import Router from 'koa-router'; import { extractAuthorizationInfoFromHeader } from './headerAuth'; import { CustomFunctionParams, FunctionHandler, FunctionRoute, Utilities } from '../types'; export type AuthInfoInput = { token: string; baseUrl: string; staticToken?: string; }; export { extractAuthorizationInfoFromHeader }; /** * Build a `Utilities` bag (services / userInfo / logger / protector) from raw * credentials, without an inbound request. * * The services need nothing but a token and a base URL, so callers outside a * lambda invocation — notably mex-custom-function-builder, enumerating a shared * function's resources with the tenant admin token pkgr hands it — can construct * a real, authenticated bag rather than stubbing one. * * `token` must be a decodable JWT: `decodeToken` derives userInfo from it. * * NOTE: `ServiceController` is a tsyringe singleton and `setupContext` mutates * shared state, so successive calls overwrite one another. Do not build two bags * concurrently in one process. */ export declare function createUtilities(auth: AuthInfoInput): Utilities; export declare function generateFunctionHandlerFromRoutes(routes: FunctionRoute[]): FunctionHandler; export declare function generateKoaFunctionHandlerFromRoutes(routes: FunctionRoute[]): Router; export declare function generateRoutesFromParams(params: CustomFunctionParams): FunctionRoute[]; //# sourceMappingURL=functionUtils.d.ts.map