aws-delivlib 14.15.71 → 14.15.72
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/publishing/github/node_modules/.yarn-integrity +1 -1
- package/lib/publishing/github/node_modules/@types/aws-lambda/README.md +1 -1
- package/lib/publishing/github/node_modules/@types/aws-lambda/handler.d.ts +95 -0
- package/lib/publishing/github/node_modules/@types/aws-lambda/package.json +3 -3
- package/package.json +2 -2
@@ -47,7 +47,7 @@
|
|
47
47
|
"@octokit/webhooks-methods@^3.0.0": "https://registry.yarnpkg.com/@octokit/webhooks-methods/-/webhooks-methods-3.0.3.tgz#2648668d34fe44e437eca90c9031d0f3cb759c77",
|
48
48
|
"@octokit/webhooks-types@6.11.0": "https://registry.yarnpkg.com/@octokit/webhooks-types/-/webhooks-types-6.11.0.tgz#1fb903bff3f2883490d6ba88d8cb8f8a55f68176",
|
49
49
|
"@octokit/webhooks@^10.0.0": "https://registry.yarnpkg.com/@octokit/webhooks/-/webhooks-10.9.2.tgz#1b1e79a70fa5b22a3149b18432cbf3f39dbcb544",
|
50
|
-
"@types/aws-lambda@^8.10.83": "https://registry.yarnpkg.com/@types/aws-lambda/-/aws-lambda-8.10.
|
50
|
+
"@types/aws-lambda@^8.10.83": "https://registry.yarnpkg.com/@types/aws-lambda/-/aws-lambda-8.10.149.tgz#77c7bde809425546d03626e51bab8181bc5d24c9",
|
51
51
|
"@types/btoa-lite@^1.0.0": "https://registry.yarnpkg.com/@types/btoa-lite/-/btoa-lite-1.0.2.tgz#82bb6aab00abf7cff3ca2825abe010c0cd536ae5",
|
52
52
|
"@types/changelog-parser@^2.8.1": "https://registry.yarnpkg.com/@types/changelog-parser/-/changelog-parser-2.8.4.tgz#45d70417e742ac3bc6bef3786aa453e1f1d63ecc",
|
53
53
|
"@types/jsonwebtoken@^9.0.0": "https://registry.yarnpkg.com/@types/jsonwebtoken/-/jsonwebtoken-9.0.9.tgz#a4c3a446c0ebaaf467a58398382616f416345fb3",
|
@@ -8,7 +8,7 @@ This package contains type definitions for aws-lambda (http://docs.aws.amazon.co
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/aws-lambda.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
11
|
+
* Last updated: Wed, 09 Apr 2025 18:39:53 GMT
|
12
12
|
* Dependencies: none
|
13
13
|
|
14
14
|
# Credits
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import type { Writable } from "node:stream";
|
1
2
|
/**
|
2
3
|
* The interface that AWS Lambda will invoke your handler with.
|
3
4
|
* There are more specialized types for many cases where AWS services
|
@@ -170,3 +171,97 @@ export interface ClientContextEnv {
|
|
170
171
|
* Pass `null` or `undefined` for the `error` parameter to use this parameter.
|
171
172
|
*/
|
172
173
|
export type Callback<TResult = any> = (error?: Error | string | null, result?: TResult) => void;
|
174
|
+
|
175
|
+
/**
|
176
|
+
* Interface for using response streaming from AWS Lambda.
|
177
|
+
* To indicate to the runtime that Lambda should stream your function’s responses, you must wrap your function handler with the `awslambda.streamifyResponse()` decorator.
|
178
|
+
*
|
179
|
+
* The `streamifyResponse` decorator accepts the following additional parameter, `responseStream`, besides the default node handler parameters, `event`, and `context`.
|
180
|
+
* The new `responseStream` object provides a stream object that your function can write data to. Data written to this stream is sent immediately to the client. You can optionally set the Content-Type header of the response to pass additional metadata to your client about the contents of the stream.
|
181
|
+
*
|
182
|
+
* {@link https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/ AWS blog post}
|
183
|
+
* {@link https://docs.aws.amazon.com/lambda/latest/dg/config-rs-write-functions.html AWS documentation}
|
184
|
+
*
|
185
|
+
* @example <caption>Writing to the response stream</caption>
|
186
|
+
* import 'aws-lambda';
|
187
|
+
*
|
188
|
+
* export const handler = awslambda.streamifyResponse(
|
189
|
+
* async (event, responseStream, context) => {
|
190
|
+
* responseStream.setContentType("text/plain");
|
191
|
+
* responseStream.write("Hello, world!");
|
192
|
+
* responseStream.end();
|
193
|
+
* }
|
194
|
+
* );
|
195
|
+
*
|
196
|
+
* @example <caption>Using pipeline</caption>
|
197
|
+
* import 'aws-lambda';
|
198
|
+
* import { Readable } from 'stream';
|
199
|
+
* import { pipeline } from 'stream/promises';
|
200
|
+
* import zlib from 'zlib';
|
201
|
+
*
|
202
|
+
* export const handler = awslambda.streamifyResponse(
|
203
|
+
* async (event, responseStream, context) => {
|
204
|
+
* // As an example, convert event to a readable stream.
|
205
|
+
* const requestStream = Readable.from(Buffer.from(JSON.stringify(event)));
|
206
|
+
*
|
207
|
+
* await pipeline(requestStream, zlib.createGzip(), responseStream);
|
208
|
+
* }
|
209
|
+
* );
|
210
|
+
*/
|
211
|
+
export type StreamifyHandler<TEvent = any, TResult = any> = (
|
212
|
+
event: TEvent,
|
213
|
+
responseStream: awslambda.HttpResponseStream,
|
214
|
+
context: Context,
|
215
|
+
) => TResult | Promise<TResult>;
|
216
|
+
|
217
|
+
declare global {
|
218
|
+
namespace awslambda {
|
219
|
+
class HttpResponseStream extends Writable {
|
220
|
+
static from(
|
221
|
+
writable: Writable,
|
222
|
+
metadata: Record<string, unknown>,
|
223
|
+
): HttpResponseStream;
|
224
|
+
setContentType: (contentType: string) => void;
|
225
|
+
}
|
226
|
+
|
227
|
+
/**
|
228
|
+
* Decorator for using response streaming from AWS Lambda.
|
229
|
+
* To indicate to the runtime that Lambda should stream your function’s responses, you must wrap your function handler with the `awslambda.streamifyResponse()` decorator.
|
230
|
+
*
|
231
|
+
* The `streamifyResponse` decorator accepts the following additional parameter, `responseStream`, besides the default node handler parameters, `event`, and `context`.
|
232
|
+
* The new `responseStream` object provides a stream object that your function can write data to. Data written to this stream is sent immediately to the client. You can optionally set the Content-Type header of the response to pass additional metadata to your client about the contents of the stream.
|
233
|
+
*
|
234
|
+
* {@link https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/ AWS blog post}
|
235
|
+
* {@link https://docs.aws.amazon.com/lambda/latest/dg/config-rs-write-functions.html AWS documentation}
|
236
|
+
*
|
237
|
+
* @example <caption>Writing to the response stream</caption>
|
238
|
+
* import 'aws-lambda';
|
239
|
+
*
|
240
|
+
* export const handler = awslambda.streamifyResponse(
|
241
|
+
* async (event, responseStream, context) => {
|
242
|
+
* responseStream.setContentType("text/plain");
|
243
|
+
* responseStream.write("Hello, world!");
|
244
|
+
* responseStream.end();
|
245
|
+
* }
|
246
|
+
* );
|
247
|
+
*
|
248
|
+
* @example <caption>Using pipeline</caption>
|
249
|
+
* import 'aws-lambda';
|
250
|
+
* import { Readable } from 'stream';
|
251
|
+
* import { pipeline } from 'stream/promises';
|
252
|
+
* import zlib from 'zlib';
|
253
|
+
*
|
254
|
+
* export const handler = awslambda.streamifyResponse(
|
255
|
+
* async (event, responseStream, context) => {
|
256
|
+
* // As an example, convert event to a readable stream.
|
257
|
+
* const requestStream = Readable.from(Buffer.from(JSON.stringify(event)));
|
258
|
+
*
|
259
|
+
* await pipeline(requestStream, zlib.createGzip(), responseStream);
|
260
|
+
* }
|
261
|
+
* );
|
262
|
+
*/
|
263
|
+
function streamifyResponse<TEvent = any, TResult = void>(
|
264
|
+
handler: StreamifyHandler<TEvent, TResult>,
|
265
|
+
): StreamifyHandler<TEvent, TResult>;
|
266
|
+
}
|
267
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/aws-lambda",
|
3
|
-
"version": "8.10.
|
3
|
+
"version": "8.10.149",
|
4
4
|
"description": "TypeScript definitions for aws-lambda",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/aws-lambda",
|
6
6
|
"license": "MIT",
|
@@ -221,6 +221,6 @@
|
|
221
221
|
"scripts": {},
|
222
222
|
"dependencies": {},
|
223
223
|
"peerDependencies": {},
|
224
|
-
"typesPublisherContentHash": "
|
225
|
-
"typeScriptVersion": "5.
|
224
|
+
"typesPublisherContentHash": "c81874d4cc10b4be40e344a39f04f615284abe3e369bde369e03adb59a3722d4",
|
225
|
+
"typeScriptVersion": "5.1"
|
226
226
|
}
|
package/package.json
CHANGED
@@ -44,7 +44,7 @@
|
|
44
44
|
"@aws-sdk/client-ssm": "^3.782.0",
|
45
45
|
"@stylistic/eslint-plugin": "^2",
|
46
46
|
"@types/adm-zip": "^0.5.7",
|
47
|
-
"@types/aws-lambda": "^8.10.
|
47
|
+
"@types/aws-lambda": "^8.10.149",
|
48
48
|
"@types/follow-redirects": "^1.14.4",
|
49
49
|
"@types/fs-extra": "^9.0.13",
|
50
50
|
"@types/jest": "^29.5.14",
|
@@ -97,7 +97,7 @@
|
|
97
97
|
"publishConfig": {
|
98
98
|
"access": "public"
|
99
99
|
},
|
100
|
-
"version": "14.15.
|
100
|
+
"version": "14.15.72",
|
101
101
|
"jest": {
|
102
102
|
"coverageProvider": "v8",
|
103
103
|
"testMatch": [
|