@aws-sdk/core 3.901.0 → 3.906.0

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 (25) hide show
  1. package/dist-cjs/index.js +1969 -6
  2. package/dist-cjs/submodules/account-id-endpoint/index.js +48 -88
  3. package/dist-cjs/submodules/client/index.js +35 -74
  4. package/dist-cjs/submodules/httpAuthSchemes/index.js +273 -365
  5. package/dist-cjs/submodules/protocols/index.js +1581 -1863
  6. package/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +2 -2
  7. package/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +2 -2
  8. package/dist-es/submodules/protocols/json/JsonShapeDeserializer.js +4 -4
  9. package/dist-es/submodules/protocols/json/JsonShapeSerializer.js +4 -4
  10. package/dist-es/submodules/protocols/query/AwsQueryProtocol.js +3 -3
  11. package/dist-es/submodules/protocols/query/QueryShapeSerializer.js +4 -4
  12. package/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js +2 -2
  13. package/dist-es/submodules/protocols/xml/XmlShapeSerializer.js +4 -4
  14. package/dist-types/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.d.ts +1 -1
  15. package/dist-types/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.d.ts +1 -1
  16. package/dist-types/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.d.ts +1 -1
  17. package/dist-types/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.d.ts +1 -1
  18. package/dist-types/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.d.ts +1 -1
  19. package/dist-types/submodules/protocols/ConfigurableSerdeContext.d.ts +1 -1
  20. package/dist-types/submodules/protocols/json/JsonCodec.d.ts +1 -1
  21. package/dist-types/submodules/protocols/json/JsonShapeDeserializer.d.ts +1 -1
  22. package/dist-types/submodules/protocols/json/JsonShapeSerializer.d.ts +2 -2
  23. package/dist-types/submodules/protocols/query/QuerySerializerSettings.d.ts +1 -1
  24. package/dist-types/submodules/protocols/xml/XmlCodec.d.ts +1 -1
  25. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { RpcProtocol } from "@smithy/core/protocols";
2
- import { deref, NormalizedSchema, SCHEMA, TypeRegistry } from "@smithy/core/schema";
2
+ import { deref, NormalizedSchema, TypeRegistry } from "@smithy/core/schema";
3
3
  import { ProtocolLib } from "../ProtocolLib";
4
4
  import { JsonCodec } from "./JsonCodec";
5
5
  import { loadRestJsonErrorCode } from "./parseJsonBody";
