windmill-components 1.28.7 → 1.34.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/common.d.ts +3 -0
- package/components/AppConnect.svelte +28 -12
- package/components/ArgInput.svelte +25 -14
- package/components/ArgInput.svelte.d.ts +4 -0
- package/components/CenteredPage.svelte +1 -1
- package/components/DisplayResult.svelte +3 -3
- package/components/Drawer.svelte +108 -0
- package/components/Drawer.svelte.d.ts +23 -0
- package/components/Editor.svelte +70 -78
- package/components/Editor.svelte.d.ts +3 -0
- package/components/EditorBar.svelte +23 -10
- package/components/FlowBuilder.svelte +39 -33
- package/components/FlowEditor.svelte +17 -58
- package/components/FlowJobResult.svelte +18 -17
- package/components/FlowPreview.svelte +13 -34
- package/components/FlowPreview.svelte.d.ts +2 -4
- package/components/FlowPreviewContent.svelte +56 -44
- package/components/FlowPreviewContent.svelte.d.ts +0 -1
- package/components/FlowStatusViewer.svelte +123 -205
- package/components/FlowStatusViewer.svelte.d.ts +7 -4
- package/components/FlowViewer.svelte +4 -1
- package/components/IconedPath.svelte +12 -0
- package/components/IconedPath.svelte.d.ts +16 -0
- package/components/IconedResourceType.svelte +21 -2
- package/components/IconedResourceType.svelte.d.ts +1 -0
- package/components/InputTransformForm.svelte +9 -8
- package/components/InputTransformForm.svelte.d.ts +1 -1
- package/components/InviteGlobalUser.svelte +1 -1
- package/components/ItemPicker.svelte +6 -1
- package/components/JobStatus.svelte +1 -1
- package/components/ModuleStep.svelte +73 -93
- package/components/ModuleStep.svelte.d.ts +7 -2
- package/components/Path.svelte +62 -40
- package/components/Path.svelte.d.ts +2 -0
- package/components/ProgressBar.svelte +31 -0
- package/components/ProgressBar.svelte.d.ts +17 -0
- package/components/ProgressBarPart.svelte +20 -0
- package/components/ProgressBarPart.svelte.d.ts +20 -0
- package/components/ResourceEditor.svelte +2 -1
- package/components/ResourcePicker.svelte +9 -0
- package/components/SchemaForm.svelte +9 -4
- package/components/SchemaForm.svelte.d.ts +1 -1
- package/components/SchemaModal.svelte +20 -3
- package/components/ScriptBuilder.svelte +58 -21
- package/components/ScriptBuilder.svelte.d.ts +1 -0
- package/components/ScriptEditor.svelte +4 -2
- package/components/SharedBadge.svelte +8 -3
- package/components/VariableEditor.svelte +1 -1
- package/components/flows/CopyFirstStepSchema.svelte +4 -3
- package/components/flows/DynamicInputHelpBox.svelte +6 -4
- package/components/flows/DynamicInputHelpBox.svelte.d.ts +1 -1
- package/components/flows/FlowBox.svelte +15 -2
- package/components/flows/FlowBox.svelte.d.ts +14 -14
- package/components/flows/FlowBoxHeader.svelte +10 -3
- package/components/flows/FlowBoxHeader.svelte.d.ts +3 -0
- package/components/flows/FlowInput.svelte +14 -12
- package/components/flows/FlowInputs.svelte +55 -35
- package/components/flows/FlowInputs.svelte.d.ts +3 -1
- package/components/flows/FlowModuleHeader.svelte +71 -55
- package/components/flows/FlowModuleHeader.svelte.d.ts +6 -6
- package/components/flows/FlowSettings.svelte +34 -57
- package/components/flows/FlowSettings.svelte.d.ts +0 -1
- package/components/flows/FlowTimeline.svelte +169 -0
- package/components/flows/FlowTimeline.svelte.d.ts +21 -0
- package/components/flows/flowState.d.ts +14 -0
- package/components/flows/flowState.js +52 -0
- package/components/flows/flowStateUtils.d.ts +37 -0
- package/components/flows/flowStateUtils.js +222 -0
- package/components/flows/flowStore.d.ts +1 -16
- package/components/flows/flowStore.js +7 -208
- package/components/flows/pickers/FlowScriptPicker.svelte +5 -9
- package/components/flows/pickers/FlowScriptPicker.svelte.d.ts +0 -1
- package/components/flows/pickers/PickHubScript.svelte +1 -1
- package/components/flows/pickers/PickHubScript.svelte.d.ts +1 -1
- package/components/flows/pickers/PickScript.svelte +1 -1
- package/components/flows/pickers/PickScript.svelte.d.ts +1 -1
- package/components/flows/scheduleUtils.d.ts +7 -0
- package/components/flows/scheduleUtils.js +21 -0
- package/components/flows/stepOpenedStore.d.ts +1 -0
- package/components/flows/stepOpenedStore.js +6 -0
- package/components/flows/utils.d.ts +5 -12
- package/components/flows/utils.js +40 -112
- package/components/icons/DiscordIcon.svelte +16 -0
- package/components/icons/DiscordIcon.svelte.d.ts +17 -0
- package/components/icons/HttpIcon.svelte +21 -0
- package/components/icons/HttpIcon.svelte.d.ts +17 -0
- package/components/icons/MastodonIcon.svelte +16 -0
- package/components/icons/MastodonIcon.svelte.d.ts +17 -0
- package/components/icons/MatrixIcon.svelte +16 -0
- package/components/icons/MatrixIcon.svelte.d.ts +17 -0
- package/components/icons/S3Icon.svelte +16 -0
- package/components/icons/S3Icon.svelte.d.ts +17 -0
- package/components/icons/WindmillIcon.svelte +68 -0
- package/components/icons/WindmillIcon.svelte.d.ts +17 -0
- package/components/preview/FlowPreviewStatus.svelte +28 -0
- package/components/preview/FlowPreviewStatus.svelte.d.ts +17 -0
- package/components/propertyPicker/ObjectViewer.svelte +13 -13
- package/components/propertyPicker/utils.js +3 -2
- package/components/tabs/Tab.svelte +12 -0
- package/components/tabs/Tab.svelte.d.ts +19 -0
- package/components/tabs/TabPanel.svelte +11 -0
- package/components/tabs/TabPanel.svelte.d.ts +20 -0
- package/components/tabs/Tabs.svelte +3 -0
- package/components/tabs/Tabs.svelte.d.ts +23 -0
- package/gen/core/OpenAPI.js +1 -1
- package/gen/core/request.js +1 -0
- package/gen/models/MainArgSignature.d.ts +14 -3
- package/gen/services/JobService.d.ts +10 -2
- package/gen/services/JobService.js +4 -2
- package/gen/services/ScriptService.d.ts +18 -0
- package/gen/services/ScriptService.js +30 -0
- package/infer.js +47 -24
- package/package.json +39 -20
- package/script_helpers.d.ts +4 -1
- package/script_helpers.js +68 -17
- package/stores.d.ts +1 -2
- package/stores.js +1 -4
- package/utils.d.ts +4 -2
- package/utils.js +33 -5
package/utils.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type Flow, type User } from './gen';
|
|
1
|
+
import { type Flow, type FlowModule, type User } from './gen';
|
|
2
2
|
import type { Schema } from './common';
|
|
3
3
|
import { type UserExt } from './stores';
|
|
4
|
+
export declare function validateUsername(username: string): string;
|
|
4
5
|
export declare function isToday(someDate: Date): boolean;
|
|
5
6
|
export declare function daysAgo(someDate: Date): number;
|
|
6
7
|
export declare function secondsAgo(date: Date): number;
|
|
@@ -31,6 +32,7 @@ export declare function emptySchema(): {
|
|
|
31
32
|
required: never[];
|
|
32
33
|
type: string;
|
|
33
34
|
};
|
|
35
|
+
export declare function emptyModule(): FlowModule;
|
|
34
36
|
export declare function simpleSchema(): {
|
|
35
37
|
$schema: string;
|
|
36
38
|
type: string;
|
|
@@ -66,7 +68,7 @@ export declare function schemaToTsType(schema: Schema): string;
|
|
|
66
68
|
export declare function schemaToObject(schema: Schema, args: Record<string, any>): Object;
|
|
67
69
|
export declare function valueToTsType(value: any): string;
|
|
68
70
|
export declare function objectToTsType(object: Object): string;
|
|
69
|
-
export declare type InputCat =
|
|
71
|
+
export declare type InputCat = 'string' | 'number' | 'boolean' | 'list' | 'resource-object' | 'enum' | 'date' | 'base64' | 'resource-string' | 'object' | 'sql';
|
|
70
72
|
export declare function setInputCat(type: string | undefined, format: string | undefined, itemsType: string | undefined, enum_: any, contentEncoding: string | undefined): InputCat;
|
|
71
73
|
export declare function scriptPathToHref(path: string): string;
|
|
72
74
|
export declare function getScriptByPath(path: string): Promise<{
|
package/utils.js
CHANGED
|
@@ -4,6 +4,14 @@ import { FlowService, ScriptService } from './gen';
|
|
|
4
4
|
import { toast } from '@zerodevx/svelte-toast';
|
|
5
5
|
import { get } from 'svelte/store';
|
|
6
6
|
import { hubScripts, workspaceStore } from './stores';
|
|
7
|
+
export function validateUsername(username) {
|
|
8
|
+
if (username != '' && !/^\w+$/.test(username)) {
|
|
9
|
+
return 'username can only contain letters and numbers';
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return '';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
7
15
|
export function isToday(someDate) {
|
|
8
16
|
const today = new Date();
|
|
9
17
|
return (someDate.getDate() == today.getDate() &&
|
|
@@ -27,7 +35,13 @@ export function displayDaysAgo(dateString) {
|
|
|
27
35
|
return `today at ${date.toLocaleTimeString()}`;
|
|
28
36
|
}
|
|
29
37
|
else {
|
|
30
|
-
|
|
38
|
+
let dAgo = daysAgo(date);
|
|
39
|
+
if (dAgo == 0) {
|
|
40
|
+
return `yday at ${date.toLocaleTimeString()}`;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return `${dAgo + 1} days ago`;
|
|
44
|
+
}
|
|
31
45
|
}
|
|
32
46
|
}
|
|
33
47
|
export function displayDate(dateString) {
|
|
@@ -97,6 +111,12 @@ export function emptySchema() {
|
|
|
97
111
|
type: 'object'
|
|
98
112
|
};
|
|
99
113
|
}
|
|
114
|
+
export function emptyModule() {
|
|
115
|
+
return {
|
|
116
|
+
value: { type: 'script', path: '' },
|
|
117
|
+
input_transform: {}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
100
120
|
export function simpleSchema() {
|
|
101
121
|
return {
|
|
102
122
|
$schema: 'https://json-schema.org/draft/2020-12/schema',
|
|
@@ -204,6 +224,9 @@ export function groupBy(scripts, toGroup, dflts = []) {
|
|
|
204
224
|
});
|
|
205
225
|
}
|
|
206
226
|
export function truncate(s, n, suffix = '...') {
|
|
227
|
+
if (!s) {
|
|
228
|
+
return suffix;
|
|
229
|
+
}
|
|
207
230
|
if (s.length <= n) {
|
|
208
231
|
return s;
|
|
209
232
|
}
|
|
@@ -212,6 +235,9 @@ export function truncate(s, n, suffix = '...') {
|
|
|
212
235
|
}
|
|
213
236
|
}
|
|
214
237
|
export function truncateRev(s, n, prefix = '...') {
|
|
238
|
+
if (!s) {
|
|
239
|
+
return prefix;
|
|
240
|
+
}
|
|
215
241
|
if (s.length <= n) {
|
|
216
242
|
return s;
|
|
217
243
|
}
|
|
@@ -397,16 +423,18 @@ export async function getScriptByPath(path) {
|
|
|
397
423
|
}
|
|
398
424
|
export async function loadHubScripts() {
|
|
399
425
|
const scripts = (await ScriptService.listHubScripts()).asks ?? [];
|
|
400
|
-
const processed = scripts
|
|
401
|
-
|
|
426
|
+
const processed = scripts
|
|
427
|
+
.map((x) => ({
|
|
428
|
+
path: `hub/${x.id}/${x.app}/${x.summary.toLowerCase().replaceAll(/\s+/g, '_')}`,
|
|
402
429
|
summary: `${x.summary} (${x.app}) ${x.views} uses`,
|
|
403
430
|
approved: x.approved,
|
|
404
431
|
is_trigger: x.is_trigger,
|
|
405
432
|
app: x.app,
|
|
406
433
|
views: x.views,
|
|
407
434
|
votes: x.votes,
|
|
408
|
-
ask_id: x.ask_id
|
|
409
|
-
}))
|
|
435
|
+
ask_id: x.ask_id
|
|
436
|
+
}))
|
|
437
|
+
.sort((a, b) => b.views - a.views);
|
|
410
438
|
hubScripts.set(processed);
|
|
411
439
|
}
|
|
412
440
|
export async function loadHubFlows() {
|