@kensio/yulin 1.16.1 → 1.16.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/dist/sdk/wire/sim-sdk-wire-operation.d.ts +12 -2
- package/dist/sdk/wire/sim-sdk-wire-operation.d.ts.map +1 -1
- package/dist/sdk/wire/sim-sdk-wire-operation.js.map +1 -1
- package/dist/sdk/wire/sim-sdk-wire.types.d.ts +0 -4
- package/dist/sdk/wire/sim-sdk-wire.types.d.ts.map +1 -1
- package/dist/service/aws/factory/sim-aws-lambda-collaborators.d.ts +8 -0
- package/dist/service/aws/factory/sim-aws-lambda-collaborators.d.ts.map +1 -1
- package/dist/service/aws/factory/sim-aws-lambda-collaborators.js +13 -0
- package/dist/service/aws/factory/sim-aws-lambda-collaborators.js.map +1 -1
- package/dist/service/cognito/command/auth/sim-cognito-password-sign-in.d.ts.map +1 -1
- package/dist/service/cognito/command/auth/sim-cognito-password-sign-in.js +2 -1
- package/dist/service/cognito/command/auth/sim-cognito-password-sign-in.js.map +1 -1
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-password-sign-in.d.ts.map +1 -1
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-password-sign-in.js +2 -1
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-password-sign-in.js.map +1 -1
- package/dist/service/cognito/command/sim-cognito-command.types.d.ts +1 -0
- package/dist/service/cognito/command/sim-cognito-command.types.d.ts.map +1 -1
- package/dist/service/cognito/command/sim-cognito-commands.d.ts +2 -0
- package/dist/service/cognito/command/sim-cognito-commands.d.ts.map +1 -1
- package/dist/service/cognito/command/sim-cognito-commands.js +8 -0
- package/dist/service/cognito/command/sim-cognito-commands.js.map +1 -1
- package/dist/service/cognito/command/user/password-reset.command.d.ts +80 -0
- package/dist/service/cognito/command/user/password-reset.command.d.ts.map +1 -0
- package/dist/service/cognito/command/user/password-reset.command.js +2 -0
- package/dist/service/cognito/command/user/password-reset.command.js.map +1 -0
- package/dist/service/cognito/command/user/sim-cognito-password-reset-commands.d.ts +74 -0
- package/dist/service/cognito/command/user/sim-cognito-password-reset-commands.d.ts.map +1 -0
- package/dist/service/cognito/command/user/sim-cognito-password-reset-commands.js +121 -0
- package/dist/service/cognito/command/user/sim-cognito-password-reset-commands.js.map +1 -0
- package/dist/service/cognito/command/user/sim-cognito-resetting-user.d.ts +34 -0
- package/dist/service/cognito/command/user/sim-cognito-resetting-user.d.ts.map +1 -0
- package/dist/service/cognito/command/user/sim-cognito-resetting-user.js +54 -0
- package/dist/service/cognito/command/user/sim-cognito-resetting-user.js.map +1 -0
- package/dist/service/cognito/command/user/sim-cognito-sign-up-commands.d.ts.map +1 -1
- package/dist/service/cognito/command/user/sim-cognito-sign-up-commands.js +3 -3
- package/dist/service/cognito/command/user/sim-cognito-sign-up-commands.js.map +1 -1
- package/dist/service/cognito/command/user/sim-cognito-unsimulated-password-reset-options.d.ts +29 -0
- package/dist/service/cognito/command/user/sim-cognito-unsimulated-password-reset-options.d.ts.map +1 -0
- package/dist/service/cognito/command/user/sim-cognito-unsimulated-password-reset-options.js +36 -0
- package/dist/service/cognito/command/user/sim-cognito-unsimulated-password-reset-options.js.map +1 -0
- package/dist/service/cognito/error/sim-cognito.error.d.ts +23 -0
- package/dist/service/cognito/error/sim-cognito.error.d.ts.map +1 -1
- package/dist/service/cognito/error/sim-cognito.error.js +27 -0
- package/dist/service/cognito/error/sim-cognito.error.js.map +1 -1
- package/dist/service/cognito/index.d.ts +2 -1
- package/dist/service/cognito/index.d.ts.map +1 -1
- package/dist/service/cognito/index.js +2 -1
- package/dist/service/cognito/index.js.map +1 -1
- package/dist/service/cognito/sdk/sim-cognito-sdk-directory-routes.d.ts +6 -5
- package/dist/service/cognito/sdk/sim-cognito-sdk-directory-routes.d.ts.map +1 -1
- package/dist/service/cognito/sdk/sim-cognito-sdk-directory-routes.js +18 -5
- package/dist/service/cognito/sdk/sim-cognito-sdk-directory-routes.js.map +1 -1
- package/dist/service/cognito/serve/page/sim-cognito-forgot-password-page.d.ts +26 -0
- package/dist/service/cognito/serve/page/sim-cognito-forgot-password-page.d.ts.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-forgot-password-page.js +57 -0
- package/dist/service/cognito/serve/page/sim-cognito-forgot-password-page.js.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-managed-login.d.ts +9 -6
- package/dist/service/cognito/serve/page/sim-cognito-managed-login.d.ts.map +1 -1
- package/dist/service/cognito/serve/page/sim-cognito-managed-login.js +26 -11
- package/dist/service/cognito/serve/page/sim-cognito-managed-login.js.map +1 -1
- package/dist/service/cognito/serve/page/sim-cognito-page-paths.d.ts +18 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-paths.d.ts.map +1 -1
- package/dist/service/cognito/serve/page/sim-cognito-page-paths.js +23 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-paths.js.map +1 -1
- package/dist/service/cognito/serve/page/sim-cognito-provider-links.d.ts +12 -0
- package/dist/service/cognito/serve/page/sim-cognito-provider-links.d.ts.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-provider-links.js +18 -0
- package/dist/service/cognito/serve/page/sim-cognito-provider-links.js.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-reset-password-page.d.ts +27 -0
- package/dist/service/cognito/serve/page/sim-cognito-reset-password-page.d.ts.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-reset-password-page.js +65 -0
- package/dist/service/cognito/serve/page/sim-cognito-reset-password-page.js.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-sign-in-page.d.ts +2 -10
- package/dist/service/cognito/serve/page/sim-cognito-sign-in-page.d.ts.map +1 -1
- package/dist/service/cognito/serve/page/sim-cognito-sign-in-page.js +16 -21
- package/dist/service/cognito/serve/page/sim-cognito-sign-in-page.js.map +1 -1
- package/dist/service/cognito/sim-cognito-user-directory.d.ts +16 -0
- package/dist/service/cognito/sim-cognito-user-directory.d.ts.map +1 -1
- package/dist/service/cognito/sim-cognito-user-directory.js +25 -0
- package/dist/service/cognito/sim-cognito-user-directory.js.map +1 -1
- package/dist/service/cognito/user-pool/auth/sim-cognito-sign-in.d.ts +9 -0
- package/dist/service/cognito/user-pool/auth/sim-cognito-sign-in.d.ts.map +1 -1
- package/dist/service/cognito/user-pool/auth/sim-cognito-sign-in.js +14 -1
- package/dist/service/cognito/user-pool/auth/sim-cognito-sign-in.js.map +1 -1
- package/dist/service/cognito/user-pool/idp/sim-cognito-federated-identity.d.ts +10 -0
- package/dist/service/cognito/user-pool/idp/sim-cognito-federated-identity.d.ts.map +1 -1
- package/dist/service/cognito/user-pool/idp/sim-cognito-federated-identity.js +11 -0
- package/dist/service/cognito/user-pool/idp/sim-cognito-federated-identity.js.map +1 -1
- package/dist/service/cognito/user-pool/message/sim-cognito-code-delivery.d.ts +44 -0
- package/dist/service/cognito/user-pool/message/sim-cognito-code-delivery.d.ts.map +1 -0
- package/dist/service/cognito/user-pool/message/sim-cognito-code-delivery.js +78 -0
- package/dist/service/cognito/user-pool/message/sim-cognito-code-delivery.js.map +1 -0
- package/dist/service/cognito/user-pool/message/sim-cognito-message-occasion.d.ts +10 -6
- package/dist/service/cognito/user-pool/message/sim-cognito-message-occasion.d.ts.map +1 -1
- package/dist/service/cognito/user-pool/message/sim-cognito-pool-messenger.d.ts +5 -2
- package/dist/service/cognito/user-pool/message/sim-cognito-pool-messenger.d.ts.map +1 -1
- package/dist/service/cognito/user-pool/message/sim-cognito-pool-messenger.js +5 -2
- package/dist/service/cognito/user-pool/message/sim-cognito-pool-messenger.js.map +1 -1
- package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-occasion.d.ts +15 -0
- package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-occasion.d.ts.map +1 -1
- package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-occasion.js +18 -0
- package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-occasion.js.map +1 -1
- package/dist/service/cognito/user-pool/trigger/sim-cognito-user-pool-triggers.d.ts +4 -1
- package/dist/service/cognito/user-pool/trigger/sim-cognito-user-pool-triggers.d.ts.map +1 -1
- package/dist/service/cognito/user-pool/trigger/sim-cognito-user-pool-triggers.js +5 -2
- package/dist/service/cognito/user-pool/trigger/sim-cognito-user-pool-triggers.js.map +1 -1
- package/dist/service/cognito/user-pool/user/sim-cognito-user-confirmation.d.ts +14 -6
- package/dist/service/cognito/user-pool/user/sim-cognito-user-confirmation.d.ts.map +1 -1
- package/dist/service/cognito/user-pool/user/sim-cognito-user-confirmation.js +20 -9
- package/dist/service/cognito/user-pool/user/sim-cognito-user-confirmation.js.map +1 -1
- package/dist/service/cognito/user-pool/user/sim-cognito-user-password-reset.d.ts +62 -0
- package/dist/service/cognito/user-pool/user/sim-cognito-user-password-reset.d.ts.map +1 -0
- package/dist/service/cognito/user-pool/user/sim-cognito-user-password-reset.js +65 -0
- package/dist/service/cognito/user-pool/user/sim-cognito-user-password-reset.js.map +1 -0
- package/dist/service/cognito/user-pool/user/sim-cognito-user-status.d.ts +55 -11
- package/dist/service/cognito/user-pool/user/sim-cognito-user-status.d.ts.map +1 -1
- package/dist/service/cognito/user-pool/user/sim-cognito-user-status.js +67 -10
- package/dist/service/cognito/user-pool/user/sim-cognito-user-status.js.map +1 -1
- package/dist/service/cognito/user-pool/user/sim-cognito-user.d.ts +15 -12
- package/dist/service/cognito/user-pool/user/sim-cognito-user.d.ts.map +1 -1
- package/dist/service/cognito/user-pool/user/sim-cognito-user.js +31 -20
- package/dist/service/cognito/user-pool/user/sim-cognito-user.js.map +1 -1
- package/dist/service/lambda/command/create-function/create-function.handler.d.ts +3 -0
- package/dist/service/lambda/command/create-function/create-function.handler.d.ts.map +1 -1
- package/dist/service/lambda/command/create-function/create-function.handler.js +5 -1
- package/dist/service/lambda/command/create-function/create-function.handler.js.map +1 -1
- package/dist/service/lambda/command/function/sim-lambda-function-commands.d.ts +2 -0
- package/dist/service/lambda/command/function/sim-lambda-function-commands.d.ts.map +1 -1
- package/dist/service/lambda/command/function/sim-lambda-function-commands.js.map +1 -1
- package/dist/service/lambda/function/code/sim-lambda-code-resolver.d.ts +7 -0
- package/dist/service/lambda/function/code/sim-lambda-code-resolver.d.ts.map +1 -1
- package/dist/service/lambda/function/code/sim-lambda-code-resolver.js +1 -0
- package/dist/service/lambda/function/code/sim-lambda-code-resolver.js.map +1 -1
- package/dist/service/lambda/function/code/sim-lambda-vm-zip-code-factory.d.ts +3 -0
- package/dist/service/lambda/function/code/sim-lambda-vm-zip-code-factory.d.ts.map +1 -1
- package/dist/service/lambda/function/code/sim-lambda-vm-zip-code-factory.js +3 -0
- package/dist/service/lambda/function/code/sim-lambda-vm-zip-code-factory.js.map +1 -1
- package/dist/service/lambda/function/code/sim-lambda-vm-zip-code.d.ts +6 -9
- package/dist/service/lambda/function/code/sim-lambda-vm-zip-code.d.ts.map +1 -1
- package/dist/service/lambda/function/code/sim-lambda-vm-zip-code.js +3 -3
- package/dist/service/lambda/function/code/sim-lambda-vm-zip-code.js.map +1 -1
- package/dist/service/lambda/function/code/vm/sdk/sim-sdk-lambda-vm-module-provider.d.ts +11 -3
- package/dist/service/lambda/function/code/vm/sdk/sim-sdk-lambda-vm-module-provider.d.ts.map +1 -1
- package/dist/service/lambda/function/code/vm/sdk/sim-sdk-lambda-vm-module-provider.js +13 -8
- package/dist/service/lambda/function/code/vm/sdk/sim-sdk-lambda-vm-module-provider.js.map +1 -1
- package/dist/service/lambda/function/code/vm/sim-lambda-vm-context.d.ts +21 -2
- package/dist/service/lambda/function/code/vm/sim-lambda-vm-context.d.ts.map +1 -1
- package/dist/service/lambda/function/code/vm/sim-lambda-vm-context.js +18 -2
- package/dist/service/lambda/function/code/vm/sim-lambda-vm-context.js.map +1 -1
- package/dist/service/lambda/function/invoke/sim-lambda-host-scope.d.ts +26 -0
- package/dist/service/lambda/function/invoke/sim-lambda-host-scope.d.ts.map +1 -0
- package/dist/service/lambda/function/invoke/sim-lambda-host-scope.js +17 -0
- package/dist/service/lambda/function/invoke/sim-lambda-host-scope.js.map +1 -0
- package/dist/service/lambda/function/invoke/sim-lambda-outbound-clients.d.ts +17 -0
- package/dist/service/lambda/function/invoke/sim-lambda-outbound-clients.d.ts.map +1 -0
- package/dist/service/lambda/function/invoke/sim-lambda-outbound-clients.js +43 -0
- package/dist/service/lambda/function/invoke/sim-lambda-outbound-clients.js.map +1 -0
- package/dist/service/lambda/function/invoke/sim-lambda-process-outbound.d.ts +44 -0
- package/dist/service/lambda/function/invoke/sim-lambda-process-outbound.d.ts.map +1 -0
- package/dist/service/lambda/function/invoke/sim-lambda-process-outbound.js +83 -0
- package/dist/service/lambda/function/invoke/sim-lambda-process-outbound.js.map +1 -0
- package/dist/service/lambda/function/outbound/sim-lambda-aws-api-outbound.d.ts +50 -0
- package/dist/service/lambda/function/outbound/sim-lambda-aws-api-outbound.d.ts.map +1 -0
- package/dist/service/lambda/function/outbound/sim-lambda-aws-api-outbound.js +83 -0
- package/dist/service/lambda/function/outbound/sim-lambda-aws-api-outbound.js.map +1 -0
- package/dist/service/lambda/function/outbound/sim-lambda-http-module.d.ts +42 -0
- package/dist/service/lambda/function/outbound/sim-lambda-http-module.d.ts.map +1 -0
- package/dist/service/lambda/function/outbound/sim-lambda-http-module.js +88 -0
- package/dist/service/lambda/function/outbound/sim-lambda-http-module.js.map +1 -0
- package/dist/service/lambda/function/{code/vm/http/sim-lambda-vm-wire-request.d.ts → outbound/sim-lambda-http-request.d.ts} +20 -7
- package/dist/service/lambda/function/outbound/sim-lambda-http-request.d.ts.map +1 -0
- package/dist/service/lambda/function/{code/vm/http/sim-lambda-vm-wire-request.js → outbound/sim-lambda-http-request.js} +27 -29
- package/dist/service/lambda/function/outbound/sim-lambda-http-request.js.map +1 -0
- package/dist/service/lambda/function/outbound/sim-lambda-http-response.d.ts +18 -0
- package/dist/service/lambda/function/outbound/sim-lambda-http-response.d.ts.map +1 -0
- package/dist/service/lambda/function/outbound/sim-lambda-http-response.js +23 -0
- package/dist/service/lambda/function/outbound/sim-lambda-http-response.js.map +1 -0
- package/dist/service/lambda/function/{code/vm/http/sim-lambda-vm-http-target.d.ts → outbound/sim-lambda-http-target.d.ts} +9 -7
- package/dist/service/lambda/function/outbound/sim-lambda-http-target.d.ts.map +1 -0
- package/dist/service/lambda/function/{code/vm/http/sim-lambda-vm-http-target.js → outbound/sim-lambda-http-target.js} +4 -38
- package/dist/service/lambda/function/outbound/sim-lambda-http-target.js.map +1 -0
- package/dist/service/lambda/function/outbound/sim-lambda-outbound-fetch.d.ts +15 -0
- package/dist/service/lambda/function/outbound/sim-lambda-outbound-fetch.d.ts.map +1 -0
- package/dist/service/lambda/function/outbound/sim-lambda-outbound-fetch.js +38 -0
- package/dist/service/lambda/function/outbound/sim-lambda-outbound-fetch.js.map +1 -0
- package/dist/service/lambda/function/outbound/sim-lambda-outbound-http.d.ts +27 -0
- package/dist/service/lambda/function/outbound/sim-lambda-outbound-http.d.ts.map +1 -0
- package/dist/service/lambda/function/outbound/sim-lambda-outbound-http.factory.d.ts +13 -0
- package/dist/service/lambda/function/outbound/sim-lambda-outbound-http.factory.d.ts.map +1 -0
- package/dist/service/lambda/function/outbound/sim-lambda-outbound-http.factory.js +107 -0
- package/dist/service/lambda/function/outbound/sim-lambda-outbound-http.factory.js.map +1 -0
- package/dist/service/lambda/function/outbound/sim-lambda-outbound-http.js +2 -0
- package/dist/service/lambda/function/outbound/sim-lambda-outbound-http.js.map +1 -0
- package/dist/service/lambda/function/outbound/sim-lambda-outbound-wire.d.ts +16 -0
- package/dist/service/lambda/function/outbound/sim-lambda-outbound-wire.d.ts.map +1 -0
- package/dist/service/lambda/function/outbound/sim-lambda-outbound-wire.js +29 -0
- package/dist/service/lambda/function/outbound/sim-lambda-outbound-wire.js.map +1 -0
- package/dist/service/lambda/function/sim-lambda-function.d.ts +12 -6
- package/dist/service/lambda/function/sim-lambda-function.d.ts.map +1 -1
- package/dist/service/lambda/function/sim-lambda-function.js +9 -10
- package/dist/service/lambda/function/sim-lambda-function.js.map +1 -1
- package/dist/service/lambda/sim-lambda-commands.d.ts +8 -0
- package/dist/service/lambda/sim-lambda-commands.d.ts.map +1 -1
- package/dist/service/lambda/sim-lambda-commands.js +2 -1
- package/dist/service/lambda/sim-lambda-commands.js.map +1 -1
- package/dist/service/rekognition/face/sim-rekognition-face-detail-builder.d.ts.map +1 -1
- package/dist/service/rekognition/face/sim-rekognition-face-detail-builder.js.map +1 -1
- package/package.json +2 -2
- package/dist/service/lambda/function/code/vm/http/sim-lambda-vm-http-module.d.ts +0 -27
- package/dist/service/lambda/function/code/vm/http/sim-lambda-vm-http-module.d.ts.map +0 -1
- package/dist/service/lambda/function/code/vm/http/sim-lambda-vm-http-module.js +0 -78
- package/dist/service/lambda/function/code/vm/http/sim-lambda-vm-http-module.js.map +0 -1
- package/dist/service/lambda/function/code/vm/http/sim-lambda-vm-http-target.d.ts.map +0 -1
- package/dist/service/lambda/function/code/vm/http/sim-lambda-vm-http-target.js.map +0 -1
- package/dist/service/lambda/function/code/vm/http/sim-lambda-vm-wire-request.d.ts.map +0 -1
- package/dist/service/lambda/function/code/vm/http/sim-lambda-vm-wire-request.js.map +0 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { STATUS_CODES } from "node:http";
|
|
2
|
+
import { Readable } from "node:stream";
|
|
3
|
+
/**
|
|
4
|
+
* Present a simulated response as the incoming message an HTTP client reads.
|
|
5
|
+
*
|
|
6
|
+
* The body is read in full before the message is built, because a client
|
|
7
|
+
* reading an incoming message expects to be handed the stream rather than a
|
|
8
|
+
* promise of one.
|
|
9
|
+
*/
|
|
10
|
+
export async function simLambdaHttpResponseMessage(response) {
|
|
11
|
+
const body = Buffer.from(await response.arrayBuffer());
|
|
12
|
+
const message = Readable.from([body], {
|
|
13
|
+
objectMode: false,
|
|
14
|
+
});
|
|
15
|
+
message.statusCode = response.status;
|
|
16
|
+
message.statusMessage =
|
|
17
|
+
response.statusText === ""
|
|
18
|
+
? (STATUS_CODES[response.status] ?? "")
|
|
19
|
+
: response.statusText;
|
|
20
|
+
message.headers = Object.fromEntries(response.headers);
|
|
21
|
+
return message;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=sim-lambda-http-response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-http-response.js","sourceRoot":"","sources":["../../../../../src/service/lambda/function/outbound/sim-lambda-http-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAWvC;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,QAAkB;IAElB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE;QACpC,UAAU,EAAE,KAAK;KAClB,CAAiC,CAAC;IAEnC,OAAO,CAAC,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC;IACrC,OAAO,CAAC,aAAa;QACnB,QAAQ,CAAC,UAAU,KAAK,EAAE;YACxB,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACvC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC;IAC1B,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAEvD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Where an outgoing HTTP request from sim Lambda function code is addressed.
|
|
3
3
|
*/
|
|
4
|
-
export interface
|
|
4
|
+
export interface SimLambdaHttpTarget {
|
|
5
5
|
readonly hostname: string;
|
|
6
6
|
readonly path: string;
|
|
7
7
|
readonly method: string;
|
|
8
8
|
readonly headers: Record<string, string>;
|
|
9
|
+
/**
|
|
10
|
+
* The scheme the request names, for the calls that name one. A call that
|
|
11
|
+
* says nothing about it is the transport module's own scheme, which is the
|
|
12
|
+
* one thing here the arguments never carry.
|
|
13
|
+
*/
|
|
14
|
+
readonly scheme: string | undefined;
|
|
9
15
|
}
|
|
10
|
-
/**
|
|
11
|
-
* Whether a hostname is an AWS service API endpoint.
|
|
12
|
-
*/
|
|
13
|
-
export declare function isSimAwsEndpointHostname(hostname: string): boolean;
|
|
14
16
|
/**
|
|
15
17
|
* Read where a call to `http.request` or `https.request` is addressed.
|
|
16
18
|
*
|
|
@@ -19,5 +21,5 @@ export declare function isSimAwsEndpointHostname(hostname: string): boolean;
|
|
|
19
21
|
* neither form read as undefined, which leaves the request to the host module
|
|
20
22
|
* and its own error message rather than inventing one.
|
|
21
23
|
*/
|
|
22
|
-
export declare function
|
|
23
|
-
//# sourceMappingURL=sim-lambda-
|
|
24
|
+
export declare function readSimLambdaHttpTarget(callArguments: readonly unknown[]): SimLambdaHttpTarget | undefined;
|
|
25
|
+
//# sourceMappingURL=sim-lambda-http-target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-http-target.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/function/outbound/sim-lambda-http-target.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEzC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,SAAS,OAAO,EAAE,GAChC,mBAAmB,GAAG,SAAS,CAkBjC"}
|
|
@@ -1,39 +1,4 @@
|
|
|
1
|
-
import { isRecord } from "
|
|
2
|
-
/**
|
|
3
|
-
* The hostname suffixes AWS issues its service API endpoints under.
|
|
4
|
-
*
|
|
5
|
-
* A request to one of these is a request to an AWS service API whoever sent
|
|
6
|
-
* it, so it belongs to the simulation rather than the network. Everything else
|
|
7
|
-
* a function asks for still goes wherever it was addressed.
|
|
8
|
-
*
|
|
9
|
-
* `.on.aws` is not among them: what AWS issues under it is Lambda Function
|
|
10
|
-
* URLs, which are the endpoint of one function rather than a service API.
|
|
11
|
-
*/
|
|
12
|
-
const awsEndpointSuffixes = [
|
|
13
|
-
".amazonaws.com",
|
|
14
|
-
".amazonaws.com.cn",
|
|
15
|
-
".api.aws",
|
|
16
|
-
];
|
|
17
|
-
/**
|
|
18
|
-
* The label an endpoint hostname carries when it names one resource rather
|
|
19
|
-
* than a service API: an API Gateway HTTP API, under `.amazonaws.com`.
|
|
20
|
-
*
|
|
21
|
-
* A request to one of these is an ordinary HTTP request to something the
|
|
22
|
-
* simulation may be running, not a serialized Command, so there is nothing
|
|
23
|
-
* here to route it as. It goes where it was addressed, as it did before this
|
|
24
|
-
* ran at all.
|
|
25
|
-
*/
|
|
26
|
-
const resourceEndpointLabel = ".execute-api.";
|
|
27
|
-
/**
|
|
28
|
-
* Whether a hostname is an AWS service API endpoint.
|
|
29
|
-
*/
|
|
30
|
-
export function isSimAwsEndpointHostname(hostname) {
|
|
31
|
-
const name = hostname.toLowerCase();
|
|
32
|
-
if (name.includes(resourceEndpointLabel)) {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
return awsEndpointSuffixes.some((suffix) => name.endsWith(suffix));
|
|
36
|
-
}
|
|
1
|
+
import { isRecord } from "../../../../util/type-guard/record.js";
|
|
37
2
|
/**
|
|
38
3
|
* Read where a call to `http.request` or `https.request` is addressed.
|
|
39
4
|
*
|
|
@@ -42,7 +7,7 @@ export function isSimAwsEndpointHostname(hostname) {
|
|
|
42
7
|
* neither form read as undefined, which leaves the request to the host module
|
|
43
8
|
* and its own error message rather than inventing one.
|
|
44
9
|
*/
|
|
45
|
-
export function
|
|
10
|
+
export function readSimLambdaHttpTarget(callArguments) {
|
|
46
11
|
const [first, second] = callArguments;
|
|
47
12
|
const url = requestUrl(first);
|
|
48
13
|
const optionsArgument = url === undefined ? first : second;
|
|
@@ -56,6 +21,7 @@ export function readSimLambdaVmHttpTarget(callArguments) {
|
|
|
56
21
|
path: stringOption(options, "path") ?? urlPath(url),
|
|
57
22
|
method: stringOption(options, "method") ?? "GET",
|
|
58
23
|
headers: targetHeaders(options),
|
|
24
|
+
scheme: stringOption(options, "protocol") ?? url?.protocol,
|
|
59
25
|
};
|
|
60
26
|
}
|
|
61
27
|
function urlPath(url) {
|
|
@@ -108,4 +74,4 @@ function stringOption(options, name) {
|
|
|
108
74
|
const value = options[name];
|
|
109
75
|
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
110
76
|
}
|
|
111
|
-
//# sourceMappingURL=sim-lambda-
|
|
77
|
+
//# sourceMappingURL=sim-lambda-http-target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-http-target.js","sourceRoot":"","sources":["../../../../../src/service/lambda/function/outbound/sim-lambda-http-target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAmBjE;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CACrC,aAAiC;IAEjC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,aAAa,CAAC;IACtC,MAAM,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAC9B,MAAM,eAAe,GAAG,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;IAC3D,MAAM,OAAO,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,eAAe,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fetch` sim Lambda function code is given.
|
|
4
|
+
*
|
|
5
|
+
* A request to a hostname the simulation serves is answered by the simulation,
|
|
6
|
+
* and everything else is the host `fetch`'s, made exactly as it was asked for.
|
|
7
|
+
* The arguments are passed on untouched in that case, so a request carrying a
|
|
8
|
+
* streaming body is not read here on its way past.
|
|
9
|
+
*
|
|
10
|
+
* This is the client a Node.js handler reaches for first, and the only one an
|
|
11
|
+
* OAuth token exchange needs, so it routes the same way the transport modules
|
|
12
|
+
* do rather than being the one client that leaves the simulation.
|
|
13
|
+
*/
|
|
14
|
+
export declare function makeSimLambdaOutboundFetch(outbound: SimLambdaOutboundHttp | undefined, hostFetch?: typeof fetch): typeof fetch;
|
|
15
|
+
//# sourceMappingURL=sim-lambda-outbound-fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-outbound-fetch.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/function/outbound/sim-lambda-outbound-fetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAwB3E;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,qBAAqB,GAAG,SAAS,EAC3C,SAAS,GAAE,OAAO,KAAa,GAC9B,OAAO,KAAK,CAiBd"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a call to `fetch` is addressed, or undefined when the arguments name
|
|
3
|
+
* no hostname at all.
|
|
4
|
+
*
|
|
5
|
+
* Arguments that name none are left to the host `fetch` and its own error
|
|
6
|
+
* message, rather than being given one invented here.
|
|
7
|
+
*/
|
|
8
|
+
function fetchHostname(input) {
|
|
9
|
+
if (input instanceof URL) {
|
|
10
|
+
return input.hostname;
|
|
11
|
+
}
|
|
12
|
+
const url = typeof input === "string" ? input : input.url;
|
|
13
|
+
return URL.parse(url)?.hostname;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Build the `fetch` sim Lambda function code is given.
|
|
17
|
+
*
|
|
18
|
+
* A request to a hostname the simulation serves is answered by the simulation,
|
|
19
|
+
* and everything else is the host `fetch`'s, made exactly as it was asked for.
|
|
20
|
+
* The arguments are passed on untouched in that case, so a request carrying a
|
|
21
|
+
* streaming body is not read here on its way past.
|
|
22
|
+
*
|
|
23
|
+
* This is the client a Node.js handler reaches for first, and the only one an
|
|
24
|
+
* OAuth token exchange needs, so it routes the same way the transport modules
|
|
25
|
+
* do rather than being the one client that leaves the simulation.
|
|
26
|
+
*/
|
|
27
|
+
export function makeSimLambdaOutboundFetch(outbound, hostFetch = fetch) {
|
|
28
|
+
return async (input, init) => {
|
|
29
|
+
const hostname = fetchHostname(input);
|
|
30
|
+
if (outbound === undefined ||
|
|
31
|
+
hostname === undefined ||
|
|
32
|
+
!outbound.serves(hostname)) {
|
|
33
|
+
return await hostFetch(input, init);
|
|
34
|
+
}
|
|
35
|
+
return await outbound.fetch(new Request(input, init));
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=sim-lambda-outbound-fetch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-outbound-fetch.js","sourceRoot":"","sources":["../../../../../src/service/lambda/function/outbound/sim-lambda-outbound-fetch.ts"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,SAAS,aAAa,CAAC,KAA0B;IAC/C,IAAI,KAAK,YAAY,GAAG,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,QAAQ,CAAC;IACxB,CAAC;IAED,MAAM,GAAG,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;IAE1D,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,0BAA0B,CACxC,QAA2C,EAC3C,SAAS,GAAiB,KAAK;IAE/B,OAAO,KAAK,EACV,KAA0B,EAC1B,IAAkB,EACC,EAAE;QACrB,MAAM,QAAQ,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;QAEtC,IACE,QAAQ,KAAK,SAAS;YACtB,QAAQ,KAAK,SAAS;YACtB,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,EAC1B,CAAC;YACD,OAAO,MAAM,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACtC,CAAC;QAED,OAAO,MAAM,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;IACxD,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where an HTTP request leaving sim Lambda function code is answered by the
|
|
3
|
+
* simulation instead of by the network.
|
|
4
|
+
*
|
|
5
|
+
* A simulated environment serves hostnames of two kinds. There are the AWS
|
|
6
|
+
* service API endpoints an SDK resolves, which carry a serialized Command, and
|
|
7
|
+
* there are the hostnames a simulated resource answers on: a Cognito user pool
|
|
8
|
+
* domain, an API Gateway HTTP API, a load balancer, anything simulated Route53
|
|
9
|
+
* resolves. Function code reaching either belongs in the simulation, and
|
|
10
|
+
* reaching anything else belongs on the network, which is where it goes.
|
|
11
|
+
*
|
|
12
|
+
* The two questions are separate because the client has to decide before it
|
|
13
|
+
* has a request to send: `http.request` hands back a stream that is written to
|
|
14
|
+
* long before there is a body, so whether the simulation is answering has to
|
|
15
|
+
* be settled from the hostname alone.
|
|
16
|
+
*/
|
|
17
|
+
export interface SimLambdaOutboundHttp {
|
|
18
|
+
/**
|
|
19
|
+
* Whether the simulation answers requests addressed to a hostname.
|
|
20
|
+
*/
|
|
21
|
+
serves(hostname: string): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Answer one request the simulation serves.
|
|
24
|
+
*/
|
|
25
|
+
fetch(request: Request): Promise<Response>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=sim-lambda-outbound-http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-outbound-http.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/function/outbound/sim-lambda-outbound-http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAElC;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC5C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AwsRegionName } from "../../../aws/sim-aws-region.js";
|
|
2
|
+
import type { SimAws } from "../../../aws/sim-aws.js";
|
|
3
|
+
import type { SimLambdaOutboundHttp } from "./sim-lambda-outbound-http.js";
|
|
4
|
+
interface SimLambdaOutboundHttpProperties {
|
|
5
|
+
readonly simAws: SimAws;
|
|
6
|
+
readonly regionName?: AwsRegionName | undefined;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Build the outbound HTTP a simulated environment answers its functions with.
|
|
10
|
+
*/
|
|
11
|
+
export declare function makeSimLambdaOutboundHttp(properties: SimLambdaOutboundHttpProperties): SimLambdaOutboundHttp;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=sim-lambda-outbound-http.factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-outbound-http.factory.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/function/outbound/sim-lambda-outbound-http.factory.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAKtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAsB3E,UAAU,+BAA+B;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;CACjD;AA8FD;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,+BAA+B,GAC1C,qBAAqB,CAEvB"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { SimAwsHttp } from "../../../../serve/http/sim-aws-http.js";
|
|
2
|
+
import { SimAwsLocalUrl } from "../../../../serve/http/url/sim-aws-local-url.js";
|
|
3
|
+
import { isSimAwsApiRequest, SimLambdaAwsApiOutbound, } from "./sim-lambda-aws-api-outbound.js";
|
|
4
|
+
/**
|
|
5
|
+
* Ask for a request at a URL, which is the request itself where that is where
|
|
6
|
+
* it was already addressed.
|
|
7
|
+
*
|
|
8
|
+
* The body is read here because a request being asked for somewhere else has
|
|
9
|
+
* to be built again, and there is nothing streaming through this: what arrives
|
|
10
|
+
* is a request a client has finished writing.
|
|
11
|
+
*/
|
|
12
|
+
async function requestAt(url, request) {
|
|
13
|
+
if (url.href === request.url) {
|
|
14
|
+
return request;
|
|
15
|
+
}
|
|
16
|
+
return new Request(url, {
|
|
17
|
+
method: request.method,
|
|
18
|
+
headers: request.headers,
|
|
19
|
+
body: request.body === null ? null : await request.arrayBuffer(),
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Answers everything sim Lambda function code addresses to a hostname its
|
|
24
|
+
* simulated environment serves.
|
|
25
|
+
*
|
|
26
|
+
* A hostname simulated Route53 resolves goes through the same in-process HTTP
|
|
27
|
+
* entry point a request arriving on localhost does. The simulation then
|
|
28
|
+
* answers a function's request to a Cognito user pool domain, an HTTP API or a
|
|
29
|
+
* load balancer without knowing which of them it is, exactly as it answers a
|
|
30
|
+
* browser.
|
|
31
|
+
*
|
|
32
|
+
* An AWS service API endpoint is answered as a Command when it carries one,
|
|
33
|
+
* and over HTTP when it does not. A user pool's JWKS is published at the
|
|
34
|
+
* regional Cognito endpoint and fetched by a verifier holding no credentials,
|
|
35
|
+
* so a hostname alone does not say which of the two a request is.
|
|
36
|
+
*
|
|
37
|
+
* A resolved hostname is answered before either, because it is the more
|
|
38
|
+
* specific answer. A load balancer's own `.elb.amazonaws.com` name and a
|
|
39
|
+
* custom domain below an AWS one both end in a service API suffix, and both
|
|
40
|
+
* name something the simulation is serving over HTTP.
|
|
41
|
+
*/
|
|
42
|
+
class SimAwsLambdaOutboundHttp {
|
|
43
|
+
simAws;
|
|
44
|
+
awsApi;
|
|
45
|
+
http;
|
|
46
|
+
constructor(properties) {
|
|
47
|
+
this.simAws = properties.simAws;
|
|
48
|
+
this.awsApi = new SimLambdaAwsApiOutbound(properties);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Whether this simulation serves a hostname, as a hostname simulated Route53
|
|
52
|
+
* resolves or as an AWS service API endpoint.
|
|
53
|
+
*/
|
|
54
|
+
serves(hostname) {
|
|
55
|
+
return this.resolves(hostname) || this.awsApi.serves(hostname);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Answer a request from the simulation.
|
|
59
|
+
*/
|
|
60
|
+
async fetch(request) {
|
|
61
|
+
const served = this.servedUrl(request);
|
|
62
|
+
if (served === undefined) {
|
|
63
|
+
return await this.awsApi.fetch(request);
|
|
64
|
+
}
|
|
65
|
+
this.http ??= new SimAwsHttp({ simAws: this.simAws });
|
|
66
|
+
return await this.http.handleRequest(await requestAt(served, request));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Where the simulation serves a request over HTTP, or nothing for one it
|
|
70
|
+
* answers as a Command.
|
|
71
|
+
*
|
|
72
|
+
* A hostname simulated Route53 resolves is served as it was asked for. An
|
|
73
|
+
* AWS service API endpoint is served at the local hostname it rewrites to,
|
|
74
|
+
* since that is the name simulated Route53 knows the endpoint by, and only
|
|
75
|
+
* for a request that is not an API call.
|
|
76
|
+
*
|
|
77
|
+
* Everything else is the wire dispatcher's, including an endpoint the
|
|
78
|
+
* simulation serves nothing at, so that a request it cannot route is refused
|
|
79
|
+
* with the explanation that dispatcher gives rather than with a 501 naming a
|
|
80
|
+
* hostname nobody asked for.
|
|
81
|
+
*/
|
|
82
|
+
servedUrl(request) {
|
|
83
|
+
const url = new URL(request.url);
|
|
84
|
+
if (this.resolves(url.hostname)) {
|
|
85
|
+
return url;
|
|
86
|
+
}
|
|
87
|
+
if (isSimAwsApiRequest(request)) {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
const localUrl = new SimAwsLocalUrl({ input: url }).toURL();
|
|
91
|
+
return this.resolves(localUrl.hostname) ? localUrl : undefined;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Whether simulated Route53 resolves a hostname to a service of this
|
|
95
|
+
* simulation.
|
|
96
|
+
*/
|
|
97
|
+
resolves(hostname) {
|
|
98
|
+
return this.simAws.route53().resolveHttpHost(hostname) !== undefined;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Build the outbound HTTP a simulated environment answers its functions with.
|
|
103
|
+
*/
|
|
104
|
+
export function makeSimLambdaOutboundHttp(properties) {
|
|
105
|
+
return new SimAwsLambdaOutboundHttp(properties);
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=sim-lambda-outbound-http.factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-outbound-http.factory.js","sourceRoot":"","sources":["../../../../../src/service/lambda/function/outbound/sim-lambda-outbound-http.factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAGjF,OAAO,EACL,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,kCAAkC,CAAC;AAG1C;;;;;;;GAOG;AACH,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C,MAAM,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;;;;;;;OAaG;IACK,SAAS,CAAC,OAAgB;QAChC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAEjC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChC,OAAO,GAAG,CAAC;QACb,CAAC;QAED,IAAI,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC;YAChC,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;QAE5D,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;IACjE,CAAC;IAED;;;OAGG;IACK,QAAQ,CAAC,QAAgB;QAC/B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,SAAS,CAAC;IACvE,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB,CACvC,UAA2C;IAE3C,OAAO,IAAI,wBAAwB,CAAC,UAAU,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-outbound-http.js","sourceRoot":"","sources":["../../../../../src/service/lambda/function/outbound/sim-lambda-outbound-http.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SimSdkWireRequest, SimSdkWireResponse } from "../../../../sdk/wire/sim-sdk-wire.types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Read an outbound request as the AWS API request it is on the wire.
|
|
4
|
+
*
|
|
5
|
+
* Header names come back lower-cased because that is how `Headers` iterates
|
|
6
|
+
* them, which is also what the wire dispatcher looks them up by.
|
|
7
|
+
*/
|
|
8
|
+
export declare function simLambdaOutboundWireRequest(request: Request): Promise<SimSdkWireRequest>;
|
|
9
|
+
/**
|
|
10
|
+
* Present an AWS API response from the wire as the response a client reads.
|
|
11
|
+
*
|
|
12
|
+
* An empty body is passed as no body at all, because the statuses that carry
|
|
13
|
+
* none refuse to be built with one.
|
|
14
|
+
*/
|
|
15
|
+
export declare function simLambdaOutboundWireResponse(response: SimSdkWireResponse): Response;
|
|
16
|
+
//# sourceMappingURL=sim-lambda-outbound-wire.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-outbound-wire.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/function/outbound/sim-lambda-outbound-wire.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,4CAA4C,CAAC;AAEpD;;;;;GAKG;AACH,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,iBAAiB,CAAC,CAU5B;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,kBAAkB,GAC3B,QAAQ,CAKV"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read an outbound request as the AWS API request it is on the wire.
|
|
3
|
+
*
|
|
4
|
+
* Header names come back lower-cased because that is how `Headers` iterates
|
|
5
|
+
* them, which is also what the wire dispatcher looks them up by.
|
|
6
|
+
*/
|
|
7
|
+
export async function simLambdaOutboundWireRequest(request) {
|
|
8
|
+
const url = new URL(request.url);
|
|
9
|
+
return {
|
|
10
|
+
method: request.method,
|
|
11
|
+
hostname: url.hostname,
|
|
12
|
+
path: `${url.pathname}${url.search}`,
|
|
13
|
+
headers: Object.fromEntries(request.headers),
|
|
14
|
+
body: new Uint8Array(await request.arrayBuffer()),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Present an AWS API response from the wire as the response a client reads.
|
|
19
|
+
*
|
|
20
|
+
* An empty body is passed as no body at all, because the statuses that carry
|
|
21
|
+
* none refuse to be built with one.
|
|
22
|
+
*/
|
|
23
|
+
export function simLambdaOutboundWireResponse(response) {
|
|
24
|
+
return new Response(response.body.length === 0 ? null : response.body, {
|
|
25
|
+
status: response.statusCode,
|
|
26
|
+
headers: { ...response.headers },
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=sim-lambda-outbound-wire.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-outbound-wire.js","sourceRoot":"","sources":["../../../../../src/service/lambda/function/outbound/sim-lambda-outbound-wire.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,OAAgB;IAEhB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAEjC,OAAO;QACL,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,IAAI,EAAE,GAAG,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,MAAM,EAAE;QACpC,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC;QAC5C,IAAI,EAAE,IAAI,UAAU,CAAC,MAAM,OAAO,CAAC,WAAW,EAAE,CAAC;KAClD,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B,CAC3C,QAA4B;IAE5B,OAAO,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE;QACrE,MAAM,EAAE,QAAQ,CAAC,UAAU;QAC3B,OAAO,EAAE,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE;KACjC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { type SimLambdaExecutableCode } from "./code/sim-lambda-executable-code.
|
|
|
5
5
|
import { SimLambdaEnvironment } from "./environment/sim-lambda-environment.js";
|
|
6
6
|
import type { SimLogsServiceWriter } from "../../logs/write/sim-logs-service-writer.js";
|
|
7
7
|
import { SimLambdaFunctionPolicy } from "./policy/sim-lambda-function-policy.js";
|
|
8
|
+
import type { SimLambdaOutboundHttp } from "./outbound/sim-lambda-outbound-http.js";
|
|
8
9
|
import { type SimClock } from "../../../util/clock/sim-clock.js";
|
|
9
10
|
import { type SimLambdaHandler } from "./sim-lambda-handler.type.js";
|
|
10
11
|
export type SimLambdaFunctionName = Brand<string, "SimLambdaFunctionName">;
|
|
@@ -65,6 +66,13 @@ interface SimLambdaFunctionProperties {
|
|
|
65
66
|
* only to the host streams.
|
|
66
67
|
*/
|
|
67
68
|
logs?: SimLogsServiceWriter | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Where the HTTP requests this function's code makes to hostnames the
|
|
71
|
+
* simulation serves are answered. A function built standalone, outside a
|
|
72
|
+
* SimAws instance, has no simulation to answer them and reaches the network
|
|
73
|
+
* as any other code would.
|
|
74
|
+
*/
|
|
75
|
+
outboundHttp?: SimLambdaOutboundHttp | undefined;
|
|
68
76
|
}
|
|
69
77
|
/**
|
|
70
78
|
* Simulated Lambda function resource.
|
|
@@ -99,6 +107,7 @@ export declare class SimLambdaFunction {
|
|
|
99
107
|
private readonly runner;
|
|
100
108
|
private readonly clock;
|
|
101
109
|
private readonly logging;
|
|
110
|
+
private readonly outboundHttp;
|
|
102
111
|
constructor(properties: SimLambdaFunctionProperties);
|
|
103
112
|
/**
|
|
104
113
|
* The log group this function's output is recorded to.
|
|
@@ -134,13 +143,10 @@ export declare class SimLambdaFunction {
|
|
|
134
143
|
*/
|
|
135
144
|
invoke(event: unknown): Promise<unknown>;
|
|
136
145
|
/**
|
|
137
|
-
* Run an invocation with
|
|
138
|
-
*
|
|
139
|
-
* Only code running in the host scope needs this. Zip code reads the Date
|
|
140
|
-
* its own vm sandbox was given, so a function backed by one leaves the
|
|
141
|
-
* global Date alone entirely.
|
|
146
|
+
* Run an invocation with the process globals host-scope code reads bridged
|
|
147
|
+
* to this simulation: the current time, and the HTTP clients it reaches for.
|
|
142
148
|
*/
|
|
143
|
-
private
|
|
149
|
+
private runInHostScope;
|
|
144
150
|
}
|
|
145
151
|
export {};
|
|
146
152
|
//# sourceMappingURL=sim-lambda-function.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-lambda-function.d.ts","sourceRoot":"","sources":["../../../../src/service/lambda/function/sim-lambda-function.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAGnF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAC1F,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAE/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAIjF,OAAO,EAAE,KAAK,QAAQ,EAAgB,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;AAE3E,eAAO,MAAM,kCAAkC,IAAI,CAAC;AACpD,eAAO,MAAM,iCAAiC,MAAM,CAAC;AAErD,MAAM,MAAM,oBAAoB,GAAG,GAAG,CACpC,qBAAqB,EACrB,iBAAiB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EG;IACH,IAAI,KAAK,IAAI,sBAAsB,CAElC;IAED;;OAEG;IACH,IAAI,GAAG,IAAI,oBAAoB,CAE9B;IAED;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAGxB;IAED;;OAEG;IACH,aAAa,IAAI,8BAA8B,CAc9C;IAED;;;;;;;;;;;OAWG;IACG,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAgC7C;IAED;;;OAGG;YACW,cAAc;CAU7B"}
|
|
@@ -6,7 +6,7 @@ import { SimLambdaFunctionLogging } from "./logging/sim-lambda-function-logging.
|
|
|
6
6
|
import { SimLambdaFunctionPolicy } from "./policy/sim-lambda-function-policy.js";
|
|
7
7
|
import { SimLambdaHandlerRunner } from "./invoke/sim-lambda-handler-runner.js";
|
|
8
8
|
import { SimLambdaInvokeContextBuilder } from "./invoke/sim-lambda-invoke-context-builder.js";
|
|
9
|
-
import {
|
|
9
|
+
import { runSimLambdaInHostScope } from "./invoke/sim-lambda-host-scope.js";
|
|
10
10
|
import { SimRealClock } from "../../../util/clock/sim-clock.js";
|
|
11
11
|
import { defaultLambdaHandler, } from "./sim-lambda-handler.type.js";
|
|
12
12
|
export const DEFAULT_SIM_LAMBDA_TIMEOUT_SECONDS = 3;
|
|
@@ -50,8 +50,9 @@ export class SimLambdaFunction {
|
|
|
50
50
|
runner = new SimLambdaHandlerRunner();
|
|
51
51
|
clock;
|
|
52
52
|
logging;
|
|
53
|
+
outboundHttp;
|
|
53
54
|
constructor(properties) {
|
|
54
|
-
const { name, roleArn, accountRegionScope = simAwsAccountRegionScopeFactory.make(), handlerFunction = defaultLambdaHandler, code, state = "Pending", handlerName, runtimeName, description, timeoutSeconds = DEFAULT_SIM_LAMBDA_TIMEOUT_SECONDS, memorySizeMb = DEFAULT_SIM_LAMBDA_MEMORY_SIZE_MB, environment, runAsOwner = this, clock = new SimRealClock(), logs, } = properties;
|
|
55
|
+
const { name, roleArn, accountRegionScope = simAwsAccountRegionScopeFactory.make(), handlerFunction = defaultLambdaHandler, code, state = "Pending", handlerName, runtimeName, description, timeoutSeconds = DEFAULT_SIM_LAMBDA_TIMEOUT_SECONDS, memorySizeMb = DEFAULT_SIM_LAMBDA_MEMORY_SIZE_MB, environment, runAsOwner = this, clock = new SimRealClock(), logs, outboundHttp, } = properties;
|
|
55
56
|
this.clock = clock;
|
|
56
57
|
this.name = name;
|
|
57
58
|
this.roleArn = roleArn;
|
|
@@ -71,6 +72,7 @@ export class SimLambdaFunction {
|
|
|
71
72
|
memorySizeMb,
|
|
72
73
|
});
|
|
73
74
|
this.runAsOwner = runAsOwner;
|
|
75
|
+
this.outboundHttp = outboundHttp;
|
|
74
76
|
this.logging = new SimLambdaFunctionLogging({
|
|
75
77
|
functionName: name,
|
|
76
78
|
logs,
|
|
@@ -143,20 +145,17 @@ export class SimLambdaFunction {
|
|
|
143
145
|
logStreamName: this.logging.logStreamName(),
|
|
144
146
|
});
|
|
145
147
|
this.logging.recordFrom(this.code);
|
|
146
|
-
return await simAwsRunAsContext.run(this.runAsOwner, { kind: "arn", arn: this.roleArn }, async () => await this.environment.runWith(async () => await this.
|
|
148
|
+
return await simAwsRunAsContext.run(this.runAsOwner, { kind: "arn", arn: this.roleArn }, async () => await this.environment.runWith(async () => await this.runInHostScope(async () => await this.logging.around(async () => await this.runner.run(this.code.handlerFunction(), event, contextBuilder)))));
|
|
147
149
|
}
|
|
148
150
|
/**
|
|
149
|
-
* Run an invocation with
|
|
150
|
-
*
|
|
151
|
-
* Only code running in the host scope needs this. Zip code reads the Date
|
|
152
|
-
* its own vm sandbox was given, so a function backed by one leaves the
|
|
153
|
-
* global Date alone entirely.
|
|
151
|
+
* Run an invocation with the process globals host-scope code reads bridged
|
|
152
|
+
* to this simulation: the current time, and the HTTP clients it reaches for.
|
|
154
153
|
*/
|
|
155
|
-
async
|
|
154
|
+
async runInHostScope(run) {
|
|
156
155
|
if (!this.code.runsInHostScope) {
|
|
157
156
|
return await run();
|
|
158
157
|
}
|
|
159
|
-
return await
|
|
158
|
+
return await runSimLambdaInHostScope({ clock: this.clock, outboundHttp: this.outboundHttp }, run);
|
|
160
159
|
}
|
|
161
160
|
}
|
|
162
161
|
//# sourceMappingURL=sim-lambda-function.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-lambda-function.js","sourceRoot":"","sources":["../../../../src/service/lambda/function/sim-lambda-function.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,+BAA+B,EAAE,MAAM,mDAAmD,CAAC;AAEpG,OAAO,EAEL,6BAA6B,GAC9B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAC;AAC9F,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sim-lambda-function.js","sourceRoot":"","sources":["../../../../src/service/lambda/function/sim-lambda-function.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,+BAA+B,EAAE,MAAM,mDAAmD,CAAC;AAEpG,OAAO,EAEL,6BAA6B,GAC9B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAA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,WAAW,CAAC,OAAO,CAC5B,KAAK,IAAI,EAAE,CACT,MAAM,IAAI,CAAC,cAAc,CACvB,KAAK,IAAI,EAAE,CACT,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CACvB,KAAK,IAAI,EAAE,CACT,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CACnB,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,EAC3B,KAAK,EACL,cAAc,CACf,CACJ,CACJ,CACJ,CACJ,CAAC;IACJ,CAAC;IAED;;;OAGG;IACK,KAAK,CAAC,cAAc,CAAI,GAAqB;QACnD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YAC/B,OAAO,MAAM,GAAG,EAAE,CAAC;QACrB,CAAC;QAED,OAAO,MAAM,uBAAuB,CAClC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,EACtD,GAAG,CACJ,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -12,6 +12,7 @@ import { type SimLambdaContainerImages } from "./function/code/image/sim-lambda-
|
|
|
12
12
|
import type { SimLambdaCodeStore } from "./function/code/store/sim-lambda-code-store.js";
|
|
13
13
|
import type { SimLambdaVmSdkModuleProvider } from "./function/code/vm/sdk/sim-lambda-vm-sdk-module-provider.js";
|
|
14
14
|
import type { SimLogsServiceWriter } from "../logs/write/sim-logs-service-writer.js";
|
|
15
|
+
import type { SimLambdaOutboundHttp } from "./function/outbound/sim-lambda-outbound-http.js";
|
|
15
16
|
import type { SimLambdaFunctionMap } from "./function/sim-lambda-function.js";
|
|
16
17
|
import { SimLambdaFunctionLookup } from "./function/url/sim-lambda-function-lookup.js";
|
|
17
18
|
import { SimLambdaFunctionUrlStore } from "./function/url/sim-lambda-function-url-store.js";
|
|
@@ -28,6 +29,13 @@ export interface SimLambdaProperties {
|
|
|
28
29
|
readonly containerImages?: SimLambdaContainerImages;
|
|
29
30
|
readonly vmSdkModuleProvider?: SimLambdaVmSdkModuleProvider;
|
|
30
31
|
readonly logs?: SimLogsServiceWriter | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Where the HTTP requests this simulated Lambda's function code makes to
|
|
34
|
+
* hostnames the simulation serves are answered. A standalone SimLambda has
|
|
35
|
+
* no simulated environment to answer them, so its functions reach the
|
|
36
|
+
* network as any other code would.
|
|
37
|
+
*/
|
|
38
|
+
readonly outboundHttp?: SimLambdaOutboundHttp;
|
|
31
39
|
readonly urlRegistry?: SimLambdaUrlRegistry;
|
|
32
40
|
readonly eventSourceQueues?: SimSqsPollQueues;
|
|
33
41
|
readonly eventSourceStreams?: SimLambdaEventSourceStreams;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-lambda-commands.d.ts","sourceRoot":"","sources":["../../../src/service/lambda/sim-lambda-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,mCAAmC,EAAE,MAAM,4EAA4E,CAAC;AACjI,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAC/F,OAAO,EAAE,4BAA4B,EAAE,MAAM,4DAA4D,CAAC;AAC1G,OAAO,EAAE,2BAA2B,EAAE,MAAM,wDAAwD,CAAC;AAGrG,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,0DAA0D,CAAC;AAClE,OAAO,EACL,KAAK,wBAAwB,EAE9B,MAAM,sDAAsD,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAA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AAgB,mBAAmB,EAAE,mCAAmC,CAAC;IAEzE,YAAY,UAAU,EAAE,2BAA2B,EA2ElD;CACF"}
|
|
@@ -35,7 +35,7 @@ export class SimLambdaCommands {
|
|
|
35
35
|
permissions;
|
|
36
36
|
eventSourceMappings;
|
|
37
37
|
constructor(properties) {
|
|
38
|
-
const { accountRegionScope = simAwsAccountRegionScopeFactory.make(), iam = new SimIamAllowAllAuth(), background = new BackgroundTasks(), codeStore, vmSdkModuleProvider, logs,
|
|
38
|
+
const { accountRegionScope = simAwsAccountRegionScopeFactory.make(), iam = new SimIamAllowAllAuth(), background = new BackgroundTasks(), codeStore, vmSdkModuleProvider, logs, outboundHttp,
|
|
39
39
|
// A standalone SimLambda is not reachable over HTTP, so its own registry
|
|
40
40
|
// is enough; a SimAws-created one shares the environment-wide registry
|
|
41
41
|
// the serving layer routes with.
|
|
@@ -96,6 +96,7 @@ export class SimLambdaCommands {
|
|
|
96
96
|
containerImages,
|
|
97
97
|
vmSdkModuleProvider,
|
|
98
98
|
logs,
|
|
99
|
+
outboundHttp,
|
|
99
100
|
});
|
|
100
101
|
}
|
|
101
102
|
}
|