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,28 +1,25 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const Modal_svelte_1 = __importDefault(require("./Modal.svelte"));
|
|
9
|
-
exports.closeOnClick = true;
|
|
1
|
+
<script>import Fuse from 'fuse.js';
|
|
2
|
+
import Modal from './Modal.svelte';
|
|
3
|
+
export let pickCallback;
|
|
4
|
+
export let loadItems;
|
|
5
|
+
export let extraField;
|
|
6
|
+
export let itemName;
|
|
7
|
+
export let closeOnClick = true;
|
|
10
8
|
let items = [];
|
|
11
9
|
let filteredItems = [];
|
|
12
10
|
let itemsFilter = '';
|
|
13
11
|
const fuseOptions = {
|
|
14
12
|
includeScore: false,
|
|
15
|
-
keys: ['path',
|
|
13
|
+
keys: ['path', extraField]
|
|
16
14
|
};
|
|
17
|
-
const fuse = new
|
|
18
|
-
function openModal() {
|
|
19
|
-
|
|
15
|
+
const fuse = new Fuse(items, fuseOptions);
|
|
16
|
+
export function openModal() {
|
|
17
|
+
loadItems().then((v) => {
|
|
20
18
|
items = v;
|
|
21
19
|
fuse.setCollection(items);
|
|
22
20
|
});
|
|
23
21
|
modal.openModal();
|
|
24
22
|
}
|
|
25
|
-
exports.openModal = openModal;
|
|
26
23
|
$: filteredItems =
|
|
27
24
|
itemsFilter.length > 0 ? fuse.search(itemsFilter).map((value) => value.item) : items;
|
|
28
25
|
let modal;
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.job = void 0;
|
|
7
|
-
const free_solid_svg_icons_1 = require("@fortawesome/free-solid-svg-icons");
|
|
8
|
-
const utils_1 = require("$lib/utils");
|
|
9
|
-
const svelte_awesome_1 = __importDefault(require("svelte-awesome"));
|
|
10
|
-
const icons_1 = require("svelte-awesome/icons");
|
|
1
|
+
<script>import { faCalendar, faCircle, faClock, faHourglassHalf, faTimes } from '@fortawesome/free-solid-svg-icons';
|
|
2
|
+
import { displayDate, forLater } from '../utils';
|
|
3
|
+
import Icon from 'svelte-awesome';
|
|
4
|
+
import { check } from 'svelte-awesome/icons';
|
|
11
5
|
const SMALL_ICON_SCALE = 0.7;
|
|
6
|
+
export let job;
|
|
12
7
|
</script>
|
|
13
8
|
|
|
14
9
|
{#if job && 'success' in job && job.success}
|
|
15
10
|
<Icon class="text-green-600" data={check} scale={SMALL_ICON_SCALE} />
|
|
16
|
-
<span class="mx-2">Succeeded</span>
|
|
11
|
+
<span class="mx-2">Succeeded {job.is_skipped ? '(Skipped)' : ''}</span>
|
|
17
12
|
<div>
|
|
18
13
|
<Icon class="text-gray-700" data={faHourglassHalf} scale={SMALL_ICON_SCALE} /><span class="mx-2"
|
|
19
14
|
>Job ran in {job.duration}
|
package/components/Modal.svelte
CHANGED
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function closeModal() {
|
|
9
|
-
exports.open = false;
|
|
1
|
+
<script>import { createEventDispatcher } from 'svelte';
|
|
2
|
+
export let open = false;
|
|
3
|
+
export let z = 'z-30';
|
|
4
|
+
const dispatch = createEventDispatcher();
|
|
5
|
+
export function closeModal() {
|
|
6
|
+
document.body.style.overflow = 'auto';
|
|
7
|
+
open = false;
|
|
10
8
|
dispatch('close');
|
|
11
9
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
export function openModal() {
|
|
11
|
+
document.body.style.overflow = 'hidden';
|
|
12
|
+
open = true;
|
|
15
13
|
dispatch('open');
|
|
16
14
|
}
|
|
17
|
-
exports.openModal = openModal;
|
|
18
15
|
function handleKeyUp(event) {
|
|
19
16
|
const key = event.key || event.keyCode;
|
|
20
17
|
if (key === 27 || key === 'Escape' || key === 'Esc') {
|
|
21
|
-
if (
|
|
18
|
+
if (open) {
|
|
22
19
|
event.preventDefault();
|
|
23
20
|
closeModal();
|
|
24
21
|
}
|
|
@@ -28,9 +25,9 @@ function handleKeyUp(event) {
|
|
|
28
25
|
|
|
29
26
|
<svelte:window on:keyup={handleKeyUp} />
|
|
30
27
|
|
|
31
|
-
<div class="blurred-background
|
|
28
|
+
<div class="blurred-background {open ? '' : 'hidden'}" />
|
|
32
29
|
|
|
33
|
-
<div class="fixed top-0 w-screen h-screen
|
|
30
|
+
<div class="fixed top-0 w-screen h-screen {open ? '' : 'hidden'} {z}">
|
|
34
31
|
<div
|
|
35
32
|
class="fixed right-0 flex flex-col w-3/4 sm:w-2/3 lg:w-1/2 h-screen border border-gray-300 shadow-xl"
|
|
36
33
|
>
|
|
@@ -95,5 +92,5 @@ function handleKeyUp(event) {
|
|
|
95
92
|
<style>
|
|
96
93
|
.blurred-background {
|
|
97
94
|
/* @apply absolute sm:top-6 lg:top-8 left-28 sm:left-40 md:left-48; */ /* If we wanted to make the navbars visible */ position: fixed; top: 0px; left: 0px; --tw-bg-opacity: 1; background-color: rgb(156 163 175 / var(--tw-bg-opacity)); opacity: 0.75; width: 100vw; height: 100vh;
|
|
98
|
-
z-index:
|
|
95
|
+
z-index: 10;
|
|
99
96
|
}</style>
|
|
@@ -1,69 +1,130 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
type: 'static',
|
|
23
|
-
value: ''
|
|
24
|
-
}));
|
|
25
|
-
exports.schemaForms[exports.i]?.setArgs(it);
|
|
26
|
-
}
|
|
27
|
-
exports.schemas[exports.i] = schema ?? (0, utils_1.emptySchema)();
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
exports.schemaForms[exports.i]?.setArgs({});
|
|
31
|
-
exports.schemas[exports.i] = (0, utils_1.emptySchema)();
|
|
32
|
-
}
|
|
33
|
-
exports.schemas = exports.schemas;
|
|
34
|
-
}
|
|
35
|
-
exports.loadSchema = loadSchema;
|
|
1
|
+
<script>import { FlowModuleValue } from '../gen';
|
|
2
|
+
import { addPreviewResult, previewResults } from '../stores';
|
|
3
|
+
import { buildExtraLib, objectToTsType, schemaToObject, schemaToTsType } from '../utils';
|
|
4
|
+
import { faRobot } from '@fortawesome/free-solid-svg-icons';
|
|
5
|
+
import Icon from 'svelte-awesome';
|
|
6
|
+
import Editor from './Editor.svelte';
|
|
7
|
+
import FlowPreview from './FlowPreview.svelte';
|
|
8
|
+
import FlowInputs from './flows/FlowInputs.svelte';
|
|
9
|
+
import FlowModuleHeader from './flows/FlowModuleHeader.svelte';
|
|
10
|
+
import { createInlineScriptModule, flowStore, loadSchema, pickScript, schemasStore } from './flows/flowStore';
|
|
11
|
+
import SchemaForm from './SchemaForm.svelte';
|
|
12
|
+
import Tooltip from './Tooltip.svelte';
|
|
13
|
+
export let open;
|
|
14
|
+
export let mode;
|
|
15
|
+
export let i;
|
|
16
|
+
export let mod;
|
|
17
|
+
export let args = {};
|
|
18
|
+
$: schema = $schemasStore[i];
|
|
19
|
+
$: shouldPick = mod.value.path === '' && mod.value.language === undefined;
|
|
20
|
+
$: previousSchema = i === 0 ? schemaToObject($flowStore?.schema) : $previewResults[i];
|
|
21
|
+
$: extraLib = buildExtraLib(i === 0 ? schemaToTsType($flowStore?.schema) : objectToTsType($previewResults[i]));
|
|
36
22
|
</script>
|
|
37
23
|
|
|
38
|
-
<li class="flex flex-row flex-shrink max-w-full
|
|
39
|
-
<div
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
24
|
+
<li class="flex flex-row flex-shrink max-w-full mx-auto mt-16">
|
|
25
|
+
<div
|
|
26
|
+
class="bg-white border border-gray xl-rounded shadow-lg w-full max-w-4xl mx-4 md:mx-auto"
|
|
27
|
+
id="module-{i}"
|
|
28
|
+
>
|
|
29
|
+
<div class="flex items-center justify-between flex-wra p-4 sm:px-6 z-10">
|
|
30
|
+
<FlowModuleHeader bind:open {mod} {i} {shouldPick}>
|
|
31
|
+
<div>
|
|
32
|
+
<h3 class="text-lg font-bold text-gray-900">Step {i + 1}</h3>
|
|
33
|
+
{#if i == 0 && mode == 'pull'}
|
|
34
|
+
<h3 class="font-bold">
|
|
35
|
+
Trigger Script <Tooltip
|
|
36
|
+
>When a flow is 'Pull', the first step is a trigger script. Trigger scripts are
|
|
37
|
+
scripts that must return a list which are the new items to be treated one by one by
|
|
38
|
+
the rest of the flow, usually the list of new items since last time the flow was
|
|
39
|
+
run. One can retrieve the item in the next step using `previous_result._value`. To
|
|
40
|
+
easily compute the diff, windmill provides some helpers under the form of
|
|
41
|
+
`getInternalState` and `setInternalState`.</Tooltip
|
|
42
|
+
>
|
|
43
|
+
</h3>{/if}
|
|
44
|
+
<p>
|
|
45
|
+
{#if mod.value.path}
|
|
46
|
+
{mod.value.path}
|
|
47
|
+
{/if}
|
|
48
|
+
{#if mod.value.language}
|
|
49
|
+
Inline {mod.value.language}
|
|
50
|
+
{/if}
|
|
51
|
+
{#if !mod.value.path && !mod.value.language}
|
|
52
|
+
Select a script
|
|
53
|
+
{/if}
|
|
54
|
+
</p>
|
|
55
|
+
</div>
|
|
56
|
+
</FlowModuleHeader>
|
|
67
57
|
</div>
|
|
58
|
+
<div class="border-b border-gray-200" />
|
|
59
|
+
{#if open == i}
|
|
60
|
+
<div class="p-6">
|
|
61
|
+
{#if shouldPick}
|
|
62
|
+
<FlowInputs
|
|
63
|
+
isTrigger={mode == 'pull' && i == 0}
|
|
64
|
+
on:pick={(e) => pickScript(e.detail.path, i)}
|
|
65
|
+
on:new={(e) => createInlineScriptModule(e.detail.language, i, mode)}
|
|
66
|
+
/>
|
|
67
|
+
{/if}
|
|
68
|
+
{#if mod.value.type === FlowModuleValue.type.RAWSCRIPT}
|
|
69
|
+
<Editor
|
|
70
|
+
class="h-80 border p-2 rounded"
|
|
71
|
+
bind:code={mod.value.content}
|
|
72
|
+
deno={mod.value.language === FlowModuleValue.language.DENO}
|
|
73
|
+
/>
|
|
74
|
+
<div class="mt-2 mb-8">
|
|
75
|
+
<button class="default-primary-button-v2" on:click={() => loadSchema(i)}>
|
|
76
|
+
<Icon data={faRobot} class="w-4 h-4 mr-2 -ml-2" />
|
|
77
|
+
|
|
78
|
+
Infer step inputs from code
|
|
79
|
+
</button>
|
|
80
|
+
</div>
|
|
81
|
+
{/if}
|
|
82
|
+
{#if !shouldPick}
|
|
83
|
+
<p class="text-lg font-bold text-gray-900 mb-2">Step inputs</p>
|
|
84
|
+
<SchemaForm
|
|
85
|
+
inputTransform={true}
|
|
86
|
+
{schema}
|
|
87
|
+
{extraLib}
|
|
88
|
+
{i}
|
|
89
|
+
{previousSchema}
|
|
90
|
+
bind:args={mod.input_transform}
|
|
91
|
+
/>
|
|
92
|
+
{/if}
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
{#if !shouldPick}
|
|
96
|
+
<div class="border-b border-gray-200" />
|
|
97
|
+
<div class="p-3">
|
|
98
|
+
<FlowPreview
|
|
99
|
+
bind:args
|
|
100
|
+
flow={$flowStore}
|
|
101
|
+
{i}
|
|
102
|
+
{mode}
|
|
103
|
+
schemas={$schemasStore}
|
|
104
|
+
on:change={(e) => {
|
|
105
|
+
addPreviewResult(e.detail.result, i + 1)
|
|
106
|
+
}}
|
|
107
|
+
/>
|
|
108
|
+
</div>
|
|
109
|
+
<div>
|
|
110
|
+
<button class="w-full h-full" on:click={() => (open = -1)}>(-)</button>
|
|
111
|
+
</div>
|
|
112
|
+
{:else}
|
|
113
|
+
<div>
|
|
114
|
+
<button class="w-full h-full" on:click={() => (open = i)}>(+)</button>
|
|
115
|
+
</div>
|
|
116
|
+
{/if}
|
|
117
|
+
{/if}
|
|
68
118
|
</div>
|
|
69
119
|
</li>
|
|
120
|
+
{#if i == 0 && mode == 'pull'}
|
|
121
|
+
<li class="relative m-20 ">
|
|
122
|
+
<div class="relative flex justify-center bg-white shadow p-2">
|
|
123
|
+
Starting from here, the flow for loop over items from step 1's result above <Tooltip
|
|
124
|
+
>This flow being in 'Pull' mode, the rest of the flow will for loop over the list of items
|
|
125
|
+
returned by the trigger script right above. Retrieve the item value using
|
|
126
|
+
`previous_result._value`</Tooltip
|
|
127
|
+
>
|
|
128
|
+
</div>
|
|
129
|
+
</li>
|
|
130
|
+
{/if}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type
|
|
3
|
-
import
|
|
4
|
-
import SchemaForm from './SchemaForm.svelte';
|
|
2
|
+
import { type FlowModule } from '../gen';
|
|
3
|
+
import { type FlowMode } from './flows/flowStore';
|
|
5
4
|
declare const __propDef: {
|
|
6
5
|
props: {
|
|
7
|
-
|
|
6
|
+
open: number;
|
|
7
|
+
mode: FlowMode;
|
|
8
8
|
i: number;
|
|
9
9
|
mod: FlowModule;
|
|
10
10
|
args?: Record<string, any> | undefined;
|
|
11
|
-
schemas?: Schema[] | undefined;
|
|
12
|
-
schemaForms?: (SchemaForm | undefined)[] | undefined;
|
|
13
|
-
loadSchema?: (() => Promise<void>) | undefined;
|
|
14
11
|
};
|
|
15
12
|
events: {
|
|
16
13
|
[evt: string]: CustomEvent<any>;
|
|
@@ -21,6 +18,5 @@ export declare type ModuleStepProps = typeof __propDef.props;
|
|
|
21
18
|
export declare type ModuleStepEvents = typeof __propDef.events;
|
|
22
19
|
export declare type ModuleStepSlots = typeof __propDef.slots;
|
|
23
20
|
export default class ModuleStep extends SvelteComponentTyped<ModuleStepProps, ModuleStepEvents, ModuleStepSlots> {
|
|
24
|
-
get loadSchema(): () => Promise<void>;
|
|
25
21
|
}
|
|
26
22
|
export {};
|
|
@@ -1,40 +1,35 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const ResourcePicker_svelte_1 = __importDefault(require("./ResourcePicker.svelte"));
|
|
9
|
-
const stores_1 = require("$lib/stores");
|
|
10
|
-
const SchemaForm_svelte_1 = __importDefault(require("./SchemaForm.svelte"));
|
|
11
|
-
const RadioButton_svelte_1 = __importDefault(require("./RadioButton.svelte"));
|
|
1
|
+
<script>import { ResourceService } from '../gen';
|
|
2
|
+
import ResourcePicker from './ResourcePicker.svelte';
|
|
3
|
+
import { workspaceStore } from '../stores';
|
|
4
|
+
import SchemaForm from './SchemaForm.svelte';
|
|
5
|
+
import RadioButton from './RadioButton.svelte';
|
|
6
|
+
export let format;
|
|
7
|
+
export let value;
|
|
12
8
|
function isString(value) {
|
|
13
9
|
return typeof value === 'string' || value instanceof String;
|
|
14
10
|
}
|
|
15
|
-
let path = isString(
|
|
11
|
+
let path = isString(value) && value.length >= '$res:'.length ? value.substr('$res:'.length) : undefined;
|
|
16
12
|
let args = {};
|
|
17
|
-
if (!isString(
|
|
18
|
-
|
|
19
|
-
args = exports.value;
|
|
13
|
+
if (!isString(value) && value) {
|
|
14
|
+
args = value;
|
|
20
15
|
}
|
|
21
16
|
let schema = undefined;
|
|
22
17
|
let isValid = true;
|
|
23
18
|
let resourceTypeName = '';
|
|
24
19
|
async function loadSchema(format) {
|
|
25
20
|
resourceTypeName = format.substring('resource-'.length);
|
|
26
|
-
schema = (await
|
|
21
|
+
schema = (await ResourceService.getResourceType({ workspace: $workspaceStore, path: resourceTypeName })).schema;
|
|
27
22
|
}
|
|
28
|
-
let option = isString(
|
|
23
|
+
let option = isString(value) || value == undefined ? 'resource' : 'raw';
|
|
29
24
|
$: {
|
|
30
25
|
if (option == 'resource') {
|
|
31
|
-
|
|
26
|
+
value = `$res:${path}`;
|
|
32
27
|
}
|
|
33
28
|
else {
|
|
34
|
-
|
|
29
|
+
value = args;
|
|
35
30
|
}
|
|
36
31
|
}
|
|
37
|
-
$:
|
|
32
|
+
$: format.startsWith('resource-') && loadSchema(format);
|
|
38
33
|
</script>
|
|
39
34
|
|
|
40
35
|
<div class="max-w-lg">
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const RadioButton_svelte_1 = __importDefault(require("./RadioButton.svelte"));
|
|
8
|
-
const ResourceTypePicker_svelte_1 = __importDefault(require("./ResourceTypePicker.svelte"));
|
|
9
|
-
let kind = exports.format?.startsWith('resource') ? 'resource' : 'none';
|
|
10
|
-
let resource = exports.format?.startsWith('resource-')
|
|
11
|
-
? exports.format.substring('resource-'.length)
|
|
1
|
+
<script>import RadioButton from './RadioButton.svelte';
|
|
2
|
+
import ResourceTypePicker from './ResourceTypePicker.svelte';
|
|
3
|
+
export let format;
|
|
4
|
+
let kind = format?.startsWith('resource') ? 'resource' : 'none';
|
|
5
|
+
let resource = format?.startsWith('resource-')
|
|
6
|
+
? format.substring('resource-'.length)
|
|
12
7
|
: undefined;
|
|
13
|
-
$:
|
|
8
|
+
$: format =
|
|
14
9
|
kind == 'resource' ? (resource != undefined ? `resource-${resource}` : 'resource') : undefined;
|
|
15
10
|
</script>
|
|
16
11
|
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.primary = exports.tooltip = exports.title = void 0;
|
|
7
|
-
const Tooltip_svelte_1 = __importDefault(require("./Tooltip.svelte"));
|
|
8
|
-
exports.tooltip = '';
|
|
9
|
-
exports.primary = true;
|
|
1
|
+
<script>import Tooltip from './Tooltip.svelte';
|
|
2
|
+
export let title;
|
|
3
|
+
export let tooltip = '';
|
|
4
|
+
export let primary = true;
|
|
10
5
|
</script>
|
|
11
6
|
|
|
12
7
|
<div class="flex flex-col sm:flex-row justify-between mt-4 mb-2">
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.placeholder = '******';
|
|
8
|
-
(0, svelte_1.onMount)(() => {
|
|
1
|
+
<script>// @ts-nocheck
|
|
2
|
+
import { onMount } from 'svelte';
|
|
3
|
+
export let password;
|
|
4
|
+
export let label = 'password';
|
|
5
|
+
export let placeholder = '******';
|
|
6
|
+
onMount(() => {
|
|
9
7
|
const passwordToggle = document.querySelector('.js-password-toggle');
|
|
10
8
|
if (passwordToggle) {
|
|
11
9
|
passwordToggle.addEventListener('change', function () {
|
package/components/Path.svelte
CHANGED
|
@@ -1,59 +1,99 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const Tooltip_svelte_1 = __importDefault(require("./Tooltip.svelte"));
|
|
10
|
-
const stores_1 = require("$lib/stores");
|
|
11
|
-
const utils_1 = require("$lib/utils");
|
|
12
|
-
exports.meta = {
|
|
1
|
+
<script>import { pathToMeta } from '../common';
|
|
2
|
+
import { FlowService, ResourceService, ScheduleService, ScriptService, VariableService } from '../gen';
|
|
3
|
+
import { GroupService } from '../gen';
|
|
4
|
+
import Tooltip from './Tooltip.svelte';
|
|
5
|
+
import { userStore, workspaceStore } from '../stores';
|
|
6
|
+
import { sleep } from '../utils';
|
|
7
|
+
import { workspace } from 'vscode';
|
|
8
|
+
export let meta = {
|
|
13
9
|
ownerKind: 'user',
|
|
14
10
|
owner: '',
|
|
15
11
|
name: ''
|
|
16
12
|
};
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
export let namePlaceholder = '';
|
|
14
|
+
export let initialPath;
|
|
15
|
+
export let path = '';
|
|
16
|
+
export let error = '';
|
|
17
|
+
export let kind;
|
|
19
18
|
let groups = [];
|
|
20
|
-
let error = '';
|
|
21
19
|
$: {
|
|
22
|
-
|
|
20
|
+
path = [meta.ownerKind === 'group' ? 'g' : 'u', meta.owner, meta.name].join('/');
|
|
23
21
|
}
|
|
24
|
-
function getPath() {
|
|
25
|
-
return
|
|
22
|
+
export function getPath() {
|
|
23
|
+
return path;
|
|
26
24
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
exports.meta.ownerKind = 'user';
|
|
25
|
+
export async function reset() {
|
|
26
|
+
if (path == '' || path == 'u//') {
|
|
27
|
+
meta.ownerKind = 'user';
|
|
31
28
|
while ($userStore == undefined) {
|
|
32
|
-
await
|
|
29
|
+
await sleep(500);
|
|
33
30
|
}
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
meta.owner = $userStore.username;
|
|
32
|
+
meta.name = '';
|
|
36
33
|
}
|
|
37
34
|
else {
|
|
38
|
-
|
|
35
|
+
meta = pathToMeta(path);
|
|
39
36
|
}
|
|
40
37
|
}
|
|
41
|
-
|
|
42
|
-
$: validateName(exports.meta);
|
|
38
|
+
$: validate(meta, path, kind);
|
|
43
39
|
async function loadGroups() {
|
|
44
|
-
groups = await
|
|
40
|
+
groups = await GroupService.listGroups({ workspace: $workspaceStore });
|
|
41
|
+
meta.owner = meta.owner;
|
|
42
|
+
}
|
|
43
|
+
async function validate(meta, path, kind) {
|
|
44
|
+
validateName(meta) && (await validatePath(path, kind));
|
|
45
|
+
}
|
|
46
|
+
let validateTimeout = undefined;
|
|
47
|
+
async function validatePath(path, kind) {
|
|
48
|
+
if (initialPath != '' && initialPath != path) {
|
|
49
|
+
if (validateTimeout) {
|
|
50
|
+
clearTimeout(validateTimeout);
|
|
51
|
+
}
|
|
52
|
+
validateTimeout = setTimeout(async () => {
|
|
53
|
+
if (initialPath != '' &&
|
|
54
|
+
initialPath != path &&
|
|
55
|
+
((kind == 'flow' &&
|
|
56
|
+
(await FlowService.existsFlowByPath({ workspace: $workspaceStore, path: path }))) ||
|
|
57
|
+
(kind == 'script' &&
|
|
58
|
+
(await ScriptService.existsScriptByPath({
|
|
59
|
+
workspace: $workspaceStore,
|
|
60
|
+
path: path
|
|
61
|
+
}))) ||
|
|
62
|
+
(kind == 'resource' &&
|
|
63
|
+
(await ResourceService.existsResource({
|
|
64
|
+
workspace: $workspaceStore,
|
|
65
|
+
path: path
|
|
66
|
+
}))) ||
|
|
67
|
+
(kind == 'variable' &&
|
|
68
|
+
(await VariableService.existsVariable({
|
|
69
|
+
workspace: $workspaceStore,
|
|
70
|
+
path: path
|
|
71
|
+
}))) ||
|
|
72
|
+
(kind == 'schedule' &&
|
|
73
|
+
(await ScheduleService.existsSchedule({ workspace: $workspaceStore, path: path }))))) {
|
|
74
|
+
error = 'path already used';
|
|
75
|
+
}
|
|
76
|
+
else if (validateName(meta)) {
|
|
77
|
+
error = '';
|
|
78
|
+
}
|
|
79
|
+
validateTimeout = undefined;
|
|
80
|
+
}, 500);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
error = '';
|
|
84
|
+
}
|
|
45
85
|
}
|
|
46
86
|
function validateName(meta) {
|
|
47
87
|
if (meta.name == undefined || meta.name == '') {
|
|
48
88
|
error = 'choose a name';
|
|
49
|
-
return;
|
|
89
|
+
return false;
|
|
50
90
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
91
|
+
else if (!/^[\w-]+(\/[\w-]+)*$/.test(meta.name)) {
|
|
92
|
+
error = 'This name is not valid.';
|
|
93
|
+
return false;
|
|
54
94
|
}
|
|
55
95
|
else {
|
|
56
|
-
|
|
96
|
+
return true;
|
|
57
97
|
}
|
|
58
98
|
}
|
|
59
99
|
$: {
|
|
@@ -62,11 +102,11 @@ $: {
|
|
|
62
102
|
}
|
|
63
103
|
}
|
|
64
104
|
$: {
|
|
65
|
-
if (
|
|
105
|
+
if (initialPath == undefined || initialPath == '') {
|
|
66
106
|
reset();
|
|
67
107
|
}
|
|
68
108
|
else {
|
|
69
|
-
|
|
109
|
+
meta = pathToMeta(initialPath);
|
|
70
110
|
}
|
|
71
111
|
}
|
|
72
112
|
</script>
|
|
@@ -74,8 +114,8 @@ $: {
|
|
|
74
114
|
<div>
|
|
75
115
|
<div class="flex flex-col sm:grid sm:grid-cols-4 sm:gap-4 pb-0 mb-1">
|
|
76
116
|
<label class="block">
|
|
77
|
-
<span class="text-gray-700 text-sm">
|
|
78
|
-
Owner Kind<Tooltip
|
|
117
|
+
<span class="text-gray-700 text-sm whitespace-nowrap">
|
|
118
|
+
Owner Kind <Tooltip>
|
|
79
119
|
<slot name="ownerToolkit" />
|
|
80
120
|
</Tooltip>
|
|
81
121
|
</span>
|
|
@@ -6,6 +6,8 @@ declare const __propDef: {
|
|
|
6
6
|
namePlaceholder?: string | undefined;
|
|
7
7
|
initialPath: string;
|
|
8
8
|
path?: string | undefined;
|
|
9
|
+
error?: string | undefined;
|
|
10
|
+
kind: "resource" | "script" | "schedule" | "variable" | "flow";
|
|
9
11
|
getPath?: (() => string) | undefined;
|
|
10
12
|
reset?: (() => Promise<void>) | undefined;
|
|
11
13
|
};
|