1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-20 00:08:02 +01:00

Refactor/move features to feature oriented architecture (#4994)

This PR gathers feature related files in the same folder.
This commit is contained in:
Fredrik Strand Oseberg 2023-10-11 09:38:57 +02:00 committed by GitHub
parent a3b4e9db5f
commit bc96216daa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
51 changed files with 183 additions and 187 deletions

View File

@ -1,7 +1,7 @@
import dbInit from '../../test/e2e/helpers/database-init';
import getLogger from '../../test/fixtures/no-logger';
import FeatureStrategiesStore from './feature-strategy-store';
import FeatureToggleStore from './feature-toggle-store';
import FeatureStrategiesStore from '../features/feature-toggle/feature-toggle-strategies-store';
import FeatureToggleStore from '../features/feature-toggle/feature-toggle-store';
import StrategyStore from './strategy-store';
import { IFeatureStrategy, PartialSome } from '../types';

View File

@ -13,7 +13,7 @@ import {
} from '../types';
import { DEFAULT_ENV, ensureStringValue, mapValues } from '../util';
import EventEmitter from 'events';
import FeatureToggleStore from './feature-toggle-store';
import FeatureToggleStore from '../features/feature-toggle/feature-toggle-store';
import { Db } from './db';
import Raw = Knex.Raw;

View File

@ -1,7 +1,7 @@
import { IUnleashConfig, IUnleashStores } from '../types';
import EventStore from './event-store';
import FeatureToggleStore from './feature-toggle-store';
import FeatureToggleStore from '../features/feature-toggle/feature-toggle-store';
import FeatureTypeStore from './feature-type-store';
import StrategyStore from './strategy-store';
import ClientInstanceStore from './client-instance-store';
@ -18,7 +18,7 @@ import SessionStore from './session-store';
import { AccessStore } from './access-store';
import { ResetTokenStore } from './reset-token-store';
import UserFeedbackStore from './user-feedback-store';
import FeatureStrategyStore from './feature-strategy-store';
import FeatureStrategyStore from '../features/feature-toggle/feature-toggle-strategies-store';
import FeatureToggleClientStore from './feature-toggle-client-store';
import EnvironmentStore from './environment-store';
import FeatureTagStore from './feature-tag-store';

View File

@ -2,14 +2,14 @@ import { Db } from '../../db/db';
import { IUnleashConfig } from '../../types';
import ExportImportService from './export-import-service';
import { ImportTogglesStore } from './import-toggles-store';
import FeatureToggleStore from '../../db/feature-toggle-store';
import FeatureToggleStore from '../feature-toggle/feature-toggle-store';
import TagStore from '../../db/tag-store';
import TagTypeStore from '../../db/tag-type-store';
import ProjectStore from '../../db/project-store';
import FeatureTagStore from '../../db/feature-tag-store';
import StrategyStore from '../../db/strategy-store';
import ContextFieldStore from '../../db/context-field-store';
import FeatureStrategiesStore from '../../db/feature-strategy-store';
import FeatureStrategiesStore from '../feature-toggle/feature-toggle-strategies-store';
import {
ContextService,
EventService,
@ -27,7 +27,7 @@ import {
} from '../feature-toggle/createFeatureToggleService';
import SegmentStore from '../../db/segment-store';
import { FeatureEnvironmentStore } from '../../db/feature-environment-store';
import FakeFeatureToggleStore from '../../../test/fixtures/fake-feature-toggle-store';
import FakeFeatureToggleStore from '../feature-toggle/fakes/fake-feature-toggle-store';
import FakeTagStore from '../../../test/fixtures/fake-tag-store';
import FakeTagTypeStore from '../../../test/fixtures/fake-tag-type-store';
import FakeSegmentStore from '../../../test/fixtures/fake-segment-store';
@ -35,7 +35,7 @@ import FakeProjectStore from '../../../test/fixtures/fake-project-store';
import FakeFeatureTagStore from '../../../test/fixtures/fake-feature-tag-store';
import FakeContextFieldStore from '../../../test/fixtures/fake-context-field-store';
import FakeEventStore from '../../../test/fixtures/fake-event-store';
import FakeFeatureStrategiesStore from '../../../test/fixtures/fake-feature-strategies-store';
import FakeFeatureStrategiesStore from '../feature-toggle/fakes/fake-feature-strategies-store';
import FakeFeatureEnvironmentStore from '../../../test/fixtures/fake-feature-environment-store';
import FakeStrategiesStore from '../../../test/fixtures/fake-strategies-store';
import EventStore from '../../db/event-store';

View File

@ -9,8 +9,8 @@ import { Logger } from '../../logger';
import { IFeatureTagStore } from '../../types/stores/feature-tag-store';
import { ITagTypeStore } from '../../types/stores/tag-type-store';
import { IStrategy } from '../../types/stores/strategy-store';
import { IFeatureToggleStore } from '../../types/stores/feature-toggle-store';
import { IFeatureStrategiesStore } from '../../types/stores/feature-strategies-store';
import { IFeatureToggleStore } from '../feature-toggle/types/feature-toggle-store-type';
import { IFeatureStrategiesStore } from '../feature-toggle/types/feature-toggle-strategies-store-type';
import { IFeatureEnvironmentStore } from '../../types/stores/feature-environment-store';
import { IContextFieldStore, IUnleashStores } from '../../types/stores';
import { ISegmentStore } from '../../types/stores/segment-store';
@ -48,7 +48,7 @@ import {
import { ImportPermissionsService, Mode } from './import-permissions-service';
import { ImportValidationMessages } from './import-validation-messages';
import { findDuplicates } from '../../util/findDuplicates';
import { FeatureNameCheckResultWithFeaturePattern } from '../../services/feature-toggle-service';
import { FeatureNameCheckResultWithFeaturePattern } from '../feature-toggle/feature-toggle-service';
export default class ExportImportService {
private logger: Logger;

View File

@ -3,7 +3,7 @@ import {
ImportTogglesValidateItemSchema,
} from '../../openapi';
import { IContextFieldDto } from '../../types/stores/context-field-store';
import { FeatureNameCheckResultWithFeaturePattern } from '../../services/feature-toggle-service';
import { FeatureNameCheckResultWithFeaturePattern } from '../feature-toggle/feature-toggle-service';
import { ProjectFeaturesLimit } from './import-toggles-store-type';
export interface IErrorsParams {

View File

@ -4,8 +4,8 @@ import {
FeatureToggleService,
GroupService,
} from '../../services';
import FeatureStrategiesStore from '../../db/feature-strategy-store';
import FeatureToggleStore from '../../db/feature-toggle-store';
import FeatureStrategiesStore from './feature-toggle-strategies-store';
import FeatureToggleStore from './feature-toggle-store';
import FeatureToggleClientStore from '../../db/feature-toggle-client-store';
import ProjectStore from '../../db/project-store';
import { FeatureEnvironmentStore } from '../../db/feature-environment-store';
@ -18,8 +18,8 @@ import EnvironmentStore from '../../db/environment-store';
import { Db } from '../../db/db';
import { IUnleashConfig } from '../../types';
import FakeEventStore from '../../../test/fixtures/fake-event-store';
import FakeFeatureStrategiesStore from '../../../test/fixtures/fake-feature-strategies-store';
import FakeFeatureToggleStore from '../../../test/fixtures/fake-feature-toggle-store';
import FakeFeatureStrategiesStore from './fakes/fake-feature-strategies-store';
import FakeFeatureToggleStore from './fakes/fake-feature-toggle-store';
import FakeFeatureToggleClientStore from '../../../test/fixtures/fake-feature-toggle-client-store';
import FakeProjectStore from '../../../test/fixtures/fake-project-store';
import FakeFeatureEnvironmentStore from '../../../test/fixtures/fake-feature-environment-store';

View File

@ -6,10 +6,10 @@ import {
IFeatureToggleQuery,
IFeatureStrategy,
FeatureToggle,
} from '../../lib/types/model';
import NotFoundError from '../../lib/error/notfound-error';
import { IFeatureStrategiesStore } from '../../lib/types/stores/feature-strategies-store';
import { IFeatureProjectUserParams } from '../../lib/routes/admin-api/project/project-features';
} from '../../../types/model';
import NotFoundError from '../../../error/notfound-error';
import { IFeatureStrategiesStore } from '../types/feature-toggle-strategies-store-type';
import { IFeatureProjectUserParams } from '../feature-toggle-controller';
interface ProjectEnvironment {
projectName: string;

View File

@ -1,16 +1,16 @@
import {
IFeatureToggleQuery,
IFeatureToggleStore,
} from '../../lib/types/stores/feature-toggle-store';
import NotFoundError from '../../lib/error/notfound-error';
} from '../types/feature-toggle-store-type';
import NotFoundError from '../../../error/notfound-error';
import {
FeatureToggle,
FeatureToggleDTO,
IFeatureEnvironment,
IVariant,
} from 'lib/types/model';
import { LastSeenInput } from '../../lib/services/client-metrics/last-seen/last-seen-service';
import { EnvironmentFeatureNames } from '../../lib/db/feature-toggle-store';
import { LastSeenInput } from '../../../services/client-metrics/last-seen/last-seen-service';
import { EnvironmentFeatureNames } from '../feature-toggle-store';
export default class FakeFeatureToggleStore implements IFeatureToggleStore {
features: FeatureToggle[] = [];

View File

@ -1,6 +1,6 @@
import { Request, Response } from 'express';
import { applyPatch, Operation } from 'fast-json-patch';
import Controller from '../../controller';
import Controller from '../../routes/controller';
import {
CREATE_FEATURE,
CREATE_FEATURE_STRATEGY,
@ -14,10 +14,10 @@ import {
UPDATE_FEATURE,
UPDATE_FEATURE_ENVIRONMENT,
UPDATE_FEATURE_STRATEGY,
} from '../../../types';
import { Logger } from '../../../logger';
import { extractUsername } from '../../../util';
import { IAuthRequest } from '../../unleash-types';
} from '../../types';
import { Logger } from '../../logger';
import { extractUsername } from '../../util';
import { IAuthRequest } from '../../routes/unleash-types';
import {
AdminFeaturesQuerySchema,
BulkToggleFeaturesSchema,
@ -40,19 +40,16 @@ import {
TagSchema,
UpdateFeatureSchema,
UpdateFeatureStrategySchema,
} from '../../../openapi';
} from '../../openapi';
import {
FeatureTagService,
FeatureToggleService,
OpenApiService,
} from '../../../services';
import { querySchema } from '../../../schema/feature-schema';
import { BatchStaleSchema } from '../../../openapi/spec/batch-stale-schema';
import {
TransactionCreator,
UnleashTransaction,
} from '../../../db/transaction';
import { BadDataError } from '../../../error';
} from '../../services';
import { querySchema } from '../../schema/feature-schema';
import { BatchStaleSchema } from '../../openapi/spec/batch-stale-schema';
import { TransactionCreator, UnleashTransaction } from '../../db/transaction';
import { BadDataError } from '../../error';
interface FeatureStrategyParams {
projectId: string;

View File

@ -45,36 +45,36 @@ import {
StrategyIds,
Unsaved,
WeightType,
} from '../types';
import { Logger } from '../logger';
} from '../../types';
import { Logger } from '../../logger';
import {
ForbiddenError,
FOREIGN_KEY_VIOLATION,
OperationDeniedError,
PatternError,
PermissionError,
} from '../error';
import BadDataError from '../error/bad-data-error';
import NameExistsError from '../error/name-exists-error';
import InvalidOperationError from '../error/invalid-operation-error';
} from '../../error';
import BadDataError from '../../error/bad-data-error';
import NameExistsError from '../../error/name-exists-error';
import InvalidOperationError from '../../error/invalid-operation-error';
import {
constraintSchema,
featureMetadataSchema,
nameSchema,
variantsArraySchema,
} from '../schema/feature-schema';
import NotFoundError from '../error/notfound-error';
} from '../../schema/feature-schema';
import NotFoundError from '../../error/notfound-error';
import {
FeatureConfigurationClient,
IFeatureStrategiesStore,
} from '../types/stores/feature-strategies-store';
} from './types/feature-toggle-strategies-store-type';
import {
DATE_OPERATORS,
DEFAULT_ENV,
NUM_OPERATORS,
SEMVER_OPERATORS,
STRING_OPERATORS,
} from '../util';
} from '../../util';
import { applyPatch, deepClone, Operation } from 'fast-json-patch';
import {
validateDate,
@ -82,24 +82,24 @@ import {
validateNumber,
validateSemver,
validateString,
} from '../util/validators/constraint-types';
} from '../../util/validators/constraint-types';
import { IContextFieldStore } from 'lib/types/stores/context-field-store';
import { SetStrategySortOrderSchema } from 'lib/openapi/spec/set-strategy-sort-order-schema';
import {
getDefaultStrategy,
getProjectDefaultStrategy,
} from '../features/playground/feature-evaluator/helpers';
import { AccessService } from './access-service';
import { User } from '../server-impl';
import { IFeatureProjectUserParams } from '../routes/admin-api/project/project-features';
import { unique } from '../util/unique';
} from '../playground/feature-evaluator/helpers';
import { AccessService } from '../../services/access-service';
import { User } from '../../server-impl';
import { IFeatureProjectUserParams } from './feature-toggle-controller';
import { unique } from '../../util/unique';
import { ISegmentService } from 'lib/segments/segment-service-interface';
import { IChangeRequestAccessReadModel } from '../features/change-request-access-service/change-request-access-read-model';
import { checkFeatureFlagNamesAgainstPattern } from '../features/feature-naming-pattern/feature-naming-validation';
import { IPrivateProjectChecker } from '../features/private-project/privateProjectCheckerType';
import { IDependentFeaturesReadModel } from '../features/dependent-features/dependent-features-read-model-type';
import EventService from './event-service';
import { DependentFeaturesService } from '../features/dependent-features/dependent-features-service';
import { IChangeRequestAccessReadModel } from '../change-request-access-service/change-request-access-read-model';
import { checkFeatureFlagNamesAgainstPattern } from '../feature-naming-pattern/feature-naming-validation';
import { IPrivateProjectChecker } from '../private-project/privateProjectCheckerType';
import { IDependentFeaturesReadModel } from '../dependent-features/dependent-features-read-model-type';
import EventService from '../../services/event-service';
import { DependentFeaturesService } from '../dependent-features/dependent-features-service';
interface IFeatureContext {
featureName: string;

View File

@ -1,14 +1,14 @@
import { Knex } from 'knex';
import EventEmitter from 'events';
import metricsHelper from '../util/metrics-helper';
import { DB_TIME } from '../metric-events';
import NotFoundError from '../error/notfound-error';
import { Logger, LogProvider } from '../logger';
import { FeatureToggle, FeatureToggleDTO, IVariant } from '../types/model';
import { IFeatureToggleStore } from '../types/stores/feature-toggle-store';
import { Db } from './db';
import { LastSeenInput } from '../services/client-metrics/last-seen/last-seen-service';
import { NameExistsError } from '../error';
import metricsHelper from '../../util/metrics-helper';
import { DB_TIME } from '../../metric-events';
import NotFoundError from '../../error/notfound-error';
import { Logger, LogProvider } from '../../logger';
import { FeatureToggle, FeatureToggleDTO, IVariant } from '../../types/model';
import { IFeatureToggleStore } from './types/feature-toggle-store-type';
import { Db } from '../../db/db';
import { LastSeenInput } from '../../services/client-metrics/last-seen/last-seen-service';
import { NameExistsError } from '../../error';
export type EnvironmentFeatureNames = { [key: string]: string[] };

View File

@ -1,10 +1,10 @@
import { Knex } from 'knex';
import EventEmitter from 'events';
import { v4 as uuidv4 } from 'uuid';
import metricsHelper from '../util/metrics-helper';
import { DB_TIME } from '../metric-events';
import { Logger, LogProvider } from '../logger';
import NotFoundError from '../error/notfound-error';
import metricsHelper from '../../util/metrics-helper';
import { DB_TIME } from '../../metric-events';
import { Logger, LogProvider } from '../../logger';
import NotFoundError from '../../error/notfound-error';
import {
FeatureToggleWithEnvironment,
IConstraint,
@ -19,11 +19,11 @@ import {
ITag,
PartialDeep,
PartialSome,
} from '../types';
} from '../../types';
import FeatureToggleStore from './feature-toggle-store';
import { ensureStringValue, mapValues } from '../util';
import { IFeatureProjectUserParams } from '../routes/admin-api/project/project-features';
import { Db } from './db';
import { ensureStringValue, mapValues } from '../../util';
import { IFeatureProjectUserParams } from './feature-toggle-controller';
import { Db } from '../../db/db';
import Raw = Knex.Raw;
const COLUMNS = [

View File

@ -1,35 +1,35 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { Request, Response } from 'express';
import Controller from '../controller';
import { extractUsername } from '../../util/extract-user';
import { NONE, UPDATE_FEATURE } from '../../types/permissions';
import { IUnleashConfig } from '../../types/option';
import { IUnleashServices } from '../../types';
import FeatureToggleService from '../../services/feature-toggle-service';
import { featureSchema, querySchema } from '../../schema/feature-schema';
import { IFeatureToggleQuery } from '../../types/model';
import FeatureTagService from '../../services/feature-tag-service';
import { IAuthRequest } from '../unleash-types';
import { DEFAULT_ENV } from '../../util/constants';
import Controller from '../../../routes/controller';
import { extractUsername } from '../../../util/extract-user';
import { NONE, UPDATE_FEATURE } from '../../../types/permissions';
import { IUnleashConfig } from '../../../types/option';
import { IUnleashServices } from '../../../types';
import FeatureToggleService from '../feature-toggle-service';
import { featureSchema, querySchema } from '../../../schema/feature-schema';
import { IFeatureToggleQuery } from '../../../types/model';
import FeatureTagService from '../../../services/feature-tag-service';
import { IAuthRequest } from '../../../routes/unleash-types';
import { DEFAULT_ENV } from '../../../util/constants';
import {
featuresSchema,
FeaturesSchema,
} from '../../openapi/spec/features-schema';
import { TagSchema } from '../../openapi/spec/tag-schema';
import { TagsSchema } from '../../openapi/spec/tags-schema';
import { serializeDates } from '../../types/serialize-dates';
import { OpenApiService } from '../../services/openapi-service';
import { createRequestSchema } from '../../openapi/util/create-request-schema';
} from '../../../openapi/spec/features-schema';
import { TagSchema } from '../../../openapi/spec/tag-schema';
import { TagsSchema } from '../../../openapi/spec/tags-schema';
import { serializeDates } from '../../../types/serialize-dates';
import { OpenApiService } from '../../../services/openapi-service';
import { createRequestSchema } from '../../../openapi/util/create-request-schema';
import {
createResponseSchema,
resourceCreatedResponseSchema,
} from '../../openapi/util/create-response-schema';
} from '../../../openapi/util/create-response-schema';
import {
emptyResponse,
getStandardResponses,
} from '../../openapi/util/standard-responses';
import { UpdateTagsSchema } from '../../openapi/spec/update-tags-schema';
import { ValidateFeatureSchema } from '../../openapi/spec/validate-feature-schema';
} from '../../../openapi/util/standard-responses';
import { UpdateTagsSchema } from '../../../openapi/spec/update-tags-schema';
import { ValidateFeatureSchema } from '../../../openapi/spec/validate-feature-schema';
const version = 1;

