@huaweidevtools/aishell-dsh-deploy 0.0.29 → 0.0.31
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/lib/index.js +27 -12
- package/lib/types/utils/hash.d.ts +12 -0
- package/lib/types/version.d.ts +1 -1
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -1691,7 +1691,7 @@ function withAnchoredPaths(args, ctx) {
|
|
|
1691
1691
|
* written by earlier releases carry it — so it is kept even though there is no
|
|
1692
1692
|
* server.
|
|
1693
1693
|
*/
|
|
1694
|
-
const SERVER_VERSION = "aishell-deploy 0.0.
|
|
1694
|
+
const SERVER_VERSION = "aishell-deploy 0.0.31";
|
|
1695
1695
|
|
|
1696
1696
|
//#endregion
|
|
1697
1697
|
//#region src/deployment-state.ts
|
|
@@ -2494,7 +2494,15 @@ function encodeRfc3986(s) {
|
|
|
2494
2494
|
* optional — including a non-whitelisted param would mismatch the service's
|
|
2495
2495
|
* own StringToSign and produce 403 SignatureDoesNotMatch.
|
|
2496
2496
|
*
|
|
2497
|
-
*
|
|
2497
|
+
* The names come from esdk-obs-nodejs `utils.js` (the
|
|
2498
|
+
* `allowedResourceParameterNames` array) with one deliberate departure: every
|
|
2499
|
+
* entry here is lowercase, because {@link canonicalizedResource} lowercases the
|
|
2500
|
+
* param before testing it. The SDK's list spells one entry `requestPayment`,
|
|
2501
|
+
* and copying that spelling would put a member in this set that no lookup can
|
|
2502
|
+
* ever reach — the lookup always asks with a lowercased key, so `requestPayment`
|
|
2503
|
+
* would sit beside `requestpayment` and never be consulted. The SDK's list also
|
|
2504
|
+
* names `requestpayment` and `position` twice each; they appear once here,
|
|
2505
|
+
* which is all a set can hold.
|
|
2498
2506
|
*/
|
|
2499
2507
|
const ALLOWED_RESOURCE_PARAMETER_NAMES = new Set([
|
|
2500
2508
|
"acl",
|
|
@@ -2539,7 +2547,6 @@ const ALLOWED_RESOURCE_PARAMETER_NAMES = new Set([
|
|
|
2539
2547
|
"directcoldaccess",
|
|
2540
2548
|
"rename",
|
|
2541
2549
|
"name",
|
|
2542
|
-
"requestpayment",
|
|
2543
2550
|
"metadata",
|
|
2544
2551
|
"modify",
|
|
2545
2552
|
"attname",
|
|
@@ -2565,8 +2572,7 @@ const ALLOWED_RESOURCE_PARAMETER_NAMES = new Set([
|
|
|
2565
2572
|
"retention",
|
|
2566
2573
|
"mirrorbacktosource",
|
|
2567
2574
|
"obscompresspolicy",
|
|
2568
|
-
"length"
|
|
2569
|
-
"position"
|
|
2575
|
+
"length"
|
|
2570
2576
|
]);
|
|
2571
2577
|
/** Header prefix for OBS custom headers (x-obs-). */
|
|
2572
2578
|
const HEADER_PREFIX = "x-obs-";
|
|
@@ -3199,16 +3205,25 @@ function isConfigurationFile(name$1) {
|
|
|
3199
3205
|
|
|
3200
3206
|
//#endregion
|
|
3201
3207
|
//#region src/utils/hash.ts
|
|
3208
|
+
/**
|
|
3209
|
+
* Hash a deployment's configuration files.
|
|
3210
|
+
*
|
|
3211
|
+
* The reads run together: a deployment is a handful of files whose sizes are
|
|
3212
|
+
* independent, and hashing them one at a time made the wait their sum. The
|
|
3213
|
+
* digest itself is unchanged — each file is hashed on its own and the parts are
|
|
3214
|
+
* concatenated in path order, so concurrency only changes when the bytes are
|
|
3215
|
+
* read, never how they are combined.
|
|
3216
|
+
*
|
|
3217
|
+
* @param dir - the deployment directory.
|
|
3218
|
+
* @returns the `sha256:` digest of its configuration.
|
|
3219
|
+
*/
|
|
3202
3220
|
async function computeTfHash(dir) {
|
|
3203
3221
|
const tfFiles = await configurationFiles(dir);
|
|
3204
|
-
const parts =
|
|
3205
|
-
for (const name$1 of tfFiles) {
|
|
3222
|
+
const parts = await Promise.all(tfFiles.map(async (name$1) => {
|
|
3206
3223
|
const content = await readFile(join(dir, name$1), "utf8");
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
const concatenated = parts.join("");
|
|
3211
|
-
const hash = createHash("sha256").update(concatenated, "utf8").digest("hex");
|
|
3224
|
+
return `${name$1}${createHash("sha256").update(content, "utf8").digest("hex")}`;
|
|
3225
|
+
}));
|
|
3226
|
+
const hash = createHash("sha256").update(parts.join(""), "utf8").digest("hex");
|
|
3212
3227
|
return `sha256:${hash}`;
|
|
3213
3228
|
}
|
|
3214
3229
|
|
|
@@ -17,5 +17,17 @@
|
|
|
17
17
|
* hashing those would make the digest change whenever terraform fetched
|
|
18
18
|
* anything.
|
|
19
19
|
*/
|
|
20
|
+
/**
|
|
21
|
+
* Hash a deployment's configuration files.
|
|
22
|
+
*
|
|
23
|
+
* The reads run together: a deployment is a handful of files whose sizes are
|
|
24
|
+
* independent, and hashing them one at a time made the wait their sum. The
|
|
25
|
+
* digest itself is unchanged — each file is hashed on its own and the parts are
|
|
26
|
+
* concatenated in path order, so concurrency only changes when the bytes are
|
|
27
|
+
* read, never how they are combined.
|
|
28
|
+
*
|
|
29
|
+
* @param dir - the deployment directory.
|
|
30
|
+
* @returns the `sha256:` digest of its configuration.
|
|
31
|
+
*/
|
|
20
32
|
export declare function computeTfHash(dir: string): Promise<string>;
|
|
21
33
|
//# sourceMappingURL=hash.d.ts.map
|
package/lib/types/version.d.ts
CHANGED
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
* written by earlier releases carry it — so it is kept even though there is no
|
|
19
19
|
* server.
|
|
20
20
|
*/
|
|
21
|
-
export declare const SERVER_VERSION = "aishell-deploy 0.0.
|
|
21
|
+
export declare const SERVER_VERSION = "aishell-deploy 0.0.31";
|
|
22
22
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huaweidevtools/aishell-dsh-deploy",
|
|
3
3
|
"description": "Huawei Cloud infrastructure tools for DSH — Terraform, OpenAPI, resource inventory, cost estimates",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.31",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/
|
|
10
|
+
"url": "git+https://github.com/huawei-developers/aishell-dsh-plugins.git",
|
|
11
11
|
"directory": "packages/aishell-deploy"
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"hcl2-parser": "^1.0.3",
|
|
32
32
|
"jsonpath-plus": "^10.4.0",
|
|
33
33
|
"zod": "^4.2.0",
|
|
34
|
-
"@huaweidevtools/aishell-dsh-credentials-store": "0.0.
|
|
34
|
+
"@huaweidevtools/aishell-dsh-credentials-store": "0.0.31"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@deepseek-ai/cordis": "^4.1.0",
|