windmill-components 1.687.0 → 1.695.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package/components/ArgInput.svelte +2 -0
- package/package/components/AutoscalingConfigEditor.svelte +18 -4
- package/package/components/CompareWorkspaces.svelte +206 -157
- package/package/components/DatatableSchemaDiff.svelte +2 -2
- package/package/components/Dev.svelte +401 -85
- package/package/components/EditableSchemaForm.svelte +4 -0
- package/package/components/ErrorOrRecoveryHandler.svelte +2 -2
- package/package/components/FlowPreviewContent.svelte +32 -30
- package/package/components/FlowRestartButton.svelte +143 -61
- package/package/components/FlowRestartButton.svelte.d.ts +37 -0
- package/package/components/FlowStatusViewer.svelte +15 -1
- package/package/components/FlowStatusViewer.svelte.d.ts +10 -2
- package/package/components/FlowStatusViewerInner.svelte +1 -2
- package/package/components/FlowStatusViewerInner.svelte.d.ts +6 -2
- package/package/components/ForkConflictModal.svelte +57 -0
- package/package/components/ForkConflictModal.svelte.d.ts +3 -0
- package/package/components/GitRepoViewer.svelte +251 -97
- package/package/components/InputTransformSchemaForm.svelte +1 -1
- package/package/components/InstanceSettings.svelte +36 -16
- package/package/components/Login.svelte +113 -28
- package/package/components/Login.svelte.d.ts +1 -0
- package/package/components/Path.svelte +7 -1
- package/package/components/Path.svelte.d.ts +1 -1
- package/package/components/RunsPage.svelte +2 -1
- package/package/components/S3FilePickerInner.svelte +89 -89
- package/package/components/ScriptEditor.svelte +18 -5
- package/package/components/ShareModal.svelte.d.ts +1 -1
- package/package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +3 -0
- package/package/components/apps/components/helpers/executeRunnable.js +2 -1
- package/package/components/apps/editor/AppReportsDrawerInner.svelte +1 -1
- package/package/components/apps/editor/appPolicy.js +2 -1
- package/package/components/apps/editor/commonAppUtils.d.ts +3 -0
- package/package/components/apps/editor/inlineScriptsPanel/CacheTtlPopup.svelte +1 -1
- package/package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +7 -0
- package/package/components/apps/editor/inlineScriptsPanel/TagPopup.svelte +49 -0
- package/package/components/apps/editor/inlineScriptsPanel/TagPopup.svelte.d.ts +9 -0
- package/package/components/apps/inputType.d.ts +1 -0
- package/package/components/apps/sharedTypes.d.ts +1 -0
- package/package/components/auditLogs/AuditLogsFilters.svelte +8 -3
- package/package/components/common/fileUpload/S3ArgInput.svelte +12 -10
- package/package/components/common/fileUpload/S3ArgInput.svelte.d.ts +2 -0
- package/package/components/copilot/chat/AIChatDisplay.svelte +5 -36
- package/package/components/copilot/chat/AIChatInput.svelte +56 -47
- package/package/components/copilot/chat/AIChatManager.svelte.js +48 -46
- package/package/components/copilot/chat/ContextElementBadge.svelte +6 -4
- package/package/components/copilot/chat/app/core.d.ts +12 -20
- package/package/components/copilot/chat/app/core.js +103 -160
- package/package/components/copilot/chat/app/core.test.js +234 -9
- package/package/components/copilot/chat/context.js +44 -0
- package/package/components/copilot/chat/flow/FlowAIChat.svelte +5 -3
- package/package/components/copilot/chat/flow/core.d.ts +2 -1
- package/package/components/copilot/chat/flow/core.js +48 -21
- package/package/components/copilot/chat/flow/helperUtils.d.ts +5 -2
- package/package/components/copilot/chat/flow/helperUtils.js +33 -1
- package/package/components/copilot/chat/flow/helperUtils.test.js +116 -1
- package/package/components/copilot/chat/flow/openFlow.json +1 -1
- package/package/components/copilot/chat/flow/openFlowZod.gen.js +24 -0
- package/package/components/copilot/chat/script/core.js +3 -0
- package/package/components/copilot/chat/shared.d.ts +6 -0
- package/package/components/copilot/chat/shared.js +22 -1
- package/package/components/copilot/chat/shared.test.d.ts +1 -0
- package/package/components/copilot/chat/shared.test.js +412 -0
- package/package/components/copilot/chat/workspaceTools.d.ts +7 -0
- package/package/components/copilot/chat/workspaceTools.js +239 -0
- package/package/components/copilot/chat/workspaceToolsZod.gen.d.ts +1295 -0
- package/package/components/copilot/chat/workspaceToolsZod.gen.js +424 -0
- package/package/components/copilot/lib.js +3 -1
- package/package/components/copilot/lib.test.d.ts +1 -0
- package/package/components/copilot/lib.test.js +19 -0
- package/package/components/copilot/modelConfig.d.ts +3 -0
- package/package/components/copilot/modelConfig.js +10 -0
- package/package/components/flows/FlowProgressBar.svelte +5 -2
- package/package/components/flows/content/FlowModuleComponent.svelte +636 -599
- package/package/components/flows/conversations/FlowChatManager.svelte.js +21 -10
- package/package/components/flows/flowStateUtils.svelte.js +5 -1
- package/package/components/flows/map/FlowModuleSchemaMap.svelte +3 -2
- package/package/components/flows/map/FlowModuleSchemaMap.svelte.d.ts +1 -0
- package/package/components/git_sync/GitSyncContext.svelte.js +0 -2
- package/package/components/graph/FlowGraphV2.svelte +7 -3
- package/package/components/graph/FlowGraphV2.svelte.d.ts +1 -0
- package/package/components/graph/renderers/triggers/TriggersBadge.svelte +3 -0
- package/package/components/home/deploy_ui.js +1 -1
- package/package/components/icons/AzureIcon.svelte +12 -25
- package/package/components/icons/AzureIcon.svelte.d.ts +3 -2
- package/package/components/instanceSettings.js +24 -0
- package/package/components/mcp/McpScopeSelector.svelte +119 -9
- package/package/components/mcp/McpScopeSelector.svelte.d.ts +1 -0
- package/package/components/offboarding-utils.js +2 -0
- package/package/components/progressBar/ProgressBar.svelte +9 -5
- package/package/components/progressBar/ProgressBar.svelte.d.ts +1 -0
- package/package/components/raw_apps/DeleteAfterUsePopup.svelte +52 -0
- package/package/components/raw_apps/DeleteAfterUsePopup.svelte.d.ts +9 -0
- package/package/components/raw_apps/RawAppBackgroundRunner.svelte +5 -1
- package/package/components/raw_apps/RawAppEditor.svelte +159 -102
- package/package/components/raw_apps/RawAppInlineScriptEditor.svelte +9 -3
- package/package/components/raw_apps/RawAppInlineScriptEditor.svelte.d.ts +2 -1
- package/package/components/raw_apps/RawAppInlineScriptRunnable.svelte +1 -0
- package/package/components/raw_apps/RawAppInlineScriptRunnable.svelte.d.ts +1 -0
- package/package/components/raw_apps/RawAppInputsSpecEditor.svelte +48 -5
- package/package/components/raw_apps/RawAppSharedUiDrawer.svelte +129 -0
- package/package/components/raw_apps/RawAppSharedUiDrawer.svelte.d.ts +5 -0
- package/package/components/raw_apps/RawAppSidebar.svelte +12 -0
- package/package/components/raw_apps/dataTableRefUtils.d.ts +7 -0
- package/package/components/raw_apps/dataTableRefUtils.js +34 -0
- package/package/components/raw_apps/dataTableRefUtils.test.d.ts +1 -0
- package/package/components/raw_apps/dataTableRefUtils.test.js +29 -0
- package/package/components/raw_apps/rawAppPolicy.d.ts +1 -0
- package/package/components/raw_apps/rawAppPolicy.js +17 -2
- package/package/components/resources/resourceTypesFilter.d.ts +19 -0
- package/package/components/resources/resourceTypesFilter.js +21 -0
- package/package/components/restartFromStepPath.d.ts +39 -0
- package/package/components/restartFromStepPath.js +89 -0
- package/package/components/runs/JobDetailFieldConfig.d.ts +1 -0
- package/package/components/runs/JobDetailFieldConfig.js +57 -10
- package/package/components/runs/JobDetailHeader.svelte +24 -3
- package/package/components/runs/runsFilter.d.ts +1 -1
- package/package/components/schema/FlowPropertyEditor.svelte +30 -1
- package/package/components/schema/FlowPropertyEditor.svelte.d.ts +5 -2
- package/package/components/search/GlobalSearchModal.svelte +8 -1
- package/package/components/select/Select.svelte +1 -1
- package/package/components/settings/CreateToken.svelte +48 -77
- package/package/components/settings/EditTokenScopesModal.svelte +57 -0
- package/package/components/settings/EditTokenScopesModal.svelte.d.ts +10 -0
- package/package/components/settings/ScopesPicker.svelte +43 -0
- package/package/components/settings/ScopesPicker.svelte.d.ts +11 -0
- package/package/components/settings/TokensTable.svelte +51 -15
- package/package/components/sidebar/OperatorMenu.svelte +6 -0
- package/package/components/sidebar/SidebarContent.svelte +11 -1
- package/package/components/triggers/AddTriggersButton.svelte +6 -0
- package/package/components/triggers/CaptureWrapper.svelte +19 -1
- package/package/components/triggers/TriggerEditorToolbar.svelte.d.ts +1 -1
- package/package/components/triggers/TriggerModeToggle.svelte +36 -7
- package/package/components/triggers/TriggerModeToggle.svelte.d.ts +1 -1
- package/package/components/triggers/TriggerSuspendedJobsModal.svelte.d.ts +1 -1
- package/package/components/triggers/TriggersEditor.svelte +5 -1
- package/package/components/triggers/TriggersWrapper.svelte +10 -0
- package/package/components/triggers/azure/AzureCapture.svelte +41 -0
- package/package/components/triggers/azure/AzureCapture.svelte.d.ts +44 -0
- package/package/components/triggers/azure/AzureTriggerEditor.svelte +20 -0
- package/package/components/triggers/azure/AzureTriggerEditor.svelte.d.ts +9 -0
- package/package/components/triggers/azure/AzureTriggerEditorConfigSection.svelte +301 -0
- package/package/components/triggers/azure/AzureTriggerEditorConfigSection.svelte.d.ts +16 -0
- package/package/components/triggers/azure/AzureTriggerEditorInner.svelte +422 -0
- package/package/components/triggers/azure/AzureTriggerEditorInner.svelte.d.ts +25 -0
- package/package/components/triggers/azure/AzureTriggerPanel.svelte +55 -0
- package/package/components/triggers/azure/AzureTriggerPanel.svelte.d.ts +10 -0
- package/{dist/sharedUtils/components/triggers/kafka → package/components/triggers/azure}/utils.d.ts +1 -1
- package/package/components/triggers/azure/utils.js +56 -0
- package/package/components/triggers/email/EmailTriggerEditorInner.svelte +2 -0
- package/package/components/triggers/gcp/GcpTriggerEditorInner.svelte +9 -3
- package/package/components/triggers/http/RouteEditorInner.svelte +2 -0
- package/package/components/triggers/kafka/KafkaTriggerEditorInner.svelte +9 -3
- package/package/components/triggers/mqtt/MqttTriggerEditorInner.svelte +9 -3
- package/package/components/triggers/nats/NatsTriggerEditorInner.svelte +9 -3
- package/package/components/triggers/postgres/PostgresTriggerEditorInner.svelte +9 -3
- package/package/components/triggers/schedules/ScheduleEditorInner.svelte +9 -3
- package/package/components/triggers/sqs/SqsTriggerEditorInner.svelte +9 -3
- package/package/components/triggers/triggers.svelte.d.ts +1 -0
- package/package/components/triggers/triggers.svelte.js +23 -1
- package/package/components/triggers/utils.js +20 -0
- package/package/components/triggers/websocket/WebsocketTriggerEditorInner.svelte +9 -3
- package/package/components/triggers.d.ts +1 -1
- package/package/components/useNestedRestartState.svelte.d.ts +56 -0
- package/package/components/useNestedRestartState.svelte.js +320 -0
- package/package/components/workspaceSettings/SharedUiSettings.svelte +175 -0
- package/package/components/workspaceSettings/SharedUiSettings.svelte.d.ts +3 -0
- package/package/gen/core/OpenAPI.js +1 -1
- package/package/gen/schemas.gen.d.ts +294 -24
- package/package/gen/schemas.gen.js +297 -25
- package/package/gen/services.gen.d.ts +247 -4
- package/package/gen/services.gen.js +498 -7
- package/package/gen/types.gen.d.ts +990 -37
- package/package/hubPaths.json +2 -5
- package/package/infer.d.ts +1 -1
- package/package/infer.js +37 -51
- package/package/mcpEndpointTools.js +60 -4
- package/package/script_helpers.js +17 -0
- package/package/stores.d.ts +7 -0
- package/package/stores.js +6 -1
- package/package/system_prompts/index.d.ts +1 -0
- package/package/system_prompts/index.js +8 -0
- package/package/system_prompts/prompts.d.ts +16 -13
- package/package/system_prompts/prompts.js +653 -43
- package/package/templates/ci_test_bun.ts.template +8 -0
- package/package/templates/ci_test_python.py.template +8 -0
- package/package/utils/forkConflict.d.ts +26 -0
- package/package/utils/forkConflict.js +56 -0
- package/package/utils_deployable.d.ts +164 -121
- package/package/utils_deployable.js +61 -11
- package/package/utils_workspace_deploy.js +3 -1
- package/package.json +28 -4
- package/dist/sharedUtils/assets/tokens/colorTokensConfig.d.ts +0 -2
- package/dist/sharedUtils/base.d.ts +0 -1
- package/dist/sharedUtils/cloud.d.ts +0 -1
- package/dist/sharedUtils/common.d.ts +0 -111
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/count.d.ts +0 -5
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/delete.d.ts +0 -5
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/insert.d.ts +0 -5
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/select.d.ts +0 -13
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/update.d.ts +0 -11
- package/dist/sharedUtils/components/apps/components/display/dbtable/utils.d.ts +0 -95
- package/dist/sharedUtils/components/apps/editor/appPolicy.d.ts +0 -6
- package/dist/sharedUtils/components/apps/editor/appUtilsCore.d.ts +0 -7
- package/dist/sharedUtils/components/apps/editor/appUtilsS3.d.ts +0 -33
- package/dist/sharedUtils/components/apps/editor/commonAppUtils.d.ts +0 -10
- package/dist/sharedUtils/components/apps/editor/component/components.d.ts +0 -5371
- package/dist/sharedUtils/components/apps/editor/component/default-codes.d.ts +0 -3
- package/dist/sharedUtils/components/apps/editor/component/index.d.ts +0 -3
- package/dist/sharedUtils/components/apps/editor/component/sets.d.ts +0 -7
- package/dist/sharedUtils/components/apps/editor/componentsPanel/componentDefaultProps.d.ts +0 -3
- package/dist/sharedUtils/components/apps/gridUtils.d.ts +0 -14
- package/dist/sharedUtils/components/apps/inputType.d.ts +0 -178
- package/dist/sharedUtils/components/apps/rx.d.ts +0 -29
- package/dist/sharedUtils/components/apps/sharedTypes.d.ts +0 -21
- package/dist/sharedUtils/components/apps/types.d.ts +0 -274
- package/dist/sharedUtils/components/assets/lib.d.ts +0 -25
- package/dist/sharedUtils/components/common/alert/model.d.ts +0 -2
- package/dist/sharedUtils/components/common/badge/model.d.ts +0 -8
- package/dist/sharedUtils/components/common/button/model.d.ts +0 -45
- package/dist/sharedUtils/components/common/fileInput/model.d.ts +0 -1
- package/dist/sharedUtils/components/common/index.d.ts +0 -24
- package/dist/sharedUtils/components/common/skeleton/model.d.ts +0 -21
- package/dist/sharedUtils/components/dbTypes.d.ts +0 -14
- package/dist/sharedUtils/components/diff_drawer.d.ts +0 -26
- package/dist/sharedUtils/components/ducklake.d.ts +0 -1
- package/dist/sharedUtils/components/flows/scheduleUtils.d.ts +0 -7
- package/dist/sharedUtils/components/icons/index.d.ts +0 -101
- package/dist/sharedUtils/components/random_positive_adjetive.d.ts +0 -1
- package/dist/sharedUtils/components/raw_apps/rawAppPolicy.d.ts +0 -10
- package/dist/sharedUtils/components/raw_apps/utils.d.ts +0 -15
- package/dist/sharedUtils/components/triggers/email/utils.d.ts +0 -4
- package/dist/sharedUtils/components/triggers/gcp/utils.d.ts +0 -2
- package/dist/sharedUtils/components/triggers/http/utils.d.ts +0 -11
- package/dist/sharedUtils/components/triggers/mqtt/utils.d.ts +0 -2
- package/dist/sharedUtils/components/triggers/nats/utils.d.ts +0 -2
- package/dist/sharedUtils/components/triggers/postgres/utils.d.ts +0 -8
- package/dist/sharedUtils/components/triggers/sqs/utils.d.ts +0 -2
- package/dist/sharedUtils/components/triggers/triggers.svelte.d.ts +0 -32
- package/dist/sharedUtils/components/triggers/utils.d.ts +0 -80
- package/dist/sharedUtils/components/triggers/websocket/utils.d.ts +0 -2
- package/dist/sharedUtils/components/triggers.d.ts +0 -20
- package/dist/sharedUtils/gen/core/ApiError.d.ts +0 -10
- package/dist/sharedUtils/gen/core/ApiRequestOptions.d.ts +0 -13
- package/dist/sharedUtils/gen/core/ApiResult.d.ts +0 -7
- package/dist/sharedUtils/gen/core/CancelablePromise.d.ts +0 -26
- package/dist/sharedUtils/gen/core/OpenAPI.d.ts +0 -27
- package/dist/sharedUtils/gen/core/request.d.ts +0 -29
- package/dist/sharedUtils/gen/index.d.ts +0 -6
- package/dist/sharedUtils/gen/schemas.gen.d.ts +0 -7036
- package/dist/sharedUtils/gen/services.gen.d.ts +0 -6047
- package/dist/sharedUtils/gen/types.gen.d.ts +0 -21881
- package/dist/sharedUtils/history.svelte.d.ts +0 -9
- package/dist/sharedUtils/hub.d.ts +0 -49
- package/dist/sharedUtils/jsr.json +0 -6
- package/dist/sharedUtils/lib.d.ts +0 -5
- package/dist/sharedUtils/lib.es.js +0 -1588
- package/dist/sharedUtils/package.json +0 -12
- package/dist/sharedUtils/schema.d.ts +0 -3
- package/dist/sharedUtils/stores.d.ts +0 -97
- package/dist/sharedUtils/svelte5Utils.svelte.d.ts +0 -80
- package/dist/sharedUtils/toast.d.ts +0 -8
- package/dist/sharedUtils/utils.d.ts +0 -265
- package/package/components/copilot/chat/flow/openFlowZod.js +0 -24
- /package/package/components/copilot/chat/flow/{openFlowZod.d.ts → openFlowZod.gen.d.ts} +0 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<script lang="ts">import { workspaceStore } from '../../stores';
|
|
2
|
+
import { WorkspaceService } from '../../gen';
|
|
3
|
+
import { sendUserToast } from '../../toast';
|
|
4
|
+
import Drawer from '../common/drawer/Drawer.svelte';
|
|
5
|
+
import DrawerContent from '../common/drawer/DrawerContent.svelte';
|
|
6
|
+
import Editor from '../Editor.svelte';
|
|
7
|
+
import { Pane, Splitpanes } from 'svelte-splitpanes';
|
|
8
|
+
let open = $state(false);
|
|
9
|
+
let files = $state({});
|
|
10
|
+
let version = $state(0);
|
|
11
|
+
let editedBy = $state('');
|
|
12
|
+
let selected = $state(undefined);
|
|
13
|
+
let loading = $state(false);
|
|
14
|
+
export async function openDrawer() {
|
|
15
|
+
open = true;
|
|
16
|
+
await load();
|
|
17
|
+
}
|
|
18
|
+
async function load() {
|
|
19
|
+
if (!$workspaceStore)
|
|
20
|
+
return;
|
|
21
|
+
loading = true;
|
|
22
|
+
try {
|
|
23
|
+
const res = (await WorkspaceService.getSharedUi({ workspace: $workspaceStore }));
|
|
24
|
+
files = res.files ?? {};
|
|
25
|
+
version = res.version ?? 0;
|
|
26
|
+
editedBy = res.edited_by ?? '';
|
|
27
|
+
const keys = Object.keys(files).sort();
|
|
28
|
+
if (selected === undefined || !(selected in files)) {
|
|
29
|
+
selected = keys[0];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
sendUserToast(`Failed to load shared UI: ${e}`, true);
|
|
34
|
+
}
|
|
35
|
+
finally {
|
|
36
|
+
loading = false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const sortedPaths = $derived(Object.keys(files).sort());
|
|
40
|
+
function langFromPath(p) {
|
|
41
|
+
const ext = (p.split('.').pop() ?? '').toLowerCase();
|
|
42
|
+
if (ext === 'ts')
|
|
43
|
+
return 'bun';
|
|
44
|
+
if (ext === 'tsx')
|
|
45
|
+
return 'tsx';
|
|
46
|
+
if (ext === 'js')
|
|
47
|
+
return 'bun';
|
|
48
|
+
if (ext === 'jsx')
|
|
49
|
+
return 'jsx';
|
|
50
|
+
if (ext === 'css')
|
|
51
|
+
return undefined;
|
|
52
|
+
if (ext === 'json')
|
|
53
|
+
return 'json';
|
|
54
|
+
if (ext === 'html')
|
|
55
|
+
return undefined;
|
|
56
|
+
if (ext === 'md')
|
|
57
|
+
return undefined;
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<Drawer bind:open size="900px">
|
|
63
|
+
<DrawerContent
|
|
64
|
+
title="Shared UI folder ({sortedPaths.length} file{sortedPaths.length === 1 ? '' : 's'})"
|
|
65
|
+
on:close={() => (open = false)}
|
|
66
|
+
noPadding
|
|
67
|
+
>
|
|
68
|
+
<div class="px-3 py-2 text-xs text-tertiary border-b">
|
|
69
|
+
Read-only view of the workspace's <code>ui/</code> folder. Imports of
|
|
70
|
+
<code>/ui/<path></code> are bundled in when you push this raw app. Edits happen via
|
|
71
|
+
<code>wmill sync</code>.
|
|
72
|
+
{#if version}
|
|
73
|
+
Version {version}{#if editedBy}, by <code>{editedBy}</code>{/if}.
|
|
74
|
+
{/if}
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
{#if loading}
|
|
78
|
+
<div class="flex items-center justify-center h-full text-tertiary">Loading…</div>
|
|
79
|
+
{:else if sortedPaths.length === 0}
|
|
80
|
+
<div class="flex flex-col items-center justify-center h-full p-6 text-center text-tertiary">
|
|
81
|
+
<div class="font-semibold mb-1">No shared UI files yet</div>
|
|
82
|
+
<div class="text-sm">
|
|
83
|
+
Create a <code>ui/</code> folder at the root of your sync directory, add files, then run
|
|
84
|
+
<code>wmill sync push</code>.
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
{:else}
|
|
88
|
+
<Splitpanes class="!h-full">
|
|
89
|
+
<Pane size={28} minSize={15}>
|
|
90
|
+
<div class="overflow-auto h-full divide-y border-r">
|
|
91
|
+
{#each sortedPaths as p (p)}
|
|
92
|
+
<button
|
|
93
|
+
class="w-full text-left px-3 py-2 text-sm font-mono hover:bg-surface-hover {selected ===
|
|
94
|
+
p
|
|
95
|
+
? 'bg-surface-selected'
|
|
96
|
+
: ''}"
|
|
97
|
+
onclick={() => (selected = p)}
|
|
98
|
+
>
|
|
99
|
+
<div class="truncate">{p}</div>
|
|
100
|
+
<div class="text-2xs text-tertiary">
|
|
101
|
+
{(files[p]?.length ?? 0).toLocaleString()} chars
|
|
102
|
+
</div>
|
|
103
|
+
</button>
|
|
104
|
+
{/each}
|
|
105
|
+
</div>
|
|
106
|
+
</Pane>
|
|
107
|
+
<Pane size={72}>
|
|
108
|
+
{#if selected}
|
|
109
|
+
{#key selected}
|
|
110
|
+
<Editor
|
|
111
|
+
class="flex flex-1 grow h-full"
|
|
112
|
+
path={`/ui/${selected}`}
|
|
113
|
+
code={files[selected] ?? ''}
|
|
114
|
+
scriptLang={langFromPath(selected)}
|
|
115
|
+
disabled={true}
|
|
116
|
+
automaticLayout
|
|
117
|
+
fixedOverflowWidgets
|
|
118
|
+
/>
|
|
119
|
+
{/key}
|
|
120
|
+
{:else}
|
|
121
|
+
<div class="flex items-center justify-center h-full text-tertiary">
|
|
122
|
+
Select a file to view
|
|
123
|
+
</div>
|
|
124
|
+
{/if}
|
|
125
|
+
</Pane>
|
|
126
|
+
</Splitpanes>
|
|
127
|
+
{/if}
|
|
128
|
+
</DrawerContent>
|
|
129
|
+
</Drawer>
|
|
@@ -7,9 +7,11 @@ import RawAppHistoryList from './RawAppHistoryList.svelte';
|
|
|
7
7
|
import Button from '../common/button/Button.svelte';
|
|
8
8
|
import RawAppDataTableList from './RawAppDataTableList.svelte';
|
|
9
9
|
import RawAppDataTableDrawer from './RawAppDataTableDrawer.svelte';
|
|
10
|
+
import RawAppSharedUiDrawer from './RawAppSharedUiDrawer.svelte';
|
|
10
11
|
let { runnables, selectedRunnable = $bindable(), files = $bindable({}), modules, onSelectFile, selectedDocument = $bindable(), historyManager, historySelectedId, onHistorySelect, onHistorySelectCurrent, onManualSnapshot, dataTableRefs = [], onDataTableRefsChange, defaultDatatable = undefined, defaultSchema = undefined, onDefaultChange } = $props();
|
|
11
12
|
let dataTableDrawer = $state();
|
|
12
13
|
let selectedDataTableIndex = $state(undefined);
|
|
14
|
+
let sharedUiDrawer = $state();
|
|
13
15
|
function handleAddDataTable(ref) {
|
|
14
16
|
onDataTableRefsChange?.([...dataTableRefs, ref]);
|
|
15
17
|
}
|
|
@@ -57,6 +59,15 @@ function handleSelectPath(path) {
|
|
|
57
59
|
<Plus size={12} />
|
|
58
60
|
<Folder size={12} />
|
|
59
61
|
</Button>
|
|
62
|
+
<Button
|
|
63
|
+
onClick={() => sharedUiDrawer?.openDrawer()}
|
|
64
|
+
title="Browse the workspace shared ui/ folder"
|
|
65
|
+
unifiedSize="xs"
|
|
66
|
+
variant="subtle"
|
|
67
|
+
btnClasses="px-1 gap-0.5 text-xs"
|
|
68
|
+
>
|
|
69
|
+
ui/
|
|
70
|
+
</Button>
|
|
60
71
|
</div>
|
|
61
72
|
{/snippet}
|
|
62
73
|
<FileExplorer
|
|
@@ -96,6 +107,7 @@ function handleSelectPath(path) {
|
|
|
96
107
|
onAdd={handleAddDataTable}
|
|
97
108
|
existingRefs={dataTableRefs}
|
|
98
109
|
/>
|
|
110
|
+
<RawAppSharedUiDrawer bind:this={sharedUiDrawer} />
|
|
99
111
|
|
|
100
112
|
{#if historyManager && onHistorySelect && onManualSnapshot}
|
|
101
113
|
<div class="py-4"></div>
|
|
@@ -18,6 +18,13 @@ export interface RawAppData {
|
|
|
18
18
|
}
|
|
19
19
|
/** Default data configuration */
|
|
20
20
|
export declare const DEFAULT_DATA: RawAppData;
|
|
21
|
+
export type DataTableWhitelist = {
|
|
22
|
+
datatables: Set<string>;
|
|
23
|
+
allTablesDatatables: Set<string>;
|
|
24
|
+
tables: Map<string, Map<string, Set<string>>>;
|
|
25
|
+
};
|
|
26
|
+
export declare function buildDataTableWhitelist(refs: DataTableRef[]): DataTableWhitelist;
|
|
27
|
+
export declare function isDatatableTableAllowed(whitelist: DataTableWhitelist, datatableName: string, schemaName: string, tableName: string): boolean;
|
|
21
28
|
/**
|
|
22
29
|
* Parse a string ref into a DataTableRef object
|
|
23
30
|
* Format: <datatableName>/<schema>:<table> or <datatableName>/<table> (for public schema)
|
|
@@ -4,6 +4,40 @@ export const DEFAULT_DATA = {
|
|
|
4
4
|
datatable: undefined,
|
|
5
5
|
schema: undefined
|
|
6
6
|
};
|
|
7
|
+
export function buildDataTableWhitelist(refs) {
|
|
8
|
+
const datatables = new Set();
|
|
9
|
+
const allTablesDatatables = new Set();
|
|
10
|
+
const tables = new Map();
|
|
11
|
+
for (const ref of refs) {
|
|
12
|
+
datatables.add(ref.datatable);
|
|
13
|
+
if (!ref.table) {
|
|
14
|
+
allTablesDatatables.add(ref.datatable);
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
if (!tables.has(ref.datatable)) {
|
|
18
|
+
tables.set(ref.datatable, new Map());
|
|
19
|
+
}
|
|
20
|
+
const schemaKey = ref.schema ?? 'public';
|
|
21
|
+
const schemaMap = tables.get(ref.datatable);
|
|
22
|
+
if (!schemaMap.has(schemaKey)) {
|
|
23
|
+
schemaMap.set(schemaKey, new Set());
|
|
24
|
+
}
|
|
25
|
+
schemaMap.get(schemaKey).add(ref.table);
|
|
26
|
+
}
|
|
27
|
+
return { datatables, allTablesDatatables, tables };
|
|
28
|
+
}
|
|
29
|
+
export function isDatatableTableAllowed(whitelist, datatableName, schemaName, tableName) {
|
|
30
|
+
if (whitelist.datatables.size === 0) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
if (!whitelist.datatables.has(datatableName)) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
if (whitelist.allTablesDatatables.has(datatableName)) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
return whitelist.tables.get(datatableName)?.get(schemaName ?? 'public')?.has(tableName) ?? false;
|
|
40
|
+
}
|
|
7
41
|
/**
|
|
8
42
|
* Parse a string ref into a DataTableRef object
|
|
9
43
|
* Format: <datatableName>/<schema>:<table> or <datatableName>/<table> (for public schema)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { buildDataTableWhitelist, isDatatableTableAllowed } from './dataTableRefUtils';
|
|
3
|
+
describe('datatable whitelist helpers', () => {
|
|
4
|
+
it('allows every datatable table when no refs are configured', () => {
|
|
5
|
+
const whitelist = buildDataTableWhitelist([]);
|
|
6
|
+
expect(isDatatableTableAllowed(whitelist, 'main', 'public', 'users')).toBe(true);
|
|
7
|
+
expect(isDatatableTableAllowed(whitelist, 'analytics', 'events', 'clicks')).toBe(true);
|
|
8
|
+
});
|
|
9
|
+
it('treats datatable-level refs as all tables in that datatable', () => {
|
|
10
|
+
const whitelist = buildDataTableWhitelist([{ datatable: 'main' }]);
|
|
11
|
+
expect(isDatatableTableAllowed(whitelist, 'main', 'public', 'users')).toBe(true);
|
|
12
|
+
expect(isDatatableTableAllowed(whitelist, 'main', 'analytics', 'events')).toBe(true);
|
|
13
|
+
expect(isDatatableTableAllowed(whitelist, 'other', 'public', 'users')).toBe(false);
|
|
14
|
+
});
|
|
15
|
+
it('allows only explicitly listed tables for table-level refs', () => {
|
|
16
|
+
const whitelist = buildDataTableWhitelist([
|
|
17
|
+
{ datatable: 'main', schema: 'public', table: 'users' },
|
|
18
|
+
{ datatable: 'main', schema: 'analytics', table: 'events' }
|
|
19
|
+
]);
|
|
20
|
+
expect(isDatatableTableAllowed(whitelist, 'main', 'public', 'users')).toBe(true);
|
|
21
|
+
expect(isDatatableTableAllowed(whitelist, 'main', 'analytics', 'events')).toBe(true);
|
|
22
|
+
expect(isDatatableTableAllowed(whitelist, 'main', 'public', 'orders')).toBe(false);
|
|
23
|
+
});
|
|
24
|
+
it('does not treat an explicit empty schema as public', () => {
|
|
25
|
+
const whitelist = buildDataTableWhitelist([{ datatable: 'main', schema: '', table: 'users' }]);
|
|
26
|
+
expect(isDatatableTableAllowed(whitelist, 'main', '', 'users')).toBe(true);
|
|
27
|
+
expect(isDatatableTableAllowed(whitelist, 'main', 'public', 'users')).toBe(false);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -10,6 +10,19 @@ export async function updateRawAppPolicy(runnables, currentPolicy) {
|
|
|
10
10
|
triggerables_v2
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
+
function extraFields(runnable, fields) {
|
|
14
|
+
const out = {};
|
|
15
|
+
if (typeof runnable.delete_after_secs === 'number' && runnable.delete_after_secs >= 0)
|
|
16
|
+
out.delete_after_secs = runnable.delete_after_secs;
|
|
17
|
+
const sensitive_inputs = Object.entries(fields)
|
|
18
|
+
.map(([k, v]) => (v['sensitive'] ? k : undefined))
|
|
19
|
+
.filter(Boolean);
|
|
20
|
+
if (sensitive_inputs.length > 0)
|
|
21
|
+
out.sensitive_inputs = sensitive_inputs;
|
|
22
|
+
if (runnable.inlineScript?.tag)
|
|
23
|
+
out.tag = runnable.inlineScript.tag;
|
|
24
|
+
return out;
|
|
25
|
+
}
|
|
13
26
|
async function processRunnable(id, runnable, fields) {
|
|
14
27
|
const staticInputs = collectStaticFields(fields);
|
|
15
28
|
const allowUserResources = Object.entries(fields)
|
|
@@ -25,7 +38,8 @@ async function processRunnable(id, runnable, fields) {
|
|
|
25
38
|
{
|
|
26
39
|
static_inputs: staticInputs,
|
|
27
40
|
one_of_inputs: {},
|
|
28
|
-
allow_user_resources: allowUserResources
|
|
41
|
+
allow_user_resources: allowUserResources,
|
|
42
|
+
...extraFields(runnable, fields)
|
|
29
43
|
}
|
|
30
44
|
];
|
|
31
45
|
}
|
|
@@ -36,7 +50,8 @@ async function processRunnable(id, runnable, fields) {
|
|
|
36
50
|
{
|
|
37
51
|
static_inputs: staticInputs,
|
|
38
52
|
one_of_inputs: {},
|
|
39
|
-
allow_user_resources: allowUserResources
|
|
53
|
+
allow_user_resources: allowUserResources,
|
|
54
|
+
...extraFields(runnable, fields)
|
|
40
55
|
}
|
|
41
56
|
];
|
|
42
57
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Boxes, FileText } from 'lucide-svelte';
|
|
2
|
+
export declare function buildResourceTypesFilterSchema(): {
|
|
3
|
+
_default_: {
|
|
4
|
+
type: "string";
|
|
5
|
+
hidden: true;
|
|
6
|
+
};
|
|
7
|
+
name: {
|
|
8
|
+
type: "string";
|
|
9
|
+
label: string;
|
|
10
|
+
icon: typeof Boxes;
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
description: {
|
|
14
|
+
type: "string";
|
|
15
|
+
label: string;
|
|
16
|
+
icon: typeof FileText;
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Boxes, FileText } from 'lucide-svelte';
|
|
2
|
+
export function buildResourceTypesFilterSchema() {
|
|
3
|
+
return {
|
|
4
|
+
_default_: {
|
|
5
|
+
type: 'string',
|
|
6
|
+
hidden: true
|
|
7
|
+
},
|
|
8
|
+
name: {
|
|
9
|
+
type: 'string',
|
|
10
|
+
label: 'Name',
|
|
11
|
+
icon: Boxes,
|
|
12
|
+
description: 'Search in resource type name'
|
|
13
|
+
},
|
|
14
|
+
description: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
label: 'Description',
|
|
17
|
+
icon: FileText,
|
|
18
|
+
description: 'Search in resource type description'
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { FlowModule } from '../gen';
|
|
2
|
+
export type ContainerType = 'branchone' | 'forloopflow' | 'flow' | 'whileloopflow' | 'branchall';
|
|
3
|
+
export type AncestorEntry = {
|
|
4
|
+
stepId: string;
|
|
5
|
+
type: ContainerType;
|
|
6
|
+
/** For BranchOne: -1 means default branch, 0..N-1 means branches[i] */
|
|
7
|
+
branchIndex?: number;
|
|
8
|
+
/** True for parallel ForLoop / BranchAll — backend rejects nested restart
|
|
9
|
+
* inside parallel containers, so the caller should hide the restart button. */
|
|
10
|
+
parallel?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type StepPath = {
|
|
13
|
+
target: FlowModule;
|
|
14
|
+
ancestors: AncestorEntry[];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Walks the flow value tree to locate `targetId`. Returns the target module and
|
|
18
|
+
* the chain of containers from the root down to (but not including) the target.
|
|
19
|
+
* Returns `undefined` if the step is not found in this flow value.
|
|
20
|
+
*
|
|
21
|
+
* Subflow boundaries are NOT crossed: if the target sits inside a `Flow{path}`
|
|
22
|
+
* step's referenced flow, this returns `undefined` because we don't have that
|
|
23
|
+
* subflow's value here.
|
|
24
|
+
*/
|
|
25
|
+
export declare function findStepPath(modules: FlowModule[], targetId: string): StepPath | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Inline-expanded subflows produce step IDs like
|
|
28
|
+
* `subflow:<outer_subflow_step>:[<nested_subflow_step>:...]<leaf>`. Each `:`-separated
|
|
29
|
+
* segment after the `subflow:` marker is a step ID; the last segment is the leaf
|
|
30
|
+
* (the user's selected step) and the preceding segments are subflow steps along
|
|
31
|
+
* the way (each one a `Flow{path}` module).
|
|
32
|
+
*
|
|
33
|
+
* Returns the parsed segments + leaf, or `undefined` if `id` is not a subflow-prefixed
|
|
34
|
+
* step.
|
|
35
|
+
*/
|
|
36
|
+
export declare function parseExpandedSubflowId(id: string): {
|
|
37
|
+
subflowSteps: string[];
|
|
38
|
+
leaf: string;
|
|
39
|
+
} | undefined;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Walks the flow value tree to locate `targetId`. Returns the target module and
|
|
3
|
+
* the chain of containers from the root down to (but not including) the target.
|
|
4
|
+
* Returns `undefined` if the step is not found in this flow value.
|
|
5
|
+
*
|
|
6
|
+
* Subflow boundaries are NOT crossed: if the target sits inside a `Flow{path}`
|
|
7
|
+
* step's referenced flow, this returns `undefined` because we don't have that
|
|
8
|
+
* subflow's value here.
|
|
9
|
+
*/
|
|
10
|
+
export function findStepPath(modules, targetId) {
|
|
11
|
+
for (const mod of modules) {
|
|
12
|
+
if (mod.id === targetId) {
|
|
13
|
+
return { target: mod, ancestors: [] };
|
|
14
|
+
}
|
|
15
|
+
const value = mod.value;
|
|
16
|
+
if (value.type === 'forloopflow' || value.type === 'whileloopflow') {
|
|
17
|
+
const sub = findStepPath(value.modules, targetId);
|
|
18
|
+
if (sub) {
|
|
19
|
+
return {
|
|
20
|
+
target: sub.target,
|
|
21
|
+
ancestors: [
|
|
22
|
+
{ stepId: mod.id, type: value.type, parallel: value.parallel === true },
|
|
23
|
+
...sub.ancestors
|
|
24
|
+
]
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
else if (value.type === 'branchone') {
|
|
29
|
+
const allBranches = [
|
|
30
|
+
{ idx: -1, modules: value.default }
|
|
31
|
+
];
|
|
32
|
+
value.branches.forEach((b, i) => allBranches.push({ idx: i, modules: b.modules }));
|
|
33
|
+
for (const { idx, modules: bm } of allBranches) {
|
|
34
|
+
const sub = findStepPath(bm, targetId);
|
|
35
|
+
if (sub) {
|
|
36
|
+
return {
|
|
37
|
+
target: sub.target,
|
|
38
|
+
ancestors: [{ stepId: mod.id, type: 'branchone', branchIndex: idx }, ...sub.ancestors]
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
else if (value.type === 'branchall') {
|
|
44
|
+
for (let i = 0; i < value.branches.length; i++) {
|
|
45
|
+
const sub = findStepPath(value.branches[i].modules, targetId);
|
|
46
|
+
if (sub) {
|
|
47
|
+
return {
|
|
48
|
+
target: sub.target,
|
|
49
|
+
ancestors: [
|
|
50
|
+
{
|
|
51
|
+
stepId: mod.id,
|
|
52
|
+
type: 'branchall',
|
|
53
|
+
branchIndex: i,
|
|
54
|
+
parallel: value.parallel === true
|
|
55
|
+
},
|
|
56
|
+
...sub.ancestors
|
|
57
|
+
]
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Inline-expanded subflows produce step IDs like
|
|
67
|
+
* `subflow:<outer_subflow_step>:[<nested_subflow_step>:...]<leaf>`. Each `:`-separated
|
|
68
|
+
* segment after the `subflow:` marker is a step ID; the last segment is the leaf
|
|
69
|
+
* (the user's selected step) and the preceding segments are subflow steps along
|
|
70
|
+
* the way (each one a `Flow{path}` module).
|
|
71
|
+
*
|
|
72
|
+
* Returns the parsed segments + leaf, or `undefined` if `id` is not a subflow-prefixed
|
|
73
|
+
* step.
|
|
74
|
+
*/
|
|
75
|
+
export function parseExpandedSubflowId(id) {
|
|
76
|
+
if (!id.startsWith('subflow:')) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
const parts = id
|
|
80
|
+
.slice('subflow:'.length)
|
|
81
|
+
.split(':')
|
|
82
|
+
.filter((p) => p.length > 0);
|
|
83
|
+
if (parts.length < 2) {
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
const leaf = parts[parts.length - 1];
|
|
87
|
+
const subflowSteps = parts.slice(0, -1);
|
|
88
|
+
return { subflowSteps, leaf };
|
|
89
|
+
}
|
|
@@ -24,6 +24,7 @@ export type FieldPresenceConfig = Record<JobCategory, Record<JobField, boolean>>
|
|
|
24
24
|
* Categorizes a job based on its job_kind
|
|
25
25
|
*/
|
|
26
26
|
export declare function getJobCategory(job: Job): JobCategory;
|
|
27
|
+
export declare function isFlowVersionHash(job: Job): boolean;
|
|
27
28
|
/**
|
|
28
29
|
* Gets trigger information from a job
|
|
29
30
|
*/
|
|
@@ -37,6 +37,21 @@ export function getJobCategory(job) {
|
|
|
37
37
|
return 'script'; // Default fallback
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
+
// For flow/app-shaped jobs `script_hash` is a flow_version/app_version id
|
|
41
|
+
// (i64) serialized as zero-padded 16-char hex.
|
|
42
|
+
export function isFlowVersionHash(job) {
|
|
43
|
+
switch (job.job_kind) {
|
|
44
|
+
case 'flow':
|
|
45
|
+
case 'flowpreview':
|
|
46
|
+
case 'singlestepflow':
|
|
47
|
+
case 'flownode':
|
|
48
|
+
case 'flowdependencies':
|
|
49
|
+
case 'appdependencies':
|
|
50
|
+
return true;
|
|
51
|
+
default:
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
40
55
|
/**
|
|
41
56
|
* Gets trigger information from a job
|
|
42
57
|
*/
|
|
@@ -158,10 +173,44 @@ export const fieldConfigs = {
|
|
|
158
173
|
script_hash: {
|
|
159
174
|
field: 'script_hash',
|
|
160
175
|
label: 'Hash',
|
|
161
|
-
getValue: (job) =>
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
176
|
+
getValue: (job) => {
|
|
177
|
+
if (!job.script_hash)
|
|
178
|
+
return null;
|
|
179
|
+
// Decode hex → decimal for flow/app version ids.
|
|
180
|
+
if (isFlowVersionHash(job)) {
|
|
181
|
+
try {
|
|
182
|
+
return BigInt('0x' + job.script_hash).toString();
|
|
183
|
+
}
|
|
184
|
+
catch {
|
|
185
|
+
return job.script_hash.toString();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return job.script_hash.toString();
|
|
189
|
+
},
|
|
190
|
+
getHref: (job, workspaceId) => {
|
|
191
|
+
if (!job.script_hash)
|
|
192
|
+
return null;
|
|
193
|
+
if (job.job_kind === 'script' || job.job_kind === 'dependencies') {
|
|
194
|
+
return `/scripts/get/${job.script_hash}?workspace=${workspaceId}`;
|
|
195
|
+
}
|
|
196
|
+
// Only flow-shaped jobs have a pinned-version viewer; app dep stays unlinked.
|
|
197
|
+
const isFlowKind = job.job_kind === 'flow' ||
|
|
198
|
+
job.job_kind === 'flowpreview' ||
|
|
199
|
+
job.job_kind === 'singlestepflow' ||
|
|
200
|
+
job.job_kind === 'flownode' ||
|
|
201
|
+
job.job_kind === 'flowdependencies';
|
|
202
|
+
if (isFlowKind && job.script_path) {
|
|
203
|
+
let version;
|
|
204
|
+
try {
|
|
205
|
+
version = BigInt('0x' + job.script_hash).toString();
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
return `/flows/get/${job.script_path}?workspace=${workspaceId}&version=${version}`;
|
|
211
|
+
}
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
165
214
|
},
|
|
166
215
|
script_path: {
|
|
167
216
|
field: 'script_path',
|
|
@@ -171,9 +220,7 @@ export const fieldConfigs = {
|
|
|
171
220
|
if (!job.script_path)
|
|
172
221
|
return null;
|
|
173
222
|
const isScript = job.job_kind === 'script';
|
|
174
|
-
return isScript
|
|
175
|
-
? `/scripts/get/${job.script_hash}`
|
|
176
|
-
: flowPathToHref(job.script_path);
|
|
223
|
+
return isScript ? `/scripts/get/${job.script_hash}` : flowPathToHref(job.script_path);
|
|
177
224
|
}
|
|
178
225
|
},
|
|
179
226
|
worker: {
|
|
@@ -266,6 +313,7 @@ export const categoryFieldPresence = {
|
|
|
266
313
|
worker: true,
|
|
267
314
|
run_id: true,
|
|
268
315
|
script_path: true,
|
|
316
|
+
script_hash: true,
|
|
269
317
|
flow_status: false,
|
|
270
318
|
duration: false,
|
|
271
319
|
// Optional fields
|
|
@@ -273,7 +321,6 @@ export const categoryFieldPresence = {
|
|
|
273
321
|
trigger_info: false,
|
|
274
322
|
parent_job: false,
|
|
275
323
|
schedule_path: false,
|
|
276
|
-
script_hash: false,
|
|
277
324
|
language: false,
|
|
278
325
|
step_info: false,
|
|
279
326
|
priority: false,
|
|
@@ -286,14 +333,14 @@ export const categoryFieldPresence = {
|
|
|
286
333
|
worker: true,
|
|
287
334
|
run_id: true,
|
|
288
335
|
started_at: true,
|
|
336
|
+
script_hash: true,
|
|
337
|
+
script_path: true,
|
|
289
338
|
duration: false,
|
|
290
339
|
// Optional fields
|
|
291
340
|
memory_peak: false,
|
|
292
341
|
trigger_info: false,
|
|
293
342
|
parent_job: false,
|
|
294
343
|
schedule_path: false,
|
|
295
|
-
script_hash: false,
|
|
296
|
-
script_path: false,
|
|
297
344
|
language: false,
|
|
298
345
|
step_info: false,
|
|
299
346
|
flow_status: false,
|