@burdenoff/fluidgrids-fe-sdk 2026.1114.5 → 2026.1114.7
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/{AiStudioPage-C2SBRqab.js → AiStudioPage-DLl4ld32.js} +2 -2
- package/dist/{ExecutionDetailPage-heD4wBjg.js → ExecutionDetailPage-DxeySgR3.js} +110 -13
- package/dist/{ExecutionsListPage-Ky3TAL9U.js → ExecutionsListPage-CMrOaFKQ.js} +2 -2
- package/dist/FileDownloadUrlDocument-CVOYKcL5.js +92 -0
- package/dist/NodeUsageStatusDocument-B-XguSjm.js +531 -0
- package/dist/{OpenTemplateAsCodeButton-pepQUqje.js → OpenTemplateAsCodeButton-Cjnagq9H.js} +2 -2
- package/dist/{PaidTemplateConfirm-BJCcJh5t.js → PaidTemplateConfirm-IWOHVR6s.js} +1 -1
- package/dist/{SettingsPage-BSucNHrq.js → SettingsPage-DwA2ZjyH.js} +4 -4
- package/dist/{TaskQueuesPage-WMJz9imi.js → TaskQueuesPage-BuWQwT5I.js} +2 -2
- package/dist/{TemplateCard-Cx_eZr9q.js → TemplateCard-9Beuqm5_.js} +19 -3
- package/dist/{TemplateConfigurationModal-D2i7ZXOM.js → TemplateConfigurationModal-B_ME8M-1.js} +1 -1
- package/dist/{TemplatePreview-DwdGa8bH.js → TemplatePreview-Bi6LSeH8.js} +5 -5
- package/dist/{TemplatesPage-DF5PK7CB.js → TemplatesPage-D9fOKAn4.js} +355 -13
- package/dist/{WorkflowBuilder-CjsO7i-D.js → WorkflowBuilder-Bzx-e5lX.js} +2 -2
- package/dist/{WorkflowBuilder-DkzzbrNn.js → WorkflowBuilder-CdcGE0Mf.js} +3 -3
- package/dist/{WorkflowsList-4VADoiz_.js → WorkflowsList-CBqxxI44.js} +3 -4
- package/dist/{api-DKfMt0IX.js → api-CEzqoN5H.js} +1 -1
- package/dist/{api-CEnNq15C.js → api-o5UUDbr8.js} +1 -1
- package/dist/executions.js +2 -2
- package/dist/{flow-builder-CIV6u8y-.js → flow-builder-CbF9P7cI.js} +9 -24
- package/dist/{index-BY0V255h.d.ts → index-D10JzNP1.d.ts} +4 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +30 -27
- package/dist/{node-detail-view-DkajTGfb.js → node-detail-view-CP6sq02c.js} +7 -217
- package/dist/{node-editor-tab-body-ChLrBfKp.js → node-editor-tab-body-B6kxLf6Q.js} +1 -1
- package/dist/observability.d.ts +1 -1
- package/dist/{popover-CCJlf41J.js → popover-9gY3-2dY.js} +2 -2
- package/dist/{quick-config-panel-Bq_uF9XF.js → quick-config-panel-TGCW64qe.js} +2 -2
- package/dist/{schedule-panel-7TtPt1t_.js → schedule-panel-zrFYGtkx.js} +4 -4
- package/dist/settings.js +1 -1
- package/dist/{shared-C0LCTtyh.js → shared-mbyvDPde.js} +2 -24
- package/dist/{sidebar-node-editor-n-7ux5IN.js → sidebar-node-editor-BPg2NKzJ.js} +2 -2
- package/dist/{template-code-B3cMigJS.js → template-code-B7x-XMAm.js} +9 -2
- package/dist/templates.js +2 -2
- package/dist/typed-calls-BqokR321.js +26 -0
- package/dist/{WorkflowEditLeaseStatusDocument-Dp62med3.js → use-workflow-code-editor-CBOkjntt.js} +216 -90
- package/dist/{useAgentDefinitions-Daa3fGVg.js → useAgentDefinitions-9pmnEpb8.js} +1 -1
- package/dist/useConnections-CmnwGk09.js +439 -0
- package/dist/{useWorkflowCodeExport-lRmbjY49.js → useWorkflowCodeExport-ChAzmhi6.js} +78 -114
- package/dist/workflow-builder.js +2 -2
- package/dist/workflow-description-ReGwCZXS.js +123 -0
- package/dist/workflow-pages.d.ts +1 -1
- package/dist/workflow-pages.js +9 -9
- package/dist/{workflow-code-transfer-BsLPUrKP.js → workflow-transfer-CktP7o1c.js} +103 -1
- package/dist/workflows-list.js +1 -1
- package/package.json +1 -1
- package/dist/QuotaExhaustedDialog-YjKgRTmu.js +0 -55
- package/dist/useConnections-BlB0gbOB.js +0 -931
- package/dist/workflow-transfer-CQnQC-ke.js +0 -104
package/dist/settings.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as SettingsPage } from "./SettingsPage-
|
|
2
|
+
import { t as SettingsPage } from "./SettingsPage-DwA2ZjyH.js";
|
|
3
3
|
import { t as ManagedAiPolicyAuthorityProvider } from "./ManagedAiPolicyAuthority-BxwJ3ptd.js";
|
|
4
4
|
|
|
5
5
|
export { ManagedAiPolicyAuthorityProvider, SettingsPage };
|
|
@@ -1,31 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { n as getFluidGridsClient } from "./client-Ctl4jmY3.js";
|
|
2
|
+
import { t as describeOperationError } from "./errors-xPZ-IbQd.js";
|
|
4
3
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
5
|
import { Label, Textarea } from "@burdenoff/fe-libs/ui";
|
|
7
6
|
|
|
8
|
-
// src/graphql/typed-calls.ts
|
|
9
|
-
async function readTyped(query, variables) {
|
|
10
|
-
const result = await getFluidGridsClient().query({
|
|
11
|
-
query,
|
|
12
|
-
variables,
|
|
13
|
-
fetchPolicy: "network-only"
|
|
14
|
-
});
|
|
15
|
-
throwIfResultError(result);
|
|
16
|
-
if (!result.data) throw new Error("The request returned no data");
|
|
17
|
-
return result.data;
|
|
18
|
-
}
|
|
19
|
-
async function writeTyped(mutation, variables) {
|
|
20
|
-
const result = await getFluidGridsClient().mutate({
|
|
21
|
-
mutation,
|
|
22
|
-
variables
|
|
23
|
-
});
|
|
24
|
-
throwIfResultError(result);
|
|
25
|
-
if (!result.data) throw new Error("The request returned no data");
|
|
26
|
-
return result.data;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
7
|
// src/modules/run-control/hooks/useResource.ts
|
|
30
8
|
/**
|
|
31
9
|
* A read keyed by its arguments that sends nothing while `enabled` is false,
|
|
@@ -194,4 +172,4 @@ function StatusPill({ tone, children, testId }) {
|
|
|
194
172
|
});
|
|
195
173
|
}
|
|
196
174
|
|
|
197
|
-
export { RUN_CONTROL_DIALOG_STYLE as a, parseJsonInput as c,
|
|
175
|
+
export { RUN_CONTROL_DIALOG_STYLE as a, parseJsonInput as c, NativeSelect as i, parseJsonObjectInput as l, JsonBlock as n, StatusPill as o, JsonField as r, newRunControlId as s, FieldError as t, useResource as u };
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { A as useFlowStore, k as nodeAccent } from "./node-operation-selection-DHbtGNrG.js";
|
|
3
3
|
import { B as nodeSubtitle, G as useNodeConfig, Un as getNodeDetail, V as nodeTitle, en as useNodeExecution } from "./FluidGridsProvider-C-WGQwuT.js";
|
|
4
4
|
import { t as NodeTypeIcon } from "./node-type-icon-DEAztACh.js";
|
|
5
|
-
import { i as NodeInputFields, n as useNodeEditorTab, r as NodeEditorTabs, t as NodeEditorTabBody } from "./node-editor-tab-body-
|
|
6
|
-
import { r as NodeExecutionActions } from "./schedule-panel-
|
|
5
|
+
import { i as NodeInputFields, n as useNodeEditorTab, r as NodeEditorTabs, t as NodeEditorTabBody } from "./node-editor-tab-body-B6kxLf6Q.js";
|
|
6
|
+
import { r as NodeExecutionActions } from "./schedule-panel-zrFYGtkx.js";
|
|
7
7
|
import { r as useTr } from "./TranslationBridge-Da-TPgQm.js";
|
|
8
8
|
import { useEffect, useState } from "react";
|
|
9
9
|
import { Icon } from "@iconify/react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { C as utf8Length } from "./workflow-transfer-CktP7o1c.js";
|
|
3
3
|
|
|
4
4
|
// src/utils/template-code.ts
|
|
5
5
|
/** DD3: the largest `content.sources` the store accepts, as UTF-8 JSON. */
|
|
@@ -180,5 +180,12 @@ function templateInstallSource(content, codeTemplatesDurable) {
|
|
|
180
180
|
const code = readTemplateCode(content);
|
|
181
181
|
return code?.tier === "tier2" && code.format === "TYPESCRIPT" ? templateImportSource(code) : null;
|
|
182
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* Whether a definition is a tier-2 workflow function: it carries a `code`
|
|
185
|
+
* block (entry, build id) that names its bundle.
|
|
186
|
+
*/
|
|
187
|
+
function isTier2Definition(definitionJson) {
|
|
188
|
+
return isRecord(definitionJson) && isRecord(definitionJson.code);
|
|
189
|
+
}
|
|
183
190
|
|
|
184
|
-
export {
|
|
191
|
+
export { contentTypeOf as a, templateInstallSource as c, buildTemplateCodeDownload as i, TemplateCodeError as n, isTier2Definition as o, assertTemplateSources as r, readTemplateCode as s, TEMPLATE_SOURCES_MAX_BYTES as t };
|
package/dist/templates.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as TemplatesPage } from "./TemplatesPage-
|
|
3
|
-
import { t as TemplatePreview } from "./TemplatePreview-
|
|
2
|
+
import { t as TemplatesPage } from "./TemplatesPage-D9fOKAn4.js";
|
|
3
|
+
import { t as TemplatePreview } from "./TemplatePreview-Bi6LSeH8.js";
|
|
4
4
|
|
|
5
5
|
export { TemplatePreview, TemplatesPage };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { n as getFluidGridsClient } from "./client-Ctl4jmY3.js";
|
|
3
|
+
import { o as throwIfResultError } from "./errors-xPZ-IbQd.js";
|
|
4
|
+
|
|
5
|
+
// src/graphql/typed-calls.ts
|
|
6
|
+
async function readTyped(query, variables) {
|
|
7
|
+
const result = await getFluidGridsClient().query({
|
|
8
|
+
query,
|
|
9
|
+
variables,
|
|
10
|
+
fetchPolicy: "network-only"
|
|
11
|
+
});
|
|
12
|
+
throwIfResultError(result);
|
|
13
|
+
if (!result.data) throw new Error("The request returned no data");
|
|
14
|
+
return result.data;
|
|
15
|
+
}
|
|
16
|
+
async function writeTyped(mutation, variables) {
|
|
17
|
+
const result = await getFluidGridsClient().mutate({
|
|
18
|
+
mutation,
|
|
19
|
+
variables
|
|
20
|
+
});
|
|
21
|
+
throwIfResultError(result);
|
|
22
|
+
if (!result.data) throw new Error("The request returned no data");
|
|
23
|
+
return result.data;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { writeTyped as n, readTyped as t };
|
package/dist/{WorkflowEditLeaseStatusDocument-Dp62med3.js → use-workflow-code-editor-CBOkjntt.js}
RENAMED
|
@@ -1,93 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"operation": "query",
|
|
8
|
-
"name": {
|
|
9
|
-
"kind": "Name",
|
|
10
|
-
"value": "FileDownloadUrl"
|
|
11
|
-
},
|
|
12
|
-
"variableDefinitions": [{
|
|
13
|
-
"kind": "VariableDefinition",
|
|
14
|
-
"variable": {
|
|
15
|
-
"kind": "Variable",
|
|
16
|
-
"name": {
|
|
17
|
-
"kind": "Name",
|
|
18
|
-
"value": "id"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"type": {
|
|
22
|
-
"kind": "NonNullType",
|
|
23
|
-
"type": {
|
|
24
|
-
"kind": "NamedType",
|
|
25
|
-
"name": {
|
|
26
|
-
"kind": "Name",
|
|
27
|
-
"value": "ID"
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"directives": []
|
|
32
|
-
}, {
|
|
33
|
-
"kind": "VariableDefinition",
|
|
34
|
-
"variable": {
|
|
35
|
-
"kind": "Variable",
|
|
36
|
-
"name": {
|
|
37
|
-
"kind": "Name",
|
|
38
|
-
"value": "expiresIn"
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
"type": {
|
|
42
|
-
"kind": "NamedType",
|
|
43
|
-
"name": {
|
|
44
|
-
"kind": "Name",
|
|
45
|
-
"value": "Int"
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
"directives": []
|
|
49
|
-
}],
|
|
50
|
-
"directives": [],
|
|
51
|
-
"selectionSet": {
|
|
52
|
-
"kind": "SelectionSet",
|
|
53
|
-
"selections": [{
|
|
54
|
-
"kind": "Field",
|
|
55
|
-
"name": {
|
|
56
|
-
"kind": "Name",
|
|
57
|
-
"value": "getFileDownloadUrl"
|
|
58
|
-
},
|
|
59
|
-
"arguments": [{
|
|
60
|
-
"kind": "Argument",
|
|
61
|
-
"name": {
|
|
62
|
-
"kind": "Name",
|
|
63
|
-
"value": "id"
|
|
64
|
-
},
|
|
65
|
-
"value": {
|
|
66
|
-
"kind": "Variable",
|
|
67
|
-
"name": {
|
|
68
|
-
"kind": "Name",
|
|
69
|
-
"value": "id"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}, {
|
|
73
|
-
"kind": "Argument",
|
|
74
|
-
"name": {
|
|
75
|
-
"kind": "Name",
|
|
76
|
-
"value": "expiresIn"
|
|
77
|
-
},
|
|
78
|
-
"value": {
|
|
79
|
-
"kind": "Variable",
|
|
80
|
-
"name": {
|
|
81
|
-
"kind": "Name",
|
|
82
|
-
"value": "expiresIn"
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}],
|
|
86
|
-
"directives": []
|
|
87
|
-
}]
|
|
88
|
-
}
|
|
89
|
-
}]
|
|
90
|
-
};
|
|
2
|
+
import { n as getFluidGridsClient } from "./client-Ctl4jmY3.js";
|
|
3
|
+
import { h as fetchCodeBundleSdk } from "./api-o5UUDbr8.js";
|
|
4
|
+
import { o as throwIfResultError, t as describeOperationError } from "./errors-xPZ-IbQd.js";
|
|
5
|
+
import { a as changedSourceFiles, d as isEditableSourcePath, f as projectLanguage, s as defaultSourcePath } from "./node-operation-selection-DHbtGNrG.js";
|
|
6
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
91
7
|
|
|
92
8
|
// src/generated/documents/wspace/BuildWorkflowCodeDocument.ts
|
|
93
9
|
const BuildWorkflowCodeDocument = {
|
|
@@ -624,4 +540,214 @@ const WorkflowEditLeaseStatusDocument = {
|
|
|
624
540
|
}]
|
|
625
541
|
};
|
|
626
542
|
|
|
627
|
-
|
|
543
|
+
// src/builder/components/code-workflow/use-workflow-code-editor.ts
|
|
544
|
+
/**
|
|
545
|
+
* In-browser editing of tier-2 workflow source (BOFF-9905, spec code-first
|
|
546
|
+
* 07 §5): load the version's project files, check them with the managed
|
|
547
|
+
* build, and save them as a new version.
|
|
548
|
+
*
|
|
549
|
+
* - **Load.** `workflowCodeSource` (project files only; vendored files stay
|
|
550
|
+
* on the service so a rebuild gives the CLI's `buildId`) together with the
|
|
551
|
+
* version's `revision` (BOFF-9725) and definition.
|
|
552
|
+
* - **Edit lease.** While another person holds the workflow's edit lease the
|
|
553
|
+
* editor is read-only and Save is off, as the canvas is. When the lease
|
|
554
|
+
* store is unavailable editing is not coordinated and the revision check
|
|
555
|
+
* still protects the save.
|
|
556
|
+
* - **Check.** `buildWorkflowCode(commit: false)`: the same toolchain as
|
|
557
|
+
* `fluidgrids push`, type errors returned as diagnostics.
|
|
558
|
+
* - **Save.** `buildWorkflowCode(commit: true, revision)`: the service
|
|
559
|
+
* builds, stores the bundle and creates a new version from the loaded
|
|
560
|
+
* revision, refusing a save made after someone else changed the version.
|
|
561
|
+
*
|
|
562
|
+
* Python projects are read-only (Python in-browser builds are Phase C).
|
|
563
|
+
*/
|
|
564
|
+
function entryOf(definitionJson) {
|
|
565
|
+
if (typeof definitionJson !== "object" || definitionJson === null || Array.isArray(definitionJson)) return void 0;
|
|
566
|
+
const code = definitionJson.code;
|
|
567
|
+
if (typeof code !== "object" || code === null || Array.isArray(code)) return void 0;
|
|
568
|
+
const entry = code.entry;
|
|
569
|
+
return typeof entry === "string" ? entry : void 0;
|
|
570
|
+
}
|
|
571
|
+
async function fetchWorkflowCodeSource(workflowKey, version) {
|
|
572
|
+
const result = await getFluidGridsClient().query({
|
|
573
|
+
query: WorkflowCodeSourceDocument,
|
|
574
|
+
variables: {
|
|
575
|
+
workflowKey,
|
|
576
|
+
version
|
|
577
|
+
},
|
|
578
|
+
fetchPolicy: "network-only"
|
|
579
|
+
});
|
|
580
|
+
throwIfResultError(result);
|
|
581
|
+
const source = result.data?.workflowCodeSource;
|
|
582
|
+
if (!source) return null;
|
|
583
|
+
const definition = result.data?.workflowDefinition;
|
|
584
|
+
return {
|
|
585
|
+
buildId: source.buildId,
|
|
586
|
+
files: source.files.map((file) => ({
|
|
587
|
+
path: file.path,
|
|
588
|
+
content: file.content
|
|
589
|
+
})),
|
|
590
|
+
revision: definition?.revision ?? null,
|
|
591
|
+
entry: entryOf(definition?.definitionJson)
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
/** Lease of the workflow, or null when it cannot be read (not coordinated). */
|
|
595
|
+
async function fetchEditLease(workflowKey) {
|
|
596
|
+
try {
|
|
597
|
+
const result = await getFluidGridsClient().query({
|
|
598
|
+
query: WorkflowEditLeaseStatusDocument,
|
|
599
|
+
variables: { workflowKey },
|
|
600
|
+
fetchPolicy: "network-only"
|
|
601
|
+
});
|
|
602
|
+
throwIfResultError(result);
|
|
603
|
+
return result.data?.workflowEditLease ?? null;
|
|
604
|
+
} catch {
|
|
605
|
+
return null;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
async function runWorkflowCodeBuild(variables) {
|
|
609
|
+
const result = await getFluidGridsClient().mutate({
|
|
610
|
+
mutation: BuildWorkflowCodeDocument,
|
|
611
|
+
variables
|
|
612
|
+
});
|
|
613
|
+
throwIfResultError(result);
|
|
614
|
+
const data = result.data?.buildWorkflowCode;
|
|
615
|
+
if (!data) throw new Error("The build returned no result");
|
|
616
|
+
return data;
|
|
617
|
+
}
|
|
618
|
+
/** True when someone other than the caller holds the lease. */
|
|
619
|
+
function leaseBlocksEditing(lease) {
|
|
620
|
+
return !!lease && lease.available && lease.held && !lease.heldByCaller;
|
|
621
|
+
}
|
|
622
|
+
function useWorkflowCodeEditor({ workflowKey, version, enabled, canEdit, onSaved, pythonEnabled = false }) {
|
|
623
|
+
const [loading, setLoading] = useState(false);
|
|
624
|
+
const [loadError, setLoadError] = useState(null);
|
|
625
|
+
const [source, setSource] = useState(null);
|
|
626
|
+
const [contents, setContents] = useState({});
|
|
627
|
+
const [selectedPath, setSelectedPath] = useState();
|
|
628
|
+
const [lease, setLease] = useState(null);
|
|
629
|
+
const [building, setBuilding] = useState(null);
|
|
630
|
+
const [buildError, setBuildError] = useState(null);
|
|
631
|
+
const [lastBuild, setLastBuild] = useState(null);
|
|
632
|
+
const request = useRef(0);
|
|
633
|
+
const onSavedRef = useRef(onSaved);
|
|
634
|
+
onSavedRef.current = onSaved;
|
|
635
|
+
const reload = useCallback(async () => {
|
|
636
|
+
if (!enabled || !workflowKey || !version) return;
|
|
637
|
+
const id = ++request.current;
|
|
638
|
+
setLoading(true);
|
|
639
|
+
setLoadError(null);
|
|
640
|
+
try {
|
|
641
|
+
const [loaded, currentLease] = await Promise.all([fetchWorkflowCodeSource(workflowKey, version), fetchEditLease(workflowKey)]);
|
|
642
|
+
if (id !== request.current) return;
|
|
643
|
+
setSource(loaded);
|
|
644
|
+
setLease(currentLease);
|
|
645
|
+
setContents(Object.fromEntries((loaded?.files ?? []).map((file) => [file.path, file.content])));
|
|
646
|
+
setSelectedPath(loaded ? defaultSourcePath(loaded.files, loaded.entry, { python: pythonEnabled && projectLanguage(loaded.files) === "python" }) : void 0);
|
|
647
|
+
setLastBuild(null);
|
|
648
|
+
setBuildError(null);
|
|
649
|
+
} catch (err) {
|
|
650
|
+
if (id !== request.current) return;
|
|
651
|
+
setLoadError(describeOperationError(err));
|
|
652
|
+
} finally {
|
|
653
|
+
if (id === request.current) setLoading(false);
|
|
654
|
+
}
|
|
655
|
+
}, [
|
|
656
|
+
enabled,
|
|
657
|
+
workflowKey,
|
|
658
|
+
version,
|
|
659
|
+
pythonEnabled
|
|
660
|
+
]);
|
|
661
|
+
useEffect(() => {
|
|
662
|
+
reload();
|
|
663
|
+
}, [reload]);
|
|
664
|
+
const [baseSdk, setBaseSdk] = useState(null);
|
|
665
|
+
useEffect(() => {
|
|
666
|
+
setBaseSdk(null);
|
|
667
|
+
if (!pythonEnabled || !enabled || !workflowKey || !version) return;
|
|
668
|
+
let cancelled = false;
|
|
669
|
+
fetchCodeBundleSdk(workflowKey, version).then((bundle) => {
|
|
670
|
+
if (!cancelled) setBaseSdk(bundle?.sdkVersion ?? null);
|
|
671
|
+
}).catch(() => void 0);
|
|
672
|
+
return () => {
|
|
673
|
+
cancelled = true;
|
|
674
|
+
};
|
|
675
|
+
}, [
|
|
676
|
+
pythonEnabled,
|
|
677
|
+
enabled,
|
|
678
|
+
workflowKey,
|
|
679
|
+
version
|
|
680
|
+
]);
|
|
681
|
+
const language = useMemo(() => projectLanguage(source?.files ?? []), [source]);
|
|
682
|
+
const pythonEditable = pythonEnabled && language === "python";
|
|
683
|
+
const readOnlyReason = language === "python" && !pythonEnabled ? "python" : !canEdit ? "permission" : leaseBlocksEditing(lease) ? "lease" : null;
|
|
684
|
+
const changed = useMemo(() => changedSourceFiles(source?.files ?? [], contents), [source, contents]);
|
|
685
|
+
const build = useCallback(async (commit, description) => {
|
|
686
|
+
if (!source || readOnlyReason) return null;
|
|
687
|
+
setBuilding(commit ? "save" : "check");
|
|
688
|
+
setBuildError(null);
|
|
689
|
+
try {
|
|
690
|
+
const result = await runWorkflowCodeBuild({ input: {
|
|
691
|
+
workflowKey,
|
|
692
|
+
baseVersion: version,
|
|
693
|
+
files: changed.length ? changed : selectedPath && contents[selectedPath] !== void 0 ? [{
|
|
694
|
+
path: selectedPath,
|
|
695
|
+
content: contents[selectedPath]
|
|
696
|
+
}] : [],
|
|
697
|
+
commit,
|
|
698
|
+
...commit && source.revision !== null ? { revision: source.revision } : {},
|
|
699
|
+
...commit && description ? { description } : {}
|
|
700
|
+
} });
|
|
701
|
+
setLastBuild(result);
|
|
702
|
+
if (commit && result.success && result.version) onSavedRef.current?.(result.version, result);
|
|
703
|
+
return result;
|
|
704
|
+
} catch (err) {
|
|
705
|
+
setBuildError(describeOperationError(err));
|
|
706
|
+
return null;
|
|
707
|
+
} finally {
|
|
708
|
+
setBuilding(null);
|
|
709
|
+
}
|
|
710
|
+
}, [
|
|
711
|
+
source,
|
|
712
|
+
readOnlyReason,
|
|
713
|
+
changed,
|
|
714
|
+
selectedPath,
|
|
715
|
+
contents,
|
|
716
|
+
workflowKey,
|
|
717
|
+
version
|
|
718
|
+
]);
|
|
719
|
+
const check = useCallback(() => build(false), [build]);
|
|
720
|
+
const save = useCallback((description) => build(true, description), [build]);
|
|
721
|
+
return {
|
|
722
|
+
loading,
|
|
723
|
+
loadError,
|
|
724
|
+
source,
|
|
725
|
+
contents,
|
|
726
|
+
selectedPath,
|
|
727
|
+
select: setSelectedPath,
|
|
728
|
+
setContent: useCallback((path, content) => {
|
|
729
|
+
setContents((current) => current[path] === content ? current : {
|
|
730
|
+
...current,
|
|
731
|
+
[path]: content
|
|
732
|
+
});
|
|
733
|
+
}, []),
|
|
734
|
+
changed,
|
|
735
|
+
language,
|
|
736
|
+
lease,
|
|
737
|
+
readOnlyReason,
|
|
738
|
+
rebuildSdk: baseSdk && lastBuild?.sdkVersion && baseSdk !== lastBuild.sdkVersion ? {
|
|
739
|
+
from: baseSdk,
|
|
740
|
+
to: lastBuild.sdkVersion
|
|
741
|
+
} : null,
|
|
742
|
+
isEditable: (path) => !readOnlyReason && isEditableSourcePath(path, { python: pythonEditable }),
|
|
743
|
+
building,
|
|
744
|
+
buildError,
|
|
745
|
+
lastBuild,
|
|
746
|
+
diagnostics: lastBuild?.diagnostics ?? [],
|
|
747
|
+
check,
|
|
748
|
+
save,
|
|
749
|
+
reload
|
|
750
|
+
};
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
export { BuildWorkflowCodeDocument as a, WorkflowCodeSourceDocument as i, useWorkflowCodeEditor as n, WorkflowEditLeaseStatusDocument as r, fetchWorkflowCodeSource as t };
|
|
@@ -5,7 +5,7 @@ import { An as TriggerWorkflowDocument, Dn as EventRegistrationsDocument, En as
|
|
|
5
5
|
import { a as PauseExecutionDocument, i as ResumeExecutionDocument, n as TerminateExecutionDocument, o as CancelExecutionDocument, r as RetryNodeDocument, t as ExecutionStatsDocument } from "./ExecutionStatsDocument-6ixNZnBV.js";
|
|
6
6
|
import { c as RunLogAppendedDocument, l as RunLogsDocument } from "./agent-form-D0uLvzx4.js";
|
|
7
7
|
import { a as DashboardSummaryDocument, c as ImportWorkflowDocument, d as DeactivateWorkflowDefinitionDocument, f as ActivateWorkflowDefinitionDocument, i as WorkflowDefinitionsDocument, l as DuplicateWorkflowDocument, n as WorkflowRunsDocument, o as UpdateWorkflowDefinitionDocument, r as WorkflowRunDocument, s as RestoreWorkflowVersionDocument, t as WorkflowVersionsDocument, u as DeleteWorkflowDefinitionDocument } from "./WorkflowVersionsDocument-DRVOp8Uj.js";
|
|
8
|
-
import {
|
|
8
|
+
import { n as NodeSchemaIntrospectionDocument, r as RemoveNodeFromWorkflowsDocument, t as NodeUsageStatusDocument } from "./NodeUsageStatusDocument-B-XguSjm.js";
|
|
9
9
|
import { t as WorkflowDefinitionDocument } from "./WorkflowDefinitionDocument-DZLbTPUZ.js";
|
|
10
10
|
import { a as SearchFluidgridsTagsDocument, i as TagFluidgridsEntityDocument, n as ReplaceFluidgridsEntityTagsDocument, o as AvailableFluidgridsTagsDocument, r as UntagFluidgridsEntityDocument, s as FluidgridsEntityTagsDocument, t as CreateFluidgridsTagDocument } from "./CreateFluidgridsTagDocument-Dtp9KPLJ.js";
|
|
11
11
|
import { useCallback, useEffect, useState } from "react";
|