@@ -18,7 +18,7 @@ export class AwsJsonRpcProtocol extends RpcProtocol {
18
18
  this.codec = new JsonCodec({
19
19
  timestampFormat: {
20
20
  useTrait: true,
21
- default: SCHEMA.TIMESTAMP_EPOCH_SECONDS,
21
+ default: 7,
22
22
  },
23
23
  jsonName: false,
24
24
  });
@@ -1,5 +1,5 @@
1
1
  import { HttpBindingProtocol, HttpInterceptingShapeDeserializer, HttpInterceptingShapeSerializer, } from "@smithy/core/protocols";
2
- import { NormalizedSchema, SCHEMA, TypeRegistry } from "@smithy/core/schema";
2
+ import { NormalizedSchema, TypeRegistry } from "@smithy/core/schema";
3
3
  import { ProtocolLib } from "../ProtocolLib";
4
4
  import { JsonCodec } from "./JsonCodec";
5
5
  import { loadRestJsonErrorCode } from "./parseJsonBody";
@@ -15,7 +15,7 @@ export class AwsRestJsonProtocol extends HttpBindingProtocol {
15
15
  const settings = {
16
16
  timestampFormat: {
17
17
  useTrait: true,
18
- default: SCHEMA.TIMESTAMP_EPOCH_SECONDS,
18
+ default: 7,
19
19
  },
20
20
  httpBindings: true,
21
21
  jsonName: true,
@@ -1,5 +1,5 @@
1
1
  import { determineTimestampFormat } from "@smithy/core/protocols";
2
- import { NormalizedSchema, SCHEMA } from "@smithy/core/schema";
2
+ import { NormalizedSchema } from "@smithy/core/schema";
3
3
  import { LazyJsonString, NumericValue, parseEpochTimestamp, parseRfc3339DateTimeWithOffset, parseRfc7231DateTime, } from "@smithy/core/serde";
4
4
  import { fromBase64 } from "@smithy/util-base64";
5
5
  import { SerdeContextConfig } from "../ConfigurableSerdeContext";
@@ -66,11 +66,11 @@ export class JsonShapeDeserializer extends SerdeContextConfig {
66
66
  if (ns.isTimestampSchema() && value != null) {
67
67
  const format = determineTimestampFormat(ns, this.settings);
68
68
  switch (format) {
69
- case SCHEMA.TIMESTAMP_DATE_TIME:
69
+ case 5:
70
70
  return parseRfc3339DateTimeWithOffset(value);
71
- case SCHEMA.TIMESTAMP_HTTP_DATE:
71
+ case 6:
72
72
  return parseRfc7231DateTime(value);
73
- case SCHEMA.TIMESTAMP_EPOCH_SECONDS:
73
+ case 7:
74
74
  return parseEpochTimestamp(value);
75
75
  default:
76
76
  console.warn("Missing timestamp format, parsing value with Date constructor:", value);
@@ -1,5 +1,5 @@
1
1
  import { determineTimestampFormat } from "@smithy/core/protocols";
2
- import { NormalizedSchema, SCHEMA } from "@smithy/core/schema";
2
+ import { NormalizedSchema } from "@smithy/core/schema";
3
3
  import { dateToUtcString, generateIdempotencyToken, LazyJsonString, NumericValue } from "@smithy/core/serde";
4
4
  import { toBase64 } from "@smithy/util-base64";
5
5
  import { SerdeContextConfig } from "../ConfigurableSerdeContext";
@@ -83,11 +83,11 @@ export class JsonShapeSerializer extends SerdeContextConfig {
83
83
  if ((ns.isTimestampSchema() || ns.isDocumentSchema()) && value instanceof Date) {
84
84
  const format = determineTimestampFormat(ns, this.settings);
85
85
  switch (format) {
86
- case SCHEMA.TIMESTAMP_DATE_TIME:
86
+ case 5:
87
87
  return value.toISOString().replace(".000Z", "Z");
88
- case SCHEMA.TIMESTAMP_HTTP_DATE:
88
+ case 6:
89
89
  return dateToUtcString(value);
90
- case SCHEMA.TIMESTAMP_EPOCH_SECONDS:
90
+ case 7:
91
91
  return value.getTime() / 1000;
92
92
  default:
93
93
  console.warn("Missing timestamp format, using epoch seconds", value);
@@ -1,5 +1,5 @@
1
1
  import { collectBody, RpcProtocol } from "@smithy/core/protocols";
2
- import { deref, NormalizedSchema, SCHEMA, TypeRegistry } from "@smithy/core/schema";
2
+ import { deref, NormalizedSchema, TypeRegistry } from "@smithy/core/schema";
3
3
  import { ProtocolLib } from "../ProtocolLib";
4
4
  import { XmlShapeDeserializer } from "../xml/XmlShapeDeserializer";
5
5
  import { QueryShapeSerializer } from "./QueryShapeSerializer";
@@ -16,7 +16,7 @@ export class AwsQueryProtocol extends RpcProtocol {
16
16
  const settings = {
17
17
  timestampFormat: {
18
18
  useTrait: true,
19
- default: SCHEMA.TIMESTAMP_DATE_TIME,
19
+ default: 5,
20
20
  },
21
21
  httpBindings: false,
22
22
  xmlNamespace: options.xmlNamespace,
@@ -61,7 +61,7 @@ export class AwsQueryProtocol extends RpcProtocol {
61
61
  if (response.statusCode >= 300) {
62
62
  const bytes = await collectBody(response.body, context);
63
63
  if (bytes.byteLength > 0) {
64
- Object.assign(dataObject, await deserializer.read(SCHEMA.DOCUMENT, bytes));
64
+ Object.assign(dataObject, await deserializer.read(15, bytes));
65
65
  }
66
66
  await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
67
67
  }
@@ -1,5 +1,5 @@
1
1
  import { determineTimestampFormat, extendedEncodeURIComponent } from "@smithy/core/protocols";
2
- import { NormalizedSchema, SCHEMA } from "@smithy/core/schema";
2
+ import { NormalizedSchema } from "@smithy/core/schema";
3
3
  import { generateIdempotencyToken, NumericValue } from "@smithy/core/serde";
4
4
  import { dateToUtcString } from "@smithy/smithy-client";
5
5
  import { toBase64 } from "@smithy/util-base64";
@@ -52,13 +52,13 @@ export class QueryShapeSerializer extends SerdeContextConfig {
52
52
  this.writeKey(prefix);
53
53
  const format = determineTimestampFormat(ns, this.settings);
54
54
  switch (format) {
55
- case SCHEMA.TIMESTAMP_DATE_TIME:
55
+ case 5:
56
56
  this.writeValue(value.toISOString().replace(".000Z", "Z"));
57
57
  break;
58
- case SCHEMA.TIMESTAMP_HTTP_DATE:
58
+ case 6:
59
59
  this.writeValue(dateToUtcString(value));
60
60
  break;
61
- case SCHEMA.TIMESTAMP_EPOCH_SECONDS:
61
+ case 7:
62
62
  this.writeValue(String(value.getTime() / 1000));
63
63
  break;
64
64
  }
@@ -1,5 +1,5 @@
1
1
  import { HttpBindingProtocol, HttpInterceptingShapeDeserializer, HttpInterceptingShapeSerializer, } from "@smithy/core/protocols";
2
- import { NormalizedSchema, SCHEMA, TypeRegistry } from "@smithy/core/schema";
2
+ import { NormalizedSchema, TypeRegistry } from "@smithy/core/schema";
3
3
  import { ProtocolLib } from "../ProtocolLib";
4
4
  import { loadRestXmlErrorCode } from "./parseXmlBody";
5
5
  import { XmlCodec } from "./XmlCodec";
@@ -13,7 +13,7 @@ export class AwsRestXmlProtocol extends HttpBindingProtocol {
13
13
  const settings = {
14
14
  timestampFormat: {
15
15
  useTrait: true,
16
- default: SCHEMA.TIMESTAMP_DATE_TIME,
16
+ default: 5,
17
17
  },
18
18
  httpBindings: true,
19
19
  xmlNamespace: options.xmlNamespace,
@@ -1,6 +1,6 @@
1
1
  import { XmlNode, XmlText } from "@aws-sdk/xml-builder";
2
2
  import { determineTimestampFormat } from "@smithy/core/protocols";
3
- import { NormalizedSchema, SCHEMA } from "@smithy/core/schema";
3
+ import { NormalizedSchema } from "@smithy/core/schema";
4
4
  import { generateIdempotencyToken, NumericValue } from "@smithy/core/serde";
5
5
  import { dateToUtcString } from "@smithy/smithy-client";
6
6
  import { fromBase64, toBase64 } from "@smithy/util-base64";
@@ -214,13 +214,13 @@ export class XmlShapeSerializer extends SerdeContextConfig {
214
214
  else if (ns.isTimestampSchema() && value instanceof Date) {
215
215
  const format = determineTimestampFormat(ns, this.settings);
216
216
  switch (format) {
217
- case SCHEMA.TIMESTAMP_DATE_TIME:
217
+ case 5:
218
218
  nodeContents = value.toISOString().replace(".000Z", "Z");
219
219
  break;
220
- case SCHEMA.TIMESTAMP_HTTP_DATE:
220
+ case 6:
221
221
  nodeContents = dateToUtcString(value);
222
222
  break;
223
- case SCHEMA.TIMESTAMP_EPOCH_SECONDS:
223
+ case 7:
224
224
  nodeContents = String(value.getTime() / 1000);
225
225
  break;
226
226
  default:
@@ -1,4 +1,4 @@
1
- import { Provider } from "@smithy/types";
1
+ import type { Provider } from "@smithy/types";
2
2
  import { AccountIdEndpointMode } from "./AccountIdEndpointModeConstants";
3
3
  /**
4
4
  * @public
@@ -1,4 +1,4 @@
1
- import { AwsCredentialIdentity, HttpRequest as IHttpRequest } from "@smithy/types";
1
+ import type { AwsCredentialIdentity, HttpRequest as IHttpRequest } from "@smithy/types";
2
2
  import { AwsSdkSigV4Signer } from "./AwsSdkSigV4Signer";
3
3
  /**
4
4
  * @internal
@@ -1,4 +1,4 @@
1
- import { AuthScheme, AwsCredentialIdentity, HttpRequest as IHttpRequest, HttpResponse, HttpSigner, RequestSigner } from "@smithy/types";
1
+ import type { AuthScheme, AwsCredentialIdentity, HttpRequest as IHttpRequest, HttpResponse, HttpSigner, RequestSigner } from "@smithy/types";
2
2
  import { AwsSdkSigV4AAuthResolvedConfig } from "./resolveAwsSdkSigV4AConfig";
3
3
  /**
4
4
  * @internal
@@ -1,5 +1,5 @@
1
1
  import { LoadedConfigSelectors } from "@smithy/node-config-provider";
2
- import { Provider } from "@smithy/types";
2
+ import type { Provider } from "@smithy/types";
3
3
  /**
4
4
  * @public
5
5
  */
@@ -1,6 +1,6 @@
1
1
  import type { MergeFunctions } from "@aws-sdk/types";
2
2
  import { SignatureV4CryptoInit, SignatureV4Init } from "@smithy/signature-v4";
3
- import { AuthScheme, AwsCredentialIdentity, AwsCredentialIdentityProvider, ChecksumConstructor, HashConstructor, MemoizedProvider, Provider, RegionInfoProvider, RequestSigner } from "@smithy/types";
3
+ import type { AuthScheme, AwsCredentialIdentity, AwsCredentialIdentityProvider, ChecksumConstructor, HashConstructor, MemoizedProvider, Provider, RegionInfoProvider, RequestSigner } from "@smithy/types";
4
4
  /**
5
5
  * @public
6
6
  */
@@ -1,4 +1,4 @@
1
- import { ConfigurableSerdeContext, SerdeFunctions } from "@smithy/types";
1
+ import type { ConfigurableSerdeContext, SerdeFunctions } from "@smithy/types";
2
2
  /**
3
3
  * @internal
4
4
  */
@@ -1,4 +1,4 @@
1
- import { Codec, CodecSettings } from "@smithy/types";
1
+ import type { Codec, CodecSettings } from "@smithy/types";
2
2
  import { SerdeContextConfig } from "../ConfigurableSerdeContext";
3
3
  import { JsonShapeDeserializer } from "./JsonShapeDeserializer";
4
4
  import { JsonShapeSerializer } from "./JsonShapeSerializer";
@@ -1,4 +1,4 @@
1
- import { DocumentType, Schema, ShapeDeserializer } from "@smithy/types";
1
+ import type { DocumentType, Schema, ShapeDeserializer } from "@smithy/types";
2
2
  import { SerdeContextConfig } from "../ConfigurableSerdeContext";
3
3
  import { JsonSettings } from "./JsonCodec";
4
4
  /**
@@ -1,6 +1,6 @@
1
- import { Schema, ShapeSerializer } from "@smithy/types";
1
+ import type { Schema, ShapeSerializer } from "@smithy/types";
2
2
  import { SerdeContextConfig } from "../ConfigurableSerdeContext";
3
- import { JsonSettings } from "./JsonCodec";
3
+ import type { JsonSettings } from "./JsonCodec";
4
4
  /**
5
5
  * @alpha
6
6
  */
@@ -1,4 +1,4 @@
1
- import { CodecSettings } from "@smithy/types";
1
+ import type { CodecSettings } from "@smithy/types";
2
2
  export type QuerySerializerSettings = CodecSettings & {
3
3
  capitalizeKeys?: boolean;
4
4
  flattenLists?: boolean;
@@ -1,4 +1,4 @@
1
- import { Codec, CodecSettings } from "@smithy/types";
1
+ import type { Codec, CodecSettings } from "@smithy/types";
2
2
  import { SerdeContextConfig } from "../ConfigurableSerdeContext";
3
3
  import { XmlShapeDeserializer } from "./XmlShapeDeserializer";
4
4
  import { XmlShapeSerializer } from "./XmlShapeSerializer";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/core",
3
- "version": "3.901.0",
3
+ "version": "3.906.0",
4
4
  "description": "Core functions & classes shared by multiple AWS SDK clients.",
5
5
  "scripts": {
6
6
  "build": "yarn lint && concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",