windmill-components 1.21.0 → 1.28.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/components/AppConnect.svelte +93 -47
- package/components/AppConnect.svelte.d.ts +2 -2
- package/components/ArgInfo.svelte +0 -5
- package/components/ArgInput.svelte +91 -66
- package/components/ArgInput.svelte.d.ts +8 -3
- package/components/Button.svelte +4 -4
- package/components/CenteredPage.svelte +1 -1
- package/components/CollapseLink.svelte +12 -0
- package/components/CollapseLink.svelte.d.ts +19 -0
- package/components/CronInput.svelte +84 -0
- package/components/CronInput.svelte.d.ts +18 -0
- package/components/DisplayResult.svelte +23 -7
- package/components/Editor.svelte +144 -61
- package/components/Editor.svelte.d.ts +2 -0
- package/components/EditorBar.svelte +215 -0
- package/components/EditorBar.svelte.d.ts +23 -0
- package/components/FlowBuilder.svelte +151 -79
- package/components/FlowEditor.svelte +77 -130
- package/components/FlowEditor.svelte.d.ts +3 -2
- package/components/FlowJobResult.svelte +1 -1
- package/components/FlowPreview.svelte +18 -24
- package/components/FlowPreviewContent.svelte +68 -0
- package/components/FlowPreviewContent.svelte.d.ts +21 -0
- package/components/FlowStatusViewer.svelte +85 -37
- package/components/FlowStatusViewer.svelte.d.ts +3 -2
- package/components/FlowViewer.svelte +100 -26
- package/components/FlowViewer.svelte.d.ts +8 -3
- package/components/IconedResourceType.svelte +30 -5
- package/components/InputTransformForm.svelte +209 -0
- package/components/InputTransformForm.svelte.d.ts +26 -0
- package/components/InviteGlobalUser.svelte +2 -2
- package/components/InviteUser.svelte +2 -2
- package/components/JobStatus.svelte +32 -25
- package/components/Modal.svelte +47 -43
- package/components/ModuleStep.svelte +100 -54
- package/components/ObjectResourceInput.svelte +58 -38
- package/components/ObjectTypeNarrowing.svelte +4 -19
- package/components/Path.svelte +3 -3
- package/components/Path.svelte.d.ts +1 -1
- package/components/RadioButton.svelte +11 -96
- package/components/RadioButton.svelte.d.ts +4 -2
- package/components/ResourceEditor.svelte +5 -6
- package/components/ResourceEditor.svelte.d.ts +2 -2
- package/components/ResourcePicker.svelte +25 -2
- package/components/ResourcePicker.svelte.d.ts +3 -0
- package/components/ResourceTypePicker.svelte +17 -29
- package/components/ResourceTypePicker.svelte.d.ts +1 -0
- package/components/RunForm.svelte +14 -15
- package/components/RunForm.svelte.d.ts +1 -1
- package/components/SchemaEditor.svelte +87 -71
- package/components/SchemaEditor.svelte.d.ts +2 -0
- package/components/SchemaEditorProperty.svelte +11 -0
- package/components/SchemaEditorProperty.svelte.d.ts +17 -0
- package/components/SchemaForm.svelte +21 -127
- package/components/SchemaForm.svelte.d.ts +3 -4
- package/components/SchemaModal.svelte +20 -33
- package/components/SchemaModal.svelte.d.ts +1 -1
- package/components/SchemaViewer.svelte +5 -7
- package/components/ScriptBuilder.svelte +41 -44
- package/components/ScriptEditor.svelte +76 -248
- package/components/ScriptPicker.svelte +13 -26
- package/components/ScriptPicker.svelte.d.ts +1 -1
- package/components/ScriptSchema.svelte +0 -5
- package/components/ShareModal.svelte +1 -1
- package/components/SharedBadge.svelte +12 -10
- package/components/StringTypeNarrowing.svelte +8 -4
- package/components/StringTypeNarrowing.svelte.d.ts +1 -0
- package/components/TableCustom.svelte +7 -9
- package/components/TableSimple.svelte +1 -1
- package/components/Toggle.svelte +8 -10
- package/components/Toggle.svelte.d.ts +5 -11
- package/components/Tooltip.svelte +56 -82
- package/components/Tooltip.svelte.d.ts +1 -5
- package/components/VariableEditor.svelte +21 -6
- package/components/flows/CopyFirstStepSchema.svelte +7 -5
- package/components/flows/DynamicInputHelpBox.svelte +1 -1
- package/components/flows/FlowBox.svelte +3 -0
- package/components/flows/FlowBox.svelte.d.ts +23 -0
- package/components/flows/FlowBoxHeader.svelte +9 -0
- package/components/flows/FlowBoxHeader.svelte.d.ts +18 -0
- package/components/flows/FlowInput.svelte +20 -0
- package/components/flows/FlowInput.svelte.d.ts +14 -0
- package/components/flows/FlowInputs.svelte +7 -3
- package/components/flows/FlowModuleHeader.svelte +44 -41
- package/components/flows/FlowModuleHeader.svelte.d.ts +1 -1
- package/components/flows/FlowSettings.svelte +174 -0
- package/components/flows/FlowSettings.svelte.d.ts +21 -0
- package/components/flows/flowStore.d.ts +5 -2
- package/components/flows/flowStore.js +65 -9
- package/components/flows/pickers/FlowScriptPicker.svelte +6 -1
- package/components/flows/pickers/FlowScriptPicker.svelte.d.ts +1 -0
- package/components/flows/utils.d.ts +11 -11
- package/components/flows/utils.js +103 -63
- package/components/icons/AirtableIcon.svelte +17 -0
- package/components/icons/AirtableIcon.svelte.d.ts +17 -0
- package/components/icons/GCloudIcon.svelte +16 -0
- package/components/icons/GCloudIcon.svelte.d.ts +17 -0
- package/components/icons/GItlabIcon.svelte +16 -0
- package/components/icons/GItlabIcon.svelte.d.ts +17 -0
- package/components/icons/GSheetsIcon.svelte +16 -0
- package/components/icons/GSheetsIcon.svelte.d.ts +17 -0
- package/components/icons/GcalIcon.svelte +16 -0
- package/components/icons/GcalIcon.svelte.d.ts +17 -0
- package/components/icons/GdriveIcon.svelte +16 -0
- package/components/icons/GdriveIcon.svelte.d.ts +17 -0
- package/components/icons/GmailIcon.svelte +16 -0
- package/components/icons/GmailIcon.svelte.d.ts +17 -0
- package/components/icons/PostgresIcon.svelte +8 -49
- package/components/icons/Slack.svelte +9 -18
- package/components/icons/TogglIcon.svelte +59 -0
- package/components/icons/TogglIcon.svelte.d.ts +17 -0
- package/components/propertyPicker/ObjectViewer.svelte +35 -37
- package/components/propertyPicker/ObjectViewer.svelte.d.ts +1 -0
- package/components/propertyPicker/OverlayPropertyPicker.svelte +53 -53
- package/components/propertyPicker/OverlayPropertyPicker.svelte.d.ts +5 -2
- package/components/propertyPicker/PropPicker.svelte +13 -15
- package/components/propertyPicker/PropPicker.svelte.d.ts +1 -1
- package/components/propertyPicker/WarningMessage.svelte +14 -41
- package/components/propertyPicker/WarningMessage.svelte.d.ts +11 -8
- package/components/propertyPicker/utils.d.ts +1 -0
- package/components/propertyPicker/utils.js +25 -0
- package/gen/core/OpenAPI.js +1 -1
- package/gen/index.d.ts +12 -2
- package/gen/index.js +1 -2
- package/gen/models/CompletedJob.d.ts +1 -1
- package/gen/models/Flow.d.ts +3 -13
- package/gen/models/FlowMetadata.d.ts +9 -0
- package/gen/models/FlowMetadata.js +4 -0
- package/gen/models/FlowModuleValue.d.ts +5 -22
- package/gen/models/FlowModuleValue.js +1 -15
- package/gen/models/ForloopFlow.d.ts +8 -0
- package/gen/models/ForloopFlow.js +4 -0
- package/gen/models/InputTransform.d.ts +3 -12
- package/gen/models/InputTransform.js +1 -8
- package/gen/models/JavascriptTransform.d.ts +4 -0
- package/gen/models/JavascriptTransform.js +4 -0
- package/gen/models/MainArgSignature.d.ts +1 -1
- package/gen/models/NewSchedule.d.ts +1 -0
- package/gen/models/OpenFlow.d.ts +7 -0
- package/gen/models/OpenFlow.js +4 -0
- package/gen/models/OpenFlowWPath.d.ts +4 -0
- package/gen/models/OpenFlowWPath.js +4 -0
- package/gen/models/PathFlow.d.ts +4 -0
- package/gen/models/PathFlow.js +4 -0
- package/gen/models/PathScript.d.ts +4 -0
- package/gen/models/PathScript.js +4 -0
- package/gen/models/RawScript.d.ts +12 -0
- package/gen/models/RawScript.js +11 -0
- package/gen/models/Schedule.d.ts +1 -1
- package/gen/models/StaticTransform.d.ts +4 -0
- package/gen/models/StaticTransform.js +4 -0
- package/gen/models/TokenResponse.d.ts +3 -3
- package/gen/models/Usage.d.ts +5 -0
- package/gen/models/Usage.js +4 -0
- package/gen/models/User.d.ts +2 -0
- package/gen/schemas/$AuditLog.d.ts +32 -0
- package/gen/schemas/$AuditLog.js +35 -0
- package/gen/schemas/$CompletedJob.d.ts +98 -0
- package/gen/schemas/$CompletedJob.js +103 -0
- package/gen/schemas/$ContextualVariable.d.ts +16 -0
- package/gen/schemas/$ContextualVariable.js +19 -0
- package/gen/schemas/$CreateResource.d.ts +22 -0
- package/gen/schemas/$CreateResource.js +25 -0
- package/gen/schemas/$CreateVariable.d.ts +26 -0
- package/gen/schemas/$CreateVariable.js +29 -0
- package/gen/schemas/$CreateWorkspace.d.ts +20 -0
- package/gen/schemas/$CreateWorkspace.js +23 -0
- package/gen/schemas/$EditResource.d.ts +13 -0
- package/gen/schemas/$EditResource.js +16 -0
- package/gen/schemas/$EditResourceType.d.ts +10 -0
- package/gen/schemas/$EditResourceType.js +13 -0
- package/gen/schemas/$EditSchedule.d.ts +20 -0
- package/gen/schemas/$EditSchedule.js +23 -0
- package/gen/schemas/$EditVariable.d.ts +16 -0
- package/gen/schemas/$EditVariable.js +19 -0
- package/gen/schemas/$EditWorkspaceUser.d.ts +7 -0
- package/gen/schemas/$EditWorkspaceUser.js +10 -0
- package/gen/schemas/$Flow.d.ts +23 -0
- package/gen/schemas/$Flow.js +26 -0
- package/gen/schemas/$FlowMetadata.d.ts +31 -0
- package/gen/schemas/$FlowMetadata.js +34 -0
- package/gen/schemas/$FlowPreview.d.ts +80 -0
- package/gen/schemas/$FlowPreview.js +83 -0
- package/gen/schemas/$GlobalUserInfo.d.ts +26 -0
- package/gen/schemas/$GlobalUserInfo.js +29 -0
- package/gen/schemas/$Group.d.ts +23 -0
- package/gen/schemas/$Group.js +26 -0
- package/gen/schemas/$Job.d.ts +17 -0
- package/gen/schemas/$Job.js +20 -0
- package/gen/schemas/$ListableVariable.d.ts +35 -0
- package/gen/schemas/$ListableVariable.js +38 -0
- package/gen/schemas/$Login.d.ts +12 -0
- package/gen/schemas/$Login.js +15 -0
- package/gen/schemas/$MainArgSignature.d.ts +50 -0
- package/gen/schemas/$MainArgSignature.js +53 -0
- package/gen/schemas/$NewSchedule.d.ts +30 -0
- package/gen/schemas/$NewSchedule.js +33 -0
- package/gen/schemas/$NewToken.d.ts +11 -0
- package/gen/schemas/$NewToken.js +14 -0
- package/gen/schemas/$NewUser.d.ts +16 -0
- package/gen/schemas/$NewUser.js +19 -0
- package/gen/schemas/$Preview.d.ts +19 -0
- package/gen/schemas/$Preview.js +22 -0
- package/gen/schemas/$QueuedJob.d.ts +139 -0
- package/gen/schemas/$QueuedJob.js +144 -0
- package/gen/schemas/$Resource.d.ts +31 -0
- package/gen/schemas/$Resource.js +34 -0
- package/gen/schemas/$ResourceType.d.ts +17 -0
- package/gen/schemas/$ResourceType.js +20 -0
- package/gen/schemas/$Schedule.d.ts +47 -0
- package/gen/schemas/$Schedule.js +50 -0
- package/gen/schemas/$Script.d.ts +77 -0
- package/gen/schemas/$Script.js +80 -0
- package/gen/schemas/$ScriptArgs.d.ts +6 -0
- package/gen/schemas/$ScriptArgs.js +9 -0
- package/gen/schemas/$SlackToken.d.ts +24 -0
- package/gen/schemas/$SlackToken.js +27 -0
- package/gen/schemas/$TokenResponse.d.ts +23 -0
- package/gen/schemas/$TokenResponse.js +26 -0
- package/gen/schemas/$TruncatedToken.d.ts +25 -0
- package/gen/schemas/$TruncatedToken.js +28 -0
- package/gen/schemas/$Usage.d.ts +13 -0
- package/gen/schemas/$Usage.js +16 -0
- package/gen/schemas/$User.d.ts +42 -0
- package/gen/schemas/$User.js +45 -0
- package/gen/schemas/$UserWorkspaceList.d.ts +28 -0
- package/gen/schemas/$UserWorkspaceList.js +31 -0
- package/gen/schemas/$WorkerPing.d.ts +31 -0
- package/gen/schemas/$WorkerPing.js +34 -0
- package/gen/schemas/$Workspace.d.ts +19 -0
- package/gen/schemas/$Workspace.js +22 -0
- package/gen/schemas/$WorkspaceInvite.d.ts +16 -0
- package/gen/schemas/$WorkspaceInvite.js +19 -0
- package/gen/services/FlowService.d.ts +30 -16
- package/gen/services/FlowService.js +25 -0
- package/gen/services/JobService.d.ts +1 -1
- package/gen/services/ScriptService.d.ts +13 -8
- package/gen/services/WorkspaceService.d.ts +1 -1
- package/gen/services/WorkspaceService.js +1 -1
- package/infer.js +8 -1
- package/package.json +87 -15
- package/script_helpers.d.ts +1 -1
- package/script_helpers.js +7 -6
- package/sql.d.ts +89 -0
- package/sql.js +817 -0
- package/stores.d.ts +1 -1
- package/stores.js +0 -6
- package/utils.d.ts +26 -6
- package/utils.js +94 -7
- package/components/RadioButtonV2.svelte +0 -38
- package/components/RadioButtonV2.svelte.d.ts +0 -20
|
@@ -3,40 +3,78 @@ import Highlight from 'svelte-highlight';
|
|
|
3
3
|
import json from 'svelte-highlight/languages/json';
|
|
4
4
|
import python from 'svelte-highlight/languages/python';
|
|
5
5
|
import typescript from 'svelte-highlight/languages/typescript';
|
|
6
|
-
import { FlowModuleValue } from '../gen';
|
|
7
|
-
import github from 'svelte-highlight/styles/github';
|
|
8
6
|
import { slide } from 'svelte/transition';
|
|
9
7
|
import Tabs from './Tabs.svelte';
|
|
8
|
+
import SchemaViewer from './SchemaViewer.svelte';
|
|
9
|
+
import FieldHeader from './FieldHeader.svelte';
|
|
10
10
|
export let flow;
|
|
11
|
+
let flowFiltered = {
|
|
12
|
+
summary: flow.summary,
|
|
13
|
+
description: flow.description,
|
|
14
|
+
value: flow.value,
|
|
15
|
+
schema: flow.schema
|
|
16
|
+
};
|
|
11
17
|
export let embedded = false;
|
|
12
18
|
export let tab = 'ui';
|
|
13
19
|
let open = {};
|
|
20
|
+
let hubCode = {};
|
|
21
|
+
function toAny(x) {
|
|
22
|
+
return x;
|
|
23
|
+
}
|
|
14
24
|
</script>
|
|
15
25
|
|
|
16
|
-
<svelte:head>
|
|
17
|
-
{@html github}
|
|
18
|
-
</svelte:head>
|
|
19
|
-
|
|
20
26
|
{#if !embedded}
|
|
21
27
|
<Tabs
|
|
22
28
|
tabs={[
|
|
23
29
|
['ui', 'Flow rendered'],
|
|
24
|
-
['json', 'JSON']
|
|
30
|
+
['json', 'JSON'],
|
|
31
|
+
['schema', 'Input schema of the flow']
|
|
25
32
|
]}
|
|
26
33
|
bind:tab
|
|
27
34
|
/>
|
|
28
35
|
{/if}
|
|
29
36
|
{#if tab == 'ui'}
|
|
30
|
-
<div class="flow-root w-full
|
|
31
|
-
|
|
32
|
-
<
|
|
37
|
+
<div class="flow-root w-full pb-4">
|
|
38
|
+
{#if !embedded}
|
|
39
|
+
<h2 class="mt-4">{flow.summary}</h2>
|
|
40
|
+
<h3 class="mt-4">{flow.description}</h3>
|
|
41
|
+
|
|
42
|
+
<p class="font-black text-lg w-full my-4">
|
|
43
|
+
<span>Inputs</span>
|
|
44
|
+
</p>
|
|
45
|
+
{#if flow.schema && flow.schema.properties && Object.keys(flow.schema.properties).length > 0 && flow.schema}
|
|
46
|
+
<ul class="my-2">
|
|
47
|
+
{#each Object.entries(flow.schema.properties) as [inp, v]}
|
|
48
|
+
<li class="list-disc flex flex-row">
|
|
49
|
+
<FieldHeader
|
|
50
|
+
label={inp}
|
|
51
|
+
required={flow.schema.required?.includes(inp)}
|
|
52
|
+
type={toAny(v)?.type}
|
|
53
|
+
contentEncoding={toAny(v)?.contentEncoding}
|
|
54
|
+
format={toAny(v)?.format}
|
|
55
|
+
itemsType={toAny(v)?.itemsType}
|
|
56
|
+
/><span class="ml-4 mt-2 text-xs"
|
|
57
|
+
>{toAny(v)?.default != undefined
|
|
58
|
+
? 'default: ' + JSON.stringify(toAny(v)?.default)
|
|
59
|
+
: ''}</span
|
|
60
|
+
>
|
|
61
|
+
</li>
|
|
62
|
+
{/each}
|
|
63
|
+
</ul>
|
|
64
|
+
{:else}
|
|
65
|
+
<div class="text-gray-700 text-xs italic mb-4">No inputs</div>
|
|
66
|
+
{/if}
|
|
67
|
+
{/if}
|
|
68
|
+
|
|
69
|
+
<p class="font-black text-lg my-6 w-full">
|
|
70
|
+
<span>{flow?.value?.modules?.length} Step{flow?.value?.modules?.length > 1 ? 's' : ''} </span>
|
|
33
71
|
<span class="mt-4" />
|
|
34
72
|
</p>
|
|
35
73
|
<ul class="-mb-8 w-full">
|
|
36
|
-
{#each flow
|
|
74
|
+
{#each flow?.value?.modules ?? [] as mod, i}
|
|
37
75
|
<li class="w-full">
|
|
38
76
|
<div class="relative pb-8 w-full">
|
|
39
|
-
{#if i < (flow
|
|
77
|
+
{#if i < (flow?.value?.modules ?? []).length - 1}
|
|
40
78
|
<span
|
|
41
79
|
class="absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200"
|
|
42
80
|
aria-hidden="true"
|
|
@@ -52,33 +90,58 @@ let open = {};
|
|
|
52
90
|
<div class="min-w-0 flex-1 pt-1.5 flex justify-between space-x-4 w-full">
|
|
53
91
|
<div class="w-full">
|
|
54
92
|
<p class="text-sm text-gray-500">
|
|
55
|
-
{#if mod
|
|
93
|
+
{#if mod?.value?.type == 'script'}
|
|
56
94
|
Script at path <a
|
|
57
95
|
target="_blank"
|
|
58
|
-
href={scriptPathToHref(mod
|
|
59
|
-
class="font-medium text-gray-900">{mod
|
|
96
|
+
href={scriptPathToHref(mod?.value?.path ?? '')}
|
|
97
|
+
class="font-medium text-gray-900">{mod?.value?.path}</a
|
|
60
98
|
>
|
|
61
|
-
|
|
99
|
+
{#if mod?.value?.path?.startsWith('hub/')}
|
|
100
|
+
<div>
|
|
101
|
+
<button
|
|
102
|
+
on:click={async () => {
|
|
103
|
+
open[i] = !open[i]
|
|
104
|
+
}}
|
|
105
|
+
class="mb-2 underline text-black"
|
|
106
|
+
>
|
|
107
|
+
View code {open[i] ? '(-)' : '(+)'}</button
|
|
108
|
+
>
|
|
109
|
+
{#if open[i]}
|
|
110
|
+
<div class="w-full h-full">
|
|
111
|
+
<iframe
|
|
112
|
+
style="height: 400px;"
|
|
113
|
+
class="w-full h-full text-sm"
|
|
114
|
+
title="embedded script from hub"
|
|
115
|
+
frameborder="0"
|
|
116
|
+
src="https://hub.windmill.dev/embed/script/{mod?.value?.path?.substring(
|
|
117
|
+
4
|
|
118
|
+
)}"
|
|
119
|
+
/>
|
|
120
|
+
</div>
|
|
121
|
+
{/if}
|
|
122
|
+
</div>
|
|
123
|
+
{/if}
|
|
124
|
+
{:else if mod?.value?.type == 'rawscript'}
|
|
62
125
|
<button
|
|
63
126
|
on:click={() => (open[i] = !open[i])}
|
|
64
127
|
class="mb-2 underline text-black"
|
|
65
128
|
>
|
|
66
|
-
Raw {mod
|
|
129
|
+
Raw {mod?.value?.language} script {open[i] ? '(-)' : '(+)'}</button
|
|
67
130
|
>
|
|
68
131
|
|
|
69
132
|
{#if open[i]}
|
|
70
133
|
<div transition:slide class="border border-black p-2 bg-gray-50 w-full">
|
|
71
134
|
<Highlight
|
|
72
|
-
language={mod
|
|
73
|
-
code={mod
|
|
135
|
+
language={mod?.value?.language == 'deno' ? typescript : python}
|
|
136
|
+
code={mod?.value?.content}
|
|
74
137
|
/>
|
|
75
138
|
</div>
|
|
76
139
|
{/if}
|
|
77
|
-
{:else if mod
|
|
78
|
-
Flow at path {mod
|
|
79
|
-
{:else if mod
|
|
80
|
-
For loop over step {i}
|
|
81
|
-
<svelte:self flow={mod
|
|
140
|
+
{:else if mod?.value?.type == 'flow'}
|
|
141
|
+
Flow at path {mod?.value?.path}
|
|
142
|
+
{:else if mod?.value?.type == 'forloopflow'}
|
|
143
|
+
For loop over all the elements of the list returned as a result of step {i}:
|
|
144
|
+
<svelte:self flow={mod?.value} embedded={true} />
|
|
82
145
|
{/if}
|
|
83
146
|
</p>
|
|
84
147
|
</div>
|
|
@@ -89,6 +152,17 @@ let open = {};
|
|
|
89
152
|
{/each}
|
|
90
153
|
</ul>
|
|
91
154
|
</div>
|
|
92
|
-
{:else}
|
|
93
|
-
<
|
|
155
|
+
{:else if tab == 'json'}
|
|
156
|
+
<div class="relative">
|
|
157
|
+
<button
|
|
158
|
+
on:click={async () => {
|
|
159
|
+
await navigator.clipboard.writeText(JSON.stringify(flowFiltered, null, 4))
|
|
160
|
+
}}
|
|
161
|
+
class="absolute default-secondary-button-v2 bg-white/30 right-0 my-2 ml-4"
|
|
162
|
+
>copy content</button
|
|
163
|
+
>
|
|
164
|
+
<Highlight language={json} code={JSON.stringify(flowFiltered, null, 4)} />
|
|
165
|
+
</div>
|
|
166
|
+
{:else if tab == 'schema'}
|
|
167
|
+
<SchemaViewer schema={flow.schema} />
|
|
94
168
|
{/if}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import {
|
|
2
|
+
import type { FlowValue } from '../gen';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
flow:
|
|
5
|
+
flow: {
|
|
6
|
+
summary: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
value: FlowValue;
|
|
9
|
+
schema?: any;
|
|
10
|
+
};
|
|
6
11
|
embedded?: boolean | undefined;
|
|
7
|
-
tab?: "json" | "ui" | undefined;
|
|
12
|
+
tab?: "json" | "schema" | "ui" | undefined;
|
|
8
13
|
};
|
|
9
14
|
events: {
|
|
10
15
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,20 +1,29 @@
|
|
|
1
|
-
<script>import
|
|
2
|
-
import
|
|
1
|
+
<script>import { faGithub } from '@fortawesome/free-brands-svg-icons';
|
|
2
|
+
import Icon from 'svelte-awesome';
|
|
3
|
+
import AirtableIcon from './icons/AirtableIcon.svelte';
|
|
3
4
|
import DbIcon from './icons/DbIcon.svelte';
|
|
5
|
+
import GcalIcon from './icons/GcalIcon.svelte';
|
|
6
|
+
import GCloudIcon from './icons/GCloudIcon.svelte';
|
|
7
|
+
import GdriveIcon from './icons/GdriveIcon.svelte';
|
|
8
|
+
import GitlabIcon from './icons/GItlabIcon.svelte';
|
|
9
|
+
import GmailIcon from './icons/GmailIcon.svelte';
|
|
10
|
+
import GSheetsIcon from './icons/GSheetsIcon.svelte';
|
|
11
|
+
import Mail from './icons/Mail.svelte';
|
|
12
|
+
import Mysql from './icons/Mysql.svelte';
|
|
4
13
|
import PostgresIcon from './icons/PostgresIcon.svelte';
|
|
5
|
-
import { faGithub } from '@fortawesome/free-brands-svg-icons';
|
|
6
14
|
import Slack from './icons/Slack.svelte';
|
|
7
|
-
import
|
|
15
|
+
import TogglIcon from './icons/TogglIcon.svelte';
|
|
8
16
|
export let name;
|
|
9
17
|
export let after = false;
|
|
10
18
|
export let height = '24px';
|
|
11
19
|
export let width = '24px';
|
|
12
20
|
</script>
|
|
13
21
|
|
|
14
|
-
<div class="flex flex-row gap-2">
|
|
22
|
+
<div class="flex flex-row gap-2 justify-center -pl-2 whitespace-nowrap">
|
|
15
23
|
{#if !after}
|
|
16
24
|
{name}
|
|
17
25
|
{/if}
|
|
26
|
+
|
|
18
27
|
{#if name === 'postgresql'}
|
|
19
28
|
<PostgresIcon {height} {width} />
|
|
20
29
|
{:else if name === 'mysql'}
|
|
@@ -27,6 +36,22 @@ export let width = '24px';
|
|
|
27
36
|
<Slack {height} {width} />
|
|
28
37
|
{:else if name === 'github'}
|
|
29
38
|
<Icon data={faGithub} scale={1.4} />
|
|
39
|
+
{:else if name === 'gmail'}
|
|
40
|
+
<GmailIcon {height} {width} />
|
|
41
|
+
{:else if name === 'gsheets'}
|
|
42
|
+
<GSheetsIcon {height} {width} />
|
|
43
|
+
{:else if name === 'gitlab'}
|
|
44
|
+
<GitlabIcon {height} {width} />
|
|
45
|
+
{:else if name === 'gcloud'}
|
|
46
|
+
<GCloudIcon {height} {width} />
|
|
47
|
+
{:else if name === 'gcal'}
|
|
48
|
+
<GcalIcon {height} {width} />
|
|
49
|
+
{:else if name === 'gdrive'}
|
|
50
|
+
<GdriveIcon {height} {width} />
|
|
51
|
+
{:else if name === 'airtable'}
|
|
52
|
+
<AirtableIcon {height} {width} />
|
|
53
|
+
{:else if name === 'toggl'}
|
|
54
|
+
<TogglIcon {height} {width} />
|
|
30
55
|
{/if}
|
|
31
56
|
{#if after}
|
|
32
57
|
{name}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
<script>import { faChain } from '@fortawesome/free-solid-svg-icons';
|
|
2
|
+
import { Button, Tooltip } from 'flowbite-svelte';
|
|
3
|
+
import Icon from 'svelte-awesome';
|
|
4
|
+
import ArgInput from './ArgInput.svelte';
|
|
5
|
+
import Editor from './Editor.svelte';
|
|
6
|
+
import FieldHeader from './FieldHeader.svelte';
|
|
7
|
+
import DynamicInputHelpBox from './flows/DynamicInputHelpBox.svelte';
|
|
8
|
+
import { codeToStaticTemplate } from './flows/flowStore';
|
|
9
|
+
import { getDefaultExpr, isCodeInjection } from './flows/utils';
|
|
10
|
+
import OverlayPropertyPicker from './propertyPicker/OverlayPropertyPicker.svelte';
|
|
11
|
+
import Toggle from './Toggle.svelte';
|
|
12
|
+
export let schema;
|
|
13
|
+
export let arg;
|
|
14
|
+
export let argName;
|
|
15
|
+
export let extraLib = 'missing extraLib';
|
|
16
|
+
export let inputCheck;
|
|
17
|
+
export let i = undefined;
|
|
18
|
+
export let pickableProperties = undefined;
|
|
19
|
+
let overlays = {};
|
|
20
|
+
let monacos = {};
|
|
21
|
+
let inputCats = {};
|
|
22
|
+
let propertyType = getPropertyType(arg);
|
|
23
|
+
function getPropertyType(arg) {
|
|
24
|
+
let type = arg.type;
|
|
25
|
+
if (type == 'javascript') {
|
|
26
|
+
if (codeToStaticTemplate(arg.expr)) {
|
|
27
|
+
type = 'static';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return type;
|
|
31
|
+
}
|
|
32
|
+
function setPropertyType(rawValue) {
|
|
33
|
+
if (!arg) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (isCodeInjection(rawValue)) {
|
|
37
|
+
arg.expr = getDefaultExpr(i, argName, `\`${rawValue}\``);
|
|
38
|
+
arg.type = 'javascript';
|
|
39
|
+
propertyType = 'static';
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
if (arg.type === 'javascript' && propertyType === 'static') {
|
|
43
|
+
arg.type = 'static';
|
|
44
|
+
}
|
|
45
|
+
if (arg.type) {
|
|
46
|
+
propertyType = arg.type;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function isStaticTemplate(inputCat) {
|
|
51
|
+
return inputCat === 'string' || inputCat === 'sql';
|
|
52
|
+
}
|
|
53
|
+
function focusProp(argName, monacoEditor = false) {
|
|
54
|
+
Object.keys(overlays).forEach((k) => {
|
|
55
|
+
if (k == argName && (isStaticTemplate(inputCats[argName]) || monacoEditor)) {
|
|
56
|
+
overlays[k].focus();
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
overlays[k].unfocus();
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function connectProperty(argName, rawValue) {
|
|
64
|
+
if (isStaticTemplate(inputCats[argName])) {
|
|
65
|
+
arg.value = `\$\{${rawValue}}`;
|
|
66
|
+
setPropertyType(arg.value);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
arg.expr = getDefaultExpr(i ?? -1, undefined, rawValue);
|
|
70
|
+
arg.type = 'javascript';
|
|
71
|
+
propertyType = 'javascript';
|
|
72
|
+
}
|
|
73
|
+
if (monacos[argName]) {
|
|
74
|
+
monacos[argName].setCode(arg.value);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
$: checked = propertyType == 'javascript';
|
|
78
|
+
</script>
|
|
79
|
+
|
|
80
|
+
{#if arg != undefined}
|
|
81
|
+
<div class="flex justify-between items-center">
|
|
82
|
+
<div class="flex items-center">
|
|
83
|
+
<FieldHeader
|
|
84
|
+
label={argName}
|
|
85
|
+
format={schema.properties[argName].format}
|
|
86
|
+
contentEncoding={schema.properties[argName].contentEncoding}
|
|
87
|
+
required={schema.required.includes(argName)}
|
|
88
|
+
type={schema.properties[argName].type}
|
|
89
|
+
itemsType={schema.properties[argName].items}
|
|
90
|
+
/>
|
|
91
|
+
|
|
92
|
+
{#if !checked && arg.type === 'javascript'}
|
|
93
|
+
<span class="bg-blue-100 text-blue-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded ml-2">
|
|
94
|
+
{'${...}'}
|
|
95
|
+
</span>
|
|
96
|
+
{/if}
|
|
97
|
+
</div>
|
|
98
|
+
<Toggle
|
|
99
|
+
bind:checked
|
|
100
|
+
options={{
|
|
101
|
+
right: 'Raw Javascript Editor'
|
|
102
|
+
}}
|
|
103
|
+
on:change={(e) => {
|
|
104
|
+
const type = e.detail ? 'javascript' : 'static'
|
|
105
|
+
const staticTemplate = isStaticTemplate(inputCats[argName])
|
|
106
|
+
if (type === 'javascript') {
|
|
107
|
+
arg.expr = getDefaultExpr(
|
|
108
|
+
i ?? -1,
|
|
109
|
+
argName,
|
|
110
|
+
staticTemplate ? `\`${arg.value ?? ''}\`` : arg.value
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
arg.value = undefined
|
|
114
|
+
propertyType = 'javascript'
|
|
115
|
+
} else {
|
|
116
|
+
arg.value = staticTemplate ? codeToStaticTemplate(arg.expr) : undefined
|
|
117
|
+
|
|
118
|
+
arg.expr = undefined
|
|
119
|
+
propertyType = 'static'
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
arg.type = type
|
|
123
|
+
}}
|
|
124
|
+
/>
|
|
125
|
+
</div>
|
|
126
|
+
<div class="max-w-xs" />
|
|
127
|
+
|
|
128
|
+
{#if propertyType === undefined || !checked}
|
|
129
|
+
<OverlayPropertyPicker
|
|
130
|
+
{pickableProperties}
|
|
131
|
+
bind:this={overlays[argName]}
|
|
132
|
+
on:select={({ detail }) => {
|
|
133
|
+
if (detail.pickerVariation === 'connect') {
|
|
134
|
+
connectProperty(argName, detail.propPath)
|
|
135
|
+
} else {
|
|
136
|
+
const toAppend = `\$\{${detail.propPath}}`
|
|
137
|
+
arg.value = `${arg.value ?? ''}${toAppend}`
|
|
138
|
+
if (monacos[argName]) {
|
|
139
|
+
monacos[argName].setCode(arg.value)
|
|
140
|
+
}
|
|
141
|
+
if (isStaticTemplate(inputCats[argName])) {
|
|
142
|
+
setPropertyType(arg.value)
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}}
|
|
146
|
+
>
|
|
147
|
+
<ArgInput
|
|
148
|
+
on:focus={() => focusProp(argName)}
|
|
149
|
+
label={argName}
|
|
150
|
+
bind:editor={monacos[argName]}
|
|
151
|
+
bind:description={schema.properties[argName].description}
|
|
152
|
+
bind:value={arg.value}
|
|
153
|
+
type={schema.properties[argName].type}
|
|
154
|
+
required={schema.required.includes(argName)}
|
|
155
|
+
bind:pattern={schema.properties[argName].pattern}
|
|
156
|
+
bind:valid={inputCheck[argName]}
|
|
157
|
+
defaultValue={schema.properties[argName].default}
|
|
158
|
+
bind:enum_={schema.properties[argName].enum}
|
|
159
|
+
bind:format={schema.properties[argName].format}
|
|
160
|
+
contentEncoding={schema.properties[argName].contentEncoding}
|
|
161
|
+
bind:itemsType={schema.properties[argName].items}
|
|
162
|
+
displayHeader={false}
|
|
163
|
+
bind:inputCat={inputCats[argName]}
|
|
164
|
+
on:input={(e) => {
|
|
165
|
+
if (isStaticTemplate(inputCats[argName])) {
|
|
166
|
+
setPropertyType(e.detail.rawValue)
|
|
167
|
+
}
|
|
168
|
+
}}
|
|
169
|
+
>
|
|
170
|
+
<div slot="actions">
|
|
171
|
+
<div on:click={() => overlays[argName]?.focus('connect')}>
|
|
172
|
+
<Tooltip placement="bottom" content="Input connect">
|
|
173
|
+
<Button size="sm" class="blue-button h-8">
|
|
174
|
+
<Icon data={faChain} />
|
|
175
|
+
</Button>
|
|
176
|
+
</Tooltip>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
</ArgInput>
|
|
180
|
+
</OverlayPropertyPicker>
|
|
181
|
+
{:else if checked}
|
|
182
|
+
{#if arg.expr != undefined}
|
|
183
|
+
<OverlayPropertyPicker
|
|
184
|
+
bind:this={overlays[argName]}
|
|
185
|
+
{pickableProperties}
|
|
186
|
+
on:select={(event) => {
|
|
187
|
+
monacos[argName].insertAtCursor(event.detail.propPath)
|
|
188
|
+
}}
|
|
189
|
+
>
|
|
190
|
+
<div class="border rounded p-2 mt-2 border-gray-300">
|
|
191
|
+
<Editor
|
|
192
|
+
bind:this={monacos[argName]}
|
|
193
|
+
on:focus={() => focusProp(argName, true)}
|
|
194
|
+
bind:code={arg.expr}
|
|
195
|
+
lang="javascript"
|
|
196
|
+
class="few-lines-editor"
|
|
197
|
+
{extraLib}
|
|
198
|
+
extraLibPath="file:///node_modules/@types/windmill@{i}/index.d.ts"
|
|
199
|
+
/>
|
|
200
|
+
</div>
|
|
201
|
+
</OverlayPropertyPicker>
|
|
202
|
+
<DynamicInputHelpBox />
|
|
203
|
+
{/if}
|
|
204
|
+
{:else}
|
|
205
|
+
<p>Not recognized arg type {arg.type}</p>
|
|
206
|
+
{/if}
|
|
207
|
+
{:else}
|
|
208
|
+
<p>Arg at {argName} is undefined</p>
|
|
209
|
+
{/if}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Schema } from '../common';
|
|
3
|
+
import type { InputTransform } from '../gen';
|
|
4
|
+
declare const __propDef: {
|
|
5
|
+
props: {
|
|
6
|
+
schema: Schema;
|
|
7
|
+
arg: InputTransform | any;
|
|
8
|
+
argName: string;
|
|
9
|
+
extraLib?: string | undefined;
|
|
10
|
+
inputCheck: {
|
|
11
|
+
[id: string]: boolean;
|
|
12
|
+
};
|
|
13
|
+
i?: number | undefined;
|
|
14
|
+
pickableProperties?: Object | undefined;
|
|
15
|
+
};
|
|
16
|
+
events: {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
};
|
|
19
|
+
slots: {};
|
|
20
|
+
};
|
|
21
|
+
export declare type InputTransformFormProps = typeof __propDef.props;
|
|
22
|
+
export declare type InputTransformFormEvents = typeof __propDef.events;
|
|
23
|
+
export declare type InputTransformFormSlots = typeof __propDef.slots;
|
|
24
|
+
export default class InputTransformForm extends SvelteComponentTyped<InputTransformFormProps, InputTransformFormEvents, InputTransformFormSlots> {
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -14,8 +14,8 @@ let password;
|
|
|
14
14
|
let name;
|
|
15
15
|
let company;
|
|
16
16
|
function handleKeyUp(event) {
|
|
17
|
-
const key = event.key
|
|
18
|
-
if (key ===
|
|
17
|
+
const key = event.key;
|
|
18
|
+
if (key === 'Enter') {
|
|
19
19
|
event.preventDefault();
|
|
20
20
|
addUser();
|
|
21
21
|
}
|
|
@@ -12,8 +12,8 @@ export function openModal() {
|
|
|
12
12
|
let email;
|
|
13
13
|
let is_admin = false;
|
|
14
14
|
function handleKeyUp(event) {
|
|
15
|
-
const key = event.key
|
|
16
|
-
if (key ===
|
|
15
|
+
const key = event.key;
|
|
16
|
+
if (key === 'Enter') {
|
|
17
17
|
event.preventDefault();
|
|
18
18
|
inviteUser();
|
|
19
19
|
}
|
|
@@ -1,38 +1,45 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
import {
|
|
1
|
+
<script>import { displayDate, forLater, msToSec } from '../utils';
|
|
2
|
+
import { faCalendar, faCheck, faCircle, faClock, faHourglassHalf, faTimes } from '@fortawesome/free-solid-svg-icons';
|
|
3
3
|
import Icon from 'svelte-awesome';
|
|
4
|
-
import {
|
|
4
|
+
import { Badge } from 'flowbite-svelte';
|
|
5
5
|
const SMALL_ICON_SCALE = 0.7;
|
|
6
6
|
export let job;
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
{#if job && 'success' in job && job.success}
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
<Badge large color="green">
|
|
11
|
+
<Icon data={faCheck} scale={SMALL_ICON_SCALE} class="mr-2" />
|
|
12
|
+
Succeeded {job.is_skipped ? '(Skipped)' : ''}
|
|
13
|
+
</Badge>
|
|
14
|
+
|
|
15
|
+
<Badge large>
|
|
16
|
+
<Icon data={faHourglassHalf} scale={SMALL_ICON_SCALE} class="mr-2" />
|
|
17
|
+
Job ran in {msToSec(job.duration_ms)} s
|
|
18
|
+
</Badge>
|
|
18
19
|
{:else if job && 'success' in job}
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</
|
|
20
|
+
<Badge large color="red">
|
|
21
|
+
<Icon data={faTimes} scale={SMALL_ICON_SCALE} class="mr-2" />
|
|
22
|
+
Failed
|
|
23
|
+
</Badge>
|
|
24
|
+
<Badge large>
|
|
25
|
+
<Icon data={faHourglassHalf} scale={SMALL_ICON_SCALE} class="mr-2" />
|
|
26
|
+
Job ran in {msToSec(job.duration_ms)}s
|
|
27
|
+
</Badge>
|
|
27
28
|
{:else if job && 'running' in job && job.running}
|
|
28
|
-
<
|
|
29
|
-
|
|
29
|
+
<Badge large color="yellow">
|
|
30
|
+
<Icon data={faCircle} scale={SMALL_ICON_SCALE} class="mr-2" />
|
|
31
|
+
Running
|
|
32
|
+
</Badge>
|
|
30
33
|
{:else if job && 'running' in job && 'scheduled_for' in job && job.scheduled_for && forLater(job.scheduled_for)}
|
|
31
|
-
<
|
|
32
|
-
|
|
34
|
+
<Badge>
|
|
35
|
+
<Icon data={faCalendar} scale={SMALL_ICON_SCALE} class="mr-2" />
|
|
36
|
+
Scheduled for {displayDate(job.scheduled_for)}
|
|
37
|
+
</Badge>
|
|
33
38
|
{:else if job && 'running' in job}
|
|
34
|
-
<
|
|
35
|
-
|
|
39
|
+
<Badge>
|
|
40
|
+
<Icon data={faClock} scale={SMALL_ICON_SCALE} class="mr-2" />
|
|
41
|
+
Queued
|
|
42
|
+
</Badge>
|
|
36
43
|
{:else}
|
|
37
44
|
<Icon class="text-gray-200" data={faCircle} scale={SMALL_ICON_SCALE} />
|
|
38
45
|
{/if}
|