@overmap-ai/core 1.0.35-fix-token-refresh-loop.0 → 1.0.35-fix-token-refresh-loop.2

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.
@@ -3461,6 +3461,19 @@ var __publicField = (obj, key, value) => {
3461
3461
  return errorRes.body.error;
3462
3462
  if (typeof errorRes.body.message === "string")
3463
3463
  return errorRes.body.message;
3464
+ try {
3465
+ return Object.entries(errorRes.body).map(([key, value]) => {
3466
+ if (typeof value === "string") {
3467
+ return `${key}: ${value}`;
3468
+ }
3469
+ if (Array.isArray(value)) {
3470
+ return value.map((v) => `${key}: ${v}`).join("\n");
3471
+ }
3472
+ return `${key}: ${JSON.stringify(value)}`;
3473
+ }).join("\n");
3474
+ } catch (e) {
3475
+ console.error("Failed to extract error message from response body", e);
3476
+ }
3464
3477
  } else if (typeof errorRes.body === "string")
3465
3478
  return errorRes.body;
3466
3479
  } else if (errorRes == null ? void 0 : errorRes.text) {
@@ -10212,7 +10225,7 @@ var __publicField = (obj, key, value) => {
10212
10225
  PatchField.displayName = "PatchField";
10213
10226
  const PatchFormProvider = React.memo(
10214
10227
  React.forwardRef((props, ref) => {
10215
- const { children, schema, values, onPatch, onError, ...rest } = props;
10228
+ const { children, schema, values, onPatch, onError, requiresDiff = true, ...rest } = props;
10216
10229
  const initialValues2 = React.useMemo(() => initialFormValues(schema.fields, values), [schema.fields, values]);
10217
10230
  const handlePatch = React.useCallback(
10218
10231
  (values2) => {
@@ -10223,11 +10236,11 @@ var __publicField = (obj, key, value) => {
10223
10236
  diff[key] = value;
10224
10237
  }
10225
10238
  }
10226
- if (!hasKeys(diff))
10239
+ if (requiresDiff && !hasKeys(diff))
10227
10240
  return;
10228
10241
  onPatch(diff);
10229
10242
  },
10230
- [initialValues2, onPatch]
10243
+ [initialValues2, onPatch, requiresDiff]
10231
10244
  );
10232
10245
  const validate = React.useCallback(
10233
10246
  (form) => {