@smithy/core 2.5.1 → 2.5.3
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.
|
@@ -23,7 +23,7 @@ __export(protocols_exports, {
|
|
|
23
23
|
collectBody: () => collectBody,
|
|
24
24
|
extendedEncodeURIComponent: () => extendedEncodeURIComponent,
|
|
25
25
|
requestBuilder: () => requestBuilder,
|
|
26
|
-
resolvedPath: () =>
|
|
26
|
+
resolvedPath: () => resolvedPath
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(protocols_exports);
|
|
29
29
|
|
|
@@ -48,8 +48,26 @@ function extendedEncodeURIComponent(str) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
// src/submodules/protocols/requestBuilder.ts
|
|
51
|
-
var import_protocols = require("@smithy/core/protocols");
|
|
52
51
|
var import_protocol_http = require("@smithy/protocol-http");
|
|
52
|
+
|
|
53
|
+
// src/submodules/protocols/resolve-path.ts
|
|
54
|
+
var resolvedPath = (resolvedPath2, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => {
|
|
55
|
+
if (input != null && input[memberName] !== void 0) {
|
|
56
|
+
const labelValue = labelValueProvider();
|
|
57
|
+
if (labelValue.length <= 0) {
|
|
58
|
+
throw new Error("Empty value provided for input HTTP label: " + memberName + ".");
|
|
59
|
+
}
|
|
60
|
+
resolvedPath2 = resolvedPath2.replace(
|
|
61
|
+
uriLabel,
|
|
62
|
+
isGreedyLabel ? labelValue.split("/").map((segment) => extendedEncodeURIComponent(segment)).join("/") : extendedEncodeURIComponent(labelValue)
|
|
63
|
+
);
|
|
64
|
+
} else {
|
|
65
|
+
throw new Error("No value provided for input HTTP label: " + memberName + ".");
|
|
66
|
+
}
|
|
67
|
+
return resolvedPath2;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// src/submodules/protocols/requestBuilder.ts
|
|
53
71
|
function requestBuilder(input, context) {
|
|
54
72
|
return new RequestBuilder(input, context);
|
|
55
73
|
}
|
|
@@ -103,7 +121,7 @@ var RequestBuilder = class {
|
|
|
103
121
|
*/
|
|
104
122
|
p(memberName, labelValueProvider, uriLabel, isGreedyLabel) {
|
|
105
123
|
this.resolvePathStack.push((path) => {
|
|
106
|
-
this.path =
|
|
124
|
+
this.path = resolvedPath(path, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel);
|
|
107
125
|
});
|
|
108
126
|
return this;
|
|
109
127
|
}
|
|
@@ -136,23 +154,6 @@ var RequestBuilder = class {
|
|
|
136
154
|
return this;
|
|
137
155
|
}
|
|
138
156
|
};
|
|
139
|
-
|
|
140
|
-
// src/submodules/protocols/resolve-path.ts
|
|
141
|
-
var resolvedPath2 = (resolvedPath3, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => {
|
|
142
|
-
if (input != null && input[memberName] !== void 0) {
|
|
143
|
-
const labelValue = labelValueProvider();
|
|
144
|
-
if (labelValue.length <= 0) {
|
|
145
|
-
throw new Error("Empty value provided for input HTTP label: " + memberName + ".");
|
|
146
|
-
}
|
|
147
|
-
resolvedPath3 = resolvedPath3.replace(
|
|
148
|
-
uriLabel,
|
|
149
|
-
isGreedyLabel ? labelValue.split("/").map((segment) => extendedEncodeURIComponent(segment)).join("/") : extendedEncodeURIComponent(labelValue)
|
|
150
|
-
);
|
|
151
|
-
} else {
|
|
152
|
-
throw new Error("No value provided for input HTTP label: " + memberName + ".");
|
|
153
|
-
}
|
|
154
|
-
return resolvedPath3;
|
|
155
|
-
};
|
|
156
157
|
// Annotate the CommonJS export names for ESM import in node:
|
|
157
158
|
0 && (module.exports = {
|
|
158
159
|
RequestBuilder,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/core",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.3",
|
|
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",
|
|
@@ -9,10 +9,11 @@
|
|
|
9
9
|
"build:types:downlevel": "rimraf dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4",
|
|
10
10
|
"stage-release": "rimraf ./.release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
|
|
11
11
|
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
|
|
12
|
-
"lint": "npx eslint -c ../../.eslintrc.js \"src/**/*.ts\" && node ./scripts/lint",
|
|
12
|
+
"lint": "npx eslint -c ../../.eslintrc.js \"src/**/*.ts\" --fix && node ./scripts/lint",
|
|
13
13
|
"format": "prettier --config ../../prettier.config.js --ignore-path ../.prettierignore --write \"**/*.{ts,md,json}\"",
|
|
14
|
-
"test": "yarn g:
|
|
15
|
-
"test:cbor:perf": "node ./scripts/cbor-perf.mjs"
|
|
14
|
+
"test": "yarn g:vitest run",
|
|
15
|
+
"test:cbor:perf": "node ./scripts/cbor-perf.mjs",
|
|
16
|
+
"test:watch": "yarn g:vitest watch"
|
|
16
17
|
},
|
|
17
18
|
"main": "./dist-cjs/index.js",
|
|
18
19
|
"module": "./dist-es/index.js",
|
|
@@ -53,12 +54,12 @@
|
|
|
53
54
|
},
|
|
54
55
|
"license": "Apache-2.0",
|
|
55
56
|
"dependencies": {
|
|
56
|
-
"@smithy/middleware-serde": "^3.0.
|
|
57
|
-
"@smithy/protocol-http": "^4.1.
|
|
58
|
-
"@smithy/types": "^3.
|
|
57
|
+
"@smithy/middleware-serde": "^3.0.10",
|
|
58
|
+
"@smithy/protocol-http": "^4.1.7",
|
|
59
|
+
"@smithy/types": "^3.7.1",
|
|
59
60
|
"@smithy/util-body-length-browser": "^3.0.0",
|
|
60
|
-
"@smithy/util-middleware": "^3.0.
|
|
61
|
-
"@smithy/util-stream": "^3.
|
|
61
|
+
"@smithy/util-middleware": "^3.0.10",
|
|
62
|
+
"@smithy/util-stream": "^3.3.1",
|
|
62
63
|
"@smithy/util-utf8": "^3.0.0",
|
|
63
64
|
"tslib": "^2.6.2"
|
|
64
65
|
},
|