Skip to content

Commit

Permalink
refactor: proxy/frontend api in feature oriented architecture (#6487)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew committed Mar 11, 2024
1 parent 7d82744 commit 2a39590
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
@@ -1,8 +1,8 @@
import { Request, Response } from 'express';
import Controller from '../controller';
import { IUnleashConfig, IUnleashServices, NONE } from '../../types';
import { Logger } from '../../logger';
import { IApiUser } from '../../types/api-user';
import Controller from '../routes/controller';
import { IUnleashConfig, IUnleashServices, NONE } from '../types';
import { Logger } from '../logger';
import { IApiUser } from '../types/api-user';
import {
ClientMetricsSchema,
createRequestSchema,
Expand All @@ -13,12 +13,12 @@ import {
ProxyFeatureSchema,
proxyFeaturesSchema,
ProxyFeaturesSchema,
} from '../../openapi';
} from '../openapi';
import { Context } from 'unleash-client';
import { enrichContextWithIp } from '../../proxy';
import { corsOriginMiddleware } from '../../middleware';
import NotImplementedError from '../../error/not-implemented-error';
import NotFoundError from '../../error/notfound-error';
import { enrichContextWithIp } from './index';
import { corsOriginMiddleware } from '../middleware';
import NotImplementedError from '../error/not-implemented-error';
import NotFoundError from '../error/notfound-error';
import rateLimit from 'express-rate-limit';
import { minutesToMilliseconds } from 'date-fns';
import isEqual from 'lodash.isequal';
Expand Down
@@ -1,5 +1,5 @@
import { ProxyService, Config } from './proxy-service';
import { GlobalFrontendApiCache } from '../proxy/global-frontend-api-cache';
import { GlobalFrontendApiCache } from './global-frontend-api-cache';
import { IApiUser } from '../types';
import { FeatureInterface } from 'unleash-client/lib/feature';
import noLogger from '../../test/fixtures/no-logger';
Expand Down
Expand Up @@ -16,9 +16,9 @@ import {
import { validateOrigins } from '../util';
import { BadDataError, InvalidTokenError } from '../error';
import { PROXY_REPOSITORY_CREATED } from '../metric-events';
import { ProxyRepository } from '../proxy';
import { FrontendApiRepository } from '../proxy/frontend-api-repository';
import { GlobalFrontendApiCache } from '../proxy/global-frontend-api-cache';
import { ProxyRepository } from './index';
import { FrontendApiRepository } from './frontend-api-repository';
import { GlobalFrontendApiCache } from './global-frontend-api-cache';

export type Config = Pick<
IUnleashConfig,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/routes/admin-api/api-token.ts
Expand Up @@ -41,7 +41,7 @@ import {
emptyResponse,
getStandardResponses,
} from '../../openapi/util/standard-responses';
import { ProxyService } from '../../services/proxy-service';
import { ProxyService } from '../../proxy/proxy-service';
import { extractUserId, extractUsername } from '../../util';
import { OperationDeniedError } from '../../error';

Expand Down
2 changes: 1 addition & 1 deletion src/lib/routes/index.ts
Expand Up @@ -9,7 +9,7 @@ import { AdminApi } from './admin-api';
import ClientApi from './client-api';

import { HealthCheckController } from './health-check';
import FrontendAPIController from './proxy-api';
import FrontendAPIController from '../proxy/proxy-controller';
import EdgeController from './edge-api';
import { PublicInviteController } from './public-invite';
import { Db } from '../db/db';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/services/index.ts
Expand Up @@ -31,7 +31,7 @@ import { OpenApiService } from './openapi-service';
import { ClientSpecService } from './client-spec-service';
import { PlaygroundService } from '../features/playground/playground-service';
import { GroupService } from './group-service';
import { ProxyService } from './proxy-service';
import { ProxyService } from '../proxy/proxy-service';
import EdgeService from './edge-service';
import PatService from './pat-service';
import { PublicSignupTokenService } from './public-signup-token-service';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/types/services.ts
Expand Up @@ -28,7 +28,7 @@ import { OpenApiService } from '../services/openapi-service';
import { ClientSpecService } from '../services/client-spec-service';
import { PlaygroundService } from '../features/playground/playground-service';
import { GroupService } from '../services/group-service';
import { ProxyService } from '../services/proxy-service';
import { ProxyService } from '../proxy/proxy-service';
import EdgeService from '../services/edge-service';
import PatService from '../services/pat-service';
import { PublicSignupTokenService } from '../services/public-signup-token-service';
Expand Down

0 comments on commit 2a39590

Please sign in to comment.