@gemeentenijmegen/webapp 1.1.10 → 1.1.11

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.
Files changed (235) hide show
  1. package/.jsii +10 -10
  2. package/assets/webapp/auth/auth.lambda/index.js +47 -66
  3. package/assets/webapp/login/login.lambda/index.js +2 -21
  4. package/assets/webapp/logout/logout.lambda/index.js +2 -2
  5. package/lib/webapp/Criticality.js +1 -1
  6. package/lib/webapp/Webapp.js +1 -1
  7. package/lib/webapp/Webpage.js +1 -1
  8. package/lib/webapp/util/Files.js +1 -1
  9. package/node_modules/@aws-sdk/client-dynamodb/dist-cjs/index.js +63 -0
  10. package/node_modules/@aws-sdk/client-dynamodb/dist-es/models/index.js +1 -0
  11. package/node_modules/@aws-sdk/client-dynamodb/dist-es/models/models_0.js +22 -0
  12. package/node_modules/@aws-sdk/client-dynamodb/dist-es/models/models_1.js +1 -0
  13. package/node_modules/@aws-sdk/client-dynamodb/dist-es/protocols/Aws_json1_0.js +14 -1
  14. package/node_modules/@aws-sdk/client-dynamodb/dist-types/commands/BatchExecuteStatementCommand.d.ts +8 -3
  15. package/node_modules/@aws-sdk/client-dynamodb/dist-types/commands/BatchGetItemCommand.d.ts +14 -7
  16. package/node_modules/@aws-sdk/client-dynamodb/dist-types/commands/BatchWriteItemCommand.d.ts +14 -7
  17. package/node_modules/@aws-sdk/client-dynamodb/dist-types/commands/DeleteItemCommand.d.ts +14 -7
  18. package/node_modules/@aws-sdk/client-dynamodb/dist-types/commands/DescribeContributorInsightsCommand.d.ts +1 -0
  19. package/node_modules/@aws-sdk/client-dynamodb/dist-types/commands/ExecuteStatementCommand.d.ts +14 -7
  20. package/node_modules/@aws-sdk/client-dynamodb/dist-types/commands/ExecuteTransactionCommand.d.ts +14 -7
  21. package/node_modules/@aws-sdk/client-dynamodb/dist-types/commands/GetItemCommand.d.ts +14 -7
  22. package/node_modules/@aws-sdk/client-dynamodb/dist-types/commands/ListContributorInsightsCommand.d.ts +1 -0
  23. package/node_modules/@aws-sdk/client-dynamodb/dist-types/commands/PutItemCommand.d.ts +14 -7
  24. package/node_modules/@aws-sdk/client-dynamodb/dist-types/commands/QueryCommand.d.ts +14 -7
  25. package/node_modules/@aws-sdk/client-dynamodb/dist-types/commands/ScanCommand.d.ts +14 -7
  26. package/node_modules/@aws-sdk/client-dynamodb/dist-types/commands/TransactGetItemsCommand.d.ts +14 -7
  27. package/node_modules/@aws-sdk/client-dynamodb/dist-types/commands/TransactWriteItemsCommand.d.ts +16 -8
  28. package/node_modules/@aws-sdk/client-dynamodb/dist-types/commands/UpdateContributorInsightsCommand.d.ts +2 -0
  29. package/node_modules/@aws-sdk/client-dynamodb/dist-types/commands/UpdateItemCommand.d.ts +14 -7
  30. package/node_modules/@aws-sdk/client-dynamodb/dist-types/models/index.d.ts +1 -0
  31. package/node_modules/@aws-sdk/client-dynamodb/dist-types/models/models_0.d.ts +151 -79
  32. package/node_modules/@aws-sdk/client-dynamodb/dist-types/models/models_1.d.ts +73 -0
  33. package/node_modules/@aws-sdk/client-dynamodb/dist-types/ts3.4/commands/TransactWriteItemsCommand.d.ts +2 -4
  34. package/node_modules/@aws-sdk/client-dynamodb/dist-types/ts3.4/models/index.d.ts +1 -0
  35. package/node_modules/@aws-sdk/client-dynamodb/dist-types/ts3.4/models/models_0.d.ts +24 -6
  36. package/node_modules/@aws-sdk/client-dynamodb/dist-types/ts3.4/models/models_1.d.ts +11 -0
  37. package/node_modules/@aws-sdk/client-dynamodb/package.json +35 -35
  38. package/node_modules/@aws-sdk/client-s3/package.json +50 -50
  39. package/node_modules/@aws-sdk/client-secrets-manager/package.json +33 -33
  40. package/node_modules/@aws-sdk/client-ssm/package.json +34 -34
  41. package/node_modules/@aws-sdk/client-sso/package.json +32 -32
  42. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +73 -25
  43. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_0Protocol.js +5 -1
  44. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_1Protocol.js +5 -1
  45. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +4 -3
  46. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +5 -2
  47. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js +11 -7
  48. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReplacer.js +1 -1
  49. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js +3 -0
  50. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js +6 -2
  51. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js +6 -3
  52. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js +11 -7
  53. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_0Protocol.d.ts +6 -1
  54. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_1Protocol.d.ts +6 -1
  55. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +3 -1
  56. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsRestJsonProtocol.d.ts +4 -0
  57. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/query/AwsQueryProtocol.d.ts +4 -0
  58. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/xml/AwsRestXmlProtocol.d.ts +4 -0
  59. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_0Protocol.d.ts +8 -1
  60. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_1Protocol.d.ts +8 -1
  61. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +8 -1
  62. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsRestJsonProtocol.d.ts +1 -0
  63. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsQueryProtocol.d.ts +1 -0
  64. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/AwsRestXmlProtocol.d.ts +1 -0
  65. package/node_modules/@aws-sdk/core/package.json +12 -12
  66. package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
  67. package/node_modules/@aws-sdk/credential-provider-http/package.json +10 -10
  68. package/node_modules/@aws-sdk/credential-provider-ini/package.json +13 -13
  69. package/node_modules/@aws-sdk/credential-provider-node/package.json +12 -12
  70. package/node_modules/@aws-sdk/credential-provider-process/package.json +6 -6
  71. package/node_modules/@aws-sdk/credential-provider-sso/package.json +8 -8
  72. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +6 -6
  73. package/node_modules/@aws-sdk/middleware-bucket-endpoint/package.json +5 -5
  74. package/node_modules/@aws-sdk/middleware-endpoint-discovery/package.json +5 -5
  75. package/node_modules/@aws-sdk/middleware-expect-continue/package.json +4 -4
  76. package/node_modules/@aws-sdk/middleware-flexible-checksums/package.json +9 -9
  77. package/node_modules/@aws-sdk/middleware-host-header/package.json +4 -4
  78. package/node_modules/@aws-sdk/middleware-location-constraint/package.json +3 -3
  79. package/node_modules/@aws-sdk/middleware-logger/package.json +3 -3
  80. package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +4 -4
  81. package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +11 -11
  82. package/node_modules/@aws-sdk/middleware-ssec/package.json +3 -3
  83. package/node_modules/@aws-sdk/middleware-user-agent/package.json +7 -7
  84. package/node_modules/@aws-sdk/nested-clients/package.json +32 -32
  85. package/node_modules/@aws-sdk/region-config-resolver/package.json +5 -5
  86. package/node_modules/@aws-sdk/s3-request-presigner/package.json +10 -10
  87. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +6 -6
  88. package/node_modules/@aws-sdk/token-providers/package.json +10 -8
  89. package/node_modules/@aws-sdk/types/package.json +2 -2
  90. package/node_modules/@aws-sdk/util-endpoints/package.json +5 -5
  91. package/node_modules/@aws-sdk/util-format-url/package.json +4 -4
  92. package/node_modules/@aws-sdk/util-user-agent-browser/package.json +3 -3
  93. package/node_modules/@aws-sdk/util-user-agent-node/package.json +5 -5
  94. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  95. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/.jsii +82 -4
  96. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/lib/index.js +1 -1
  97. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/node_modules/@aws-solutions-constructs/core/.jsii +84 -6
  98. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/node_modules/@aws-solutions-constructs/core/lib/bedrock-inference-helper.js +2 -2
  99. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/node_modules/@aws-solutions-constructs/core/lib/cloudfront-distribution-defaults.d.ts +1 -1
  100. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/node_modules/@aws-solutions-constructs/core/lib/cloudfront-distribution-defaults.js +1 -1
  101. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/node_modules/@aws-solutions-constructs/core/lib/cloudfront-distribution-helper.d.ts +1 -1
  102. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/node_modules/@aws-solutions-constructs/core/lib/cloudfront-distribution-helper.js +1 -1
  103. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/node_modules/@aws-solutions-constructs/core/lib/kendra-helper.js +4 -2
  104. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/node_modules/@aws-solutions-constructs/core/lib/waf-helper.js +5 -2
  105. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/node_modules/@aws-solutions-constructs/core/package.json +3 -3
  106. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/node_modules/@aws-solutions-constructs/core/test/TwoLogGroups.json +365 -0
  107. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/node_modules/@aws-solutions-constructs/core/test/bedrock-inference-helper.test.js +2 -6
  108. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/node_modules/@aws-solutions-constructs/core/test/lambda/index.js +1 -1
  109. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/node_modules/@aws-solutions-constructs/core/test/pipes-helper.test.js +2 -2
  110. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/node_modules/@aws-solutions-constructs/core/test/step-function-helper.test.js +1 -1
  111. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/node_modules/@aws-solutions-constructs/core/test/test-helper.d.ts +6 -0
  112. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/node_modules/@aws-solutions-constructs/core/test/test-helper.js +84 -1
  113. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/node_modules/@aws-solutions-constructs/core/test/waf-helper.test.js +35 -1
  114. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/package.json +6 -6
  115. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-add-secondary-index.js +2 -1
  116. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithExistingVpc.js +2 -1
  117. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/cdk.out +1 -1
  118. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/integ.json +2 -2
  119. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/lamddb-deployFunctionWithExistingVpc.assets.json +6 -6
  120. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/lamddb-deployFunctionWithExistingVpc.template.json +1 -136
  121. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/lamddbdeployFunctionWithExistingVpcIntegDefaultTestDeployAssertEE08E38E.assets.json +2 -2
  122. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/manifest.json +475 -10
  123. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/tree.json +1 -1
  124. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithVpc.js +2 -1
  125. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/cdk.out +1 -1
  126. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/integ.json +2 -2
  127. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/lamddb-deployFunctionWithVpc.assets.json +6 -6
  128. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/lamddb-deployFunctionWithVpc.template.json +1 -136
  129. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/lamddbdeployFunctionWithVpcIntegDefaultTestDeployAssert0AB8275C.assets.json +2 -2
  130. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/manifest.json +475 -10
  131. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/tree.json +1 -1
  132. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-no-arguments.js +2 -1
  133. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-point-in-time-recovery.js +2 -1
  134. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-set-billing-mode.js +2 -1
  135. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-use-existing-func.js +2 -1
  136. package/node_modules/@gemeentenijmegen/apiclient/node_modules/@gemeentenijmegen/utils/package.json +8 -8
  137. package/node_modules/@gemeentenijmegen/apiclient/package.json +7 -7
  138. package/node_modules/@gemeentenijmegen/apigateway-http/package.json +4 -4
  139. package/node_modules/@gemeentenijmegen/session/package.json +5 -5
  140. package/node_modules/@gemeentenijmegen/utils/package.json +7 -7
  141. package/node_modules/@smithy/abort-controller/package.json +2 -2
  142. package/node_modules/@smithy/config-resolver/package.json +4 -4
  143. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +77 -38
  144. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +88 -85
  145. package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +12 -0
  146. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +6 -51
  147. package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +77 -41
  148. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +95 -0
  149. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +7 -95
  150. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js +9 -0
  151. package/node_modules/@smithy/core/dist-es/submodules/serde/copyDocumentWithTransform.js +1 -53
  152. package/node_modules/@smithy/core/dist-es/submodules/serde/generateIdempotencyToken.js +2 -0
  153. package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +1 -0
  154. package/node_modules/@smithy/core/dist-types/submodules/cbor/CborCodec.d.ts +5 -0
  155. package/node_modules/@smithy/core/dist-types/submodules/protocols/HttpBindingProtocol.d.ts +9 -1
  156. package/node_modules/@smithy/core/dist-types/submodules/protocols/HttpProtocol.d.ts +3 -1
  157. package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/NormalizedSchema.d.ts +5 -0
  158. package/node_modules/@smithy/core/dist-types/submodules/serde/copyDocumentWithTransform.d.ts +1 -0
  159. package/node_modules/@smithy/core/dist-types/submodules/serde/generateIdempotencyToken.d.ts +2 -0
  160. package/node_modules/@smithy/core/dist-types/submodules/serde/index.d.ts +1 -0
  161. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/CborCodec.d.ts +5 -0
  162. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/HttpBindingProtocol.d.ts +9 -1
  163. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/HttpProtocol.d.ts +3 -1
  164. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/NormalizedSchema.d.ts +5 -0
  165. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/copyDocumentWithTransform.d.ts +1 -0
  166. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/generateIdempotencyToken.d.ts +2 -0
  167. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.d.ts +1 -0
  168. package/node_modules/@smithy/core/package.json +9 -7
  169. package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
  170. package/node_modules/@smithy/eventstream-codec/package.json +2 -2
  171. package/node_modules/@smithy/eventstream-serde-browser/package.json +3 -3
  172. package/node_modules/@smithy/eventstream-serde-config-resolver/package.json +2 -2
  173. package/node_modules/@smithy/eventstream-serde-node/package.json +3 -3
  174. package/node_modules/@smithy/eventstream-serde-universal/package.json +3 -3
  175. package/node_modules/@smithy/fetch-http-handler/package.json +5 -5
  176. package/node_modules/@smithy/hash-blob-browser/package.json +2 -2
  177. package/node_modules/@smithy/hash-node/package.json +2 -2
  178. package/node_modules/@smithy/hash-stream-node/package.json +2 -2
  179. package/node_modules/@smithy/invalid-dependency/package.json +2 -2
  180. package/node_modules/@smithy/md5-js/package.json +2 -2
  181. package/node_modules/@smithy/middleware-content-length/package.json +3 -3
  182. package/node_modules/@smithy/middleware-endpoint/package.json +8 -8
  183. package/node_modules/@smithy/middleware-retry/package.json +9 -9
  184. package/node_modules/@smithy/middleware-serde/package.json +3 -3
  185. package/node_modules/@smithy/middleware-stack/package.json +2 -2
  186. package/node_modules/@smithy/node-config-provider/package.json +4 -4
  187. package/node_modules/@smithy/node-http-handler/package.json +5 -5
  188. package/node_modules/@smithy/property-provider/package.json +2 -2
  189. package/node_modules/@smithy/protocol-http/package.json +2 -2
  190. package/node_modules/@smithy/querystring-builder/package.json +2 -2
  191. package/node_modules/@smithy/querystring-parser/package.json +2 -2
  192. package/node_modules/@smithy/service-error-classification/package.json +2 -2
  193. package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
  194. package/node_modules/@smithy/signature-v4/package.json +4 -4
  195. package/node_modules/@smithy/smithy-client/dist-cjs/index.js +1 -0
  196. package/node_modules/@smithy/smithy-client/package.json +7 -7
  197. package/node_modules/@smithy/types/dist-types/schema/schema.d.ts +1 -0
  198. package/node_modules/@smithy/types/dist-types/ts3.4/schema/schema.d.ts +1 -0
  199. package/node_modules/@smithy/types/package.json +1 -1
  200. package/node_modules/@smithy/url-parser/package.json +3 -3
  201. package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
  202. package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
  203. package/node_modules/@smithy/util-endpoints/package.json +3 -3
  204. package/node_modules/@smithy/util-middleware/package.json +2 -2
  205. package/node_modules/@smithy/util-retry/package.json +3 -3
  206. package/node_modules/@smithy/util-stream/package.json +4 -4
  207. package/node_modules/@smithy/util-waiter/package.json +3 -3
  208. package/node_modules/bowser/CHANGELOG.md +1 -1
  209. package/node_modules/bowser/README.md +2 -4
  210. package/node_modules/bowser/bundled.js +1 -1
  211. package/node_modules/bowser/es5.js +1 -1
  212. package/node_modules/bowser/index.d.ts +72 -7
  213. package/node_modules/bowser/package.json +4 -3
  214. package/node_modules/bowser/src/constants.js +3 -0
  215. package/node_modules/bowser/src/parser-browsers.js +15 -0
  216. package/node_modules/bowser/src/parser-platforms.js +17 -1
  217. package/node_modules/bowser/src/parser.js +20 -5
  218. package/node_modules/bowser/src/utils.js +2 -2
  219. package/node_modules/follow-redirects/package.json +1 -1
  220. package/node_modules/oidc-token-hash/README.md +1 -0
  221. package/node_modules/oidc-token-hash/lib/index.js +0 -10
  222. package/node_modules/oidc-token-hash/package.json +1 -1
  223. package/package.json +16 -16
  224. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-add-secondary-index.js.snapshot/asset.a0c6248ec595d3ceec1177aa5ac5b494fdf4c66f1b88aa48086befd44f193d8c/index.js +0 -21
  225. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200/__entrypoint__.js +0 -1
  226. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200/index.js +0 -1
  227. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithExistingVpc.js.snapshot/asset.a0c6248ec595d3ceec1177aa5ac5b494fdf4c66f1b88aa48086befd44f193d8c/index.js +0 -21
  228. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200/__entrypoint__.js +0 -1
  229. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200/index.js +0 -1
  230. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-deployFunctionWithVpc.js.snapshot/asset.a0c6248ec595d3ceec1177aa5ac5b494fdf4c66f1b88aa48086befd44f193d8c/index.js +0 -21
  231. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-no-arguments.js.snapshot/asset.a0c6248ec595d3ceec1177aa5ac5b494fdf4c66f1b88aa48086befd44f193d8c/index.js +0 -21
  232. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-point-in-time-recovery.js.snapshot/asset.a0c6248ec595d3ceec1177aa5ac5b494fdf4c66f1b88aa48086befd44f193d8c/index.js +0 -21
  233. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-set-billing-mode.js.snapshot/asset.a0c6248ec595d3ceec1177aa5ac5b494fdf4c66f1b88aa48086befd44f193d8c/index.js +0 -21
  234. package/node_modules/@aws-solutions-constructs/aws-lambda-dynamodb/test/integ.lamddb-use-existing-func.js.snapshot/asset.a0c6248ec595d3ceec1177aa5ac5b494fdf4c66f1b88aa48086befd44f193d8c/index.js +0 -21
  235. package/node_modules/oidc-token-hash/lib/shake256.js +0 -7
