@temporary-name/standard-server-aws-lambda 1.9.3-alpha.b7ce8fb6e9463a26fd2564cb172dc612ae4de52d → 1.9.3-alpha.c13915862ce0feb161cb37a7c0da5ab7d57bd1bf
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/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +11 -20
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Stream, { Readable } from 'node:stream';
|
|
2
|
-
import { StandardBody,
|
|
2
|
+
import { StandardBody, StandardLazyRequest, StandardResponse } from '@temporary-name/shared';
|
|
3
3
|
import { ToNodeHttpBodyOptions } from '@temporary-name/standard-server-node';
|
|
4
4
|
export { ToEventStreamOptions, toAbortSignal, toEventStream } from '@temporary-name/standard-server-node';
|
|
5
5
|
import { ToEventIteratorOptions as ToEventIteratorOptions$1 } from '@temporary-name/standard-server-fetch';
|
|
@@ -47,10 +47,10 @@ interface ToStandardBodyOptions extends ToEventIteratorOptions {
|
|
|
47
47
|
declare function toStandardBody(event: APIGatewayProxyEventV2, options?: ToStandardBodyOptions): Promise<StandardBody>;
|
|
48
48
|
interface ToLambdaBodyOptions extends ToNodeHttpBodyOptions {
|
|
49
49
|
}
|
|
50
|
-
declare function toLambdaBody(standardBody: StandardBody, standardHeaders:
|
|
50
|
+
declare function toLambdaBody(standardBody: StandardBody, standardHeaders: Headers, options?: ToLambdaBodyOptions): [body: undefined | string | Readable, headers: Headers];
|
|
51
51
|
|
|
52
|
-
declare function toStandardHeaders(headers: APIGatewayProxyEventHeaders, cookies: string[] | undefined):
|
|
53
|
-
declare function toLambdaHeaders(standard:
|
|
52
|
+
declare function toStandardHeaders(headers: APIGatewayProxyEventHeaders, cookies: string[] | undefined): Headers;
|
|
53
|
+
declare function toLambdaHeaders(standard: Headers): [headers: APIGatewayProxyEventHeaders, setCookies: string[]];
|
|
54
54
|
|
|
55
55
|
declare function toStandardLazyRequest(event: APIGatewayProxyEventV2, responseStream: Stream.Writable): StandardLazyRequest;
|
|
56
56
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Stream, { Readable } from 'node:stream';
|
|
2
|
-
import { StandardBody,
|
|
2
|
+
import { StandardBody, StandardLazyRequest, StandardResponse } from '@temporary-name/shared';
|
|
3
3
|
import { ToNodeHttpBodyOptions } from '@temporary-name/standard-server-node';
|
|
4
4
|
export { ToEventStreamOptions, toAbortSignal, toEventStream } from '@temporary-name/standard-server-node';
|
|
5
5
|
import { ToEventIteratorOptions as ToEventIteratorOptions$1 } from '@temporary-name/standard-server-fetch';
|
|
@@ -47,10 +47,10 @@ interface ToStandardBodyOptions extends ToEventIteratorOptions {
|
|
|
47
47
|
declare function toStandardBody(event: APIGatewayProxyEventV2, options?: ToStandardBodyOptions): Promise<StandardBody>;
|
|
48
48
|
interface ToLambdaBodyOptions extends ToNodeHttpBodyOptions {
|
|
49
49
|
}
|
|
50
|
-
declare function toLambdaBody(standardBody: StandardBody, standardHeaders:
|
|
50
|
+
declare function toLambdaBody(standardBody: StandardBody, standardHeaders: Headers, options?: ToLambdaBodyOptions): [body: undefined | string | Readable, headers: Headers];
|
|
51
51
|
|
|
52
|
-
declare function toStandardHeaders(headers: APIGatewayProxyEventHeaders, cookies: string[] | undefined):
|
|
53
|
-
declare function toLambdaHeaders(standard:
|
|
52
|
+
declare function toStandardHeaders(headers: APIGatewayProxyEventHeaders, cookies: string[] | undefined): Headers;
|
|
53
|
+
declare function toLambdaHeaders(standard: Headers): [headers: APIGatewayProxyEventHeaders, setCookies: string[]];
|
|
54
54
|
|
|
55
55
|
declare function toStandardLazyRequest(event: APIGatewayProxyEventV2, responseStream: Stream.Writable): StandardLazyRequest;
|
|
56
56
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { runWithSpan, parseEmptyableJSON,
|
|
2
|
-
import { getFilenameFromContentDisposition
|
|
1
|
+
import { runWithSpan, parseEmptyableJSON, once } from '@temporary-name/shared';
|
|
2
|
+
import { getFilenameFromContentDisposition } from '@temporary-name/standard-server';
|
|
3
3
|
import { toNodeHttpBody, toAbortSignal } from '@temporary-name/standard-server-node';
|
|
4
4
|
export { toAbortSignal, toEventStream } from '@temporary-name/standard-server-node';
|
|
5
5
|
import { Buffer } from 'node:buffer';
|
|
@@ -38,7 +38,7 @@ function toStandardBody(event, options = {}) {
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
function toLambdaBody(standardBody, standardHeaders, options = {}) {
|
|
41
|
-
standardHeaders =
|
|
41
|
+
standardHeaders = new Headers(standardHeaders);
|
|
42
42
|
const body = toNodeHttpBody(standardBody, standardHeaders, options);
|
|
43
43
|
return [body, standardHeaders];
|
|
44
44
|
}
|
|
@@ -63,25 +63,16 @@ function _parseAsFormData(body, isBase64Encoded, contentType) {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
function toStandardHeaders(headers, cookies) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"set-cookie"
|
|
69
|
-
}
|
|
66
|
+
const standard = new Headers(headers);
|
|
67
|
+
for (const cookie of cookies ?? []) {
|
|
68
|
+
standard.append("set-cookie", cookie);
|
|
69
|
+
}
|
|
70
|
+
return standard;
|
|
70
71
|
}
|
|
71
72
|
function toLambdaHeaders(standard) {
|
|
72
|
-
const headers =
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const value = standard[key];
|
|
76
|
-
if (value === void 0) {
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
if (key === "set-cookie") {
|
|
80
|
-
setCookies.push(...toArray(value));
|
|
81
|
-
} else {
|
|
82
|
-
headers[key] = flattenHeader(value);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
73
|
+
const headers = Object.fromEntries(standard);
|
|
74
|
+
delete headers["set-cookie"];
|
|
75
|
+
const setCookies = standard.getSetCookie();
|
|
85
76
|
return [headers, setCookies];
|
|
86
77
|
}
|
|
87
78
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temporary-name/standard-server-aws-lambda",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.9.3-alpha.
|
|
4
|
+
"version": "1.9.3-alpha.c13915862ce0feb161cb37a7c0da5ab7d57bd1bf",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://www.stainless.com/",
|
|
7
7
|
"repository": {
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@temporary-name/shared": "1.9.3-alpha.
|
|
27
|
-
"@temporary-name/standard-server-fetch": "1.9.3-alpha.
|
|
28
|
-
"@temporary-name/standard-server": "1.9.3-alpha.
|
|
29
|
-
"@temporary-name/standard-server
|
|
26
|
+
"@temporary-name/shared": "1.9.3-alpha.c13915862ce0feb161cb37a7c0da5ab7d57bd1bf",
|
|
27
|
+
"@temporary-name/standard-server-fetch": "1.9.3-alpha.c13915862ce0feb161cb37a7c0da5ab7d57bd1bf",
|
|
28
|
+
"@temporary-name/standard-server-node": "1.9.3-alpha.c13915862ce0feb161cb37a7c0da5ab7d57bd1bf",
|
|
29
|
+
"@temporary-name/standard-server": "1.9.3-alpha.c13915862ce0feb161cb37a7c0da5ab7d57bd1bf"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/aws-lambda": "^8.10.153",
|