windmill-components 1.501.15 → 1.501.17

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.
@@ -0,0 +1,6 @@
1
+ <script lang="ts">import AppEditor from './apps/editor/AppEditor.svelte';
2
+ let { app: oldApp, ...props } = $props();
3
+ let app = $state(oldApp);
4
+ </script>
5
+
6
+ <AppEditor {app} {...props} />
@@ -1,26 +1,4 @@
1
+ import type { AppEditorProps } from './apps/types';
2
+ declare const AppWrapper: import("svelte").Component<AppEditorProps, {}, "">;
3
+ type AppWrapper = ReturnType<typeof AppWrapper>;
1
4
  export default AppWrapper;
2
- type AppWrapper = SvelteComponent<{
3
- [x: string]: never;
4
- }, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> & {
7
- $$bindings?: string | undefined;
8
- };
9
- declare const AppWrapper: $$__sveltets_2_IsomorphicComponent<{
10
- [x: string]: never;
11
- }, {
12
- [evt: string]: CustomEvent<any>;
13
- }, {}, {}, string>;
14
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
15
- new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
16
- $$bindings?: Bindings;
17
- } & Exports;
18
- (internal: unknown, props: {
19
- $$events?: Events;
20
- $$slots?: Slots;
21
- }): Exports & {
22
- $set?: any;
23
- $on?: any;
24
- };
25
- z_$$bindings?: Bindings;
26
- }
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">import { createEventDispatcher, onDestroy, getContext, untrack } from 'svelte';
2
- import { getFirstStepSchema } from './flows/flowStore.svelte';
2
+ import { getFirstStepSchema } from './flows/flowStore';
3
3
  import { twMerge } from 'tailwind-merge';
4
4
  import { Alert } from './common';
5
5
  import FlowModuleSchemaItemViewer from './flows/map/FlowModuleSchemaItemViewer.svelte';
@@ -7,6 +7,6 @@ interface Props {
7
7
  inlineEditorOpened: boolean;
8
8
  initializing?: boolean | undefined;
9
9
  }
10
- declare const ComponentInner: import("svelte").Component<Props, {}, "inlineEditorOpened" | "errorHandledByComponent" | "initializing">;
10
+ declare const ComponentInner: import("svelte").Component<Props, {}, "initializing" | "errorHandledByComponent" | "inlineEditorOpened">;
11
11
  type ComponentInner = ReturnType<typeof ComponentInner>;
12
12
  export default ComponentInner;
@@ -4,7 +4,7 @@ import BarsStaggered from '../icons/BarsStaggered.svelte';
4
4
  import { Button } from '../common';
5
5
  import Drawer from '../common/drawer/Drawer.svelte';
6
6
  import DrawerContent from '../common/drawer/DrawerContent.svelte';
7
- import { importFlowStore } from './flowStore.svelte';
7
+ import { importFlowStore } from './flowStore';
8
8
  import { Loader2, Plus } from 'lucide-svelte';
9
9
  import YAML from 'yaml';
10
10
  let drawer = $state(undefined);
@@ -5,53 +5,9 @@ import type { StateStore } from '../../utils';
5
5
  export type FlowMode = 'push' | 'pull';
6
6
  export declare const importFlowStore: Writable<Flow | undefined>;
7
7
  export declare function initFlow(flow: Flow, flowStore: StateStore<Flow>, flowStateStore: Writable<FlowState>): Promise<void>;
