windmill-components 1.695.1 → 1.699.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sharedUtils/assets/tokens/colorTokensConfig.d.ts +2 -0
- package/dist/sharedUtils/base.d.ts +1 -0
- package/dist/sharedUtils/cloud.d.ts +1 -0
- package/dist/sharedUtils/common.d.ts +111 -0
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/count.d.ts +5 -0
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/delete.d.ts +5 -0
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/insert.d.ts +5 -0
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/select.d.ts +13 -0
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/update.d.ts +11 -0
- package/dist/sharedUtils/components/apps/components/display/dbtable/utils.d.ts +95 -0
- package/dist/sharedUtils/components/apps/editor/appPolicy.d.ts +6 -0
- package/dist/sharedUtils/components/apps/editor/appUtilsCore.d.ts +7 -0
- package/dist/sharedUtils/components/apps/editor/appUtilsS3.d.ts +33 -0
- package/dist/sharedUtils/components/apps/editor/commonAppUtils.d.ts +10 -0
- package/dist/sharedUtils/components/apps/editor/component/components.d.ts +5371 -0
- package/dist/sharedUtils/components/apps/editor/component/default-codes.d.ts +3 -0
- package/dist/sharedUtils/components/apps/editor/component/index.d.ts +3 -0
- package/dist/sharedUtils/components/apps/editor/component/sets.d.ts +7 -0
- package/dist/sharedUtils/components/apps/editor/componentsPanel/componentDefaultProps.d.ts +3 -0
- package/dist/sharedUtils/components/apps/gridUtils.d.ts +14 -0
- package/dist/sharedUtils/components/apps/inputType.d.ts +178 -0
- package/dist/sharedUtils/components/apps/rx.d.ts +29 -0
- package/dist/sharedUtils/components/apps/sharedTypes.d.ts +21 -0
- package/dist/sharedUtils/components/apps/types.d.ts +274 -0
- package/dist/sharedUtils/components/assets/lib.d.ts +25 -0
- package/dist/sharedUtils/components/common/alert/model.d.ts +2 -0
- package/dist/sharedUtils/components/common/badge/model.d.ts +8 -0
- package/dist/sharedUtils/components/common/button/model.d.ts +45 -0
- package/dist/sharedUtils/components/common/fileInput/model.d.ts +1 -0
- package/dist/sharedUtils/components/common/index.d.ts +24 -0
- package/dist/sharedUtils/components/common/skeleton/model.d.ts +21 -0
- package/dist/sharedUtils/components/dbTypes.d.ts +14 -0
- package/dist/sharedUtils/components/diff_drawer.d.ts +26 -0
- package/dist/sharedUtils/components/ducklake.d.ts +1 -0
- package/dist/sharedUtils/components/flows/scheduleUtils.d.ts +7 -0
- package/dist/sharedUtils/components/icons/index.d.ts +101 -0
- package/dist/sharedUtils/components/random_positive_adjetive.d.ts +1 -0
- package/dist/sharedUtils/components/raw_apps/rawAppPolicy.d.ts +10 -0
- package/dist/sharedUtils/components/raw_apps/utils.d.ts +15 -0
- package/dist/sharedUtils/components/triggers/email/utils.d.ts +4 -0
- package/dist/sharedUtils/components/triggers/gcp/utils.d.ts +2 -0
- package/dist/sharedUtils/components/triggers/http/utils.d.ts +11 -0
- package/dist/sharedUtils/components/triggers/kafka/utils.d.ts +2 -0
- package/dist/sharedUtils/components/triggers/mqtt/utils.d.ts +2 -0
- package/dist/sharedUtils/components/triggers/nats/utils.d.ts +2 -0
- package/dist/sharedUtils/components/triggers/postgres/utils.d.ts +8 -0
- package/dist/sharedUtils/components/triggers/sqs/utils.d.ts +2 -0
- package/dist/sharedUtils/components/triggers/triggers.svelte.d.ts +32 -0
- package/dist/sharedUtils/components/triggers/utils.d.ts +80 -0
- package/dist/sharedUtils/components/triggers/websocket/utils.d.ts +2 -0
- package/dist/sharedUtils/components/triggers.d.ts +20 -0
- package/dist/sharedUtils/gen/core/ApiError.d.ts +10 -0
- package/dist/sharedUtils/gen/core/ApiRequestOptions.d.ts +13 -0
- package/dist/sharedUtils/gen/core/ApiResult.d.ts +7 -0
- package/dist/sharedUtils/gen/core/CancelablePromise.d.ts +26 -0
- package/dist/sharedUtils/gen/core/OpenAPI.d.ts +27 -0
- package/dist/sharedUtils/gen/core/request.d.ts +29 -0
- package/dist/sharedUtils/gen/index.d.ts +6 -0
- package/dist/sharedUtils/gen/schemas.gen.d.ts +7036 -0
- package/dist/sharedUtils/gen/services.gen.d.ts +6047 -0
- package/dist/sharedUtils/gen/types.gen.d.ts +21881 -0
- package/dist/sharedUtils/history.svelte.d.ts +9 -0
- package/dist/sharedUtils/hub.d.ts +49 -0
- package/dist/sharedUtils/jsr.json +6 -0
- package/dist/sharedUtils/lib.d.ts +5 -0
- package/dist/sharedUtils/lib.es.js +1588 -0
- package/dist/sharedUtils/package.json +12 -0
- package/dist/sharedUtils/schema.d.ts +3 -0
- package/dist/sharedUtils/stores.d.ts +97 -0
- package/dist/sharedUtils/svelte5Utils.svelte.d.ts +80 -0
- package/dist/sharedUtils/toast.d.ts +8 -0
- package/dist/sharedUtils/utils.d.ts +265 -0
- package/package/components/AppConnectInner.svelte +38 -5
- package/package/components/CompareWorkspaces.svelte +142 -486
- package/package/components/DisplayResult.svelte +39 -19
- package/package/components/Editor.svelte +5 -4
- package/package/components/Editor.svelte.d.ts +1 -0
- package/package/components/FilterSearchbar.svelte +3 -1
- package/package/components/FilterSearchbar.svelte.d.ts +1 -0
- package/package/components/FlowStatusViewerInner.svelte +23 -9
- package/package/components/ForkWorkspaceBanner.svelte +16 -0
- package/package/components/HistoricInputs.svelte +2 -1
- package/package/components/InstanceSetting.svelte +47 -5
- package/package/components/LogViewer.svelte +101 -71
- package/package/components/OnBehalfOfSelector.svelte +10 -7
- package/package/components/ParqetCsvTableRenderer.svelte +9 -4
- package/package/components/Path.svelte +10 -0
- package/package/components/ResourceEditor.svelte +198 -311
- package/package/components/ResourceEditor.svelte.d.ts +3 -3
- package/package/components/ResourceEditorDrawer.svelte +17 -6
- package/package/components/ResourceForm.svelte +235 -0
- package/package/components/ResourceForm.svelte.d.ts +25 -0
- package/package/components/RunsPage.svelte +1 -0
- package/package/components/S3FilePickerInner.svelte +22 -8
- package/package/components/ScriptBuilder.svelte +1 -0
- package/package/components/ScriptEditor.svelte +44 -7
- package/package/components/ScriptEditor.svelte.d.ts +1 -0
- package/package/components/ShareModal.svelte.d.ts +1 -1
- package/package/components/TaggedTextInput.svelte +4 -1
- package/package/components/TaggedTextInput.svelte.d.ts +2 -0
- package/package/components/VariableEditor.svelte +177 -199
- package/package/components/VariableEditor.svelte.d.ts +1 -2
- package/package/components/VariableForm.svelte +133 -0
- package/package/components/VariableForm.svelte.d.ts +22 -0
- package/package/components/WsSpecificVersions.svelte +39 -0
- package/package/components/WsSpecificVersions.svelte.d.ts +9 -0
- package/package/components/apps/editor/AppEditorHeaderDeploy.svelte.d.ts +1 -1
- package/package/components/common/fileDownload/FileDownload.svelte +16 -6
- package/package/components/common/table/AppRow.svelte +2 -1
- package/package/components/common/table/AppRow.svelte.d.ts +1 -0
- package/package/components/common/table/FlowRow.svelte +2 -1
- package/package/components/common/table/FlowRow.svelte.d.ts +1 -0
- package/package/components/common/table/RawAppRow.svelte +2 -1
- package/package/components/common/table/RawAppRow.svelte.d.ts +1 -0
- package/package/components/common/table/Row.svelte +11 -3
- package/package/components/common/table/Row.svelte.d.ts +2 -1
- package/package/components/common/table/RowIcon.svelte +18 -2
- package/package/components/common/table/RowIcon.svelte.d.ts +1 -1
- package/package/components/common/table/ScriptRow.svelte +2 -1
- package/package/components/common/table/ScriptRow.svelte.d.ts +1 -0
- package/package/components/copilot/autocomplete/Autocompletor.d.ts +3 -1
- package/package/components/copilot/autocomplete/Autocompletor.js +5 -2
- package/package/components/copilot/autocomplete/request.d.ts +1 -0
- package/package/components/copilot/autocomplete/request.js +1 -1
- package/package/components/copilot/chat/AIChatManager.svelte.js +14 -4
- package/package/components/copilot/chat/AiChatLayout.svelte +2 -0
- package/package/components/copilot/chat/ContextManager.svelte.d.ts +1 -0
- package/package/components/copilot/chat/CreatedResourceActionDrawers.svelte +129 -0
- package/package/components/copilot/chat/CreatedResourceActionDrawers.svelte.d.ts +4 -0
- package/package/components/copilot/chat/ToolExecutionDisplay.svelte +14 -6
- package/package/components/copilot/chat/ToolMessageActions.svelte +73 -0
- package/package/components/copilot/chat/ToolMessageActions.svelte.d.ts +7 -0
- package/package/components/copilot/chat/createdResourceActions.svelte.d.ts +6 -0
- package/package/components/copilot/chat/createdResourceActions.svelte.js +29 -0
- package/package/components/copilot/chat/script/core.d.ts +6 -2
- package/package/components/copilot/chat/script/core.js +13 -7
- package/package/components/copilot/chat/script/wacPrompt.test.d.ts +1 -0
- package/package/components/copilot/chat/script/wacPrompt.test.js +25 -0
- package/package/components/copilot/chat/shared.d.ts +12 -0
- package/package/components/copilot/chat/shared.test.js +23 -2
- package/package/components/copilot/chat/workspaceTools.js +34 -4
- package/package/components/flows/content/ScriptEditorDrawer.svelte +1 -0
- package/package/components/flows/idUtils.js +4 -1
- package/package/components/flows/stepsInputArgs.svelte.js +6 -1
- package/package/components/graph/wacToFlow.js +1 -1
- package/package/components/graph/wacToFlow.test.d.ts +1 -0
- package/package/components/graph/wacToFlow.test.js +17 -0
- package/package/components/home/Item.svelte +5 -1
- package/package/components/home/Item.svelte.d.ts +1 -0
- package/package/components/home/ItemsList.svelte +260 -3
- package/package/components/instanceSettings/SecretBackendConfig.svelte +492 -98
- package/package/components/propertyPicker/ObjectViewer.svelte +10 -4
- package/package/components/runs/runsFilter.d.ts +1 -1
- package/package/components/runs/useJobsLoader.svelte.d.ts +1 -0
- package/package/components/runs/useJobsLoader.svelte.js +8 -12
- package/package/components/scriptEditor/LogPanel.svelte +4 -1
- package/package/components/scriptEditor/LogPanel.svelte.d.ts +1 -0
- package/package/components/settings/WorkspaceOperatorSettings.svelte +1 -1
- package/package/components/sidebar/SidebarContent.svelte +40 -2
- package/package/components/sidebar/WorkspaceMenu.svelte +19 -5
- package/package/externalDomain.d.ts +2 -0
- package/package/externalDomain.js +16 -0
- package/package/gen/core/OpenAPI.js +1 -1
- package/package/gen/schemas.gen.d.ts +33 -4
- package/package/gen/schemas.gen.js +33 -4
- package/package/gen/services.gen.d.ts +20 -1
- package/package/gen/services.gen.js +40 -0
- package/package/gen/types.gen.d.ts +70 -3
- package/package/hubPaths.json +2 -2
- package/package/system_prompts/index.d.ts +1 -1
- package/package/system_prompts/index.js +22 -3
- package/package/system_prompts/prompts.d.ts +2 -2
- package/package/system_prompts/prompts.js +7 -4
- package/package/utils/downloadFile.d.ts +11 -0
- package/package/utils/downloadFile.js +48 -0
- package/package/utils_deployable.d.ts +162 -638
- package/package/utils_deployable.js +75 -143
- package/package/utils_workspace_deploy.d.ts +10 -4
- package/package/utils_workspace_deploy.js +167 -42
- package/package.json +7 -3
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
<script lang="ts">import { emptyString, isOwner, urlize } from '../utils';
|
|
2
|
+
import { Alert, Skeleton } from './common';
|
|
3
|
+
import Path from './Path.svelte';
|
|
4
|
+
import LabelsInput from './LabelsInput.svelte';
|
|
5
|
+
import Required from './Required.svelte';
|
|
6
|
+
import { userStore, workspaceStore } from '../stores';
|
|
7
|
+
import SchemaForm from './SchemaForm.svelte';
|
|
8
|
+
import SimpleEditor from './SimpleEditor.svelte';
|
|
9
|
+
import FilesetEditor from './FilesetEditor.svelte';
|
|
10
|
+
import Toggle from './Toggle.svelte';
|
|
11
|
+
import TestConnection from './TestConnection.svelte';
|
|
12
|
+
import { Pen } from 'lucide-svelte';
|
|
13
|
+
import Markdown from 'svelte-exmarkdown';
|
|
14
|
+
import autosize from '../autosize';
|
|
15
|
+
import GfmMarkdown from './GfmMarkdown.svelte';
|
|
16
|
+
import TestTriggerConnection from './triggers/TestTriggerConnection.svelte';
|
|
17
|
+
import GitHubAppIntegration from './GitHubAppIntegration.svelte';
|
|
18
|
+
import Button from './common/button/Button.svelte';
|
|
19
|
+
import ResourceGen from './copilot/ResourceGen.svelte';
|
|
20
|
+
import SyncResourceTypes from './SyncResourceTypes.svelte';
|
|
21
|
+
import Label from './Label.svelte';
|
|
22
|
+
let { path = $bindable(), initialPath, hidePath = false, labels = $bindable(), description = $bindable(), args = $bindable(), wsSpecific = $bindable(), isValid = $bindable(), viewJsonSchema = $bindable(), jsonError = $bindable(), deployTo, can_write, resource_type, resourceTypeInfo, resourceSchema, loadingSchema, resourceToEdit, onLoadResourceType } = $props();
|
|
23
|
+
let editDescription = $state(false);
|
|
24
|
+
let rawCode = $state(undefined);
|
|
25
|
+
let textFileContent = $state('');
|
|
26
|
+
function parseJson() {
|
|
27
|
+
try {
|
|
28
|
+
args = JSON.parse(rawCode ?? '');
|
|
29
|
+
jsonError = '';
|
|
30
|
+
}
|
|
31
|
+
catch (e) {
|
|
32
|
+
jsonError = e.message;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function parseTextFileContent() {
|
|
36
|
+
args = { content: textFileContent };
|
|
37
|
+
}
|
|
38
|
+
$effect(() => {
|
|
39
|
+
if (rawCode !== undefined)
|
|
40
|
+
parseJson();
|
|
41
|
+
});
|
|
42
|
+
$effect(() => {
|
|
43
|
+
if (viewJsonSchema && rawCode === undefined) {
|
|
44
|
+
rawCode = JSON.stringify(args, null, 2);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
$effect(() => {
|
|
48
|
+
if (textFileContent)
|
|
49
|
+
parseTextFileContent();
|
|
50
|
+
});
|
|
51
|
+
$effect(() => {
|
|
52
|
+
if (resourceTypeInfo?.format_extension && !resourceTypeInfo?.is_fileset && !viewJsonSchema) {
|
|
53
|
+
textFileContent = args?.content ?? '';
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
{#if !hidePath}
|
|
59
|
+
<div>
|
|
60
|
+
{#if !can_write}
|
|
61
|
+
<div class="my-2">
|
|
62
|
+
<Alert type="warning" title="Only read access">
|
|
63
|
+
You only have read access to this resource and cannot edit it
|
|
64
|
+
</Alert>
|
|
65
|
+
</div>
|
|
66
|
+
{/if}
|
|
67
|
+
<Label label="Path">
|
|
68
|
+
<Path
|
|
69
|
+
disabled={initialPath != '' && !isOwner(initialPath, $userStore, $workspaceStore)}
|
|
70
|
+
bind:path
|
|
71
|
+
{initialPath}
|
|
72
|
+
namePlaceholder="resource"
|
|
73
|
+
kind="resource"
|
|
74
|
+
/>
|
|
75
|
+
</Label>
|
|
76
|
+
</div>
|
|
77
|
+
{/if}
|
|
78
|
+
<LabelsInput bind:labels class="-mt-4" />
|
|
79
|
+
|
|
80
|
+
{#if deployTo}
|
|
81
|
+
<Label
|
|
82
|
+
label="Workspace specific"
|
|
83
|
+
tooltip="Prevents this resource from being deployed to prod/staging. When enabled, any variable referenced via $var: inside the resource value is also automatically marked workspace-specific. Disabling this toggle does not un-mark those variables — they may be referenced by other resources."
|
|
84
|
+
>
|
|
85
|
+
<Toggle bind:checked={wsSpecific} />
|
|
86
|
+
</Label>
|
|
87
|
+
{/if}
|
|
88
|
+
|
|
89
|
+
{#if !emptyString(resourceTypeInfo?.description)}
|
|
90
|
+
<div class="flex flex-col gap-1">
|
|
91
|
+
<h4 class="text-xs text-emphasis font-semibold">{resourceTypeInfo?.name} description</h4>
|
|
92
|
+
<div class="text-xs text-primary font-normal">
|
|
93
|
+
<Markdown md={urlize(resourceTypeInfo?.description ?? '', 'md')} />
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
{/if}
|
|
97
|
+
|
|
98
|
+
<div class="flex flex-col gap-1">
|
|
99
|
+
<h4 class="inline-flex items-center gap-2 text-xs text-emphasis font-semibold"
|
|
100
|
+
>Resource description <Required required={false} />
|
|
101
|
+
{#if can_write}
|
|
102
|
+
<Button
|
|
103
|
+
variant="subtle"
|
|
104
|
+
unifiedSize="xs"
|
|
105
|
+
btnClasses={editDescription ? 'bg-surface-hover' : ''}
|
|
106
|
+
startIcon={{ icon: Pen }}
|
|
107
|
+
on:click={() => (editDescription = !editDescription)}
|
|
108
|
+
/>
|
|
109
|
+
{/if}
|
|
110
|
+
</h4>
|
|
111
|
+
{#if can_write && editDescription}
|
|
112
|
+
<div class="relative">
|
|
113
|
+
<div class="text-2xs text-primary absolute -top-4 right-0">GH Markdown</div>
|
|
114
|
+
<textarea
|
|
115
|
+
class="text-xs text-primary font-normal"
|
|
116
|
+
disabled={!can_write}
|
|
117
|
+
use:autosize
|
|
118
|
+
bind:value={description}
|
|
119
|
+
placeholder="Describe what this resource is for"
|
|
120
|
+
></textarea>
|
|
121
|
+
</div>
|
|
122
|
+
{:else if description == undefined || description == ''}
|
|
123
|
+
<div class="text-xs text-secondary font-normal">No description provided</div>
|
|
124
|
+
{:else}
|
|
125
|
+
<div class="text-xs text-primary font-normal">
|
|
126
|
+
<GfmMarkdown md={description} noPadding />
|
|
127
|
+
</div>
|
|
128
|
+
{/if}
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
<div class="flex flex-col gap-1">
|
|
132
|
+
<div class="w-full flex gap-4 flex-row-reverse items-center">
|
|
133
|
+
<Toggle
|
|
134
|
+
bind:checked={viewJsonSchema}
|
|
135
|
+
on:change={(e) => {
|
|
136
|
+
if (e.detail) {
|
|
137
|
+
rawCode = JSON.stringify(args, null, 2)
|
|
138
|
+
} else if (resourceTypeInfo?.format_extension && !resourceTypeInfo?.is_fileset) {
|
|
139
|
+
textFileContent = args?.content ?? ''
|
|
140
|
+
}
|
|
141
|
+
}}
|
|
142
|
+
options={{
|
|
143
|
+
right: 'As JSON'
|
|
144
|
+
}}
|
|
145
|
+
/>
|
|
146
|
+
<ResourceGen
|
|
147
|
+
bind:args
|
|
148
|
+
resourceType={resource_type}
|
|
149
|
+
resourceName={path}
|
|
150
|
+
resourceDescription={description}
|
|
151
|
+
{resourceSchema}
|
|
152
|
+
/>
|
|
153
|
+
{#if resourceToEdit?.resource_type === 'nats' || resourceToEdit?.resource_type === 'kafka'}
|
|
154
|
+
<TestTriggerConnection kind={resourceToEdit?.resource_type} args={{ connection: args }} />
|
|
155
|
+
{:else}
|
|
156
|
+
<TestConnection resourceType={resourceToEdit?.resource_type} {args} />
|
|
157
|
+
{/if}
|
|
158
|
+
{#if resource_type === 'git_repository' && $workspaceStore && ($userStore?.is_admin || $userStore?.is_super_admin)}
|
|
159
|
+
<GitHubAppIntegration
|
|
160
|
+
resourceType={resource_type}
|
|
161
|
+
{args}
|
|
162
|
+
{description}
|
|
163
|
+
onArgsUpdate={(newArgs) => {
|
|
164
|
+
args = newArgs
|
|
165
|
+
if (viewJsonSchema) {
|
|
166
|
+
rawCode = JSON.stringify(args, null, 2)
|
|
167
|
+
}
|
|
168
|
+
}}
|
|
169
|
+
onDescriptionUpdate={(newDescription) => (description = newDescription)}
|
|
170
|
+
/>
|
|
171
|
+
{/if}
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
<div>
|
|
175
|
+
{#if loadingSchema}
|
|
176
|
+
<Skeleton layout={[[4]]} />
|
|
177
|
+
{:else if !viewJsonSchema && resourceTypeInfo?.is_fileset}
|
|
178
|
+
<div class="mt-1 flex items-center gap-2">
|
|
179
|
+
<h5 class="inline-flex items-center gap-4">Fileset</h5>
|
|
180
|
+
<ResourceGen
|
|
181
|
+
bind:args
|
|
182
|
+
resourceType={resource_type}
|
|
183
|
+
resourceName={path}
|
|
184
|
+
resourceDescription={description}
|
|
185
|
+
{resourceSchema}
|
|
186
|
+
isFileset
|
|
187
|
+
/>
|
|
188
|
+
</div>
|
|
189
|
+
<FilesetEditor bind:args />
|
|
190
|
+
{:else if !viewJsonSchema && resourceSchema && resourceSchema?.properties}
|
|
191
|
+
{#if resourceTypeInfo?.format_extension}
|
|
192
|
+
<h5 class="mt-1 inline-flex items-center gap-4">
|
|
193
|
+
File content ({resourceTypeInfo.format_extension})
|
|
194
|
+
</h5>
|
|
195
|
+
<div class="">
|
|
196
|
+
<SimpleEditor
|
|
197
|
+
autoHeight
|
|
198
|
+
lang={resourceTypeInfo.format_extension}
|
|
199
|
+
bind:code={textFileContent}
|
|
200
|
+
fixedOverflowWidgets={false}
|
|
201
|
+
/>
|
|
202
|
+
</div>
|
|
203
|
+
{:else}
|
|
204
|
+
<SchemaForm
|
|
205
|
+
onlyMaskPassword
|
|
206
|
+
noDelete
|
|
207
|
+
disabled={!can_write}
|
|
208
|
+
compact
|
|
209
|
+
schema={resourceSchema}
|
|
210
|
+
bind:args
|
|
211
|
+
bind:isValid
|
|
212
|
+
/>
|
|
213
|
+
{/if}
|
|
214
|
+
{:else if !can_write}
|
|
215
|
+
<input type="text" disabled value={rawCode} />
|
|
216
|
+
{:else}
|
|
217
|
+
{#if !viewJsonSchema}
|
|
218
|
+
<div class="flex flex-col gap-2 mb-4">
|
|
219
|
+
<p class="text-red-500 dark:text-red-400 text-xs">
|
|
220
|
+
Resource type '{resource_type}' not found in your workspace
|
|
221
|
+
</p>
|
|
222
|
+
<SyncResourceTypes onSynced={() => onLoadResourceType?.()} />
|
|
223
|
+
<p class="italic text-secondary text-xs"> Define the value in JSON directly </p>
|
|
224
|
+
</div>
|
|
225
|
+
{/if}
|
|
226
|
+
|
|
227
|
+
{#if !emptyString(jsonError)}<span class="text-red-400 text-xs mb-1 flex flex-row-reverse"
|
|
228
|
+
>{jsonError}</span
|
|
229
|
+
>{:else}<div class="py-2"></div>{/if}
|
|
230
|
+
<div class="bg-surface-tertiary rounded-md border py-2.5">
|
|
231
|
+
<SimpleEditor autoHeight lang="json" bind:code={rawCode} />
|
|
232
|
+
</div>
|
|
233
|
+
{/if}
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Schema } from '../common';
|
|
2
|
+
import type { Resource, ResourceType } from '../gen';
|
|
3
|
+
interface Props {
|
|
4
|
+
path: string;
|
|
5
|
+
initialPath: string;
|
|
6
|
+
hidePath?: boolean;
|
|
7
|
+
labels: string[] | undefined;
|
|
8
|
+
description: string;
|
|
9
|
+
args: Record<string, any>;
|
|
10
|
+
wsSpecific: boolean;
|
|
11
|
+
isValid: boolean;
|
|
12
|
+
viewJsonSchema: boolean;
|
|
13
|
+
jsonError: string;
|
|
14
|
+
deployTo: string | undefined;
|
|
15
|
+
can_write: boolean;
|
|
16
|
+
resource_type: string | undefined;
|
|
17
|
+
resourceTypeInfo: ResourceType | undefined;
|
|
18
|
+
resourceSchema: Schema | undefined;
|
|
19
|
+
loadingSchema: boolean;
|
|
20
|
+
resourceToEdit: Resource | undefined;
|
|
21
|
+
onLoadResourceType?: () => void;
|
|
22
|
+
}
|
|
23
|
+
declare const ResourceForm: import("svelte").Component<Props, {}, "path" | "description" | "args" | "labels" | "wsSpecific" | "isValid" | "viewJsonSchema" | "jsonError">;
|
|
24
|
+
type ResourceForm = ReturnType<typeof ResourceForm>;
|
|
25
|
+
export default ResourceForm;
|
|
@@ -5,6 +5,7 @@ import { workspaceStore } from '../stores';
|
|
|
5
5
|
import { CancelablePromise, HelpersService } from '../gen';
|
|
6
6
|
import { base } from '../base';
|
|
7
7
|
import { displayDate, displaySize, emptyString, parseS3Object, sendUserToast } from '../utils';
|
|
8
|
+
import { downloadViaClient, shouldDownloadViaClient } from '../utils/downloadFile';
|
|
8
9
|
import { Alert, Button } from './common';
|
|
9
10
|
import Section from './Section.svelte';
|
|
10
11
|
import { createEventDispatcher, untrack } from 'svelte';
|
|
@@ -577,14 +578,27 @@ $effect.pre(() => {
|
|
|
577
578
|
{#if filePreview !== undefined && (!hideS3SpecificDetails || !readOnlyMode || allowDelete)}
|
|
578
579
|
<div class="flex gap-2 shrink-0">
|
|
579
580
|
{#if !hideS3SpecificDetails}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
581
|
+
{@const downloadApiPath = `/w/${$workspaceStore}/job_helpers/download_s3_file?file_key=${encodeURIComponent(fileMetadata?.fileKey ?? '')}${storage ? `&storage=${storage}` : ''}`}
|
|
582
|
+
{@const downloadName =
|
|
583
|
+
fileMetadata?.fileKey.split('/').pop() ?? 'unnamed_download.file'}
|
|
584
|
+
{#if shouldDownloadViaClient()}
|
|
585
|
+
<Button
|
|
586
|
+
title="Download file from S3"
|
|
587
|
+
variant="default"
|
|
588
|
+
on:click={() => downloadViaClient(downloadApiPath, downloadName)}
|
|
589
|
+
startIcon={{ icon: Download }}
|
|
590
|
+
iconOnly={true}
|
|
591
|
+
/>
|
|
592
|
+
{:else}
|
|
593
|
+
<Button
|
|
594
|
+
title="Download file from S3"
|
|
595
|
+
variant="default"
|
|
596
|
+
href={`${base}/api${downloadApiPath}`}
|
|
597
|
+
download={downloadName}
|
|
598
|
+
startIcon={{ icon: Download }}
|
|
599
|
+
iconOnly={true}
|
|
600
|
+
/>
|
|
601
|
+
{/if}
|
|
588
602
|
{/if}
|
|
589
603
|
{#if !readOnlyMode}
|
|
590
604
|
<Button
|
|
@@ -57,7 +57,7 @@ import { resource, watch } from 'runed';
|
|
|
57
57
|
import { createScriptRecording } from './recording/scriptRecording.svelte';
|
|
58
58
|
import { setActiveRecording } from './recording/flowRecording.svelte';
|
|
59
59
|
import DropdownV2 from './DropdownV2.svelte';
|
|
60
|
-
let { schema = $bindable(), code = $bindable(), path, lang, kind = undefined, template = 'script', tag, fixedOverflowWidgets = true, noSyncFromGithub = false, editor = $bindable(undefined), diffEditor = $bindable(undefined), collabMode = false, edit = true, noHistory = false, saveToWorkspace = false, watchChanges = false, customUi = undefined, args = $bindable(), selectedTab = $bindable('main'), hasPreprocessor = $bindable(false), captureTable = $bindable(undefined), showCaptures = true, stablePathForCaptures = '', lastSavedCode = undefined, lastDeployedCode = undefined, disableAi = false, assets = $bindable(), modules = $bindable(undefined), editorBarRight, enablePreprocessorSnippet = false } = $props();
|
|
60
|
+
let { schema = $bindable(), code = $bindable(), path, lang, kind = undefined, autoKind = undefined, template = 'script', tag, fixedOverflowWidgets = true, noSyncFromGithub = false, editor = $bindable(undefined), diffEditor = $bindable(undefined), collabMode = false, edit = true, noHistory = false, saveToWorkspace = false, watchChanges = false, customUi = undefined, args = $bindable(), selectedTab = $bindable('main'), hasPreprocessor = $bindable(false), captureTable = $bindable(undefined), showCaptures = true, stablePathForCaptures = '', lastSavedCode = undefined, lastDeployedCode = undefined, disableAi = false, assets = $bindable(), modules = $bindable(undefined), editorBarRight, enablePreprocessorSnippet = false } = $props();
|
|
61
61
|
let initialArgs = structuredClone($state.snapshot(args));
|
|
62
62
|
let jsonView = $state(false);
|
|
63
63
|
let schemaHeight = $state(0);
|
|
@@ -408,6 +408,8 @@ let logPanel = $state(undefined);
|
|
|
408
408
|
let testIsLoading = $state(false);
|
|
409
409
|
let testJob = $state();
|
|
410
410
|
let pastPreviews = $state([]);
|
|
411
|
+
let historyTabActive = false;
|
|
412
|
+
let pastPreviewsRequest;
|
|
411
413
|
let validCode = $state(true);
|
|
412
414
|
// Recording
|
|
413
415
|
let scriptRecording = createScriptRecording();
|
|
@@ -511,7 +513,9 @@ export async function runTest() {
|
|
|
511
513
|
lastRecording = scriptRecording.stop();
|
|
512
514
|
setActiveRecording(undefined);
|
|
513
515
|
}
|
|
514
|
-
|
|
516
|
+
if (historyTabActive) {
|
|
517
|
+
loadPastTests();
|
|
518
|
+
}
|
|
515
519
|
},
|
|
516
520
|
doneError({ error }) {
|
|
517
521
|
if (scriptRecording.active) {
|
|
@@ -536,12 +540,31 @@ function downloadRecording() {
|
|
|
536
540
|
}
|
|
537
541
|
}
|
|
538
542
|
async function loadPastTests() {
|
|
539
|
-
|
|
543
|
+
pastPreviewsRequest?.cancel();
|
|
544
|
+
const req = JobService.listCompletedJobs({
|
|
540
545
|
workspace: $workspaceStore,
|
|
541
546
|
jobKinds: 'preview',
|
|
542
547
|
createdBy: $userStore?.username,
|
|
543
|
-
scriptPathExact: path
|
|
548
|
+
scriptPathExact: path,
|
|
549
|
+
hasNullParent: true
|
|
544
550
|
});
|
|
551
|
+
pastPreviewsRequest = req;
|
|
552
|
+
try {
|
|
553
|
+
const result = await req;
|
|
554
|
+
if (pastPreviewsRequest === req) {
|
|
555
|
+
pastPreviews = result;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
catch (err) {
|
|
559
|
+
if (!(err instanceof Error) || err.name !== 'CancelError') {
|
|
560
|
+
throw err;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
finally {
|
|
564
|
+
if (pastPreviewsRequest === req) {
|
|
565
|
+
pastPreviewsRequest = undefined;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
545
568
|
}
|
|
546
569
|
export async function inferSchema(code, { nlang, resetArgs = false, applyInitialArgs = false } = {}) {
|
|
547
570
|
let nschema = schema ?? emptySchema();
|
|
@@ -897,7 +920,6 @@ onMount(async () => {
|
|
|
897
920
|
if (!validCode && code && lang) {
|
|
898
921
|
await inferSchema(code, { applyInitialArgs: true });
|
|
899
922
|
}
|
|
900
|
-
loadPastTests();
|
|
901
923
|
aiChatManager.saveAndClear();
|
|
902
924
|
aiChatManager.changeMode(AIMode.SCRIPT);
|
|
903
925
|
});
|
|
@@ -964,6 +986,8 @@ export function disableCollaboration() {
|
|
|
964
986
|
wsProvider = undefined;
|
|
965
987
|
}
|
|
966
988
|
onDestroy(() => {
|
|
989
|
+
pastPreviewsRequest?.cancel();
|
|
990
|
+
pastPreviewsRequest = undefined;
|
|
967
991
|
disableCollaboration();
|
|
968
992
|
aiChatManager.scriptEditorApplyCode = undefined;
|
|
969
993
|
aiChatManager.scriptEditorShowDiffMode = undefined;
|
|
@@ -986,7 +1010,12 @@ function collabUrl() {
|
|
|
986
1010
|
return (`${url}?collab=1&workspace=${encodeURIComponent($workspaceStore ?? '')}&lang=${encodeURIComponent(lang ?? '')}` +
|
|
987
1011
|
(edit ? '' : `&path=${path}`));
|
|
988
1012
|
}
|
|
989
|
-
|
|
1013
|
+
const WAC_CONTEXT_LANGUAGES = ['python3', 'bun'];
|
|
1014
|
+
let isWac = $derived(template === 'wac_python' ||
|
|
1015
|
+
template === 'wac_typescript' ||
|
|
1016
|
+
autoKind === 'wac' ||
|
|
1017
|
+
(code && lang ? isWorkflowAsCode(code, lang) : false));
|
|
1018
|
+
let workflowAsCodeAiContext = $derived(activeModuleTab === null && isWac && WAC_CONTEXT_LANGUAGES.includes(lang ?? ''));
|
|
990
1019
|
let showTabs = $derived(hasPreprocessor || isWac);
|
|
991
1020
|
$effect(() => {
|
|
992
1021
|
!hasPreprocessor && (selectedTab = 'main');
|
|
@@ -1049,7 +1078,8 @@ $effect(() => {
|
|
|
1049
1078
|
path,
|
|
1050
1079
|
lastSavedCode,
|
|
1051
1080
|
lastDeployedCode,
|
|
1052
|
-
diffMode
|
|
1081
|
+
diffMode,
|
|
1082
|
+
workflowAsCode: workflowAsCodeAiContext
|
|
1053
1083
|
};
|
|
1054
1084
|
untrack(() => {
|
|
1055
1085
|
aiChatManager.scriptEditorOptions = options;
|
|
@@ -1407,6 +1437,12 @@ $effect(() => {
|
|
|
1407
1437
|
} as any)
|
|
1408
1438
|
: testJob}
|
|
1409
1439
|
{pastPreviews}
|
|
1440
|
+
onTabChange={(tab) => {
|
|
1441
|
+
historyTabActive = tab === 'history'
|
|
1442
|
+
if (historyTabActive) {
|
|
1443
|
+
loadPastTests()
|
|
1444
|
+
}
|
|
1445
|
+
}}
|
|
1410
1446
|
previewIsLoading={debugMode
|
|
1411
1447
|
? $debugState.running && !$debugState.stopped
|
|
1412
1448
|
: testIsLoading}
|
|
@@ -1818,6 +1854,7 @@ $effect(() => {
|
|
|
1818
1854
|
automaticLayout={true}
|
|
1819
1855
|
{fixedOverflowWidgets}
|
|
1820
1856
|
{args}
|
|
1857
|
+
workflowAsCode={workflowAsCodeAiContext}
|
|
1821
1858
|
{enablePreprocessorSnippet}
|
|
1822
1859
|
preparedAssetsSqlQueries={preparedSqlQueries.current}
|
|
1823
1860
|
customTag={tag}
|
|
@@ -11,6 +11,7 @@ interface Props {
|
|
|
11
11
|
path: string | undefined;
|
|
12
12
|
lang: Preview['language'];
|
|
13
13
|
kind?: string | undefined;
|
|
14
|
+
autoKind?: string | undefined;
|
|
14
15
|
template?: 'pgsql' | 'mysql' | 'script' | 'docker' | 'powershell' | 'bunnative' | 'claudesandbox' | 'wac_python' | 'wac_typescript' | 'ci_test_bun' | 'ci_test_python';
|
|
15
16
|
tag: string | undefined;
|
|
16
17
|
initialArgs?: Record<string, any>;
|
|
@@ -16,7 +16,7 @@ declare const ShareModal: $$__sveltets_2_IsomorphicComponent<Record<string, neve
|
|
|
16
16
|
} & {
|
|
17
17
|
[evt: string]: CustomEvent<any>;
|
|
18
18
|
}, {}, {
|
|
19
|
-
openDrawer: (newPath: string, kind_l: "resource" | "volume" | "script" | "flow" | "app" | "variable" | "schedule" | "raw_app" | "
|
|
19
|
+
openDrawer: (newPath: string, kind_l: "resource" | "volume" | "script" | "flow" | "app" | "variable" | "schedule" | "raw_app" | "http_trigger" | "websocket_trigger" | "kafka_trigger" | "nats_trigger" | "postgres_trigger" | "mqtt_trigger" | "sqs_trigger" | "gcp_trigger" | "azure_trigger" | "email_trigger" | "group_", isOwnerOverride?: boolean) => Promise<void>;
|
|
20
20
|
}, "">;
|
|
21
21
|
type ShareModal = InstanceType<typeof ShareModal>;
|
|
22
22
|
export default ShareModal;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script lang="ts">let { tags, value = $bindable(''), placeholder = '', highlights, onCurrentTagChange, onTextSegmentAtCursorChange, class: className = '' } = $props();
|
|
1
|
+
<script lang="ts">let { tags, value = $bindable(''), placeholder = '', highlights, onCurrentTagChange, onTextSegmentAtCursorChange, onKeyDown, autofocus, class: className = '' } = $props();
|
|
2
2
|
let contentEditableDiv;
|
|
3
3
|
let isUpdating = false;
|
|
4
4
|
$effect(() => {
|
|
@@ -270,6 +270,7 @@ function handleKeyup(e) {
|
|
|
270
270
|
updateCurrentTag(cursorPos);
|
|
271
271
|
}
|
|
272
272
|
function handleKeyDown(e) {
|
|
273
|
+
onKeyDown?.(e);
|
|
273
274
|
if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Enter')
|
|
274
275
|
return;
|
|
275
276
|
const cursorPos = getCursorPosition();
|
|
@@ -427,6 +428,7 @@ export function focusAtEnd() {
|
|
|
427
428
|
}
|
|
428
429
|
</script>
|
|
429
430
|
|
|
431
|
+
<!-- svelte-ignore a11y_autofocus -->
|
|
430
432
|
<div
|
|
431
433
|
bind:this={contentEditableDiv}
|
|
432
434
|
contenteditable="true"
|
|
@@ -441,6 +443,7 @@ export function focusAtEnd() {
|
|
|
441
443
|
role="textbox"
|
|
442
444
|
tabindex="0"
|
|
443
445
|
spellcheck="false"
|
|
446
|
+
{autofocus}
|
|
444
447
|
></div>
|
|
445
448
|
|
|
446
449
|
<style>
|