windmill-components 1.532.0 → 1.537.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package/components/ArgInput.svelte +25 -18
- package/package/components/Auth0Setting.svelte +8 -3
- package/package/components/Dev.svelte +5 -4
- package/package/components/DiffDrawer.svelte +2 -2
- package/package/components/DiffEditor.svelte +34 -37
- package/package/components/DiffEditor.svelte.d.ts +23 -39
- package/package/components/EditableSchemaForm.svelte +42 -51
- package/package/components/EditableSchemaForm.svelte.d.ts +2 -3
- package/package/components/Editor.svelte +30 -9
- package/package/components/Editor.svelte.d.ts +5 -0
- package/package/components/FlowBuilder.svelte +7 -4
- package/package/components/FlowPreviewContent.svelte +3 -3
- package/package/components/FlowStatusViewer.svelte +28 -0
- package/package/components/FlowStatusViewerInner.svelte +72 -20
- package/package/components/FlowStatusViewerInner.svelte.d.ts +7 -0
- package/package/components/ModulePreview.svelte +2 -1
- package/package/components/ModulePreview.svelte.d.ts +1 -0
- package/package/components/ModulePreviewForm.svelte +72 -65
- package/package/components/ModulePreviewResultViewer.svelte +13 -18
- package/package/components/ModuleTest.svelte +6 -5
- package/package/components/ModuleTest.svelte.d.ts +1 -0
- package/package/components/OktaSetting.svelte +8 -3
- package/package/components/Portal.svelte +11 -7
- package/package/components/Portal.svelte.d.ts +19 -39
- package/package/components/RunForm.svelte +2 -2
- package/package/components/RunForm.svelte.d.ts +1 -1
- package/package/components/RunFormAdvancedPopup.svelte +13 -1
- package/package/components/SchemaForm.svelte +1 -2
- package/package/components/ScriptBuilder.svelte +1 -1
- package/package/components/ScriptEditor.svelte +21 -7
- package/package/components/SimpleEditor.svelte +0 -1
- package/package/components/apps/components/layout/AppModal.svelte +2 -2
- package/package/components/apps/editor/component/ComponentNavigation.svelte +3 -2
- package/package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +1 -1
- package/package/components/apps/editor/inlineScriptsPanel/InlineScriptRunnableByPath.svelte +0 -1
- package/package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +3 -1
- package/package/components/apps/editor/settingsPanel/GridCondition.svelte +3 -1
- package/package/components/apps/editor/settingsPanel/GridNavbar.svelte +3 -1
- package/package/components/apps/editor/settingsPanel/GridTab.svelte +3 -1
- package/package/components/apps/editor/settingsPanel/OneOfInputSpecsEditor.svelte +55 -53
- package/package/components/apps/editor/settingsPanel/TableActions.svelte +3 -1
- package/package/components/common/button/model.d.ts +1 -1
- package/package/components/common/drawer/Disposable.svelte +51 -30
- package/package/components/common/drawer/Disposable.svelte.d.ts +12 -44
- package/package/components/common/drawer/Drawer.svelte +15 -11
- package/package/components/copilot/MetadataGen.svelte +14 -3
- package/package/components/copilot/chat/AIChatInput.svelte +0 -1
- package/package/components/copilot/chat/AIChatManager.svelte.js +3 -3
- package/package/components/copilot/chat/AvailableContextList.svelte +192 -66
- package/package/components/copilot/chat/AvailableContextList.svelte.d.ts +2 -2
- package/package/components/copilot/chat/ContextElementBadge.svelte +3 -3
- package/package/components/copilot/chat/ContextManager.svelte.js +36 -13
- package/package/components/copilot/chat/ContextTextarea.svelte +21 -48
- package/package/components/copilot/chat/ToolContentDisplay.svelte +10 -1
- package/package/components/copilot/chat/ToolExecutionDisplay.svelte +3 -3
- package/package/components/copilot/chat/context.d.ts +7 -2
- package/package/components/copilot/chat/flow/FlowAIChat.svelte +110 -8
- package/package/components/copilot/chat/flow/core.d.ts +11 -0
- package/package/components/copilot/chat/flow/core.js +121 -3
- package/package/components/copilot/chat/flow/uiIntents.d.ts +8 -0
- package/package/components/copilot/chat/flow/uiIntents.js +5 -0
- package/package/components/copilot/chat/flow/useUiIntent.d.ts +5 -0
- package/package/components/copilot/chat/flow/useUiIntent.js +12 -0
- package/package/components/copilot/chat/monaco-adapter.d.ts +22 -4
- package/package/components/copilot/chat/monaco-adapter.js +55 -16
- package/package/components/copilot/chat/script/core.js +3 -2
- package/package/components/copilot/chat/shared.d.ts +3 -2
- package/package/components/copilot/chat/shared.js +24 -12
- package/package/components/copilot/lib.js +12 -7
- package/package/components/copilot/shared.d.ts +1 -1
- package/package/components/copilot/shared.js +16 -10
- package/package/components/flows/FlowEditor.svelte +4 -2
- package/package/components/flows/FlowEditor.svelte.d.ts +1 -0
- package/package/components/flows/FlowModuleIcon.svelte +8 -8
- package/package/components/flows/common/FlowCardHeader.svelte +4 -1
- package/package/components/flows/content/FlowBranchesAllWrapper.svelte +6 -0
- package/package/components/flows/content/FlowBranchesOneWrapper.svelte +6 -0
- package/package/components/flows/content/FlowEditorPanel.svelte +2 -1
- package/package/components/flows/content/FlowEditorPanel.svelte.d.ts +1 -0
- package/package/components/flows/content/FlowInput.svelte +31 -34
- package/package/components/flows/content/FlowInput.svelte.d.ts +1 -0
- package/package/components/flows/content/FlowLoop.svelte +7 -0
- package/package/components/flows/content/FlowModuleComponent.svelte +37 -44
- package/package/components/flows/content/FlowModuleScript.svelte +1 -1
- package/package/components/flows/content/FlowModuleSuspend.svelte +16 -18
- package/package/components/flows/content/FlowWhileLoop.svelte +6 -0
- package/package/components/flows/content/ScriptEditorDrawer.svelte +9 -11
- package/package/components/flows/dfs.d.ts +1 -1
- package/package/components/flows/dfs.js +6 -6
- package/package/components/flows/flowInfers.js +7 -7
- package/package/components/flows/flowStateUtils.svelte.js +1 -2
- package/package/components/flows/map/FlowModuleSchemaItem.svelte +12 -26
- package/package/components/flows/map/MapItem.svelte +8 -4
- package/package/components/flows/map/VirtualItem.svelte +1 -1
- package/package/components/flows/pickers/TopLevelNode.svelte +1 -1
- package/package/components/flows/propPicker/InputPickerInner.svelte +5 -5
- package/package/components/flows/propPicker/OutputPickerInner.svelte +143 -118
- package/package/components/flows/propPicker/OutputPickerInner.svelte.d.ts +7 -16
- package/package/components/flows/{testSteps.svelte.d.ts → stepsInputArgs.svelte.d.ts} +2 -1
- package/package/components/flows/{testSteps.svelte.js → stepsInputArgs.svelte.js} +15 -3
- package/package/components/flows/types.d.ts +16 -3
- package/package/components/flows/utils.js +3 -0
- package/package/components/graph/FlowGraphV2.svelte +1 -1
- package/package/components/graph/renderers/nodes/AIToolNode.svelte +4 -4
- package/package/components/graph/renderers/nodes/NewAIToolNode.svelte +71 -54
- package/package/components/propertyPicker/ObjectViewer.svelte +11 -3
- package/package/components/raw_apps/RawAppInlineScriptEditor.svelte +1 -1
- package/package/components/schema/AddPropertyV2.svelte +2 -7
- package/package/components/schema/AddPropertyV2.svelte.d.ts +3 -20
- package/package/components/schema/EditableSchemaDrawer.svelte +109 -115
- package/package/components/schema/EditableSchemaDrawer.svelte.d.ts +2 -1
- package/package/components/schema/EditableSchemaSdkWrapper.svelte +16 -3
- package/package/components/schema/EditableSchemaSdkWrapper.svelte.d.ts +4 -1
- package/package/components/schema/EditableSchemaWrapper.svelte +3 -10
- package/package/components/schema/FlowPropertyEditor.svelte +9 -41
- package/package/components/schema/FlowPropertyEditor.svelte.d.ts +1 -1
- package/package/components/schema/SchemaFormDND.svelte +11 -10
- package/package/components/schema/SchemaFormDND.svelte.d.ts +3 -2
- package/package/components/schema/editable_schema_wrapper.d.ts +0 -3
- package/package/components/settings/PremiumInfo.svelte +7 -2
- package/package/components/triggers/CaptureWrapper.svelte +2 -13
- package/package/components/triggers/CaptureWrapper.svelte.d.ts +1 -1
- package/package/components/triggers/TriggersWrapper.svelte +1 -0
- package/package/components/triggers/http/RouteEditorInner.svelte +1 -1
- package/package/components/triggers/nats/NatsTriggerEditorInner.svelte +23 -20
- package/package/components/triggers/nats/NatsTriggersConfigSection.svelte +15 -27
- package/package/components/triggers/nats/NatsTriggersConfigSection.svelte.d.ts +7 -5
- package/package/components/triggers/websocket/WebsocketTriggerEditorInner.svelte +16 -16
- package/package/hubPaths.json +3 -1
- package/package/script_helpers.d.ts +2 -2
- package/package/script_helpers.js +2 -0
- package/package/stores.d.ts +1 -0
- package/package/stores.js +8 -1
- package/package.json +2 -2
- package/package/components/ModulePreviewResultViewer.svelte.d.ts +0 -28
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
<script lang="ts">import
|
|
2
|
-
|
|
1
|
+
<script lang="ts">import { readFieldsRecursively } from '../../utils';
|
|
2
|
+
import { deepEqual } from 'fast-equals';
|
|
3
|
+
import EditableSchemaWrapper from './EditableSchemaWrapper.svelte';
|
|
4
|
+
let { schema: oldSchema, onSchemaChange, ...props } = $props();
|
|
3
5
|
let schema = $state(oldSchema);
|
|
6
|
+
let lastSchema = $state.snapshot(schema);
|
|
7
|
+
$effect(() => {
|
|
8
|
+
if (onSchemaChange) {
|
|
9
|
+
readFieldsRecursively(schema);
|
|
10
|
+
let newSchema = $state.snapshot(schema);
|
|
11
|
+
if (!deepEqual(lastSchema, newSchema)) {
|
|
12
|
+
lastSchema = newSchema;
|
|
13
|
+
onSchemaChange(newSchema);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
4
17
|
</script>
|
|
5
18
|
|
|
6
|
-
<EditableSchemaWrapper
|
|
19
|
+
<EditableSchemaWrapper bind:schema {...props} />
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { EditableSchemaWrapperProps } from './editable_schema_wrapper';
|
|
2
|
-
|
|
2
|
+
type $$ComponentProps = EditableSchemaWrapperProps & {
|
|
3
|
+
onSchemaChange?: (schema: any) => void;
|
|
4
|
+
};
|
|
5
|
+
declare const EditableSchemaSdkWrapper: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
3
6
|
type EditableSchemaSdkWrapper = ReturnType<typeof EditableSchemaSdkWrapper>;
|
|
4
7
|
export default EditableSchemaSdkWrapper;
|
|
@@ -7,7 +7,7 @@ import AddPropertyV2 from './AddPropertyV2.svelte';
|
|
|
7
7
|
import { Plus } from 'lucide-svelte';
|
|
8
8
|
import Select from '../select/Select.svelte';
|
|
9
9
|
import { safeSelectItems } from '../select/utils.svelte';
|
|
10
|
-
let { schema = $bindable(), uiOnly = false, noPreview = false, fullHeight = true, formatExtension = $bindable(undefined),
|
|
10
|
+
let { schema = $bindable(), uiOnly = false, noPreview = false, fullHeight = true, formatExtension = $bindable(undefined), customUi } = $props();
|
|
11
11
|
let resourceIsTextFile = $state(false);
|
|
12
12
|
let addPropertyComponent = $state(undefined);
|
|
13
13
|
let editableSchemaForm = $state(undefined);
|
|
@@ -35,7 +35,6 @@ function switchResourceIsFile() {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
onSchemaChange?.({ schema: $state.snapshot(schema) });
|
|
39
38
|
}
|
|
40
39
|
let suggestedFileExtensions = $state([
|
|
41
40
|
'json',
|
|
@@ -64,9 +63,8 @@ let suggestedFileExtensions = $state([
|
|
|
64
63
|
noPopover={customUi?.noAddPopover}
|
|
65
64
|
bind:schema
|
|
66
65
|
bind:this={addPropertyComponent}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
editableSchemaForm?.openField(e.detail)
|
|
66
|
+
onAddNew={(argName) => {
|
|
67
|
+
editableSchemaForm?.openField(argName)
|
|
70
68
|
}}
|
|
71
69
|
>
|
|
72
70
|
{#snippet trigger()}
|
|
@@ -82,11 +80,7 @@ let suggestedFileExtensions = $state([
|
|
|
82
80
|
onlyMaskPassword
|
|
83
81
|
bind:this={editableSchemaForm}
|
|
84
82
|
bind:schema
|
|
85
|
-
on:change={() => onSchemaChange?.({ schema: $state.snapshot(schema) })}
|
|
86
83
|
isFlowInput
|
|
87
|
-
on:edit={(e) => {
|
|
88
|
-
addPropertyComponent?.openDrawer(e.detail)
|
|
89
|
-
}}
|
|
90
84
|
on:delete={(e) => {
|
|
91
85
|
addPropertyComponent?.handleDeleteArgument([e.detail])
|
|
92
86
|
}}
|
|
@@ -100,7 +94,6 @@ let suggestedFileExtensions = $state([
|
|
|
100
94
|
noPopover={customUi?.noAddPopover}
|
|
101
95
|
bind:schema
|
|
102
96
|
bind:this={addPropertyComponent}
|
|
103
|
-
on:change={() => onSchemaChange?.({ schema })}
|
|
104
97
|
>
|
|
105
98
|
{#snippet trigger()}
|
|
106
99
|
<div
|
|
@@ -15,8 +15,8 @@ import { Pen, Plus, Trash2 } from 'lucide-svelte';
|
|
|
15
15
|
import Popover from '../meltComponents/Popover.svelte';
|
|
16
16
|
import ResourcePicker from '../ResourcePicker.svelte';
|
|
17
17
|
import Tooltip from '../Tooltip.svelte';
|
|
18
|
-
let { format = $bindable(undefined), contentEncoding = undefined, type = undefined, oneOf = $bindable(undefined), required = false, pattern = undefined, password = undefined, variableEditor = undefined, itemPicker = undefined, nullable = $bindable(undefined), disabled = $bindable(undefined), defaultValue = $bindable(undefined), propsNames = [], showExpr = $bindable(undefined), extra = {}, customErrorMessage = undefined, itemsType = undefined, properties = $bindable(undefined), order = $bindable(undefined), requiredProperty = $bindable(undefined), displayWebhookWarning = true } = $props();
|
|
19
|
-
let oneOfSelected = $state(
|
|
18
|
+
let { format = $bindable(undefined), contentEncoding = undefined, type = undefined, oneOf = $bindable(undefined), required = false, pattern = undefined, password = undefined, variableEditor = undefined, itemPicker = undefined, nullable = $bindable(undefined), disabled = $bindable(undefined), defaultValue = $bindable(undefined), propsNames = [], showExpr = $bindable(undefined), extra = {}, customErrorMessage = undefined, itemsType = undefined, properties = $bindable(undefined), order = $bindable(undefined), requiredProperty = $bindable(undefined), displayWebhookWarning = true, onDrawerClose = undefined } = $props();
|
|
19
|
+
let oneOfSelected = $state(oneOf?.[0]?.title);
|
|
20
20
|
const dispatch = createEventDispatcher();
|
|
21
21
|
function getResourceTypesFromFormat(format) {
|
|
22
22
|
if (format?.startsWith('resource-')) {
|
|
@@ -189,44 +189,13 @@ let customObjectSelected = $state(format?.startsWith('jsonschema-') ? 'json-sche
|
|
|
189
189
|
{#if oneOfSelected && oneOf}
|
|
190
190
|
{@const idx = oneOf.findIndex((obj) => obj.title === oneOfSelected)}
|
|
191
191
|
<EditableSchemaDrawer
|
|
192
|
-
|
|
193
|
-
()
|
|
194
|
-
if (oneOf?.[idx]) {
|
|
195
|
-
let properties = Object.fromEntries(
|
|
196
|
-
Object.entries(oneOf[idx].properties ?? {}).filter(
|
|
197
|
-
([k]) => k !== 'label' && k !== 'kind'
|
|
198
|
-
)
|
|
199
|
-
)
|
|
200
|
-
return {
|
|
201
|
-
...oneOf[idx],
|
|
202
|
-
properties: properties,
|
|
203
|
-
order: Object.keys(properties),
|
|
204
|
-
required: oneOf[idx].required ?? []
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
(v) => {
|
|
209
|
-
if (oneOf?.[idx]) {
|
|
210
|
-
const tagKey = oneOf?.find((o) => Object.keys(o.properties ?? {}).includes('kind'))
|
|
211
|
-
? 'kind'
|
|
212
|
-
: 'label'
|
|
213
|
-
oneOf[idx] = {
|
|
214
|
-
...(v ?? {}),
|
|
215
|
-
type: 'object',
|
|
216
|
-
properties: {
|
|
217
|
-
...(v?.properties ?? {}),
|
|
218
|
-
[tagKey]: {
|
|
219
|
-
type: 'string',
|
|
220
|
-
enum: [v?.title ?? '']
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
on:change={() => {
|
|
228
|
-
dispatch('schemaChange')
|
|
192
|
+
onClose={() => {
|
|
193
|
+
onDrawerClose?.()
|
|
229
194
|
}}
|
|
195
|
+
bind:schema={oneOf[idx]}
|
|
196
|
+
hiddenArgs={[
|
|
197
|
+
oneOf?.find((o) => Object.keys(o.properties ?? {}).includes('kind')) ? 'kind' : 'label'
|
|
198
|
+
]}
|
|
230
199
|
/>
|
|
231
200
|
{/if}
|
|
232
201
|
{:else if type === 'object' && format !== 'resource-s3_object' && !isDynSelect}
|
|
@@ -289,7 +258,6 @@ let customObjectSelected = $state(format?.startsWith('jsonschema-') ? 'json-sche
|
|
|
289
258
|
properties = v.properties
|
|
290
259
|
order = v.order
|
|
291
260
|
requiredProperty = v.required
|
|
292
|
-
dispatch('schemaChange')
|
|
293
261
|
}
|
|
294
262
|
}
|
|
295
263
|
/>
|
|
@@ -312,7 +280,7 @@ let customObjectSelected = $state(format?.startsWith('jsonschema-') ? 'json-sche
|
|
|
312
280
|
</TabContent>
|
|
313
281
|
|
|
314
282
|
<TabContent value="resource">
|
|
315
|
-
<ObjectTypeNarrowing
|
|
283
|
+
<ObjectTypeNarrowing bind:format />
|
|
316
284
|
</TabContent>
|
|
317
285
|
</div>
|
|
318
286
|
{/snippet}
|
|
@@ -28,6 +28,7 @@ interface Props {
|
|
|
28
28
|
order?: string[] | undefined;
|
|
29
29
|
requiredProperty?: string[] | undefined;
|
|
30
30
|
displayWebhookWarning?: boolean;
|
|
31
|
+
onDrawerClose?: () => void;
|
|
31
32
|
}
|
|
32
33
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
33
34
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -43,7 +44,6 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
43
44
|
z_$$bindings?: Bindings;
|
|
44
45
|
}
|
|
45
46
|
declare const FlowPropertyEditor: $$__sveltets_2_IsomorphicComponent<Props, {
|
|
46
|
-
schemaChange: CustomEvent<any>;
|
|
47
47
|
requiredChange: CustomEvent<any>;
|
|
48
48
|
} & {
|
|
49
49
|
[evt: string]: CustomEvent<any>;
|
|
@@ -3,7 +3,8 @@ import { dragHandle } from '@windmill-labs/svelte-dnd-action';
|
|
|
3
3
|
import SchemaForm from '../SchemaForm.svelte';
|
|
4
4
|
import { GripVertical } from 'lucide-svelte';
|
|
5
5
|
import { deepEqual } from 'fast-equals';
|
|
6
|
-
|
|
6
|
+
import { generateRandomString } from '../../utils';
|
|
7
|
+
let { schema = $bindable(), args = $bindable(undefined), prettifyHeader = false, onlyMaskPassword = false, disablePortal = false, disabled = false, hiddenArgs = [], nestedParent = undefined, disableDnd = false, shouldDispatchChanges = false, helperScript = undefined, diff = {}, nestedClasses = '', isValid = $bindable(true), noVariablePicker = false, className = '', dndType = generateRandomString() } = $props();
|
|
7
8
|
$effect.pre(() => {
|
|
8
9
|
if (args == undefined) {
|
|
9
10
|
args = {};
|
|
@@ -12,9 +13,9 @@ $effect.pre(() => {
|
|
|
12
13
|
const dispatch = createEventDispatcher();
|
|
13
14
|
const flipDurationMs = 200;
|
|
14
15
|
let items = $state(computeItems());
|
|
15
|
-
let
|
|
16
|
+
let dragDisabledState = $state(true);
|
|
16
17
|
function computeItems() {
|
|
17
|
-
return ((schema?.order ?? Object.keys(schema?.properties ?? {}) ?? []).map((key) => ({
|
|
18
|
+
return (($state.snapshot(schema?.order) ?? Object.keys(schema?.properties ?? {}) ?? []).map((key) => ({
|
|
18
19
|
id: key,
|
|
19
20
|
value: key
|
|
20
21
|
})) ?? []);
|
|
@@ -26,20 +27,19 @@ function updateItems() {
|
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
function handleConsider(e) {
|
|
29
|
-
|
|
30
|
+
dragDisabledState = false;
|
|
30
31
|
const { items: newItems } = e.detail;
|
|
31
|
-
items = newItems;
|
|
32
|
+
items = $state.snapshot(newItems);
|
|
32
33
|
}
|
|
33
34
|
function handleFinalize(e) {
|
|
34
35
|
const { items: newItems } = e.detail;
|
|
35
|
-
|
|
36
|
-
items = newItems;
|
|
36
|
+
dragDisabledState = true;
|
|
37
|
+
items = $state.snapshot(newItems);
|
|
37
38
|
const newOrder = items.map((item) => item.value);
|
|
38
|
-
// console.log('handleFinalize', newOrder, e.detail)
|
|
39
39
|
dispatch('reorder', newOrder);
|
|
40
40
|
}
|
|
41
41
|
$effect(() => {
|
|
42
|
-
schema &&
|
|
42
|
+
schema && dragDisabledState && untrack(() => updateItems());
|
|
43
43
|
});
|
|
44
44
|
</script>
|
|
45
45
|
|
|
@@ -67,6 +67,7 @@ $effect(() => {
|
|
|
67
67
|
{disablePortal}
|
|
68
68
|
{disabled}
|
|
69
69
|
{helperScript}
|
|
70
|
+
{className}
|
|
70
71
|
bind:schema
|
|
71
72
|
dndConfig={disableDnd
|
|
72
73
|
? undefined
|
|
@@ -74,7 +75,7 @@ $effect(() => {
|
|
|
74
75
|
items,
|
|
75
76
|
flipDurationMs,
|
|
76
77
|
dropTargetStyle: {},
|
|
77
|
-
type: dndType
|
|
78
|
+
type: dndType
|
|
78
79
|
}}
|
|
79
80
|
{items}
|
|
80
81
|
{diff}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { Schema } from '../../common';
|
|
2
2
|
import type { SchemaDiff } from './schemaUtils.svelte';
|
|
3
|
-
import type
|
|
3
|
+
import { type DynamicSelect } from '../../utils';
|
|
4
4
|
interface Props {
|
|
5
|
-
dndType?: string | undefined;
|
|
6
5
|
schema: Schema;
|
|
7
6
|
args?: Record<string, any>;
|
|
8
7
|
prettifyHeader?: boolean;
|
|
@@ -21,6 +20,8 @@ interface Props {
|
|
|
21
20
|
isValid?: boolean;
|
|
22
21
|
noVariablePicker?: boolean;
|
|
23
22
|
helperScript?: DynamicSelect.HelperScript;
|
|
23
|
+
className?: string;
|
|
24
|
+
dndType?: string;
|
|
24
25
|
}
|
|
25
26
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
26
27
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -126,8 +126,13 @@ $: estimatedSeats && updateExecs();
|
|
|
126
126
|
</div>
|
|
127
127
|
{#if premiumInfo?.status === 'past_due'}
|
|
128
128
|
<p class="text-red-500 text-base">
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
{#if premiumInfo.max_tolerated_executions === undefined || premiumInfo.usage > premiumInfo.max_tolerated_executions}
|
|
130
|
+
Your last invoice is unpaid, you cannot run any more jobs. Please update your payment
|
|
131
|
+
method in the customer portal to continue running jobs.
|
|
132
|
+
{:else}
|
|
133
|
+
Your last invoice is unpaid. Please update your payment method in the customer portal to
|
|
134
|
+
prevent the interruption of your job executions.
|
|
135
|
+
{/if}
|
|
131
136
|
</p>
|
|
132
137
|
{/if}
|
|
133
138
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">import { workspaceStore } from '../../stores';
|
|
2
2
|
import { CaptureService } from '../../gen';
|
|
3
3
|
import { onDestroy, untrack } from 'svelte';
|
|
4
|
-
import {
|
|
4
|
+
import { sendUserToast, sleep } from '../../utils';
|
|
5
5
|
import RouteCapture from './http/RouteCapture.svelte';
|
|
6
6
|
import WebhooksCapture from './webhook/WebhooksCapture.svelte';
|
|
7
7
|
import EmailTriggerCaptures from '../details/EmailTriggerCaptures.svelte';
|
|
@@ -12,7 +12,7 @@ import NatsCapture from './nats/NatsCapture.svelte';
|
|
|
12
12
|
import MqttCapture from './mqtt/MqttCapture.svelte';
|
|
13
13
|
import SqsCapture from './sqs/SqsCapture.svelte';
|
|
14
14
|
import GcpCapture from './gcp/GcpCapture.svelte';
|
|
15
|
-
let { isFlow, path, hasPreprocessor, canHavePreprocessor, captureType = 'webhook', data = {}, connectionInfo = $bindable(undefined), args =
|
|
15
|
+
let { isFlow, path, hasPreprocessor, canHavePreprocessor, captureType = 'webhook', data = {}, connectionInfo = $bindable(undefined), args = {}, isValid = false, triggerDeployed = false } = $props();
|
|
16
16
|
let captureLoading = $state(false);
|
|
17
17
|
let captureActive = $state(false);
|
|
18
18
|
let captureConfigs = $state({});
|
|
@@ -64,7 +64,6 @@ async function getCaptureConfigs() {
|
|
|
64
64
|
}
|
|
65
65
|
return captureConfigs;
|
|
66
66
|
}
|
|
67
|
-
getCaptureConfigs().then((captureConfigs) => setDefaultArgs(captureConfigs));
|
|
68
67
|
async function capture() {
|
|
69
68
|
let i = 0;
|
|
70
69
|
captureActive = true;
|
|
@@ -82,16 +81,6 @@ async function capture() {
|
|
|
82
81
|
await sleep(1000);
|
|
83
82
|
}
|
|
84
83
|
}
|
|
85
|
-
function setDefaultArgs(captureConfigs) {
|
|
86
|
-
if (captureType in captureConfigs) {
|
|
87
|
-
const triggerConfig = captureConfigs[captureType].trigger_config;
|
|
88
|
-
args = isObject(triggerConfig) ? triggerConfig : {};
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
args = {};
|
|
92
|
-
}
|
|
93
|
-
ready = true;
|
|
94
|
-
}
|
|
95
84
|
onDestroy(() => {
|
|
96
85
|
captureActive = false;
|
|
97
86
|
});
|
|
@@ -37,6 +37,6 @@ declare const CaptureWrapper: $$__sveltets_2_IsomorphicComponent<Props, {
|
|
|
37
37
|
handleCapture: (e: CustomEvent<{
|
|
38
38
|
disableOnly?: boolean;
|
|
39
39
|
}>) => Promise<void>;
|
|
40
|
-
}, "
|
|
40
|
+
}, "connectionInfo">;
|
|
41
41
|
type CaptureWrapper = InstanceType<typeof CaptureWrapper>;
|
|
42
42
|
export default CaptureWrapper;
|
|
@@ -43,6 +43,7 @@ let { selectedTrigger, isFlow = false, initialPath, fakeInitialPath, currentPath
|
|
|
43
43
|
scopes={isFlow ? [`jobs:run:flows:${currentPath}`] : [`jobs:run:scripts:${currentPath}`]}
|
|
44
44
|
path={initialPath || fakeInitialPath}
|
|
45
45
|
{isFlow}
|
|
46
|
+
{hash}
|
|
46
47
|
on:email-domain
|
|
47
48
|
/>
|
|
48
49
|
{:else if selectedTrigger.type === 'schedule'}
|
|
@@ -36,11 +36,11 @@ let drawerLoading = $state(true);
|
|
|
36
36
|
let showLoading = $state(false);
|
|
37
37
|
let defaultValues = $state(undefined);
|
|
38
38
|
let natsResourcePath = $state('');
|
|
39
|
-
let subjects = $state(['']);
|
|
40
|
-
let useJetstream = $state(false);
|
|
41
|
-
let streamName = $state('');
|
|
42
|
-
let consumerName = $state('');
|
|
43
39
|
let initialConfig = undefined;
|
|
40
|
+
let natsCfg = $state({
|
|
41
|
+
subjects: [],
|
|
42
|
+
use_jetstream: false
|
|
43
|
+
});
|
|
44
44
|
let deploymentLoading = $state(false);
|
|
45
45
|
let isValid = $state(false);
|
|
46
46
|
let optionTabSelected = $state('error_handler');
|
|
@@ -90,10 +90,13 @@ export async function openNew(nis_flow, fixedScriptPath_, nDefaultValues) {
|
|
|
90
90
|
edit = false;
|
|
91
91
|
itemKind = nis_flow ? 'flow' : 'script';
|
|
92
92
|
natsResourcePath = nDefaultValues?.nats_resource_path ?? '';
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
const useJetstream = nDefaultValues?.use_jetstream ?? false;
|
|
94
|
+
natsCfg = {
|
|
95
|
+
subjects: nDefaultValues?.subjects ?? [''],
|
|
96
|
+
use_jetstream: useJetstream,
|
|
97
|
+
stream_name: useJetstream ? (nDefaultValues?.stream_name ?? '') : undefined,
|
|
98
|
+
consumer_name: useJetstream ? (nDefaultValues?.consumer_name ?? '') : undefined
|
|
99
|
+
};
|
|
97
100
|
initialScriptPath = '';
|
|
98
101
|
fixedScriptPath = fixedScriptPath_ ?? '';
|
|
99
102
|
script_path = fixedScriptPath;
|
|
@@ -119,10 +122,13 @@ async function loadTriggerConfig(cfg) {
|
|
|
119
122
|
is_flow = cfg?.is_flow;
|
|
120
123
|
path = cfg?.path;
|
|
121
124
|
natsResourcePath = cfg?.nats_resource_path;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
const useJetstream = cfg?.use_jetstream || false;
|
|
126
|
+
natsCfg = {
|
|
127
|
+
subjects: cfg?.subjects || [''],
|
|
128
|
+
use_jetstream: useJetstream,
|
|
129
|
+
stream_name: useJetstream ? cfg?.stream_name || '' : undefined,
|
|
130
|
+
consumer_name: useJetstream ? cfg?.consumer_name || '' : undefined
|
|
131
|
+
};
|
|
126
132
|
enabled = cfg?.enabled;
|
|
127
133
|
can_write = canWrite(cfg?.path, cfg?.extra_perms, $userStore);
|
|
128
134
|
error_handler_path = cfg?.error_handler_path;
|
|
@@ -150,10 +156,10 @@ function getSaveCfg() {
|
|
|
150
156
|
is_flow,
|
|
151
157
|
enabled,
|
|
152
158
|
nats_resource_path: natsResourcePath,
|
|
153
|
-
stream_name:
|
|
154
|
-
consumer_name:
|
|
155
|
-
subjects,
|
|
156
|
-
use_jetstream:
|
|
159
|
+
stream_name: natsCfg.stream_name,
|
|
160
|
+
consumer_name: natsCfg.consumer_name,
|
|
161
|
+
subjects: natsCfg.subjects,
|
|
162
|
+
use_jetstream: natsCfg.use_jetstream,
|
|
157
163
|
error_handler_path,
|
|
158
164
|
error_handler_args,
|
|
159
165
|
retry
|
|
@@ -325,10 +331,7 @@ $effect(() => {
|
|
|
325
331
|
<NatsTriggersConfigSection
|
|
326
332
|
{path}
|
|
327
333
|
bind:natsResourcePath
|
|
328
|
-
bind:
|
|
329
|
-
bind:useJetstream
|
|
330
|
-
bind:streamName
|
|
331
|
-
bind:consumerName
|
|
334
|
+
bind:natsCfg
|
|
332
335
|
on:valid-config={({ detail }) => {
|
|
333
336
|
isValid = detail
|
|
334
337
|
}}
|
|
@@ -5,11 +5,11 @@ import ResourcePicker from '../../ResourcePicker.svelte';
|
|
|
5
5
|
import SchemaForm from '../../SchemaForm.svelte';
|
|
6
6
|
import TestTriggerConnection from '../TestTriggerConnection.svelte';
|
|
7
7
|
import TestingBadge from '../testingBadge.svelte';
|
|
8
|
-
import { createEventDispatcher } from 'svelte';
|
|
8
|
+
import { createEventDispatcher, untrack } from 'svelte';
|
|
9
9
|
const dispatch = createEventDispatcher();
|
|
10
|
-
let { defaultValues = undefined, headless = false, natsResourcePath = $bindable(),
|
|
10
|
+
let { defaultValues = undefined, headless = false, natsResourcePath = $bindable(), natsCfg = $bindable(), path, can_write = true, showTestingBadge = false } = $props();
|
|
11
11
|
let otherArgsValid = $state(false);
|
|
12
|
-
let globalError = $derived(!
|
|
12
|
+
let globalError = $derived(!natsCfg.use_jetstream && natsCfg.subjects && natsCfg.subjects.length > 1
|
|
13
13
|
? 'Only one subject is supported if not using JetStream.'
|
|
14
14
|
: '');
|
|
15
15
|
let isConnectionValid = $derived(!!natsResourcePath);
|
|
@@ -55,37 +55,25 @@ const argsSchema = {
|
|
|
55
55
|
$effect(() => {
|
|
56
56
|
const valid = isConnectionValid &&
|
|
57
57
|
otherArgsValid &&
|
|
58
|
-
!!subjects &&
|
|
59
|
-
subjects.length > 0 &&
|
|
60
|
-
subjects.every((b) => /^[a-zA-Z0-9-_.*>]+$/.test(b)) &&
|
|
58
|
+
!!natsCfg.subjects &&
|
|
59
|
+
natsCfg.subjects.length > 0 &&
|
|
60
|
+
natsCfg.subjects.every((b) => /^[a-zA-Z0-9-_.*>]+$/.test(b)) &&
|
|
61
61
|
globalError === '';
|
|
62
62
|
dispatch('valid-config', valid);
|
|
63
63
|
});
|
|
64
64
|
function setStreamAndConsumerNames() {
|
|
65
|
-
if (!
|
|
66
|
-
|
|
65
|
+
if (!natsCfg.stream_name) {
|
|
66
|
+
natsCfg.stream_name = `windmill_stream-${$workspaceStore}-${path.replaceAll('/', '__')}`;
|
|
67
67
|
}
|
|
68
|
-
if (!
|
|
69
|
-
|
|
68
|
+
if (!natsCfg.consumer_name) {
|
|
69
|
+
natsCfg.consumer_name = `windmill_consumer-${$workspaceStore}-${path.replaceAll('/', '__')}`;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
streamName = args.stream_name;
|
|
76
|
-
consumerName = args.consumer_name;
|
|
77
|
-
if (args.use_jetstream) {
|
|
78
|
-
setStreamAndConsumerNames();
|
|
72
|
+
$effect(() => {
|
|
73
|
+
if (natsCfg.use_jetstream) {
|
|
74
|
+
untrack(() => setStreamAndConsumerNames());
|
|
79
75
|
}
|
|
80
|
-
}
|
|
81
|
-
function getNatsArgsCfg() {
|
|
82
|
-
return {
|
|
83
|
-
subjects,
|
|
84
|
-
use_jetstream: useJetstream,
|
|
85
|
-
stream_name: streamName,
|
|
86
|
-
consumer_name: consumerName
|
|
87
|
-
};
|
|
88
|
-
}
|
|
76
|
+
});
|
|
89
77
|
</script>
|
|
90
78
|
|
|
91
79
|
<div>
|
|
@@ -121,7 +109,7 @@ function getNatsArgsCfg() {
|
|
|
121
109
|
<Subsection headless={true}>
|
|
122
110
|
<SchemaForm
|
|
123
111
|
schema={argsSchema}
|
|
124
|
-
bind:args={
|
|
112
|
+
bind:args={natsCfg}
|
|
125
113
|
bind:isValid={otherArgsValid}
|
|
126
114
|
lightHeader={true}
|
|
127
115
|
disabled={!can_write}
|
|
@@ -2,10 +2,12 @@ interface Props {
|
|
|
2
2
|
defaultValues?: Record<string, any> | undefined;
|
|
3
3
|
headless?: boolean;
|
|
4
4
|
natsResourcePath: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
natsCfg: {
|
|
6
|
+
subjects: string[];
|
|
7
|
+
use_jetstream: boolean;
|
|
8
|
+
stream_name?: string;
|
|
9
|
+
consumer_name?: string;
|
|
10
|
+
};
|
|
9
11
|
path: string;
|
|
10
12
|
can_write?: boolean;
|
|
11
13
|
showTestingBadge?: boolean;
|
|
@@ -27,6 +29,6 @@ declare const NatsTriggersConfigSection: $$__sveltets_2_IsomorphicComponent<Prop
|
|
|
27
29
|
'valid-config': CustomEvent<any>;
|
|
28
30
|
} & {
|
|
29
31
|
[evt: string]: CustomEvent<any>;
|
|
30
|
-
}, {}, {}, "
|
|
32
|
+
}, {}, {}, "natsResourcePath" | "natsCfg">;
|
|
31
33
|
type NatsTriggersConfigSection = InstanceType<typeof NatsTriggersConfigSection>;
|
|
32
34
|
export default NatsTriggersConfigSection;
|
|
@@ -331,8 +331,8 @@ $effect(() => {
|
|
|
331
331
|
</Label>
|
|
332
332
|
</div>
|
|
333
333
|
|
|
334
|
-
{
|
|
335
|
-
|
|
334
|
+
<Section label={hideTarget ? 'Runnable options' : 'Runnable'} class="flex flex-col gap-4">
|
|
335
|
+
{#if !hideTarget}
|
|
336
336
|
<div>
|
|
337
337
|
<p class="text-xs mb-1 text-tertiary">
|
|
338
338
|
Pick a script or flow to be triggered<Required required={true} />
|
|
@@ -363,21 +363,21 @@ $effect(() => {
|
|
|
363
363
|
{/if}
|
|
364
364
|
</div>
|
|
365
365
|
</div>
|
|
366
|
+
{/if}
|
|
366
367
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
{/if}
|
|
368
|
+
<Toggle
|
|
369
|
+
checked={can_return_message}
|
|
370
|
+
on:change={() => {
|
|
371
|
+
can_return_message = !can_return_message
|
|
372
|
+
}}
|
|
373
|
+
options={{
|
|
374
|
+
right: 'Send runnable result',
|
|
375
|
+
rightTooltip:
|
|
376
|
+
'Whether the runnable result should be sent as a message to the websocket server when not null.'
|
|
377
|
+
}}
|
|
378
|
+
disabled={!can_write}
|
|
379
|
+
/>
|
|
380
|
+
</Section>
|
|
381
381
|
|
|
382
382
|
<WebsocketEditorConfigSection
|
|
383
383
|
bind:url
|
package/package/hubPaths.json
CHANGED
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
"gitSync_9": "hub/19738/sync-script-to-git-repo-windmill",
|
|
12
12
|
"gitSync_10": "hub/19785/sync-script-to-git-repo-windmill",
|
|
13
13
|
"gitSync_11": "hub/19789/sync-script-to-git-repo-windmill",
|
|
14
|
-
"
|
|
14
|
+
"gitSync_12": "hub/19798/sync-script-to-git-repo-windmill",
|
|
15
|
+
"gitSync_13": "hub/19801/sync-script-to-git-repo-windmill",
|
|
16
|
+
"gitSync": "hub/19803/sync-script-to-git-repo-windmill",
|
|
15
17
|
"gitSyncTest_0": "hub/9073/git-repo-test-read-write-windmill",
|
|
16
18
|
"gitSyncTest_1": "hub/11499/git-repo-test-read-write-windmill",
|
|
17
19
|
"gitSyncTest_2": "hub/11667/git-repo-test-read-write-windmill",
|
|
@@ -2,10 +2,10 @@ import { type Script } from './gen';
|
|
|
2
2
|
import type { SupportedLanguage } from './common';
|
|
3
3
|
export declare const TS_PREPROCESSOR_SCRIPT_INTRO = "/**\n * Trigger preprocessor\n *\n * \u26A0\uFE0F This function runs BEFORE the main function.\n *\n * It processes raw trigger data from various sources (webhook, custom HTTP route, SQS, WebSocket, Kafka, NATS, MQTT, Postgres, or email)\n * before passing it to `main`. This separates the trigger logic from the main logic and keeps the auto-generated runnable UI clean.\n *\n * The returned object defines the parameter values passed to `main()`.\n * e.g., { b: 1, a: 2 } \u2192 Calls `main(2, 1)`, assuming `main` is defined as `main(a: number, b: number)`.\n * Ensure that the parameter names in `main` match the keys in the returned object.\n * \n * Learn more: https://www.windmill.dev/docs/core_concepts/preprocessors\n */\n";
|
|
4
4
|
export declare const TS_PREPROCESSOR_FLOW_INTRO = "/**\n * Trigger preprocessor\n *\n * It processes raw trigger data from various sources (webhook, custom HTTP route, SQS, WebSocket, Kafka, NATS, MQTT, Postgres, or email) \n * before passing it to the flow. This separates the trigger logic from the flow logic and keeps the auto-generated UI clean.\n * \n * The returned object determines the parameter values passed to the flow.\n * e.g., `{ b: 1, a: 2 }` \u2192 Calls the flow with `a = 2` and `b = 1`, assuming the flow has two inputs called `a` and `b`.\n * Ensure that the input names of the flow match the keys in the returned object.\n * \n * Learn more: https://www.windmill.dev/docs/core_concepts/preprocessors\n */\n";
|
|
5
|
-
export declare const TS_PREPROCESSOR_MODULE_CODE = "export async function preprocessor(\n event:\n | {\n kind: \"webhook\";\n body: any;\n raw_string: string | null;\n query: Record<string, string>;\n headers: Record<string, string>;\n }\n | {\n kind: \"http\";\n body: any;\n raw_string: string | null;\n route: string;\n path: string;\n method: string;\n params: Record<string, string>;\n query: Record<string, string>;\n headers: Record<string, string>;\n }\n | {\n kind: \"email\";\n parsed_email: any;\n raw_email: string;\n }\n | { kind: \"websocket\"; msg: string; url: string }\n | {\n kind: \"kafka\";\n payload: string;\n brokers: string[];\n topic: string;\n group_id: string;\n }\n | {\n kind: \"nats\";\n payload: string;\n servers: string[];\n subject: string;\n headers?: Record<string, string[]>;\n status?: number;\n description?: string;\n length: number;\n }\n | {\n kind: \"sqs\";\n msg: string;\n queue_url: string;\n message_id?: string;\n receipt_handle?: string;\n attributes: Record<string, string>;\n message_attributes?: Record<\n string,\n { string_value?: string; data_type: string }\n >;\n }\n | {\n kind: \"mqtt\";\n payload: string;\n topic: string;\n retain: boolean;\n pkid: number;\n qos: number;\n v5?: {\n payload_format_indicator?: number;\n topic_alias?: number;\n response_topic?: string;\n correlation_data?: Array<number>;\n user_properties?: Array<[string, string]>;\n subscription_identifiers?: Array<number>;\n content_type?: string;\n };\n }\n | {\n kind: \"gcp\";\n payload: string;\n message_id: string;\n subscription: string;\n ordering_key?: string;\n attributes?: Record<string, string>;\n delivery_type: \"push\" | \"pull\";\n headers?: Record<string, string>;\n publish_time?: string;\n ack_id?: string;\n }\n | {\n kind: \"postgres\";\n transaction_type: \"insert\" | \"update\" | \"delete\",\n schema_name: string,\n table_name: string,\n old_row?: Record<string, any>,\n row: Record<string, any>\n }\n) {\n return {\n // return the args to be passed to the runnable\n };\n}\n";
|
|
5
|
+
export declare const TS_PREPROCESSOR_MODULE_CODE = "export async function preprocessor(\n event:\n | {\n kind: \"webhook\";\n body: any;\n raw_string: string | null;\n query: Record<string, string>;\n headers: Record<string, string>;\n }\n | {\n kind: \"http\";\n body: any;\n raw_string: string | null;\n route: string;\n path: string;\n method: string;\n params: Record<string, string>;\n query: Record<string, string>;\n headers: Record<string, string>;\n }\n | {\n kind: \"email\";\n parsed_email: any;\n raw_email: string;\n email_extra_args?: Record<string, string>;\n }\n | { kind: \"websocket\"; msg: string; url: string }\n | {\n kind: \"kafka\";\n payload: string;\n brokers: string[];\n topic: string;\n group_id: string;\n }\n | {\n kind: \"nats\";\n payload: string;\n servers: string[];\n subject: string;\n headers?: Record<string, string[]>;\n status?: number;\n description?: string;\n length: number;\n }\n | {\n kind: \"sqs\";\n msg: string;\n queue_url: string;\n message_id?: string;\n receipt_handle?: string;\n attributes: Record<string, string>;\n message_attributes?: Record<\n string,\n { string_value?: string; data_type: string }\n >;\n }\n | {\n kind: \"mqtt\";\n payload: string;\n topic: string;\n retain: boolean;\n pkid: number;\n qos: number;\n v5?: {\n payload_format_indicator?: number;\n topic_alias?: number;\n response_topic?: string;\n correlation_data?: Array<number>;\n user_properties?: Array<[string, string]>;\n subscription_identifiers?: Array<number>;\n content_type?: string;\n };\n }\n | {\n kind: \"gcp\";\n payload: string;\n message_id: string;\n subscription: string;\n ordering_key?: string;\n attributes?: Record<string, string>;\n delivery_type: \"push\" | \"pull\";\n headers?: Record<string, string>;\n publish_time?: string;\n ack_id?: string;\n }\n | {\n kind: \"postgres\";\n transaction_type: \"insert\" | \"update\" | \"delete\",\n schema_name: string,\n table_name: string,\n old_row?: Record<string, any>,\n row: Record<string, any>\n }\n) {\n return {\n // return the args to be passed to the runnable\n };\n}\n";
|
|
6
6
|
export declare const PYTHON_PREPROCESSOR_SCRIPT_INTRO = "# Trigger preprocessor\n#\n# \u26A0\uFE0F This function runs BEFORE the main function.\n#\n# It processes raw trigger data from various sources (webhook, custom HTTP route, SQS, WebSocket, Kafka, NATS, MQTT, Postgres, or email) \n# before passing it to `main`. This separates the trigger logic from the main logic and keeps the auto-generated UI clean.\n#\n# The returned object defines the parameter values passed to `main()`.\n# e.g., { b: 1, a: 2 } \u2192 Calls `main(2, 1)`, assuming `main` is defined as `main(a: int, b: int)`.\n# Ensure that the parameter names in `main` match the keys in the returned object.\n#\n# Learn more: https://www.windmill.dev/docs/core_concepts/preprocessors\n\n";
|
|
7
7
|
export declare const PYTHON_PREPROCESSOR_FLOW_INTRO = "# Trigger preprocessor\n#\n# It processes raw trigger data from various sources (webhook, custom HTTP route, SQS, WebSocket, Kafka, NATS, MQTT, Postgres, or email) \n# before passing it to the flow. This separates the trigger logic from the flow logic and keeps the auto-generated UI clean.\n# \n# The returned object determines the parameter values passed to the flow.\n# e.g., `{ b: 1, a: 2 }` \u2192 Calls the flow with `a = 2` and `b = 1`, assuming the flow has two inputs called `a` and `b`.\n# Ensure that the input names of the flow match the keys in the returned object.\n#\n# Learn more: https://www.windmill.dev/docs/core_concepts/preprocessors\n\n";
|
|
8
|
-
export declare const PYTHON_PREPROCESSOR_MODULE_CODE = "from typing import TypedDict, Literal, Optional, Union\n\n\nclass WebhookEvent(TypedDict):\n kind: Literal[\"webhook\"]\n body: dict\n raw_string: Optional[str]\n query: dict[str, str]\n headers: dict[str, str]\n\n\nclass HttpEvent(TypedDict):\n kind: Literal[\"http\"]\n body: dict\n raw_string: Optional[str]\n route: str\n path: str\n method: str\n params: dict[str, str]\n query: dict[str, str]\n headers: dict[str, str]\n\n\nclass EmailEvent(TypedDict):\n kind: Literal[\"email\"]\n parsed_email: dict\n raw_email: str\n\n\nclass WebsocketEvent(TypedDict):\n kind: Literal[\"websocket\"]\n msg: str\n url: str\n\n\nclass KafkaEvent(TypedDict):\n kind: Literal[\"kafka\"]\n payload: str\n brokers: list[str]\n topic: str\n group_id: str\n\n\nclass NatsEvent(TypedDict):\n kind: Literal[\"nats\"]\n payload: str\n servers: list[str]\n subject: str\n headers: Optional[dict[str, list[str]]]\n status: Optional[int]\n description: Optional[str]\n length: int\n\n\nclass MessageAttribute(TypedDict):\n string_value: Optional[str]\n data_type: str\n\n\nclass SqsEvent(TypedDict):\n kind: Literal[\"sqs\"]\n msg: str\n queue_url: str\n message_id: Optional[str]\n receipt_handle: Optional[str]\n attributes: dict[str, str]\n message_attributes: Optional[dict[str, MessageAttribute]]\n\n\nclass MqttV5Properties(TypedDict, total=False):\n payload_format_indicator: Optional[int]\n topic_alias: Optional[int]\n response_topic: Optional[str]\n correlation_data: Optional[list[int]]\n user_properties: Optional[list[tuple[str, str]]]\n subscription_identifiers: Optional[list[int]]\n content_type: Optional[str]\n\n\nclass MqttEvent(TypedDict):\n kind: Literal[\"mqtt\"]\n payload: str\n topic: str\n retain: bool\n pkid: int\n qos: int\n v5: Optional[MqttV5Properties]\n\n\nclass GcpEvent(TypedDict):\n kind: Literal[\"gcp\"]\n payload: str\n message_id: str\n subscription: str\n ordering_key: Optional[str]\n attributes: Optional[dict[str, str]]\n delivery_type: Literal[\"push\", \"pull\"]\n headers: Optional[dict[str, str]]\n publish_time: Optional[str]\n ack_id: Optional[str]\n\n\nclass PostgresEvent(TypedDict):\n kind: Literal[\"postgres\"]\n transaction_type: Literal[\"insert\", \"update\", \"delete\"]\n schema_name: str\n table_name: str\n old_row: Optional[dict[str, any]]\n row: dict[str, any]\n\n\nEvent = Union[\n WebhookEvent,\n HttpEvent,\n EmailEvent,\n WebsocketEvent,\n KafkaEvent,\n NatsEvent,\n SqsEvent,\n MqttEvent,\n GcpEvent,\n PostgresEvent,\n]\n\n\ndef preprocessor(event: Event):\n return {\n # return the args to be passed to the runnable\n }\n";
|
|
8
|
+
export declare const PYTHON_PREPROCESSOR_MODULE_CODE = "from typing import TypedDict, Literal, Optional, Union\n\n\nclass WebhookEvent(TypedDict):\n kind: Literal[\"webhook\"]\n body: dict\n raw_string: Optional[str]\n query: dict[str, str]\n headers: dict[str, str]\n\n\nclass HttpEvent(TypedDict):\n kind: Literal[\"http\"]\n body: dict\n raw_string: Optional[str]\n route: str\n path: str\n method: str\n params: dict[str, str]\n query: dict[str, str]\n headers: dict[str, str]\n\n\nclass EmailEvent(TypedDict):\n kind: Literal[\"email\"]\n parsed_email: dict\n raw_email: str\n email_extra_args: Optional[dict[str, str]]\n\n\nclass WebsocketEvent(TypedDict):\n kind: Literal[\"websocket\"]\n msg: str\n url: str\n\n\nclass KafkaEvent(TypedDict):\n kind: Literal[\"kafka\"]\n payload: str\n brokers: list[str]\n topic: str\n group_id: str\n\n\nclass NatsEvent(TypedDict):\n kind: Literal[\"nats\"]\n payload: str\n servers: list[str]\n subject: str\n headers: Optional[dict[str, list[str]]]\n status: Optional[int]\n description: Optional[str]\n length: int\n\n\nclass MessageAttribute(TypedDict):\n string_value: Optional[str]\n data_type: str\n\n\nclass SqsEvent(TypedDict):\n kind: Literal[\"sqs\"]\n msg: str\n queue_url: str\n message_id: Optional[str]\n receipt_handle: Optional[str]\n attributes: dict[str, str]\n message_attributes: Optional[dict[str, MessageAttribute]]\n\n\nclass MqttV5Properties(TypedDict, total=False):\n payload_format_indicator: Optional[int]\n topic_alias: Optional[int]\n response_topic: Optional[str]\n correlation_data: Optional[list[int]]\n user_properties: Optional[list[tuple[str, str]]]\n subscription_identifiers: Optional[list[int]]\n content_type: Optional[str]\n\n\nclass MqttEvent(TypedDict):\n kind: Literal[\"mqtt\"]\n payload: str\n topic: str\n retain: bool\n pkid: int\n qos: int\n v5: Optional[MqttV5Properties]\n\n\nclass GcpEvent(TypedDict):\n kind: Literal[\"gcp\"]\n payload: str\n message_id: str\n subscription: str\n ordering_key: Optional[str]\n attributes: Optional[dict[str, str]]\n delivery_type: Literal[\"push\", \"pull\"]\n headers: Optional[dict[str, str]]\n publish_time: Optional[str]\n ack_id: Optional[str]\n\n\nclass PostgresEvent(TypedDict):\n kind: Literal[\"postgres\"]\n transaction_type: Literal[\"insert\", \"update\", \"delete\"]\n schema_name: str\n table_name: str\n old_row: Optional[dict[str, any]]\n row: dict[str, any]\n\n\nEvent = Union[\n WebhookEvent,\n HttpEvent,\n EmailEvent,\n WebsocketEvent,\n KafkaEvent,\n NatsEvent,\n SqsEvent,\n MqttEvent,\n GcpEvent,\n PostgresEvent,\n]\n\n\ndef preprocessor(event: Event):\n return {\n # return the args to be passed to the runnable\n }\n";
|
|
9
9
|
export declare const INITIAL_CODE: {
|
|
10
10
|
bun: {
|
|
11
11
|
scriptInitCodeBlock: string;
|