@@ -792,6 +792,7 @@ var import_util_middleware = require("@smithy/util-middleware");
792
792
  // src/submodules/cbor/CborCodec.ts
793
793
  var import_schema = require("@smithy/core/schema");
794
794
  var import_serde3 = require("@smithy/core/serde");
795
+ var import_util_base64 = require("@smithy/util-base64");
795
796
  var CborCodec = class {
796
797
  createSerializer() {
797
798
  const serializer = new CborShapeSerializer();
@@ -812,35 +813,73 @@ var CborShapeSerializer = class {
812
813
  this.serdeContext = serdeContext;
813
814
  }
814
815
  write(schema, value) {
815
- this.value = (0, import_serde3.copyDocumentWithTransform)(value, schema, (_, schemaRef) => {
816
- if (_ instanceof Date) {
817
- return dateToTag(_);
816
+ this.value = this.serialize(schema, value);
817
+ }
818
+ /**
819
+ * Recursive serializer transform that copies and prepares the user input object
820
+ * for CBOR serialization.
821
+ */
822
+ serialize(schema, source) {
823
+ const ns = import_schema.NormalizedSchema.of(schema);
824
+ if (source == null) {
825
+ if (ns.isIdempotencyToken()) {
826
+ return (0, import_serde3.generateIdempotencyToken)();
818
827
  }
819
- if (_ instanceof Uint8Array) {
820
- return _;
828
+ return source;
829
+ }
830
+ if (ns.isBlobSchema()) {
831
+ if (typeof source === "string") {
832
+ return (this.serdeContext?.base64Decoder ?? import_util_base64.fromBase64)(source);
821
833
  }
822
- const ns = import_schema.NormalizedSchema.of(schemaRef);
823
- const sparse = !!ns.getMergedTraits().sparse;
824
- if (ns.isListSchema() && Array.isArray(_)) {
825
- if (!sparse) {
826
- return _.filter((item) => item != null);
834
+ return source;
835
+ }
836
+ if (ns.isTimestampSchema()) {
837
+ if (typeof source === "number" || typeof source === "bigint") {
838
+ return dateToTag(new Date(Number(source) / 1e3 | 0));
839
+ }
840
+ return dateToTag(source);
841
+ }
842
+ if (typeof source === "function" || typeof source === "object") {
843
+ const sourceObject = source;
844
+ if (ns.isListSchema() && Array.isArray(sourceObject)) {
845
+ const sparse = !!ns.getMergedTraits().sparse;
846
+ const newArray = [];
847
+ let i = 0;
848
+ for (const item of sourceObject) {
849
+ const value = this.serialize(ns.getValueSchema(), item);
850
+ if (value != null || sparse) {
851
+ newArray[i++] = value;
852
+ }
827
853
  }
828
- } else if (_ && typeof _ === "object") {
829
- const members = ns.getMemberSchemas();
830
- const isStruct = ns.isStructSchema();
831
- if (!sparse || isStruct) {
832
- for (const [k, v] of Object.entries(_)) {
833
- const filteredOutByNonSparse = !sparse && v == null;
834
- const filteredOutByUnrecognizedMember = isStruct && !(k in members);
835
- if (filteredOutByNonSparse || filteredOutByUnrecognizedMember) {
836
- delete _[k];
837
- }
854
+ return newArray;
855
+ }
856
+ if (sourceObject instanceof Date) {
857
+ return dateToTag(sourceObject);
858
+ }
859
+ const newObject = {};
860
+ if (ns.isMapSchema()) {
861
+ const sparse = !!ns.getMergedTraits().sparse;
862
+ for (const key of Object.keys(sourceObject)) {
863
+ const value = this.serialize(ns.getValueSchema(), sourceObject[key]);
864
+ if (value != null || sparse) {
865
+ newObject[key] = value;
838
866
  }
839
- return _;
867
+ }
868
+ } else if (ns.isStructSchema()) {
869
+ for (const [key, memberSchema] of ns.structIterator()) {
870
+ const value = this.serialize(memberSchema, sourceObject[key]);
871
+ if (value != null) {
872
+ newObject[key] = value;
873
+ }
874
+ }
875
+ } else if (ns.isDocumentSchema()) {
876
+ for (const key of Object.keys(sourceObject)) {
877
+ newObject[key] = this.serialize(ns.getValueSchema(), sourceObject[key]);
840
878
  }
841
879
  }
842
- return _;
843
- });
880
+ return newObject;
881
+ }
882
+ return source;
844
883
  }
845
884
  flush() {
846
885
  const buffer = cbor.serialize(this.value);
@@ -858,14 +897,14 @@ var CborShapeDeserializer = class {
858
897
  }
859
898
  readValue(_schema, value) {
860
899
  const ns = import_schema.NormalizedSchema.of(_schema);
861
- const schema = ns.getSchema();
862
- if (typeof schema === "number") {
863
- if (ns.isTimestampSchema()) {
864
- return (0, import_serde3.parseEpochTimestamp)(value);
865
- }
866
- if (ns.isBlobSchema()) {
867
- return value;
900
+ if (ns.isTimestampSchema() && typeof value === "number") {
901
+ return (0, import_serde3.parseEpochTimestamp)(value);
902
+ }
903
+ if (ns.isBlobSchema()) {
904
+ if (typeof value === "string") {
905
+ return (this.serdeContext?.base64Decoder ?? import_util_base64.fromBase64)(value);
868
906
  }
907
+ return value;
869
908
  }
870
909
  if (typeof value === "undefined" || typeof value === "boolean" || typeof value === "number" || typeof value === "string" || typeof value === "bigint" || typeof value === "symbol") {
871
910
  return value;
@@ -885,23 +924,23 @@ var CborShapeDeserializer = class {
885
924
  if (ns.isListSchema()) {
886
925
  const newArray = [];
887
926
  const memberSchema = ns.getValueSchema();
888
- const sparse = ns.isListSchema() && !!ns.getMergedTraits().sparse;
927
+ const sparse = !!ns.getMergedTraits().sparse;
889
928
  for (const item of value) {
890
- newArray.push(this.readValue(memberSchema, item));
891
- if (!sparse && newArray[newArray.length - 1] == null) {
892
- newArray.pop();
929
+ const itemValue = this.readValue(memberSchema, item);
930
+ if (itemValue != null || sparse) {
931
+ newArray.push(itemValue);
893
932
  }
894
933
  }
895
934
  return newArray;
896
935
  }
897
936
  const newObject = {};
898
937
  if (ns.isMapSchema()) {
899
- const sparse = ns.getMergedTraits().sparse;
938
+ const sparse = !!ns.getMergedTraits().sparse;
900
939
  const targetSchema = ns.getValueSchema();
901
940
  for (const key of Object.keys(value)) {
902
- newObject[key] = this.readValue(targetSchema, value[key]);
903
- if (newObject[key] == null && !sparse) {
904
- delete newObject[key];
941
+ const itemValue = this.readValue(targetSchema, value[key]);
942
+ if (itemValue != null || sparse) {
943
+ newObject[key] = itemValue;
905
944
  }
906
945
  }
907
946
  } else if (ns.isStructSchema()) {
@@ -56,13 +56,13 @@ function extendedEncodeURIComponent(str) {
56
56
 
57
57
  // src/submodules/protocols/HttpBindingProtocol.ts
58
58
  var import_schema2 = require("@smithy/core/schema");
59
+ var import_serde = require("@smithy/core/serde");
59
60
  var import_protocol_http2 = require("@smithy/protocol-http");
61
+ var import_util_stream2 = require("@smithy/util-stream");
60
62
 
61
63
  // src/submodules/protocols/HttpProtocol.ts
62
64
  var import_schema = require("@smithy/core/schema");
63
- var import_serde = require("@smithy/core/serde");
64
65
  var import_protocol_http = require("@smithy/protocol-http");
65
- var import_util_stream2 = require("@smithy/util-stream");
66
66
  var HttpProtocol = class {
67
67
  constructor(options) {
68
68
  this.options = options;
@@ -137,89 +137,7 @@ var HttpProtocol = class {
137
137
  };
138
138
  }
139
139
  async deserializeHttpMessage(schema, context, response, arg4, arg5) {
140
- let dataObject;
141
- if (arg4 instanceof Set) {
142
- dataObject = arg5;
143
- } else {
144
- dataObject = arg4;
145
- }
146
- const deserializer = this.deserializer;
147
- const ns = import_schema.NormalizedSchema.of(schema);
148
- const nonHttpBindingMembers = [];
149
- for (const [memberName, memberSchema] of ns.structIterator()) {
150
- const memberTraits = memberSchema.getMemberTraits();
151
- if (memberTraits.httpPayload) {
152
- const isStreaming = memberSchema.isStreaming();
153
- if (isStreaming) {
154
- const isEventStream = memberSchema.isStructSchema();
155
- if (isEventStream) {
156
- const context2 = this.serdeContext;
157
- if (!context2.eventStreamMarshaller) {
158
- throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");
159
- }
160
- const memberSchemas = memberSchema.getMemberSchemas();
161
- dataObject[memberName] = context2.eventStreamMarshaller.deserialize(response.body, async (event) => {
162
- const unionMember = Object.keys(event).find((key) => {
163
- return key !== "__type";
164
- }) ?? "";
165
- if (unionMember in memberSchemas) {
166
- const eventStreamSchema = memberSchemas[unionMember];
167
- return {
168
- [unionMember]: await deserializer.read(eventStreamSchema, event[unionMember].body)
169
- };
170
- } else {
171
- return {
172
- $unknown: event
173
- };
174
- }
175
- });
176
- } else {
177
- dataObject[memberName] = (0, import_util_stream2.sdkStreamMixin)(response.body);
178
- }
179
- } else if (response.body) {
180
- const bytes = await collectBody(response.body, context);
181
- if (bytes.byteLength > 0) {
182
- dataObject[memberName] = await deserializer.read(memberSchema, bytes);
183
- }
184
- }
185
- } else if (memberTraits.httpHeader) {
186
- const key = String(memberTraits.httpHeader).toLowerCase();
187
- const value = response.headers[key];
188
- if (null != value) {
189
- if (memberSchema.isListSchema()) {
190
- const headerListValueSchema = memberSchema.getValueSchema();
191
- let sections;
192
- if (headerListValueSchema.isTimestampSchema() && headerListValueSchema.getSchema() === import_schema.SCHEMA.TIMESTAMP_DEFAULT) {
193
- sections = (0, import_serde.splitEvery)(value, ",", 2);
194
- } else {
195
- sections = (0, import_serde.splitHeader)(value);
196
- }
197
- const list = [];
198
- for (const section of sections) {
199
- list.push(await deserializer.read([headerListValueSchema, { httpHeader: key }], section.trim()));
200
- }
201
- dataObject[memberName] = list;
202
- } else {
203
- dataObject[memberName] = await deserializer.read(memberSchema, value);
204
- }
205
- }
206
- } else if (memberTraits.httpPrefixHeaders !== void 0) {
207
- dataObject[memberName] = {};
208
- for (const [header, value] of Object.entries(response.headers)) {
209
- if (header.startsWith(memberTraits.httpPrefixHeaders)) {
210
- dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(
211
- [memberSchema.getValueSchema(), { httpHeader: header }],
212
- value
213
- );
214
- }
215
- }
216
- } else if (memberTraits.httpResponseCode) {
217
- dataObject[memberName] = response.statusCode;
218
- } else {
219
- nonHttpBindingMembers.push(memberName);
220
- }
221
- }
222
- return nonHttpBindingMembers;
140
+ return [];
223
141
  }
224
142
  };
225
143
 
@@ -395,6 +313,91 @@ var HttpBindingProtocol = class extends HttpProtocol {
395
313
  };
396
314
  return output;
397
315
  }
316
+ async deserializeHttpMessage(schema, context, response, arg4, arg5) {
317
+ let dataObject;
318
+ if (arg4 instanceof Set) {
319
+ dataObject = arg5;
320
+ } else {
321
+ dataObject = arg4;
322
+ }
323
+ const deserializer = this.deserializer;
324
+ const ns = import_schema2.NormalizedSchema.of(schema);
325
+ const nonHttpBindingMembers = [];
326
+ for (const [memberName, memberSchema] of ns.structIterator()) {
327
+ const memberTraits = memberSchema.getMemberTraits();
328
+ if (memberTraits.httpPayload) {
329
+ const isStreaming = memberSchema.isStreaming();
330
+ if (isStreaming) {
331
+ const isEventStream = memberSchema.isStructSchema();
332
+ if (isEventStream) {
333
+ const context2 = this.serdeContext;
334
+ if (!context2.eventStreamMarshaller) {
335
+ throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");
336
+ }
337
+ const memberSchemas = memberSchema.getMemberSchemas();
338
+ dataObject[memberName] = context2.eventStreamMarshaller.deserialize(response.body, async (event) => {
339
+ const unionMember = Object.keys(event).find((key) => {
340
+ return key !== "__type";
341
+ }) ?? "";
342
+ if (unionMember in memberSchemas) {
343
+ const eventStreamSchema = memberSchemas[unionMember];
344
+ return {
345
+ [unionMember]: await deserializer.read(eventStreamSchema, event[unionMember].body)
346
+ };
347
+ } else {
348
+ return {
349
+ $unknown: event
350
+ };
351
+ }
352
+ });
353
+ } else {
354
+ dataObject[memberName] = (0, import_util_stream2.sdkStreamMixin)(response.body);
355
+ }
356
+ } else if (response.body) {
357
+ const bytes = await collectBody(response.body, context);
358
+ if (bytes.byteLength > 0) {
359
+ dataObject[memberName] = await deserializer.read(memberSchema, bytes);
360
+ }
361
+ }
362
+ } else if (memberTraits.httpHeader) {
363
+ const key = String(memberTraits.httpHeader).toLowerCase();
364
+ const value = response.headers[key];
365
+ if (null != value) {
366
+ if (memberSchema.isListSchema()) {
367
+ const headerListValueSchema = memberSchema.getValueSchema();
368
+ let sections;
369
+ if (headerListValueSchema.isTimestampSchema() && headerListValueSchema.getSchema() === import_schema2.SCHEMA.TIMESTAMP_DEFAULT) {
370
+ sections = (0, import_serde.splitEvery)(value, ",", 2);
371
+ } else {
372
+ sections = (0, import_serde.splitHeader)(value);
373
+ }
374
+ const list = [];
375
+ for (const section of sections) {
376
+ list.push(await deserializer.read([headerListValueSchema, { httpHeader: key }], section.trim()));
377
+ }
378
+ dataObject[memberName] = list;
379
+ } else {
380
+ dataObject[memberName] = await deserializer.read(memberSchema, value);
381
+ }
382
+ }
383
+ } else if (memberTraits.httpPrefixHeaders !== void 0) {
384
+ dataObject[memberName] = {};
385
+ for (const [header, value] of Object.entries(response.headers)) {
386
+ if (header.startsWith(memberTraits.httpPrefixHeaders)) {
387
+ dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(
388
+ [memberSchema.getValueSchema(), { httpHeader: header }],
389
+ value
390
+ );
391
+ }
392
+ }
393
+ } else if (memberTraits.httpResponseCode) {
394
+ dataObject[memberName] = response.statusCode;
395
+ } else {
396
+ nonHttpBindingMembers.push(memberName);
397
+ }
398
+ }
399
+ return nonHttpBindingMembers;
400
+ }
398
401
  };
399
402
 
400
403
  // src/submodules/protocols/RpcProtocol.ts
@@ -658,6 +658,18 @@ var NormalizedSchema = class _NormalizedSchema {
658
658
  }
659
659
  return this.getSchema() === SCHEMA.STREAMING_BLOB;
660
660
  }
661
+ /**
662
+ * This is a shortcut to avoid calling `getMergedTraits().idempotencyToken` on every string.
663
+ * @returns whether the schema has the idempotencyToken trait.
664
+ */
665
+ isIdempotencyToken() {
666
+ if (typeof this.traits === "number") {
667
+ return (this.traits & 4) === 4;
668
+ } else if (typeof this.traits === "object") {
669
+ return !!this.traits.idempotencyToken;
670
+ }
671
+ return false;
672
+ }
661
673
  /**
662
674
  * @returns own traits merged with member traits, where member traits of the same trait key take priority.
663
675
  * This method is cached.
@@ -35,6 +35,7 @@ __export(serde_exports, {
35
35
  expectShort: () => expectShort,
36
36
  expectString: () => expectString,
37
37
  expectUnion: () => expectUnion,
38
+ generateIdempotencyToken: () => import_uuid.v4,
38
39
  handleFloat: () => handleFloat,
39
40
  limitedParseDouble: () => limitedParseDouble,
40
41
  limitedParseFloat: () => limitedParseFloat,
@@ -61,57 +62,7 @@ __export(serde_exports, {
61
62
  module.exports = __toCommonJS(serde_exports);
62
63
 
63
64
  // src/submodules/serde/copyDocumentWithTransform.ts
64
- var import_schema = require("@smithy/core/schema");
65
- var copyDocumentWithTransform = (source, schemaRef, transform = (_) => _) => {
66
- const ns = import_schema.NormalizedSchema.of(schemaRef);
67
- switch (typeof source) {
68
- case "undefined":
69
- case "boolean":
70
- case "number":
71
- case "string":
72
- case "bigint":
73
- case "symbol":
74
- return transform(source, ns);
75
- case "function":
76
- case "object":
77
- if (source === null) {
78
- return transform(null, ns);
79
- }
80
- if (Array.isArray(source)) {
81
- const newArray = new Array(source.length);
82
- let i = 0;
83
- for (const item of source) {
84
- newArray[i++] = copyDocumentWithTransform(item, ns.getValueSchema(), transform);
85
- }
86
- return transform(newArray, ns);
87
- }
88
- if ("byteLength" in source) {
89
- const newBytes = new Uint8Array(source.byteLength);
90
- newBytes.set(source, 0);
91
- return transform(newBytes, ns);
92
- }
93
- if (source instanceof Date) {
94
- return transform(source, ns);
95
- }
96
- const newObject = {};
97
- if (ns.isMapSchema()) {
98
- for (const key of Object.keys(source)) {
99
- newObject[key] = copyDocumentWithTransform(source[key], ns.getValueSchema(), transform);
100
- }
101
- } else if (ns.isStructSchema()) {
102
- for (const [key, memberSchema] of ns.structIterator()) {
103
- newObject[key] = copyDocumentWithTransform(source[key], memberSchema, transform);
104
- }
105
- } else if (ns.isDocumentSchema()) {
106
- for (const key of Object.keys(source)) {
107
- newObject[key] = copyDocumentWithTransform(source[key], ns.getValueSchema(), transform);
108
- }
109
- }
110
- return transform(newObject, ns);
111
- default:
112
- return transform(source, ns);
113
- }
114
- };
65
+ var copyDocumentWithTransform = (source, schemaRef, transform = (_) => _) => source;
115
66
 
116
67
  // src/submodules/serde/parse-utils.ts
117
68
  var parseBoolean = (value) => {
@@ -566,6 +517,9 @@ var stripLeadingZeroes = (value) => {
566
517
  return value.slice(idx);
567
518
  };
568
519
 
520
+ // src/submodules/serde/generateIdempotencyToken.ts
521
+ var import_uuid = require("uuid");
522
+
569
523
  // src/submodules/serde/lazy-json.ts
570
524
  var LazyJsonString = function LazyJsonString2(val) {
571
525
  const str = Object.assign(new String(val), {
@@ -730,6 +684,7 @@ function nv(input) {
730
684
  expectShort,
731
685
  expectString,
732
686
  expectUnion,
687
+ generateIdempotencyToken,
733
688
  handleFloat,
734
689
  limitedParseDouble,
735
690
  limitedParseFloat,
@@ -1,5 +1,6 @@
1
1
  import { NormalizedSchema } from "@smithy/core/schema";
2
- import { copyDocumentWithTransform, parseEpochTimestamp } from "@smithy/core/serde";
2
+ import { generateIdempotencyToken, parseEpochTimestamp } from "@smithy/core/serde";
3
+ import { fromBase64 } from "@smithy/util-base64";
3
4
  import { cbor } from "./cbor";
4
5
  import { dateToTag } from "./parseCborBody";
5
6
  export class CborCodec {
@@ -22,36 +23,71 @@ export class CborShapeSerializer {
22
23
  this.serdeContext = serdeContext;
23
24
  }
24
25
  write(schema, value) {
25
- this.value = copyDocumentWithTransform(value, schema, (_, schemaRef) => {
26
- if (_ instanceof Date) {
27
- return dateToTag(_);
28
- }
29
- if (_ instanceof Uint8Array) {
30
- return _;
31
- }
32
- const ns = NormalizedSchema.of(schemaRef);
33
- const sparse = !!ns.getMergedTraits().sparse;
34
- if (ns.isListSchema() && Array.isArray(_)) {
35
- if (!sparse) {
36
- return _.filter((item) => item != null);
26
+ this.value = this.serialize(schema, value);
27
+ }
28
+ serialize(schema, source) {
29
+ const ns = NormalizedSchema.of(schema);
30
+ if (source == null) {
31
+ if (ns.isIdempotencyToken()) {
32
+ return generateIdempotencyToken();
33
+ }
34
+ return source;
35
+ }
36
+ if (ns.isBlobSchema()) {
37
+ if (typeof source === "string") {
38
+ return (this.serdeContext?.base64Decoder ?? fromBase64)(source);
39
+ }
40
+ return source;
41
+ }
42
+ if (ns.isTimestampSchema()) {
43
+ if (typeof source === "number" || typeof source === "bigint") {
44
+ return dateToTag(new Date((Number(source) / 1000) | 0));
45
+ }
46
+ return dateToTag(source);
47
+ }
48
+ if (typeof source === "function" || typeof source === "object") {
49
+ const sourceObject = source;
50
+ if (ns.isListSchema() && Array.isArray(sourceObject)) {
51
+ const sparse = !!ns.getMergedTraits().sparse;
52
+ const newArray = [];
53
+ let i = 0;
54
+ for (const item of sourceObject) {
55
+ const value = this.serialize(ns.getValueSchema(), item);
56
+ if (value != null || sparse) {
57
+ newArray[i++] = value;
58
+ }
59
+ }
60
+ return newArray;
61
+ }
62
+ if (sourceObject instanceof Date) {
63
+ return dateToTag(sourceObject);
64
+ }
65
+ const newObject = {};
66
+ if (ns.isMapSchema()) {
67
+ const sparse = !!ns.getMergedTraits().sparse;
68
+ for (const key of Object.keys(sourceObject)) {
69
+ const value = this.serialize(ns.getValueSchema(), sourceObject[key]);
70
+ if (value != null || sparse) {
71
+ newObject[key] = value;
72
+ }
37
73
  }
38
74
  }
39
- else if (_ && typeof _ === "object") {
40
- const members = ns.getMemberSchemas();
41
- const isStruct = ns.isStructSchema();
42
- if (!sparse || isStruct) {
43
- for (const [k, v] of Object.entries(_)) {
44
- const filteredOutByNonSparse = !sparse && v == null;
45
- const filteredOutByUnrecognizedMember = isStruct && !(k in members);
46
- if (filteredOutByNonSparse || filteredOutByUnrecognizedMember) {
47
- delete _[k];
48
- }
75
+ else if (ns.isStructSchema()) {
76
+ for (const [key, memberSchema] of ns.structIterator()) {
77
+ const value = this.serialize(memberSchema, sourceObject[key]);
78
+ if (value != null) {
79
+ newObject[key] = value;
49
80
  }
50
- return _;
51
81
  }
52
82
  }
53
- return _;
54
- });
83
+ else if (ns.isDocumentSchema()) {
84
+ for (const key of Object.keys(sourceObject)) {
85
+ newObject[key] = this.serialize(ns.getValueSchema(), sourceObject[key]);
86
+ }
87
+ }
88
+ return newObject;
89
+ }
90
+ return source;
55
91
  }
56
92
  flush() {
57
93
  const buffer = cbor.serialize(this.value);
@@ -69,14 +105,14 @@ export class CborShapeDeserializer {
69
105
  }
70
106
  readValue(_schema, value) {
71
107
  const ns = NormalizedSchema.of(_schema);
72
- const schema = ns.getSchema();
73
- if (typeof schema === "number") {
74
- if (ns.isTimestampSchema()) {
75
- return parseEpochTimestamp(value);
76
- }
77
- if (ns.isBlobSchema()) {
78
- return value;
108
+ if (ns.isTimestampSchema() && typeof value === "number") {
109
+ return parseEpochTimestamp(value);
110
+ }
111
+ if (ns.isBlobSchema()) {
112
+ if (typeof value === "string") {
113
+ return (this.serdeContext?.base64Decoder ?? fromBase64)(value);
79
114
  }
115
+ return value;
80
116
  }
81
117
  if (typeof value === "undefined" ||
82
118
  typeof value === "boolean" ||
@@ -102,23 +138,23 @@ export class CborShapeDeserializer {
102
138
  if (ns.isListSchema()) {
103
139
  const newArray = [];
104
140
  const memberSchema = ns.getValueSchema();
105
- const sparse = ns.isListSchema() && !!ns.getMergedTraits().sparse;
141
+ const sparse = !!ns.getMergedTraits().sparse;
106
142
  for (const item of value) {
107
- newArray.push(this.readValue(memberSchema, item));
108
- if (!sparse && newArray[newArray.length - 1] == null) {
109
- newArray.pop();
143
+ const itemValue = this.readValue(memberSchema, item);
144
+ if (itemValue != null || sparse) {
145
+ newArray.push(itemValue);
110
146
  }
111
147
  }
112
148
  return newArray;
113
149
  }
114
150
  const newObject = {};
115
151
  if (ns.isMapSchema()) {
116
- const sparse = ns.getMergedTraits().sparse;
152
+ const sparse = !!ns.getMergedTraits().sparse;
117
153
  const targetSchema = ns.getValueSchema();
118
154
  for (const key of Object.keys(value)) {
119
- newObject[key] = this.readValue(targetSchema, value[key]);
120
- if (newObject[key] == null && !sparse) {
121
- delete newObject[key];
155
+ const itemValue = this.readValue(targetSchema, value[key]);
156
+ if (itemValue != null || sparse) {
157
+ newObject[key] = itemValue;
122
158
  }
123
159
  }
124
160
  }