mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	feat: drop full- for import/validate (#3168)
This commit is contained in:
		
							parent
							
								
									4b21175c80
								
							
						
					
					
						commit
						3800877be1
					
				| @ -14,7 +14,7 @@ export const useImportApi = () => { | |||||||
|     const { trackEvent } = usePlausibleTracker(); |     const { trackEvent } = usePlausibleTracker(); | ||||||
| 
 | 
 | ||||||
|     const createImport = async (payload: ImportQuerySchema) => { |     const createImport = async (payload: ImportQuerySchema) => { | ||||||
|         const path = `api/admin/features-batch/full-import`; |         const path = `api/admin/features-batch/import`; | ||||||
|         const req = createRequest(path, { |         const req = createRequest(path, { | ||||||
|             method: 'POST', |             method: 'POST', | ||||||
|             body: JSON.stringify(payload), |             body: JSON.stringify(payload), | ||||||
|  | |||||||
| @ -19,7 +19,7 @@ export const useValidateImportApi = () => { | |||||||
|     const validateImport = async ( |     const validateImport = async ( | ||||||
|         payload: ImportQuerySchema |         payload: ImportQuerySchema | ||||||
|     ): Promise<IValidationSchema> => { |     ): Promise<IValidationSchema> => { | ||||||
|         const path = `api/admin/features-batch/full-validate`; |         const path = `api/admin/features-batch/validate`; | ||||||
|         const req = createRequest(path, { |         const req = createRequest(path, { | ||||||
|             method: 'POST', |             method: 'POST', | ||||||
|             body: JSON.stringify(payload), |             body: JSON.stringify(payload), | ||||||
|  | |||||||
| @ -36,7 +36,7 @@ import { FavoriteProjectsStore } from './favorite-projects-store'; | |||||||
| import { AccountStore } from './account-store'; | import { AccountStore } from './account-store'; | ||||||
| import ProjectStatsStore from './project-stats-store'; | import ProjectStatsStore from './project-stats-store'; | ||||||
| import { Db } from './db'; | import { Db } from './db'; | ||||||
| import { ImportTogglesStore } from '../export-import-toggles/import-toggles-store'; | import { ImportTogglesStore } from '../features/export-import-toggles/import-toggles-store'; | ||||||
| 
 | 
 | ||||||
| export const createStores = ( | export const createStores = ( | ||||||
|     config: IUnleashConfig, |     config: IUnleashConfig, | ||||||
|  | |||||||
| @ -1,17 +1,17 @@ | |||||||
| import { Db, IUnleashConfig } from 'lib/server-impl'; | import { Db, IUnleashConfig } from 'lib/server-impl'; | ||||||
| import EventStore from '../db/event-store'; | import EventStore from '../../db/event-store'; | ||||||
| import GroupStore from '../db/group-store'; | import GroupStore from '../../db/group-store'; | ||||||
| import { AccountStore } from '../db/account-store'; | import { AccountStore } from '../../db/account-store'; | ||||||
| import RoleStore from '../db/role-store'; | import RoleStore from '../../db/role-store'; | ||||||
| import EnvironmentStore from '../db/environment-store'; | import EnvironmentStore from '../../db/environment-store'; | ||||||
| import { AccessStore } from '../db/access-store'; | import { AccessStore } from '../../db/access-store'; | ||||||
| import { AccessService, GroupService } from '../services'; | import { AccessService, GroupService } from '../../services'; | ||||||
| import FakeEventStore from '../../test/fixtures/fake-event-store'; | import FakeGroupStore from '../../../test/fixtures/fake-group-store'; | ||||||
| import FakeGroupStore from '../../test/fixtures/fake-group-store'; | import FakeEventStore from '../../../test/fixtures/fake-event-store'; | ||||||
| import { FakeAccountStore } from '../../test/fixtures/fake-account-store'; | import { FakeAccountStore } from '../../../test/fixtures/fake-account-store'; | ||||||
| import FakeRoleStore from '../../test/fixtures/fake-role-store'; | import FakeRoleStore from '../../../test/fixtures/fake-role-store'; | ||||||
| import FakeEnvironmentStore from '../../test/fixtures/fake-environment-store'; | import FakeEnvironmentStore from '../../../test/fixtures/fake-environment-store'; | ||||||
| import FakeAccessStore from '../../test/fixtures/fake-access-store'; | import FakeAccessStore from '../../../test/fixtures/fake-access-store'; | ||||||
| 
 | 
 | ||||||
| export const createAccessService = ( | export const createAccessService = ( | ||||||
|     db: Db, |     db: Db, | ||||||
| @ -1,40 +1,43 @@ | |||||||
| import { Db } from '../db/db'; | import { Db } from '../../db/db'; | ||||||
| import { IUnleashConfig } from '../types'; | import { IUnleashConfig } from '../../types'; | ||||||
| import ExportImportService from './export-import-service'; | import ExportImportService from './export-import-service'; | ||||||
| import { ImportTogglesStore } from './import-toggles-store'; | import { ImportTogglesStore } from './import-toggles-store'; | ||||||
| import FeatureToggleStore from '../db/feature-toggle-store'; | import FeatureToggleStore from '../../db/feature-toggle-store'; | ||||||
| import TagStore from '../db/tag-store'; | import TagStore from '../../db/tag-store'; | ||||||
| import TagTypeStore from '../db/tag-type-store'; | import TagTypeStore from '../../db/tag-type-store'; | ||||||
| import ProjectStore from '../db/project-store'; | import ProjectStore from '../../db/project-store'; | ||||||
| import FeatureTagStore from '../db/feature-tag-store'; | import FeatureTagStore from '../../db/feature-tag-store'; | ||||||
| import StrategyStore from '../db/strategy-store'; | import StrategyStore from '../../db/strategy-store'; | ||||||
| import ContextFieldStore from '../db/context-field-store'; | import ContextFieldStore from '../../db/context-field-store'; | ||||||
| import EventStore from '../db/event-store'; | import EventStore from '../../db/event-store'; | ||||||
| import FeatureStrategiesStore from '../db/feature-strategy-store'; | import FeatureStrategiesStore from '../../db/feature-strategy-store'; | ||||||
| import { | import { | ||||||
|     ContextService, |     ContextService, | ||||||
|     FeatureTagService, |     FeatureTagService, | ||||||
|     StrategyService, |     StrategyService, | ||||||
|     TagTypeService, |     TagTypeService, | ||||||
| } from '../services'; | } from '../../services'; | ||||||
| import { createAccessService, createFakeAccessService } from '../access'; | import { | ||||||
|  |     createAccessService, | ||||||
|  |     createFakeAccessService, | ||||||
|  | } from '../access/createAccessService'; | ||||||
| import { | import { | ||||||
|     createFakeFeatureToggleService, |     createFakeFeatureToggleService, | ||||||
|     createFeatureToggleService, |     createFeatureToggleService, | ||||||
| } from '../feature-toggle'; | } from '../feature-toggle/createFeatureToggleService'; | ||||||
| import SegmentStore from '../db/segment-store'; | import SegmentStore from '../../db/segment-store'; | ||||||
| import { FeatureEnvironmentStore } from '../db/feature-environment-store'; | import { FeatureEnvironmentStore } from '../../db/feature-environment-store'; | ||||||
| import FakeFeatureToggleStore from '../../test/fixtures/fake-feature-toggle-store'; | import FakeFeatureToggleStore from '../../../test/fixtures/fake-feature-toggle-store'; | ||||||
| import FakeTagStore from '../../test/fixtures/fake-tag-store'; | import FakeTagStore from '../../../test/fixtures/fake-tag-store'; | ||||||
| import FakeTagTypeStore from '../../test/fixtures/fake-tag-type-store'; | import FakeTagTypeStore from '../../../test/fixtures/fake-tag-type-store'; | ||||||
| import FakeSegmentStore from '../../test/fixtures/fake-segment-store'; | import FakeSegmentStore from '../../../test/fixtures/fake-segment-store'; | ||||||
| import FakeProjectStore from '../../test/fixtures/fake-project-store'; | import FakeProjectStore from '../../../test/fixtures/fake-project-store'; | ||||||
| import FakeFeatureTagStore from '../../test/fixtures/fake-feature-tag-store'; | import FakeFeatureTagStore from '../../../test/fixtures/fake-feature-tag-store'; | ||||||
| import FakeContextFieldStore from '../../test/fixtures/fake-context-field-store'; | import FakeContextFieldStore from '../../../test/fixtures/fake-context-field-store'; | ||||||
| import FakeEventStore from '../../test/fixtures/fake-event-store'; | import FakeEventStore from '../../../test/fixtures/fake-event-store'; | ||||||
| import FakeFeatureStrategiesStore from '../../test/fixtures/fake-feature-strategies-store'; | import FakeFeatureStrategiesStore from '../../../test/fixtures/fake-feature-strategies-store'; | ||||||
| import FakeFeatureEnvironmentStore from '../../test/fixtures/fake-feature-environment-store'; | import FakeFeatureEnvironmentStore from '../../../test/fixtures/fake-feature-environment-store'; | ||||||
| import FakeStrategiesStore from '../../test/fixtures/fake-strategies-store'; | import FakeStrategiesStore from '../../../test/fixtures/fake-strategies-store'; | ||||||
| 
 | 
 | ||||||
| export const createFakeExportImportTogglesService = ( | export const createFakeExportImportTogglesService = ( | ||||||
|     config: IUnleashConfig, |     config: IUnleashConfig, | ||||||
| @ -1,16 +1,16 @@ | |||||||
| import { Response } from 'express'; | import { Response } from 'express'; | ||||||
| import { Knex } from 'knex'; | import { Knex } from 'knex'; | ||||||
| import Controller from '../routes/controller'; | import Controller from '../../routes/controller'; | ||||||
| import { Logger } from '../logger'; | import { Logger } from '../../logger'; | ||||||
| import ExportImportService from './export-import-service'; | import ExportImportService from './export-import-service'; | ||||||
| import { OpenApiService } from '../services'; | import { OpenApiService } from '../../services'; | ||||||
| import { TransactionCreator, UnleashTransaction } from '../db/transaction'; | import { TransactionCreator, UnleashTransaction } from '../../db/transaction'; | ||||||
| import { | import { | ||||||
|     IUnleashConfig, |     IUnleashConfig, | ||||||
|     IUnleashServices, |     IUnleashServices, | ||||||
|     NONE, |     NONE, | ||||||
|     serializeDates, |     serializeDates, | ||||||
| } from '../types'; | } from '../../types'; | ||||||
| import { | import { | ||||||
|     createRequestSchema, |     createRequestSchema, | ||||||
|     createResponseSchema, |     createResponseSchema, | ||||||
| @ -19,10 +19,10 @@ import { | |||||||
|     exportResultSchema, |     exportResultSchema, | ||||||
|     ImportTogglesSchema, |     ImportTogglesSchema, | ||||||
|     importTogglesValidateSchema, |     importTogglesValidateSchema, | ||||||
| } from '../openapi'; | } from '../../openapi'; | ||||||
| import { IAuthRequest } from '../routes/unleash-types'; | import { IAuthRequest } from '../../routes/unleash-types'; | ||||||
| import { extractUsername } from '../util'; | import { extractUsername } from '../../util'; | ||||||
| import { InvalidOperationError } from '../error'; | import { InvalidOperationError } from '../../error'; | ||||||
| 
 | 
 | ||||||
| class ExportImportController extends Controller { | class ExportImportController extends Controller { | ||||||
|     private logger: Logger; |     private logger: Logger; | ||||||
| @ -76,7 +76,7 @@ class ExportImportController extends Controller { | |||||||
|         }); |         }); | ||||||
|         this.route({ |         this.route({ | ||||||
|             method: 'post', |             method: 'post', | ||||||
|             path: '/full-validate', |             path: '/validate', | ||||||
|             permission: NONE, |             permission: NONE, | ||||||
|             handler: this.validateImport, |             handler: this.validateImport, | ||||||
|             middleware: [ |             middleware: [ | ||||||
| @ -97,7 +97,7 @@ class ExportImportController extends Controller { | |||||||
|         }); |         }); | ||||||
|         this.route({ |         this.route({ | ||||||
|             method: 'post', |             method: 'post', | ||||||
|             path: '/full-import', |             path: '/import', | ||||||
|             permission: NONE, |             permission: NONE, | ||||||
|             handler: this.importData, |             handler: this.importData, | ||||||
|             middleware: [ |             middleware: [ | ||||||
| @ -1,9 +1,9 @@ | |||||||
| import { | import { | ||||||
|     IUnleashTest, |     IUnleashTest, | ||||||
|     setupAppWithAuth, |     setupAppWithAuth, | ||||||
| } from '../../test/e2e/helpers/test-helper'; | } from '../../../test/e2e/helpers/test-helper'; | ||||||
| import dbInit, { ITestDb } from '../../test/e2e/helpers/database-init'; | import dbInit, { ITestDb } from '../../../test/e2e/helpers/database-init'; | ||||||
| import getLogger from '../../test/fixtures/no-logger'; | import getLogger from '../../../test/fixtures/no-logger'; | ||||||
| import { | import { | ||||||
|     DEFAULT_PROJECT, |     DEFAULT_PROJECT, | ||||||
|     IContextFieldStore, |     IContextFieldStore, | ||||||
| @ -13,11 +13,11 @@ import { | |||||||
|     IProjectStore, |     IProjectStore, | ||||||
|     IUnleashStores, |     IUnleashStores, | ||||||
|     RoleName, |     RoleName, | ||||||
| } from '../types'; | } from '../../types'; | ||||||
| import { ImportTogglesSchema, VariantsSchema } from '../openapi'; | import { ImportTogglesSchema, VariantsSchema } from '../../openapi'; | ||||||
| import { IContextFieldDto } from '../types/stores/context-field-store'; | import { IContextFieldDto } from '../../types/stores/context-field-store'; | ||||||
| import { AccessService } from '../services'; | import { AccessService } from '../../services'; | ||||||
| import { DEFAULT_ENV } from '../util'; | import { DEFAULT_ENV } from '../../util'; | ||||||
| 
 | 
 | ||||||
| let app: IUnleashTest; | let app: IUnleashTest; | ||||||
| let db: ITestDb; | let db: ITestDb; | ||||||
| @ -35,7 +35,7 @@ const adminUserName = 'admin-user'; | |||||||
| 
 | 
 | ||||||
| const validateImport = (importPayload: ImportTogglesSchema, status = 200) => | const validateImport = (importPayload: ImportTogglesSchema, status = 200) => | ||||||
|     app.request |     app.request | ||||||
|         .post('/api/admin/features-batch/full-validate') |         .post('/api/admin/features-batch/validate') | ||||||
|         .send(importPayload) |         .send(importPayload) | ||||||
|         .set('Content-Type', 'application/json') |         .set('Content-Type', 'application/json') | ||||||
|         .expect(status); |         .expect(status); | ||||||
| @ -1,37 +1,37 @@ | |||||||
| import { IUnleashConfig } from '../types/option'; | import { IUnleashConfig } from '../../types/option'; | ||||||
| import { | import { | ||||||
|     FeatureToggleDTO, |     FeatureToggleDTO, | ||||||
|     IFeatureStrategy, |     IFeatureStrategy, | ||||||
|     IFeatureStrategySegment, |     IFeatureStrategySegment, | ||||||
|     IVariant, |     IVariant, | ||||||
| } from '../types/model'; | } from '../../types/model'; | ||||||
| import { Logger } from '../logger'; | import { Logger } from '../../logger'; | ||||||
| import { IFeatureTagStore } from '../types/stores/feature-tag-store'; | import { IFeatureTagStore } from '../../types/stores/feature-tag-store'; | ||||||
| import { ITagTypeStore } from '../types/stores/tag-type-store'; | import { ITagTypeStore } from '../../types/stores/tag-type-store'; | ||||||
| import { IEventStore } from '../types/stores/event-store'; | import { IEventStore } from '../../types/stores/event-store'; | ||||||
| import { IStrategy } from '../types/stores/strategy-store'; | import { IStrategy } from '../../types/stores/strategy-store'; | ||||||
| import { IFeatureToggleStore } from '../types/stores/feature-toggle-store'; | import { IFeatureToggleStore } from '../../types/stores/feature-toggle-store'; | ||||||
| import { IFeatureStrategiesStore } from '../types/stores/feature-strategies-store'; | import { IFeatureStrategiesStore } from '../../types/stores/feature-strategies-store'; | ||||||
| import { IFeatureEnvironmentStore } from '../types/stores/feature-environment-store'; | import { IFeatureEnvironmentStore } from '../../types/stores/feature-environment-store'; | ||||||
| import { IContextFieldStore, IUnleashStores } from '../types/stores'; | import { IContextFieldStore, IUnleashStores } from '../../types/stores'; | ||||||
| import { ISegmentStore } from '../types/stores/segment-store'; | import { ISegmentStore } from '../../types/stores/segment-store'; | ||||||
| import { ExportQuerySchema } from '../openapi/spec/export-query-schema'; | import { ExportQuerySchema } from '../../openapi/spec/export-query-schema'; | ||||||
| import { | import { | ||||||
|     FEATURES_EXPORTED, |     FEATURES_EXPORTED, | ||||||
|     FEATURES_IMPORTED, |     FEATURES_IMPORTED, | ||||||
|     IFlagResolver, |     IFlagResolver, | ||||||
|     IUnleashServices, |     IUnleashServices, | ||||||
|     WithRequired, |     WithRequired, | ||||||
| } from '../types'; | } from '../../types'; | ||||||
| import { | import { | ||||||
|     ExportResultSchema, |     ExportResultSchema, | ||||||
|     FeatureStrategySchema, |     FeatureStrategySchema, | ||||||
|     ImportTogglesValidateSchema, |     ImportTogglesValidateSchema, | ||||||
| } from '../openapi'; | } from '../../openapi'; | ||||||
| import { ImportTogglesSchema } from '../openapi/spec/import-toggles-schema'; | import { ImportTogglesSchema } from '../../openapi/spec/import-toggles-schema'; | ||||||
| import User from '../types/user'; | import User from '../../types/user'; | ||||||
| import { BadDataError } from '../error'; | import { BadDataError } from '../../error'; | ||||||
| import { extractUsernameFromUser } from '../util'; | import { extractUsernameFromUser } from '../../util'; | ||||||
| import { | import { | ||||||
|     AccessService, |     AccessService, | ||||||
|     ContextService, |     ContextService, | ||||||
| @ -39,7 +39,7 @@ import { | |||||||
|     FeatureToggleService, |     FeatureToggleService, | ||||||
|     StrategyService, |     StrategyService, | ||||||
|     TagTypeService, |     TagTypeService, | ||||||
| } from '../services'; | } from '../../services'; | ||||||
| import { isValidField } from './import-context-validation'; | import { isValidField } from './import-context-validation'; | ||||||
| import { IImportTogglesStore } from './import-toggles-store-type'; | import { IImportTogglesStore } from './import-toggles-store-type'; | ||||||
| import { ImportPermissionsService } from './import-permissions-service'; | import { ImportPermissionsService } from './import-permissions-service'; | ||||||
| @ -1,9 +1,9 @@ | |||||||
| import { | import { | ||||||
|     IUnleashTest, |     IUnleashTest, | ||||||
|     setupAppWithCustomConfig, |     setupAppWithCustomConfig, | ||||||
| } from '../../test/e2e/helpers/test-helper'; | } from '../../../test/e2e/helpers/test-helper'; | ||||||
| import dbInit, { ITestDb } from '../../test/e2e/helpers/database-init'; | import dbInit, { ITestDb } from '../../../test/e2e/helpers/database-init'; | ||||||
| import getLogger from '../../test/fixtures/no-logger'; | import getLogger from '../../../test/fixtures/no-logger'; | ||||||
| import { | import { | ||||||
|     DEFAULT_PROJECT, |     DEFAULT_PROJECT, | ||||||
|     FeatureToggleDTO, |     FeatureToggleDTO, | ||||||
| @ -15,15 +15,15 @@ import { | |||||||
|     ISegment, |     ISegment, | ||||||
|     IStrategyConfig, |     IStrategyConfig, | ||||||
|     IVariant, |     IVariant, | ||||||
| } from '../types'; | } from '../../types'; | ||||||
| import { DEFAULT_ENV } from '../util'; | import { DEFAULT_ENV } from '../../util'; | ||||||
| import { | import { | ||||||
|     ContextFieldSchema, |     ContextFieldSchema, | ||||||
|     ImportTogglesSchema, |     ImportTogglesSchema, | ||||||
|     VariantsSchema, |     VariantsSchema, | ||||||
| } from '../openapi'; | } from '../../openapi'; | ||||||
| import User from '../types/user'; | import User from '../../types/user'; | ||||||
| import { IContextFieldDto } from '../types/stores/context-field-store'; | import { IContextFieldDto } from '../../types/stores/context-field-store'; | ||||||
| 
 | 
 | ||||||
| let app: IUnleashTest; | let app: IUnleashTest; | ||||||
| let db: ITestDb; | let db: ITestDb; | ||||||
| @ -422,7 +422,7 @@ const importToggles = ( | |||||||
|     expect: (response) => void = () => {}, |     expect: (response) => void = () => {}, | ||||||
| ) => | ) => | ||||||
|     app.request |     app.request | ||||||
|         .post('/api/admin/features-batch/full-import') |         .post('/api/admin/features-batch/import') | ||||||
|         .send(importPayload) |         .send(importPayload) | ||||||
|         .set('Content-Type', 'application/json') |         .set('Content-Type', 'application/json') | ||||||
|         .expect(status) |         .expect(status) | ||||||
| @ -543,7 +543,7 @@ const getTags = (feature: string) => | |||||||
| 
 | 
 | ||||||
| const validateImport = (importPayload: ImportTogglesSchema, status = 200) => | const validateImport = (importPayload: ImportTogglesSchema, status = 200) => | ||||||
|     app.request |     app.request | ||||||
|         .post('/api/admin/features-batch/full-validate') |         .post('/api/admin/features-batch/validate') | ||||||
|         .send(importPayload) |         .send(importPayload) | ||||||
|         .set('Content-Type', 'application/json') |         .set('Content-Type', 'application/json') | ||||||
|         .expect(status); |         .expect(status); | ||||||
| @ -1,4 +1,4 @@ | |||||||
| import { IContextFieldDto } from '../types/stores/context-field-store'; | import { IContextFieldDto } from '../../types/stores/context-field-store'; | ||||||
| 
 | 
 | ||||||
| export const isValidField = ( | export const isValidField = ( | ||||||
|     importedField: IContextFieldDto, |     importedField: IContextFieldDto, | ||||||
| @ -1,8 +1,8 @@ | |||||||
| import { IImportTogglesStore } from './import-toggles-store-type'; | import { IImportTogglesStore } from './import-toggles-store-type'; | ||||||
| import { AccessService, ContextService, TagTypeService } from '../services'; | import { AccessService, ContextService, TagTypeService } from '../../services'; | ||||||
| import { ContextFieldSchema, ImportTogglesSchema } from '../openapi'; | import { ContextFieldSchema, ImportTogglesSchema } from '../../openapi'; | ||||||
| import { ITagType } from '../types/stores/tag-type-store'; | import { ITagType } from '../../types/stores/tag-type-store'; | ||||||
| import User from '../types/user'; | import User from '../../types/user'; | ||||||
| import { | import { | ||||||
|     CREATE_CONTEXT_FIELD, |     CREATE_CONTEXT_FIELD, | ||||||
|     CREATE_FEATURE, |     CREATE_FEATURE, | ||||||
| @ -11,8 +11,8 @@ import { | |||||||
|     UPDATE_FEATURE, |     UPDATE_FEATURE, | ||||||
|     UPDATE_FEATURE_ENVIRONMENT_VARIANTS, |     UPDATE_FEATURE_ENVIRONMENT_VARIANTS, | ||||||
|     UPDATE_TAG_TYPE, |     UPDATE_TAG_TYPE, | ||||||
| } from '../types'; | } from '../../types'; | ||||||
| import { InvalidOperationError } from '../error'; | import { InvalidOperationError } from '../../error'; | ||||||
| 
 | 
 | ||||||
| type Mode = 'regular' | 'change_request'; | type Mode = 'regular' | 'change_request'; | ||||||
| 
 | 
 | ||||||
| @ -1,8 +1,8 @@ | |||||||
| import { | import { | ||||||
|     FeatureStrategySchema, |     FeatureStrategySchema, | ||||||
|     ImportTogglesValidateItemSchema, |     ImportTogglesValidateItemSchema, | ||||||
| } from '../openapi'; | } from '../../openapi'; | ||||||
| import { IContextFieldDto } from '../types/stores/context-field-store'; | import { IContextFieldDto } from '../../types/stores/context-field-store'; | ||||||
| 
 | 
 | ||||||
| export class ImportValidationMessages { | export class ImportValidationMessages { | ||||||
|     static compilePermissionErrors( |     static compilePermissionErrors( | ||||||
| @ -3,37 +3,37 @@ import { | |||||||
|     FeatureToggleService, |     FeatureToggleService, | ||||||
|     GroupService, |     GroupService, | ||||||
|     SegmentService, |     SegmentService, | ||||||
| } from '../services'; | } from '../../services'; | ||||||
| import EventStore from '../db/event-store'; | import EventStore from '../../db/event-store'; | ||||||
| import FeatureStrategiesStore from '../db/feature-strategy-store'; | import FeatureStrategiesStore from '../../db/feature-strategy-store'; | ||||||
| import FeatureToggleStore from '../db/feature-toggle-store'; | import FeatureToggleStore from '../../db/feature-toggle-store'; | ||||||
| import FeatureToggleClientStore from '../db/feature-toggle-client-store'; | import FeatureToggleClientStore from '../../db/feature-toggle-client-store'; | ||||||
| import ProjectStore from '../db/project-store'; | import ProjectStore from '../../db/project-store'; | ||||||
| import FeatureTagStore from '../db/feature-tag-store'; | import FeatureTagStore from '../../db/feature-tag-store'; | ||||||
| import { FeatureEnvironmentStore } from '../db/feature-environment-store'; | import { FeatureEnvironmentStore } from '../../db/feature-environment-store'; | ||||||
| import SegmentStore from '../db/segment-store'; | import SegmentStore from '../../db/segment-store'; | ||||||
| import ContextFieldStore from '../db/context-field-store'; | import ContextFieldStore from '../../db/context-field-store'; | ||||||
| import GroupStore from '../db/group-store'; | import GroupStore from '../../db/group-store'; | ||||||
| import { AccountStore } from '../db/account-store'; | import { AccountStore } from '../../db/account-store'; | ||||||
| import { AccessStore } from '../db/access-store'; | import { AccessStore } from '../../db/access-store'; | ||||||
| import RoleStore from '../db/role-store'; | import RoleStore from '../../db/role-store'; | ||||||
| import EnvironmentStore from '../db/environment-store'; | import EnvironmentStore from '../../db/environment-store'; | ||||||
| import { Db } from '../db/db'; | import { Db } from '../../db/db'; | ||||||
| import { IUnleashConfig } from '../types'; | import { IUnleashConfig } from '../../types'; | ||||||
| import FakeEventStore from '../../test/fixtures/fake-event-store'; | import FakeEventStore from '../../../test/fixtures/fake-event-store'; | ||||||
| import FakeFeatureStrategiesStore from '../../test/fixtures/fake-feature-strategies-store'; | import FakeFeatureStrategiesStore from '../../../test/fixtures/fake-feature-strategies-store'; | ||||||
| import FakeFeatureToggleStore from '../../test/fixtures/fake-feature-toggle-store'; | import FakeFeatureToggleStore from '../../../test/fixtures/fake-feature-toggle-store'; | ||||||
| import FakeFeatureToggleClientStore from '../../test/fixtures/fake-feature-toggle-client-store'; | import FakeFeatureToggleClientStore from '../../../test/fixtures/fake-feature-toggle-client-store'; | ||||||
| import FakeProjectStore from '../../test/fixtures/fake-project-store'; | import FakeProjectStore from '../../../test/fixtures/fake-project-store'; | ||||||
| import FakeFeatureTagStore from '../../test/fixtures/fake-feature-tag-store'; | import FakeFeatureTagStore from '../../../test/fixtures/fake-feature-tag-store'; | ||||||
| import FakeFeatureEnvironmentStore from '../../test/fixtures/fake-feature-environment-store'; | import FakeFeatureEnvironmentStore from '../../../test/fixtures/fake-feature-environment-store'; | ||||||
| import FakeSegmentStore from '../../test/fixtures/fake-segment-store'; | import FakeSegmentStore from '../../../test/fixtures/fake-segment-store'; | ||||||
| import FakeContextFieldStore from '../../test/fixtures/fake-context-field-store'; | import FakeContextFieldStore from '../../../test/fixtures/fake-context-field-store'; | ||||||
| import FakeGroupStore from '../../test/fixtures/fake-group-store'; | import FakeGroupStore from '../../../test/fixtures/fake-group-store'; | ||||||
| import { FakeAccountStore } from '../../test/fixtures/fake-account-store'; | import { FakeAccountStore } from '../../../test/fixtures/fake-account-store'; | ||||||
| import FakeAccessStore from '../../test/fixtures/fake-access-store'; | import FakeAccessStore from '../../../test/fixtures/fake-access-store'; | ||||||
| import FakeRoleStore from '../../test/fixtures/fake-role-store'; | import FakeRoleStore from '../../../test/fixtures/fake-role-store'; | ||||||
| import FakeEnvironmentStore from '../../test/fixtures/fake-environment-store'; | import FakeEnvironmentStore from '../../../test/fixtures/fake-environment-store'; | ||||||
| 
 | 
 | ||||||
| export const createFeatureToggleService = ( | export const createFeatureToggleService = ( | ||||||
|     db: Db, |     db: Db, | ||||||
							
								
								
									
										3
									
								
								src/lib/features/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/lib/features/index.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | |||||||
|  | export * from './access/createAccessService'; | ||||||
|  | export * from './export-import-toggles/createExportImportService'; | ||||||
|  | export * from './feature-toggle/createFeatureToggleService'; | ||||||
| @ -13,6 +13,4 @@ export * from './services'; | |||||||
| export * from './types'; | export * from './types'; | ||||||
| export * from './util'; | export * from './util'; | ||||||
| export * from './error'; | export * from './error'; | ||||||
| export * from './access'; | export * from './features'; | ||||||
| export * from './export-import-toggles'; |  | ||||||
| export * from './feature-toggle'; |  | ||||||
|  | |||||||
| @ -30,7 +30,7 @@ import FavoritesController from './favorites'; | |||||||
| import MaintenanceController from './maintenance'; | import MaintenanceController from './maintenance'; | ||||||
| import { createKnexTransactionStarter } from '../../db/transaction'; | import { createKnexTransactionStarter } from '../../db/transaction'; | ||||||
| import { Db } from '../../db/db'; | import { Db } from '../../db/db'; | ||||||
| import ExportImportController from '../../export-import-toggles/export-import-controller'; | import ExportImportController from '../../features/export-import-toggles/export-import-controller'; | ||||||
| 
 | 
 | ||||||
| class AdminApi extends Controller { | class AdminApi extends Controller { | ||||||
|     constructor(config: IUnleashConfig, services: IUnleashServices, db: Db) { |     constructor(config: IUnleashConfig, services: IUnleashServices, db: Db) { | ||||||
|  | |||||||
| @ -46,7 +46,7 @@ import { Knex } from 'knex'; | |||||||
| import { | import { | ||||||
|     createExportImportTogglesService, |     createExportImportTogglesService, | ||||||
|     createFakeExportImportTogglesService, |     createFakeExportImportTogglesService, | ||||||
| } from '../export-import-toggles'; | } from '../features/export-import-toggles/createExportImportService'; | ||||||
| import { Db } from '../db/db'; | import { Db } from '../db/db'; | ||||||
| 
 | 
 | ||||||
| // TODO: will be moved to scheduler feature directory
 | // TODO: will be moved to scheduler feature directory
 | ||||||
|  | |||||||
| @ -37,10 +37,10 @@ import { LastSeenService } from '../services/client-metrics/last-seen-service'; | |||||||
| import { InstanceStatsService } from '../services/instance-stats-service'; | import { InstanceStatsService } from '../services/instance-stats-service'; | ||||||
| import { FavoritesService } from '../services/favorites-service'; | import { FavoritesService } from '../services/favorites-service'; | ||||||
| import MaintenanceService from '../services/maintenance-service'; | import MaintenanceService from '../services/maintenance-service'; | ||||||
| import ExportImportService from '../export-import-toggles/export-import-service'; |  | ||||||
| import { AccountService } from '../services/account-service'; | import { AccountService } from '../services/account-service'; | ||||||
| import { SchedulerService } from '../services/scheduler-service'; | import { SchedulerService } from '../services/scheduler-service'; | ||||||
| import { Knex } from 'knex'; | import { Knex } from 'knex'; | ||||||
|  | import ExportImportService from '../features/export-import-toggles/export-import-service'; | ||||||
| 
 | 
 | ||||||
| export interface IUnleashServices { | export interface IUnleashServices { | ||||||
|     accessService: AccessService; |     accessService: AccessService; | ||||||
|  | |||||||
| @ -32,7 +32,7 @@ import { IFavoriteFeaturesStore } from './stores/favorite-features'; | |||||||
| import { IFavoriteProjectsStore } from './stores/favorite-projects'; | import { IFavoriteProjectsStore } from './stores/favorite-projects'; | ||||||
| import { IAccountStore } from './stores/account-store'; | import { IAccountStore } from './stores/account-store'; | ||||||
| import { IProjectStatsStore } from './stores/project-stats-store-type'; | import { IProjectStatsStore } from './stores/project-stats-store-type'; | ||||||
| import { IImportTogglesStore } from '../export-import-toggles/import-toggles-store-type'; | import { IImportTogglesStore } from '../features/export-import-toggles/import-toggles-store-type'; | ||||||
| 
 | 
 | ||||||
| export interface IUnleashStores { | export interface IUnleashStores { | ||||||
|     accessStore: IAccessStore; |     accessStore: IAccessStore; | ||||||
|  | |||||||
| @ -5129,7 +5129,7 @@ If the provided project does not exist, the list of events will be empty.", | |||||||
|         ], |         ], | ||||||
|       }, |       }, | ||||||
|     }, |     }, | ||||||
|     "/api/admin/features-batch/full-import": { |     "/api/admin/features-batch/import": { | ||||||
|       "post": { |       "post": { | ||||||
|         "description": "Unleash toggles exported from a different instance can be imported into a new project and environment", |         "description": "Unleash toggles exported from a different instance can be imported into a new project and environment", | ||||||
|         "operationId": "importToggles", |         "operationId": "importToggles", | ||||||
| @ -5155,7 +5155,7 @@ If the provided project does not exist, the list of events will be empty.", | |||||||
|         ], |         ], | ||||||
|       }, |       }, | ||||||
|     }, |     }, | ||||||
|     "/api/admin/features-batch/full-validate": { |     "/api/admin/features-batch/validate": { | ||||||
|       "post": { |       "post": { | ||||||
|         "description": "Unleash toggles exported from a different instance can be imported into a new project and environment", |         "description": "Unleash toggles exported from a different instance can be imported into a new project and environment", | ||||||
|         "operationId": "validateImport", |         "operationId": "validateImport", | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user