@burdenoff/microfe-cosmicintersection 2026.1108.1 → 2026.1109.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.
Files changed (90) hide show
  1. package/dist/cosmicintersection/api/cosmicApi.d.ts +14 -0
  2. package/dist/cosmicintersection/api/cosmicApi.d.ts.map +1 -1
  3. package/dist/cosmicintersection/api/cosmicApi.js +71 -56
  4. package/dist/cosmicintersection/api/cosmicApi.js.map +1 -1
  5. package/dist/cosmicintersection/api/databricksTransport.d.ts +13 -0
  6. package/dist/cosmicintersection/api/databricksTransport.d.ts.map +1 -0
  7. package/dist/cosmicintersection/api/databricksTransport.js +38 -0
  8. package/dist/cosmicintersection/api/databricksTransport.js.map +1 -0
  9. package/dist/cosmicintersection/components/ActionMenu.js +17 -17
  10. package/dist/cosmicintersection/components/DatabricksQueueForm.d.ts +13 -0
  11. package/dist/cosmicintersection/components/DatabricksQueueForm.d.ts.map +1 -0
  12. package/dist/cosmicintersection/components/DatabricksQueueForm.js +221 -0
  13. package/dist/cosmicintersection/components/DatabricksQueueForm.js.map +1 -0
  14. package/dist/cosmicintersection/components/DatabricksRunPanel.d.ts +6 -0
  15. package/dist/cosmicintersection/components/DatabricksRunPanel.d.ts.map +1 -0
  16. package/dist/cosmicintersection/components/DatabricksRunPanel.js +206 -0
  17. package/dist/cosmicintersection/components/DatabricksRunPanel.js.map +1 -0
  18. package/dist/cosmicintersection/components/EntityFormShell.js +7 -7
  19. package/dist/cosmicintersection/components/EntityTagsField.js +8 -8
  20. package/dist/cosmicintersection/components/ErrorState.js +4 -4
  21. package/dist/cosmicintersection/components/FileUploadField.js +8 -8
  22. package/dist/cosmicintersection/components/Pagination.js +6 -6
  23. package/dist/cosmicintersection/components/ReleaseDraftDialog.js +17 -17
  24. package/dist/cosmicintersection/components/RunTriageCard.js +12 -12
  25. package/dist/cosmicintersection/components/SchemaProposalPanel.js +35 -35
  26. package/dist/cosmicintersection/components/SchemaProposalPanel.js.map +1 -1
  27. package/dist/cosmicintersection/components/WorkspaceTagsPicker.js +12 -12
  28. package/dist/cosmicintersection/components/index.js +7 -7
  29. package/dist/cosmicintersection/context/CosmicIntersectionContext.d.ts +2 -0
  30. package/dist/cosmicintersection/context/CosmicIntersectionContext.d.ts.map +1 -1
  31. package/dist/cosmicintersection/context/CosmicIntersectionContext.js +17 -13
  32. package/dist/cosmicintersection/context/CosmicIntersectionContext.js.map +1 -1
  33. package/dist/cosmicintersection/hooks/useDatabricksExecutions.d.ts +69 -0
  34. package/dist/cosmicintersection/hooks/useDatabricksExecutions.d.ts.map +1 -0
  35. package/dist/cosmicintersection/hooks/useDatabricksExecutions.js +89 -0
  36. package/dist/cosmicintersection/hooks/useDatabricksExecutions.js.map +1 -0
  37. package/dist/cosmicintersection/hooks/useDatabricksQueueForm.d.ts +59 -0
  38. package/dist/cosmicintersection/hooks/useDatabricksQueueForm.d.ts.map +1 -0
  39. package/dist/cosmicintersection/hooks/useDatabricksQueueForm.js +158 -0
  40. package/dist/cosmicintersection/hooks/useDatabricksQueueForm.js.map +1 -0
  41. package/dist/cosmicintersection/lib/databricksForm.d.ts +4 -0
  42. package/dist/cosmicintersection/lib/databricksForm.d.ts.map +1 -0
  43. package/dist/cosmicintersection/lib/databricksForm.js +31 -0
  44. package/dist/cosmicintersection/lib/databricksForm.js.map +1 -0
  45. package/dist/cosmicintersection/lib/databricksIntent.d.ts +19 -0
  46. package/dist/cosmicintersection/lib/databricksIntent.d.ts.map +1 -0
  47. package/dist/cosmicintersection/lib/databricksIntent.js +60 -0
  48. package/dist/cosmicintersection/lib/databricksIntent.js.map +1 -0
  49. package/dist/cosmicintersection/lib/databricksPresentation.d.ts +5 -0
  50. package/dist/cosmicintersection/lib/databricksPresentation.d.ts.map +1 -0
  51. package/dist/cosmicintersection/lib/databricksPresentation.js +27 -0
  52. package/dist/cosmicintersection/lib/databricksPresentation.js.map +1 -0
  53. package/dist/cosmicintersection/pages/access/AccessPage.js +62 -62
  54. package/dist/cosmicintersection/pages/access/AccessPage.js.map +1 -1
  55. package/dist/cosmicintersection/pages/analyses/AnalysesPage.js +107 -107
  56. package/dist/cosmicintersection/pages/analyses/AnalysesPage.js.map +1 -1
  57. package/dist/cosmicintersection/pages/collections/CollectionDetailPage.js +24 -24
  58. package/dist/cosmicintersection/pages/collections/CollectionsPage.js +12 -12
  59. package/dist/cosmicintersection/pages/dashboard/DashboardPage.js +18 -18
  60. package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js +91 -91
  61. package/dist/cosmicintersection/pages/datasets/DatasetsPage.js +209 -209
  62. package/dist/cosmicintersection/pages/datasets/DatasetsPage.js.map +1 -1
  63. package/dist/cosmicintersection/pages/discovery/DiscoveryPage.js +98 -98
  64. package/dist/cosmicintersection/pages/discovery/DiscoveryPage.js.map +1 -1
  65. package/dist/cosmicintersection/pages/lineage/LineagePage.js +15 -15
  66. package/dist/cosmicintersection/pages/notebooks/NotebookDetailPage.js +139 -139
  67. package/dist/cosmicintersection/pages/notebooks/NotebookDetailPage.js.map +1 -1
  68. package/dist/cosmicintersection/pages/notebooks/NotebooksPage.js +34 -34
  69. package/dist/cosmicintersection/pages/pipelines/PipelineDetailPage.js +39 -39
  70. package/dist/cosmicintersection/pages/pipelines/PipelineDetailPage.js.map +1 -1
  71. package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.js +107 -107
  72. package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.js.map +1 -1
  73. package/dist/cosmicintersection/pages/pipelines/PipelinesPage.js +32 -32
  74. package/dist/cosmicintersection/pages/releases/ReleasesPage.d.ts.map +1 -1
  75. package/dist/cosmicintersection/pages/releases/ReleasesPage.js +193 -161
  76. package/dist/cosmicintersection/pages/releases/ReleasesPage.js.map +1 -1
  77. package/dist/cosmicintersection/pages/runs/RunDetailPage.d.ts.map +1 -1
  78. package/dist/cosmicintersection/pages/runs/RunDetailPage.js +250 -213
  79. package/dist/cosmicintersection/pages/runs/RunDetailPage.js.map +1 -1
  80. package/dist/cosmicintersection/pages/runs/RunsPage.js +31 -31
  81. package/dist/cosmicintersection/pages/sources/SourceDetailPage.js +41 -41
  82. package/dist/cosmicintersection/pages/sources/SourcesPage.js +122 -122
  83. package/dist/cosmicintersection/pages/sources/SourcesPage.js.map +1 -1
  84. package/dist/generated/wspace-operations.d.ts +243 -0
  85. package/dist/generated/wspace-operations.d.ts.map +1 -0
  86. package/dist/generated/wspace-operations.js +1472 -0
  87. package/dist/generated/wspace-operations.js.map +1 -0
  88. package/dist/generated/wspace-types.d.ts +183281 -30204
  89. package/dist/generated/wspace-types.d.ts.map +1 -1
  90. package/package.json +10 -7
