@dpuse/dpuse-shared 0.3.780 → 0.3.783

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/README.md CHANGED
@@ -149,11 +149,11 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
149
149
  | dist/dpuse-shared-errors.es.js | 3.5 kB · brotli 1.1 kB |
150
150
  | dist/dpuse-shared-locale.es.js | 1.0 kB · brotli 393 B |
151
151
  | dist/dpuse-shared-component.es.js | 842 B · brotli 355 B |
152
+ | dist/dpuse-shared-componentModuleTool.es.js | 784 B · brotli 398 B |
152
153
  | dist/dpuse-shared-componentDataView.es.js | 722 B · brotli 310 B |
153
154
  | dist/dpuse-shared-componentModulePresenter.es.js | 411 B · brotli 225 B |
154
155
  | dist/moduleConfig.schema-CcJFr8H1.js | 405 B · brotli 224 B |
155
156
  | dist/dpuse-shared-componentModuleCookbook.es.js | 370 B · brotli 203 B |
156
- | dist/dpuse-shared-componentModuleTool.es.js | 302 B · brotli 216 B |
157
157
  | dist/dpuse-shared-componentRecipe.es.js | 94 B · brotli 70 B |
158
158
  | dist/dpuse-shared-componentConnection.es.js | 0 B · brotli 1 B |
159
159
  | dist/dpuse-shared-componentContext.es.js | 0 B · brotli 1 B |
@@ -1,10 +1,29 @@
1
- async function e(e, t) {
2
- let n = `dpuse-tool-${t}`, r = e.find((e) => e.id === n);
3
- if (!r) throw Error(`Tool '${t} not found'.`);
4
- return new (await (import(
5
- /* @vite-ignore */
6
- `https://engine-eu.dpuse.app/tools/${t}_v${r.version}/${n}.es.js`
1
+ import { AppError as e } from "./dpuse-shared-errors.es.js";
2
+ //#region src/component/module/tool/index.ts
3
+ var t = "https://engine-eu.dpuse.app/tools";
4
+ async function n(n, r) {
5
+ let i = `dpuse-tool-${r}`, a = n.find((e) => e.id === i);
6
+ if (!a) {
7
+ let t = {
8
+ availableToolIds: n.map((e) => e.id),
9
+ toolName: i
10
+ };
11
+ throw new e(`Tool '${r}' not found.`, "dpuse-shared.component.module.tool.loadTool", t);
12
+ }
13
+ let o = `${t}/${r}_v${a.version}/${i}.es.js`;
14
+ try {
15
+ return new (await (import(
16
+ /* @vite-ignore */
17
+ o
7
18
  ))).Tool();
19
+ } catch (t) {
20
+ let n = {
21
+ toolName: i,
22
+ url: o,
23
+ version: a.version
24
+ };
25
+ throw new e(`Failed to load tool '${i}' v${a.version}.`, "dpuse-shared.component.module.tool.loadTool", n, { cause: t });
26
+ }
8
27
  }
9
28
  //#endregion
10
- export { e as loadTool };
29
+ export { n as loadTool };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dpuse/dpuse-shared",
3
- "version": "0.3.780",
3
+ "version": "0.3.783",
4
4
  "private": false,
5
5
  "description": "Common constants, types and utilities used across all DPUse projects.",
6
6
  "license": "MIT",