@lark-sh/client 0.1.17 → 0.1.18

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.
@@ -2828,6 +2828,7 @@ function generatePushId() {
2828
2828
 
2829
2829
  // src/utils/validation.ts
2830
2830
  var MAX_KEY_BYTES = 768;
2831
+ var MAX_STRING_VALUE_BYTES = 10 * 1024 * 1024;
2831
2832
  var INVALID_KEY_CHARS = /[.#$\[\]\/]/;
2832
2833
  var CONTROL_CHARS = /[\x00-\x1f\x7f]/;
2833
2834
  function hasControlChars(str) {
@@ -2898,10 +2899,11 @@ function validateValue(value, context, path = "") {
2898
2899
  return;
2899
2900
  }
2900
2901
  if (typeof value === "string") {
2901
- if (hasControlChars(value)) {
2902
+ const byteLength = getByteLength(value);
2903
+ if (byteLength > MAX_STRING_VALUE_BYTES) {
2902
2904
  throw new LarkError(
2903
2905
  ErrorCode.INVALID_DATA,
2904
- `${prefix}string value${location} contains control characters (ASCII 0-31, 127 are not allowed)`
2906
+ `${prefix}string value${location} exceeds maximum size of 10 MB (got ${Math.round(byteLength / 1024 / 1024 * 100) / 100} MB)`
2905
2907
  );
2906
2908
  }
2907
2909
  return;
@@ -5348,4 +5350,4 @@ export {
5348
5350
  ServerValue,
5349
5351
  LarkDatabase
5350
5352
  };
5351
- //# sourceMappingURL=chunk-VLAAYUVX.mjs.map
5353
+ //# sourceMappingURL=chunk-UVJBN3NR.mjs.map