@ctil/gql 1.0.17 → 1.0.19
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 +12 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -4
- 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) {
|
|
@@ -4703,7 +4708,7 @@ var import_crypto = __toESM(require("crypto"), 1);
|
|
|
4703
4708
|
var import_fs2 = __toESM(require("fs"), 1);
|
|
4704
4709
|
var import_path2 = __toESM(require("path"), 1);
|
|
4705
4710
|
async function computeFileMd5Base64(file) {
|
|
4706
|
-
if (typeof window
|
|
4711
|
+
if (typeof window === "undefined") {
|
|
4707
4712
|
let buffer;
|
|
4708
4713
|
if (typeof file === "string") {
|
|
4709
4714
|
buffer = import_fs2.default.readFileSync(import_path2.default.resolve(file));
|
|
@@ -4757,7 +4762,6 @@ var oss = {
|
|
|
4757
4762
|
const result = await execute({ query: query2, variables });
|
|
4758
4763
|
return result;
|
|
4759
4764
|
});
|
|
4760
|
-
console.log("presignedResult====>", presignedResult);
|
|
4761
4765
|
if (!presignedResult.uploadPresignedUrl) throw new Error("\u83B7\u53D6\u9884\u7B7E\u540D URL \u5931\u8D25");
|
|
4762
4766
|
const { uploadUrl, uploadHeaders, downloadUrl, resourceId, contentType, originalFileName } = presignedResult.uploadPresignedUrl;
|
|
4763
4767
|
const headers = {};
|
|
@@ -4803,7 +4807,11 @@ var oss = {
|
|
|
4803
4807
|
md5Base64 = import_crypto.default.createHash("md5").update(Buffer.from(arrayBuffer)).digest("base64");
|
|
4804
4808
|
} else {
|
|
4805
4809
|
const SparkMD5 = (await import("spark-md5")).default;
|
|
4806
|
-
|
|
4810
|
+
const md5Hex = SparkMD5.ArrayBuffer.hash(arrayBuffer, false);
|
|
4811
|
+
const md5Bytes = new Uint8Array(md5Hex.match(/.{2}/g).map((b) => parseInt(b, 16)));
|
|
4812
|
+
let binary = "";
|
|
4813
|
+
md5Bytes.forEach((byte) => binary += String.fromCharCode(byte));
|
|
4814
|
+
md5Base64 = btoa(binary);
|
|
4807
4815
|
}
|
|
4808
4816
|
const presignedInput = {
|
|
4809
4817
|
fileMd5Base64: md5Base64,
|