@lumerahq/ui 0.7.0 → 0.7.1
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/dist/{RecordSheet-CMsi-WRF.js → RecordSheet-Gz6YUndK.js} +2 -2
- package/dist/{api-B2V4ej-2.js → api-DUHGhS3m.js} +1 -1
- package/dist/{automations-Cooyxu8b.js → automations-C-qXt1dk.js} +30 -19
- package/dist/components/index.js +1 -1
- package/dist/hooks/index.js +2 -2
- package/dist/index.js +5 -5
- package/dist/lib/bridge.d.ts.map +1 -1
- package/dist/lib/index.js +2 -2
- package/dist/{use-automation-run-BViXpbNQ.js → use-automation-run-BJqfJATj.js} +1 -1
- package/dist/{use-sql-table-DTWXek_R.js → use-sql-table-9L14vGe4.js} +2 -2
- package/package.json +1 -1
|
@@ -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-
|
|
4
|
+
import { b as automationStatuses, n as getAutomationRunFileDownloadUrl, v as listAutomationRunFiles } from "./automations-C-qXt1dk.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-BJqfJATj.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-C-qXt1dk.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;
|
|
@@ -25,23 +30,28 @@ const generateId = () => {
|
|
|
25
30
|
}
|
|
26
31
|
return `${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
27
32
|
};
|
|
28
|
-
const
|
|
29
|
-
if (!origin || !
|
|
30
|
-
if (origin ===
|
|
31
|
-
if (
|
|
32
|
-
|
|
33
|
-
try {
|
|
34
|
-
const originUrl = new URL(origin);
|
|
35
|
-
const hostnameSuffix = EXPECTED_PARENT_ORIGIN.replace(/^https?:\/\//, "").replace(/^\*\./, "");
|
|
36
|
-
const expectedProtocol = EXPECTED_PARENT_ORIGIN.startsWith("https") ? "https:" : "http:";
|
|
37
|
-
const hostMatches = originUrl.hostname === hostnameSuffix || originUrl.hostname.endsWith(`.${hostnameSuffix}`);
|
|
38
|
-
const protocolMatches = originUrl.protocol === expectedProtocol;
|
|
39
|
-
return hostMatches && protocolMatches;
|
|
40
|
-
} catch {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
33
|
+
const matchesOriginPattern = (origin, pattern) => {
|
|
34
|
+
if (!origin || !pattern) return false;
|
|
35
|
+
if (origin === pattern) return true;
|
|
36
|
+
if (!pattern.includes("*")) {
|
|
37
|
+
return false;
|
|
43
38
|
}
|
|
44
|
-
|
|
39
|
+
try {
|
|
40
|
+
const originUrl = new URL(origin);
|
|
41
|
+
const hostnameSuffix = pattern.replace(/^https?:\/\//, "").replace(/^\*\./, "");
|
|
42
|
+
const expectedProtocol = pattern.startsWith("https") ? "https:" : "http:";
|
|
43
|
+
const hostMatches = originUrl.hostname === hostnameSuffix || originUrl.hostname.endsWith(`.${hostnameSuffix}`);
|
|
44
|
+
const protocolMatches = originUrl.protocol === expectedProtocol;
|
|
45
|
+
return hostMatches && protocolMatches;
|
|
46
|
+
} catch {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const isAllowedParentOrigin = (origin, currentOrigin) => {
|
|
51
|
+
if (!origin) return false;
|
|
52
|
+
if (origin === currentOrigin) return true;
|
|
53
|
+
if (origin.startsWith("http://localhost:")) return true;
|
|
54
|
+
return EXPECTED_PARENT_ORIGINS.some((pattern) => matchesOriginPattern(origin, pattern));
|
|
45
55
|
};
|
|
46
56
|
const PLAYGROUND_FLAG = "__playground__";
|
|
47
57
|
const isPlaygroundMode = () => typeof window !== "undefined" && window.self !== window.top && window.name.includes(PLAYGROUND_FLAG);
|
|
@@ -95,10 +105,11 @@ const handleMessage = (event) => {
|
|
|
95
105
|
if (event.source !== window.parent) {
|
|
96
106
|
return;
|
|
97
107
|
}
|
|
98
|
-
if (!
|
|
108
|
+
if (!isAllowedParentOrigin(event.origin, window.location.origin)) {
|
|
99
109
|
log("Ignoring message from unexpected origin", {
|
|
100
|
-
expected:
|
|
101
|
-
received: event.origin
|
|
110
|
+
expected: EXPECTED_PARENT_ORIGINS,
|
|
111
|
+
received: event.origin,
|
|
112
|
+
current: window.location.origin
|
|
102
113
|
});
|
|
103
114
|
return;
|
|
104
115
|
}
|
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-9L14vGe4.js";
|
|
2
|
+
import { u as u2 } from "../use-automation-run-BJqfJATj.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, 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-
|
|
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-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";
|
|
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 {
|
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/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;QACR,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,4BAA4B;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,iCAAiC;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,iDAAiD;IACjD,EAAE,EAAE,OAAO,CAAC;IACZ,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;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;AAYD;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,GAAG,SAAS,CAE5D;AAmSD;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,QAAO,OAAsE,CAAC;AAErG;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,QAAO,IAiEnC,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,CA6CrF,CAAC"}
|
package/dist/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
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, 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";
|
|
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 {
|
|
@@ -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-
|
|
3
|
+
import { j as ensureAutomationRun, f as createAutomationRun, c as cancelAutomationRun, b as automationStatuses, m as getAutomationRun } from "./automations-C-qXt1dk.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-
|
|
4
|
-
import { u as uploadFile, i as pbSql, k as pbUpdateRecord } from "./api-
|
|
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";
|
|
5
5
|
function useAutomationAgent({
|
|
6
6
|
agentId,
|
|
7
7
|
limit = 5,
|