diff --git a/api/registry/types.ts b/api/registry/types.ts index 6bf62be0..39bb967e 100644 --- a/api/registry/types.ts +++ b/api/registry/types.ts @@ -1 +1,2 @@ export type {DLSConstructor} from '../../src/registry/common/components/dls/types'; +export type {GatewayApi} from '../../src/registry'; diff --git a/src/registry/index.ts b/src/registry/index.ts index adaa1508..f7b08dbd 100644 --- a/src/registry/index.ts +++ b/src/registry/index.ts @@ -20,6 +20,13 @@ const wrapperGetGatewayControllers = ( let gateway: ReturnType; +export type GatewayApi = ApiWithRoot< + TSchema, + AppContext, + Request, + Response +>; + export const registry = { setupApp(appInstance: ExpressKit) { if (app) { @@ -58,8 +65,9 @@ export const registry = { if (!gateway) { throw new Error('First of all setup the gateway'); } + return {gatewayApi: gateway.api} as { - gatewayApi: ApiWithRoot; + gatewayApi: GatewayApi; }; }, common: commonRegistry, diff --git a/src/tests/int/routes.ts b/src/tests/int/routes.ts index f9ab685f..5107b013 100644 --- a/src/tests/int/routes.ts +++ b/src/tests/int/routes.ts @@ -16,4 +16,4 @@ export const routes = { rootCollectionPermissions: '/v1/root-collection-permissions', workbooks: '/v2/workbooks', privateWorkbooks: '/private/v2/workbooks', -}; +} as const;