View File

@ -1,30 +1,23 @@
import FeatureToggleService from '../../../lib/services/feature-toggle-service';
import { createTestConfig } from '../../config/test-config';
import dbInit from '../helpers/database-init';
import { DEFAULT_ENV } from '../../../lib/util';
import { FeatureStrategySchema } from '../../../lib/openapi';
import User from '../../../lib/types/user';
import FeatureToggleService from '../feature-toggle-service';
import { createTestConfig } from '../../../../test/config/test-config';
import dbInit from '../../../../test/e2e/helpers/database-init';
import { DEFAULT_ENV } from '../../../util';
import { FeatureStrategySchema } from '../../../openapi';
import User from '../../../types/user';
import {
IConstraint,
IUnleashStores,
IVariant,
SKIP_CHANGE_REQUEST,
} from '../../../lib/types';
import EnvironmentService from '../../../lib/services/environment-service';
import {
ForbiddenError,
PatternError,
PermissionError,
} from '../../../lib/error';
import { ISegmentService } from '../../../lib/segments/segment-service-interface';
import {
createFeatureToggleService,
createSegmentService,
} from '../../../lib/features';
} from '../../../types';
import EnvironmentService from '../../../services/environment-service';
import { ForbiddenError, PatternError, PermissionError } from '../../../error';
import { ISegmentService } from '../../../segments/segment-service-interface';
import { createFeatureToggleService, createSegmentService } from '../..';
import {
insertFeatureEnvironmentsLastSeen,
insertLastSeenAt,
} from '../api/admin/project/projects.e2e.test';
} from '../../../../test/e2e/api/admin/project/projects.e2e.test';
let stores: IUnleashStores;
let db;

