@trpc/server 10.28.0 → 10.28.1
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/dist/{TRPCError-61026c9a.js → TRPCError-7c3909ea.js} +47 -47
- package/dist/adapters/aws-lambda/index.d.ts +9 -9
- package/dist/adapters/aws-lambda/index.d.ts.map +1 -1
- package/dist/adapters/aws-lambda/utils.d.ts +37 -37
- package/dist/adapters/aws-lambda/utils.d.ts.map +1 -1
- package/dist/adapters/express.d.ts +5 -5
- package/dist/adapters/express.d.ts.map +1 -1
- package/dist/adapters/fastify/fastifyRequestHandler.d.ts +12 -12
- package/dist/adapters/fastify/fastifyRequestHandler.d.ts.map +1 -1
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts +11 -11
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts.map +1 -1
- package/dist/adapters/fastify/index.d.ts +2 -2
- package/dist/adapters/fetch/fetchRequestHandler.d.ts +7 -7
- package/dist/adapters/fetch/fetchRequestHandler.d.ts.map +1 -1
- package/dist/adapters/fetch/index.d.ts +2 -2
- package/dist/adapters/fetch/types.d.ts +19 -19
- package/dist/adapters/fetch/types.d.ts.map +1 -1
- package/dist/adapters/lambda/index.d.ts +11 -11
- package/dist/adapters/lambda/index.d.ts.map +1 -1
- package/dist/adapters/next.d.ts +5 -5
- package/dist/adapters/next.d.ts.map +1 -1
- package/dist/adapters/node-http/content-type/form-data/fileUploadHandler.d.ts +69 -69
- package/dist/adapters/node-http/content-type/form-data/fileUploadHandler.d.ts.map +1 -1
- package/dist/adapters/node-http/content-type/form-data/index.d.ts +23 -23
- package/dist/adapters/node-http/content-type/form-data/index.js +1 -3
- package/dist/adapters/node-http/content-type/form-data/index.mjs +1 -3
- package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.d.ts +30 -30
- package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.d.ts.map +1 -1
- package/dist/adapters/node-http/content-type/form-data/streamSlice.d.ts +10 -10
- package/dist/adapters/node-http/content-type/form-data/uploadHandler.d.ts +40 -39
- package/dist/adapters/node-http/content-type/form-data/uploadHandler.d.ts.map +1 -1
- package/dist/adapters/node-http/content-type/json/getPostBody.d.ts +6 -6
- package/dist/adapters/node-http/content-type/json/index.d.ts +1 -1
- package/dist/adapters/node-http/index.d.ts +2 -2
- package/dist/adapters/node-http/internals/contentType.d.ts +8 -8
- package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts +3 -3
- package/dist/adapters/node-http/types.d.ts +63 -63
- package/dist/adapters/node-http/types.d.ts.map +1 -1
- package/dist/adapters/standalone.d.ts +13 -13
- package/dist/adapters/standalone.d.ts.map +1 -1
- package/dist/adapters/ws.d.ts +21 -21
- package/dist/adapters/ws.d.ts.map +1 -1
- package/dist/{codes-b3c262d8.js → codes-1c9ad84e.js} +44 -44
- package/dist/{config-1a5a494d.js → config-54786004.js} +168 -168
- package/dist/{contentType-f27e4bfc.js → contentType-24c44bba.js} +2 -2
- package/dist/{contentType-a75c990c.js → contentType-7354963c.js} +54 -54
- package/dist/core/index.d.ts +8 -8
- package/dist/core/initTRPC.d.ts +104 -104
- package/dist/core/initTRPC.d.ts.map +1 -1
- package/dist/core/internals/config.d.ts +74 -74
- package/dist/core/internals/config.d.ts.map +1 -1
- package/dist/core/internals/getParseFn.d.ts +8 -8
- package/dist/core/internals/getParseFn.d.ts.map +1 -1
- package/dist/core/internals/mergeRouters.d.ts +17 -17
- package/dist/core/internals/mergeRouters.d.ts.map +1 -1
- package/dist/core/internals/mergeWithoutOverrides.d.ts +4 -4
- package/dist/core/internals/omitPrototype.d.ts +5 -5
- package/dist/core/internals/procedureBuilder.d.ts +115 -115
- package/dist/core/internals/procedureBuilder.d.ts.map +1 -1
- package/dist/core/internals/utils.d.ts +51 -51
- package/dist/core/internals/utils.d.ts.map +1 -1
- package/dist/core/middleware.d.ts +127 -127
- package/dist/core/middleware.d.ts.map +1 -1
- package/dist/core/parser.d.ts +27 -27
- package/dist/core/parser.d.ts.map +1 -1
- package/dist/core/procedure.d.ts +72 -72
- package/dist/core/procedure.d.ts.map +1 -1
- package/dist/core/router.d.ts +111 -111
- package/dist/core/router.d.ts.map +1 -1
- package/dist/core/types.d.ts +28 -28
- package/dist/core/types.d.ts.map +1 -1
- package/dist/deprecated/internals/middlewares.d.ts +51 -51
- package/dist/deprecated/internals/middlewares.d.ts.map +1 -1
- package/dist/deprecated/internals/procedure.d.ts +95 -95
- package/dist/deprecated/internals/procedure.d.ts.map +1 -1
- package/dist/deprecated/interop.d.ts +43 -43
- package/dist/deprecated/interop.d.ts.map +1 -1
- package/dist/deprecated/router.d.ts +203 -203
- package/dist/deprecated/router.d.ts.map +1 -1
- package/dist/error/TRPCError.d.ts +11 -11
- package/dist/error/formatter.d.ts +32 -32
- package/dist/error/formatter.d.ts.map +1 -1
- package/dist/error/utils.d.ts +5 -5
- package/dist/http/contentType.d.ts +28 -28
- package/dist/http/contentType.d.ts.map +1 -1
- package/dist/http/getHTTPStatusCode.d.ts +23 -23
- package/dist/http/getHTTPStatusCode.d.ts.map +1 -1
- package/dist/http/index.d.ts +3 -3
- package/dist/http/internals/types.d.ts +24 -24
- package/dist/http/internals/types.d.ts.map +1 -1
- package/dist/http/resolveHTTPResponse.d.ts +16 -16
- package/dist/http/types.d.ts +24 -24
- package/dist/{index-6d5795e9.js → index-ca9a128e.js} +88 -88
- package/dist/index.d.ts +6 -6
- package/dist/internals/invert.d.ts +11 -11
- package/dist/internals/invert.d.ts.map +1 -1
- package/dist/internals/types.d.ts +25 -25
- package/dist/internals/types.d.ts.map +1 -1
- package/dist/internals.d.ts +9 -9
- package/dist/{nodeHTTPRequestHandler-e424955c.js → nodeHTTPRequestHandler-bd47641d.js} +62 -62
- package/dist/observable/index.d.ts +4 -4
- package/dist/observable/internals/identity.d.ts +1 -1
- package/dist/observable/internals/observableToPromise.d.ts +9 -9
- package/dist/observable/internals/pipe.d.ts +3 -3
- package/dist/observable/observable.d.ts +4 -4
- package/dist/observable/observable.d.ts.map +1 -1
- package/dist/observable/operators/index.d.ts +3 -3
- package/dist/observable/operators/map.d.ts +2 -2
- package/dist/observable/operators/share.d.ts +5 -5
- package/dist/observable/operators/tap.d.ts +2 -2
- package/dist/observable/types.d.ts +28 -28
- package/dist/observable/types.d.ts.map +1 -1
- package/dist/{observable-a1c2103f.js → observable-15588f28.js} +76 -76
- package/dist/{resolveHTTPResponse-4e05c4f8.js → resolveHTTPResponse-ba557d3e.js} +162 -162
- package/dist/rpc/codes.d.ts +52 -52
- package/dist/rpc/codes.d.ts.map +1 -1
- package/dist/rpc/envelopes.d.ts +98 -98
- package/dist/rpc/envelopes.d.ts.map +1 -1
- package/dist/rpc/index.d.ts +2 -2
- package/dist/shared/createProxy/index.d.ts +18 -18
- package/dist/shared/createProxy/index.d.ts.map +1 -1
- package/dist/shared/getErrorShape.d.ts +14 -14
- package/dist/shared/index.d.ts +5 -5
- package/dist/shared/internal/serialize.d.ts +29 -29
- package/dist/shared/internal/serialize.d.ts.map +1 -1
- package/dist/shared/jsonify.d.ts +9 -9
- package/dist/shared/jsonify.d.ts.map +1 -1
- package/dist/shared/transformTRPCResponse.d.ts +8 -8
- package/dist/shared/transformTRPCResponse.d.ts.map +1 -1
- package/dist/subscription.d.ts +12 -12
- package/dist/{transformTRPCResponse-64a4fd96.js → transformTRPCResponse-7fcbe472.js} +48 -48
- package/dist/transformer.d.ts +73 -73
- package/dist/transformer.d.ts.map +1 -1
- package/dist/types.d.ts +77 -77
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/adapters/node-http/content-type/form-data/fileUploadHandler.ts +3 -3
- package/src/adapters/node-http/content-type/form-data/uploadHandler.ts +3 -1
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
*/
|
|
4
|
-
function isObject(value) {
|
|
5
|
-
// check that value is object
|
|
6
|
-
return !!value && !Array.isArray(value) && typeof value === 'object';
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
function getMessageFromUnknownError(err, fallback) {
|
|
12
|
-
if (typeof err === 'string') {
|
|
13
|
-
return err;
|
|
14
|
-
}
|
|
15
|
-
if (isObject(err) && typeof err.message === 'string') {
|
|
16
|
-
return err.message;
|
|
17
|
-
}
|
|
18
|
-
return fallback;
|
|
19
|
-
}
|
|
20
|
-
function getCauseFromUnknown(cause) {
|
|
21
|
-
if (cause instanceof Error) {
|
|
22
|
-
return cause;
|
|
23
|
-
}
|
|
24
|
-
return undefined;
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
function isObject(value) {
|
|
5
|
+
// check that value is object
|
|
6
|
+
return !!value && !Array.isArray(value) && typeof value === 'object';
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
function getMessageFromUnknownError(err, fallback) {
|
|
12
|
+
if (typeof err === 'string') {
|
|
13
|
+
return err;
|
|
14
|
+
}
|
|
15
|
+
if (isObject(err) && typeof err.message === 'string') {
|
|
16
|
+
return err.message;
|
|
17
|
+
}
|
|
18
|
+
return fallback;
|
|
19
|
+
}
|
|
20
|
+
function getCauseFromUnknown(cause) {
|
|
21
|
+
if (cause instanceof Error) {
|
|
22
|
+
return cause;
|
|
23
|
+
}
|
|
24
|
+
return undefined;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
function getTRPCErrorFromUnknown(cause) {
|
|
28
|
-
if (cause instanceof TRPCError) {
|
|
29
|
-
return cause;
|
|
30
|
-
}
|
|
31
|
-
const trpcError = new TRPCError({
|
|
32
|
-
code: 'INTERNAL_SERVER_ERROR',
|
|
33
|
-
cause,
|
|
34
|
-
});
|
|
35
|
-
// Inherit stack from error
|
|
36
|
-
if (cause instanceof Error && cause.stack) {
|
|
37
|
-
trpcError.stack = cause.stack;
|
|
38
|
-
}
|
|
39
|
-
return trpcError;
|
|
40
|
-
}
|
|
41
|
-
class TRPCError extends Error {
|
|
42
|
-
constructor(opts) {
|
|
43
|
-
const message = opts.message ?? getMessageFromUnknownError(opts.cause, opts.code);
|
|
44
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
45
|
-
// @ts-ignore https://github.com/tc39/proposal-error-cause
|
|
46
|
-
super(message, { cause: opts.cause });
|
|
47
|
-
this.code = opts.code;
|
|
48
|
-
this.name = this.constructor.name;
|
|
49
|
-
}
|
|
27
|
+
function getTRPCErrorFromUnknown(cause) {
|
|
28
|
+
if (cause instanceof TRPCError) {
|
|
29
|
+
return cause;
|
|
30
|
+
}
|
|
31
|
+
const trpcError = new TRPCError({
|
|
32
|
+
code: 'INTERNAL_SERVER_ERROR',
|
|
33
|
+
cause,
|
|
34
|
+
});
|
|
35
|
+
// Inherit stack from error
|
|
36
|
+
if (cause instanceof Error && cause.stack) {
|
|
37
|
+
trpcError.stack = cause.stack;
|
|
38
|
+
}
|
|
39
|
+
return trpcError;
|
|
40
|
+
}
|
|
41
|
+
class TRPCError extends Error {
|
|
42
|
+
constructor(opts) {
|
|
43
|
+
const message = opts.message ?? getMessageFromUnknownError(opts.cause, opts.code);
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
45
|
+
// @ts-ignore https://github.com/tc39/proposal-error-cause
|
|
46
|
+
super(message, { cause: opts.cause });
|
|
47
|
+
this.code = opts.code;
|
|
48
|
+
this.name = this.constructor.name;
|
|
49
|
+
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export { TRPCError as T, getTRPCErrorFromUnknown as a, getCauseFromUnknown as g };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { Context as APIGWContext, APIGatewayProxyEvent, APIGatewayProxyEventV2, APIGatewayProxyResult, APIGatewayProxyStructuredResultV2 } from 'aws-lambda';
|
|
2
|
-
import { AnyRouter } from '../../core';
|
|
3
|
-
import { APIGatewayEvent, AWSLambdaOptions } from './utils';
|
|
4
|
-
export * from './utils';
|
|
5
|
-
/** 1:1 mapping of v1 or v2 input events, deduces which is which.
|
|
6
|
-
* @internal
|
|
7
|
-
**/
|
|
8
|
-
|
|
9
|
-
export declare function awsLambdaRequestHandler<TRouter extends AnyRouter, TEvent extends APIGatewayEvent, TResult extends inferAPIGWReturn<TEvent>>(opts: AWSLambdaOptions<TRouter, TEvent>): (event: TEvent, context: APIGWContext) => Promise<TResult>;
|
|
1
|
+
import type { Context as APIGWContext, APIGatewayProxyEvent, APIGatewayProxyEventV2, APIGatewayProxyResult, APIGatewayProxyStructuredResultV2 } from 'aws-lambda';
|
|
2
|
+
import { AnyRouter } from '../../core';
|
|
3
|
+
import { APIGatewayEvent, AWSLambdaOptions } from './utils';
|
|
4
|
+
export * from './utils';
|
|
5
|
+
/** 1:1 mapping of v1 or v2 input events, deduces which is which.
|
|
6
|
+
* @internal
|
|
7
|
+
**/
|
|
8
|
+
type inferAPIGWReturn<TType> = TType extends APIGatewayProxyEvent ? APIGatewayProxyResult : TType extends APIGatewayProxyEventV2 ? APIGatewayProxyStructuredResultV2 : never;
|
|
9
|
+
export declare function awsLambdaRequestHandler<TRouter extends AnyRouter, TEvent extends APIGatewayEvent, TResult extends inferAPIGWReturn<TEvent>>(opts: AWSLambdaOptions<TRouter, TEvent>): (event: TEvent, context: APIGWContext) => Promise<TResult>;
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/aws-lambda/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,IAAI,YAAY,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,iCAAiC,EAClC,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,SAAS,EAAsB,MAAM,YAAY,CAAC;AAG3D,OAAO,EACL,eAAe,EAEf,gBAAgB,EAOjB,MAAM,SAAS,CAAC;AAEjB,cAAc,SAAS,CAAC;AAqDxB;;IAEI;AACJ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/aws-lambda/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,IAAI,YAAY,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,iCAAiC,EAClC,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,SAAS,EAAsB,MAAM,YAAY,CAAC;AAG3D,OAAO,EACL,eAAe,EAEf,gBAAgB,EAOjB,MAAM,SAAS,CAAC;AAEjB,cAAc,SAAS,CAAC;AAqDxB;;IAEI;AACJ,KAAK,gBAAgB,CAAC,KAAK,IAAI,KAAK,SAAS,oBAAoB,GAC7D,qBAAqB,GACrB,KAAK,SAAS,sBAAsB,GACpC,iCAAiC,GACjC,KAAK,CAAC;AACV,wBAAgB,uBAAuB,CACrC,OAAO,SAAS,SAAS,EACzB,MAAM,SAAS,eAAe,EAC9B,OAAO,SAAS,gBAAgB,CAAC,MAAM,CAAC,EAExC,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,GACtC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,OAAO,CAAC,CA4B5D"}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import type { Context as APIGWContext, APIGatewayProxyEvent, APIGatewayProxyEventV2, APIGatewayProxyResult, APIGatewayProxyStructuredResultV2 } from 'aws-lambda';
|
|
2
|
-
import type { AnyRouter, inferRouterContext } from '../../core';
|
|
3
|
-
import type { HTTPHeaders, ResponseMetaFn } from '../../http/internals/types';
|
|
4
|
-
import { OnErrorFunction } from '../../internals/types';
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
event: TEvent;
|
|
9
|
-
context: APIGWContext;
|
|
10
|
-
};
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
router: TRouter;
|
|
14
|
-
batching?: {
|
|
15
|
-
enabled: boolean;
|
|
16
|
-
};
|
|
17
|
-
onError?: OnErrorFunction<TRouter, TEvent>;
|
|
18
|
-
responseMeta?: ResponseMetaFn<TRouter>;
|
|
19
|
-
} & ({
|
|
20
|
-
/**
|
|
21
|
-
* @link https://trpc.io/docs/context
|
|
22
|
-
**/
|
|
23
|
-
createContext: AWSLambdaCreateContextFn<TRouter, TEvent>;
|
|
24
|
-
} | {
|
|
25
|
-
/**
|
|
26
|
-
* @link https://trpc.io/docs/context
|
|
27
|
-
**/
|
|
28
|
-
createContext?: AWSLambdaCreateContextFn<TRouter, TEvent>;
|
|
29
|
-
});
|
|
30
|
-
export declare function isPayloadV1(event: APIGatewayEvent): event is APIGatewayProxyEvent;
|
|
31
|
-
export declare function isPayloadV2(event: APIGatewayEvent): event is APIGatewayProxyEventV2;
|
|
32
|
-
export declare function getHTTPMethod(event: APIGatewayEvent): string;
|
|
33
|
-
export declare function getPath(event: APIGatewayEvent): string;
|
|
34
|
-
export declare function transformHeaders(headers: HTTPHeaders): APIGatewayResult['headers'];
|
|
35
|
-
export
|
|
36
|
-
export
|
|
37
|
-
export declare const UNKNOWN_PAYLOAD_FORMAT_VERSION_ERROR_MESSAGE: string;
|
|
1
|
+
import type { Context as APIGWContext, APIGatewayProxyEvent, APIGatewayProxyEventV2, APIGatewayProxyResult, APIGatewayProxyStructuredResultV2 } from 'aws-lambda';
|
|
2
|
+
import type { AnyRouter, inferRouterContext } from '../../core';
|
|
3
|
+
import type { HTTPHeaders, ResponseMetaFn } from '../../http/internals/types';
|
|
4
|
+
import { OnErrorFunction } from '../../internals/types';
|
|
5
|
+
export type APIGatewayEvent = APIGatewayProxyEvent | APIGatewayProxyEventV2;
|
|
6
|
+
export type APIGatewayResult = APIGatewayProxyResult | APIGatewayProxyStructuredResultV2;
|
|
7
|
+
export type CreateAWSLambdaContextOptions<TEvent extends APIGatewayEvent> = {
|
|
8
|
+
event: TEvent;
|
|
9
|
+
context: APIGWContext;
|
|
10
|
+
};
|
|
11
|
+
export type AWSLambdaCreateContextFn<TRouter extends AnyRouter, TEvent extends APIGatewayEvent> = ({ event, context, }: CreateAWSLambdaContextOptions<TEvent>) => inferRouterContext<TRouter> | Promise<inferRouterContext<TRouter>>;
|
|
12
|
+
export type AWSLambdaOptions<TRouter extends AnyRouter, TEvent extends APIGatewayEvent> = {
|
|
13
|
+
router: TRouter;
|
|
14
|
+
batching?: {
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
};
|
|
17
|
+
onError?: OnErrorFunction<TRouter, TEvent>;
|
|
18
|
+
responseMeta?: ResponseMetaFn<TRouter>;
|
|
19
|
+
} & ({
|
|
20
|
+
/**
|
|
21
|
+
* @link https://trpc.io/docs/context
|
|
22
|
+
**/
|
|
23
|
+
createContext: AWSLambdaCreateContextFn<TRouter, TEvent>;
|
|
24
|
+
} | {
|
|
25
|
+
/**
|
|
26
|
+
* @link https://trpc.io/docs/context
|
|
27
|
+
**/
|
|
28
|
+
createContext?: AWSLambdaCreateContextFn<TRouter, TEvent>;
|
|
29
|
+
});
|
|
30
|
+
export declare function isPayloadV1(event: APIGatewayEvent): event is APIGatewayProxyEvent;
|
|
31
|
+
export declare function isPayloadV2(event: APIGatewayEvent): event is APIGatewayProxyEventV2;
|
|
32
|
+
export declare function getHTTPMethod(event: APIGatewayEvent): string;
|
|
33
|
+
export declare function getPath(event: APIGatewayEvent): string;
|
|
34
|
+
export declare function transformHeaders(headers: HTTPHeaders): APIGatewayResult['headers'];
|
|
35
|
+
export type DefinedAPIGatewayPayloadFormats = '1.0' | '2.0';
|
|
36
|
+
export type APIGatewayPayloadFormatVersion = DefinedAPIGatewayPayloadFormats | 'custom';
|
|
37
|
+
export declare const UNKNOWN_PAYLOAD_FORMAT_VERSION_ERROR_MESSAGE: string;
|
|
38
38
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/adapters/aws-lambda/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,IAAI,YAAY,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,iCAAiC,EAClC,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhE,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/adapters/aws-lambda/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,IAAI,YAAY,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,iCAAiC,EAClC,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhE,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,MAAM,eAAe,GAAG,oBAAoB,GAAG,sBAAsB,CAAC;AAC5E,MAAM,MAAM,gBAAgB,GACxB,qBAAqB,GACrB,iCAAiC,CAAC;AAEtC,MAAM,MAAM,6BAA6B,CAAC,MAAM,SAAS,eAAe,IAAI;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,YAAY,CAAC;CACvB,CAAC;AACF,MAAM,MAAM,wBAAwB,CAClC,OAAO,SAAS,SAAS,EACzB,MAAM,SAAS,eAAe,IAC5B,CAAC,EACH,KAAK,EACL,OAAO,GACR,EAAE,6BAA6B,CAAC,MAAM,CAAC,KACpC,kBAAkB,CAAC,OAAO,CAAC,GAC3B,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;AAEzC,MAAM,MAAM,gBAAgB,CAC1B,OAAO,SAAS,SAAS,EACzB,MAAM,SAAS,eAAe,IAE5B;IACE,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE;QACT,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IACF,OAAO,CAAC,EAAE,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC3C,YAAY,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;CACxC,GAAG,CACA;IACE;;QAEI;IACJ,aAAa,EAAE,wBAAwB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;CAC1D,GACD;IACE;;QAEI;IACJ,aAAa,CAAC,EAAE,wBAAwB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;CAC3D,CACJ,CAAC;AAEN,wBAAgB,WAAW,CACzB,KAAK,EAAE,eAAe,GACrB,KAAK,IAAI,oBAAoB,CAE/B;AACD,wBAAgB,WAAW,CACzB,KAAK,EAAE,eAAe,GACrB,KAAK,IAAI,sBAAsB,CAEjC;AAoBD,wBAAgB,aAAa,CAAC,KAAK,EAAE,eAAe,UAWnD;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,eAAe,UA+B7C;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,WAAW,GACnB,gBAAgB,CAAC,SAAS,CAAC,CAU7B;AAED,MAAM,MAAM,+BAA+B,GAAG,KAAK,GAAG,KAAK,CAAC;AAC5D,MAAM,MAAM,8BAA8B,GACtC,+BAA+B,GAC/B,QAAQ,CAAC;AAEb,eAAO,MAAM,4CAA4C,QAEiD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type * as express from 'express';
|
|
2
|
-
import { AnyRouter } from '../core';
|
|
3
|
-
import { NodeHTTPCreateContextFnOptions, NodeHTTPHandlerOptions } from './node-http';
|
|
4
|
-
export
|
|
5
|
-
export declare function createExpressMiddleware<TRouter extends AnyRouter>(opts: NodeHTTPHandlerOptions<TRouter, express.Request, express.Response>): express.Handler;
|
|
1
|
+
import type * as express from 'express';
|
|
2
|
+
import { AnyRouter } from '../core';
|
|
3
|
+
import { NodeHTTPCreateContextFnOptions, NodeHTTPHandlerOptions } from './node-http';
|
|
4
|
+
export type CreateExpressContextOptions = NodeHTTPCreateContextFnOptions<express.Request, express.Response>;
|
|
5
|
+
export declare function createExpressMiddleware<TRouter extends AnyRouter>(opts: NodeHTTPHandlerOptions<TRouter, express.Request, express.Response>): express.Handler;
|
|
6
6
|
//# sourceMappingURL=express.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../src/adapters/express.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,EACL,8BAA8B,EAC9B,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAErB,
|
|
1
|
+
{"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../src/adapters/express.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,EACL,8BAA8B,EAC9B,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,2BAA2B,GAAG,8BAA8B,CACtE,OAAO,CAAC,OAAO,EACf,OAAO,CAAC,QAAQ,CACjB,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,OAAO,SAAS,SAAS,EAC/D,IAAI,EAAE,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,GACvE,OAAO,CAAC,OAAO,CAWjB"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
-
import { AnyRouter } from '../../core';
|
|
3
|
-
import { HTTPBaseHandlerOptions } from '../../http';
|
|
4
|
-
import { NodeHTTPCreateContextOption } from '../node-http';
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
req: TRequest;
|
|
8
|
-
res: TResponse;
|
|
9
|
-
path: string;
|
|
10
|
-
} & FastifyHandlerOptions<TRouter, TRequest, TResponse>;
|
|
11
|
-
export declare function fastifyRequestHandler<TRouter extends AnyRouter, TRequest extends FastifyRequest, TResponse extends FastifyReply>(opts: FastifyRequestHandlerOptions<TRouter, TRequest, TResponse>): Promise<void>;
|
|
12
|
-
export {};
|
|
1
|
+
import { FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
import { AnyRouter } from '../../core';
|
|
3
|
+
import { HTTPBaseHandlerOptions } from '../../http';
|
|
4
|
+
import { NodeHTTPCreateContextOption } from '../node-http';
|
|
5
|
+
export type FastifyHandlerOptions<TRouter extends AnyRouter, TRequest extends FastifyRequest, TResponse extends FastifyReply> = HTTPBaseHandlerOptions<TRouter, TRequest> & NodeHTTPCreateContextOption<TRouter, TRequest, TResponse>;
|
|
6
|
+
type FastifyRequestHandlerOptions<TRouter extends AnyRouter, TRequest extends FastifyRequest, TResponse extends FastifyReply> = {
|
|
7
|
+
req: TRequest;
|
|
8
|
+
res: TResponse;
|
|
9
|
+
path: string;
|
|
10
|
+
} & FastifyHandlerOptions<TRouter, TRequest, TResponse>;
|
|
11
|
+
export declare function fastifyRequestHandler<TRouter extends AnyRouter, TRequest extends FastifyRequest, TResponse extends FastifyReply>(opts: FastifyRequestHandlerOptions<TRouter, TRequest, TResponse>): Promise<void>;
|
|
12
|
+
export {};
|
|
13
13
|
//# sourceMappingURL=fastifyRequestHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastifyRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/fastify/fastifyRequestHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,SAAS,EAAsB,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAe,MAAM,YAAY,CAAC;AAEjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAE3D,
|
|
1
|
+
{"version":3,"file":"fastifyRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/fastify/fastifyRequestHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,SAAS,EAAsB,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAe,MAAM,YAAY,CAAC;AAEjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAE3D,MAAM,MAAM,qBAAqB,CAC/B,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,cAAc,EAC/B,SAAS,SAAS,YAAY,IAC5B,sBAAsB,CAAC,OAAO,EAAE,QAAQ,CAAC,GAC3C,2BAA2B,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;AAE5D,KAAK,4BAA4B,CAC/B,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,cAAc,EAC/B,SAAS,SAAS,YAAY,IAC5B;IACF,GAAG,EAAE,QAAQ,CAAC;IACd,GAAG,EAAE,SAAS,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;AAExD,wBAAsB,qBAAqB,CACzC,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,cAAc,EAC/B,SAAS,SAAS,YAAY,EAC9B,IAAI,EAAE,4BAA4B,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,iBA4CjE"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
-
import { FastifyHandlerOptions } from '.';
|
|
3
|
-
import { AnyRouter } from '../../core';
|
|
4
|
-
import { NodeHTTPCreateContextFnOptions } from '../node-http';
|
|
5
|
-
export interface FastifyTRPCPluginOptions<TRouter extends AnyRouter> {
|
|
6
|
-
prefix?: string;
|
|
7
|
-
useWSS?: boolean;
|
|
8
|
-
trpcOptions: FastifyHandlerOptions<TRouter, FastifyRequest, FastifyReply>;
|
|
9
|
-
}
|
|
10
|
-
export
|
|
11
|
-
export declare function fastifyTRPCPlugin<TRouter extends AnyRouter>(fastify: FastifyInstance, opts: FastifyTRPCPluginOptions<TRouter>, done: (err?: Error) => void): void;
|
|
1
|
+
import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
+
import { FastifyHandlerOptions } from '.';
|
|
3
|
+
import { AnyRouter } from '../../core';
|
|
4
|
+
import { NodeHTTPCreateContextFnOptions } from '../node-http';
|
|
5
|
+
export interface FastifyTRPCPluginOptions<TRouter extends AnyRouter> {
|
|
6
|
+
prefix?: string;
|
|
7
|
+
useWSS?: boolean;
|
|
8
|
+
trpcOptions: FastifyHandlerOptions<TRouter, FastifyRequest, FastifyReply>;
|
|
9
|
+
}
|
|
10
|
+
export type CreateFastifyContextOptions = NodeHTTPCreateContextFnOptions<FastifyRequest, FastifyReply>;
|
|
11
|
+
export declare function fastifyTRPCPlugin<TRouter extends AnyRouter>(fastify: FastifyInstance, opts: FastifyTRPCPluginOptions<TRouter>, done: (err?: Error) => void): void;
|
|
12
12
|
//# sourceMappingURL=fastifyTRPCPlugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastifyTRPCPlugin.d.ts","sourceRoot":"","sources":["../../../src/adapters/fastify/fastifyTRPCPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,GAAG,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAI9D,MAAM,WAAW,wBAAwB,CAAC,OAAO,SAAS,SAAS;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,qBAAqB,CAAC,OAAO,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;CAC3E;AAED,
|
|
1
|
+
{"version":3,"file":"fastifyTRPCPlugin.d.ts","sourceRoot":"","sources":["../../../src/adapters/fastify/fastifyTRPCPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,GAAG,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAI9D,MAAM,WAAW,wBAAwB,CAAC,OAAO,SAAS,SAAS;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,qBAAqB,CAAC,OAAO,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;CAC3E;AAED,MAAM,MAAM,2BAA2B,GAAG,8BAA8B,CACtE,cAAc,EACd,YAAY,CACb,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,OAAO,SAAS,SAAS,EACzD,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,EACvC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,KAAK,IAAI,QAiC5B"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './fastifyRequestHandler';
|
|
2
|
-
export * from './fastifyTRPCPlugin';
|
|
1
|
+
export * from './fastifyRequestHandler';
|
|
2
|
+
export * from './fastifyTRPCPlugin';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AnyRouter } from '../../core';
|
|
2
|
-
import { FetchHandlerOptions } from './types';
|
|
3
|
-
export
|
|
4
|
-
req: Request;
|
|
5
|
-
endpoint: string;
|
|
6
|
-
} & FetchHandlerOptions<TRouter>;
|
|
7
|
-
export declare function fetchRequestHandler<TRouter extends AnyRouter>(opts: FetchHandlerRequestOptions<TRouter>): Promise<Response>;
|
|
1
|
+
import { AnyRouter } from '../../core';
|
|
2
|
+
import { FetchHandlerOptions } from './types';
|
|
3
|
+
export type FetchHandlerRequestOptions<TRouter extends AnyRouter> = {
|
|
4
|
+
req: Request;
|
|
5
|
+
endpoint: string;
|
|
6
|
+
} & FetchHandlerOptions<TRouter>;
|
|
7
|
+
export declare function fetchRequestHandler<TRouter extends AnyRouter>(opts: FetchHandlerRequestOptions<TRouter>): Promise<Response>;
|
|
8
8
|
//# sourceMappingURL=fetchRequestHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/fetch/fetchRequestHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,
|
|
1
|
+
{"version":3,"file":"fetchRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/fetch/fetchRequestHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,0BAA0B,CAAC,OAAO,SAAS,SAAS,IAAI;IAClE,GAAG,EAAE,OAAO,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;AAEjC,wBAAsB,mBAAmB,CAAC,OAAO,SAAS,SAAS,EACjE,IAAI,EAAE,0BAA0B,CAAC,OAAO,CAAC,GACxC,OAAO,CAAC,QAAQ,CAAC,CAqDnB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './fetchRequestHandler';
|
|
2
|
-
export * from './types';
|
|
1
|
+
export * from './fetchRequestHandler';
|
|
2
|
+
export * from './types';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { AnyRouter, inferRouterContext } from '../../core';
|
|
2
|
-
import { HTTPBaseHandlerOptions } from '../../http';
|
|
3
|
-
export
|
|
4
|
-
req: Request;
|
|
5
|
-
resHeaders: Headers;
|
|
6
|
-
};
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
/**
|
|
10
|
-
* @link https://trpc.io/docs/context
|
|
11
|
-
**/
|
|
12
|
-
createContext?: FetchCreateContextFn<TRouter>;
|
|
13
|
-
} : {
|
|
14
|
-
/**
|
|
15
|
-
* @link https://trpc.io/docs/context
|
|
16
|
-
**/
|
|
17
|
-
createContext: FetchCreateContextFn<TRouter>;
|
|
18
|
-
};
|
|
19
|
-
export
|
|
1
|
+
import { AnyRouter, inferRouterContext } from '../../core';
|
|
2
|
+
import { HTTPBaseHandlerOptions } from '../../http';
|
|
3
|
+
export type FetchCreateContextFnOptions = {
|
|
4
|
+
req: Request;
|
|
5
|
+
resHeaders: Headers;
|
|
6
|
+
};
|
|
7
|
+
export type FetchCreateContextFn<TRouter extends AnyRouter> = (opts: FetchCreateContextFnOptions) => inferRouterContext<TRouter> | Promise<inferRouterContext<TRouter>>;
|
|
8
|
+
export type FetchCreateContextOption<TRouter extends AnyRouter> = unknown extends inferRouterContext<TRouter> ? {
|
|
9
|
+
/**
|
|
10
|
+
* @link https://trpc.io/docs/context
|
|
11
|
+
**/
|
|
12
|
+
createContext?: FetchCreateContextFn<TRouter>;
|
|
13
|
+
} : {
|
|
14
|
+
/**
|
|
15
|
+
* @link https://trpc.io/docs/context
|
|
16
|
+
**/
|
|
17
|
+
createContext: FetchCreateContextFn<TRouter>;
|
|
18
|
+
};
|
|
19
|
+
export type FetchHandlerOptions<TRouter extends AnyRouter> = HTTPBaseHandlerOptions<TRouter, Request> & FetchCreateContextOption<TRouter>;
|
|
20
20
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/adapters/fetch/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEpD,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/adapters/fetch/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEpD,MAAM,MAAM,2BAA2B,GAAG;IACxC,GAAG,EAAE,OAAO,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,OAAO,SAAS,SAAS,IAAI,CAC5D,IAAI,EAAE,2BAA2B,KAC9B,kBAAkB,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;AAExE,MAAM,MAAM,wBAAwB,CAAC,OAAO,SAAS,SAAS,IAC5D,OAAO,SAAS,kBAAkB,CAAC,OAAO,CAAC,GACvC;IACE;;QAEI;IACJ,aAAa,CAAC,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;CAC/C,GACD;IACE;;QAEI;IACJ,aAAa,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;CAC9C,CAAC;AAER,MAAM,MAAM,mBAAmB,CAAC,OAAO,SAAS,SAAS,IACvD,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { CreateAWSLambdaContextOptions, awsLambdaRequestHandler } from '../aws-lambda';
|
|
2
|
-
import { APIGatewayEvent } from '../aws-lambda/utils';
|
|
3
|
-
export * from '../aws-lambda';
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated use `aws-lambda` instead
|
|
6
|
-
*/
|
|
7
|
-
export
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated use `aws-lambda` instead
|
|
10
|
-
*/
|
|
11
|
-
export declare const lambdaRequestHandler: typeof awsLambdaRequestHandler;
|
|
1
|
+
import { CreateAWSLambdaContextOptions, awsLambdaRequestHandler } from '../aws-lambda';
|
|
2
|
+
import { APIGatewayEvent } from '../aws-lambda/utils';
|
|
3
|
+
export * from '../aws-lambda';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated use `aws-lambda` instead
|
|
6
|
+
*/
|
|
7
|
+
export type CreateLambdaContextOptions<TEvent extends APIGatewayEvent> = CreateAWSLambdaContextOptions<TEvent>;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated use `aws-lambda` instead
|
|
10
|
+
*/
|
|
11
|
+
export declare const lambdaRequestHandler: typeof awsLambdaRequestHandler;
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/lambda/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,EACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,cAAc,eAAe,CAAC;AAE9B;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/lambda/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,EACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,cAAc,eAAe,CAAC;AAE9B;;GAEG;AACH,MAAM,MAAM,0BAA0B,CAAC,MAAM,SAAS,eAAe,IACnE,6BAA6B,CAAC,MAAM,CAAC,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,oBAAoB,gCAA0B,CAAC"}
|
package/dist/adapters/next.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { NextApiHandler, NextApiRequest, NextApiResponse } from 'next/types';
|
|
2
|
-
import { AnyRouter } from '../core';
|
|
3
|
-
import { NodeHTTPCreateContextFnOptions, NodeHTTPHandlerOptions } from './node-http';
|
|
4
|
-
export
|
|
5
|
-
export declare function createNextApiHandler<TRouter extends AnyRouter>(opts: NodeHTTPHandlerOptions<TRouter, NextApiRequest, NextApiResponse>): NextApiHandler;
|
|
1
|
+
import type { NextApiHandler, NextApiRequest, NextApiResponse } from 'next/types';
|
|
2
|
+
import { AnyRouter } from '../core';
|
|
3
|
+
import { NodeHTTPCreateContextFnOptions, NodeHTTPHandlerOptions } from './node-http';
|
|
4
|
+
export type CreateNextContextOptions = NodeHTTPCreateContextFnOptions<NextApiRequest, NextApiResponse>;
|
|
5
|
+
export declare function createNextApiHandler<TRouter extends AnyRouter>(opts: NodeHTTPHandlerOptions<TRouter, NextApiRequest, NextApiResponse>): NextApiHandler;
|
|
6
6
|
//# sourceMappingURL=next.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/adapters/next.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,eAAe,EAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIpC,OAAO,EACL,8BAA8B,EAC9B,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAErB,
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/adapters/next.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,eAAe,EAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIpC,OAAO,EACL,8BAA8B,EAC9B,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,wBAAwB,GAAG,8BAA8B,CACnE,cAAc,EACd,eAAe,CAChB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,OAAO,SAAS,SAAS,EAC5D,IAAI,EAAE,sBAAsB,CAAC,OAAO,EAAE,cAAc,EAAE,eAAe,CAAC,GACrE,cAAc,CAyChB"}
|
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import { UploadHandler } from './uploadHandler';
|
|
4
|
-
export declare function readableStreamToString(stream: ReadableStream<Uint8Array>, encoding?: BufferEncoding): Promise<string>;
|
|
5
|
-
export
|
|
6
|
-
filename: string;
|
|
7
|
-
contentType: string;
|
|
8
|
-
name: string;
|
|
9
|
-
};
|
|
10
|
-
export
|
|
11
|
-
filename: string;
|
|
12
|
-
contentType: string;
|
|
13
|
-
name: string;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Chooses the path of the file to be uploaded. If a string is not
|
|
17
|
-
* returned the file will not be written.
|
|
18
|
-
*/
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
/**
|
|
22
|
-
* Avoid file conflicts by appending a count on the end of the filename
|
|
23
|
-
* if it already exists on disk. Defaults to `true`.
|
|
24
|
-
*/
|
|
25
|
-
avoidFileConflicts?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* The directory to write the upload.
|
|
28
|
-
*/
|
|
29
|
-
directory?: string | FileUploadHandlerPathResolver;
|
|
30
|
-
/**
|
|
31
|
-
* The name of the file in the directory. Can be a relative path, the directory
|
|
32
|
-
* structure will be created if it does not exist.
|
|
33
|
-
*/
|
|
34
|
-
file?: FileUploadHandlerPathResolver;
|
|
35
|
-
/**
|
|
36
|
-
* The maximum upload size allowed. If the size is exceeded an error will be thrown.
|
|
37
|
-
* Defaults to 3000000B (3MB).
|
|
38
|
-
*/
|
|
39
|
-
maxPartSize?: number;
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
* @param filename
|
|
43
|
-
* @param contentType
|
|
44
|
-
* @param name
|
|
45
|
-
*/
|
|
46
|
-
filter?(args: FileUploadHandlerFilterArgs): boolean | Promise<boolean>;
|
|
47
|
-
};
|
|
48
|
-
export declare function createFileUploadHandler({ directory, avoidFileConflicts, file, filter, maxPartSize, }?: FileUploadHandlerOptions): UploadHandler;
|
|
49
|
-
export declare class NodeOnDiskFile
|
|
50
|
-
private filepath;
|
|
51
|
-
type: string;
|
|
52
|
-
private slicer?;
|
|
53
|
-
name: string;
|
|
54
|
-
lastModified: number;
|
|
55
|
-
webkitRelativePath: string;
|
|
56
|
-
constructor(filepath: string, type: string, slicer?: {
|
|
57
|
-
start: number;
|
|
58
|
-
end: number;
|
|
59
|
-
} | undefined);
|
|
60
|
-
get size(): number;
|
|
61
|
-
slice(start?: number, end?: number, type?: string):
|
|
62
|
-
arrayBuffer(): Promise<ArrayBuffer>;
|
|
63
|
-
stream(): ReadableStream<any>;
|
|
64
|
-
stream(): NodeJS.ReadableStream;
|
|
65
|
-
text(): Promise<string>;
|
|
66
|
-
get [Symbol.toStringTag](): string;
|
|
67
|
-
remove(): Promise<void>;
|
|
68
|
-
getFilePath(): string;
|
|
69
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { UploadHandler } from './uploadHandler';
|
|
4
|
+
export declare function readableStreamToString(stream: ReadableStream<Uint8Array>, encoding?: BufferEncoding): Promise<string>;
|
|
5
|
+
export type FileUploadHandlerFilterArgs = {
|
|
6
|
+
filename: string;
|
|
7
|
+
contentType: string;
|
|
8
|
+
name: string;
|
|
9
|
+
};
|
|
10
|
+
export type FileUploadHandlerPathResolverArgs = {
|
|
11
|
+
filename: string;
|
|
12
|
+
contentType: string;
|
|
13
|
+
name: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Chooses the path of the file to be uploaded. If a string is not
|
|
17
|
+
* returned the file will not be written.
|
|
18
|
+
*/
|
|
19
|
+
export type FileUploadHandlerPathResolver = (args: FileUploadHandlerPathResolverArgs) => string | undefined;
|
|
20
|
+
export type FileUploadHandlerOptions = {
|
|
21
|
+
/**
|
|
22
|
+
* Avoid file conflicts by appending a count on the end of the filename
|
|
23
|
+
* if it already exists on disk. Defaults to `true`.
|
|
24
|
+
*/
|
|
25
|
+
avoidFileConflicts?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The directory to write the upload.
|
|
28
|
+
*/
|
|
29
|
+
directory?: string | FileUploadHandlerPathResolver;
|
|
30
|
+
/**
|
|
31
|
+
* The name of the file in the directory. Can be a relative path, the directory
|
|
32
|
+
* structure will be created if it does not exist.
|
|
33
|
+
*/
|
|
34
|
+
file?: FileUploadHandlerPathResolver;
|
|
35
|
+
/**
|
|
36
|
+
* The maximum upload size allowed. If the size is exceeded an error will be thrown.
|
|
37
|
+
* Defaults to 3000000B (3MB).
|
|
38
|
+
*/
|
|
39
|
+
maxPartSize?: number;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @param filename
|
|
43
|
+
* @param contentType
|
|
44
|
+
* @param name
|
|
45
|
+
*/
|
|
46
|
+
filter?(args: FileUploadHandlerFilterArgs): boolean | Promise<boolean>;
|
|
47
|
+
};
|
|
48
|
+
export declare function createFileUploadHandler({ directory, avoidFileConflicts, file, filter, maxPartSize, }?: FileUploadHandlerOptions): UploadHandler;
|
|
49
|
+
export declare class NodeOnDiskFile {
|
|
50
|
+
private filepath;
|
|
51
|
+
type: string;
|
|
52
|
+
private slicer?;
|
|
53
|
+
name: string;
|
|
54
|
+
lastModified: number;
|
|
55
|
+
webkitRelativePath: string;
|
|
56
|
+
constructor(filepath: string, type: string, slicer?: {
|
|
57
|
+
start: number;
|
|
58
|
+
end: number;
|
|
59
|
+
} | undefined);
|
|
60
|
+
get size(): number;
|
|
61
|
+
slice(start?: number, end?: number, type?: string): NodeOnDiskFile;
|
|
62
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
63
|
+
stream(): ReadableStream<any>;
|
|
64
|
+
stream(): NodeJS.ReadableStream;
|
|
65
|
+
text(): Promise<string>;
|
|
66
|
+
get [Symbol.toStringTag](): string;
|
|
67
|
+
remove(): Promise<void>;
|
|
68
|
+
getFilePath(): string;
|
|
69
|
+
}
|
|
70
70
|
//# sourceMappingURL=fileUploadHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileUploadHandler.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/node-http/content-type/form-data/fileUploadHandler.ts"],"names":[],"mappings":";;AAoBA,OAAO,EAA4B,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE1E,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,EAClC,QAAQ,CAAC,EAAE,cAAc,mBAoB1B;AAED,
|
|
1
|
+
{"version":3,"file":"fileUploadHandler.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/node-http/content-type/form-data/fileUploadHandler.ts"],"names":[],"mappings":";;AAoBA,OAAO,EAA4B,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE1E,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,EAClC,QAAQ,CAAC,EAAE,cAAc,mBAoB1B;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG,CAC1C,IAAI,EAAE,iCAAiC,KACpC,MAAM,GAAG,SAAS,CAAC;AAExB,MAAM,MAAM,wBAAwB,GAAG;IACrC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,6BAA6B,CAAC;IACnD;;;OAGG;IACH,IAAI,CAAC,EAAE,6BAA6B,CAAC;IACrC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,MAAM,CAAC,CAAC,IAAI,EAAE,2BAA2B,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACxE,CAAC;AA4BF,wBAAgB,uBAAuB,CAAC,EACtC,SAAoB,EACpB,kBAAyB,EACzB,IAA8B,EAC9B,MAAM,EACN,WAAqB,GACtB,GAAE,wBAA6B,GAAG,aAAa,CAyD/C;AAED,qBAAa,cAAc;IAMvB,OAAO,CAAC,QAAQ;IACT,IAAI,EAAE,MAAM;IACnB,OAAO,CAAC,MAAM,CAAC;IAPjB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,SAAK;IACjB,kBAAkB,SAAM;gBAGd,QAAQ,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACX,MAAM,CAAC;eAAW,MAAM;aAAO,MAAM;iBAAE;IAKjD,IAAI,IAAI,IAAI,MAAM,CASjB;IAED,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc;IAkB5D,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC;IAczC,MAAM,IAAI,cAAc,CAAC,GAAG,CAAC;IAC7B,MAAM,IAAI,MAAM,CAAC,cAAc;IAUzB,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;IAI7B,IAAW,CAAC,MAAM,CAAC,WAAW,CAAC,WAE9B;IAED,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAGvB,WAAW,IAAI,MAAM;CAGtB"}
|