@smithy/core 3.9.2 → 3.11.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.
- package/dist-cjs/index.js +10 -11
- package/dist-cjs/submodules/cbor/index.js +3 -3
- package/dist-cjs/submodules/event-streams/index.js +3 -3
- package/dist-cjs/submodules/protocols/index.js +22 -19
- package/dist-cjs/submodules/schema/index.js +158 -224
- package/dist-cjs/submodules/serde/index.js +3 -3
- package/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js +0 -1
- package/dist-es/middleware-http-signing/httpSigningMiddleware.js +0 -1
- package/dist-es/submodules/cbor/parseCborBody.js +1 -1
- package/dist-es/submodules/protocols/HttpBindingProtocol.js +12 -10
- package/dist-es/submodules/schema/schemas/ErrorSchema.js +12 -22
- package/dist-es/submodules/schema/schemas/ListSchema.js +9 -20
- package/dist-es/submodules/schema/schemas/MapSchema.js +10 -21
- package/dist-es/submodules/schema/schemas/NormalizedSchema.js +76 -87
- package/dist-es/submodules/schema/schemas/OperationSchema.js +11 -12
- package/dist-es/submodules/schema/schemas/Schema.js +16 -3
- package/dist-es/submodules/schema/schemas/SimpleSchema.js +9 -20
- package/dist-es/submodules/schema/schemas/StructureSchema.js +10 -27
- package/dist-types/getSmithyContext.d.ts +1 -1
- package/dist-types/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.d.ts +2 -2
- package/dist-types/middleware-http-auth-scheme/getHttpAuthSchemePlugin.d.ts +2 -2
- package/dist-types/middleware-http-auth-scheme/httpAuthSchemeMiddleware.d.ts +1 -1
- package/dist-types/middleware-http-auth-scheme/resolveAuthOptions.d.ts +1 -1
- package/dist-types/middleware-http-signing/getHttpSigningMiddleware.d.ts +1 -1
- package/dist-types/middleware-http-signing/httpSigningMiddleware.d.ts +1 -1
- package/dist-types/normalizeProvider.d.ts +1 -1
- package/dist-types/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +1 -2
- package/dist-types/submodules/cbor/cbor-decode.d.ts +1 -1
- package/dist-types/submodules/cbor/parseCborBody.d.ts +1 -1
- package/dist-types/submodules/event-streams/EventStreamSerde.d.ts +1 -1
- package/dist-types/submodules/protocols/collect-stream-body.d.ts +1 -1
- package/dist-types/submodules/protocols/serde/determineTimestampFormat.d.ts +1 -1
- package/dist-types/submodules/schema/TypeRegistry.d.ts +1 -1
- package/dist-types/submodules/schema/middleware/getSchemaSerdePlugin.d.ts +1 -1
- package/dist-types/submodules/schema/middleware/schemaDeserializationMiddleware.d.ts +1 -1
- package/dist-types/submodules/schema/middleware/schemaSerializationMiddleware.d.ts +2 -2
- package/dist-types/submodules/schema/schemas/ErrorSchema.d.ts +3 -16
- package/dist-types/submodules/schema/schemas/ListSchema.d.ts +3 -5
- package/dist-types/submodules/schema/schemas/MapSchema.d.ts +3 -9
- package/dist-types/submodules/schema/schemas/NormalizedSchema.d.ts +15 -13
- package/dist-types/submodules/schema/schemas/OperationSchema.d.ts +3 -2
- package/dist-types/submodules/schema/schemas/Schema.d.ts +5 -1
- package/dist-types/submodules/schema/schemas/SimpleSchema.d.ts +3 -5
- package/dist-types/submodules/schema/schemas/StructureSchema.d.ts +3 -6
- package/dist-types/ts3.4/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +1 -2
- package/dist-types/ts3.4/submodules/schema/schemas/ErrorSchema.d.ts +3 -16
- package/dist-types/ts3.4/submodules/schema/schemas/ListSchema.d.ts +3 -5
- package/dist-types/ts3.4/submodules/schema/schemas/MapSchema.d.ts +3 -9
- package/dist-types/ts3.4/submodules/schema/schemas/NormalizedSchema.d.ts +15 -13
- package/dist-types/ts3.4/submodules/schema/schemas/OperationSchema.d.ts +3 -2
- package/dist-types/ts3.4/submodules/schema/schemas/Schema.d.ts +5 -1
- package/dist-types/ts3.4/submodules/schema/schemas/SimpleSchema.d.ts +3 -5
- package/dist-types/ts3.4/submodules/schema/schemas/StructureSchema.d.ts +3 -9
- package/dist-types/util-identity-and-auth/DefaultIdentityProviderConfig.d.ts +1 -1
- package/dist-types/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.d.ts +1 -1
- package/dist-types/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.d.ts +1 -1
- package/dist-types/util-identity-and-auth/httpAuthSchemes/noAuth.d.ts +1 -1
- package/dist-types/util-identity-and-auth/memoizeIdentityProvider.d.ts +1 -1
- package/package.json +10 -10
package/dist-cjs/index.js
CHANGED
|
@@ -18,8 +18,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
20
|
// src/index.ts
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
23
|
DefaultIdentityProviderConfig: () => DefaultIdentityProviderConfig,
|
|
24
24
|
EXPIRATION_MS: () => EXPIRATION_MS,
|
|
25
25
|
HttpApiKeyAuthSigner: () => HttpApiKeyAuthSigner,
|
|
@@ -43,7 +43,7 @@ __export(src_exports, {
|
|
|
43
43
|
requestBuilder: () => import_protocols.requestBuilder,
|
|
44
44
|
setFeature: () => setFeature
|
|
45
45
|
});
|
|
46
|
-
module.exports = __toCommonJS(
|
|
46
|
+
module.exports = __toCommonJS(index_exports);
|
|
47
47
|
|
|
48
48
|
// src/getSmithyContext.ts
|
|
49
49
|
var import_types = require("@smithy/types");
|
|
@@ -132,7 +132,7 @@ var getHttpAuthSchemeEndpointRuleSetPlugin = /* @__PURE__ */ __name((config, {
|
|
|
132
132
|
httpAuthSchemeParametersProvider,
|
|
133
133
|
identityProviderConfigProvider
|
|
134
134
|
}) => ({
|
|
135
|
-
applyToStack: (clientStack) => {
|
|
135
|
+
applyToStack: /* @__PURE__ */ __name((clientStack) => {
|
|
136
136
|
clientStack.addRelativeTo(
|
|
137
137
|
httpAuthSchemeMiddleware(config, {
|
|
138
138
|
httpAuthSchemeParametersProvider,
|
|
@@ -140,7 +140,7 @@ var getHttpAuthSchemeEndpointRuleSetPlugin = /* @__PURE__ */ __name((config, {
|
|
|
140
140
|
}),
|
|
141
141
|
httpAuthSchemeEndpointRuleSetMiddlewareOptions
|
|
142
142
|
);
|
|
143
|
-
}
|
|
143
|
+
}, "applyToStack")
|
|
144
144
|
}), "getHttpAuthSchemeEndpointRuleSetPlugin");
|
|
145
145
|
|
|
146
146
|
// src/middleware-http-auth-scheme/getHttpAuthSchemePlugin.ts
|
|
@@ -157,7 +157,7 @@ var getHttpAuthSchemePlugin = /* @__PURE__ */ __name((config, {
|
|
|
157
157
|
httpAuthSchemeParametersProvider,
|
|
158
158
|
identityProviderConfigProvider
|
|
159
159
|
}) => ({
|
|
160
|
-
applyToStack: (clientStack) => {
|
|
160
|
+
applyToStack: /* @__PURE__ */ __name((clientStack) => {
|
|
161
161
|
clientStack.addRelativeTo(
|
|
162
162
|
httpAuthSchemeMiddleware(config, {
|
|
163
163
|
httpAuthSchemeParametersProvider,
|
|
@@ -165,7 +165,7 @@ var getHttpAuthSchemePlugin = /* @__PURE__ */ __name((config, {
|
|
|
165
165
|
}),
|
|
166
166
|
httpAuthSchemeMiddlewareOptions
|
|
167
167
|
);
|
|
168
|
-
}
|
|
168
|
+
}, "applyToStack")
|
|
169
169
|
}), "getHttpAuthSchemePlugin");
|
|
170
170
|
|
|
171
171
|
// src/middleware-http-signing/httpSigningMiddleware.ts
|
|
@@ -209,15 +209,14 @@ var httpSigningMiddlewareOptions = {
|
|
|
209
209
|
toMiddleware: "retryMiddleware"
|
|
210
210
|
};
|
|
211
211
|
var getHttpSigningPlugin = /* @__PURE__ */ __name((config) => ({
|
|
212
|
-
applyToStack: (clientStack) => {
|
|
212
|
+
applyToStack: /* @__PURE__ */ __name((clientStack) => {
|
|
213
213
|
clientStack.addRelativeTo(httpSigningMiddleware(config), httpSigningMiddlewareOptions);
|
|
214
|
-
}
|
|
214
|
+
}, "applyToStack")
|
|
215
215
|
}), "getHttpSigningPlugin");
|
|
216
216
|
|
|
217
217
|
// src/normalizeProvider.ts
|
|
218
218
|
var normalizeProvider = /* @__PURE__ */ __name((input) => {
|
|
219
|
-
if (typeof input === "function")
|
|
220
|
-
return input;
|
|
219
|
+
if (typeof input === "function") return input;
|
|
221
220
|
const promisified = Promise.resolve(input);
|
|
222
221
|
return () => promisified;
|
|
223
222
|
}, "normalizeProvider");
|
|
@@ -17,8 +17,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
19
|
// src/submodules/cbor/index.ts
|
|
20
|
-
var
|
|
21
|
-
__export(
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
22
|
CborCodec: () => CborCodec,
|
|
23
23
|
CborShapeDeserializer: () => CborShapeDeserializer,
|
|
24
24
|
CborShapeSerializer: () => CborShapeSerializer,
|
|
@@ -33,7 +33,7 @@ __export(cbor_exports, {
|
|
|
33
33
|
tag: () => tag,
|
|
34
34
|
tagSymbol: () => tagSymbol
|
|
35
35
|
});
|
|
36
|
-
module.exports = __toCommonJS(
|
|
36
|
+
module.exports = __toCommonJS(index_exports);
|
|
37
37
|
|
|
38
38
|
// src/submodules/cbor/cbor-decode.ts
|
|
39
39
|
var import_serde = require("@smithy/core/serde");
|
|
@@ -17,11 +17,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
19
|
// src/submodules/event-streams/index.ts
|
|
20
|
-
var
|
|
21
|
-
__export(
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
22
|
EventStreamSerde: () => EventStreamSerde
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
24
|
+
module.exports = __toCommonJS(index_exports);
|
|
25
25
|
|
|
26
26
|
// src/submodules/event-streams/EventStreamSerde.ts
|
|
27
27
|
var import_schema = require("@smithy/core/schema");
|
|
@@ -27,8 +27,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
29
|
// src/submodules/protocols/index.ts
|
|
30
|
-
var
|
|
31
|
-
__export(
|
|
30
|
+
var index_exports = {};
|
|
31
|
+
__export(index_exports, {
|
|
32
32
|
FromStringShapeDeserializer: () => FromStringShapeDeserializer,
|
|
33
33
|
HttpBindingProtocol: () => HttpBindingProtocol,
|
|
34
34
|
HttpInterceptingShapeDeserializer: () => HttpInterceptingShapeDeserializer,
|
|
@@ -43,7 +43,7 @@ __export(protocols_exports, {
|
|
|
43
43
|
requestBuilder: () => requestBuilder,
|
|
44
44
|
resolvedPath: () => resolvedPath
|
|
45
45
|
});
|
|
46
|
-
module.exports = __toCommonJS(
|
|
46
|
+
module.exports = __toCommonJS(index_exports);
|
|
47
47
|
|
|
48
48
|
// src/submodules/protocols/collect-stream-body.ts
|
|
49
49
|
var import_util_stream = require("@smithy/util-stream");
|
|
@@ -207,6 +207,11 @@ var HttpProtocol = class {
|
|
|
207
207
|
);
|
|
208
208
|
}
|
|
209
209
|
async deserializeHttpMessage(schema, context, response, arg4, arg5) {
|
|
210
|
+
void schema;
|
|
211
|
+
void context;
|
|
212
|
+
void response;
|
|
213
|
+
void arg4;
|
|
214
|
+
void arg5;
|
|
210
215
|
return [];
|
|
211
216
|
}
|
|
212
217
|
getEventStreamMarshaller() {
|
|
@@ -328,20 +333,15 @@ var HttpBindingProtocol = class extends HttpProtocol {
|
|
|
328
333
|
if (traits.httpQueryParams) {
|
|
329
334
|
for (const [key, val] of Object.entries(data)) {
|
|
330
335
|
if (!(key in query)) {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
}
|
|
341
|
-
]),
|
|
342
|
-
val,
|
|
343
|
-
query
|
|
344
|
-
);
|
|
336
|
+
const valueSchema = ns.getValueSchema();
|
|
337
|
+
Object.assign(valueSchema.getMergedTraits(), {
|
|
338
|
+
// We pass on the traits to the sub-schema
|
|
339
|
+
// because we are still in the process of serializing the map itself.
|
|
340
|
+
...traits,
|
|
341
|
+
httpQuery: key,
|
|
342
|
+
httpQueryParams: void 0
|
|
343
|
+
});
|
|
344
|
+
this.serializeQuery(valueSchema, val, query);
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
return;
|
|
@@ -428,6 +428,7 @@ var HttpBindingProtocol = class extends HttpProtocol {
|
|
|
428
428
|
if (null != value) {
|
|
429
429
|
if (memberSchema.isListSchema()) {
|
|
430
430
|
const headerListValueSchema = memberSchema.getValueSchema();
|
|
431
|
+
headerListValueSchema.getMergedTraits().httpHeader = key;
|
|
431
432
|
let sections;
|
|
432
433
|
if (headerListValueSchema.isTimestampSchema() && headerListValueSchema.getSchema() === import_schema2.SCHEMA.TIMESTAMP_DEFAULT) {
|
|
433
434
|
sections = (0, import_serde.splitEvery)(value, ",", 2);
|
|
@@ -436,7 +437,7 @@ var HttpBindingProtocol = class extends HttpProtocol {
|
|
|
436
437
|
}
|
|
437
438
|
const list = [];
|
|
438
439
|
for (const section of sections) {
|
|
439
|
-
list.push(await deserializer.read(
|
|
440
|
+
list.push(await deserializer.read(headerListValueSchema, section.trim()));
|
|
440
441
|
}
|
|
441
442
|
dataObject[memberName] = list;
|
|
442
443
|
} else {
|
|
@@ -447,8 +448,10 @@ var HttpBindingProtocol = class extends HttpProtocol {
|
|
|
447
448
|
dataObject[memberName] = {};
|
|
448
449
|
for (const [header, value] of Object.entries(response.headers)) {
|
|
449
450
|
if (header.startsWith(memberTraits.httpPrefixHeaders)) {
|
|
451
|
+
const valueSchema = memberSchema.getValueSchema();
|
|
452
|
+
valueSchema.getMergedTraits().httpHeader = header;
|
|
450
453
|
dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(
|
|
451
|
-
|
|
454
|
+
valueSchema,
|
|
452
455
|
value
|
|
453
456
|
);
|
|
454
457
|
}
|