8
- export declare function copyFirstStepSchema(flowState: FlowState, flowStore: Writable<OpenFlow>): Promise<void>;
9
- export declare function getFirstStepSchema(flowState: FlowState, flowStore: StateStore<OpenFlow>): Promise<{
10
- schema: {
11
- $schema: string | undefined;
12
- type: string;
13
- properties: {
14
- [x: string]: {
15
- type: string | undefined;
16
- description?: string | undefined;
17
- pattern?: string | undefined;
18
- default?: any;
19
- enum?: string[] | undefined;
20
- contentEncoding?: "base64" | "binary" | undefined;
21
- format?: string | undefined;
22
- items?: {
23
- type?: "string" | "number" | "bytes" | "object" | "resource" | undefined;
24
- contentEncoding?: "base64" | undefined;
25
- enum?: string[] | undefined;
26
- resourceType?: string | undefined;
27
- properties?: {
28
- [x: string]: /*elided*/ any;
29
- } | undefined;
30
- } | undefined;
31
- min?: number | undefined;
32
- max?: number | undefined;
33
- currency?: string | undefined;
34
- currencyLocale?: string | undefined;
35
- multiselect?: boolean | undefined;
36
- customErrorMessage?: string | undefined;
37
- properties?: {
38
- [x: string]: /*elided*/ any;
39
- } | undefined;
40
- required?: string[] | undefined;
41
- showExpr?: string | undefined;
42
- password?: boolean | undefined;
43
- order?: string[] | undefined;
44
- nullable?: boolean | undefined;
45
- dateFormat?: string | undefined;
46
- title?: string | undefined;
47
- placeholder?: string | undefined;
48
- oneOf?: /*elided*/ any[] | undefined;
49
- originalType?: string | undefined;
50
- };
51
- };
52
- order?: string[] | undefined;
53
- required: string[];
54
- } | undefined;
8
+ export declare function copyFirstStepSchema(flowState: FlowState, flowStore: StateStore<OpenFlow>): Promise<void>;
9
+ export declare function getFirstStepSchema(flowState: FlowState, flow: OpenFlow): Promise<{
10
+ schema: import("../../common").Schema | undefined;
55
11
  mod: {
56
12
  id: string;
57
13
  summary: string | undefined;
@@ -1,41 +1,35 @@
1
1
  import { writable } from 'svelte/store';
2
2
  import { initFlowState } from './flowState';
3
3
  import { sendUserToast } from '../../toast';
4
- import { stateSnapshot } from '../../svelte5Utils.svelte';
5
4
  export const importFlowStore = writable(undefined);
6
5
  export async function initFlow(flow, flowStore, flowStateStore) {
7
6
  await initFlowState(flow, flowStateStore);
8
7
  flowStore.val = flow;
9
8
  }
10
9
  export async function copyFirstStepSchema(flowState, flowStore) {
11
- flowStore.update((flow) => {
12
- const firstModuleId = flow.value.modules[0]?.id;
13
- if (flowState[firstModuleId] && firstModuleId) {
14
- flow.schema = structuredClone(stateSnapshot(flowState[firstModuleId].schema));
15
- const v = flow.value.modules[0].value;
16
- if (v.type == 'rawscript' || v.type == 'script') {
17
- Object.keys(v.input_transforms ?? {}).forEach((key) => {
18
- v.input_transforms[key] = {
19
- type: 'javascript',
20
- expr: `flow_input.${key}`
21
- };
22
- });
23
- return flow;
24
- }
25
- sendUserToast('Only scripts can be used as a input schema', true);
26
- return flow;
10
+ const firstModuleId = flowStore.val.value.modules[0]?.id;
11
+ if (flowState[firstModuleId] && firstModuleId) {
12
+ flowStore.val.schema = structuredClone($state.snapshot(flowState[firstModuleId].schema));
13
+ const v = flowStore.val.value.modules[0].value;
14
+ if (v.type == 'rawscript' || v.type == 'script') {
15
+ Object.keys(v.input_transforms ?? {}).forEach((key) => {
16
+ v.input_transforms[key] = {
17
+ type: 'javascript',
18
+ expr: `flow_input.${key}`
19
+ };
20
+ });
21
+ return;
27
22
  }
28
- sendUserToast('No first step found', true);
29
- return flow;
30
- });
23
+ return sendUserToast('Only scripts can be used as a input schema', true);
24
+ }
25
+ return sendUserToast('No first step found', true);
31
26
  }
32
- export async function getFirstStepSchema(flowState, flowStore) {
33
- const flow = flowStore.val;
27
+ export async function getFirstStepSchema(flowState, flow) {
34
28
  const firstModuleId = flow.value.modules[0]?.id;
35
29
  if (!firstModuleId || !flowState[firstModuleId]) {
36
30
  throw new Error('no first step found');
37
31
  }
38
- const schema = structuredClone(stateSnapshot(flowState[firstModuleId].schema));
32
+ const schema = structuredClone(flowState[firstModuleId].schema);
39
33
  const v = flow.value.modules[0].value;
40
34
  if (v.type !== 'rawscript' && v.type !== 'script') {
41
35
  throw new Error('only scripts can be used as a input schema');
@@ -11,7 +11,7 @@ import { dfs as dfsPreviousResults } from '../previousResults';
11
11
  import { Drawer } from '../../common';
12
12
  import DrawerContent from '../../common/drawer/DrawerContent.svelte';
13
13
  import { getDependeeAndDependentComponents } from '../flowExplorer';
14
- import { replaceId } from '../flowStore.svelte';
14
+ import { replaceId } from '../flowStore';
15
15
  import FlowModuleSchemaItemViewer from './FlowModuleSchemaItemViewer.svelte';
16
16
  import OutputPicker from '../propPicker/OutputPicker.svelte';
17
17
  import OutputPickerInner from '../propPicker/OutputPickerInner.svelte';
@@ -11,7 +11,7 @@ import FlowTutorials from '../../FlowTutorials.svelte';
11
11
  import { ignoredTutorials } from '../../tutorials/ignoredTutorials';
12
12
  import { tutorialInProgress } from '../../../tutorialUtils';
13
13
  import FlowGraphV2 from '../../graph/FlowGraphV2.svelte';
14
- import { replaceId } from '../flowStore.svelte';
14
+ import { replaceId } from '../flowStore';
15
15
  import { setScheduledPollSchedule } from '../../triggers';
16
16
  import { JobService } from '../../../gen';
17
17
  import { dfsByModule } from '../previousResults';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-components",
3
- "version": "1.501.15",
3
+ "version": "1.501.17",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build",
@@ -1,22 +0,0 @@
1
- import type { Flow, OpenFlow } from '../../gen';
2
- import { type Writable } from 'svelte/store';
3
- import { type FlowState } from './flowState';
4
- import type { StateStore } from '../../utils';
5
- export type FlowMode = 'push' | 'pull';
6
- export declare const importFlowStore: Writable<Flow | undefined>;
7
- export declare function initFlow(flow: Flow, flowStore: StateStore<Flow>, flowStateStore: Writable<FlowState>): Promise<void>;
8
- export declare function copyFirstStepSchema(flowState: FlowState, flowStore: StateStore<OpenFlow>): Promise<void>;
9
- export declare function getFirstStepSchema(flowState: FlowState, flow: OpenFlow): Promise<{
10
- schema: import("../../common").Schema | undefined;
11
- mod: {
12
- id: string;
13
- summary: string | undefined;
14
- value: {
15
- language?: "deno" | "bun" | "python3" | "go" | "bash" | "powershell" | "postgresql" | "mysql" | "bigquery" | "snowflake" | "mssql" | "oracledb" | "graphql" | "nativets" | "php" | undefined;
16
- path?: string | undefined;
17
- type: "rawscript" | "script" | "flow" | "forloopflow" | "branchone" | "branchall" | "identity" | "whileloopflow";
18
- };
19
- };
20
- connectFirstNode: () => void;
21
- }>;
22
- export declare function replaceId(expr: string, id: string, newId: string): string;
@@ -1,65 +0,0 @@
1
- import { writable } from 'svelte/store';
2
- import { initFlowState } from './flowState';
3
- import { sendUserToast } from '../../toast';
4
- export const importFlowStore = writable(undefined);
5
- export async function initFlow(flow, flowStore, flowStateStore) {
6
- await initFlowState(flow, flowStateStore);
7
- flowStore.val = flow;
8
- }
9
- export async function copyFirstStepSchema(flowState, flowStore) {
10
- const firstModuleId = flowStore.val.value.modules[0]?.id;
11
- if (flowState[firstModuleId] && firstModuleId) {
12
- flowStore.val.schema = structuredClone($state.snapshot(flowState[firstModuleId].schema));
13
- const v = flowStore.val.value.modules[0].value;
14
- if (v.type == 'rawscript' || v.type == 'script') {
15
- Object.keys(v.input_transforms ?? {}).forEach((key) => {
16
- v.input_transforms[key] = {
17
- type: 'javascript',
18
- expr: `flow_input.${key}`
19
- };
20
- });
21
- return;
22
- }
23
- return sendUserToast('Only scripts can be used as a input schema', true);
24
- }
25
- return sendUserToast('No first step found', true);
26
- }
27
- export async function getFirstStepSchema(flowState, flow) {
28
- const firstModuleId = flow.value.modules[0]?.id;
29
- if (!firstModuleId || !flowState[firstModuleId]) {
30
- throw new Error('no first step found');
31
- }
32
- const schema = structuredClone(flowState[firstModuleId].schema);
33
- const v = flow.value.modules[0].value;
34
- if (v.type !== 'rawscript' && v.type !== 'script') {
35
- throw new Error('only scripts can be used as a input schema');
36
- }
37
- const simplifiedModule = {
38
- id: flow.value.modules[0].id,
39
- summary: flow.value.modules[0].summary,
40
- value: {
41
- type: flow.value.modules[0].value.type,
42
- ...('path' in flow.value.modules[0].value ? { path: flow.value.modules[0].value.path } : {}),
43
- ...('language' in flow.value.modules[0].value
44
- ? { language: flow.value.modules[0].value.language }
45
- : {})
46
- }
47
- };
48
- return {
49
- schema,
50
- mod: simplifiedModule,
51
- connectFirstNode: () => {
52
- Object.keys(v.input_transforms ?? {}).forEach((key) => {
53
- v.input_transforms[key] = {
54
- type: 'javascript',
55
- expr: `flow_input.${key}`
56
- };
57
- });
58
- }
59
- };
60
- }
61
- export function replaceId(expr, id, newId) {
62
- return expr
63
- .replaceAll(`results.${id}`, `results.${newId}`)
64
- .replaceAll(`results?.${id}`, `results?.${newId}`);
65
- }