@burdenoff/fluidgrids-fe-sdk 2026.1107.1 → 2026.1108.2
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/{ExecutionDetailPage-TQST7JKC.js → ExecutionDetailPage-PY5OE2RJ.js} +16 -15
- package/dist/{ExecutionsListPage-QQKEGXSC.js → ExecutionsListPage-LKNYPXNZ.js} +12 -11
- package/dist/{MissingNodesInstallModal-OSAJLIBE.js → MissingNodesInstallModal-Q6OPULJU.js} +2 -1
- package/dist/{TemplateConfigurationModal-SILENYXX.js → TemplateConfigurationModal-PWCDDPKT.js} +2 -1
- package/dist/{TemplateDetailPanel-7MPY5MYT.js → TemplateDetailPanel-5WY75DVB.js} +3 -2
- package/dist/WorkflowBuilder-YFPBMOWZ.js +37 -0
- package/dist/{WorkflowsList-2WX7N526.js → WorkflowsList-TETNEMYP.js} +11 -11
- package/dist/{agentTools-MEEGOAE2.js → agentTools-BW2XMHRV.js} +7 -7
- package/dist/{chunk-KE677WYY.js → chunk-2CXUTQUH.js} +1 -1
- package/dist/{chunk-H4ERTSMX.js → chunk-2VSYOGNI.js} +1948 -35
- package/dist/{chunk-NZMUKAXG.js → chunk-54NXUOHI.js} +1 -1
- package/dist/{chunk-E3PNEIBJ.js → chunk-62RJORF7.js} +5 -5
- package/dist/{chunk-4F54UT62.js → chunk-66AKFXP7.js} +21 -18
- package/dist/{chunk-MESGVHUU.js → chunk-7SSMRID2.js} +5 -5
- package/dist/{chunk-752BT4WM.js → chunk-7XW6BC4B.js} +1 -1
- package/dist/{chunk-5375NUIO.js → chunk-AR22A74Y.js} +11 -0
- package/dist/{chunk-5KK3ALQ4.js → chunk-D5Y3DHGJ.js} +1 -1
- package/dist/{chunk-NSDBXKIC.js → chunk-DG4UO5OY.js} +5 -5
- package/dist/{chunk-NMYENCP2.js → chunk-E7KIH3CF.js} +1 -1
- package/dist/{chunk-HUCRE45R.js → chunk-GI6BQIQA.js} +127 -42
- package/dist/{chunk-Z3ABLERJ.js → chunk-GOZR72NK.js} +64 -1
- package/dist/{chunk-KHS2DZHH.js → chunk-HICQ4J4W.js} +1 -1
- package/dist/chunk-HPNZ3PYU.js +1448 -0
- package/dist/{chunk-RI4NFNDX.js → chunk-HQSSW7K3.js} +8 -8
- package/dist/{chunk-CTKWMPQQ.js → chunk-HSOSMPRC.js} +3 -1
- package/dist/{chunk-JRSCUUBT.js → chunk-IPJV2IOH.js} +1 -1
- package/dist/{chunk-PYSEOWLW.js → chunk-IWLNBDR2.js} +5 -5
- package/dist/{chunk-MYAFMXFI.js → chunk-IZOPKR64.js} +3 -3
- package/dist/{chunk-ZWDKN6PU.js → chunk-JRR4VKYD.js} +95 -6
- package/dist/{chunk-TDFC5U66.js → chunk-JSJSBB76.js} +2 -2
- package/dist/{chunk-V2K4HJY4.js → chunk-KJB3WZVD.js} +2 -2
- package/dist/{chunk-OHKSDHNC.js → chunk-L7PHZ7RY.js} +2 -2
- package/dist/{chunk-JOOGRWYY.js → chunk-LOMLLWHD.js} +705 -12
- package/dist/{chunk-ZTZNQ5GF.js → chunk-MYPB2KTJ.js} +13 -6
- package/dist/{chunk-HY3XCZLB.js → chunk-N2QXEV5Y.js} +8 -8
- package/dist/{chunk-EXJW7EKR.js → chunk-OJHBCOBA.js} +164 -1
- package/dist/{chunk-BLLBUHVF.js → chunk-POYMF7L6.js} +1 -1
- package/dist/{chunk-BQXVT32O.js → chunk-QJAZXCFQ.js} +1 -23
- package/dist/{chunk-GA3V3X7Q.js → chunk-RNYFPG7R.js} +4 -4
- package/dist/chunk-TFCIZFDM.js +28 -0
- package/dist/{chunk-PASKZCII.js → chunk-TN3NGTF7.js} +3 -3
- package/dist/{chunk-KXCJPWYE.js → chunk-VH3EET6H.js} +2 -2
- package/dist/{chunk-UZJKX5FN.js → chunk-X3F5IQBP.js} +5 -3
- package/dist/chunk-XRGAH6IQ.js +110 -0
- package/dist/chunk-YASVILWQ.js +398 -0
- package/dist/{chunk-WBVBRXDI.js → chunk-ZHXJYOOG.js} +2115 -25
- package/dist/executions.js +17 -16
- package/dist/history.js +9 -9
- package/dist/index.d.ts +15474 -238
- package/dist/index.js +1064 -58
- package/dist/{node-detail-view-AQCGO4XQ.js → node-detail-view-BGWKE6KW.js} +490 -22
- package/dist/nodes.js +5 -2
- package/dist/observability.js +9 -9
- package/dist/{quick-config-panel-G3T4JCF6.js → quick-config-panel-67BU4I23.js} +9 -9
- package/dist/settings.js +11 -9
- package/dist/templates.js +19 -17
- package/dist/{workflow-builder-C261exmL.d.ts → workflow-builder-D7eMRluc.d.ts} +3 -1
- package/dist/workflow-builder.d.ts +1 -1
- package/dist/workflow-builder.js +21 -19
- package/dist/workflow-preview.js +2 -2
- package/dist/workflows-list.js +11 -11
- package/package.json +2 -2
- package/dist/WorkflowBuilder-R7VIOVRO.js +0 -35
- package/dist/chunk-VKC3ICRA.js +0 -529
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
import { RunControlFieldsDocument, WorkflowRunHistoryArchiveDocument, QueryWorkflowRunDocument, UpdateWorkflowRunDocument, WorkflowRunUpdateDocument, PauseActivityDocument, UnpauseActivityDocument, ResetActivityDocument, UpdateActivityOptionsDocument, CompleteActivityByIdDocument, FailActivityByIdDocument, ResetWorkflowRunDocument, ResetWorkflowRunToLastCleanTaskDocument, WorkflowSignalTokensDocument, CreateWorkflowSignalTokenDocument, RevokeWorkflowSignalTokenDocument, WorkflowSearchAttributesDocument, CreateWorkflowSearchAttributeDocument, DeleteWorkflowSearchAttributeDocument, UpsertWorkflowRunSearchAttributesDocument, WorkflowActivityPauseRulesDocument, CreateActivityPauseRuleDocument, DeleteActivityPauseRuleDocument, CodecServerSettingsDocument, UpdateCodecServerSettingsDocument, ArchiveSettingsDocument, UpdateArchiveSettingsDocument, StartBatchOperationDocument, StartBatchTerminateDocument, StartBatchExportDocument, CancelBatchOperationDocument, WorkflowBatchOperationDocument, WorkflowBatchOperationsDocument, WorkflowScheduleDescribeDocument, TriggerWorkflowScheduleDocument, BackfillWorkflowScheduleDocument, PauseWorkflowScheduleDocument, UnpauseWorkflowScheduleDocument, WorkflowCodeBundleSdkDocument } from './chunk-GOZR72NK.js';
|
|
2
|
+
import { getFluidGridsClient } from './chunk-PDODDDHY.js';
|
|
3
|
+
import { throwIfResultError, describeOperationError } from './chunk-JKLZ6YZ3.js';
|
|
4
|
+
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
5
|
+
import { Label, Textarea } from '@burdenoff/fe-libs/ui';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
|
|
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
|
+
// src/modules/run-control/api.ts
|
|
30
|
+
function jsonArg(value) {
|
|
31
|
+
if (value === void 0) return null;
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
34
|
+
async function fetchRunControlFields(runId) {
|
|
35
|
+
return (await readTyped(RunControlFieldsDocument, { id: runId })).workflowRun ?? null;
|
|
36
|
+
}
|
|
37
|
+
async function fetchRunHistoryArchive(runId) {
|
|
38
|
+
return (await readTyped(WorkflowRunHistoryArchiveDocument, { runId })).workflowRunHistory;
|
|
39
|
+
}
|
|
40
|
+
async function queryRun(input) {
|
|
41
|
+
return (await readTyped(QueryWorkflowRunDocument, {
|
|
42
|
+
runId: input.runId,
|
|
43
|
+
name: input.name,
|
|
44
|
+
args: jsonArg(input.args),
|
|
45
|
+
rejectCondition: input.rejectCondition ?? null
|
|
46
|
+
})).queryWorkflowRun;
|
|
47
|
+
}
|
|
48
|
+
async function sendRunUpdate(input) {
|
|
49
|
+
return (await writeTyped(UpdateWorkflowRunDocument, {
|
|
50
|
+
runId: input.runId,
|
|
51
|
+
name: input.name,
|
|
52
|
+
args: jsonArg(input.args),
|
|
53
|
+
updateId: input.updateId,
|
|
54
|
+
waitFor: input.waitFor,
|
|
55
|
+
timeoutMs: input.timeoutMs ?? null
|
|
56
|
+
})).updateWorkflowRun;
|
|
57
|
+
}
|
|
58
|
+
async function fetchRunUpdate(runId, updateId) {
|
|
59
|
+
return (await readTyped(WorkflowRunUpdateDocument, { runId, updateId })).workflowRunUpdate;
|
|
60
|
+
}
|
|
61
|
+
async function pauseActivities(input) {
|
|
62
|
+
await writeTyped(PauseActivityDocument, input);
|
|
63
|
+
}
|
|
64
|
+
async function unpauseActivities(input) {
|
|
65
|
+
await writeTyped(UnpauseActivityDocument, {
|
|
66
|
+
runId: input.runId,
|
|
67
|
+
selector: input.selector,
|
|
68
|
+
resetAttempts: input.resetAttempts ?? false,
|
|
69
|
+
resetHeartbeat: input.resetHeartbeat ?? false
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
async function resetActivities(input) {
|
|
73
|
+
await writeTyped(ResetActivityDocument, {
|
|
74
|
+
runId: input.runId,
|
|
75
|
+
selector: input.selector,
|
|
76
|
+
resetHeartbeat: input.resetHeartbeat ?? false
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
async function updateActivityOptions(input) {
|
|
80
|
+
await writeTyped(UpdateActivityOptionsDocument, input);
|
|
81
|
+
}
|
|
82
|
+
async function completeActivityById(input) {
|
|
83
|
+
return (await writeTyped(CompleteActivityByIdDocument, {
|
|
84
|
+
runId: input.runId,
|
|
85
|
+
activityId: input.activityId,
|
|
86
|
+
result: jsonArg(input.result)
|
|
87
|
+
})).completeActivityById;
|
|
88
|
+
}
|
|
89
|
+
async function failActivityById(input) {
|
|
90
|
+
return (await writeTyped(FailActivityByIdDocument, input)).failActivityById;
|
|
91
|
+
}
|
|
92
|
+
async function resetRun(input) {
|
|
93
|
+
return (await writeTyped(ResetWorkflowRunDocument, {
|
|
94
|
+
runId: input.runId,
|
|
95
|
+
to: input.to,
|
|
96
|
+
reason: input.reason?.trim() || null,
|
|
97
|
+
reapplySignals: input.reapplySignals ?? true,
|
|
98
|
+
reapplyUpdates: input.reapplyUpdates ?? true
|
|
99
|
+
})).resetWorkflowRun;
|
|
100
|
+
}
|
|
101
|
+
async function resetRunToLastCleanTask(input) {
|
|
102
|
+
return (await writeTyped(ResetWorkflowRunToLastCleanTaskDocument, {
|
|
103
|
+
runId: input.runId,
|
|
104
|
+
reason: input.reason?.trim() || null
|
|
105
|
+
})).resetWorkflowRunToLastCleanTask;
|
|
106
|
+
}
|
|
107
|
+
async function fetchSignalTokens(runId) {
|
|
108
|
+
return (await readTyped(WorkflowSignalTokensDocument, { runId })).workflowSignalTokens;
|
|
109
|
+
}
|
|
110
|
+
async function createSignalToken(input) {
|
|
111
|
+
return (await writeTyped(CreateWorkflowSignalTokenDocument, { input })).createWorkflowSignalToken;
|
|
112
|
+
}
|
|
113
|
+
async function revokeSignalToken(id) {
|
|
114
|
+
return (await writeTyped(RevokeWorkflowSignalTokenDocument, { id })).revokeWorkflowSignalToken;
|
|
115
|
+
}
|
|
116
|
+
async function fetchSearchAttributes() {
|
|
117
|
+
return (await readTyped(WorkflowSearchAttributesDocument, {})).workflowSearchAttributes;
|
|
118
|
+
}
|
|
119
|
+
async function createSearchAttribute(input) {
|
|
120
|
+
return (await writeTyped(CreateWorkflowSearchAttributeDocument, {
|
|
121
|
+
input: {
|
|
122
|
+
name: input.name.trim(),
|
|
123
|
+
type: input.type,
|
|
124
|
+
description: input.description?.trim() || null
|
|
125
|
+
}
|
|
126
|
+
})).createWorkflowSearchAttribute;
|
|
127
|
+
}
|
|
128
|
+
async function deleteSearchAttribute(id) {
|
|
129
|
+
return (await writeTyped(DeleteWorkflowSearchAttributeDocument, { id })).deleteWorkflowSearchAttribute;
|
|
130
|
+
}
|
|
131
|
+
async function upsertRunSearchAttributes(runId, attributes) {
|
|
132
|
+
return (await writeTyped(UpsertWorkflowRunSearchAttributesDocument, {
|
|
133
|
+
runId,
|
|
134
|
+
attributes
|
|
135
|
+
})).upsertWorkflowRunSearchAttributes.searchAttributes;
|
|
136
|
+
}
|
|
137
|
+
async function fetchPauseRules() {
|
|
138
|
+
return (await readTyped(WorkflowActivityPauseRulesDocument, {})).workflowActivityPauseRules;
|
|
139
|
+
}
|
|
140
|
+
async function createPauseRule(input) {
|
|
141
|
+
return (await writeTyped(CreateActivityPauseRuleDocument, { input })).createActivityPauseRule;
|
|
142
|
+
}
|
|
143
|
+
async function deletePauseRule(id) {
|
|
144
|
+
return (await writeTyped(DeleteActivityPauseRuleDocument, { id })).deleteActivityPauseRule;
|
|
145
|
+
}
|
|
146
|
+
async function fetchCodecServerSettings() {
|
|
147
|
+
const settings = (await readTyped(CodecServerSettingsDocument, {})).workflowExecutionSettings;
|
|
148
|
+
return settings ?? {
|
|
149
|
+
__typename: "WorkflowExecutionSettings",
|
|
150
|
+
codecServerUrl: null,
|
|
151
|
+
codecServerIncludeCredentials: false
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
async function saveCodecServerSettings(input) {
|
|
155
|
+
return (await writeTyped(UpdateCodecServerSettingsDocument, input)).updateWorkflowExecutionSettings;
|
|
156
|
+
}
|
|
157
|
+
async function fetchArchiveSettings() {
|
|
158
|
+
const data = await readTyped(ArchiveSettingsDocument, {});
|
|
159
|
+
return data.workflowExecutionSettings?.archive ?? null;
|
|
160
|
+
}
|
|
161
|
+
async function saveArchiveSettings(archive) {
|
|
162
|
+
return (await writeTyped(UpdateArchiveSettingsDocument, {
|
|
163
|
+
archive,
|
|
164
|
+
clearArchive: null
|
|
165
|
+
})).updateWorkflowExecutionSettings.archive ?? null;
|
|
166
|
+
}
|
|
167
|
+
async function clearArchiveSettings() {
|
|
168
|
+
await writeTyped(UpdateArchiveSettingsDocument, {
|
|
169
|
+
archive: null,
|
|
170
|
+
clearArchive: true
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
async function startBatchOperation(input) {
|
|
174
|
+
return (await writeTyped(StartBatchOperationDocument, { input })).startBatchOperation;
|
|
175
|
+
}
|
|
176
|
+
async function startBatchTerminate(input) {
|
|
177
|
+
return (await writeTyped(StartBatchTerminateDocument, { input })).startBatchTerminate;
|
|
178
|
+
}
|
|
179
|
+
async function startBatchExport(input) {
|
|
180
|
+
return (await writeTyped(StartBatchExportDocument, { input })).startBatchExport;
|
|
181
|
+
}
|
|
182
|
+
async function cancelBatchOperation(id) {
|
|
183
|
+
return (await writeTyped(CancelBatchOperationDocument, { id })).cancelBatchOperation;
|
|
184
|
+
}
|
|
185
|
+
async function fetchBatchOperation(id) {
|
|
186
|
+
return (await readTyped(WorkflowBatchOperationDocument, { id })).workflowBatchOperation;
|
|
187
|
+
}
|
|
188
|
+
async function fetchBatchOperations(input) {
|
|
189
|
+
const page = (await readTyped(WorkflowBatchOperationsDocument, {
|
|
190
|
+
status: input.status ?? null,
|
|
191
|
+
first: input.first ?? 20,
|
|
192
|
+
after: input.after ?? null
|
|
193
|
+
})).workflowBatchOperations;
|
|
194
|
+
return { items: page.items, nextCursor: page.nextCursor ?? null };
|
|
195
|
+
}
|
|
196
|
+
async function describeSchedule(workflowKey, triggerNodeId) {
|
|
197
|
+
return (await readTyped(WorkflowScheduleDescribeDocument, { workflowKey, triggerNodeId })).workflowScheduleDescribe;
|
|
198
|
+
}
|
|
199
|
+
async function triggerSchedule(input) {
|
|
200
|
+
return (await writeTyped(TriggerWorkflowScheduleDocument, {
|
|
201
|
+
workflowKey: input.workflowKey,
|
|
202
|
+
triggerNodeId: input.triggerNodeId,
|
|
203
|
+
overlapPolicy: input.overlapPolicy ?? null
|
|
204
|
+
})).triggerWorkflowSchedule;
|
|
205
|
+
}
|
|
206
|
+
async function backfillSchedule(input) {
|
|
207
|
+
return (await writeTyped(BackfillWorkflowScheduleDocument, {
|
|
208
|
+
...input,
|
|
209
|
+
overlapPolicy: input.overlapPolicy ?? null
|
|
210
|
+
})).backfillWorkflowSchedule;
|
|
211
|
+
}
|
|
212
|
+
async function pauseSchedule(input) {
|
|
213
|
+
return (await writeTyped(PauseWorkflowScheduleDocument, {
|
|
214
|
+
workflowKey: input.workflowKey,
|
|
215
|
+
triggerNodeId: input.triggerNodeId,
|
|
216
|
+
note: input.note?.trim() || null
|
|
217
|
+
})).pauseWorkflowSchedule;
|
|
218
|
+
}
|
|
219
|
+
async function unpauseSchedule(input) {
|
|
220
|
+
return (await writeTyped(UnpauseWorkflowScheduleDocument, input)).unpauseWorkflowSchedule;
|
|
221
|
+
}
|
|
222
|
+
async function fetchCodeBundleSdk(workflowKey, version) {
|
|
223
|
+
return (await readTyped(WorkflowCodeBundleSdkDocument, { workflowKey, version })).workflowCodeBundle ?? null;
|
|
224
|
+
}
|
|
225
|
+
function useResource(key, enabled, load, {
|
|
226
|
+
live = false,
|
|
227
|
+
intervalMs = 0
|
|
228
|
+
} = {}) {
|
|
229
|
+
const [data, setData] = useState(null);
|
|
230
|
+
const [loading, setLoading] = useState(false);
|
|
231
|
+
const [error, setError] = useState(null);
|
|
232
|
+
const request = useRef(0);
|
|
233
|
+
const loadRef = useRef(load);
|
|
234
|
+
loadRef.current = load;
|
|
235
|
+
const active = enabled && key !== null;
|
|
236
|
+
const refetch = useCallback(async () => {
|
|
237
|
+
if (!enabled || key === null) return;
|
|
238
|
+
const id = ++request.current;
|
|
239
|
+
setLoading(true);
|
|
240
|
+
try {
|
|
241
|
+
const next = await loadRef.current();
|
|
242
|
+
if (id !== request.current) return;
|
|
243
|
+
setData(next);
|
|
244
|
+
setError(null);
|
|
245
|
+
} catch (err) {
|
|
246
|
+
if (id !== request.current) return;
|
|
247
|
+
setError(describeOperationError(err));
|
|
248
|
+
} finally {
|
|
249
|
+
if (id === request.current) setLoading(false);
|
|
250
|
+
}
|
|
251
|
+
}, [enabled, key]);
|
|
252
|
+
useEffect(() => {
|
|
253
|
+
request.current += 1;
|
|
254
|
+
setData(null);
|
|
255
|
+
setError(null);
|
|
256
|
+
setLoading(false);
|
|
257
|
+
void refetch();
|
|
258
|
+
}, [refetch]);
|
|
259
|
+
useEffect(() => {
|
|
260
|
+
if (!live || !active || intervalMs <= 0) return;
|
|
261
|
+
const timer = setInterval(() => void refetch(), intervalMs);
|
|
262
|
+
return () => clearInterval(timer);
|
|
263
|
+
}, [live, active, intervalMs, refetch]);
|
|
264
|
+
const set = useCallback((value) => {
|
|
265
|
+
request.current += 1;
|
|
266
|
+
setData(value);
|
|
267
|
+
setError(null);
|
|
268
|
+
setLoading(false);
|
|
269
|
+
}, []);
|
|
270
|
+
return { data: active ? data : null, loading, error, refetch, set };
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// src/modules/run-control/utils/json-input.ts
|
|
274
|
+
function parseJsonInput(text) {
|
|
275
|
+
const trimmed = text.trim();
|
|
276
|
+
if (!trimmed) return { ok: true, value: void 0 };
|
|
277
|
+
try {
|
|
278
|
+
return { ok: true, value: JSON.parse(trimmed) };
|
|
279
|
+
} catch (error) {
|
|
280
|
+
return {
|
|
281
|
+
ok: false,
|
|
282
|
+
error: error instanceof Error ? error.message : String(error)
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
function parseJsonObjectInput(text) {
|
|
287
|
+
const parsed = parseJsonInput(text);
|
|
288
|
+
if (!parsed.ok) return parsed;
|
|
289
|
+
const value = parsed.value;
|
|
290
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
291
|
+
return { ok: false, error: 'Enter a JSON object, for example {"key": 1}' };
|
|
292
|
+
return { ok: true, value: Object.fromEntries(Object.entries(value)) };
|
|
293
|
+
}
|
|
294
|
+
function formatJson(value) {
|
|
295
|
+
if (value === void 0 || value === null) return "\u2014";
|
|
296
|
+
if (typeof value === "string") return JSON.stringify(value);
|
|
297
|
+
return JSON.stringify(value, null, 2);
|
|
298
|
+
}
|
|
299
|
+
function newRunControlId(prefix) {
|
|
300
|
+
const random = typeof crypto !== "undefined" && typeof crypto.randomUUID === "function" ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
301
|
+
return `${prefix}-${random}`;
|
|
302
|
+
}
|
|
303
|
+
var RUN_CONTROL_DIALOG_STYLE = { zIndex: 1100 };
|
|
304
|
+
function FieldError({
|
|
305
|
+
message,
|
|
306
|
+
testId
|
|
307
|
+
}) {
|
|
308
|
+
if (!message) return null;
|
|
309
|
+
return /* @__PURE__ */ jsx(
|
|
310
|
+
"p",
|
|
311
|
+
{
|
|
312
|
+
role: "alert",
|
|
313
|
+
className: "text-sm text-[var(--color-status-error-text)]",
|
|
314
|
+
"data-testid": testId,
|
|
315
|
+
children: message
|
|
316
|
+
}
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
function JsonField({
|
|
320
|
+
id,
|
|
321
|
+
label,
|
|
322
|
+
value,
|
|
323
|
+
onChange,
|
|
324
|
+
placeholder,
|
|
325
|
+
error,
|
|
326
|
+
rows = 4,
|
|
327
|
+
testId
|
|
328
|
+
}) {
|
|
329
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
330
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: id, children: label }),
|
|
331
|
+
/* @__PURE__ */ jsx(
|
|
332
|
+
Textarea,
|
|
333
|
+
{
|
|
334
|
+
id,
|
|
335
|
+
value,
|
|
336
|
+
onChange: (event) => onChange(event.target.value),
|
|
337
|
+
placeholder,
|
|
338
|
+
rows,
|
|
339
|
+
className: "font-mono text-xs",
|
|
340
|
+
"data-testid": testId
|
|
341
|
+
}
|
|
342
|
+
),
|
|
343
|
+
/* @__PURE__ */ jsx(FieldError, { message: error })
|
|
344
|
+
] });
|
|
345
|
+
}
|
|
346
|
+
function JsonBlock({
|
|
347
|
+
value,
|
|
348
|
+
testId
|
|
349
|
+
}) {
|
|
350
|
+
return /* @__PURE__ */ jsx(
|
|
351
|
+
"pre",
|
|
352
|
+
{
|
|
353
|
+
className: "max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md bg-background-primary p-3 font-mono text-xs text-text-primary",
|
|
354
|
+
"data-testid": testId,
|
|
355
|
+
children: formatJson(value)
|
|
356
|
+
}
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
function NativeSelect({
|
|
360
|
+
id,
|
|
361
|
+
value,
|
|
362
|
+
onChange,
|
|
363
|
+
children,
|
|
364
|
+
testId,
|
|
365
|
+
disabled,
|
|
366
|
+
ariaLabel
|
|
367
|
+
}) {
|
|
368
|
+
return /* @__PURE__ */ jsx(
|
|
369
|
+
"select",
|
|
370
|
+
{
|
|
371
|
+
id,
|
|
372
|
+
value,
|
|
373
|
+
disabled,
|
|
374
|
+
"aria-label": ariaLabel,
|
|
375
|
+
onChange: (event) => onChange(event.target.value),
|
|
376
|
+
className: "h-9 w-full rounded-md border border-border-primary bg-background-primary px-2 text-sm text-text-primary",
|
|
377
|
+
"data-testid": testId,
|
|
378
|
+
children
|
|
379
|
+
}
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
function StatusPill({
|
|
383
|
+
tone,
|
|
384
|
+
children,
|
|
385
|
+
testId
|
|
386
|
+
}) {
|
|
387
|
+
const classes = tone === "neutral" ? "border-border-secondary bg-background-tertiary text-text-secondary" : `border-[var(--color-status-${tone}-border)] bg-[var(--color-status-${tone}-bg-subtle)] text-[var(--color-status-${tone}-text)]`;
|
|
388
|
+
return /* @__PURE__ */ jsx(
|
|
389
|
+
"span",
|
|
390
|
+
{
|
|
391
|
+
className: `inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${classes}`,
|
|
392
|
+
"data-testid": testId,
|
|
393
|
+
children
|
|
394
|
+
}
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export { FieldError, JsonBlock, JsonField, NativeSelect, RUN_CONTROL_DIALOG_STYLE, StatusPill, backfillSchedule, cancelBatchOperation, clearArchiveSettings, completeActivityById, createPauseRule, createSearchAttribute, createSignalToken, deletePauseRule, deleteSearchAttribute, describeSchedule, failActivityById, fetchArchiveSettings, fetchBatchOperation, fetchBatchOperations, fetchCodeBundleSdk, fetchCodecServerSettings, fetchPauseRules, fetchRunControlFields, fetchRunHistoryArchive, fetchRunUpdate, fetchSearchAttributes, fetchSignalTokens, jsonArg, newRunControlId, parseJsonInput, parseJsonObjectInput, pauseActivities, pauseSchedule, queryRun, readTyped, resetActivities, resetRun, resetRunToLastCleanTask, revokeSignalToken, saveArchiveSettings, saveCodecServerSettings, sendRunUpdate, startBatchExport, startBatchOperation, startBatchTerminate, triggerSchedule, unpauseActivities, unpauseSchedule, updateActivityOptions, upsertRunSearchAttributes, useResource, writeTyped };
|