@cdklabs/cdk-construct-connect-datalake 0.0.19 → 0.0.21
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/.jsii +9 -9
- package/.jsii.tabl.json +1 -1
- package/lib/index.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/index.js +2 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/models/enums.js +1 -0
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/commands/DescribeChangeSetCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/models/enums.d.ts +1 -0
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/models/models_0.d.ts +7 -3
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/models/enums.d.ts +1 -0
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/client-cloudformation/package.json +6 -6
- package/node_modules/@aws-sdk/client-connect/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-connect/dist-types/commands/AssociateContactWithUserCommand.d.ts +5 -1
- package/node_modules/@aws-sdk/client-connect/dist-types/models/models_0.d.ts +11 -3
- package/node_modules/@aws-sdk/client-connect/dist-types/models/models_2.d.ts +3 -1
- package/node_modules/@aws-sdk/client-connect/dist-types/models/models_3.d.ts +9 -2
- package/node_modules/@aws-sdk/client-connect/dist-types/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/client-connect/dist-types/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/client-connect/dist-types/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/client-connect/dist-types/ts3.4/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/client-connect/dist-types/ts3.4/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/client-connect/dist-types/ts3.4/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/client-connect/package.json +6 -6
- package/node_modules/@aws-sdk/client-glue/README.md +7 -0
- package/node_modules/@aws-sdk/client-glue/dist-cjs/index.js +295 -118
- package/node_modules/@aws-sdk/client-glue/dist-es/Glue.js +2 -0
- package/node_modules/@aws-sdk/client-glue/dist-es/commands/BatchGetDataQualityRulesetEvaluationRunCommand.js +4 -0
- package/node_modules/@aws-sdk/client-glue/dist-es/commands/index.js +1 -0
- package/node_modules/@aws-sdk/client-glue/dist-es/models/enums.js +30 -13
- package/node_modules/@aws-sdk/client-glue/dist-es/schemas/schemas_0.js +243 -104
- package/node_modules/@aws-sdk/client-glue/dist-types/Glue.d.ts +7 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/GlueClient.d.ts +3 -2
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/BatchGetDataQualityResultCommand.d.ts +11 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/BatchGetDataQualityRulesetEvaluationRunCommand.d.ts +202 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/CreateClassifierCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/CreateColumnStatisticsTaskSettingsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/CreateConnectionCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/CreateCrawlerCommand.d.ts +1 -2
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/DescribeConnectionTypeCommand.d.ts +68 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/GetDataCatalogEncryptionSettingsCommand.d.ts +2 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/GetDataQualityModelCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/GetDataQualityModelResultCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/GetDataQualityResultCommand.d.ts +12 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/GetDataQualityRuleRecommendationRunCommand.d.ts +4 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/GetDataQualityRulesetCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/GetDataQualityRulesetEvaluationRunCommand.d.ts +48 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/GetDataflowGraphCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/ListDataQualityRuleRecommendationRunsCommand.d.ts +4 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/ListDataQualityStatisticsCommand.d.ts +9 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/RegisterConnectionTypeCommand.d.ts +67 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/SearchAssetsCommand.d.ts +1 -2
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/SearchTablesCommand.d.ts +1 -2
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/StartBlueprintRunCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/StartColumnStatisticsTaskRunCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/StartColumnStatisticsTaskRunScheduleCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/StartCrawlerCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/StartDataQualityRuleRecommendationRunCommand.d.ts +3 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/StartDataQualityRulesetEvaluationRunCommand.d.ts +48 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/commands/index.d.ts +1 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/models/enums.d.ts +78 -29
- package/node_modules/@aws-sdk/client-glue/dist-types/models/models_0.d.ts +305 -439
- package/node_modules/@aws-sdk/client-glue/dist-types/models/models_1.d.ts +3890 -3703
- package/node_modules/@aws-sdk/client-glue/dist-types/models/models_2.d.ts +416 -308
- package/node_modules/@aws-sdk/client-glue/dist-types/models/models_3.d.ts +301 -4
- package/node_modules/@aws-sdk/client-glue/dist-types/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/schemas/schemas_0.d.ts +16 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/Glue.d.ts +17 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/GlueClient.d.ts +6 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/BatchGetDataQualityRulesetEvaluationRunCommand.d.ts +42 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/CreateClassifierCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/CreateColumnStatisticsTaskSettingsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/CreateConnectionCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/CreateCrawlerCommand.d.ts +1 -2
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/GetDataCatalogEncryptionSettingsCommand.d.ts +2 -4
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/GetDataQualityModelCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/GetDataQualityModelResultCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/GetDataQualityResultCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/GetDataQualityRuleRecommendationRunCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/GetDataQualityRulesetCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/GetDataflowGraphCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/SearchAssetsCommand.d.ts +1 -2
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/SearchTablesCommand.d.ts +1 -2
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/StartBlueprintRunCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/StartColumnStatisticsTaskRunCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/StartColumnStatisticsTaskRunScheduleCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/StartCrawlerCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/commands/index.d.ts +1 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/models/enums.d.ts +38 -16
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/models/models_0.d.ts +74 -76
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/models/models_1.d.ts +113 -101
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/models/models_2.d.ts +109 -79
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/models/models_3.d.ts +77 -4
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/schemas/schemas_0.d.ts +16 -0
- package/node_modules/@aws-sdk/client-glue/package.json +6 -6
- package/node_modules/@aws-sdk/client-lakeformation/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-lakeformation/dist-types/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/client-lakeformation/dist-types/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/client-lakeformation/dist-types/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/client-lakeformation/dist-types/ts3.4/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/client-lakeformation/dist-types/ts3.4/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/client-lakeformation/dist-types/ts3.4/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/client-lakeformation/package.json +6 -6
- package/node_modules/@aws-sdk/client-ram/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-ram/dist-types/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/client-ram/dist-types/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/client-ram/dist-types/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/client-ram/dist-types/ts3.4/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/client-ram/dist-types/ts3.4/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/client-ram/dist-types/ts3.4/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/client-ram/package.json +6 -6
- package/node_modules/@aws-sdk/client-sts/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/client-sts/package.json +8 -8
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +66 -28
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +989 -72
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js +7 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +28 -14
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.browser.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.js +3 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/clock-skew-node-config.js +8 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js +3 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.browser.js +9 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js +5 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js +12 -6
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js +2 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +8 -5
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonSettings.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{JsonCodec.js → codec-v1/JsonCodec.js} +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonSettings.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{JsonShapeDeserializer.js → codec-v1/JsonShapeDeserializer.js} +14 -5
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/{JsonShapeSerializer.js → codec-v1/JsonShapeSerializer.js} +12 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.js +103 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonCodec2.js +20 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js +200 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js +489 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/detectBufferParsing.js +18 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js +22 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/needsReviver.js +41 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js +33 -13
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/writeKey.js +3 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js +4 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.d.ts +2 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.browser.d.ts +6 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.d.ts +7 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/clock-skew-node-config.d.ts +13 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/index.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.d.ts +22 -6
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/index.browser.d.ts +11 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/index.d.ts +7 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/utils/getDateHeader.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.d.ts +22 -6
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/utils/index.d.ts +2 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +9 -6
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsRestJsonProtocol.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonSettings.d.ts +7 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{JsonCodec.d.ts → codec-v1/JsonCodec.d.ts} +4 -8
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v1/JsonSettings.d.ts +7 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{JsonShapeDeserializer.d.ts → codec-v1/JsonShapeDeserializer.d.ts} +3 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/{JsonShapeSerializer.d.ts → codec-v1/JsonShapeSerializer.d.ts} +3 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +51 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +13 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +30 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +60 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/detectBufferParsing.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/needsReviver.d.ts +11 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/parseJsonBody.d.ts +7 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/writeKey.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.d.ts +2 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.browser.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-node-config.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/index.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.d.ts +7 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/index.browser.d.ts +32 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/index.d.ts +10 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getDateHeader.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.d.ts +2 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/index.d.ts +2 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +9 -6
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsRestJsonProtocol.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonSettings.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/{JsonCodec.d.ts → codec-v1/JsonCodec.d.ts} +3 -5
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonSettings.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/{JsonShapeDeserializer.d.ts → codec-v1/JsonShapeDeserializer.d.ts} +2 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/{JsonShapeSerializer.d.ts → codec-v1/JsonShapeSerializer.d.ts} +2 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +27 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +9 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +15 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +39 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/detectBufferParsing.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +2 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +7 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/writeKey.d.ts +1 -0
- package/node_modules/@aws-sdk/core/package.json +11 -6
- package/node_modules/@aws-sdk/credential-provider-env/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-http/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +11 -11
- package/node_modules/@aws-sdk/credential-provider-login/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-node/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-process/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-web-identity/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 +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.native.d.ts +2 -0
- package/node_modules/@aws-sdk/nested-clients/package.json +6 -6
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +2 -2
- package/node_modules/@aws-sdk/token-providers/package.json +4 -4
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/index.js +14 -4
- package/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js +14 -4
- package/node_modules/@aws-sdk/xml-builder/package.json +1 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +1562 -338
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +34 -11
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +34 -11
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +1 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +1 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +1 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +2 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +2 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +2 -2
- package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +4 -205
- package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-decode.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-encode.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeDeserializer.js +113 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeSerializer.js +103 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeDeserializer2.js +621 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeSerializer2.js +602 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/index.js +5 -1
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +34 -11
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/constants.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js +2 -2
- package/node_modules/@smithy/core/dist-types/submodules/cbor/CborCodec.d.ts +5 -27
- package/node_modules/@smithy/core/dist-types/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +2 -2
- package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v1/CborShapeDeserializer.d.ts +13 -0
- package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v1/CborShapeSerializer.d.ts +15 -0
- package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v2/CborShapeDeserializer2.d.ts +18 -0
- package/node_modules/@smithy/core/dist-types/submodules/cbor/codec-v2/CborShapeSerializer2.d.ts +35 -0
- package/node_modules/@smithy/core/dist-types/submodules/cbor/index.d.ts +5 -1
- package/node_modules/@smithy/core/dist-types/submodules/event-streams/EventStreamSerde.d.ts +10 -2
- package/node_modules/@smithy/core/dist-types/submodules/retry/service-error-classification/constants.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/CborCodec.d.ts +5 -27
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +2 -2
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v1/CborShapeDeserializer.d.ts +13 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v1/CborShapeSerializer.d.ts +15 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v2/CborShapeDeserializer2.d.ts +18 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/codec-v2/CborShapeSerializer2.d.ts +35 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/index.d.ts +5 -1
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/event-streams/EventStreamSerde.d.ts +10 -2
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/retry/service-error-classification/constants.d.ts +1 -0
- package/node_modules/@smithy/core/package.json +2 -1
- package/node_modules/@smithy/credential-provider-imds/package.json +2 -2
- package/node_modules/@smithy/fetch-http-handler/package.json +2 -2
- package/node_modules/@smithy/node-http-handler/package.json +2 -2
- package/node_modules/@smithy/signature-v4/package.json +2 -2
- package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/dist/js-yaml.js +4 -4
- package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/dist/js-yaml.min.js +1 -1
- package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/type/omap.js +3 -3
- package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/package.json +1 -1
- package/node_modules/xml2js/node_modules/sax/lib/sax.js +27 -9
- package/node_modules/xml2js/node_modules/sax/package.json +1 -1
- package/package.json +12 -12
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.js +0 -135
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.d.ts +0 -27
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.d.ts +0 -17
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/LICENSE +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/README.md +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/bin/js-yaml.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/index.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/common.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/dumper.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/exception.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/loader.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/mark.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/schema/core.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/schema/default_full.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/schema/default_safe.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/schema/failsafe.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/schema/json.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/schema.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/type/binary.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/type/bool.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/type/float.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/type/int.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/type/js/function.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/type/js/regexp.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/type/js/undefined.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/type/map.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/type/merge.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/type/null.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/type/pairs.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/type/seq.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/type/set.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/type/str.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/type/timestamp.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml/type.js +0 -0
- /package/node_modules/{js-yaml → aws-lambda/node_modules/js-yaml}/lib/js-yaml.js +0 -0
|
@@ -0,0 +1,621 @@
|
|
|
1
|
+
import { SerdeContext } from "@smithy/core/protocols";
|
|
2
|
+
import { NormalizedSchema } from "@smithy/core/schema";
|
|
3
|
+
import { NumericValue, _parseEpochTimestamp, nv } from "@smithy/core/serde";
|
|
4
|
+
import { extendedFloat16, extendedFloat32, extendedFloat64, extendedOneByte, majorList, majorMap, majorNegativeInt64, majorSpecial, majorTag, majorUint64, majorUnstructuredByteString, majorUtf8String, minorIndefinite, specialFalse, specialNull, specialTrue, specialUndefined, } from "../cbor-types";
|
|
5
|
+
import { loadCborStructIterator } from "./CborShapeSerializer2";
|
|
6
|
+
export class CborShapeDeserializer2 extends SerdeContext {
|
|
7
|
+
read(schema, bytes) {
|
|
8
|
+
payload = bytes;
|
|
9
|
+
isBuffer = USE_BUFFER && bytes instanceof Buffer;
|
|
10
|
+
dataView = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
11
|
+
pos = 0;
|
|
12
|
+
end = bytes.length;
|
|
13
|
+
cacheEpoch = (cacheEpoch + 1) & 0xffff;
|
|
14
|
+
return readValue(NormalizedSchema.of(schema));
|
|
15
|
+
}
|
|
16
|
+
readValue(_schema, value) {
|
|
17
|
+
return transformObject(NormalizedSchema.of(_schema), value);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const USE_BUFFER = typeof Buffer !== "undefined";
|
|
21
|
+
const textDecoder = new TextDecoder();
|
|
22
|
+
let payload = new Uint8Array(0);
|
|
23
|
+
let isBuffer = false;
|
|
24
|
+
let dataView = new DataView(new ArrayBuffer(0));
|
|
25
|
+
let pos = 0;
|
|
26
|
+
let end = 0;
|
|
27
|
+
const STRING_CACHE_SIZE = 2048;
|
|
28
|
+
const stringCache = new Array(STRING_CACHE_SIZE);
|
|
29
|
+
const stringCacheEpochs = new Uint16Array(STRING_CACHE_SIZE);
|
|
30
|
+
let cacheEpoch = 0;
|
|
31
|
+
function readValue(ns) {
|
|
32
|
+
if (pos >= end) {
|
|
33
|
+
throw new Error("unexpected end of CBOR payload.");
|
|
34
|
+
}
|
|
35
|
+
const major = (payload[pos] & 0b1110_0000) >> 5;
|
|
36
|
+
const minor = payload[pos] & 0b0001_1111;
|
|
37
|
+
if (minor === minorIndefinite && major >= 2 && major <= 5) {
|
|
38
|
+
return readIndefinite(ns, major);
|
|
39
|
+
}
|
|
40
|
+
switch (major) {
|
|
41
|
+
case majorUint64:
|
|
42
|
+
return readUnsignedInt();
|
|
43
|
+
case majorNegativeInt64:
|
|
44
|
+
return readNegativeInt();
|
|
45
|
+
case majorUnstructuredByteString:
|
|
46
|
+
return readByteString();
|
|
47
|
+
case majorUtf8String:
|
|
48
|
+
return readUtf8String();
|
|
49
|
+
case majorList:
|
|
50
|
+
return readList(ns);
|
|
51
|
+
case majorMap:
|
|
52
|
+
return readMap(ns);
|
|
53
|
+
case majorTag:
|
|
54
|
+
return readTag(ns);
|
|
55
|
+
case majorSpecial:
|
|
56
|
+
return readSpecial();
|
|
57
|
+
default:
|
|
58
|
+
throw new Error(`unexpected CBOR major type ${major}.`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function readList(ns) {
|
|
62
|
+
const count = decodeCount();
|
|
63
|
+
const memberSchema = ns.isListSchema() ? ns.getValueSchema() : ns;
|
|
64
|
+
const list = Array(count);
|
|
65
|
+
for (let i = 0; i < count; ++i) {
|
|
66
|
+
list[i] = readValue(memberSchema);
|
|
67
|
+
}
|
|
68
|
+
return list;
|
|
69
|
+
}
|
|
70
|
+
function readMap(ns) {
|
|
71
|
+
const count = decodeCount();
|
|
72
|
+
if (ns.isStructSchema()) {
|
|
73
|
+
const startPos = pos;
|
|
74
|
+
return readStruct(ns, count, startPos);
|
|
75
|
+
}
|
|
76
|
+
const valueSchema = ns.isMapSchema() ? ns.getValueSchema() : ns;
|
|
77
|
+
const map = {};
|
|
78
|
+
for (let i = 0; i < count; ++i) {
|
|
79
|
+
const key = readUtf8String();
|
|
80
|
+
map[key] = readValue(valueSchema);
|
|
81
|
+
}
|
|
82
|
+
return map;
|
|
83
|
+
}
|
|
84
|
+
function readStruct(ns, count, startPos) {
|
|
85
|
+
const isUnion = ns.isUnionSchema();
|
|
86
|
+
const cache = loadCborStructIterator(ns);
|
|
87
|
+
const { memberSchemas, encodedKeys, memberNames } = cache;
|
|
88
|
+
const z = encodedKeys.length;
|
|
89
|
+
const result = {};
|
|
90
|
+
let unknownKey;
|
|
91
|
+
let unknownValue;
|
|
92
|
+
let unknownCount = 0;
|
|
93
|
+
let hasType = false;
|
|
94
|
+
let hint = 0;
|
|
95
|
+
for (let i = 0; i < count; ++i) {
|
|
96
|
+
const matchIdx = matchStructKey(encodedKeys, z, hint);
|
|
97
|
+
if (matchIdx >= 0) {
|
|
98
|
+
hint = matchIdx + 1;
|
|
99
|
+
if (hint >= z) {
|
|
100
|
+
hint = 0;
|
|
101
|
+
}
|
|
102
|
+
const val = readValue(memberSchemas[matchIdx]);
|
|
103
|
+
if (val != null) {
|
|
104
|
+
result[memberNames[matchIdx]] = val;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
const key = readUtf8String();
|
|
109
|
+
const val = readValue(NormalizedSchema.of(15));
|
|
110
|
+
if (key === "__type" && typeof val === "string") {
|
|
111
|
+
hasType = true;
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
unknownKey = key;
|
|
115
|
+
unknownValue = val;
|
|
116
|
+
++unknownCount;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (isUnion) {
|
|
121
|
+
let resultEmpty = true;
|
|
122
|
+
for (const _ in result) {
|
|
123
|
+
resultEmpty = false;
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
if (resultEmpty && unknownCount === 1) {
|
|
127
|
+
result.$unknown = [unknownKey, unknownValue];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
else if (hasType) {
|
|
131
|
+
pos = startPos;
|
|
132
|
+
const docSchema = NormalizedSchema.of(15);
|
|
133
|
+
for (let i = 0; i < count; ++i) {
|
|
134
|
+
const key = readUtf8String();
|
|
135
|
+
const val = readValue(docSchema);
|
|
136
|
+
if (!(key in result)) {
|
|
137
|
+
result[key] = val;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return result;
|
|
142
|
+
}
|
|
143
|
+
function readTag(ns) {
|
|
144
|
+
const tagNum = decodeArgument();
|
|
145
|
+
const tagNumber = typeof tagNum === "bigint" ? Number(tagNum) : tagNum;
|
|
146
|
+
if (tagNumber === 1) {
|
|
147
|
+
const docSchema = NormalizedSchema.of(15);
|
|
148
|
+
const epochValue = readValue(docSchema);
|
|
149
|
+
return _parseEpochTimestamp(epochValue);
|
|
150
|
+
}
|
|
151
|
+
if (tagNumber === 2 || tagNumber === 3) {
|
|
152
|
+
const byteStr = readByteString();
|
|
153
|
+
let b = BigInt(0);
|
|
154
|
+
for (let i = 0; i < byteStr.length; ++i) {
|
|
155
|
+
b = (b << BigInt(8)) | BigInt(byteStr[i]);
|
|
156
|
+
}
|
|
157
|
+
return tagNumber === 3 ? -b - BigInt(1) : b;
|
|
158
|
+
}
|
|
159
|
+
if (tagNumber === 4) {
|
|
160
|
+
const docSchema = NormalizedSchema.of(15);
|
|
161
|
+
const pair = readValue(docSchema);
|
|
162
|
+
const [exponent, mantissa] = pair;
|
|
163
|
+
const normalizer = mantissa < 0 ? -1 : 1;
|
|
164
|
+
const mantissaStr = "0".repeat(Math.abs(exponent) + 1) + String(BigInt(normalizer) * BigInt(mantissa));
|
|
165
|
+
let numericString;
|
|
166
|
+
const sign = mantissa < 0 ? "-" : "";
|
|
167
|
+
numericString =
|
|
168
|
+
exponent === 0
|
|
169
|
+
? mantissaStr
|
|
170
|
+
: mantissaStr.slice(0, mantissaStr.length + exponent) + "." + mantissaStr.slice(exponent);
|
|
171
|
+
numericString = numericString.replace(/^0+/g, "");
|
|
172
|
+
if (numericString === "") {
|
|
173
|
+
numericString = "0";
|
|
174
|
+
}
|
|
175
|
+
if (numericString[0] === ".") {
|
|
176
|
+
numericString = "0" + numericString;
|
|
177
|
+
}
|
|
178
|
+
numericString = sign + numericString;
|
|
179
|
+
return nv(numericString);
|
|
180
|
+
}
|
|
181
|
+
const docSchema = NormalizedSchema.of(15);
|
|
182
|
+
const innerValue = readValue(docSchema);
|
|
183
|
+
return { tag: castBigInt(tagNum), value: innerValue };
|
|
184
|
+
}
|
|
185
|
+
function readIndefinite(ns, major) {
|
|
186
|
+
switch (major) {
|
|
187
|
+
case majorUtf8String:
|
|
188
|
+
return readUtf8StringIndefinite();
|
|
189
|
+
case majorUnstructuredByteString:
|
|
190
|
+
return readByteStringIndefinite();
|
|
191
|
+
case majorList:
|
|
192
|
+
return readListIndefinite(ns);
|
|
193
|
+
case majorMap:
|
|
194
|
+
return readMapIndefinite(ns);
|
|
195
|
+
default:
|
|
196
|
+
throw new Error(`unexpected indefinite length for major ${major}.`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
function readUtf8StringIndefinite() {
|
|
200
|
+
pos += 1;
|
|
201
|
+
const chunks = [];
|
|
202
|
+
let totalLen = 0;
|
|
203
|
+
while (pos < end) {
|
|
204
|
+
if (payload[pos] === 0xff) {
|
|
205
|
+
pos += 1;
|
|
206
|
+
const combined = new Uint8Array(totalLen);
|
|
207
|
+
let offset = 0;
|
|
208
|
+
for (let i = 0; i < chunks.length; ++i) {
|
|
209
|
+
combined.set(chunks[i], offset);
|
|
210
|
+
offset += chunks[i].length;
|
|
211
|
+
}
|
|
212
|
+
if (USE_BUFFER) {
|
|
213
|
+
return Buffer.from(combined.buffer, combined.byteOffset, combined.byteLength).toString("utf-8");
|
|
214
|
+
}
|
|
215
|
+
return textDecoder.decode(combined);
|
|
216
|
+
}
|
|
217
|
+
const bytes = readByteString();
|
|
218
|
+
chunks.push(bytes);
|
|
219
|
+
totalLen += bytes.length;
|
|
220
|
+
}
|
|
221
|
+
throw new Error("expected break marker.");
|
|
222
|
+
}
|
|
223
|
+
function readByteStringIndefinite() {
|
|
224
|
+
pos += 1;
|
|
225
|
+
const chunks = [];
|
|
226
|
+
let totalLen = 0;
|
|
227
|
+
while (pos < end) {
|
|
228
|
+
if (payload[pos] === 0xff) {
|
|
229
|
+
pos += 1;
|
|
230
|
+
const combined = new Uint8Array(totalLen);
|
|
231
|
+
let offset = 0;
|
|
232
|
+
for (let i = 0; i < chunks.length; ++i) {
|
|
233
|
+
combined.set(chunks[i], offset);
|
|
234
|
+
offset += chunks[i].length;
|
|
235
|
+
}
|
|
236
|
+
return combined;
|
|
237
|
+
}
|
|
238
|
+
const bytes = readByteString();
|
|
239
|
+
chunks.push(bytes);
|
|
240
|
+
totalLen += bytes.length;
|
|
241
|
+
}
|
|
242
|
+
throw new Error("expected break marker.");
|
|
243
|
+
}
|
|
244
|
+
function readListIndefinite(ns) {
|
|
245
|
+
pos += 1;
|
|
246
|
+
const memberSchema = ns.isListSchema() ? ns.getValueSchema() : ns;
|
|
247
|
+
const list = [];
|
|
248
|
+
while (pos < end) {
|
|
249
|
+
if (payload[pos] === 0xff) {
|
|
250
|
+
pos += 1;
|
|
251
|
+
return list;
|
|
252
|
+
}
|
|
253
|
+
list.push(readValue(memberSchema));
|
|
254
|
+
}
|
|
255
|
+
throw new Error("expected break marker.");
|
|
256
|
+
}
|
|
257
|
+
function readMapIndefinite(ns) {
|
|
258
|
+
pos += 1;
|
|
259
|
+
if (ns.isStructSchema()) {
|
|
260
|
+
const cache = loadCborStructIterator(ns);
|
|
261
|
+
const { memberSchemas, encodedKeys, memberNames } = cache;
|
|
262
|
+
const z = encodedKeys.length;
|
|
263
|
+
const isUnion = ns.isUnionSchema();
|
|
264
|
+
const result = {};
|
|
265
|
+
let unknownKey;
|
|
266
|
+
let unknownValue;
|
|
267
|
+
let unknownCount = 0;
|
|
268
|
+
let hint = 0;
|
|
269
|
+
while (pos < end) {
|
|
270
|
+
if (payload[pos] === 0xff) {
|
|
271
|
+
pos += 1;
|
|
272
|
+
if (isUnion) {
|
|
273
|
+
let resultEmpty = true;
|
|
274
|
+
for (const _ in result) {
|
|
275
|
+
resultEmpty = false;
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
if (resultEmpty && unknownCount === 1) {
|
|
279
|
+
result.$unknown = [unknownKey, unknownValue];
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return result;
|
|
283
|
+
}
|
|
284
|
+
const matchIdx = matchStructKey(encodedKeys, z, hint);
|
|
285
|
+
if (matchIdx >= 0) {
|
|
286
|
+
hint = matchIdx + 1;
|
|
287
|
+
if (hint >= z) {
|
|
288
|
+
hint = 0;
|
|
289
|
+
}
|
|
290
|
+
const val = readValue(memberSchemas[matchIdx]);
|
|
291
|
+
if (val != null) {
|
|
292
|
+
result[memberNames[matchIdx]] = val;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
const key = readUtf8String();
|
|
297
|
+
const val = readValue(NormalizedSchema.of(15));
|
|
298
|
+
if (key !== "__type") {
|
|
299
|
+
unknownKey = key;
|
|
300
|
+
unknownValue = val;
|
|
301
|
+
++unknownCount;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
throw new Error("expected break marker.");
|
|
306
|
+
}
|
|
307
|
+
const valueSchema = ns.isMapSchema() ? ns.getValueSchema() : ns;
|
|
308
|
+
const map = {};
|
|
309
|
+
while (pos < end) {
|
|
310
|
+
if (payload[pos] === 0xff) {
|
|
311
|
+
pos += 1;
|
|
312
|
+
return map;
|
|
313
|
+
}
|
|
314
|
+
const key = readUtf8String();
|
|
315
|
+
map[key] = readValue(valueSchema);
|
|
316
|
+
}
|
|
317
|
+
throw new Error("expected break marker.");
|
|
318
|
+
}
|
|
319
|
+
function matchStructKey(encodedKeys, z, hint) {
|
|
320
|
+
const hintKey = encodedKeys[hint];
|
|
321
|
+
if (pos + hintKey.length <= end && bytesMatch(pos, hintKey)) {
|
|
322
|
+
pos += hintKey.length;
|
|
323
|
+
return hint;
|
|
324
|
+
}
|
|
325
|
+
for (let i = 0; i < z; ++i) {
|
|
326
|
+
if (i === hint) {
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
const ek = encodedKeys[i];
|
|
330
|
+
if (pos + ek.length <= end && bytesMatch(pos, ek)) {
|
|
331
|
+
pos += ek.length;
|
|
332
|
+
return i;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return -1;
|
|
336
|
+
}
|
|
337
|
+
function bytesMatch(at, expected) {
|
|
338
|
+
const len = expected.length;
|
|
339
|
+
if (payload[at] !== expected[0]) {
|
|
340
|
+
return false;
|
|
341
|
+
}
|
|
342
|
+
for (let i = 1; i < len; ++i) {
|
|
343
|
+
if (payload[at + i] !== expected[i]) {
|
|
344
|
+
return false;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
return true;
|
|
348
|
+
}
|
|
349
|
+
function decodeArgument() {
|
|
350
|
+
const minor = payload[pos] & 0b0001_1111;
|
|
351
|
+
if (minor < 24) {
|
|
352
|
+
pos += 1;
|
|
353
|
+
return minor;
|
|
354
|
+
}
|
|
355
|
+
switch (minor) {
|
|
356
|
+
case extendedOneByte:
|
|
357
|
+
if (end - pos < 2) {
|
|
358
|
+
overflow(1);
|
|
359
|
+
}
|
|
360
|
+
pos += 2;
|
|
361
|
+
return payload[pos - 1];
|
|
362
|
+
case extendedFloat16:
|
|
363
|
+
if (end - pos < 3) {
|
|
364
|
+
overflow(2);
|
|
365
|
+
}
|
|
366
|
+
pos += 3;
|
|
367
|
+
return dataView.getUint16(pos - 2);
|
|
368
|
+
case extendedFloat32:
|
|
369
|
+
if (end - pos < 5) {
|
|
370
|
+
overflow(4);
|
|
371
|
+
}
|
|
372
|
+
pos += 5;
|
|
373
|
+
return dataView.getUint32(pos - 4);
|
|
374
|
+
case extendedFloat64: {
|
|
375
|
+
if (end - pos < 9) {
|
|
376
|
+
overflow(8);
|
|
377
|
+
}
|
|
378
|
+
pos += 9;
|
|
379
|
+
const hi = dataView.getUint32(pos - 8);
|
|
380
|
+
if (hi < 0x00200000) {
|
|
381
|
+
return hi * 4294967296 + dataView.getUint32(pos - 4);
|
|
382
|
+
}
|
|
383
|
+
return dataView.getBigUint64(pos - 8);
|
|
384
|
+
}
|
|
385
|
+
default:
|
|
386
|
+
throw new Error(`unexpected minor value ${minor}.`);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
function decodeCount() {
|
|
390
|
+
const val = decodeArgument();
|
|
391
|
+
return typeof val === "bigint" ? Number(val) : val;
|
|
392
|
+
}
|
|
393
|
+
function readUnsignedInt() {
|
|
394
|
+
const val = decodeArgument();
|
|
395
|
+
return castBigInt(val);
|
|
396
|
+
}
|
|
397
|
+
function readNegativeInt() {
|
|
398
|
+
const val = decodeArgument();
|
|
399
|
+
if (typeof val === "bigint") {
|
|
400
|
+
return BigInt(-1) - val;
|
|
401
|
+
}
|
|
402
|
+
return -1 - val;
|
|
403
|
+
}
|
|
404
|
+
function readByteString() {
|
|
405
|
+
const length = decodeCount();
|
|
406
|
+
if (end - pos < length) {
|
|
407
|
+
overflow(length);
|
|
408
|
+
}
|
|
409
|
+
const start = pos;
|
|
410
|
+
pos += length;
|
|
411
|
+
return payload.subarray(start, start + length);
|
|
412
|
+
}
|
|
413
|
+
function readUtf8String() {
|
|
414
|
+
const length = decodeCount();
|
|
415
|
+
if (end - pos < length) {
|
|
416
|
+
overflow(length);
|
|
417
|
+
}
|
|
418
|
+
const start = pos;
|
|
419
|
+
pos += length;
|
|
420
|
+
if (length < 24) {
|
|
421
|
+
return decodeUtf8Cached(start, length);
|
|
422
|
+
}
|
|
423
|
+
if (isBuffer) {
|
|
424
|
+
return payload.toString("utf-8", start, start + length);
|
|
425
|
+
}
|
|
426
|
+
return textDecoder.decode(payload.subarray(start, start + length));
|
|
427
|
+
}
|
|
428
|
+
function decodeUtf8Cached(at, length) {
|
|
429
|
+
let h = length;
|
|
430
|
+
for (let i = 0; i < length; ++i) {
|
|
431
|
+
h = (h * 31 + payload[at + i]) | 0;
|
|
432
|
+
}
|
|
433
|
+
const slot = (h >>> 0) & (STRING_CACHE_SIZE - 1);
|
|
434
|
+
const cached = stringCache[slot];
|
|
435
|
+
if (cached !== undefined && cached.length === length) {
|
|
436
|
+
let match = true;
|
|
437
|
+
for (let i = 0; i < length; ++i) {
|
|
438
|
+
if (cached.charCodeAt(i) !== payload[at + i]) {
|
|
439
|
+
match = false;
|
|
440
|
+
break;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
if (match) {
|
|
444
|
+
stringCacheEpochs[slot] = cacheEpoch;
|
|
445
|
+
return cached;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
const result = isBuffer
|
|
449
|
+
? payload.toString("utf-8", at, at + length)
|
|
450
|
+
: textDecoder.decode(payload.subarray(at, at + length));
|
|
451
|
+
if (stringCacheEpochs[slot] !== cacheEpoch) {
|
|
452
|
+
stringCache[slot] = result;
|
|
453
|
+
stringCacheEpochs[slot] = cacheEpoch;
|
|
454
|
+
}
|
|
455
|
+
return result;
|
|
456
|
+
}
|
|
457
|
+
function readSpecial() {
|
|
458
|
+
const p = pos;
|
|
459
|
+
const minor = payload[p] & 0b0001_1111;
|
|
460
|
+
switch (minor) {
|
|
461
|
+
case specialTrue:
|
|
462
|
+
pos = p + 1;
|
|
463
|
+
return true;
|
|
464
|
+
case specialFalse:
|
|
465
|
+
pos = p + 1;
|
|
466
|
+
return false;
|
|
467
|
+
case specialNull:
|
|
468
|
+
pos = p + 1;
|
|
469
|
+
return null;
|
|
470
|
+
case specialUndefined:
|
|
471
|
+
pos = p + 1;
|
|
472
|
+
return null;
|
|
473
|
+
case extendedFloat16: {
|
|
474
|
+
if (end - p < 3) {
|
|
475
|
+
overflow(2);
|
|
476
|
+
}
|
|
477
|
+
pos = p + 3;
|
|
478
|
+
return bytesToFloat16(payload[p + 1], payload[p + 2]);
|
|
479
|
+
}
|
|
480
|
+
case extendedFloat32: {
|
|
481
|
+
if (end - p < 5) {
|
|
482
|
+
overflow(4);
|
|
483
|
+
}
|
|
484
|
+
pos = p + 5;
|
|
485
|
+
return dataView.getFloat32(p + 1);
|
|
486
|
+
}
|
|
487
|
+
case extendedFloat64: {
|
|
488
|
+
if (end - p < 9) {
|
|
489
|
+
overflow(8);
|
|
490
|
+
}
|
|
491
|
+
pos = p + 9;
|
|
492
|
+
return dataView.getFloat64(p + 1);
|
|
493
|
+
}
|
|
494
|
+
default:
|
|
495
|
+
throw new Error(`unexpected minor value ${minor} for major 7.`);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
function bytesToFloat16(a, b) {
|
|
499
|
+
const sign = a >> 7;
|
|
500
|
+
const exponent = (a & 0b0111_1100) >> 2;
|
|
501
|
+
const fraction = ((a & 0b0000_0011) << 8) | b;
|
|
502
|
+
const scalar = sign === 0 ? 1 : -1;
|
|
503
|
+
if (exponent === 0b00000) {
|
|
504
|
+
if (fraction === 0) {
|
|
505
|
+
return 0;
|
|
506
|
+
}
|
|
507
|
+
return scalar * (Math.pow(2, 1 - 15) * (fraction / 1024));
|
|
508
|
+
}
|
|
509
|
+
else if (exponent === 0b11111) {
|
|
510
|
+
if (fraction === 0) {
|
|
511
|
+
return scalar * Infinity;
|
|
512
|
+
}
|
|
513
|
+
return NaN;
|
|
514
|
+
}
|
|
515
|
+
return scalar * (Math.pow(2, exponent - 15) * (1 + fraction / 1024));
|
|
516
|
+
}
|
|
517
|
+
function castBigInt(value) {
|
|
518
|
+
if (typeof value === "number") {
|
|
519
|
+
return value;
|
|
520
|
+
}
|
|
521
|
+
const num = Number(value);
|
|
522
|
+
if (Number.MIN_SAFE_INTEGER <= num && num <= Number.MAX_SAFE_INTEGER) {
|
|
523
|
+
return num;
|
|
524
|
+
}
|
|
525
|
+
return value;
|
|
526
|
+
}
|
|
527
|
+
function overflow(n) {
|
|
528
|
+
throw new Error(`CBOR: length ${n} greater than remaining buffer length.`);
|
|
529
|
+
}
|
|
530
|
+
function transformObject(ns, value) {
|
|
531
|
+
if (ns.isTimestampSchema()) {
|
|
532
|
+
if (typeof value === "number") {
|
|
533
|
+
return _parseEpochTimestamp(value);
|
|
534
|
+
}
|
|
535
|
+
if (typeof value === "object" && value !== null) {
|
|
536
|
+
if (value.tag === 1 && "value" in value) {
|
|
537
|
+
return _parseEpochTimestamp(value.value);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
if (ns.isBlobSchema()) {
|
|
542
|
+
return value;
|
|
543
|
+
}
|
|
544
|
+
if (typeof value === "undefined" ||
|
|
545
|
+
typeof value === "boolean" ||
|
|
546
|
+
typeof value === "number" ||
|
|
547
|
+
typeof value === "string" ||
|
|
548
|
+
typeof value === "bigint" ||
|
|
549
|
+
typeof value === "symbol") {
|
|
550
|
+
return value;
|
|
551
|
+
}
|
|
552
|
+
if (typeof value !== "object" || value === null) {
|
|
553
|
+
return value;
|
|
554
|
+
}
|
|
555
|
+
if ("byteLength" in value) {
|
|
556
|
+
return value;
|
|
557
|
+
}
|
|
558
|
+
if (value instanceof Date) {
|
|
559
|
+
return value;
|
|
560
|
+
}
|
|
561
|
+
if (value instanceof NumericValue) {
|
|
562
|
+
return value;
|
|
563
|
+
}
|
|
564
|
+
if (ns.isDocumentSchema()) {
|
|
565
|
+
return value;
|
|
566
|
+
}
|
|
567
|
+
if (ns.isListSchema()) {
|
|
568
|
+
const memberSchema = ns.getValueSchema();
|
|
569
|
+
const out = [];
|
|
570
|
+
for (const item of value) {
|
|
571
|
+
out.push(transformObject(memberSchema, item));
|
|
572
|
+
}
|
|
573
|
+
return out;
|
|
574
|
+
}
|
|
575
|
+
const newObject = {};
|
|
576
|
+
if (ns.isMapSchema()) {
|
|
577
|
+
const targetSchema = ns.getValueSchema();
|
|
578
|
+
for (const key in value) {
|
|
579
|
+
newObject[key] = transformObject(targetSchema, value[key]);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
else if (ns.isStructSchema()) {
|
|
583
|
+
const isUnion = ns.isUnionSchema();
|
|
584
|
+
let keys;
|
|
585
|
+
if (isUnion) {
|
|
586
|
+
keys = new Set();
|
|
587
|
+
for (const k in value) {
|
|
588
|
+
if (k !== "__type") {
|
|
589
|
+
keys.add(k);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
for (const [key, memberSchema] of ns.structIterator()) {
|
|
594
|
+
if (isUnion) {
|
|
595
|
+
keys.delete(key);
|
|
596
|
+
}
|
|
597
|
+
if (value[key] != null) {
|
|
598
|
+
newObject[key] = transformObject(memberSchema, value[key]);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
if (isUnion && keys?.size === 1) {
|
|
602
|
+
let newObjectEmpty = true;
|
|
603
|
+
for (const _ in newObject) {
|
|
604
|
+
newObjectEmpty = false;
|
|
605
|
+
break;
|
|
606
|
+
}
|
|
607
|
+
if (newObjectEmpty) {
|
|
608
|
+
const k = keys.values().next().value;
|
|
609
|
+
newObject.$unknown = [k, value[k]];
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
else if (typeof value.__type === "string") {
|
|
613
|
+
for (const k in value) {
|
|
614
|
+
if (!(k in newObject)) {
|
|
615
|
+
newObject[k] = value[k];
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
return newObject;
|
|
621
|
+
}
|