@feltdb/core 0.9.0 → 0.10.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/dist/authority-scope.d.ts +2 -0
- package/dist/authority-scope.d.ts.map +1 -1
- package/dist/authority-scope.js +7 -2
- package/dist/cli/commands.js +19 -21
- package/dist/cli/development-session.js +16 -0
- package/dist/cli/studio-artifact.js +33 -0
- package/dist/create/package-versions.js +1 -1
- package/dist/create/server-source/crates/feltdb/src/acceptance_tests.rs +8 -1
- package/dist/create/server-source/crates/feltdb/src/application.rs +16 -0
- package/dist/create/server-source/crates/feltdb/src/bin/feltdb_node.rs +21 -22
- package/dist/create/server-source/crates/feltdb/src/lib.rs +451 -33
- package/dist/create/server-source/crates/feltdb/src/state_contract.rs +48 -3
- package/dist/create/server-source/crates/feltdb/src/state_model.rs +569 -4
- package/dist/create/server-source/crates/feltdb/src/state_trigger.rs +1 -0
- package/dist/create/server-source/crates/feltdb/src/versioned_object_substrate.rs +708 -0
- package/dist/create/server-source/crates/feltdb/src/worker_mesh.rs +1 -0
- package/dist/create/server-source/crates/feltdb/src/workload.rs +480 -44
- package/dist/create/server-source/crates/feltdb/tests/generalized_version_control_evidence.rs +123 -0
- package/dist/create/server-source/crates/feltdb/tests/generalized_version_control_substrate_completion.rs +281 -0
- package/dist/create/server-source/crates/feltdb/tests/production_readiness_contract.rs +15 -3
- package/dist/create/server-source/crates/feltdb/tests/revision_retention_boundary_evidence.rs +28 -18
- package/dist/create/server-source/crates/feltdb/tests/storage_independent_versioned_object_substrate.rs +328 -0
- package/dist/create/server-source/crates/feltdb/tests/workload_envelope_contract.rs +20 -3
- package/dist/create/server-source/crates/feltdb-server/src/app_state.rs +14 -4
- package/dist/create/server-source/crates/feltdb-server/src/backup.rs +0 -4
- package/dist/create/server-source/crates/feltdb-server/src/canonical_principals.rs +1093 -0
- package/dist/create/server-source/crates/feltdb-server/src/causal.rs +905 -144
- package/dist/create/server-source/crates/feltdb-server/src/connections.rs +9 -6
- package/dist/create/server-source/crates/feltdb-server/src/control_plane.rs +90 -0
- package/dist/create/server-source/crates/feltdb-server/src/lib.rs +1 -0
- package/dist/create/server-source/crates/feltdb-server/src/main.rs +443 -77
- package/dist/create/server-source/crates/feltdb-server/src/principals.rs +9 -501
- package/dist/create/server-source/crates/feltdb-server/src/tenancy.rs +22 -0
- package/dist/create/server-source/crates/feltdb-server/tests/principal_tenant_migration.rs +247 -0
- package/dist/db.d.ts +14 -7
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +50 -26
- package/dist/deployment.d.ts +2 -0
- package/dist/deployment.d.ts.map +1 -1
- package/dist/deployment.js +4 -2
- package/dist/embedded-transaction.d.ts.map +1 -1
- package/dist/embedded-transaction.js +4 -0
- package/dist/error-codes.d.ts +12 -0
- package/dist/error-codes.d.ts.map +1 -1
- package/dist/error-codes.js +20 -2
- package/dist/feltdb.d.ts +4 -0
- package/dist/feltdb.d.ts.map +1 -1
- package/dist/file-db.d.ts +10 -0
- package/dist/file-db.d.ts.map +1 -1
- package/dist/file-db.js +18 -0
- package/dist/http-db.d.ts +7 -0
- package/dist/http-db.d.ts.map +1 -1
- package/dist/http-db.js +83 -15
- package/dist/index-core.d.ts +1 -0
- package/dist/index-core.d.ts.map +1 -1
- package/dist/index-core.js +1 -0
- package/dist/operation-admission.d.ts +2 -0
- package/dist/operation-admission.d.ts.map +1 -1
- package/dist/public-contract.d.ts +112 -0
- package/dist/public-contract.d.ts.map +1 -0
- package/dist/public-contract.js +125 -0
- package/dist/studio/app.d.ts +23 -0
- package/dist/studio/app.d.ts.map +1 -1
- package/dist/studio/components/ContractInspector.d.ts +5 -0
- package/dist/studio/components/ContractInspector.d.ts.map +1 -1
- package/dist/studio/components/SettingsPanel.d.ts +4 -1
- package/dist/studio/components/SettingsPanel.d.ts.map +1 -1
- package/dist/studio/components/index.js +4 -4
- package/dist/studio/{components-CehkcX_k.js → components-CJFgdKG6.js} +322 -303
- package/dist/studio/control-plane/Data.d.ts.map +1 -1
- package/dist/studio/control-plane/Instance.d.ts +10 -0
- package/dist/studio/control-plane/Instance.d.ts.map +1 -1
- package/dist/studio/control-plane/Operations.d.ts +3 -0
- package/dist/studio/control-plane/Operations.d.ts.map +1 -1
- package/dist/studio/control-plane/State.d.ts.map +1 -1
- package/dist/studio/control-plane/index.d.ts +4 -2
- package/dist/studio/control-plane/index.d.ts.map +1 -1
- package/dist/studio/control-plane/index.js +2 -2
- package/dist/studio/control-plane-DP8ljTDO.js +3207 -0
- package/dist/studio/index.js +96 -75
- package/dist/studio/utils/api.d.ts +1 -1
- package/dist/studio/utils/api.d.ts.map +1 -1
- package/dist/studio/utils/control-plane-api.d.ts +12 -1
- package/dist/studio/utils/control-plane-api.d.ts.map +1 -1
- package/dist/studio/utils/control-plane-api.js +1 -1
- package/dist/studio/utils/index.js +16 -16
- package/dist/studio/utils/service-api.d.ts +8 -0
- package/dist/studio/utils/service-api.d.ts.map +1 -1
- package/dist/studio/utils/service-api.js +15 -12
- package/dist/studio-app/assets/{feltdb_wasm-DksXDnLa.js → feltdb_wasm-CfNb3IoF.js} +1 -1
- package/dist/studio-app/assets/feltdb_wasm_bg-D9d3gY-E.wasm +0 -0
- package/dist/studio-app/assets/index-SDXdROi1.js +30 -0
- package/dist/studio-app/feltdb-studio.json +6 -0
- package/dist/studio-app/index.html +1 -1
- package/dist/transaction.d.ts +9 -1
- package/dist/transaction.d.ts.map +1 -1
- package/dist/transaction.js +6 -2
- package/dist/wasm/feltdb_wasm_bg.wasm +0 -0
- package/dist/workspace/local-development-authority.d.ts +8 -0
- package/dist/workspace/local-development-authority.d.ts.map +1 -1
- package/dist/workspace/local-development-authority.js +136 -1
- package/package.json +2 -2
- package/dist/studio/control-plane-D6TT2fCQ.js +0 -3064
- package/dist/studio-app/assets/feltdb_wasm_bg-Yy4QRHJT.wasm +0 -0
- package/dist/studio-app/assets/index-CjELc-ul.js +0 -30
|
@@ -104,7 +104,7 @@ function O(e, t) {
|
|
|
104
104
|
error: o
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function ee(e) {
|
|
108
108
|
let [t, n] = f([]);
|
|
109
109
|
return l(() => {
|
|
110
110
|
if (!e) {
|
|
@@ -124,7 +124,7 @@ function k(e) {
|
|
|
124
124
|
return () => clearInterval(r);
|
|
125
125
|
}, [e]), t;
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function k(e, t) {
|
|
128
128
|
let [n, r] = f(null), [i, a] = f(!1), [o, s] = f(null);
|
|
129
129
|
return l(() => {
|
|
130
130
|
if (!e || !t) {
|
|
@@ -133,7 +133,7 @@ function A(e, t) {
|
|
|
133
133
|
}
|
|
134
134
|
a(!0), s(null), (async () => {
|
|
135
135
|
try {
|
|
136
|
-
let n = e.provenance(t);
|
|
136
|
+
let n = await e.provenance(t);
|
|
137
137
|
r(n);
|
|
138
138
|
} catch (e) {
|
|
139
139
|
s(e instanceof Error ? e.message : "Failed to fetch provenance");
|
|
@@ -149,7 +149,7 @@ function A(e, t) {
|
|
|
149
149
|
}
|
|
150
150
|
//#endregion
|
|
151
151
|
//#region src/components/ExecutionViewer.tsx
|
|
152
|
-
function
|
|
152
|
+
function A({ db: e, name: t, label: n }) {
|
|
153
153
|
let { items: r } = O(e, t);
|
|
154
154
|
return r.length ? /* @__PURE__ */ g("section", { children: [/* @__PURE__ */ g("h2", { children: [n, /* @__PURE__ */ h("span", { children: r.length })] }), /* @__PURE__ */ h("div", {
|
|
155
155
|
className: "execution-list",
|
|
@@ -166,7 +166,7 @@ function j({ db: e, name: t, label: n }) {
|
|
|
166
166
|
}, String(e.id ?? r)))
|
|
167
167
|
})] }) : null;
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function j({ db: e, model: t }) {
|
|
170
170
|
return /* @__PURE__ */ g("div", {
|
|
171
171
|
className: "studio-model-page",
|
|
172
172
|
children: [
|
|
@@ -182,27 +182,27 @@ function M({ db: e, model: t }) {
|
|
|
182
182
|
className: "model-summary",
|
|
183
183
|
children: [/* @__PURE__ */ g("span", { children: [t?.workflows.length ?? 0, " workflow definitions"] }), /* @__PURE__ */ g("span", { children: [t?.agents.length ?? 0, " autonomous agents"] })]
|
|
184
184
|
}),
|
|
185
|
-
/* @__PURE__ */ h(
|
|
185
|
+
/* @__PURE__ */ h(A, {
|
|
186
186
|
db: e ?? null,
|
|
187
187
|
name: "_flow_executions",
|
|
188
188
|
label: "Capability executions"
|
|
189
189
|
}),
|
|
190
|
-
/* @__PURE__ */ h(
|
|
190
|
+
/* @__PURE__ */ h(A, {
|
|
191
191
|
db: e ?? null,
|
|
192
192
|
name: "_flow_workflow_runs",
|
|
193
193
|
label: "Workflow runs"
|
|
194
194
|
}),
|
|
195
|
-
/* @__PURE__ */ h(
|
|
195
|
+
/* @__PURE__ */ h(A, {
|
|
196
196
|
db: e ?? null,
|
|
197
197
|
name: "Assignment",
|
|
198
198
|
label: "Materialized assignments"
|
|
199
199
|
}),
|
|
200
|
-
/* @__PURE__ */ h(
|
|
200
|
+
/* @__PURE__ */ h(A, {
|
|
201
201
|
db: e ?? null,
|
|
202
202
|
name: "Decision",
|
|
203
203
|
label: "Agent decisions"
|
|
204
204
|
}),
|
|
205
|
-
/* @__PURE__ */ h(
|
|
205
|
+
/* @__PURE__ */ h(A, {
|
|
206
206
|
db: e ?? null,
|
|
207
207
|
name: "_flow_agent_executions",
|
|
208
208
|
label: "Agent executions"
|
|
@@ -220,7 +220,7 @@ function M({ db: e, model: t }) {
|
|
|
220
220
|
}
|
|
221
221
|
//#endregion
|
|
222
222
|
//#region src/components/WorkflowVisualizer.tsx
|
|
223
|
-
function
|
|
223
|
+
function M({ model: e }) {
|
|
224
224
|
let t = e?.workflows ?? [], [n, r] = f(), i = t.find((e) => e.name === n) ?? t[0];
|
|
225
225
|
return /* @__PURE__ */ g("div", {
|
|
226
226
|
className: "studio-model-page",
|
|
@@ -264,7 +264,7 @@ function N({ model: e }) {
|
|
|
264
264
|
}
|
|
265
265
|
//#endregion
|
|
266
266
|
//#region src/components/AgentExplorer.tsx
|
|
267
|
-
function
|
|
267
|
+
function N({ model: e }) {
|
|
268
268
|
let t = e?.agents ?? [], [n, r] = f(), i = t.find((e) => e.name === n) ?? t[0];
|
|
269
269
|
return /* @__PURE__ */ g("div", {
|
|
270
270
|
className: "studio-model-page",
|
|
@@ -299,26 +299,41 @@ function P({ model: e }) {
|
|
|
299
299
|
}
|
|
300
300
|
//#endregion
|
|
301
301
|
//#region src/components/SettingsPanel.tsx
|
|
302
|
-
function
|
|
303
|
-
|
|
302
|
+
function P(e) {
|
|
303
|
+
return e === "node" ? "Node.js" : e === "browser" ? "Browser" : e === "self-hosted" ? "Self-hosted" : e === "managed" ? "Managed" : e === "remote" ? "Remote" : e || "unavailable";
|
|
304
|
+
}
|
|
305
|
+
function F({ db: e, remoteUrl: t = "", token: n = "", applicationUrl: r = "", feltDBRuntime: i, authorityUrl: a = "", onConnect: o }) {
|
|
306
|
+
let [s, c] = f(t), [u, d] = f(n), p = e?.runtime();
|
|
304
307
|
return l(() => {
|
|
305
|
-
|
|
308
|
+
c(t), d(n);
|
|
306
309
|
}, [t, n]), /* @__PURE__ */ g("div", {
|
|
307
310
|
className: "settings-panel",
|
|
308
311
|
children: [/* @__PURE__ */ h("h2", { children: "Settings" }), /* @__PURE__ */ g("div", {
|
|
309
312
|
className: "settings-content",
|
|
310
313
|
children: [
|
|
311
|
-
/* @__PURE__ */ h("h3", { children: "
|
|
314
|
+
/* @__PURE__ */ h("h3", { children: "Application" }),
|
|
315
|
+
/* @__PURE__ */ h("div", {
|
|
316
|
+
className: "connection-info",
|
|
317
|
+
children: /* @__PURE__ */ g("div", {
|
|
318
|
+
className: "info-row",
|
|
319
|
+
children: [/* @__PURE__ */ h("label", { children: "URL" }), /* @__PURE__ */ h("span", { children: r || "unavailable" })]
|
|
320
|
+
})
|
|
321
|
+
}),
|
|
322
|
+
/* @__PURE__ */ h("h3", { children: "FeltDB" }),
|
|
312
323
|
/* @__PURE__ */ g("div", {
|
|
313
324
|
className: "connection-info",
|
|
314
325
|
children: [
|
|
315
326
|
/* @__PURE__ */ g("div", {
|
|
316
327
|
className: "info-row",
|
|
317
|
-
children: [/* @__PURE__ */ h("label", { children: "Runtime
|
|
328
|
+
children: [/* @__PURE__ */ h("label", { children: "Runtime" }), /* @__PURE__ */ h("span", { children: P(i || p?.runtime) })]
|
|
318
329
|
}),
|
|
319
330
|
/* @__PURE__ */ g("div", {
|
|
320
331
|
className: "info-row",
|
|
321
|
-
children: [/* @__PURE__ */ h("label", { children: "
|
|
332
|
+
children: [/* @__PURE__ */ h("label", { children: "Studio client backend" }), /* @__PURE__ */ h("span", { children: p?.storage || "unavailable" })]
|
|
333
|
+
}),
|
|
334
|
+
/* @__PURE__ */ g("div", {
|
|
335
|
+
className: "info-row",
|
|
336
|
+
children: [/* @__PURE__ */ h("label", { children: "Authority" }), /* @__PURE__ */ h("span", { children: a || t || "unavailable" })]
|
|
322
337
|
}),
|
|
323
338
|
/* @__PURE__ */ g("div", {
|
|
324
339
|
className: "info-row",
|
|
@@ -332,19 +347,19 @@ function F({ db: e, remoteUrl: t = "", token: n = "", onConnect: r }) {
|
|
|
332
347
|
/* @__PURE__ */ g("form", {
|
|
333
348
|
className: "connection-form",
|
|
334
349
|
onSubmit: (e) => {
|
|
335
|
-
e.preventDefault(),
|
|
350
|
+
e.preventDefault(), o?.(s, u);
|
|
336
351
|
},
|
|
337
352
|
children: [
|
|
338
|
-
/* @__PURE__ */ g("label", { children: ["
|
|
353
|
+
/* @__PURE__ */ g("label", { children: ["FeltDB authority endpoint", /* @__PURE__ */ h("input", {
|
|
339
354
|
type: "url",
|
|
340
|
-
value:
|
|
341
|
-
onChange: (e) =>
|
|
342
|
-
placeholder: "https://your-
|
|
355
|
+
value: s,
|
|
356
|
+
onChange: (e) => c(e.target.value),
|
|
357
|
+
placeholder: "https://your-authority.example.com"
|
|
343
358
|
})] }),
|
|
344
359
|
/* @__PURE__ */ g("label", { children: ["API token", /* @__PURE__ */ h("input", {
|
|
345
360
|
type: "password",
|
|
346
|
-
value:
|
|
347
|
-
onChange: (e) =>
|
|
361
|
+
value: u,
|
|
362
|
+
onChange: (e) => d(e.target.value),
|
|
348
363
|
placeholder: "fdb_live_…",
|
|
349
364
|
autoComplete: "off"
|
|
350
365
|
})] }),
|
|
@@ -452,7 +467,7 @@ function R({ db: e, namespace: t = "default", projectSpec: n, managedPublish: r,
|
|
|
452
467
|
} catch {
|
|
453
468
|
return L;
|
|
454
469
|
}
|
|
455
|
-
})()), s = d(o.current !== L), [c, p] = f(o.current), [m, C] = f(() => x(o.current)), [T, E] = f([]), [D, O] = f([]), [
|
|
470
|
+
})()), s = d(o.current !== L), [c, p] = f(o.current), [m, C] = f(() => x(o.current)), [T, E] = f([]), [D, O] = f([]), [ee, k] = f("Draft is valid"), [A, j] = f(0), [M, N] = f(null), [P, F] = f(null), [I, R] = f(!1), [z, B] = f(!1), [V, H] = f(() => ({
|
|
456
471
|
url: r?.url || "",
|
|
457
472
|
namespace: r?.namespace || t,
|
|
458
473
|
token: r?.token || "",
|
|
@@ -460,7 +475,7 @@ function R({ db: e, namespace: t = "default", projectSpec: n, managedPublish: r,
|
|
|
460
475
|
applicationId: r?.applicationId,
|
|
461
476
|
publishEndpoint: r?.publishEndpoint,
|
|
462
477
|
allowDestructive: !1
|
|
463
|
-
})),
|
|
478
|
+
})), U = d(null), W = D.length ? D[D.length - 1].source : b(y(m.app)), G = u(() => v(x(W), m), [W, m]), K = u(() => S(x(W), m), [W, m]);
|
|
464
479
|
l(() => {
|
|
465
480
|
if (!e || n) return;
|
|
466
481
|
let t = !1;
|
|
@@ -469,15 +484,15 @@ function R({ db: e, namespace: t = "default", projectSpec: n, managedPublish: r,
|
|
|
469
484
|
let n = await e.collection("_flow_apps").all(), r = n.find((e) => e.status === "active") ?? n[0];
|
|
470
485
|
if (!r || t) return;
|
|
471
486
|
let i = b(r.spec);
|
|
472
|
-
s.current || (C(r.spec), p(i)),
|
|
487
|
+
s.current || (C(r.spec), p(i)), j(r.version ?? 0);
|
|
473
488
|
let a = (await e.collection("_flow_app_versions").all()).filter((e) => e.app === r.app).sort((e, t) => e.version - t.version);
|
|
474
489
|
t || (O(a.map((e) => ({
|
|
475
490
|
version: e.version,
|
|
476
491
|
source: b(e.spec),
|
|
477
492
|
savedAt: e.deployed_at
|
|
478
|
-
}))),
|
|
493
|
+
}))), k(`Loaded ${r.app} v${r.version}`));
|
|
479
494
|
} catch (e) {
|
|
480
|
-
t ||
|
|
495
|
+
t || k(`Could not load deployed model: ${e instanceof Error ? e.message : String(e)}`);
|
|
481
496
|
}
|
|
482
497
|
})(), () => {
|
|
483
498
|
t = !0;
|
|
@@ -486,59 +501,59 @@ function R({ db: e, namespace: t = "default", projectSpec: n, managedPublish: r,
|
|
|
486
501
|
let e = window.setTimeout(() => window.localStorage.setItem(a, c), 200);
|
|
487
502
|
return () => window.clearTimeout(e);
|
|
488
503
|
}, [a, c]);
|
|
489
|
-
let
|
|
504
|
+
let te = (e) => {
|
|
490
505
|
p(e);
|
|
491
506
|
try {
|
|
492
507
|
let t = x(e), n = w(t);
|
|
493
|
-
C(t), i?.(t), E(n),
|
|
508
|
+
C(t), i?.(t), E(n), k(n.some((e) => e.severity === "error") ? "Model has validation errors" : "Draft is valid");
|
|
494
509
|
} catch (e) {
|
|
495
510
|
E([{
|
|
496
511
|
severity: "error",
|
|
497
512
|
message: e instanceof Error ? e.message : String(e)
|
|
498
|
-
}]),
|
|
513
|
+
}]), k("DSL parse failed");
|
|
499
514
|
}
|
|
500
515
|
};
|
|
501
516
|
l(() => {
|
|
502
517
|
if (!n) return;
|
|
503
518
|
let e = b(n);
|
|
504
|
-
p(e), C(n), E(w(n)),
|
|
519
|
+
p(e), C(n), E(w(n)), k(`Loaded ${n.app} project model`);
|
|
505
520
|
}, [n]);
|
|
506
|
-
let
|
|
507
|
-
C(e),
|
|
508
|
-
},
|
|
509
|
-
if (!
|
|
510
|
-
let e =
|
|
511
|
-
if (!/^[A-Z][A-Za-z0-9_]*$/.test(e)) return
|
|
512
|
-
...
|
|
521
|
+
let ne = (e) => {
|
|
522
|
+
C(e), te(b(e));
|
|
523
|
+
}, q = () => {
|
|
524
|
+
if (!P) return F({ name: "" });
|
|
525
|
+
let e = P.name.trim();
|
|
526
|
+
if (!/^[A-Z][A-Za-z0-9_]*$/.test(e)) return F({
|
|
527
|
+
...P,
|
|
513
528
|
error: "Use a capitalized name with no spaces."
|
|
514
529
|
});
|
|
515
|
-
if (m.collections.some((t) => t.name === e)) return
|
|
516
|
-
...
|
|
530
|
+
if (m.collections.some((t) => t.name === e)) return F({
|
|
531
|
+
...P,
|
|
517
532
|
error: "That collection already exists."
|
|
518
533
|
});
|
|
519
|
-
|
|
534
|
+
ne({
|
|
520
535
|
...m,
|
|
521
536
|
collections: [...m.collections, {
|
|
522
537
|
name: e,
|
|
523
538
|
fields: [],
|
|
524
539
|
indexes: []
|
|
525
540
|
}]
|
|
526
|
-
}),
|
|
527
|
-
},
|
|
541
|
+
}), F(null);
|
|
542
|
+
}, re = (e) => N({
|
|
528
543
|
collection: e,
|
|
529
544
|
name: "",
|
|
530
545
|
type: "text",
|
|
531
546
|
reference: "",
|
|
532
547
|
optional: !1
|
|
533
|
-
}),
|
|
534
|
-
if (!
|
|
535
|
-
let e =
|
|
536
|
-
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(e)) return
|
|
537
|
-
...
|
|
548
|
+
}), J = () => {
|
|
549
|
+
if (!M) return;
|
|
550
|
+
let e = M.name.trim(), t = m.collections.find((e) => e.name === M.collection);
|
|
551
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(e)) return N({
|
|
552
|
+
...M,
|
|
538
553
|
error: "Use a letter-led name with no spaces."
|
|
539
554
|
});
|
|
540
|
-
if (t?.fields.some((t) => t.name === e)) return
|
|
541
|
-
...
|
|
555
|
+
if (t?.fields.some((t) => t.name === e)) return N({
|
|
556
|
+
...M,
|
|
542
557
|
error: "That field already exists."
|
|
543
558
|
});
|
|
544
559
|
if ([
|
|
@@ -547,124 +562,124 @@ function R({ db: e, namespace: t = "default", projectSpec: n, managedPublish: r,
|
|
|
547
562
|
"array",
|
|
548
563
|
"map",
|
|
549
564
|
"vector"
|
|
550
|
-
].includes(
|
|
551
|
-
...
|
|
565
|
+
].includes(M.type) && !M.reference.trim()) return N({
|
|
566
|
+
...M,
|
|
552
567
|
error: "Configure this field type."
|
|
553
568
|
});
|
|
554
|
-
let n =
|
|
555
|
-
|
|
569
|
+
let n = M.type === "ref" ? `ref ${M.reference}` : M.type === "enum" ? `enum(${M.reference.split(",").map((e) => e.trim()).filter(Boolean).join(",")})` : M.type === "array" ? `array<${M.reference.trim()}>` : M.type === "map" ? `map<${M.reference.trim()}>` : M.type === "vector" ? `vector<${M.reference.trim()}>` : M.type;
|
|
570
|
+
ne({
|
|
556
571
|
...m,
|
|
557
|
-
collections: m.collections.map((t) => t.name ===
|
|
572
|
+
collections: m.collections.map((t) => t.name === M.collection ? {
|
|
558
573
|
...t,
|
|
559
574
|
fields: [...t.fields, {
|
|
560
575
|
name: e,
|
|
561
576
|
type: n,
|
|
562
|
-
optional:
|
|
577
|
+
optional: M.optional
|
|
563
578
|
}]
|
|
564
579
|
} : t)
|
|
565
|
-
}),
|
|
566
|
-
},
|
|
580
|
+
}), N(null);
|
|
581
|
+
}, ie = () => {
|
|
567
582
|
let e = [...D, {
|
|
568
583
|
version: D.length + 1,
|
|
569
584
|
source: c,
|
|
570
585
|
savedAt: Date.now()
|
|
571
586
|
}];
|
|
572
|
-
O(e),
|
|
573
|
-
},
|
|
574
|
-
if (!e) return
|
|
575
|
-
if (T.some((e) => e.severity === "error")) return
|
|
576
|
-
if (
|
|
587
|
+
O(e), k(`Saved local revision v${e.length}`);
|
|
588
|
+
}, Y = async () => {
|
|
589
|
+
if (!e) return k("Local embedded storage is unavailable");
|
|
590
|
+
if (T.some((e) => e.severity === "error")) return k("Resolve validation errors before deploying");
|
|
591
|
+
if (K.filter((e) => e.safety === "destructive").length && !I) return k("Review and approve destructive local changes before applying");
|
|
577
592
|
try {
|
|
578
|
-
let t = await e.deployFlowSpec(m,
|
|
593
|
+
let t = await e.deployFlowSpec(m, A, I), n = [...D, {
|
|
579
594
|
version: t.version,
|
|
580
595
|
source: c,
|
|
581
596
|
savedAt: Date.now()
|
|
582
597
|
}];
|
|
583
|
-
O(n),
|
|
598
|
+
O(n), j(t.version), R(!1), k(`Applied locally as ${t.app} v${t.version}`);
|
|
584
599
|
} catch (e) {
|
|
585
|
-
|
|
600
|
+
k(`Local apply failed: ${e instanceof Error ? e.message : String(e)}`);
|
|
586
601
|
}
|
|
587
|
-
},
|
|
588
|
-
if (
|
|
589
|
-
|
|
590
|
-
...
|
|
602
|
+
}, ae = async () => {
|
|
603
|
+
if (V.publishEndpoint) {
|
|
604
|
+
H({
|
|
605
|
+
...V,
|
|
591
606
|
publishing: !0,
|
|
592
607
|
error: void 0
|
|
593
608
|
});
|
|
594
609
|
try {
|
|
595
|
-
let e = await fetch(
|
|
610
|
+
let e = await fetch(V.publishEndpoint, {
|
|
596
611
|
method: "POST",
|
|
597
612
|
headers: { "content-type": "application/json" },
|
|
598
613
|
body: JSON.stringify({
|
|
599
|
-
environment:
|
|
600
|
-
approveDestructive:
|
|
614
|
+
environment: V.environment,
|
|
615
|
+
approveDestructive: V.allowDestructive
|
|
601
616
|
})
|
|
602
617
|
}), t = await e.json();
|
|
603
618
|
if (!e.ok) throw Error(t.error || "Publish failed");
|
|
604
|
-
|
|
605
|
-
...
|
|
619
|
+
H({
|
|
620
|
+
...V,
|
|
606
621
|
publishing: !1,
|
|
607
622
|
error: void 0
|
|
608
|
-
}),
|
|
623
|
+
}), B(!1), k(t.messages?.at(-1) || `Published immutable version ${t.version}`);
|
|
609
624
|
return;
|
|
610
625
|
} catch (e) {
|
|
611
|
-
|
|
612
|
-
...
|
|
626
|
+
H({
|
|
627
|
+
...V,
|
|
613
628
|
publishing: !1,
|
|
614
629
|
error: e instanceof Error ? e.message : String(e)
|
|
615
630
|
});
|
|
616
631
|
return;
|
|
617
632
|
}
|
|
618
633
|
}
|
|
619
|
-
if (!
|
|
620
|
-
...
|
|
634
|
+
if (!V.url.trim() || !V.token.trim()) return H({
|
|
635
|
+
...V,
|
|
621
636
|
error: "Cloud URL and API key are required."
|
|
622
637
|
});
|
|
623
|
-
if (T.some((e) => e.severity === "error")) return
|
|
624
|
-
...
|
|
638
|
+
if (T.some((e) => e.severity === "error")) return H({
|
|
639
|
+
...V,
|
|
625
640
|
error: "Resolve validation errors before publishing."
|
|
626
641
|
});
|
|
627
|
-
|
|
628
|
-
...
|
|
642
|
+
H({
|
|
643
|
+
...V,
|
|
629
644
|
publishing: !0,
|
|
630
645
|
error: void 0
|
|
631
646
|
});
|
|
632
647
|
let e = _({
|
|
633
|
-
namespace:
|
|
648
|
+
namespace: V.namespace.trim() || t,
|
|
634
649
|
server: {
|
|
635
|
-
url:
|
|
636
|
-
token:
|
|
650
|
+
url: V.url.trim().replace(/\/$/, ""),
|
|
651
|
+
token: V.token
|
|
637
652
|
}
|
|
638
653
|
});
|
|
639
654
|
try {
|
|
640
655
|
let t = await e.collection("_flow_apps").get(m.app), n = S(t?.spec ?? y(m.app), m).filter((e) => e.safety === "destructive");
|
|
641
|
-
if (n.length && !
|
|
642
|
-
...
|
|
656
|
+
if (n.length && !V.allowDestructive) return H({
|
|
657
|
+
...V,
|
|
643
658
|
publishing: !1,
|
|
644
659
|
destructive: n.map((e) => e.target),
|
|
645
660
|
error: `Review and approve destructive changes: ${n.map((e) => e.target).join(", ")}`
|
|
646
661
|
});
|
|
647
|
-
let r = await e.deployFlowSpec(m, t?.version ?? 0,
|
|
648
|
-
window.sessionStorage.setItem(`feltdb-token:${
|
|
649
|
-
...
|
|
662
|
+
let r = await e.deployFlowSpec(m, t?.version ?? 0, V.allowDestructive);
|
|
663
|
+
window.sessionStorage.setItem(`feltdb-token:${V.url.trim()}`, V.token), H({
|
|
664
|
+
...V,
|
|
650
665
|
publishing: !1,
|
|
651
666
|
error: void 0
|
|
652
|
-
}),
|
|
667
|
+
}), B(!1), k(`Published ${r.app} v${r.version} to ${V.environment || "cloud"}`);
|
|
653
668
|
} catch (e) {
|
|
654
|
-
|
|
655
|
-
...
|
|
669
|
+
H({
|
|
670
|
+
...V,
|
|
656
671
|
publishing: !1,
|
|
657
672
|
error: e instanceof Error ? e.message : String(e)
|
|
658
673
|
});
|
|
659
674
|
} finally {
|
|
660
675
|
await e.close();
|
|
661
676
|
}
|
|
662
|
-
},
|
|
677
|
+
}, X = () => {
|
|
663
678
|
let e = URL.createObjectURL(new Blob([c], { type: "text/plain" })), t = document.createElement("a");
|
|
664
679
|
t.href = e, t.download = "feltdb.flow", t.click(), URL.revokeObjectURL(e);
|
|
665
|
-
},
|
|
666
|
-
e &&
|
|
667
|
-
},
|
|
680
|
+
}, oe = async (e) => {
|
|
681
|
+
e && te(await e.text());
|
|
682
|
+
}, Z = [
|
|
668
683
|
["Data", m.collections.map((e) => e.name)],
|
|
669
684
|
["Capabilities", m.capabilities.map((e) => e.name)],
|
|
670
685
|
["Agents", m.agents.map((e) => e.name)],
|
|
@@ -689,52 +704,52 @@ function R({ db: e, namespace: t = "default", projectSpec: n, managedPublish: r,
|
|
|
689
704
|
className: "designer-actions",
|
|
690
705
|
children: [
|
|
691
706
|
/* @__PURE__ */ h("input", {
|
|
692
|
-
ref:
|
|
707
|
+
ref: U,
|
|
693
708
|
hidden: !0,
|
|
694
709
|
type: "file",
|
|
695
710
|
accept: ".flow,text/plain",
|
|
696
|
-
onChange: (e) => void
|
|
711
|
+
onChange: (e) => void oe(e.target.files?.[0])
|
|
697
712
|
}),
|
|
698
713
|
/* @__PURE__ */ h("button", {
|
|
699
714
|
className: "btn btn-ghost",
|
|
700
|
-
onClick: () =>
|
|
715
|
+
onClick: () => U.current?.click(),
|
|
701
716
|
children: "Import"
|
|
702
717
|
}),
|
|
703
718
|
/* @__PURE__ */ h("button", {
|
|
704
719
|
className: "btn btn-ghost",
|
|
705
|
-
onClick:
|
|
720
|
+
onClick: X,
|
|
706
721
|
children: "Export"
|
|
707
722
|
}),
|
|
708
723
|
/* @__PURE__ */ h("button", {
|
|
709
724
|
className: "btn btn-ghost",
|
|
710
|
-
onClick:
|
|
725
|
+
onClick: ie,
|
|
711
726
|
children: "Version"
|
|
712
727
|
}),
|
|
713
728
|
/* @__PURE__ */ h("button", {
|
|
714
729
|
className: "btn btn-ghost",
|
|
715
|
-
onClick: () => void
|
|
730
|
+
onClick: () => void Y(),
|
|
716
731
|
children: "Apply locally"
|
|
717
732
|
}),
|
|
718
733
|
/* @__PURE__ */ h("button", {
|
|
719
734
|
className: "btn btn-primary",
|
|
720
|
-
onClick: () =>
|
|
735
|
+
onClick: () => B((e) => !e),
|
|
721
736
|
children: "Publish to cloud"
|
|
722
737
|
})
|
|
723
738
|
]
|
|
724
739
|
})]
|
|
725
740
|
}),
|
|
726
|
-
|
|
741
|
+
K.some((e) => e.safety === "destructive") && /* @__PURE__ */ g("label", {
|
|
727
742
|
className: "local-destructive",
|
|
728
743
|
children: [/* @__PURE__ */ h("input", {
|
|
729
744
|
type: "checkbox",
|
|
730
|
-
checked:
|
|
731
|
-
onChange: (e) =>
|
|
732
|
-
}), /* @__PURE__ */ g("span", { children: ["Approve destructive local changes: ",
|
|
745
|
+
checked: I,
|
|
746
|
+
onChange: (e) => R(e.target.checked)
|
|
747
|
+
}), /* @__PURE__ */ g("span", { children: ["Approve destructive local changes: ", K.filter((e) => e.safety === "destructive").map((e) => e.target).join(", ")] })]
|
|
733
748
|
}),
|
|
734
|
-
|
|
749
|
+
z && /* @__PURE__ */ g("form", {
|
|
735
750
|
className: "cloud-publisher",
|
|
736
751
|
onSubmit: (e) => {
|
|
737
|
-
e.preventDefault(),
|
|
752
|
+
e.preventDefault(), ae();
|
|
738
753
|
},
|
|
739
754
|
children: [
|
|
740
755
|
/* @__PURE__ */ g("div", {
|
|
@@ -749,7 +764,7 @@ function R({ db: e, namespace: t = "default", projectSpec: n, managedPublish: r,
|
|
|
749
764
|
] }), /* @__PURE__ */ h("button", {
|
|
750
765
|
type: "button",
|
|
751
766
|
"aria-label": "Close cloud publisher",
|
|
752
|
-
onClick: () =>
|
|
767
|
+
onClick: () => B(!1),
|
|
753
768
|
children: "×"
|
|
754
769
|
})]
|
|
755
770
|
}),
|
|
@@ -758,10 +773,10 @@ function R({ db: e, namespace: t = "default", projectSpec: n, managedPublish: r,
|
|
|
758
773
|
children: [
|
|
759
774
|
/* @__PURE__ */ g("label", { children: [/* @__PURE__ */ h("span", { children: "FeltDB Cloud URL" }), /* @__PURE__ */ h("input", {
|
|
760
775
|
type: "url",
|
|
761
|
-
value:
|
|
762
|
-
readOnly: !!
|
|
763
|
-
onChange: (e) =>
|
|
764
|
-
...
|
|
776
|
+
value: V.url,
|
|
777
|
+
readOnly: !!V.publishEndpoint,
|
|
778
|
+
onChange: (e) => H({
|
|
779
|
+
...V,
|
|
765
780
|
url: e.target.value,
|
|
766
781
|
error: void 0,
|
|
767
782
|
destructive: void 0,
|
|
@@ -769,72 +784,72 @@ function R({ db: e, namespace: t = "default", projectSpec: n, managedPublish: r,
|
|
|
769
784
|
})
|
|
770
785
|
})] }),
|
|
771
786
|
/* @__PURE__ */ g("label", { children: [/* @__PURE__ */ h("span", { children: "Namespace" }), /* @__PURE__ */ h("input", {
|
|
772
|
-
value:
|
|
773
|
-
readOnly: !!
|
|
774
|
-
onChange: (e) =>
|
|
775
|
-
...
|
|
787
|
+
value: V.namespace,
|
|
788
|
+
readOnly: !!V.publishEndpoint,
|
|
789
|
+
onChange: (e) => H({
|
|
790
|
+
...V,
|
|
776
791
|
namespace: e.target.value,
|
|
777
792
|
error: void 0,
|
|
778
793
|
destructive: void 0,
|
|
779
794
|
allowDestructive: !1
|
|
780
795
|
})
|
|
781
796
|
})] }),
|
|
782
|
-
!
|
|
797
|
+
!V.publishEndpoint && /* @__PURE__ */ g("label", { children: [/* @__PURE__ */ h("span", { children: "API key" }), /* @__PURE__ */ h("input", {
|
|
783
798
|
type: "password",
|
|
784
799
|
autoComplete: "off",
|
|
785
800
|
placeholder: "Loaded securely from this project",
|
|
786
|
-
value:
|
|
787
|
-
onChange: (e) =>
|
|
788
|
-
...
|
|
801
|
+
value: V.token,
|
|
802
|
+
onChange: (e) => H({
|
|
803
|
+
...V,
|
|
789
804
|
token: e.target.value,
|
|
790
805
|
error: void 0
|
|
791
806
|
})
|
|
792
807
|
})] }),
|
|
793
|
-
|
|
794
|
-
value:
|
|
808
|
+
V.environment && /* @__PURE__ */ g("label", { children: [/* @__PURE__ */ h("span", { children: "Environment" }), /* @__PURE__ */ h("input", {
|
|
809
|
+
value: V.environment,
|
|
795
810
|
readOnly: !0
|
|
796
811
|
})] }),
|
|
797
|
-
|
|
798
|
-
value:
|
|
812
|
+
V.applicationId && /* @__PURE__ */ g("label", { children: [/* @__PURE__ */ h("span", { children: "Application" }), /* @__PURE__ */ h("input", {
|
|
813
|
+
value: V.applicationId,
|
|
799
814
|
readOnly: !0
|
|
800
815
|
})] })
|
|
801
816
|
]
|
|
802
817
|
}),
|
|
803
|
-
(
|
|
818
|
+
(V.destructive?.length || K.some((e) => e.safety === "destructive")) && /* @__PURE__ */ g("label", {
|
|
804
819
|
className: "cloud-destructive",
|
|
805
820
|
children: [/* @__PURE__ */ h("input", {
|
|
806
821
|
type: "checkbox",
|
|
807
|
-
checked:
|
|
808
|
-
onChange: (e) =>
|
|
809
|
-
...
|
|
822
|
+
checked: V.allowDestructive,
|
|
823
|
+
onChange: (e) => H({
|
|
824
|
+
...V,
|
|
810
825
|
allowDestructive: e.target.checked
|
|
811
826
|
})
|
|
812
|
-
}), /* @__PURE__ */ g("span", { children: ["I reviewed and approve destructive model changes",
|
|
827
|
+
}), /* @__PURE__ */ g("span", { children: ["I reviewed and approve destructive model changes", V.destructive?.length ? `: ${V.destructive.join(", ")}` : "."] })]
|
|
813
828
|
}),
|
|
814
|
-
|
|
829
|
+
V.error && /* @__PURE__ */ h("div", {
|
|
815
830
|
className: "cloud-error",
|
|
816
831
|
role: "alert",
|
|
817
|
-
children:
|
|
832
|
+
children: V.error
|
|
818
833
|
}),
|
|
819
834
|
/* @__PURE__ */ g("div", {
|
|
820
835
|
className: "cloud-actions",
|
|
821
836
|
children: [/* @__PURE__ */ h("button", {
|
|
822
837
|
type: "button",
|
|
823
838
|
className: "btn btn-ghost",
|
|
824
|
-
onClick: () =>
|
|
839
|
+
onClick: () => B(!1),
|
|
825
840
|
children: "Cancel"
|
|
826
841
|
}), /* @__PURE__ */ h("button", {
|
|
827
842
|
className: "btn btn-primary",
|
|
828
|
-
disabled:
|
|
843
|
+
disabled: V.publishing,
|
|
829
844
|
type: "submit",
|
|
830
|
-
children:
|
|
845
|
+
children: V.publishing ? "Publishing…" : "Review and publish"
|
|
831
846
|
})]
|
|
832
847
|
})
|
|
833
848
|
]
|
|
834
849
|
}),
|
|
835
850
|
/* @__PURE__ */ g("div", {
|
|
836
851
|
className: `designer-status ${T.some((e) => e.severity === "error") ? "error" : ""}`,
|
|
837
|
-
children: [/* @__PURE__ */ h("span", { children:
|
|
852
|
+
children: [/* @__PURE__ */ h("span", { children: ee }), /* @__PURE__ */ g("span", { children: [
|
|
838
853
|
m.collections.length,
|
|
839
854
|
" collections · ",
|
|
840
855
|
m.workflows.length,
|
|
@@ -852,33 +867,33 @@ function R({ db: e, namespace: t = "default", projectSpec: n, managedPublish: r,
|
|
|
852
867
|
className: "panel-title",
|
|
853
868
|
children: [/* @__PURE__ */ h("span", { children: "Application" }), /* @__PURE__ */ h("button", {
|
|
854
869
|
"aria-label": "Add collection",
|
|
855
|
-
onClick: () =>
|
|
870
|
+
onClick: () => F({ name: "" }),
|
|
856
871
|
children: "+"
|
|
857
872
|
})]
|
|
858
873
|
}),
|
|
859
|
-
|
|
874
|
+
P && /* @__PURE__ */ g("form", {
|
|
860
875
|
className: "collection-editor",
|
|
861
876
|
onSubmit: (e) => {
|
|
862
|
-
e.preventDefault(),
|
|
877
|
+
e.preventDefault(), q();
|
|
863
878
|
},
|
|
864
879
|
onKeyDown: (e) => {
|
|
865
|
-
e.key === "Escape" &&
|
|
880
|
+
e.key === "Escape" && F(null);
|
|
866
881
|
},
|
|
867
882
|
children: [
|
|
868
883
|
/* @__PURE__ */ g("label", { children: [/* @__PURE__ */ h("span", { children: "New collection" }), /* @__PURE__ */ h("input", {
|
|
869
884
|
autoFocus: !0,
|
|
870
885
|
placeholder: "e.g. Customer",
|
|
871
|
-
value:
|
|
872
|
-
onChange: (e) =>
|
|
886
|
+
value: P.name,
|
|
887
|
+
onChange: (e) => F({ name: e.target.value })
|
|
873
888
|
})] }),
|
|
874
|
-
|
|
889
|
+
P.error && /* @__PURE__ */ h("div", {
|
|
875
890
|
className: "field-error",
|
|
876
891
|
role: "alert",
|
|
877
|
-
children:
|
|
892
|
+
children: P.error
|
|
878
893
|
}),
|
|
879
894
|
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("button", {
|
|
880
895
|
type: "button",
|
|
881
|
-
onClick: () =>
|
|
896
|
+
onClick: () => F(null),
|
|
882
897
|
children: "Cancel"
|
|
883
898
|
}), /* @__PURE__ */ h("button", {
|
|
884
899
|
className: "collection-save",
|
|
@@ -887,7 +902,7 @@ function R({ db: e, namespace: t = "default", projectSpec: n, managedPublish: r,
|
|
|
887
902
|
})] })
|
|
888
903
|
]
|
|
889
904
|
}),
|
|
890
|
-
|
|
905
|
+
Z.map(([e, t]) => /* @__PURE__ */ g("section", { children: [/* @__PURE__ */ h("h3", { children: e }), t.length ? t.map((e) => /* @__PURE__ */ h("div", {
|
|
891
906
|
className: "tree-item",
|
|
892
907
|
children: e
|
|
893
908
|
}, e)) : /* @__PURE__ */ h("div", {
|
|
@@ -921,21 +936,21 @@ function R({ db: e, namespace: t = "default", projectSpec: n, managedPublish: r,
|
|
|
921
936
|
className: "node-field",
|
|
922
937
|
children: [/* @__PURE__ */ h("span", { children: e.name }), /* @__PURE__ */ g("code", { children: [e.type, e.optional ? "?" : ""] })]
|
|
923
938
|
}, e.name)),
|
|
924
|
-
|
|
939
|
+
M?.collection === e.name ? /* @__PURE__ */ g("form", {
|
|
925
940
|
className: "field-editor",
|
|
926
941
|
onSubmit: (e) => {
|
|
927
|
-
e.preventDefault(),
|
|
942
|
+
e.preventDefault(), J();
|
|
928
943
|
},
|
|
929
944
|
onKeyDown: (e) => {
|
|
930
|
-
e.key === "Escape" &&
|
|
945
|
+
e.key === "Escape" && N(null);
|
|
931
946
|
},
|
|
932
947
|
children: [
|
|
933
948
|
/* @__PURE__ */ g("label", { children: [/* @__PURE__ */ h("span", { children: "Field name" }), /* @__PURE__ */ h("input", {
|
|
934
949
|
autoFocus: !0,
|
|
935
|
-
value:
|
|
950
|
+
value: M.name,
|
|
936
951
|
placeholder: "e.g. publishedAt",
|
|
937
|
-
onChange: (e) =>
|
|
938
|
-
...
|
|
952
|
+
onChange: (e) => N({
|
|
953
|
+
...M,
|
|
939
954
|
name: e.target.value,
|
|
940
955
|
error: void 0
|
|
941
956
|
})
|
|
@@ -944,9 +959,9 @@ function R({ db: e, namespace: t = "default", projectSpec: n, managedPublish: r,
|
|
|
944
959
|
className: "field-editor-row",
|
|
945
960
|
children: [
|
|
946
961
|
/* @__PURE__ */ g("label", { children: [/* @__PURE__ */ h("span", { children: "Type" }), /* @__PURE__ */ g("select", {
|
|
947
|
-
value:
|
|
948
|
-
onChange: (e) =>
|
|
949
|
-
...
|
|
962
|
+
value: M.type,
|
|
963
|
+
onChange: (e) => N({
|
|
964
|
+
...M,
|
|
950
965
|
type: e.target.value,
|
|
951
966
|
error: void 0
|
|
952
967
|
}),
|
|
@@ -1049,10 +1064,10 @@ function R({ db: e, namespace: t = "default", projectSpec: n, managedPublish: r,
|
|
|
1049
1064
|
})
|
|
1050
1065
|
]
|
|
1051
1066
|
})] }),
|
|
1052
|
-
|
|
1053
|
-
value:
|
|
1054
|
-
onChange: (e) =>
|
|
1055
|
-
...
|
|
1067
|
+
M.type === "ref" && /* @__PURE__ */ g("label", { children: [/* @__PURE__ */ h("span", { children: "Collection" }), /* @__PURE__ */ h("select", {
|
|
1068
|
+
value: M.reference,
|
|
1069
|
+
onChange: (e) => N({
|
|
1070
|
+
...M,
|
|
1056
1071
|
reference: e.target.value,
|
|
1057
1072
|
error: void 0
|
|
1058
1073
|
}),
|
|
@@ -1061,31 +1076,31 @@ function R({ db: e, namespace: t = "default", projectSpec: n, managedPublish: r,
|
|
|
1061
1076
|
children: e.name
|
|
1062
1077
|
}, e.name))
|
|
1063
1078
|
})] }),
|
|
1064
|
-
|
|
1079
|
+
M.type === "enum" && /* @__PURE__ */ g("label", { children: [/* @__PURE__ */ h("span", { children: "Values" }), /* @__PURE__ */ h("input", {
|
|
1065
1080
|
placeholder: "draft,active,done",
|
|
1066
|
-
value:
|
|
1067
|
-
onChange: (e) =>
|
|
1068
|
-
...
|
|
1081
|
+
value: M.reference,
|
|
1082
|
+
onChange: (e) => N({
|
|
1083
|
+
...M,
|
|
1069
1084
|
reference: e.target.value,
|
|
1070
1085
|
error: void 0
|
|
1071
1086
|
})
|
|
1072
1087
|
})] }),
|
|
1073
|
-
(
|
|
1088
|
+
(M.type === "array" || M.type === "map") && /* @__PURE__ */ g("label", { children: [/* @__PURE__ */ h("span", { children: "Item type" }), /* @__PURE__ */ h("input", {
|
|
1074
1089
|
placeholder: "text, uuid, ref Project…",
|
|
1075
|
-
value:
|
|
1076
|
-
onChange: (e) =>
|
|
1077
|
-
...
|
|
1090
|
+
value: M.reference,
|
|
1091
|
+
onChange: (e) => N({
|
|
1092
|
+
...M,
|
|
1078
1093
|
reference: e.target.value,
|
|
1079
1094
|
error: void 0
|
|
1080
1095
|
})
|
|
1081
1096
|
})] }),
|
|
1082
|
-
|
|
1097
|
+
M.type === "vector" && /* @__PURE__ */ g("label", { children: [/* @__PURE__ */ h("span", { children: "Dimensions" }), /* @__PURE__ */ h("input", {
|
|
1083
1098
|
type: "number",
|
|
1084
1099
|
min: "1",
|
|
1085
1100
|
placeholder: "1536",
|
|
1086
|
-
value:
|
|
1087
|
-
onChange: (e) =>
|
|
1088
|
-
...
|
|
1101
|
+
value: M.reference,
|
|
1102
|
+
onChange: (e) => N({
|
|
1103
|
+
...M,
|
|
1089
1104
|
reference: e.target.value,
|
|
1090
1105
|
error: void 0
|
|
1091
1106
|
})
|
|
@@ -1096,23 +1111,23 @@ function R({ db: e, namespace: t = "default", projectSpec: n, managedPublish: r,
|
|
|
1096
1111
|
className: "field-optional",
|
|
1097
1112
|
children: [/* @__PURE__ */ h("input", {
|
|
1098
1113
|
type: "checkbox",
|
|
1099
|
-
checked:
|
|
1100
|
-
onChange: (e) =>
|
|
1101
|
-
...
|
|
1114
|
+
checked: M.optional,
|
|
1115
|
+
onChange: (e) => N({
|
|
1116
|
+
...M,
|
|
1102
1117
|
optional: e.target.checked
|
|
1103
1118
|
})
|
|
1104
1119
|
}), /* @__PURE__ */ h("span", { children: "Optional field" })]
|
|
1105
1120
|
}),
|
|
1106
|
-
|
|
1121
|
+
M.error && /* @__PURE__ */ h("div", {
|
|
1107
1122
|
className: "field-error",
|
|
1108
1123
|
role: "alert",
|
|
1109
|
-
children:
|
|
1124
|
+
children: M.error
|
|
1110
1125
|
}),
|
|
1111
1126
|
/* @__PURE__ */ g("div", {
|
|
1112
1127
|
className: "field-editor-actions",
|
|
1113
1128
|
children: [/* @__PURE__ */ h("button", {
|
|
1114
1129
|
type: "button",
|
|
1115
|
-
onClick: () =>
|
|
1130
|
+
onClick: () => N(null),
|
|
1116
1131
|
children: "Cancel"
|
|
1117
1132
|
}), /* @__PURE__ */ h("button", {
|
|
1118
1133
|
className: "field-save",
|
|
@@ -1123,7 +1138,7 @@ function R({ db: e, namespace: t = "default", projectSpec: n, managedPublish: r,
|
|
|
1123
1138
|
]
|
|
1124
1139
|
}) : /* @__PURE__ */ h("button", {
|
|
1125
1140
|
className: "node-add",
|
|
1126
|
-
onClick: () =>
|
|
1141
|
+
onClick: () => re(e.name),
|
|
1127
1142
|
children: "+ field"
|
|
1128
1143
|
})
|
|
1129
1144
|
]
|
|
@@ -1164,15 +1179,15 @@ function R({ db: e, namespace: t = "default", projectSpec: n, managedPublish: r,
|
|
|
1164
1179
|
/* @__PURE__ */ h("strong", { children: "Model diff" }),
|
|
1165
1180
|
/* @__PURE__ */ g("span", {
|
|
1166
1181
|
className: "added",
|
|
1167
|
-
children: ["+ ",
|
|
1182
|
+
children: ["+ ", G.added.join(", ") || "none"]
|
|
1168
1183
|
}),
|
|
1169
1184
|
/* @__PURE__ */ g("span", {
|
|
1170
1185
|
className: "changed",
|
|
1171
|
-
children: ["~ ",
|
|
1186
|
+
children: ["~ ", G.changed.join(", ") || "none"]
|
|
1172
1187
|
}),
|
|
1173
1188
|
/* @__PURE__ */ g("span", {
|
|
1174
1189
|
className: "removed",
|
|
1175
|
-
children: ["− ",
|
|
1190
|
+
children: ["− ", G.removed.join(", ") || "none"]
|
|
1176
1191
|
})
|
|
1177
1192
|
]
|
|
1178
1193
|
})
|
|
@@ -1189,7 +1204,7 @@ function R({ db: e, namespace: t = "default", projectSpec: n, managedPublish: r,
|
|
|
1189
1204
|
"aria-label": "Flow DSL",
|
|
1190
1205
|
spellCheck: !1,
|
|
1191
1206
|
value: c,
|
|
1192
|
-
onChange: (e) =>
|
|
1207
|
+
onChange: (e) => te(e.target.value)
|
|
1193
1208
|
}),
|
|
1194
1209
|
T.length > 0 && /* @__PURE__ */ h("div", {
|
|
1195
1210
|
className: "diagnostics",
|
|
@@ -1505,7 +1520,7 @@ function K({ artifact: e }) {
|
|
|
1505
1520
|
]
|
|
1506
1521
|
});
|
|
1507
1522
|
}
|
|
1508
|
-
function
|
|
1523
|
+
function te({ value: e }) {
|
|
1509
1524
|
return /* @__PURE__ */ g("section", {
|
|
1510
1525
|
className: `repository-readiness ${e?.ready ? "ready" : "blocked"}`,
|
|
1511
1526
|
children: [/* @__PURE__ */ h("h3", { children: "Repository" }), e ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("strong", { children: e.ready ? "✓ READY FOR CLI APPLY" : "⚠ BLOCKED" }), /* @__PURE__ */ g("ul", { children: [
|
|
@@ -1531,7 +1546,7 @@ function q({ value: e }) {
|
|
|
1531
1546
|
] })]
|
|
1532
1547
|
});
|
|
1533
1548
|
}
|
|
1534
|
-
function
|
|
1549
|
+
function ne({ value: e }) {
|
|
1535
1550
|
return e ? /* @__PURE__ */ g("section", {
|
|
1536
1551
|
className: `proposal-verification ${e.status}`,
|
|
1537
1552
|
children: [
|
|
@@ -1566,7 +1581,7 @@ function ee({ value: e }) {
|
|
|
1566
1581
|
]
|
|
1567
1582
|
});
|
|
1568
1583
|
}
|
|
1569
|
-
function
|
|
1584
|
+
function q({ serviceUrl: t = "", token: n = "", applicationId: r, environment: d, applicationName: p, sourceSync: _ }) {
|
|
1570
1585
|
let v = u(() => new i({
|
|
1571
1586
|
baseUrl: t,
|
|
1572
1587
|
token: n,
|
|
@@ -1577,22 +1592,22 @@ function J({ serviceUrl: t = "", token: n = "", applicationId: r, environment: d
|
|
|
1577
1592
|
n,
|
|
1578
1593
|
r,
|
|
1579
1594
|
d
|
|
1580
|
-
]), [y, b] = f([]), [x, S] = f(), [C, w] = f([]), [T, E] = f(), [D, O] = f(), [
|
|
1581
|
-
|
|
1595
|
+
]), [y, b] = f([]), [x, S] = f(), [C, w] = f([]), [T, E] = f(), [D, O] = f(), [ee, k] = f(), [A, j] = f(), [M, N] = f(""), [P, F] = f(), [I, L] = f(null), [R, q] = f([]), [re, J] = f(!0), [ie, Y] = f(""), [ae, X] = f(!1), [oe, Z] = f(!1), [se, ce] = f(""), [le, ue] = f(!1), Q = c(async (t, n = !0) => {
|
|
1596
|
+
J(!0);
|
|
1582
1597
|
try {
|
|
1583
|
-
let e = await v.list(
|
|
1584
|
-
b(e.proposals),
|
|
1598
|
+
let e = await v.list(M, t);
|
|
1599
|
+
b(e.proposals), F(t), L(e.pagination?.nextCursor ?? null), Y("");
|
|
1585
1600
|
} catch (r) {
|
|
1586
1601
|
if (n && t && r instanceof e && r.code === "invalid_cursor") {
|
|
1587
|
-
|
|
1602
|
+
q([]), await Q(void 0, !1), Y(a(r));
|
|
1588
1603
|
return;
|
|
1589
1604
|
}
|
|
1590
|
-
|
|
1605
|
+
Y(a(r));
|
|
1591
1606
|
} finally {
|
|
1592
|
-
|
|
1607
|
+
J(!1);
|
|
1593
1608
|
}
|
|
1594
|
-
}, [v,
|
|
1595
|
-
|
|
1609
|
+
}, [v, M]), $ = c(async (e) => {
|
|
1610
|
+
Y("");
|
|
1596
1611
|
try {
|
|
1597
1612
|
let [t, n, r, i] = await Promise.all([
|
|
1598
1613
|
v.get(e),
|
|
@@ -1600,38 +1615,38 @@ function J({ serviceUrl: t = "", token: n = "", applicationId: r, environment: d
|
|
|
1600
1615
|
v.history(e),
|
|
1601
1616
|
v.convergence(e)
|
|
1602
1617
|
]);
|
|
1603
|
-
S(t), E(n), w(r.events),
|
|
1618
|
+
S(t), E(n), w(r.events), j(i.convergence[0]), fetch(`/_feltdb/repository-readiness?proposal=${encodeURIComponent(e)}`, { cache: "no-store" }).then((e) => e.ok ? e.json() : void 0).then(k).catch(() => k(void 0)), t.preview_id ? v.preview(t.preview_id).then(O).catch((e) => Y(a(e))) : O(void 0);
|
|
1604
1619
|
} catch (e) {
|
|
1605
|
-
|
|
1620
|
+
Y(a(e));
|
|
1606
1621
|
}
|
|
1607
1622
|
}, [v]);
|
|
1608
1623
|
l(() => {
|
|
1609
|
-
|
|
1610
|
-
}, [
|
|
1624
|
+
q([]), Q();
|
|
1625
|
+
}, [Q]), l(() => {
|
|
1611
1626
|
if (!x?.id) return;
|
|
1612
1627
|
let e = window.setInterval(() => {
|
|
1613
|
-
|
|
1628
|
+
$(x.id), Q(P);
|
|
1614
1629
|
}, 5e3);
|
|
1615
1630
|
return () => window.clearInterval(e);
|
|
1616
1631
|
}, [
|
|
1617
1632
|
x?.id,
|
|
1618
|
-
ue,
|
|
1619
1633
|
$,
|
|
1620
|
-
|
|
1634
|
+
Q,
|
|
1635
|
+
P
|
|
1621
1636
|
]);
|
|
1622
1637
|
let de = async () => {
|
|
1623
|
-
await
|
|
1638
|
+
await Q(P), x && await $(x.id);
|
|
1624
1639
|
}, fe = async (e) => {
|
|
1625
1640
|
if (x) try {
|
|
1626
|
-
e === "approve" ? await v.approve(x.id,
|
|
1641
|
+
e === "approve" ? await v.approve(x.id, le) : await v.reject(x.id, se || void 0), X(!1), Z(!1), await de();
|
|
1627
1642
|
} catch (e) {
|
|
1628
|
-
|
|
1643
|
+
Y(a(e));
|
|
1629
1644
|
}
|
|
1630
1645
|
}, pe = async () => {
|
|
1631
1646
|
if (x) try {
|
|
1632
1647
|
x.status === "proposed" ? await v.validate(x.id) : await v.createPreview(x.id), await de();
|
|
1633
1648
|
} catch (e) {
|
|
1634
|
-
|
|
1649
|
+
Y(a(e));
|
|
1635
1650
|
}
|
|
1636
1651
|
}, me = x ? o(x) : void 0, he = x?.warnings.some((e) => e.startsWith("Authorization "));
|
|
1637
1652
|
return /* @__PURE__ */ g("div", {
|
|
@@ -1652,12 +1667,12 @@ function J({ serviceUrl: t = "", token: n = "", applicationId: r, environment: d
|
|
|
1652
1667
|
] }),
|
|
1653
1668
|
/* @__PURE__ */ h(z, {
|
|
1654
1669
|
configuration: _,
|
|
1655
|
-
onProposalCreated: () => void
|
|
1670
|
+
onProposalCreated: () => void Q()
|
|
1656
1671
|
}),
|
|
1657
|
-
|
|
1672
|
+
ie && /* @__PURE__ */ g("div", {
|
|
1658
1673
|
className: "data-error",
|
|
1659
1674
|
role: "alert",
|
|
1660
|
-
children: [
|
|
1675
|
+
children: [ie, /* @__PURE__ */ h("button", {
|
|
1661
1676
|
onClick: () => void de(),
|
|
1662
1677
|
children: "Refresh"
|
|
1663
1678
|
})]
|
|
@@ -1669,16 +1684,16 @@ function J({ serviceUrl: t = "", token: n = "", applicationId: r, environment: d
|
|
|
1669
1684
|
children: [
|
|
1670
1685
|
/* @__PURE__ */ g("header", { children: [/* @__PURE__ */ h("h2", { children: "Proposals" }), /* @__PURE__ */ h("select", {
|
|
1671
1686
|
"aria-label": "Proposal status",
|
|
1672
|
-
value:
|
|
1673
|
-
onChange: (e) =>
|
|
1687
|
+
value: M,
|
|
1688
|
+
onChange: (e) => N(e.target.value),
|
|
1674
1689
|
children: B.map((e) => /* @__PURE__ */ h("option", {
|
|
1675
1690
|
value: e,
|
|
1676
1691
|
children: e ? e.toUpperCase() : "ALL STATUSES"
|
|
1677
1692
|
}, e || "all"))
|
|
1678
1693
|
})] }),
|
|
1679
|
-
|
|
1694
|
+
re ? /* @__PURE__ */ h("p", { children: "Loading…" }) : y.length ? y.map((e) => /* @__PURE__ */ g("button", {
|
|
1680
1695
|
className: `proposal-list-row ${x?.id === e.id ? "active" : ""}`,
|
|
1681
|
-
onClick: () => void
|
|
1696
|
+
onClick: () => void $(e.id),
|
|
1682
1697
|
children: [/* @__PURE__ */ g("span", { children: [/* @__PURE__ */ h("strong", { children: e.summary }), /* @__PURE__ */ g("small", { children: [
|
|
1683
1698
|
e.id,
|
|
1684
1699
|
" · ",
|
|
@@ -1688,16 +1703,16 @@ function J({ serviceUrl: t = "", token: n = "", applicationId: r, environment: d
|
|
|
1688
1703
|
/* @__PURE__ */ g("footer", {
|
|
1689
1704
|
className: "data-pagination",
|
|
1690
1705
|
children: [/* @__PURE__ */ h("button", {
|
|
1691
|
-
disabled: !
|
|
1706
|
+
disabled: !R.length,
|
|
1692
1707
|
onClick: () => {
|
|
1693
|
-
let e =
|
|
1694
|
-
|
|
1708
|
+
let e = R.at(-1);
|
|
1709
|
+
q((e) => e.slice(0, -1)), Q(e);
|
|
1695
1710
|
},
|
|
1696
1711
|
children: "←"
|
|
1697
1712
|
}), /* @__PURE__ */ h("button", {
|
|
1698
|
-
disabled: !
|
|
1713
|
+
disabled: !I,
|
|
1699
1714
|
onClick: () => {
|
|
1700
|
-
|
|
1715
|
+
q((e) => [...e, P]), Q(I || void 0);
|
|
1701
1716
|
},
|
|
1702
1717
|
children: "→"
|
|
1703
1718
|
})]
|
|
@@ -1717,7 +1732,7 @@ function J({ serviceUrl: t = "", token: n = "", applicationId: r, environment: d
|
|
|
1717
1732
|
" ",
|
|
1718
1733
|
/* @__PURE__ */ h("button", {
|
|
1719
1734
|
className: "reference-value",
|
|
1720
|
-
onClick: () => void
|
|
1735
|
+
onClick: () => void $(x.parent_proposal_id),
|
|
1721
1736
|
children: x.parent_proposal_id
|
|
1722
1737
|
})
|
|
1723
1738
|
] })
|
|
@@ -1779,13 +1794,13 @@ function J({ serviceUrl: t = "", token: n = "", applicationId: r, environment: d
|
|
|
1779
1794
|
] }),
|
|
1780
1795
|
T && /* @__PURE__ */ h(W, { value: T }),
|
|
1781
1796
|
D && /* @__PURE__ */ h(K, { artifact: D }),
|
|
1782
|
-
x.status === "applied" && /* @__PURE__ */ h(
|
|
1797
|
+
x.status === "applied" && /* @__PURE__ */ h(ne, { value: A }),
|
|
1783
1798
|
/* @__PURE__ */ g("section", { children: [/* @__PURE__ */ h("h3", { children: "Source plan" }), x.source_plan.files.map((e) => /* @__PURE__ */ h("p", { children: /* @__PURE__ */ g("code", { children: [
|
|
1784
1799
|
e.operation,
|
|
1785
1800
|
" ",
|
|
1786
1801
|
e.path
|
|
1787
1802
|
] }) }, e.path))] }),
|
|
1788
|
-
/* @__PURE__ */ h(
|
|
1803
|
+
/* @__PURE__ */ h(te, { value: ee }),
|
|
1789
1804
|
/* @__PURE__ */ g("section", { children: [/* @__PURE__ */ h("h3", { children: "History" }), /* @__PURE__ */ h("ol", {
|
|
1790
1805
|
className: "proposal-history",
|
|
1791
1806
|
children: C.map((e) => /* @__PURE__ */ g("li", { children: [
|
|
@@ -1809,17 +1824,17 @@ function J({ serviceUrl: t = "", token: n = "", applicationId: r, environment: d
|
|
|
1809
1824
|
children: [/* @__PURE__ */ h("button", {
|
|
1810
1825
|
className: "btn btn-primary",
|
|
1811
1826
|
disabled: T?.readiness === "blocked",
|
|
1812
|
-
onClick: () =>
|
|
1827
|
+
onClick: () => X(!0),
|
|
1813
1828
|
children: "Approve Proposal"
|
|
1814
1829
|
}), /* @__PURE__ */ h("button", {
|
|
1815
1830
|
className: "btn btn-ghost",
|
|
1816
|
-
onClick: () =>
|
|
1831
|
+
onClick: () => Z(!0),
|
|
1817
1832
|
children: "Reject"
|
|
1818
1833
|
})]
|
|
1819
1834
|
}),
|
|
1820
1835
|
["proposed", "validated"].includes(x.status) && /* @__PURE__ */ h("button", {
|
|
1821
1836
|
className: "btn btn-ghost",
|
|
1822
|
-
onClick: () =>
|
|
1837
|
+
onClick: () => Z(!0),
|
|
1823
1838
|
children: "Reject"
|
|
1824
1839
|
}),
|
|
1825
1840
|
x.status === "approved" && /* @__PURE__ */ g("section", {
|
|
@@ -1841,7 +1856,7 @@ function J({ serviceUrl: t = "", token: n = "", applicationId: r, environment: d
|
|
|
1841
1856
|
})
|
|
1842
1857
|
})]
|
|
1843
1858
|
}),
|
|
1844
|
-
|
|
1859
|
+
ae && x && /* @__PURE__ */ h("div", {
|
|
1845
1860
|
className: "proposal-modal",
|
|
1846
1861
|
role: "dialog",
|
|
1847
1862
|
"aria-modal": "true",
|
|
@@ -1853,23 +1868,23 @@ function J({ serviceUrl: t = "", token: n = "", applicationId: r, environment: d
|
|
|
1853
1868
|
he && /* @__PURE__ */ g("label", { children: [
|
|
1854
1869
|
/* @__PURE__ */ h("input", {
|
|
1855
1870
|
type: "checkbox",
|
|
1856
|
-
checked:
|
|
1857
|
-
onChange: (e) =>
|
|
1871
|
+
checked: le,
|
|
1872
|
+
onChange: (e) => ue(e.target.checked)
|
|
1858
1873
|
}),
|
|
1859
1874
|
" ",
|
|
1860
1875
|
"I explicitly approve the authorization change."
|
|
1861
1876
|
] }),
|
|
1862
1877
|
/* @__PURE__ */ g("footer", { children: [/* @__PURE__ */ h("button", {
|
|
1863
|
-
onClick: () =>
|
|
1878
|
+
onClick: () => X(!1),
|
|
1864
1879
|
children: "Cancel"
|
|
1865
1880
|
}), /* @__PURE__ */ h("button", {
|
|
1866
|
-
disabled: he && !
|
|
1881
|
+
disabled: he && !le,
|
|
1867
1882
|
onClick: () => void fe("approve"),
|
|
1868
1883
|
children: "Approve"
|
|
1869
1884
|
})] })
|
|
1870
1885
|
] })
|
|
1871
1886
|
}),
|
|
1872
|
-
|
|
1887
|
+
oe && x && /* @__PURE__ */ h("div", {
|
|
1873
1888
|
className: "proposal-modal",
|
|
1874
1889
|
role: "dialog",
|
|
1875
1890
|
"aria-modal": "true",
|
|
@@ -1877,12 +1892,12 @@ function J({ serviceUrl: t = "", token: n = "", applicationId: r, environment: d
|
|
|
1877
1892
|
/* @__PURE__ */ h("h2", { children: "Reject Proposal?" }),
|
|
1878
1893
|
/* @__PURE__ */ h("textarea", {
|
|
1879
1894
|
"aria-label": "Rejection reason",
|
|
1880
|
-
value:
|
|
1881
|
-
onChange: (e) =>
|
|
1895
|
+
value: se,
|
|
1896
|
+
onChange: (e) => ce(e.target.value),
|
|
1882
1897
|
placeholder: "Optional reason"
|
|
1883
1898
|
}),
|
|
1884
1899
|
/* @__PURE__ */ g("footer", { children: [/* @__PURE__ */ h("button", {
|
|
1885
|
-
onClick: () =>
|
|
1900
|
+
onClick: () => Z(!1),
|
|
1886
1901
|
children: "Cancel"
|
|
1887
1902
|
}), /* @__PURE__ */ h("button", {
|
|
1888
1903
|
onClick: () => void fe("reject"),
|
|
@@ -1895,7 +1910,7 @@ function J({ serviceUrl: t = "", token: n = "", applicationId: r, environment: d
|
|
|
1895
1910
|
}
|
|
1896
1911
|
//#endregion
|
|
1897
1912
|
//#region src/components/ModuleExplorer.tsx
|
|
1898
|
-
function
|
|
1913
|
+
function re({ model: e }) {
|
|
1899
1914
|
let t = C(e?.modules ?? []);
|
|
1900
1915
|
return /* @__PURE__ */ g("section", {
|
|
1901
1916
|
className: "module-explorer",
|
|
@@ -1962,7 +1977,14 @@ function Y({ model: e }) {
|
|
|
1962
1977
|
}
|
|
1963
1978
|
//#endregion
|
|
1964
1979
|
//#region src/components/ContractInspector.tsx
|
|
1965
|
-
function
|
|
1980
|
+
function J(e, t) {
|
|
1981
|
+
let n = new URLSearchParams(e);
|
|
1982
|
+
return n.set("collection", t), {
|
|
1983
|
+
pathname: "/data",
|
|
1984
|
+
search: `?${n.toString()}`
|
|
1985
|
+
};
|
|
1986
|
+
}
|
|
1987
|
+
function ie({ model: e, section: t }) {
|
|
1966
1988
|
return e ? /* @__PURE__ */ g("div", {
|
|
1967
1989
|
className: "studio-model-page",
|
|
1968
1990
|
children: [/* @__PURE__ */ g("header", { children: [/* @__PURE__ */ h("span", {
|
|
@@ -1974,10 +1996,7 @@ function te({ model: e, section: t }) {
|
|
|
1974
1996
|
/* @__PURE__ */ h("h2", { children: e.name }),
|
|
1975
1997
|
/* @__PURE__ */ h("p", { children: e.fields.map((e) => `${e.name}: ${e.type}${e.optional ? "?" : ""}`).join(" · ") }),
|
|
1976
1998
|
/* @__PURE__ */ h(p, {
|
|
1977
|
-
to:
|
|
1978
|
-
pathname: "/data",
|
|
1979
|
-
search: window.location.search
|
|
1980
|
-
},
|
|
1999
|
+
to: J(window.location.search, e.name),
|
|
1981
2000
|
children: "Inspect records →"
|
|
1982
2001
|
})
|
|
1983
2002
|
]
|
|
@@ -1992,7 +2011,7 @@ function te({ model: e, section: t }) {
|
|
|
1992
2011
|
}
|
|
1993
2012
|
//#endregion
|
|
1994
2013
|
//#region src/components/CapabilityExplorer.tsx
|
|
1995
|
-
function
|
|
2014
|
+
function Y({ model: e }) {
|
|
1996
2015
|
let t = e?.capabilities ?? [];
|
|
1997
2016
|
return /* @__PURE__ */ g("div", {
|
|
1998
2017
|
className: "studio-model-page",
|
|
@@ -2041,7 +2060,7 @@ function ne({ model: e }) {
|
|
|
2041
2060
|
}
|
|
2042
2061
|
//#endregion
|
|
2043
2062
|
//#region src/components/OverviewDashboard.tsx
|
|
2044
|
-
function
|
|
2063
|
+
function ae({ stats: e }) {
|
|
2045
2064
|
return e ? /* @__PURE__ */ g("div", {
|
|
2046
2065
|
className: "overview-dashboard",
|
|
2047
2066
|
children: [/* @__PURE__ */ g("div", {
|
|
@@ -2056,7 +2075,7 @@ function re({ stats: e }) {
|
|
|
2056
2075
|
/* @__PURE__ */ g("div", {
|
|
2057
2076
|
className: "stat-card",
|
|
2058
2077
|
children: [
|
|
2059
|
-
/* @__PURE__ */ h("label", { children: "
|
|
2078
|
+
/* @__PURE__ */ h("label", { children: "FeltDB runtime" }),
|
|
2060
2079
|
/* @__PURE__ */ h("div", {
|
|
2061
2080
|
className: `status-indicator ${e.status}`,
|
|
2062
2081
|
children: "●"
|
|
@@ -2132,7 +2151,7 @@ function re({ stats: e }) {
|
|
|
2132
2151
|
})]
|
|
2133
2152
|
}) : /* @__PURE__ */ h("div", {
|
|
2134
2153
|
className: "overview-dashboard loading",
|
|
2135
|
-
children: /* @__PURE__ */ h("p", { children: "Loading runtime information..." })
|
|
2154
|
+
children: /* @__PURE__ */ h("p", { children: "Loading FeltDB runtime information..." })
|
|
2136
2155
|
});
|
|
2137
2156
|
}
|
|
2138
2157
|
//#endregion
|
|
@@ -2159,7 +2178,7 @@ function X({ field: e, value: t }) {
|
|
|
2159
2178
|
children: [r.configured ? "Configured" : "Not configured", " · Secret"]
|
|
2160
2179
|
}) : /* @__PURE__ */ g("details", { children: [/* @__PURE__ */ h("summary", { children: Array.isArray(r) ? `${r.length} items` : "Object" }), /* @__PURE__ */ h("pre", { children: JSON.stringify(r, null, 2) })] }) : /* @__PURE__ */ h(m, { children: String(r) });
|
|
2161
2180
|
}
|
|
2162
|
-
function
|
|
2181
|
+
function oe({ api: e, schema: t, detail: n, onNavigate: i, onClose: a }) {
|
|
2163
2182
|
let [o, c] = f({}), [l, u] = f(""), d = new Map(n.relationships.map((e) => [e.name, e])), p = async (t) => {
|
|
2164
2183
|
try {
|
|
2165
2184
|
let r = await e.records(t.source_collection, void 0, { [t.foreign_field]: String(n.record.id) }, 20);
|
|
@@ -2250,51 +2269,51 @@ function Z({ serviceUrl: n = "", token: i = "", applicationId: a, environment: o
|
|
|
2250
2269
|
i,
|
|
2251
2270
|
a,
|
|
2252
2271
|
o
|
|
2253
|
-
]), [p, m] = f(), [_, v] = f(), [y, b] = f(""), [x, S] = f([]), [C, w] = f(), [T, E] = f(), [D, O] = f([]), [
|
|
2272
|
+
]), [p, m] = f(), [_, v] = f(), [y, b] = f(""), [x, S] = f([]), [C, w] = f(), [T, E] = f(), [D, O] = f([]), [ee, k] = f(null), [A, j] = f(""), [M, N] = f(""), [P, F] = f({}), [I, L] = f(!0), [R, z] = f(""), B = c(async () => {
|
|
2254
2273
|
try {
|
|
2255
2274
|
let [e, t] = await Promise.all([d.application(), d.schema()]);
|
|
2256
|
-
m(e), v(t),
|
|
2275
|
+
m(e), v(t), z(""), b((e) => t.collections.some((t) => t.collection === e) ? e : t.collections[0]?.collection || "");
|
|
2257
2276
|
} catch (e) {
|
|
2258
|
-
|
|
2277
|
+
z(r(e));
|
|
2259
2278
|
}
|
|
2260
|
-
}, [d]),
|
|
2279
|
+
}, [d]), V = c(async (t, n = P, i = !0) => {
|
|
2261
2280
|
if (y) {
|
|
2262
|
-
|
|
2281
|
+
L(!0), z(""), w(void 0);
|
|
2263
2282
|
try {
|
|
2264
2283
|
let e = await d.records(y, t, n);
|
|
2265
|
-
S(e.records), E(t),
|
|
2284
|
+
S(e.records), E(t), k(e.pagination.nextCursor);
|
|
2266
2285
|
} catch (a) {
|
|
2267
2286
|
if (i && t && a instanceof e && a.code === "invalid_cursor") {
|
|
2268
|
-
O([]), await
|
|
2287
|
+
O([]), await V(void 0, n, !1), z("The cursor expired. Refreshed from the first page.");
|
|
2269
2288
|
return;
|
|
2270
2289
|
}
|
|
2271
|
-
|
|
2290
|
+
z(r(a, y)), S([]);
|
|
2272
2291
|
} finally {
|
|
2273
|
-
|
|
2292
|
+
L(!1);
|
|
2274
2293
|
}
|
|
2275
2294
|
}
|
|
2276
2295
|
}, [
|
|
2277
|
-
|
|
2296
|
+
P,
|
|
2278
2297
|
d,
|
|
2279
2298
|
y
|
|
2280
2299
|
]);
|
|
2281
2300
|
l(() => {
|
|
2282
|
-
|
|
2283
|
-
let e = window.setInterval(() => void
|
|
2301
|
+
L(!0), B().finally(() => L(!1));
|
|
2302
|
+
let e = window.setInterval(() => void B(), s);
|
|
2284
2303
|
return () => window.clearInterval(e);
|
|
2285
|
-
}, [
|
|
2286
|
-
O([]), E(void 0),
|
|
2304
|
+
}, [B, s]), l(() => {
|
|
2305
|
+
O([]), E(void 0), k(null), F({}), j(""), N(""), y && V(void 0, {});
|
|
2287
2306
|
}, [y, d]);
|
|
2288
|
-
let
|
|
2289
|
-
|
|
2307
|
+
let H = _?.collections.find((e) => e.collection === y), U = _?.collections.find((e) => e.collection === C?.collection), W = async (e, t) => {
|
|
2308
|
+
z("");
|
|
2290
2309
|
try {
|
|
2291
2310
|
w(await d.record(e, t));
|
|
2292
2311
|
} catch (t) {
|
|
2293
|
-
w(void 0),
|
|
2312
|
+
w(void 0), z(r(t, e));
|
|
2294
2313
|
}
|
|
2295
|
-
},
|
|
2296
|
-
let e =
|
|
2297
|
-
|
|
2314
|
+
}, G = () => {
|
|
2315
|
+
let e = A && M ? { [A]: M } : {};
|
|
2316
|
+
F(e), O([]), V(void 0, e);
|
|
2298
2317
|
};
|
|
2299
2318
|
return /* @__PURE__ */ g("div", {
|
|
2300
2319
|
className: "studio-model-page data-explorer",
|
|
@@ -2332,7 +2351,7 @@ function Z({ serviceUrl: n = "", token: i = "", applicationId: a, environment: o
|
|
|
2332
2351
|
onClick: () => b(e.collection),
|
|
2333
2352
|
children: e.collection
|
|
2334
2353
|
}, e.collection)),
|
|
2335
|
-
!_?.collections.length && !
|
|
2354
|
+
!_?.collections.length && !I && /* @__PURE__ */ h("p", { children: "No application collections." })
|
|
2336
2355
|
]
|
|
2337
2356
|
}), /* @__PURE__ */ g("section", {
|
|
2338
2357
|
className: "data-browser",
|
|
@@ -2340,41 +2359,41 @@ function Z({ serviceUrl: n = "", token: i = "", applicationId: a, environment: o
|
|
|
2340
2359
|
/* @__PURE__ */ g("header", { children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("span", {
|
|
2341
2360
|
className: "card-kind",
|
|
2342
2361
|
children: "collection"
|
|
2343
|
-
}), /* @__PURE__ */ h("h2", { children: y || "Data" })] }),
|
|
2362
|
+
}), /* @__PURE__ */ h("h2", { children: y || "Data" })] }), H && /* @__PURE__ */ g("form", {
|
|
2344
2363
|
onSubmit: (e) => {
|
|
2345
|
-
e.preventDefault(),
|
|
2364
|
+
e.preventDefault(), G();
|
|
2346
2365
|
},
|
|
2347
2366
|
children: [
|
|
2348
2367
|
/* @__PURE__ */ g("select", {
|
|
2349
2368
|
"aria-label": "Filter field",
|
|
2350
|
-
value:
|
|
2351
|
-
onChange: (e) =>
|
|
2369
|
+
value: A,
|
|
2370
|
+
onChange: (e) => j(e.target.value),
|
|
2352
2371
|
children: [/* @__PURE__ */ h("option", {
|
|
2353
2372
|
value: "",
|
|
2354
2373
|
children: "Filter field"
|
|
2355
|
-
}),
|
|
2374
|
+
}), H.fields.map((e) => /* @__PURE__ */ h("option", {
|
|
2356
2375
|
value: e.name,
|
|
2357
2376
|
children: e.name
|
|
2358
2377
|
}, e.name))]
|
|
2359
2378
|
}),
|
|
2360
2379
|
/* @__PURE__ */ h("input", {
|
|
2361
2380
|
"aria-label": "Filter value",
|
|
2362
|
-
value:
|
|
2363
|
-
onChange: (e) =>
|
|
2381
|
+
value: M,
|
|
2382
|
+
onChange: (e) => N(e.target.value),
|
|
2364
2383
|
placeholder: "Equals…"
|
|
2365
2384
|
}),
|
|
2366
2385
|
/* @__PURE__ */ h("button", { children: "Apply" })
|
|
2367
2386
|
]
|
|
2368
2387
|
})] }),
|
|
2369
|
-
|
|
2388
|
+
R && /* @__PURE__ */ g("div", {
|
|
2370
2389
|
className: "data-error",
|
|
2371
2390
|
role: "alert",
|
|
2372
|
-
children: [
|
|
2373
|
-
onClick: () => void
|
|
2391
|
+
children: [R, /* @__PURE__ */ h("button", {
|
|
2392
|
+
onClick: () => void V(void 0),
|
|
2374
2393
|
children: "Refresh"
|
|
2375
2394
|
})]
|
|
2376
2395
|
}),
|
|
2377
|
-
|
|
2396
|
+
I ? /* @__PURE__ */ h("div", {
|
|
2378
2397
|
className: "model-empty",
|
|
2379
2398
|
children: "Loading…"
|
|
2380
2399
|
}) : x.length === 0 ? /* @__PURE__ */ g("div", {
|
|
@@ -2386,14 +2405,14 @@ function Z({ serviceUrl: n = "", token: i = "", applicationId: a, environment: o
|
|
|
2386
2405
|
y || "record",
|
|
2387
2406
|
" through your application to see persisted application state here."
|
|
2388
2407
|
]
|
|
2389
|
-
}) :
|
|
2408
|
+
}) : H && /* @__PURE__ */ h("div", {
|
|
2390
2409
|
className: "table-shell",
|
|
2391
|
-
children: /* @__PURE__ */ g("table", { children: [/* @__PURE__ */ h("thead", { children: /* @__PURE__ */ g("tr", { children: [/* @__PURE__ */ h("th", { children: "id" }),
|
|
2392
|
-
onClick: () => void
|
|
2410
|
+
children: /* @__PURE__ */ g("table", { children: [/* @__PURE__ */ h("thead", { children: /* @__PURE__ */ g("tr", { children: [/* @__PURE__ */ h("th", { children: "id" }), H.fields.map((e) => /* @__PURE__ */ g("th", { children: [e.name, /* @__PURE__ */ g("small", { children: [e.type, e.reference ? ` → ${e.reference}` : ""] })] }, e.name))] }) }), /* @__PURE__ */ h("tbody", { children: x.map((e) => /* @__PURE__ */ g("tr", {
|
|
2411
|
+
onClick: () => void W(y, String(e.id)),
|
|
2393
2412
|
children: [/* @__PURE__ */ h("td", { children: /* @__PURE__ */ h("button", {
|
|
2394
2413
|
className: "record-link",
|
|
2395
2414
|
children: String(e.id)
|
|
2396
|
-
}) }),
|
|
2415
|
+
}) }), H.fields.map((t) => /* @__PURE__ */ h("td", { children: t.reference && e[t.name] != null ? /* @__PURE__ */ g("span", {
|
|
2397
2416
|
className: "reference-value",
|
|
2398
2417
|
children: [
|
|
2399
2418
|
"→ ",
|
|
@@ -2420,24 +2439,24 @@ function Z({ serviceUrl: n = "", token: i = "", applicationId: a, environment: o
|
|
|
2420
2439
|
disabled: !D.length,
|
|
2421
2440
|
onClick: () => {
|
|
2422
2441
|
let e = D.at(-1);
|
|
2423
|
-
O((e) => e.slice(0, -1)),
|
|
2442
|
+
O((e) => e.slice(0, -1)), V(e);
|
|
2424
2443
|
},
|
|
2425
2444
|
children: "← Previous"
|
|
2426
2445
|
}),
|
|
2427
2446
|
/* @__PURE__ */ h("button", {
|
|
2428
|
-
disabled: !
|
|
2447
|
+
disabled: !ee,
|
|
2429
2448
|
onClick: () => {
|
|
2430
|
-
O((e) => [...e, T]),
|
|
2449
|
+
O((e) => [...e, T]), V(ee || void 0);
|
|
2431
2450
|
},
|
|
2432
2451
|
children: "Next →"
|
|
2433
2452
|
})
|
|
2434
2453
|
]
|
|
2435
2454
|
}),
|
|
2436
|
-
C &&
|
|
2455
|
+
C && U && /* @__PURE__ */ h(oe, {
|
|
2437
2456
|
api: d,
|
|
2438
|
-
schema:
|
|
2457
|
+
schema: U,
|
|
2439
2458
|
detail: C,
|
|
2440
|
-
onNavigate: (e, t) => void
|
|
2459
|
+
onNavigate: (e, t) => void W(e, t),
|
|
2441
2460
|
onClose: () => w(void 0)
|
|
2442
2461
|
})
|
|
2443
2462
|
]
|
|
@@ -2448,7 +2467,7 @@ function Z({ serviceUrl: n = "", token: i = "", applicationId: a, environment: o
|
|
|
2448
2467
|
}
|
|
2449
2468
|
//#endregion
|
|
2450
2469
|
//#region src/components/ReferenceExplorer.tsx
|
|
2451
|
-
function
|
|
2470
|
+
function se(e) {
|
|
2452
2471
|
let t = e.trim().replace(/^flow:\/\//, "").split("/").filter(Boolean);
|
|
2453
2472
|
return e.startsWith("flow://") ? t.length >= 3 ? {
|
|
2454
2473
|
collection: t[t.length - 2],
|
|
@@ -2458,9 +2477,9 @@ function ae(e) {
|
|
|
2458
2477
|
id: t[t.length - 1]
|
|
2459
2478
|
} : null;
|
|
2460
2479
|
}
|
|
2461
|
-
function
|
|
2480
|
+
function ce({ db: e, model: t, namespace: n = "default" }) {
|
|
2462
2481
|
let [r, i] = f(""), [a, o] = f(), [s, c] = f("Enter a reference to resolve live state."), l = async () => {
|
|
2463
|
-
let t =
|
|
2482
|
+
let t = se(r);
|
|
2464
2483
|
if (!t || !e) {
|
|
2465
2484
|
o(void 0), c(e ? "Use Collection/id or flow://namespace/Collection/id." : "Runtime unavailable.");
|
|
2466
2485
|
return;
|
|
@@ -2522,7 +2541,7 @@ function Q({ db: e, model: t, namespace: n = "default" }) {
|
|
|
2522
2541
|
}
|
|
2523
2542
|
//#endregion
|
|
2524
2543
|
//#region src/components/OperationsExplorer.tsx
|
|
2525
|
-
function
|
|
2544
|
+
function le({ db: e, namespace: t = "default" }) {
|
|
2526
2545
|
let [n, r] = f([]), [i, a] = f("all");
|
|
2527
2546
|
l(() => {
|
|
2528
2547
|
if (!e) return;
|
|
@@ -2546,7 +2565,7 @@ function oe({ db: e, namespace: t = "default" }) {
|
|
|
2546
2565
|
children: "Observe"
|
|
2547
2566
|
}),
|
|
2548
2567
|
/* @__PURE__ */ h("h1", { children: "Operations" }),
|
|
2549
|
-
/* @__PURE__ */ h("p", { children: "The runtime's durable local mutation log—not a simulated activity feed." })
|
|
2568
|
+
/* @__PURE__ */ h("p", { children: "The FeltDB runtime's durable local mutation log—not a simulated activity feed." })
|
|
2550
2569
|
] }),
|
|
2551
2570
|
/* @__PURE__ */ g("div", {
|
|
2552
2571
|
className: "model-summary",
|
|
@@ -2604,7 +2623,7 @@ function oe({ db: e, namespace: t = "default" }) {
|
|
|
2604
2623
|
}
|
|
2605
2624
|
//#endregion
|
|
2606
2625
|
//#region src/components/PeerMap.tsx
|
|
2607
|
-
function
|
|
2626
|
+
function ue({ peers: e = [], localInstance: t = "local" }) {
|
|
2608
2627
|
return /* @__PURE__ */ g("div", {
|
|
2609
2628
|
className: "studio-model-page",
|
|
2610
2629
|
children: [
|
|
@@ -2643,7 +2662,7 @@ function se({ peers: e = [], localInstance: t = "local" }) {
|
|
|
2643
2662
|
}
|
|
2644
2663
|
//#endregion
|
|
2645
2664
|
//#region src/components/ConflictExplorer.tsx
|
|
2646
|
-
function
|
|
2665
|
+
function Q({ db: e, diagnostics: t }) {
|
|
2647
2666
|
let n = (() => {
|
|
2648
2667
|
try {
|
|
2649
2668
|
return e?.sync();
|
|
@@ -2687,7 +2706,7 @@ function ce({ db: e, diagnostics: t }) {
|
|
|
2687
2706
|
}
|
|
2688
2707
|
//#endregion
|
|
2689
2708
|
//#region src/components/ProvenanceViewer.tsx
|
|
2690
|
-
function
|
|
2709
|
+
function $({ db: e, namespace: t = "default", reference: n }) {
|
|
2691
2710
|
let [r, i] = f(n ?? ""), [a, o] = f(null), [s, c] = f([]), [u, d] = f("Enter a Flow reference to trace it.");
|
|
2692
2711
|
l(() => {
|
|
2693
2712
|
n && i(n);
|
|
@@ -2759,10 +2778,10 @@ function le({ db: e, namespace: t = "default", reference: n }) {
|
|
|
2759
2778
|
}
|
|
2760
2779
|
//#endregion
|
|
2761
2780
|
//#region src/components/HealthCenter.tsx
|
|
2762
|
-
function
|
|
2781
|
+
function de({ diagnostics: e, model: t }) {
|
|
2763
2782
|
let n = e ? [
|
|
2764
2783
|
[
|
|
2765
|
-
"
|
|
2784
|
+
"FeltDB runtime",
|
|
2766
2785
|
e.runtime.status,
|
|
2767
2786
|
e.runtime.reactive ? "reactive" : "non-reactive"
|
|
2768
2787
|
],
|
|
@@ -2842,4 +2861,4 @@ function $({ diagnostics: e, model: t }) {
|
|
|
2842
2861
|
});
|
|
2843
2862
|
}
|
|
2844
2863
|
//#endregion
|
|
2845
|
-
export {
|
|
2864
|
+
export { T as C, D as E, E as S, k as T, F as _, le as a, j as b, ae as c, J as d, re as f, I as g, R as h, ue as i, Y as l, z as m, $ as n, ce as o, q as p, Q as r, Z as s, de as t, ie as u, N as v, ee as w, O as x, M as y };
|