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,19 +1,14 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const svelte_1 = require("svelte");
|
|
13
|
-
const simple_svelte_autocomplete_1 = __importDefault(require("simple-svelte-autocomplete"));
|
|
14
|
-
const stores_1 = require("$lib/stores");
|
|
15
|
-
const dispatch = (0, svelte_1.createEventDispatcher)();
|
|
16
|
-
exports.path = '';
|
|
1
|
+
<script>import Modal from './Modal.svelte';
|
|
2
|
+
import TableCustom from './TableCustom.svelte';
|
|
3
|
+
import { GranularAclService } from '../gen/services/GranularAclService';
|
|
4
|
+
import { sendUserToast } from '../utils';
|
|
5
|
+
import { GroupService, UserService } from '../gen';
|
|
6
|
+
import { createEventDispatcher } from 'svelte';
|
|
7
|
+
import AutoComplete from 'simple-svelte-autocomplete';
|
|
8
|
+
import { workspaceStore } from '../stores';
|
|
9
|
+
const dispatch = createEventDispatcher();
|
|
10
|
+
export let kind;
|
|
11
|
+
export let path = '';
|
|
17
12
|
let ownerKind = 'user';
|
|
18
13
|
let owner = '';
|
|
19
14
|
let newOwner = '';
|
|
@@ -23,45 +18,44 @@ let groups = [];
|
|
|
23
18
|
let usernames = [];
|
|
24
19
|
let modal;
|
|
25
20
|
$: newOwner = [ownerKind === 'group' ? 'g' : 'u', owner].join('/');
|
|
26
|
-
async function openModal(newPath) {
|
|
21
|
+
export async function openModal(newPath) {
|
|
27
22
|
if (newPath) {
|
|
28
|
-
|
|
23
|
+
path = newPath;
|
|
29
24
|
}
|
|
30
25
|
loadAcls();
|
|
31
26
|
loadGroups();
|
|
32
27
|
loadUsernames();
|
|
33
28
|
modal.openModal();
|
|
34
29
|
}
|
|
35
|
-
exports.openModal = openModal;
|
|
36
30
|
async function loadAcls() {
|
|
37
|
-
acls = Object.entries(await
|
|
31
|
+
acls = Object.entries(await GranularAclService.getGranularAcls({ workspace: $workspaceStore, path, kind }));
|
|
38
32
|
}
|
|
39
33
|
async function loadGroups() {
|
|
40
|
-
groups = await
|
|
34
|
+
groups = await GroupService.listGroupNames({ workspace: $workspaceStore });
|
|
41
35
|
}
|
|
42
36
|
async function loadUsernames() {
|
|
43
|
-
usernames = await
|
|
37
|
+
usernames = await UserService.listUsernames({ workspace: $workspaceStore });
|
|
44
38
|
}
|
|
45
39
|
async function deleteAcl(owner) {
|
|
46
40
|
try {
|
|
47
|
-
await
|
|
41
|
+
await GranularAclService.removeGranularAcls({
|
|
48
42
|
workspace: $workspaceStore,
|
|
49
|
-
path
|
|
50
|
-
kind
|
|
43
|
+
path,
|
|
44
|
+
kind,
|
|
51
45
|
requestBody: { owner }
|
|
52
46
|
});
|
|
53
47
|
loadAcls();
|
|
54
48
|
dispatch('change');
|
|
55
49
|
}
|
|
56
50
|
catch (err) {
|
|
57
|
-
|
|
51
|
+
sendUserToast(err.toString(), true);
|
|
58
52
|
}
|
|
59
53
|
}
|
|
60
54
|
async function addAcl(owner, write) {
|
|
61
|
-
await
|
|
55
|
+
await GranularAclService.addGranularAcls({
|
|
62
56
|
workspace: $workspaceStore,
|
|
63
|
-
path
|
|
64
|
-
kind
|
|
57
|
+
path,
|
|
58
|
+
kind,
|
|
65
59
|
requestBody: { owner, write }
|
|
66
60
|
});
|
|
67
61
|
loadAcls();
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.canWrite = exports.extraPerms = void 0;
|
|
7
|
-
const stores_1 = require("$lib/stores");
|
|
8
|
-
const Badge_svelte_1 = __importDefault(require("./Badge.svelte"));
|
|
9
|
-
exports.extraPerms = {};
|
|
1
|
+
<script>import { userStore } from '../stores';
|
|
2
|
+
import Badge from './Badge.svelte';
|
|
3
|
+
export let extraPerms = {};
|
|
4
|
+
export let canWrite;
|
|
10
5
|
let kind = undefined;
|
|
11
6
|
let reason = '';
|
|
12
7
|
$: {
|
|
13
8
|
let username = $userStore?.username ?? '';
|
|
14
9
|
let pgroups = $userStore?.pgroups ?? [];
|
|
15
10
|
let pusername = `u/${username}`;
|
|
16
|
-
let extraPermsKeys = Object.keys(
|
|
11
|
+
let extraPermsKeys = Object.keys(extraPerms);
|
|
17
12
|
if (pusername in extraPermsKeys) {
|
|
18
|
-
if (
|
|
13
|
+
if (extraPerms[pusername]) {
|
|
19
14
|
kind = 'write';
|
|
20
15
|
}
|
|
21
16
|
else {
|
|
@@ -24,13 +19,13 @@ $: {
|
|
|
24
19
|
reason = 'This item was shared to you personally';
|
|
25
20
|
}
|
|
26
21
|
else {
|
|
27
|
-
let writeGroup = pgroups.find((x) => extraPermsKeys.includes(x) &&
|
|
28
|
-
if (pgroups.find((x) => x in extraPermsKeys &&
|
|
22
|
+
let writeGroup = pgroups.find((x) => extraPermsKeys.includes(x) && extraPerms[x]);
|
|
23
|
+
if (pgroups.find((x) => x in extraPermsKeys && extraPerms[x])) {
|
|
29
24
|
kind = 'write';
|
|
30
25
|
reason = `This item was write shared to the group ${writeGroup} which you are a member of`;
|
|
31
26
|
}
|
|
32
27
|
else {
|
|
33
|
-
let readGroup = pgroups.find((x) => extraPermsKeys.includes(x) &&
|
|
28
|
+
let readGroup = pgroups.find((x) => extraPermsKeys.includes(x) && extraPerms[x]);
|
|
34
29
|
if (pgroups.find((x) => extraPermsKeys.includes(x))) {
|
|
35
30
|
kind = 'read';
|
|
36
31
|
reason = `This item was read-only shared to the group ${readGroup} which you are a member of`;
|
|
@@ -40,10 +35,10 @@ $: {
|
|
|
40
35
|
}
|
|
41
36
|
}
|
|
42
37
|
}
|
|
43
|
-
if (kind == 'read' &&
|
|
38
|
+
if (kind == 'read' && canWrite) {
|
|
44
39
|
kind = undefined;
|
|
45
40
|
}
|
|
46
|
-
if (kind == undefined && !
|
|
41
|
+
if (kind == undefined && !canWrite) {
|
|
47
42
|
kind = 'read';
|
|
48
43
|
reason = '';
|
|
49
44
|
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.format = exports.enum_ = exports.pattern = void 0;
|
|
7
|
-
const RadioButton_svelte_1 = __importDefault(require("./RadioButton.svelte"));
|
|
8
|
-
const ResourceTypePicker_svelte_1 = __importDefault(require("./ResourceTypePicker.svelte"));
|
|
1
|
+
<script>import RadioButton from './RadioButton.svelte';
|
|
2
|
+
import ResourceTypePicker from './ResourceTypePicker.svelte';
|
|
3
|
+
export let pattern;
|
|
4
|
+
export let enum_;
|
|
5
|
+
export let format;
|
|
9
6
|
let kind = 'none';
|
|
10
|
-
let patternStr =
|
|
7
|
+
let patternStr = pattern ?? '';
|
|
11
8
|
let resource;
|
|
12
9
|
const FORMATS = [
|
|
13
10
|
'email',
|
|
@@ -21,9 +18,9 @@ const FORMATS = [
|
|
|
21
18
|
// 'ipv6',
|
|
22
19
|
// 'jsonpointer'
|
|
23
20
|
];
|
|
24
|
-
$:
|
|
21
|
+
$: format =
|
|
25
22
|
kind == 'resource' ? (resource != undefined ? `resource-${resource}` : 'resource') : undefined;
|
|
26
|
-
$:
|
|
23
|
+
$: pattern = patternStr == '' ? undefined : patternStr;
|
|
27
24
|
</script>
|
|
28
25
|
|
|
29
26
|
<RadioButton
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
/** @typedef {typeof __propDef.slots} SwitchSlots */
|
|
4
4
|
export default class Switch extends SvelteComponentTyped<{
|
|
5
5
|
[x: string]: any;
|
|
6
|
-
checked?: boolean | undefined;
|
|
7
6
|
label?: string | undefined;
|
|
7
|
+
checked?: boolean | undefined;
|
|
8
8
|
horizontal?: boolean | undefined;
|
|
9
9
|
textFormat?: string | undefined;
|
|
10
10
|
}, {
|
|
@@ -18,8 +18,8 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
18
18
|
declare const __propDef: {
|
|
19
19
|
props: {
|
|
20
20
|
[x: string]: any;
|
|
21
|
-
checked?: boolean | undefined;
|
|
22
21
|
label?: string | undefined;
|
|
22
|
+
checked?: boolean | undefined;
|
|
23
23
|
horizontal?: boolean | undefined;
|
|
24
24
|
textFormat?: string | undefined;
|
|
25
25
|
};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.currentPage = 1;
|
|
7
|
-
exports.showNext = true;
|
|
8
|
-
const dispatch = (0, svelte_1.createEventDispatcher)();
|
|
1
|
+
<script>import { createEventDispatcher } from 'svelte';
|
|
2
|
+
export let paginated = false;
|
|
3
|
+
export let currentPage = 1;
|
|
4
|
+
export let showNext = true;
|
|
5
|
+
const dispatch = createEventDispatcher();
|
|
9
6
|
</script>
|
|
10
7
|
|
|
11
8
|
<!-- A custom table
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
<script>import { createEventDispatcher } from 'svelte';
|
|
2
|
+
// A table suitable if you can pass data as a list of row objects
|
|
3
|
+
export let headers;
|
|
4
|
+
export let data; // Object containing the data
|
|
5
|
+
export let keys;
|
|
6
|
+
export let defaultText = 'No data to display';
|
|
7
|
+
export let paginated = false;
|
|
8
|
+
export let twTextSize = 'text-sm md:text-base';
|
|
9
|
+
const dispatch = createEventDispatcher();
|
|
9
10
|
</script>
|
|
10
11
|
|
|
11
12
|
<div class="mt-8 flex flex-col {$$props.class}">
|
package/components/Tabs.svelte
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const dispatch = (0, svelte_1.createEventDispatcher)();
|
|
8
|
-
$: dispatch('update', exports.tab);
|
|
1
|
+
<script>import { createEventDispatcher } from 'svelte';
|
|
2
|
+
export let tabs;
|
|
3
|
+
export let dflt = 0;
|
|
4
|
+
export let tab = tabs[dflt][0];
|
|
5
|
+
const dispatch = createEventDispatcher();
|
|
6
|
+
$: dispatch('update', tab);
|
|
9
7
|
</script>
|
|
10
8
|
|
|
11
9
|
<div class="flex flex-col sm:flex-row text-base">
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script>import { createEventDispatcher } from 'svelte';
|
|
2
|
+
export let value;
|
|
3
|
+
export let options;
|
|
4
|
+
let checked = options.right.value === value;
|
|
5
|
+
const id = Date.now().toString(36);
|
|
6
|
+
const dispatch = createEventDispatcher();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<span>
|
|
10
|
+
<label for={id} class="inline-flex items-center cursor-pointer mt-2">
|
|
11
|
+
{#if Boolean(options.left.label)}
|
|
12
|
+
<span class="mr-2 text-sm font-medium text-gray-900">{options.left.label}</span>
|
|
13
|
+
{/if}
|
|
14
|
+
<div class="relative">
|
|
15
|
+
<input
|
|
16
|
+
type="checkbox"
|
|
17
|
+
value={false}
|
|
18
|
+
{id}
|
|
19
|
+
class="sr-only peer"
|
|
20
|
+
bind:checked
|
|
21
|
+
on:change={() => {
|
|
22
|
+
value = checked ? options.right.value : options.left.value
|
|
23
|
+
dispatch('change', value)
|
|
24
|
+
}}
|
|
25
|
+
/>
|
|
26
|
+
<div
|
|
27
|
+
class="w-11 h-6 bg-gray-200 rounded-full peer peer-focus:ring-4 peer-focus:ring-blue-300 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"
|
|
28
|
+
/>
|
|
29
|
+
</div>
|
|
30
|
+
{#if Boolean(options.right.label)}
|
|
31
|
+
<span class="ml-2 text-sm font-medium text-gray-900">{options.right.label}</span>
|
|
32
|
+
{/if}
|
|
33
|
+
</label>
|
|
34
|
+
</span>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
value: any;
|
|
5
|
+
options: {
|
|
6
|
+
left: {
|
|
7
|
+
label?: string | undefined;
|
|
8
|
+
value: any;
|
|
9
|
+
};
|
|
10
|
+
right: {
|
|
11
|
+
label?: string | undefined;
|
|
12
|
+
value: any;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
events: {
|
|
17
|
+
change: CustomEvent<any>;
|
|
18
|
+
} & {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
};
|
|
21
|
+
slots: {};
|
|
22
|
+
};
|
|
23
|
+
export declare type ToggleProps = typeof __propDef.props;
|
|
24
|
+
export declare type ToggleEvents = typeof __propDef.events;
|
|
25
|
+
export declare type ToggleSlots = typeof __propDef.slots;
|
|
26
|
+
export default class Toggle extends SvelteComponentTyped<ToggleProps, ToggleEvents, ToggleSlots> {
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -1,99 +1,66 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
<script>import Icon from 'svelte-awesome';
|
|
2
|
+
import { faInfoCircle } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import { createPopperActions } from 'svelte-popperjs';
|
|
4
|
+
import { fade } from 'svelte/transition';
|
|
5
|
+
const [popperRef, popperContent] = createPopperActions({
|
|
6
|
+
placement: 'auto'
|
|
7
|
+
});
|
|
8
|
+
const betterPreventOverflow = (options) => ({
|
|
9
|
+
name: 'preventOverflow',
|
|
10
|
+
options,
|
|
11
|
+
effect: ({ state }) => {
|
|
12
|
+
const { padding = 0 } = options;
|
|
13
|
+
state.elements.popper.style.maxWidth = `calc(100vw - ${padding * 2}px)`;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
const extraOpts = {
|
|
17
|
+
modifiers: [
|
|
18
|
+
betterPreventOverflow({ padding: 50 }),
|
|
19
|
+
{ name: 'offset', options: { offset: [8, 8] } },
|
|
20
|
+
{
|
|
21
|
+
name: 'arrow',
|
|
22
|
+
options: {
|
|
23
|
+
padding: 10 // 5px from the edges of the popper
|
|
24
|
+
}
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
+
]
|
|
27
|
+
};
|
|
28
|
+
let showTooltip = false;
|
|
29
|
+
let timeout;
|
|
30
|
+
function open() {
|
|
31
|
+
clearTimeout(timeout);
|
|
32
|
+
showTooltip = true;
|
|
33
|
+
}
|
|
34
|
+
function close() {
|
|
35
|
+
timeout = setTimeout(() => (showTooltip = false), 200);
|
|
26
36
|
}
|
|
27
37
|
</script>
|
|
28
38
|
|
|
29
|
-
<
|
|
30
|
-
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class="tooltip rounded shadow-lg p-1 leading-4 {position === 'above' ? '-mt-8' : 'mt-6'}
|
|
34
|
-
{viewTooltip ? 'tooltip-visible' : 'tooltip'} {direction === 'left' ? 'right-0' : ''}
|
|
35
|
-
text-2xs text-gray-700"
|
|
36
|
-
on:mouseover={() => {
|
|
37
|
-
mouseOnMessage = true
|
|
38
|
-
}}
|
|
39
|
-
on:focus={() => {}}
|
|
40
|
-
on:mouseout={() => {
|
|
41
|
-
mouseOnMessage = false
|
|
42
|
-
}}
|
|
43
|
-
on:blur={() => {}}
|
|
44
|
-
><slot />
|
|
45
|
-
</span>
|
|
46
|
-
{/if}
|
|
47
|
-
<Icon class="text-gray-500 font-thin inline-block align-middle" data={faInfoCircle} scale={0.6} />
|
|
48
|
-
<!-- Hovering on this (invisible) area triggers the apparition of the tooltip. Needed because the icon is too small-->
|
|
39
|
+
<button use:popperRef on:mouseenter={open} on:mouseleave={close}>
|
|
40
|
+
<Icon class="text-gray-500 font-thin inline-block align-middle" data={faInfoCircle} scale={0.8} />
|
|
41
|
+
</button>
|
|
42
|
+
{#if showTooltip}
|
|
49
43
|
<div
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
mouseOver = false
|
|
61
|
-
}}
|
|
62
|
-
on:blur={() => {}}
|
|
63
|
-
/>
|
|
64
|
-
</div>
|
|
44
|
+
transition:fade
|
|
45
|
+
id="tooltip"
|
|
46
|
+
use:popperContent={extraOpts}
|
|
47
|
+
on:mouseenter={open}
|
|
48
|
+
on:mouseleave={close}
|
|
49
|
+
>
|
|
50
|
+
<slot />
|
|
51
|
+
<div id="arrow" data-popper-arrow />
|
|
52
|
+
</div>
|
|
53
|
+
{/if}
|
|
65
54
|
|
|
66
55
|
<style>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
visibility: hidden;
|
|
70
|
-
|
|
71
|
-
position: absolute;
|
|
72
|
-
|
|
73
|
-
transition-property: opacity;
|
|
74
|
-
|
|
75
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
76
|
-
|
|
77
|
-
transition-duration: 100ms
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.tooltip-visible {
|
|
81
|
-
|
|
82
|
-
visibility: visible;
|
|
83
|
-
|
|
84
|
-
position: absolute;
|
|
85
|
-
|
|
56
|
+
#tooltip {
|
|
86
57
|
z-index: 50;
|
|
87
|
-
|
|
58
|
+
white-space: normal;
|
|
59
|
+
border-radius: 0.75rem;
|
|
88
60
|
--tw-bg-opacity: 1;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
transition-property: opacity;
|
|
95
|
-
|
|
96
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
97
|
-
|
|
98
|
-
transition-duration: 150ms
|
|
61
|
+
background-color: rgb(39 39 42 / var(--tw-bg-opacity));
|
|
62
|
+
padding: 1rem;
|
|
63
|
+
font-weight: 400;
|
|
64
|
+
--tw-text-opacity: 1;
|
|
65
|
+
color: rgb(209 213 219 / var(--tw-text-opacity))
|
|
99
66
|
}</style>
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
position?: ("above" | "below") | undefined;
|
|
6
|
-
direction?: ("default" | "left") | undefined;
|
|
7
|
-
};
|
|
3
|
+
props: {};
|
|
8
4
|
events: {
|
|
9
5
|
[evt: string]: CustomEvent<any>;
|
|
10
6
|
};
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const Path_svelte_1 = __importDefault(require("./Path.svelte"));
|
|
12
|
-
const Modal_svelte_1 = __importDefault(require("./Modal.svelte"));
|
|
13
|
-
const svelte_1 = require("svelte");
|
|
14
|
-
const stores_1 = require("$lib/stores");
|
|
15
|
-
const Required_svelte_1 = __importDefault(require("./Required.svelte"));
|
|
16
|
-
const dispatch = (0, svelte_1.createEventDispatcher)();
|
|
1
|
+
<script>import Password from './Password.svelte';
|
|
2
|
+
import { sendUserToast } from '../utils';
|
|
3
|
+
import { VariableService } from '../gen';
|
|
4
|
+
import AutosizedTextarea from './AutosizedTextarea.svelte';
|
|
5
|
+
import Path from './Path.svelte';
|
|
6
|
+
import Modal from './Modal.svelte';
|
|
7
|
+
import { createEventDispatcher } from 'svelte';
|
|
8
|
+
import { workspaceStore } from '../stores';
|
|
9
|
+
import Required from './Required.svelte';
|
|
10
|
+
const dispatch = createEventDispatcher();
|
|
17
11
|
let path = '';
|
|
18
12
|
let variable = {
|
|
19
13
|
value: '',
|
|
@@ -24,19 +18,21 @@ let valid = true;
|
|
|
24
18
|
let modal;
|
|
25
19
|
let edit = false;
|
|
26
20
|
let initialPath;
|
|
27
|
-
|
|
21
|
+
let pathError = '';
|
|
22
|
+
export function initNew() {
|
|
28
23
|
variable = {
|
|
29
24
|
value: '',
|
|
30
25
|
is_secret: true,
|
|
31
26
|
description: ''
|
|
32
27
|
};
|
|
33
28
|
edit = false;
|
|
29
|
+
initialPath = '';
|
|
30
|
+
path = '';
|
|
34
31
|
modal.openModal();
|
|
35
32
|
}
|
|
36
|
-
|
|
37
|
-
async function editVariable(path) {
|
|
33
|
+
export async function editVariable(path) {
|
|
38
34
|
edit = true;
|
|
39
|
-
const getV = await
|
|
35
|
+
const getV = await VariableService.getVariable({
|
|
40
36
|
workspace: $workspaceStore ?? '',
|
|
41
37
|
path,
|
|
42
38
|
decryptSecret: false
|
|
@@ -49,11 +45,10 @@ async function editVariable(path) {
|
|
|
49
45
|
initialPath = path;
|
|
50
46
|
modal.openModal();
|
|
51
47
|
}
|
|
52
|
-
exports.editVariable = editVariable;
|
|
53
48
|
const MAX_VARIABLE_LENGTH = 3000;
|
|
54
49
|
$: valid = variable.value.length < MAX_VARIABLE_LENGTH;
|
|
55
50
|
async function createVariable() {
|
|
56
|
-
await
|
|
51
|
+
await VariableService.createVariable({
|
|
57
52
|
workspace: $workspaceStore,
|
|
58
53
|
requestBody: {
|
|
59
54
|
path,
|
|
@@ -62,18 +57,18 @@ async function createVariable() {
|
|
|
62
57
|
description: variable.description
|
|
63
58
|
}
|
|
64
59
|
});
|
|
65
|
-
|
|
60
|
+
sendUserToast(`Successfully created variable ${path}`);
|
|
66
61
|
dispatch('create');
|
|
67
62
|
modal.closeModal();
|
|
68
63
|
}
|
|
69
64
|
async function updateVariable() {
|
|
70
65
|
try {
|
|
71
|
-
const getV = await
|
|
66
|
+
const getV = await VariableService.getVariable({
|
|
72
67
|
workspace: $workspaceStore ?? '',
|
|
73
68
|
path: initialPath,
|
|
74
69
|
decryptSecret: false
|
|
75
70
|
});
|
|
76
|
-
await
|
|
71
|
+
await VariableService.updateVariable({
|
|
77
72
|
workspace: $workspaceStore,
|
|
78
73
|
path: initialPath,
|
|
79
74
|
requestBody: {
|
|
@@ -83,12 +78,12 @@ async function updateVariable() {
|
|
|
83
78
|
description: getV.description != variable.description ? variable.description : undefined
|
|
84
79
|
}
|
|
85
80
|
});
|
|
86
|
-
|
|
81
|
+
sendUserToast(`Successfully updated variable at ${initialPath}`);
|
|
87
82
|
dispatch('create');
|
|
88
83
|
modal.closeModal();
|
|
89
84
|
}
|
|
90
85
|
catch (err) {
|
|
91
|
-
|
|
86
|
+
sendUserToast(`Could not update variable: ${err.body}`, true);
|
|
92
87
|
}
|
|
93
88
|
}
|
|
94
89
|
</script>
|
|
@@ -113,7 +108,13 @@ async function updateVariable() {
|
|
|
113
108
|
<div class="flex flex-col gap-2 ">
|
|
114
109
|
<div>
|
|
115
110
|
<div class="text-gray-700 mb-0 pb-0">path</div>
|
|
116
|
-
<Path
|
|
111
|
+
<Path
|
|
112
|
+
bind:error={pathError}
|
|
113
|
+
bind:path
|
|
114
|
+
{initialPath}
|
|
115
|
+
namePlaceholder="my/variable"
|
|
116
|
+
kind="variable"
|
|
117
|
+
/>
|
|
117
118
|
</div>
|
|
118
119
|
|
|
119
120
|
<label class="block pb-6">
|
|
@@ -151,7 +152,7 @@ async function updateVariable() {
|
|
|
151
152
|
createVariable()
|
|
152
153
|
}
|
|
153
154
|
}}
|
|
154
|
-
disabled={!valid}
|
|
155
|
+
disabled={!valid || pathError != ''}
|
|
155
156
|
>
|
|
156
157
|
{#if edit}
|
|
157
158
|
Save
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script>import { copyFirstStepSchema, isCopyFirstStepSchemaDisabled } from './flowStore';
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<button
|
|
5
|
+
class="default-secondary-button-v2"
|
|
6
|
+
disabled={$isCopyFirstStepSchemaDisabled}
|
|
7
|
+
on:click={copyFirstStepSchema}
|
|
8
|
+
>
|
|
9
|
+
Copy from step 1's schema
|
|
10
|
+
</button>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {};
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export declare type CopyFirstStepSchemaProps = typeof __propDef.props;
|
|
10
|
+
export declare type CopyFirstStepSchemaEvents = typeof __propDef.events;
|
|
11
|
+
export declare type CopyFirstStepSchemaSlots = typeof __propDef.slots;
|
|
12
|
+
export default class CopyFirstStepSchema extends SvelteComponentTyped<CopyFirstStepSchemaProps, CopyFirstStepSchemaEvents, CopyFirstStepSchemaSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|