@ctil/gql 1.0.18 → 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 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 || value === void 0) continue;
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) {
@@ -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
- md5Base64 = SparkMD5.ArrayBuffer.hash(arrayBuffer, true);
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,