@lumerahq/ui 0.7.0 → 0.7.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.
- package/README.md +11 -0
- package/dist/{RecordSheet-CMsi-WRF.js → RecordSheet-DJL4aph1.js} +2 -2
- package/dist/{api-B2V4ej-2.js → api-BIZPZp2T.js} +1 -1
- package/dist/{automations-Cooyxu8b.js → automations-NGijzdAj.js} +214 -44
- package/dist/components/index.js +1 -1
- package/dist/hooks/index.js +2 -2
- package/dist/index.js +29 -28
- package/dist/lib/bridge.d.ts +14 -0
- package/dist/lib/bridge.d.ts.map +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +26 -25
- package/dist/{use-automation-run-BViXpbNQ.js → use-automation-run-CSxc9EhA.js} +1 -1
- package/dist/{use-sql-table-DTWXek_R.js → use-sql-table-CEBrg3zE.js} +2 -2
- package/package.json +1 -1
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 {
|
|
4
|
+
import { c as automationStatuses, q as getAutomationRunFileDownloadUrl, w as listAutomationRunFiles } from "./automations-NGijzdAj.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-
|
|
6
|
+
import { u as useAutomationRun } from "./use-automation-run-CSxc9EhA.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-
|
|
1
|
+
import { p as parentApiRequest, B as BridgeError } from "./automations-NGijzdAj.js";
|
|
2
2
|
const API_PREFIX = "/api";
|
|
3
3
|
const buildUrl = (path) => {
|
|
4
4
|
const normalized = path.startsWith("/") ? path : `/${path}`;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
const DEFAULT_TIMEOUT_MS = 15e3;
|
|
2
|
+
const parseParentOrigins = (value) => (value ?? "").split(",").map((item) => item.trim()).filter(Boolean);
|
|
2
3
|
const EXPECTED_PARENT_ORIGIN = "https://*.lumerahq.com";
|
|
4
|
+
const EXPECTED_PARENT_ORIGINS = [
|
|
5
|
+
...parseParentOrigins(void 0),
|
|
6
|
+
EXPECTED_PARENT_ORIGIN
|
|
7
|
+
].filter(Boolean);
|
|
3
8
|
class BridgeError extends Error {
|
|
4
9
|
status;
|
|
5
10
|
response;
|
|
@@ -13,10 +18,66 @@ class BridgeError extends Error {
|
|
|
13
18
|
const pendingRequests = /* @__PURE__ */ new Map();
|
|
14
19
|
const initListeners = /* @__PURE__ */ new Set();
|
|
15
20
|
let listenerAttached = false;
|
|
21
|
+
let routeSyncAttached = false;
|
|
16
22
|
let storedHostPayload;
|
|
23
|
+
let storedHostOrigin;
|
|
24
|
+
let suppressRouteBroadcast = false;
|
|
25
|
+
let lastBroadcastRoute = "";
|
|
17
26
|
function getAppProjectExternalId() {
|
|
18
27
|
return storedHostPayload?.app?.projectExternalId;
|
|
19
28
|
}
|
|
29
|
+
const normalizeHash = (hash) => {
|
|
30
|
+
if (!hash) return "";
|
|
31
|
+
return hash.startsWith("#") ? hash : `#${hash}`;
|
|
32
|
+
};
|
|
33
|
+
const stripBasePath = (basePathname, pathname) => {
|
|
34
|
+
const normalizedBase = basePathname === "/" ? "/" : basePathname.replace(/\/+$/, "");
|
|
35
|
+
const normalizedPath = pathname || "/";
|
|
36
|
+
if (normalizedBase === "/") {
|
|
37
|
+
return normalizedPath.replace(/^\/+/, "");
|
|
38
|
+
}
|
|
39
|
+
if (normalizedPath === normalizedBase || normalizedPath === `${normalizedBase}/`) {
|
|
40
|
+
return "";
|
|
41
|
+
}
|
|
42
|
+
const withSlash = `${normalizedBase}/`;
|
|
43
|
+
if (normalizedPath.startsWith(withSlash)) {
|
|
44
|
+
return normalizedPath.slice(withSlash.length);
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
};
|
|
48
|
+
const deriveHostRouteFromCurrentLocation = () => {
|
|
49
|
+
if (typeof window === "undefined") return void 0;
|
|
50
|
+
const appExternalId = storedHostPayload?.app?.externalId;
|
|
51
|
+
const iframeBaseUrl = storedHostPayload?.app?.iframeBaseUrl;
|
|
52
|
+
if (!appExternalId || !iframeBaseUrl) {
|
|
53
|
+
return void 0;
|
|
54
|
+
}
|
|
55
|
+
const baseUrl = new URL(iframeBaseUrl, storedHostOrigin ?? window.location.origin);
|
|
56
|
+
const strippedPath = stripBasePath(baseUrl.pathname || "/", window.location.pathname || "/");
|
|
57
|
+
if (strippedPath === null) {
|
|
58
|
+
return void 0;
|
|
59
|
+
}
|
|
60
|
+
const pathname = strippedPath ? `/app/${appExternalId}/${strippedPath.replace(/^\/+/, "")}` : `/app/${appExternalId}`;
|
|
61
|
+
return {
|
|
62
|
+
pathname,
|
|
63
|
+
search: window.location.search,
|
|
64
|
+
hash: normalizeHash(window.location.hash)
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
function getShareableAppUrl(options) {
|
|
68
|
+
const target = deriveHostRouteFromCurrentLocation();
|
|
69
|
+
if (!target) {
|
|
70
|
+
return void 0;
|
|
71
|
+
}
|
|
72
|
+
const route = `${target.pathname}${target.search ?? ""}${target.hash ?? ""}`;
|
|
73
|
+
if (options?.absolute === false) {
|
|
74
|
+
return route;
|
|
75
|
+
}
|
|
76
|
+
if (typeof window === "undefined") {
|
|
77
|
+
return route;
|
|
78
|
+
}
|
|
79
|
+
return new URL(route, storedHostOrigin ?? window.location.origin).toString();
|
|
80
|
+
}
|
|
20
81
|
const log = (...args) => {
|
|
21
82
|
};
|
|
22
83
|
const generateId = () => {
|
|
@@ -25,23 +86,28 @@ const generateId = () => {
|
|
|
25
86
|
}
|
|
26
87
|
return `${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
27
88
|
};
|
|
28
|
-
const
|
|
29
|
-
if (!origin || !
|
|
30
|
-
if (origin ===
|
|
31
|
-
if (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
89
|
+
const matchesOriginPattern = (origin, pattern) => {
|
|
90
|
+
if (!origin || !pattern) return false;
|
|
91
|
+
if (origin === pattern) return true;
|
|
92
|
+
if (!pattern.includes("*")) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
const originUrl = new URL(origin);
|
|
97
|
+
const hostnameSuffix = pattern.replace(/^https?:\/\//, "").replace(/^\*\./, "");
|
|
98
|
+
const expectedProtocol = pattern.startsWith("https") ? "https:" : "http:";
|
|
99
|
+
const hostMatches = originUrl.hostname === hostnameSuffix || originUrl.hostname.endsWith(`.${hostnameSuffix}`);
|
|
100
|
+
const protocolMatches = originUrl.protocol === expectedProtocol;
|
|
101
|
+
return hostMatches && protocolMatches;
|
|
102
|
+
} catch {
|
|
103
|
+
return false;
|
|
43
104
|
}
|
|
44
|
-
|
|
105
|
+
};
|
|
106
|
+
const isAllowedParentOrigin = (origin, currentOrigin) => {
|
|
107
|
+
if (!origin) return false;
|
|
108
|
+
if (origin === currentOrigin) return true;
|
|
109
|
+
if (origin.startsWith("http://localhost:")) return true;
|
|
110
|
+
return EXPECTED_PARENT_ORIGINS.some((pattern) => matchesOriginPattern(origin, pattern));
|
|
45
111
|
};
|
|
46
112
|
const PLAYGROUND_FLAG = "__playground__";
|
|
47
113
|
const isPlaygroundMode = () => typeof window !== "undefined" && window.self !== window.top && window.name.includes(PLAYGROUND_FLAG);
|
|
@@ -91,19 +157,107 @@ const playgroundApiRequest = async (request2) => {
|
|
|
91
157
|
};
|
|
92
158
|
}
|
|
93
159
|
};
|
|
160
|
+
const isStandaloneDevMode = () => false;
|
|
161
|
+
const getCurrentRouteSnapshot = () => ({
|
|
162
|
+
pathname: window.location.pathname,
|
|
163
|
+
search: window.location.search,
|
|
164
|
+
hash: window.location.hash
|
|
165
|
+
});
|
|
166
|
+
const routeSnapshotToString = (payload) => `${payload.pathname}${payload.search ?? ""}${payload.hash ?? ""}`;
|
|
167
|
+
const dispatchSyntheticRouteEvents = (previous, next) => {
|
|
168
|
+
const currentUrl = new URL(routeSnapshotToString(previous), window.location.origin).toString();
|
|
169
|
+
const nextUrl = new URL(routeSnapshotToString(next), window.location.origin).toString();
|
|
170
|
+
window.dispatchEvent(new PopStateEvent("popstate", { state: window.history.state }));
|
|
171
|
+
if (previous.hash !== next.hash) {
|
|
172
|
+
try {
|
|
173
|
+
window.dispatchEvent(
|
|
174
|
+
new HashChangeEvent("hashchange", {
|
|
175
|
+
oldURL: currentUrl,
|
|
176
|
+
newURL: nextUrl
|
|
177
|
+
})
|
|
178
|
+
);
|
|
179
|
+
} catch {
|
|
180
|
+
window.dispatchEvent(new Event("hashchange"));
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
const postRouteChange = (mode) => {
|
|
185
|
+
if (typeof window === "undefined" || !isEmbedded() || isStandaloneDevMode() || isPlaygroundMode() || suppressRouteBroadcast) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const payload = { ...getCurrentRouteSnapshot(), mode };
|
|
189
|
+
const route = routeSnapshotToString(payload);
|
|
190
|
+
if (route === lastBroadcastRoute) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
lastBroadcastRoute = route;
|
|
194
|
+
window.parent.postMessage({ type: "route-change", payload }, storedHostOrigin ?? "*");
|
|
195
|
+
};
|
|
196
|
+
const applyRouteSyncFromParent = (payload) => {
|
|
197
|
+
if (typeof window === "undefined" || !payload?.pathname) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
const nextRoute = routeSnapshotToString(payload);
|
|
201
|
+
const currentRoute = routeSnapshotToString(getCurrentRouteSnapshot());
|
|
202
|
+
if (!nextRoute || nextRoute === currentRoute) {
|
|
203
|
+
lastBroadcastRoute = currentRoute;
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
const previous = getCurrentRouteSnapshot();
|
|
207
|
+
suppressRouteBroadcast = true;
|
|
208
|
+
try {
|
|
209
|
+
window.history.replaceState(window.history.state, "", nextRoute);
|
|
210
|
+
dispatchSyntheticRouteEvents(previous, {
|
|
211
|
+
pathname: payload.pathname,
|
|
212
|
+
search: payload.search ?? "",
|
|
213
|
+
hash: payload.hash ?? ""
|
|
214
|
+
});
|
|
215
|
+
lastBroadcastRoute = nextRoute;
|
|
216
|
+
} finally {
|
|
217
|
+
setTimeout(() => {
|
|
218
|
+
suppressRouteBroadcast = false;
|
|
219
|
+
}, 0);
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
const ensureRouteSync = () => {
|
|
223
|
+
if (routeSyncAttached || typeof window === "undefined" || isStandaloneDevMode() || !isEmbedded() || isPlaygroundMode()) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
routeSyncAttached = true;
|
|
227
|
+
lastBroadcastRoute = routeSnapshotToString(getCurrentRouteSnapshot());
|
|
228
|
+
const { history } = window;
|
|
229
|
+
const originalPushState = history.pushState.bind(history);
|
|
230
|
+
const originalReplaceState = history.replaceState.bind(history);
|
|
231
|
+
history.pushState = function pushState(...args) {
|
|
232
|
+
originalPushState(...args);
|
|
233
|
+
postRouteChange("push");
|
|
234
|
+
};
|
|
235
|
+
history.replaceState = function replaceState(...args) {
|
|
236
|
+
originalReplaceState(...args);
|
|
237
|
+
postRouteChange("replace");
|
|
238
|
+
};
|
|
239
|
+
window.addEventListener("popstate", () => {
|
|
240
|
+
postRouteChange("replace");
|
|
241
|
+
});
|
|
242
|
+
window.addEventListener("hashchange", () => {
|
|
243
|
+
postRouteChange("replace");
|
|
244
|
+
});
|
|
245
|
+
};
|
|
94
246
|
const handleMessage = (event) => {
|
|
95
247
|
if (event.source !== window.parent) {
|
|
96
248
|
return;
|
|
97
249
|
}
|
|
98
|
-
if (!
|
|
250
|
+
if (!isAllowedParentOrigin(event.origin, window.location.origin)) {
|
|
99
251
|
log("Ignoring message from unexpected origin", {
|
|
100
|
-
expected:
|
|
101
|
-
received: event.origin
|
|
252
|
+
expected: EXPECTED_PARENT_ORIGINS,
|
|
253
|
+
received: event.origin,
|
|
254
|
+
current: window.location.origin
|
|
102
255
|
});
|
|
103
256
|
return;
|
|
104
257
|
}
|
|
105
258
|
const { type, payload } = event.data ?? {};
|
|
106
259
|
if (type === "init") {
|
|
260
|
+
storedHostOrigin = event.origin;
|
|
107
261
|
storedHostPayload = payload;
|
|
108
262
|
initListeners.forEach((listener) => listener(payload));
|
|
109
263
|
return;
|
|
@@ -116,12 +270,17 @@ const handleMessage = (event) => {
|
|
|
116
270
|
} else {
|
|
117
271
|
log("No pending request found for response id", response?.id);
|
|
118
272
|
}
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
if (type === "route-sync") {
|
|
276
|
+
applyRouteSyncFromParent(payload);
|
|
119
277
|
}
|
|
120
278
|
};
|
|
121
279
|
const ensureListener = () => {
|
|
122
280
|
if (listenerAttached || typeof window === "undefined") return;
|
|
123
281
|
listenerAttached = true;
|
|
124
282
|
window.addEventListener("message", handleMessage);
|
|
283
|
+
ensureRouteSync();
|
|
125
284
|
};
|
|
126
285
|
const isEmbedded = () => typeof window !== "undefined" && window.self !== window.top;
|
|
127
286
|
const postReadyMessage = () => {
|
|
@@ -145,7 +304,12 @@ const postReadyMessage = () => {
|
|
|
145
304
|
name: user.company_name,
|
|
146
305
|
apiName: user.company_api_name
|
|
147
306
|
},
|
|
148
|
-
user: {
|
|
307
|
+
user: {
|
|
308
|
+
id: user.id,
|
|
309
|
+
name: user.name,
|
|
310
|
+
email: user.email,
|
|
311
|
+
role: user.role
|
|
312
|
+
},
|
|
149
313
|
message: "Playground mode"
|
|
150
314
|
};
|
|
151
315
|
log("Playground mode: init from VB", payload);
|
|
@@ -164,6 +328,8 @@ const postReadyMessage = () => {
|
|
|
164
328
|
return;
|
|
165
329
|
}
|
|
166
330
|
window.parent.postMessage({ type: "ready" }, "*");
|
|
331
|
+
lastBroadcastRoute = "";
|
|
332
|
+
setTimeout(() => postRouteChange("replace"), 0);
|
|
167
333
|
};
|
|
168
334
|
const onInitMessage = (listener) => {
|
|
169
335
|
ensureListener();
|
|
@@ -199,7 +365,10 @@ const parentApiRequest = async (request2) => {
|
|
|
199
365
|
id,
|
|
200
366
|
method: request2.method,
|
|
201
367
|
url: request2.url,
|
|
202
|
-
headers: {
|
|
368
|
+
headers: {
|
|
369
|
+
"X-Lumera-Client": "lumera-custom-app",
|
|
370
|
+
...request2.headers
|
|
371
|
+
},
|
|
203
372
|
body: request2.body,
|
|
204
373
|
isBase64: request2.isBase64
|
|
205
374
|
}
|
|
@@ -437,33 +606,34 @@ async function listRunsByExternalId(params) {
|
|
|
437
606
|
});
|
|
438
607
|
}
|
|
439
608
|
export {
|
|
440
|
-
|
|
609
|
+
pollAutomationRun as A,
|
|
441
610
|
BridgeError as B,
|
|
611
|
+
pollRun as C,
|
|
442
612
|
EXPECTED_PARENT_ORIGIN as E,
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
613
|
+
getShareableAppUrl as a,
|
|
614
|
+
postReadyMessage as b,
|
|
615
|
+
automationStatuses as c,
|
|
616
|
+
cancelAutomationRun as d,
|
|
617
|
+
cancelRun as e,
|
|
618
|
+
clearAutomationCache as f,
|
|
449
619
|
getAppProjectExternalId as g,
|
|
450
|
-
|
|
620
|
+
createAutomationRun as h,
|
|
451
621
|
isEmbedded as i,
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
622
|
+
createRun as j,
|
|
623
|
+
ensureAutomationRun as k,
|
|
624
|
+
ensureRun as l,
|
|
625
|
+
getAutomationByExternalId as m,
|
|
626
|
+
getAutomationRun as n,
|
|
457
627
|
onInitMessage as o,
|
|
458
628
|
parentApiRequest as p,
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
629
|
+
getAutomationRunFileDownloadUrl as q,
|
|
630
|
+
getRun as r,
|
|
631
|
+
getRunFiles as s,
|
|
632
|
+
getRunFileUrl as t,
|
|
633
|
+
isActiveStatus as u,
|
|
634
|
+
isTerminalStatus as v,
|
|
635
|
+
listAutomationRunFiles as w,
|
|
636
|
+
listRuns as x,
|
|
637
|
+
listRunsByAgent as y,
|
|
638
|
+
listRunsByExternalId as z
|
|
469
639
|
};
|
package/dist/components/index.js
CHANGED
package/dist/hooks/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { u, a, b, c, d, e } from "../use-sql-table-
|
|
2
|
-
import { u as u2 } from "../use-automation-run-
|
|
1
|
+
import { u, a, b, c, d, e } from "../use-sql-table-CEBrg3zE.js";
|
|
2
|
+
import { u as u2 } from "../use-automation-run-CSxc9EhA.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-
|
|
2
|
-
import { u, a as a2, b as b2, c as c2, d, e } from "./use-sql-table-
|
|
3
|
-
import { u as u2 } from "./use-automation-run-
|
|
4
|
-
import { B, E,
|
|
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-
|
|
1
|
+
import { A, a, D, b, c, R } from "./RecordSheet-DJL4aph1.js";
|
|
2
|
+
import { u, a as a2, b as b2, c as c2, d, e } from "./use-sql-table-CEBrg3zE.js";
|
|
3
|
+
import { u as u2 } from "./use-automation-run-CSxc9EhA.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-NGijzdAj.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-BIZPZp2T.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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
c3 as automationStatuses,
|
|
18
|
+
d2 as cancelAutomationRun,
|
|
19
|
+
e2 as cancelRun,
|
|
20
|
+
f as clearAutomationCache,
|
|
21
21
|
o2 as cn,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
m as getAutomationByExternalId,
|
|
42
|
+
n as getAutomationRun,
|
|
43
|
+
q as getAutomationRunFileDownloadUrl,
|
|
44
44
|
g2 as getDownloadUrl,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
r as getRun,
|
|
46
|
+
t as getRunFileUrl,
|
|
47
|
+
s as getRunFiles,
|
|
48
|
+
a3 as getShareableAppUrl,
|
|
48
49
|
a4 as getUploadUrl,
|
|
49
|
-
|
|
50
|
+
u3 as isActiveStatus,
|
|
50
51
|
i as isEmbedded,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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,
|
package/dist/lib/bridge.d.ts
CHANGED
|
@@ -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
|
*
|
package/dist/lib/bridge.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../src/lib/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../src/l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AAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAWF;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;gBAEvB,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,cAAc;CAMxE;AAgBD;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,GAAG,SAAS,CAE5D;AAmDD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,GAAG,SAAS,CAgBvF;AAsaD;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,QAAO,OAAsE,CAAC;AAErG;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,QAAO,IAwEnC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,aAAa,GAAI,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAgB/F,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,gBAAgB,GAAU,SAAS,aAAa,KAAG,OAAO,CAAC,cAAc,CAgDrF,CAAC"}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -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';
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -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,EAClB,KAAK,cAAc,EAEnB,sBAAsB,EAEtB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],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,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,
|
|
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-
|
|
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-NGijzdAj.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-BIZPZp2T.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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
c as automationStatuses,
|
|
9
|
+
d as cancelAutomationRun,
|
|
10
|
+
e as cancelRun,
|
|
11
|
+
f as clearAutomationCache,
|
|
12
12
|
o2 as cn,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
m as getAutomationByExternalId,
|
|
33
|
+
n as getAutomationRun,
|
|
34
|
+
q as getAutomationRunFileDownloadUrl,
|
|
35
35
|
g2 as getDownloadUrl,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
r as getRun,
|
|
37
|
+
t as getRunFileUrl,
|
|
38
|
+
s as getRunFiles,
|
|
39
|
+
a as getShareableAppUrl,
|
|
39
40
|
a2 as getUploadUrl,
|
|
40
|
-
|
|
41
|
+
u as isActiveStatus,
|
|
41
42
|
i as isEmbedded,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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 {
|
|
3
|
+
import { k as ensureAutomationRun, h as createAutomationRun, d as cancelAutomationRun, c as automationStatuses, n as getAutomationRun } from "./automations-NGijzdAj.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 {
|
|
4
|
-
import { u as uploadFile, i as pbSql, k as pbUpdateRecord } from "./api-
|
|
3
|
+
import { y as listRunsByAgent, c as automationStatuses, h as createAutomationRun, o as onInitMessage } from "./automations-NGijzdAj.js";
|
|
4
|
+
import { u as uploadFile, i as pbSql, k as pbUpdateRecord } from "./api-BIZPZp2T.js";
|
|
5
5
|
function useAutomationAgent({
|
|
6
6
|
agentId,
|
|
7
7
|
limit = 5,
|