mirror of
https://github.com/Unleash/unleash.git
synced 2025-03-04 00:18:40 +01:00
fix(import): making all imports relative and removing baseUrl (#5847)
Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
This commit is contained in:
parent
60813acb09
commit
1392b10727
@ -1,8 +1,8 @@
|
|||||||
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 { PermissionRef } from 'lib/services/access-service';
|
import { PermissionRef } from '../services/access-service';
|
||||||
import { AccessStore } from './access-store';
|
import { AccessStore } from './access-store';
|
||||||
import { BadDataError } from '../../lib/error';
|
import { BadDataError } from '../error';
|
||||||
|
|
||||||
let db: ITestDb;
|
let db: ITestDb;
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ import {
|
|||||||
IdPermissionRef,
|
IdPermissionRef,
|
||||||
NamePermissionRef,
|
NamePermissionRef,
|
||||||
PermissionRef,
|
PermissionRef,
|
||||||
} from 'lib/services/access-service';
|
} from '../services/access-service';
|
||||||
import { inTransaction } from './transaction';
|
import { inTransaction } from './transaction';
|
||||||
import BadDataError from '../error/bad-data-error';
|
import BadDataError from '../error/bad-data-error';
|
||||||
|
|
||||||
|
@ -3,13 +3,13 @@ import { Logger, LogProvider } from '../logger';
|
|||||||
import metricsHelper from '../util/metrics-helper';
|
import metricsHelper from '../util/metrics-helper';
|
||||||
import { DB_TIME } from '../metric-events';
|
import { DB_TIME } from '../metric-events';
|
||||||
import EventEmitter from 'events';
|
import EventEmitter from 'events';
|
||||||
import { IProjectStats } from 'lib/services/project-service';
|
import { IProjectStats } from '../services/project-service';
|
||||||
import {
|
import {
|
||||||
ICreateEnabledDates,
|
ICreateEnabledDates,
|
||||||
IProjectStatsStore,
|
IProjectStatsStore,
|
||||||
} from 'lib/types/stores/project-stats-store-type';
|
} from '../types/stores/project-stats-store-type';
|
||||||
import { Db } from './db';
|
import { Db } from './db';
|
||||||
import { DoraFeaturesSchema } from 'lib/openapi';
|
import { DoraFeaturesSchema } from '../openapi';
|
||||||
|
|
||||||
const TABLE = 'project_stats';
|
const TABLE = 'project_stats';
|
||||||
|
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
import EventEmitter from 'events';
|
import EventEmitter from 'events';
|
||||||
import { Logger, LogProvider } from '../logger';
|
import { Logger, LogProvider } from '../logger';
|
||||||
import NotFoundError from '../error/notfound-error';
|
import NotFoundError from '../error/notfound-error';
|
||||||
import { ICustomRole } from 'lib/types/model';
|
import { ICustomRole } from '../types/model';
|
||||||
import {
|
import {
|
||||||
ICustomRoleInsert,
|
ICustomRoleInsert,
|
||||||
ICustomRoleUpdate,
|
ICustomRoleUpdate,
|
||||||
IRoleStore,
|
IRoleStore,
|
||||||
} from 'lib/types/stores/role-store';
|
} from '../types/stores/role-store';
|
||||||
import { IRole, IUserRole } from 'lib/types/stores/access-store';
|
import { IRole, IUserRole } from '../types/stores/access-store';
|
||||||
import { Db } from './db';
|
import { Db } from './db';
|
||||||
import { PROJECT_ROLE_TYPES, ROOT_ROLE_TYPES } from '../util';
|
import { PROJECT_ROLE_TYPES, ROOT_ROLE_TYPES } from '../util';
|
||||||
import { RoleSchema } from 'lib/openapi';
|
import { RoleSchema } from '../openapi';
|
||||||
|
|
||||||
const T = {
|
const T = {
|
||||||
ROLE_USER: 'role_user',
|
ROLE_USER: 'role_user',
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Knex } from 'knex';
|
import { Knex } from 'knex';
|
||||||
import { IUnleashConfig } from 'lib/server-impl';
|
import { IUnleashConfig } from '../server-impl';
|
||||||
|
|
||||||
export type KnexTransaction = Knex.Transaction;
|
export type KnexTransaction = Knex.Transaction;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { subDays } from 'date-fns';
|
import { subDays } from 'date-fns';
|
||||||
import type { IFeatureType } from 'lib/types/stores/feature-type-store';
|
import type { IFeatureType } from '../../types/stores/feature-type-store';
|
||||||
import {
|
import {
|
||||||
calculateProjectHealth,
|
calculateProjectHealth,
|
||||||
calculateHealthRating,
|
calculateHealthRating,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { hoursToMilliseconds } from 'date-fns';
|
import { hoursToMilliseconds } from 'date-fns';
|
||||||
import type { IProjectHealthReport } from 'lib/types';
|
import type { IProjectHealthReport } from '../../types';
|
||||||
import type { IFeatureType } from 'lib/types/stores/feature-type-store';
|
import type { IFeatureType } from '../../types/stores/feature-type-store';
|
||||||
|
|
||||||
type IPartialFeatures = Array<{
|
type IPartialFeatures = Array<{
|
||||||
stale?: boolean;
|
stale?: boolean;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Db, IUnleashConfig } from 'lib/server-impl';
|
import { Db, IUnleashConfig } from '../../server-impl';
|
||||||
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';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Db, IUnleashConfig } from 'lib/server-impl';
|
import { Db, IUnleashConfig } from '../../server-impl';
|
||||||
import { ChangeRequestAccessReadModel } from './sql-change-request-access-read-model';
|
import { ChangeRequestAccessReadModel } from './sql-change-request-access-read-model';
|
||||||
import { createAccessService } from '../access/createAccessService';
|
import { createAccessService } from '../access/createAccessService';
|
||||||
import { FakeChangeRequestAccessReadModel } from './fake-change-request-access-read-model';
|
import { FakeChangeRequestAccessReadModel } from './fake-change-request-access-read-model';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IUser } from 'lib/server-impl';
|
import { IUser } from '../../server-impl';
|
||||||
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 { IChangeRequestSegmentUsageReadModel } from './change-request-segment-usage-read-model';
|
import { IChangeRequestSegmentUsageReadModel } from './change-request-segment-usage-read-model';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Db } from 'lib/server-impl';
|
import { Db } from '../../server-impl';
|
||||||
import { ChangeRequestSegmentUsageReadModel } from './sql-change-request-segment-usage-read-model';
|
import { ChangeRequestSegmentUsageReadModel } from './sql-change-request-segment-usage-read-model';
|
||||||
import { FakeChangeRequestSegmentUsageReadModel } from './fake-change-request-segment-usage-read-model';
|
import { FakeChangeRequestSegmentUsageReadModel } from './fake-change-request-segment-usage-read-model';
|
||||||
import { IChangeRequestSegmentUsageReadModel } from './change-request-segment-usage-read-model';
|
import { IChangeRequestSegmentUsageReadModel } from './change-request-segment-usage-read-model';
|
||||||
|
@ -43,7 +43,7 @@ import {
|
|||||||
createFakePrivateProjectChecker,
|
createFakePrivateProjectChecker,
|
||||||
createPrivateProjectChecker,
|
createPrivateProjectChecker,
|
||||||
} from '../private-project/createPrivateProjectChecker';
|
} from '../private-project/createPrivateProjectChecker';
|
||||||
import { DeferredServiceFactory } from 'lib/db/transaction';
|
import { DeferredServiceFactory } from '../../db/transaction';
|
||||||
import { DependentFeaturesReadModel } from '../dependent-features/dependent-features-read-model';
|
import { DependentFeaturesReadModel } from '../dependent-features/dependent-features-read-model';
|
||||||
import { FakeDependentFeaturesReadModel } from '../dependent-features/fake-dependent-features-read-model';
|
import { FakeDependentFeaturesReadModel } from '../dependent-features/fake-dependent-features-read-model';
|
||||||
import {
|
import {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IFeatureOverview } from 'lib/types';
|
import { IFeatureOverview } from '../../types';
|
||||||
import {
|
import {
|
||||||
IFeatureSearchParams,
|
IFeatureSearchParams,
|
||||||
IQueryParam,
|
IQueryParam,
|
||||||
|
@ -10,7 +10,7 @@ import {
|
|||||||
IFeatureToggleQuery,
|
IFeatureToggleQuery,
|
||||||
IFeatureTypeCount,
|
IFeatureTypeCount,
|
||||||
IVariant,
|
IVariant,
|
||||||
} from 'lib/types/model';
|
} from '../../../types/model';
|
||||||
import { LastSeenInput } from '../../metrics/last-seen/last-seen-service';
|
import { LastSeenInput } from '../../metrics/last-seen/last-seen-service';
|
||||||
import {
|
import {
|
||||||
EnvironmentFeatureNames,
|
EnvironmentFeatureNames,
|
||||||
|
@ -86,8 +86,8 @@ import {
|
|||||||
validateSemver,
|
validateSemver,
|
||||||
validateString,
|
validateString,
|
||||||
} from '../../util/validators/constraint-types';
|
} from '../../util/validators/constraint-types';
|
||||||
import { IContextFieldStore } from 'lib/types/stores/context-field-store';
|
import { IContextFieldStore } from '../../types/stores/context-field-store';
|
||||||
import { SetStrategySortOrderSchema } from 'lib/openapi/spec/set-strategy-sort-order-schema';
|
import { SetStrategySortOrderSchema } from '../../openapi/spec/set-strategy-sort-order-schema';
|
||||||
import {
|
import {
|
||||||
getDefaultStrategy,
|
getDefaultStrategy,
|
||||||
getProjectDefaultStrategy,
|
getProjectDefaultStrategy,
|
||||||
@ -96,7 +96,7 @@ import { AccessService } from '../../services/access-service';
|
|||||||
import { IUser } from '../../server-impl';
|
import { IUser } from '../../server-impl';
|
||||||
import { IFeatureProjectUserParams } from './feature-toggle-controller';
|
import { IFeatureProjectUserParams } from './feature-toggle-controller';
|
||||||
import { unique } from '../../util/unique';
|
import { unique } from '../../util/unique';
|
||||||
import { ISegmentService } from 'lib/segments/segment-service-interface';
|
import { ISegmentService } from '../../segments/segment-service-interface';
|
||||||
import { IChangeRequestAccessReadModel } from '../change-request-access-service/change-request-access-read-model';
|
import { IChangeRequestAccessReadModel } from '../change-request-access-service/change-request-access-read-model';
|
||||||
import { checkFeatureFlagNamesAgainstPattern } from '../feature-naming-pattern/feature-naming-validation';
|
import { checkFeatureFlagNamesAgainstPattern } from '../feature-naming-pattern/feature-naming-validation';
|
||||||
import { IPrivateProjectChecker } from '../private-project/privateProjectCheckerType';
|
import { IPrivateProjectChecker } from '../private-project/privateProjectCheckerType';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { IFeatureStrategiesStore } from 'lib/features/feature-toggle/types/feature-toggle-strategies-store-type';
|
import { IFeatureStrategiesStore } from '../../../features/feature-toggle/types/feature-toggle-strategies-store-type';
|
||||||
import { IFeatureToggleStore } from 'lib/features/feature-toggle/types/feature-toggle-store-type';
|
import { IFeatureToggleStore } from '../../../features/feature-toggle/types/feature-toggle-store-type';
|
||||||
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 { IUnleashStores } from '../../../types';
|
import { IUnleashStores } from '../../../types';
|
||||||
|
@ -26,7 +26,10 @@ import { v4 as uuidv4 } from 'uuid';
|
|||||||
import supertest from 'supertest';
|
import supertest from 'supertest';
|
||||||
import { randomId } from '../../../util/random-id';
|
import { randomId } from '../../../util/random-id';
|
||||||
import { DEFAULT_PROJECT } from '../../../types';
|
import { DEFAULT_PROJECT } from '../../../types';
|
||||||
import { FeatureStrategySchema, SetStrategySortOrderSchema } from 'lib/openapi';
|
import {
|
||||||
|
FeatureStrategySchema,
|
||||||
|
SetStrategySortOrderSchema,
|
||||||
|
} from '../../../openapi';
|
||||||
import { ForbiddenError } from '../../../error';
|
import { ForbiddenError } from '../../../error';
|
||||||
|
|
||||||
let app: IUnleashTest;
|
let app: IUnleashTest;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { type Db } from 'lib/server-impl';
|
import { type Db } from '../../server-impl';
|
||||||
|
|
||||||
export type GetActiveUsers = () => Promise<{
|
export type GetActiveUsers = () => Promise<{
|
||||||
last7: number;
|
last7: number;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { type Db } from 'lib/server-impl';
|
import { type Db } from '../../server-impl';
|
||||||
|
|
||||||
export type GetProductionChanges = () => Promise<{
|
export type GetProductionChanges = () => Promise<{
|
||||||
last30: number;
|
last30: number;
|
||||||
|
@ -15,8 +15,8 @@ import {
|
|||||||
MaintenanceSchema,
|
MaintenanceSchema,
|
||||||
maintenanceSchema,
|
maintenanceSchema,
|
||||||
} from '../../openapi/spec/maintenance-schema';
|
} from '../../openapi/spec/maintenance-schema';
|
||||||
import MaintenanceService from 'lib/features/maintenance/maintenance-service';
|
import MaintenanceService from '../../features/maintenance/maintenance-service';
|
||||||
import { ToggleMaintenanceSchema } from 'lib/openapi/spec/toggle-maintenance-schema';
|
import { ToggleMaintenanceSchema } from '../../openapi/spec/toggle-maintenance-schema';
|
||||||
|
|
||||||
export default class MaintenanceController extends Controller {
|
export default class MaintenanceController extends Controller {
|
||||||
private maintenanceService: MaintenanceService;
|
private maintenanceService: MaintenanceService;
|
||||||
|
@ -5,7 +5,7 @@ import getLogger from '../../../../test/fixtures/no-logger';
|
|||||||
import createStores from '../../../../test/fixtures/store';
|
import createStores from '../../../../test/fixtures/store';
|
||||||
import EventEmitter from 'events';
|
import EventEmitter from 'events';
|
||||||
import { LastSeenService } from '../last-seen/last-seen-service';
|
import { LastSeenService } from '../last-seen/last-seen-service';
|
||||||
import { IClientMetricsStoreV2, IUnleashConfig } from 'lib/types';
|
import { IClientMetricsStoreV2, IUnleashConfig } from '../../../../lib/types';
|
||||||
import { endOfDay, startOfHour, subDays, subHours } from 'date-fns';
|
import { endOfDay, startOfHour, subDays, subHours } from 'date-fns';
|
||||||
import { IClientMetricsEnv } from './client-metrics-store-v2-type';
|
import { IClientMetricsEnv } from './client-metrics-store-v2-type';
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ import {
|
|||||||
generateHourBuckets,
|
generateHourBuckets,
|
||||||
HourBucket,
|
HourBucket,
|
||||||
} from '../../../util/time-utils';
|
} from '../../../util/time-utils';
|
||||||
import { ClientMetricsSchema } from 'lib/openapi';
|
import { ClientMetricsSchema } from '../../../../lib/openapi';
|
||||||
import { nameSchema } from '../../../schema/feature-schema';
|
import { nameSchema } from '../../../schema/feature-schema';
|
||||||
|
|
||||||
export default class ClientMetricsServiceV2 {
|
export default class ClientMetricsServiceV2 {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import joi from 'joi';
|
import joi from 'joi';
|
||||||
import { IMetricsBucket } from 'lib/types';
|
import { IMetricsBucket } from '../../../types';
|
||||||
|
|
||||||
const countSchema = joi
|
const countSchema = joi
|
||||||
.object()
|
.object()
|
||||||
|
@ -9,7 +9,7 @@ import {
|
|||||||
} from './variant';
|
} from './variant';
|
||||||
import { Context } from './context';
|
import { Context } from './context';
|
||||||
import { SegmentForEvaluation } from './strategy/strategy';
|
import { SegmentForEvaluation } from './strategy/strategy';
|
||||||
import { PlaygroundStrategySchema } from 'lib/openapi/spec/playground-strategy-schema';
|
import { PlaygroundStrategySchema } from '../../../openapi/spec/playground-strategy-schema';
|
||||||
import { playgroundStrategyEvaluation } from '../../../openapi/spec/playground-strategy-schema';
|
import { playgroundStrategyEvaluation } from '../../../openapi/spec/playground-strategy-schema';
|
||||||
|
|
||||||
export type StrategyEvaluationResult = Pick<
|
export type StrategyEvaluationResult = Pick<
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { PlaygroundConstraintSchema } from 'lib/openapi/spec/playground-constraint-schema';
|
import { PlaygroundConstraintSchema } from '../../../../openapi/spec/playground-constraint-schema';
|
||||||
import { PlaygroundSegmentSchema } from 'lib/openapi/spec/playground-segment-schema';
|
import { PlaygroundSegmentSchema } from '../../../../openapi/spec/playground-segment-schema';
|
||||||
import { StrategyEvaluationResult } from '../client';
|
import { StrategyEvaluationResult } from '../client';
|
||||||
import { Constraint, operators } from '../constraint';
|
import { Constraint, operators } from '../constraint';
|
||||||
import { Context } from '../context';
|
import { Context } from '../context';
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { SdkContextSchema } from 'lib/openapi/spec/sdk-context-schema';
|
import { SdkContextSchema } from '../../openapi/spec/sdk-context-schema';
|
||||||
import { InMemStorageProvider, FeatureEvaluator } from './feature-evaluator';
|
import { InMemStorageProvider, FeatureEvaluator } from './feature-evaluator';
|
||||||
import { FeatureConfigurationClient } from 'lib/features/feature-toggle/types/feature-toggle-strategies-store-type';
|
import { FeatureConfigurationClient } from '../../features/feature-toggle/types/feature-toggle-strategies-store-type';
|
||||||
import { Segment } from './feature-evaluator/strategy/strategy';
|
import { Segment } from './feature-evaluator/strategy/strategy';
|
||||||
import { ISegment } from 'lib/types/model';
|
import { ISegment } from '../../types/model';
|
||||||
import { serializeDates } from '../../types/serialize-dates';
|
import { serializeDates } from '../../types/serialize-dates';
|
||||||
import { Operator } from './feature-evaluator/constraint';
|
import { Operator } from './feature-evaluator/constraint';
|
||||||
import { FeatureInterface } from 'unleash-client/lib/feature';
|
import { FeatureInterface } from 'unleash-client/lib/feature';
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
import FeatureToggleService from '../feature-toggle/feature-toggle-service';
|
import FeatureToggleService from '../feature-toggle/feature-toggle-service';
|
||||||
import { SdkContextSchema } from 'lib/openapi/spec/sdk-context-schema';
|
import { SdkContextSchema } from '../../openapi/spec/sdk-context-schema';
|
||||||
import { IUnleashServices } from 'lib/types/services';
|
import { IUnleashServices } from '../../types/services';
|
||||||
import { ALL } from '../../types/models/api-token';
|
import { ALL } from '../../types/models/api-token';
|
||||||
import { PlaygroundFeatureSchema } from 'lib/openapi/spec/playground-feature-schema';
|
import { PlaygroundFeatureSchema } from '../../openapi/spec/playground-feature-schema';
|
||||||
import { Logger } from '../../logger';
|
import { Logger } from '../../logger';
|
||||||
import { IFlagResolver, ISegment, IUnleashConfig } from 'lib/types';
|
import { IFlagResolver, ISegment, IUnleashConfig } from '../../types';
|
||||||
import { offlineUnleashClient } from './offline-unleash-client';
|
import { offlineUnleashClient } from './offline-unleash-client';
|
||||||
import { FeatureInterface } from 'lib/features/playground/feature-evaluator/feature';
|
import { FeatureInterface } from '../../features/playground/feature-evaluator/feature';
|
||||||
import {
|
import {
|
||||||
EvaluatedPlaygroundStrategy,
|
EvaluatedPlaygroundStrategy,
|
||||||
FeatureStrategiesEvaluationResult,
|
FeatureStrategiesEvaluationResult,
|
||||||
} from 'lib/features/playground/feature-evaluator/client';
|
} from '../../features/playground/feature-evaluator/client';
|
||||||
import { ISegmentService } from 'lib/segments/segment-service-interface';
|
import { ISegmentService } from '../../segments/segment-service-interface';
|
||||||
import { FeatureConfigurationClient } from '../feature-toggle/types/feature-toggle-strategies-store-type';
|
import { FeatureConfigurationClient } from '../feature-toggle/types/feature-toggle-strategies-store-type';
|
||||||
import { generateObjectCombinations } from './generateObjectCombinations';
|
import { generateObjectCombinations } from './generateObjectCombinations';
|
||||||
import groupBy from 'lodash.groupby';
|
import groupBy from 'lodash.groupby';
|
||||||
@ -19,7 +19,7 @@ import { omitKeys } from '../../util';
|
|||||||
import { AdvancedPlaygroundFeatureSchema } from '../../openapi';
|
import { AdvancedPlaygroundFeatureSchema } from '../../openapi';
|
||||||
import { AdvancedPlaygroundEnvironmentFeatureSchema } from '../../openapi/spec/advanced-playground-environment-feature-schema';
|
import { AdvancedPlaygroundEnvironmentFeatureSchema } from '../../openapi/spec/advanced-playground-environment-feature-schema';
|
||||||
import { validateQueryComplexity } from './validateQueryComplexity';
|
import { validateQueryComplexity } from './validateQueryComplexity';
|
||||||
import { playgroundStrategyEvaluation } from 'lib/openapi';
|
import { playgroundStrategyEvaluation } from '../../openapi';
|
||||||
import { IPrivateProjectChecker } from '../private-project/privateProjectCheckerType';
|
import { IPrivateProjectChecker } from '../private-project/privateProjectCheckerType';
|
||||||
import { getDefaultVariant } from './feature-evaluator/variant';
|
import { getDefaultVariant } from './feature-evaluator/variant';
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import {
|
|||||||
PlaygroundRequestSchema,
|
PlaygroundRequestSchema,
|
||||||
PlaygroundResponseSchema,
|
PlaygroundResponseSchema,
|
||||||
PlaygroundStrategySchema,
|
PlaygroundStrategySchema,
|
||||||
} from 'lib/openapi';
|
} from '../../openapi';
|
||||||
import {
|
import {
|
||||||
AdvancedPlaygroundFeatureEvaluationResult,
|
AdvancedPlaygroundFeatureEvaluationResult,
|
||||||
PlaygroundFeatureEvaluationResult,
|
PlaygroundFeatureEvaluationResult,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Db, IUnleashConfig } from 'lib/server-impl';
|
import { Db, IUnleashConfig } from '../../server-impl';
|
||||||
import PrivateProjectStore from './privateProjectStore';
|
import PrivateProjectStore from './privateProjectStore';
|
||||||
import { PrivateProjectChecker } from './privateProjectChecker';
|
import { PrivateProjectChecker } from './privateProjectChecker';
|
||||||
import { FakePrivateProjectChecker } from './fakePrivateProjectChecker';
|
import { FakePrivateProjectChecker } from './fakePrivateProjectChecker';
|
||||||
|
@ -17,9 +17,9 @@ import { BadDataError, UNIQUE_CONSTRAINT_VIOLATION } from '../../error';
|
|||||||
import NameExistsError from '../../error/name-exists-error';
|
import NameExistsError from '../../error/name-exists-error';
|
||||||
import { sortOrderSchema } from '../../services/state-schema';
|
import { sortOrderSchema } from '../../services/state-schema';
|
||||||
import NotFoundError from '../../error/notfound-error';
|
import NotFoundError from '../../error/notfound-error';
|
||||||
import { IProjectStore } from 'lib/types/stores/project-store';
|
import { IProjectStore } from '../../types/stores/project-store';
|
||||||
import MinimumOneEnvironmentError from '../../error/minimum-one-environment-error';
|
import MinimumOneEnvironmentError from '../../error/minimum-one-environment-error';
|
||||||
import { IFlagResolver } from 'lib/types/experimental';
|
import { IFlagResolver } from '../../types/experimental';
|
||||||
import { CreateFeatureStrategySchema } from '../../openapi';
|
import { CreateFeatureStrategySchema } from '../../openapi';
|
||||||
import EventService from '../../services/event-service';
|
import EventService from '../../services/event-service';
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Db, IUnleashConfig } from 'lib/server-impl';
|
import { Db, IUnleashConfig } from '../../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';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Db, IUnleashConfig } from 'lib/server-impl';
|
import { Db, IUnleashConfig } from '../../server-impl';
|
||||||
import { EventService, SegmentService } from '../../services';
|
import { EventService, SegmentService } from '../../services';
|
||||||
import FakeEventStore from '../../../test/fixtures/fake-event-store';
|
import FakeEventStore from '../../../test/fixtures/fake-event-store';
|
||||||
import { ISegmentService } from '../../segments/segment-service-interface';
|
import { ISegmentService } from '../../segments/segment-service-interface';
|
||||||
|
@ -6,8 +6,8 @@ import { ALL, ApiTokenType } from '../types/models/api-token';
|
|||||||
import apiTokenMiddleware, {
|
import apiTokenMiddleware, {
|
||||||
TOKEN_TYPE_ERROR_MESSAGE,
|
TOKEN_TYPE_ERROR_MESSAGE,
|
||||||
} from './api-token-middleware';
|
} from './api-token-middleware';
|
||||||
import { ApiTokenService } from 'lib/services';
|
import { ApiTokenService } from '../services';
|
||||||
import { IUnleashConfig } from 'lib/types';
|
import { IUnleashConfig } from '../types';
|
||||||
|
|
||||||
let config: IUnleashConfig;
|
let config: IUnleashConfig;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { ApiTokenType } from '../types/models/api-token';
|
import { ApiTokenType } from '../types/models/api-token';
|
||||||
import { IUnleashConfig } from '../types/option';
|
import { IUnleashConfig } from '../types/option';
|
||||||
import { IApiRequest, IAuthRequest } from '../routes/unleash-types';
|
import { IApiRequest, IAuthRequest } from '../routes/unleash-types';
|
||||||
import { IUnleashServices } from 'lib/server-impl';
|
import { IUnleashServices } from '../server-impl';
|
||||||
|
|
||||||
const isClientApi = ({ path }) => {
|
const isClientApi = ({ path }) => {
|
||||||
return path && path.indexOf('/api/client') > -1;
|
return path && path.indexOf('/api/client') > -1;
|
||||||
|
@ -4,8 +4,8 @@ import { IUnleashServices } from '../types/services';
|
|||||||
import { IUnleashConfig } from '../types/option';
|
import { IUnleashConfig } from '../types/option';
|
||||||
import ApiUser from '../types/api-user';
|
import ApiUser from '../types/api-user';
|
||||||
import { ApiTokenType } from '../types/models/api-token';
|
import { ApiTokenType } from '../types/models/api-token';
|
||||||
import { IAuthRequest } from 'lib/server-impl';
|
import { IAuthRequest } from '../server-impl';
|
||||||
import { IApiRequest } from 'lib/routes/unleash-types';
|
import { IApiRequest } from '../routes/unleash-types';
|
||||||
import { encrypt } from '../util';
|
import { encrypt } from '../util';
|
||||||
|
|
||||||
function demoAuthentication(
|
function demoAuthentication(
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IAuthRequest } from 'lib/routes/unleash-types';
|
import { IAuthRequest } from '../routes/unleash-types';
|
||||||
import supertest from 'supertest';
|
import supertest from 'supertest';
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import noAuthentication from './no-authentication';
|
import noAuthentication from './no-authentication';
|
||||||
|
@ -2,7 +2,7 @@ import * as responseTime from 'response-time';
|
|||||||
import EventEmitter from 'events';
|
import EventEmitter from 'events';
|
||||||
import { REQUEST_TIME } from '../metric-events';
|
import { REQUEST_TIME } from '../metric-events';
|
||||||
import { IFlagResolver } from '../types/experimental';
|
import { IFlagResolver } from '../types/experimental';
|
||||||
import { InstanceStatsService } from 'lib/services';
|
import { InstanceStatsService } from '../services';
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||||
const _responseTime = responseTime.default;
|
const _responseTime = responseTime.default;
|
||||||
|
@ -22,7 +22,7 @@ import {
|
|||||||
emptyResponse,
|
emptyResponse,
|
||||||
getStandardResponses,
|
getStandardResponses,
|
||||||
} from '../../openapi/util/standard-responses';
|
} from '../../openapi/util/standard-responses';
|
||||||
import { AddonCreateUpdateSchema } from 'lib/openapi/spec/addon-create-update-schema';
|
import { AddonCreateUpdateSchema } from '../../openapi/spec/addon-create-update-schema';
|
||||||
|
|
||||||
type AddonServices = Pick<IUnleashServices, 'addonService' | 'openApiService'>;
|
type AddonServices = Pick<IUnleashServices, 'addonService' | 'openApiService'>;
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@ import { IUnleashServices } from '../../types/services';
|
|||||||
import { IAuthType, IUnleashConfig } from '../../types/option';
|
import { IAuthType, IUnleashConfig } from '../../types/option';
|
||||||
import version from '../../util/version';
|
import version from '../../util/version';
|
||||||
import Controller from '../controller';
|
import Controller from '../controller';
|
||||||
import VersionService from 'lib/services/version-service';
|
import VersionService from '../../services/version-service';
|
||||||
import SettingService from 'lib/services/setting-service';
|
import SettingService from '../../services/setting-service';
|
||||||
import {
|
import {
|
||||||
simpleAuthSettingsKey,
|
simpleAuthSettingsKey,
|
||||||
SimpleAuthSettings,
|
SimpleAuthSettings,
|
||||||
@ -24,8 +24,8 @@ import { extractUsername } from '../../util/extract-user';
|
|||||||
import NotFoundError from '../../error/notfound-error';
|
import NotFoundError from '../../error/notfound-error';
|
||||||
import { SetUiConfigSchema } from '../../openapi/spec/set-ui-config-schema';
|
import { SetUiConfigSchema } from '../../openapi/spec/set-ui-config-schema';
|
||||||
import { createRequestSchema } from '../../openapi/util/create-request-schema';
|
import { createRequestSchema } from '../../openapi/util/create-request-schema';
|
||||||
import { ProxyService } from 'lib/services';
|
import { ProxyService } from '../../services';
|
||||||
import MaintenanceService from 'lib/features/maintenance/maintenance-service';
|
import MaintenanceService from '../../features/maintenance/maintenance-service';
|
||||||
|
|
||||||
class ConfigController extends Controller {
|
class ConfigController extends Controller {
|
||||||
private versionService: VersionService;
|
private versionService: VersionService;
|
||||||
|
@ -38,8 +38,8 @@ import {
|
|||||||
ContextFieldStrategiesSchema,
|
ContextFieldStrategiesSchema,
|
||||||
contextFieldStrategiesSchema,
|
contextFieldStrategiesSchema,
|
||||||
} from '../../openapi/spec/context-field-strategies-schema';
|
} from '../../openapi/spec/context-field-strategies-schema';
|
||||||
import { UpdateContextFieldSchema } from 'lib/openapi/spec/update-context-field-schema';
|
import { UpdateContextFieldSchema } from '../../openapi/spec/update-context-field-schema';
|
||||||
import { CreateContextFieldSchema } from 'lib/openapi/spec/create-context-field-schema';
|
import { CreateContextFieldSchema } from '../../openapi/spec/create-context-field-schema';
|
||||||
|
|
||||||
interface ContextParam {
|
interface ContextParam {
|
||||||
contextField: string;
|
contextField: string;
|
||||||
|
@ -31,7 +31,7 @@ import ProjectArchiveController from './project-archive';
|
|||||||
import { createKnexTransactionStarter } from '../../../db/transaction';
|
import { createKnexTransactionStarter } from '../../../db/transaction';
|
||||||
import { Db } from '../../../db/db';
|
import { Db } from '../../../db/db';
|
||||||
import DependentFeaturesController from '../../../features/dependent-features/dependent-features-controller';
|
import DependentFeaturesController from '../../../features/dependent-features/dependent-features-controller';
|
||||||
import { ProjectOverviewSchema } from 'lib/openapi/spec/project-overview-schema';
|
import { ProjectOverviewSchema } from '../../../openapi/spec/project-overview-schema';
|
||||||
|
|
||||||
export default class ProjectApi extends Controller {
|
export default class ProjectApi extends Controller {
|
||||||
private projectService: ProjectService;
|
private projectService: ProjectService;
|
||||||
|
@ -18,8 +18,8 @@ import { createRequestSchema } from '../../../openapi/util/create-request-schema
|
|||||||
import { createResponseSchema } from '../../../openapi/util/create-response-schema';
|
import { createResponseSchema } from '../../../openapi/util/create-response-schema';
|
||||||
import { AccessService } from '../../../services';
|
import { AccessService } from '../../../services';
|
||||||
import { BadDataError, PermissionError } from '../../../../lib/error';
|
import { BadDataError, PermissionError } from '../../../../lib/error';
|
||||||
import { IUser } from 'lib/server-impl';
|
import { IUser } from '../../../server-impl';
|
||||||
import { PushVariantsSchema } from 'lib/openapi/spec/push-variants-schema';
|
import { PushVariantsSchema } from '../../../openapi/spec/push-variants-schema';
|
||||||
import { getStandardResponses } from '../../../openapi';
|
import { getStandardResponses } from '../../../openapi';
|
||||||
|
|
||||||
const PREFIX = '/:projectId/features/:featureName/variants';
|
const PREFIX = '/:projectId/features/:featureName/variants';
|
||||||
|
@ -25,7 +25,7 @@ import {
|
|||||||
emptyResponse,
|
emptyResponse,
|
||||||
getStandardResponses,
|
getStandardResponses,
|
||||||
} from '../../openapi/util/standard-responses';
|
} from '../../openapi/util/standard-responses';
|
||||||
import FeatureTagService from 'lib/services/feature-tag-service';
|
import FeatureTagService from '../../services/feature-tag-service';
|
||||||
import { IFlagResolver } from '../../types';
|
import { IFlagResolver } from '../../types';
|
||||||
|
|
||||||
const version = 1;
|
const version = 1;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { Response } from 'express';
|
import { Response } from 'express';
|
||||||
import { OpenApiService } from 'lib/services';
|
import { OpenApiService } from '../../services';
|
||||||
import { IAuthRequest } from '../unleash-types';
|
import { IAuthRequest } from '../unleash-types';
|
||||||
import { IUnleashConfig } from '../../types/option';
|
import { IUnleashConfig } from '../../types/option';
|
||||||
import Controller from '../controller';
|
import Controller from '../controller';
|
||||||
import { NONE } from '../../types/permissions';
|
import { NONE } from '../../types/permissions';
|
||||||
import { IUnleashServices } from 'lib/types';
|
import { IUnleashServices } from '../../types';
|
||||||
import { createResponseSchema } from '../../openapi/util/create-response-schema';
|
import { createResponseSchema } from '../../openapi/util/create-response-schema';
|
||||||
import {
|
import {
|
||||||
telemetrySettingsSchema,
|
telemetrySettingsSchema,
|
||||||
|
@ -10,7 +10,7 @@ import { OpenApiService } from '../../services/openapi-service';
|
|||||||
import { createResponseSchema } from '../../openapi/util/create-response-schema';
|
import { createResponseSchema } from '../../openapi/util/create-response-schema';
|
||||||
import { splashRequestSchema } from '../../openapi/spec/splash-request-schema';
|
import { splashRequestSchema } from '../../openapi/spec/splash-request-schema';
|
||||||
import { getStandardResponses } from '../../openapi';
|
import { getStandardResponses } from '../../openapi';
|
||||||
import { SplashResponseSchema } from 'lib/openapi/spec/splash-response-schema';
|
import { SplashResponseSchema } from '../../openapi/spec/splash-response-schema';
|
||||||
|
|
||||||
class UserSplashController extends Controller {
|
class UserSplashController extends Controller {
|
||||||
private logger: Logger;
|
private logger: Logger;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { IRouter, Router, Request, Response, RequestHandler } from 'express';
|
import { IRouter, Router, Request, Response, RequestHandler } from 'express';
|
||||||
import { Logger } from 'lib/logger';
|
import { Logger } from '../logger';
|
||||||
import { IUnleashConfig, NONE } from '../types';
|
import { IUnleashConfig, NONE } from '../types';
|
||||||
import { handleErrors } from './util';
|
import { handleErrors } from './util';
|
||||||
import requireContentType from '../middleware/content_type_checker';
|
import requireContentType from '../middleware/content_type_checker';
|
||||||
|
@ -5,7 +5,7 @@ import getApp from '../app';
|
|||||||
import supertest, { Test } from 'supertest';
|
import supertest, { Test } from 'supertest';
|
||||||
import permissions from '../../test/fixtures/permissions';
|
import permissions from '../../test/fixtures/permissions';
|
||||||
import { RoleName, RoleType } from '../types/model';
|
import { RoleName, RoleType } from '../types/model';
|
||||||
import { IUnleashStores } from 'lib/types';
|
import { IUnleashStores } from '../types';
|
||||||
import TestAgent from 'supertest/lib/agent';
|
import TestAgent from 'supertest/lib/agent';
|
||||||
|
|
||||||
describe('Public Signup API', () => {
|
describe('Public Signup API', () => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { ChangeRequestStrategy } from 'lib/features/change-request-segment-usage-service/change-request-segment-usage-read-model';
|
import { ChangeRequestStrategy } from '../features/change-request-segment-usage-service/change-request-segment-usage-read-model';
|
||||||
import { UpsertSegmentSchema } from 'lib/openapi';
|
import { UpsertSegmentSchema } from '../openapi';
|
||||||
import { IClientSegment, IFeatureStrategy, ISegment, IUser } from 'lib/types';
|
import { IClientSegment, IFeatureStrategy, ISegment, IUser } from '../types';
|
||||||
|
|
||||||
export type StrategiesUsingSegment = {
|
export type StrategiesUsingSegment = {
|
||||||
strategies: IFeatureStrategy[];
|
strategies: IFeatureStrategy[];
|
||||||
|
@ -4,7 +4,7 @@ import { IUnleashConfig } from '../types/option';
|
|||||||
import { IAccountStore, IUnleashStores } from '../types/stores';
|
import { IAccountStore, IUnleashStores } from '../types/stores';
|
||||||
import { AccessService } from './access-service';
|
import { AccessService } from './access-service';
|
||||||
import { RoleName } from '../types/model';
|
import { RoleName } from '../types/model';
|
||||||
import { IAdminCount } from 'lib/types/stores/account-store';
|
import { IAdminCount } from '../types/stores/account-store';
|
||||||
|
|
||||||
interface IUserWithRole extends IUser {
|
interface IUserWithRole extends IUser {
|
||||||
rootRole: number;
|
rootRole: number;
|
||||||
|
@ -17,7 +17,7 @@ import {
|
|||||||
import { IApiTokenStore } from '../types/stores/api-token-store';
|
import { IApiTokenStore } from '../types/stores/api-token-store';
|
||||||
import { FOREIGN_KEY_VIOLATION } from '../error/db-error';
|
import { FOREIGN_KEY_VIOLATION } from '../error/db-error';
|
||||||
import BadDataError from '../error/bad-data-error';
|
import BadDataError from '../error/bad-data-error';
|
||||||
import { IEnvironmentStore } from 'lib/features/project-environments/environment-store-type';
|
import { IEnvironmentStore } from '../features/project-environments/environment-store-type';
|
||||||
import { constantTimeCompare } from '../util/constantTimeCompare';
|
import { constantTimeCompare } from '../util/constantTimeCompare';
|
||||||
import {
|
import {
|
||||||
ApiTokenCreatedEvent,
|
ApiTokenCreatedEvent,
|
||||||
|
@ -7,8 +7,8 @@ import {
|
|||||||
import { createTestConfig } from '../../test/config/test-config';
|
import { createTestConfig } from '../../test/config/test-config';
|
||||||
import FeatureToggleService from '../features/feature-toggle/feature-toggle-service';
|
import FeatureToggleService from '../features/feature-toggle/feature-toggle-service';
|
||||||
import { AccessService } from './access-service';
|
import { AccessService } from './access-service';
|
||||||
import { IChangeRequestAccessReadModel } from 'lib/features/change-request-access-service/change-request-access-read-model';
|
import { IChangeRequestAccessReadModel } from '../features/change-request-access-service/change-request-access-read-model';
|
||||||
import { ISegmentService } from 'lib/segments/segment-service-interface';
|
import { ISegmentService } from '../segments/segment-service-interface';
|
||||||
import { IPrivateProjectChecker } from '../features/private-project/privateProjectCheckerType';
|
import { IPrivateProjectChecker } from '../features/private-project/privateProjectCheckerType';
|
||||||
import { IDependentFeaturesReadModel } from '../features/dependent-features/dependent-features-read-model-type';
|
import { IDependentFeaturesReadModel } from '../features/dependent-features/dependent-features-read-model-type';
|
||||||
import EventService from './event-service';
|
import EventService from './event-service';
|
||||||
|
@ -57,13 +57,13 @@ import IncompatibleProjectError from '../error/incompatible-project-error';
|
|||||||
import ProjectWithoutOwnerError from '../error/project-without-owner-error';
|
import ProjectWithoutOwnerError from '../error/project-without-owner-error';
|
||||||
import { arraysHaveSameItems } from '../util';
|
import { arraysHaveSameItems } from '../util';
|
||||||
import { GroupService } from './group-service';
|
import { GroupService } from './group-service';
|
||||||
import { IGroupRole } from 'lib/types/group';
|
import { IGroupRole } from '../types/group';
|
||||||
import { FavoritesService } from './favorites-service';
|
import { FavoritesService } from './favorites-service';
|
||||||
import { calculateAverageTimeToProd } from '../features/feature-toggle/time-to-production/time-to-production';
|
import { calculateAverageTimeToProd } from '../features/feature-toggle/time-to-production/time-to-production';
|
||||||
import { IProjectStatsStore } from 'lib/types/stores/project-stats-store-type';
|
import { IProjectStatsStore } from '../types/stores/project-stats-store-type';
|
||||||
import { uniqueByKey } from '../util/unique';
|
import { uniqueByKey } from '../util/unique';
|
||||||
import { BadDataError, PermissionError } from '../error';
|
import { BadDataError, PermissionError } from '../error';
|
||||||
import { ProjectDoraMetricsSchema } from 'lib/openapi';
|
import { ProjectDoraMetricsSchema } from '../openapi';
|
||||||
import { checkFeatureNamingData } from '../features/feature-naming-pattern/feature-naming-validation';
|
import { checkFeatureNamingData } from '../features/feature-naming-pattern/feature-naming-validation';
|
||||||
import { IPrivateProjectChecker } from '../features/private-project/privateProjectCheckerType';
|
import { IPrivateProjectChecker } from '../features/private-project/privateProjectCheckerType';
|
||||||
import EventService from './event-service';
|
import EventService from './event-service';
|
||||||
|
@ -6,7 +6,7 @@ import { PublicSignupTokenSchema } from '../openapi/spec/public-signup-token-sch
|
|||||||
import { IRoleStore } from '../types/stores/role-store';
|
import { IRoleStore } from '../types/stores/role-store';
|
||||||
import { IPublicSignupTokenCreate } from '../types/models/public-signup-token';
|
import { IPublicSignupTokenCreate } from '../types/models/public-signup-token';
|
||||||
import { PublicSignupTokenCreateSchema } from '../openapi/spec/public-signup-token-create-schema';
|
import { PublicSignupTokenCreateSchema } from '../openapi/spec/public-signup-token-create-schema';
|
||||||
import { CreateInvitedUserSchema } from 'lib/openapi/spec/create-invited-user-schema';
|
import { CreateInvitedUserSchema } from '../openapi/spec/create-invited-user-schema';
|
||||||
import { RoleName } from '../types/model';
|
import { RoleName } from '../types/model';
|
||||||
import {
|
import {
|
||||||
PublicSignupTokenCreatedEvent,
|
PublicSignupTokenCreatedEvent,
|
||||||
|
@ -27,7 +27,7 @@ import { PermissionError } from '../error';
|
|||||||
import { IChangeRequestAccessReadModel } from '../features/change-request-access-service/change-request-access-read-model';
|
import { IChangeRequestAccessReadModel } from '../features/change-request-access-service/change-request-access-read-model';
|
||||||
import { IPrivateProjectChecker } from '../features/private-project/privateProjectCheckerType';
|
import { IPrivateProjectChecker } from '../features/private-project/privateProjectCheckerType';
|
||||||
import EventService from './event-service';
|
import EventService from './event-service';
|
||||||
import { IChangeRequestSegmentUsageReadModel } from 'lib/features/change-request-segment-usage-service/change-request-segment-usage-read-model';
|
import { IChangeRequestSegmentUsageReadModel } from '../features/change-request-segment-usage-service/change-request-segment-usage-read-model';
|
||||||
|
|
||||||
export class SegmentService implements ISegmentService {
|
export class SegmentService implements ISegmentService {
|
||||||
private logger: Logger;
|
private logger: Logger;
|
||||||
|
@ -16,7 +16,7 @@ import { IUnleashConfig } from '../types/option';
|
|||||||
import version from '../util/version';
|
import version from '../util/version';
|
||||||
import { Logger } from '../logger';
|
import { Logger } from '../logger';
|
||||||
import { ISettingStore } from '../types/stores/settings-store';
|
import { ISettingStore } from '../types/stores/settings-store';
|
||||||
import { IStrategyStore } from 'lib/types';
|
import { IStrategyStore } from '../types';
|
||||||
import { FEATURES_EXPORTED, FEATURES_IMPORTED } from '../types';
|
import { FEATURES_EXPORTED, FEATURES_IMPORTED } from '../types';
|
||||||
import { CUSTOM_ROOT_ROLE_TYPE } from '../util';
|
import { CUSTOM_ROOT_ROLE_TYPE } from '../util';
|
||||||
import { GetActiveUsers } from '../features/instance-stats/getActiveUsers';
|
import { GetActiveUsers } from '../features/instance-stats/getActiveUsers';
|
||||||
|
@ -2,7 +2,7 @@ import { getDbConfig } from '../../test/e2e/helpers/database-config';
|
|||||||
import { createTestConfig } from '../../test/config/test-config';
|
import { createTestConfig } from '../../test/config/test-config';
|
||||||
import { log } from 'db-migrate-shared';
|
import { log } from 'db-migrate-shared';
|
||||||
import { Client } from 'pg';
|
import { Client } from 'pg';
|
||||||
import { IDBOption } from 'lib/types';
|
import { IDBOption } from '../../lib/types';
|
||||||
import { migrateDb } from '../../migrator';
|
import { migrateDb } from '../../migrator';
|
||||||
import { SYSTEM_USER } from './core';
|
import { SYSTEM_USER } from './core';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import { LogProvider } from '../logger';
|
|||||||
import { IRole } from './stores/access-store';
|
import { IRole } from './stores/access-store';
|
||||||
import { IUser } from './user';
|
import { IUser } from './user';
|
||||||
import { ALL_OPERATORS } from '../util';
|
import { ALL_OPERATORS } from '../util';
|
||||||
import { IProjectStats } from 'lib/services/project-service';
|
import { IProjectStats } from '../services/project-service';
|
||||||
import { CreateFeatureStrategySchema } from '../openapi';
|
import { CreateFeatureStrategySchema } from '../openapi';
|
||||||
import { ProjectEnvironment } from './stores/project-store';
|
import { ProjectEnvironment } from './stores/project-store';
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ import ClientMetricsServiceV2 from '../features/metrics/client-metrics/metrics-s
|
|||||||
import UserSplashService from '../services/user-splash-service';
|
import UserSplashService from '../services/user-splash-service';
|
||||||
import { OpenApiService } from '../services/openapi-service';
|
import { OpenApiService } from '../services/openapi-service';
|
||||||
import { ClientSpecService } from '../services/client-spec-service';
|
import { ClientSpecService } from '../services/client-spec-service';
|
||||||
import { PlaygroundService } from 'lib/features/playground/playground-service';
|
import { PlaygroundService } from '../features/playground/playground-service';
|
||||||
import { GroupService } from '../services/group-service';
|
import { GroupService } from '../services/group-service';
|
||||||
import { ProxyService } from '../services/proxy-service';
|
import { ProxyService } from '../services/proxy-service';
|
||||||
import EdgeService from '../services/edge-service';
|
import EdgeService from '../services/edge-service';
|
||||||
@ -45,12 +45,12 @@ import {
|
|||||||
} from '../features/export-import-toggles/export-import-service';
|
} from '../features/export-import-toggles/export-import-service';
|
||||||
import { ISegmentService } from '../segments/segment-service-interface';
|
import { ISegmentService } from '../segments/segment-service-interface';
|
||||||
import ConfigurationRevisionService from '../features/feature-toggle/configuration-revision-service';
|
import ConfigurationRevisionService from '../features/feature-toggle/configuration-revision-service';
|
||||||
import EventAnnouncerService from 'lib/services/event-announcer-service';
|
import EventAnnouncerService from '../services/event-announcer-service';
|
||||||
import { IPrivateProjectChecker } from '../features/private-project/privateProjectCheckerType';
|
import { IPrivateProjectChecker } from '../features/private-project/privateProjectCheckerType';
|
||||||
import { DependentFeaturesService } from '../features/dependent-features/dependent-features-service';
|
import { DependentFeaturesService } from '../features/dependent-features/dependent-features-service';
|
||||||
import { WithTransactional } from 'lib/db/transaction';
|
import { WithTransactional } from '../db/transaction';
|
||||||
import { ClientFeatureToggleService } from 'lib/features/client-feature-toggles/client-feature-toggle-service';
|
import { ClientFeatureToggleService } from '../features/client-feature-toggles/client-feature-toggle-service';
|
||||||
import { FeatureSearchService } from 'lib/features/feature-search/feature-search-service';
|
import { FeatureSearchService } from '../features/feature-search/feature-search-service';
|
||||||
|
|
||||||
export interface IUnleashServices {
|
export interface IUnleashServices {
|
||||||
accessService: AccessService;
|
accessService: AccessService;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { PermissionRef } from 'lib/services/access-service';
|
import { PermissionRef } from '../../services/access-service';
|
||||||
import { IGroupModelWithProjectRole } from '../group';
|
import { IGroupModelWithProjectRole } from '../group';
|
||||||
import { IPermission, IUserAccessOverview, IUserWithRole } from '../model';
|
import { IPermission, IUserAccessOverview, IUserWithRole } from '../model';
|
||||||
import { Store } from './store';
|
import { Store } from './store';
|
||||||
|
@ -2,7 +2,7 @@ import { IBaseEvent, IEvent } from '../events';
|
|||||||
import { Store } from './store';
|
import { Store } from './store';
|
||||||
import { SearchEventsSchema } from '../../openapi/spec/search-events-schema';
|
import { SearchEventsSchema } from '../../openapi/spec/search-events-schema';
|
||||||
import EventEmitter from 'events';
|
import EventEmitter from 'events';
|
||||||
import { IQueryOperations } from 'lib/db/event-store';
|
import { IQueryOperations } from '../../db/event-store';
|
||||||
|
|
||||||
export interface IEventStore
|
export interface IEventStore
|
||||||
extends Store<IEvent, number>,
|
extends Store<IEvent, number>,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { DoraFeaturesSchema } from 'lib/openapi';
|
import { DoraFeaturesSchema } from '../../openapi';
|
||||||
import { IProjectStats } from 'lib/services/project-service';
|
import { IProjectStats } from '../../services/project-service';
|
||||||
|
|
||||||
export interface ICreateEnabledDates {
|
export interface ICreateEnabledDates {
|
||||||
created: Date;
|
created: Date;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { RoleSchema } from 'lib/openapi';
|
import { RoleSchema } from '../../openapi';
|
||||||
import { ICustomRole } from '../model';
|
import { ICustomRole } from '../model';
|
||||||
import { IRole, IUserRole } from './access-store';
|
import { IRole, IUserRole } from './access-store';
|
||||||
import { Store } from './store';
|
import { Store } from './store';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { CreateStrategySchema } from 'lib/openapi';
|
import { CreateStrategySchema } from '../../openapi';
|
||||||
import { Store } from './store';
|
import { Store } from './store';
|
||||||
|
|
||||||
export interface IStrategy {
|
export interface IStrategy {
|
||||||
|
@ -4,8 +4,8 @@ import { ALL_OPERATORS } from '../lib/util/constants';
|
|||||||
import { ClientFeatureSchema } from '../lib/openapi/spec/client-feature-schema';
|
import { ClientFeatureSchema } from '../lib/openapi/spec/client-feature-schema';
|
||||||
import { IVariant, WeightType } from '../lib/types/model';
|
import { IVariant, WeightType } from '../lib/types/model';
|
||||||
import { FeatureStrategySchema } from '../lib/openapi/spec/feature-strategy-schema';
|
import { FeatureStrategySchema } from '../lib/openapi/spec/feature-strategy-schema';
|
||||||
import { ConstraintSchema } from 'lib/openapi/spec/constraint-schema';
|
import { ConstraintSchema } from '../lib/openapi/spec/constraint-schema';
|
||||||
import { SegmentSchema } from 'lib/openapi/spec/segment-schema';
|
import { SegmentSchema } from '../lib/openapi/spec/segment-schema';
|
||||||
|
|
||||||
export const urlFriendlyString = (): Arbitrary<string> =>
|
export const urlFriendlyString = (): Arbitrary<string> =>
|
||||||
fc
|
fc
|
||||||
|
@ -14,7 +14,7 @@ import {
|
|||||||
UPDATE_CLIENT_API_TOKEN,
|
UPDATE_CLIENT_API_TOKEN,
|
||||||
} from '../../../../lib/types';
|
} from '../../../../lib/types';
|
||||||
import { addDays } from 'date-fns';
|
import { addDays } from 'date-fns';
|
||||||
import { AccessService, UserService } from 'lib/services';
|
import { AccessService, UserService } from '../../../../lib/services';
|
||||||
|
|
||||||
let stores: IUnleashStores;
|
let stores: IUnleashStores;
|
||||||
let db: ITestDb;
|
let db: ITestDb;
|
||||||
|
@ -10,10 +10,10 @@ import {
|
|||||||
ApiTokenType,
|
ApiTokenType,
|
||||||
IApiToken,
|
IApiToken,
|
||||||
} from '../../../../lib/types/models/api-token';
|
} from '../../../../lib/types/models/api-token';
|
||||||
import { PlaygroundFeatureSchema } from 'lib/openapi/spec/playground-feature-schema';
|
import { PlaygroundFeatureSchema } from '../../../../lib/openapi/spec/playground-feature-schema';
|
||||||
import { ClientFeatureSchema } from 'lib/openapi/spec/client-feature-schema';
|
import { ClientFeatureSchema } from '../../../../lib/openapi/spec/client-feature-schema';
|
||||||
import { PlaygroundResponseSchema } from 'lib/openapi/spec/playground-response-schema';
|
import { PlaygroundResponseSchema } from '../../../../lib/openapi/spec/playground-response-schema';
|
||||||
import { PlaygroundRequestSchema } from 'lib/openapi/spec/playground-request-schema';
|
import { PlaygroundRequestSchema } from '../../../../lib/openapi/spec/playground-request-schema';
|
||||||
|
|
||||||
let app: IUnleashTest;
|
let app: IUnleashTest;
|
||||||
let db: ITestDb;
|
let db: ITestDb;
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
} from '../../../helpers/test-helper';
|
} from '../../../helpers/test-helper';
|
||||||
import getLogger from '../../../../fixtures/no-logger';
|
import getLogger from '../../../../fixtures/no-logger';
|
||||||
|
|
||||||
import { IProjectStore } from 'lib/types';
|
import { IProjectStore } from '../../../../../lib/types';
|
||||||
import { DEFAULT_ENV } from '../../../../../lib/util';
|
import { DEFAULT_ENV } from '../../../../../lib/util';
|
||||||
|
|
||||||
let app: IUnleashTest;
|
let app: IUnleashTest;
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
IUnleashTest,
|
IUnleashTest,
|
||||||
setupAppWithCustomConfig,
|
setupAppWithCustomConfig,
|
||||||
} from '../../helpers/test-helper';
|
} from '../../helpers/test-helper';
|
||||||
import { StrategiesUsingSegment } from 'lib/segments/segment-service-interface';
|
import { StrategiesUsingSegment } from '../../../../lib/segments/segment-service-interface';
|
||||||
import { IUser } from '../../../../lib/types';
|
import { IUser } from '../../../../lib/types';
|
||||||
|
|
||||||
let app: IUnleashTest;
|
let app: IUnleashTest;
|
||||||
|
@ -13,7 +13,7 @@ import { IRole } from '../../../../lib/types/stores/access-store';
|
|||||||
import { IEventStore } from '../../../../lib/types/stores/event-store';
|
import { IEventStore } from '../../../../lib/types/stores/event-store';
|
||||||
import { IUserStore } from '../../../../lib/types/stores/user-store';
|
import { IUserStore } from '../../../../lib/types/stores/user-store';
|
||||||
import { RoleName } from '../../../../lib/types/model';
|
import { RoleName } from '../../../../lib/types/model';
|
||||||
import { IRoleStore } from 'lib/types/stores/role-store';
|
import { IRoleStore } from '../../../../lib/types/stores/role-store';
|
||||||
import { randomId } from '../../../../lib/util/random-id';
|
import { randomId } from '../../../../lib/util/random-id';
|
||||||
import { omitKeys } from '../../../../lib/util/omit-keys';
|
import { omitKeys } from '../../../../lib/util/omit-keys';
|
||||||
import { ISessionStore } from '../../../../lib/types/stores/session-store';
|
import { ISessionStore } from '../../../../lib/types/stores/session-store';
|
||||||
|
@ -22,7 +22,7 @@ import {
|
|||||||
CreateFeatureStrategySchema,
|
CreateFeatureStrategySchema,
|
||||||
FeatureStrategySchema,
|
FeatureStrategySchema,
|
||||||
UpsertSegmentSchema,
|
UpsertSegmentSchema,
|
||||||
} from 'lib/openapi';
|
} from '../../../../lib/openapi';
|
||||||
import { DEFAULT_ENV } from '../../../../lib/util';
|
import { DEFAULT_ENV } from '../../../../lib/util';
|
||||||
import { DEFAULT_PROJECT } from '../../../../lib/types';
|
import { DEFAULT_PROJECT } from '../../../../lib/types';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import { createTestConfig } from '../config/test-config';
|
|||||||
import { getInstance } from 'db-migrate';
|
import { getInstance } from 'db-migrate';
|
||||||
import { log } from 'db-migrate-shared';
|
import { log } from 'db-migrate-shared';
|
||||||
import { Client } from 'pg';
|
import { Client } from 'pg';
|
||||||
import { IDBOption } from 'lib/types';
|
import { IDBOption } from '../../lib/types';
|
||||||
|
|
||||||
log.setLogLevel('error');
|
log.setLogLevel('error');
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import { createTestConfig } from '../config/test-config';
|
|||||||
import { getInstance } from 'db-migrate';
|
import { getInstance } from 'db-migrate';
|
||||||
import { log } from 'db-migrate-shared';
|
import { log } from 'db-migrate-shared';
|
||||||
import { Client } from 'pg';
|
import { Client } from 'pg';
|
||||||
import { IDBOption } from 'lib/types';
|
import { IDBOption } from '../../lib/types';
|
||||||
|
|
||||||
log.setLogLevel('error');
|
log.setLogLevel('error');
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { CreateFeatureStrategySchema } from 'lib/openapi';
|
import { CreateFeatureStrategySchema } from '../../../lib/openapi';
|
||||||
import { IUnleashTest } from './test-helper';
|
import { IUnleashTest } from './test-helper';
|
||||||
|
|
||||||
export const FEATURES_BASE_PATH = '/api/admin/projects/default/features';
|
export const FEATURES_BASE_PATH = '/api/admin/projects/default/features';
|
||||||
|
@ -10,7 +10,7 @@ import EnvironmentStore from '../../../lib/features/project-environments/environ
|
|||||||
import { IUnleashStores } from '../../../lib/types';
|
import { IUnleashStores } from '../../../lib/types';
|
||||||
import { IFeatureEnvironmentStore } from '../../../lib/types/stores/feature-environment-store';
|
import { IFeatureEnvironmentStore } from '../../../lib/types/stores/feature-environment-store';
|
||||||
import { DEFAULT_ENV } from '../../../lib/util/constants';
|
import { DEFAULT_ENV } from '../../../lib/util/constants';
|
||||||
import { IUnleashOptions, Knex } from 'lib/server-impl';
|
import { IUnleashOptions, Knex } from '../../../lib/server-impl';
|
||||||
|
|
||||||
// require('db-migrate-shared').log.silence(false);
|
// require('db-migrate-shared').log.silence(false);
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import {
|
|||||||
} from '../../../lib/types';
|
} from '../../../lib/types';
|
||||||
import { IUnleashServices } from '../../../lib/types/services';
|
import { IUnleashServices } from '../../../lib/types/services';
|
||||||
import { Db } from '../../../lib/db/db';
|
import { Db } from '../../../lib/db/db';
|
||||||
import { IContextFieldDto } from 'lib/types/stores/context-field-store';
|
import { IContextFieldDto } from '../../../lib/types/stores/context-field-store';
|
||||||
import { DEFAULT_ENV } from '../../../lib/util';
|
import { DEFAULT_ENV } from '../../../lib/util';
|
||||||
import {
|
import {
|
||||||
CreateFeatureSchema,
|
CreateFeatureSchema,
|
||||||
|
@ -3,7 +3,7 @@ import { createTestConfig } from '../config/test-config';
|
|||||||
import { getInstance } from 'db-migrate';
|
import { getInstance } from 'db-migrate';
|
||||||
import { log } from 'db-migrate-shared';
|
import { log } from 'db-migrate-shared';
|
||||||
import { Client } from 'pg';
|
import { Client } from 'pg';
|
||||||
import { IDBOption } from 'lib/types';
|
import { IDBOption } from '../../lib/types';
|
||||||
|
|
||||||
log.setLogLevel('error');
|
log.setLogLevel('error');
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import {
|
|||||||
ISegment,
|
ISegment,
|
||||||
} from '../../../lib/types/model';
|
} from '../../../lib/types/model';
|
||||||
import { IUnleashTest, setupApp } from '../helpers/test-helper';
|
import { IUnleashTest, setupApp } from '../helpers/test-helper';
|
||||||
import { UpsertSegmentSchema } from 'lib/openapi';
|
import { UpsertSegmentSchema } from '../../../lib/openapi';
|
||||||
|
|
||||||
interface ISeedSegmentSpec {
|
interface ISeedSegmentSpec {
|
||||||
featuresCount: number;
|
featuresCount: number;
|
||||||
|
@ -8,7 +8,7 @@ import { addDays, subDays } from 'date-fns';
|
|||||||
import ProjectService from '../../../lib/services/project-service';
|
import ProjectService from '../../../lib/services/project-service';
|
||||||
import { createProjectService } from '../../../lib/features';
|
import { createProjectService } from '../../../lib/features';
|
||||||
import { EventService } from '../../../lib/services';
|
import { EventService } from '../../../lib/services';
|
||||||
import { IUnleashStores } from 'lib/types';
|
import { IUnleashStores } from '../../../lib/types';
|
||||||
|
|
||||||
let db: ITestDb;
|
let db: ITestDb;
|
||||||
let stores: IUnleashStores;
|
let stores: IUnleashStores;
|
||||||
|
@ -15,11 +15,11 @@ import FeatureToggleService from '../../../lib/features/feature-toggle/feature-t
|
|||||||
import { FeatureToggle, ISegment, WeightType } from '../../../lib/types/model';
|
import { FeatureToggle, ISegment, WeightType } from '../../../lib/types/model';
|
||||||
import { PlaygroundFeatureSchema } from '../../../lib/openapi/spec/playground-feature-schema';
|
import { PlaygroundFeatureSchema } from '../../../lib/openapi/spec/playground-feature-schema';
|
||||||
import { offlineUnleashClientNode } from '../../../lib/features/playground/offline-unleash-client.test';
|
import { offlineUnleashClientNode } from '../../../lib/features/playground/offline-unleash-client.test';
|
||||||
import { ClientFeatureSchema } from 'lib/openapi/spec/client-feature-schema';
|
import { ClientFeatureSchema } from '../../../lib/openapi/spec/client-feature-schema';
|
||||||
import { SdkContextSchema } from 'lib/openapi/spec/sdk-context-schema';
|
import { SdkContextSchema } from '../../../lib/openapi/spec/sdk-context-schema';
|
||||||
import { SegmentSchema } from 'lib/openapi/spec/segment-schema';
|
import { SegmentSchema } from '../../../lib/openapi/spec/segment-schema';
|
||||||
import { playgroundStrategyEvaluation } from '../../../lib/openapi/spec/playground-strategy-schema';
|
import { playgroundStrategyEvaluation } from '../../../lib/openapi/spec/playground-strategy-schema';
|
||||||
import { PlaygroundSegmentSchema } from 'lib/openapi/spec/playground-segment-schema';
|
import { PlaygroundSegmentSchema } from '../../../lib/openapi/spec/playground-segment-schema';
|
||||||
import { ISegmentService } from '../../../lib/segments/segment-service-interface';
|
import { ISegmentService } from '../../../lib/segments/segment-service-interface';
|
||||||
import { createPrivateProjectChecker } from '../../../lib/features/private-project/createPrivateProjectChecker';
|
import { createPrivateProjectChecker } from '../../../lib/features/private-project/createPrivateProjectChecker';
|
||||||
import {
|
import {
|
||||||
|
@ -23,7 +23,7 @@ import {
|
|||||||
SYSTEM_USER,
|
SYSTEM_USER,
|
||||||
SYSTEM_USER_ID,
|
SYSTEM_USER_ID,
|
||||||
} from '../../../lib/types';
|
} from '../../../lib/types';
|
||||||
import { User } from 'lib/server-impl';
|
import { User } from '../../../lib/server-impl';
|
||||||
|
|
||||||
let stores: IUnleashStores;
|
let stores: IUnleashStores;
|
||||||
let db: ITestDb;
|
let db: ITestDb;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import faker from 'faker';
|
import faker from 'faker';
|
||||||
import dbInit, { ITestDb } from '../helpers/database-init';
|
import dbInit, { ITestDb } from '../helpers/database-init';
|
||||||
import getLogger from '../../fixtures/no-logger';
|
import getLogger from '../../fixtures/no-logger';
|
||||||
import { IClientApplicationsStore, IUnleashStores } from 'lib/types';
|
import { IClientApplicationsStore, IUnleashStores } from '../../../lib/types';
|
||||||
import { IClientApplication } from '../../../lib/types/stores/client-applications-store';
|
import { IClientApplication } from '../../../lib/types/stores/client-applications-store';
|
||||||
|
|
||||||
let db: ITestDb;
|
let db: ITestDb;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import dbInit, { ITestDb } from '../helpers/database-init';
|
import dbInit, { ITestDb } from '../helpers/database-init';
|
||||||
import getLogger from '../../fixtures/no-logger';
|
import getLogger from '../../fixtures/no-logger';
|
||||||
import { IContextFieldDto } from 'lib/types/stores/context-field-store';
|
import { IContextFieldDto } from '../../../lib/types/stores/context-field-store';
|
||||||
import fc, { Arbitrary } from 'fast-check';
|
import fc, { Arbitrary } from 'fast-check';
|
||||||
import { IUnleashStores } from 'lib/types';
|
import { IUnleashStores } from '../../../lib/types';
|
||||||
|
|
||||||
let stores: IUnleashStores;
|
let stores: IUnleashStores;
|
||||||
let db: ITestDb;
|
let db: ITestDb;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { IFeatureTagStore } from 'lib/types/stores/feature-tag-store';
|
import { IFeatureTagStore } from '../../../lib/types/stores/feature-tag-store';
|
||||||
import { IFeatureToggleStore } from 'lib/features/feature-toggle/types/feature-toggle-store-type';
|
import { IFeatureToggleStore } from '../../../lib/features/feature-toggle/types/feature-toggle-store-type';
|
||||||
import dbInit, { ITestDb } from '../helpers/database-init';
|
import dbInit, { ITestDb } from '../helpers/database-init';
|
||||||
import getLogger from '../../fixtures/no-logger';
|
import getLogger from '../../fixtures/no-logger';
|
||||||
import NotFoundError from '../../../lib/error/notfound-error';
|
import NotFoundError from '../../../lib/error/notfound-error';
|
||||||
import { IUnleashStores } from 'lib/types';
|
import { IUnleashStores } from '../../../lib/types';
|
||||||
|
|
||||||
let stores: IUnleashStores;
|
let stores: IUnleashStores;
|
||||||
let db: ITestDb;
|
let db: ITestDb;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { IFeatureTypeStore } from 'lib/types/stores/feature-type-store';
|
import { IFeatureTypeStore } from '../../../lib/types/stores/feature-type-store';
|
||||||
import dbInit, { ITestDb } from '../helpers/database-init';
|
import dbInit, { ITestDb } from '../helpers/database-init';
|
||||||
import getLogger from '../../fixtures/no-logger';
|
import getLogger from '../../fixtures/no-logger';
|
||||||
import { IUnleashStores } from '../../../lib/types';
|
import { IUnleashStores } from '../../../lib/types';
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
import { IProjectInsert, IProjectStore } from 'lib/types/stores/project-store';
|
import {
|
||||||
import { IEnvironmentStore } from 'lib/features/project-environments/environment-store-type';
|
IProjectInsert,
|
||||||
|
IProjectStore,
|
||||||
|
} from '../../../lib/types/stores/project-store';
|
||||||
|
import { IEnvironmentStore } from '../../../lib/features/project-environments/environment-store-type';
|
||||||
|
|
||||||
import dbInit, { ITestDb } from '../helpers/database-init';
|
import dbInit, { ITestDb } from '../helpers/database-init';
|
||||||
import getLogger from '../../fixtures/no-logger';
|
import getLogger from '../../fixtures/no-logger';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { IUserFeedbackStore } from 'lib/types/stores/user-feedback-store';
|
import { IUserFeedbackStore } from '../../../lib/types/stores/user-feedback-store';
|
||||||
import { IUserStore } from 'lib/types/stores/user-store';
|
import { IUserStore } from '../../../lib/types/stores/user-store';
|
||||||
import dbInit, { ITestDb } from '../helpers/database-init';
|
import dbInit, { ITestDb } from '../helpers/database-init';
|
||||||
import getLogger from '../../fixtures/no-logger';
|
import getLogger from '../../fixtures/no-logger';
|
||||||
import { IUnleashStores, IUser } from '../../../lib/types';
|
import { IUnleashStores, IUser } from '../../../lib/types';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { IUserSplashStore } from 'lib/types/stores/user-splash-store';
|
import { IUserSplashStore } from '../../../lib/types/stores/user-splash-store';
|
||||||
import { IUserStore } from 'lib/types/stores/user-store';
|
import { IUserStore } from '../../../lib/types/stores/user-store';
|
||||||
import dbInit, { ITestDb } from '../helpers/database-init';
|
import dbInit, { ITestDb } from '../helpers/database-init';
|
||||||
import getLogger from '../../fixtures/no-logger';
|
import getLogger from '../../fixtures/no-logger';
|
||||||
import { IUnleashStores, IUser } from '../../../lib/types';
|
import { IUnleashStores, IUser } from '../../../lib/types';
|
||||||
|
@ -3,7 +3,7 @@ import { createTestConfig } from '../config/test-config';
|
|||||||
import { getInstance } from 'db-migrate';
|
import { getInstance } from 'db-migrate';
|
||||||
import { log } from 'db-migrate-shared';
|
import { log } from 'db-migrate-shared';
|
||||||
import { Client } from 'pg';
|
import { Client } from 'pg';
|
||||||
import { IDBOption } from 'lib/types';
|
import { IDBOption } from '../../lib/types';
|
||||||
|
|
||||||
log.setLogLevel('error');
|
log.setLogLevel('error');
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ test('System user creation migration correctly sets is_system', async () => {
|
|||||||
|
|
||||||
await client.query(`
|
await client.query(`
|
||||||
INSERT INTO "system_user_migration_test"."users"
|
INSERT INTO "system_user_migration_test"."users"
|
||||||
(name, username, email, created_by_user_id)
|
(name, username, email, created_by_user_id)
|
||||||
VALUES
|
VALUES
|
||||||
('Test Person', 'testperson', 'testperson@getunleash.io', 1);
|
('Test Person', 'testperson', 'testperson@getunleash.io', 1);
|
||||||
`);
|
`);
|
||||||
|
2
src/test/fixtures/fake-access-store.ts
vendored
2
src/test/fixtures/fake-access-store.ts
vendored
@ -17,7 +17,7 @@ import {
|
|||||||
RoleType,
|
RoleType,
|
||||||
} from '../../lib/types';
|
} from '../../lib/types';
|
||||||
import FakeRoleStore from './fake-role-store';
|
import FakeRoleStore from './fake-role-store';
|
||||||
import { PermissionRef } from 'lib/services/access-service';
|
import { PermissionRef } from '../../lib/services/access-service';
|
||||||
|
|
||||||
class AccessStoreMock implements IAccessStore {
|
class AccessStoreMock implements IAccessStore {
|
||||||
fakeRolesStore: IRoleStore;
|
fakeRolesStore: IRoleStore;
|
||||||
|
2
src/test/fixtures/fake-event-store.ts
vendored
2
src/test/fixtures/fake-event-store.ts
vendored
@ -1,7 +1,7 @@
|
|||||||
import { IEventStore } from '../../lib/types/stores/event-store';
|
import { IEventStore } from '../../lib/types/stores/event-store';
|
||||||
import { IEvent } from '../../lib/types/events';
|
import { IEvent } from '../../lib/types/events';
|
||||||
import { sharedEventEmitter } from '../../lib/util/anyEventEmitter';
|
import { sharedEventEmitter } from '../../lib/util/anyEventEmitter';
|
||||||
import { IQueryOperations } from 'lib/db/event-store';
|
import { IQueryOperations } from '../../lib/db/event-store';
|
||||||
import { SearchEventsSchema } from '../../lib/openapi';
|
import { SearchEventsSchema } from '../../lib/openapi';
|
||||||
import EventEmitter from 'events';
|
import EventEmitter from 'events';
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { IProjectStats } from 'lib/services/project-service';
|
import { IProjectStats } from '../../lib/services/project-service';
|
||||||
import {
|
import {
|
||||||
ICreateEnabledDates,
|
ICreateEnabledDates,
|
||||||
IProjectStatsStore,
|
IProjectStatsStore,
|
||||||
} from 'lib/types/stores/project-stats-store-type';
|
} from '../../lib/types/stores/project-stats-store-type';
|
||||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||||
|
|
||||||
export default class FakeProjectStatsStore implements IProjectStatsStore {
|
export default class FakeProjectStatsStore implements IProjectStatsStore {
|
||||||
|
2
src/test/fixtures/fake-project-store.ts
vendored
2
src/test/fixtures/fake-project-store.ts
vendored
@ -10,7 +10,7 @@ import {
|
|||||||
IEnvironmentProjectLink,
|
IEnvironmentProjectLink,
|
||||||
IProjectMembersCount,
|
IProjectMembersCount,
|
||||||
ProjectModeCount,
|
ProjectModeCount,
|
||||||
} from 'lib/db/project-store';
|
} from '../../lib/db/project-store';
|
||||||
import { CreateFeatureStrategySchema } from '../../lib/openapi';
|
import { CreateFeatureStrategySchema } from '../../lib/openapi';
|
||||||
|
|
||||||
export default class FakeProjectStore implements IProjectStore {
|
export default class FakeProjectStore implements IProjectStore {
|
||||||
|
8
src/test/fixtures/fake-role-store.ts
vendored
8
src/test/fixtures/fake-role-store.ts
vendored
@ -1,12 +1,12 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||||
import { RoleSchema } from 'lib/openapi';
|
import { RoleSchema } from '../../lib/openapi';
|
||||||
import { ICustomRole } from 'lib/types/model';
|
import { ICustomRole } from '../../lib/types/model';
|
||||||
import { IRole, IUserRole } from 'lib/types/stores/access-store';
|
import { IRole, IUserRole } from '../../lib/types/stores/access-store';
|
||||||
import {
|
import {
|
||||||
ICustomRoleInsert,
|
ICustomRoleInsert,
|
||||||
ICustomRoleUpdate,
|
ICustomRoleUpdate,
|
||||||
IRoleStore,
|
IRoleStore,
|
||||||
} from 'lib/types/stores/role-store';
|
} from '../../lib/types/stores/role-store';
|
||||||
|
|
||||||
export default class FakeRoleStore implements IRoleStore {
|
export default class FakeRoleStore implements IRoleStore {
|
||||||
count(): Promise<number> {
|
count(): Promise<number> {
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
|
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
|
||||||
/* Module Resolution Options */
|
/* Module Resolution Options */
|
||||||
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
||||||
"baseUrl": "./src" /* Base directory to resolve non-absolute module names. */,
|
// "baseUrl": "./src" /* Base directory to resolve non-absolute module names. */,
|
||||||
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
||||||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||||
// "typeRoots": [], /* List of folders to include type definitions from. */
|
// "typeRoots": [], /* List of folders to include type definitions from. */
|
||||||
|
Loading…
Reference in New Issue
Block a user