@smithy/core 3.23.3 → 3.23.5
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
CHANGED
|
@@ -322,10 +322,7 @@ const memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => {
|
|
|
322
322
|
};
|
|
323
323
|
};
|
|
324
324
|
|
|
325
|
-
|
|
326
|
-
enumerable: true,
|
|
327
|
-
get: function () { return protocols.requestBuilder; }
|
|
328
|
-
});
|
|
325
|
+
exports.requestBuilder = protocols.requestBuilder;
|
|
329
326
|
exports.DefaultIdentityProviderConfig = DefaultIdentityProviderConfig;
|
|
330
327
|
exports.EXPIRATION_MS = EXPIRATION_MS;
|
|
331
328
|
exports.HttpApiKeyAuthSigner = HttpApiKeyAuthSigner;
|
|
@@ -164,7 +164,8 @@ class HttpBindingProtocol extends HttpProtocol {
|
|
|
164
164
|
const headers = {};
|
|
165
165
|
const endpoint = await context.endpoint();
|
|
166
166
|
const ns = schema.NormalizedSchema.of(operationSchema?.input);
|
|
167
|
-
const
|
|
167
|
+
const payloadMemberNames = [];
|
|
168
|
+
const payloadMemberSchemas = [];
|
|
168
169
|
let hasNonHttpBindingMember = false;
|
|
169
170
|
let payload;
|
|
170
171
|
const request = new protocolHttp.HttpRequest({
|
|
@@ -257,10 +258,29 @@ class HttpBindingProtocol extends HttpProtocol {
|
|
|
257
258
|
}
|
|
258
259
|
else {
|
|
259
260
|
hasNonHttpBindingMember = true;
|
|
261
|
+
payloadMemberNames.push(memberName);
|
|
262
|
+
payloadMemberSchemas.push(memberNs);
|
|
260
263
|
}
|
|
261
264
|
}
|
|
262
265
|
if (hasNonHttpBindingMember && input) {
|
|
263
|
-
|
|
266
|
+
const [namespace, name] = (ns.getName(true) ?? "#Unknown").split("#");
|
|
267
|
+
const requiredMembers = ns.getSchema()[6];
|
|
268
|
+
const payloadSchema = [
|
|
269
|
+
3,
|
|
270
|
+
namespace,
|
|
271
|
+
name,
|
|
272
|
+
ns.getMergedTraits(),
|
|
273
|
+
payloadMemberNames,
|
|
274
|
+
payloadMemberSchemas,
|
|
275
|
+
undefined,
|
|
276
|
+
];
|
|
277
|
+
if (requiredMembers) {
|
|
278
|
+
payloadSchema[6] = requiredMembers;
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
payloadSchema.pop();
|
|
282
|
+
}
|
|
283
|
+
serializer.write(payloadSchema, input);
|
|
264
284
|
payload = serializer.flush();
|
|
265
285
|
}
|
|
266
286
|
request.headers = headers;
|
|
@@ -515,7 +535,7 @@ class RpcProtocol extends HttpProtocol {
|
|
|
515
535
|
const resolvedPath = (resolvedPath, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => {
|
|
516
536
|
if (input != null && input[memberName] !== undefined) {
|
|
517
537
|
const labelValue = labelValueProvider();
|
|
518
|
-
if (labelValue.length <= 0) {
|
|
538
|
+
if (labelValue == null || labelValue.length <= 0) {
|
|
519
539
|
throw new Error("Empty value provided for input HTTP label: " + memberName + ".");
|
|
520
540
|
}
|
|
521
541
|
resolvedPath = resolvedPath.replace(uriLabel, isGreedyLabel
|
|
@@ -650,10 +650,7 @@ function nv(input) {
|
|
|
650
650
|
return new NumericValue(String(input), "bigDecimal");
|
|
651
651
|
}
|
|
652
652
|
|
|
653
|
-
|
|
654
|
-
enumerable: true,
|
|
655
|
-
get: function () { return uuid.v4; }
|
|
656
|
-
});
|
|
653
|
+
exports.generateIdempotencyToken = uuid.v4;
|
|
657
654
|
exports.LazyJsonString = LazyJsonString;
|
|
658
655
|
exports.NumericValue = NumericValue;
|
|
659
656
|
exports._parseEpochTimestamp = _parseEpochTimestamp;
|
|
@@ -15,7 +15,8 @@ export class HttpBindingProtocol extends HttpProtocol {
|
|
|
15
15
|
const headers = {};
|
|
16
16
|
const endpoint = await context.endpoint();
|
|
17
17
|
const ns = NormalizedSchema.of(operationSchema?.input);
|
|
18
|
-
const
|
|
18
|
+
const payloadMemberNames = [];
|
|
19
|
+
const payloadMemberSchemas = [];
|
|
19
20
|
let hasNonHttpBindingMember = false;
|
|
20
21
|
let payload;
|
|
21
22
|
const request = new HttpRequest({
|
|
@@ -108,10 +109,29 @@ export class HttpBindingProtocol extends HttpProtocol {
|
|
|
108
109
|
}
|
|
109
110
|
else {
|
|
110
111
|
hasNonHttpBindingMember = true;
|
|
112
|
+
payloadMemberNames.push(memberName);
|
|
113
|
+
payloadMemberSchemas.push(memberNs);
|
|
111
114
|
}
|
|
112
115
|
}
|
|
113
116
|
if (hasNonHttpBindingMember && input) {
|
|
114
|
-
|
|
117
|
+
const [namespace, name] = (ns.getName(true) ?? "#Unknown").split("#");
|
|
118
|
+
const requiredMembers = ns.getSchema()[6];
|
|
119
|
+
const payloadSchema = [
|
|
120
|
+
3,
|
|
121
|
+
namespace,
|
|
122
|
+
name,
|
|
123
|
+
ns.getMergedTraits(),
|
|
124
|
+
payloadMemberNames,
|
|
125
|
+
payloadMemberSchemas,
|
|
126
|
+
undefined,
|
|
127
|
+
];
|
|
128
|
+
if (requiredMembers) {
|
|
129
|
+
payloadSchema[6] = requiredMembers;
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
payloadSchema.pop();
|
|
133
|
+
}
|
|
134
|
+
serializer.write(payloadSchema, input);
|
|
115
135
|
payload = serializer.flush();
|
|
116
136
|
}
|
|
117
137
|
request.headers = headers;
|
|
@@ -2,7 +2,7 @@ import { extendedEncodeURIComponent } from "./extended-encode-uri-component";
|
|
|
2
2
|
export const resolvedPath = (resolvedPath, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => {
|
|
3
3
|
if (input != null && input[memberName] !== undefined) {
|
|
4
4
|
const labelValue = labelValueProvider();
|
|
5
|
-
if (labelValue.length <= 0) {
|
|
5
|
+
if (labelValue == null || labelValue.length <= 0) {
|
|
6
6
|
throw new Error("Empty value provided for input HTTP label: " + memberName + ".");
|
|
7
7
|
}
|
|
8
8
|
resolvedPath = resolvedPath.replace(uriLabel, isGreedyLabel
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/core",
|
|
3
|
-
"version": "3.23.
|
|
3
|
+
"version": "3.23.5",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "yarn lint && concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
|
6
6
|
"build:cjs": "node ../../scripts/inline core",
|
|
@@ -79,15 +79,15 @@
|
|
|
79
79
|
"license": "Apache-2.0",
|
|
80
80
|
"sideEffects": false,
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@smithy/middleware-serde": "^4.2.
|
|
83
|
-
"@smithy/protocol-http": "^5.3.
|
|
84
|
-
"@smithy/types": "^4.12.
|
|
85
|
-
"@smithy/util-base64": "^4.3.
|
|
86
|
-
"@smithy/util-body-length-browser": "^4.2.
|
|
87
|
-
"@smithy/util-middleware": "^4.2.
|
|
88
|
-
"@smithy/util-stream": "^4.5.
|
|
89
|
-
"@smithy/util-utf8": "^4.2.
|
|
90
|
-
"@smithy/uuid": "^1.1.
|
|
82
|
+
"@smithy/middleware-serde": "^4.2.10",
|
|
83
|
+
"@smithy/protocol-http": "^5.3.9",
|
|
84
|
+
"@smithy/types": "^4.12.1",
|
|
85
|
+
"@smithy/util-base64": "^4.3.1",
|
|
86
|
+
"@smithy/util-body-length-browser": "^4.2.1",
|
|
87
|
+
"@smithy/util-middleware": "^4.2.9",
|
|
88
|
+
"@smithy/util-stream": "^4.5.14",
|
|
89
|
+
"@smithy/util-utf8": "^4.2.1",
|
|
90
|
+
"@smithy/uuid": "^1.1.1",
|
|
91
91
|
"tslib": "^2.6.2"
|
|
92
92
|
},
|
|
93
93
|
"engines": {
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"directory": "packages/core"
|
|
121
121
|
},
|
|
122
122
|
"devDependencies": {
|
|
123
|
-
"@smithy/eventstream-serde-node": "^4.2.
|
|
123
|
+
"@smithy/eventstream-serde-node": "^4.2.9",
|
|
124
124
|
"@types/node": "^18.11.9",
|
|
125
125
|
"concurrently": "7.0.0",
|
|
126
126
|
"downlevel-dts": "0.10.1",
|