edgeone-cli 1.0.12 → 1.0.13
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/api/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,KAAK,EACV,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,0BAA0B,EAC1B,6BAA6B,EAE7B,qBAAqB,EACrB,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAE3B,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,IAAI,CAAa;gBAEb,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAiB,EAAE,IAAI,GAAE,UAAyB;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,KAAK,EACV,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,0BAA0B,EAC1B,6BAA6B,EAE7B,qBAAqB,EACrB,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAE3B,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,IAAI,CAAa;gBAEb,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAiB,EAAE,IAAI,GAAE,UAAyB;IAS3H;;OAEG;YACW,OAAO;IAuDrB;;OAEG;IACG,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAWtF;;OAEG;IACG,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,0BAA0B,CAAC,CAAC;IAkD9F;;OAEG;IACG,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAS5F;;OAEG;IACG,qBAAqB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,6BAA6B,CAAC,CAAC;IAkDpG;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IASxF;;OAEG;IACG,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;IAazG;;OAEG;IACG,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;CAOhG"}
|
package/dist/api/client.js
CHANGED
|
@@ -9,7 +9,8 @@ export class EdgeOneClient {
|
|
|
9
9
|
constructor(secretId, secretKey, endpoint, region = "ap-guangzhou", mode = "production") {
|
|
10
10
|
this.secretId = secretId;
|
|
11
11
|
this.secretKey = secretKey;
|
|
12
|
-
|
|
12
|
+
// 确保 endpoint 有效,防止空值或 undefined
|
|
13
|
+
this.endpoint = endpoint || "teo.tencentcloudapi.com";
|
|
13
14
|
this.region = region;
|
|
14
15
|
this.mode = mode;
|
|
15
16
|
}
|
package/dist/commands/config.js
CHANGED
|
@@ -50,7 +50,7 @@ export function readConfig() {
|
|
|
50
50
|
const config = {
|
|
51
51
|
secretId: stored.secretId,
|
|
52
52
|
secretKey: secretKey,
|
|
53
|
-
endpoint: stored.endpoint,
|
|
53
|
+
endpoint: stored.endpoint || "teo.tencentcloudapi.com", // 默认值
|
|
54
54
|
mode: stored.mode || "production", // 默认为生产模式
|
|
55
55
|
domainIdList: domainIdList, // 默认为空数组
|
|
56
56
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src/utils/signature.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src/utils/signature.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAsDpE"}
|
package/dist/utils/signature.js
CHANGED
|
@@ -7,7 +7,9 @@ import crypto from 'crypto';
|
|
|
7
7
|
*/
|
|
8
8
|
export function calculateSignature(options) {
|
|
9
9
|
const { secretId, secretKey, endpoint, action, requestBody, timestamp } = options;
|
|
10
|
-
|
|
10
|
+
// 确保 endpoint 有效,防止 Invalid URL 错误
|
|
11
|
+
const validEndpoint = endpoint || "teo.tencentcloudapi.com";
|
|
12
|
+
const host = new URL(`https://${validEndpoint}`).host;
|
|
11
13
|
// 第一步:拼接规范请求串 CanonicalRequest
|
|
12
14
|
const HTTPRequestMethod = 'POST';
|
|
13
15
|
const CanonicalURI = '/';
|