@retailcrm/embed-ui-v1-contexts 0.5.23-alpha.7 → 0.6.0

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/remote.cjs CHANGED
@@ -63,10 +63,13 @@ const defineActions = (id, schema) => {
63
63
  throw new Error(`[crm:embed:remote] Invalid arguments for invokable ${String(name)} in schema ${id}`);
64
64
  }
65
65
  const result = await endpoint.call.invoke(String(name), ...args);
66
- if (!expects(result)) {
66
+ if (result.rejection) {
67
+ throw new Error(`[crm:embed:remote] Invokable ${String(name)} in schema ${id} failed with: ${result.rejection.message}`);
68
+ }
69
+ if (!expects(result.payload)) {
67
70
  throw new Error(`[crm:embed:remote] Invalid result for invokable ${String(name)} in schema ${id}`);
68
71
  }
69
- return result;
72
+ return result.payload;
70
73
  };
71
74
  }
72
75
  });
package/dist/remote.js CHANGED
@@ -61,10 +61,13 @@ const defineActions = (id, schema) => {
61
61
  throw new Error(`[crm:embed:remote] Invalid arguments for invokable ${String(name)} in schema ${id}`);
62
62
  }
63
63
  const result = await endpoint.call.invoke(String(name), ...args);
64
- if (!expects(result)) {
64
+ if (result.rejection) {
65
+ throw new Error(`[crm:embed:remote] Invokable ${String(name)} in schema ${id} failed with: ${result.rejection.message}`);
66
+ }
67
+ if (!expects(result.payload)) {
65
68
  throw new Error(`[crm:embed:remote] Invalid result for invokable ${String(name)} in schema ${id}`);
66
69
  }
67
- return result;
70
+ return result.payload;
68
71
  };
69
72
  }
70
73
  });
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@retailcrm/embed-ui-v1-contexts",
3
3
  "description": "Reactive contexts for RetailCRM JS API",
4
4
  "type": "module",
5
- "version": "0.5.23-alpha.7",
5
+ "version": "0.6.0",
6
6
  "license": "MIT",
7
7
  "author": "RetailDriverLLC <integration@retailcrm.ru>",
8
8
  "repository": "git@github.com:retailcrm/embed-ui.git",
@@ -104,10 +104,10 @@
104
104
  "@floating-ui/core": "^1.6.9",
105
105
  "@floating-ui/dom": "^1.6.13",
106
106
  "@omnicajs/symfony-router": "^1.0.0",
107
- "@retailcrm/embed-ui-v1-types": "^0.5.23-alpha.7"
107
+ "@retailcrm/embed-ui-v1-types": "^0.6.0"
108
108
  },
109
109
  "devDependencies": {
110
- "@retailcrm/embed-ui-v1-testing": "^0.5.23-alpha.7",
110
+ "@retailcrm/embed-ui-v1-testing": "^0.6.0",
111
111
  "tsx": "^4.19.2",
112
112
  "typescript": "^5.6.3",
113
113
  "vite": "^5.4.11",