UNPKG

moleculer-api

Version:

A dynamic API Gateway for MoleculerJS which updates REST endpoints and aggregated GraphQL schema, access control policy for each action calls from metadata of remote services schema without restart or deployment.

21 lines (20 loc) 1.14 kB
import { APIRequestContextFactory, APIRequestContextProps, APIRequestContextSource } from "./index"; export declare type APIRequestContextConstructor = (source: APIRequestContextSource) => Promise<APIRequestContext>; export interface APIRequestContext extends APIRequestContextProps { } export declare class APIRequestContext { protected constructor(props: APIRequestContextProps); private static SourceContextIsCreatingSymbol; private static SourceContextSymbol; private static StoreSymbol; static createConstructor(factories: ReadonlyArray<APIRequestContextFactory<any>>, hooks?: { before?: (source: APIRequestContextSource) => void; after?: (source: APIRequestContextSource, context: APIRequestContext) => void; }): APIRequestContextConstructor; static find(source: APIRequestContextSource): APIRequestContext | null; static findProps(source: APIRequestContextSource): APIRequestContextProps | null; static isCreating(source: APIRequestContextSource): boolean; set<T>(symbol: symbol, value: T, clear: (value: T) => void): void; get(symbol: symbol): any; clear(): void; }