@@ -1,8 +1,8 @@
1
1
  import { cleanTagLabel as e, findTagByLabel as t, normalizeTagLabel as n, suggestWorkspaceTags as r, useWorkspaceTags as i } from "../api/tagsApi.js";
2
2
  import { useId as a, useMemo as o, useState as s } from "react";
3
3
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
4
- import { Plus as u, Tag as d, X as f } from "lucide-react";
5
- import { Badge as p, Button as m, Input as h } from "@burdenoff/fe-libs/ui";
4
+ import { Badge as u, Button as d, Input as f } from "@burdenoff/fe-libs/ui";
5
+ import { Plus as p, Tag as m, X as h } from "lucide-react";
6
6
  //#region src/cosmicintersection/components/WorkspaceTagsPicker.tsx
7
7
  function g({ value: g, onChange: _, label: v = "Tags", placeholder: y = "Search workspace tags or add a new one", disabled: b = !1, className: x, suggestionLimit: S = 8 }) {
8
8
  let [C, w] = s(""), T = a(), { data: E, loading: D, error: O } = i(b), k = o(() => E?.availableCosTags ?? [], [E]), A = o(() => r(k, g, C, S), [
@@ -24,7 +24,7 @@ function g({ value: g, onChange: _, label: v = "Tags", placeholder: y = "Search
24
24
  children: [
25
25
  /* @__PURE__ */ l("div", {
26
26
  className: "flex items-center gap-2 text-sm font-medium text-text-primary",
27
- children: [/* @__PURE__ */ c(d, {
27
+ children: [/* @__PURE__ */ c(m, {
28
28
  className: "size-4 text-text-secondary",
29
29
  "aria-hidden": "true"
30
30
  }), /* @__PURE__ */ c("span", { children: v })]
@@ -36,7 +36,7 @@ function g({ value: g, onChange: _, label: v = "Tags", placeholder: y = "Search
36
36
  children: g.length === 0 ? /* @__PURE__ */ c("span", {
37
37
  className: "text-sm text-text-secondary",
38
38
  children: "No tags yet."
39
- }) : g.map((e) => /* @__PURE__ */ l(p, {
39
+ }) : g.map((e) => /* @__PURE__ */ l(u, {
40
40
  variant: "secondary",
41
41
  className: "gap-1.5",
42
42
  role: "listitem",
@@ -49,7 +49,7 @@ function g({ value: g, onChange: _, label: v = "Tags", placeholder: y = "Search
49
49
  disabled: b,
50
50
  "aria-label": `Remove ${e}`,
51
51
  className: "rounded-full text-text-secondary transition-colors hover:text-text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border-focus disabled:opacity-50",
52
- children: /* @__PURE__ */ c(f, {
52
+ children: /* @__PURE__ */ c(h, {
53
53
  className: "size-3",
54
54
  "aria-hidden": "true"
55
55
  })
@@ -58,7 +58,7 @@ function g({ value: g, onChange: _, label: v = "Tags", placeholder: y = "Search
58
58
  }),
59
59
  /* @__PURE__ */ l("div", {
60
60
  className: "flex items-center gap-2",
61
- children: [/* @__PURE__ */ c(h, {
61
+ children: [/* @__PURE__ */ c(f, {
62
62
  value: C,
63
63
  onChange: (e) => w(e.target.value),
64
64
  placeholder: y,
@@ -70,13 +70,13 @@ function g({ value: g, onChange: _, label: v = "Tags", placeholder: y = "Search
70
70
  onKeyDown: (e) => {
71
71
  e.key === "Enter" && (e.preventDefault(), L());
72
72
  }
73
- }), /* @__PURE__ */ l(m, {
73
+ }), /* @__PURE__ */ l(d, {
74
74
  type: "button",
75
75
  variant: "outline",
76
76
  size: "sm",
77
77
  onClick: L,
78
78
  disabled: b || !j,
79
- children: [/* @__PURE__ */ c(u, { className: "size-4" }), "Add"]
79
+ children: [/* @__PURE__ */ c(p, { className: "size-4" }), "Add"]
80
80
  })]
81
81
  }),
82
82
  b ? null : /* @__PURE__ */ l("div", {
@@ -89,19 +89,19 @@ function g({ value: g, onChange: _, label: v = "Tags", placeholder: y = "Search
89
89
  className: "text-xs text-text-secondary",
90
90
  children: j ? "Matching tags:" : "Workspace tags:"
91
91
  }) : null,
92
- A.map((e) => /* @__PURE__ */ l(m, {
92
+ A.map((e) => /* @__PURE__ */ l(d, {
93
93
  type: "button",
94
94
  variant: "ghost",
95
95
  size: "sm",
96
96
  className: "h-7 px-2 text-xs",
97
97
  onClick: () => I(e.label),
98
98
  "aria-label": `Add workspace tag ${e.label}`,
99
- children: [/* @__PURE__ */ c(d, {
99
+ children: [/* @__PURE__ */ c(m, {
100
100
  className: "size-3",
101
101
  "aria-hidden": "true"
102
102
  }), e.label]
103
103
  }, e.id)),
104
- F ? /* @__PURE__ */ l(m, {
104
+ F ? /* @__PURE__ */ l(d, {
105
105
  type: "button",
106
106
  variant: "ghost",
107
107
  size: "sm",
@@ -109,7 +109,7 @@ function g({ value: g, onChange: _, label: v = "Tags", placeholder: y = "Search
109
109
  onClick: () => I(j),
110
110
  "aria-label": `Create tag ${j}`,
111
111
  children: [
112
- /* @__PURE__ */ c(u, {
112
+ /* @__PURE__ */ c(p, {
113
113
  className: "size-3",
114
114
  "aria-hidden": "true"
115
115
  }),
@@ -1,10 +1,10 @@
1
- import { ActionMenu as e } from "./ActionMenu.js";
1
+ import { SafeLink as e } from "./SafeLink.js";
2
+ import { ActionMenu as t } from "./ActionMenu.js";
2
3
  import "./AiRunAttribution.js";
3
- import { EmptyState as t } from "./EmptyState.js";
4
- import { ErrorState as n } from "./ErrorState.js";
5
- import { LoadingState as r } from "./LoadingState.js";
6
- import { ActivityFeedPanel as i } from "./ActivityFeedPanel.js";
7
- import { SafeLink as a } from "./SafeLink.js";
4
+ import { EmptyState as n } from "./EmptyState.js";
5
+ import { ErrorState as r } from "./ErrorState.js";
6
+ import { LoadingState as i } from "./LoadingState.js";
7
+ import { ActivityFeedPanel as a } from "./ActivityFeedPanel.js";
8
8
  import { DiscussionPanel as o } from "./DiscussionPanel.js";
9
9
  import { EntityFormShell as s } from "./EntityFormShell.js";
10
10
  import { EntityTagsField as c } from "./EntityTagsField.js";
@@ -18,4 +18,4 @@ import { StatusBadge as h, formatEnumLabel as g } from "./StatusBadge.js";
18
18
  import { ReleaseDraftDialog as _ } from "./ReleaseDraftDialog.js";
19
19
  import { RunTriageCard as v } from "./RunTriageCard.js";
20
20
  import { SchemaProposalPanel as y } from "./SchemaProposalPanel.js";
21
- export { e as ActionMenu, i as ActivityFeedPanel, o as DiscussionPanel, t as EmptyState, s as EntityFormShell, c as EntityTagsField, n as ErrorState, u as FileUploadField, r as LoadingState, f as PageLayout, p as Pagination, _ as ReleaseDraftDialog, v as RunTriageCard, a as SafeLink, y as SchemaProposalPanel, h as StatusBadge, l as WorkspaceTagsPicker, g as formatEnumLabel, d as useFileDownloadUrl, m as usePagination };
21
+ export { t as ActionMenu, a as ActivityFeedPanel, o as DiscussionPanel, n as EmptyState, s as EntityFormShell, c as EntityTagsField, r as ErrorState, u as FileUploadField, i as LoadingState, f as PageLayout, p as Pagination, _ as ReleaseDraftDialog, v as RunTriageCard, e as SafeLink, y as SchemaProposalPanel, h as StatusBadge, l as WorkspaceTagsPicker, g as formatEnumLabel, d as useFileDownloadUrl, m as usePagination };
@@ -6,6 +6,8 @@ interface CosmicIntersectionContextValue {
6
6
  currentUser: CosmicIntersectionRootProps['currentUser'];
7
7
  workspaceId?: string;
8
8
  tenantId?: string;
9
+ organizationId?: string;
10
+ projectId?: string;
9
11
  apiGatewayUrl: string;
10
12
  authToken: string;
11
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CosmicIntersectionContext.d.ts","sourceRoot":"","sources":["../../../src/cosmicintersection/context/CosmicIntersectionContext.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAmD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACxF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAE5D,UAAU,8BAA8B;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,WAAW,EAAE,2BAA2B,CAAC,aAAa,CAAC,CAAC;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB;AAID,UAAU,+BAA+B;IACvC,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,2BAA2B,CAAC;CACpC;AAED,wBAAgB,0BAA0B,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,+BAA+B,+BAmD9F;AAED,wBAAgB,qBAAqB,mCAMpC;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,WAjF1B,MAAM,KAAK,IAAI,CAiGjC"}
1
+ {"version":3,"file":"CosmicIntersectionContext.d.ts","sourceRoot":"","sources":["../../../src/cosmicintersection/context/CosmicIntersectionContext.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAmD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACxF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAE5D,UAAU,8BAA8B;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,WAAW,EAAE,2BAA2B,CAAC,aAAa,CAAC,CAAC;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB;AAID,UAAU,+BAA+B;IACvC,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,2BAA2B,CAAC;CACpC;AAED,wBAAgB,0BAA0B,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,+BAA+B,+BAiE9F;AAED,wBAAgB,qBAAqB,mCAMpC;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,WAjG1B,MAAM,KAAK,IAAI,CAiHjC"}
@@ -3,36 +3,40 @@ import { jsx as i } from "react/jsx-runtime";
3
3
  //#region src/cosmicintersection/context/CosmicIntersectionContext.tsx
4
4
  var a = e(null);
5
5
  function o({ children: e, props: n }) {
6
- let { basePath: o = "", navigate: s, currentUser: c, workspaceId: l, tenantId: u, apiGatewayUrl: d, authToken: f } = n, p = o.endsWith("/") ? o.slice(0, -1) : o, m = t((e) => {
7
- if (!p || p === "/") {
6
+ let { basePath: o = "", navigate: s, currentUser: c, workspaceId: l, tenantId: u, organizationId: d, projectId: f, apiGatewayUrl: p, authToken: m } = n, h = o.endsWith("/") ? o.slice(0, -1) : o, g = t((e) => {
7
+ if (!h || h === "/") {
8
8
  s(e);
9
9
  return;
10
10
  }
11
- if (e.startsWith(p)) {
11
+ if (e.startsWith(h)) {
12
12
  s(e);
13
13
  return;
14
14
  }
15
- let t = e.startsWith("/") ? `${p}${e}` : `${p}/${e}`;
15
+ let t = e.startsWith("/") ? `${h}${e}` : `${h}/${e}`;
16
16
  s(t);
17
- }, [p, s]), h = r(() => ({
18
- basePath: p,
19
- navigate: m,
17
+ }, [h, s]), _ = r(() => ({
18
+ basePath: h,
19
+ navigate: g,
20
20
  currentUser: c,
21
21
  workspaceId: l,
22
22
  tenantId: u,
23
- apiGatewayUrl: d || "",
24
- authToken: f || ""
23
+ organizationId: d,
24
+ projectId: f,
25
+ apiGatewayUrl: p || "",
26
+ authToken: m || ""
25
27
  }), [
26
- p,
27
- m,
28
+ h,
29
+ g,
28
30
  c,
29
31
  l,
30
32
  u,
31
33
  d,
32
- f
34
+ f,
35
+ p,
36
+ m
33
37
  ]);
34
38
  return /* @__PURE__ */ i(a.Provider, {
35
- value: h,
39
+ value: _,
36
40
  children: e
37
41
  });
38
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CosmicIntersectionContext.js","names":[],"sources":["../../../src/cosmicintersection/context/CosmicIntersectionContext.tsx"],"sourcesContent":["/**\n * CosmicIntersectionContext\n *\n * Provides basePath-aware navigation and shared props throughout the\n * CosmicIntersection microfrontend. Uses the `navigate` function injected by the\n * host app shell — no react-router hooks are needed here, so the same tree works\n * whether the shell drives routing or the local dev harness does.\n */\n\nimport { createContext, useCallback, useContext, useMemo, type ReactNode } from 'react';\nimport type { CosmicIntersectionRootProps } from '../types';\n\ninterface CosmicIntersectionContextValue {\n basePath: string;\n navigate: (path: string) => void;\n currentUser: CosmicIntersectionRootProps['currentUser'];\n workspaceId?: string;\n tenantId?: string;\n apiGatewayUrl: string;\n authToken: string;\n}\n\nconst CosmicIntersectionContext = createContext<CosmicIntersectionContextValue | null>(null);\n\ninterface CosmicIntersectionProviderProps {\n children: ReactNode;\n props: CosmicIntersectionRootProps;\n}\n\nexport function CosmicIntersectionProvider({ children, props }: CosmicIntersectionProviderProps) {\n const {\n basePath = '',\n navigate: hostNavigate,\n currentUser,\n workspaceId,\n tenantId,\n apiGatewayUrl,\n authToken,\n } = props;\n\n // Normalize basePath (strip trailing slash) so joins never produce `//`.\n const normalizedBasePath = basePath.endsWith('/') ? basePath.slice(0, -1) : basePath;\n\n // basePath-aware navigation built on the host's navigate function.\n const navigate = useCallback(\n (path: string) => {\n if (!normalizedBasePath || normalizedBasePath === '/') {\n hostNavigate(path);\n return;\n }\n if (path.startsWith(normalizedBasePath)) {\n hostNavigate(path);\n return;\n }\n const fullPath = path.startsWith('/')\n ? `${normalizedBasePath}${path}`\n : `${normalizedBasePath}/${path}`;\n hostNavigate(fullPath);\n },\n [normalizedBasePath, hostNavigate]\n );\n\n const value = useMemo(\n () => ({\n basePath: normalizedBasePath,\n navigate,\n currentUser,\n workspaceId,\n tenantId,\n apiGatewayUrl: apiGatewayUrl || '',\n authToken: authToken || '',\n }),\n [normalizedBasePath, navigate, currentUser, workspaceId, tenantId, apiGatewayUrl, authToken]\n );\n\n return (\n <CosmicIntersectionContext.Provider value={value}>\n {children}\n </CosmicIntersectionContext.Provider>\n );\n}\n\nexport function useCosmicIntersection() {\n const context = useContext(CosmicIntersectionContext);\n if (!context) {\n throw new Error('useCosmicIntersection must be used within a CosmicIntersectionProvider');\n }\n return context;\n}\n\n/**\n * Hook for basePath-aware navigation. Returns a navigate function that\n * automatically prepends the microfrontend basePath. Falls back to a\n * `window.location`-based navigate if used outside the provider.\n */\nexport function useCosmicIntersectionNavigate() {\n const context = useContext(CosmicIntersectionContext);\n\n const fallbackNavigate = useCallback((path: string) => {\n const currentPath = window.location.pathname;\n const mfeMatch = currentPath.match(/^(\\/cosmicintersection)/);\n const basePath = mfeMatch ? mfeMatch[1] : '';\n\n let fullPath = path;\n if (basePath && !path.startsWith(basePath)) {\n fullPath = path.startsWith('/') ? `${basePath}${path}` : `${basePath}/${path}`;\n }\n window.location.href = fullPath;\n }, []);\n\n return context?.navigate ?? fallbackNavigate;\n}\n"],"mappings":";;;AAsBA,IAAM,IAA4B,EAAqD,IAAI;AAO3F,SAAgB,EAA2B,EAAE,aAAU,YAA0C;CAC/F,IAAM,EACJ,cAAW,IACX,UAAU,GACV,gBACA,gBACA,aACA,kBACA,iBACE,GAGE,IAAqB,EAAS,SAAS,GAAG,IAAI,EAAS,MAAM,GAAG,EAAE,IAAI,GAGtE,IAAW,GACd,MAAiB;EAChB,IAAI,CAAC,KAAsB,MAAuB,KAAK;GACrD,EAAa,CAAI;GACjB;EACF;EACA,IAAI,EAAK,WAAW,CAAkB,GAAG;GACvC,EAAa,CAAI;GACjB;EACF;EACA,IAAM,IAAW,EAAK,WAAW,GAAG,IAChC,GAAG,IAAqB,MACxB,GAAG,EAAmB,GAAG;EAC7B,EAAa,CAAQ;CACvB,GACA,CAAC,GAAoB,CAAY,CACnC,GAEM,IAAQ,SACL;EACL,UAAU;EACV;EACA;EACA;EACA;EACA,eAAe,KAAiB;EAChC,WAAW,KAAa;CAC1B,IACA;EAAC;EAAoB;EAAU;EAAa;EAAa;EAAU;EAAe;CAAS,CAC7F;CAEA,OACE,kBAAC,EAA0B,UAA3B;EAA2C;EACxC;CACiC,CAAA;AAExC;AAEA,SAAgB,IAAwB;CACtC,IAAM,IAAU,EAAW,CAAyB;CACpD,IAAI,CAAC,GACH,MAAU,MAAM,wEAAwE;CAE1F,OAAO;AACT"}
1
+ {"version":3,"file":"CosmicIntersectionContext.js","names":[],"sources":["../../../src/cosmicintersection/context/CosmicIntersectionContext.tsx"],"sourcesContent":["/**\n * CosmicIntersectionContext\n *\n * Provides basePath-aware navigation and shared props throughout the\n * CosmicIntersection microfrontend. Uses the `navigate` function injected by the\n * host app shell — no react-router hooks are needed here, so the same tree works\n * whether the shell drives routing or the local dev harness does.\n */\n\nimport { createContext, useCallback, useContext, useMemo, type ReactNode } from 'react';\nimport type { CosmicIntersectionRootProps } from '../types';\n\ninterface CosmicIntersectionContextValue {\n basePath: string;\n navigate: (path: string) => void;\n currentUser: CosmicIntersectionRootProps['currentUser'];\n workspaceId?: string;\n tenantId?: string;\n organizationId?: string;\n projectId?: string;\n apiGatewayUrl: string;\n authToken: string;\n}\n\nconst CosmicIntersectionContext = createContext<CosmicIntersectionContextValue | null>(null);\n\ninterface CosmicIntersectionProviderProps {\n children: ReactNode;\n props: CosmicIntersectionRootProps;\n}\n\nexport function CosmicIntersectionProvider({ children, props }: CosmicIntersectionProviderProps) {\n const {\n basePath = '',\n navigate: hostNavigate,\n currentUser,\n workspaceId,\n tenantId,\n organizationId,\n projectId,\n apiGatewayUrl,\n authToken,\n } = props;\n\n // Normalize basePath (strip trailing slash) so joins never produce `//`.\n const normalizedBasePath = basePath.endsWith('/') ? basePath.slice(0, -1) : basePath;\n\n // basePath-aware navigation built on the host's navigate function.\n const navigate = useCallback(\n (path: string) => {\n if (!normalizedBasePath || normalizedBasePath === '/') {\n hostNavigate(path);\n return;\n }\n if (path.startsWith(normalizedBasePath)) {\n hostNavigate(path);\n return;\n }\n const fullPath = path.startsWith('/')\n ? `${normalizedBasePath}${path}`\n : `${normalizedBasePath}/${path}`;\n hostNavigate(fullPath);\n },\n [normalizedBasePath, hostNavigate]\n );\n\n const value = useMemo(\n () => ({\n basePath: normalizedBasePath,\n navigate,\n currentUser,\n workspaceId,\n tenantId,\n organizationId,\n projectId,\n apiGatewayUrl: apiGatewayUrl || '',\n authToken: authToken || '',\n }),\n [\n normalizedBasePath,\n navigate,\n currentUser,\n workspaceId,\n tenantId,\n organizationId,\n projectId,\n apiGatewayUrl,\n authToken,\n ]\n );\n\n return (\n <CosmicIntersectionContext.Provider value={value}>\n {children}\n </CosmicIntersectionContext.Provider>\n );\n}\n\nexport function useCosmicIntersection() {\n const context = useContext(CosmicIntersectionContext);\n if (!context) {\n throw new Error('useCosmicIntersection must be used within a CosmicIntersectionProvider');\n }\n return context;\n}\n\n/**\n * Hook for basePath-aware navigation. Returns a navigate function that\n * automatically prepends the microfrontend basePath. Falls back to a\n * `window.location`-based navigate if used outside the provider.\n */\nexport function useCosmicIntersectionNavigate() {\n const context = useContext(CosmicIntersectionContext);\n\n const fallbackNavigate = useCallback((path: string) => {\n const currentPath = window.location.pathname;\n const mfeMatch = currentPath.match(/^(\\/cosmicintersection)/);\n const basePath = mfeMatch ? mfeMatch[1] : '';\n\n let fullPath = path;\n if (basePath && !path.startsWith(basePath)) {\n fullPath = path.startsWith('/') ? `${basePath}${path}` : `${basePath}/${path}`;\n }\n window.location.href = fullPath;\n }, []);\n\n return context?.navigate ?? fallbackNavigate;\n}\n"],"mappings":";;;AAwBA,IAAM,IAA4B,EAAqD,IAAI;AAO3F,SAAgB,EAA2B,EAAE,aAAU,YAA0C;CAC/F,IAAM,EACJ,cAAW,IACX,UAAU,GACV,gBACA,gBACA,aACA,mBACA,cACA,kBACA,iBACE,GAGE,IAAqB,EAAS,SAAS,GAAG,IAAI,EAAS,MAAM,GAAG,EAAE,IAAI,GAGtE,IAAW,GACd,MAAiB;EAChB,IAAI,CAAC,KAAsB,MAAuB,KAAK;GACrD,EAAa,CAAI;GACjB;EACF;EACA,IAAI,EAAK,WAAW,CAAkB,GAAG;GACvC,EAAa,CAAI;GACjB;EACF;EACA,IAAM,IAAW,EAAK,WAAW,GAAG,IAChC,GAAG,IAAqB,MACxB,GAAG,EAAmB,GAAG;EAC7B,EAAa,CAAQ;CACvB,GACA,CAAC,GAAoB,CAAY,CACnC,GAEM,IAAQ,SACL;EACL,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EACA,eAAe,KAAiB;EAChC,WAAW,KAAa;CAC1B,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,OACE,kBAAC,EAA0B,UAA3B;EAA2C;EACxC;CACiC,CAAA;AAExC;AAEA,SAAgB,IAAwB;CACtC,IAAM,IAAU,EAAW,CAAyB;CACpD,IAAI,CAAC,GACH,MAAU,MAAM,wEAAwE;CAE1F,OAAO;AACT"}
@@ -0,0 +1,69 @@
1
+ import { DocumentNode } from 'graphql';
2
+ import { CosDatabricksExecutionFieldsFragment } from '../../generated/wspace-operations';
3
+ import { DatabricksRequestScope } from '../api/databricksTransport';
4
+ type Execution = CosDatabricksExecutionFieldsFragment;
5
+ export declare function useDatabricksExecutions({ scope, runId, onRunChanged, }: {
6
+ scope: DatabricksRequestScope;
7
+ runId: string;
8
+ onRunChanged(): Promise<void>;
9
+ }): {
10
+ items: {
11
+ id: string;
12
+ runId: string;
13
+ stepId: string;
14
+ requestId: string;
15
+ jobId: string;
16
+ externalRunId: string | null;
17
+ state: import('../../generated/wspace-types').CosExternalComputeState;
18
+ lifecycle: string | null;
19
+ result: string | null;
20
+ errorCode: string | null;
21
+ cancelRequested: boolean;
22
+ deadlineAt: string;
23
+ createdAt: string;
24
+ updatedAt: string;
25
+ finishedAt: string | null;
26
+ logsUrl: string | null;
27
+ inputDatasetIds: Array<string>;
28
+ outputDatasetIds: Array<string>;
29
+ }[];
30
+ hasMore: boolean;
31
+ loading: boolean;
32
+ executions: import('@tanstack/react-query').UseQueryResult<{
33
+ intentRecoveryUnavailable: boolean;
34
+ items: Array<{
35
+ id: string;
36
+ runId: string;
37
+ stepId: string;
38
+ requestId: string;
39
+ jobId: string;
40
+ externalRunId: string | null;
41
+ state: import('../../generated/wspace-types').CosExternalComputeState;
42
+ lifecycle: string | null;
43
+ result: string | null;
44
+ errorCode: string | null;
45
+ cancelRequested: boolean;
46
+ deadlineAt: string;
47
+ createdAt: string;
48
+ updatedAt: string;
49
+ finishedAt: string | null;
50
+ logsUrl: string | null;
51
+ inputDatasetIds: Array<string>;
52
+ outputDatasetIds: Array<string>;
53
+ }>;
54
+ pageInfo: {
55
+ hasMore: boolean;
56
+ };
57
+ }, Error>;
58
+ error: string | null;
59
+ actionId: string | null;
60
+ offset: number;
61
+ setOffset: import('react').Dispatch<import('react').SetStateAction<number>>;
62
+ setError: import('react').Dispatch<import('react').SetStateAction<string | null>>;
63
+ refresh: () => Promise<void>;
64
+ act: (item: Execution, resume: boolean) => Promise<void>;
65
+ request: <T>(document: DocumentNode, variables: Record<string, unknown>) => Promise<T>;
66
+ intentKey: string;
67
+ };
68
+ export {};
69
+ //# sourceMappingURL=useDatabricksExecutions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDatabricksExecutions.d.ts","sourceRoot":"","sources":["../../../src/cosmicintersection/hooks/useDatabricksExecutions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C,OAAO,EAKL,KAAK,oCAAoC,EAG1C,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAG5F,KAAK,SAAS,GAAG,oCAAoC,CAAC;AAEtD,wBAAgB,uBAAuB,CAAC,EACtC,KAAK,EACL,KAAK,EACL,YAAY,GACb,EAAE;IACD,KAAK,EAAE,sBAAsB,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA6D0B,SAAS,UAAU,OAAO;cA7C1C,CAAC,YAAY,YAAY,aAAa,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;EAyFvE"}
@@ -0,0 +1,89 @@
1
+ import { databricksIntentKey as e } from "../lib/databricksPresentation.js";
2
+ import { CosCancelExternalComputeDocument as t, CosExternalComputeDocument as n, CosRetryExternalComputeDocument as r } from "../../generated/wspace-operations.js";
3
+ import { confirmDatabricksIntent as i } from "../lib/databricksIntent.js";
4
+ import { databricksRequest as a } from "../api/databricksTransport.js";
5
+ import { useCallback as o, useEffect as s, useRef as c, useState as l } from "react";
6
+ import { useQuery as u } from "@tanstack/react-query";
7
+ import { clearGraphqlFetchResponseCache as d } from "@burdenoff/fe-libs/shared/graphql";
8
+ //#region src/cosmicintersection/hooks/useDatabricksExecutions.ts
9
+ function f({ scope: f, runId: p, onRunChanged: m }) {
10
+ let h = c(/* @__PURE__ */ new Set()), [g, _] = l(0), [v, y] = l(null), [b, x] = l(null), S = e(f, p);
11
+ s(() => {
12
+ let e = h.current;
13
+ return () => {
14
+ for (let t of e) t.abort();
15
+ e.clear();
16
+ };
17
+ }, [f]);
18
+ let C = o(async (e, t) => {
19
+ let n = new AbortController();
20
+ h.current.add(n);
21
+ try {
22
+ return await a(f, e, t, n.signal);
23
+ } finally {
24
+ h.current.delete(n);
25
+ }
26
+ }, [f]), w = u({
27
+ queryKey: [
28
+ "cosmic-databricks-executions",
29
+ S,
30
+ g
31
+ ],
32
+ queryFn: async ({ signal: e }) => {
33
+ d();
34
+ let t = await a(f, n, {
35
+ runId: p,
36
+ pagination: {
37
+ limit: 10,
38
+ offset: g
39
+ }
40
+ }, e), r = !1;
41
+ try {
42
+ for (let e of t.cosListExternalCompute.items) i(window.sessionStorage, S, e);
43
+ } catch {
44
+ r = !0;
45
+ }
46
+ return {
47
+ ...t.cosListExternalCompute,
48
+ intentRecoveryUnavailable: r
49
+ };
50
+ }
51
+ }), T = w.data?.items ?? [], E = w.data?.pageInfo.hasMore ?? !1, D = w.isPending || w.isFetching, O = async () => {
52
+ await Promise.all([w.refetch({ throwOnError: !0 }), m()]);
53
+ };
54
+ return {
55
+ items: T,
56
+ hasMore: E,
57
+ loading: D,
58
+ executions: w,
59
+ error: b,
60
+ actionId: v,
61
+ offset: g,
62
+ setOffset: _,
63
+ setError: x,
64
+ refresh: O,
65
+ act: async (e, n) => {
66
+ y(e.id), x(null);
67
+ let i = !1;
68
+ try {
69
+ n ? await C(r, {
70
+ runId: p,
71
+ id: e.id
72
+ }) : await C(t, {
73
+ runId: p,
74
+ id: e.id
75
+ }), i = !0, await O();
76
+ } catch {
77
+ x(i ? "The action is confirmed, but its status read failed. Refresh status; do not repeat the action." : "The action was not confirmed. Refresh status before trying again.");
78
+ } finally {
79
+ y(null);
80
+ }
81
+ },
82
+ request: C,
83
+ intentKey: S
84
+ };
85
+ }
86
+ //#endregion
87
+ export { f as useDatabricksExecutions };
88
+
89
+ //# sourceMappingURL=useDatabricksExecutions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDatabricksExecutions.js","names":[],"sources":["../../../src/cosmicintersection/hooks/useDatabricksExecutions.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\nimport type { DocumentNode } from 'graphql';\nimport { useQuery } from '@tanstack/react-query';\nimport { clearGraphqlFetchResponseCache } from '@burdenoff/fe-libs/shared/graphql';\nimport {\n CosCancelExternalComputeDocument,\n CosExternalComputeDocument,\n CosRetryExternalComputeDocument,\n type CosCancelExternalComputeMutation,\n type CosDatabricksExecutionFieldsFragment,\n type CosExternalComputeQuery,\n type CosRetryExternalComputeMutation,\n} from '../../generated/wspace-operations';\nimport { databricksRequest, type DatabricksRequestScope } from '../api/databricksTransport';\nimport { confirmDatabricksIntent } from '../lib/databricksIntent';\nimport { databricksIntentKey } from '../lib/databricksPresentation';\ntype Execution = CosDatabricksExecutionFieldsFragment;\n\nexport function useDatabricksExecutions({\n scope,\n runId,\n onRunChanged,\n}: {\n scope: DatabricksRequestScope;\n runId: string;\n onRunChanged(): Promise<void>;\n}) {\n const controllers = useRef(new Set<AbortController>());\n const [offset, setOffset] = useState(0);\n const [actionId, setActionId] = useState<string | null>(null);\n const [error, setError] = useState<string | null>(null);\n const intentKey = databricksIntentKey(scope, runId);\n\n useEffect(() => {\n const active = controllers.current;\n return () => {\n for (const controller of active) controller.abort();\n active.clear();\n };\n }, [scope]);\n\n const request = useCallback(\n async <T>(document: DocumentNode, variables: Record<string, unknown>) => {\n const controller = new AbortController();\n controllers.current.add(controller);\n try {\n return await databricksRequest<T>(scope, document, variables, controller.signal);\n } finally {\n controllers.current.delete(controller);\n }\n },\n [scope]\n );\n\n const executions = useQuery({\n queryKey: ['cosmic-databricks-executions', intentKey, offset],\n queryFn: async ({ signal }) => {\n clearGraphqlFetchResponseCache();\n const result = await databricksRequest<CosExternalComputeQuery>(\n scope,\n CosExternalComputeDocument,\n {\n runId,\n pagination: { limit: 10, offset },\n },\n signal\n );\n // Identity validation or storage failure must not hide running compute.\n let intentRecoveryUnavailable = false;\n try {\n // Only an actual server record can resolve an ambiguous saved intent.\n for (const item of result.cosListExternalCompute.items) {\n confirmDatabricksIntent(window.sessionStorage, intentKey, item);\n }\n } catch {\n intentRecoveryUnavailable = true;\n }\n return { ...result.cosListExternalCompute, intentRecoveryUnavailable };\n },\n });\n const items = executions.data?.items ?? [];\n const hasMore = executions.data?.pageInfo.hasMore ?? false;\n const loading = executions.isPending || executions.isFetching;\n const refresh = async () => {\n await Promise.all([executions.refetch({ throwOnError: true }), onRunChanged()]);\n };\n\n const act = async (item: Execution, resume: boolean) => {\n setActionId(item.id);\n setError(null);\n let confirmed = false;\n try {\n if (resume) {\n await request<CosRetryExternalComputeMutation>(CosRetryExternalComputeDocument, {\n runId,\n id: item.id,\n });\n } else {\n await request<CosCancelExternalComputeMutation>(CosCancelExternalComputeDocument, {\n runId,\n id: item.id,\n });\n }\n confirmed = true;\n await refresh();\n } catch {\n setError(\n confirmed\n ? 'The action is confirmed, but its status read failed. Refresh status; do not repeat the action.'\n : 'The action was not confirmed. Refresh status before trying again.'\n );\n } finally {\n setActionId(null);\n }\n };\n\n return {\n items,\n hasMore,\n loading,\n executions,\n error,\n actionId,\n offset,\n setOffset,\n setError,\n refresh,\n act,\n request,\n intentKey,\n };\n}\n"],"mappings":";;;;;;;;AAkBA,SAAgB,EAAwB,EACtC,UACA,UACA,mBAKC;CACD,IAAM,IAAc,kBAAO,IAAI,IAAqB,CAAC,GAC/C,CAAC,GAAQ,KAAa,EAAS,CAAC,GAChC,CAAC,GAAU,KAAe,EAAwB,IAAI,GACtD,CAAC,GAAO,KAAY,EAAwB,IAAI,GAChD,IAAY,EAAoB,GAAO,CAAK;CAElD,QAAgB;EACd,IAAM,IAAS,EAAY;EAC3B,aAAa;GACX,KAAK,IAAM,KAAc,GAAQ,EAAW,MAAM;GAClD,EAAO,MAAM;EACf;CACF,GAAG,CAAC,CAAK,CAAC;CAEV,IAAM,IAAU,EACd,OAAU,GAAwB,MAAuC;EACvE,IAAM,IAAa,IAAI,gBAAgB;EACvC,EAAY,QAAQ,IAAI,CAAU;EAClC,IAAI;GACF,OAAO,MAAM,EAAqB,GAAO,GAAU,GAAW,EAAW,MAAM;EACjF,UAAU;GACR,EAAY,QAAQ,OAAO,CAAU;EACvC;CACF,GACA,CAAC,CAAK,CACR,GAEM,IAAa,EAAS;EAC1B,UAAU;GAAC;GAAgC;GAAW;EAAM;EAC5D,SAAS,OAAO,EAAE,gBAAa;GAC7B,EAA+B;GAC/B,IAAM,IAAS,MAAM,EACnB,GACA,GACA;IACE;IACA,YAAY;KAAE,OAAO;KAAI;IAAO;GAClC,GACA,CACF,GAEI,IAA4B;GAChC,IAAI;IAEF,KAAK,IAAM,KAAQ,EAAO,uBAAuB,OAC/C,EAAwB,OAAO,gBAAgB,GAAW,CAAI;GAElE,QAAQ;IACN,IAA4B;GAC9B;GACA,OAAO;IAAE,GAAG,EAAO;IAAwB;GAA0B;EACvE;CACF,CAAC,GACK,IAAQ,EAAW,MAAM,SAAS,CAAC,GACnC,IAAU,EAAW,MAAM,SAAS,WAAW,IAC/C,IAAU,EAAW,aAAa,EAAW,YAC7C,IAAU,YAAY;EAC1B,MAAM,QAAQ,IAAI,CAAC,EAAW,QAAQ,EAAE,cAAc,GAAK,CAAC,GAAG,EAAa,CAAC,CAAC;CAChF;CA+BA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,YAxCiB,GAAiB,MAAoB;GAEtD,AADA,EAAY,EAAK,EAAE,GACnB,EAAS,IAAI;GACb,IAAI,IAAY;GAChB,IAAI;IAaF,AAZI,IACF,MAAM,EAAyC,GAAiC;KAC9E;KACA,IAAI,EAAK;IACX,CAAC,IAED,MAAM,EAA0C,GAAkC;KAChF;KACA,IAAI,EAAK;IACX,CAAC,GAEH,IAAY,IACZ,MAAM,EAAQ;GAChB,QAAQ;IACN,EACE,IACI,mGACA,mEACN;GACF,UAAU;IACR,EAAY,IAAI;GAClB;EACF;EAcE;EACA;CACF;AACF"}
@@ -0,0 +1,59 @@
1
+ import { FormEvent } from 'react';
2
+ import { DocumentNode } from 'graphql';
3
+ import { DatabricksIntent } from '../lib/databricksIntent';
4
+ type Request = <T>(document: DocumentNode, variables: Record<string, unknown>) => Promise<T>;
5
+ export declare function useDatabricksQueueForm({ request, runId, workspaceId, intentKey, onQueued, statusReady, canQueue, }: {
6
+ request: Request;
7
+ runId: string;
8
+ workspaceId: string;
9
+ intentKey: string;
10
+ onQueued(): Promise<void>;
11
+ statusReady: boolean;
12
+ canQueue: boolean;
13
+ }): {
14
+ connections: {
15
+ id: string;
16
+ name: string;
17
+ status: import('../../generated/wspace-types').ConnectionStatus;
18
+ workspaceId: string | null;
19
+ canUse: boolean | null;
20
+ provider: {
21
+ key: string;
22
+ name: string;
23
+ };
24
+ }[];
25
+ datasets: {
26
+ id: string;
27
+ name: string;
28
+ }[];
29
+ connectionOffset: number;
30
+ datasetOffset: number;
31
+ moreConnections: boolean;
32
+ moreDatasets: boolean;
33
+ connectionId: string;
34
+ jobId: string;
35
+ name: string;
36
+ parameters: string;
37
+ maximum: string;
38
+ inputs: string[];
39
+ outputs: string[];
40
+ confirmedCost: boolean;
41
+ busy: boolean;
42
+ error: string | null;
43
+ intent: DatabricksIntent | null;
44
+ setConnectionId: import('react').Dispatch<import('react').SetStateAction<string>>;
45
+ setJobId: import('react').Dispatch<import('react').SetStateAction<string>>;
46
+ setName: import('react').Dispatch<import('react').SetStateAction<string>>;
47
+ setParameters: import('react').Dispatch<import('react').SetStateAction<string>>;
48
+ setMaximum: import('react').Dispatch<import('react').SetStateAction<string>>;
49
+ setInputs: import('react').Dispatch<import('react').SetStateAction<string[]>>;
50
+ setOutputs: import('react').Dispatch<import('react').SetStateAction<string[]>>;
51
+ setConfirmedCost: import('react').Dispatch<import('react').SetStateAction<boolean>>;
52
+ loadOptions: (kind: "connections" | "datasets") => Promise<void>;
53
+ submit: (event: FormEvent) => Promise<void>;
54
+ checkSavedRequest: () => void;
55
+ resolveSavedRequest: () => Promise<void>;
56
+ startAnotherJob: () => void;
57
+ };
58
+ export {};
59
+ //# sourceMappingURL=useDatabricksQueueForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDatabricksQueueForm.d.ts","sourceRoot":"","sources":["../../../src/cosmicintersection/hooks/useDatabricksQueueForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAc5C,OAAO,EAML,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AAIjC,KAAK,OAAO,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AAE7F,wBAAgB,sBAAsB,CAAC,EACrC,OAAO,EACP,KAAK,EACL,WAAW,EACX,SAAS,EACT,QAAQ,EACR,WAAW,EACX,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;CACnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAiCkC,aAAa,GAAG,UAAU;oBA6D9B,SAAS;;;;EAuLvC"}
@@ -0,0 +1,158 @@
1
+ import { CosDatabricksConnectionsDocument as e, CosDatabricksDatasetsDocument as t, CosQueueDatabricksStepDocument as n, CosResolveExternalComputeRequestDocument as r } from "../../generated/wspace-operations.js";
2
+ import { databricksJobId as i, databricksParameters as a } from "../lib/databricksForm.js";
3
+ import { clearConfirmedDatabricksIntent as o, clearWithdrawnDatabricksIntent as s, confirmDatabricksIntent as c, prepareDatabricksIntent as l, readDatabricksIntent as u } from "../lib/databricksIntent.js";
4
+ import { useRef as d, useState as f } from "react";
5
+ import { clearGraphqlFetchResponseCache as p } from "@burdenoff/fe-libs/shared/graphql";
6
+ //#region src/cosmicintersection/hooks/useDatabricksQueueForm.ts
7
+ function m({ request: m, runId: h, workspaceId: g, intentKey: _, onQueued: v, statusReady: ee, canQueue: y }) {
8
+ let [b, x] = f([]), [S, C] = f([]), [w, T] = f(0), [E, D] = f(0), [O, k] = f(!1), [A, te] = f(!1), [j, ne] = f(""), [M, N] = f(""), [P, F] = f("Databricks job"), [I, L] = f("{}"), [R, z] = f("3600"), [B, V] = f([]), [H, U] = f([]), [W, G] = f(!1), [K, q] = f(!1), [J] = f(() => {
9
+ try {
10
+ return {
11
+ intent: u(window.sessionStorage, _),
12
+ error: null
13
+ };
14
+ } catch {
15
+ return {
16
+ intent: null,
17
+ error: "The saved request is unreadable. Do not submit another job until its status is recovered."
18
+ };
19
+ }
20
+ }), [Y, X] = f(J.error), [re, Z] = f(J.intent), Q = d(!1), $ = () => Z(u(window.sessionStorage, _));
21
+ return {
22
+ connections: b,
23
+ datasets: S,
24
+ connectionOffset: w,
25
+ datasetOffset: E,
26
+ moreConnections: O,
27
+ moreDatasets: A,
28
+ connectionId: j,
29
+ jobId: M,
30
+ name: P,
31
+ parameters: I,
32
+ maximum: R,
33
+ inputs: B,
34
+ outputs: H,
35
+ confirmedCost: W,
36
+ busy: K,
37
+ error: Y,
38
+ intent: re,
39
+ setConnectionId: ne,
40
+ setJobId: N,
41
+ setName: F,
42
+ setParameters: L,
43
+ setMaximum: z,
44
+ setInputs: V,
45
+ setOutputs: U,
46
+ setConfirmedCost: G,
47
+ loadOptions: async (n) => {
48
+ if (!Q.current) {
49
+ Q.current = !0, q(!0), X(null);
50
+ try {
51
+ if (p(), n === "connections") {
52
+ let t = O ? w : 0, n = await m(e, { pagination: {
53
+ limit: 50,
54
+ offset: t
55
+ } });
56
+ x((e) => Array.from(new Map([...t ? e : [], ...n.connections.items].filter((e) => e.workspaceId === g && e.canUse && e.status === "ACTIVE" && e.provider.key === "generic-api-key").map((e) => [e.id, e])).values())), T(t + n.connections.items.length), k(n.connections.hasMore);
57
+ } else {
58
+ let e = A ? E : 0, n = await m(t, { pagination: {
59
+ limit: 50,
60
+ offset: e
61
+ } });
62
+ C((t) => Array.from(new Map([...e ? t : [], ...n.cosListDatasets.items].map((e) => [e.id, e])).values())), D(e + n.cosListDatasets.items.length), te(n.cosListDatasets.pageInfo.hasMore);
63
+ }
64
+ } catch {
65
+ X("Could not load choices. Retry this read; no job was submitted.");
66
+ } finally {
67
+ Q.current = !1, q(!1);
68
+ }
69
+ }
70
+ },
71
+ submit: async (e) => {
72
+ if (e.preventDefault(), Q.current) return;
73
+ Q.current = !0, q(!0), X(null);
74
+ let t = !1, r = !1;
75
+ try {
76
+ if (!y || !ee) throw Error("Refresh and confirm existing job status before submitting a request.");
77
+ if (!W || !b.some((e) => e.id === j)) throw Error("Choose an available existing connection and confirm external usage charges.");
78
+ let e = Number(R);
79
+ if (!Number.isSafeInteger(e) || e < 60 || e > 86400) throw Error("Choose a monitoring deadline between 60 and 86,400 seconds.");
80
+ if (!P.trim() || P.trim().length > 255) throw Error("Enter a job step name of at most 255 characters.");
81
+ if (B.length > 100 || H.length > 100) throw Error("Select at most 100 datasets for each lineage direction.");
82
+ let o = {
83
+ connectionId: j,
84
+ jobId: i(M),
85
+ name: P.trim(),
86
+ parameters: a(I),
87
+ inputDatasetIds: B,
88
+ outputDatasetIds: H,
89
+ maxRuntimeSeconds: e
90
+ }, s = await l(window.sessionStorage, _, o);
91
+ if (s.confirmedExecutionId) throw Error("This request is already confirmed. Explicitly start another job below.");
92
+ Z(s), t = !0;
93
+ let u = await m(n, {
94
+ runId: h,
95
+ input: {
96
+ ...o,
97
+ requestId: s.requestId
98
+ }
99
+ });
100
+ if (u.cosQueueDatabricksStep.runId !== h || u.cosQueueDatabricksStep.requestId !== s.requestId) throw Error("The returned execution did not match the saved request.");
101
+ r = !0;
102
+ let d = !1;
103
+ try {
104
+ if (!c(window.sessionStorage, _, u.cosQueueDatabricksStep)) throw Error("The acknowledged execution no longer matches local recovery identity.");
105
+ $();
106
+ } catch {
107
+ d = !0;
108
+ }
109
+ await v(), d && X("The job request is confirmed and status was refreshed, but local recovery storage failed. Do not submit another job; recover the original request identity.");
110
+ } catch (e) {
111
+ X(r ? "The job request is confirmed, but its status refresh failed. Refresh job status; do not submit a replacement." : t ? "The queue outcome was not confirmed. Refresh job status. Retrying identical inputs reuses the saved request; changing them is refused until the original is recovered." : e instanceof Error ? e.message : "The request could not be verified. No job was submitted.");
112
+ } finally {
113
+ Q.current = !1, q(!1);
114
+ }
115
+ },
116
+ checkSavedRequest: () => {
117
+ try {
118
+ $();
119
+ } catch {
120
+ X("The saved request could not be verified.");
121
+ }
122
+ },
123
+ resolveSavedRequest: async () => {
124
+ if (Q.current) return;
125
+ Q.current = !0, q(!0), X(null);
126
+ let e = !1;
127
+ try {
128
+ let t = u(window.sessionStorage, _);
129
+ if (!t || t.confirmedExecutionId) throw Error("Only an unresolved saved request can be recovered here.");
130
+ let n = (await m(r, {
131
+ runId: h,
132
+ requestId: t.requestId
133
+ })).cosResolveExternalComputeRequest;
134
+ if (u(window.sessionStorage, _)?.requestId !== t.requestId) throw Error("The saved request changed while recovery was running.");
135
+ if (n.withdrawn && n.execution === null) s(window.sessionStorage, _, t.requestId), G(!1);
136
+ else if (!n.withdrawn && n.execution?.runId === h && n.execution.requestId === t.requestId) {
137
+ if (!c(window.sessionStorage, _, n.execution)) throw Error("The recovered execution no longer matches local recovery identity.");
138
+ } else throw Error("The response did not resolve this exact saved request.");
139
+ $(), e = !0, await v();
140
+ } catch {
141
+ X(e ? "The saved request was resolved, but status refresh failed. Refresh status before submitting another job." : "The saved request could not be resolved. Keep its identity and retry recovery; do not submit a replacement.");
142
+ } finally {
143
+ Q.current = !1, q(!1);
144
+ }
145
+ },
146
+ startAnotherJob: () => {
147
+ try {
148
+ o(window.sessionStorage, _), Z(null), G(!1);
149
+ } catch {
150
+ X("The prior request is not confirmed. Refresh status before starting another job.");
151
+ }
152
+ }
153
+ };
154
+ }
155
+ //#endregion
156
+ export { m as useDatabricksQueueForm };
157
+
158
+ //# sourceMappingURL=useDatabricksQueueForm.js.map