View File

@ -1,6 +1,6 @@
import dbInit from '../helpers/database-init';
import getLogger from '../../fixtures/no-logger';
import { FeatureToggleDTO, IFeatureToggleStore } from '../../../lib/types';
import dbInit from '../../../../test/e2e/helpers/database-init';
import getLogger from '../../../../test/fixtures/no-logger';
import { FeatureToggleDTO, IFeatureToggleStore } from '../../../types';
let stores;
let db;

View File

@ -1,7 +1,7 @@
import { IFeatureStrategiesStore } from 'lib/types/stores/feature-strategies-store';
import { IFeatureToggleStore } from 'lib/types/stores/feature-toggle-store';
import dbInit from '../helpers/database-init';
import getLogger from '../../fixtures/no-logger';
import { IFeatureStrategiesStore } from 'lib/features/feature-toggle/types/feature-toggle-strategies-store-type';
import { IFeatureToggleStore } from 'lib/features/feature-toggle/types/feature-toggle-store-type';
import dbInit from '../../../../test/e2e/helpers/database-init';
import getLogger from '../../../../test/fixtures/no-logger';
let stores;
let db;

View File

@ -1,8 +1,11 @@
import dbInit, { ITestDb } from '../../../helpers/database-init';
import { IUnleashTest, setupAppWithAuth } from '../../../helpers/test-helper';
import getLogger from '../../../../fixtures/no-logger';
import { DEFAULT_ENV } from '../../../../../lib/util';
import { RoleName, CREATE_FEATURE_STRATEGY } from '../../../../../lib/types';
import dbInit, { ITestDb } from '../../../../test/e2e/helpers/database-init';
import {
IUnleashTest,
setupAppWithAuth,
} from '../../../../test/e2e/helpers/test-helper';
import getLogger from '../../../../test/fixtures/no-logger';
import { DEFAULT_ENV } from '../../../util';
import { RoleName, CREATE_FEATURE_STRATEGY } from '../../../types';
let app: IUnleashTest;
let db: ITestDb;

