windmill-components 1.389.2 → 1.394.3
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/assets/app.css +4 -3
- package/package/components/AppConnectInner.svelte +18 -10
- package/package/components/ArgInfo.svelte +1 -1
- package/package/components/ArgInput.svelte +22 -2
- package/package/components/AutheliaSetting.svelte +1 -0
- package/package/components/AuthentikSetting.svelte +1 -0
- package/package/components/BoundedInputNumber +0 -0
- package/package/components/CliHelpBox.svelte +2 -2
- package/package/components/DateInput.svelte +1 -0
- package/package/components/DisplayResult.svelte +39 -31
- package/package/components/Editor.svelte +0 -21
- package/package/components/ErrorOrRecoveryHandler.svelte +7 -1
- package/package/components/ErrorOrRecoveryHandler.svelte.d.ts +1 -1
- package/package/components/FlowBuilder.svelte +2 -2
- package/package/components/FlowGraphViewerStep.svelte +22 -0
- package/package/components/FlowJobResult.svelte +1 -0
- package/package/components/FlowMetadata.svelte +3 -2
- package/package/components/FlowStatusViewer.svelte +2 -0
- package/package/components/FlowStatusViewer.svelte.d.ts +2 -0
- package/package/components/FlowStatusViewerInner.svelte +10 -5
- package/package/components/FlowStatusViewerInner.svelte.d.ts +1 -0
- package/package/components/FolderEditor.svelte +1 -1
- package/package/components/IdEditorInput.svelte +82 -0
- package/package/components/IdEditorInput.svelte.d.ts +26 -0
- package/package/components/InputTransformForm.svelte +10 -10
- package/package/components/InputTransformForm.svelte.d.ts +4 -1
- package/package/components/InputTransformSchemaForm.svelte.d.ts +3 -1
- package/package/components/InstanceSettings.svelte +73 -12
- package/package/components/ItemPicker.svelte +1 -0
- package/package/components/KanidmSetting.svelte +1 -0
- package/package/components/KeycloakSetting.svelte +1 -0
- package/package/components/LightweightArgInput.svelte +2 -0
- package/package/components/LogViewer.svelte +206 -0
- package/package/components/ModulePreview.svelte.d.ts +3 -1
- package/package/components/ModulePreviewForm.svelte +2 -2
- package/package/components/ModulePreviewForm.svelte.d.ts +4 -1
- package/package/components/OAuthSetting.svelte +11 -10
- package/package/components/ObjectStoreConfigSettings.svelte +6 -6
- package/package/components/OktaSetting.svelte +1 -0
- package/package/components/Password.svelte +30 -35
- package/package/components/RunChart.svelte +16 -0
- package/package/components/RunChart.svelte.d.ts +2 -0
- package/package/components/SavedInputs.svelte +4 -4
- package/package/components/ScheduleEditorInner.svelte +145 -2
- package/package/components/SchemaForm.svelte +1 -2
- package/package/components/ScriptBuilder.svelte +1 -0
- package/package/components/TestConnection.svelte +24 -6
- package/package/components/TestJobLoader.svelte +2 -0
- package/package/components/ZitadelSetting.svelte +1 -0
- package/package/components/apps/components/display/table/AppAggridInfiniteTable.svelte +0 -1
- package/package/components/apps/components/display/table/AppAggridInfiniteTable.svelte.d.ts +1 -2
- package/package/components/apps/components/display/table/AppAggridInfiniteTableEe.svelte +0 -2
- package/package/components/apps/components/display/table/AppAggridInfiniteTableEe.svelte.d.ts +1 -2
- package/package/components/apps/components/display/table/AppAggridTable.svelte +6 -2
- package/package/components/apps/components/inputs/AppSelect.svelte +18 -17
- package/package/components/apps/editor/AppEditor.svelte +1 -1
- package/package/components/apps/editor/AppPreview.svelte +3 -6
- package/package/components/apps/editor/AppReportsDrawer.svelte +17 -5
- package/package/components/apps/editor/DeploymentHistory.svelte +1 -0
- package/package/components/apps/editor/component/Component.svelte +0 -2
- package/package/components/apps/editor/componentsPanel/themeUtils.js +18 -7
- package/package/components/apps/editor/contextPanel/SubGridOutput.svelte +1 -0
- package/package/components/apps/editor/contextPanel/components/IdEditor.svelte +13 -67
- package/package/components/apps/editor/contextPanel/components/IdEditor.svelte.d.ts +1 -2
- package/package/components/apps/editor/settingsPanel/ComponentPanel.svelte +0 -1
- package/package/components/apps/editor/settingsPanel/DecisionTreeGraphEditor.svelte +0 -1
- package/package/components/apps/editor/settingsPanel/DecisionTreeGraphEditor.svelte.d.ts +0 -1
- package/package/components/apps/editor/settingsPanel/DecisionTreeGraphNode.svelte +1 -1
- package/package/components/apps/editor/settingsPanel/decisionTree/InsertDecisionTreeNode.svelte +2 -2
- package/package/components/apps/editor/settingsPanel/inputEditor/IconSelectInput.svelte +1 -0
- package/package/components/apps/svelte-select/lib/Select.svelte +1 -0
- package/package/components/build_workers.js +24 -18
- package/package/components/common/button/Button.svelte +3 -4
- package/package/components/common/button/model.d.ts +1 -1
- package/package/components/common/button/model.js +6 -0
- package/package/components/common/clearableInput/ClearableInput.svelte +1 -0
- package/package/components/common/menu/MenuItem.svelte +1 -0
- package/package/components/common/modal/AlwaysMountedModal.svelte +1 -0
- package/package/components/common/stepper/Stepper.svelte +1 -0
- package/package/components/copilot/StepInputsGen.svelte +2 -2
- package/package/components/copilot/StepInputsGen.svelte.d.ts +3 -1
- package/package/components/copilot/lib.js +2 -2
- package/package/components/details/ClipboardPanel.svelte +1 -0
- package/package/components/flows/content/DynamicInputHelpBox.svelte +4 -1
- package/package/components/flows/content/FlowConstants.svelte +3 -3
- package/package/components/flows/content/FlowEditorPanel.svelte +1 -1
- package/package/components/flows/content/FlowModuleComponent.svelte +2 -2
- package/package/components/flows/content/FlowModuleHeader.svelte +5 -45
- package/package/components/flows/content/FlowModuleWorkerTagSelect.svelte +47 -0
- package/package/components/flows/content/FlowModuleWorkerTagSelect.svelte.d.ts +16 -0
- package/package/components/flows/content/FlowSettings.svelte +1 -0
- package/package/components/flows/flowModuleNextId.js +1 -1
- package/package/components/flows/flowState.d.ts +1 -1
- package/package/components/flows/flowStateUtils.d.ts +1 -1
- package/package/components/flows/flowStateUtils.js +1 -1
- package/package/components/flows/flowStore.d.ts +1 -0
- package/package/components/flows/flowStore.js +5 -0
- package/package/components/flows/map/FlowJobsMenu.svelte +0 -1
- package/package/components/flows/map/FlowJobsMenu.svelte.d.ts +0 -1
- package/package/components/flows/map/FlowModuleSchemaItem.svelte +103 -19
- package/package/components/flows/map/FlowModuleSchemaItem.svelte.d.ts +1 -0
- package/package/components/flows/map/FlowModuleSchemaMap.svelte +31 -1
- package/package/components/flows/map/InsertModuleButton.svelte +5 -5
- package/package/components/flows/map/InsertTriggerButton.svelte +2 -2
- package/package/components/flows/map/MapItem.svelte +4 -0
- package/package/components/flows/map/MapItem.svelte.d.ts +1 -0
- package/package/components/flows/map/VirtualItem.svelte +15 -7
- package/package/components/flows/map/VirtualItem.svelte.d.ts +2 -1
- package/package/components/flows/previousResults.js +1 -1
- package/package/components/flows/utils.d.ts +3 -3
- package/package/components/flows/utils.js +2 -2
- package/package/components/graph/FlowGraphV2.svelte +4 -0
- package/package/components/graph/FlowGraphV2.svelte.d.ts +1 -0
- package/package/components/graph/graphBuilder.d.ts +1 -0
- package/package/components/graph/graphBuilder.js +2 -4
- package/package/components/graph/renderers/edges/BaseEdge.svelte +2 -2
- package/package/components/graph/renderers/nodes/BranchAllStart.svelte +2 -1
- package/package/components/graph/renderers/nodes/BranchOneStart.svelte +3 -3
- package/package/components/graph/renderers/nodes/BranchOneStart.svelte.d.ts +1 -0
- package/package/components/graph/renderers/nodes/InputNode.svelte +2 -2
- package/package/components/graph/renderers/nodes/ModuleNode.svelte +6 -2
- package/package/components/graph/util.d.ts +1 -1
- package/package/components/graph/util.js +7 -2
- package/package/components/icons/AzureIcon.svelte +1 -1
- package/package/components/icons/FunkwhaleIcon.svelte +1 -19
- package/package/components/icons/JumpCloudIcon.svelte +12 -0
- package/package/components/icons/JumpCloudIcon.svelte.d.ts +17 -0
- package/package/components/icons/KeycloakIcon.svelte +20 -0
- package/package/components/icons/KeycloakIcon.svelte.d.ts +17 -0
- package/package/components/icons/MailchimpIcon.svelte +1 -1
- package/package/components/icons/ZitadelIcon.svelte +76 -0
- package/package/components/icons/ZitadelIcon.svelte.d.ts +17 -0
- package/package/components/icons/index.d.ts +7 -1
- package/package/components/icons/index.js +8 -2
- package/package/components/instanceSettings.d.ts +1 -1
- package/package/components/instanceSettings.js +24 -15
- package/package/components/runs/JobLoader.svelte +17 -6
- package/package/components/runs/JobLoader.svelte.d.ts +2 -0
- package/package/components/runs/RunRow.svelte +7 -7
- package/package/components/runs/RunsFilter.svelte +8 -1
- package/package/components/runs/RunsTable.svelte +30 -8
- package/package/components/runs/RunsTable.svelte.d.ts +2 -0
- package/package/components/schema/PropertyEditor.svelte +0 -5
- package/package/components/settings/WorkspaceUserSettings.svelte +1 -1
- package/package/components/sidebar/MenuLink.svelte +2 -1
- package/package/components/sidebar/WorkspaceMenu.svelte +4 -1
- package/package/components/sidebar/changelogs.js +30 -0
- package/package/components/tutorials/FlowBuilderTutorialsForLoop.svelte +2 -2
- package/package/gen/core/OpenAPI.js +1 -1
- package/package/gen/schemas.gen.d.ts +21 -0
- package/package/gen/schemas.gen.js +21 -0
- package/package/gen/services.gen.d.ts +11 -12
- package/package/gen/services.gen.js +19 -24
- package/package/gen/types.gen.d.ts +62 -37
- package/package/hub.d.ts +1 -0
- package/package/hubPaths.json +11 -8
- package/package.json +4 -4
- package/package/windmill_fetch.d.ts.txt +0 -16966
|
@@ -19,8 +19,8 @@ $: resources = Object.fromEntries(scriptModules
|
|
|
19
19
|
let schema = $flowStateStore[m.id]?.schema;
|
|
20
20
|
let val = undefined;
|
|
21
21
|
const [k, inputTransform] = x;
|
|
22
|
-
const v = schema
|
|
23
|
-
if (v
|
|
22
|
+
const v = schema?.properties[k];
|
|
23
|
+
if (v?.format?.includes('resource') &&
|
|
24
24
|
inputTransform.type === 'static' &&
|
|
25
25
|
(inputTransform.value === '' ||
|
|
26
26
|
inputTransform.value === undefined ||
|
|
@@ -41,7 +41,7 @@ $: steps = scriptModules
|
|
|
41
41
|
Object.entries(v.input_transforms)
|
|
42
42
|
.filter((x) => {
|
|
43
43
|
const shouldDisplay = hideOptional
|
|
44
|
-
? $flowStateStore[m.id]?.schema
|
|
44
|
+
? $flowStateStore[m.id]?.schema?.required?.includes(x[0])
|
|
45
45
|
: true;
|
|
46
46
|
return x[1].type == 'static' && shouldDisplay;
|
|
47
47
|
})
|
|
@@ -28,7 +28,7 @@ async function initWarnings() {
|
|
|
28
28
|
$flowInputsStore = {};
|
|
29
29
|
}
|
|
30
30
|
$flowInputsStore[module?.id] = {
|
|
31
|
-
flowStepWarnings: await initFlowStepWarnings(module.value, $flowStateStore?.[module?.id]?.schema
|
|
31
|
+
flowStepWarnings: await initFlowStepWarnings(module.value, $flowStateStore?.[module?.id]?.schema, dfs($flowStore.value.modules, (fm) => fm.id))
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -150,7 +150,7 @@ function onSelectedIdChange() {
|
|
|
150
150
|
}
|
|
151
151
|
let debouncedWarning = debounce((argName) => {
|
|
152
152
|
if ($flowInputsStore) {
|
|
153
|
-
computeFlowStepWarning(argName, flowModule.value, $flowInputsStore[flowModule.id].flowStepWarnings ?? {}, $flowStateStore[$selectedId]?.schema
|
|
153
|
+
computeFlowStepWarning(argName, flowModule.value, $flowInputsStore[flowModule.id].flowStepWarnings ?? {}, $flowStateStore[$selectedId]?.schema, dfs($flowStore?.value?.modules ?? [], (fm) => fm.id) ?? []).then((flowStepWarnings) => {
|
|
154
154
|
$flowInputsStore[flowModule.id].flowStepWarnings = flowStepWarnings;
|
|
155
155
|
});
|
|
156
156
|
}
|
|
@@ -204,7 +204,6 @@ function setFlowInput(argName) {
|
|
|
204
204
|
flowModule,
|
|
205
205
|
$selectedId,
|
|
206
206
|
$flowStateStore[flowModule.id].schema,
|
|
207
|
-
$flowStore,
|
|
208
207
|
$pathStore
|
|
209
208
|
)
|
|
210
209
|
flowModule = module
|
|
@@ -450,6 +449,7 @@ function setFlowInput(argName) {
|
|
|
450
449
|
using `$args[name_of_arg]`</Tooltip
|
|
451
450
|
>
|
|
452
451
|
</svelte:fragment>
|
|
452
|
+
<!-- svelte-ignore a11y-autofocus -->
|
|
453
453
|
<input
|
|
454
454
|
type="text"
|
|
455
455
|
autofocus
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
<script>import Button from '../../common/button/Button.svelte';
|
|
2
|
-
import {
|
|
2
|
+
import {} from '../../../gen';
|
|
3
3
|
import { createEventDispatcher, getContext } from 'svelte';
|
|
4
4
|
import { Bed, Database, Gauge, GitFork, Pen, PhoneIncoming, Repeat, Save, Square, Voicemail } from 'lucide-svelte';
|
|
5
5
|
import Popover from '../../Popover.svelte';
|
|
6
6
|
import { sendUserToast } from '../../../utils';
|
|
7
|
-
import { workerTags } from '../../../stores';
|
|
8
7
|
import { getLatestHashForScript } from '../../../scripts';
|
|
8
|
+
import FlowModuleWorkerTagSelect from './FlowModuleWorkerTagSelect.svelte';
|
|
9
9
|
export let module;
|
|
10
|
-
const { scriptEditorDrawer
|
|
10
|
+
const { scriptEditorDrawer } = getContext('FlowEditorContext');
|
|
11
11
|
const dispatch = createEventDispatcher();
|
|
12
12
|
let customUi = getContext('customUi');
|
|
13
|
-
loadWorkerGroups();
|
|
14
|
-
async function loadWorkerGroups() {
|
|
15
|
-
if (!$workerTags) {
|
|
16
|
-
$workerTags = await WorkerService.getCustomTags();
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
13
|
$: moduleRetry = module.retry?.constant || module.retry?.exponential;
|
|
20
14
|
</script>
|
|
21
15
|
|
|
@@ -114,6 +108,7 @@ $: moduleRetry = module.retry?.constant || module.retry?.exponential;
|
|
|
114
108
|
Edit {#if module.value.hash != undefined} (locked hash){/if}
|
|
115
109
|
</Button>
|
|
116
110
|
{/if}
|
|
111
|
+
<FlowModuleWorkerTagSelect bind:tag={module.value.tag_override} />
|
|
117
112
|
{#if customUi?.scriptFork != false}
|
|
118
113
|
<Button
|
|
119
114
|
size="xs"
|
|
@@ -128,42 +123,7 @@ $: moduleRetry = module.retry?.constant || module.retry?.exponential;
|
|
|
128
123
|
{/if}
|
|
129
124
|
<div class="px-0.5" />
|
|
130
125
|
{#if module.value.type === 'rawscript'}
|
|
131
|
-
{
|
|
132
|
-
{#if $workerTags?.length > 0}
|
|
133
|
-
<div class="w-40">
|
|
134
|
-
{#if $flowStore.tag == undefined}
|
|
135
|
-
<select
|
|
136
|
-
placeholder="Tag"
|
|
137
|
-
bind:value={module.value.tag}
|
|
138
|
-
on:change={(e) => {
|
|
139
|
-
if (module.value.type === 'rawscript') {
|
|
140
|
-
if (module.value.tag == '') {
|
|
141
|
-
module.value.tag = undefined
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}}
|
|
145
|
-
>
|
|
146
|
-
{#if module.value.tag}
|
|
147
|
-
<option value="">reset to default</option>
|
|
148
|
-
{:else}
|
|
149
|
-
<option value="" disabled selected>Tag</option>
|
|
150
|
-
{/if}
|
|
151
|
-
{#each $workerTags ?? [] as tag (tag)}
|
|
152
|
-
<option value={tag}>{tag}</option>
|
|
153
|
-
{/each}
|
|
154
|
-
</select>
|
|
155
|
-
{:else}
|
|
156
|
-
<button
|
|
157
|
-
title="Worker Group is defined at the flow level"
|
|
158
|
-
class="w-full text-left items-center font-normal p-1 border text-xs rounded"
|
|
159
|
-
on:click={() => ($selectedId = 'settings-worker-group')}
|
|
160
|
-
>
|
|
161
|
-
Flow's WG: {$flowStore.tag}
|
|
162
|
-
</button>
|
|
163
|
-
{/if}
|
|
164
|
-
</div>
|
|
165
|
-
{/if}
|
|
166
|
-
{/if}
|
|
126
|
+
<FlowModuleWorkerTagSelect bind:tag={module.value.tag} />
|
|
167
127
|
<Button
|
|
168
128
|
size="xs"
|
|
169
129
|
color="light"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script>import { getContext } from 'svelte';
|
|
2
|
+
import { workerTags } from '../../../stores';
|
|
3
|
+
import { WorkerService } from '../../../gen';
|
|
4
|
+
export let tag;
|
|
5
|
+
const { flowStore, selectedId } = getContext('FlowEditorContext');
|
|
6
|
+
loadWorkerGroups();
|
|
7
|
+
async function loadWorkerGroups() {
|
|
8
|
+
if (!$workerTags) {
|
|
9
|
+
$workerTags = await WorkerService.getCustomTags();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
{#if $workerTags}
|
|
15
|
+
{#if $workerTags?.length > 0}
|
|
16
|
+
<div class="w-40">
|
|
17
|
+
{#if $flowStore.tag == undefined}
|
|
18
|
+
<select
|
|
19
|
+
placeholder="Tag"
|
|
20
|
+
bind:value={tag}
|
|
21
|
+
on:change={(e) => {
|
|
22
|
+
if (tag == '') {
|
|
23
|
+
tag = undefined
|
|
24
|
+
}
|
|
25
|
+
}}
|
|
26
|
+
>
|
|
27
|
+
{#if tag}
|
|
28
|
+
<option value="">reset to default</option>
|
|
29
|
+
{:else}
|
|
30
|
+
<option value="" disabled selected>Tag</option>
|
|
31
|
+
{/if}
|
|
32
|
+
{#each $workerTags ?? [] as tag (tag)}
|
|
33
|
+
<option value={tag}>{tag}</option>
|
|
34
|
+
{/each}
|
|
35
|
+
</select>
|
|
36
|
+
{:else}
|
|
37
|
+
<button
|
|
38
|
+
title="Worker Group is defined at the flow level"
|
|
39
|
+
class="w-full text-left items-center font-normal p-1 border text-xs rounded"
|
|
40
|
+
on:click={() => ($selectedId = 'settings-worker-group')}
|
|
41
|
+
>
|
|
42
|
+
Flow's WG: {$flowStore.tag}
|
|
43
|
+
</button>
|
|
44
|
+
{/if}
|
|
45
|
+
</div>
|
|
46
|
+
{/if}
|
|
47
|
+
{/if}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
tag: string | undefined;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {};
|
|
10
|
+
};
|
|
11
|
+
export type FlowModuleWorkerTagSelectProps = typeof __propDef.props;
|
|
12
|
+
export type FlowModuleWorkerTagSelectEvents = typeof __propDef.events;
|
|
13
|
+
export type FlowModuleWorkerTagSelectSlots = typeof __propDef.slots;
|
|
14
|
+
export default class FlowModuleWorkerTagSelect extends SvelteComponent<FlowModuleWorkerTagSelectProps, FlowModuleWorkerTagSelectEvents, FlowModuleWorkerTagSelectSlots> {
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -37,6 +37,7 @@ let dirtyPath = false;
|
|
|
37
37
|
<div class="h-full overflow-hidden">
|
|
38
38
|
<FlowCard {noEditor} title="Settings">
|
|
39
39
|
<div class="h-full flex-1">
|
|
40
|
+
<!-- svelte-ignore a11y-autofocus -->
|
|
40
41
|
<Tabs bind:selected={$selectedId}>
|
|
41
42
|
<Tab value="settings-metadata">Metadata</Tab>
|
|
42
43
|
{#if !noEditor && customUi?.settingsTabs?.schedule != false}
|
|
@@ -4,7 +4,7 @@ import { charsToNumber, numberToChars } from './idUtils';
|
|
|
4
4
|
export function nextId(flowState, fullFlow) {
|
|
5
5
|
const allIds = dfs(fullFlow.value.modules, (fm) => fm.id);
|
|
6
6
|
const max = allIds.concat(Object.keys(flowState)).reduce((acc, key) => {
|
|
7
|
-
if (key
|
|
7
|
+
if (key.length >= 4) {
|
|
8
8
|
return acc;
|
|
9
9
|
}
|
|
10
10
|
else {
|
|
@@ -20,7 +20,7 @@ export declare function fork(flowModule: FlowModule): Promise<[FlowModule & {
|
|
|
20
20
|
value: RawScript;
|
|
21
21
|
}, FlowModuleState]>;
|
|
22
22
|
export declare function emptyModule(flowState: FlowState, fullFlow: OpenFlow, flow?: boolean): FlowModule;
|
|
23
|
-
export declare function createScriptFromInlineScript(flowModule: FlowModule, suffix: string, schema: Schema
|
|
23
|
+
export declare function createScriptFromInlineScript(flowModule: FlowModule, suffix: string, schema: Schema | undefined, flowPath: string): Promise<[FlowModule & {
|
|
24
24
|
value: PathScript;
|
|
25
25
|
}, FlowModuleState]>;
|
|
26
26
|
export declare function deleteFlowStateById(id: string, flowStateStore: Writable<FlowState>): void;
|
|
@@ -142,7 +142,7 @@ export function emptyModule(flowState, fullFlow, flow) {
|
|
|
142
142
|
value: { type: 'identity', flow }
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
|
-
export async function createScriptFromInlineScript(flowModule, suffix, schema,
|
|
145
|
+
export async function createScriptFromInlineScript(flowModule, suffix, schema, flowPath) {
|
|
146
146
|
const user = get(userStore);
|
|
147
147
|
if (flowModule.value.type != 'rawscript') {
|
|
148
148
|
throw new Error("Can't create script from non-inline script");
|
|
@@ -6,3 +6,4 @@ export type FlowMode = 'push' | 'pull';
|
|
|
6
6
|
export declare const importFlowStore: Writable<Flow | undefined>;
|
|
7
7
|
export declare function initFlow(flow: Flow, flowStore: Writable<Flow>, flowStateStore: Writable<FlowState>): Promise<void>;
|
|
8
8
|
export declare function copyFirstStepSchema(flowState: FlowState, flowStore: Writable<OpenFlow>): Promise<void>;
|
|
9
|
+
export declare function replaceId(expr: string, id: string, newId: string): string;
|
|
@@ -23,3 +23,8 @@ export async function copyFirstStepSchema(flowState, flowStore) {
|
|
|
23
23
|
return flow;
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
+
export function replaceId(expr, id, newId) {
|
|
27
|
+
return expr
|
|
28
|
+
.replaceAll(`results.${id}`, `results.${newId}`)
|
|
29
|
+
.replaceAll(`results?.${id}`, `results?.${newId}`);
|
|
30
|
+
}
|
|
@@ -3,7 +3,6 @@ import { createEventDispatcher } from 'svelte';
|
|
|
3
3
|
import { ListFilter } from 'lucide-svelte';
|
|
4
4
|
import { MenuItem } from '@rgossiaux/svelte-headlessui';
|
|
5
5
|
const dispatch = createEventDispatcher();
|
|
6
|
-
export let open = undefined;
|
|
7
6
|
export let index;
|
|
8
7
|
export let flowJobs;
|
|
9
8
|
export let flowJobsSuccess;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
<script>import Badge from '../../common/badge/Badge.svelte';
|
|
2
2
|
import Popover from '../../Popover.svelte';
|
|
3
3
|
import { classNames } from '../../../utils';
|
|
4
|
-
import { AlertTriangle, Bed, Database, Gauge, Move, PhoneIncoming, Repeat, Square, Voicemail, X } from 'lucide-svelte';
|
|
4
|
+
import { AlertTriangle, Bed, Database, Gauge, Move, Pencil, PhoneIncoming, Repeat, Square, Voicemail, X } from 'lucide-svelte';
|
|
5
5
|
import { createEventDispatcher, getContext } from 'svelte';
|
|
6
6
|
import { fade } from 'svelte/transition';
|
|
7
|
+
import { get } from 'svelte/store';
|
|
7
8
|
import { twMerge } from 'tailwind-merge';
|
|
9
|
+
import IdEditorInput from '../../IdEditorInput.svelte';
|
|
10
|
+
import { dfs } from '../dfs';
|
|
11
|
+
import { Drawer } from '../../common';
|
|
12
|
+
import DrawerContent from '../../common/drawer/DrawerContent.svelte';
|
|
13
|
+
import { getDependeeAndDependentComponents } from '../flowExplorer';
|
|
14
|
+
import { replaceId } from '../flowStore';
|
|
8
15
|
export let selected = false;
|
|
9
16
|
export let deletable = false;
|
|
10
17
|
export let retry = false;
|
|
@@ -22,20 +29,84 @@ export let concurrency = false;
|
|
|
22
29
|
export let retries = undefined;
|
|
23
30
|
export let warningMessage = undefined;
|
|
24
31
|
const { flowInputsStore } = getContext('FlowGraphContext');
|
|
32
|
+
const flowEditorContext = getContext('FlowEditorContext');
|
|
25
33
|
const dispatch = createEventDispatcher();
|
|
26
34
|
const { currentStepStore: copilotCurrentStepStore } = getContext('FlowCopilotContext') || {};
|
|
35
|
+
let editId = false;
|
|
36
|
+
let newId = id ?? '';
|
|
37
|
+
let hover = false;
|
|
27
38
|
</script>
|
|
28
39
|
|
|
40
|
+
{#if deletable && id && editId}
|
|
41
|
+
{@const flowStore = flowEditorContext?.flowStore ? get(flowEditorContext?.flowStore) : undefined}
|
|
42
|
+
{@const getDeps = getDependeeAndDependentComponents(
|
|
43
|
+
id,
|
|
44
|
+
flowStore?.value.modules ?? [],
|
|
45
|
+
flowStore?.value.failure_module
|
|
46
|
+
)}
|
|
47
|
+
<Drawer bind:open={editId}>
|
|
48
|
+
<DrawerContent title="Edit Step Id {id}" on:close={() => (editId = false)}>
|
|
49
|
+
<div>
|
|
50
|
+
<IdEditorInput
|
|
51
|
+
buttonText="Edit Id "
|
|
52
|
+
btnClasses="!ml-1"
|
|
53
|
+
label=""
|
|
54
|
+
initialId={id}
|
|
55
|
+
acceptUnderScores
|
|
56
|
+
reservedIds={dfs(flowStore?.value.modules ?? [], (x) => x.id)}
|
|
57
|
+
bind:value={newId}
|
|
58
|
+
on:save={(e) => {
|
|
59
|
+
dispatch('changeId', { id, newId: e.detail, deps: getDeps?.dependents ?? {} })
|
|
60
|
+
editId = false
|
|
61
|
+
}}
|
|
62
|
+
on:close={() => {
|
|
63
|
+
editId = false
|
|
64
|
+
}}
|
|
65
|
+
/>
|
|
66
|
+
<div class="mt-8">
|
|
67
|
+
<h3>Step Inputs Replacements</h3>
|
|
68
|
+
<div class="text-2xs text-tertiary pt-0.5">
|
|
69
|
+
Replace all occurrences of `results.<span class="font-bold">{id}</span>` with{' '}
|
|
70
|
+
results.<span class="font-bold">{newId}</span> in the step inputs of all steps that depend
|
|
71
|
+
on it.
|
|
72
|
+
</div>
|
|
73
|
+
<div class="pt-8 flex flex-col gap-y-4">
|
|
74
|
+
{#if Object.keys(getDeps?.dependents ?? {})?.length > 0}
|
|
75
|
+
{#each Object.entries(getDeps?.dependents ?? {}) as dependents}
|
|
76
|
+
<div>
|
|
77
|
+
<h4>{dependents[0]}</h4>
|
|
78
|
+
<div>
|
|
79
|
+
{#each dependents?.[1] as d}
|
|
80
|
+
<div>
|
|
81
|
+
<span class="font-mono text-sm">{d}</span> →
|
|
82
|
+
<span class="font-mono text-sm">{replaceId(d, id, newId)}</span>
|
|
83
|
+
</div>
|
|
84
|
+
{/each}
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
{/each}
|
|
88
|
+
{:else}
|
|
89
|
+
<div class="text-2xs text-tertiary"> No dependents </div>
|
|
90
|
+
{/if}
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</DrawerContent>
|
|
95
|
+
</Drawer>
|
|
96
|
+
{/if}
|
|
97
|
+
|
|
29
98
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
30
99
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
31
100
|
<div
|
|
32
101
|
class={classNames(
|
|
33
102
|
'w-full module flex rounded-sm cursor-pointer',
|
|
34
|
-
selected ? 'outline outline-offset-
|
|
103
|
+
selected ? 'outline outline-offset-0 outline-2 outline-slate-500 dark:outline-gray-400' : '',
|
|
35
104
|
'flex relative',
|
|
36
105
|
$copilotCurrentStepStore === id ? 'z-[901]' : ''
|
|
37
106
|
)}
|
|
38
107
|
style="width: 275px; height: 34px; background-color: {bgColor};"
|
|
108
|
+
on:mouseenter={() => (hover = true)}
|
|
109
|
+
on:mouseleave={() => (hover = false)}
|
|
39
110
|
on:click
|
|
40
111
|
>
|
|
41
112
|
<div class="absolute text-sm right-12 -bottom-3 flex flex-row gap-1 z-10">
|
|
@@ -46,7 +117,7 @@ const { currentStepStore: copilotCurrentStepStore } = getContext('FlowCopilotCon
|
|
|
46
117
|
class="center-center rounded border bg-surface border-gray-400 text-secondary px-1 py-0.5"
|
|
47
118
|
>
|
|
48
119
|
{#if retries}<span class="text-red-400 mr-2">{retries}</span>{/if}
|
|
49
|
-
<Repeat size={
|
|
120
|
+
<Repeat size={12} />
|
|
50
121
|
</div>
|
|
51
122
|
<svelte:fragment slot="text">Retries</svelte:fragment>
|
|
52
123
|
</Popover>
|
|
@@ -58,7 +129,7 @@ const { currentStepStore: copilotCurrentStepStore } = getContext('FlowCopilotCon
|
|
|
58
129
|
transition:fade|local={{ duration: 200 }}
|
|
59
130
|
class="center-center rounded border bg-surface border-gray-400 text-secondary px-1 py-0.5"
|
|
60
131
|
>
|
|
61
|
-
<Gauge size={
|
|
132
|
+
<Gauge size={12} />
|
|
62
133
|
</div>
|
|
63
134
|
<svelte:fragment slot="text">Concurrency Limits</svelte:fragment>
|
|
64
135
|
</Popover>
|
|
@@ -69,7 +140,7 @@ const { currentStepStore: copilotCurrentStepStore } = getContext('FlowCopilotCon
|
|
|
69
140
|
transition:fade|local={{ duration: 200 }}
|
|
70
141
|
class="center-center rounded border bg-surface border-gray-400 text-secondary px-1 py-0.5"
|
|
71
142
|
>
|
|
72
|
-
<Database size={
|
|
143
|
+
<Database size={12} />
|
|
73
144
|
</div>
|
|
74
145
|
<svelte:fragment slot="text">Cached</svelte:fragment>
|
|
75
146
|
</Popover>
|
|
@@ -80,7 +151,7 @@ const { currentStepStore: copilotCurrentStepStore } = getContext('FlowCopilotCon
|
|
|
80
151
|
transition:fade|local={{ duration: 200 }}
|
|
81
152
|
class="center-center bg-surface rounded border border-gray-400 text-secondary px-1 py-0.5"
|
|
82
153
|
>
|
|
83
|
-
<Square size={
|
|
154
|
+
<Square size={12} />
|
|
84
155
|
</div>
|
|
85
156
|
<svelte:fragment slot="text">Early stop/break</svelte:fragment>
|
|
86
157
|
</Popover>
|
|
@@ -91,7 +162,7 @@ const { currentStepStore: copilotCurrentStepStore } = getContext('FlowCopilotCon
|
|
|
91
162
|
transition:fade|local={{ duration: 200 }}
|
|
92
163
|
class="center-center bg-surface rounded border border-gray-400 text-secondary px-1 py-0.5"
|
|
93
164
|
>
|
|
94
|
-
<PhoneIncoming size={
|
|
165
|
+
<PhoneIncoming size={12} />
|
|
95
166
|
</div>
|
|
96
167
|
<svelte:fragment slot="text">Suspend</svelte:fragment>
|
|
97
168
|
</Popover>
|
|
@@ -102,7 +173,7 @@ const { currentStepStore: copilotCurrentStepStore } = getContext('FlowCopilotCon
|
|
|
102
173
|
transition:fade|local={{ duration: 200 }}
|
|
103
174
|
class="center-center bg-surface rounded border border-gray-400 text-secondary px-1 py-0.5"
|
|
104
175
|
>
|
|
105
|
-
<Bed size={
|
|
176
|
+
<Bed size={12} />
|
|
106
177
|
</div>
|
|
107
178
|
<svelte:fragment slot="text">Sleep</svelte:fragment>
|
|
108
179
|
</Popover>
|
|
@@ -113,7 +184,7 @@ const { currentStepStore: copilotCurrentStepStore } = getContext('FlowCopilotCon
|
|
|
113
184
|
transition:fade|local={{ duration: 200 }}
|
|
114
185
|
class="center-center bg-surface rounded border border-gray-400 text-secondary px-1 py-0.5"
|
|
115
186
|
>
|
|
116
|
-
<Voicemail size={
|
|
187
|
+
<Voicemail size={12} />
|
|
117
188
|
</div>
|
|
118
189
|
<svelte:fragment slot="text">Mocked</svelte:fragment>
|
|
119
190
|
</Popover>
|
|
@@ -122,36 +193,49 @@ const { currentStepStore: copilotCurrentStepStore } = getContext('FlowCopilotCon
|
|
|
122
193
|
|
|
123
194
|
<div
|
|
124
195
|
class="flex gap-1 justify-between items-center w-full overflow-hidden rounded-sm
|
|
125
|
-
|
|
196
|
+
p-2 text-2xs module text-primary"
|
|
126
197
|
>
|
|
127
198
|
{#if $$slots.icon}
|
|
128
199
|
<slot name="icon" />
|
|
129
200
|
{/if}
|
|
130
201
|
<div class="truncate" class:font-bold={bold}>{label}</div>
|
|
131
|
-
<div class="flex items-center
|
|
202
|
+
<div class="flex items-center relative">
|
|
132
203
|
{#if id}
|
|
133
204
|
<Badge color="indigo">{id}</Badge>
|
|
205
|
+
|
|
206
|
+
{#if deletable}
|
|
207
|
+
<button
|
|
208
|
+
class="absolute -left-[20px] z-10 h-[20px] rounded-l rounded-t rounded-s w-[20px] trash center-center text-secondary bg-surface duration-150 hover:bg-blue-400 {editId
|
|
209
|
+
? '!bg-blue-400'
|
|
210
|
+
: ''} hover:text-white
|
|
211
|
+
hover:border-blue-700 hover:!visible {hover ? '' : '!hidden'}"
|
|
212
|
+
on:click|preventDefault|stopPropagation={(event) => (editId = !editId)}
|
|
213
|
+
title="Edit Id"><Pencil size={14} /></button
|
|
214
|
+
>
|
|
215
|
+
{/if}
|
|
134
216
|
{/if}
|
|
135
217
|
</div>
|
|
136
218
|
</div>
|
|
137
219
|
{#if deletable}
|
|
138
220
|
<button
|
|
139
|
-
class="absolute -top-[10px] -right-[10px] rounded-full h-[20px] w-[20px] trash center-center text-
|
|
140
|
-
|
|
141
|
-
|
|
221
|
+
class="absolute -top-[10px] -right-[10px] rounded-full h-[20px] w-[20px] trash center-center text-secondary
|
|
222
|
+
outline-[1px] outline dark:outline-gray-500 outline-gray-300 bg-surface duration-150 hover:bg-red-400 hover:text-white
|
|
223
|
+
{hover || selected ? '' : '!hidden'}"
|
|
224
|
+
title="Delete"
|
|
142
225
|
on:click|preventDefault|stopPropagation={(event) =>
|
|
143
226
|
dispatch('delete', { event, id, type: modType })}
|
|
144
227
|
>
|
|
145
|
-
<X class="mx-[3px]" size={
|
|
228
|
+
<X class="mx-[3px]" size={12} strokeWidth={2} />
|
|
146
229
|
</button>
|
|
147
230
|
|
|
148
231
|
<button
|
|
149
|
-
class="absolute -top-[10px] right-[
|
|
150
|
-
|
|
151
|
-
|
|
232
|
+
class="absolute -top-[10px] right-[60px] rounded-full h-[20px] w-[20px] trash center-center text-secondary
|
|
233
|
+
outline-[1px] outline dark:outline-gray-500 outline-gray-300 bg-surface duration-150 hover:bg-blue-400 hover:text-white
|
|
234
|
+
{hover ? '' : '!hidden'}"
|
|
152
235
|
on:click|preventDefault|stopPropagation={(event) => dispatch('move')}
|
|
236
|
+
title="Move"
|
|
153
237
|
>
|
|
154
|
-
<Move class="mx-[3px]" size={
|
|
238
|
+
<Move class="mx-[3px]" size={12} strokeWidth={2} />
|
|
155
239
|
</button>
|
|
156
240
|
|
|
157
241
|
{#if (id && Object.values($flowInputsStore?.[id]?.flowStepWarnings || {}).length > 0) || Boolean(warningMessage)}
|
|
@@ -15,6 +15,7 @@ import FlowTutorials from '../../FlowTutorials.svelte';
|
|
|
15
15
|
import { ignoredTutorials } from '../../tutorials/ignoredTutorials';
|
|
16
16
|
import { tutorialInProgress } from '../../../tutorialUtils';
|
|
17
17
|
import FlowGraphV2 from '../../graph/FlowGraphV2.svelte';
|
|
18
|
+
import { replaceId } from '../flowStore';
|
|
18
19
|
export let modules;
|
|
19
20
|
export let sidebarSize = undefined;
|
|
20
21
|
export let disableStaticInputs = false;
|
|
@@ -149,7 +150,7 @@ async function updateFlowInputsStore() {
|
|
|
149
150
|
$flowInputsStore = {};
|
|
150
151
|
}
|
|
151
152
|
$flowInputsStore[module.id] = {
|
|
152
|
-
flowStepWarnings: await initFlowStepWarnings(module.value, $flowStateStore?.[module.id]?.schema
|
|
153
|
+
flowStepWarnings: await initFlowStepWarnings(module.value, $flowStateStore?.[module.id]?.schema, dfs($flowStore.value.modules, (fm) => fm.id))
|
|
153
154
|
};
|
|
154
155
|
}
|
|
155
156
|
}
|
|
@@ -279,6 +280,35 @@ async function updateFlowInputsStore() {
|
|
|
279
280
|
$flowStore = $flowStore
|
|
280
281
|
}
|
|
281
282
|
}}
|
|
283
|
+
on:changeId={({ detail }) => {
|
|
284
|
+
let { id, newId, deps } = detail
|
|
285
|
+
dfs($flowStore.value.modules, (mod) => {
|
|
286
|
+
if (deps[mod.id]) {
|
|
287
|
+
deps[mod.id].forEach((dep) => {
|
|
288
|
+
if (
|
|
289
|
+
mod.value.type == 'rawscript' ||
|
|
290
|
+
mod.value.type == 'script' ||
|
|
291
|
+
mod.value.type == 'flow'
|
|
292
|
+
) {
|
|
293
|
+
mod.value.input_transforms = Object.fromEntries(
|
|
294
|
+
Object.entries(mod.value.input_transforms).map(([k, v]) => {
|
|
295
|
+
if (v.type == 'javascript') {
|
|
296
|
+
return [k, { ...v, expr: replaceId(v.expr, id, newId) }]
|
|
297
|
+
} else {
|
|
298
|
+
return [k, v]
|
|
299
|
+
}
|
|
300
|
+
})
|
|
301
|
+
)
|
|
302
|
+
}
|
|
303
|
+
})
|
|
304
|
+
}
|
|
305
|
+
if (mod.id == id) {
|
|
306
|
+
mod.id = newId
|
|
307
|
+
}
|
|
308
|
+
})
|
|
309
|
+
$flowStore = $flowStore
|
|
310
|
+
$selectedId = newId
|
|
311
|
+
}}
|
|
282
312
|
on:deleteBranch={async ({ detail }) => {
|
|
283
313
|
if (detail.module) {
|
|
284
314
|
await removeBranch(detail.module, detail.index)
|
|
@@ -30,13 +30,13 @@ let customUi = getContext('customUi');
|
|
|
30
30
|
id={`flow-editor-add-step-${index}`}
|
|
31
31
|
type="button"
|
|
32
32
|
class={twMerge(
|
|
33
|
-
'w-
|
|
34
|
-
'
|
|
35
|
-
'text-
|
|
36
|
-
'bg-surface focus:outline-none hover:bg-surface-hover
|
|
33
|
+
'w-5 h-5 flex items-center justify-center',
|
|
34
|
+
'outline-[1px] outline dark:outline-gray-500 outline-gray-300',
|
|
35
|
+
'text-secondary',
|
|
36
|
+
'bg-surface focus:outline-none hover:bg-surface-hover rounded '
|
|
37
37
|
)}
|
|
38
38
|
>
|
|
39
|
-
<Cross size={
|
|
39
|
+
<Cross size={12} />
|
|
40
40
|
</button>
|
|
41
41
|
</svelte:fragment>
|
|
42
42
|
<div id="flow-editor-insert-module">
|
|
@@ -23,9 +23,9 @@ $: !open && (funcDesc = '');
|
|
|
23
23
|
title="Add a Trigger"
|
|
24
24
|
slot="trigger"
|
|
25
25
|
type="button"
|
|
26
|
-
class="text-
|
|
26
|
+
class="text-secondary bg-surface outline-[1px] outline dark:outline-gray-500 outline-gray-300 rotate-180 focus:outline-none hover:bg-surface-hover focus:ring-4 focus:ring-gray-200 font-medium rounded text-sm w-[20px] h-[20px] flex items-center justify-center"
|
|
27
27
|
>
|
|
28
|
-
<Zap size={
|
|
28
|
+
<Zap size={12} />
|
|
29
29
|
</button>
|
|
30
30
|
{#if !disableAi}
|
|
31
31
|
<StepGen {index} bind:funcDesc bind:open {close} {modules} trigger on:insert />
|
|
@@ -79,6 +79,7 @@ function onDelete(event) {
|
|
|
79
79
|
mod.value.skip_failures ? '(skip failures)' : ''
|
|
80
80
|
}`}
|
|
81
81
|
id={mod.id}
|
|
82
|
+
on:changeId
|
|
82
83
|
on:move={() => dispatch('move')}
|
|
83
84
|
on:delete={onDelete}
|
|
84
85
|
on:click={() => dispatch('select', mod.id)}
|
|
@@ -97,6 +98,7 @@ function onDelete(event) {
|
|
|
97
98
|
{:else if mod.value.type === 'branchone'}
|
|
98
99
|
<FlowModuleSchemaItem
|
|
99
100
|
deletable={insertable}
|
|
101
|
+
on:changeId
|
|
100
102
|
on:delete={onDelete}
|
|
101
103
|
on:move={() => dispatch('move')}
|
|
102
104
|
on:click={() => dispatch('select', mod.id)}
|
|
@@ -112,6 +114,7 @@ function onDelete(event) {
|
|
|
112
114
|
{:else if mod.value.type === 'branchall'}
|
|
113
115
|
<FlowModuleSchemaItem
|
|
114
116
|
deletable={insertable}
|
|
117
|
+
on:changeId
|
|
115
118
|
on:delete={onDelete}
|
|
116
119
|
on:move={() => dispatch('move')}
|
|
117
120
|
on:click={() => dispatch('select', mod.id)}
|
|
@@ -127,6 +130,7 @@ function onDelete(event) {
|
|
|
127
130
|
{:else}
|
|
128
131
|
<FlowModuleSchemaItem
|
|
129
132
|
{retries}
|
|
133
|
+
on:changeId
|
|
130
134
|
on:click={() => dispatch('select', mod.id)}
|
|
131
135
|
on:delete={onDelete}
|
|
132
136
|
on:move={() => dispatch('move')}
|