@burdenoff/microfe-bigconsole 2026.1004.8 → 2026.1005.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.
@@ -0,0 +1,25 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ interface WorkflowOpenGuardProps {
4
+ /** The workflow KEY from the URL (`:id`). */
5
+ workflowKey: string;
6
+ /** The SDK builder — mounted only once the open is known to be read-only. */
7
+ children: ReactNode;
8
+ }
9
+ /**
10
+ * Mounts the SDK builder only when opening the key cannot create anything
11
+ * (BOFF-8060 F2). The SDK builder creates a definition for an unknown key on
12
+ * mount, so a link to a key that does not exist must never reach it.
13
+ *
14
+ * - explicit "new workflow" navigation -> builder (the person asked to create)
15
+ * - key exists -> builder
16
+ * - key does not exist -> not-found state, nothing is written
17
+ * - lookup failed -> retry state, nothing is written
18
+ *
19
+ * A key stays trusted once seen, so the SDK's own `navigate(../workflow/key/vN)`
20
+ * after a save (same key, new version) does not unmount an editor with unsaved
21
+ * work behind another lookup.
22
+ */
23
+ export declare const WorkflowOpenGuard: import('react').NamedExoticComponent<WorkflowOpenGuardProps>;
24
+ export {};
25
+ //# sourceMappingURL=WorkflowOpenGuard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkflowOpenGuard.d.ts","sourceRoot":"","sources":["../../../../src/bigconsole/components/workflow/WorkflowOpenGuard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AASlE,UAAU,sBAAsB;IAC9B,6CAA6C;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,8DAiG5B,CAAC"}
@@ -0,0 +1,89 @@
1
+ import { useAppNavigate as e } from "../../contexts/NavigationContext.js";
2
+ import "../../contexts/index.js";
3
+ import { decideWorkflowOpenView as t, isCreateIntent as n, toLookupClient as r, verifyWorkflowKey as i } from "../../workflowOpen.js";
4
+ import { memo as a, useEffect as o, useState as s } from "react";
5
+ import { useLocation as c } from "react-router";
6
+ import { Spinner as l } from "@burdenoff/fe-libs/ui";
7
+ import { useApolloClient as u } from "@apollo/client/react";
8
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
9
+ import { useI18n as m } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
10
+ //#region src/bigconsole/components/workflow/WorkflowOpenGuard.tsx
11
+ var h = a(function({ workflowKey: a, children: h }) {
12
+ let { t: g } = m(), _ = e(), v = u(), y = n(c().state), [b, x] = s(null), [S, C] = s(null), [w, T] = s(null), [E, D] = s(0);
13
+ o(() => {
14
+ if (!a) return;
15
+ if (y) {
16
+ x(a);
17
+ return;
18
+ }
19
+ if (b === a) return;
20
+ let e = !1;
21
+ return i(r(v), a).then((t) => {
22
+ e || (t === "found" ? x(a) : t === "absent" ? C(a) : T(a));
23
+ }), () => {
24
+ e = !0;
25
+ };
26
+ }, [
27
+ a,
28
+ y,
29
+ b,
30
+ v,
31
+ E
32
+ ]);
33
+ let O = t({
34
+ key: a,
35
+ createIntent: y,
36
+ verifiedKey: b,
37
+ absentKey: S,
38
+ failedKey: w
39
+ });
40
+ return O === "builder" ? /* @__PURE__ */ f(d, { children: h }) : O === "not-found" ? /* @__PURE__ */ p("div", {
41
+ className: "p-6 flex flex-col items-center justify-center min-h-[400px] text-center gap-4",
42
+ role: "alert",
43
+ children: [
44
+ /* @__PURE__ */ f("p", {
45
+ className: "text-base font-medium text-text-primary",
46
+ children: g("bigconsole.workflows.builder.notFoundTitle", "Workflow not found")
47
+ }),
48
+ /* @__PURE__ */ f("p", {
49
+ className: "text-sm text-text-secondary",
50
+ children: g("bigconsole.workflows.builder.notFoundDescription", "No workflow with this key exists in this workspace. Nothing was created.")
51
+ }),
52
+ /* @__PURE__ */ f("button", {
53
+ type: "button",
54
+ onClick: () => _("/workflows"),
55
+ className: "px-4 py-2 text-sm font-medium text-text-primary bg-bg-sunken hover:bg-border-default rounded-md transition-colors",
56
+ children: g("bigconsole.workflows.view.backToWorkflows", "Back to Workflows")
57
+ })
58
+ ]
59
+ }) : O === "failed" ? /* @__PURE__ */ p("div", {
60
+ className: "p-6 flex flex-col items-center justify-center min-h-[400px] text-center gap-4",
61
+ role: "alert",
62
+ children: [/* @__PURE__ */ f("p", {
63
+ className: "text-sm text-text-secondary",
64
+ children: g("bigconsole.workflows.builder.loadFailed", "Couldn't load this workflow. Please try again.")
65
+ }), /* @__PURE__ */ p("div", {
66
+ className: "flex items-center gap-2",
67
+ children: [/* @__PURE__ */ f("button", {
68
+ type: "button",
69
+ onClick: () => {
70
+ T(null), D((e) => e + 1);
71
+ },
72
+ className: "px-4 py-2 text-sm font-medium text-action-primary-fg bg-action-primary-bg hover:bg-action-primary-bgHover rounded-md transition-colors",
73
+ children: g("bigconsole.workflows.actions.tryAgain", "Try Again")
74
+ }), /* @__PURE__ */ f("button", {
75
+ type: "button",
76
+ onClick: () => _("/workflows"),
77
+ className: "px-4 py-2 text-sm font-medium text-text-primary bg-bg-sunken hover:bg-border-default rounded-md transition-colors",
78
+ children: g("bigconsole.workflows.view.backToWorkflows", "Back to Workflows")
79
+ })]
80
+ })]
81
+ }) : /* @__PURE__ */ f("div", {
82
+ className: "flex items-center justify-center min-h-[400px]",
83
+ children: /* @__PURE__ */ f(l, { className: "h-8 w-8" })
84
+ });
85
+ });
86
+ //#endregion
87
+ export { h as WorkflowOpenGuard };
88
+
89
+ //# sourceMappingURL=WorkflowOpenGuard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkflowOpenGuard.js","names":[],"sources":["../../../../src/bigconsole/components/workflow/WorkflowOpenGuard.tsx"],"sourcesContent":["import { memo, useEffect, useState, type ReactNode } from 'react';\nimport { useLocation } from 'react-router';\nimport { Spinner } from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useApolloClient } from '@apollo/client/react';\n\nimport { useAppNavigate } from '../../contexts';\nimport { decideWorkflowOpenView, isCreateIntent, toLookupClient, verifyWorkflowKey } from '../../workflowOpen';\n\ninterface WorkflowOpenGuardProps {\n /** The workflow KEY from the URL (`:id`). */\n workflowKey: string;\n /** The SDK builder — mounted only once the open is known to be read-only. */\n children: ReactNode;\n}\n\n/**\n * Mounts the SDK builder only when opening the key cannot create anything\n * (BOFF-8060 F2). The SDK builder creates a definition for an unknown key on\n * mount, so a link to a key that does not exist must never reach it.\n *\n * - explicit \"new workflow\" navigation -> builder (the person asked to create)\n * - key exists -> builder\n * - key does not exist -> not-found state, nothing is written\n * - lookup failed -> retry state, nothing is written\n *\n * A key stays trusted once seen, so the SDK's own `navigate(../workflow/key/vN)`\n * after a save (same key, new version) does not unmount an editor with unsaved\n * work behind another lookup.\n */\nexport const WorkflowOpenGuard = memo(function WorkflowOpenGuard({ workflowKey, children }: WorkflowOpenGuardProps) {\n const { t } = useI18n();\n const navigate = useAppNavigate();\n const client = useApolloClient();\n const location = useLocation();\n const createIntent = isCreateIntent(location.state);\n\n // Each verdict is keyed by the key it describes so navigating between\n // workflows never reuses a stale answer.\n const [verifiedKey, setVerifiedKey] = useState<string | null>(null);\n const [absentKey, setAbsentKey] = useState<string | null>(null);\n const [failedKey, setFailedKey] = useState<string | null>(null);\n // Bumped by \"Try again\" to re-run the lookup after a failure.\n const [retryNonce, setRetryNonce] = useState(0);\n\n useEffect(() => {\n if (!workflowKey) return;\n if (createIntent) {\n // The person pressed \"New workflow\": trust this key from here on.\n setVerifiedKey(workflowKey);\n return;\n }\n if (verifiedKey === workflowKey) return;\n\n let cancelled = false;\n verifyWorkflowKey(toLookupClient(client), workflowKey).then((verdict) => {\n if (cancelled) return;\n if (verdict === 'found') setVerifiedKey(workflowKey);\n else if (verdict === 'absent') setAbsentKey(workflowKey);\n else setFailedKey(workflowKey);\n });\n return () => {\n cancelled = true;\n };\n }, [workflowKey, createIntent, verifiedKey, client, retryNonce]);\n\n const view = decideWorkflowOpenView({ key: workflowKey, createIntent, verifiedKey, absentKey, failedKey });\n\n if (view === 'builder') return <>{children}</>;\n\n if (view === 'not-found') {\n return (\n <div className=\"p-6 flex flex-col items-center justify-center min-h-[400px] text-center gap-4\" role=\"alert\">\n <p className=\"text-base font-medium text-text-primary\">\n {t('bigconsole.workflows.builder.notFoundTitle', 'Workflow not found')}\n </p>\n <p className=\"text-sm text-text-secondary\">\n {t(\n 'bigconsole.workflows.builder.notFoundDescription',\n 'No workflow with this key exists in this workspace. Nothing was created.'\n )}\n </p>\n <button\n type=\"button\"\n onClick={() => navigate('/workflows')}\n className=\"px-4 py-2 text-sm font-medium text-text-primary bg-bg-sunken hover:bg-border-default rounded-md transition-colors\"\n >\n {t('bigconsole.workflows.view.backToWorkflows', 'Back to Workflows')}\n </button>\n </div>\n );\n }\n\n if (view === 'failed') {\n return (\n <div className=\"p-6 flex flex-col items-center justify-center min-h-[400px] text-center gap-4\" role=\"alert\">\n <p className=\"text-sm text-text-secondary\">\n {t('bigconsole.workflows.builder.loadFailed', \"Couldn't load this workflow. Please try again.\")}\n </p>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => {\n setFailedKey(null);\n setRetryNonce((n) => n + 1);\n }}\n className=\"px-4 py-2 text-sm font-medium text-action-primary-fg bg-action-primary-bg hover:bg-action-primary-bgHover rounded-md transition-colors\"\n >\n {t('bigconsole.workflows.actions.tryAgain', 'Try Again')}\n </button>\n <button\n type=\"button\"\n onClick={() => navigate('/workflows')}\n className=\"px-4 py-2 text-sm font-medium text-text-primary bg-bg-sunken hover:bg-border-default rounded-md transition-colors\"\n >\n {t('bigconsole.workflows.view.backToWorkflows', 'Back to Workflows')}\n </button>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"flex items-center justify-center min-h-[400px]\">\n <Spinner className=\"h-8 w-8\" />\n </div>\n );\n});\n"],"mappings":";;;;;;;;;;AA8BA,IAAa,IAAoB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AAD;GAAK,WAAU;aAAf,CACE,kBAAC,UAAD;IACE,MAAK;IACL,eAAe;AAEb,KADA,EAAa,KAAK,EAClB,GAAe,MAAM,IAAI,EAAE;;IAE7B,WAAU;cAET,EAAE,yCAAyC,YAAY;IACjD,CAAA,EACT,kBAAC,UAAD;IACE,MAAK;IACL,eAAe,EAAS,aAAa;IACrC,WAAU;cAET,EAAE,6CAA6C,oBAAoB;IAC7D,CAAA,CACL;KACF;MAKR,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAS,WAAU,WAAY,CAAA;EAC3B,CAAA;EAER"}
@@ -1 +1 @@
1
- {"version":3,"file":"DataSinkViewPage.d.ts","sourceRoot":"","sources":["../../../src/bigconsole/pages/DataSinkViewPage.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAiEH,eAAO,MAAM,gBAAgB,8CAgnB3B,CAAC;AAEH,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"DataSinkViewPage.d.ts","sourceRoot":"","sources":["../../../src/bigconsole/pages/DataSinkViewPage.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAkEH,eAAO,MAAM,gBAAgB,8CAgnB3B,CAAC;AAEH,eAAe,gBAAgB,CAAC"}