View File

@ -1,10 +1,10 @@
import dbInit, { ITestDb } from '../../../helpers/database-init';
import dbInit, { ITestDb } from '../../../../test/e2e/helpers/database-init';
import {
IUnleashTest,
setupAppWithCustomConfig,
} from '../../../helpers/test-helper';
import getLogger from '../../../../fixtures/no-logger';
import { DEFAULT_ENV } from '../../../../../lib/util/constants';
} from '../../../../test/e2e/helpers/test-helper';
import getLogger from '../../../../test/fixtures/no-logger';
import { DEFAULT_ENV } from '../../../util/constants';
import {
FEATURE_ENVIRONMENT_DISABLED,
FEATURE_ENVIRONMENT_ENABLED,
@ -12,22 +12,22 @@ import {
FEATURE_STALE_OFF,
FEATURE_STALE_ON,
FEATURE_STRATEGY_REMOVE,
} from '../../../../../lib/types/events';
import ApiUser from '../../../../../lib/types/api-user';
import { ApiTokenType } from '../../../../../lib/types/models/api-token';
import IncompatibleProjectError from '../../../../../lib/error/incompatible-project-error';
} from '../../../types/events';
import ApiUser from '../../../types/api-user';
import { ApiTokenType } from '../../../types/models/api-token';
import IncompatibleProjectError from '../../../error/incompatible-project-error';
import {
IStrategyConfig,
IVariant,
RoleName,
WeightType,
} from '../../../../../lib/types/model';
} from '../../../types/model';
import { v4 as uuidv4 } from 'uuid';
import supertest from 'supertest';
import { randomId } from '../../../../../lib/util/random-id';
import { DEFAULT_PROJECT } from '../../../../../lib/types';
import { randomId } from '../../../util/random-id';
import { DEFAULT_PROJECT } from '../../../types';
import { FeatureStrategySchema, SetStrategySortOrderSchema } from 'lib/openapi';
import { ForbiddenError } from '../../../../../lib/error';
import { ForbiddenError } from '../../../error';
let app: IUnleashTest;
let db: ITestDb;

