windmill-components 1.379.2 → 1.379.4
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/package/components/common/table/AppRow.svelte +2 -1
- package/package/components/common/table/FlowRow.svelte +2 -1
- package/package/components/common/table/RawAppRow.svelte +1 -1
- package/package/components/common/table/ScriptRow.svelte +2 -1
- package/package/components/home/Item.svelte +1 -1
- package/package/forLater.js +8 -4
- package/package/utils.d.ts +1 -4
- package/package/utils.js +0 -19
- package/package/utils_deployable.d.ts +5 -0
- package/package/utils_deployable.js +19 -0
- package/package.json +1 -1
|
@@ -11,9 +11,10 @@ import Badge from '../badge/Badge.svelte';
|
|
|
11
11
|
import { ExternalLink, Eye, File, FileJson, FileUp, GitFork, Globe, History, Pen, Share, Trash, Clipboard } from 'lucide-svelte';
|
|
12
12
|
import { goto as gotoUrl } from '$app/navigation';
|
|
13
13
|
import { page } from '$app/stores';
|
|
14
|
-
import { DELETE, copyToClipboard
|
|
14
|
+
import { DELETE, copyToClipboard } from '../../../utils';
|
|
15
15
|
import AppDeploymentHistory from '../../apps/editor/AppDeploymentHistory.svelte';
|
|
16
16
|
import AppJsonEditor from '../../apps/editor/AppJsonEditor.svelte';
|
|
17
|
+
import { isDeployable } from '../../../utils_deployable';
|
|
17
18
|
export let app;
|
|
18
19
|
export let marked;
|
|
19
20
|
export let starred;
|
|
@@ -11,7 +11,8 @@ import Button from '../button/Button.svelte';
|
|
|
11
11
|
import Row from './Row.svelte';
|
|
12
12
|
import DraftBadge from '../../DraftBadge.svelte';
|
|
13
13
|
import { sendUserToast } from '../../../toast';
|
|
14
|
-
import { DELETE, copyToClipboard,
|
|
14
|
+
import { DELETE, copyToClipboard, isOwner } from '../../../utils';
|
|
15
|
+
import { isDeployable } from '../../../utils_deployable';
|
|
15
16
|
import { Pen, GitFork, Trash, List, FileUp, Globe, Calendar, Share, Archive, Clipboard, Eye, HistoryIcon } from 'lucide-svelte';
|
|
16
17
|
import FlowHistory from '../../flows/FlowHistory.svelte';
|
|
17
18
|
export let flow;
|
|
@@ -11,7 +11,7 @@ import DrawerContent from '../drawer/DrawerContent.svelte';
|
|
|
11
11
|
import FileInput from '../fileInput/FileInput.svelte';
|
|
12
12
|
import { goto } from '../../../navigation';
|
|
13
13
|
import { FileUp, Globe, Pen, Share, Trash } from 'lucide-svelte';
|
|
14
|
-
import { isDeployable } from '../../../
|
|
14
|
+
import { isDeployable } from '../../../utils_deployable';
|
|
15
15
|
export let app;
|
|
16
16
|
export let marked;
|
|
17
17
|
export let starred;
|
|
@@ -11,7 +11,8 @@ import Button from '../button/Button.svelte';
|
|
|
11
11
|
import Row from './Row.svelte';
|
|
12
12
|
import DraftBadge from '../../DraftBadge.svelte';
|
|
13
13
|
import { sendUserToast } from '../../../toast';
|
|
14
|
-
import { copyToClipboard, DELETE,
|
|
14
|
+
import { copyToClipboard, DELETE, isOwner } from '../../../utils';
|
|
15
|
+
import { isDeployable } from '../../../utils_deployable';
|
|
15
16
|
import { LanguageIcon } from '../languageIcons';
|
|
16
17
|
import { Archive, Calendar, Code, Copy, Eye, FileUp, GitFork, List, Pen, Share, Trash, History } from 'lucide-svelte';
|
|
17
18
|
import ScriptVersionHistory from '../../ScriptVersionHistory.svelte';
|
|
@@ -11,7 +11,7 @@ import { createEventDispatcher } from 'svelte';
|
|
|
11
11
|
import { ArrowBigUp } from 'lucide-svelte';
|
|
12
12
|
import { enterpriseLicense, workspaceStore } from '../../stores';
|
|
13
13
|
import { WorkspaceService } from '../../gen';
|
|
14
|
-
import { ALL_DEPLOYABLE } from '../../
|
|
14
|
+
import { ALL_DEPLOYABLE } from '../../utils_deployable';
|
|
15
15
|
export let item;
|
|
16
16
|
export let depth = 0;
|
|
17
17
|
const dispatch = createEventDispatcher();
|
package/package/forLater.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { get } from 'svelte/store';
|
|
2
2
|
import { dbClockDrift } from './stores';
|
|
3
3
|
import { JobService } from './gen';
|
|
4
|
+
import pLimit from 'p-limit';
|
|
4
5
|
function subtractSeconds(date, seconds) {
|
|
5
6
|
date.setSeconds(date.getSeconds() - seconds);
|
|
6
7
|
return date;
|
|
@@ -9,17 +10,20 @@ function adjustDate(drift) {
|
|
|
9
10
|
return new Date(Date.now() + drift);
|
|
10
11
|
}
|
|
11
12
|
export async function computeDrift() {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
if (get(dbClockDrift) == undefined) {
|
|
14
|
+
const now = Date.now();
|
|
15
|
+
const dbClock = await JobService.getDbClock();
|
|
16
|
+
dbClockDrift.set(dbClock - now);
|
|
17
|
+
}
|
|
15
18
|
}
|
|
16
19
|
export function forLater(scheduledString) {
|
|
17
20
|
return getDbClockNow() < subtractSeconds(new Date(scheduledString), 5);
|
|
18
21
|
}
|
|
22
|
+
const limit = pLimit(1);
|
|
19
23
|
export function getDbClockNow() {
|
|
20
24
|
let drift = get(dbClockDrift);
|
|
21
25
|
if (drift == undefined) {
|
|
22
|
-
computeDrift();
|
|
26
|
+
limit(() => computeDrift());
|
|
23
27
|
drift = 0;
|
|
24
28
|
}
|
|
25
29
|
return adjustDate(drift);
|
package/package/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UserExt } from './stores';
|
|
2
2
|
import { sendUserToast } from './toast';
|
|
3
|
-
import type { Script
|
|
3
|
+
import type { Script } from './gen';
|
|
4
4
|
import type { EnumType, SchemaProperty } from './common';
|
|
5
5
|
import type { Schema } from './common';
|
|
6
6
|
export { sendUserToast };
|
|
@@ -105,6 +105,3 @@ export declare function shouldDisplayPlaceholder(type: string | undefined, forma
|
|
|
105
105
|
export declare function getSchemaFromProperties(properties: {
|
|
106
106
|
[name: string]: SchemaProperty;
|
|
107
107
|
}): Schema;
|
|
108
|
-
type DeployUIType = 'script' | 'flow' | 'app' | 'resource' | 'variable' | 'secret';
|
|
109
|
-
export declare function isDeployable(type: DeployUIType, path: string, deployUiSettings: WorkspaceDeployUISettings | undefined): boolean;
|
|
110
|
-
export declare const ALL_DEPLOYABLE: WorkspaceDeployUISettings;
|
package/package/utils.js
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
import { deepEqual } from 'fast-equals';
|
|
10
10
|
import YAML from 'yaml';
|
|
11
11
|
import { sendUserToast } from './toast';
|
|
12
|
-
import { minimatch } from 'minimatch';
|
|
13
12
|
export { sendUserToast };
|
|
14
13
|
export function validateUsername(username) {
|
|
15
14
|
if (username != '' && !/^[a-zA-Z]\w+$/.test(username)) {
|
|
@@ -800,21 +799,3 @@ export function getSchemaFromProperties(properties) {
|
|
|
800
799
|
order: Object.keys(properties).filter((k) => k !== 'label')
|
|
801
800
|
};
|
|
802
801
|
}
|
|
803
|
-
export function isDeployable(type, path, deployUiSettings) {
|
|
804
|
-
if (deployUiSettings == undefined) {
|
|
805
|
-
return false;
|
|
806
|
-
}
|
|
807
|
-
if (deployUiSettings.include_type != undefined && !deployUiSettings.include_type.includes(type)) {
|
|
808
|
-
return false;
|
|
809
|
-
}
|
|
810
|
-
if (deployUiSettings.include_path != undefined &&
|
|
811
|
-
deployUiSettings.include_path.length != 0 &&
|
|
812
|
-
deployUiSettings.include_path.every((x) => !minimatch(path, x))) {
|
|
813
|
-
return false;
|
|
814
|
-
}
|
|
815
|
-
return true;
|
|
816
|
-
}
|
|
817
|
-
export const ALL_DEPLOYABLE = {
|
|
818
|
-
include_path: [],
|
|
819
|
-
include_type: ['script', 'flow', 'app', 'resource', 'variable', 'secret']
|
|
820
|
-
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { WorkspaceDeployUISettings } from './gen';
|
|
2
|
+
type DeployUIType = 'script' | 'flow' | 'app' | 'resource' | 'variable' | 'secret';
|
|
3
|
+
export declare function isDeployable(type: DeployUIType, path: string, deployUiSettings: WorkspaceDeployUISettings | undefined): boolean;
|
|
4
|
+
export declare const ALL_DEPLOYABLE: WorkspaceDeployUISettings;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { minimatch } from 'minimatch';
|
|
2
|
+
export function isDeployable(type, path, deployUiSettings) {
|
|
3
|
+
if (deployUiSettings == undefined) {
|
|
4
|
+
return false;
|
|
5
|
+
}
|
|
6
|
+
if (deployUiSettings.include_type != undefined && !deployUiSettings.include_type.includes(type)) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
if (deployUiSettings.include_path != undefined &&
|
|
10
|
+
deployUiSettings.include_path.length != 0 &&
|
|
11
|
+
deployUiSettings.include_path.every((x) => !minimatch(path, x))) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
export const ALL_DEPLOYABLE = {
|
|
17
|
+
include_path: [],
|
|
18
|
+
include_type: ['script', 'flow', 'app', 'resource', 'variable', 'secret']
|
|
19
|
+
};
|