@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.js
CHANGED
|
@@ -946,7 +946,12 @@ function buildDataValue(data) {
|
|
|
946
946
|
const parts = [];
|
|
947
947
|
for (const key in data) {
|
|
948
948
|
const value = data[key];
|
|
949
|
-
if (value === null
|
|
949
|
+
if (value === null) {
|
|
950
|
+
parts.push(`${key}: ${value}`);
|
|
951
|
+
continue;
|
|
952
|
+
}
|
|
953
|
+
;
|
|
954
|
+
if (value === void 0) continue;
|
|
950
955
|
if (typeof value === "string" && value.startsWith("$")) {
|
|
951
956
|
parts.push(`${key}: ${value}`);
|
|
952
957
|
} else if (typeof value === "object" && !Array.isArray(value) && value.constructor === Object) {
|
|
@@ -1687,7 +1692,6 @@ var CCRequest = class {
|
|
|
1687
1692
|
this.removeLoginInfo();
|
|
1688
1693
|
throw new Error("Login expired. Please login again.");
|
|
1689
1694
|
}
|
|
1690
|
-
console.log("refreshExpired", refreshExpired);
|
|
1691
1695
|
if (accessExpired && !refreshExpired) {
|
|
1692
1696
|
try {
|
|
1693
1697
|
const refreshResult = await auth.refreshToken({
|
|
@@ -1698,7 +1702,6 @@ var CCRequest = class {
|
|
|
1698
1702
|
const newInfo = refreshResult.refreshToken ?? refreshResult;
|
|
1699
1703
|
this.setLoginInfo(newInfo, this._remember);
|
|
1700
1704
|
} catch (err) {
|
|
1701
|
-
console.log("err", err);
|
|
1702
1705
|
this.removeLoginInfo();
|
|
1703
1706
|
throw new Error("Failed to refresh token. Please login again." + err?.message);
|
|
1704
1707
|
}
|
|
@@ -1988,7 +1991,6 @@ var oss = {
|
|
|
1988
1991
|
const result = await execute({ query: query2, variables });
|
|
1989
1992
|
return result;
|
|
1990
1993
|
});
|
|
1991
|
-
console.log("presignedResult====>", presignedResult);
|
|
1992
1994
|
if (!presignedResult.uploadPresignedUrl) throw new Error("\u83B7\u53D6\u9884\u7B7E\u540D URL \u5931\u8D25");
|
|
1993
1995
|
const { uploadUrl, uploadHeaders, downloadUrl, resourceId, contentType, originalFileName } = presignedResult.uploadPresignedUrl;
|
|
1994
1996
|
const headers = {};
|
|
@@ -2034,7 +2036,11 @@ var oss = {
|
|
|
2034
2036
|
md5Base64 = crypto.createHash("md5").update(Buffer.from(arrayBuffer)).digest("base64");
|
|
2035
2037
|
} else {
|
|
2036
2038
|
const SparkMD5 = (await import("spark-md5")).default;
|
|
2037
|
-
|
|
2039
|
+
const md5Hex = SparkMD5.ArrayBuffer.hash(arrayBuffer, false);
|
|
2040
|
+
const md5Bytes = new Uint8Array(md5Hex.match(/.{2}/g).map((b) => parseInt(b, 16)));
|
|
2041
|
+
let binary = "";
|
|
2042
|
+
md5Bytes.forEach((byte) => binary += String.fromCharCode(byte));
|
|
2043
|
+
md5Base64 = btoa(binary);
|
|
2038
2044
|
}
|
|
2039
2045
|
const presignedInput = {
|
|
2040
2046
|
fileMd5Base64: md5Base64,
|