windmill-components 1.22.42 → 1.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AppConnect.svelte +93 -47
- package/components/AppConnect.svelte.d.ts +2 -2
- package/components/ArgInfo.svelte +0 -5
- package/components/ArgInput.svelte +91 -64
- package/components/ArgInput.svelte.d.ts +8 -3
- package/components/Button.svelte +4 -4
- package/components/CenteredPage.svelte +1 -1
- package/components/CollapseLink.svelte +12 -0
- package/components/CollapseLink.svelte.d.ts +19 -0
- package/components/CronInput.svelte +84 -0
- package/components/CronInput.svelte.d.ts +18 -0
- package/components/DisplayResult.svelte +23 -7
- package/components/Editor.svelte +136 -66
- package/components/Editor.svelte.d.ts +2 -0
- package/components/EditorBar.svelte +56 -45
- package/components/FlowBuilder.svelte +150 -71
- package/components/FlowEditor.svelte +75 -200
- package/components/FlowEditor.svelte.d.ts +3 -2
- package/components/FlowJobResult.svelte +1 -1
- package/components/FlowPreview.svelte +18 -24
- package/components/FlowPreviewContent.svelte +68 -0
- package/components/FlowPreviewContent.svelte.d.ts +21 -0
- package/components/FlowStatusViewer.svelte +85 -37
- package/components/FlowStatusViewer.svelte.d.ts +3 -2
- package/components/FlowViewer.svelte +77 -45
- package/components/FlowViewer.svelte.d.ts +1 -1
- package/components/IconedResourceType.svelte +30 -5
- package/components/InputTransformForm.svelte +209 -0
- package/components/InputTransformForm.svelte.d.ts +26 -0
- package/components/InviteGlobalUser.svelte +2 -2
- package/components/InviteUser.svelte +2 -2
- package/components/JobStatus.svelte +32 -25
- package/components/Modal.svelte +44 -42
- package/components/ModuleStep.svelte +94 -79
- package/components/ObjectResourceInput.svelte +58 -38
- package/components/ObjectTypeNarrowing.svelte +4 -19
- package/components/Path.svelte +1 -0
- package/components/Path.svelte.d.ts +1 -1
- package/components/RadioButton.svelte +11 -96
- package/components/RadioButton.svelte.d.ts +4 -2
- package/components/ResourceEditor.svelte +4 -5
- package/components/ResourceEditor.svelte.d.ts +2 -2
- package/components/ResourcePicker.svelte +25 -2
- package/components/ResourcePicker.svelte.d.ts +3 -0
- package/components/ResourceTypePicker.svelte +17 -29
- package/components/ResourceTypePicker.svelte.d.ts +1 -0
- package/components/RunForm.svelte +14 -15
- package/components/RunForm.svelte.d.ts +1 -1
- package/components/SchemaEditor.svelte +87 -71
- package/components/SchemaEditor.svelte.d.ts +2 -0
- package/components/SchemaEditorProperty.svelte +11 -0
- package/components/SchemaEditorProperty.svelte.d.ts +17 -0
- package/components/SchemaForm.svelte +21 -127
- package/components/SchemaForm.svelte.d.ts +3 -4
- package/components/SchemaModal.svelte +20 -33
- package/components/SchemaModal.svelte.d.ts +1 -1
- package/components/SchemaViewer.svelte +4 -6
- package/components/ScriptBuilder.svelte +40 -43
- package/components/ScriptEditor.svelte +71 -66
- package/components/ScriptPicker.svelte +10 -12
- package/components/ScriptPicker.svelte.d.ts +1 -1
- package/components/ScriptSchema.svelte +0 -5
- package/components/ShareModal.svelte +1 -1
- package/components/SharedBadge.svelte +12 -10
- package/components/StringTypeNarrowing.svelte +8 -4
- package/components/StringTypeNarrowing.svelte.d.ts +1 -0
- package/components/TableCustom.svelte +7 -9
- package/components/TableSimple.svelte +1 -1
- package/components/Toggle.svelte +8 -10
- package/components/Toggle.svelte.d.ts +5 -11
- package/components/Tooltip.svelte +3 -2
- package/components/VariableEditor.svelte +21 -6
- package/components/flows/CopyFirstStepSchema.svelte +7 -5
- package/components/flows/DynamicInputHelpBox.svelte +1 -1
- package/components/flows/FlowBox.svelte +3 -0
- package/components/flows/FlowBox.svelte.d.ts +23 -0
- package/components/flows/FlowBoxHeader.svelte +9 -0
- package/components/flows/FlowBoxHeader.svelte.d.ts +18 -0
- package/components/flows/FlowInput.svelte +20 -0
- package/components/flows/FlowInput.svelte.d.ts +14 -0
- package/components/flows/FlowInputs.svelte +7 -3
- package/components/flows/FlowModuleHeader.svelte +42 -40
- package/components/flows/FlowModuleHeader.svelte.d.ts +1 -1
- package/components/flows/FlowSettings.svelte +174 -0
- package/components/flows/FlowSettings.svelte.d.ts +21 -0
- package/components/flows/flowStore.d.ts +5 -2
- package/components/flows/flowStore.js +65 -9
- package/components/flows/pickers/FlowScriptPicker.svelte +6 -1
- package/components/flows/pickers/FlowScriptPicker.svelte.d.ts +1 -0
- package/components/flows/utils.d.ts +11 -7
- package/components/flows/utils.js +104 -43
- package/components/icons/AirtableIcon.svelte +17 -0
- package/components/icons/AirtableIcon.svelte.d.ts +17 -0
- package/components/icons/GCloudIcon.svelte +16 -0
- package/components/icons/GCloudIcon.svelte.d.ts +17 -0
- package/components/icons/GItlabIcon.svelte +16 -0
- package/components/icons/GItlabIcon.svelte.d.ts +17 -0
- package/components/icons/GSheetsIcon.svelte +16 -0
- package/components/icons/GSheetsIcon.svelte.d.ts +17 -0
- package/components/icons/GcalIcon.svelte +16 -0
- package/components/icons/GcalIcon.svelte.d.ts +17 -0
- package/components/icons/GdriveIcon.svelte +16 -0
- package/components/icons/GdriveIcon.svelte.d.ts +17 -0
- package/components/icons/GmailIcon.svelte +16 -0
- package/components/icons/GmailIcon.svelte.d.ts +17 -0
- package/components/icons/PostgresIcon.svelte +8 -49
- package/components/icons/Slack.svelte +9 -18
- package/components/icons/TogglIcon.svelte +59 -0
- package/components/icons/TogglIcon.svelte.d.ts +17 -0
- package/components/propertyPicker/ObjectViewer.svelte +35 -37
- package/components/propertyPicker/ObjectViewer.svelte.d.ts +1 -0
- package/components/propertyPicker/OverlayPropertyPicker.svelte +53 -53
- package/components/propertyPicker/OverlayPropertyPicker.svelte.d.ts +5 -2
- package/components/propertyPicker/PropPicker.svelte +13 -15
- package/components/propertyPicker/PropPicker.svelte.d.ts +1 -1
- package/components/propertyPicker/WarningMessage.svelte +14 -41
- package/components/propertyPicker/WarningMessage.svelte.d.ts +11 -8
- package/components/propertyPicker/utils.d.ts +1 -0
- package/components/propertyPicker/utils.js +25 -0
- package/gen/core/OpenAPI.js +1 -1
- package/gen/index.d.ts +11 -2
- package/gen/index.js +1 -2
- package/gen/models/CompletedJob.d.ts +1 -1
- package/gen/models/Flow.d.ts +3 -13
- package/gen/models/FlowMetadata.d.ts +9 -0
- package/gen/models/FlowMetadata.js +4 -0
- package/gen/models/FlowModuleValue.d.ts +5 -22
- package/gen/models/FlowModuleValue.js +1 -15
- package/gen/models/ForloopFlow.d.ts +8 -0
- package/gen/models/ForloopFlow.js +4 -0
- package/gen/models/InputTransform.d.ts +3 -12
- package/gen/models/InputTransform.js +1 -8
- package/gen/models/JavascriptTransform.d.ts +4 -0
- package/gen/models/JavascriptTransform.js +4 -0
- package/gen/models/MainArgSignature.d.ts +1 -1
- package/gen/models/NewSchedule.d.ts +1 -0
- package/gen/models/OpenFlowWPath.d.ts +4 -0
- package/gen/models/OpenFlowWPath.js +4 -0
- package/gen/models/PathFlow.d.ts +4 -0
- package/gen/models/PathFlow.js +4 -0
- package/gen/models/PathScript.d.ts +4 -0
- package/gen/models/PathScript.js +4 -0
- package/gen/models/RawScript.d.ts +12 -0
- package/gen/models/RawScript.js +11 -0
- package/gen/models/Schedule.d.ts +1 -1
- package/gen/models/StaticTransform.d.ts +4 -0
- package/gen/models/StaticTransform.js +4 -0
- package/gen/models/TokenResponse.d.ts +3 -3
- package/gen/models/Usage.d.ts +5 -0
- package/gen/models/Usage.js +4 -0
- package/gen/models/User.d.ts +2 -0
- package/gen/schemas/$AuditLog.d.ts +32 -0
- package/gen/schemas/$AuditLog.js +35 -0
- package/gen/schemas/$CompletedJob.d.ts +98 -0
- package/gen/schemas/$CompletedJob.js +103 -0
- package/gen/schemas/$ContextualVariable.d.ts +16 -0
- package/gen/schemas/$ContextualVariable.js +19 -0
- package/gen/schemas/$CreateResource.d.ts +22 -0
- package/gen/schemas/$CreateResource.js +25 -0
- package/gen/schemas/$CreateVariable.d.ts +26 -0
- package/gen/schemas/$CreateVariable.js +29 -0
- package/gen/schemas/$CreateWorkspace.d.ts +20 -0
- package/gen/schemas/$CreateWorkspace.js +23 -0
- package/gen/schemas/$EditResource.d.ts +13 -0
- package/gen/schemas/$EditResource.js +16 -0
- package/gen/schemas/$EditResourceType.d.ts +10 -0
- package/gen/schemas/$EditResourceType.js +13 -0
- package/gen/schemas/$EditSchedule.d.ts +20 -0
- package/gen/schemas/$EditSchedule.js +23 -0
- package/gen/schemas/$EditVariable.d.ts +16 -0
- package/gen/schemas/$EditVariable.js +19 -0
- package/gen/schemas/$EditWorkspaceUser.d.ts +7 -0
- package/gen/schemas/$EditWorkspaceUser.js +10 -0
- package/gen/schemas/$Flow.d.ts +23 -0
- package/gen/schemas/$Flow.js +26 -0
- package/gen/schemas/$FlowMetadata.d.ts +31 -0
- package/gen/schemas/$FlowMetadata.js +34 -0
- package/gen/schemas/$FlowPreview.d.ts +80 -0
- package/gen/schemas/$FlowPreview.js +83 -0
- package/gen/schemas/$GlobalUserInfo.d.ts +26 -0
- package/gen/schemas/$GlobalUserInfo.js +29 -0
- package/gen/schemas/$Group.d.ts +23 -0
- package/gen/schemas/$Group.js +26 -0
- package/gen/schemas/$Job.d.ts +17 -0
- package/gen/schemas/$Job.js +20 -0
- package/gen/schemas/$ListableVariable.d.ts +35 -0
- package/gen/schemas/$ListableVariable.js +38 -0
- package/gen/schemas/$Login.d.ts +12 -0
- package/gen/schemas/$Login.js +15 -0
- package/gen/schemas/$MainArgSignature.d.ts +50 -0
- package/gen/schemas/$MainArgSignature.js +53 -0
- package/gen/schemas/$NewSchedule.d.ts +30 -0
- package/gen/schemas/$NewSchedule.js +33 -0
- package/gen/schemas/$NewToken.d.ts +11 -0
- package/gen/schemas/$NewToken.js +14 -0
- package/gen/schemas/$NewUser.d.ts +16 -0
- package/gen/schemas/$NewUser.js +19 -0
- package/gen/schemas/$Preview.d.ts +19 -0
- package/gen/schemas/$Preview.js +22 -0
- package/gen/schemas/$QueuedJob.d.ts +139 -0
- package/gen/schemas/$QueuedJob.js +144 -0
- package/gen/schemas/$Resource.d.ts +31 -0
- package/gen/schemas/$Resource.js +34 -0
- package/gen/schemas/$ResourceType.d.ts +17 -0
- package/gen/schemas/$ResourceType.js +20 -0
- package/gen/schemas/$Schedule.d.ts +47 -0
- package/gen/schemas/$Schedule.js +50 -0
- package/gen/schemas/$Script.d.ts +77 -0
- package/gen/schemas/$Script.js +80 -0
- package/gen/schemas/$ScriptArgs.d.ts +6 -0
- package/gen/schemas/$ScriptArgs.js +9 -0
- package/gen/schemas/$SlackToken.d.ts +24 -0
- package/gen/schemas/$SlackToken.js +27 -0
- package/gen/schemas/$TokenResponse.d.ts +23 -0
- package/gen/schemas/$TokenResponse.js +26 -0
- package/gen/schemas/$TruncatedToken.d.ts +25 -0
- package/gen/schemas/$TruncatedToken.js +28 -0
- package/gen/schemas/$Usage.d.ts +13 -0
- package/gen/schemas/$Usage.js +16 -0
- package/gen/schemas/$User.d.ts +42 -0
- package/gen/schemas/$User.js +45 -0
- package/gen/schemas/$UserWorkspaceList.d.ts +28 -0
- package/gen/schemas/$UserWorkspaceList.js +31 -0
- package/gen/schemas/$WorkerPing.d.ts +31 -0
- package/gen/schemas/$WorkerPing.js +34 -0
- package/gen/schemas/$Workspace.d.ts +19 -0
- package/gen/schemas/$Workspace.js +22 -0
- package/gen/schemas/$WorkspaceInvite.d.ts +16 -0
- package/gen/schemas/$WorkspaceInvite.js +19 -0
- package/gen/services/FlowService.d.ts +24 -23
- package/gen/services/FlowService.js +14 -0
- package/gen/services/JobService.d.ts +1 -1
- package/gen/services/ScriptService.d.ts +13 -19
- package/gen/services/ScriptService.js +0 -14
- package/gen/services/WorkspaceService.d.ts +1 -1
- package/gen/services/WorkspaceService.js +1 -1
- package/infer.js +8 -1
- package/package.json +83 -15
- package/script_helpers.d.ts +1 -1
- package/script_helpers.js +7 -6
- package/sql.d.ts +89 -0
- package/sql.js +817 -0
- package/stores.d.ts +0 -1
- package/stores.js +0 -6
- package/utils.d.ts +12 -5
- package/utils.js +55 -9
- package/components/RadioButtonV2.svelte +0 -33
- package/components/RadioButtonV2.svelte.d.ts +0 -20
|
@@ -1,61 +1,81 @@
|
|
|
1
1
|
<script>import { ResourceService } from '../gen';
|
|
2
|
-
import ResourcePicker from './ResourcePicker.svelte';
|
|
3
2
|
import { workspaceStore } from '../stores';
|
|
4
|
-
import SchemaForm from './SchemaForm.svelte';
|
|
5
3
|
import RadioButton from './RadioButton.svelte';
|
|
4
|
+
import ResourcePicker from './ResourcePicker.svelte';
|
|
5
|
+
import SchemaForm from './SchemaForm.svelte';
|
|
6
6
|
export let format;
|
|
7
7
|
export let value;
|
|
8
8
|
function isString(value) {
|
|
9
9
|
return typeof value === 'string' || value instanceof String;
|
|
10
10
|
}
|
|
11
|
-
let path =
|
|
11
|
+
let path = '';
|
|
12
12
|
let args = {};
|
|
13
|
-
if (!isString(value) && value) {
|
|
14
|
-
args = value;
|
|
15
|
-
}
|
|
16
13
|
let schema = undefined;
|
|
17
14
|
let isValid = true;
|
|
18
15
|
let resourceTypeName = '';
|
|
16
|
+
let option = isString(value) || value == undefined ? 'resource' : 'raw';
|
|
17
|
+
$: format.startsWith('resource-') && loadSchema(format);
|
|
19
18
|
async function loadSchema(format) {
|
|
20
19
|
resourceTypeName = format.substring('resource-'.length);
|
|
21
20
|
schema = (await ResourceService.getResourceType({ workspace: $workspaceStore, path: resourceTypeName })).schema;
|
|
22
21
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
function argToValue() {
|
|
23
|
+
value = args;
|
|
24
|
+
}
|
|
25
|
+
function resourceToValue() {
|
|
26
|
+
value = `$res:${path}`;
|
|
27
|
+
}
|
|
28
|
+
function isResource() {
|
|
29
|
+
return isString(value) && value.length >= '$res:'.length;
|
|
30
|
+
}
|
|
31
|
+
function valueToPath() {
|
|
32
|
+
if (!isString(value) && value) {
|
|
33
|
+
args = value;
|
|
34
|
+
}
|
|
35
|
+
if (isResource()) {
|
|
36
|
+
path = value.substr('$res:'.length);
|
|
27
37
|
}
|
|
28
|
-
else {
|
|
29
|
-
|
|
38
|
+
else if (value !== undefined && value !== '') {
|
|
39
|
+
option = 'raw';
|
|
30
40
|
}
|
|
31
41
|
}
|
|
32
|
-
$:
|
|
42
|
+
$: value && valueToPath();
|
|
33
43
|
</script>
|
|
34
44
|
|
|
35
|
-
<div class="
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
[
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
45
|
+
<div class="flex flex-row w-full gap-2">
|
|
46
|
+
<div class="shrink w-40">
|
|
47
|
+
<RadioButton
|
|
48
|
+
options={[
|
|
49
|
+
[`Resource (${resourceTypeName})`, 'resource'],
|
|
50
|
+
[`Raw object value`, 'raw']
|
|
51
|
+
]}
|
|
52
|
+
on:change={argToValue}
|
|
53
|
+
bind:value={option}
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="grow">
|
|
57
|
+
{#if option == 'resource'}
|
|
58
|
+
<ResourcePicker
|
|
59
|
+
on:refresh={() => loadSchema(format)}
|
|
60
|
+
on:change={(e) => {
|
|
61
|
+
path = e.detail
|
|
62
|
+
resourceToValue()
|
|
63
|
+
}}
|
|
64
|
+
bind:value={path}
|
|
65
|
+
resourceType={format.split('-').length > 1
|
|
66
|
+
? format.substring('resource-'.length)
|
|
67
|
+
: undefined}
|
|
68
|
+
/>
|
|
69
|
+
{:else}
|
|
70
|
+
<div class="border rounded p-5 w-full">
|
|
71
|
+
<h2 class="mb-5">
|
|
72
|
+
Object of <a target="_blank" href="/resources">resource type</a>
|
|
73
|
+
{resourceTypeName}
|
|
74
|
+
</h2>
|
|
75
|
+
{#if !isString(args)}
|
|
76
|
+
<SchemaForm {schema} bind:isValid bind:args />
|
|
77
|
+
{/if}
|
|
78
|
+
</div>
|
|
59
79
|
{/if}
|
|
60
80
|
</div>
|
|
61
|
-
|
|
81
|
+
</div>
|
|
@@ -1,25 +1,10 @@
|
|
|
1
|
-
<script>import
|
|
2
|
-
import ResourceTypePicker from './ResourceTypePicker.svelte';
|
|
1
|
+
<script>import ResourceTypePicker from './ResourceTypePicker.svelte';
|
|
3
2
|
export let format;
|
|
4
|
-
let kind = format?.startsWith('resource') ? 'resource' : 'none';
|
|
5
3
|
let resource = format?.startsWith('resource-')
|
|
6
4
|
? format.substring('resource-'.length)
|
|
7
5
|
: undefined;
|
|
8
|
-
$: format =
|
|
9
|
-
kind == 'resource' ? (resource != undefined ? `resource-${resource}` : 'resource') : undefined;
|
|
6
|
+
$: format = resource != undefined ? `resource-${resource}` : undefined;
|
|
10
7
|
</script>
|
|
11
8
|
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
small={true}
|
|
15
|
-
options={[
|
|
16
|
-
['None', 'none'],
|
|
17
|
-
['Resource Type', 'resource']
|
|
18
|
-
]}
|
|
19
|
-
bind:value={kind}
|
|
20
|
-
/>
|
|
21
|
-
|
|
22
|
-
{#if kind == 'resource'}
|
|
23
|
-
<div class="mt-1" />
|
|
24
|
-
<ResourceTypePicker bind:value={resource} />
|
|
25
|
-
{/if}
|
|
9
|
+
<div class="mt-2" />
|
|
10
|
+
<ResourceTypePicker bind:value={resource} nonePickable={true} />
|
package/components/Path.svelte
CHANGED
|
@@ -7,7 +7,7 @@ declare const __propDef: {
|
|
|
7
7
|
initialPath: string;
|
|
8
8
|
path?: string | undefined;
|
|
9
9
|
error?: string | undefined;
|
|
10
|
-
kind: "
|
|
10
|
+
kind: "flow" | "script" | "resource" | "schedule" | "variable";
|
|
11
11
|
getPath?: (() => string) | undefined;
|
|
12
12
|
reset?: (() => Promise<void>) | undefined;
|
|
13
13
|
};
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
<script>export let label = '';
|
|
2
2
|
export let options;
|
|
3
3
|
export let value;
|
|
4
|
-
export let small = false;
|
|
5
4
|
import { createEventDispatcher } from 'svelte';
|
|
5
|
+
import Tooltip from './Tooltip.svelte';
|
|
6
6
|
const dispatch = createEventDispatcher();
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
|
-
<fieldset>
|
|
9
|
+
<fieldset class="w-full">
|
|
10
10
|
<legend class="sr-only">{label}</legend>
|
|
11
|
-
<div class="flex flex-row gap-2">
|
|
11
|
+
<div class="flex flex-row flex-wrap gap-2 items-center mb-2 w-full">
|
|
12
12
|
{#each options as [label, val]}
|
|
13
|
-
<label
|
|
13
|
+
<label
|
|
14
|
+
class:item-button-selected={val == value}
|
|
15
|
+
class="item-button text-center text-sm h-full p-2 grow"
|
|
16
|
+
>
|
|
14
17
|
<input
|
|
15
18
|
type="radio"
|
|
16
19
|
value={val}
|
|
@@ -19,99 +22,11 @@ const dispatch = createEventDispatcher();
|
|
|
19
22
|
aria-labelledby="memory-option-0-label"
|
|
20
23
|
on:click={() => dispatch('change', val)}
|
|
21
24
|
/>
|
|
22
|
-
<p>
|
|
25
|
+
<p>
|
|
26
|
+
{#if typeof label !== 'string'}{label.title} <Tooltip>{label.desc}</Tooltip>
|
|
27
|
+
{:else}{label}{/if}
|
|
28
|
+
</p>
|
|
23
29
|
</label>
|
|
24
30
|
{/each}
|
|
25
31
|
</div>
|
|
26
32
|
</fieldset>
|
|
27
|
-
|
|
28
|
-
<style>
|
|
29
|
-
label {
|
|
30
|
-
|
|
31
|
-
display: flex;
|
|
32
|
-
|
|
33
|
-
cursor: pointer;
|
|
34
|
-
|
|
35
|
-
align-items: center;
|
|
36
|
-
|
|
37
|
-
justify-content: center;
|
|
38
|
-
|
|
39
|
-
border-radius: 0.375rem;
|
|
40
|
-
|
|
41
|
-
border-width: 1px;
|
|
42
|
-
|
|
43
|
-
padding-left: 0.75rem;
|
|
44
|
-
|
|
45
|
-
padding-right: 0.75rem;
|
|
46
|
-
|
|
47
|
-
font-size: 0.875rem;
|
|
48
|
-
|
|
49
|
-
line-height: 1.25rem;
|
|
50
|
-
|
|
51
|
-
font-weight: 500;
|
|
52
|
-
|
|
53
|
-
text-transform: uppercase
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
label:focus {
|
|
57
|
-
|
|
58
|
-
outline: 2px solid transparent;
|
|
59
|
-
|
|
60
|
-
outline-offset: 2px
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@media (min-width: 640px) {
|
|
64
|
-
|
|
65
|
-
label {
|
|
66
|
-
|
|
67
|
-
flex: 1 1 0%
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
label.selected {
|
|
72
|
-
|
|
73
|
-
display: flex;
|
|
74
|
-
|
|
75
|
-
cursor: pointer;
|
|
76
|
-
|
|
77
|
-
align-items: center;
|
|
78
|
-
|
|
79
|
-
justify-content: center;
|
|
80
|
-
|
|
81
|
-
border-radius: 0.375rem;
|
|
82
|
-
|
|
83
|
-
border-width: 1px;
|
|
84
|
-
|
|
85
|
-
background-color: rgb(59 130 246 / 0.7);
|
|
86
|
-
|
|
87
|
-
padding-left: 0.75rem;
|
|
88
|
-
|
|
89
|
-
padding-right: 0.75rem;
|
|
90
|
-
|
|
91
|
-
font-size: 0.875rem;
|
|
92
|
-
|
|
93
|
-
line-height: 1.25rem;
|
|
94
|
-
|
|
95
|
-
font-weight: 500;
|
|
96
|
-
|
|
97
|
-
text-transform: uppercase;
|
|
98
|
-
|
|
99
|
-
--tw-text-opacity: 1;
|
|
100
|
-
|
|
101
|
-
color: rgb(255 255 255 / var(--tw-text-opacity))
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
label.selected:focus {
|
|
105
|
-
|
|
106
|
-
outline: 2px solid transparent;
|
|
107
|
-
|
|
108
|
-
outline-offset: 2px
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
@media (min-width: 640px) {
|
|
112
|
-
|
|
113
|
-
label.selected {
|
|
114
|
-
|
|
115
|
-
flex: 1 1 0%
|
|
116
|
-
}
|
|
117
|
-
}</style>
|
|
@@ -2,9 +2,11 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
label?: string | undefined;
|
|
5
|
-
options: [string
|
|
5
|
+
options: [string | {
|
|
6
|
+
title: string;
|
|
7
|
+
desc: string;
|
|
8
|
+
}, any][];
|
|
6
9
|
value: any;
|
|
7
|
-
small?: boolean | undefined;
|
|
8
10
|
};
|
|
9
11
|
events: {
|
|
10
12
|
change: CustomEvent<any>;
|
|
@@ -16,8 +16,7 @@ let pathError = '';
|
|
|
16
16
|
let step = 1;
|
|
17
17
|
let resourceToEdit;
|
|
18
18
|
let description = '';
|
|
19
|
-
let DESCRIPTION_PLACEHOLDER = `You can use markdown to style your description
|
|
20
|
-
A good way to make resources user friendly is to link to a default script for your resource [example](scripts/add?template=f2d1dc8df796d9e8)`;
|
|
19
|
+
let DESCRIPTION_PLACEHOLDER = `You can use markdown to style your description`;
|
|
21
20
|
let selectedResourceType;
|
|
22
21
|
let resourceType;
|
|
23
22
|
let resourceSchema;
|
|
@@ -28,8 +27,7 @@ let itemPicker;
|
|
|
28
27
|
let variableEditor;
|
|
29
28
|
let modal;
|
|
30
29
|
const dispatch = createEventDispatcher();
|
|
31
|
-
export async function initNew() {
|
|
32
|
-
selectedResourceType = undefined;
|
|
30
|
+
export async function initNew(rt) {
|
|
33
31
|
step = 1;
|
|
34
32
|
args = {};
|
|
35
33
|
path = '';
|
|
@@ -37,6 +35,7 @@ export async function initNew() {
|
|
|
37
35
|
initialPath = '';
|
|
38
36
|
resourceSchema = emptySchema();
|
|
39
37
|
resourceToEdit = undefined;
|
|
38
|
+
selectedResourceType = rt;
|
|
40
39
|
modal.openModal();
|
|
41
40
|
}
|
|
42
41
|
export async function initEdit(p) {
|
|
@@ -136,7 +135,7 @@ $: isValid = allTrue(inputCheck) ?? false;
|
|
|
136
135
|
minRows={3}
|
|
137
136
|
/>
|
|
138
137
|
<div>
|
|
139
|
-
<div class="mb-
|
|
138
|
+
<div class="mb-2 font-semibold text-gray-700">
|
|
140
139
|
Resource type<Required required={true} />
|
|
141
140
|
</div>
|
|
142
141
|
<ResourceTypePicker
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
initNew?: (() => Promise<void>) | undefined;
|
|
4
|
+
initNew?: ((rt?: string) => Promise<void>) | undefined;
|
|
5
5
|
initEdit?: ((p: string) => Promise<void>) | undefined;
|
|
6
6
|
};
|
|
7
7
|
events: {
|
|
@@ -16,7 +16,7 @@ export declare type ResourceEditorProps = typeof __propDef.props;
|
|
|
16
16
|
export declare type ResourceEditorEvents = typeof __propDef.events;
|
|
17
17
|
export declare type ResourceEditorSlots = typeof __propDef.slots;
|
|
18
18
|
export default class ResourceEditor extends SvelteComponentTyped<ResourceEditorProps, ResourceEditorEvents, ResourceEditorSlots> {
|
|
19
|
-
get initNew(): () => Promise<void>;
|
|
19
|
+
get initNew(): (rt?: string | undefined) => Promise<void>;
|
|
20
20
|
get initEdit(): (p: string) => Promise<void>;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
@@ -1,21 +1,44 @@
|
|
|
1
1
|
<script>import { ResourceService } from '../gen';
|
|
2
2
|
import { workspaceStore } from '../stores';
|
|
3
|
+
import { createEventDispatcher } from 'svelte';
|
|
4
|
+
import ResourceEditor from './ResourceEditor.svelte';
|
|
5
|
+
const dispatch = createEventDispatcher();
|
|
3
6
|
let resources = [];
|
|
4
|
-
export let
|
|
7
|
+
export let initialValue = undefined;
|
|
8
|
+
export let value = initialValue;
|
|
5
9
|
export let resourceType = undefined;
|
|
10
|
+
let resourceEditor;
|
|
6
11
|
async function loadResources(resourceType) {
|
|
12
|
+
const v = value;
|
|
7
13
|
resources = await ResourceService.listResource({ workspace: $workspaceStore, resourceType });
|
|
14
|
+
value = v;
|
|
8
15
|
}
|
|
9
16
|
$: {
|
|
10
17
|
if ($workspaceStore) {
|
|
11
18
|
loadResources(resourceType);
|
|
12
19
|
}
|
|
13
20
|
}
|
|
21
|
+
$: dispatch('change', value);
|
|
14
22
|
</script>
|
|
15
23
|
|
|
16
|
-
<
|
|
24
|
+
<ResourceEditor bind:this={resourceEditor} on:refresh={() => loadResources(resourceType)} />
|
|
25
|
+
<select bind:value placeholder="Pick a resource {resourceType}">
|
|
17
26
|
<option value={undefined} />
|
|
18
27
|
{#each resources as r}
|
|
19
28
|
<option value={r.path}>{r.path}{r.description ? ' | ' + r.description : ''}</option>
|
|
20
29
|
{/each}
|
|
21
30
|
</select>
|
|
31
|
+
<div class="flex flex-row gap-4">
|
|
32
|
+
<a class="text-xs hover:underline" target="_blank" href="/resources?connect_app={resourceType}"
|
|
33
|
+
>Connect the app {resourceType} to an account (if available)</a
|
|
34
|
+
>
|
|
35
|
+
<button
|
|
36
|
+
class="text-xs text-blue-500"
|
|
37
|
+
type="button"
|
|
38
|
+
on:click={() => {
|
|
39
|
+
resourceEditor.initNew(resourceType)
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
+ Create a new {resourceType} resource manually
|
|
43
|
+
</button>
|
|
44
|
+
</div>
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
+
initialValue?: string | undefined;
|
|
4
5
|
value?: string | undefined;
|
|
5
6
|
resourceType?: string | undefined;
|
|
6
7
|
};
|
|
7
8
|
events: {
|
|
9
|
+
change: CustomEvent<any>;
|
|
10
|
+
} & {
|
|
8
11
|
[evt: string]: CustomEvent<any>;
|
|
9
12
|
};
|
|
10
13
|
slots: {};
|
|
@@ -5,6 +5,7 @@ import IconedResourceType from './IconedResourceType.svelte';
|
|
|
5
5
|
let resources = [];
|
|
6
6
|
export let value;
|
|
7
7
|
export let notPickable = false;
|
|
8
|
+
export let nonePickable = false;
|
|
8
9
|
async function loadResources() {
|
|
9
10
|
resources = await ResourceService.listResourceTypeNames({ workspace: $workspaceStore });
|
|
10
11
|
}
|
|
@@ -17,9 +18,24 @@ $: {
|
|
|
17
18
|
</script>
|
|
18
19
|
|
|
19
20
|
<div class="grid sm:grid-cols-2 md:grid-cols-3 gap-x-2 gap-y-1 items-center mb-2">
|
|
21
|
+
{#if nonePickable}
|
|
22
|
+
<button
|
|
23
|
+
class="px-4 h-8 text-center {undefined == value
|
|
24
|
+
? 'item-button-selected'
|
|
25
|
+
: notPickable
|
|
26
|
+
? 'item-button-disabled'
|
|
27
|
+
: 'item-button'}"
|
|
28
|
+
on:click={() => {
|
|
29
|
+
value = undefined
|
|
30
|
+
dispatch('click')
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
None
|
|
34
|
+
</button>
|
|
35
|
+
{/if}
|
|
20
36
|
{#each resources as r}
|
|
21
37
|
<button
|
|
22
|
-
class="px-4 h-8 {r == value
|
|
38
|
+
class="px-4 h-8 text-center {r == value
|
|
23
39
|
? 'item-button-selected'
|
|
24
40
|
: notPickable
|
|
25
41
|
? 'item-button-disabled'
|
|
@@ -35,34 +51,6 @@ $: {
|
|
|
35
51
|
</div>
|
|
36
52
|
|
|
37
53
|
<style>
|
|
38
|
-
.item-button {
|
|
39
|
-
padding-top: 0.25rem;
|
|
40
|
-
padding-bottom: 0.25rem;
|
|
41
|
-
border-width: 1px;
|
|
42
|
-
border-radius: 0.125rem
|
|
43
|
-
}
|
|
44
|
-
.item-button-selected {
|
|
45
|
-
padding-top: 0.25rem;
|
|
46
|
-
padding-bottom: 0.25rem;
|
|
47
|
-
border-width: 1px;
|
|
48
|
-
--tw-border-opacity: 1;
|
|
49
|
-
border-color: rgb(59 130 246 / var(--tw-border-opacity));
|
|
50
|
-
--tw-bg-opacity: 1;
|
|
51
|
-
background-color: rgb(239 246 255 / var(--tw-bg-opacity));
|
|
52
|
-
border-radius: 0.125rem
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.item-button-disabled {
|
|
56
|
-
padding-top: 0.25rem;
|
|
57
|
-
padding-bottom: 0.25rem;
|
|
58
|
-
border-width: 1px;
|
|
59
|
-
--tw-bg-opacity: 1;
|
|
60
|
-
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
|
|
61
|
-
--tw-text-opacity: 1;
|
|
62
|
-
color: rgb(209 213 219 / var(--tw-text-opacity));
|
|
63
|
-
border-radius: 0.125rem
|
|
64
|
-
}
|
|
65
|
-
|
|
66
54
|
.selected:hover {
|
|
67
55
|
border-radius: 0.375rem;
|
|
68
56
|
border-width: 1px;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script>import { page } from '$app/stores';
|
|
2
|
-
import { getToday } from '../utils';
|
|
2
|
+
import { decodeState, getToday } from '../utils';
|
|
3
3
|
import { slide } from 'svelte/transition';
|
|
4
4
|
import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons';
|
|
5
5
|
import Icon from 'svelte-awesome';
|
|
6
|
-
import Tooltip from './Tooltip.svelte';
|
|
7
6
|
import SvelteMarkdown from 'svelte-markdown';
|
|
8
7
|
import SchemaForm from './SchemaForm.svelte';
|
|
8
|
+
import Tooltip from './Tooltip.svelte';
|
|
9
9
|
export let runnable;
|
|
10
10
|
export let runAction;
|
|
11
11
|
export let buttonText = 'Run';
|
|
@@ -15,7 +15,7 @@ export let args = {};
|
|
|
15
15
|
let isValid = true;
|
|
16
16
|
let queryArgs = $page.url.searchParams.get('args');
|
|
17
17
|
if (queryArgs) {
|
|
18
|
-
const parsed =
|
|
18
|
+
const parsed = decodeState(queryArgs);
|
|
19
19
|
Object.entries(parsed).forEach(([k, v]) => {
|
|
20
20
|
if (v == '<function call>') {
|
|
21
21
|
parsed[k] = undefined;
|
|
@@ -52,17 +52,16 @@ let scheduledForStr;
|
|
|
52
52
|
{#if runnable?.schema}
|
|
53
53
|
{#if detailed}
|
|
54
54
|
<h2>
|
|
55
|
-
Arguments
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
Arguments
|
|
56
|
+
<Tooltip>
|
|
57
|
+
The optional fields, if left blank, will use the placeholder value as default.
|
|
58
|
+
</Tooltip>
|
|
58
59
|
</h2>
|
|
59
60
|
{/if}
|
|
60
61
|
{#if !runnable.schema.properties || Object.keys(runnable.schema.properties).length === 0}
|
|
61
|
-
<div class="text-sm">No arguments</div>
|
|
62
|
+
<div class="text-sm p-4">No arguments</div>
|
|
62
63
|
{:else}
|
|
63
|
-
<div
|
|
64
|
-
class="bg-gray-50 border border shadow-md shadow-blue-100 shadow-inner rounded border-gray-300 p-6"
|
|
65
|
-
>
|
|
64
|
+
<div class="bg-gray-50 border shadow-blue-100 shadow-inner rounded border-gray-300 p-6">
|
|
66
65
|
<SchemaForm schema={runnable.schema} bind:isValid bind:args />
|
|
67
66
|
</div>
|
|
68
67
|
{/if}
|
|
@@ -89,8 +88,10 @@ let scheduledForStr;
|
|
|
89
88
|
class="default-button-secondary mx-2 mb-1"
|
|
90
89
|
on:click={() => {
|
|
91
90
|
scheduledForStr = undefined
|
|
92
|
-
}}
|
|
91
|
+
}}
|
|
93
92
|
>
|
|
93
|
+
Clear
|
|
94
|
+
</button>
|
|
94
95
|
</div>
|
|
95
96
|
</div>
|
|
96
97
|
</div>
|
|
@@ -105,10 +106,8 @@ let scheduledForStr;
|
|
|
105
106
|
>
|
|
106
107
|
{#if schedulable}
|
|
107
108
|
<div>
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
scale={0.5}
|
|
111
|
-
/>
|
|
109
|
+
Schedule to run later
|
|
110
|
+
<Icon data={viewOptions ? faChevronUp : faChevronDown} scale={0.5} />
|
|
112
111
|
</div>
|
|
113
112
|
{/if}
|
|
114
113
|
</button>
|