windmill-components 1.13.25 → 1.22.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.js +1 -5
- package/components/AppConnect.svelte +281 -0
- package/components/AppConnect.svelte.d.ts +22 -0
- package/components/ArgInfo.svelte +11 -16
- package/components/ArgInput.svelte +73 -70
- package/components/ArgInput.svelte.d.ts +6 -1
- package/components/AutosizedTextarea.svelte +6 -8
- package/components/Badge.svelte +4 -10
- package/components/Button.svelte +22 -18
- package/components/ButtonAndDropdown.svelte +6 -12
- package/components/CenteredModal.svelte +30 -0
- package/components/CenteredModal.svelte.d.ts +19 -0
- package/components/ChevronButton.svelte +4 -9
- package/components/DisplayResult.svelte +58 -57
- package/components/Dropdown.svelte +8 -13
- package/components/Editor.svelte +108 -149
- package/components/Editor.svelte.d.ts +3 -1
- package/components/FieldHeader.svelte +7 -12
- package/components/FlowBuilder.svelte +72 -121
- package/components/FlowBuilder.svelte.d.ts +0 -2
- package/components/FlowEditor.svelte +185 -73
- package/components/FlowEditor.svelte.d.ts +4 -4
- package/components/FlowJobResult.svelte +23 -0
- package/components/FlowJobResult.svelte.d.ts +17 -0
- package/components/FlowPreview.svelte +36 -51
- package/components/FlowPreview.svelte.d.ts +7 -1
- package/components/FlowStatusViewer.svelte +66 -40
- package/components/FlowStatusViewer.svelte.d.ts +1 -1
- package/components/FlowViewer.svelte +100 -0
- package/components/FlowViewer.svelte.d.ts +24 -0
- package/components/GroupModal.svelte +13 -20
- package/components/IconedResourceType.svelte +15 -18
- package/components/InviteGlobalUser.svelte +8 -15
- package/components/InviteUser.svelte +9 -16
- package/components/ItemPicker.svelte +11 -14
- package/components/JobStatus.svelte +6 -11
- package/components/Modal.svelte +14 -17
- package/components/ModuleStep.svelte +125 -64
- package/components/ModuleStep.svelte.d.ts +4 -8
- package/components/ObjectResourceInput.svelte +15 -20
- package/components/ObjectTypeNarrowing.svelte +7 -12
- package/components/PageHeader.svelte +4 -9
- package/components/Password.svelte +6 -8
- package/components/Path.svelte +78 -38
- package/components/Path.svelte.d.ts +2 -0
- package/components/RadioButton.svelte +7 -8
- package/components/RadioButtonV2.svelte +33 -0
- package/components/RadioButtonV2.svelte.d.ts +20 -0
- package/components/Required.svelte +2 -4
- package/components/ResourceEditor.svelte +44 -48
- package/components/ResourcePicker.svelte +6 -7
- package/components/ResourcePicker.svelte.d.ts +2 -2
- package/components/ResourceTypePicker.svelte +8 -13
- package/components/RunForm.svelte +15 -20
- package/components/SchemaEditor.svelte +31 -61
- package/components/SchemaForm.svelte +126 -134
- package/components/SchemaForm.svelte.d.ts +6 -4
- package/components/SchemaModal.svelte +25 -40
- package/components/SchemaModal.svelte.d.ts +1 -1
- package/components/SchemaViewer.svelte +6 -12
- package/components/ScriptBuilder.svelte +76 -101
- package/components/ScriptEditor.svelte +55 -60
- package/components/ScriptPicker.svelte +28 -34
- package/components/ScriptPicker.svelte.d.ts +1 -0
- package/components/ScriptSchema.svelte +13 -17
- package/components/ShareModal.svelte +23 -29
- package/components/SharedBadge.svelte +11 -16
- package/components/StringTypeNarrowing.svelte +8 -11
- package/components/Switch.svelte.d.ts +2 -2
- package/components/TableCustom.svelte +5 -8
- package/components/TableSimple.svelte +9 -8
- package/components/Tabs.svelte +6 -8
- package/components/Toggle.svelte +34 -0
- package/components/Toggle.svelte.d.ts +28 -0
- package/components/Tooltip.svelte +56 -89
- package/components/Tooltip.svelte.d.ts +1 -5
- package/components/VariableEditor.svelte +30 -29
- package/components/flows/CopyFirstStepSchema.svelte +10 -0
- package/components/flows/CopyFirstStepSchema.svelte.d.ts +14 -0
- package/components/flows/DynamicInputHelpBox.svelte +72 -0
- package/components/flows/DynamicInputHelpBox.svelte.d.ts +14 -0
- package/components/flows/FlowInputs.svelte +27 -0
- package/components/flows/FlowInputs.svelte.d.ts +19 -0
- package/components/flows/FlowModuleHeader.svelte +91 -0
- package/components/flows/FlowModuleHeader.svelte.d.ts +22 -0
- package/components/flows/flowStore.d.ts +17 -0
- package/components/flows/flowStore.js +161 -0
- package/components/flows/pickers/FlowScriptPicker.svelte +11 -0
- package/components/flows/pickers/FlowScriptPicker.svelte.d.ts +22 -0
- package/components/flows/pickers/PickHubScript.svelte +30 -0
- package/components/flows/pickers/PickHubScript.svelte.d.ts +18 -0
- package/components/flows/pickers/PickScript.svelte +38 -0
- package/components/flows/pickers/PickScript.svelte.d.ts +18 -0
- package/components/flows/utils.d.ts +21 -0
- package/components/flows/utils.js +164 -0
- package/components/icons/DbIcon.svelte +2 -5
- package/components/icons/Mail.svelte +2 -5
- package/components/icons/Mysql.svelte +2 -5
- package/components/icons/PostgresIcon.svelte +2 -5
- package/components/icons/Slack.svelte +2 -5
- package/components/propertyPicker/ObjectViewer.svelte +113 -0
- package/components/propertyPicker/ObjectViewer.svelte.d.ts +21 -0
- package/components/propertyPicker/OverlayPropertyPicker.svelte +69 -0
- package/components/propertyPicker/OverlayPropertyPicker.svelte.d.ts +21 -0
- package/components/propertyPicker/PropPicker.svelte +24 -0
- package/components/propertyPicker/PropPicker.svelte.d.ts +18 -0
- package/components/propertyPicker/WarningMessage.svelte +43 -0
- package/components/propertyPicker/WarningMessage.svelte.d.ts +16 -0
- package/components/propertyPicker/utils.d.ts +2 -0
- package/components/propertyPicker/utils.js +40 -0
- package/gen/core/ApiError.d.ts +3 -1
- package/gen/core/ApiError.js +4 -6
- package/gen/core/ApiRequestOptions.js +1 -2
- package/gen/core/ApiResult.js +1 -2
- package/gen/core/CancelablePromise.js +2 -7
- package/gen/core/OpenAPI.js +2 -5
- package/gen/core/request.js +8 -13
- package/gen/index.d.ts +3 -0
- package/gen/index.js +28 -58
- package/gen/models/AuditLog.js +2 -5
- package/gen/models/CompletedJob.d.ts +3 -1
- package/gen/models/CompletedJob.js +3 -5
- package/gen/models/ContextualVariable.js +1 -2
- package/gen/models/CreateResource.d.ts +1 -0
- package/gen/models/CreateResource.js +1 -2
- package/gen/models/CreateVariable.d.ts +2 -0
- package/gen/models/CreateVariable.js +1 -2
- package/gen/models/CreateWorkspace.js +1 -2
- package/gen/models/EditResource.js +1 -2
- package/gen/models/EditResourceType.js +1 -2
- package/gen/models/EditSchedule.js +1 -2
- package/gen/models/EditVariable.js +1 -2
- package/gen/models/EditWorkspaceUser.js +1 -2
- package/gen/models/Flow.js +1 -2
- package/gen/models/FlowModule.d.ts +2 -0
- package/gen/models/FlowModule.js +1 -2
- package/gen/models/FlowModuleValue.d.ts +14 -2
- package/gen/models/FlowModuleValue.js +9 -5
- package/gen/models/FlowPreview.js +1 -2
- package/gen/models/FlowStatus.js +1 -2
- package/gen/models/FlowStatusModule.d.ts +6 -0
- package/gen/models/FlowStatusModule.js +2 -5
- package/gen/models/FlowValue.js +1 -2
- package/gen/models/GlobalUserInfo.js +2 -5
- package/gen/models/Group.js +1 -2
- package/gen/models/InputTransform.js +2 -5
- package/gen/models/Job.js +2 -5
- package/gen/models/ListableVariable.d.ts +2 -0
- package/gen/models/ListableVariable.js +1 -2
- package/gen/models/Login.js +1 -2
- package/gen/models/MainArgSignature.js +1 -2
- package/gen/models/NewSchedule.js +1 -2
- package/gen/models/NewToken.js +1 -2
- package/gen/models/NewUser.js +1 -2
- package/gen/models/Preview.js +2 -5
- package/gen/models/QueuedJob.d.ts +2 -1
- package/gen/models/QueuedJob.js +3 -5
- package/gen/models/Resource.d.ts +1 -0
- package/gen/models/Resource.js +1 -2
- package/gen/models/ResourceType.js +1 -2
- package/gen/models/Schedule.js +1 -2
- package/gen/models/Script.d.ts +1 -0
- package/gen/models/Script.js +2 -5
- package/gen/models/ScriptArgs.js +1 -2
- package/gen/models/SlackToken.d.ts +8 -0
- package/gen/models/SlackToken.js +4 -0
- package/gen/models/TokenResponse.d.ts +6 -0
- package/gen/models/TokenResponse.js +4 -0
- package/gen/models/TruncatedToken.js +1 -2
- package/gen/models/User.js +1 -2
- package/gen/models/UserWorkspaceList.js +1 -2
- package/gen/models/WorkerPing.js +1 -2
- package/gen/models/Workspace.js +1 -2
- package/gen/models/WorkspaceInvite.js +1 -2
- package/gen/services/AdminService.d.ts +6 -2
- package/gen/services/AdminService.js +6 -10
- package/gen/services/AuditService.d.ts +24 -8
- package/gen/services/AuditService.js +5 -9
- package/gen/services/FlowService.d.ts +37 -10
- package/gen/services/FlowService.js +23 -12
- package/gen/services/GranularAclService.d.ts +6 -2
- package/gen/services/GranularAclService.js +6 -10
- package/gen/services/GroupService.d.ts +18 -6
- package/gen/services/GroupService.js +11 -15
- package/gen/services/JobService.d.ts +167 -46
- package/gen/services/JobService.js +42 -22
- package/gen/services/OauthService.d.ts +104 -0
- package/gen/services/OauthService.js +133 -0
- package/gen/services/ResourceService.d.ts +39 -7
- package/gen/services/ResourceService.js +44 -18
- package/gen/services/ScheduleService.d.ts +36 -6
- package/gen/services/ScheduleService.js +39 -13
- package/gen/services/ScriptService.d.ts +66 -19
- package/gen/services/ScriptService.js +32 -20
- package/gen/services/SettingsService.js +5 -9
- package/gen/services/UserService.d.ts +49 -11
- package/gen/services/UserService.js +42 -29
- package/gen/services/VariableService.d.ts +19 -4
- package/gen/services/VariableService.js +24 -13
- package/gen/services/WorkerService.d.ts +6 -2
- package/gen/services/WorkerService.js +4 -8
- package/gen/services/WorkspaceService.d.ts +29 -24
- package/gen/services/WorkspaceService.js +23 -42
- package/infer.js +5 -9
- package/logout.js +20 -18
- package/package.json +51 -24
- package/script_helpers.d.ts +4 -0
- package/script_helpers.js +70 -0
- package/scripts.d.ts +2 -1
- package/scripts.js +11 -15
- package/stores.d.ts +6 -0
- package/stores.js +30 -22
- package/user.js +10 -15
- package/utils.d.ts +15 -1
- package/utils.js +191 -52
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
exports.schemas = [];
|
|
19
|
-
exports.args = {};
|
|
1
|
+
<script>import { InputTransform, Job, JobService } from '../gen';
|
|
2
|
+
import { workspaceStore } from '../stores';
|
|
3
|
+
import { sendUserToast, truncateRev } from '../utils';
|
|
4
|
+
import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons';
|
|
5
|
+
import { createEventDispatcher, onDestroy } from 'svelte';
|
|
6
|
+
import Icon from 'svelte-awesome';
|
|
7
|
+
import FlowJobResult from './FlowJobResult.svelte';
|
|
8
|
+
import { flowToMode } from './flows/utils';
|
|
9
|
+
import FlowStatusViewer from './FlowStatusViewer.svelte';
|
|
10
|
+
import RunForm from './RunForm.svelte';
|
|
11
|
+
import Tabs from './Tabs.svelte';
|
|
12
|
+
const dispatch = createEventDispatcher();
|
|
13
|
+
export let i;
|
|
14
|
+
export let flow;
|
|
15
|
+
export let schemas = [];
|
|
16
|
+
export let mode;
|
|
17
|
+
export let args = {};
|
|
20
18
|
let stepArgs = {};
|
|
21
19
|
let tab = 'upto';
|
|
22
20
|
let viewPreview = false;
|
|
23
21
|
let intervalId;
|
|
24
|
-
let uptoText =
|
|
22
|
+
let uptoText = i == flow.value.modules.length - 1 ? 'Preview whole flow' : 'Preview up to this step';
|
|
25
23
|
let job;
|
|
26
24
|
let jobs = [];
|
|
27
25
|
let jobId;
|
|
28
|
-
async function runPreview(args) {
|
|
26
|
+
export async function runPreview(args) {
|
|
27
|
+
viewPreview = true;
|
|
29
28
|
intervalId && clearInterval(intervalId);
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
let newFlow = flowToMode(flow, mode);
|
|
30
|
+
newFlow = tab == 'upto' ? truncateFlow(newFlow) : extractStep(newFlow);
|
|
31
|
+
jobId = await JobService.runFlowPreview({
|
|
32
32
|
workspace: $workspaceStore ?? '',
|
|
33
33
|
requestBody: {
|
|
34
34
|
args,
|
|
@@ -38,20 +38,20 @@ async function runPreview(args) {
|
|
|
38
38
|
});
|
|
39
39
|
jobs = [];
|
|
40
40
|
intervalId = setInterval(loadJob, 1000);
|
|
41
|
-
|
|
41
|
+
sendUserToast(`started preview ${truncateRev(jobId, 10)}`);
|
|
42
42
|
}
|
|
43
43
|
function truncateFlow(flow) {
|
|
44
44
|
const localFlow = JSON.parse(JSON.stringify(flow));
|
|
45
|
-
localFlow.value.modules = flow.value.modules.slice(0,
|
|
45
|
+
localFlow.value.modules = flow.value.modules.slice(0, i + 1);
|
|
46
46
|
return localFlow;
|
|
47
47
|
}
|
|
48
48
|
function extractStep(flow) {
|
|
49
49
|
const localFlow = JSON.parse(JSON.stringify(flow));
|
|
50
|
-
localFlow.value.modules = flow.value.modules.slice(
|
|
51
|
-
localFlow.schema =
|
|
50
|
+
localFlow.value.modules = flow.value.modules.slice(i, i + 1);
|
|
51
|
+
localFlow.schema = schemas[i];
|
|
52
52
|
stepArgs = {};
|
|
53
|
-
Object.entries(flow.value.modules[
|
|
54
|
-
if (x[1].type ==
|
|
53
|
+
Object.entries(flow.value.modules[i].input_transform).forEach((x) => {
|
|
54
|
+
if (x[1].type == InputTransform.type.STATIC) {
|
|
55
55
|
stepArgs[x[0]] = x[1].value;
|
|
56
56
|
}
|
|
57
57
|
});
|
|
@@ -59,25 +59,25 @@ function extractStep(flow) {
|
|
|
59
59
|
}
|
|
60
60
|
async function loadJob() {
|
|
61
61
|
try {
|
|
62
|
-
job = await
|
|
62
|
+
job = await JobService.getJob({ workspace: $workspaceStore, id: jobId });
|
|
63
63
|
if (job?.type == 'CompletedJob') {
|
|
64
64
|
//only CompletedJob has success property
|
|
65
65
|
clearInterval(intervalId);
|
|
66
66
|
}
|
|
67
|
+
dispatch('change', job);
|
|
67
68
|
}
|
|
68
69
|
catch (err) {
|
|
69
|
-
|
|
70
|
+
sendUserToast(err, true);
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
|
-
|
|
73
|
+
onDestroy(() => {
|
|
73
74
|
intervalId && clearInterval(intervalId);
|
|
74
75
|
});
|
|
75
76
|
</script>
|
|
76
77
|
|
|
77
|
-
<h2 class="
|
|
78
|
+
<h2 class="flex justify-center">
|
|
78
79
|
<button
|
|
79
|
-
|
|
80
|
-
class="underline text-gray-700 inline-flex items-center"
|
|
80
|
+
class="default-button "
|
|
81
81
|
on:click={() => {
|
|
82
82
|
viewPreview = !viewPreview
|
|
83
83
|
}}
|
|
@@ -124,22 +124,7 @@ async function loadJob() {
|
|
|
124
124
|
<FlowStatusViewer {job} bind:jobs />
|
|
125
125
|
</div>
|
|
126
126
|
{#if `result` in job}
|
|
127
|
-
<
|
|
128
|
-
<div>
|
|
129
|
-
<ChevronButton text="result" viewOptions={true}>
|
|
130
|
-
<div class="text-xs">
|
|
131
|
-
<DisplayResult result={job.result} />
|
|
132
|
-
</div>
|
|
133
|
-
</ChevronButton>
|
|
134
|
-
</div>
|
|
135
|
-
<div>
|
|
136
|
-
<ChevronButton text="logs" viewOptions={true}>
|
|
137
|
-
<div class="text-xs p-4 bg-gray-50 overflow-auto max-h-lg">
|
|
138
|
-
<pre class="w-full">{job.logs}</pre>
|
|
139
|
-
</div>
|
|
140
|
-
</ChevronButton>
|
|
141
|
-
</div>
|
|
142
|
-
</div>
|
|
127
|
+
<FlowJobResult {job} />
|
|
143
128
|
{/if}
|
|
144
129
|
{/if}
|
|
145
130
|
{/if}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import { type Flow } from '../gen';
|
|
3
2
|
import type { Schema } from '../common';
|
|
3
|
+
import { type Flow } from '../gen';
|
|
4
|
+
import type { FlowMode } from './flows/flowStore';
|
|
4
5
|
declare const __propDef: {
|
|
5
6
|
props: {
|
|
6
7
|
i: number;
|
|
7
8
|
flow: Flow;
|
|
8
9
|
schemas?: Schema[] | undefined;
|
|
10
|
+
mode: FlowMode;
|
|
9
11
|
args?: Record<string, any> | undefined;
|
|
12
|
+
runPreview?: ((args: any) => Promise<void>) | undefined;
|
|
10
13
|
};
|
|
11
14
|
events: {
|
|
15
|
+
change: CustomEvent<any>;
|
|
16
|
+
} & {
|
|
12
17
|
[evt: string]: CustomEvent<any>;
|
|
13
18
|
};
|
|
14
19
|
slots: {};
|
|
@@ -17,5 +22,6 @@ export declare type FlowPreviewProps = typeof __propDef.props;
|
|
|
17
22
|
export declare type FlowPreviewEvents = typeof __propDef.events;
|
|
18
23
|
export declare type FlowPreviewSlots = typeof __propDef.slots;
|
|
19
24
|
export default class FlowPreview extends SvelteComponentTyped<FlowPreviewProps, FlowPreviewEvents, FlowPreviewSlots> {
|
|
25
|
+
get runPreview(): (args: any) => Promise<void>;
|
|
20
26
|
}
|
|
21
27
|
export {};
|
|
@@ -1,28 +1,39 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const stores_1 = require("$lib/stores");
|
|
13
|
-
const DisplayResult_svelte_1 = __importDefault(require("./DisplayResult.svelte"));
|
|
14
|
-
const ChevronButton_svelte_1 = __importDefault(require("./ChevronButton.svelte"));
|
|
15
|
-
const JobStatus_svelte_1 = __importDefault(require("./JobStatus.svelte"));
|
|
1
|
+
<script>import { faHourglassHalf, faSpinner, faTimes } from '@fortawesome/free-solid-svg-icons';
|
|
2
|
+
import { scriptPathToHref, truncateRev } from '../utils';
|
|
3
|
+
import Icon from 'svelte-awesome';
|
|
4
|
+
import { check } from 'svelte-awesome/icons';
|
|
5
|
+
import { CompletedJob, FlowModuleValue, FlowStatusModule, JobService, QueuedJob } from '../gen';
|
|
6
|
+
import { workspaceStore } from '../stores';
|
|
7
|
+
import JobStatus from './JobStatus.svelte';
|
|
8
|
+
import FlowJobResult from './FlowJobResult.svelte';
|
|
9
|
+
export let job;
|
|
10
|
+
export let jobs = [];
|
|
11
|
+
let forloop_selected = '';
|
|
16
12
|
function loadResults() {
|
|
17
|
-
|
|
18
|
-
if ((i >=
|
|
19
|
-
x.type ==
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
job?.flow_status?.modules?.forEach(async (x, i) => {
|
|
14
|
+
if ((i >= jobs.length && x.type == FlowStatusModule.type.SUCCESS) ||
|
|
15
|
+
x.type == FlowStatusModule.type.FAILURE) {
|
|
16
|
+
if (x.forloop_jobs) {
|
|
17
|
+
const forloop_jobs = [];
|
|
18
|
+
for (let j of x.forloop_jobs) {
|
|
19
|
+
forloop_jobs.push(await JobService.getCompletedJob({ workspace: $workspaceStore, id: j }));
|
|
20
|
+
}
|
|
21
|
+
jobs.push(forloop_jobs);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
jobs.push(await JobService.getCompletedJob({ workspace: $workspaceStore, id: x.job }));
|
|
25
|
+
}
|
|
26
|
+
jobs = jobs;
|
|
22
27
|
}
|
|
23
28
|
});
|
|
24
29
|
}
|
|
25
|
-
|
|
30
|
+
function toCompletedJob(x) {
|
|
31
|
+
return x;
|
|
32
|
+
}
|
|
33
|
+
function toCompletedJobs(x) {
|
|
34
|
+
return x;
|
|
35
|
+
}
|
|
36
|
+
$: $workspaceStore && job && loadResults();
|
|
26
37
|
</script>
|
|
27
38
|
|
|
28
39
|
<div class="flow-root max-w-lg w-full p-4">
|
|
@@ -47,7 +58,7 @@ $: $workspaceStore && exports.job && loadResults();
|
|
|
47
58
|
out of <span class="font-medium text-gray-900">{job?.raw_flow?.modules.length}</span>
|
|
48
59
|
<span class="mt-4" />
|
|
49
60
|
</p>
|
|
50
|
-
<ul
|
|
61
|
+
<ul class="-mb-8 w-full">
|
|
51
62
|
{#each job?.raw_flow?.modules ?? [] as mod, i}
|
|
52
63
|
<li class="w-full">
|
|
53
64
|
<div class="relative pb-8 w-full">
|
|
@@ -100,7 +111,8 @@ $: $workspaceStore && exports.job && loadResults();
|
|
|
100
111
|
<p class="text-sm text-gray-500">
|
|
101
112
|
{#if mod.value.type == FlowModuleValue.type.SCRIPT}
|
|
102
113
|
Script at path <a
|
|
103
|
-
|
|
114
|
+
target="_blank"
|
|
115
|
+
href={scriptPathToHref(mod.value.path ?? '')}
|
|
104
116
|
class="font-medium text-gray-900">{mod.value.path}</a
|
|
105
117
|
>
|
|
106
118
|
{/if}
|
|
@@ -108,7 +120,15 @@ $: $workspaceStore && exports.job && loadResults();
|
|
|
108
120
|
</div>
|
|
109
121
|
<div class="text-right text-sm whitespace-nowrap text-gray-500">
|
|
110
122
|
{job.flow_status?.modules[i].type}
|
|
111
|
-
{#if job.flow_status?.modules[i].
|
|
123
|
+
{#if job.flow_status?.modules[i].forloop_jobs}
|
|
124
|
+
{#each job.flow_status?.modules[i].forloop_jobs ?? [] as job}
|
|
125
|
+
<div class="flex flex-col">
|
|
126
|
+
<a href="/run/{job}" class="font-medium text-blue-600"
|
|
127
|
+
>{truncateRev(job ?? '', 10)}</a
|
|
128
|
+
>
|
|
129
|
+
</div>
|
|
130
|
+
{/each}
|
|
131
|
+
{:else if job.flow_status?.modules[i].job}
|
|
112
132
|
<a href="/run/{job.flow_status?.modules[i].job}" class="font-medium text-blue-600"
|
|
113
133
|
>{truncateRev(job.flow_status?.modules[i].job ?? '', 10)}</a
|
|
114
134
|
>
|
|
@@ -116,23 +136,29 @@ $: $workspaceStore && exports.job && loadResults();
|
|
|
116
136
|
</div>
|
|
117
137
|
</div>
|
|
118
138
|
</div>
|
|
119
|
-
{#if
|
|
120
|
-
|
|
121
|
-
<div>
|
|
122
|
-
|
|
123
|
-
<
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
139
|
+
{#if jobs[i]}
|
|
140
|
+
{#if Array.isArray(jobs[i])}
|
|
141
|
+
<div class="flex flex-col space-y-2">
|
|
142
|
+
{#each toCompletedJobs(jobs[i]) as job, i}
|
|
143
|
+
<button
|
|
144
|
+
class="underline text-blue-600 hover:text-blue-700"
|
|
145
|
+
on:click={() => {
|
|
146
|
+
if (forloop_selected == job.id) {
|
|
147
|
+
forloop_selected = ''
|
|
148
|
+
} else {
|
|
149
|
+
forloop_selected = job.id
|
|
150
|
+
}
|
|
151
|
+
}}
|
|
152
|
+
>Iteration: #{i}: {job.id} {forloop_selected == job.id ? '(-)' : '(+)'}</button
|
|
153
|
+
>
|
|
154
|
+
{#if forloop_selected == job.id}
|
|
155
|
+
<svelte:self {job} />
|
|
156
|
+
{/if}
|
|
157
|
+
{/each}
|
|
134
158
|
</div>
|
|
135
|
-
|
|
159
|
+
{:else}
|
|
160
|
+
<FlowJobResult job={toCompletedJob(jobs[i])} />
|
|
161
|
+
{/if}
|
|
136
162
|
{/if}
|
|
137
163
|
</div>
|
|
138
164
|
</li>
|
|
@@ -3,7 +3,7 @@ import { CompletedJob, QueuedJob } from '../gen';
|
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
job: QueuedJob | CompletedJob;
|
|
6
|
-
jobs
|
|
6
|
+
jobs?: (CompletedJob | CompletedJob[] | undefined)[] | undefined;
|
|
7
7
|
};
|
|
8
8
|
events: {
|
|
9
9
|
[evt: string]: CustomEvent<any>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<script>import { scriptPathToHref } from '../utils';
|
|
2
|
+
import Highlight from 'svelte-highlight';
|
|
3
|
+
import json from 'svelte-highlight/languages/json';
|
|
4
|
+
import python from 'svelte-highlight/languages/python';
|
|
5
|
+
import typescript from 'svelte-highlight/languages/typescript';
|
|
6
|
+
import { FlowModuleValue } from '../gen';
|
|
7
|
+
import github from 'svelte-highlight/styles/github';
|
|
8
|
+
import { slide } from 'svelte/transition';
|
|
9
|
+
import Tabs from './Tabs.svelte';
|
|
10
|
+
export let flow;
|
|
11
|
+
let flowFiltered = {
|
|
12
|
+
summary: flow.summary,
|
|
13
|
+
description: flow.description,
|
|
14
|
+
value: flow.value,
|
|
15
|
+
schema: flow.schema
|
|
16
|
+
};
|
|
17
|
+
export let embedded = false;
|
|
18
|
+
export let tab = 'ui';
|
|
19
|
+
let open = {};
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<svelte:head>
|
|
23
|
+
{@html github}
|
|
24
|
+
</svelte:head>
|
|
25
|
+
|
|
26
|
+
{#if !embedded}
|
|
27
|
+
<Tabs
|
|
28
|
+
tabs={[
|
|
29
|
+
['ui', 'Flow rendered'],
|
|
30
|
+
['json', 'JSON']
|
|
31
|
+
]}
|
|
32
|
+
bind:tab
|
|
33
|
+
/>
|
|
34
|
+
{/if}
|
|
35
|
+
{#if tab == 'ui'}
|
|
36
|
+
<div class="flow-root w-full p-4">
|
|
37
|
+
<p class="font-black text-lg mb-6 w-full ml-2">
|
|
38
|
+
<span>{flow.value.modules.length} Steps </span>
|
|
39
|
+
<span class="mt-4" />
|
|
40
|
+
</p>
|
|
41
|
+
<ul class="-mb-8 w-full">
|
|
42
|
+
{#each flow.value.modules ?? [] as mod, i}
|
|
43
|
+
<li class="w-full">
|
|
44
|
+
<div class="relative pb-8 w-full">
|
|
45
|
+
{#if i < (flow.value.modules ?? []).length - 1}
|
|
46
|
+
<span
|
|
47
|
+
class="absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200"
|
|
48
|
+
aria-hidden="true"
|
|
49
|
+
/>
|
|
50
|
+
{/if}
|
|
51
|
+
<div class="relative flex space-x-3">
|
|
52
|
+
<div>
|
|
53
|
+
<span
|
|
54
|
+
class="h-8 w-8 rounded-full bg-blue-600 flex items-center justify-center ring-8 ring-white text-white"
|
|
55
|
+
>{i + 1}
|
|
56
|
+
</span>
|
|
57
|
+
</div>
|
|
58
|
+
<div class="min-w-0 flex-1 pt-1.5 flex justify-between space-x-4 w-full">
|
|
59
|
+
<div class="w-full">
|
|
60
|
+
<p class="text-sm text-gray-500">
|
|
61
|
+
{#if mod.value.type == FlowModuleValue.type.SCRIPT}
|
|
62
|
+
Script at path <a
|
|
63
|
+
target="_blank"
|
|
64
|
+
href={scriptPathToHref(mod.value.path ?? '')}
|
|
65
|
+
class="font-medium text-gray-900">{mod.value.path}</a
|
|
66
|
+
>
|
|
67
|
+
{:else if mod.value.type == FlowModuleValue.type.RAWSCRIPT}
|
|
68
|
+
<button
|
|
69
|
+
on:click={() => (open[i] = !open[i])}
|
|
70
|
+
class="mb-2 underline text-black"
|
|
71
|
+
>
|
|
72
|
+
Raw {mod.value.language} script {open[i] ? '(-)' : '(+)'}</button
|
|
73
|
+
>
|
|
74
|
+
|
|
75
|
+
{#if open[i]}
|
|
76
|
+
<div transition:slide class="border border-black p-2 bg-gray-50 w-full">
|
|
77
|
+
<Highlight
|
|
78
|
+
language={mod.value.language == 'deno' ? typescript : python}
|
|
79
|
+
code={mod.value.content}
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
82
|
+
{/if}
|
|
83
|
+
{:else if mod.value.type == FlowModuleValue.type.FLOW}
|
|
84
|
+
Flow at path {mod.value.path}
|
|
85
|
+
{:else if mod.value.type == FlowModuleValue.type.FORLOOPFLOW}
|
|
86
|
+
For loop over step {i}'s result':
|
|
87
|
+
<svelte:self flow={mod.value} embedded={true} />
|
|
88
|
+
{/if}
|
|
89
|
+
</p>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</li>
|
|
95
|
+
{/each}
|
|
96
|
+
</ul>
|
|
97
|
+
</div>
|
|
98
|
+
{:else}
|
|
99
|
+
<Highlight language={json} code={JSON.stringify(flowFiltered, null, 4)} />
|
|
100
|
+
{/if}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import { type FlowValue } from '../gen';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
flow: {
|
|
6
|
+
summary: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
value: FlowValue;
|
|
9
|
+
schema?: any;
|
|
10
|
+
};
|
|
11
|
+
embedded?: boolean | undefined;
|
|
12
|
+
tab?: "json" | "ui" | undefined;
|
|
13
|
+
};
|
|
14
|
+
events: {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
};
|
|
17
|
+
slots: {};
|
|
18
|
+
};
|
|
19
|
+
export declare type FlowViewerProps = typeof __propDef.props;
|
|
20
|
+
export declare type FlowViewerEvents = typeof __propDef.events;
|
|
21
|
+
export declare type FlowViewerSlots = typeof __propDef.slots;
|
|
22
|
+
export default class FlowViewer extends SvelteComponentTyped<FlowViewerProps, FlowViewerEvents, FlowViewerSlots> {
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const Modal_svelte_1 = __importDefault(require("./Modal.svelte"));
|
|
9
|
-
const gen_1 = require("$lib/gen");
|
|
10
|
-
const simple_svelte_autocomplete_1 = __importDefault(require("simple-svelte-autocomplete"));
|
|
11
|
-
const PageHeader_svelte_1 = __importDefault(require("./PageHeader.svelte"));
|
|
12
|
-
const TableCustom_svelte_1 = __importDefault(require("./TableCustom.svelte"));
|
|
13
|
-
const utils_1 = require("$lib/utils");
|
|
1
|
+
<script>import { userStore, workspaceStore } from '../stores';
|
|
2
|
+
import Modal from './Modal.svelte';
|
|
3
|
+
import { GroupService, UserService } from '../gen';
|
|
4
|
+
import AutoComplete from 'simple-svelte-autocomplete';
|
|
5
|
+
import PageHeader from './PageHeader.svelte';
|
|
6
|
+
import TableCustom from './TableCustom.svelte';
|
|
7
|
+
import { canWrite } from '../utils';
|
|
14
8
|
let name = '';
|
|
15
9
|
let modal;
|
|
16
10
|
let can_write = false;
|
|
@@ -19,10 +13,10 @@ let members = [];
|
|
|
19
13
|
let usernames = [];
|
|
20
14
|
let username = '';
|
|
21
15
|
async function loadUsernames() {
|
|
22
|
-
usernames = await
|
|
16
|
+
usernames = await UserService.listUsernames({ workspace: $workspaceStore });
|
|
23
17
|
}
|
|
24
18
|
$: {
|
|
25
|
-
if (group && $workspaceStore &&
|
|
19
|
+
if (group && $workspaceStore && userStore) {
|
|
26
20
|
members = (group.members ?? []).map((x) => {
|
|
27
21
|
return {
|
|
28
22
|
name: x,
|
|
@@ -31,15 +25,14 @@ $: {
|
|
|
31
25
|
});
|
|
32
26
|
}
|
|
33
27
|
}
|
|
34
|
-
function openModal(newName) {
|
|
28
|
+
export function openModal(newName) {
|
|
35
29
|
name = newName;
|
|
36
30
|
loadGroup();
|
|
37
31
|
loadUsernames();
|
|
38
32
|
modal.openModal();
|
|
39
33
|
}
|
|
40
|
-
exports.openModal = openModal;
|
|
41
34
|
async function addToGroup() {
|
|
42
|
-
await
|
|
35
|
+
await GroupService.addUserToGroup({
|
|
43
36
|
workspace: $workspaceStore ?? '',
|
|
44
37
|
name,
|
|
45
38
|
requestBody: { username }
|
|
@@ -47,8 +40,8 @@ async function addToGroup() {
|
|
|
47
40
|
loadGroup();
|
|
48
41
|
}
|
|
49
42
|
async function loadGroup() {
|
|
50
|
-
group = await
|
|
51
|
-
can_write =
|
|
43
|
+
group = await GroupService.getGroup({ workspace: $workspaceStore, name });
|
|
44
|
+
can_write = canWrite(group.name, group.extra_perms ?? {}, $userStore);
|
|
52
45
|
}
|
|
53
46
|
</script>
|
|
54
47
|
|
|
@@ -1,35 +1,32 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
require("@fortawesome/free-brands-svg-icons");
|
|
13
|
-
const Slack_svelte_1 = __importDefault(require("./icons/Slack.svelte"));
|
|
14
|
-
exports.after = false;
|
|
15
|
-
exports.height = '24px';
|
|
16
|
-
exports.width = '24px';
|
|
1
|
+
<script>import Mysql from './icons/Mysql.svelte';
|
|
2
|
+
import Mail from './icons/Mail.svelte';
|
|
3
|
+
import DbIcon from './icons/DbIcon.svelte';
|
|
4
|
+
import PostgresIcon from './icons/PostgresIcon.svelte';
|
|
5
|
+
import { faGithub } from '@fortawesome/free-brands-svg-icons';
|
|
6
|
+
import Slack from './icons/Slack.svelte';
|
|
7
|
+
import Icon from 'svelte-awesome';
|
|
8
|
+
export let name;
|
|
9
|
+
export let after = false;
|
|
10
|
+
export let height = '24px';
|
|
11
|
+
export let width = '24px';
|
|
17
12
|
</script>
|
|
18
13
|
|
|
19
14
|
<div class="flex flex-row gap-2">
|
|
20
15
|
{#if !after}
|
|
21
16
|
{name}
|
|
22
17
|
{/if}
|
|
23
|
-
{#if name === '
|
|
18
|
+
{#if name === 'postgresql'}
|
|
24
19
|
<PostgresIcon {height} {width} />
|
|
25
20
|
{:else if name === 'mysql'}
|
|
26
21
|
<Mysql {height} {width} />
|
|
27
|
-
{:else if name === '
|
|
22
|
+
{:else if name === 'smtp'}
|
|
28
23
|
<Mail {height} {width} />
|
|
29
24
|
{:else if name === 'mongodb'}
|
|
30
25
|
<DbIcon {height} {width} />
|
|
31
26
|
{:else if name === 'slack'}
|
|
32
27
|
<Slack {height} {width} />
|
|
28
|
+
{:else if name === 'github'}
|
|
29
|
+
<Icon data={faGithub} scale={1.4} />
|
|
33
30
|
{/if}
|
|
34
31
|
{#if after}
|
|
35
32
|
{name}
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
exports.openModal = void 0;
|
|
7
|
-
const utils_1 = require("$lib/utils");
|
|
8
|
-
const Switch_svelte_1 = __importDefault(require("./Switch.svelte"));
|
|
9
|
-
const svelte_1 = require("svelte");
|
|
10
|
-
const gen_1 = require("$lib/gen");
|
|
11
|
-
const dispatch = (0, svelte_1.createEventDispatcher)();
|
|
1
|
+
<script>import { sendUserToast } from '../utils';
|
|
2
|
+
import Switch from './Switch.svelte';
|
|
3
|
+
import { createEventDispatcher } from 'svelte';
|
|
4
|
+
import { UserService } from '../gen';
|
|
5
|
+
const dispatch = createEventDispatcher();
|
|
12
6
|
let valid = true;
|
|
13
7
|
let modal;
|
|
14
|
-
function openModal() {
|
|
8
|
+
export function openModal() {
|
|
15
9
|
modal.openModal();
|
|
16
10
|
}
|
|
17
|
-
exports.openModal = openModal;
|
|
18
11
|
let email;
|
|
19
12
|
let is_super_admin = false;
|
|
20
13
|
let password;
|
|
@@ -28,7 +21,7 @@ function handleKeyUp(event) {
|
|
|
28
21
|
}
|
|
29
22
|
}
|
|
30
23
|
async function addUser() {
|
|
31
|
-
await
|
|
24
|
+
await UserService.createUserGlobally({
|
|
32
25
|
requestBody: {
|
|
33
26
|
email,
|
|
34
27
|
password,
|
|
@@ -37,7 +30,7 @@ async function addUser() {
|
|
|
37
30
|
company
|
|
38
31
|
}
|
|
39
32
|
});
|
|
40
|
-
|
|
33
|
+
sendUserToast(`Successfully added ${email}. Welcome to them!`);
|
|
41
34
|
dispatch('new');
|
|
42
35
|
}
|
|
43
36
|
</script>
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const utils_1 = require("$lib/utils");
|
|
8
|
-
const Switch_svelte_1 = __importDefault(require("./Switch.svelte"));
|
|
9
|
-
const svelte_1 = require("svelte");
|
|
10
|
-
const stores_1 = require("$lib/stores");
|
|
11
|
-
const gen_1 = require("$lib/gen");
|
|
12
|
-
const dispatch = (0, svelte_1.createEventDispatcher)();
|
|
1
|
+
<script>import { sendUserToast } from '../utils';
|
|
2
|
+
import Switch from './Switch.svelte';
|
|
3
|
+
import { createEventDispatcher } from 'svelte';
|
|
4
|
+
import { workspaceStore } from '../stores';
|
|
5
|
+
import { WorkspaceService } from '../gen';
|
|
6
|
+
const dispatch = createEventDispatcher();
|
|
13
7
|
let valid = true;
|
|
14
8
|
let modal;
|
|
15
|
-
function openModal() {
|
|
9
|
+
export function openModal() {
|
|
16
10
|
modal.openModal();
|
|
17
11
|
}
|
|
18
|
-
exports.openModal = openModal;
|
|
19
12
|
let email;
|
|
20
13
|
let is_admin = false;
|
|
21
14
|
function handleKeyUp(event) {
|
|
@@ -26,14 +19,14 @@ function handleKeyUp(event) {
|
|
|
26
19
|
}
|
|
27
20
|
}
|
|
28
21
|
async function inviteUser() {
|
|
29
|
-
await
|
|
22
|
+
await WorkspaceService.inviteUser({
|
|
30
23
|
workspace: $workspaceStore,
|
|
31
24
|
requestBody: {
|
|
32
25
|
email,
|
|
33
26
|
is_admin
|
|
34
27
|
}
|
|
35
28
|
});
|
|
36
|
-
|
|
29
|
+
sendUserToast(`Successfully invited ${email}. Welcome to them!`);
|
|
37
30
|
dispatch('new');
|
|
38
31
|
}
|
|
39
32
|
</script>
|