View File

@ -1,6 +1,10 @@
import { FeatureToggle, FeatureToggleDTO, IVariant } from '../model';
import { Store } from './store';
import { LastSeenInput } from '../../services/client-metrics/last-seen/last-seen-service';
import {
FeatureToggle,
FeatureToggleDTO,
IVariant,
} from '../../../types/model';
import { Store } from '../../../types/stores/store';
import { LastSeenInput } from '../../../services/client-metrics/last-seen/last-seen-service';
export interface IFeatureToggleQuery {
archived: boolean;

View File

@ -5,9 +5,9 @@ import {
IFeatureStrategy,
IStrategyConfig,
IVariant,
} from '../model';
import { Store } from './store';
import { IFeatureProjectUserParams } from '../../routes/admin-api/project/project-features';
} from '../../../types/model';
import { Store } from '../../../types/stores/store';
import { IFeatureProjectUserParams } from '../feature-toggle-controller';
export interface FeatureConfigurationClient {
name: string;

View File

@ -8,7 +8,7 @@ import {
} from '../../types/stores';
import { IContextFieldStore } from '../../types/stores/context-field-store';
import { IEnvironmentStore } from '../../types/stores/environment-store';
import { IFeatureToggleStore } from '../../types/stores/feature-toggle-store';
import { IFeatureToggleStore } from '../feature-toggle/types/feature-toggle-store-type';
import { IGroupStore } from '../../types/stores/group-store';
import { IProjectStore } from '../../types/stores/project-store';
import { IStrategyStore } from '../../types/stores/strategy-store';

View File

@ -1,6 +1,6 @@
import { SdkContextSchema } from 'lib/openapi/spec/sdk-context-schema';
import { InMemStorageProvider, FeatureEvaluator } from './feature-evaluator';
import { FeatureConfigurationClient } from 'lib/types/stores/feature-strategies-store';
import { FeatureConfigurationClient } from 'lib/features/feature-toggle/types/feature-toggle-strategies-store-type';
import { Segment } from './feature-evaluator/strategy/strategy';
import { ISegment } from 'lib/types/model';
import { serializeDates } from '../../types/serialize-dates';

View File

@ -1,4 +1,4 @@
import FeatureToggleService from '../../services/feature-toggle-service';
import FeatureToggleService from '../feature-toggle/feature-toggle-service';
import { SdkContextSchema } from 'lib/openapi/spec/sdk-context-schema';
import { IUnleashServices } from 'lib/types/services';
import { ALL } from '../../types/models/api-token';
@ -12,7 +12,7 @@ import {
FeatureStrategiesEvaluationResult,
} from 'lib/features/playground/feature-evaluator/client';
import { ISegmentService } from 'lib/segments/segment-service-interface';
import { FeatureConfigurationClient } from '../../types/stores/feature-strategies-store';
import { FeatureConfigurationClient } from '../feature-toggle/types/feature-toggle-strategies-store-type';
import { generateObjectCombinations } from './generateObjectCombinations';
import groupBy from 'lodash.groupby';
import { omitKeys } from '../../util';

View File

@ -13,7 +13,7 @@ import {
import FakeGroupStore from '../../../test/fixtures/fake-group-store';
import FakeEventStore from '../../../test/fixtures/fake-event-store';
import ProjectStore from '../../db/project-store';
import FeatureToggleStore from '../../db/feature-toggle-store';
import FeatureToggleStore from '../feature-toggle/feature-toggle-store';
import FeatureTypeStore from '../../db/feature-type-store';
import { FeatureEnvironmentStore } from '../../db/feature-environment-store';
import ProjectStatsStore from '../../db/project-stats-store';
@ -28,7 +28,7 @@ import {
import { FavoriteFeaturesStore } from '../../db/favorite-features-store';
import { FavoriteProjectsStore } from '../../db/favorite-projects-store';
import FakeProjectStore from '../../../test/fixtures/fake-project-store';
import FakeFeatureToggleStore from '../../../test/fixtures/fake-feature-toggle-store';
import FakeFeatureToggleStore from '../feature-toggle/fakes/fake-feature-toggle-store';
import FakeFeatureTypeStore from '../../../test/fixtures/fake-feature-type-store';
import FakeEnvironmentStore from '../../../test/fixtures/fake-environment-store';
import FakeFeatureEnvironmentStore from '../../../test/fixtures/fake-feature-environment-store';

View File

@ -3,10 +3,10 @@ import EventStore from '../../db/event-store';
import { EventService, SegmentService } from '../../services';
import FakeEventStore from '../../../test/fixtures/fake-event-store';
import { ISegmentService } from '../../segments/segment-service-interface';
import FeatureStrategiesStore from '../../db/feature-strategy-store';
import FeatureStrategiesStore from '../feature-toggle/feature-toggle-strategies-store';
import SegmentStore from '../../db/segment-store';
import FakeSegmentStore from '../../../test/fixtures/fake-segment-store';
import FakeFeatureStrategiesStore from '../../../test/fixtures/fake-feature-strategies-store';
import FakeFeatureStrategiesStore from '../feature-toggle/fakes/fake-feature-strategies-store';
import {
createChangeRequestAccessReadModel,
createFakeChangeRequestAccessService,

View File

@ -4,8 +4,8 @@ import * as perms from '../types/permissions';
import { IUnleashConfig } from '../types/option';
import { createTestConfig } from '../../test/config/test-config';
import ApiUser from '../types/api-user';
import { IFeatureToggleStore } from '../types/stores/feature-toggle-store';
import FakeFeatureToggleStore from '../../test/fixtures/fake-feature-toggle-store';
import { IFeatureToggleStore } from '../features/feature-toggle/types/feature-toggle-store-type';
import FakeFeatureToggleStore from '../features/feature-toggle/fakes/fake-feature-toggle-store';
import { ApiTokenType } from '../types/models/api-token';
let config: IUnleashConfig;

View File

@ -4,7 +4,7 @@ import { IUnleashServices } from '../../types';
import Controller from '../controller';
import { extractUsername } from '../../util/extract-user';
import { DELETE_FEATURE, NONE, UPDATE_FEATURE } from '../../types/permissions';
import FeatureToggleService from '../../services/feature-toggle-service';
import FeatureToggleService from '../../features/feature-toggle/feature-toggle-service';
import { IAuthRequest } from '../unleash-types';
import {
featuresSchema,

View File

@ -1,5 +1,5 @@
import { Request, Response } from 'express';
import FeatureToggleService from '../../services/feature-toggle-service';
import FeatureToggleService from '../../features/feature-toggle/feature-toggle-service';
import { IUnleashConfig } from '../../types/option';
import { IUnleashServices } from '../../types';
import { NONE } from '../../types/permissions';

View File

@ -1,6 +1,6 @@
import Controller from '../controller';
import { IUnleashServices, IUnleashConfig } from '../../types';
import FeatureController from './feature';
import FeatureController from '../../features/feature-toggle/legacy/feature-toggle-legacy-controller';
import { FeatureTypeController } from './feature-type';
import ArchiveController from './archive';
import StrategyController from './strategy';

View File

@ -151,7 +151,6 @@ export class ProjectApiTokenController extends Controller {
const { projectId } = req.params;
const project = await this.projectService.getProject(projectId); // Validates that the project exists
console.log('project', project);
const projectTokens = await this.accessibleTokens(user, projectId);
this.openApiService.respondWithValidation(
200,

View File

@ -8,7 +8,7 @@ import {
NONE,
serializeDates,
} from '../../../types';
import ProjectFeaturesController from './project-features';
import ProjectFeaturesController from '../../../features/feature-toggle/feature-toggle-controller';
import EnvironmentsController from './environments';
import ProjectHealthReport from './health-report';
import ProjectService from '../../../services/project-service';

View File

@ -9,7 +9,7 @@ import {
import { Logger } from '../../../logger';
import { extractUsername } from '../../../util/extract-user';
import { DELETE_FEATURE } from '../../../types/permissions';
import FeatureToggleService from '../../../services/feature-toggle-service';
import FeatureToggleService from '../../../features/feature-toggle/feature-toggle-service';
import { IAuthRequest } from '../../unleash-types';
import { OpenApiService } from '../../../services/openapi-service';
import {

View File

@ -1,4 +1,4 @@
import FeatureToggleService from '../../../services/feature-toggle-service';
import FeatureToggleService from '../../../features/feature-toggle/feature-toggle-service';
import { Logger } from '../../../logger';
import Controller from '../../controller';
import { IUnleashConfig } from '../../../types/option';

View File

@ -4,7 +4,7 @@ import { Response } from 'express';
import hashSum from 'hash-sum';
import Controller from '../controller';
import { IClientSegment, IUnleashConfig, IUnleashServices } from '../../types';
import FeatureToggleService from '../../services/feature-toggle-service';
import FeatureToggleService from '../../features/feature-toggle/feature-toggle-service';
import { Logger } from '../../logger';
import { querySchema } from '../../schema/feature-schema';
import { IFeatureToggleQuery } from '../../types/model';
@ -12,7 +12,7 @@ import NotFoundError from '../../error/notfound-error';
import { IAuthRequest } from '../unleash-types';
import ApiUser from '../../types/api-user';
import { ALL, isAllProjects } from '../../types/models/api-token';
import { FeatureConfigurationClient } from '../../types/stores/feature-strategies-store';
import { FeatureConfigurationClient } from '../../features/feature-toggle/types/feature-toggle-strategies-store-type';
import { ClientSpecService } from '../../services/client-spec-service';
import { OpenApiService } from '../../services/openapi-service';
import { NONE } from '../../types/permissions';

View File

@ -4,7 +4,7 @@ import { getAddons, IAddonProviders } from '../addons';
import * as events from '../types/events';
import { addonSchema } from './addon-schema';
import NameExistsError from '../error/name-exists-error';
import { IFeatureToggleStore } from '../types/stores/feature-toggle-store';
import { IFeatureToggleStore } from '../features/feature-toggle/types/feature-toggle-store-type';
import { Logger } from '../logger';
import TagTypeService from './tag-type-service';
import { IAddon, IAddonDto, IAddonStore } from '../types/stores/addon-store';

View File

@ -7,7 +7,7 @@ import {
IClientApplication,
IClientApplicationsStore,
} from '../../types/stores/client-applications-store';
import { IFeatureToggleStore } from '../../types/stores/feature-toggle-store';
import { IFeatureToggleStore } from '../../features/feature-toggle/types/feature-toggle-store-type';
import { IStrategyStore } from '../../types/stores/strategy-store';
import { IClientInstanceStore } from '../../types/stores/client-instance-store';
import { IApplicationQuery } from '../../types/query';

View File

@ -1,5 +1,5 @@
import FakeFeatureToggleStore from '../../../../test/fixtures/fake-feature-toggle-store';
import FeatureToggleStore from '../../../db/feature-toggle-store';
import FakeFeatureToggleStore from '../../../features/feature-toggle/fakes/fake-feature-toggle-store';
import FeatureToggleStore from '../../../features/feature-toggle/feature-toggle-store';
import { Db, IUnleashConfig } from '../../../server-impl';
import { FakeLastSeenStore } from './fake-last-seen-store';
import { LastSeenService } from './last-seen-service';

View File

@ -5,7 +5,7 @@ import {
IUnleashStores,
} from '../types';
import { createTestConfig } from '../../test/config/test-config';
import FeatureToggleService from './feature-toggle-service';
import FeatureToggleService from '../features/feature-toggle/feature-toggle-service';
import { AccessService } from './access-service';
import { IChangeRequestAccessReadModel } from 'lib/features/change-request-access-service/change-request-access-read-model';
import { ISegmentService } from 'lib/segments/segment-service-interface';

View File

@ -21,7 +21,7 @@ import ResetTokenService from './reset-token-service';
import SettingService from './setting-service';
import SessionService from './session-service';
import UserFeedbackService from './user-feedback-service';
import FeatureToggleService from './feature-toggle-service';
import FeatureToggleService from '../features/feature-toggle/feature-toggle-service';
import EnvironmentService from './environment-service';
import FeatureTagService from './feature-tag-service';
import ProjectHealthService from './project-health-service';

View File

@ -2,7 +2,7 @@ import { IUnleashStores } from '../types/stores';
import { IUnleashConfig } from '../types/option';
import { Logger } from '../logger';
import type { IProject, IProjectHealthReport } from '../types/model';
import type { IFeatureToggleStore } from '../types/stores/feature-toggle-store';
import type { IFeatureToggleStore } from '../features/feature-toggle/types/feature-toggle-store-type';
import type { IFeatureTypeStore } from '../types/stores/feature-type-store';
import type { IProjectStore } from '../types/stores/project-store';
import ProjectService from './project-service';

View File

@ -50,7 +50,7 @@ import {
IProjectAccessModel,
IRoleDescriptor,
} from '../types/stores/access-store';
import FeatureToggleService from './feature-toggle-service';
import FeatureToggleService from '../features/feature-toggle/feature-toggle-service';
import IncompatibleProjectError from '../error/incompatible-project-error';
import ProjectWithoutOwnerError from '../error/project-without-owner-error';
import { arraysHaveSameItems } from '../util';

View File

@ -16,7 +16,7 @@ import {
SEGMENT_UPDATED,
} from '../types/events';
import User from '../types/user';
import { IFeatureStrategiesStore } from '../types/stores/feature-strategies-store';
import { IFeatureStrategiesStore } from '../features/feature-toggle/types/feature-toggle-strategies-store-type';
import BadDataError from '../error/bad-data-error';
import { ISegmentService } from '../segments/segment-service-interface';
import { PermissionError } from '../error';

View File

@ -40,8 +40,8 @@ import { IProjectStore } from '../types/stores/project-store';
import { ITagType, ITagTypeStore } from '../types/stores/tag-type-store';
import { ITagStore } from '../types/stores/tag-store';
import { IStrategy, IStrategyStore } from '../types/stores/strategy-store';
import { IFeatureToggleStore } from '../types/stores/feature-toggle-store';
import { IFeatureStrategiesStore } from '../types/stores/feature-strategies-store';
import { IFeatureToggleStore } from '../features/feature-toggle/types/feature-toggle-store-type';
import { IFeatureStrategiesStore } from '../features/feature-toggle/types/feature-toggle-strategies-store-type';
import { IEnvironmentStore } from '../types/stores/environment-store';
import { IFeatureEnvironmentStore } from '../types/stores/feature-environment-store';
import { IUnleashStores } from '../types/stores';

View File

@ -18,7 +18,7 @@ import HealthService from '../services/health-service';
import SettingService from '../services/setting-service';
import SessionService from '../services/session-service';
import UserFeedbackService from '../services/user-feedback-service';
import FeatureToggleService from '../services/feature-toggle-service';
import FeatureToggleService from '../features/feature-toggle/feature-toggle-service';
import EnvironmentService from '../services/environment-service';
import FeatureTagService from '../services/feature-tag-service';
import ProjectHealthService from '../services/project-health-service';

View File

@ -4,7 +4,7 @@ import { IFeatureTypeStore } from './stores/feature-type-store';
import { IStrategyStore } from './stores/strategy-store';
import { IClientApplicationsStore } from './stores/client-applications-store';
import { IClientInstanceStore } from './stores/client-instance-store';
import { IFeatureToggleStore } from './stores/feature-toggle-store';
import { IFeatureToggleStore } from '../features/feature-toggle/types/feature-toggle-store-type';
import { IContextFieldStore } from './stores/context-field-store';
import { ISettingStore } from './stores/settings-store';
import { ISessionStore } from './stores/session-store';
@ -18,7 +18,7 @@ import { IApiTokenStore } from './stores/api-token-store';
import { IResetTokenStore } from './stores/reset-token-store';
import { IUserFeedbackStore } from './stores/user-feedback-store';
import { IFeatureEnvironmentStore } from './stores/feature-environment-store';
import { IFeatureStrategiesStore } from './stores/feature-strategies-store';
import { IFeatureStrategiesStore } from '../features/feature-toggle/types/feature-toggle-strategies-store-type';
import { IEnvironmentStore } from './stores/environment-store';
import { IFeatureToggleClientStore } from './stores/feature-toggle-client-store';
import { IClientMetricsStoreV2 } from './stores/client-metrics-store-v2';

View File

@ -11,7 +11,7 @@ import fc from 'fast-check';
import { createTestConfig } from '../../config/test-config';
import dbInit, { ITestDb } from '../helpers/database-init';
import { IUnleashStores } from '../../../lib/types/stores';
import FeatureToggleService from '../../../lib/services/feature-toggle-service';
import FeatureToggleService from '../../../lib/features/feature-toggle/feature-toggle-service';
import { FeatureToggle, ISegment, WeightType } from '../../../lib/types/model';
import { PlaygroundFeatureSchema } from '../../../lib/openapi/spec/playground-feature-schema';
import { offlineUnleashClientNode } from '../../../lib/features/playground/offline-unleash-client.test';

View File

@ -1,6 +1,6 @@
import dbInit, { ITestDb } from '../helpers/database-init';
import getLogger from '../../fixtures/no-logger';
import FeatureToggleService from '../../../lib/services/feature-toggle-service';
import FeatureToggleService from '../../../lib/features/feature-toggle/feature-toggle-service';
import ProjectService from '../../../lib/services/project-service';
import { AccessService } from '../../../lib/services/access-service';
import { MOVE_FEATURE_TOGGLE } from '../../../lib/types/permissions';

View File

@ -2,7 +2,7 @@ import { IUnleashStores } from '../../../lib/types';
import dbInit from '../helpers/database-init';
import getLogger from '../../fixtures/no-logger';
import { IFeatureEnvironmentStore } from '../../../lib/types/stores/feature-environment-store';
import { IFeatureToggleStore } from '../../../lib/types/stores/feature-toggle-store';
import { IFeatureToggleStore } from '../../../lib/features/feature-toggle/types/feature-toggle-store-type';
import { IEnvironmentStore } from '../../../lib/types/stores/environment-store';
let db;

View File

@ -1,5 +1,5 @@
import { IFeatureTagStore } from 'lib/types/stores/feature-tag-store';
import { IFeatureToggleStore } from 'lib/types/stores/feature-toggle-store';
import { IFeatureToggleStore } from 'lib/features/feature-toggle/types/feature-toggle-store-type';
import dbInit from '../helpers/database-init';
import getLogger from '../../fixtures/no-logger';
import NotFoundError from '../../../lib/error/notfound-error';

View File

@ -1,7 +1,7 @@
import FakeFeatureStrategiesStore from './fake-feature-strategies-store';
import FakeFeatureStrategiesStore from '../../lib/features/feature-toggle/fakes/fake-feature-strategies-store';
import FakeClientInstanceStore from './fake-client-instance-store';
import FakeClientApplicationsStore from './fake-client-applications-store';
import FakeFeatureToggleStore from './fake-feature-toggle-store';
import FakeFeatureToggleStore from '../../lib/features/feature-toggle/fakes/fake-feature-toggle-store';
import FakeTagStore from './fake-tag-store';
import FakeTagTypeStore from './fake-tag-type-store';
import FakeEventStore from './fake-event-store';