@thatopen/services 0.0.6 → 0.1.3

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.
Files changed (64) hide show
  1. package/README.md +46 -46
  2. package/dist/built-in/index.d.ts +723 -0
  3. package/dist/cli.js +22 -0
  4. package/dist/core/client.d.ts +10 -1
  5. package/dist/index.cjs.js +2 -2
  6. package/dist/index.es.js +87 -71
  7. package/dist/types/files.d.ts +6 -0
  8. package/dist/vite-env.d.ts +1 -1
  9. package/docs/builtin/paths.json +22 -6
  10. package/package.json +99 -99
  11. package/resources/AGENTS.md +5 -3
  12. package/src/built-in/AppManager/example.ts +86 -86
  13. package/src/built-in/CDEManager/example.ts +214 -214
  14. package/src/built-in/CDEManager/examples/FileEditing/example.ts +226 -226
  15. package/src/built-in/CDEManager/examples/FileMoves/example.ts +186 -186
  16. package/src/built-in/CDEManager/examples/FileOperations/example.ts +295 -295
  17. package/src/built-in/CDEManager/examples/FileTransfers/example.ts +210 -210
  18. package/src/built-in/CDEManager/examples/FolderManagement/example.ts +230 -230
  19. package/src/built-in/CDEManager/examples/MetadataSchema/example.ts +230 -230
  20. package/src/built-in/CDEManager/examples/MetadataViews/example.ts +166 -166
  21. package/src/built-in/CDEManager/examples/ProjectConfig/example.ts +177 -177
  22. package/src/built-in/FileList/example.ts +107 -107
  23. package/src/built-in/TabbedNavigation/example.ts +115 -115
  24. package/src/built-in/UIManager/src/app/example.ts +99 -0
  25. package/src/built-in/UIManager/src/app/examples/AppState/example.ts +142 -0
  26. package/src/built-in/UIManager/src/app/examples/Contexts/example.ts +125 -0
  27. package/src/built-in/UIManager/src/app/examples/FloatingLayout/example.ts +92 -0
  28. package/src/built-in/UIManager/src/app/examples/Notifications/example.ts +161 -0
  29. package/src/built-in/UIManager/src/app/examples/Sidebar/example.ts +104 -0
  30. package/src/built-in/ViewportsManager/example.ts +106 -106
  31. package/src/built-in/index.ts +755 -755
  32. package/src/cli/templates/app/README.md +241 -241
  33. package/src/cli/templates/app/index.html +27 -27
  34. package/src/cli/templates/app/package.json +27 -25
  35. package/src/cli/templates/app/src/bim-components/CloudRunner/index.ts +87 -91
  36. package/src/cli/templates/app/src/bim-components/CloudRunner/src/index.ts +1 -1
  37. package/src/cli/templates/app/src/bim-components/CloudRunner/src/types.ts +5 -5
  38. package/src/cli/templates/app/src/bim-components/index.ts +1 -1
  39. package/src/cli/templates/app/src/main.ts +56 -89
  40. package/src/cli/templates/app/src/setups/cloud-runner.ts +9 -13
  41. package/src/cli/templates/app/src/setups/fragments.ts +18 -0
  42. package/src/cli/templates/app/src/setups/ifc-loader.ts +12 -0
  43. package/src/cli/templates/app/src/setups/index.ts +3 -3
  44. package/src/cli/templates/app/src/ui-components/AppPanel/index.ts +160 -0
  45. package/src/cli/templates/app/src/ui-components/index.ts +1 -2
  46. package/src/cli/templates/app/tsconfig.json +17 -16
  47. package/src/cli/templates/cloud-component/README.md +205 -205
  48. package/src/cli/templates/cloud-component/_thatopen +5 -5
  49. package/src/cli/templates/cloud-component/declarations.json +4 -4
  50. package/src/cli/templates/cloud-component/package.json +21 -21
  51. package/src/cli/templates/cloud-component/src/main.ts +70 -70
  52. package/src/cli/templates/cloud-component/tsconfig.json +16 -16
  53. package/src/cli/templates/shared/CLAUDE.md +1 -1
  54. package/src/cli/templates/shared/_gitignore +4 -4
  55. package/src/cli/templates/app/src/app.ts +0 -16
  56. package/src/cli/templates/app/src/globals.ts +0 -1
  57. package/src/cli/templates/app/src/setups/ui-manager.ts +0 -27
  58. package/src/cli/templates/app/src/setups/viewports-manager.ts +0 -22
  59. package/src/cli/templates/app/src/ui-components/app-info-section/index.ts +0 -26
  60. package/src/cli/templates/app/src/ui-components/app-info-section/src/index.ts +0 -1
  61. package/src/cli/templates/app/src/ui-components/app-info-section/src/types.ts +0 -15
  62. package/src/cli/templates/app/src/ui-components/cloud-runner-section/index.ts +0 -37
  63. package/src/cli/templates/app/src/ui-components/cloud-runner-section/src/index.ts +0 -1
  64. package/src/cli/templates/app/src/ui-components/cloud-runner-section/src/types.ts +0 -14
package/dist/index.es.js CHANGED
@@ -41,11 +41,11 @@ const Ee = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", N
41
41
  for (let n = 0; n < Ee.length; n++)
42
42
  N[Ee.charCodeAt(n)] = n;
