@kensio/yulin 1.16.0 → 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/README.md +44 -46
- 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-account-region-service-builder.js +2 -2
- package/dist/service/aws/factory/sim-aws-account-region-service-builder.js.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/cloudfront/origin/custom/sim-cf-custom-origin-request.d.ts +3 -2
- package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-request.d.ts.map +1 -1
- package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-request.js.map +1 -1
- package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-signer.d.ts +5 -2
- package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-signer.d.ts.map +1 -1
- package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-signer.js +38 -2
- package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-signer.js.map +1 -1
- package/dist/service/cloudfront/origin/custom/sim-cf-function-url-origin-template.factory.d.ts.map +1 -1
- package/dist/service/cloudfront/origin/custom/sim-cf-function-url-origin-template.factory.js +5 -2
- package/dist/service/cloudfront/origin/custom/sim-cf-function-url-origin-template.factory.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/hosted-auth.command.d.ts +10 -0
- package/dist/service/cognito/command/hosted/hosted-auth.command.d.ts.map +1 -1
- package/dist/service/cognito/command/hosted/sim-cognito-authorize-endpoint.d.ts +14 -13
- package/dist/service/cognito/command/hosted/sim-cognito-authorize-endpoint.d.ts.map +1 -1
- package/dist/service/cognito/command/hosted/sim-cognito-authorize-endpoint.js +14 -18
- package/dist/service/cognito/command/hosted/sim-cognito-authorize-endpoint.js.map +1 -1
- package/dist/service/cognito/command/hosted/sim-cognito-authorize-request.d.ts +15 -6
- package/dist/service/cognito/command/hosted/sim-cognito-authorize-request.d.ts.map +1 -1
- package/dist/service/cognito/command/hosted/sim-cognito-authorize-request.js +26 -19
- package/dist/service/cognito/command/hosted/sim-cognito-authorize-request.js.map +1 -1
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-commands.d.ts.map +1 -1
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-commands.js +5 -1
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-commands.js.map +1 -1
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-password-sign-in.d.ts +41 -0
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-password-sign-in.d.ts.map +1 -0
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-password-sign-in.js +72 -0
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-password-sign-in.js.map +1 -0
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-sign-in.d.ts +32 -0
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-sign-in.d.ts.map +1 -0
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-sign-in.js +36 -0
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-sign-in.js.map +1 -0
- 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-managed-login.error.d.ts +22 -0
- package/dist/service/cognito/error/sim-cognito-managed-login.error.d.ts.map +1 -0
- package/dist/service/cognito/error/sim-cognito-managed-login.error.js +32 -0
- package/dist/service/cognito/error/sim-cognito-managed-login.error.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-confirm-page.d.ts +29 -0
- package/dist/service/cognito/serve/page/sim-cognito-confirm-page.d.ts.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-confirm-page.js +90 -0
- package/dist/service/cognito/serve/page/sim-cognito-confirm-page.js.map +1 -0
- 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 +41 -0
- package/dist/service/cognito/serve/page/sim-cognito-managed-login.d.ts.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-managed-login.js +77 -0
- package/dist/service/cognito/serve/page/sim-cognito-managed-login.js.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-form.d.ts +47 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-form.d.ts.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-form.js +76 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-form.js.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-markup.d.ts +69 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-markup.d.ts.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-markup.js +111 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-markup.js.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-paths.d.ts +57 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-paths.d.ts.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-paths.js +82 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-paths.js.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-request.d.ts +22 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-request.d.ts.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-request.js +30 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-request.js.map +1 -0
- 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 +20 -0
- package/dist/service/cognito/serve/page/sim-cognito-sign-in-page.d.ts.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-sign-in-page.js +40 -0
- package/dist/service/cognito/serve/page/sim-cognito-sign-in-page.js.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-sign-up-page.d.ts +35 -0
- package/dist/service/cognito/serve/page/sim-cognito-sign-up-page.d.ts.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-sign-up-page.js +85 -0
- package/dist/service/cognito/serve/page/sim-cognito-sign-up-page.js.map +1 -0
- package/dist/service/cognito/serve/sim-cognito-domain-endpoints.d.ts +20 -23
- package/dist/service/cognito/serve/sim-cognito-domain-endpoints.d.ts.map +1 -1
- package/dist/service/cognito/serve/sim-cognito-domain-endpoints.js +40 -19
- package/dist/service/cognito/serve/sim-cognito-domain-endpoints.js.map +1 -1
- package/dist/service/cognito/serve/sim-cognito-domain-request.d.ts +14 -0
- package/dist/service/cognito/serve/sim-cognito-domain-request.d.ts.map +1 -0
- package/dist/service/cognito/serve/sim-cognito-domain-request.js +2 -0
- package/dist/service/cognito/serve/sim-cognito-domain-request.js.map +1 -0
- 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/iam/sigv4/canonical/sim-iam-sigv4-payload-hash.d.ts +8 -0
- package/dist/service/iam/sigv4/canonical/sim-iam-sigv4-payload-hash.d.ts.map +1 -1
- package/dist/service/iam/sigv4/canonical/sim-iam-sigv4-payload-hash.js +14 -6
- package/dist/service/iam/sigv4/canonical/sim-iam-sigv4-payload-hash.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/serve/auth/sim-lambda-url-payload-hash.d.ts +28 -0
- package/dist/service/lambda/serve/auth/sim-lambda-url-payload-hash.d.ts.map +1 -0
- package/dist/service/lambda/serve/auth/sim-lambda-url-payload-hash.js +56 -0
- package/dist/service/lambda/serve/auth/sim-lambda-url-payload-hash.js.map +1 -0
- package/dist/service/lambda/serve/response/sim-lambda-url-error-response.d.ts +16 -0
- package/dist/service/lambda/serve/response/sim-lambda-url-error-response.d.ts.map +1 -1
- package/dist/service/lambda/serve/response/sim-lambda-url-error-response.js +24 -0
- package/dist/service/lambda/serve/response/sim-lambda-url-error-response.js.map +1 -1
- package/dist/service/lambda/serve/sim-lambda-controller.d.ts +6 -0
- package/dist/service/lambda/serve/sim-lambda-controller.d.ts.map +1 -1
- package/dist/service/lambda/serve/sim-lambda-controller.js +11 -0
- package/dist/service/lambda/serve/sim-lambda-controller.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/dist/service/sns/cfn/subscription/sim-cfn-sns-subscription-properties.d.ts +4 -3
- package/dist/service/sns/cfn/subscription/sim-cfn-sns-subscription-properties.d.ts.map +1 -1
- package/dist/service/sns/cfn/subscription/sim-cfn-sns-subscription-properties.js +4 -3
- package/dist/service/sns/cfn/subscription/sim-cfn-sns-subscription-properties.js.map +1 -1
- package/dist/service/sns/cfn/subscription/sim-cfn-sns-subscription-property-names.d.ts +2 -2
- package/dist/service/sns/cfn/subscription/sim-cfn-sns-subscription-property-names.js +2 -2
- package/dist/service/sns/command/publish/sim-sns-publish-commands.d.ts +3 -0
- package/dist/service/sns/command/publish/sim-sns-publish-commands.d.ts.map +1 -1
- package/dist/service/sns/command/publish/sim-sns-publish-commands.js +4 -2
- package/dist/service/sns/command/publish/sim-sns-publish-commands.js.map +1 -1
- package/dist/service/sns/command/publish/sim-sns-publish-dispatch.d.ts +39 -0
- package/dist/service/sns/command/publish/sim-sns-publish-dispatch.d.ts.map +1 -0
- package/dist/service/sns/command/publish/sim-sns-publish-dispatch.js +42 -0
- package/dist/service/sns/command/publish/sim-sns-publish-dispatch.js.map +1 -0
- package/dist/service/sns/command/publish/sim-sns-publish-input.d.ts +3 -3
- package/dist/service/sns/command/publish/sim-sns-publish-input.d.ts.map +1 -1
- package/dist/service/sns/command/publish/sim-sns-publish-input.js +8 -8
- package/dist/service/sns/command/publish/sim-sns-publish-input.js.map +1 -1
- package/dist/service/sns/command/publish/sim-sns-publish-sms.d.ts +38 -0
- package/dist/service/sns/command/publish/sim-sns-publish-sms.d.ts.map +1 -0
- package/dist/service/sns/command/publish/sim-sns-publish-sms.js +53 -0
- package/dist/service/sns/command/publish/sim-sns-publish-sms.js.map +1 -0
- package/dist/service/sns/command/sim-sns-command.types.d.ts +1 -0
- package/dist/service/sns/command/sim-sns-command.types.d.ts.map +1 -1
- package/dist/service/sns/command/sim-sns-commands.d.ts +12 -4
- package/dist/service/sns/command/sim-sns-commands.d.ts.map +1 -1
- package/dist/service/sns/command/sim-sns-commands.js +39 -4
- package/dist/service/sns/command/sim-sns-commands.js.map +1 -1
- package/dist/service/sns/command/sms/sim-sns-opt-out-commands.d.ts +41 -0
- package/dist/service/sns/command/sms/sim-sns-opt-out-commands.d.ts.map +1 -0
- package/dist/service/sns/command/sms/sim-sns-opt-out-commands.js +56 -0
- package/dist/service/sns/command/sms/sim-sns-opt-out-commands.js.map +1 -0
- package/dist/service/sns/command/sms/sms.command.d.ts +50 -0
- package/dist/service/sns/command/sms/sms.command.d.ts.map +1 -0
- package/dist/service/sns/command/sms/sms.command.js +2 -0
- package/dist/service/sns/command/sms/sms.command.js.map +1 -0
- package/dist/service/sns/delivery/sim-aws-sns-delivery-endpoints.d.ts +5 -6
- package/dist/service/sns/delivery/sim-aws-sns-delivery-endpoints.d.ts.map +1 -1
- package/dist/service/sns/delivery/sim-aws-sns-delivery-endpoints.js +8 -12
- package/dist/service/sns/delivery/sim-aws-sns-delivery-endpoints.js.map +1 -1
- package/dist/service/sns/delivery/sim-sns-no-delivery-endpoints.d.ts +6 -13
- package/dist/service/sns/delivery/sim-sns-no-delivery-endpoints.d.ts.map +1 -1
- package/dist/service/sns/delivery/sim-sns-no-delivery-endpoints.js +13 -2
- package/dist/service/sns/delivery/sim-sns-no-delivery-endpoints.js.map +1 -1
- package/dist/service/sns/delivery/sim-sns-protocol-delivery-endpoints.d.ts +10 -1
- package/dist/service/sns/delivery/sim-sns-protocol-delivery-endpoints.d.ts.map +1 -1
- package/dist/service/sns/delivery/sim-sns-protocol-delivery-endpoints.js.map +1 -1
- package/dist/service/sns/delivery/sms/sim-sns-delivery-sms.d.ts +34 -0
- package/dist/service/sns/delivery/sms/sim-sns-delivery-sms.d.ts.map +1 -0
- package/dist/service/sns/delivery/sms/sim-sns-delivery-sms.js +46 -0
- package/dist/service/sns/delivery/sms/sim-sns-delivery-sms.js.map +1 -0
- package/dist/service/sns/index.d.ts +5 -1
- package/dist/service/sns/index.d.ts.map +1 -1
- package/dist/service/sns/index.js +4 -1
- package/dist/service/sns/index.js.map +1 -1
- package/dist/service/sns/message/sim-sns-message-attribute-rules.d.ts.map +1 -1
- package/dist/service/sns/message/sim-sns-message-attribute-rules.js +9 -1
- package/dist/service/sns/message/sim-sns-message-attribute-rules.js.map +1 -1
- package/dist/service/sns/message/sim-sns-message-attributes.d.ts +8 -0
- package/dist/service/sns/message/sim-sns-message-attributes.d.ts.map +1 -1
- package/dist/service/sns/message/sim-sns-message-attributes.js +10 -0
- package/dist/service/sns/message/sim-sns-message-attributes.js.map +1 -1
- package/dist/service/sns/message/sim-sns-sms-attributes.d.ts +25 -0
- package/dist/service/sns/message/sim-sns-sms-attributes.d.ts.map +1 -0
- package/dist/service/sns/message/sim-sns-sms-attributes.js +46 -0
- package/dist/service/sns/message/sim-sns-sms-attributes.js.map +1 -0
- package/dist/service/sns/sdk/sim-sns-sdk-command-router.d.ts.map +1 -1
- package/dist/service/sns/sdk/sim-sns-sdk-command-router.js +12 -0
- package/dist/service/sns/sdk/sim-sns-sdk-command-router.js.map +1 -1
- package/dist/service/sns/sim-sns-sms.d.ts +63 -0
- package/dist/service/sns/sim-sns-sms.d.ts.map +1 -0
- package/dist/service/sns/sim-sns-sms.js +76 -0
- package/dist/service/sns/sim-sns-sms.js.map +1 -0
- package/dist/service/sns/sim-sns.d.ts +7 -15
- package/dist/service/sns/sim-sns.d.ts.map +1 -1
- package/dist/service/sns/sim-sns.js +23 -30
- package/dist/service/sns/sim-sns.js.map +1 -1
- package/dist/service/sns/sms/sim-sns-opt-out-list.d.ts +40 -0
- package/dist/service/sns/sms/sim-sns-opt-out-list.d.ts.map +1 -0
- package/dist/service/sns/sms/sim-sns-opt-out-list.js +47 -0
- package/dist/service/sns/sms/sim-sns-opt-out-list.js.map +1 -0
- package/dist/service/sns/sms/sim-sns-phone-number.d.ts +21 -0
- package/dist/service/sns/sms/sim-sns-phone-number.d.ts.map +1 -0
- package/dist/service/sns/sms/sim-sns-phone-number.js +41 -0
- package/dist/service/sns/sms/sim-sns-phone-number.js.map +1 -0
- package/dist/service/sns/sms/sim-sns-sent-sms-message.d.ts +69 -0
- package/dist/service/sns/sms/sim-sns-sent-sms-message.d.ts.map +1 -0
- package/dist/service/sns/sms/sim-sns-sent-sms-message.js +71 -0
- package/dist/service/sns/sms/sim-sns-sent-sms-message.js.map +1 -0
- package/dist/service/sns/sms/sim-sns-sent-sms-store.d.ts +25 -0
- package/dist/service/sns/sms/sim-sns-sent-sms-store.d.ts.map +1 -0
- package/dist/service/sns/sms/sim-sns-sent-sms-store.js +28 -0
- package/dist/service/sns/sms/sim-sns-sent-sms-store.js.map +1 -0
- package/dist/service/sns/subscription/sim-sns-subscription-endpoint.d.ts +9 -7
- package/dist/service/sns/subscription/sim-sns-subscription-endpoint.d.ts.map +1 -1
- package/dist/service/sns/subscription/sim-sns-subscription-endpoint.js +7 -2
- package/dist/service/sns/subscription/sim-sns-subscription-endpoint.js.map +1 -1
- package/dist/service/sns/subscription/sim-sns-subscription-protocol.d.ts +19 -1
- package/dist/service/sns/subscription/sim-sns-subscription-protocol.d.ts.map +1 -1
- package/dist/service/sns/subscription/sim-sns-subscription-protocol.js +26 -5
- package/dist/service/sns/subscription/sim-sns-subscription-protocol.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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-lambda-vm-context.js","sourceRoot":"","sources":["../../../../../../src/service/lambda/function/code/vm/sim-lambda-vm-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAEL,YAAY,GACb,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EACL,qBAAqB,GAEtB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-lambda-vm-context.js","sourceRoot":"","sources":["../../../../../../src/service/lambda/function/code/vm/sim-lambda-vm-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAEL,YAAY,GACb,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EACL,qBAAqB,GAEtB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAEzF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAsB3E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,sBAAsB,CACpC,UAAwC;IAExC,MAAM,EACJ,WAAW,EACX,KAAK,GAAG,IAAI,YAAY,EAAE,EAC1B,IAAI,GAAG,qBAAqB,EAC5B,YAAY,GACb,GAAG,UAAU,CAAC;IAEf,4EAA4E;IAC5E,2EAA2E;IAC3E,+BAA+B;IAC/B,MAAM,MAAM,GAAG,IAAI,uBAAuB,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACjE,MAAM,MAAM,GAAG,IAAI,uBAAuB,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAEjE,2EAA2E;IAC3E,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACtB,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEtB,OAAO,EAAE,CAAC,aAAa,CAAC;QACtB,iEAAiE;QACjE,qEAAqE;QACrE,wEAAwE;QACxE,OAAO,EAAE,IAAI,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QACxC,MAAM;QACN,OAAO,EAAE;YACP,GAAG,EAAE,WAAW,CAAC,SAAS,EAAE;YAC5B,MAAM;YACN,MAAM;SACP;QACD,qEAAqE;QACrE,mEAAmE;QACnE,IAAI,EAAE,gBAAgB,CAAC,KAAK,CAAC;QAC7B,UAAU;QACV,YAAY;QACZ,WAAW;QACX,aAAa;QACb,YAAY;QACZ,cAAc;QACd,WAAW;QACX,WAAW;QACX,GAAG;QACH,eAAe;QACf,eAAe;QACf,MAAM;QACN,qEAAqE;QACrE,0EAA0E;QAC1E,yEAAyE;QACzE,iBAAiB;QACjB,KAAK,EAAE,0BAA0B,CAAC,YAAY,CAAC;QAC/C,OAAO;QACP,OAAO;QACP,QAAQ;QACR,QAAQ;QACR,IAAI;QACJ,eAAe;QACf,WAAW;KACZ,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SimClock } from "../../../../util/clock/sim-clock.js";
|
|
2
|
+
import type { SimLambdaOutboundHttp } from "../outbound/sim-lambda-outbound-http.js";
|
|
3
|
+
/**
|
|
4
|
+
* What an invocation of host-scope code has bridged to it.
|
|
5
|
+
*/
|
|
6
|
+
interface SimLambdaHostScope {
|
|
7
|
+
/** The time the invocation reports as the current time. */
|
|
8
|
+
readonly clock: SimClock;
|
|
9
|
+
/**
|
|
10
|
+
* Where the requests the invocation makes to hostnames the simulation
|
|
11
|
+
* serves are answered. A function outside a simulated environment has none,
|
|
12
|
+
* and its requests go where they were addressed.
|
|
13
|
+
*/
|
|
14
|
+
readonly outboundHttp: SimLambdaOutboundHttp | undefined;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Run an invocation of code in the host scope with the process globals it
|
|
18
|
+
* reads bridged to its simulation.
|
|
19
|
+
*
|
|
20
|
+
* Only code running in the host scope needs this. Zip code reads the Date and
|
|
21
|
+
* the HTTP clients its own vm sandbox was given, so a function backed by one
|
|
22
|
+
* leaves the globals alone entirely and never comes here.
|
|
23
|
+
*/
|
|
24
|
+
export declare function runSimLambdaInHostScope<T>(scope: SimLambdaHostScope, run: () => Promise<T>): Promise<T>;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=sim-lambda-host-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-host-scope.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/function/invoke/sim-lambda-host-scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAIrF;;GAEG;AACH,UAAU,kBAAkB;IAC1B,2DAA2D;IAC3D,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IAEzB;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,qBAAqB,GAAG,SAAS,CAAC;CAC1D;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAAC,CAAC,EAC7C,KAAK,EAAE,kBAAkB,EACzB,GAAG,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACpB,OAAO,CAAC,CAAC,CAAC,CAQZ"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { simLambdaProcessClock } from "./sim-lambda-process-clock.js";
|
|
2
|
+
import { simLambdaProcessOutbound } from "./sim-lambda-process-outbound.js";
|
|
3
|
+
/**
|
|
4
|
+
* Run an invocation of code in the host scope with the process globals it
|
|
5
|
+
* reads bridged to its simulation.
|
|
6
|
+
*
|
|
7
|
+
* Only code running in the host scope needs this. Zip code reads the Date and
|
|
8
|
+
* the HTTP clients its own vm sandbox was given, so a function backed by one
|
|
9
|
+
* leaves the globals alone entirely and never comes here.
|
|
10
|
+
*/
|
|
11
|
+
export async function runSimLambdaInHostScope(scope, run) {
|
|
12
|
+
const { outboundHttp } = scope;
|
|
13
|
+
return await simLambdaProcessClock.run(scope.clock, async () => outboundHttp === undefined
|
|
14
|
+
? await run()
|
|
15
|
+
: await simLambdaProcessOutbound.run(outboundHttp, run));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=sim-lambda-host-scope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-host-scope.js","sourceRoot":"","sources":["../../../../../src/service/lambda/function/invoke/sim-lambda-host-scope.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAiB5E;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,KAAyB,EACzB,GAAqB;IAErB,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAE/B,OAAO,MAAM,qBAAqB,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,IAAI,EAAE,CAC7D,YAAY,KAAK,SAAS;QACxB,CAAC,CAAC,MAAM,GAAG,EAAE;QACb,CAAC,CAAC,MAAM,wBAAwB,CAAC,GAAG,CAAC,YAAY,EAAE,GAAG,CAAC,CAC1D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SimLambdaOutboundHttp } from "../outbound/sim-lambda-outbound-http.js";
|
|
2
|
+
/**
|
|
3
|
+
* Replace the process-wide HTTP clients with ones an outbound HTTP answers
|
|
4
|
+
* for.
|
|
5
|
+
*
|
|
6
|
+
* The global `fetch` is defined rather than assigned, to keep it the
|
|
7
|
+
* configurable, writable, non-enumerable global property it already was:
|
|
8
|
+
* anything else replacing it has to find what it expects.
|
|
9
|
+
*
|
|
10
|
+
* The transport modules are what a handler holds, so the two functions that
|
|
11
|
+
* start a request are replaced on them in place, leaving everything else the
|
|
12
|
+
* modules export as it was. The built-in modules' named ES module exports are
|
|
13
|
+
* a snapshot of those properties, so they are re-synchronised afterwards for
|
|
14
|
+
* the handler that imported `request` by name rather than the module.
|
|
15
|
+
*/
|
|
16
|
+
export declare function installSimLambdaOutboundClients(outbound: SimLambdaOutboundHttp): void;
|
|
17
|
+
//# sourceMappingURL=sim-lambda-outbound-clients.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-outbound-clients.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/function/invoke/sim-lambda-outbound-clients.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAWrF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,qBAAqB,GAC9B,IAAI,CAkBN"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import http from "node:http";
|
|
2
|
+
import https from "node:https";
|
|
3
|
+
import { syncBuiltinESMExports } from "node:module";
|
|
4
|
+
import { makeSimLambdaHttpModule } from "../outbound/sim-lambda-http-module.js";
|
|
5
|
+
import { makeSimLambdaOutboundFetch } from "../outbound/sim-lambda-outbound-fetch.js";
|
|
6
|
+
/**
|
|
7
|
+
* The transport modules an in-process handler makes requests through, with the
|
|
8
|
+
* scheme each one carries.
|
|
9
|
+
*/
|
|
10
|
+
const transportModules = [
|
|
11
|
+
[http, "http:"],
|
|
12
|
+
[https, "https:"],
|
|
13
|
+
];
|
|
14
|
+
/**
|
|
15
|
+
* Replace the process-wide HTTP clients with ones an outbound HTTP answers
|
|
16
|
+
* for.
|
|
17
|
+
*
|
|
18
|
+
* The global `fetch` is defined rather than assigned, to keep it the
|
|
19
|
+
* configurable, writable, non-enumerable global property it already was:
|
|
20
|
+
* anything else replacing it has to find what it expects.
|
|
21
|
+
*
|
|
22
|
+
* The transport modules are what a handler holds, so the two functions that
|
|
23
|
+
* start a request are replaced on them in place, leaving everything else the
|
|
24
|
+
* modules export as it was. The built-in modules' named ES module exports are
|
|
25
|
+
* a snapshot of those properties, so they are re-synchronised afterwards for
|
|
26
|
+
* the handler that imported `request` by name rather than the module.
|
|
27
|
+
*/
|
|
28
|
+
export function installSimLambdaOutboundClients(outbound) {
|
|
29
|
+
const hostFetch = globalThis.fetch;
|
|
30
|
+
Object.defineProperty(globalThis, "fetch", {
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true,
|
|
33
|
+
value: makeSimLambdaOutboundFetch(outbound, hostFetch),
|
|
34
|
+
});
|
|
35
|
+
for (const [hostModule, scheme] of transportModules) {
|
|
36
|
+
const routed = makeSimLambdaHttpModule({ hostModule, outbound, scheme });
|
|
37
|
+
const patched = hostModule;
|
|
38
|
+
patched["request"] = routed["request"];
|
|
39
|
+
patched["get"] = routed["get"];
|
|
40
|
+
}
|
|
41
|
+
syncBuiltinESMExports();
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=sim-lambda-outbound-clients.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-outbound-clients.js","sourceRoot":"","sources":["../../../../../src/service/lambda/function/invoke/sim-lambda-outbound-clients.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAGtF;;;GAGG;AACH,MAAM,gBAAgB,GAAG;IACvB,CAAC,IAAI,EAAE,OAAO,CAAC;IACf,CAAC,KAAK,EAAE,QAAQ,CAAC;CACT,CAAC;AAEX;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,+BAA+B,CAC7C,QAA+B;IAE/B,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC;IAEnC,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,OAAO,EAAE;QACzC,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,0BAA0B,CAAC,QAAQ,EAAE,SAAS,CAAC;KACvD,CAAC,CAAC;IAEH,KAAK,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,gBAAgB,EAAE,CAAC;QACpD,MAAM,MAAM,GAAG,uBAAuB,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QACzE,MAAM,OAAO,GAAG,UAAgD,CAAC;QAEjE,OAAO,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;QACvC,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,qBAAqB,EAAE,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { SimLambdaOutboundHttp } from "../outbound/sim-lambda-outbound-http.js";
|
|
2
|
+
/**
|
|
3
|
+
* Where the HTTP clients an in-process sim Lambda handler uses are routed to
|
|
4
|
+
* the simulation it belongs to.
|
|
5
|
+
*
|
|
6
|
+
* A handler backed by a real in-process function is a closure over its own
|
|
7
|
+
* module scope, so it reaches for the same `fetch`, `node:http` and
|
|
8
|
+
* `node:https` as everything else in the test run. Zip code is handed clients
|
|
9
|
+
* of its own by the sandbox and needs none of this. Node.js asynchronous
|
|
10
|
+
* context tracking bridges the gap, exactly as it does for process.env and the
|
|
11
|
+
* clock: the invocation's outbound HTTP is held in an AsyncLocalStorage store,
|
|
12
|
+
* and the patched clients resolve to it while it is set.
|
|
13
|
+
*
|
|
14
|
+
* The store follows the invocation across await points, so concurrent
|
|
15
|
+
* invocations of functions belonging to different simulations each reach their
|
|
16
|
+
* own.
|
|
17
|
+
*/
|
|
18
|
+
declare class SimLambdaProcessOutbound {
|
|
19
|
+
private readonly storage;
|
|
20
|
+
private installed;
|
|
21
|
+
/**
|
|
22
|
+
* Run an invocation with the given outbound HTTP answering the requests its
|
|
23
|
+
* code makes to hostnames the simulation serves.
|
|
24
|
+
*/
|
|
25
|
+
run<T>(outbound: SimLambdaOutboundHttp, run: () => Promise<T>): Promise<T>;
|
|
26
|
+
/**
|
|
27
|
+
* Replace the process-wide HTTP clients with ones backed by the invocation
|
|
28
|
+
* store.
|
|
29
|
+
*
|
|
30
|
+
* Installed on the first invocation of an in-process handler rather than at
|
|
31
|
+
* import, so a test run that never uses one is left completely alone. With
|
|
32
|
+
* no invocation running the patched clients hand every request to the host
|
|
33
|
+
* client, so an installed patch behaves exactly like no patch at all. They
|
|
34
|
+
* are never removed: removing them would be unsafe while another invocation
|
|
35
|
+
* is in flight, and there is nothing to gain.
|
|
36
|
+
*/
|
|
37
|
+
private install;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Shared because it patches process globals: one patch, one store.
|
|
41
|
+
*/
|
|
42
|
+
export declare const simLambdaProcessOutbound: SimLambdaProcessOutbound;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=sim-lambda-process-outbound.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-process-outbound.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/function/invoke/sim-lambda-process-outbound.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAuCrF;;;;;;;;;;;;;;;GAeG;AACH,cAAM,wBAAwB;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkD;IAC1E,OAAO,CAAC,SAAS,CAAS;IAE1B;;;OAGG;IACG,GAAG,CAAC,CAAC,EACT,QAAQ,EAAE,qBAAqB,EAC/B,GAAG,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACpB,OAAO,CAAC,CAAC,CAAC,CAGZ;IAED;;;;;;;;;;OAUG;IACH,OAAO,CAAC,OAAO;CAQhB;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,0BAAiC,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
import { assertDefined } from "../../../../util/type-guard/defined.js";
|
|
3
|
+
import { installSimLambdaOutboundClients } from "./sim-lambda-outbound-clients.js";
|
|
4
|
+
/**
|
|
5
|
+
* The outbound HTTP the patched clients route through.
|
|
6
|
+
*
|
|
7
|
+
* An invocation in progress lends its own; anything else in the process
|
|
8
|
+
* reaches the network as it always did, which is what keeps the patches inert
|
|
9
|
+
* outside a sim Lambda invocation.
|
|
10
|
+
*/
|
|
11
|
+
class SimLambdaAmbientOutbound {
|
|
12
|
+
storage;
|
|
13
|
+
constructor(storage) {
|
|
14
|
+
this.storage = storage;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Whether the invocation in progress, if there is one, serves a hostname.
|
|
18
|
+
*/
|
|
19
|
+
serves(hostname) {
|
|
20
|
+
return this.storage.getStore()?.serves(hostname) ?? false;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Answer a request from the invocation in progress.
|
|
24
|
+
*/
|
|
25
|
+
async fetch(request) {
|
|
26
|
+
const outbound = this.storage.getStore();
|
|
27
|
+
/* v8 ignore next 4 -- only reached for a request `serves` accepted, which
|
|
28
|
+
is a request made while an invocation is in progress. */
|
|
29
|
+
assertDefined(outbound, "sim Lambda invocation outbound HTTP for a request the simulation serves");
|
|
30
|
+
return await outbound.fetch(request);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Where the HTTP clients an in-process sim Lambda handler uses are routed to
|
|
35
|
+
* the simulation it belongs to.
|
|
36
|
+
*
|
|
37
|
+
* A handler backed by a real in-process function is a closure over its own
|
|
38
|
+
* module scope, so it reaches for the same `fetch`, `node:http` and
|
|
39
|
+
* `node:https` as everything else in the test run. Zip code is handed clients
|
|
40
|
+
* of its own by the sandbox and needs none of this. Node.js asynchronous
|
|
41
|
+
* context tracking bridges the gap, exactly as it does for process.env and the
|
|
42
|
+
* clock: the invocation's outbound HTTP is held in an AsyncLocalStorage store,
|
|
43
|
+
* and the patched clients resolve to it while it is set.
|
|
44
|
+
*
|
|
45
|
+
* The store follows the invocation across await points, so concurrent
|
|
46
|
+
* invocations of functions belonging to different simulations each reach their
|
|
47
|
+
* own.
|
|
48
|
+
*/
|
|
49
|
+
class SimLambdaProcessOutbound {
|
|
50
|
+
storage = new AsyncLocalStorage();
|
|
51
|
+
installed = false;
|
|
52
|
+
/**
|
|
53
|
+
* Run an invocation with the given outbound HTTP answering the requests its
|
|
54
|
+
* code makes to hostnames the simulation serves.
|
|
55
|
+
*/
|
|
56
|
+
async run(outbound, run) {
|
|
57
|
+
this.install();
|
|
58
|
+
return await this.storage.run(outbound, run);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Replace the process-wide HTTP clients with ones backed by the invocation
|
|
62
|
+
* store.
|
|
63
|
+
*
|
|
64
|
+
* Installed on the first invocation of an in-process handler rather than at
|
|
65
|
+
* import, so a test run that never uses one is left completely alone. With
|
|
66
|
+
* no invocation running the patched clients hand every request to the host
|
|
67
|
+
* client, so an installed patch behaves exactly like no patch at all. They
|
|
68
|
+
* are never removed: removing them would be unsafe while another invocation
|
|
69
|
+
* is in flight, and there is nothing to gain.
|
|
70
|
+
*/
|
|
71
|
+
install() {
|
|
72
|
+
if (this.installed) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
this.installed = true;
|
|
76
|
+
installSimLambdaOutboundClients(new SimLambdaAmbientOutbound(this.storage));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Shared because it patches process globals: one patch, one store.
|
|
81
|
+
*/
|
|
82
|
+
export const simLambdaProcessOutbound = new SimLambdaProcessOutbound();
|
|
83
|
+
//# sourceMappingURL=sim-lambda-process-outbound.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-process-outbound.js","sourceRoot":"","sources":["../../../../../src/service/lambda/function/invoke/sim-lambda-process-outbound.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAEvE,OAAO,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AAEnF;;;;;;GAMG;AACH,MAAM,wBAAwB;IAET,OAAO;IAD1B,YACmB,OAAiD;uBAAjD,OAAO;IACvB,CAAC;IAEJ;;OAEG;IACH,MAAM,CAAC,QAAgB;QACrB,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC;IAC5D,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK,CAAC,OAAgB;QAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QAEzC;mEAC2D;QAC3D,aAAa,CACX,QAAQ,EACR,yEAAyE,CAC1E,CAAC;QAEF,OAAO,MAAM,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;CACF;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,wBAAwB;IACX,OAAO,GAAG,IAAI,iBAAiB,EAAyB,CAAC;IAClE,SAAS,GAAG,KAAK,CAAC;IAE1B;;;OAGG;IACH,KAAK,CAAC,GAAG,CACP,QAA+B,EAC/B,GAAqB;QAErB,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;;;;;OAUG;IACK,OAAO;QACb,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,OAAO;QACT,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QAEtB,+BAA+B,CAAC,IAAI,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9E,CAAC;CACF;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,wBAAwB,EAAE,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
/**
|
|
5
|
+
* Whether a hostname is an AWS service API endpoint.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isSimAwsEndpointHostname(hostname: string): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Whether a request to an AWS service API endpoint is an API call, or an
|
|
10
|
+
* ordinary HTTP request to the same hostname.
|
|
11
|
+
*
|
|
12
|
+
* A service API endpoint answers both. What an SDK sends carries the operation
|
|
13
|
+
* header of the AWS JSON protocol, or the SigV4 credentials it was signed
|
|
14
|
+
* with, or both, and the wire dispatcher answers it. A token verifier fetching
|
|
15
|
+
* from the same hostname carries neither, because it holds nothing to sign
|
|
16
|
+
* with. A user pool publishes its JWKS and its OpenID configuration to whoever
|
|
17
|
+
* asks, and both are read over plain HTTP.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isSimAwsApiRequest(request: Request): boolean;
|
|
20
|
+
interface SimLambdaAwsApiOutboundProperties {
|
|
21
|
+
readonly simAws: SimAws;
|
|
22
|
+
/**
|
|
23
|
+
* The Region the function code is running in, which answers a request whose
|
|
24
|
+
* credential scope names none.
|
|
25
|
+
*/
|
|
26
|
+
readonly regionName?: AwsRegionName | undefined;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Answers the AWS service API requests sim Lambda function code sends.
|
|
30
|
+
*
|
|
31
|
+
* This is the half of a function's outbound HTTP that carries a serialized
|
|
32
|
+
* Command rather than an ordinary HTTP request: the SDK has already signed and
|
|
33
|
+
* encoded it by the time it reaches a transport, so the request itself is what
|
|
34
|
+
* there is to route, and the wire dispatcher turns it back into the simulated
|
|
35
|
+
* operation it names.
|
|
36
|
+
*/
|
|
37
|
+
export declare class SimLambdaAwsApiOutbound implements SimLambdaOutboundHttp {
|
|
38
|
+
private readonly dispatcher;
|
|
39
|
+
constructor(properties: SimLambdaAwsApiOutboundProperties);
|
|
40
|
+
/**
|
|
41
|
+
* Whether a hostname is one of the AWS service API endpoints.
|
|
42
|
+
*/
|
|
43
|
+
serves(hostname: string): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Answer an AWS API request from the simulated operation it names.
|
|
46
|
+
*/
|
|
47
|
+
fetch(request: Request): Promise<Response>;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=sim-lambda-aws-api-outbound.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-aws-api-outbound.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/function/outbound/sim-lambda-aws-api-outbound.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAkC3E;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAQlE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAO5D;AAED,UAAU,iCAAiC;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;CACjD;AAED;;;;;;;;GAQG;AACH,qBAAa,uBAAwB,YAAW,qBAAqB;IACnE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAuB;IAElD,YAAY,UAAU,EAAE,iCAAiC,EAKxD;IAED;;OAEG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEhC;IAED;;OAEG;IACG,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAM/C;CACF"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { SimSdkWireDispatcher } from "../../../../sdk/wire/sim-sdk-wire-dispatcher.js";
|
|
2
|
+
import { readSimSdkWireCredentialScope, readSimSdkWireOperation, } from "../../../../sdk/wire/sim-sdk-wire-operation.js";
|
|
3
|
+
import { simLambdaOutboundWireRequest, simLambdaOutboundWireResponse, } from "./sim-lambda-outbound-wire.js";
|
|
4
|
+
/**
|
|
5
|
+
* The hostname suffixes AWS issues its service API endpoints under.
|
|
6
|
+
*
|
|
7
|
+
* A request to one of these is a request to an AWS service API whoever sent
|
|
8
|
+
* it, so it belongs to the simulation rather than the network. Everything else
|
|
9
|
+
* a function asks for is either a hostname the simulation serves some other
|
|
10
|
+
* way or one it serves nothing at.
|
|
11
|
+
*
|
|
12
|
+
* `.on.aws` is not among them: what AWS issues under it is Lambda Function
|
|
13
|
+
* URLs, which are the endpoint of one function rather than a service API.
|
|
14
|
+
*/
|
|
15
|
+
const awsEndpointSuffixes = [
|
|
16
|
+
".amazonaws.com",
|
|
17
|
+
".amazonaws.com.cn",
|
|
18
|
+
".api.aws",
|
|
19
|
+
];
|
|
20
|
+
/**
|
|
21
|
+
* The label an endpoint hostname carries when it names one resource rather
|
|
22
|
+
* than a service API: an API Gateway HTTP API, under `.amazonaws.com`.
|
|
23
|
+
*
|
|
24
|
+
* A request to one of these is an ordinary HTTP request to something the
|
|
25
|
+
* simulation may be running, not a serialized Command, so there is nothing
|
|
26
|
+
* here to route it as. Simulated Route53 answers for it instead, in the same
|
|
27
|
+
* way it answers for every other hostname a resource is issued.
|
|
28
|
+
*/
|
|
29
|
+
const resourceEndpointLabel = ".execute-api.";
|
|
30
|
+
/**
|
|
31
|
+
* Whether a hostname is an AWS service API endpoint.
|
|
32
|
+
*/
|
|
33
|
+
export function isSimAwsEndpointHostname(hostname) {
|
|
34
|
+
const name = hostname.toLowerCase();
|
|
35
|
+
if (name.includes(resourceEndpointLabel)) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
return awsEndpointSuffixes.some((suffix) => name.endsWith(suffix));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Whether a request to an AWS service API endpoint is an API call, or an
|
|
42
|
+
* ordinary HTTP request to the same hostname.
|
|
43
|
+
*
|
|
44
|
+
* A service API endpoint answers both. What an SDK sends carries the operation
|
|
45
|
+
* header of the AWS JSON protocol, or the SigV4 credentials it was signed
|
|
46
|
+
* with, or both, and the wire dispatcher answers it. A token verifier fetching
|
|
47
|
+
* from the same hostname carries neither, because it holds nothing to sign
|
|
48
|
+
* with. A user pool publishes its JWKS and its OpenID configuration to whoever
|
|
49
|
+
* asks, and both are read over plain HTTP.
|
|
50
|
+
*/
|
|
51
|
+
export function isSimAwsApiRequest(request) {
|
|
52
|
+
const wireRequest = { headers: Object.fromEntries(request.headers) };
|
|
53
|
+
return (readSimSdkWireOperation(wireRequest) !== undefined ||
|
|
54
|
+
readSimSdkWireCredentialScope(wireRequest) !== undefined);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Answers the AWS service API requests sim Lambda function code sends.
|
|
58
|
+
*
|
|
59
|
+
* This is the half of a function's outbound HTTP that carries a serialized
|
|
60
|
+
* Command rather than an ordinary HTTP request: the SDK has already signed and
|
|
61
|
+
* encoded it by the time it reaches a transport, so the request itself is what
|
|
62
|
+
* there is to route, and the wire dispatcher turns it back into the simulated
|
|
63
|
+
* operation it names.
|
|
64
|
+
*/
|
|
65
|
+
export class SimLambdaAwsApiOutbound {
|
|
66
|
+
dispatcher;
|
|
67
|
+
constructor(properties) {
|
|
68
|
+
this.dispatcher = new SimSdkWireDispatcher(properties.simAws, properties.regionName);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Whether a hostname is one of the AWS service API endpoints.
|
|
72
|
+
*/
|
|
73
|
+
serves(hostname) {
|
|
74
|
+
return isSimAwsEndpointHostname(hostname);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Answer an AWS API request from the simulated operation it names.
|
|
78
|
+
*/
|
|
79
|
+
async fetch(request) {
|
|
80
|
+
return simLambdaOutboundWireResponse(await this.dispatcher.dispatch(await simLambdaOutboundWireRequest(request)));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=sim-lambda-aws-api-outbound.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-aws-api-outbound.js","sourceRoot":"","sources":["../../../../../src/service/lambda/function/outbound/sim-lambda-aws-api-outbound.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AACvF,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,gDAAgD,CAAC;AAIxD,OAAO,EACL,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,+BAA+B,CAAC;AAEvC;;;;;;;;;;GAUG;AACH,MAAM,mBAAmB,GAAsB;IAC7C,gBAAgB;IAChB,mBAAmB;IACnB,UAAU;CACX,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAE9C;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAAgB;IACvD,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IAEpC,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AACrE,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAgB;IACjD,MAAM,WAAW,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;IAErE,OAAO,CACL,uBAAuB,CAAC,WAAW,CAAC,KAAK,SAAS;QAClD,6BAA6B,CAAC,WAAW,CAAC,KAAK,SAAS,CACzD,CAAC;AACJ,CAAC;AAYD;;;;;;;;GAQG;AACH,MAAM,OAAO,uBAAuB;IACjB,UAAU,CAAuB;IAElD,YAAY,UAA6C;QACvD,IAAI,CAAC,UAAU,GAAG,IAAI,oBAAoB,CACxC,UAAU,CAAC,MAAM,EACjB,UAAU,CAAC,UAAU,CACtB,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,QAAgB;QACrB,OAAO,wBAAwB,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK,CAAC,OAAgB;QAC1B,OAAO,6BAA6B,CAClC,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAC5B,MAAM,4BAA4B,CAAC,OAAO,CAAC,CAC5C,CACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { SimLambdaOutboundHttp } from "./sim-lambda-outbound-http.js";
|
|
2
|
+
/**
|
|
3
|
+
* A `node:http` or `node:https` module, as far as this needs to know.
|
|
4
|
+
*/
|
|
5
|
+
type NodeHttpModule = Record<string, unknown>;
|
|
6
|
+
/**
|
|
7
|
+
* Whether a module specifier names an HTTP transport module.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isSimLambdaHttpModuleSpecifier(specifier: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The scheme a transport module's requests are made with, for a specifier
|
|
12
|
+
* naming one.
|
|
13
|
+
*/
|
|
14
|
+
export declare function simLambdaHttpModuleScheme(specifier: string): string;
|
|
15
|
+
interface SimLambdaHttpModuleProperties {
|
|
16
|
+
readonly hostModule: NodeHttpModule;
|
|
17
|
+
readonly outbound: SimLambdaOutboundHttp;
|
|
18
|
+
/**
|
|
19
|
+
* The scheme this module's requests carry, `https:` unless said otherwise,
|
|
20
|
+
* since the arguments to a request rarely name one.
|
|
21
|
+
*/
|
|
22
|
+
readonly scheme?: string | undefined;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Build the `node:http` or `node:https` module sim Lambda function code makes
|
|
26
|
+
* its requests through.
|
|
27
|
+
*
|
|
28
|
+
* Everything the real module exports is kept, and only the two functions that
|
|
29
|
+
* start a request are replaced, so a client library that reaches for an Agent,
|
|
30
|
+
* a status code table or anything else finds the real thing. A request to a
|
|
31
|
+
* hostname the simulation serves is answered by the simulation; every other
|
|
32
|
+
* request is the host module's, made exactly as it was asked for.
|
|
33
|
+
*
|
|
34
|
+
* This is where a deployment package that bundles the AWS SDK is reached. The
|
|
35
|
+
* bundled SDK resolves no module specifier the simulator can intercept, but it
|
|
36
|
+
* still asks the runtime for its HTTP transport, and that is a module the
|
|
37
|
+
* runtime provides. It is also what a handler reaching for `node:https`
|
|
38
|
+
* directly gets, which an OAuth token exchange written without `fetch` does.
|
|
39
|
+
*/
|
|
40
|
+
export declare function makeSimLambdaHttpModule(properties: SimLambdaHttpModuleProperties): NodeHttpModule;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=sim-lambda-http-module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-http-module.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/function/outbound/sim-lambda-http-module.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAE3E;;GAEG;AACH,KAAK,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAc9C;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEzE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEnE;AAID,UAAU,6BAA6B;IACrC,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IAEzC;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,6BAA6B,GACxC,cAAc,CA0BhB"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { SimLambdaHttpRequest } from "./sim-lambda-http-request.js";
|
|
2
|
+
import { readSimLambdaHttpTarget } from "./sim-lambda-http-target.js";
|
|
3
|
+
/**
|
|
4
|
+
* The transport modules an SDK bundled into the function code archive reaches
|
|
5
|
+
* the network through, named as both a bundler and a hand-written require may
|
|
6
|
+
* ask for them, with the scheme each one carries.
|
|
7
|
+
*/
|
|
8
|
+
const httpModuleSchemes = new Map([
|
|
9
|
+
["http", "http:"],
|
|
10
|
+
["node:http", "http:"],
|
|
11
|
+
["https", "https:"],
|
|
12
|
+
["node:https", "https:"],
|
|
13
|
+
]);
|
|
14
|
+
/**
|
|
15
|
+
* Whether a module specifier names an HTTP transport module.
|
|
16
|
+
*/
|
|
17
|
+
export function isSimLambdaHttpModuleSpecifier(specifier) {
|
|
18
|
+
return httpModuleSchemes.has(specifier);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The scheme a transport module's requests are made with, for a specifier
|
|
22
|
+
* naming one.
|
|
23
|
+
*/
|
|
24
|
+
export function simLambdaHttpModuleScheme(specifier) {
|
|
25
|
+
return httpModuleSchemes.get(specifier) ?? "https:";
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Build the `node:http` or `node:https` module sim Lambda function code makes
|
|
29
|
+
* its requests through.
|
|
30
|
+
*
|
|
31
|
+
* Everything the real module exports is kept, and only the two functions that
|
|
32
|
+
* start a request are replaced, so a client library that reaches for an Agent,
|
|
33
|
+
* a status code table or anything else finds the real thing. A request to a
|
|
34
|
+
* hostname the simulation serves is answered by the simulation; every other
|
|
35
|
+
* request is the host module's, made exactly as it was asked for.
|
|
36
|
+
*
|
|
37
|
+
* This is where a deployment package that bundles the AWS SDK is reached. The
|
|
38
|
+
* bundled SDK resolves no module specifier the simulator can intercept, but it
|
|
39
|
+
* still asks the runtime for its HTTP transport, and that is a module the
|
|
40
|
+
* runtime provides. It is also what a handler reaching for `node:https`
|
|
41
|
+
* directly gets, which an OAuth token exchange written without `fetch` does.
|
|
42
|
+
*/
|
|
43
|
+
export function makeSimLambdaHttpModule(properties) {
|
|
44
|
+
const { hostModule } = properties;
|
|
45
|
+
const hostRequest = hostModule["request"];
|
|
46
|
+
const hostGet = hostModule["get"];
|
|
47
|
+
return {
|
|
48
|
+
...hostModule,
|
|
49
|
+
request: (...callArguments) => {
|
|
50
|
+
const simulated = simulatedRequest(callArguments, properties);
|
|
51
|
+
return simulated ?? hostRequest(...callArguments);
|
|
52
|
+
},
|
|
53
|
+
/**
|
|
54
|
+
* `get` is `request` with the body ended immediately, which is the whole
|
|
55
|
+
* of the difference for a request the simulation answers.
|
|
56
|
+
*/
|
|
57
|
+
get: (...callArguments) => {
|
|
58
|
+
const simulated = simulatedRequest(callArguments, properties);
|
|
59
|
+
if (simulated === undefined) {
|
|
60
|
+
return hostGet(...callArguments);
|
|
61
|
+
}
|
|
62
|
+
simulated.end();
|
|
63
|
+
return simulated;
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Start a simulated request, for a call addressed to a hostname the simulation
|
|
69
|
+
* serves.
|
|
70
|
+
*
|
|
71
|
+
* The response callback a caller passed is attached to the `response` event,
|
|
72
|
+
* as the real module attaches it, so a caller using either receives the
|
|
73
|
+
* response.
|
|
74
|
+
*/
|
|
75
|
+
function simulatedRequest(callArguments, properties) {
|
|
76
|
+
const { outbound, scheme = "https:" } = properties;
|
|
77
|
+
const target = readSimLambdaHttpTarget(callArguments);
|
|
78
|
+
if (target === undefined || !outbound.serves(target.hostname)) {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
const request = new SimLambdaHttpRequest({ target, outbound, scheme });
|
|
82
|
+
const callback = callArguments.at(-1);
|
|
83
|
+
if (typeof callback === "function") {
|
|
84
|
+
request.on("response", callback);
|
|
85
|
+
}
|
|
86
|
+
return request;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=sim-lambda-http-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-http-module.js","sourceRoot":"","sources":["../../../../../src/service/lambda/function/outbound/sim-lambda-http-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAQtE;;;;GAIG;AACH,MAAM,iBAAiB,GAAgC,IAAI,GAAG,CAAC;IAC7D,CAAC,MAAM,EAAE,OAAO,CAAC;IACjB,CAAC,WAAW,EAAE,OAAO,CAAC;IACtB,CAAC,OAAO,EAAE,QAAQ,CAAC;IACnB,CAAC,YAAY,EAAE,QAAQ,CAAC;CACzB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,UAAU,8BAA8B,CAAC,SAAiB;IAC9D,OAAO,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAC1C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,SAAiB;IACzD,OAAO,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAC;AACtD,CAAC;AAeD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,uBAAuB,CACrC,UAAyC;IAEzC,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC;IAClC,MAAM,WAAW,GAAG,UAAU,CAAC,SAAS,CAAoB,CAAC;IAC7D,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,CAAoB,CAAC;IAErD,OAAO;QACL,GAAG,UAAU;QACb,OAAO,EAAE,CAAC,GAAG,aAAwB,EAAW,EAAE;YAChD,MAAM,SAAS,GAAG,gBAAgB,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;YAE9D,OAAO,SAAS,IAAI,WAAW,CAAC,GAAG,aAAa,CAAC,CAAC;QACpD,CAAC;QACD;;;WAGG;QACH,GAAG,EAAE,CAAC,GAAG,aAAwB,EAAW,EAAE;YAC5C,MAAM,SAAS,GAAG,gBAAgB,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;YAC9D,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;gBAC5B,OAAO,OAAO,CAAC,GAAG,aAAa,CAAC,CAAC;YACnC,CAAC;YAED,SAAS,CAAC,GAAG,EAAE,CAAC;YAChB,OAAO,SAAS,CAAC;QACnB,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,gBAAgB,CACvB,aAAiC,EACjC,UAAyC;IAEzC,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,GAAG,UAAU,CAAC;IACnD,MAAM,MAAM,GAAG,uBAAuB,CAAC,aAAa,CAAC,CAAC;IACtD,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9D,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,oBAAoB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;IAEvE,MAAM,QAAQ,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACnC,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,QAAuC,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { Writable } from "node:stream";
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { SimLambdaHttpTarget } from "./sim-lambda-http-target.js";
|
|
3
|
+
import type { SimLambdaOutboundHttp } from "./sim-lambda-outbound-http.js";
|
|
4
|
+
interface SimLambdaHttpRequestProperties {
|
|
5
|
+
readonly target: SimLambdaHttpTarget;
|
|
6
|
+
readonly outbound: SimLambdaOutboundHttp;
|
|
7
|
+
/**
|
|
8
|
+
* The scheme of the transport module the call was made through, which
|
|
9
|
+
* stands in when the call itself named none.
|
|
10
|
+
*/
|
|
11
|
+
readonly scheme: string;
|
|
12
|
+
}
|
|
4
13
|
/**
|
|
5
14
|
* The outgoing request object `http.request` hands back, for a request the
|
|
6
15
|
* simulation answers instead of the network.
|
|
@@ -12,11 +21,10 @@ import type { SimLambdaVmHttpTarget } from "./sim-lambda-vm-http-target.js";
|
|
|
12
21
|
* client may reach for do nothing rather than being absent, since there is no
|
|
13
22
|
* socket to time out.
|
|
14
23
|
*/
|
|
15
|
-
export declare class
|
|
16
|
-
private readonly
|
|
17
|
-
private readonly handler;
|
|
24
|
+
export declare class SimLambdaHttpRequest extends Writable {
|
|
25
|
+
private readonly properties;
|
|
18
26
|
private readonly chunks;
|
|
19
|
-
constructor(
|
|
27
|
+
constructor(properties: SimLambdaHttpRequestProperties);
|
|
20
28
|
_write(chunk: unknown, _encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
|
|
21
29
|
/**
|
|
22
30
|
* Answer the request once its body is complete.
|
|
@@ -33,5 +41,10 @@ export declare class SimLambdaVmWireRequest extends Writable {
|
|
|
33
41
|
setNoDelay(): this;
|
|
34
42
|
setSocketKeepAlive(): this;
|
|
35
43
|
private answer;
|
|
44
|
+
/**
|
|
45
|
+
* The written request, as the request the simulation is asked to answer.
|
|
46
|
+
*/
|
|
47
|
+
private request;
|
|
36
48
|
}
|
|
37
|
-
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=sim-lambda-http-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-lambda-http-request.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/function/outbound/sim-lambda-http-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAQ3E,UAAU,8BAA8B;IACtC,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IAEzC;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;GAUG;AACH,qBAAa,oBAAqB,SAAQ,QAAQ;IAGpC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAFvC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;IAEvC,YAA6B,UAAU,EAAE,8BAA8B,EAEtE;IAEQ,MAAM,CACb,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,cAAc,EACzB,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,GACvC,IAAI,CAGN;IAED;;;;;;OAMG;IACM,MAAM,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI,CAE9D;IAED;;OAEG;IACH,UAAU,IAAI,IAAI,CAEjB;IAED,UAAU,IAAI,IAAI,CAEjB;IAED,kBAAkB,IAAI,IAAI,CAEzB;YAEa,MAAM;IAapB;;OAEG;IACH,OAAO,CAAC,OAAO;CAahB"}
|