@psnext/slingcli 3.0.20260811-3 → 3.0.20260820-1
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/node_modules/@aws-sdk/core/dist-types/submodules/client/util-endpoints/lib/aws/partitions.d.ts +54 -54
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-user-agent-node/defaultUserAgent.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partitions.d.ts +54 -54
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts +1 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts +1 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/defaultUserAgent.d.ts +1 -4
- package/node_modules/@aws-sdk/core/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-env/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-cjs/index.js +9 -2
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +9 -2
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +1 -1
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +1 -1
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/package.json +5 -13
- package/node_modules/@aws-sdk/credential-provider-http/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +11 -11
- package/node_modules/@aws-sdk/credential-provider-login/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-node/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-process/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +5 -5
- package/node_modules/@aws-sdk/eventstream-handler-node/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-eventstream/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-websocket/package.json +4 -4
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.browser.d.ts +42 -42
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.d.ts +42 -42
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.native.d.ts +41 -41
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.shared.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.browser.d.ts +43 -43
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.d.ts +43 -43
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.native.d.ts +42 -42
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.shared.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.browser.d.ts +42 -42
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.d.ts +42 -42
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.native.d.ts +41 -41
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.shared.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.browser.d.ts +42 -42
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.d.ts +42 -42
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.native.d.ts +41 -41
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.shared.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.browser.d.ts +44 -44
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.d.ts +35 -35
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.native.d.ts +43 -43
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.shared.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.browser.d.ts +64 -66
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.d.ts +65 -65
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.native.d.ts +68 -70
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.shared.d.ts +3 -3
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.browser.d.ts +67 -69
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.d.ts +66 -66
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.native.d.ts +71 -73
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.shared.d.ts +3 -3
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.browser.d.ts +64 -66
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.d.ts +65 -65
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.native.d.ts +68 -70
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.shared.d.ts +3 -3
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.browser.d.ts +64 -66
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.d.ts +65 -65
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.native.d.ts +68 -70
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.shared.d.ts +3 -3
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.browser.d.ts +68 -70
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.d.ts +68 -68
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.native.d.ts +72 -74
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.shared.d.ts +3 -3
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-cjs/index.js +9 -2
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +9 -2
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/package.json +5 -13
- package/node_modules/@aws-sdk/nested-clients/package.json +5 -5
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +3 -3
- package/node_modules/@aws-sdk/types/package.json +2 -2
- package/node_modules/@aws-sdk/util-locate-window/package.json +27 -27
- package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js +4 -1
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@hono/node-server/dist/index.cjs +151 -9
- package/node_modules/@hono/node-server/dist/index.mjs +151 -9
- package/node_modules/@hono/node-server/package.json +1 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +1 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +23 -23
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +23 -23
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +17 -13
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +0 -10
- package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +1 -2
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +4 -4
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js +19 -19
- package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +3 -4
- package/node_modules/@smithy/core/dist-es/submodules/protocols/middleware-content-length/contentLengthMiddleware.js +6 -4
- package/node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.js +8 -5
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js +0 -2
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js +0 -2
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js +0 -2
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js +0 -2
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js +0 -2
- package/node_modules/@smithy/core/dist-types/submodules/client/smithy-client/extensions/defaultExtensionConfiguration.d.ts +1 -7
- package/node_modules/@smithy/core/dist-types/submodules/config/config-resolver/regionConfig/checkRegion.d.ts +2 -1
- package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/evaluateCondition.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/evaluateConditions.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/evaluateExpression.d.ts +2 -2
- package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/evaluateRules.d.ts +2 -2
- package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/getEndpointProperties.d.ts +2 -2
- package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/utils/getReferenceValue.d.ts +2 -2
- package/node_modules/@smithy/core/dist-types/submodules/event-streams/EventStreamSerde.d.ts +14 -2
- package/node_modules/@smithy/core/dist-types/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +7 -2
- package/node_modules/@smithy/core/dist-types/submodules/retry/util-retry/retries-2026-config.d.ts +2 -2
- package/node_modules/@smithy/core/dist-types/submodules/schema/TypeRegistry.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/submodules/serde/parse-utils.d.ts +5 -5
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/client/smithy-client/extensions/defaultExtensionConfiguration.d.ts +1 -7
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/config/config-resolver/regionConfig/checkRegion.d.ts +2 -1
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/evaluateCondition.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/evaluateConditions.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/evaluateExpression.d.ts +2 -2
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/evaluateRules.d.ts +2 -2
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/getEndpointProperties.d.ts +2 -2
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/endpoints/util-endpoints/utils/getReferenceValue.d.ts +2 -2
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/event-streams/EventStreamSerde.d.ts +14 -2
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +7 -2
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/retry/util-retry/retries-2026-config.d.ts +2 -2
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/TypeRegistry.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/parse-utils.d.ts +5 -5
- package/node_modules/@smithy/core/package.json +3 -11
- package/node_modules/@smithy/credential-provider-imds/package.json +4 -12
- package/node_modules/@smithy/fetch-http-handler/package.json +5 -13
- package/node_modules/@smithy/signature-v4/dist-cjs/index.js +9 -9
- package/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +9 -9
- package/node_modules/@smithy/signature-v4/package.json +4 -12
- package/node_modules/@smithy/types/dist-types/schema/sentinels.d.ts +14 -14
- package/node_modules/@smithy/types/package.json +29 -39
- package/node_modules/body-parser/node_modules/content-type/README.md +2 -0
- package/node_modules/body-parser/node_modules/content-type/dist/index.d.ts +20 -0
- package/node_modules/body-parser/node_modules/content-type/dist/index.js +20 -14
- package/node_modules/body-parser/node_modules/content-type/dist/index.js.map +1 -1
- package/node_modules/body-parser/node_modules/content-type/package.json +1 -1
- package/node_modules/gaxios/build/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/node_modules/gaxios/build/esm/tsconfig.tsbuildinfo +1 -1
- package/node_modules/gaxios/package.json +3 -3
- package/node_modules/hono/dist/cjs/client/client.js +3 -3
- package/node_modules/hono/dist/cjs/client/utils.js +1 -1
- package/node_modules/hono/dist/cjs/context.js +4 -0
- package/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/cors/index.js +16 -13
- package/node_modules/hono/dist/cjs/middleware/csrf/index.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/etag/digest.js +47 -1
- package/node_modules/hono/dist/cjs/middleware/etag/index.js +2 -2
- package/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +3 -1
- package/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js +6 -3
- package/node_modules/hono/dist/cjs/router/linear-router/router.js +7 -2
- package/node_modules/hono/dist/cjs/router/pattern-router/router.js +3 -9
- package/node_modules/hono/dist/cjs/router/trie-router/node.js +43 -67
- package/node_modules/hono/dist/cjs/router/trie-router/router.js +3 -11
- package/node_modules/hono/dist/cjs/utils/ipaddr.js +5 -3
- package/node_modules/hono/dist/cjs/utils/url.js +2 -2
- package/node_modules/hono/dist/client/client.js +3 -3
- package/node_modules/hono/dist/client/utils.js +1 -1
- package/node_modules/hono/dist/context.js +4 -0
- package/node_modules/hono/dist/jsx/intrinsic-element/components.js +1 -1
- package/node_modules/hono/dist/middleware/cors/index.js +16 -13
- package/node_modules/hono/dist/middleware/csrf/index.js +1 -1
- package/node_modules/hono/dist/middleware/etag/digest.js +47 -1
- package/node_modules/hono/dist/middleware/etag/index.js +2 -2
- package/node_modules/hono/dist/middleware/pretty-json/index.js +3 -1
- package/node_modules/hono/dist/middleware/secure-headers/secure-headers.js +6 -3
- package/node_modules/hono/dist/router/linear-router/router.js +7 -2
- package/node_modules/hono/dist/router/pattern-router/router.js +3 -9
- package/node_modules/hono/dist/router/trie-router/node.js +43 -67
- package/node_modules/hono/dist/router/trie-router/router.js +3 -11
- package/node_modules/hono/dist/types/context.d.ts +4 -0
- package/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts +3 -3
- package/node_modules/hono/dist/types/router/trie-router/node.d.ts +1 -2
- package/node_modules/hono/dist/types/router/trie-router/router.d.ts +0 -1
- package/node_modules/hono/dist/utils/ipaddr.js +5 -3
- package/node_modules/hono/dist/utils/url.js +2 -2
- package/node_modules/hono/package.json +1 -1
- package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +4 -3
- package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +4 -3
- package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +4 -3
- package/node_modules/jose/dist/types/jwt/encrypt.d.ts +4 -3
- package/node_modules/jose/dist/types/types.d.ts +4 -2
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +7 -3
- package/node_modules/jose/dist/webapi/jwks/remote.js +1 -1
- package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +6 -2
- package/node_modules/jose/package.json +1 -1
- package/node_modules/type-is/node_modules/content-type/README.md +2 -0
- package/node_modules/type-is/node_modules/content-type/dist/index.d.ts +20 -0
- package/node_modules/type-is/node_modules/content-type/dist/index.js +20 -14
- package/node_modules/type-is/node_modules/content-type/dist/index.js.map +1 -1
- package/node_modules/type-is/node_modules/content-type/package.json +1 -1
- package/package.json +2 -2
- package/slingshot/index.js +295 -279
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/xml-builder",
|
|
3
|
-
"version": "3.972.
|
|
3
|
+
"version": "3.972.39",
|
|
4
4
|
"description": "XML utilities for the AWS SDK",
|
|
5
5
|
"homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages-internal/xml-builder",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"concurrently": "7.0.0",
|
|
56
56
|
"downlevel-dts": "0.10.1",
|
|
57
57
|
"premove": "4.0.0",
|
|
58
|
-
"typescript": "~
|
|
58
|
+
"typescript": "~7.0.2"
|
|
59
59
|
},
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">=20.0.0"
|
|
@@ -87,7 +87,10 @@ Sling documentation (read only when the user asks about sling itself, its SDK, e
|
|
|
87
87
|
- When reading sling docs or examples, resolve docs/... under Additional docs and examples/... under Examples, not the current working directory
|
|
88
88
|
- When asked about: extensions (docs/extensions.md, examples/extensions/), themes (docs/themes.md), skills (docs/skills.md), prompt templates (docs/prompt-templates.md), TUI components (docs/tui.md), keybindings (docs/keybindings.md), SDK integrations (docs/sdk.md), custom providers (docs/custom-provider.md), adding models (docs/models.md), sling packages (docs/packages.md), environment variables (docs/environment-variables.md)
|
|
89
89
|
- When working on sling topics, read the docs and examples, and follow .md cross-references before implementing
|
|
90
|
-
- Always read sling .md files completely and follow links to related docs (e.g., tui.md for TUI API details)
|
|
90
|
+
- Always read sling .md files completely and follow links to related docs (e.g., tui.md for TUI API details)
|
|
91
|
+
|
|
92
|
+
IMPORTANT: sling is an alias of pi, whenever you have command line examples of pi show them as sling,
|
|
93
|
+
for example \`pi -ne\` should be shown as \`sling -ne\``;
|
|
91
94
|
if (appendSection) {
|
|
92
95
|
prompt += appendSection;
|
|
93
96
|
}
|
|
@@ -13,6 +13,157 @@ var RequestError = class extends Error {
|
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/headers.ts
|
|
18
|
+
const nonJoinedHeaders = new Set([
|
|
19
|
+
"age",
|
|
20
|
+
"authorization",
|
|
21
|
+
"content-length",
|
|
22
|
+
"content-type",
|
|
23
|
+
"etag",
|
|
24
|
+
"expires",
|
|
25
|
+
"from",
|
|
26
|
+
"host",
|
|
27
|
+
"if-modified-since",
|
|
28
|
+
"if-unmodified-since",
|
|
29
|
+
"last-modified",
|
|
30
|
+
"location",
|
|
31
|
+
"max-forwards",
|
|
32
|
+
"proxy-authorization",
|
|
33
|
+
"referer",
|
|
34
|
+
"retry-after",
|
|
35
|
+
"server",
|
|
36
|
+
"user-agent"
|
|
37
|
+
]);
|
|
38
|
+
const validHeaderName = /^[!#$%&'*+\-.^_`|~\dA-Za-z]+$/;
|
|
39
|
+
const isHttpWhitespace = (code) => code === 9 || code === 10 || code === 13 || code === 32;
|
|
40
|
+
const normalizeHeaderValue = (value) => {
|
|
41
|
+
if (!isHttpWhitespace(value.charCodeAt(0)) && !isHttpWhitespace(value.charCodeAt(value.length - 1))) return value;
|
|
42
|
+
let start = 0;
|
|
43
|
+
let end = value.length;
|
|
44
|
+
while (start < end && isHttpWhitespace(value.charCodeAt(start))) start++;
|
|
45
|
+
while (end > start && isHttpWhitespace(value.charCodeAt(end - 1))) end--;
|
|
46
|
+
return value.slice(start, end);
|
|
47
|
+
};
|
|
48
|
+
const forbiddenHeaderValue = /[\0\r\n]/;
|
|
49
|
+
const GlobalHeaders = globalThis.Headers;
|
|
50
|
+
const materializeHeaders = (rawHeaders, HeadersCtor = GlobalHeaders) => {
|
|
51
|
+
const headers = new HeadersCtor();
|
|
52
|
+
for (let i = 0; i < rawHeaders.length; i += 2) {
|
|
53
|
+
const name = rawHeaders[i];
|
|
54
|
+
if (!name.startsWith(":")) headers.append(name, rawHeaders[i + 1]);
|
|
55
|
+
}
|
|
56
|
+
return headers;
|
|
57
|
+
};
|
|
58
|
+
var RequestHeaders = class {
|
|
59
|
+
#incoming;
|
|
60
|
+
#rawHeaders;
|
|
61
|
+
#headers;
|
|
62
|
+
#invalidValue;
|
|
63
|
+
constructor(incoming) {
|
|
64
|
+
this.#incoming = incoming;
|
|
65
|
+
if (incoming instanceof node_http2.Http2ServerRequest) this.#rawHeaders = incoming.rawHeaders.slice();
|
|
66
|
+
}
|
|
67
|
+
get #lazyRawHeaders() {
|
|
68
|
+
return this.#rawHeaders ??= this.#incoming.rawHeaders.slice();
|
|
69
|
+
}
|
|
70
|
+
get #native() {
|
|
71
|
+
if (!this.#headers) {
|
|
72
|
+
this.#headers = materializeHeaders(this.#lazyRawHeaders);
|
|
73
|
+
this.#rawHeaders = void 0;
|
|
74
|
+
}
|
|
75
|
+
return this.#headers;
|
|
76
|
+
}
|
|
77
|
+
#normalizedName(name) {
|
|
78
|
+
if (typeof name !== "string") return;
|
|
79
|
+
if (!validHeaderName.test(name)) throw new TypeError(`Invalid header name: ${name}`);
|
|
80
|
+
return name.toLowerCase();
|
|
81
|
+
}
|
|
82
|
+
#lookupHttp1(lowerName) {
|
|
83
|
+
const headers = this.#incoming instanceof node_http2.Http2ServerRequest ? void 0 : this.#incoming.headers;
|
|
84
|
+
if (!headers || nonJoinedHeaders.has(lowerName) || lowerName === "set-cookie" || lowerName === "__proto__") return;
|
|
85
|
+
if (!Object.hasOwn(headers, lowerName)) return null;
|
|
86
|
+
const rawValue = headers[lowerName];
|
|
87
|
+
if (typeof rawValue === "string") {
|
|
88
|
+
const value = normalizeHeaderValue(rawValue);
|
|
89
|
+
return forbiddenHeaderValue.test(value) ? void 0 : value;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
#lookup(rawHeaders, lowerName) {
|
|
93
|
+
const separator = lowerName === "cookie" ? "; " : ", ";
|
|
94
|
+
let value = null;
|
|
95
|
+
for (let i = 0; i < rawHeaders.length; i += 2) {
|
|
96
|
+
const rawName = rawHeaders[i];
|
|
97
|
+
if (rawName.length === lowerName.length && rawName.toLowerCase() === lowerName) {
|
|
98
|
+
const rawValue = normalizeHeaderValue(rawHeaders[i + 1]);
|
|
99
|
+
if (forbiddenHeaderValue.test(rawValue)) {
|
|
100
|
+
this.#invalidValue = true;
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
value = value === null ? rawValue : value + separator + rawValue;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return value;
|
|
107
|
+
}
|
|
108
|
+
append(name, value) {
|
|
109
|
+
this.#native.append(name, value);
|
|
110
|
+
}
|
|
111
|
+
delete(name) {
|
|
112
|
+
this.#native.delete(name);
|
|
113
|
+
}
|
|
114
|
+
get(name) {
|
|
115
|
+
const lowerName = this.#normalizedName(name);
|
|
116
|
+
if (lowerName && !this.#headers && !this.#invalidValue) {
|
|
117
|
+
const http1Value = this.#lookupHttp1(lowerName);
|
|
118
|
+
if (http1Value !== void 0) return http1Value;
|
|
119
|
+
const value = this.#lookup(this.#lazyRawHeaders, lowerName);
|
|
120
|
+
if (value !== void 0) return value;
|
|
121
|
+
}
|
|
122
|
+
return this.#native.get(name);
|
|
123
|
+
}
|
|
124
|
+
has(name) {
|
|
125
|
+
const lowerName = this.#normalizedName(name);
|
|
126
|
+
if (lowerName && !this.#headers && !this.#invalidValue) {
|
|
127
|
+
const http1Value = this.#lookupHttp1(lowerName);
|
|
128
|
+
if (http1Value !== void 0) return http1Value !== null;
|
|
129
|
+
const value = this.#lookup(this.#lazyRawHeaders, lowerName);
|
|
130
|
+
if (value !== void 0) return value !== null;
|
|
131
|
+
}
|
|
132
|
+
return this.#native.has(name);
|
|
133
|
+
}
|
|
134
|
+
set(name, value) {
|
|
135
|
+
this.#native.set(name, value);
|
|
136
|
+
}
|
|
137
|
+
getSetCookie() {
|
|
138
|
+
return this.#native.getSetCookie();
|
|
139
|
+
}
|
|
140
|
+
keys() {
|
|
141
|
+
return this.#native.keys();
|
|
142
|
+
}
|
|
143
|
+
values() {
|
|
144
|
+
return this.#native.values();
|
|
145
|
+
}
|
|
146
|
+
entries() {
|
|
147
|
+
return this.#native.entries();
|
|
148
|
+
}
|
|
149
|
+
forEach(callback, thisArg) {
|
|
150
|
+
this.#native.forEach((value, key) => {
|
|
151
|
+
callback.call(thisArg, value, key, this);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
[Symbol.iterator]() {
|
|
155
|
+
return this.entries();
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
Object.defineProperty(RequestHeaders.prototype, Symbol.for("nodejs.util.inspect.custom"), { value: function(depth, options, inspectFn) {
|
|
159
|
+
return `Headers (lightweight) ${inspectFn(Object.fromEntries(this), {
|
|
160
|
+
...options,
|
|
161
|
+
depth: depth == null ? null : depth - 1
|
|
162
|
+
})}`;
|
|
163
|
+
} });
|
|
164
|
+
Object.setPrototypeOf(RequestHeaders.prototype, GlobalHeaders.prototype);
|
|
165
|
+
const newHeadersFromIncoming = (incoming) => globalThis.Headers === GlobalHeaders ? new RequestHeaders(incoming) : materializeHeaders(incoming.rawHeaders, globalThis.Headers);
|
|
166
|
+
|
|
16
167
|
//#endregion
|
|
17
168
|
//#region src/url.ts
|
|
18
169
|
const reValidRequestUrl = /^\/[!#$&-;=?-\[\]_a-z~]*$/;
|
|
@@ -50,15 +201,6 @@ var Request$1 = class extends GlobalRequest {
|
|
|
50
201
|
super(input, options);
|
|
51
202
|
}
|
|
52
203
|
};
|
|
53
|
-
const newHeadersFromIncoming = (incoming) => {
|
|
54
|
-
const headerRecord = [];
|
|
55
|
-
const rawHeaders = incoming.rawHeaders;
|
|
56
|
-
for (let i = 0, len = rawHeaders.length; i < len; i += 2) {
|
|
57
|
-
const key = rawHeaders[i];
|
|
58
|
-
if (key.charCodeAt(0) !== 58) headerRecord.push([key, rawHeaders[i + 1]]);
|
|
59
|
-
}
|
|
60
|
-
return new Headers(headerRecord);
|
|
61
|
-
};
|
|
62
204
|
const wrapBodyStream = Symbol("wrapBodyStream");
|
|
63
205
|
const byteExactEncodings = new Set([
|
|
64
206
|
"latin1",
|
|
@@ -12,6 +12,157 @@ var RequestError = class extends Error {
|
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/headers.ts
|
|
17
|
+
const nonJoinedHeaders = new Set([
|
|
18
|
+
"age",
|
|
19
|
+
"authorization",
|
|
20
|
+
"content-length",
|
|
21
|
+
"content-type",
|
|
22
|
+
"etag",
|
|
23
|
+
"expires",
|
|
24
|
+
"from",
|
|
25
|
+
"host",
|
|
26
|
+
"if-modified-since",
|
|
27
|
+
"if-unmodified-since",
|
|
28
|
+
"last-modified",
|
|
29
|
+
"location",
|
|
30
|
+
"max-forwards",
|
|
31
|
+
"proxy-authorization",
|
|
32
|
+
"referer",
|
|
33
|
+
"retry-after",
|
|
34
|
+
"server",
|
|
35
|
+
"user-agent"
|
|
36
|
+
]);
|
|
37
|
+
const validHeaderName = /^[!#$%&'*+\-.^_`|~\dA-Za-z]+$/;
|
|
38
|
+
const isHttpWhitespace = (code) => code === 9 || code === 10 || code === 13 || code === 32;
|
|
39
|
+
const normalizeHeaderValue = (value) => {
|
|
40
|
+
if (!isHttpWhitespace(value.charCodeAt(0)) && !isHttpWhitespace(value.charCodeAt(value.length - 1))) return value;
|
|
41
|
+
let start = 0;
|
|
42
|
+
let end = value.length;
|
|
43
|
+
while (start < end && isHttpWhitespace(value.charCodeAt(start))) start++;
|
|
44
|
+
while (end > start && isHttpWhitespace(value.charCodeAt(end - 1))) end--;
|
|
45
|
+
return value.slice(start, end);
|
|
46
|
+
};
|
|
47
|
+
const forbiddenHeaderValue = /[\0\r\n]/;
|
|
48
|
+
const GlobalHeaders = globalThis.Headers;
|
|
49
|
+
const materializeHeaders = (rawHeaders, HeadersCtor = GlobalHeaders) => {
|
|
50
|
+
const headers = new HeadersCtor();
|
|
51
|
+
for (let i = 0; i < rawHeaders.length; i += 2) {
|
|
52
|
+
const name = rawHeaders[i];
|
|
53
|
+
if (!name.startsWith(":")) headers.append(name, rawHeaders[i + 1]);
|
|
54
|
+
}
|
|
55
|
+
return headers;
|
|
56
|
+
};
|
|
57
|
+
var RequestHeaders = class {
|
|
58
|
+
#incoming;
|
|
59
|
+
#rawHeaders;
|
|
60
|
+
#headers;
|
|
61
|
+
#invalidValue;
|
|
62
|
+
constructor(incoming) {
|
|
63
|
+
this.#incoming = incoming;
|
|
64
|
+
if (incoming instanceof Http2ServerRequest) this.#rawHeaders = incoming.rawHeaders.slice();
|
|
65
|
+
}
|
|
66
|
+
get #lazyRawHeaders() {
|
|
67
|
+
return this.#rawHeaders ??= this.#incoming.rawHeaders.slice();
|
|
68
|
+
}
|
|
69
|
+
get #native() {
|
|
70
|
+
if (!this.#headers) {
|
|
71
|
+
this.#headers = materializeHeaders(this.#lazyRawHeaders);
|
|
72
|
+
this.#rawHeaders = void 0;
|
|
73
|
+
}
|
|
74
|
+
return this.#headers;
|
|
75
|
+
}
|
|
76
|
+
#normalizedName(name) {
|
|
77
|
+
if (typeof name !== "string") return;
|
|
78
|
+
if (!validHeaderName.test(name)) throw new TypeError(`Invalid header name: ${name}`);
|
|
79
|
+
return name.toLowerCase();
|
|
80
|
+
}
|
|
81
|
+
#lookupHttp1(lowerName) {
|
|
82
|
+
const headers = this.#incoming instanceof Http2ServerRequest ? void 0 : this.#incoming.headers;
|
|
83
|
+
if (!headers || nonJoinedHeaders.has(lowerName) || lowerName === "set-cookie" || lowerName === "__proto__") return;
|
|
84
|
+
if (!Object.hasOwn(headers, lowerName)) return null;
|
|
85
|
+
const rawValue = headers[lowerName];
|
|
86
|
+
if (typeof rawValue === "string") {
|
|
87
|
+
const value = normalizeHeaderValue(rawValue);
|
|
88
|
+
return forbiddenHeaderValue.test(value) ? void 0 : value;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
#lookup(rawHeaders, lowerName) {
|
|
92
|
+
const separator = lowerName === "cookie" ? "; " : ", ";
|
|
93
|
+
let value = null;
|
|
94
|
+
for (let i = 0; i < rawHeaders.length; i += 2) {
|
|
95
|
+
const rawName = rawHeaders[i];
|
|
96
|
+
if (rawName.length === lowerName.length && rawName.toLowerCase() === lowerName) {
|
|
97
|
+
const rawValue = normalizeHeaderValue(rawHeaders[i + 1]);
|
|
98
|
+
if (forbiddenHeaderValue.test(rawValue)) {
|
|
99
|
+
this.#invalidValue = true;
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
value = value === null ? rawValue : value + separator + rawValue;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return value;
|
|
106
|
+
}
|
|
107
|
+
append(name, value) {
|
|
108
|
+
this.#native.append(name, value);
|
|
109
|
+
}
|
|
110
|
+
delete(name) {
|
|
111
|
+
this.#native.delete(name);
|
|
112
|
+
}
|
|
113
|
+
get(name) {
|
|
114
|
+
const lowerName = this.#normalizedName(name);
|
|
115
|
+
if (lowerName && !this.#headers && !this.#invalidValue) {
|
|
116
|
+
const http1Value = this.#lookupHttp1(lowerName);
|
|
117
|
+
if (http1Value !== void 0) return http1Value;
|
|
118
|
+
const value = this.#lookup(this.#lazyRawHeaders, lowerName);
|
|
119
|
+
if (value !== void 0) return value;
|
|
120
|
+
}
|
|
121
|
+
return this.#native.get(name);
|
|
122
|
+
}
|
|
123
|
+
has(name) {
|
|
124
|
+
const lowerName = this.#normalizedName(name);
|
|
125
|
+
if (lowerName && !this.#headers && !this.#invalidValue) {
|
|
126
|
+
const http1Value = this.#lookupHttp1(lowerName);
|
|
127
|
+
if (http1Value !== void 0) return http1Value !== null;
|
|
128
|
+
const value = this.#lookup(this.#lazyRawHeaders, lowerName);
|
|
129
|
+
if (value !== void 0) return value !== null;
|
|
130
|
+
}
|
|
131
|
+
return this.#native.has(name);
|
|
132
|
+
}
|
|
133
|
+
set(name, value) {
|
|
134
|
+
this.#native.set(name, value);
|
|
135
|
+
}
|
|
136
|
+
getSetCookie() {
|
|
137
|
+
return this.#native.getSetCookie();
|
|
138
|
+
}
|
|
139
|
+
keys() {
|
|
140
|
+
return this.#native.keys();
|
|
141
|
+
}
|
|
142
|
+
values() {
|
|
143
|
+
return this.#native.values();
|
|
144
|
+
}
|
|
145
|
+
entries() {
|
|
146
|
+
return this.#native.entries();
|
|
147
|
+
}
|
|
148
|
+
forEach(callback, thisArg) {
|
|
149
|
+
this.#native.forEach((value, key) => {
|
|
150
|
+
callback.call(thisArg, value, key, this);
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
[Symbol.iterator]() {
|
|
154
|
+
return this.entries();
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
Object.defineProperty(RequestHeaders.prototype, Symbol.for("nodejs.util.inspect.custom"), { value: function(depth, options, inspectFn) {
|
|
158
|
+
return `Headers (lightweight) ${inspectFn(Object.fromEntries(this), {
|
|
159
|
+
...options,
|
|
160
|
+
depth: depth == null ? null : depth - 1
|
|
161
|
+
})}`;
|
|
162
|
+
} });
|
|
163
|
+
Object.setPrototypeOf(RequestHeaders.prototype, GlobalHeaders.prototype);
|
|
164
|
+
const newHeadersFromIncoming = (incoming) => globalThis.Headers === GlobalHeaders ? new RequestHeaders(incoming) : materializeHeaders(incoming.rawHeaders, globalThis.Headers);
|
|
165
|
+
|
|
15
166
|
//#endregion
|
|
16
167
|
//#region src/url.ts
|
|
17
168
|
const reValidRequestUrl = /^\/[!#$&-;=?-\[\]_a-z~]*$/;
|
|
@@ -49,15 +200,6 @@ var Request$1 = class extends GlobalRequest {
|
|
|
49
200
|
super(input, options);
|
|
50
201
|
}
|
|
51
202
|
};
|
|
52
|
-
const newHeadersFromIncoming = (incoming) => {
|
|
53
|
-
const headerRecord = [];
|
|
54
|
-
const rawHeaders = incoming.rawHeaders;
|
|
55
|
-
for (let i = 0, len = rawHeaders.length; i < len; i += 2) {
|
|
56
|
-
const key = rawHeaders[i];
|
|
57
|
-
if (key.charCodeAt(0) !== 58) headerRecord.push([key, rawHeaders[i + 1]]);
|
|
58
|
-
}
|
|
59
|
-
return new Headers(headerRecord);
|
|
60
|
-
};
|
|
61
203
|
const wrapBodyStream = Symbol("wrapBodyStream");
|
|
62
204
|
const byteExactEncodings = new Set([
|
|
63
205
|
"latin1",
|
|
@@ -2187,10 +2187,9 @@ class SmithyRpcV2CborProtocol extends RpcProtocol {
|
|
|
2187
2187
|
this.serializer.write(15, {});
|
|
2188
2188
|
request.body = this.serializer.flush();
|
|
2189
2189
|
}
|
|
2190
|
-
|
|
2190
|
+
if (request.body instanceof Uint8Array) {
|
|
2191
2191
|
request.headers["content-length"] = String(request.body.byteLength);
|
|
2192
2192
|
}
|
|
2193
|
-
catch (ignored) { }
|
|
2194
2193
|
}
|
|
2195
2194
|
const { service, operation } = getSmithyContext(context);
|
|
2196
2195
|
const path = `/service/${service}/operation/${operation}`;
|
|
@@ -70,27 +70,27 @@ class HeaderMarshaller {
|
|
|
70
70
|
formatHeaderValue(header) {
|
|
71
71
|
switch (header.type) {
|
|
72
72
|
case "boolean":
|
|
73
|
-
return Uint8Array.from([header.value ?
|
|
73
|
+
return Uint8Array.from([header.value ? 0 : 1]);
|
|
74
74
|
case "byte":
|
|
75
|
-
return Uint8Array.from([
|
|
75
|
+
return Uint8Array.from([2, header.value]);
|
|
76
76
|
case "short":
|
|
77
77
|
const shortView = new DataView(new ArrayBuffer(3));
|
|
78
|
-
shortView.setUint8(0,
|
|
78
|
+
shortView.setUint8(0, 3);
|
|
79
79
|
shortView.setInt16(1, header.value, false);
|
|
80
80
|
return new Uint8Array(shortView.buffer);
|
|
81
81
|
case "integer":
|
|
82
82
|
const intView = new DataView(new ArrayBuffer(5));
|
|
83
|
-
intView.setUint8(0,
|
|
83
|
+
intView.setUint8(0, 4);
|
|
84
84
|
intView.setInt32(1, header.value, false);
|
|
85
85
|
return new Uint8Array(intView.buffer);
|
|
86
86
|
case "long":
|
|
87
87
|
const longBytes = new Uint8Array(9);
|
|
88
|
-
longBytes[0] =
|
|
88
|
+
longBytes[0] = 5;
|
|
89
89
|
longBytes.set(header.value.bytes, 1);
|
|
90
90
|
return longBytes;
|
|
91
91
|
case "binary":
|
|
92
92
|
const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength));
|
|
93
|
-
binView.setUint8(0,
|
|
93
|
+
binView.setUint8(0, 6);
|
|
94
94
|
binView.setUint16(1, header.value.byteLength, false);
|
|
95
95
|
const binBytes = new Uint8Array(binView.buffer);
|
|
96
96
|
binBytes.set(header.value, 3);
|
|
@@ -98,14 +98,14 @@ class HeaderMarshaller {
|
|
|
98
98
|
case "string":
|
|
99
99
|
const utf8Bytes = this.fromUtf8(header.value);
|
|
100
100
|
const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength));
|
|
101
|
-
strView.setUint8(0,
|
|
101
|
+
strView.setUint8(0, 7);
|
|
102
102
|
strView.setUint16(1, utf8Bytes.byteLength, false);
|
|
103
103
|
const strBytes = new Uint8Array(strView.buffer);
|
|
104
104
|
strBytes.set(utf8Bytes, 3);
|
|
105
105
|
return strBytes;
|
|
106
106
|
case "timestamp":
|
|
107
107
|
const tsBytes = new Uint8Array(9);
|
|
108
|
-
tsBytes[0] =
|
|
108
|
+
tsBytes[0] = 8;
|
|
109
109
|
tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1);
|
|
110
110
|
return tsBytes;
|
|
111
111
|
case "uuid":
|
|
@@ -113,7 +113,7 @@ class HeaderMarshaller {
|
|
|
113
113
|
throw new Error(`Invalid UUID received: ${header.value}`);
|
|
114
114
|
}
|
|
115
115
|
const uuidBytes = new Uint8Array(17);
|
|
116
|
-
uuidBytes[0] =
|
|
116
|
+
uuidBytes[0] = 9;
|
|
117
117
|
uuidBytes.set(fromHex(header.value.replace(/-/g, "")), 1);
|
|
118
118
|
return uuidBytes;
|
|
119
119
|
}
|
|
@@ -126,46 +126,46 @@ class HeaderMarshaller {
|
|
|
126
126
|
const name = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength));
|
|
127
127
|
position += nameLength;
|
|
128
128
|
switch (headers.getUint8(position++)) {
|
|
129
|
-
case
|
|
129
|
+
case 0:
|
|
130
130
|
out[name] = {
|
|
131
131
|
type: BOOLEAN_TAG,
|
|
132
132
|
value: true,
|
|
133
133
|
};
|
|
134
134
|
break;
|
|
135
|
-
case
|
|
135
|
+
case 1:
|
|
136
136
|
out[name] = {
|
|
137
137
|
type: BOOLEAN_TAG,
|
|
138
138
|
value: false,
|
|
139
139
|
};
|
|
140
140
|
break;
|
|
141
|
-
case
|
|
141
|
+
case 2:
|
|
142
142
|
out[name] = {
|
|
143
143
|
type: BYTE_TAG,
|
|
144
144
|
value: headers.getInt8(position++),
|
|
145
145
|
};
|
|
146
146
|
break;
|
|
147
|
-
case
|
|
147
|
+
case 3:
|
|
148
148
|
out[name] = {
|
|
149
149
|
type: SHORT_TAG,
|
|
150
150
|
value: headers.getInt16(position, false),
|
|
151
151
|
};
|
|
152
152
|
position += 2;
|
|
153
153
|
break;
|
|
154
|
-
case
|
|
154
|
+
case 4:
|
|
155
155
|
out[name] = {
|
|
156
156
|
type: INT_TAG,
|
|
157
157
|
value: headers.getInt32(position, false),
|
|
158
158
|
};
|
|
159
159
|
position += 4;
|
|
160
160
|
break;
|
|
161
|
-
case
|
|
161
|
+
case 5:
|
|
162
162
|
out[name] = {
|
|
163
163
|
type: LONG_TAG,
|
|
164
164
|
value: new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)),
|
|
165
165
|
};
|
|
166
166
|
position += 8;
|
|
167
167
|
break;
|
|
168
|
-
case
|
|
168
|
+
case 6:
|
|
169
169
|
const binaryLength = headers.getUint16(position, false);
|
|
170
170
|
position += 2;
|
|
171
171
|
out[name] = {
|
|
@@ -174,7 +174,7 @@ class HeaderMarshaller {
|
|
|
174
174
|
};
|
|
175
175
|
position += binaryLength;
|
|
176
176
|
break;
|
|
177
|
-
case
|
|
177
|
+
case 7:
|
|
178
178
|
const stringLength = headers.getUint16(position, false);
|
|
179
179
|
position += 2;
|
|
180
180
|
out[name] = {
|
|
@@ -183,14 +183,14 @@ class HeaderMarshaller {
|
|
|
183
183
|
};
|
|
184
184
|
position += stringLength;
|
|
185
185
|
break;
|
|
186
|
-
case
|
|
186
|
+
case 8:
|
|
187
187
|
out[name] = {
|
|
188
188
|
type: TIMESTAMP_TAG,
|
|
189
189
|
value: new Date(new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf()),
|
|
190
190
|
};
|
|
191
191
|
position += 8;
|
|
192
192
|
break;
|
|
193
|
-
case
|
|
193
|
+
case 9:
|
|
194
194
|
const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16);
|
|
195
195
|
position += 16;
|
|
196
196
|
out[name] = {
|
|
@@ -601,7 +601,7 @@ class EventStreamSerde {
|
|
|
601
601
|
this.defaultContentType = defaultContentType;
|
|
602
602
|
this.compositeErrorRegistry = compositeErrorRegistry;
|
|
603
603
|
}
|
|
604
|
-
async serializeEventStream({ eventStream, requestSchema, initialRequest, }) {
|
|
604
|
+
async serializeEventStream({ eventStream, requestSchema, initialRequest, initialMessageType, }) {
|
|
605
605
|
const marshaller = this.marshaller;
|
|
606
606
|
const eventStreamMember = requestSchema.getEventStreamMember();
|
|
607
607
|
const unionSchema = requestSchema.getMemberSchema(eventStreamMember);
|
|
@@ -612,7 +612,7 @@ class EventStreamSerde {
|
|
|
612
612
|
async *[Symbol.asyncIterator]() {
|
|
613
613
|
if (initialRequest) {
|
|
614
614
|
const headers = {
|
|
615
|
-
":event-type": { type: "string", value: "initial-request" },
|
|
615
|
+
":event-type": { type: "string", value: initialMessageType ?? "initial-request" },
|
|
616
616
|
":message-type": { type: "string", value: "event" },
|
|
617
617
|
":content-type": { type: "string", value: defaultContentType },
|
|
618
618
|
};
|
|
@@ -656,7 +656,7 @@ class EventStreamSerde {
|
|
|
656
656
|
};
|
|
657
657
|
});
|
|
658
658
|
}
|
|
659
|
-
async deserializeEventStream({ response, responseSchema, initialResponseContainer, }) {
|
|
659
|
+
async deserializeEventStream({ response, responseSchema, initialResponseContainer, initialMessageType, }) {
|
|
660
660
|
const marshaller = this.marshaller;
|
|
661
661
|
const eventStreamMember = responseSchema.getEventStreamMember();
|
|
662
662
|
const unionSchema = responseSchema.getMemberSchema(eventStreamMember);
|
|
@@ -671,7 +671,7 @@ class EventStreamSerde {
|
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
673
|
const body = event[unionMember].body;
|
|
674
|
-
if (unionMember === "initial-response") {
|
|
674
|
+
if (unionMember === (initialMessageType ?? "initial-response")) {
|
|
675
675
|
const dataObject = await this.deserializer.read(responseSchema, body);
|
|
676
676
|
delete dataObject[eventStreamMember];
|
|
677
677
|
return {
|