/** * @license Apache-2.0 * @copyright Cube Dev, Inc. * @fileoverview * Gateway server data types definition. */ import { QueryRewriteFn, ExtendContextFn } from './request'; import { JWTOptions, CheckAuthFn } from './auth'; import { RequestLoggerMiddlewareFn, ContextRejectionMiddlewareFn, ContextAcceptorFn, ContextToApiScopesFn } from '../interfaces'; type UserBackgroundContext = { /** * Security context object. * @todo any could be changed to unknown? * @todo Maybe we can add type limitations? */ securityContext: any; /** * @deprecated */ authInfo?: any; }; type RequestContext = { authInfo?: any; securityContext: any; requestId: string; }; /** * Function that should provide a logic of scheduled returning of * the user background context. Used as a part of a main * configuration object of the Gateway to provide extendability to * this logic. */ type ScheduledRefreshContextsFn = () => Promise; type ScheduledRefreshTimeZonesFn = (context: RequestContext) => string[] | Promise; /** * Gateway configuration options interface. */ interface ApiGatewayOptions { standalone: boolean; gatewayPort?: number; dataSourceStorage: any; refreshScheduler: any; scheduledRefreshContexts?: ScheduledRefreshContextsFn; scheduledRefreshTimeZones?: ScheduledRefreshTimeZonesFn; basePath: string; extendContext?: ExtendContextFn; jwt?: JWTOptions; requestLoggerMiddleware?: RequestLoggerMiddlewareFn; queryRewrite?: QueryRewriteFn; subscriptionStore?: any; /** Resolved by server-core from CreateOptions.devServer; defaults to CUBEJS_DEV_MODE */ devServer?: boolean; enforceSecurityChecks?: boolean; playgroundAuthSecret?: string; /** Rotation window: any listed secret verifies. Takes precedence over `apiSecret`. */ apiSecrets?: string[]; serverCoreVersion?: string; contextRejectionMiddleware?: ContextRejectionMiddlewareFn; wsContextAcceptor?: ContextAcceptorFn; checkAuth?: CheckAuthFn; contextToApiScopes?: ContextToApiScopesFn; event?: (name: string, props?: object) => void; } export type { UserBackgroundContext, ScheduledRefreshContextsFn, ApiGatewayOptions, }; //# sourceMappingURL=gateway.d.ts.map