windmill-components 1.13.4 → 1.13.7

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.
@@ -4,7 +4,7 @@ import Tooltip from './Tooltip.svelte';
4
4
  import json from 'svelte-highlight/languages/json';
5
5
  import github from 'svelte-highlight/styles/github';
6
6
  import { Highlight } from 'svelte-highlight';
7
- import { ResourceService } from '../gen';
7
+ import { ResourceService } from '../gen/index';
8
8
  import { workspaceStore } from '../stores';
9
9
  export let value;
10
10
  let resourceViewer;
@@ -4,7 +4,6 @@ import { onDestroy, onMount } from 'svelte';
4
4
  import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
5
5
  import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
6
6
  import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
7
- import * as vscode from 'vscode';
8
7
  import { createEventDispatcher } from 'svelte';
9
8
  const dispatch = createEventDispatcher();
10
9
  let divEl = null;
@@ -73,6 +72,7 @@ export async function reloadWebsocket() {
73
72
  // install Monaco language client services
74
73
  const { MonacoLanguageClient } = await import('monaco-languageclient');
75
74
  const { CloseAction, ErrorAction } = await import('vscode-languageclient');
75
+ const vscode = await import('vscode');
76
76
  const { RequestType, toSocket, WebSocketMessageReader, WebSocketMessageWriter } = await import('@codingame/monaco-jsonrpc');
77
77
  function createLanguageClient(transports, name, initializationOptions) {
78
78
  const client = new MonacoLanguageClient({
@@ -1,4 +1,4 @@
1
- <script>import { FlowService } from '../gen';
1
+ <script>import { FlowService } from '../gen/index';
2
2
  import { sendUserToast } from '../utils';
3
3
  import { page } from '$app/stores';
4
4
  import { goto } from '$app/navigation';
@@ -1,5 +1,5 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import { type Flow } from '../gen';
2
+ import { type Flow } from '../gen/index';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  flow: Flow;
@@ -1,7 +1,7 @@
1
1
  <script>import { faPlus } from '@fortawesome/free-solid-svg-icons';
2
2
  import { emptySchema, loadSchema } from '../utils';
3
3
  import Icon from 'svelte-awesome';
4
- import { FlowModuleValue, ScriptService } from '../gen';
4
+ import { FlowModuleValue, ScriptService } from '../gen/index';
5
5
  import SchemaEditor from './SchemaEditor.svelte';
6
6
  import { workspaceStore } from '../stores';
7
7
  import ModuleStep from './ModuleStep.svelte';
@@ -1,5 +1,5 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import { type Flow } from '../gen';
2
+ import { type Flow } from '../gen/index';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  flow: Flow;
@@ -1,7 +1,7 @@
1
1
  <script>import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons';
2
2
  import { sendUserToast, truncateRev } from '../utils';
3
3
  import Icon from 'svelte-awesome';
4
- import { Job, JobService, InputTransform } from '../gen';
4
+ import { Job, JobService, InputTransform } from '../gen/index';
5
5
  import { workspaceStore } from '../stores';
6
6
  import RunForm from './RunForm.svelte';
7
7
  import FlowStatusViewer from './FlowStatusViewer.svelte';
@@ -1,5 +1,5 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import { type Flow } from '../gen';
2
+ import { type Flow } from '../gen/index';
3
3
  import type { Schema } from '../common';
4
4
  declare const __propDef: {
5
5
  props: {
@@ -2,7 +2,7 @@
2
2
  import { truncateRev } from '../utils';
3
3
  import Icon from 'svelte-awesome';
4
4
  import { check } from 'svelte-awesome/icons';
5
- import { CompletedJob, FlowModuleValue, FlowStatusModule, JobService, QueuedJob } from '../gen';
5
+ import { CompletedJob, FlowModuleValue, FlowStatusModule, JobService, QueuedJob } from '../gen/index';
6
6
  import { workspaceStore } from '../stores';
7
7
  import DisplayResult from './DisplayResult.svelte';
8
8
  import ChevronButton from './ChevronButton.svelte';
@@ -1,5 +1,5 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import { CompletedJob, QueuedJob } from '../gen';
2
+ import { CompletedJob, QueuedJob } from '../gen/index';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  job: QueuedJob | CompletedJob;
@@ -1,6 +1,6 @@
1
1
  <script>import { userStore, workspaceStore } from '../stores';
2
2
  import Modal from './Modal.svelte';
3
- import { GroupService, UserService } from '../gen';
3
+ import { GroupService, UserService } from '../gen/index';
4
4
  import AutoComplete from 'simple-svelte-autocomplete';
5
5
  import PageHeader from './PageHeader.svelte';
6
6
  import TableCustom from './TableCustom.svelte';
@@ -1,7 +1,7 @@
1
1
  <script>import { sendUserToast } from '../utils';
2
2
  import Switch from './Switch.svelte';
3
3
  import { createEventDispatcher } from 'svelte';
4
- import { UserService } from '../gen';
4
+ import { UserService } from '../gen/index';
5
5
  const dispatch = createEventDispatcher();
6
6
  let valid = true;
7
7
  let modal;
@@ -2,7 +2,7 @@
2
2
  import Switch from './Switch.svelte';
3
3
  import { createEventDispatcher } from 'svelte';
4
4
  import { workspaceStore } from '../stores';
5
- import { WorkspaceService } from '../gen';
5
+ import { WorkspaceService } from '../gen/index';
6
6
  const dispatch = createEventDispatcher();
7
7
  let valid = true;
8
8
  let modal;
@@ -1,5 +1,5 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { CompletedJob, QueuedJob } from '../gen';
2
+ import type { CompletedJob, QueuedJob } from '../gen/index';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  job: QueuedJob | CompletedJob | undefined;
@@ -1,6 +1,6 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  import type { Schema } from '../common';
3
- import type { Flow, FlowModule } from '../gen';
3
+ import type { Flow, FlowModule } from '../gen/index';
4
4
  import SchemaForm from './SchemaForm.svelte';
5
5
  declare const __propDef: {
6
6
  props: {
@@ -1,4 +1,4 @@
1
- <script>import { ResourceService } from '../gen';
1
+ <script>import { ResourceService } from '../gen/index';
2
2
  import ResourcePicker from './ResourcePicker.svelte';
3
3
  import { workspaceStore } from '../stores';
4
4
  import SchemaForm from './SchemaForm.svelte';
@@ -1,5 +1,5 @@
1
1
  <script>import { pathToMeta } from '../common';
2
- import { GroupService } from '../gen';
2
+ import { GroupService } from '../gen/index';
3
3
  import Tooltip from './Tooltip.svelte';
4
4
  import { userStore, workspaceStore } from '../stores';
5
5
  import { sleep } from '../utils';
@@ -1,4 +1,4 @@
1
- <script>import { ResourceService, VariableService } from '../gen';
1
+ <script>import { ResourceService, VariableService } from '../gen/index';
2
2
  import { allTrue, emptySchema, sendUserToast } from '../utils';
3
3
  import { createEventDispatcher } from 'svelte';
4
4
  import Modal from './Modal.svelte';
@@ -1,4 +1,4 @@
1
- <script>import { ResourceService } from '../gen';
1
+ <script>import { ResourceService } from '../gen/index';
2
2
  import { workspaceStore } from '../stores';
3
3
  let resources = [];
4
4
  export let value;
@@ -1,5 +1,5 @@
1
1
  <script>import { createEventDispatcher } from 'svelte';
2
- import { ResourceService } from '../gen';
2
+ import { ResourceService } from '../gen/index';
3
3
  import { workspaceStore } from '../stores';
4
4
  import IconedResourceType from './IconedResourceType.svelte';
5
5
  let resources = [];
@@ -1,5 +1,5 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { Script, Flow } from '../gen';
2
+ import type { Script, Flow } from '../gen/index';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  runnable: Script | Flow | undefined;
@@ -46,7 +46,7 @@ export async function main(x: string, y: string = 'default arg') {
46
46
  `
47
47
  </script>
48
48
 
49
- <script>import { ScriptService } from '../gen';
49
+ <script>import { ScriptService } from '../gen/index';
50
50
  import { emptySchema, sendUserToast } from '../utils';
51
51
  import { onDestroy } from 'svelte';
52
52
  import ScriptEditor from './ScriptEditor.svelte';
@@ -1,5 +1,5 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import { type Script } from '../gen';
2
+ import { type Script } from '../gen/index';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  script: Script;
@@ -1,4 +1,4 @@
1
- <script>import { JobService, Job, CompletedJob, VariableService, ResourceService, ScriptService } from '../gen';
1
+ <script>import { JobService, Job, CompletedJob, VariableService, ResourceService, ScriptService } from '../gen/index';
2
2
  import { sendUserToast, emptySchema, displayDate } from '../utils';
3
3
  import { fade } from 'svelte/transition';
4
4
  import Icon from 'svelte-awesome';
@@ -1,5 +1,5 @@
1
1
  <script>import { sendUserToast } from '../utils';
2
- import { ScriptService, FlowService, Script } from '../gen';
2
+ import { ScriptService, FlowService, Script } from '../gen/index';
3
3
  import Icon from 'svelte-awesome';
4
4
  import { faSearch } from '@fortawesome/free-solid-svg-icons';
5
5
  import { hubScripts, workspaceStore } from '../stores';
@@ -2,7 +2,7 @@
2
2
  import TableCustom from './TableCustom.svelte';
3
3
  import { GranularAclService } from '../gen/services/GranularAclService';
4
4
  import { sendUserToast } from '../utils';
5
- import { GroupService, UserService } from '../gen';
5
+ import { GroupService, UserService } from '../gen/index';
6
6
  import { createEventDispatcher } from 'svelte';
7
7
  import AutoComplete from 'simple-svelte-autocomplete';
8
8
  import { workspaceStore } from '../stores';
@@ -1,6 +1,6 @@
1
1
  <script>import Password from './Password.svelte';
2
2
  import { sendUserToast } from '../utils';
3
- import { VariableService } from '../gen';
3
+ import { VariableService } from '../gen/index';
4
4
  import AutosizedTextarea from './AutosizedTextarea.svelte';
5
5
  import Path from './Path.svelte';
6
6
  import Modal from './Modal.svelte';
package/infer.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ScriptService } from './gen';
1
+ import { ScriptService } from './gen/index';
2
2
  import { sendUserToast } from './utils';
3
3
  export async function inferArgs(language, code, schema) {
4
4
  try {
package/logout.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare function logoutWithRedirect(rd?: string): void;
2
+ export declare function logout(logoutMessage?: string): Promise<void>;
package/logout.js ADDED
@@ -0,0 +1,20 @@
1
+ import { goto } from '$app/navigation';
2
+ import { UserService } from './gen';
3
+ import { clearStores } from './stores';
4
+ import { sendUserToast } from './utils';
5
+ export function logoutWithRedirect(rd) {
6
+ const error = encodeURIComponent('You have been logged out because your session has expired.');
7
+ goto(`/user/login?error=${error}${rd ? '&rd=' + encodeURIComponent(rd) : ''}`);
8
+ }
9
+ export async function logout(logoutMessage) {
10
+ try {
11
+ clearStores();
12
+ await UserService.logout();
13
+ goto(`/user/login${logoutMessage ? '?error=' + encodeURIComponent(logoutMessage) : ''}`);
14
+ sendUserToast('you have been logged out');
15
+ }
16
+ catch (error) {
17
+ goto(`/user/login?error=${encodeURIComponent('There was a problem logging you out, check the logs')}`);
18
+ console.error(error);
19
+ }
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-components",
3
- "version": "1.13.4",
3
+ "version": "1.13.7",
4
4
  "devDependencies": {
5
5
  "@sveltejs/adapter-node": "^1.0.0-next.78",
6
6
  "@sveltejs/adapter-static": "^1.0.0-next.34",
@@ -170,6 +170,7 @@
170
170
  "./gen/services/WorkerService": "./gen/services/WorkerService.js",
171
171
  "./gen/services/WorkspaceService": "./gen/services/WorkspaceService.js",
172
172
  "./infer": "./infer.js",
173
+ "./logout": "./logout.js",
173
174
  "./stores": "./stores.js",
174
175
  "./utils": "./utils.js"
175
176
  }
package/stores.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { UserWorkspaceList } from './gen';
1
+ import type { UserWorkspaceList } from './gen/index';
2
2
  export interface UserExt {
3
3
  email: string;
4
4
  username: string;
package/utils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type User } from './gen';
1
+ import { type User } from './gen/index';
2
2
  import { type UserExt } from './stores';
3
3
  export declare function isToday(someDate: Date): boolean;
4
4
  export declare function daysAgo(someDate: Date): number;
@@ -9,11 +9,9 @@ export declare function getToday(): Date;
9
9
  export declare function sendUserToast(message: string, error?: boolean): void;
10
10
  export declare function truncateHash(hash: string): string;
11
11
  export declare function getUserExt(workspace: string): Promise<UserExt | undefined>;
12
- export declare function logoutWithRedirect(rd?: string): void;
13
12
  export declare function sleep(ms: number): Promise<void>;
14
13
  export declare function validatePassword(password: string): boolean;
15
14
  export declare function refreshSuperadmin(): Promise<void>;
16
- export declare function logout(logoutMessage?: string): Promise<void>;
17
15
  export declare function clickOutside(node: any): any;
18
16
  export declare function loadSchema(path: string): Promise<any>;
19
17
  export declare type DropdownType = 'action' | 'delete';
package/utils.js CHANGED
@@ -1,10 +1,9 @@
1
1
  /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
2
- import { goto } from '$app/navigation';
3
2
  import { toast } from '@zerodevx/svelte-toast';
4
3
  import { get } from 'svelte/store';
5
- import { ScriptService, UserService } from './gen';
4
+ import { ScriptService, UserService } from './gen/index';
6
5
  import { inferArgs } from './infer';
7
- import { clearStores, superadmin, workspaceStore } from './stores';
6
+ import { superadmin, workspaceStore } from './stores';
8
7
  export function isToday(someDate) {
9
8
  const today = new Date();
10
9
  return (someDate.getDate() == today.getDate() &&
@@ -73,10 +72,6 @@ export async function getUserExt(workspace) {
73
72
  return undefined;
74
73
  }
75
74
  }
76
- export function logoutWithRedirect(rd) {
77
- const error = encodeURIComponent('You have been logged out because your session has expired.');
78
- goto(`/user/login?error=${error}${rd ? '&rd=' + encodeURIComponent(rd) : ''}`);
79
- }
80
75
  export function sleep(ms) {
81
76
  return new Promise((resolve) => setTimeout(resolve, ms));
82
77
  }
@@ -96,18 +91,6 @@ export async function refreshSuperadmin() {
96
91
  });
97
92
  }
98
93
  }
99
- export async function logout(logoutMessage) {
100
- try {
101
- clearStores();
102
- await UserService.logout();
103
- goto(`/user/login${logoutMessage ? '?error=' + encodeURIComponent(logoutMessage) : ''}`);
104
- sendUserToast('you have been logged out');
105
- }
106
- catch (error) {
107
- goto(`/user/login?error=${encodeURIComponent('There was a problem logging you out, check the logs')}`);
108
- console.error(error);
109
- }
110
- }
111
94
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
112
95
  export function clickOutside(node) {
113
96
  const handleClick = (event) => {