@lumerahq/ui 0.7.4 → 0.7.6
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-RdrsJW-k.js → RecordSheet-BvHHP8P4.js} +2 -2
- package/dist/{api-IxGsOnrw.js → api-BrhR_Jjl.js} +1 -1
- package/dist/{automations-BS2Ot6Vw.js → automations-XN4WPV_g.js} +18 -9
- 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 +14 -4
- package/dist/lib/bridge.d.ts.map +1 -1
- package/dist/lib/index.js +2 -2
- package/dist/{use-automation-run-AieycPD9.js → use-automation-run-Cecvf4Aq.js} +1 -1
- package/dist/{use-sql-table-CQPrB7SP.js → use-sql-table-B7C06_An.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 { c as automationStatuses, q as getAutomationRunFileDownloadUrl, w as listAutomationRunFiles } from "./automations-
|
|
4
|
+
import { c as automationStatuses, q as getAutomationRunFileDownloadUrl, w as listAutomationRunFiles } from "./automations-XN4WPV_g.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-Cecvf4Aq.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-XN4WPV_g.js";
|
|
2
2
|
const API_PREFIX = "/api";
|
|
3
3
|
const buildUrl = (path) => {
|
|
4
4
|
const normalized = path.startsWith("/") ? path : `/${path}`;
|
|
@@ -8,8 +8,15 @@ const uniqueStrings = (values) => {
|
|
|
8
8
|
return true;
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
const
|
|
11
|
+
const DEFAULT_PARENT_ORIGINS = [
|
|
12
|
+
"https://*.lumerahq.com",
|
|
13
|
+
"https://*.lumerahq.dev",
|
|
14
|
+
"http://localhost:*",
|
|
15
|
+
"http://127.0.0.1:*"
|
|
16
|
+
];
|
|
17
|
+
const EXPECTED_PARENT_ORIGIN = DEFAULT_PARENT_ORIGINS[0];
|
|
12
18
|
const EXPECTED_PARENT_ORIGINS = uniqueStrings([
|
|
19
|
+
...DEFAULT_PARENT_ORIGINS,
|
|
13
20
|
...parseParentOrigins(void 0),
|
|
14
21
|
EXPECTED_PARENT_ORIGIN
|
|
15
22
|
]);
|
|
@@ -105,16 +112,19 @@ const generateId = () => {
|
|
|
105
112
|
const matchesOriginPattern = (origin, pattern) => {
|
|
106
113
|
if (!origin || !pattern) return false;
|
|
107
114
|
if (origin === pattern) return true;
|
|
108
|
-
if (!pattern.includes("*")) {
|
|
109
|
-
return false;
|
|
110
|
-
}
|
|
111
115
|
try {
|
|
112
116
|
const originUrl = new URL(origin);
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
117
|
+
const parsed = pattern.match(/^(https?):\/\/([^/:]+)(?::(\*|\d+))?$/);
|
|
118
|
+
if (!parsed) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
const [, expectedProtocolName, hostPattern, portPattern] = parsed;
|
|
122
|
+
const expectedProtocol = `${expectedProtocolName}:`;
|
|
116
123
|
const protocolMatches = originUrl.protocol === expectedProtocol;
|
|
117
|
-
|
|
124
|
+
const hostMatches = hostPattern.startsWith("*.") ? originUrl.hostname === hostPattern.slice(2) || originUrl.hostname.endsWith(`.${hostPattern.slice(2)}`) : originUrl.hostname === hostPattern;
|
|
125
|
+
const normalizedOriginPort = originUrl.port || (originUrl.protocol === "https:" ? "443" : originUrl.protocol === "http:" ? "80" : "");
|
|
126
|
+
const portMatches = !portPattern || portPattern === "*" || normalizedOriginPort === portPattern;
|
|
127
|
+
return protocolMatches && hostMatches && portMatches;
|
|
118
128
|
} catch {
|
|
119
129
|
return false;
|
|
120
130
|
}
|
|
@@ -122,7 +132,6 @@ const matchesOriginPattern = (origin, pattern) => {
|
|
|
122
132
|
const isAllowedParentOrigin = (origin, currentOrigin) => {
|
|
123
133
|
if (!origin) return false;
|
|
124
134
|
if (origin === currentOrigin) return true;
|
|
125
|
-
if (origin.startsWith("http://localhost:")) return true;
|
|
126
135
|
return EXPECTED_PARENT_ORIGINS.some((pattern) => matchesOriginPattern(origin, pattern));
|
|
127
136
|
};
|
|
128
137
|
const PLAYGROUND_FLAG = "__playground__";
|
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-B7C06_An.js";
|
|
2
|
+
import { u as u2 } from "../use-automation-run-Cecvf4Aq.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, 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-
|
|
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-BvHHP8P4.js";
|
|
2
|
+
import { u, a as a2, b as b2, c as c2, d, e } from "./use-sql-table-B7C06_An.js";
|
|
3
|
+
import { u as u2 } from "./use-automation-run-Cecvf4Aq.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-XN4WPV_g.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-BrhR_Jjl.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
CHANGED
|
@@ -7,12 +7,22 @@
|
|
|
7
7
|
* - API request proxying through the parent
|
|
8
8
|
* - Standalone dev mode for local development
|
|
9
9
|
*
|
|
10
|
+
* Future cleanup direction:
|
|
11
|
+
* - Prefer `VITE_PARENT_ORIGINS` over `VITE_PARENT_ORIGIN` for all new code.
|
|
12
|
+
* - Prefer the allowlist model (`EXPECTED_PARENT_ORIGINS`) over the singular
|
|
13
|
+
* compatibility export (`EXPECTED_PARENT_ORIGIN`).
|
|
14
|
+
* - Once all downstream apps/configs have migrated to the plural env var and no
|
|
15
|
+
* external consumers import `EXPECTED_PARENT_ORIGIN`, we can deprecate then
|
|
16
|
+
* remove:
|
|
17
|
+
* - `VITE_PARENT_ORIGIN`
|
|
18
|
+
* - `EXPECTED_PARENT_ORIGIN`
|
|
19
|
+
* - That removal should happen only in a deliberate breaking release after:
|
|
20
|
+
* 1. templates and docs use only `VITE_PARENT_ORIGINS`
|
|
21
|
+
* 2. published Lumera apps no longer depend on the singular export/env var
|
|
22
|
+
* 3. a major/minor migration note is shipped for external consumers
|
|
23
|
+
*
|
|
10
24
|
* @module bridge
|
|
11
25
|
*/
|
|
12
|
-
/**
|
|
13
|
-
* Expected parent origin for security validation.
|
|
14
|
-
* Supports wildcards like `https://*.lumerahq.com`
|
|
15
|
-
*/
|
|
16
26
|
export declare const EXPECTED_PARENT_ORIGIN: any;
|
|
17
27
|
/**
|
|
18
28
|
* Payload received from the parent during initialization.
|
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
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../src/lib/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AA0CH,eAAO,MAAM,sBAAsB,KAAkE,CAAC;AAYtG;;;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;QAC3B,yEAAyE;QACzE,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,OAAO,CAAC,EAAE,MAA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,eAAO,MAAM,UAAU,QAAO,OAAsE,CAAC;AAErG;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,QAAO,IA2EnC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,aAAa,GAAI,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAkB/F,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,gBAAgB,GAAU,SAAS,aAAa,KAAG,OAAO,CAAC,cAAc,CAgDrF,CAAC"}
|
package/dist/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
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-XN4WPV_g.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-BrhR_Jjl.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 { k as ensureAutomationRun, h as createAutomationRun, d as cancelAutomationRun, c as automationStatuses, n as getAutomationRun } from "./automations-
|
|
3
|
+
import { k as ensureAutomationRun, h as createAutomationRun, d as cancelAutomationRun, c as automationStatuses, n as getAutomationRun } from "./automations-XN4WPV_g.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 { y as listRunsByAgent, c as automationStatuses, h as createAutomationRun, o as onInitMessage } from "./automations-
|
|
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-XN4WPV_g.js";
|
|
4
|
+
import { u as uploadFile, i as pbSql, k as pbUpdateRecord } from "./api-BrhR_Jjl.js";
|
|
5
5
|
function useAutomationAgent({
|
|
6
6
|
agentId,
|
|
7
7
|
limit = 5,
|