openxiangda 1.0.48 → 1.0.50

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda",
3
- "version": "1.0.48",
3
+ "version": "1.0.50",
4
4
  "description": "OpenXiangda CLI, workspace build tools, runtime SDK, and form components.",
5
5
  "private": false,
6
6
  "bin": {
@@ -39207,8 +39207,16 @@ var normalizeFormInstancePayload = (payload) => {
39207
39207
  };
39208
39208
  };
39209
39209
  var unwrapBusinessResponse = (response) => {
39210
- const result = response?.data || response?.result || response;
39211
- if (result?.success === false) {
39210
+ const isFailureCode = (value) => {
39211
+ if (value === void 0 || value === null || value === "") return false;
39212
+ const code = Number(value);
39213
+ return Number.isFinite(code) && code !== 0 && code !== 200;
39214
+ };
39215
+ if (response?.success === false || isFailureCode(response?.code)) {
39216
+ throw new Error(response.message || response.error || "\u8BF7\u6C42\u5931\u8D25");
39217
+ }
39218
+ const result = response?.data ?? response?.result ?? response;
39219
+ if (result?.success === false || isFailureCode(result?.code)) {
39212
39220
  throw new Error(result.message || response?.message || "\u8BF7\u6C42\u5931\u8D25");
39213
39221
  }
39214
39222
  return result;
@@ -39456,7 +39464,7 @@ function createFormRuntimeApi(config3) {
39456
39464
  method: "post",
39457
39465
  data: payload
39458
39466
  });
39459
- return response.data || response.result || response;
39467
+ return unwrapBusinessResponse(response);
39460
39468
  },
39461
39469
  updateFormData: async (payload) => {
39462
39470
  const data = normalizeFormInstancePayload(payload);