@h4ad/serverless-adapter 2.3.2 → 2.4.0
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/lib/frameworks/trpc/index.d.ts +2 -0
- package/lib/frameworks/trpc/index.d.ts.map +1 -0
- package/lib/frameworks/trpc/index.js +18 -0
- package/lib/frameworks/trpc/index.js.map +1 -0
- package/lib/frameworks/trpc/trpc.framework.d.ts +152 -0
- package/lib/frameworks/trpc/trpc.framework.d.ts.map +1 -0
- package/lib/frameworks/trpc/trpc.framework.js +119 -0
- package/lib/frameworks/trpc/trpc.framework.js.map +1 -0
- package/package.json +11 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/frameworks/trpc/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./trpc.framework"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/frameworks/trpc/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { IncomingMessage, ServerResponse } from 'http';
|
|
3
|
+
import type { AnyRouter, DataTransformer } from '@trpc/server';
|
|
4
|
+
import { NodeHTTPCreateContextFnOptions, NodeHTTPHandlerOptions } from '@trpc/server/adapters/node-http';
|
|
5
|
+
import { SingleValueHeaders } from '../../@types';
|
|
6
|
+
import { FrameworkContract } from '../../contracts';
|
|
7
|
+
/**
|
|
8
|
+
* The transformer that is responsible to transform buffer's input to javascript objects
|
|
9
|
+
*
|
|
10
|
+
* @breadcrumb Frameworks / TrpcFramework
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export declare class BufferToJSObjectTransformer implements DataTransformer {
|
|
14
|
+
/**
|
|
15
|
+
* Deserialize unknown values to javascript objects
|
|
16
|
+
*
|
|
17
|
+
* @param value - The value to be deserialized
|
|
18
|
+
*/
|
|
19
|
+
deserialize(value?: unknown): any;
|
|
20
|
+
/**
|
|
21
|
+
* The value to be serialized, do nothing because tRPC can handle.
|
|
22
|
+
*
|
|
23
|
+
* @param value - The value to be serialized
|
|
24
|
+
*/
|
|
25
|
+
serialize(value: any): any;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The context created by this library that allows getting some information from the request and setting the status and header of the response.
|
|
29
|
+
*
|
|
30
|
+
* @breadcrumb Frameworks / TrpcFramework
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
export interface TrpcAdapterBaseContext {
|
|
34
|
+
/**
|
|
35
|
+
* The request object that will be forward to your app
|
|
36
|
+
*/
|
|
37
|
+
request: IncomingMessage;
|
|
38
|
+
/**
|
|
39
|
+
* The response object that will be forward to your app to output the response
|
|
40
|
+
*/
|
|
41
|
+
response: ServerResponse;
|
|
42
|
+
/**
|
|
43
|
+
* The method to set response status.
|
|
44
|
+
*
|
|
45
|
+
* @param statusCode - The response status that you want
|
|
46
|
+
*/
|
|
47
|
+
setStatus(statusCode: number): void;
|
|
48
|
+
/**
|
|
49
|
+
* The method to set some header in the response
|
|
50
|
+
*
|
|
51
|
+
* @param name - The name of the header
|
|
52
|
+
* @param value - The value to be set in the header
|
|
53
|
+
*/
|
|
54
|
+
setHeader(name: string, value: number | string): void;
|
|
55
|
+
/**
|
|
56
|
+
* The method to remove some header from the response
|
|
57
|
+
*
|
|
58
|
+
* @param name - The name of the header
|
|
59
|
+
*/
|
|
60
|
+
removeHeader(name: string): void;
|
|
61
|
+
/**
|
|
62
|
+
* The method to return the value of some header from the request
|
|
63
|
+
*
|
|
64
|
+
* @param name - The name of the header
|
|
65
|
+
*/
|
|
66
|
+
getHeader(name: string): string | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* The method to return the request headers
|
|
69
|
+
*/
|
|
70
|
+
getHeaders(): SingleValueHeaders;
|
|
71
|
+
/**
|
|
72
|
+
* The method to return user's address
|
|
73
|
+
*/
|
|
74
|
+
getIp(): string | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* The method to return the URL called
|
|
77
|
+
*/
|
|
78
|
+
getUrl(): string | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* The method to return the HTTP Method in the request
|
|
81
|
+
*/
|
|
82
|
+
getMethod(): string | undefined;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* This is the context merged between {@link TrpcAdapterBaseContext} and the {@link TContext} that you provided.
|
|
86
|
+
*
|
|
87
|
+
* This context will be merged with the context you created with `createContext` inside {@link TrpcFrameworkOptions}.
|
|
88
|
+
* So to make the type work, just send the properties you've added inside {@link TContext}.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```typescript
|
|
92
|
+
* type MyCustomContext = { user: { name: string } };
|
|
93
|
+
* type TrpcContext = TrpcAdapterContext<MyCustomContext>; // your final context type to put inside trpc.router
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* @breadcrumb Frameworks / TrpcFramework
|
|
97
|
+
* @public
|
|
98
|
+
*/
|
|
99
|
+
export declare type TrpcAdapterContext<TContext> = TContext & TrpcAdapterBaseContext;
|
|
100
|
+
/**
|
|
101
|
+
* The options to customize the {@link TrpcFramework}
|
|
102
|
+
*
|
|
103
|
+
* @breadcrumb Frameworks / TrpcFramework
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
export declare type TrpcFrameworkOptions<TContext> = Omit<NodeHTTPHandlerOptions<AnyRouter<TContext>, IncomingMessage, ServerResponse>, 'router' | 'createContext'> & {
|
|
107
|
+
createContext?: (opts: NodeHTTPCreateContextFnOptions<IncomingMessage, ServerResponse>) => Omit<TContext, keyof TrpcAdapterBaseContext> | Promise<Omit<TContext, keyof TrpcAdapterBaseContext>>;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* The framework that forwards requests to TRPC handler
|
|
111
|
+
*
|
|
112
|
+
* @breadcrumb Frameworks / TrpcFramework
|
|
113
|
+
* @public
|
|
114
|
+
*/
|
|
115
|
+
export declare class TrpcFramework<TContext extends TrpcAdapterBaseContext> implements FrameworkContract<AnyRouter<TContext>> {
|
|
116
|
+
protected readonly options?: TrpcFrameworkOptions<TContext> | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* Default constructor
|
|
119
|
+
*/
|
|
120
|
+
constructor(options?: TrpcFrameworkOptions<TContext> | undefined);
|
|
121
|
+
/**
|
|
122
|
+
* {@inheritDoc}
|
|
123
|
+
*/
|
|
124
|
+
sendRequest(app: AnyRouter<TContext>, request: IncomingMessage, response: ServerResponse): void;
|
|
125
|
+
/**
|
|
126
|
+
* Get safe url that can be used inside Trpc.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* const url = getSafeUrlForTrpc('/users?input=hello');
|
|
131
|
+
* console.log(url); // users
|
|
132
|
+
* ```
|
|
133
|
+
*
|
|
134
|
+
* @param request - The request object that will be forward to your app
|
|
135
|
+
*/
|
|
136
|
+
protected getSafeUrlForTrpc(request: IncomingMessage): string;
|
|
137
|
+
/**
|
|
138
|
+
* Merge the default context ({@link TrpcAdapterContext}) with the context created by the user.
|
|
139
|
+
*
|
|
140
|
+
* @param createContextOptions - The options sent by trpc to create the context
|
|
141
|
+
*/
|
|
142
|
+
protected mergeDefaultContextWithOptionsContext(createContextOptions: NodeHTTPCreateContextFnOptions<IncomingMessage, ServerResponse>): TContext | Promise<TContext>;
|
|
143
|
+
/**
|
|
144
|
+
* Wraps the resolved context from the {@link TrpcFrameworkOptions} created with `createContext` and merge
|
|
145
|
+
* with the {@link TrpcAdapterContext} generated by the library.
|
|
146
|
+
*
|
|
147
|
+
* @param resolvedContext - The context created with `createContext` inside {@link TrpcFrameworkOptions}
|
|
148
|
+
* @param createContextOptions - The options sent by trpc to create the context
|
|
149
|
+
*/
|
|
150
|
+
protected wrapResolvedContextWithDefaultContext(resolvedContext: TContext, createContextOptions: NodeHTTPCreateContextFnOptions<IncomingMessage, ServerResponse>): TContext;
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=trpc.framework.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trpc.framework.d.ts","sourceRoot":"","sources":["../../../src/frameworks/trpc/trpc.framework.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAEL,8BAA8B,EAC9B,sBAAsB,EAEvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAKpD;;;;;GAKG;AACH,qBAA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sB,CAAC,GAC5C,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,sBAAsB,CAAC,CAAC,CAAC;CAC3D,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,aAAa,CAAC,QAAQ,SAAS,sBAAsB,CAChE,YAAW,iBAAiB,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAOrC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC;IAHvC;;OAEG;gBAC4B,OAAO,CAAC,4CAAgC;IAMvE;;OAEG;IACI,WAAW,CAChB,GAAG,EAAE,SAAS,CAAC,QAAQ,CAAC,EACxB,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,cAAc,GACvB,IAAI;IAkBP;;;;;;;;;;OAUG;IACH,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM;IAU7D;;;;OAIG;IACH,SAAS,CAAC,qCAAqC,CAC7C,oBAAoB,EAAE,8BAA8B,CAClD,eAAe,EACf,cAAc,CACf,GACA,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IA4B/B;;;;;;OAMG;IACH,SAAS,CAAC,qCAAqC,CAC7C,eAAe,EAAE,QAAQ,EACzB,oBAAoB,EAAE,8BAA8B,CAClD,eAAe,EACf,cAAc,CACf,GACA,QAAQ;CAiCZ"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//#region
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.TrpcFramework = exports.BufferToJSObjectTransformer = void 0;
|
|
5
|
+
const node_http_1 = require("@trpc/server/adapters/node-http");
|
|
6
|
+
const core_1 = require("../../core");
|
|
7
|
+
//#endregion
|
|
8
|
+
/**
|
|
9
|
+
* The transformer that is responsible to transform buffer's input to javascript objects
|
|
10
|
+
*
|
|
11
|
+
* @breadcrumb Frameworks / TrpcFramework
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
class BufferToJSObjectTransformer {
|
|
15
|
+
/**
|
|
16
|
+
* Deserialize unknown values to javascript objects
|
|
17
|
+
*
|
|
18
|
+
* @param value - The value to be deserialized
|
|
19
|
+
*/
|
|
20
|
+
deserialize(value) {
|
|
21
|
+
if (value instanceof Buffer)
|
|
22
|
+
return JSON.parse(value.toString('utf-8'));
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The value to be serialized, do nothing because tRPC can handle.
|
|
27
|
+
*
|
|
28
|
+
* @param value - The value to be serialized
|
|
29
|
+
*/
|
|
30
|
+
serialize(value) {
|
|
31
|
+
return value;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.BufferToJSObjectTransformer = BufferToJSObjectTransformer;
|
|
35
|
+
/**
|
|
36
|
+
* The framework that forwards requests to TRPC handler
|
|
37
|
+
*
|
|
38
|
+
* @breadcrumb Frameworks / TrpcFramework
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
class TrpcFramework {
|
|
42
|
+
//#region Constructor
|
|
43
|
+
/**
|
|
44
|
+
* Default constructor
|
|
45
|
+
*/
|
|
46
|
+
constructor(options) {
|
|
47
|
+
this.options = options;
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region Public Methods
|
|
51
|
+
/**
|
|
52
|
+
* {@inheritDoc}
|
|
53
|
+
*/
|
|
54
|
+
sendRequest(app, request, response) {
|
|
55
|
+
const endpoint = this.getSafeUrlForTrpc(request);
|
|
56
|
+
(0, node_http_1.nodeHTTPRequestHandler)(Object.assign(Object.assign({ req: request, res: response, path: endpoint, router: app }, this.options), { createContext: createContextOptions => this.mergeDefaultContextWithOptionsContext(createContextOptions) }));
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region Protected Methods
|
|
60
|
+
/**
|
|
61
|
+
* Get safe url that can be used inside Trpc.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* const url = getSafeUrlForTrpc('/users?input=hello');
|
|
66
|
+
* console.log(url); // users
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* @param request - The request object that will be forward to your app
|
|
70
|
+
*/
|
|
71
|
+
getSafeUrlForTrpc(request) {
|
|
72
|
+
let url = request.url;
|
|
73
|
+
if (url.startsWith('/'))
|
|
74
|
+
url = url.slice(1);
|
|
75
|
+
if (url.includes('?'))
|
|
76
|
+
url = url.split('?')[0];
|
|
77
|
+
return url;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Merge the default context ({@link TrpcAdapterContext}) with the context created by the user.
|
|
81
|
+
*
|
|
82
|
+
* @param createContextOptions - The options sent by trpc to create the context
|
|
83
|
+
*/
|
|
84
|
+
mergeDefaultContextWithOptionsContext(createContextOptions) {
|
|
85
|
+
var _a;
|
|
86
|
+
const createContextFromOptions = (0, core_1.getDefaultIfUndefined)((_a = this.options) === null || _a === void 0 ? void 0 : _a.createContext, () => undefined);
|
|
87
|
+
const resolvedContext = createContextFromOptions(createContextOptions);
|
|
88
|
+
if (resolvedContext && resolvedContext.then) {
|
|
89
|
+
return resolvedContext.then(context => this.wrapResolvedContextWithDefaultContext(context, createContextOptions));
|
|
90
|
+
}
|
|
91
|
+
return this.wrapResolvedContextWithDefaultContext(resolvedContext, createContextOptions);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Wraps the resolved context from the {@link TrpcFrameworkOptions} created with `createContext` and merge
|
|
95
|
+
* with the {@link TrpcAdapterContext} generated by the library.
|
|
96
|
+
*
|
|
97
|
+
* @param resolvedContext - The context created with `createContext` inside {@link TrpcFrameworkOptions}
|
|
98
|
+
* @param createContextOptions - The options sent by trpc to create the context
|
|
99
|
+
*/
|
|
100
|
+
wrapResolvedContextWithDefaultContext(resolvedContext, createContextOptions) {
|
|
101
|
+
const request = createContextOptions.req;
|
|
102
|
+
const response = createContextOptions.res;
|
|
103
|
+
return Object.assign(Object.assign({}, resolvedContext), { request,
|
|
104
|
+
response, getUrl: () => request.url, getMethod: () => request.method, getHeaders: () => (0, core_1.getFlattenedHeadersMap)(request.headers, ',', true), setHeader: (header, value) => {
|
|
105
|
+
response.setHeader(header, value);
|
|
106
|
+
}, removeHeader: header => {
|
|
107
|
+
response.removeHeader(header);
|
|
108
|
+
}, getHeader: (header) => {
|
|
109
|
+
return (0, core_1.getFlattenedHeadersMap)(request.headers, ',', true)[header.toLowerCase()];
|
|
110
|
+
}, setStatus: (statusCode) => {
|
|
111
|
+
response.statusCode = statusCode;
|
|
112
|
+
// force undefined to get default message for the status code
|
|
113
|
+
// ref: https://nodejs.org/dist/latest-v16.x/docs/api/http.html#responsestatusmessage
|
|
114
|
+
response.statusMessage = undefined;
|
|
115
|
+
}, getIp: () => request.connection.remoteAddress });
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
exports.TrpcFramework = TrpcFramework;
|
|
119
|
+
//# sourceMappingURL=trpc.framework.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trpc.framework.js","sourceRoot":"","sources":["../../../src/frameworks/trpc/trpc.framework.ts"],"names":[],"mappings":";AAAA,SAAS;;;AAIT,+DAKyC;AAGzC,qCAA2E;AAE3E,YAAY;AAEZ;;;;;GAKG;AACH,MAAa,2BAA2B;IACtC;;;;OAIG;IACI,WAAW,CAAC,KAAe;QAChC,IAAI,KAAK,YAAY,MAAM;YAAE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QAExE,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;OAIG;IACI,SAAS,CAAC,KAAU;QACzB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AApBD,kEAoBC;AAuGD;;;;;GAKG;AACH,MAAa,aAAa;IAGxB,qBAAqB;IAErB;;OAEG;IACH,YAA+B,OAAwC;QAAxC,YAAO,GAAP,OAAO,CAAiC;IAAG,CAAC;IAE3E,YAAY;IAEZ,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ad/serverless-adapter",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Run REST APIs and other web applications using your existing Node.js application framework (NestJS, Express, Koa, Hapi, Fastify and many others), on top of AWS, Huawei and many other clouds.",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
"node.js",
|
|
54
54
|
"http",
|
|
55
55
|
"huawei",
|
|
56
|
-
"functiongraph"
|
|
56
|
+
"functiongraph",
|
|
57
|
+
"trpc"
|
|
57
58
|
],
|
|
58
59
|
"bugs": {
|
|
59
60
|
"url": "https://github.com/H4ad/serverless-adapter/issues"
|
|
@@ -87,7 +88,7 @@
|
|
|
87
88
|
"jest": "^27.5.1",
|
|
88
89
|
"lint-staged": "^10.5.4",
|
|
89
90
|
"prettier": "^2.5.1",
|
|
90
|
-
"semantic-release": "^19.0.
|
|
91
|
+
"semantic-release": "^19.0.3",
|
|
91
92
|
"stream-mock": "^2.0.5",
|
|
92
93
|
"supertest": "^6.2.3",
|
|
93
94
|
"ts-jest": "^27.1.3",
|
|
@@ -97,7 +98,8 @@
|
|
|
97
98
|
},
|
|
98
99
|
"peerDependencies": {
|
|
99
100
|
"@hapi/hapi": ">= 20.0.0",
|
|
100
|
-
"@
|
|
101
|
+
"@trpc/server": ">= 9.0.0",
|
|
102
|
+
"@types/aws-lambda": ">= 8.10.92",
|
|
101
103
|
"@types/express": ">= 4.15.4",
|
|
102
104
|
"@types/hapi": ">= 18.0.7",
|
|
103
105
|
"@types/koa": ">= 2.11.2",
|
|
@@ -107,10 +109,13 @@
|
|
|
107
109
|
"koa": ">= 2.5.1"
|
|
108
110
|
},
|
|
109
111
|
"peerDependenciesMeta": {
|
|
110
|
-
"@
|
|
112
|
+
"@hapi/hapi": {
|
|
111
113
|
"optional": true
|
|
112
114
|
},
|
|
113
|
-
"@
|
|
115
|
+
"@trpc/server": {
|
|
116
|
+
"optional": true
|
|
117
|
+
},
|
|
118
|
+
"@types/aws-lambda": {
|
|
114
119
|
"optional": true
|
|
115
120
|
},
|
|
116
121
|
"express": {
|