@bleedingdev/modern-js-bff-core 3.2.0-ultramodern.0 → 3.2.0-ultramodern.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/dist/types/api.d.ts +0 -6
- package/dist/types/client/generateClient.d.ts +0 -21
- package/dist/types/client/index.d.ts +0 -1
- package/dist/types/client/result.d.ts +0 -15
- package/dist/types/compatible.d.ts +0 -9
- package/dist/types/contracts/eventContracts.d.ts +0 -22
- package/dist/types/errors/http.d.ts +0 -8
- package/dist/types/index.d.ts +0 -11
- package/dist/types/operators/http.d.ts +0 -44
- package/dist/types/router/constants.d.ts +0 -6
- package/dist/types/router/index.d.ts +0 -49
- package/dist/types/router/types.d.ts +0 -18
- package/dist/types/router/utils.d.ts +0 -10
- package/dist/types/security/crossProjectPolicy.d.ts +0 -30
- package/dist/types/security/operationContracts.d.ts +0 -28
- package/dist/types/types.d.ts +0 -64
- package/dist/types/utils/alias.d.ts +0 -7
- package/dist/types/utils/debug.d.ts +0 -1
- package/dist/types/utils/index.d.ts +0 -5
- package/dist/types/utils/meta.d.ts +0 -4
- package/dist/types/utils/storage.d.ts +0 -5
- package/dist/types/utils/validate.d.ts +0 -5
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"modern",
|
|
18
18
|
"modern.js"
|
|
19
19
|
],
|
|
20
|
-
"version": "3.2.0-ultramodern.
|
|
20
|
+
"version": "3.2.0-ultramodern.2",
|
|
21
21
|
"types": "./dist/types/index.d.ts",
|
|
22
22
|
"main": "./dist/cjs/index.js",
|
|
23
23
|
"exports": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"koa-compose": "^4.1.0",
|
|
36
36
|
"reflect-metadata": "^0.2.2",
|
|
37
37
|
"type-fest": "5.6.0",
|
|
38
|
-
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.
|
|
38
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.2"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@rslib/core": "0.21.5",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@typescript/native-preview": "7.0.0-dev.20260516.1",
|
|
45
45
|
"tsconfig-paths": "^4.2.0",
|
|
46
46
|
"zod": "^4.4.3",
|
|
47
|
-
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.
|
|
47
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.2",
|
|
48
48
|
"@scripts/rstest-config": "2.66.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
package/dist/types/api.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
import type { ApiRunner, ArrayToObject, ExtractInputType, ExtractOuputType, MaybeAsync, Operator } from './types';
|
|
3
|
-
export declare function Api<Operators extends Operator<any, any>[], Res extends MaybeAsync<any>>(...args: [
|
|
4
|
-
...operators: Operators,
|
|
5
|
-
handler: (arg: ArrayToObject<ExtractOuputType<Operators>>) => Res
|
|
6
|
-
]): ApiRunner<ExtractInputType<Operators> extends void[] ? void : ArrayToObject<ExtractInputType<Operators>>, Res>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { HttpMethodDecider } from '@modern-js/types';
|
|
2
|
-
import { type Result } from './result';
|
|
3
|
-
export type GenClientResult = Result<string>;
|
|
4
|
-
export type GenClientOptions = {
|
|
5
|
-
resourcePath: string;
|
|
6
|
-
source: string;
|
|
7
|
-
appDir: string;
|
|
8
|
-
apiDir: string;
|
|
9
|
-
lambdaDir: string;
|
|
10
|
-
prefix: string;
|
|
11
|
-
port: number;
|
|
12
|
-
requestCreator?: string;
|
|
13
|
-
fetcher?: string;
|
|
14
|
-
target?: string;
|
|
15
|
-
requireResolve?: typeof require.resolve;
|
|
16
|
-
httpMethodDecider?: HttpMethodDecider;
|
|
17
|
-
domain?: string;
|
|
18
|
-
requestId?: string;
|
|
19
|
-
};
|
|
20
|
-
export declare const INNER_CLIENT_REQUEST_CREATOR = "@modern-js/plugin-bff/client";
|
|
21
|
-
export declare const generateClient: ({ appDir, resourcePath, apiDir, lambdaDir, prefix, port, target, requestCreator, fetcher, requireResolve, httpMethodDecider, domain, requestId, }: GenClientOptions) => Promise<GenClientResult>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './generateClient';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type Err<T = unknown> = {
|
|
2
|
-
kind: 'Err';
|
|
3
|
-
value: T;
|
|
4
|
-
isErr: true;
|
|
5
|
-
isOk: false;
|
|
6
|
-
};
|
|
7
|
-
export type Ok<T = unknown> = {
|
|
8
|
-
kind: 'Ok';
|
|
9
|
-
value: T;
|
|
10
|
-
isErr: false;
|
|
11
|
-
isOk: true;
|
|
12
|
-
};
|
|
13
|
-
export type Result<T = unknown, E = string> = Err<E> | Ok<T>;
|
|
14
|
-
export declare const Err: <E = string>(value: E) => Err<E>;
|
|
15
|
-
export declare const Ok: <T, E = string>(value: T) => Result<T, E>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export type EventContract<Name extends string = string, Payload = unknown> = {
|
|
2
|
-
name: Name;
|
|
3
|
-
version: number;
|
|
4
|
-
schemaHash: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
};
|
|
7
|
-
export type EventEnvelope<TContract extends EventContract = EventContract, TMeta extends Record<string, unknown> = Record<string, unknown>> = {
|
|
8
|
-
name: TContract['name'];
|
|
9
|
-
version: TContract['version'];
|
|
10
|
-
schemaHash: TContract['schemaHash'];
|
|
11
|
-
timestamp: number;
|
|
12
|
-
payload: TContract extends EventContract<string, infer TPayload> ? TPayload : unknown;
|
|
13
|
-
meta?: TMeta;
|
|
14
|
-
};
|
|
15
|
-
export declare const defineEventContract: <Name extends string, Payload = unknown>(input: {
|
|
16
|
-
name: Name;
|
|
17
|
-
version: number;
|
|
18
|
-
schemaHash: string;
|
|
19
|
-
description?: string;
|
|
20
|
-
}) => EventContract<Name, Payload>;
|
|
21
|
-
export declare const createEventEnvelope: <TContract extends EventContract, TMeta extends Record<string, unknown> = Record<string, unknown>>(contract: TContract, payload: TContract extends EventContract<string, infer TPayload> ? TPayload : unknown, meta?: TMeta) => EventEnvelope<TContract, TMeta>;
|
|
22
|
-
export declare const isEventEnvelope: (value: unknown) => value is EventEnvelope<EventContract, Record<string, unknown>>;
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { Api } from './api';
|
|
2
|
-
export * from './client';
|
|
3
|
-
export type * from './compatible';
|
|
4
|
-
export * from './contracts/eventContracts';
|
|
5
|
-
export { HttpError, ValidationError } from './errors/http';
|
|
6
|
-
export * from './operators/http';
|
|
7
|
-
export * from './router';
|
|
8
|
-
export * from './security/crossProjectPolicy';
|
|
9
|
-
export * from './security/operationContracts';
|
|
10
|
-
export * from './types';
|
|
11
|
-
export { createStorage, getRelativeRuntimePath, HANDLER_WITH_META, INPUT_PARAMS_DECIDER, isInputParamsDeciderHandler, isWithMetaHandler, registerPaths, } from './utils';
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { z } from 'zod';
|
|
2
|
-
import { HttpMethod, type Operator, ResponseMetaType } from '../types';
|
|
3
|
-
export interface ResponseMeta {
|
|
4
|
-
type: ResponseMetaType;
|
|
5
|
-
value: unknown;
|
|
6
|
-
}
|
|
7
|
-
export declare const createHttpOperator: (method: HttpMethod) => (urlPath: string) => Operator<void>;
|
|
8
|
-
export declare const Get: (urlPath: string) => Operator<void>;
|
|
9
|
-
export declare const Post: (urlPath: string) => Operator<void>;
|
|
10
|
-
export declare const Put: (urlPath: string) => Operator<void>;
|
|
11
|
-
export declare const Delete: (urlPath: string) => Operator<void>;
|
|
12
|
-
export declare const Connect: (urlPath: string) => Operator<void>;
|
|
13
|
-
export declare const Trace: (urlPath: string) => Operator<void>;
|
|
14
|
-
export declare const Patch: (urlPath: string) => Operator<void>;
|
|
15
|
-
export declare const Options: (urlPath: string) => Operator<void>;
|
|
16
|
-
export declare const Head: (urlPath: string) => Operator<void>;
|
|
17
|
-
export declare const Data: <Schema extends z.ZodType>(schema: Schema) => Operator<{
|
|
18
|
-
data: z.input<Schema>;
|
|
19
|
-
}, {
|
|
20
|
-
data: z.output<Schema>;
|
|
21
|
-
}>;
|
|
22
|
-
export declare const Query: <Schema extends z.ZodType>(schema: Schema) => Operator<{
|
|
23
|
-
query: z.input<Schema>;
|
|
24
|
-
}, {
|
|
25
|
-
query: z.output<Schema>;
|
|
26
|
-
}>;
|
|
27
|
-
export declare const Params: <Schema extends z.ZodType>(schema: Schema) => Operator<{
|
|
28
|
-
params: z.input<Schema>;
|
|
29
|
-
}, {
|
|
30
|
-
params: z.output<Schema>;
|
|
31
|
-
}>;
|
|
32
|
-
export declare const Headers: <Schema extends z.ZodType>(schema: Schema) => Operator<{
|
|
33
|
-
headers: z.input<Schema>;
|
|
34
|
-
}, {
|
|
35
|
-
headers: z.output<Schema>;
|
|
36
|
-
}>;
|
|
37
|
-
export declare const HttpCode: (statusCode: number) => Operator<void>;
|
|
38
|
-
export declare const SetHeaders: (headers: Record<string, string>) => Operator<void>;
|
|
39
|
-
export declare const Redirect: (url: string) => Operator<void>;
|
|
40
|
-
export declare const Upload: <Schema extends z.ZodType>(urlPath: string, schema?: Schema) => Operator<{
|
|
41
|
-
files: z.input<Schema>;
|
|
42
|
-
}, {
|
|
43
|
-
formData: z.output<Schema>;
|
|
44
|
-
}>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const AllHttpMethods: string[];
|
|
2
|
-
export declare const FRAMEWORK_MODE_LAMBDA_DIR = "lambda";
|
|
3
|
-
export declare const FRAMEWORK_MODE_APP_DIR = "app";
|
|
4
|
-
export declare const INDEX_SUFFIX = "index";
|
|
5
|
-
export declare const API_DIR = "api";
|
|
6
|
-
export declare const API_FILE_RULES: string[];
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
import type { HttpMethodDecider } from '@modern-js/types';
|
|
3
|
-
import { HttpMethod } from '../types';
|
|
4
|
-
import type { APIHandlerInfo, ApiHandler } from './types';
|
|
5
|
-
export * from './constants';
|
|
6
|
-
export * from './types';
|
|
7
|
-
export declare class ApiRouter {
|
|
8
|
-
private appDir?;
|
|
9
|
-
private apiDir;
|
|
10
|
-
private existLambdaDir;
|
|
11
|
-
private httpMethodDecider;
|
|
12
|
-
private lambdaDir;
|
|
13
|
-
private prefix;
|
|
14
|
-
private apiFiles;
|
|
15
|
-
private isBuild?;
|
|
16
|
-
constructor({ appDir, apiDir, lambdaDir, prefix, isBuild, httpMethodDecider, }: {
|
|
17
|
-
appDir?: string;
|
|
18
|
-
apiDir: string;
|
|
19
|
-
lambdaDir?: string;
|
|
20
|
-
prefix?: string;
|
|
21
|
-
isBuild?: boolean;
|
|
22
|
-
httpMethodDecider?: HttpMethodDecider;
|
|
23
|
-
});
|
|
24
|
-
isExistLambda(): boolean;
|
|
25
|
-
getLambdaDir(): string;
|
|
26
|
-
isApiFile(filename: string): boolean;
|
|
27
|
-
getSingleModuleHandlers(filename: string): Promise<APIHandlerInfo[] | null>;
|
|
28
|
-
getHandlerInfo(filename: string, originFuncName: string, handler: ApiHandler): APIHandlerInfo | null;
|
|
29
|
-
getSafeRoutePath(filename: string, handler?: ApiHandler): string;
|
|
30
|
-
getRouteName(filename: string, handler?: ApiHandler): string;
|
|
31
|
-
getHttpMethod(originHandlerName: string, handler?: ApiHandler): HttpMethod | null;
|
|
32
|
-
getAction(handler?: ApiHandler): string | undefined;
|
|
33
|
-
loadApiFiles(): string[];
|
|
34
|
-
getApiFiles(): string[];
|
|
35
|
-
getApiHandlers(): Promise<APIHandlerInfo[]>;
|
|
36
|
-
/**
|
|
37
|
-
* 如果用户未传入或传入空串,默认为 /api
|
|
38
|
-
* 如果传入 /,则 prefix 为 /
|
|
39
|
-
*/
|
|
40
|
-
private initPrefix;
|
|
41
|
-
private validateAbsolute;
|
|
42
|
-
private getExactLambdaDir;
|
|
43
|
-
private getModuleInfos;
|
|
44
|
-
private getModuleInfo;
|
|
45
|
-
private getHandlerInfos;
|
|
46
|
-
private getModuleHandlerInfos;
|
|
47
|
-
private validateValidApifile;
|
|
48
|
-
private getRoutePath;
|
|
49
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { HttpMethod } from '../types';
|
|
2
|
-
export type ModuleInfo = {
|
|
3
|
-
filename: string;
|
|
4
|
-
module: HandlerModule;
|
|
5
|
-
};
|
|
6
|
-
type Handler = (...args: any) => any | Promise<any>;
|
|
7
|
-
export type ApiHandler = Handler;
|
|
8
|
-
export type HandlerModule = Record<string, ApiHandler>;
|
|
9
|
-
export type APIHandlerInfo = {
|
|
10
|
-
handler: ApiHandler;
|
|
11
|
-
name: string;
|
|
12
|
-
httpMethod: HttpMethod;
|
|
13
|
-
filename: string;
|
|
14
|
-
routeName: string;
|
|
15
|
-
routePath: string;
|
|
16
|
-
action?: string;
|
|
17
|
-
};
|
|
18
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { APIHandlerInfo } from './types';
|
|
2
|
-
type MaybeAsync<I> = I | Promise<I>;
|
|
3
|
-
export type NormalHandler = (...args: any[]) => any;
|
|
4
|
-
export type Handler<I, O> = (input: I) => MaybeAsync<O>;
|
|
5
|
-
export declare const getFiles: (lambdaDir: string, rules: string | string[]) => string[];
|
|
6
|
-
export declare const getPathFromFilename: (baseDir: string, filename: string) => string;
|
|
7
|
-
export declare const isHandler: (input: any) => input is Handler<any, any>;
|
|
8
|
-
export declare const requireHandlerModule: (modulePath: string) => Promise<any>;
|
|
9
|
-
export declare const sortRoutes: (apiHandlers: APIHandlerInfo[]) => APIHandlerInfo[];
|
|
10
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export declare const BFF_ENVELOPE_HEADER = "x-modernjs-bff-envelope";
|
|
2
|
-
export declare const BFF_OPERATION_CONTEXT_HEADER = "x-operation-id";
|
|
3
|
-
export declare const BFF_OPERATION_CONTEXT_DETAIL_HEADER = "x-modernjs-bff-operation-context";
|
|
4
|
-
export type CrossProjectOperationContract = {
|
|
5
|
-
schemaHash?: string;
|
|
6
|
-
operationVersion?: number;
|
|
7
|
-
};
|
|
8
|
-
export type CrossProjectPolicyViolationReason = 'missing_envelope' | 'invalid_envelope' | 'missing_request_id' | 'namespace_not_allowed' | 'missing_operation_context' | 'operation_context_mismatch' | 'missing_operation_context_details' | 'invalid_operation_context_details' | 'operation_context_details_request_id_mismatch' | 'missing_operation_schema_hash' | 'missing_operation_version' | 'unknown_operation_contract' | 'operation_schema_hash_mismatch' | 'operation_version_mismatch';
|
|
9
|
-
export type CrossProjectPolicyViolation = {
|
|
10
|
-
code: 'BFF_CROSS_PROJECT_POLICY_DENIED';
|
|
11
|
-
reason: CrossProjectPolicyViolationReason;
|
|
12
|
-
message: string;
|
|
13
|
-
status: number;
|
|
14
|
-
};
|
|
15
|
-
export interface CrossProjectPolicyConfig {
|
|
16
|
-
enabled?: boolean;
|
|
17
|
-
requireEnvelope?: boolean;
|
|
18
|
-
requireOperationContext?: boolean;
|
|
19
|
-
requireOperationContextDetails?: boolean;
|
|
20
|
-
requireOperationSchemaHash?: boolean;
|
|
21
|
-
requireOperationVersion?: boolean;
|
|
22
|
-
allowedNamespaces?: string[];
|
|
23
|
-
envelopeHeader?: string;
|
|
24
|
-
operationContextHeader?: string;
|
|
25
|
-
operationContextDetailHeader?: string;
|
|
26
|
-
expectedOperationContracts?: Record<string, CrossProjectOperationContract>;
|
|
27
|
-
allowUnknownOperations?: boolean;
|
|
28
|
-
denyStatus?: number;
|
|
29
|
-
}
|
|
30
|
-
export declare const evaluateCrossProjectPolicy: (headers: Record<string, unknown>, policy?: CrossProjectPolicyConfig) => CrossProjectPolicyViolation | null;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { APIHandlerInfo } from '../router/types';
|
|
2
|
-
export type OperationContractEntry = {
|
|
3
|
-
name: string;
|
|
4
|
-
httpMethod: string;
|
|
5
|
-
routePath: string;
|
|
6
|
-
};
|
|
7
|
-
export type OperationContractDefinition = {
|
|
8
|
-
requestId: string;
|
|
9
|
-
operationVersion: number;
|
|
10
|
-
schemaHash: string;
|
|
11
|
-
method: string;
|
|
12
|
-
routePath: string;
|
|
13
|
-
operationId: string;
|
|
14
|
-
handlerName: string;
|
|
15
|
-
filename?: string;
|
|
16
|
-
};
|
|
17
|
-
export type OperationContractMap = Record<string, OperationContractDefinition>;
|
|
18
|
-
export declare const DEFAULT_OPERATION_VERSION = 1;
|
|
19
|
-
export declare const createOperationEntries: (handlers: Array<{
|
|
20
|
-
name: string;
|
|
21
|
-
httpMethod: string;
|
|
22
|
-
routePath: string;
|
|
23
|
-
}>) => OperationContractEntry[];
|
|
24
|
-
export declare const createOperationSchemaHash: (operationEntries: OperationContractEntry[], requestId: string) => string;
|
|
25
|
-
export declare const buildOperationContractMap: ({ handlers, requestId, }: {
|
|
26
|
-
handlers: APIHandlerInfo[];
|
|
27
|
-
requestId?: string;
|
|
28
|
-
}) => OperationContractMap;
|
package/dist/types/types.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
type Merge<T, U> = T & Omit<U, keyof T>;
|
|
2
|
-
export declare enum OperatorType {
|
|
3
|
-
Trigger = 0,
|
|
4
|
-
Middleware = 1
|
|
5
|
-
}
|
|
6
|
-
export declare enum TriggerType {
|
|
7
|
-
Http = 0
|
|
8
|
-
}
|
|
9
|
-
export declare enum HttpMetadata {
|
|
10
|
-
Method = "METHOD",
|
|
11
|
-
Data = "DATA",
|
|
12
|
-
Query = "QUERY",
|
|
13
|
-
Params = "PARAMS",
|
|
14
|
-
Headers = "HEADERS",
|
|
15
|
-
Response = "RESPONSE",
|
|
16
|
-
Files = "Files"
|
|
17
|
-
}
|
|
18
|
-
export declare enum ResponseMetaType {
|
|
19
|
-
StatusCode = 0,
|
|
20
|
-
Redirect = 1,
|
|
21
|
-
Headers = 2
|
|
22
|
-
}
|
|
23
|
-
export declare enum HttpMethod {
|
|
24
|
-
Get = "GET",
|
|
25
|
-
Post = "POST",
|
|
26
|
-
Put = "PUT",
|
|
27
|
-
Delete = "DELETE",
|
|
28
|
-
Connect = "CONNECT",
|
|
29
|
-
Trace = "TRACE",
|
|
30
|
-
Patch = "PATCH",
|
|
31
|
-
Options = "OPTIONS",
|
|
32
|
-
Head = "HEAD"
|
|
33
|
-
}
|
|
34
|
-
export type InputSchemaMeata = Extract<HttpMetadata, HttpMetadata.Data | HttpMetadata.Query | HttpMetadata.Headers | HttpMetadata.Params | HttpMetadata.Files>;
|
|
35
|
-
export type ExecuteFunc<Outputs> = (helper: ExecuteHelper<Outputs>, next: () => Promise<any>) => Promise<any>;
|
|
36
|
-
export type ExecuteHelper<Outputs> = {
|
|
37
|
-
result?: any;
|
|
38
|
-
inputs: Outputs;
|
|
39
|
-
};
|
|
40
|
-
export type MetadataHelper = {
|
|
41
|
-
setMetadata: <T = any>(key: any, value: T) => void;
|
|
42
|
-
getMetadata: <T = any>(key: any) => T;
|
|
43
|
-
};
|
|
44
|
-
export type Operator<Input = any, Output = Input> = {
|
|
45
|
-
name: string;
|
|
46
|
-
inputType?: Input;
|
|
47
|
-
outputType?: Output;
|
|
48
|
-
metadata?: (helper: MetadataHelper) => void;
|
|
49
|
-
validate?: ExecuteFunc<Output>;
|
|
50
|
-
execute?: ExecuteFunc<Output>;
|
|
51
|
-
};
|
|
52
|
-
export type MaybeAsync<T> = Promise<T> | T;
|
|
53
|
-
export type ApiRunner<Input extends object | void | unknown, Output extends MaybeAsync<any>> = (...args: Input extends void ? [] : [input: Input]) => Output;
|
|
54
|
-
export type NonNullable<T> = Exclude<T, null | undefined>;
|
|
55
|
-
export type ExtractInputType<T> = {
|
|
56
|
-
[key in keyof T]: T[key] extends Operator<any, any> ? NonNullable<T[key]['inputType']> : void;
|
|
57
|
-
};
|
|
58
|
-
export type ExtractOuputType<T> = {
|
|
59
|
-
[key in keyof T]: T[key] extends Operator<any, any> ? NonNullable<T[key]['outputType']> : void;
|
|
60
|
-
};
|
|
61
|
-
export type ArrayToObject<T, R = {}> = T extends [infer First, ...infer Rest] ? First extends PromiseLike<infer PromiseValue> ? PromiseValue : First extends object ? Merge<First, ArrayToObject<Rest, R>> : ArrayToObject<Rest, R> : R;
|
|
62
|
-
export type AsyncFunction = (...args: any[]) => Promise<any>;
|
|
63
|
-
export declare const httpMethods: HttpMethod[];
|
|
64
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
interface Paths {
|
|
2
|
-
[key: string]: string[] | string;
|
|
3
|
-
}
|
|
4
|
-
export declare const getRelativeRuntimePath: (appDirectory: string, serverRuntimePath: string) => string;
|
|
5
|
-
export declare const createMatchPath: (paths: Paths) => (request: string) => string | null;
|
|
6
|
-
export declare const registerPaths: (paths: Paths) => () => void;
|
|
7
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const debug: (...args: unknown[]) => void;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const getTypeErrorMessage: (actual: unknown) => string;
|
|
2
|
-
export declare class ERR_INVALID_ARG_TYPE extends Error {
|
|
3
|
-
constructor(funcName: string, expectedType: string, actual: unknown);
|
|
4
|
-
}
|
|
5
|
-
export declare const validateFunction: (maybeFunc: unknown, name: string) => boolean;
|