@lumerahq/ui 0.7.1 → 0.7.4

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
@@ -40,6 +40,17 @@ const items = await pbList<User>('users', { filter: JSON.stringify({ status: "ac
40
40
  const user = await pbGet<User>('users', 'user-id');
41
41
  ```
42
42
 
43
+ ### Shareable App Links
44
+
45
+ ```tsx
46
+ import { getShareableAppUrl } from '@lumerahq/ui/lib';
47
+
48
+ const shareUrl = getShareableAppUrl();
49
+ // -> https://your-company.lumerahq.dev/app/my-app/orders/123
50
+ // HashRouter apps retain their hash route:
51
+ // -> https://your-company.lumerahq.dev/app/my-app#/orders/123
52
+ ```
53
+
43
54
  ### Automation Runner
44
55
 
45
56
  ```tsx
@@ -1,9 +1,9 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import React__default, { forwardRef, createElement, useState, useLayoutEffect, useCallback } from "react";
4
- import { b as automationStatuses, n as getAutomationRunFileDownloadUrl, v as listAutomationRunFiles } from "./automations-C-qXt1dk.js";
4
+ import { c as automationStatuses, q as getAutomationRunFileDownloadUrl, w as listAutomationRunFiles } from "./automations-BS2Ot6Vw.js";
5
5
  import { p as clsx, o as cn, a as formatCellValue } from "./formatters-Baj7FkeG.js";
6
- import { u as useAutomationRun } from "./use-automation-run-BJqfJATj.js";
6
+ import { u as useAutomationRun } from "./use-automation-run-AieycPD9.js";
7
7
  import * as ReactDOM from "react-dom";
8
8
  const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
9
9
  const toCamelCase = (string) => string.replace(
@@ -1,4 +1,4 @@
1
- import { p as parentApiRequest, B as BridgeError } from "./automations-C-qXt1dk.js";
1
+ import { p as parentApiRequest, B as BridgeError } from "./automations-BS2Ot6Vw.js";
2
2
  const API_PREFIX = "/api";
3
3
  const buildUrl = (path) => {
4
4
  const normalized = path.startsWith("/") ? path : `/${path}`;
@@ -1,10 +1,18 @@
1
1
  const DEFAULT_TIMEOUT_MS = 15e3;
2
2
  const parseParentOrigins = (value) => (value ?? "").split(",").map((item) => item.trim()).filter(Boolean);
3
+ const uniqueStrings = (values) => {
4
+ const seen = /* @__PURE__ */ new Set();
5
+ return values.filter((value) => {
6
+ if (!value || seen.has(value)) return false;
7
+ seen.add(value);
8
+ return true;
9
+ });
10
+ };
3
11
  const EXPECTED_PARENT_ORIGIN = "https://*.lumerahq.com";
4
- const EXPECTED_PARENT_ORIGINS = [
12
+ const EXPECTED_PARENT_ORIGINS = uniqueStrings([
5
13
  ...parseParentOrigins(void 0),
6
14
  EXPECTED_PARENT_ORIGIN
7
- ].filter(Boolean);
15
+ ]);
8
16
  class BridgeError extends Error {
9
17
  status;
10
18
  response;
@@ -18,12 +26,76 @@ class BridgeError extends Error {
18
26
  const pendingRequests = /* @__PURE__ */ new Map();
19
27
  const initListeners = /* @__PURE__ */ new Set();
20
28
  let listenerAttached = false;
29
+ let routeSyncAttached = false;
21
30
  let storedHostPayload;
31
+ let storedHostOrigin;
32
+ let suppressRouteBroadcast = false;
33
+ let lastBroadcastRoute = "";
34
+ let hasStoredHostPayload = false;
22
35
  function getAppProjectExternalId() {
23
36
  return storedHostPayload?.app?.projectExternalId;
24
37
  }
38
+ const normalizeHash = (hash) => {
39
+ if (!hash) return "";
40
+ return hash.startsWith("#") ? hash : `#${hash}`;
41
+ };
42
+ const stripBasePath = (basePathname, pathname) => {
43
+ const normalizedBase = basePathname === "/" ? "/" : basePathname.replace(/\/+$/, "");
44
+ const normalizedPath = pathname || "/";
45
+ if (normalizedBase === "/") {
46
+ return normalizedPath.replace(/^\/+/, "");
47
+ }
48
+ if (normalizedPath === normalizedBase || normalizedPath === `${normalizedBase}/`) {
49
+ return "";
50
+ }
51
+ const withSlash = `${normalizedBase}/`;
52
+ if (normalizedPath.startsWith(withSlash)) {
53
+ return normalizedPath.slice(withSlash.length);
54
+ }
55
+ return null;
56
+ };
57
+ const deriveHostRouteFromCurrentLocation = () => {
58
+ if (typeof window === "undefined") return void 0;
59
+ const appExternalId = storedHostPayload?.app?.externalId;
60
+ const iframeBaseUrl = storedHostPayload?.app?.iframeBaseUrl;
61
+ if (!appExternalId || !iframeBaseUrl) {
62
+ return void 0;
63
+ }
64
+ const baseUrl = new URL(iframeBaseUrl, storedHostOrigin ?? window.location.origin);
65
+ const strippedPath = stripBasePath(baseUrl.pathname || "/", window.location.pathname || "/");
66
+ if (strippedPath === null) {
67
+ return void 0;
68
+ }
69
+ const pathname = strippedPath ? `/app/${appExternalId}/${strippedPath.replace(/^\/+/, "")}` : `/app/${appExternalId}`;
70
+ return {
71
+ pathname,
72
+ search: window.location.search,
73
+ hash: normalizeHash(window.location.hash)
74
+ };
75
+ };
76
+ function getShareableAppUrl(options) {
77
+ const target = deriveHostRouteFromCurrentLocation();
78
+ if (!target) {
79
+ return void 0;
80
+ }
81
+ const route = `${target.pathname}${target.search ?? ""}${target.hash ?? ""}`;
82
+ if (options?.absolute === false) {
83
+ return route;
84
+ }
85
+ if (typeof window === "undefined") {
86
+ return route;
87
+ }
88
+ return new URL(route, storedHostOrigin ?? window.location.origin).toString();
89
+ }
25
90
  const log = (...args) => {
26
91
  };
92
+ const cacheHostPayload = (payload, options) => {
93
+ storedHostPayload = payload;
94
+ if (options?.origin) {
95
+ storedHostOrigin = options.origin;
96
+ }
97
+ hasStoredHostPayload = true;
98
+ };
27
99
  const generateId = () => {
28
100
  if (typeof crypto !== "undefined" && crypto.randomUUID) {
29
101
  return crypto.randomUUID();
@@ -101,10 +173,93 @@ const playgroundApiRequest = async (request2) => {
101
173
  };
102
174
  }
103
175
  };
104
- const handleMessage = (event) => {
105
- if (event.source !== window.parent) {
176
+ const isStandaloneDevMode = () => false;
177
+ const getCurrentRouteSnapshot = () => ({
178
+ pathname: window.location.pathname,
179
+ search: window.location.search,
180
+ hash: window.location.hash
181
+ });
182
+ const routeSnapshotToString = (payload) => `${payload.pathname}${payload.search ?? ""}${payload.hash ?? ""}`;
183
+ const dispatchSyntheticRouteEvents = (previous, next) => {
184
+ const currentUrl = new URL(routeSnapshotToString(previous), window.location.origin).toString();
185
+ const nextUrl = new URL(routeSnapshotToString(next), window.location.origin).toString();
186
+ window.dispatchEvent(new PopStateEvent("popstate", { state: window.history.state }));
187
+ if (previous.hash !== next.hash) {
188
+ try {
189
+ window.dispatchEvent(
190
+ new HashChangeEvent("hashchange", {
191
+ oldURL: currentUrl,
192
+ newURL: nextUrl
193
+ })
194
+ );
195
+ } catch {
196
+ window.dispatchEvent(new Event("hashchange"));
197
+ }
198
+ }
199
+ };
200
+ const postRouteChange = (mode) => {
201
+ if (typeof window === "undefined" || !isEmbedded() || isStandaloneDevMode() || isPlaygroundMode() || suppressRouteBroadcast) {
106
202
  return;
107
203
  }
204
+ const payload = { ...getCurrentRouteSnapshot(), mode };
205
+ const route = routeSnapshotToString(payload);
206
+ if (route === lastBroadcastRoute) {
207
+ return;
208
+ }
209
+ lastBroadcastRoute = route;
210
+ window.parent.postMessage({ type: "route-change", payload }, storedHostOrigin ?? "*");
211
+ };
212
+ const applyRouteSyncFromParent = (payload) => {
213
+ if (typeof window === "undefined" || !payload?.pathname) {
214
+ return;
215
+ }
216
+ const nextRoute = routeSnapshotToString(payload);
217
+ const currentRoute = routeSnapshotToString(getCurrentRouteSnapshot());
218
+ if (!nextRoute || nextRoute === currentRoute) {
219
+ lastBroadcastRoute = currentRoute;
220
+ return;
221
+ }
222
+ const previous = getCurrentRouteSnapshot();
223
+ suppressRouteBroadcast = true;
224
+ try {
225
+ window.history.replaceState(window.history.state, "", nextRoute);
226
+ dispatchSyntheticRouteEvents(previous, {
227
+ pathname: payload.pathname,
228
+ search: payload.search ?? "",
229
+ hash: payload.hash ?? ""
230
+ });
231
+ lastBroadcastRoute = nextRoute;
232
+ } finally {
233
+ setTimeout(() => {
234
+ suppressRouteBroadcast = false;
235
+ }, 0);
236
+ }
237
+ };
238
+ const ensureRouteSync = () => {
239
+ if (routeSyncAttached || typeof window === "undefined" || isStandaloneDevMode() || !isEmbedded() || isPlaygroundMode()) {
240
+ return;
241
+ }
242
+ routeSyncAttached = true;
243
+ lastBroadcastRoute = routeSnapshotToString(getCurrentRouteSnapshot());
244
+ const { history } = window;
245
+ const originalPushState = history.pushState.bind(history);
246
+ const originalReplaceState = history.replaceState.bind(history);
247
+ history.pushState = function pushState(...args) {
248
+ originalPushState(...args);
249
+ postRouteChange("push");
250
+ };
251
+ history.replaceState = function replaceState(...args) {
252
+ originalReplaceState(...args);
253
+ postRouteChange("replace");
254
+ };
255
+ window.addEventListener("popstate", () => {
256
+ postRouteChange("replace");
257
+ });
258
+ window.addEventListener("hashchange", () => {
259
+ postRouteChange("replace");
260
+ });
261
+ };
262
+ const handleMessage = (event) => {
108
263
  if (!isAllowedParentOrigin(event.origin, window.location.origin)) {
109
264
  log("Ignoring message from unexpected origin", {
110
265
  expected: EXPECTED_PARENT_ORIGINS,
@@ -113,9 +268,12 @@ const handleMessage = (event) => {
113
268
  });
114
269
  return;
115
270
  }
271
+ if (event.source && event.source !== window.parent) ;
116
272
  const { type, payload } = event.data ?? {};
117
273
  if (type === "init") {
118
- storedHostPayload = payload;
274
+ cacheHostPayload(payload, {
275
+ origin: event.origin
276
+ });
119
277
  initListeners.forEach((listener) => listener(payload));
120
278
  return;
121
279
  }
@@ -127,12 +285,17 @@ const handleMessage = (event) => {
127
285
  } else {
128
286
  log("No pending request found for response id", response?.id);
129
287
  }
288
+ return;
289
+ }
290
+ if (type === "route-sync") {
291
+ applyRouteSyncFromParent(payload);
130
292
  }
131
293
  };
132
294
  const ensureListener = () => {
133
295
  if (listenerAttached || typeof window === "undefined") return;
134
296
  listenerAttached = true;
135
297
  window.addEventListener("message", handleMessage);
298
+ ensureRouteSync();
136
299
  };
137
300
  const isEmbedded = () => typeof window !== "undefined" && window.self !== window.top;
138
301
  const postReadyMessage = () => {
@@ -156,30 +319,40 @@ const postReadyMessage = () => {
156
319
  name: user.company_name,
157
320
  apiName: user.company_api_name
158
321
  },
159
- user: { id: user.id, name: user.name, email: user.email, role: user.role },
322
+ user: {
323
+ id: user.id,
324
+ name: user.name,
325
+ email: user.email,
326
+ role: user.role
327
+ },
160
328
  message: "Playground mode"
161
329
  };
162
330
  log("Playground mode: init from VB", payload);
163
- storedHostPayload = payload;
331
+ cacheHostPayload(payload);
164
332
  setTimeout(() => initListeners.forEach((listener) => listener(payload)), 0);
165
333
  } else {
166
334
  log("Playground mode: /api/me returned no user, continuing");
335
+ cacheHostPayload(void 0);
167
336
  setTimeout(() => initListeners.forEach((listener) => listener(void 0)), 0);
168
337
  }
169
338
  } catch (err) {
339
+ cacheHostPayload(void 0);
170
340
  setTimeout(() => initListeners.forEach((listener) => listener(void 0)), 0);
171
341
  }
172
342
  } else {
343
+ cacheHostPayload(void 0);
173
344
  setTimeout(() => initListeners.forEach((listener) => listener(void 0)), 0);
174
345
  }
175
346
  return;
176
347
  }
177
348
  window.parent.postMessage({ type: "ready" }, "*");
349
+ lastBroadcastRoute = "";
350
+ setTimeout(() => postRouteChange("replace"), 0);
178
351
  };
179
352
  const onInitMessage = (listener) => {
180
353
  ensureListener();
181
354
  initListeners.add(listener);
182
- if (isPlaygroundMode() && storedHostPayload) {
355
+ if (hasStoredHostPayload) {
183
356
  setTimeout(() => listener(storedHostPayload), 0);
184
357
  }
185
358
  return () => initListeners.delete(listener);
@@ -210,7 +383,10 @@ const parentApiRequest = async (request2) => {
210
383
  id,
211
384
  method: request2.method,
212
385
  url: request2.url,
213
- headers: { "X-Lumera-Client": "lumera-custom-app", ...request2.headers },
386
+ headers: {
387
+ "X-Lumera-Client": "lumera-custom-app",
388
+ ...request2.headers
389
+ },
214
390
  body: request2.body,
215
391
  isBase64: request2.isBase64
216
392
  }
@@ -448,33 +624,34 @@ async function listRunsByExternalId(params) {
448
624
  });
449
625
  }
450
626
  export {
451
- pollRun as A,
627
+ pollAutomationRun as A,
452
628
  BridgeError as B,
629
+ pollRun as C,
453
630
  EXPECTED_PARENT_ORIGIN as E,
454
- postReadyMessage as a,
455
- automationStatuses as b,
456
- cancelAutomationRun as c,
457
- cancelRun as d,
458
- clearAutomationCache as e,
459
- createAutomationRun as f,
631
+ getShareableAppUrl as a,
632
+ postReadyMessage as b,
633
+ automationStatuses as c,
634
+ cancelAutomationRun as d,
635
+ cancelRun as e,
636
+ clearAutomationCache as f,
460
637
  getAppProjectExternalId as g,
461
- createRun as h,
638
+ createAutomationRun as h,
462
639
  isEmbedded as i,
463
- ensureAutomationRun as j,
464
- ensureRun as k,
465
- getAutomationByExternalId as l,
466
- getAutomationRun as m,
467
- getAutomationRunFileDownloadUrl as n,
640
+ createRun as j,
641
+ ensureAutomationRun as k,
642
+ ensureRun as l,
643
+ getAutomationByExternalId as m,
644
+ getAutomationRun as n,
468
645
  onInitMessage as o,
469
646
  parentApiRequest as p,
470
- getRun as q,
471
- getRunFiles as r,
472
- getRunFileUrl as s,
473
- isActiveStatus as t,
474
- isTerminalStatus as u,
475
- listAutomationRunFiles as v,
476
- listRuns as w,
477
- listRunsByAgent as x,
478
- listRunsByExternalId as y,
479
- pollAutomationRun as z
647
+ getAutomationRunFileDownloadUrl as q,
648
+ getRun as r,
649
+ getRunFiles as s,
650
+ getRunFileUrl as t,
651
+ isActiveStatus as u,
652
+ isTerminalStatus as v,
653
+ listAutomationRunFiles as w,
654
+ listRuns as x,
655
+ listRunsByAgent as y,
656
+ listRunsByExternalId as z
480
657
  };
@@ -1,4 +1,4 @@
1
- import { A, a, D, b, c, R } from "../RecordSheet-Gz6YUndK.js";
1
+ import { A, a, D, b, c, R } from "../RecordSheet-RdrsJW-k.js";
2
2
  export {
3
3
  A as AutomationRunList,
4
4
  a as AutomationRunner,
@@ -1,5 +1,5 @@
1
- import { u, a, b, c, d, e } from "../use-sql-table-9L14vGe4.js";
2
- import { u as u2 } from "../use-automation-run-BJqfJATj.js";
1
+ import { u, a, b, c, d, e } from "../use-sql-table-CQPrB7SP.js";
2
+ import { u as u2 } from "../use-automation-run-AieycPD9.js";
3
3
  export {
4
4
  u as useAutomationAgent,
5
5
  u2 as useAutomationRun,
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { A, a, D, b, c, R } from "./RecordSheet-Gz6YUndK.js";
2
- import { u, a as a2, b as b2, c as c2, d, e } from "./use-sql-table-9L14vGe4.js";
3
- import { u as u2 } from "./use-automation-run-BJqfJATj.js";
4
- import { B, E, b as b3, c as c3, d as d2, e as e2, f, h, j, k, g, l, m, n, q, s, r, t, i, u as u3, v, w, x, y, o, p, z, A as A2, a as a3 } from "./automations-C-qXt1dk.js";
5
- import { g as g2, a as a4, p as p2, b as b4, c as c4, d as d3, e as e3, f as f2, h as h2, i as i2, j as j2, k as k2, l as l2, s as s2, u as u4 } from "./api-DUHGhS3m.js";
1
+ import { A, a, D, b, c, R } from "./RecordSheet-RdrsJW-k.js";
2
+ import { u, a as a2, b as b2, c as c2, d, e } from "./use-sql-table-CQPrB7SP.js";
3
+ import { u as u2 } from "./use-automation-run-AieycPD9.js";
4
+ import { B, E, c as c3, d as d2, e as e2, f, h, j, k, l, g, m, n, q, r, t, s, a as a3, u as u3, i, v, w, x, y, z, o, p, A as A2, C, b as b3 } from "./automations-BS2Ot6Vw.js";
5
+ import { g as g2, a as a4, p as p2, b as b4, c as c4, d as d3, e as e3, f as f2, h as h2, i as i2, j as j2, k as k2, l as l2, s as s2, u as u4 } from "./api-IxGsOnrw.js";
6
6
  import { o as o2, f as f3, a as a5, b as b5, c as c5, d as d4, e as e4, g as g3, h as h3, i as i3, j as j3, k as k3, l as l3, m as m2, n as n2, s as s3 } from "./formatters-Baj7FkeG.js";
7
7
  import { q as q2 } from "./query-client-DdOWay4_.js";
8
8
  export {
@@ -14,15 +14,15 @@ export {
14
14
  c as DataTablePagination,
15
15
  E as EXPECTED_PARENT_ORIGIN,
16
16
  R as RecordSheet,
17
- b3 as automationStatuses,
18
- c3 as cancelAutomationRun,
19
- d2 as cancelRun,
20
- e2 as clearAutomationCache,
17
+ c3 as automationStatuses,
18
+ d2 as cancelAutomationRun,
19
+ e2 as cancelRun,
20
+ f as clearAutomationCache,
21
21
  o2 as cn,
22
- f as createAutomationRun,
23
- h as createRun,
24
- j as ensureAutomationRun,
25
- k as ensureRun,
22
+ h as createAutomationRun,
23
+ j as createRun,
24
+ k as ensureAutomationRun,
25
+ l as ensureRun,
26
26
  f3 as formatBoolean,
27
27
  a5 as formatCellValue,
28
28
  b5 as formatCurrency,
@@ -38,21 +38,22 @@ export {
38
38
  m2 as formatSelect,
39
39
  n2 as formatText,
40
40
  g as getAppProjectExternalId,
41
- l as getAutomationByExternalId,
42
- m as getAutomationRun,
43
- n as getAutomationRunFileDownloadUrl,
41
+ m as getAutomationByExternalId,
42
+ n as getAutomationRun,
43
+ q as getAutomationRunFileDownloadUrl,
44
44
  g2 as getDownloadUrl,
45
- q as getRun,
46
- s as getRunFileUrl,
47
- r as getRunFiles,
45
+ r as getRun,
46
+ t as getRunFileUrl,
47
+ s as getRunFiles,
48
+ a3 as getShareableAppUrl,
48
49
  a4 as getUploadUrl,
49
- t as isActiveStatus,
50
+ u3 as isActiveStatus,
50
51
  i as isEmbedded,
51
- u3 as isTerminalStatus,
52
- v as listAutomationRunFiles,
53
- w as listRuns,
54
- x as listRunsByAgent,
55
- y as listRunsByExternalId,
52
+ v as isTerminalStatus,
53
+ w as listAutomationRunFiles,
54
+ x as listRuns,
55
+ y as listRunsByAgent,
56
+ z as listRunsByExternalId,
56
57
  o as onInitMessage,
57
58
  p as parentApiRequest,
58
59
  p2 as pbBulkDelete,
@@ -66,9 +67,9 @@ export {
66
67
  j2 as pbUpdate,
67
68
  k2 as pbUpdateRecord,
68
69
  l2 as pbUpsert,
69
- z as pollAutomationRun,
70
- A2 as pollRun,
71
- a3 as postReadyMessage,
70
+ A2 as pollAutomationRun,
71
+ C as pollRun,
72
+ b3 as postReadyMessage,
72
73
  q2 as queryClient,
73
74
  s2 as sendEmail,
74
75
  s3 as stripHtml,
@@ -33,6 +33,8 @@ export type HostPayload = {
33
33
  app?: {
34
34
  externalId?: string;
35
35
  projectExternalId?: string;
36
+ /** Base iframe URL mounted by Lumera, used for share-link generation. */
37
+ iframeBaseUrl?: string;
36
38
  };
37
39
  message?: string;
38
40
  session?: {
@@ -84,6 +86,18 @@ export declare class BridgeError extends Error {
84
86
  * Returns the project external ID (package.json name) if available.
85
87
  */
86
88
  export declare function getAppProjectExternalId(): string | undefined;
89
+ /**
90
+ * Build a shareable Lumera host URL for the current embedded app route.
91
+ *
92
+ * For BrowserRouter apps this returns clean path-based URLs such as
93
+ * `/app/my-app/orders/123`. For HashRouter apps the hash segment is retained,
94
+ * e.g. `/app/my-app#/orders/123`.
95
+ *
96
+ * Returns `undefined` until the bridge init payload is received.
97
+ */
98
+ export declare function getShareableAppUrl(options?: {
99
+ absolute?: boolean;
100
+ }): string | undefined;
87
101
  /**
88
102
  * Check if the app is running embedded in an iframe.
89
103
  *
@@ -1 +1 @@
1
- {"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../src/lib/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAkBH;;;GAGG;AACH,eAAO,MAAM,sBAAsB,KAC+E,CAAC;AAWnH;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE;QACR,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,IAAI,CAAC,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,GAAG,CAAC,EAAE;QACJ,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE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rF,CAAC"}
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module @lumerahq/ui/lib
5
5
  */
6
- export { BridgeError, type BridgeRequest, type BridgeResponse, EXPECTED_PARENT_ORIGIN, getAppProjectExternalId, type HostPayload, isEmbedded, onInitMessage, parentApiRequest, postReadyMessage, } from './bridge';
6
+ export { BridgeError, type BridgeRequest, type BridgeResponse, EXPECTED_PARENT_ORIGIN, getAppProjectExternalId, getShareableAppUrl, type HostPayload, isEmbedded, onInitMessage, parentApiRequest, postReadyMessage, } from './bridge';
7
7
  export { type EmailSendRequest, type EmailSendResult, type FileDescriptor, getDownloadUrl, getUploadUrl, type PbBulkResult, type PbListOptions, type PbListResponse, type PbRecord, type PbSqlRequest, type PbSqlResponse, pbBulkDelete, pbBulkUpdate, pbCreate, pbDelete, pbGet, pbList, pbSearch, pbSql, pbUpdate, pbUpdateRecord, pbUpsert, sendEmail, type UploadOptions, type UploadUrlResponse, uploadFile, } from './api';
8
8
  export { type Automation, type AutomationRun, type AutomationRunFile, type AutomationStatus, automationStatuses, type CreateRunOptions, cancelAutomationRun, cancelRun, clearAutomationCache, createAutomationRun, createRun, ensureAutomationRun, ensureRun, getAutomationByExternalId, getAutomationRun, getAutomationRunFileDownloadUrl, getRun, getRunFiles, getRunFileUrl, isActiveStatus, isTerminalStatus, type LegacyCreateRunOptions, type ListRunsOptions, listAutomationRunFiles, listRuns, listRunsByAgent, listRunsByExternalId, type PollOptions, pollAutomationRun, pollRun, } from './automations';
9
9
  export { type ColumnType, type FileDescriptor as FormatterFileDescriptor, type FormatOptions, formatBoolean, formatCellValue, formatCurrency, formatDate, formatDateTime, formatEditor, formatFile, formatFileSize, formatJson, formatNumber, formatPercent, formatRelation, formatSelect, formatText, stripHtml, } from './formatters';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAEL,WAAW,EACX,KAAK,aAAa,EA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e,EACpB,sBAAsB,EACtB,QAAQ,EACR,eAAe,EACf,oBAAoB,EACpB,KAAK,WAAW,EAChB,iBAAiB,EACjB,OAAO,GACR,MAAM,eAAe,CAAC;AAMvB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,cAAc,IAAI,uBAAuB,EAC9C,KAAK,aAAa,EAClB,aAAa,EACb,eAAe,EACf,cAAc,EACd,UAAU,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,cAAc,EACd,UAAU,EACV,YAAY,EACZ,aAAa,EACb,cAAc,EACd,YAAY,EACZ,UAAU,EACV,SAAS,GACV,MAAM,cAAc,CAAC;AAMtB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAM7C,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC"}
package/dist/lib/index.js CHANGED
@@ -1,19 +1,19 @@
1
- import { B, E, b, c, d, e, f, h, j, k, g, l, m, n, q, s, r, t, i, u, v, w, x, y, o, p, z, A, a } from "../automations-C-qXt1dk.js";
2
- import { g as g2, a as a2, p as p2, b as b2, c as c2, d as d2, e as e2, f as f2, h as h2, i as i2, j as j2, k as k2, l as l2, s as s2, u as u2 } from "../api-DUHGhS3m.js";
1
+ import { B, E, c, d, e, f, h, j, k, l, g, m, n, q, r, t, s, a, u, i, v, w, x, y, z, o, p, A, C, b } from "../automations-BS2Ot6Vw.js";
2
+ import { g as g2, a as a2, p as p2, b as b2, c as c2, d as d2, e as e2, f as f2, h as h2, i as i2, j as j2, k as k2, l as l2, s as s2, u as u2 } from "../api-IxGsOnrw.js";
3
3
  import { o as o2, f as f3, a as a3, b as b3, c as c3, d as d3, e as e3, g as g3, h as h3, i as i3, j as j3, k as k3, l as l3, m as m2, n as n2, s as s3 } from "../formatters-Baj7FkeG.js";
4
4
  import { q as q2 } from "../query-client-DdOWay4_.js";
5
5
  export {
6
6
  B as BridgeError,
7
7
  E as EXPECTED_PARENT_ORIGIN,
8
- b as automationStatuses,
9
- c as cancelAutomationRun,
10
- d as cancelRun,
11
- e as clearAutomationCache,
8
+ c as automationStatuses,
9
+ d as cancelAutomationRun,
10
+ e as cancelRun,
11
+ f as clearAutomationCache,
12
12
  o2 as cn,
13
- f as createAutomationRun,
14
- h as createRun,
15
- j as ensureAutomationRun,
16
- k as ensureRun,
13
+ h as createAutomationRun,
14
+ j as createRun,
15
+ k as ensureAutomationRun,
16
+ l as ensureRun,
17
17
  f3 as formatBoolean,
18
18
  a3 as formatCellValue,
19
19
  b3 as formatCurrency,
@@ -29,21 +29,22 @@ export {
29
29
  m2 as formatSelect,
30
30
  n2 as formatText,
31
31
  g as getAppProjectExternalId,
32
- l as getAutomationByExternalId,
33
- m as getAutomationRun,
34
- n as getAutomationRunFileDownloadUrl,
32
+ m as getAutomationByExternalId,
33
+ n as getAutomationRun,
34
+ q as getAutomationRunFileDownloadUrl,
35
35
  g2 as getDownloadUrl,
36
- q as getRun,
37
- s as getRunFileUrl,
38
- r as getRunFiles,
36
+ r as getRun,
37
+ t as getRunFileUrl,
38
+ s as getRunFiles,
39
+ a as getShareableAppUrl,
39
40
  a2 as getUploadUrl,
40
- t as isActiveStatus,
41
+ u as isActiveStatus,
41
42
  i as isEmbedded,
42
- u as isTerminalStatus,
43
- v as listAutomationRunFiles,
44
- w as listRuns,
45
- x as listRunsByAgent,
46
- y as listRunsByExternalId,
43
+ v as isTerminalStatus,
44
+ w as listAutomationRunFiles,
45
+ x as listRuns,
46
+ y as listRunsByAgent,
47
+ z as listRunsByExternalId,
47
48
  o as onInitMessage,
48
49
  p as parentApiRequest,
49
50
  p2 as pbBulkDelete,
@@ -57,9 +58,9 @@ export {
57
58
  j2 as pbUpdate,
58
59
  k2 as pbUpdateRecord,
59
60
  l2 as pbUpsert,
60
- z as pollAutomationRun,
61
- A as pollRun,
62
- a as postReadyMessage,
61
+ A as pollAutomationRun,
62
+ C as pollRun,
63
+ b as postReadyMessage,
63
64
  q2 as queryClient,
64
65
  s2 as sendEmail,
65
66
  s3 as stripHtml,
@@ -1,6 +1,6 @@
1
1
  import { useQueryClient, useMutation, useQuery } from "@tanstack/react-query";
2
2
  import { useState, useRef, useEffect, useCallback } from "react";
3
- import { j as ensureAutomationRun, f as createAutomationRun, c as cancelAutomationRun, b as automationStatuses, m as getAutomationRun } from "./automations-C-qXt1dk.js";
3
+ import { k as ensureAutomationRun, h as createAutomationRun, d as cancelAutomationRun, c as automationStatuses, n as getAutomationRun } from "./automations-BS2Ot6Vw.js";
4
4
  function useAutomationRun(options) {
5
5
  const {
6
6
  agentId,
@@ -1,7 +1,7 @@
1
1
  import { useQueryClient, useQuery, useMutation } from "@tanstack/react-query";
2
2
  import { useState, useCallback, useEffect, useMemo } from "react";
3
- import { x as listRunsByAgent, b as automationStatuses, f as createAutomationRun, o as onInitMessage } from "./automations-C-qXt1dk.js";
4
- import { u as uploadFile, i as pbSql, k as pbUpdateRecord } from "./api-DUHGhS3m.js";
3
+ import { y as listRunsByAgent, c as automationStatuses, h as createAutomationRun, o as onInitMessage } from "./automations-BS2Ot6Vw.js";
4
+ import { u as uploadFile, i as pbSql, k as pbUpdateRecord } from "./api-IxGsOnrw.js";
5
5
  function useAutomationAgent({
6
6
  agentId,
7
7
  limit = 5,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumerahq/ui",
3
- "version": "0.7.1",
3
+ "version": "0.7.4",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "*.css"