@ctil/gql 1.0.18 → 1.0.20
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/index.cjs +11 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3715,7 +3715,12 @@ function buildDataValue(data) {
|
|
|
3715
3715
|
const parts = [];
|
|
3716
3716
|
for (const key in data) {
|
|
3717
3717
|
const value = data[key];
|
|
3718
|
-
if (value === null
|
|
3718
|
+
if (value === null) {
|
|
3719
|
+
parts.push(`${key}: ${value}`);
|
|
3720
|
+
continue;
|
|
3721
|
+
}
|
|
3722
|
+
;
|
|
3723
|
+
if (value === void 0) continue;
|
|
3719
3724
|
if (typeof value === "string" && value.startsWith("$")) {
|
|
3720
3725
|
parts.push(`${key}: ${value}`);
|
|
3721
3726
|
} else if (typeof value === "object" && !Array.isArray(value) && value.constructor === Object) {
|
|
@@ -4456,7 +4461,6 @@ var CCRequest = class {
|
|
|
4456
4461
|
this.removeLoginInfo();
|
|
4457
4462
|
throw new Error("Login expired. Please login again.");
|
|
4458
4463
|
}
|
|
4459
|
-
console.log("refreshExpired", refreshExpired);
|
|
4460
4464
|
if (accessExpired && !refreshExpired) {
|
|
4461
4465
|
try {
|
|
4462
4466
|
const refreshResult = await auth.refreshToken({
|
|
@@ -4467,7 +4471,6 @@ var CCRequest = class {
|
|
|
4467
4471
|
const newInfo = refreshResult.refreshToken ?? refreshResult;
|
|
4468
4472
|
this.setLoginInfo(newInfo, this._remember);
|
|
4469
4473
|
} catch (err) {
|
|
4470
|
-
console.log("err", err);
|
|
4471
4474
|
this.removeLoginInfo();
|
|
4472
4475
|
throw new Error("Failed to refresh token. Please login again." + err?.message);
|
|
4473
4476
|
}
|
|
@@ -4757,7 +4760,6 @@ var oss = {
|
|
|
4757
4760
|
const result = await execute({ query: query2, variables });
|
|
4758
4761
|
return result;
|
|
4759
4762
|
});
|
|
4760
|
-
console.log("presignedResult====>", presignedResult);
|
|
4761
4763
|
if (!presignedResult.uploadPresignedUrl) throw new Error("\u83B7\u53D6\u9884\u7B7E\u540D URL \u5931\u8D25");
|
|
4762
4764
|
const { uploadUrl, uploadHeaders, downloadUrl, resourceId, contentType, originalFileName } = presignedResult.uploadPresignedUrl;
|
|
4763
4765
|
const headers = {};
|
|
@@ -4803,7 +4805,11 @@ var oss = {
|
|
|
4803
4805
|
md5Base64 = import_crypto.default.createHash("md5").update(Buffer.from(arrayBuffer)).digest("base64");
|
|
4804
4806
|
} else {
|
|
4805
4807
|
const SparkMD5 = (await import("spark-md5")).default;
|
|
4806
|
-
|
|
4808
|
+
const md5Hex = SparkMD5.ArrayBuffer.hash(arrayBuffer, false);
|
|
4809
|
+
const md5Bytes = new Uint8Array(md5Hex.match(/.{2}/g).map((b) => parseInt(b, 16)));
|
|
4810
|
+
let binary = "";
|
|
4811
|
+
md5Bytes.forEach((byte) => binary += String.fromCharCode(byte));
|
|
4812
|
+
md5Base64 = btoa(binary);
|
|
4807
4813
|
}
|
|
4808
4814
|
const presignedInput = {
|
|
4809
4815
|
fileMd5Base64: md5Base64,
|