@slycode/slycode 0.2.11 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/messaging/index.js +4 -2
- package/dist/messaging/index.js.map +1 -1
- package/dist/messaging/state.js +1 -0
- package/dist/messaging/state.js.map +1 -1
- package/dist/messaging/stt.d.ts +1 -0
- package/dist/messaging/stt.js +66 -57
- package/dist/messaging/stt.js.map +1 -1
- package/dist/messaging/types.d.ts +1 -0
- package/dist/web/.next/BUILD_ID +1 -1
- package/dist/web/.next/build-manifest.json +2 -2
- package/dist/web/.next/node_modules/@aws-sdk/client-s3-ecbef8e33fd0b8f0/dist-cjs/auth/httpAuthSchemeProvider.js +126 -0
- package/dist/web/.next/node_modules/@aws-sdk/client-s3-ecbef8e33fd0b8f0/dist-cjs/endpoint/endpointResolver.js +33 -0
- package/dist/web/.next/node_modules/@aws-sdk/client-s3-ecbef8e33fd0b8f0/dist-cjs/endpoint/ruleset.js +7 -0
- package/dist/web/.next/node_modules/@aws-sdk/client-s3-ecbef8e33fd0b8f0/dist-cjs/index.js +3057 -0
- package/dist/web/.next/node_modules/@aws-sdk/client-s3-ecbef8e33fd0b8f0/dist-cjs/models/S3ServiceException.js +12 -0
- package/dist/web/.next/node_modules/@aws-sdk/client-s3-ecbef8e33fd0b8f0/dist-cjs/models/errors.js +203 -0
- package/dist/web/.next/node_modules/@aws-sdk/client-s3-ecbef8e33fd0b8f0/dist-cjs/runtimeConfig.js +67 -0
- package/dist/web/.next/node_modules/@aws-sdk/client-s3-ecbef8e33fd0b8f0/dist-cjs/runtimeConfig.shared.js +56 -0
- package/dist/web/.next/node_modules/@aws-sdk/client-s3-ecbef8e33fd0b8f0/dist-cjs/schemas/schemas_0.js +3258 -0
- package/dist/web/.next/node_modules/@aws-sdk/client-s3-ecbef8e33fd0b8f0/package.json +127 -0
- package/dist/web/.next/prerender-manifest.json +3 -3
- package/dist/web/.next/server/app/_global-error.html +2 -2
- package/dist/web/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/.next/server/app/_not-found.html +1 -1
- package/dist/web/.next/server/app/_not-found.rsc +1 -1
- package/dist/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dist/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/.next/server/app/api/transcribe/route.js +5 -5
- package/dist/web/.next/server/app/api/transcribe/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/project/[id]/page_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/chunks/[root-of-the-server]__1b9e0d6e._.js +19 -0
- package/dist/web/.next/server/chunks/{[root-of-the-server]__a4d171b5._.js → [root-of-the-server]__4297cb97._.js} +3 -3
- package/dist/web/.next/server/chunks/[root-of-the-server]__52da7fe0._.js +5 -0
- package/dist/web/.next/server/chunks/{[root-of-the-server]__53ef96b9._.js → [root-of-the-server]__cf14e306._.js} +2 -2
- package/dist/web/.next/server/chunks/[root-of-the-server]__d5272169._.js +3 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__d56e68cb._.js +3 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__f5dae2ad._.js +3 -0
- package/dist/web/.next/server/chunks/{node_modules_ec9ae6c4._.js → node_modules_269a84e6._.js} +5 -5
- package/dist/web/.next/server/chunks/node_modules_9fc3887b._.js +3 -0
- package/dist/web/.next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_570f147e.js +3 -0
- package/dist/web/.next/server/chunks/node_modules_@aws-sdk_nested-clients_dist-es_submodules_sts_index_c78619b3.js +1 -1
- package/dist/web/.next/server/chunks/node_modules_@smithy_smithy-client_dist-es_create-aggregated-client_db42850b.js +3 -0
- package/dist/web/.next/server/chunks/node_modules_c58ca22f._.js +3 -0
- package/dist/web/.next/server/chunks/node_modules_f96dfac4._.js +7 -0
- package/dist/web/.next/server/pages/404.html +1 -1
- package/dist/web/.next/server/pages/500.html +2 -2
- package/dist/web/.next/server/server-reference-manifest.js +1 -1
- package/dist/web/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/.next/static/chunks/{0bab8c7c82cef548.js → 17bf7ad67057dc74.js} +1 -1
- package/dist/web/.next/static/chunks/{1b46e836090e130b.js → 29b5d391d655a999.js} +1 -1
- package/dist/web/.next/static/chunks/{345c46e638c28d26.js → 8cb404d087e9f3c7.js} +1 -1
- package/dist/web/.next/static/chunks/{de965b463aff71a9.js → e8b318caa49fce00.js} +1 -1
- package/dist/web/node_modules/@aws/lambda-invoke-store/dist-cjs/invoke-store.js +119 -0
- package/dist/web/node_modules/@aws/lambda-invoke-store/package.json +55 -0
- package/dist/web/node_modules/@aws-crypto/crc32/build/main/aws_crc32.js +31 -0
- package/dist/web/node_modules/@aws-crypto/crc32/build/main/index.js +108 -0
- package/dist/web/node_modules/@aws-crypto/crc32/package.json +32 -0
- package/dist/web/node_modules/@aws-crypto/crc32c/build/main/aws_crc32c.js +31 -0
- package/dist/web/node_modules/@aws-crypto/crc32c/build/main/index.js +78 -0
- package/dist/web/node_modules/@aws-crypto/crc32c/package.json +32 -0
- package/dist/web/node_modules/@aws-crypto/util/build/main/convertToBuffer.js +24 -0
- package/dist/web/node_modules/@aws-crypto/util/build/main/index.js +14 -0
- package/dist/web/node_modules/@aws-crypto/util/build/main/isEmptyData.js +13 -0
- package/dist/web/node_modules/@aws-crypto/util/build/main/numToUint8.js +15 -0
- package/dist/web/node_modules/@aws-crypto/util/build/main/uint32ArrayFrom.js +20 -0
- package/dist/web/node_modules/@aws-crypto/util/node_modules/@smithy/is-array-buffer/dist-cjs/index.js +32 -0
- package/dist/web/node_modules/@aws-crypto/util/node_modules/@smithy/is-array-buffer/package.json +60 -0
- package/dist/web/node_modules/@aws-crypto/util/node_modules/@smithy/util-buffer-from/dist-cjs/index.js +47 -0
- package/dist/web/node_modules/@aws-crypto/util/node_modules/@smithy/util-buffer-from/package.json +61 -0
- package/dist/web/node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-cjs/index.js +65 -0
- package/dist/web/node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/package.json +66 -0
- package/dist/web/node_modules/@aws-crypto/util/package.json +32 -0
- package/dist/web/node_modules/@aws-sdk/client-s3/dist-cjs/auth/httpAuthSchemeProvider.js +126 -0
- package/dist/web/node_modules/@aws-sdk/client-s3/dist-cjs/endpoint/endpointResolver.js +33 -0
- package/dist/web/node_modules/@aws-sdk/client-s3/dist-cjs/endpoint/ruleset.js +7 -0
- package/dist/web/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +3057 -0
- package/dist/web/node_modules/@aws-sdk/client-s3/dist-cjs/models/S3ServiceException.js +12 -0
- package/dist/web/node_modules/@aws-sdk/client-s3/dist-cjs/models/errors.js +203 -0
- package/dist/web/node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.js +67 -0
- package/dist/web/node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.shared.js +56 -0
- package/dist/web/node_modules/@aws-sdk/client-s3/dist-cjs/schemas/schemas_0.js +3258 -0
- package/dist/web/node_modules/@aws-sdk/client-s3/package.json +127 -0
- package/dist/web/node_modules/@aws-sdk/core/dist-cjs/index.js +2212 -0
- package/dist/web/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +51 -0
- package/dist/web/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +307 -0
- package/dist/web/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +1859 -0
- package/dist/web/node_modules/@aws-sdk/core/package.json +121 -0
- package/dist/web/node_modules/@aws-sdk/crc64-nvme/dist-cjs/index.js +101 -0
- package/dist/web/node_modules/@aws-sdk/crc64-nvme/package.json +50 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js +41 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-env/package.json +63 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js +46 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js +70 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js +53 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js +17 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js +5 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-http/package.json +70 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js +224 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-ini/package.json +74 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js +286 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-login/package.json +68 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +156 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-node/package.json +72 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js +79 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-process/package.json +64 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js +192 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-BKDNrsal.js +8 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-sso/package.json +66 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js +34 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js +62 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js +27 -0
- package/dist/web/node_modules/@aws-sdk/credential-provider-web-identity/package.json +73 -0
- package/dist/web/node_modules/@aws-sdk/middleware-bucket-endpoint/dist-cjs/index.js +352 -0
- package/dist/web/node_modules/@aws-sdk/middleware-bucket-endpoint/package.json +60 -0
- package/dist/web/node_modules/@aws-sdk/middleware-expect-continue/dist-cjs/index.js +48 -0
- package/dist/web/node_modules/@aws-sdk/middleware-expect-continue/package.json +58 -0
- package/dist/web/node_modules/@aws-sdk/middleware-flexible-checksums/dist-cjs/getCrc32ChecksumAlgorithmFunction.js +26 -0
- package/dist/web/node_modules/@aws-sdk/middleware-flexible-checksums/dist-cjs/index.js +451 -0
- package/dist/web/node_modules/@aws-sdk/middleware-flexible-checksums/package.json +78 -0
- package/dist/web/node_modules/@aws-sdk/middleware-host-header/dist-cjs/index.js +41 -0
- package/dist/web/node_modules/@aws-sdk/middleware-host-header/package.json +59 -0
- package/dist/web/node_modules/@aws-sdk/middleware-location-constraint/dist-cjs/index.js +30 -0
- package/dist/web/node_modules/@aws-sdk/middleware-location-constraint/package.json +57 -0
- package/dist/web/node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js +48 -0
- package/dist/web/node_modules/@aws-sdk/middleware-logger/package.json +59 -0
- package/dist/web/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js +29 -0
- package/dist/web/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/recursionDetectionMiddleware.js +33 -0
- package/dist/web/node_modules/@aws-sdk/middleware-recursion-detection/package.json +63 -0
- package/dist/web/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/index.js +570 -0
- package/dist/web/node_modules/@aws-sdk/middleware-sdk-s3/package.json +72 -0
- package/dist/web/node_modules/@aws-sdk/middleware-ssec/dist-cjs/index.js +73 -0
- package/dist/web/node_modules/@aws-sdk/middleware-ssec/package.json +57 -0
- package/dist/web/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js +194 -0
- package/dist/web/node_modules/@aws-sdk/middleware-user-agent/package.json +63 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/auth/httpAuthSchemeProvider.js +56 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/endpoint/endpointResolver.js +18 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/endpoint/ruleset.js +133 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +170 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/models/SigninServiceException.js +12 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/models/errors.js +64 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/runtimeConfig.js +53 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/runtimeConfig.shared.js +49 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/schemas/schemas_0.js +125 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/auth/httpAuthSchemeProvider.js +56 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/endpoint/endpointResolver.js +18 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/endpoint/ruleset.js +106 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +160 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/models/SSOServiceException.js +12 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/models/errors.js +56 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/runtimeConfig.js +53 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/runtimeConfig.shared.js +49 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/schemas/schemas_0.js +90 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/auth/httpAuthSchemeProvider.js +56 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/endpoint/endpointResolver.js +18 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/endpoint/ruleset.js +106 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +172 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/models/SSOOIDCServiceException.js +12 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/models/errors.js +195 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/runtimeConfig.js +53 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/runtimeConfig.shared.js +49 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/schemas/schemas_0.js +140 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/STSClient.js +54 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/auth/httpAuthExtensionConfiguration.js +43 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/auth/httpAuthSchemeProvider.js +62 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/endpoint/EndpointParameters.js +19 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/endpoint/endpointResolver.js +18 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/endpoint/ruleset.js +145 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +202 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/models/STSServiceException.js +12 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/models/errors.js +95 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeConfig.js +67 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeConfig.shared.js +50 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeExtensions.js +13 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/schemas/schemas_0.js +195 -0
- package/dist/web/node_modules/@aws-sdk/nested-clients/package.json +147 -0
- package/dist/web/node_modules/@aws-sdk/region-config-resolver/dist-cjs/index.js +38 -0
- package/dist/web/node_modules/@aws-sdk/region-config-resolver/dist-cjs/regionConfig/stsRegionDefaultResolver.js +20 -0
- package/dist/web/node_modules/@aws-sdk/region-config-resolver/package.json +62 -0
- package/dist/web/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js +121 -0
- package/dist/web/node_modules/@aws-sdk/signature-v4-multi-region/package.json +61 -0
- package/dist/web/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +157 -0
- package/dist/web/node_modules/@aws-sdk/token-providers/package.json +70 -0
- package/dist/web/node_modules/@aws-sdk/util-arn-parser/dist-cjs/index.js +27 -0
- package/dist/web/node_modules/@aws-sdk/util-arn-parser/package.json +55 -0
- package/dist/web/node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js +406 -0
- package/dist/web/node_modules/@aws-sdk/util-endpoints/package.json +60 -0
- package/dist/web/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js +185 -0
- package/dist/web/node_modules/@aws-sdk/util-user-agent-node/package.json +69 -0
- package/dist/web/node_modules/@aws-sdk/xml-builder/dist-cjs/index.js +131 -0
- package/dist/web/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js +23 -0
- package/dist/web/node_modules/@aws-sdk/xml-builder/package.json +63 -0
- package/dist/web/node_modules/@smithy/config-resolver/dist-cjs/index.js +198 -0
- package/dist/web/node_modules/@smithy/config-resolver/package.json +66 -0
- package/dist/web/node_modules/@smithy/core/dist-cjs/index.js +345 -0
- package/dist/web/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +1096 -0
- package/dist/web/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +22 -0
- package/dist/web/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +259 -0
- package/dist/web/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +884 -0
- package/dist/web/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +698 -0
- package/dist/web/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +694 -0
- package/dist/web/node_modules/@smithy/core/package.json +146 -0
- package/dist/web/node_modules/@smithy/credential-provider-imds/dist-cjs/index.js +372 -0
- package/dist/web/node_modules/@smithy/credential-provider-imds/package.json +70 -0
- package/dist/web/node_modules/@smithy/eventstream-codec/dist-cjs/index.js +388 -0
- package/dist/web/node_modules/@smithy/eventstream-codec/package.json +65 -0
- package/dist/web/node_modules/@smithy/eventstream-serde-config-resolver/dist-cjs/index.js +7 -0
- package/dist/web/node_modules/@smithy/eventstream-serde-config-resolver/package.json +62 -0
- package/dist/web/node_modules/@smithy/eventstream-serde-node/dist-cjs/index.js +53 -0
- package/dist/web/node_modules/@smithy/eventstream-serde-node/package.json +62 -0
- package/dist/web/node_modules/@smithy/eventstream-serde-universal/dist-cjs/index.js +132 -0
- package/dist/web/node_modules/@smithy/eventstream-serde-universal/package.json +66 -0
- package/dist/web/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +233 -0
- package/dist/web/node_modules/@smithy/fetch-http-handler/package.json +69 -0
- package/dist/web/node_modules/@smithy/hash-node/dist-cjs/index.js +42 -0
- package/dist/web/node_modules/@smithy/hash-node/package.json +65 -0
- package/dist/web/node_modules/@smithy/hash-stream-node/dist-cjs/index.js +67 -0
- package/dist/web/node_modules/@smithy/hash-stream-node/package.json +65 -0
- package/dist/web/node_modules/@smithy/is-array-buffer/dist-cjs/index.js +6 -0
- package/dist/web/node_modules/@smithy/is-array-buffer/package.json +61 -0
- package/dist/web/node_modules/@smithy/middleware-content-length/dist-cjs/index.js +46 -0
- package/dist/web/node_modules/@smithy/middleware-content-length/package.json +64 -0
- package/dist/web/node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js +7 -0
- package/dist/web/node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointUrlConfig.js +35 -0
- package/dist/web/node_modules/@smithy/middleware-endpoint/dist-cjs/index.js +264 -0
- package/dist/web/node_modules/@smithy/middleware-endpoint/package.json +75 -0
- package/dist/web/node_modules/@smithy/middleware-retry/dist-cjs/index.js +355 -0
- package/dist/web/node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.js +7 -0
- package/dist/web/node_modules/@smithy/middleware-retry/package.json +79 -0
- package/dist/web/node_modules/@smithy/middleware-serde/dist-cjs/index.js +104 -0
- package/dist/web/node_modules/@smithy/middleware-serde/package.json +66 -0
- package/dist/web/node_modules/@smithy/middleware-stack/dist-cjs/index.js +285 -0
- package/dist/web/node_modules/@smithy/middleware-stack/package.json +64 -0
- package/dist/web/node_modules/@smithy/node-config-provider/dist-cjs/index.js +62 -0
- package/dist/web/node_modules/@smithy/node-config-provider/package.json +66 -0
- package/dist/web/node_modules/@smithy/node-http-handler/dist-cjs/index.js +762 -0
- package/dist/web/node_modules/@smithy/node-http-handler/package.json +68 -0
- package/dist/web/node_modules/@smithy/property-provider/dist-cjs/index.js +117 -0
- package/dist/web/node_modules/@smithy/property-provider/package.json +61 -0
- package/dist/web/node_modules/@smithy/protocol-http/dist-cjs/index.js +169 -0
- package/dist/web/node_modules/@smithy/protocol-http/package.json +62 -0
- package/dist/web/node_modules/@smithy/querystring-builder/dist-cjs/index.js +26 -0
- package/dist/web/node_modules/@smithy/querystring-builder/package.json +61 -0
- package/dist/web/node_modules/@smithy/querystring-parser/dist-cjs/index.js +27 -0
- package/dist/web/node_modules/@smithy/querystring-parser/package.json +61 -0
- package/dist/web/node_modules/@smithy/service-error-classification/dist-cjs/index.js +77 -0
- package/dist/web/node_modules/@smithy/service-error-classification/package.json +60 -0
- package/dist/web/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js +26 -0
- package/dist/web/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js +12 -0
- package/dist/web/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js +15 -0
- package/dist/web/node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js +196 -0
- package/dist/web/node_modules/@smithy/shared-ini-file-loader/dist-cjs/readFile.js +16 -0
- package/dist/web/node_modules/@smithy/shared-ini-file-loader/package.json +73 -0
- package/dist/web/node_modules/@smithy/signature-v4/dist-cjs/index.js +556 -0
- package/dist/web/node_modules/@smithy/signature-v4/package.json +70 -0
- package/dist/web/node_modules/@smithy/smithy-client/dist-cjs/index.js +635 -0
- package/dist/web/node_modules/@smithy/smithy-client/package.json +70 -0
- package/dist/web/node_modules/@smithy/types/dist-cjs/index.js +91 -0
- package/dist/web/node_modules/@smithy/types/package.json +61 -0
- package/dist/web/node_modules/@smithy/url-parser/dist-cjs/index.js +23 -0
- package/dist/web/node_modules/@smithy/url-parser/package.json +62 -0
- package/dist/web/node_modules/@smithy/util-base64/dist-cjs/fromBase64.js +16 -0
- package/dist/web/node_modules/@smithy/util-base64/dist-cjs/index.js +27 -0
- package/dist/web/node_modules/@smithy/util-base64/dist-cjs/toBase64.js +19 -0
- package/dist/web/node_modules/@smithy/util-base64/package.json +74 -0
- package/dist/web/node_modules/@smithy/util-body-length-browser/dist-cjs/index.js +30 -0
- package/dist/web/node_modules/@smithy/util-body-length-browser/package.json +61 -0
- package/dist/web/node_modules/@smithy/util-body-length-node/dist-cjs/index.js +32 -0
- package/dist/web/node_modules/@smithy/util-body-length-node/package.json +62 -0
- package/dist/web/node_modules/@smithy/util-buffer-from/dist-cjs/index.js +20 -0
- package/dist/web/node_modules/@smithy/util-buffer-from/package.json +62 -0
- package/dist/web/node_modules/@smithy/util-config-provider/dist-cjs/index.js +30 -0
- package/dist/web/node_modules/@smithy/util-config-provider/package.json +63 -0
- package/dist/web/node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js +74 -0
- package/dist/web/node_modules/@smithy/util-defaults-mode-node/package.json +67 -0
- package/dist/web/node_modules/@smithy/util-endpoints/dist-cjs/index.js +472 -0
- package/dist/web/node_modules/@smithy/util-endpoints/package.json +69 -0
- package/dist/web/node_modules/@smithy/util-hex-encoding/dist-cjs/index.js +38 -0
- package/dist/web/node_modules/@smithy/util-hex-encoding/package.json +61 -0
- package/dist/web/node_modules/@smithy/util-middleware/dist-cjs/index.js +15 -0
- package/dist/web/node_modules/@smithy/util-middleware/package.json +67 -0
- package/dist/web/node_modules/@smithy/util-retry/dist-cjs/index.js +278 -0
- package/dist/web/node_modules/@smithy/util-retry/package.json +71 -0
- package/dist/web/node_modules/@smithy/util-stream/dist-cjs/ByteArrayCollector.js +36 -0
- package/dist/web/node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.browser.js +7 -0
- package/dist/web/node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.js +64 -0
- package/dist/web/node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.browser.js +39 -0
- package/dist/web/node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.js +12 -0
- package/dist/web/node_modules/@smithy/util-stream/dist-cjs/createBufferedReadable.js +60 -0
- package/dist/web/node_modules/@smithy/util-stream/dist-cjs/createBufferedReadableStream.js +103 -0
- package/dist/web/node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.browser.js +31 -0
- package/dist/web/node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js +41 -0
- package/dist/web/node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js +34 -0
- package/dist/web/node_modules/@smithy/util-stream/dist-cjs/headStream.js +42 -0
- package/dist/web/node_modules/@smithy/util-stream/dist-cjs/index.js +108 -0
- package/dist/web/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js +68 -0
- package/dist/web/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js +54 -0
- package/dist/web/node_modules/@smithy/util-stream/dist-cjs/splitStream.browser.js +10 -0
- package/dist/web/node_modules/@smithy/util-stream/dist-cjs/splitStream.js +16 -0
- package/dist/web/node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js +10 -0
- package/dist/web/node_modules/@smithy/util-stream/package.json +99 -0
- package/dist/web/node_modules/@smithy/util-uri-escape/dist-cjs/index.js +9 -0
- package/dist/web/node_modules/@smithy/util-uri-escape/package.json +60 -0
- package/dist/web/node_modules/@smithy/util-utf8/dist-cjs/index.js +32 -0
- package/dist/web/node_modules/@smithy/util-utf8/package.json +67 -0
- package/dist/web/node_modules/@smithy/util-waiter/dist-cjs/index.js +179 -0
- package/dist/web/node_modules/@smithy/util-waiter/package.json +63 -0
- package/dist/web/node_modules/@smithy/uuid/dist-cjs/index.js +36 -0
- package/dist/web/node_modules/@smithy/uuid/dist-cjs/randomUUID.js +6 -0
- package/dist/web/node_modules/@smithy/uuid/package.json +66 -0
- package/dist/web/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
- package/dist/web/node_modules/fast-xml-parser/package.json +94 -0
- package/dist/web/node_modules/tslib/package.json +47 -0
- package/dist/web/node_modules/tslib/tslib.js +484 -0
- package/dist/web/package-lock.json +433 -161
- package/dist/web/package.json +2 -1
- package/dist/web/src/app/api/transcribe/route.ts +84 -74
- package/dist/web/tsconfig.tsbuildinfo +1 -1
- package/lib/cli/stop.d.ts.map +1 -1
- package/lib/cli/stop.js +38 -18
- package/lib/cli/stop.js.map +1 -1
- package/package.json +1 -1
- package/templates/kanban-seed.json +1 -1
- package/dist/web/.next/server/chunks/[root-of-the-server]__0f8687da._.js +0 -3
- package/dist/web/.next/server/chunks/[root-of-the-server]__0f9b71fd._.js +0 -5
- package/dist/web/.next/server/chunks/[root-of-the-server]__1dec5018._.js +0 -3
- package/dist/web/.next/server/chunks/[root-of-the-server]__2605d761._.js +0 -9
- package/dist/web/.next/server/chunks/[root-of-the-server]__8ce673c9._.js +0 -3
- package/dist/web/.next/server/chunks/[root-of-the-server]__a43db24d._.js +0 -19
- package/dist/web/.next/server/chunks/[root-of-the-server]__c7ac3578._.js +0 -5
- package/dist/web/.next/server/chunks/a9bf9_@aws-sdk_core_dist-es_submodules_protocols_json_AwsRestJsonProtocol_764d7a83.js +0 -3
- /package/dist/web/.next/static/{eGpcv9LfmamGIm1II8SKL → 5LMWBFPioBVfTpJ4F5OT6}/_buildManifest.js +0 -0
- /package/dist/web/.next/static/{eGpcv9LfmamGIm1II8SKL → 5LMWBFPioBVfTpJ4F5OT6}/_clientMiddlewareManifest.json +0 -0
- /package/dist/web/.next/static/{eGpcv9LfmamGIm1II8SKL → 5LMWBFPioBVfTpJ4F5OT6}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,1096 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var serde = require('@smithy/core/serde');
|
|
4
|
+
var utilUtf8 = require('@smithy/util-utf8');
|
|
5
|
+
var protocols = require('@smithy/core/protocols');
|
|
6
|
+
var protocolHttp = require('@smithy/protocol-http');
|
|
7
|
+
var utilBodyLengthBrowser = require('@smithy/util-body-length-browser');
|
|
8
|
+
var schema = require('@smithy/core/schema');
|
|
9
|
+
var utilMiddleware = require('@smithy/util-middleware');
|
|
10
|
+
var utilBase64 = require('@smithy/util-base64');
|
|
11
|
+
|
|
12
|
+
const majorUint64 = 0;
|
|
13
|
+
const majorNegativeInt64 = 1;
|
|
14
|
+
const majorUnstructuredByteString = 2;
|
|
15
|
+
const majorUtf8String = 3;
|
|
16
|
+
const majorList = 4;
|
|
17
|
+
const majorMap = 5;
|
|
18
|
+
const majorTag = 6;
|
|
19
|
+
const majorSpecial = 7;
|
|
20
|
+
const specialFalse = 20;
|
|
21
|
+
const specialTrue = 21;
|
|
22
|
+
const specialNull = 22;
|
|
23
|
+
const specialUndefined = 23;
|
|
24
|
+
const extendedOneByte = 24;
|
|
25
|
+
const extendedFloat16 = 25;
|
|
26
|
+
const extendedFloat32 = 26;
|
|
27
|
+
const extendedFloat64 = 27;
|
|
28
|
+
const minorIndefinite = 31;
|
|
29
|
+
function alloc(size) {
|
|
30
|
+
return typeof Buffer !== "undefined" ? Buffer.alloc(size) : new Uint8Array(size);
|
|
31
|
+
}
|
|
32
|
+
const tagSymbol = Symbol("@smithy/core/cbor::tagSymbol");
|
|
33
|
+
function tag(data) {
|
|
34
|
+
data[tagSymbol] = true;
|
|
35
|
+
return data;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const USE_TEXT_DECODER = typeof TextDecoder !== "undefined";
|
|
39
|
+
const USE_BUFFER$1 = typeof Buffer !== "undefined";
|
|
40
|
+
let payload = alloc(0);
|
|
41
|
+
let dataView$1 = new DataView(payload.buffer, payload.byteOffset, payload.byteLength);
|
|
42
|
+
const textDecoder = USE_TEXT_DECODER ? new TextDecoder() : null;
|
|
43
|
+
let _offset = 0;
|
|
44
|
+
function setPayload(bytes) {
|
|
45
|
+
payload = bytes;
|
|
46
|
+
dataView$1 = new DataView(payload.buffer, payload.byteOffset, payload.byteLength);
|
|
47
|
+
}
|
|
48
|
+
function decode(at, to) {
|
|
49
|
+
if (at >= to) {
|
|
50
|
+
throw new Error("unexpected end of (decode) payload.");
|
|
51
|
+
}
|
|
52
|
+
const major = (payload[at] & 0b1110_0000) >> 5;
|
|
53
|
+
const minor = payload[at] & 0b0001_1111;
|
|
54
|
+
switch (major) {
|
|
55
|
+
case majorUint64:
|
|
56
|
+
case majorNegativeInt64:
|
|
57
|
+
case majorTag:
|
|
58
|
+
let unsignedInt;
|
|
59
|
+
let offset;
|
|
60
|
+
if (minor < 24) {
|
|
61
|
+
unsignedInt = minor;
|
|
62
|
+
offset = 1;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
switch (minor) {
|
|
66
|
+
case extendedOneByte:
|
|
67
|
+
case extendedFloat16:
|
|
68
|
+
case extendedFloat32:
|
|
69
|
+
case extendedFloat64:
|
|
70
|
+
const countLength = minorValueToArgumentLength[minor];
|
|
71
|
+
const countOffset = (countLength + 1);
|
|
72
|
+
offset = countOffset;
|
|
73
|
+
if (to - at < countOffset) {
|
|
74
|
+
throw new Error(`countLength ${countLength} greater than remaining buf len.`);
|
|
75
|
+
}
|
|
76
|
+
const countIndex = at + 1;
|
|
77
|
+
if (countLength === 1) {
|
|
78
|
+
unsignedInt = payload[countIndex];
|
|
79
|
+
}
|
|
80
|
+
else if (countLength === 2) {
|
|
81
|
+
unsignedInt = dataView$1.getUint16(countIndex);
|
|
82
|
+
}
|
|
83
|
+
else if (countLength === 4) {
|
|
84
|
+
unsignedInt = dataView$1.getUint32(countIndex);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
unsignedInt = dataView$1.getBigUint64(countIndex);
|
|
88
|
+
}
|
|
89
|
+
break;
|
|
90
|
+
default:
|
|
91
|
+
throw new Error(`unexpected minor value ${minor}.`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (major === majorUint64) {
|
|
95
|
+
_offset = offset;
|
|
96
|
+
return castBigInt(unsignedInt);
|
|
97
|
+
}
|
|
98
|
+
else if (major === majorNegativeInt64) {
|
|
99
|
+
let negativeInt;
|
|
100
|
+
if (typeof unsignedInt === "bigint") {
|
|
101
|
+
negativeInt = BigInt(-1) - unsignedInt;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
negativeInt = -1 - unsignedInt;
|
|
105
|
+
}
|
|
106
|
+
_offset = offset;
|
|
107
|
+
return castBigInt(negativeInt);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
if (minor === 2 || minor === 3) {
|
|
111
|
+
const length = decodeCount(at + offset, to);
|
|
112
|
+
let b = BigInt(0);
|
|
113
|
+
const start = at + offset + _offset;
|
|
114
|
+
for (let i = start; i < start + length; ++i) {
|
|
115
|
+
b = (b << BigInt(8)) | BigInt(payload[i]);
|
|
116
|
+
}
|
|
117
|
+
_offset = offset + _offset + length;
|
|
118
|
+
return minor === 3 ? -b - BigInt(1) : b;
|
|
119
|
+
}
|
|
120
|
+
else if (minor === 4) {
|
|
121
|
+
const decimalFraction = decode(at + offset, to);
|
|
122
|
+
const [exponent, mantissa] = decimalFraction;
|
|
123
|
+
const normalizer = mantissa < 0 ? -1 : 1;
|
|
124
|
+
const mantissaStr = "0".repeat(Math.abs(exponent) + 1) + String(BigInt(normalizer) * BigInt(mantissa));
|
|
125
|
+
let numericString;
|
|
126
|
+
const sign = mantissa < 0 ? "-" : "";
|
|
127
|
+
numericString =
|
|
128
|
+
exponent === 0
|
|
129
|
+
? mantissaStr
|
|
130
|
+
: mantissaStr.slice(0, mantissaStr.length + exponent) + "." + mantissaStr.slice(exponent);
|
|
131
|
+
numericString = numericString.replace(/^0+/g, "");
|
|
132
|
+
if (numericString === "") {
|
|
133
|
+
numericString = "0";
|
|
134
|
+
}
|
|
135
|
+
if (numericString[0] === ".") {
|
|
136
|
+
numericString = "0" + numericString;
|
|
137
|
+
}
|
|
138
|
+
numericString = sign + numericString;
|
|
139
|
+
_offset = offset + _offset;
|
|
140
|
+
return serde.nv(numericString);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
const value = decode(at + offset, to);
|
|
144
|
+
const valueOffset = _offset;
|
|
145
|
+
_offset = offset + valueOffset;
|
|
146
|
+
return tag({ tag: castBigInt(unsignedInt), value });
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
case majorUtf8String:
|
|
150
|
+
case majorMap:
|
|
151
|
+
case majorList:
|
|
152
|
+
case majorUnstructuredByteString:
|
|
153
|
+
if (minor === minorIndefinite) {
|
|
154
|
+
switch (major) {
|
|
155
|
+
case majorUtf8String:
|
|
156
|
+
return decodeUtf8StringIndefinite(at, to);
|
|
157
|
+
case majorMap:
|
|
158
|
+
return decodeMapIndefinite(at, to);
|
|
159
|
+
case majorList:
|
|
160
|
+
return decodeListIndefinite(at, to);
|
|
161
|
+
case majorUnstructuredByteString:
|
|
162
|
+
return decodeUnstructuredByteStringIndefinite(at, to);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
switch (major) {
|
|
167
|
+
case majorUtf8String:
|
|
168
|
+
return decodeUtf8String(at, to);
|
|
169
|
+
case majorMap:
|
|
170
|
+
return decodeMap(at, to);
|
|
171
|
+
case majorList:
|
|
172
|
+
return decodeList(at, to);
|
|
173
|
+
case majorUnstructuredByteString:
|
|
174
|
+
return decodeUnstructuredByteString(at, to);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
default:
|
|
178
|
+
return decodeSpecial(at, to);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function bytesToUtf8(bytes, at, to) {
|
|
182
|
+
if (USE_BUFFER$1 && bytes.constructor?.name === "Buffer") {
|
|
183
|
+
return bytes.toString("utf-8", at, to);
|
|
184
|
+
}
|
|
185
|
+
if (textDecoder) {
|
|
186
|
+
return textDecoder.decode(bytes.subarray(at, to));
|
|
187
|
+
}
|
|
188
|
+
return utilUtf8.toUtf8(bytes.subarray(at, to));
|
|
189
|
+
}
|
|
190
|
+
function demote(bigInteger) {
|
|
191
|
+
const num = Number(bigInteger);
|
|
192
|
+
if (num < Number.MIN_SAFE_INTEGER || Number.MAX_SAFE_INTEGER < num) {
|
|
193
|
+
console.warn(new Error(`@smithy/core/cbor - truncating BigInt(${bigInteger}) to ${num} with loss of precision.`));
|
|
194
|
+
}
|
|
195
|
+
return num;
|
|
196
|
+
}
|
|
197
|
+
const minorValueToArgumentLength = {
|
|
198
|
+
[extendedOneByte]: 1,
|
|
199
|
+
[extendedFloat16]: 2,
|
|
200
|
+
[extendedFloat32]: 4,
|
|
201
|
+
[extendedFloat64]: 8,
|
|
202
|
+
};
|
|
203
|
+
function bytesToFloat16(a, b) {
|
|
204
|
+
const sign = a >> 7;
|
|
205
|
+
const exponent = (a & 0b0111_1100) >> 2;
|
|
206
|
+
const fraction = ((a & 0b0000_0011) << 8) | b;
|
|
207
|
+
const scalar = sign === 0 ? 1 : -1;
|
|
208
|
+
let exponentComponent;
|
|
209
|
+
let summation;
|
|
210
|
+
if (exponent === 0b00000) {
|
|
211
|
+
if (fraction === 0b00000_00000) {
|
|
212
|
+
return 0;
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
exponentComponent = Math.pow(2, 1 - 15);
|
|
216
|
+
summation = 0;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
else if (exponent === 0b11111) {
|
|
220
|
+
if (fraction === 0b00000_00000) {
|
|
221
|
+
return scalar * Infinity;
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
return NaN;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
exponentComponent = Math.pow(2, exponent - 15);
|
|
229
|
+
summation = 1;
|
|
230
|
+
}
|
|
231
|
+
summation += fraction / 1024;
|
|
232
|
+
return scalar * (exponentComponent * summation);
|
|
233
|
+
}
|
|
234
|
+
function decodeCount(at, to) {
|
|
235
|
+
const minor = payload[at] & 0b0001_1111;
|
|
236
|
+
if (minor < 24) {
|
|
237
|
+
_offset = 1;
|
|
238
|
+
return minor;
|
|
239
|
+
}
|
|
240
|
+
if (minor === extendedOneByte ||
|
|
241
|
+
minor === extendedFloat16 ||
|
|
242
|
+
minor === extendedFloat32 ||
|
|
243
|
+
minor === extendedFloat64) {
|
|
244
|
+
const countLength = minorValueToArgumentLength[minor];
|
|
245
|
+
_offset = (countLength + 1);
|
|
246
|
+
if (to - at < _offset) {
|
|
247
|
+
throw new Error(`countLength ${countLength} greater than remaining buf len.`);
|
|
248
|
+
}
|
|
249
|
+
const countIndex = at + 1;
|
|
250
|
+
if (countLength === 1) {
|
|
251
|
+
return payload[countIndex];
|
|
252
|
+
}
|
|
253
|
+
else if (countLength === 2) {
|
|
254
|
+
return dataView$1.getUint16(countIndex);
|
|
255
|
+
}
|
|
256
|
+
else if (countLength === 4) {
|
|
257
|
+
return dataView$1.getUint32(countIndex);
|
|
258
|
+
}
|
|
259
|
+
return demote(dataView$1.getBigUint64(countIndex));
|
|
260
|
+
}
|
|
261
|
+
throw new Error(`unexpected minor value ${minor}.`);
|
|
262
|
+
}
|
|
263
|
+
function decodeUtf8String(at, to) {
|
|
264
|
+
const length = decodeCount(at, to);
|
|
265
|
+
const offset = _offset;
|
|
266
|
+
at += offset;
|
|
267
|
+
if (to - at < length) {
|
|
268
|
+
throw new Error(`string len ${length} greater than remaining buf len.`);
|
|
269
|
+
}
|
|
270
|
+
const value = bytesToUtf8(payload, at, at + length);
|
|
271
|
+
_offset = offset + length;
|
|
272
|
+
return value;
|
|
273
|
+
}
|
|
274
|
+
function decodeUtf8StringIndefinite(at, to) {
|
|
275
|
+
at += 1;
|
|
276
|
+
const vector = [];
|
|
277
|
+
for (const base = at; at < to;) {
|
|
278
|
+
if (payload[at] === 0b1111_1111) {
|
|
279
|
+
const data = alloc(vector.length);
|
|
280
|
+
data.set(vector, 0);
|
|
281
|
+
_offset = at - base + 2;
|
|
282
|
+
return bytesToUtf8(data, 0, data.length);
|
|
283
|
+
}
|
|
284
|
+
const major = (payload[at] & 0b1110_0000) >> 5;
|
|
285
|
+
const minor = payload[at] & 0b0001_1111;
|
|
286
|
+
if (major !== majorUtf8String) {
|
|
287
|
+
throw new Error(`unexpected major type ${major} in indefinite string.`);
|
|
288
|
+
}
|
|
289
|
+
if (minor === minorIndefinite) {
|
|
290
|
+
throw new Error("nested indefinite string.");
|
|
291
|
+
}
|
|
292
|
+
const bytes = decodeUnstructuredByteString(at, to);
|
|
293
|
+
const length = _offset;
|
|
294
|
+
at += length;
|
|
295
|
+
for (let i = 0; i < bytes.length; ++i) {
|
|
296
|
+
vector.push(bytes[i]);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
throw new Error("expected break marker.");
|
|
300
|
+
}
|
|
301
|
+
function decodeUnstructuredByteString(at, to) {
|
|
302
|
+
const length = decodeCount(at, to);
|
|
303
|
+
const offset = _offset;
|
|
304
|
+
at += offset;
|
|
305
|
+
if (to - at < length) {
|
|
306
|
+
throw new Error(`unstructured byte string len ${length} greater than remaining buf len.`);
|
|
307
|
+
}
|
|
308
|
+
const value = payload.subarray(at, at + length);
|
|
309
|
+
_offset = offset + length;
|
|
310
|
+
return value;
|
|
311
|
+
}
|
|
312
|
+
function decodeUnstructuredByteStringIndefinite(at, to) {
|
|
313
|
+
at += 1;
|
|
314
|
+
const vector = [];
|
|
315
|
+
for (const base = at; at < to;) {
|
|
316
|
+
if (payload[at] === 0b1111_1111) {
|
|
317
|
+
const data = alloc(vector.length);
|
|
318
|
+
data.set(vector, 0);
|
|
319
|
+
_offset = at - base + 2;
|
|
320
|
+
return data;
|
|
321
|
+
}
|
|
322
|
+
const major = (payload[at] & 0b1110_0000) >> 5;
|
|
323
|
+
const minor = payload[at] & 0b0001_1111;
|
|
324
|
+
if (major !== majorUnstructuredByteString) {
|
|
325
|
+
throw new Error(`unexpected major type ${major} in indefinite string.`);
|
|
326
|
+
}
|
|
327
|
+
if (minor === minorIndefinite) {
|
|
328
|
+
throw new Error("nested indefinite string.");
|
|
329
|
+
}
|
|
330
|
+
const bytes = decodeUnstructuredByteString(at, to);
|
|
331
|
+
const length = _offset;
|
|
332
|
+
at += length;
|
|
333
|
+
for (let i = 0; i < bytes.length; ++i) {
|
|
334
|
+
vector.push(bytes[i]);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
throw new Error("expected break marker.");
|
|
338
|
+
}
|
|
339
|
+
function decodeList(at, to) {
|
|
340
|
+
const listDataLength = decodeCount(at, to);
|
|
341
|
+
const offset = _offset;
|
|
342
|
+
at += offset;
|
|
343
|
+
const base = at;
|
|
344
|
+
const list = Array(listDataLength);
|
|
345
|
+
for (let i = 0; i < listDataLength; ++i) {
|
|
346
|
+
const item = decode(at, to);
|
|
347
|
+
const itemOffset = _offset;
|
|
348
|
+
list[i] = item;
|
|
349
|
+
at += itemOffset;
|
|
350
|
+
}
|
|
351
|
+
_offset = offset + (at - base);
|
|
352
|
+
return list;
|
|
353
|
+
}
|
|
354
|
+
function decodeListIndefinite(at, to) {
|
|
355
|
+
at += 1;
|
|
356
|
+
const list = [];
|
|
357
|
+
for (const base = at; at < to;) {
|
|
358
|
+
if (payload[at] === 0b1111_1111) {
|
|
359
|
+
_offset = at - base + 2;
|
|
360
|
+
return list;
|
|
361
|
+
}
|
|
362
|
+
const item = decode(at, to);
|
|
363
|
+
const n = _offset;
|
|
364
|
+
at += n;
|
|
365
|
+
list.push(item);
|
|
366
|
+
}
|
|
367
|
+
throw new Error("expected break marker.");
|
|
368
|
+
}
|
|
369
|
+
function decodeMap(at, to) {
|
|
370
|
+
const mapDataLength = decodeCount(at, to);
|
|
371
|
+
const offset = _offset;
|
|
372
|
+
at += offset;
|
|
373
|
+
const base = at;
|
|
374
|
+
const map = {};
|
|
375
|
+
for (let i = 0; i < mapDataLength; ++i) {
|
|
376
|
+
if (at >= to) {
|
|
377
|
+
throw new Error("unexpected end of map payload.");
|
|
378
|
+
}
|
|
379
|
+
const major = (payload[at] & 0b1110_0000) >> 5;
|
|
380
|
+
if (major !== majorUtf8String) {
|
|
381
|
+
throw new Error(`unexpected major type ${major} for map key at index ${at}.`);
|
|
382
|
+
}
|
|
383
|
+
const key = decode(at, to);
|
|
384
|
+
at += _offset;
|
|
385
|
+
const value = decode(at, to);
|
|
386
|
+
at += _offset;
|
|
387
|
+
map[key] = value;
|
|
388
|
+
}
|
|
389
|
+
_offset = offset + (at - base);
|
|
390
|
+
return map;
|
|
391
|
+
}
|
|
392
|
+
function decodeMapIndefinite(at, to) {
|
|
393
|
+
at += 1;
|
|
394
|
+
const base = at;
|
|
395
|
+
const map = {};
|
|
396
|
+
for (; at < to;) {
|
|
397
|
+
if (at >= to) {
|
|
398
|
+
throw new Error("unexpected end of map payload.");
|
|
399
|
+
}
|
|
400
|
+
if (payload[at] === 0b1111_1111) {
|
|
401
|
+
_offset = at - base + 2;
|
|
402
|
+
return map;
|
|
403
|
+
}
|
|
404
|
+
const major = (payload[at] & 0b1110_0000) >> 5;
|
|
405
|
+
if (major !== majorUtf8String) {
|
|
406
|
+
throw new Error(`unexpected major type ${major} for map key.`);
|
|
407
|
+
}
|
|
408
|
+
const key = decode(at, to);
|
|
409
|
+
at += _offset;
|
|
410
|
+
const value = decode(at, to);
|
|
411
|
+
at += _offset;
|
|
412
|
+
map[key] = value;
|
|
413
|
+
}
|
|
414
|
+
throw new Error("expected break marker.");
|
|
415
|
+
}
|
|
416
|
+
function decodeSpecial(at, to) {
|
|
417
|
+
const minor = payload[at] & 0b0001_1111;
|
|
418
|
+
switch (minor) {
|
|
419
|
+
case specialTrue:
|
|
420
|
+
case specialFalse:
|
|
421
|
+
_offset = 1;
|
|
422
|
+
return minor === specialTrue;
|
|
423
|
+
case specialNull:
|
|
424
|
+
_offset = 1;
|
|
425
|
+
return null;
|
|
426
|
+
case specialUndefined:
|
|
427
|
+
_offset = 1;
|
|
428
|
+
return null;
|
|
429
|
+
case extendedFloat16:
|
|
430
|
+
if (to - at < 3) {
|
|
431
|
+
throw new Error("incomplete float16 at end of buf.");
|
|
432
|
+
}
|
|
433
|
+
_offset = 3;
|
|
434
|
+
return bytesToFloat16(payload[at + 1], payload[at + 2]);
|
|
435
|
+
case extendedFloat32:
|
|
436
|
+
if (to - at < 5) {
|
|
437
|
+
throw new Error("incomplete float32 at end of buf.");
|
|
438
|
+
}
|
|
439
|
+
_offset = 5;
|
|
440
|
+
return dataView$1.getFloat32(at + 1);
|
|
441
|
+
case extendedFloat64:
|
|
442
|
+
if (to - at < 9) {
|
|
443
|
+
throw new Error("incomplete float64 at end of buf.");
|
|
444
|
+
}
|
|
445
|
+
_offset = 9;
|
|
446
|
+
return dataView$1.getFloat64(at + 1);
|
|
447
|
+
default:
|
|
448
|
+
throw new Error(`unexpected minor value ${minor}.`);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
function castBigInt(bigInt) {
|
|
452
|
+
if (typeof bigInt === "number") {
|
|
453
|
+
return bigInt;
|
|
454
|
+
}
|
|
455
|
+
const num = Number(bigInt);
|
|
456
|
+
if (Number.MIN_SAFE_INTEGER <= num && num <= Number.MAX_SAFE_INTEGER) {
|
|
457
|
+
return num;
|
|
458
|
+
}
|
|
459
|
+
return bigInt;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
const USE_BUFFER = typeof Buffer !== "undefined";
|
|
463
|
+
const initialSize = 2048;
|
|
464
|
+
let data = alloc(initialSize);
|
|
465
|
+
let dataView = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
466
|
+
let cursor = 0;
|
|
467
|
+
function ensureSpace(bytes) {
|
|
468
|
+
const remaining = data.byteLength - cursor;
|
|
469
|
+
if (remaining < bytes) {
|
|
470
|
+
if (cursor < 16_000_000) {
|
|
471
|
+
resize(Math.max(data.byteLength * 4, data.byteLength + bytes));
|
|
472
|
+
}
|
|
473
|
+
else {
|
|
474
|
+
resize(data.byteLength + bytes + 16_000_000);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
function toUint8Array() {
|
|
479
|
+
const out = alloc(cursor);
|
|
480
|
+
out.set(data.subarray(0, cursor), 0);
|
|
481
|
+
cursor = 0;
|
|
482
|
+
return out;
|
|
483
|
+
}
|
|
484
|
+
function resize(size) {
|
|
485
|
+
const old = data;
|
|
486
|
+
data = alloc(size);
|
|
487
|
+
if (old) {
|
|
488
|
+
if (old.copy) {
|
|
489
|
+
old.copy(data, 0, 0, old.byteLength);
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
data.set(old, 0);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
dataView = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
496
|
+
}
|
|
497
|
+
function encodeHeader(major, value) {
|
|
498
|
+
if (value < 24) {
|
|
499
|
+
data[cursor++] = (major << 5) | value;
|
|
500
|
+
}
|
|
501
|
+
else if (value < 1 << 8) {
|
|
502
|
+
data[cursor++] = (major << 5) | 24;
|
|
503
|
+
data[cursor++] = value;
|
|
504
|
+
}
|
|
505
|
+
else if (value < 1 << 16) {
|
|
506
|
+
data[cursor++] = (major << 5) | extendedFloat16;
|
|
507
|
+
dataView.setUint16(cursor, value);
|
|
508
|
+
cursor += 2;
|
|
509
|
+
}
|
|
510
|
+
else if (value < 2 ** 32) {
|
|
511
|
+
data[cursor++] = (major << 5) | extendedFloat32;
|
|
512
|
+
dataView.setUint32(cursor, value);
|
|
513
|
+
cursor += 4;
|
|
514
|
+
}
|
|
515
|
+
else {
|
|
516
|
+
data[cursor++] = (major << 5) | extendedFloat64;
|
|
517
|
+
dataView.setBigUint64(cursor, typeof value === "bigint" ? value : BigInt(value));
|
|
518
|
+
cursor += 8;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
function encode(_input) {
|
|
522
|
+
const encodeStack = [_input];
|
|
523
|
+
while (encodeStack.length) {
|
|
524
|
+
const input = encodeStack.pop();
|
|
525
|
+
ensureSpace(typeof input === "string" ? input.length * 4 : 64);
|
|
526
|
+
if (typeof input === "string") {
|
|
527
|
+
if (USE_BUFFER) {
|
|
528
|
+
encodeHeader(majorUtf8String, Buffer.byteLength(input));
|
|
529
|
+
cursor += data.write(input, cursor);
|
|
530
|
+
}
|
|
531
|
+
else {
|
|
532
|
+
const bytes = utilUtf8.fromUtf8(input);
|
|
533
|
+
encodeHeader(majorUtf8String, bytes.byteLength);
|
|
534
|
+
data.set(bytes, cursor);
|
|
535
|
+
cursor += bytes.byteLength;
|
|
536
|
+
}
|
|
537
|
+
continue;
|
|
538
|
+
}
|
|
539
|
+
else if (typeof input === "number") {
|
|
540
|
+
if (Number.isInteger(input)) {
|
|
541
|
+
const nonNegative = input >= 0;
|
|
542
|
+
const major = nonNegative ? majorUint64 : majorNegativeInt64;
|
|
543
|
+
const value = nonNegative ? input : -input - 1;
|
|
544
|
+
if (value < 24) {
|
|
545
|
+
data[cursor++] = (major << 5) | value;
|
|
546
|
+
}
|
|
547
|
+
else if (value < 256) {
|
|
548
|
+
data[cursor++] = (major << 5) | 24;
|
|
549
|
+
data[cursor++] = value;
|
|
550
|
+
}
|
|
551
|
+
else if (value < 65536) {
|
|
552
|
+
data[cursor++] = (major << 5) | extendedFloat16;
|
|
553
|
+
data[cursor++] = value >> 8;
|
|
554
|
+
data[cursor++] = value;
|
|
555
|
+
}
|
|
556
|
+
else if (value < 4294967296) {
|
|
557
|
+
data[cursor++] = (major << 5) | extendedFloat32;
|
|
558
|
+
dataView.setUint32(cursor, value);
|
|
559
|
+
cursor += 4;
|
|
560
|
+
}
|
|
561
|
+
else {
|
|
562
|
+
data[cursor++] = (major << 5) | extendedFloat64;
|
|
563
|
+
dataView.setBigUint64(cursor, BigInt(value));
|
|
564
|
+
cursor += 8;
|
|
565
|
+
}
|
|
566
|
+
continue;
|
|
567
|
+
}
|
|
568
|
+
data[cursor++] = (majorSpecial << 5) | extendedFloat64;
|
|
569
|
+
dataView.setFloat64(cursor, input);
|
|
570
|
+
cursor += 8;
|
|
571
|
+
continue;
|
|
572
|
+
}
|
|
573
|
+
else if (typeof input === "bigint") {
|
|
574
|
+
const nonNegative = input >= 0;
|
|
575
|
+
const major = nonNegative ? majorUint64 : majorNegativeInt64;
|
|
576
|
+
const value = nonNegative ? input : -input - BigInt(1);
|
|
577
|
+
const n = Number(value);
|
|
578
|
+
if (n < 24) {
|
|
579
|
+
data[cursor++] = (major << 5) | n;
|
|
580
|
+
}
|
|
581
|
+
else if (n < 256) {
|
|
582
|
+
data[cursor++] = (major << 5) | 24;
|
|
583
|
+
data[cursor++] = n;
|
|
584
|
+
}
|
|
585
|
+
else if (n < 65536) {
|
|
586
|
+
data[cursor++] = (major << 5) | extendedFloat16;
|
|
587
|
+
data[cursor++] = n >> 8;
|
|
588
|
+
data[cursor++] = n & 0b1111_1111;
|
|
589
|
+
}
|
|
590
|
+
else if (n < 4294967296) {
|
|
591
|
+
data[cursor++] = (major << 5) | extendedFloat32;
|
|
592
|
+
dataView.setUint32(cursor, n);
|
|
593
|
+
cursor += 4;
|
|
594
|
+
}
|
|
595
|
+
else if (value < BigInt("18446744073709551616")) {
|
|
596
|
+
data[cursor++] = (major << 5) | extendedFloat64;
|
|
597
|
+
dataView.setBigUint64(cursor, value);
|
|
598
|
+
cursor += 8;
|
|
599
|
+
}
|
|
600
|
+
else {
|
|
601
|
+
const binaryBigInt = value.toString(2);
|
|
602
|
+
const bigIntBytes = new Uint8Array(Math.ceil(binaryBigInt.length / 8));
|
|
603
|
+
let b = value;
|
|
604
|
+
let i = 0;
|
|
605
|
+
while (bigIntBytes.byteLength - ++i >= 0) {
|
|
606
|
+
bigIntBytes[bigIntBytes.byteLength - i] = Number(b & BigInt(255));
|
|
607
|
+
b >>= BigInt(8);
|
|
608
|
+
}
|
|
609
|
+
ensureSpace(bigIntBytes.byteLength * 2);
|
|
610
|
+
data[cursor++] = nonNegative ? 0b110_00010 : 0b110_00011;
|
|
611
|
+
if (USE_BUFFER) {
|
|
612
|
+
encodeHeader(majorUnstructuredByteString, Buffer.byteLength(bigIntBytes));
|
|
613
|
+
}
|
|
614
|
+
else {
|
|
615
|
+
encodeHeader(majorUnstructuredByteString, bigIntBytes.byteLength);
|
|
616
|
+
}
|
|
617
|
+
data.set(bigIntBytes, cursor);
|
|
618
|
+
cursor += bigIntBytes.byteLength;
|
|
619
|
+
}
|
|
620
|
+
continue;
|
|
621
|
+
}
|
|
622
|
+
else if (input === null) {
|
|
623
|
+
data[cursor++] = (majorSpecial << 5) | specialNull;
|
|
624
|
+
continue;
|
|
625
|
+
}
|
|
626
|
+
else if (typeof input === "boolean") {
|
|
627
|
+
data[cursor++] = (majorSpecial << 5) | (input ? specialTrue : specialFalse);
|
|
628
|
+
continue;
|
|
629
|
+
}
|
|
630
|
+
else if (typeof input === "undefined") {
|
|
631
|
+
throw new Error("@smithy/core/cbor: client may not serialize undefined value.");
|
|
632
|
+
}
|
|
633
|
+
else if (Array.isArray(input)) {
|
|
634
|
+
for (let i = input.length - 1; i >= 0; --i) {
|
|
635
|
+
encodeStack.push(input[i]);
|
|
636
|
+
}
|
|
637
|
+
encodeHeader(majorList, input.length);
|
|
638
|
+
continue;
|
|
639
|
+
}
|
|
640
|
+
else if (typeof input.byteLength === "number") {
|
|
641
|
+
ensureSpace(input.length * 2);
|
|
642
|
+
encodeHeader(majorUnstructuredByteString, input.length);
|
|
643
|
+
data.set(input, cursor);
|
|
644
|
+
cursor += input.byteLength;
|
|
645
|
+
continue;
|
|
646
|
+
}
|
|
647
|
+
else if (typeof input === "object") {
|
|
648
|
+
if (input instanceof serde.NumericValue) {
|
|
649
|
+
const decimalIndex = input.string.indexOf(".");
|
|
650
|
+
const exponent = decimalIndex === -1 ? 0 : decimalIndex - input.string.length + 1;
|
|
651
|
+
const mantissa = BigInt(input.string.replace(".", ""));
|
|
652
|
+
data[cursor++] = 0b110_00100;
|
|
653
|
+
encodeStack.push(mantissa);
|
|
654
|
+
encodeStack.push(exponent);
|
|
655
|
+
encodeHeader(majorList, 2);
|
|
656
|
+
continue;
|
|
657
|
+
}
|
|
658
|
+
if (input[tagSymbol]) {
|
|
659
|
+
if ("tag" in input && "value" in input) {
|
|
660
|
+
encodeStack.push(input.value);
|
|
661
|
+
encodeHeader(majorTag, input.tag);
|
|
662
|
+
continue;
|
|
663
|
+
}
|
|
664
|
+
else {
|
|
665
|
+
throw new Error("tag encountered with missing fields, need 'tag' and 'value', found: " + JSON.stringify(input));
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
const keys = Object.keys(input);
|
|
669
|
+
for (let i = keys.length - 1; i >= 0; --i) {
|
|
670
|
+
const key = keys[i];
|
|
671
|
+
encodeStack.push(input[key]);
|
|
672
|
+
encodeStack.push(key);
|
|
673
|
+
}
|
|
674
|
+
encodeHeader(majorMap, keys.length);
|
|
675
|
+
continue;
|
|
676
|
+
}
|
|
677
|
+
throw new Error(`data type ${input?.constructor?.name ?? typeof input} not compatible for encoding.`);
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
const cbor = {
|
|
682
|
+
deserialize(payload) {
|
|
683
|
+
setPayload(payload);
|
|
684
|
+
return decode(0, payload.length);
|
|
685
|
+
},
|
|
686
|
+
serialize(input) {
|
|
687
|
+
try {
|
|
688
|
+
encode(input);
|
|
689
|
+
return toUint8Array();
|
|
690
|
+
}
|
|
691
|
+
catch (e) {
|
|
692
|
+
toUint8Array();
|
|
693
|
+
throw e;
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
resizeEncodingBuffer(size) {
|
|
697
|
+
resize(size);
|
|
698
|
+
},
|
|
699
|
+
};
|
|
700
|
+
|
|
701
|
+
const parseCborBody = (streamBody, context) => {
|
|
702
|
+
return protocols.collectBody(streamBody, context).then(async (bytes) => {
|
|
703
|
+
if (bytes.length) {
|
|
704
|
+
try {
|
|
705
|
+
return cbor.deserialize(bytes);
|
|
706
|
+
}
|
|
707
|
+
catch (e) {
|
|
708
|
+
Object.defineProperty(e, "$responseBodyText", {
|
|
709
|
+
value: context.utf8Encoder(bytes),
|
|
710
|
+
});
|
|
711
|
+
throw e;
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
return {};
|
|
715
|
+
});
|
|
716
|
+
};
|
|
717
|
+
const dateToTag = (date) => {
|
|
718
|
+
return tag({
|
|
719
|
+
tag: 1,
|
|
720
|
+
value: date.getTime() / 1000,
|
|
721
|
+
});
|
|
722
|
+
};
|
|
723
|
+
const parseCborErrorBody = async (errorBody, context) => {
|
|
724
|
+
const value = await parseCborBody(errorBody, context);
|
|
725
|
+
value.message = value.message ?? value.Message;
|
|
726
|
+
return value;
|
|
727
|
+
};
|
|
728
|
+
const loadSmithyRpcV2CborErrorCode = (output, data) => {
|
|
729
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
730
|
+
let cleanValue = rawValue;
|
|
731
|
+
if (typeof cleanValue === "number") {
|
|
732
|
+
cleanValue = cleanValue.toString();
|
|
733
|
+
}
|
|
734
|
+
if (cleanValue.indexOf(",") >= 0) {
|
|
735
|
+
cleanValue = cleanValue.split(",")[0];
|
|
736
|
+
}
|
|
737
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
738
|
+
cleanValue = cleanValue.split(":")[0];
|
|
739
|
+
}
|
|
740
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
741
|
+
cleanValue = cleanValue.split("#")[1];
|
|
742
|
+
}
|
|
743
|
+
return cleanValue;
|
|
744
|
+
};
|
|
745
|
+
if (data["__type"] !== undefined) {
|
|
746
|
+
return sanitizeErrorCode(data["__type"]);
|
|
747
|
+
}
|
|
748
|
+
const codeKey = Object.keys(data).find((key) => key.toLowerCase() === "code");
|
|
749
|
+
if (codeKey && data[codeKey] !== undefined) {
|
|
750
|
+
return sanitizeErrorCode(data[codeKey]);
|
|
751
|
+
}
|
|
752
|
+
};
|
|
753
|
+
const checkCborResponse = (response) => {
|
|
754
|
+
if (String(response.headers["smithy-protocol"]).toLowerCase() !== "rpc-v2-cbor") {
|
|
755
|
+
throw new Error("Malformed RPCv2 CBOR response, status: " + response.statusCode);
|
|
756
|
+
}
|
|
757
|
+
};
|
|
758
|
+
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
759
|
+
const endpoint = await context.endpoint();
|
|
760
|
+
const { hostname, protocol = "https", port, path: basePath } = endpoint;
|
|
761
|
+
const contents = {
|
|
762
|
+
protocol,
|
|
763
|
+
hostname,
|
|
764
|
+
port,
|
|
765
|
+
method: "POST",
|
|
766
|
+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
|
|
767
|
+
headers: {
|
|
768
|
+
...headers,
|
|
769
|
+
},
|
|
770
|
+
};
|
|
771
|
+
if (resolvedHostname !== undefined) {
|
|
772
|
+
contents.hostname = resolvedHostname;
|
|
773
|
+
}
|
|
774
|
+
if (endpoint.headers) {
|
|
775
|
+
for (const [name, value] of Object.entries(endpoint.headers)) {
|
|
776
|
+
contents.headers[name] = value;
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
if (body !== undefined) {
|
|
780
|
+
contents.body = body;
|
|
781
|
+
try {
|
|
782
|
+
contents.headers["content-length"] = String(utilBodyLengthBrowser.calculateBodyLength(body));
|
|
783
|
+
}
|
|
784
|
+
catch (e) { }
|
|
785
|
+
}
|
|
786
|
+
return new protocolHttp.HttpRequest(contents);
|
|
787
|
+
};
|
|
788
|
+
|
|
789
|
+
class CborCodec extends protocols.SerdeContext {
|
|
790
|
+
createSerializer() {
|
|
791
|
+
const serializer = new CborShapeSerializer();
|
|
792
|
+
serializer.setSerdeContext(this.serdeContext);
|
|
793
|
+
return serializer;
|
|
794
|
+
}
|
|
795
|
+
createDeserializer() {
|
|
796
|
+
const deserializer = new CborShapeDeserializer();
|
|
797
|
+
deserializer.setSerdeContext(this.serdeContext);
|
|
798
|
+
return deserializer;
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
class CborShapeSerializer extends protocols.SerdeContext {
|
|
802
|
+
value;
|
|
803
|
+
write(schema, value) {
|
|
804
|
+
this.value = this.serialize(schema, value);
|
|
805
|
+
}
|
|
806
|
+
serialize(schema$1, source) {
|
|
807
|
+
const ns = schema.NormalizedSchema.of(schema$1);
|
|
808
|
+
if (source == null) {
|
|
809
|
+
if (ns.isIdempotencyToken()) {
|
|
810
|
+
return serde.generateIdempotencyToken();
|
|
811
|
+
}
|
|
812
|
+
return source;
|
|
813
|
+
}
|
|
814
|
+
if (ns.isBlobSchema()) {
|
|
815
|
+
if (typeof source === "string") {
|
|
816
|
+
return (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(source);
|
|
817
|
+
}
|
|
818
|
+
return source;
|
|
819
|
+
}
|
|
820
|
+
if (ns.isTimestampSchema()) {
|
|
821
|
+
if (typeof source === "number" || typeof source === "bigint") {
|
|
822
|
+
return dateToTag(new Date((Number(source) / 1000) | 0));
|
|
823
|
+
}
|
|
824
|
+
return dateToTag(source);
|
|
825
|
+
}
|
|
826
|
+
if (typeof source === "function" || typeof source === "object") {
|
|
827
|
+
const sourceObject = source;
|
|
828
|
+
if (ns.isListSchema() && Array.isArray(sourceObject)) {
|
|
829
|
+
const sparse = !!ns.getMergedTraits().sparse;
|
|
830
|
+
const newArray = [];
|
|
831
|
+
let i = 0;
|
|
832
|
+
for (const item of sourceObject) {
|
|
833
|
+
const value = this.serialize(ns.getValueSchema(), item);
|
|
834
|
+
if (value != null || sparse) {
|
|
835
|
+
newArray[i++] = value;
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
return newArray;
|
|
839
|
+
}
|
|
840
|
+
if (sourceObject instanceof Date) {
|
|
841
|
+
return dateToTag(sourceObject);
|
|
842
|
+
}
|
|
843
|
+
const newObject = {};
|
|
844
|
+
if (ns.isMapSchema()) {
|
|
845
|
+
const sparse = !!ns.getMergedTraits().sparse;
|
|
846
|
+
for (const key of Object.keys(sourceObject)) {
|
|
847
|
+
const value = this.serialize(ns.getValueSchema(), sourceObject[key]);
|
|
848
|
+
if (value != null || sparse) {
|
|
849
|
+
newObject[key] = value;
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
else if (ns.isStructSchema()) {
|
|
854
|
+
for (const [key, memberSchema] of ns.structIterator()) {
|
|
855
|
+
const value = this.serialize(memberSchema, sourceObject[key]);
|
|
856
|
+
if (value != null) {
|
|
857
|
+
newObject[key] = value;
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
const isUnion = ns.isUnionSchema();
|
|
861
|
+
if (isUnion && Array.isArray(sourceObject.$unknown)) {
|
|
862
|
+
const [k, v] = sourceObject.$unknown;
|
|
863
|
+
newObject[k] = v;
|
|
864
|
+
}
|
|
865
|
+
else if (typeof sourceObject.__type === "string") {
|
|
866
|
+
for (const [k, v] of Object.entries(sourceObject)) {
|
|
867
|
+
if (!(k in newObject)) {
|
|
868
|
+
newObject[k] = this.serialize(15, v);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
else if (ns.isDocumentSchema()) {
|
|
874
|
+
for (const key of Object.keys(sourceObject)) {
|
|
875
|
+
newObject[key] = this.serialize(ns.getValueSchema(), sourceObject[key]);
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
else if (ns.isBigDecimalSchema()) {
|
|
879
|
+
return sourceObject;
|
|
880
|
+
}
|
|
881
|
+
return newObject;
|
|
882
|
+
}
|
|
883
|
+
return source;
|
|
884
|
+
}
|
|
885
|
+
flush() {
|
|
886
|
+
const buffer = cbor.serialize(this.value);
|
|
887
|
+
this.value = undefined;
|
|
888
|
+
return buffer;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
class CborShapeDeserializer extends protocols.SerdeContext {
|
|
892
|
+
read(schema, bytes) {
|
|
893
|
+
const data = cbor.deserialize(bytes);
|
|
894
|
+
return this.readValue(schema, data);
|
|
895
|
+
}
|
|
896
|
+
readValue(_schema, value) {
|
|
897
|
+
const ns = schema.NormalizedSchema.of(_schema);
|
|
898
|
+
if (ns.isTimestampSchema()) {
|
|
899
|
+
if (typeof value === "number") {
|
|
900
|
+
return serde._parseEpochTimestamp(value);
|
|
901
|
+
}
|
|
902
|
+
if (typeof value === "object") {
|
|
903
|
+
if (value.tag === 1 && "value" in value) {
|
|
904
|
+
return serde._parseEpochTimestamp(value.value);
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
if (ns.isBlobSchema()) {
|
|
909
|
+
if (typeof value === "string") {
|
|
910
|
+
return (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(value);
|
|
911
|
+
}
|
|
912
|
+
return value;
|
|
913
|
+
}
|
|
914
|
+
if (typeof value === "undefined" ||
|
|
915
|
+
typeof value === "boolean" ||
|
|
916
|
+
typeof value === "number" ||
|
|
917
|
+
typeof value === "string" ||
|
|
918
|
+
typeof value === "bigint" ||
|
|
919
|
+
typeof value === "symbol") {
|
|
920
|
+
return value;
|
|
921
|
+
}
|
|
922
|
+
else if (typeof value === "object") {
|
|
923
|
+
if (value === null) {
|
|
924
|
+
return null;
|
|
925
|
+
}
|
|
926
|
+
if ("byteLength" in value) {
|
|
927
|
+
return value;
|
|
928
|
+
}
|
|
929
|
+
if (value instanceof Date) {
|
|
930
|
+
return value;
|
|
931
|
+
}
|
|
932
|
+
if (ns.isDocumentSchema()) {
|
|
933
|
+
return value;
|
|
934
|
+
}
|
|
935
|
+
if (ns.isListSchema()) {
|
|
936
|
+
const newArray = [];
|
|
937
|
+
const memberSchema = ns.getValueSchema();
|
|
938
|
+
for (const item of value) {
|
|
939
|
+
const itemValue = this.readValue(memberSchema, item);
|
|
940
|
+
newArray.push(itemValue);
|
|
941
|
+
}
|
|
942
|
+
return newArray;
|
|
943
|
+
}
|
|
944
|
+
const newObject = {};
|
|
945
|
+
if (ns.isMapSchema()) {
|
|
946
|
+
const targetSchema = ns.getValueSchema();
|
|
947
|
+
for (const key of Object.keys(value)) {
|
|
948
|
+
const itemValue = this.readValue(targetSchema, value[key]);
|
|
949
|
+
newObject[key] = itemValue;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
else if (ns.isStructSchema()) {
|
|
953
|
+
const isUnion = ns.isUnionSchema();
|
|
954
|
+
let keys;
|
|
955
|
+
if (isUnion) {
|
|
956
|
+
keys = new Set(Object.keys(value).filter((k) => k !== "__type"));
|
|
957
|
+
}
|
|
958
|
+
for (const [key, memberSchema] of ns.structIterator()) {
|
|
959
|
+
if (isUnion) {
|
|
960
|
+
keys.delete(key);
|
|
961
|
+
}
|
|
962
|
+
if (value[key] != null) {
|
|
963
|
+
newObject[key] = this.readValue(memberSchema, value[key]);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
if (isUnion && keys?.size === 1 && Object.keys(newObject).length === 0) {
|
|
967
|
+
const k = keys.values().next().value;
|
|
968
|
+
newObject.$unknown = [k, value[k]];
|
|
969
|
+
}
|
|
970
|
+
else if (typeof value.__type === "string") {
|
|
971
|
+
for (const [k, v] of Object.entries(value)) {
|
|
972
|
+
if (!(k in newObject)) {
|
|
973
|
+
newObject[k] = v;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
else if (value instanceof serde.NumericValue) {
|
|
979
|
+
return value;
|
|
980
|
+
}
|
|
981
|
+
return newObject;
|
|
982
|
+
}
|
|
983
|
+
else {
|
|
984
|
+
return value;
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
class SmithyRpcV2CborProtocol extends protocols.RpcProtocol {
|
|
990
|
+
codec = new CborCodec();
|
|
991
|
+
serializer = this.codec.createSerializer();
|
|
992
|
+
deserializer = this.codec.createDeserializer();
|
|
993
|
+
constructor({ defaultNamespace, errorTypeRegistries, }) {
|
|
994
|
+
super({ defaultNamespace, errorTypeRegistries });
|
|
995
|
+
}
|
|
996
|
+
getShapeId() {
|
|
997
|
+
return "smithy.protocols#rpcv2Cbor";
|
|
998
|
+
}
|
|
999
|
+
getPayloadCodec() {
|
|
1000
|
+
return this.codec;
|
|
1001
|
+
}
|
|
1002
|
+
async serializeRequest(operationSchema, input, context) {
|
|
1003
|
+
const request = await super.serializeRequest(operationSchema, input, context);
|
|
1004
|
+
Object.assign(request.headers, {
|
|
1005
|
+
"content-type": this.getDefaultContentType(),
|
|
1006
|
+
"smithy-protocol": "rpc-v2-cbor",
|
|
1007
|
+
accept: this.getDefaultContentType(),
|
|
1008
|
+
});
|
|
1009
|
+
if (schema.deref(operationSchema.input) === "unit") {
|
|
1010
|
+
delete request.body;
|
|
1011
|
+
delete request.headers["content-type"];
|
|
1012
|
+
}
|
|
1013
|
+
else {
|
|
1014
|
+
if (!request.body) {
|
|
1015
|
+
this.serializer.write(15, {});
|
|
1016
|
+
request.body = this.serializer.flush();
|
|
1017
|
+
}
|
|
1018
|
+
try {
|
|
1019
|
+
request.headers["content-length"] = String(request.body.byteLength);
|
|
1020
|
+
}
|
|
1021
|
+
catch (e) { }
|
|
1022
|
+
}
|
|
1023
|
+
const { service, operation } = utilMiddleware.getSmithyContext(context);
|
|
1024
|
+
const path = `/service/${service}/operation/${operation}`;
|
|
1025
|
+
if (request.path.endsWith("/")) {
|
|
1026
|
+
request.path += path.slice(1);
|
|
1027
|
+
}
|
|
1028
|
+
else {
|
|
1029
|
+
request.path += path;
|
|
1030
|
+
}
|
|
1031
|
+
return request;
|
|
1032
|
+
}
|
|
1033
|
+
async deserializeResponse(operationSchema, context, response) {
|
|
1034
|
+
return super.deserializeResponse(operationSchema, context, response);
|
|
1035
|
+
}
|
|
1036
|
+
async handleError(operationSchema, context, response, dataObject, metadata) {
|
|
1037
|
+
const errorName = loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown";
|
|
1038
|
+
const errorMetadata = {
|
|
1039
|
+
$metadata: metadata,
|
|
1040
|
+
$fault: response.statusCode <= 500 ? "client" : "server",
|
|
1041
|
+
};
|
|
1042
|
+
let namespace = this.options.defaultNamespace;
|
|
1043
|
+
if (errorName.includes("#")) {
|
|
1044
|
+
[namespace] = errorName.split("#");
|
|
1045
|
+
}
|
|
1046
|
+
const registry = this.compositeErrorRegistry;
|
|
1047
|
+
const nsRegistry = schema.TypeRegistry.for(namespace);
|
|
1048
|
+
registry.copyFrom(nsRegistry);
|
|
1049
|
+
let errorSchema;
|
|
1050
|
+
try {
|
|
1051
|
+
errorSchema = registry.getSchema(errorName);
|
|
1052
|
+
}
|
|
1053
|
+
catch (e) {
|
|
1054
|
+
if (dataObject.Message) {
|
|
1055
|
+
dataObject.message = dataObject.Message;
|
|
1056
|
+
}
|
|
1057
|
+
const syntheticRegistry = schema.TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace);
|
|
1058
|
+
registry.copyFrom(syntheticRegistry);
|
|
1059
|
+
const baseExceptionSchema = registry.getBaseException();
|
|
1060
|
+
if (baseExceptionSchema) {
|
|
1061
|
+
const ErrorCtor = registry.getErrorCtor(baseExceptionSchema);
|
|
1062
|
+
throw Object.assign(new ErrorCtor({ name: errorName }), errorMetadata, dataObject);
|
|
1063
|
+
}
|
|
1064
|
+
throw Object.assign(new Error(errorName), errorMetadata, dataObject);
|
|
1065
|
+
}
|
|
1066
|
+
const ns = schema.NormalizedSchema.of(errorSchema);
|
|
1067
|
+
const ErrorCtor = registry.getErrorCtor(errorSchema);
|
|
1068
|
+
const message = dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
1069
|
+
const exception = new ErrorCtor(message);
|
|
1070
|
+
const output = {};
|
|
1071
|
+
for (const [name, member] of ns.structIterator()) {
|
|
1072
|
+
output[name] = this.deserializer.readValue(member, dataObject[name]);
|
|
1073
|
+
}
|
|
1074
|
+
throw Object.assign(exception, errorMetadata, {
|
|
1075
|
+
$fault: ns.getMergedTraits().error,
|
|
1076
|
+
message,
|
|
1077
|
+
}, output);
|
|
1078
|
+
}
|
|
1079
|
+
getDefaultContentType() {
|
|
1080
|
+
return "application/cbor";
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
exports.CborCodec = CborCodec;
|
|
1085
|
+
exports.CborShapeDeserializer = CborShapeDeserializer;
|
|
1086
|
+
exports.CborShapeSerializer = CborShapeSerializer;
|
|
1087
|
+
exports.SmithyRpcV2CborProtocol = SmithyRpcV2CborProtocol;
|
|
1088
|
+
exports.buildHttpRpcRequest = buildHttpRpcRequest;
|
|
1089
|
+
exports.cbor = cbor;
|
|
1090
|
+
exports.checkCborResponse = checkCborResponse;
|
|
1091
|
+
exports.dateToTag = dateToTag;
|
|
1092
|
+
exports.loadSmithyRpcV2CborErrorCode = loadSmithyRpcV2CborErrorCode;
|
|
1093
|
+
exports.parseCborBody = parseCborBody;
|
|
1094
|
+
exports.parseCborErrorBody = parseCborErrorBody;
|
|
1095
|
+
exports.tag = tag;
|
|
1096
|
+
exports.tagSymbol = tagSymbol;
|