@lumerahq/ui 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -1
- package/dist/{RecordSheet-DjPTM9r2.js → RecordSheet-DnEqk0gH.js} +4 -4
- package/dist/{api-Da1IIWDG.js → api-Bm4dzr1n.js} +1 -1
- package/dist/{automations-BEBG7FqJ.js → automations-DNWw-HT7.js} +287 -37
- package/dist/components/index.js +1 -1
- package/dist/{highlighted-body-OFNGDK62-B8uWyiQv.js → highlighted-body-OFNGDK62-ClX2-0Ut.js} +1 -1
- package/dist/hooks/index.js +2 -2
- package/dist/index.js +30 -29
- package/dist/lib/bridge.d.ts +37 -4
- 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 +27 -26
- package/dist/mermaid-GHXKKRXX-srRS7-dD.js +4 -0
- package/dist/{use-automation-run-rhYZZhj7.js → use-automation-run-D_1647k0.js} +1 -1
- package/dist/{use-sql-table-MilCekNQ.js → use-sql-table-8APCNryn.js} +2 -2
- package/package.json +13 -12
- package/dist/mermaid-GHXKKRXX-Cm-NNxwL.js +0 -4
package/README.md
CHANGED
|
@@ -42,13 +42,41 @@ const user = await pbGet<User>('users', 'user-id');
|
|
|
42
42
|
|
|
43
43
|
### Shareable App Links
|
|
44
44
|
|
|
45
|
+
**Always use `getShareableAppUrl()` for any URL a human will open** (copy-link buttons, invite/share flows, email bodies, QR codes). **Never use `window.location.href`** — the app runs inside an iframe loaded from the backend's internal `/_apps/{company}/{app}/` path, so `window.location` returns that iframe URL, not the Lumera shell URL in the user's browser tab. Sharing `window.location.href` produces broken links.
|
|
46
|
+
|
|
45
47
|
```tsx
|
|
46
|
-
import { getShareableAppUrl } from '@lumerahq/ui/lib';
|
|
48
|
+
import { buildShareableAppUrl, getShareableAppUrl } from '@lumerahq/ui/lib';
|
|
47
49
|
|
|
50
|
+
// ✅ Correct
|
|
48
51
|
const shareUrl = getShareableAppUrl();
|
|
49
52
|
// -> https://your-company.lumerahq.dev/app/my-app/orders/123
|
|
50
53
|
// HashRouter apps retain their hash route:
|
|
51
54
|
// -> https://your-company.lumerahq.dev/app/my-app#/orders/123
|
|
55
|
+
|
|
56
|
+
// ✅ Correct for a different in-app route, such as an email/invite link
|
|
57
|
+
const invoiceUrl = buildShareableAppUrl('/invoices/123');
|
|
58
|
+
// Default template apps use hash routing; pass this when generating target links
|
|
59
|
+
// from a page where the current hash route cannot be detected.
|
|
60
|
+
const hashInvoiceUrl = buildShareableAppUrl('/invoices/123', {
|
|
61
|
+
router: 'hash',
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// ❌ WRONG — leaks the internal iframe URL
|
|
65
|
+
navigator.clipboard.writeText(window.location.href);
|
|
66
|
+
// -> https://your-company.lumerahq.dev/_apps/your-company/my-app/#/orders/123
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Returns `undefined` until the bridge handshake completes; guard accordingly if you call it on first render.
|
|
70
|
+
|
|
71
|
+
### File URLs
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import { getDownloadUrl } from '@lumerahq/ui/lib';
|
|
75
|
+
|
|
76
|
+
const url = await getDownloadUrl(record.attachment.object_key);
|
|
77
|
+
// -> fresh presigned S3 URL suitable for links, new tabs, and iframe previews
|
|
78
|
+
// (PDFs / images render inline; Content-Type is inferred when the stored
|
|
79
|
+
// object metadata is missing or wrong).
|
|
52
80
|
```
|
|
53
81
|
|
|
54
82
|
### Automation Runner
|
|
@@ -4,8 +4,8 @@ import React__default, { forwardRef, createElement, memo, useId as useId$1, useT
|
|
|
4
4
|
import { t as twMerge, p as clsx, o as cn$2, a as formatCellValue } from "./formatters-D4T821Dv.js";
|
|
5
5
|
import * as ReactDOM from "react-dom";
|
|
6
6
|
import { createPortal } from "react-dom";
|
|
7
|
-
import { u as useAgentChat, a as useAutomationRun } from "./use-automation-run-
|
|
8
|
-
import { p as parentApiRequest,
|
|
7
|
+
import { u as useAgentChat, a as useAutomationRun } from "./use-automation-run-D_1647k0.js";
|
|
8
|
+
import { p as parentApiRequest, d as parentApiStream, B as BridgeError, f as automationStatuses, u as getAutomationRunFileDownloadUrl, A as listAutomationRunFiles } from "./automations-DNWw-HT7.js";
|
|
9
9
|
const toKebabCase = (string2) => string2.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
10
10
|
const toCamelCase = (string2) => string2.replace(
|
|
11
11
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
@@ -23866,7 +23866,7 @@ var lr = (e) => {
|
|
|
23866
23866
|
for (; t > 0 && e[t - 1] === `
|
|
23867
23867
|
`; ) t--;
|
|
23868
23868
|
return e.slice(0, t);
|
|
23869
|
-
}, cr = lazy(() => import("./highlighted-body-OFNGDK62-
|
|
23869
|
+
}, cr = lazy(() => import("./highlighted-body-OFNGDK62-ClX2-0Ut.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), st = ({ code: e, language: t, className: o, children: n, isIncomplete: r = false, startLine: s2, lineNumbers: a, ...l }) => {
|
|
23870
23870
|
let i = y2(), d2 = useMemo(() => lr(e), [e]), c2 = useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: d2.split(`
|
|
23871
23871
|
`).map((p2) => [{ content: p2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [d2]);
|
|
23872
23872
|
return jsx(nt.Provider, { value: { code: e }, children: jsxs(ot, { isIncomplete: r, language: t, children: [jsx(rt, { language: t }), n ? jsx("div", { className: i("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"), children: jsx("div", { className: i("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"), "data-streamdown": "code-block-actions", children: n }) }) : null, jsx(Suspense, { fallback: jsx(At, { className: o, language: t, lineNumbers: a, result: c2, startLine: s2, ...l }), children: jsx(cr, { className: o, code: d2, language: t, lineNumbers: a, raw: c2, startLine: s2, ...l }) })] }) });
|
|
@@ -24228,7 +24228,7 @@ var vo = ({ children: e, className: t, showControls: o, showCopy: n = true, show
|
|
|
24228
24228
|
let l = y2(), i = o && n, d2 = o && r, c2 = o && s2, p2 = i || d2 || c2;
|
|
24229
24229
|
return jsxs("div", { className: l("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"), "data-streamdown": "table-wrapper", children: [p2 ? jsxs("div", { className: l("flex items-center justify-end gap-1"), children: [i ? jsx(Te, {}) : null, d2 ? jsx(Pe, {}) : null, c2 ? jsx(Co, { showCopy: i, showDownload: d2, children: e }) : null] }) : null, jsx("div", { className: l("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"), children: jsx("table", { className: l("w-full divide-y divide-border", t), "data-streamdown": "table", ...a, children: e }) })] });
|
|
24230
24230
|
};
|
|
24231
|
-
var es = /startLine=(\d+)/, ts = /\bnoLineNumbers\b/, os = lazy(() => import("./mermaid-GHXKKRXX-
|
|
24231
|
+
var es = /startLine=(\d+)/, ts = /\bnoLineNumbers\b/, os = lazy(() => import("./mermaid-GHXKKRXX-srRS7-dD.js").then((e) => ({ default: e.Mermaid }))), ns = /language-([^\s]+)/;
|
|
24232
24232
|
function qe(e, t) {
|
|
24233
24233
|
if (!(e != null && e.position || t != null && t.position)) return true;
|
|
24234
24234
|
if (!(e != null && e.position && (t != null && t.position))) return false;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as parentApiRequest, B as BridgeError } from "./automations-
|
|
1
|
+
import { p as parentApiRequest, B as BridgeError } from "./automations-DNWw-HT7.js";
|
|
2
2
|
const API_PREFIX = "/api";
|
|
3
3
|
const buildUrl = (path) => {
|
|
4
4
|
const normalized = path.startsWith("/") ? path : `/${path}`;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
const __vite_import_meta_env__ = { "DEV": false };
|
|
1
2
|
const DEFAULT_TIMEOUT_MS = 15e3;
|
|
3
|
+
const viteEnv = __vite_import_meta_env__ ?? {};
|
|
4
|
+
const DEBUG = !!viteEnv.DEV;
|
|
2
5
|
const parseParentOrigins = (value) => (value ?? "").split(",").map((item) => item.trim()).filter(Boolean);
|
|
3
6
|
const uniqueStrings = (values) => {
|
|
4
7
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -14,10 +17,10 @@ const DEFAULT_PARENT_ORIGINS = [
|
|
|
14
17
|
"http://localhost:*",
|
|
15
18
|
"http://127.0.0.1:*"
|
|
16
19
|
];
|
|
17
|
-
const EXPECTED_PARENT_ORIGIN = DEFAULT_PARENT_ORIGINS[0];
|
|
20
|
+
const EXPECTED_PARENT_ORIGIN = viteEnv.VITE_PARENT_ORIGIN ?? DEFAULT_PARENT_ORIGINS[0];
|
|
18
21
|
const EXPECTED_PARENT_ORIGINS = uniqueStrings([
|
|
19
22
|
...DEFAULT_PARENT_ORIGINS,
|
|
20
|
-
...parseParentOrigins(
|
|
23
|
+
...parseParentOrigins(viteEnv.VITE_PARENT_ORIGINS),
|
|
21
24
|
EXPECTED_PARENT_ORIGIN
|
|
22
25
|
]);
|
|
23
26
|
const BRIDGE_WINDOW_NAME_PREFIX = "__lumera_bridge__=";
|
|
@@ -69,6 +72,7 @@ const pendingStreams = /* @__PURE__ */ new Map();
|
|
|
69
72
|
const initListeners = /* @__PURE__ */ new Set();
|
|
70
73
|
let listenerAttached = false;
|
|
71
74
|
let routeSyncAttached = false;
|
|
75
|
+
let devModeInitFired = false;
|
|
72
76
|
let storedHostPayload;
|
|
73
77
|
let storedHostOrigin;
|
|
74
78
|
let suppressRouteBroadcast = false;
|
|
@@ -81,9 +85,15 @@ const normalizeHash = (hash) => {
|
|
|
81
85
|
if (!hash) return "";
|
|
82
86
|
return hash.startsWith("#") ? hash : `#${hash}`;
|
|
83
87
|
};
|
|
88
|
+
const normalizeSearch = (search) => {
|
|
89
|
+
if (!search) return "";
|
|
90
|
+
const value = search instanceof URLSearchParams ? search.toString() : search;
|
|
91
|
+
if (!value) return "";
|
|
92
|
+
return value.startsWith("?") ? value : `?${value}`;
|
|
93
|
+
};
|
|
84
94
|
const stripBasePath = (basePathname, pathname) => {
|
|
85
95
|
const normalizedBase = basePathname === "/" ? "/" : basePathname.replace(/\/+$/, "");
|
|
86
|
-
const normalizedPath = pathname
|
|
96
|
+
const normalizedPath = pathname;
|
|
87
97
|
if (normalizedBase === "/") {
|
|
88
98
|
return normalizedPath.replace(/^\/+/, "");
|
|
89
99
|
}
|
|
@@ -115,21 +125,74 @@ const deriveHostRouteFromCurrentLocation = () => {
|
|
|
115
125
|
hash: normalizeHash(window.location.hash)
|
|
116
126
|
};
|
|
117
127
|
};
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return void 0;
|
|
128
|
+
const detectShareableRouterMode = (router) => {
|
|
129
|
+
if (router === "path" || router === "hash") {
|
|
130
|
+
return router;
|
|
122
131
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
return route;
|
|
132
|
+
if (typeof window !== "undefined" && /^#(?:\/|!)/.test(window.location.hash)) {
|
|
133
|
+
return "hash";
|
|
126
134
|
}
|
|
127
|
-
|
|
135
|
+
return "path";
|
|
136
|
+
};
|
|
137
|
+
const parseShareableTarget = (path, options) => {
|
|
138
|
+
let rawPath = path.trim();
|
|
139
|
+
if (rawPath.startsWith("#")) {
|
|
140
|
+
rawPath = rawPath.slice(1);
|
|
141
|
+
}
|
|
142
|
+
const parsed = new URL(rawPath || "/", "https://lumera.local");
|
|
143
|
+
return {
|
|
144
|
+
pathname: parsed.pathname || "/",
|
|
145
|
+
search: normalizeSearch(options?.search ?? parsed.search),
|
|
146
|
+
hash: normalizeHash(options?.hash ?? parsed.hash)
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
const encodeHashRouterNestedHash = (hash) => {
|
|
150
|
+
if (!hash) return "";
|
|
151
|
+
return `%23${hash.replace(/^#/, "")}`;
|
|
152
|
+
};
|
|
153
|
+
const serializeHostRoute = (target, absolute) => {
|
|
154
|
+
const route = `${target.pathname}${target.search ?? ""}${target.hash ?? ""}`;
|
|
155
|
+
if (absolute === false || typeof window === "undefined") {
|
|
128
156
|
return route;
|
|
129
157
|
}
|
|
130
158
|
return new URL(route, storedHostOrigin ?? window.location.origin).toString();
|
|
159
|
+
};
|
|
160
|
+
const deriveHostRouteForTarget = (path, options) => {
|
|
161
|
+
const appExternalId = storedHostPayload?.app?.externalId;
|
|
162
|
+
if (!appExternalId) {
|
|
163
|
+
return void 0;
|
|
164
|
+
}
|
|
165
|
+
const target = parseShareableTarget(path, options);
|
|
166
|
+
const mode = detectShareableRouterMode(options?.router);
|
|
167
|
+
if (mode === "hash") {
|
|
168
|
+
const hashPath = target.pathname.startsWith("/") ? target.pathname : `/${target.pathname}`;
|
|
169
|
+
return {
|
|
170
|
+
pathname: `/app/${appExternalId}`,
|
|
171
|
+
search: "",
|
|
172
|
+
hash: normalizeHash(`${hashPath}${target.search}${encodeHashRouterNestedHash(target.hash)}`)
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
const nestedPath = target.pathname.replace(/^\/+|\/+$/g, "");
|
|
176
|
+
return {
|
|
177
|
+
pathname: nestedPath ? `/app/${appExternalId}/${nestedPath}` : `/app/${appExternalId}`,
|
|
178
|
+
search: target.search,
|
|
179
|
+
hash: target.hash
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
function buildShareableAppUrl(path, options) {
|
|
183
|
+
return getShareableAppUrl({ ...options, path });
|
|
184
|
+
}
|
|
185
|
+
function getShareableAppUrl(options) {
|
|
186
|
+
const target = options?.path !== void 0 ? deriveHostRouteForTarget(options.path, options) : deriveHostRouteFromCurrentLocation();
|
|
187
|
+
if (!target) {
|
|
188
|
+
return void 0;
|
|
189
|
+
}
|
|
190
|
+
return serializeHostRoute(target, options?.absolute);
|
|
131
191
|
}
|
|
132
192
|
const log = (...args) => {
|
|
193
|
+
if (DEBUG) {
|
|
194
|
+
console.log("[Bridge]", ...args);
|
|
195
|
+
}
|
|
133
196
|
};
|
|
134
197
|
const cacheHostPayload = (payload, options) => {
|
|
135
198
|
storedHostPayload = payload;
|
|
@@ -161,6 +224,7 @@ const matchesOriginPattern = (origin, pattern) => {
|
|
|
161
224
|
const portMatches = !portPattern || portPattern === "*" || normalizedOriginPort === portPattern;
|
|
162
225
|
return protocolMatches && hostMatches && portMatches;
|
|
163
226
|
} catch {
|
|
227
|
+
log("Failed to parse origin for wildcard match", { origin, pattern });
|
|
164
228
|
return false;
|
|
165
229
|
}
|
|
166
230
|
};
|
|
@@ -225,7 +289,168 @@ const playgroundApiStream = (handlers) => {
|
|
|
225
289
|
}, 0);
|
|
226
290
|
return { id, close: () => void 0 };
|
|
227
291
|
};
|
|
228
|
-
const isStandaloneDevMode = () =>
|
|
292
|
+
const isStandaloneDevMode = () => !!viteEnv.DEV && !isEmbedded() && !!viteEnv.VITE_DEV_API_BASE_URL;
|
|
293
|
+
const decodeBase64ToBlob = (base64, contentType) => {
|
|
294
|
+
const binaryString = atob(base64);
|
|
295
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
296
|
+
for (let i = 0; i < binaryString.length; i++) {
|
|
297
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
298
|
+
}
|
|
299
|
+
return new Blob([bytes], { type: contentType });
|
|
300
|
+
};
|
|
301
|
+
const buildFetchBodyAndHeaders = (request2) => {
|
|
302
|
+
const headers = {
|
|
303
|
+
"Content-Type": "application/json",
|
|
304
|
+
...request2.headers
|
|
305
|
+
};
|
|
306
|
+
if (!request2.body || request2.method === "GET" || request2.method === "HEAD") {
|
|
307
|
+
return { headers };
|
|
308
|
+
}
|
|
309
|
+
if (request2.isBase64 && typeof request2.body === "string") {
|
|
310
|
+
const contentType = request2.headers?.["Content-Type"] || "application/octet-stream";
|
|
311
|
+
const blob = decodeBase64ToBlob(request2.body, contentType);
|
|
312
|
+
if (request2.fileName) {
|
|
313
|
+
const form = new FormData();
|
|
314
|
+
form.append(request2.formFieldName || "file", blob, request2.fileName);
|
|
315
|
+
delete headers["Content-Type"];
|
|
316
|
+
return { body: form, headers };
|
|
317
|
+
}
|
|
318
|
+
headers["Content-Type"] = contentType;
|
|
319
|
+
return { body: blob, headers };
|
|
320
|
+
}
|
|
321
|
+
return { body: JSON.stringify(request2.body), headers };
|
|
322
|
+
};
|
|
323
|
+
const directApiRequest = async (request2) => {
|
|
324
|
+
const baseUrl = viteEnv.VITE_DEV_API_BASE_URL;
|
|
325
|
+
const token = viteEnv.VITE_DEV_AUTH_TOKEN;
|
|
326
|
+
const project = viteEnv.VITE_LUMERA_PROJECT;
|
|
327
|
+
const url = `${baseUrl.replace(/\/$/, "")}${request2.url}`;
|
|
328
|
+
log("Standalone dev mode: direct fetch", { url, method: request2.method });
|
|
329
|
+
try {
|
|
330
|
+
const built = buildFetchBodyAndHeaders(request2);
|
|
331
|
+
const response = await fetch(url, {
|
|
332
|
+
method: request2.method,
|
|
333
|
+
headers: {
|
|
334
|
+
...built.headers,
|
|
335
|
+
"X-Lumera-Client": "lumera-custom-app",
|
|
336
|
+
...token ? { Authorization: `Bearer ${token}` } : {},
|
|
337
|
+
...project ? { "X-Lumera-Project": project } : {}
|
|
338
|
+
},
|
|
339
|
+
body: built.body
|
|
340
|
+
});
|
|
341
|
+
const text = await response.text();
|
|
342
|
+
let body = text;
|
|
343
|
+
try {
|
|
344
|
+
body = JSON.parse(text);
|
|
345
|
+
} catch {
|
|
346
|
+
}
|
|
347
|
+
return {
|
|
348
|
+
id: "direct",
|
|
349
|
+
ok: response.ok,
|
|
350
|
+
status: response.status,
|
|
351
|
+
body,
|
|
352
|
+
error: response.ok ? void 0 : text
|
|
353
|
+
};
|
|
354
|
+
} catch (err) {
|
|
355
|
+
return {
|
|
356
|
+
id: "direct",
|
|
357
|
+
ok: false,
|
|
358
|
+
status: 0,
|
|
359
|
+
error: err instanceof Error ? err.message : "Network error"
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
const responseHeadersToRecord = (headers) => {
|
|
364
|
+
const record = {};
|
|
365
|
+
headers.forEach((value, key) => {
|
|
366
|
+
record[key] = value;
|
|
367
|
+
});
|
|
368
|
+
return record;
|
|
369
|
+
};
|
|
370
|
+
const directApiStream = (request2, handlers) => {
|
|
371
|
+
const id = generateId();
|
|
372
|
+
const controller = new AbortController();
|
|
373
|
+
const baseUrl = viteEnv.VITE_DEV_API_BASE_URL;
|
|
374
|
+
const token = viteEnv.VITE_DEV_AUTH_TOKEN;
|
|
375
|
+
const project = viteEnv.VITE_LUMERA_PROJECT;
|
|
376
|
+
const url = `${baseUrl.replace(/\/$/, "")}${request2.url}`;
|
|
377
|
+
void (async () => {
|
|
378
|
+
try {
|
|
379
|
+
const response = await fetch(url, {
|
|
380
|
+
method: request2.method,
|
|
381
|
+
headers: {
|
|
382
|
+
"Content-Type": "application/json",
|
|
383
|
+
Accept: "text/event-stream",
|
|
384
|
+
"X-Lumera-Client": "lumera-custom-app",
|
|
385
|
+
...token ? { Authorization: `Bearer ${token}` } : {},
|
|
386
|
+
...project ? { "X-Lumera-Project": project } : {},
|
|
387
|
+
...request2.headers
|
|
388
|
+
},
|
|
389
|
+
body: request2.body ? JSON.stringify(request2.body) : void 0,
|
|
390
|
+
signal: controller.signal
|
|
391
|
+
});
|
|
392
|
+
if (!response.ok) {
|
|
393
|
+
if (response.status === 409) {
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
const message = await response.text().catch(() => `HTTP ${response.status}`);
|
|
397
|
+
handlers.onError?.(new BridgeError(message || `HTTP ${response.status}`, response.status));
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
handlers.onOpen?.({
|
|
401
|
+
id,
|
|
402
|
+
ok: response.ok,
|
|
403
|
+
status: response.status,
|
|
404
|
+
headers: responseHeadersToRecord(response.headers)
|
|
405
|
+
});
|
|
406
|
+
const reader = response.body?.getReader();
|
|
407
|
+
if (!reader) {
|
|
408
|
+
handlers.onError?.(new BridgeError("Streaming response had no body", response.status));
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
const decoder = new TextDecoder();
|
|
412
|
+
for (; ; ) {
|
|
413
|
+
const { done, value } = await reader.read();
|
|
414
|
+
if (done) break;
|
|
415
|
+
handlers.onChunk(decoder.decode(value, { stream: true }));
|
|
416
|
+
}
|
|
417
|
+
const trailing = decoder.decode();
|
|
418
|
+
if (trailing) handlers.onChunk(trailing);
|
|
419
|
+
} catch (err) {
|
|
420
|
+
if (err instanceof Error && err.name === "AbortError") return;
|
|
421
|
+
handlers.onError?.(new BridgeError(err instanceof Error ? err.message : "Network error"));
|
|
422
|
+
} finally {
|
|
423
|
+
handlers.onClose?.();
|
|
424
|
+
}
|
|
425
|
+
})();
|
|
426
|
+
return {
|
|
427
|
+
id,
|
|
428
|
+
close: () => controller.abort()
|
|
429
|
+
};
|
|
430
|
+
};
|
|
431
|
+
const fireDevModeInit = () => {
|
|
432
|
+
if (devModeInitFired || !isStandaloneDevMode()) return;
|
|
433
|
+
devModeInitFired = true;
|
|
434
|
+
const mockPayload = {
|
|
435
|
+
company: {
|
|
436
|
+
id: viteEnv.VITE_DEV_COMPANY_ID ?? "__dev_company__",
|
|
437
|
+
name: viteEnv.VITE_DEV_COMPANY_NAME ?? "Dev Company"
|
|
438
|
+
},
|
|
439
|
+
user: {
|
|
440
|
+
id: viteEnv.VITE_DEV_USER_ID ?? "__dev_user__",
|
|
441
|
+
name: viteEnv.VITE_DEV_USER_NAME ?? "Dev User",
|
|
442
|
+
email: viteEnv.VITE_DEV_USER_EMAIL ?? "dev@localhost"
|
|
443
|
+
},
|
|
444
|
+
session: {
|
|
445
|
+
token: viteEnv.VITE_DEV_AUTH_TOKEN
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
log("Standalone dev mode: firing mock init payload", mockPayload);
|
|
449
|
+
setTimeout(() => {
|
|
450
|
+
cacheHostPayload(mockPayload, { origin: window.location.origin });
|
|
451
|
+
initListeners.forEach((listener) => listener(mockPayload));
|
|
452
|
+
}, 0);
|
|
453
|
+
};
|
|
229
454
|
const getCurrentRouteSnapshot = () => ({
|
|
230
455
|
pathname: window.location.pathname,
|
|
231
456
|
search: window.location.search,
|
|
@@ -259,6 +484,7 @@ const postRouteChange = (mode) => {
|
|
|
259
484
|
return;
|
|
260
485
|
}
|
|
261
486
|
lastBroadcastRoute = route;
|
|
487
|
+
log("Posting route change to parent", payload);
|
|
262
488
|
window.parent.postMessage({ type: "route-change", payload }, storedHostOrigin ?? "*");
|
|
263
489
|
};
|
|
264
490
|
const applyRouteSyncFromParent = (payload) => {
|
|
@@ -355,9 +581,12 @@ const handleMessage = (event) => {
|
|
|
355
581
|
});
|
|
356
582
|
return;
|
|
357
583
|
}
|
|
358
|
-
if (event.source && event.source !== window.parent)
|
|
584
|
+
if (event.source && event.source !== window.parent) {
|
|
585
|
+
log("Accepting message from trusted origin despite non-identical parent source");
|
|
586
|
+
}
|
|
359
587
|
const { type, payload } = event.data ?? {};
|
|
360
588
|
if (type === "init") {
|
|
589
|
+
log("Received init payload from parent");
|
|
361
590
|
cacheHostPayload(payload, {
|
|
362
591
|
origin: event.origin
|
|
363
592
|
});
|
|
@@ -394,8 +623,14 @@ const configureBridge = (config) => {
|
|
|
394
623
|
const isEmbedded = () => typeof window !== "undefined" && window.self !== window.top;
|
|
395
624
|
const postReadyMessage = () => {
|
|
396
625
|
if (typeof window === "undefined") return;
|
|
626
|
+
if (isStandaloneDevMode()) {
|
|
627
|
+
log("Standalone dev mode: skipping postMessage, using direct API");
|
|
628
|
+
fireDevModeInit();
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
397
631
|
ensureListener();
|
|
398
632
|
if (isPlaygroundMode()) {
|
|
633
|
+
log("Playground mode: initializing via VirtualBackend");
|
|
399
634
|
window.parent.postMessage({ type: "ready" }, "*");
|
|
400
635
|
const vb = getPlaygroundVB();
|
|
401
636
|
if (vb) {
|
|
@@ -430,20 +665,28 @@ const postReadyMessage = () => {
|
|
|
430
665
|
setTimeout(() => initListeners.forEach((listener) => listener(void 0)), 0);
|
|
431
666
|
}
|
|
432
667
|
} catch (err) {
|
|
668
|
+
log("Playground mode: VB init failed, continuing without init", err);
|
|
433
669
|
cacheHostPayload(void 0);
|
|
434
670
|
setTimeout(() => initListeners.forEach((listener) => listener(void 0)), 0);
|
|
435
671
|
}
|
|
436
672
|
} else {
|
|
673
|
+
log("Playground mode: VB not available, continuing without init");
|
|
437
674
|
cacheHostPayload(void 0);
|
|
438
675
|
setTimeout(() => initListeners.forEach((listener) => listener(void 0)), 0);
|
|
439
676
|
}
|
|
440
677
|
return;
|
|
441
678
|
}
|
|
679
|
+
log("Posting ready message to parent");
|
|
442
680
|
window.parent.postMessage({ type: "ready" }, "*");
|
|
443
681
|
lastBroadcastRoute = "";
|
|
444
682
|
setTimeout(() => postRouteChange("replace"), 0);
|
|
445
683
|
};
|
|
446
684
|
const onInitMessage = (listener) => {
|
|
685
|
+
if (isStandaloneDevMode()) {
|
|
686
|
+
initListeners.add(listener);
|
|
687
|
+
fireDevModeInit();
|
|
688
|
+
return () => initListeners.delete(listener);
|
|
689
|
+
}
|
|
447
690
|
ensureListener();
|
|
448
691
|
initListeners.add(listener);
|
|
449
692
|
if (hasStoredHostPayload) {
|
|
@@ -452,6 +695,9 @@ const onInitMessage = (listener) => {
|
|
|
452
695
|
return () => initListeners.delete(listener);
|
|
453
696
|
};
|
|
454
697
|
const parentApiRequest = async (request2) => {
|
|
698
|
+
if (isStandaloneDevMode()) {
|
|
699
|
+
return directApiRequest(request2);
|
|
700
|
+
}
|
|
455
701
|
if (isPlaygroundMode()) {
|
|
456
702
|
return playgroundApiRequest(request2);
|
|
457
703
|
}
|
|
@@ -492,6 +738,9 @@ const parentApiRequest = async (request2) => {
|
|
|
492
738
|
});
|
|
493
739
|
};
|
|
494
740
|
const parentApiStream = (request2, handlers) => {
|
|
741
|
+
if (isStandaloneDevMode()) {
|
|
742
|
+
return directApiStream(request2, handlers);
|
|
743
|
+
}
|
|
495
744
|
if (isPlaygroundMode()) {
|
|
496
745
|
return playgroundApiStream(handlers);
|
|
497
746
|
}
|
|
@@ -764,37 +1013,38 @@ async function listRunsByExternalId(params) {
|
|
|
764
1013
|
});
|
|
765
1014
|
}
|
|
766
1015
|
export {
|
|
767
|
-
|
|
1016
|
+
listAutomationRunFiles as A,
|
|
768
1017
|
BridgeError as B,
|
|
769
|
-
|
|
770
|
-
|
|
1018
|
+
listRuns as C,
|
|
1019
|
+
listRunsByAgent as D,
|
|
771
1020
|
EXPECTED_PARENT_ORIGIN as E,
|
|
772
|
-
|
|
773
|
-
|
|
1021
|
+
listRunsByExternalId as F,
|
|
1022
|
+
pollAutomationRun as G,
|
|
1023
|
+
pollRun as H,
|
|
774
1024
|
getShareableAppUrl as a,
|
|
775
|
-
|
|
1025
|
+
buildShareableAppUrl as b,
|
|
776
1026
|
configureBridge as c,
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
1027
|
+
parentApiStream as d,
|
|
1028
|
+
postReadyMessage as e,
|
|
1029
|
+
automationStatuses as f,
|
|
780
1030
|
getAppProjectExternalId as g,
|
|
781
|
-
|
|
1031
|
+
cancelAutomationRun as h,
|
|
782
1032
|
isEmbedded as i,
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
1033
|
+
cancelRun as j,
|
|
1034
|
+
clearAutomationCache as k,
|
|
1035
|
+
createAutomationRun as l,
|
|
1036
|
+
createRun as m,
|
|
1037
|
+
ensureAutomationRun as n,
|
|
788
1038
|
onInitMessage as o,
|
|
789
1039
|
parentApiRequest as p,
|
|
790
|
-
|
|
791
|
-
|
|
1040
|
+
ensureRun as q,
|
|
1041
|
+
getAutomationByExternalId as r,
|
|
792
1042
|
serializeBridgeRuntimeConfig as s,
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
1043
|
+
getAutomationRun as t,
|
|
1044
|
+
getAutomationRunFileDownloadUrl as u,
|
|
1045
|
+
getRun as v,
|
|
1046
|
+
getRunFiles as w,
|
|
1047
|
+
getRunFileUrl as x,
|
|
1048
|
+
isActiveStatus as y,
|
|
1049
|
+
isTerminalStatus as z
|
|
800
1050
|
};
|
package/dist/components/index.js
CHANGED
package/dist/{highlighted-body-OFNGDK62-B8uWyiQv.js → highlighted-body-OFNGDK62-ClX2-0Ut.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as R$1, L as Li, g as At } from "./RecordSheet-
|
|
1
|
+
import { f as R$1, L as Li, g as At } from "./RecordSheet-DnEqk0gH.js";
|
|
2
2
|
import { useContext, useState, useEffect } from "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
var R = ({ code: s, language: e, raw: t, className: h, startLine: d, lineNumbers: m, ...p }) => {
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { u, a } from "../use-automation-run-
|
|
2
|
-
import { u as u2, a as a2, b, c, d, e, f } from "../use-sql-table-
|
|
1
|
+
import { u, a } from "../use-automation-run-D_1647k0.js";
|
|
2
|
+
import { u as u2, a as a2, b, c, d, e, f } from "../use-sql-table-8APCNryn.js";
|
|
3
3
|
export {
|
|
4
4
|
u as useAgentChat,
|
|
5
5
|
u2 as useAgentChatSessions,
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A, a, b, D, d, e, R, c } from "./RecordSheet-
|
|
2
|
-
import { u, a as a2 } from "./use-automation-run-
|
|
3
|
-
import { u as u2, a as a3, b as b2, c as c2, d as d2, e as e2, f } from "./use-sql-table-
|
|
4
|
-
import { B, E,
|
|
5
|
-
import { g as g2, a as a5, p as p2, b as b4, c as c4, d as d4, e as e4, f as f3, 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, b, D, d, e, R, c } from "./RecordSheet-DnEqk0gH.js";
|
|
2
|
+
import { u, a as a2 } from "./use-automation-run-D_1647k0.js";
|
|
3
|
+
import { u as u2, a as a3, b as b2, c as c2, d as d2, e as e2, f } from "./use-sql-table-8APCNryn.js";
|
|
4
|
+
import { B, E, f as f2, b as b3, h, j, k, c as c3, l, m, n, q, g, r, t, u as u3, v, x, w, a as a4, y, i, z, A as A2, C, D as D2, F, o, p, d as d3, G, H, e as e3, s } from "./automations-DNWw-HT7.js";
|
|
5
|
+
import { g as g2, a as a5, p as p2, b as b4, c as c4, d as d4, e as e4, f as f3, h as h2, i as i2, j as j2, k as k2, l as l2, s as s2, u as u4 } from "./api-Bm4dzr1n.js";
|
|
6
6
|
import { o as o2, f as f4, a as a6, b as b5, c as c5, d as d5, e as e5, 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-D4T821Dv.js";
|
|
7
7
|
import { q as q2 } from "./query-client-DdOWay4_.js";
|
|
8
8
|
export {
|
|
@@ -15,17 +15,18 @@ export {
|
|
|
15
15
|
e as DataTablePagination,
|
|
16
16
|
E as EXPECTED_PARENT_ORIGIN,
|
|
17
17
|
R as RecordSheet,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
h as
|
|
21
|
-
j as
|
|
18
|
+
f2 as automationStatuses,
|
|
19
|
+
b3 as buildShareableAppUrl,
|
|
20
|
+
h as cancelAutomationRun,
|
|
21
|
+
j as cancelRun,
|
|
22
|
+
k as clearAutomationCache,
|
|
22
23
|
o2 as cn,
|
|
23
24
|
c3 as configureBridge,
|
|
24
|
-
|
|
25
|
+
l as createAutomationRun,
|
|
25
26
|
c as createLumeraAgentChatTransport,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
m as createRun,
|
|
28
|
+
n as ensureAutomationRun,
|
|
29
|
+
q as ensureRun,
|
|
29
30
|
f4 as formatBoolean,
|
|
30
31
|
a6 as formatCellValue,
|
|
31
32
|
b5 as formatCurrency,
|
|
@@ -41,25 +42,25 @@ export {
|
|
|
41
42
|
m2 as formatSelect,
|
|
42
43
|
n2 as formatText,
|
|
43
44
|
g as getAppProjectExternalId,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
r as getAutomationByExternalId,
|
|
46
|
+
t as getAutomationRun,
|
|
47
|
+
u3 as getAutomationRunFileDownloadUrl,
|
|
47
48
|
g2 as getDownloadUrl,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
v as getRun,
|
|
50
|
+
x as getRunFileUrl,
|
|
51
|
+
w as getRunFiles,
|
|
51
52
|
a4 as getShareableAppUrl,
|
|
52
53
|
a5 as getUploadUrl,
|
|
53
|
-
|
|
54
|
+
y as isActiveStatus,
|
|
54
55
|
i as isEmbedded,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
z as isTerminalStatus,
|
|
57
|
+
A2 as listAutomationRunFiles,
|
|
58
|
+
C as listRuns,
|
|
59
|
+
D2 as listRunsByAgent,
|
|
60
|
+
F as listRunsByExternalId,
|
|
60
61
|
o as onInitMessage,
|
|
61
62
|
p as parentApiRequest,
|
|
62
|
-
|
|
63
|
+
d3 as parentApiStream,
|
|
63
64
|
p2 as pbBulkDelete,
|
|
64
65
|
b4 as pbBulkUpdate,
|
|
65
66
|
c4 as pbCreate,
|
|
@@ -71,9 +72,9 @@ export {
|
|
|
71
72
|
j2 as pbUpdate,
|
|
72
73
|
k2 as pbUpdateRecord,
|
|
73
74
|
l2 as pbUpsert,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
G as pollAutomationRun,
|
|
76
|
+
H as pollRun,
|
|
77
|
+
e3 as postReadyMessage,
|
|
77
78
|
q2 as queryClient,
|
|
78
79
|
s2 as sendEmail,
|
|
79
80
|
s as serializeBridgeRuntimeConfig,
|
package/dist/lib/bridge.d.ts
CHANGED
|
@@ -64,6 +64,22 @@ export type HostPayload = {
|
|
|
64
64
|
token?: string;
|
|
65
65
|
};
|
|
66
66
|
};
|
|
67
|
+
export type ShareableAppRouter = 'auto' | 'path' | 'hash';
|
|
68
|
+
export type ShareableAppUrlOptions = {
|
|
69
|
+
/** Return an absolute URL by default; pass false for a host-relative path. */
|
|
70
|
+
absolute?: boolean;
|
|
71
|
+
/** App route to share. Omit to share the current embedded route. */
|
|
72
|
+
path?: string;
|
|
73
|
+
/** Query string for `path`; accepts either `?a=b` or `a=b`. */
|
|
74
|
+
search?: string | URLSearchParams;
|
|
75
|
+
/** Fragment for `path`; accepts either `#section` or `section`. */
|
|
76
|
+
hash?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Router mode for explicit target paths. The default follows the current
|
|
79
|
+
* page when it can detect hash routing.
|
|
80
|
+
*/
|
|
81
|
+
router?: ShareableAppRouter;
|
|
82
|
+
};
|
|
67
83
|
/**
|
|
68
84
|
* Request payload sent to the parent for API calls.
|
|
69
85
|
*/
|
|
@@ -146,18 +162,35 @@ export declare class BridgeError extends Error {
|
|
|
146
162
|
* Returns the project external ID (package.json name) if available.
|
|
147
163
|
*/
|
|
148
164
|
export declare function getAppProjectExternalId(): string | undefined;
|
|
165
|
+
/**
|
|
166
|
+
* Build a shareable Lumera host URL for any route in the current embedded app.
|
|
167
|
+
*
|
|
168
|
+
* Use this for emails, invite links, row/action hyperlinks, QR codes, and
|
|
169
|
+
* anything else a human will open outside the iframe.
|
|
170
|
+
*
|
|
171
|
+
* This is the explicit-path convenience wrapper for
|
|
172
|
+
* `getShareableAppUrl({ ...options, path })`. In hash-router mode, nested
|
|
173
|
+
* path fragments are percent-encoded so the host URL contains only one `#`.
|
|
174
|
+
* Pass an empty string to link to the app root.
|
|
175
|
+
*/
|
|
176
|
+
export declare function buildShareableAppUrl(path: string, options?: ShareableAppUrlOptions): string | undefined;
|
|
149
177
|
/**
|
|
150
178
|
* Build a shareable Lumera host URL for the current embedded app route.
|
|
151
179
|
*
|
|
152
180
|
* For BrowserRouter apps this returns clean path-based URLs such as
|
|
153
181
|
* `/app/my-app/orders/123`. For HashRouter apps the hash segment is retained,
|
|
154
182
|
* e.g. `/app/my-app#/orders/123`.
|
|
183
|
+
* Passing `path` targets an explicit route; in hash-router mode, nested path
|
|
184
|
+
* fragments are percent-encoded so the host URL contains only one `#`.
|
|
185
|
+
* When `path` is omitted, `router` is ignored because the current iframe URL
|
|
186
|
+
* already encodes the active router mode.
|
|
155
187
|
*
|
|
156
|
-
* Returns `undefined` until the bridge init payload is received.
|
|
188
|
+
* Returns `undefined` until the bridge init payload is received. The
|
|
189
|
+
* current-route form also requires `app.iframeBaseUrl` in that payload so it
|
|
190
|
+
* can strip the iframe mount; explicit `path` links only require
|
|
191
|
+
* `app.externalId`.
|
|
157
192
|
*/
|
|
158
|
-
export declare function getShareableAppUrl(options?:
|
|
159
|
-
absolute?: boolean;
|
|
160
|
-
}): string | undefined;
|
|
193
|
+
export declare function getShareableAppUrl(options?: ShareableAppUrlOptions): string | undefined;
|
|
161
194
|
/**
|
|
162
195
|
* Extend bridge runtime config for the current page load.
|
|
163
196
|
*
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../src/lib/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AA2CH,eAAO,MAAM,sBAAsB,KAA0D,CAAC;AAQ9F,MAAM,MAAM,mBAAmB,GAAG;IAChC,sEAAsE;IACtE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AA2CF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,GAAI,QAAQ,mBAAmB,KAAG,MAI1E,CAAC;AAMF;;;GA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;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,gBAAgB,GAAU,SAAS,aAAa,KAAG,OAAO,CAAC,cAAc,CAkDrF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,aAAa,EAAE,UAAU,oBAAoB,KAAG,YAsDxF,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, type BridgeRuntimeConfig, type BridgeStream, type BridgeStreamHandlers, type BridgeStreamOpen, type BridgeStreamResponse, configureBridge, EXPECTED_PARENT_ORIGIN, getAppProjectExternalId, getShareableAppUrl, type HostPayload, isEmbedded, onInitMessage, parentApiRequest, parentApiStream, postReadyMessage, serializeBridgeRuntimeConfig, } from './bridge';
|
|
6
|
+
export { BridgeError, type BridgeRequest, type BridgeResponse, type BridgeRuntimeConfig, type BridgeStream, type BridgeStreamHandlers, type BridgeStreamOpen, type BridgeStreamResponse, buildShareableAppUrl, configureBridge, EXPECTED_PARENT_ORIGIN, getAppProjectExternalId, getShareableAppUrl, type HostPayload, isEmbedded, onInitMessage, parentApiRequest, parentApiStream, postReadyMessage, type ShareableAppRouter, type ShareableAppUrlOptions, serializeBridgeRuntimeConfig, } 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,EACnB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,
|
|
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,EACnB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,oBAAoB,EAEpB,eAAe,EAEf,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAElB,KAAK,WAAW,EAChB,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,4BAA4B,GAC7B,MAAM,UAAU,CAAC;AAMlB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK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/lib/index.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
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, f, b, h, j, k, c, l, m, n, q, g, r, t, u, v, x, w, a, y, i, z, A, C, D, F, o, p, d, G, H, e, s } from "../automations-DNWw-HT7.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-Bm4dzr1n.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-D4T821Dv.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
|
-
h as
|
|
11
|
-
j as
|
|
8
|
+
f as automationStatuses,
|
|
9
|
+
b as buildShareableAppUrl,
|
|
10
|
+
h as cancelAutomationRun,
|
|
11
|
+
j as cancelRun,
|
|
12
|
+
k as clearAutomationCache,
|
|
12
13
|
o2 as cn,
|
|
13
14
|
c as configureBridge,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
l as createAutomationRun,
|
|
16
|
+
m as createRun,
|
|
17
|
+
n as ensureAutomationRun,
|
|
18
|
+
q as ensureRun,
|
|
18
19
|
f3 as formatBoolean,
|
|
19
20
|
a3 as formatCellValue,
|
|
20
21
|
b3 as formatCurrency,
|
|
@@ -30,25 +31,25 @@ export {
|
|
|
30
31
|
m2 as formatSelect,
|
|
31
32
|
n2 as formatText,
|
|
32
33
|
g as getAppProjectExternalId,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
r as getAutomationByExternalId,
|
|
35
|
+
t as getAutomationRun,
|
|
36
|
+
u as getAutomationRunFileDownloadUrl,
|
|
36
37
|
g2 as getDownloadUrl,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
v as getRun,
|
|
39
|
+
x as getRunFileUrl,
|
|
40
|
+
w as getRunFiles,
|
|
40
41
|
a as getShareableAppUrl,
|
|
41
42
|
a2 as getUploadUrl,
|
|
42
|
-
|
|
43
|
+
y as isActiveStatus,
|
|
43
44
|
i as isEmbedded,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
z as isTerminalStatus,
|
|
46
|
+
A as listAutomationRunFiles,
|
|
47
|
+
C as listRuns,
|
|
48
|
+
D as listRunsByAgent,
|
|
49
|
+
F as listRunsByExternalId,
|
|
49
50
|
o as onInitMessage,
|
|
50
51
|
p as parentApiRequest,
|
|
51
|
-
|
|
52
|
+
d as parentApiStream,
|
|
52
53
|
p2 as pbBulkDelete,
|
|
53
54
|
b2 as pbBulkUpdate,
|
|
54
55
|
c2 as pbCreate,
|
|
@@ -60,9 +61,9 @@ export {
|
|
|
60
61
|
j2 as pbUpdate,
|
|
61
62
|
k2 as pbUpdateRecord,
|
|
62
63
|
l2 as pbUpsert,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
G as pollAutomationRun,
|
|
65
|
+
H as pollRun,
|
|
66
|
+
e as postReadyMessage,
|
|
66
67
|
q2 as queryClient,
|
|
67
68
|
s2 as sendEmail,
|
|
68
69
|
s as serializeBridgeRuntimeConfig,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState, useRef, useCallback, useEffect, useMemo } from "react";
|
|
2
2
|
import { useQueryClient, useMutation, useQuery } from "@tanstack/react-query";
|
|
3
|
-
import {
|
|
3
|
+
import { n as ensureAutomationRun, l as createAutomationRun, h as cancelAutomationRun, f as automationStatuses, t as getAutomationRun } from "./automations-DNWw-HT7.js";
|
|
4
4
|
const DEFAULT_SESSION_ID = "default";
|
|
5
5
|
const DEFAULT_HISTORY_LIMIT = 10;
|
|
6
6
|
const DEFAULT_MAX_BUFFERED_MESSAGES = 100;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState, useCallback, useEffect, useMemo } from "react";
|
|
2
2
|
import { useQueryClient, useQuery, useMutation } from "@tanstack/react-query";
|
|
3
|
-
import {
|
|
4
|
-
import { u as uploadFile, i as pbSql, k as pbUpdateRecord } from "./api-
|
|
3
|
+
import { D as listRunsByAgent, f as automationStatuses, l as createAutomationRun, o as onInitMessage } from "./automations-DNWw-HT7.js";
|
|
4
|
+
import { u as uploadFile, i as pbSql, k as pbUpdateRecord } from "./api-Bm4dzr1n.js";
|
|
5
5
|
function useAgentChatSessions({
|
|
6
6
|
agentId,
|
|
7
7
|
transport,
|
package/package.json
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumerahq/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css"
|
|
7
7
|
],
|
|
8
|
+
"scripts": {
|
|
9
|
+
"dev": "vite",
|
|
10
|
+
"build": "tsc -b && vite build",
|
|
11
|
+
"build:lib": "tsc -b && vite build --mode lib",
|
|
12
|
+
"format": "biome format --write .",
|
|
13
|
+
"lint": "biome lint --write .",
|
|
14
|
+
"check": "biome check --write .",
|
|
15
|
+
"check:ci": "biome check .",
|
|
16
|
+
"test": "tsc -p tsconfig.test.json && node --test dist-test/*.test.js",
|
|
17
|
+
"preview": "vite preview"
|
|
18
|
+
},
|
|
8
19
|
"main": "./dist/index.js",
|
|
9
20
|
"module": "./dist/index.js",
|
|
10
21
|
"types": "./dist/index.d.ts",
|
|
@@ -62,15 +73,5 @@
|
|
|
62
73
|
"typescript": "~5.9.3",
|
|
63
74
|
"vite": "^7.2.4",
|
|
64
75
|
"vite-plugin-dts": "^4.5.4"
|
|
65
|
-
},
|
|
66
|
-
"scripts": {
|
|
67
|
-
"dev": "vite",
|
|
68
|
-
"build": "tsc -b && vite build",
|
|
69
|
-
"build:lib": "tsc -b && vite build --mode lib",
|
|
70
|
-
"format": "biome format --write .",
|
|
71
|
-
"lint": "biome lint --write .",
|
|
72
|
-
"check": "biome check --write .",
|
|
73
|
-
"check:ci": "biome check .",
|
|
74
|
-
"preview": "vite preview"
|
|
75
76
|
}
|
|
76
|
-
}
|
|
77
|
+
}
|