43
43
  const He = (n) => {
44
- let e = n.length * 0.75, t = n.length, s, r = 0, i, o, h, u;
44
+ let e = n.length * 0.75, t = n.length, s, r = 0, i, o, h, l;
45
45
  n[n.length - 1] === "=" && (e--, n[n.length - 2] === "=" && e--);
46
46
  const y = new ArrayBuffer(e), d = new Uint8Array(y);
47
47
  for (s = 0; s < t; s += 4)
48
- i = N[n.charCodeAt(s)], o = N[n.charCodeAt(s + 1)], h = N[n.charCodeAt(s + 2)], u = N[n.charCodeAt(s + 3)], d[r++] = i << 2 | o >> 4, d[r++] = (o & 15) << 4 | h >> 2, d[r++] = (h & 3) << 6 | u & 63;
48
+ i = N[n.charCodeAt(s)], o = N[n.charCodeAt(s + 1)], h = N[n.charCodeAt(s + 2)], l = N[n.charCodeAt(s + 3)], d[r++] = i << 2 | o >> 4, d[r++] = (o & 15) << 4 | h >> 2, d[r++] = (h & 3) << 6 | l & 63;
49
49
  return y;
50
50
  }, Je = typeof ArrayBuffer == "function", le = (n, e) => {
51
51
  if (typeof n != "string")
@@ -139,17 +139,17 @@ function We(n, e) {
139
139
  if (s === 0) {
140
140
  if (P(t) < 1)
141
141
  break;
142
- const u = L(t, 1);
143
- i = (u[0] & 128) === 128, r = u[0] & 127, r < 126 ? s = 3 : r === 126 ? s = 1 : s = 2;
142
+ const l = L(t, 1);
143
+ i = (l[0] & 128) === 128, r = l[0] & 127, r < 126 ? s = 3 : r === 126 ? s = 1 : s = 2;
144
144
  } else if (s === 1) {
145
145
  if (P(t) < 2)
146
146
  break;
147
- const u = L(t, 2);
148
- r = new DataView(u.buffer, u.byteOffset, u.length).getUint16(0), s = 3;
147
+ const l = L(t, 2);
148
+ r = new DataView(l.buffer, l.byteOffset, l.length).getUint16(0), s = 3;
149
149
  } else if (s === 2) {
150
150
  if (P(t) < 8)
151
151
  break;
152
- const u = L(t, 8), y = new DataView(u.buffer, u.byteOffset, u.length), d = y.getUint32(0);
152
+ const l = L(t, 8), y = new DataView(l.buffer, l.byteOffset, l.length), d = y.getUint32(0);
153
153
  if (d > Math.pow(2, 21) - 1) {
154
154
  h.enqueue(ee);
155
155
  break;
@@ -158,8 +158,8 @@ function We(n, e) {
158
158
  } else {
159
159
  if (P(t) < r)
160
160
  break;
161
- const u = L(t, r);
162
- h.enqueue(le(i ? u : W.decode(u), e)), s = 0;
161
+ const l = L(t, r);
162
+ h.enqueue(le(i ? l : W.decode(l), e)), s = 0;
163
163
  }
164
164
  if (r === 0 || r > n) {
165
165
  h.enqueue(ee);
@@ -724,8 +724,8 @@ class dt extends fe {
724
724
  const t = We(Number.MAX_SAFE_INTEGER, this.socket.binaryType), s = e.readable.pipeThrough(t).getReader(), r = Ye();
725
725
  r.readable.pipeTo(e.writable), this._writer = r.writable.getWriter();
726
726
  const i = () => {
727
- s.read().then(({ done: h, value: u }) => {
728
- h || (this.onPacket(u), i());
727
+ s.read().then(({ done: h, value: l }) => {
728
+ h || (this.onPacket(l), i());
729
729
  }).catch((h) => {
730
730
  });
731
731
  };
@@ -1109,16 +1109,16 @@ class bt extends C {
1109
1109
  function h() {
1110
1110
  o("transport closed");
1111
1111
  }
1112
- function u() {
1112
+ function l() {
1113
1113
  o("socket closed");
1114
1114
  }
1115
1115
  function y(m) {
1116
1116
  t && m.name !== t.name && i();
1117
1117
  }
1118
1118
  const d = () => {
1119
- t.removeListener("open", r), t.removeListener("error", o), t.removeListener("close", h), this.off("close", u), this.off("upgrading", y);
1119
+ t.removeListener("open", r), t.removeListener("error", o), t.removeListener("close", h), this.off("close", l), this.off("upgrading", y);
1120
1120
  };
1121
- t.once("open", r), t.once("error", o), t.once("close", h), this.once("close", u), this.once("upgrading", y), this._upgrades.indexOf("webtransport") !== -1 && e !== "webtransport" ? this.setTimeoutFn(() => {
1121
+ t.once("open", r), t.once("error", o), t.once("close", h), this.once("close", l), this.once("upgrading", y), this._upgrades.indexOf("webtransport") !== -1 && e !== "webtransport" ? this.setTimeoutFn(() => {
1122
1122
  s || t.open();
1123
1123
  }, 200) : t.open();
1124
1124
  }
@@ -1562,8 +1562,8 @@ class qe extends g {
1562
1562
  const d = this.ids++, m = t.pop();
1563
1563
  this._registerAckCallback(d, m), o.id = d;
1564
1564
  }
1565
- const h = (r = (s = this.io.engine) === null || s === void 0 ? void 0 : s.transport) === null || r === void 0 ? void 0 : r.writable, u = this.connected && !(!((i = this.io.engine) === null || i === void 0) && i._hasPingExpired());
1566
- return this.flags.volatile && !h || (u ? (this.notifyOutgoingListeners(o), this.packet(o)) : this.sendBuffer.push(o)), this.flags = {}, this;
1565
+ const h = (r = (s = this.io.engine) === null || s === void 0 ? void 0 : s.transport) === null || r === void 0 ? void 0 : r.writable, l = this.connected && !(!((i = this.io.engine) === null || i === void 0) && i._hasPingExpired());
1566
+ return this.flags.volatile && !h || (l ? (this.notifyOutgoingListeners(o), this.packet(o)) : this.sendBuffer.push(o)), this.flags = {}, this;
1567
1567
  }
1568
1568
  /**
1569
1569
  * @private
@@ -2109,11 +2109,11 @@ class ie extends g {
2109
2109
  this.cleanup(), this._readyState = "closed", this.emitReserved("error", h), e ? e(h) : this.maybeReconnectOnOpen();
2110
2110
  }, o = E(t, "error", i);
2111
2111
  if (this._timeout !== !1) {
2112
- const h = this._timeout, u = this.setTimeoutFn(() => {
2112
+ const h = this._timeout, l = this.setTimeoutFn(() => {
2113
2113
  r(), i(new Error("timeout")), t.close();
2114
2114
  }, h);
2115
- this.opts.autoUnref && u.unref(), this.subs.push(() => {
2116
- this.clearTimeoutFn(u);
2115
+ this.opts.autoUnref && l.unref(), this.subs.push(() => {
2116
+ this.clearTimeoutFn(l);
2117
2117
  });
2118
2118
  }
2119
2119
  return this.subs.push(r), this.subs.push(o), this;
@@ -2291,8 +2291,8 @@ const x = {};
2291
2291
  function F(n, e) {
2292
2292
  typeof n == "object" && (e = n, n = void 0), e = e || {};
2293
2293
  const t = Tt(n, e.path || "/socket.io"), s = t.source, r = t.id, i = t.path, o = x[r] && i in x[r].nsps, h = e.forceNew || e["force new connection"] || e.multiplex === !1 || o;
2294
- let u;
2295
- return h ? u = new ie(s, e) : (x[r] || (x[r] = new ie(s, e)), u = x[r]), t.query && !e.query && (e.query = t.queryKey), u.socket(t.path, e);
2294
+ let l;
2295
+ return h ? l = new ie(s, e) : (x[r] || (x[r] = new ie(s, e)), l = x[r]), t.query && !e.query && (e.query = t.queryKey), l.socket(t.path, e);
2296
2296
  }
2297
2297
  Object.assign(F, {
2298
2298
  Manager: ie,
@@ -2327,7 +2327,7 @@ class Lt extends Error {
2327
2327
  }
2328
2328
  }
2329
2329
  const T = "item/folder", p = "item", O = "processor", R = "hidden", X = "FILE", Q = "TOOL", Z = "APP";
2330
- var a, ae, l, S, V, M, ce, he, Ue;
2330
+ var a, ae, u, S, V, M, ce, he, Ue;
2331
2331
  const ye = class ye {
2332
2332
  /**
2333
2333
  * Creates a new EngineServicesClient instance.
@@ -2359,8 +2359,8 @@ const ye = class ye {
2359
2359
  const { retries: r = 0, useBearer: i = !1, localServerUrl: o } = s || {};
2360
2360
  let h = t;
2361
2361
  if (h.charAt(h.length - 1) === "/" && (h = h.slice(0, -1)), this.apiUrl = `${h}/api`, this.accessToken = e, this.wsUrl = `${h}?accessToken=${e}`, this.retries = r, this.useBearer = i, this.context = { appId: "", projectId: "", accessToken: e, apiUrl: t }, o) {
2362
- let u = o;
2363
- u.charAt(u.length - 1) === "/" && (u = u.slice(0, -1)), this.localServerUrl = u;
2362
+ let l = o;
2363
+ l.charAt(l.length - 1) === "/" && (l = l.slice(0, -1)), this.localServerUrl = l;
2364
2364
  }
2365
2365
  }
2366
2366
  /**
@@ -2442,7 +2442,7 @@ const ye = class ye {
2442
2442
  * cleaning logic is applied identically.
2443
2443
  */
2444
2444
  async request(e, t, s) {
2445
- return c(this, a, l).call(this, e, t, s);
2445
+ return c(this, a, u).call(this, e, t, s);
2446
2446
  }
2447
2447
  // ─── Files ───────────────────────────────────────────────────────
2448
2448
  /**
@@ -2452,7 +2452,7 @@ const ye = class ye {
2452
2452
  */
2453
2453
  async listFiles(e) {
2454
2454
  const { folderId: t, archived: s, projectId: r } = e || {};
2455
- return t ? await c(this, a, l).call(this, "GET", `${T}/${t}/items`, { query: { itemType: X, archived: s } }) : await c(this, a, l).call(this, "GET", `${p}`, {
2455
+ return t ? await c(this, a, u).call(this, "GET", `${T}/${t}/items`, { query: { itemType: X, archived: s } }) : await c(this, a, u).call(this, "GET", `${p}`, {
2456
2456
  query: {
2457
2457
  itemType: X,
2458
2458
  archived: s,
@@ -2492,14 +2492,14 @@ const ye = class ye {
2492
2492
  * @param fileId - The file's unique identifier.
2493
2493
  */
2494
2494
  async archiveFile(e) {
2495
- return await c(this, a, l).call(this, "DELETE", `${p}/${e}`);
2495
+ return await c(this, a, u).call(this, "DELETE", `${p}/${e}`);
2496
2496
  }
2497
2497
  /**
2498
2498
  * Recovers a previously archived file.
2499
2499
  * @param fileId - The file's unique identifier.
2500
2500
  */
2501
2501
  async recoverFile(e) {
2502
- return await c(this, a, l).call(this, "PUT", `${p}/${e}/recover`);
2502
+ return await c(this, a, u).call(this, "PUT", `${p}/${e}/recover`);
2503
2503
  }
2504
2504
  /**
2505
2505
  * Downloads a file's content. Returns the raw fetch Response.
@@ -2519,7 +2519,7 @@ const ye = class ye {
2519
2519
  */
2520
2520
  async getFileVersionMetadata(e, t, s) {
2521
2521
  const { withDraft: r } = s || {};
2522
- return await c(this, a, l).call(this, "GET", `${p}/${encodeURIComponent(e)}/version/${encodeURIComponent(t)}/metadata`, {
2522
+ return await c(this, a, u).call(this, "GET", `${p}/${encodeURIComponent(e)}/version/${encodeURIComponent(t)}/metadata`, {
2523
2523
  query: {
2524
2524
  ...r && { withDraft: "true" }
2525
2525
  }
@@ -2532,7 +2532,7 @@ const ye = class ye {
2532
2532
  * @param metadata - Free-JSON object (max 200 fields, 50-char keys/values).
2533
2533
  */
2534
2534
  async updateFileVersionMetadata(e, t, s) {
2535
- return await c(this, a, l).call(this, "PUT", `${p}/${encodeURIComponent(e)}/version/${encodeURIComponent(t)}/metadata`, {
2535
+ return await c(this, a, u).call(this, "PUT", `${p}/${encodeURIComponent(e)}/version/${encodeURIComponent(t)}/metadata`, {
2536
2536
  body: JSON.stringify({ metadata: s }),
2537
2537
  contentType: "application/json"
2538
2538
  });
@@ -2543,7 +2543,7 @@ const ye = class ye {
2543
2543
  * @param versionTag - The version tag.
2544
2544
  */
2545
2545
  async deleteFileVersionMetadata(e, t) {
2546
- return await c(this, a, l).call(this, "DELETE", `${p}/${encodeURIComponent(e)}/version/${encodeURIComponent(t)}/metadata`);
2546
+ return await c(this, a, u).call(this, "DELETE", `${p}/${encodeURIComponent(e)}/version/${encodeURIComponent(t)}/metadata`);
2547
2547
  }
2548
2548
  // ─── Folders ─────────────────────────────────────────────────────
2549
2549
  /**
@@ -2553,7 +2553,7 @@ const ye = class ye {
2553
2553
  */
2554
2554
  async listFolders(e) {
2555
2555
  const { archived: t, parentFolderId: s, projectId: r } = e || {};
2556
- return await c(this, a, l).call(this, "GET", T, {
2556
+ return await c(this, a, u).call(this, "GET", T, {
2557
2557
  query: {
2558
2558
  parentFolderId: s,
2559
2559
  archived: t,
@@ -2566,7 +2566,7 @@ const ye = class ye {
2566
2566
  * @param folderId - The folder's unique identifier.
2567
2567
  */
2568
2568
  async getFolder(e) {
2569
- return await c(this, a, l).call(this, "GET", `${T}/${e}`);
2569
+ return await c(this, a, u).call(this, "GET", `${T}/${e}`);
2570
2570
  }
2571
2571
  /**
2572
2572
  * Creates a new folder.
@@ -2575,7 +2575,7 @@ const ye = class ye {
2575
2575
  * @returns The created folder.
2576
2576
  */
2577
2577
  async createFolder(e, t, s) {
2578
- return await c(this, a, l).call(this, "POST", T, {
2578
+ return await c(this, a, u).call(this, "POST", T, {
2579
2579
  body: JSON.stringify({
2580
2580
  name: e,
2581
2581
  ...t && { parentId: t },
@@ -2592,7 +2592,7 @@ const ye = class ye {
2592
2592
  */
2593
2593
  async updateFolder(e, t) {
2594
2594
  const { name: s } = t;
2595
- return await c(this, a, l).call(this, "PUT", `${T}/${e}`, {
2595
+ return await c(this, a, u).call(this, "PUT", `${T}/${e}`, {
2596
2596
  body: JSON.stringify({ name: s }),
2597
2597
  contentType: "application/json"
2598
2598
  });
@@ -2602,14 +2602,14 @@ const ye = class ye {
2602
2602
  * @param folderId - The folder's unique identifier.
2603
2603
  */
2604
2604
  async archiveFolder(e) {
2605
- return await c(this, a, l).call(this, "DELETE", `${T}/${e}`);
2605
+ return await c(this, a, u).call(this, "DELETE", `${T}/${e}`);
2606
2606
  }
2607
2607
  /**
2608
2608
  * Recovers a previously archived folder.
2609
2609
  * @param folderId - The folder's unique identifier.
2610
2610
  */
2611
2611
  async recoverFolder(e) {
2612
- return await c(this, a, l).call(this, "PUT", `${T}/${e}/recover`);
2612
+ return await c(this, a, u).call(this, "PUT", `${T}/${e}/recover`);
2613
2613
  }
2614
2614
  /**
2615
2615
  * Downloads an entire folder as a ZIP archive.
@@ -2627,12 +2627,12 @@ const ye = class ye {
2627
2627
  */
2628
2628
  async listComponents(e) {
2629
2629
  const { folderId: t, ShowVersions: s, projectId: r } = e || {};
2630
- return t ? await c(this, a, l).call(this, "GET", `${T}/${t}/items`, {
2630
+ return t ? await c(this, a, u).call(this, "GET", `${T}/${t}/items`, {
2631
2631
  query: {
2632
2632
  itemType: Q,
2633
2633
  ...s && { ShowVersions: s }
2634
2634
  }
2635
- }) : await c(this, a, l).call(this, "GET", `${p}`, {
2635
+ }) : await c(this, a, u).call(this, "GET", `${p}`, {
2636
2636
  query: {
2637
2637
  itemType: Q,
2638
2638
  ...s && { ShowVersions: s },
@@ -2697,14 +2697,14 @@ const ye = class ye {
2697
2697
  * @param componentId - The component's unique identifier.
2698
2698
  */
2699
2699
  async archiveComponent(e) {
2700
- return await c(this, a, l).call(this, "DELETE", `${p}/${e}`);
2700
+ return await c(this, a, u).call(this, "DELETE", `${p}/${e}`);
2701
2701
  }
2702
2702
  /**
2703
2703
  * Recovers a previously archived component.
2704
2704
  * @param componentId - The component's unique identifier.
2705
2705
  */
2706
2706
  async recoverComponent(e) {
2707
- return await c(this, a, l).call(this, "PUT", `${p}/${e}/recover`);
2707
+ return await c(this, a, u).call(this, "PUT", `${p}/${e}/recover`);
2708
2708
  }
2709
2709
  // ─── Built-in Components ─────────────────────────────────────────
2710
2710
  /**
@@ -2811,12 +2811,12 @@ return main;`)(...h), d = (y == null ? void 0 : y.componentDefinition) ?? y;
2811
2811
  */
2812
2812
  async listApps(e) {
2813
2813
  const { folderId: t, ShowVersions: s, projectId: r } = e || {};
2814
- return t ? await c(this, a, l).call(this, "GET", `${T}/${t}/items`, {
2814
+ return t ? await c(this, a, u).call(this, "GET", `${T}/${t}/items`, {
2815
2815
  query: {
2816
2816
  itemType: Z,
2817
2817
  ...s && { ShowVersions: s }
2818
2818
  }
2819
- }) : await c(this, a, l).call(this, "GET", `${p}`, {
2819
+ }) : await c(this, a, u).call(this, "GET", `${p}`, {
2820
2820
  query: {
2821
2821
  itemType: Z,
2822
2822
  ...s && { ShowVersions: s },
@@ -2863,7 +2863,7 @@ return main;`)(...h), d = (y == null ? void 0 : y.componentDefinition) ?? y;
2863
2863
  * @param appId - The app's unique identifier.
2864
2864
  */
2865
2865
  async archiveApp(e) {
2866
- return await c(this, a, l).call(this, "DELETE", `${p}/${e}`);
2866
+ return await c(this, a, u).call(this, "DELETE", `${p}/${e}`);
2867
2867
  }
2868
2868
  // ─── Execution ───────────────────────────────────────────────────
2869
2869
  /**
@@ -2893,7 +2893,7 @@ return main;`)(...h), d = (y == null ? void 0 : y.componentDefinition) ?? y;
2893
2893
  }
2894
2894
  return await i.json();
2895
2895
  }
2896
- return await c(this, a, l).call(this, "POST", `${O}/${e}/execute`, {
2896
+ return await c(this, a, u).call(this, "POST", `${O}/${e}/execute`, {
2897
2897
  body: JSON.stringify(t),
2898
2898
  query: { ...s && { versionTag: s } },
2899
2899
  contentType: "application/json"
@@ -2912,7 +2912,7 @@ return main;`)(...h), d = (y == null ? void 0 : y.componentDefinition) ?? y;
2912
2912
  }
2913
2913
  return await s.json();
2914
2914
  }
2915
- return await c(this, a, l).call(this, "POST", `${O}/progress/${e}/abort`);
2915
+ return await c(this, a, u).call(this, "POST", `${O}/progress/${e}/abort`);
2916
2916
  }
2917
2917
  /**
2918
2918
  * Lists all executions for a given component.
@@ -2938,7 +2938,7 @@ return main;`)(...h), d = (y == null ? void 0 : y.componentDefinition) ?? y;
2938
2938
  }
2939
2939
  return await i.json();
2940
2940
  }
2941
- return await c(this, a, l).call(this, "GET", `${O}/${e}/progress`, { query: { ...t && { projectId: t } } });
2941
+ return await c(this, a, u).call(this, "GET", `${O}/${e}/progress`, { query: { ...t && { projectId: t } } });
2942
2942
  }
2943
2943
  /**
2944
2944
  * Gets details of a specific execution, including its messages.
@@ -2954,7 +2954,7 @@ return main;`)(...h), d = (y == null ? void 0 : y.componentDefinition) ?? y;
2954
2954
  }
2955
2955
  return await s.json();
2956
2956
  }
2957
- return await c(this, a, l).call(this, "GET", `${O}/progress/${e}`);
2957
+ return await c(this, a, u).call(this, "GET", `${O}/progress/${e}`);
2958
2958
  }
2959
2959
  /**
2960
2960
  * Subscribes to real-time execution progress via WebSocket.
@@ -2983,7 +2983,23 @@ return main;`)(...h), d = (y == null ? void 0 : y.componentDefinition) ?? y;
2983
2983
  */
2984
2984
  async createHiddenFile(e, t) {
2985
2985
  const s = new FormData();
2986
- return s.append("file", e), s.append("parentItemId", t), await c(this, a, l).call(this, "POST", `${p}/${R}`, {
2986
+ return s.append("file", e), s.append("parentItemId", t), await c(this, a, u).call(this, "POST", `${p}/${R}`, {
2987
+ body: s
2988
+ });
2989
+ }
2990
+ /**
2991
+ * Creates many hidden files attached to a parent item in a single request.
2992
+ * Use this instead of many `createHiddenFile` calls when uploading large sets
2993
+ * (e.g. 3D Tiles); upload in chunks of up to 100 files per call.
2994
+ * @param files - The files to upload.
2995
+ * @param parentFileId - The parent item's unique identifier.
2996
+ * @returns One result per uploaded file, in order, each with its hidden file ID.
2997
+ */
2998
+ async createHiddenFilesBatch(e, t) {
2999
+ const s = new FormData();
3000
+ for (const r of e)
3001
+ s.append("files", r);
3002
+ return s.append("parentItemId", t), await c(this, a, u).call(this, "POST", `${p}/${R}/batch`, {
2987
3003
  body: s
2988
3004
  });
2989
3005
  }
@@ -2992,14 +3008,14 @@ return main;`)(...h), d = (y == null ? void 0 : y.componentDefinition) ?? y;
2992
3008
  * @param hiddenId - The hidden file's unique identifier.
2993
3009
  */
2994
3010
  async deleteHiddenFile(e) {
2995
- return await c(this, a, l).call(this, "DELETE", `${p}/${R}/${e}`);
3011
+ return await c(this, a, u).call(this, "DELETE", `${p}/${R}/${e}`);
2996
3012
  }
2997
3013
  /**
2998
3014
  * Gets metadata for a hidden file.
2999
3015
  * @param hiddenId - The hidden file's unique identifier.
3000
3016
  */
3001
3017
  async getHiddenFile(e) {
3002
- return await c(this, a, l).call(this, "GET", `${p}/${R}/${e}`);
3018
+ return await c(this, a, u).call(this, "GET", `${p}/${R}/${e}`);
3003
3019
  }
3004
3020
  /**
3005
3021
  * Downloads a hidden file's content. Returns the raw fetch Response.
@@ -3014,14 +3030,14 @@ return main;`)(...h), d = (y == null ? void 0 : y.componentDefinition) ?? y;
3014
3030
  * @returns Array of hidden file entities.
3015
3031
  */
3016
3032
  async getHiddenFilesByParent(e) {
3017
- return await c(this, a, l).call(this, "GET", `${p}/${e}/${R}`);
3033
+ return await c(this, a, u).call(this, "GET", `${p}/${e}/${R}`);
3018
3034
  }
3019
3035
  /**
3020
3036
  * Deletes all hidden files attached to a parent item.
3021
3037
  * @param parentFileId - The parent item's unique identifier.
3022
3038
  */
3023
3039
  async deleteHiddenFilesByParent(e) {
3024
- return await c(this, a, l).call(this, "DELETE", `${p}/${e}/${R}`);
3040
+ return await c(this, a, u).call(this, "DELETE", `${p}/${e}/${R}`);
3025
3041
  }
3026
3042
  // ─── Icons ───────────────────────────────────────────────────────
3027
3043
  /**
@@ -3033,7 +3049,7 @@ return main;`)(...h), d = (y == null ? void 0 : y.componentDefinition) ?? y;
3033
3049
  */
3034
3050
  async uploadItemIcon(e, t) {
3035
3051
  const s = new FormData();
3036
- return s.append("icon", t), await c(this, a, l).call(this, "PUT", `${p}/${e}/icon`, { body: s });
3052
+ return s.append("icon", t), await c(this, a, u).call(this, "PUT", `${p}/${e}/icon`, { body: s });
3037
3053
  }
3038
3054
  /**
3039
3055
  * Downloads the icon for an item as a binary stream.
@@ -3049,7 +3065,7 @@ return main;`)(...h), d = (y == null ? void 0 : y.componentDefinition) ?? y;
3049
3065
  * @returns The updated item with icon fields removed.
3050
3066
  */
3051
3067
  async removeItemIcon(e) {
3052
- return await c(this, a, l).call(this, "DELETE", `${p}/${e}/icon`);
3068
+ return await c(this, a, u).call(this, "DELETE", `${p}/${e}/icon`);
3053
3069
  }
3054
3070
  // ─── General Item Operations ─────────────────────────────────────
3055
3071
  /**
@@ -3059,7 +3075,7 @@ return main;`)(...h), d = (y == null ? void 0 : y.componentDefinition) ?? y;
3059
3075
  * @returns The updated item.
3060
3076
  */
3061
3077
  async updateItem(e, t) {
3062
- return await c(this, a, l).call(this, "PUT", `${p}/${e}`, {
3078
+ return await c(this, a, u).call(this, "PUT", `${p}/${e}`, {
3063
3079
  body: JSON.stringify(t),
3064
3080
  contentType: "application/json"
3065
3081
  });
@@ -3076,7 +3092,7 @@ return main;`)(...h), d = (y == null ? void 0 : y.componentDefinition) ?? y;
3076
3092
  */
3077
3093
  async createVersion(e, t, s, r, i) {
3078
3094
  const o = new FormData();
3079
- return o.append("file", t), o.append("versionTag", s), r && o.append("extraProps", JSON.stringify(r)), i && o.append("metadata", JSON.stringify(i)), await c(this, a, l).call(this, "POST", `${p}/${e}/version`, { body: o });
3095
+ return o.append("file", t), o.append("versionTag", s), r && o.append("extraProps", JSON.stringify(r)), i && o.append("metadata", JSON.stringify(i)), await c(this, a, u).call(this, "POST", `${p}/${e}/version`, { body: o });
3080
3096
  }
3081
3097
  /**
3082
3098
  * Lists versions of an item. Pass `archived: true` to fetch only archived
@@ -3086,7 +3102,7 @@ return main;`)(...h), d = (y == null ? void 0 : y.componentDefinition) ?? y;
3086
3102
  * @returns Array of versions, sorted by creation date descending.
3087
3103
  */
3088
3104
  async listVersions(e, t = {}) {
3089
- return await c(this, a, l).call(this, "GET", `${p}/${encodeURIComponent(e)}/versions`, { query: t });
3105
+ return await c(this, a, u).call(this, "GET", `${p}/${encodeURIComponent(e)}/versions`, { query: t });
3090
3106
  }
3091
3107
  /**
3092
3108
  * Archives a version of an item. Archived versions remain available via
@@ -3098,7 +3114,7 @@ return main;`)(...h), d = (y == null ? void 0 : y.componentDefinition) ?? y;
3098
3114
  * @returns The archived version.
3099
3115
  */
3100
3116
  async archiveVersion(e, t) {
3101
- return await c(this, a, l).call(this, "PUT", `${p}/${encodeURIComponent(e)}/version/${encodeURIComponent(t)}/archive`);
3117
+ return await c(this, a, u).call(this, "PUT", `${p}/${encodeURIComponent(e)}/version/${encodeURIComponent(t)}/archive`);
3102
3118
  }
3103
3119
  /**
3104
3120
  * Recovers a previously archived version, restoring it to the active list.
@@ -3107,7 +3123,7 @@ return main;`)(...h), d = (y == null ? void 0 : y.componentDefinition) ?? y;
3107
3123
  * @returns The recovered version.
3108
3124
  */
3109
3125
  async recoverVersion(e, t) {
3110
- return await c(this, a, l).call(this, "PUT", `${p}/${encodeURIComponent(e)}/version/${encodeURIComponent(t)}/recover`);
3126
+ return await c(this, a, u).call(this, "PUT", `${p}/${encodeURIComponent(e)}/version/${encodeURIComponent(t)}/recover`);
3111
3127
  }
3112
3128
  /**
3113
3129
  * Permanently deletes a version, including its file in object storage.
@@ -3116,19 +3132,19 @@ return main;`)(...h), d = (y == null ? void 0 : y.componentDefinition) ?? y;
3116
3132
  * @param versionTag - The version's tag (e.g. "v2").
3117
3133
  */
3118
3134
  async deleteVersion(e, t) {
3119
- return await c(this, a, l).call(this, "DELETE", `${p}/${encodeURIComponent(e)}/version/${encodeURIComponent(t)}`);
3135
+ return await c(this, a, u).call(this, "DELETE", `${p}/${encodeURIComponent(e)}/version/${encodeURIComponent(t)}`);
3120
3136
  }
3121
3137
  };
3122
3138
  a = new WeakSet(), ae = function(e) {
3123
3139
  return `${this.apiUrl}/${e}`;
3124
- }, l = async function(e, t, s) {
3125
- const { body: r, query: i, contentType: o, retries: h } = s || {}, u = c(this, a, ae).call(this, t), y = c(this, a, Ue).call(this, i), d = await this.resolveAccessToken(), m = {
3140
+ }, u = async function(e, t, s) {
3141
+ const { body: r, query: i, contentType: o, retries: h } = s || {}, l = c(this, a, ae).call(this, t), y = c(this, a, Ue).call(this, i), d = await this.resolveAccessToken(), m = {
3126
3142
  ...y,
3127
3143
  ...this.useBearer ? {} : { accessToken: d }
3128
3144
  };
3129
3145
  try {
3130
3146
  const w = await fetch(
3131
- u + "?" + new URLSearchParams(m).toString(),
3147
+ l + "?" + new URLSearchParams(m).toString(),
3132
3148
  {
3133
3149
  method: e,
3134
3150
  headers: {
@@ -3152,7 +3168,7 @@ a = new WeakSet(), ae = function(e) {
3152
3168
  } catch (w) {
3153
3169
  let A = h ?? this.retries;
3154
3170
  if (A)
3155
- return A = A - 1, await c(this, a, l).call(this, e, t, {
3171
+ return A = A - 1, await c(this, a, u).call(this, e, t, {
3156
3172
  ...s,
3157
3173
  retries: A
3158
3174
  });
@@ -3181,16 +3197,16 @@ a = new WeakSet(), ae = function(e) {
3181
3197
  }
3182
3198
  });
3183
3199
  }, M = async function(e, t, s) {
3184
- const { name: r, versionTag: i, parentFolderId: o, projectId: h, file: u, metadata: y } = e, d = new FormData();
3185
- return d.append("file", u), d.append("name", r), d.append("versionTag", i), d.append("itemType", t), o && d.append("folderId", o), h && d.append("projectId", h), s && d.append("extraProps", JSON.stringify(s)), y && d.append("metadata", JSON.stringify(y)), await c(this, a, l).call(this, "POST", p, {
3200
+ const { name: r, versionTag: i, parentFolderId: o, projectId: h, file: l, metadata: y } = e, d = new FormData();
3201
+ return d.append("file", l), d.append("name", r), d.append("versionTag", i), d.append("itemType", t), o && d.append("folderId", o), h && d.append("projectId", h), s && d.append("extraProps", JSON.stringify(s)), y && d.append("metadata", JSON.stringify(y)), await c(this, a, u).call(this, "POST", p, {
3186
3202
  body: d
3187
3203
  });
3188
3204
  }, ce = async function(e, t, s) {
3189
- const { name: r, versionTag: i, parentFolderId: o, file: h, metadata: u } = t;
3205
+ const { name: r, versionTag: i, parentFolderId: o, file: h, metadata: l } = t;
3190
3206
  let y, d;
3191
3207
  if (h) {
3192
3208
  const m = new FormData();
3193
- m.append("file", h), i && m.append("versionTag", i), s && m.append("extraProps", JSON.stringify(s)), u && m.append("metadata", JSON.stringify(u)), d = await c(this, a, l).call(this, "POST", `${p}/${e}/version`, {
3209
+ m.append("file", h), i && m.append("versionTag", i), s && m.append("extraProps", JSON.stringify(s)), l && m.append("metadata", JSON.stringify(l)), d = await c(this, a, u).call(this, "POST", `${p}/${e}/version`, {
3194
3210
  body: m
3195
3211
  });
3196
3212
  }
@@ -3199,7 +3215,7 @@ a = new WeakSet(), ae = function(e) {
3199
3215
  ...r && { name: r },
3200
3216
  ...o && { folderId: o }
3201
3217
  }, w = JSON.stringify(m);
3202
- y = await c(this, a, l).call(this, "PUT", `${p}/${e}`, {
3218
+ y = await c(this, a, u).call(this, "PUT", `${p}/${e}`, {
3203
3219
  body: w,
3204
3220
  contentType: "application/json"
3205
3221
  });
@@ -3207,7 +3223,7 @@ a = new WeakSet(), ae = function(e) {
3207
3223
  return { item: y, version: d };
3208
3224
  }, he = async function(e, t) {
3209
3225
  const { showVersions: s = !1 } = t || {};
3210
- return await c(this, a, l).call(this, "GET", `${p}/${e}`, {
3226
+ return await c(this, a, u).call(this, "GET", `${p}/${e}`, {
3211
3227
  query: { showVersions: s }
3212
3228
  });
3213
3229
  }, Ue = function(e) {
@@ -10,6 +10,12 @@ export type HiddenFileEntity = {
10
10
  export type CreateHiddenItemResult = {
11
11
  hiddenFileId: string;
12
12
  };
13
+ export type CreateHiddenItemsBatchResult = {
14
+ results: {
15
+ originalName: string;
16
+ hiddenFileId: string;
17
+ }[];
18
+ };
13
19
  export type MetadataValue = string | number | boolean | null;
14
20
  export type Metadata = Record<string, MetadataValue>;
15
21
  export declare const METADATA_LIMITS: {
@@ -1 +1 @@
1
- /// <reference types="vite/client" />
1
+ /// <reference types="vite/client" />
@@ -1,8 +1,4 @@
1
1
  [
2
- {
3
- "path": "src/built-in/AppManager/example.ts",
4
- "description": ""
5
- },
6
2
  {
7
3
  "path": "src/built-in/CDEManager/example.ts",
8
4
  "description": "CDEManager — CDEManager is the central state machine for a Common Data Environment. It holds files, folders, metadata schemas, viewer groups, and user permissions, and exposes a typed state machine that all file operations — selecting, editing, uploading, viewing — route through. It has no DOM or Three.js dependencies and can run in Node, a browser, or a server-side worker wherever `@thatopen/components` is available."
@@ -48,7 +44,27 @@
48
44
  "description": ""
49
45
  },
50
46
  {
51
- "path": "src/built-in/ViewportsManager/example.ts",
52
- "description": ""
47
+ "path": "src/built-in/UIManager/src/app/example.ts",
48
+ "description": "top-app — Front-end developers building BIM web apps need to coordinate several async initialization steps before the UI can be shown — loading the engine, preparing fragment workers, registering loaders — and users need visible feedback on what is happening during that wait, rather than a blank screen."
49
+ },
50
+ {
51
+ "path": "src/built-in/UIManager/src/app/examples/AppState/example.ts",
52
+ "description": "Shared reactive state with AppState — Developers building interactive BIM panels often need sibling components — a filter selector and a results table, for example — to stay in sync without a shared parent. Lifting state to a common ancestor and threading it down as props works for shallow trees but becomes unwieldy as the component tree grows."
53
+ },
54
+ {
55
+ "path": "src/built-in/UIManager/src/app/examples/Contexts/example.ts",
56
+ "description": "Consuming platform contexts in child components — Developers building custom BIM panels need access to the 3D engine, the platform API, and the current project's metadata — but threading these objects down through props across multiple component layers forces every intermediate element to know about data it doesn't use, making trees brittle and hard to refactor."
57
+ },
58
+ {
59
+ "path": "src/built-in/UIManager/src/app/examples/FloatingLayout/example.ts",
60
+ "description": "Floating layout — Developers building BIM coordination tools often want the 3D model to fill the entire window while control panels float above it — but standard grid layouts give every area equal standing, shrinking the viewer into one cell and leaving visible seams between it and the panels."
61
+ },
62
+ {
63
+ "path": "src/built-in/UIManager/src/app/examples/Notifications/example.ts",
64
+ "description": "Toasts, file drop, and cross-component notifications — Developers building BIM processing UIs need to surface status updates, errors, and file-drop feedback to users from different points in the component tree — but reaching back to the app root to trigger a notification from a deeply nested component requires threading a reference through every layer in between."
65
+ },
66
+ {
67
+ "path": "src/built-in/UIManager/src/app/examples/Sidebar/example.ts",
68
+ "description": "Sidebar navigation — Product teams building BIM apps often need multiple distinct views — a 3D model viewer, a data browser, a settings screen — but wiring a custom nav bar and managing view transitions from scratch adds complexity before any real feature work begins."
53
69
  }
54
70
  ]