windmill-components 1.382.3 → 1.382.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.
@@ -1,28 +1,16 @@
1
- <script>import Highlight from 'svelte-highlight';
2
- import json from 'svelte-highlight/languages/json';
3
- import { Tab, Tabs, TabContent, Button } from './common';
1
+ <script>import { Tab, Tabs, TabContent } from './common';
4
2
  import SchemaViewer from './SchemaViewer.svelte';
5
3
  import FieldHeader from './FieldHeader.svelte';
6
- import { copyToClipboard } from '../utils';
7
4
  import FlowGraphViewer from './FlowGraphViewer.svelte';
8
- import { Clipboard } from 'lucide-svelte';
9
- import YAML from 'yaml';
10
- import { yaml } from 'svelte-highlight/languages';
11
5
  import HighlightTheme from './HighlightTheme.svelte';
6
+ import FlowViewerInner from './FlowViewerInner.svelte';
12
7
  export let flow;
13
8
  export let initialOpen = undefined;
14
9
  export let noSide = false;
15
- $: flowFiltered = {
16
- summary: flow.summary,
17
- description: flow.description,
18
- value: flow.value,
19
- schema: flow.schema
20
- };
21
10
  export let noGraph = false;
22
11
  export let tab = noGraph ? 'schema' : 'ui';
23
12
  export let noSummary = false;
24
13
  export let noGraphDownload = false;
25
- let rawType = 'yaml';
26
14
  let open = {};
27
15
  if (initialOpen) {
28
16
  open[initialOpen] = true;
@@ -77,37 +65,8 @@ function toAny(x) {
77
65
  <FlowGraphViewer download={!noGraphDownload} {noSide} {flow} overflowAuto />
78
66
  </div>
79
67
  </TabContent>
80
- <TabContent value="raw"
81
- ><Tabs bind:selected={rawType} wrapperClass="mt-4">
82
- <Tab value="yaml">YAML</Tab>
83
- <Tab value="json">JSON</Tab>
84
- <svelte:fragment slot="content">
85
- <div class="relative pt-2">
86
- <Button
87
- on:click={() =>
88
- copyToClipboard(
89
- rawType === 'yaml'
90
- ? YAML.stringify(flowFiltered)
91
- : JSON.stringify(flowFiltered, null, 4)
92
- )}
93
- color="light"
94
- variant="border"
95
- size="xs"
96
- startIcon={{ icon: Clipboard }}
97
- btnClasses="absolute top-2 right-2 w-min"
98
- >
99
- Copy content
100
- </Button>
101
- <Highlight
102
- class="overflow-auto px-1"
103
- language={rawType === 'yaml' ? yaml : json}
104
- code={rawType === 'yaml'
105
- ? YAML.stringify(flowFiltered)
106
- : JSON.stringify(flowFiltered, null, 4)}
107
- />
108
- </div>
109
- </svelte:fragment>
110
- </Tabs>
68
+ <TabContent value="raw">
69
+ <FlowViewerInner {flow} />
111
70
  </TabContent>
112
71
  <TabContent value="schema">
113
72
  <div class="my-4" />
@@ -0,0 +1,109 @@
1
+ <script>import Highlight from 'svelte-highlight';
2
+ import json from 'svelte-highlight/languages/json';
3
+ import { Tab, Tabs, Button } from './common';
4
+ import { copyToClipboard } from '../utils';
5
+ import { ArrowDown, Clipboard } from 'lucide-svelte';
6
+ import YAML from 'yaml';
7
+ import { yaml } from 'svelte-highlight/languages';
8
+ import HighlightTheme from './HighlightTheme.svelte';
9
+ export let flow;
10
+ $: flowFiltered = {
11
+ summary: flow.summary,
12
+ description: flow.description,
13
+ value: flow.value,
14
+ schema: flow.schema
15
+ };
16
+ let rawType = 'yaml';
17
+ function trimStringToLines(inputString, maxLines = 100) {
18
+ const lines = inputString?.split('\n') ?? [];
19
+ const linesToKeep = lines.slice(0, maxLines);
20
+ return linesToKeep.join('\n');
21
+ }
22
+ let code = '';
23
+ function computeCode() {
24
+ const str = rawType === 'json' ? JSON.stringify(flowFiltered, null, 4) : YAML.stringify(flowFiltered);
25
+ const numberOfLines = str.split('\n').length;
26
+ if (numberOfLines > maxLines) {
27
+ shouldDisplayLoadMore = true;
28
+ }
29
+ code = str;
30
+ }
31
+ let shouldDisplayLoadMore = false;
32
+ $: flowFiltered && rawType && computeCode();
33
+ let maxLines = 100;
34
+ </script>
35
+
36
+ <HighlightTheme />
37
+
38
+ <div>
39
+ <Tabs
40
+ bind:selected={rawType}
41
+ on:selected={() => {
42
+ maxLines = 100
43
+ }}
44
+ >
45
+ <Tab value="yaml">YAML</Tab>
46
+ <Tab value="json">JSON</Tab>
47
+ <svelte:fragment slot="content">
48
+ <div class="relative pt-2">
49
+ <Button
50
+ on:click={() =>
51
+ copyToClipboard(
52
+ rawType === 'yaml'
53
+ ? YAML.stringify(flowFiltered)
54
+ : JSON.stringify(flowFiltered, null, 4)
55
+ )}
56
+ color="light"
57
+ variant="border"
58
+ size="xs"
59
+ startIcon={{ icon: Clipboard }}
60
+ btnClasses="absolute top-2 right-2 w-min"
61
+ >
62
+ Copy content
63
+ </Button>
64
+
65
+ <div class={shouldDisplayLoadMore ? 'code-container' : ''}>
66
+ <Highlight
67
+ class="overflow-auto px-1"
68
+ language={rawType === 'yaml' ? yaml : json}
69
+ code={trimStringToLines(code, maxLines)}
70
+ />
71
+ </div>
72
+ {#if shouldDisplayLoadMore}
73
+ <Button
74
+ on:click={() => {
75
+ maxLines += 500
76
+
77
+ // If the code is less than the max lines, we don't need to show the button
78
+ if (maxLines >= code?.split('\n').length) {
79
+ shouldDisplayLoadMore = false
80
+ }
81
+ }}
82
+ color="light"
83
+ size="xs"
84
+ btnClasses="mb-2 mx-2"
85
+ startIcon={{ icon: ArrowDown }}
86
+ >
87
+ Show more
88
+ </Button>
89
+ {/if}
90
+ </div>
91
+ </svelte:fragment>
92
+ </Tabs>
93
+ </div>
94
+
95
+ <style>
96
+ .code-container {
97
+ position: relative;
98
+ overflow: hidden;
99
+ }
100
+ .code-container::after {
101
+ content: '';
102
+ position: absolute;
103
+ bottom: 0;
104
+ left: 0;
105
+ right: 0;
106
+ height: 100px;
107
+ background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgb(var(--color-surface)));
108
+ pointer-events: none;
109
+ }</style>
@@ -0,0 +1,22 @@
1
+ import { SvelteComponent } from "svelte";
2
+ import type { FlowValue } from '../gen';
3
+ declare const __propDef: {
4
+ props: {
5
+ flow: {
6
+ summary: string;
7
+ description?: string;
8
+ value: FlowValue;
9
+ schema?: any;
10
+ };
11
+ };
12
+ events: {
13
+ [evt: string]: CustomEvent<any>;
14
+ };
15
+ slots: {};
16
+ };
17
+ export type FlowViewerInnerProps = typeof __propDef.props;
18
+ export type FlowViewerInnerEvents = typeof __propDef.events;
19
+ export type FlowViewerInnerSlots = typeof __propDef.slots;
20
+ export default class FlowViewerInner extends SvelteComponent<FlowViewerInnerProps, FlowViewerInnerEvents, FlowViewerInnerSlots> {
21
+ }
22
+ export {};
@@ -38,16 +38,18 @@ export let template = 'script';
38
38
  export let initialArgs = {};
39
39
  export let lockedLanguage = false;
40
40
  export let showMeta = false;
41
+ export let neverShowMeta = false;
41
42
  export let diffDrawer = undefined;
42
43
  export let savedScript = undefined;
43
44
  export let searchParams = new URLSearchParams();
44
45
  export let disableHistoryChange = false;
45
46
  export let replaceStateFn = (url) => window.history.replaceState(null, '', url);
46
47
  export let customUi = {};
47
- let metadataOpen = showMeta ||
48
- (initialPath == '' &&
49
- searchParams.get('state') == undefined &&
50
- searchParams.get('collab') == undefined);
48
+ let metadataOpen = !neverShowMeta &&
49
+ (showMeta ||
50
+ (initialPath == '' &&
51
+ searchParams.get('state') == undefined &&
52
+ searchParams.get('collab') == undefined));
51
53
  let editor = undefined;
52
54
  let scriptEditor = undefined;
53
55
  let scheduleStore = writable({
@@ -11,6 +11,7 @@ declare const __propDef: {
11
11
  initialArgs?: Record<string, any> | undefined;
12
12
  lockedLanguage?: boolean | undefined;
13
13
  showMeta?: boolean | undefined;
14
+ neverShowMeta?: boolean | undefined;
14
15
  diffDrawer?: DiffDrawer | undefined;
15
16
  savedScript?: NewScriptWithDraft | undefined;
16
17
  searchParams?: URLSearchParams | undefined;
@@ -1,18 +1,13 @@
1
- <script>import { Tabs, Tab, TabContent, Button } from '../common';
2
- import { copyToClipboard } from '../../utils';
3
- import { CalendarCheck2, Clipboard, MailIcon, Terminal, Webhook } from 'lucide-svelte';
4
- import { Highlight } from 'svelte-highlight';
5
- import { yaml } from 'svelte-highlight/languages';
6
- import json from 'svelte-highlight/languages/json';
1
+ <script>import { Tabs, Tab, TabContent } from '../common';
2
+ import { CalendarCheck2, MailIcon, Terminal, Webhook } from 'lucide-svelte';
7
3
  import { Pane, Splitpanes } from 'svelte-splitpanes';
8
- import YAML from 'yaml';
9
4
  import HighlightTheme from '../HighlightTheme.svelte';
5
+ import FlowViewerInner from '../FlowViewerInner.svelte';
10
6
  export let triggerSelected = 'webhooks';
11
7
  export let flow_json = undefined;
12
8
  export let hasStepDetails = false;
13
9
  export let isOperator = false;
14
10
  export let selected;
15
- let rawType = 'yaml';
16
11
  $: if (hasStepDetails) {
17
12
  selected = 'flow_step';
18
13
  }
@@ -90,36 +85,7 @@ $: !hasStepDetails && selected === 'flow_step' && (selected = 'saved_inputs');
90
85
  </Splitpanes>
91
86
  </TabContent>
92
87
  <TabContent value="raw" class="flex flex-col flex-1 h-full overflow-auto">
93
- <Tabs bind:selected={rawType} wrapperClass="mt-4">
94
- <Tab value="yaml">YAML</Tab>
95
- <Tab value="json">JSON</Tab>
96
- <svelte:fragment slot="content">
97
- <div class="relative pt-2">
98
- <Button
99
- on:click={() =>
100
- copyToClipboard(
101
- rawType === 'yaml'
102
- ? YAML.stringify(flow_json)
103
- : JSON.stringify(flow_json, null, 4)
104
- )}
105
- color="light"
106
- variant="border"
107
- size="xs"
108
- startIcon={{ icon: Clipboard }}
109
- btnClasses="absolute top-2 right-2 w-min"
110
- >
111
- Copy content
112
- </Button>
113
- <Highlight
114
- class="overflow-auto px-1"
115
- language={rawType === 'yaml' ? yaml : json}
116
- code={rawType === 'yaml'
117
- ? YAML.stringify(flow_json)
118
- : JSON.stringify(flow_json, null, 4)}
119
- />
120
- </div>
121
- </svelte:fragment>
122
- </Tabs>
88
+ <FlowViewerInner flow={flow_json} />
123
89
  </TabContent>
124
90
  <TabContent value="flow_step" class="flex flex-col flex-1 h-full">
125
91
  <slot name="flow_step" />
@@ -21,7 +21,7 @@ export const OpenAPI = {
21
21
  PASSWORD: undefined,
22
22
  TOKEN: undefined,
23
23
  USERNAME: undefined,
24
- VERSION: '1.381.0',
24
+ VERSION: '1.382.2',
25
25
  WITH_CREDENTIALS: false,
26
26
  interceptors: {
27
27
  request: new Interceptors(),
@@ -2550,6 +2550,18 @@ export declare const $FlowModule: {
2550
2550
  };
2551
2551
  readonly required: readonly ["expr"];
2552
2552
  };
2553
+ readonly stop_after_all_iters_if: {
2554
+ readonly type: "object";
2555
+ readonly properties: {
2556
+ readonly skip_if_stopped: {
2557
+ readonly type: "boolean";
2558
+ };
2559
+ readonly expr: {
2560
+ readonly type: "string";
2561
+ };
2562
+ };
2563
+ readonly required: readonly ["expr"];
2564
+ };
2553
2565
  readonly sleep: {
2554
2566
  readonly $ref: "#/components/schemas/InputTransform";
2555
2567
  };
@@ -2592,6 +2592,18 @@ export const $FlowModule = {
2592
2592
  },
2593
2593
  required: ['expr']
2594
2594
  },
2595
+ stop_after_all_iters_if: {
2596
+ type: 'object',
2597
+ properties: {
2598
+ skip_if_stopped: {
2599
+ type: 'boolean'
2600
+ },
2601
+ expr: {
2602
+ type: 'string'
2603
+ }
2604
+ },
2605
+ required: ['expr']
2606
+ },
2595
2607
  sleep: {
2596
2608
  '$ref': '#/components/schemas/InputTransform'
2597
2609
  },
@@ -3332,14 +3332,15 @@ export declare class ServiceLogsService {
3332
3332
  /**
3333
3333
  * list log files ordered by timestamp
3334
3334
  * @param data The data for the request.
3335
- * @param data.startedBefore filter on started before (inclusive) timestamp
3336
- * @param data.startedAfter filter on started after (exclusive) timestamp
3335
+ * @param data.before filter on started before (inclusive) timestamp
3336
+ * @param data.after filter on created after (exclusive) timestamp
3337
+ * @param data.withError
3337
3338
  * @returns unknown time
3338
3339
  * @throws ApiError
3339
3340
  */
3340
3341
  static listLogFiles(data?: ListLogFilesData): CancelablePromise<ListLogFilesResponse>;
3341
3342
  /**
3342
- * get log stream from log files
3343
+ * get log file by path
3343
3344
  * @param data The data for the request.
3344
3345
  * @param data.path
3345
3346
  * @returns string log stream
@@ -6704,8 +6704,9 @@ export class ServiceLogsService {
6704
6704
  /**
6705
6705
  * list log files ordered by timestamp
6706
6706
  * @param data The data for the request.
6707
- * @param data.startedBefore filter on started before (inclusive) timestamp
6708
- * @param data.startedAfter filter on started after (exclusive) timestamp
6707
+ * @param data.before filter on started before (inclusive) timestamp
6708
+ * @param data.after filter on created after (exclusive) timestamp
6709
+ * @param data.withError
6709
6710
  * @returns unknown time
6710
6711
  * @throws ApiError
6711
6712
  */
@@ -6714,13 +6715,14 @@ export class ServiceLogsService {
6714
6715
  method: 'GET',
6715
6716
  url: '/service_logs/list_files',
6716
6717
  query: {
6717
- started_before: data.startedBefore,
6718
- started_after: data.startedAfter
6718
+ before: data.before,
6719
+ after: data.after,
6720
+ with_error: data.withError
6719
6721
  }
6720
6722
  });
6721
6723
  }
6722
6724
  /**
6723
- * get log stream from log files
6725
+ * get log file by path
6724
6726
  * @param data The data for the request.
6725
6727
  * @param data.path
6726
6728
  * @returns string log stream
@@ -838,6 +838,10 @@ export type FlowModule = {
838
838
  skip_if_stopped?: boolean;
839
839
  expr: string;
840
840
  };
841
+ stop_after_all_iters_if?: {
842
+ skip_if_stopped?: boolean;
843
+ expr: string;
844
+ };
841
845
  sleep?: InputTransform;
842
846
  cache_ttl?: number;
843
847
  timeout?: number;
@@ -4692,13 +4696,14 @@ export type GetJobMetricsResponse = {
4692
4696
  };
4693
4697
  export type ListLogFilesData = {
4694
4698
  /**
4695
- * filter on started after (exclusive) timestamp
4699
+ * filter on created after (exclusive) timestamp
4696
4700
  */
4697
- startedAfter?: string;
4701
+ after?: string;
4698
4702
  /**
4699
4703
  * filter on started before (inclusive) timestamp
4700
4704
  */
4701
- startedBefore?: string;
4705
+ before?: string;
4706
+ withError?: boolean;
4702
4707
  };
4703
4708
  export type ListLogFilesResponse = Array<{
4704
4709
  hostname: string;
@@ -4706,7 +4711,8 @@ export type ListLogFilesResponse = Array<{
4706
4711
  worker_group?: string;
4707
4712
  log_ts: string;
4708
4713
  file_path: string;
4709
- byte_size?: number;
4714
+ ok_lines?: number;
4715
+ err_lines?: number;
4710
4716
  }>;
4711
4717
  export type GetLogFileData = {
4712
4718
  path: string;
@@ -11228,13 +11234,14 @@ export type $OpenApiTs = {
11228
11234
  get: {
11229
11235
  req: {
11230
11236
  /**
11231
- * filter on started after (exclusive) timestamp
11237
+ * filter on created after (exclusive) timestamp
11232
11238
  */
11233
- startedAfter?: string;
11239
+ after?: string;
11234
11240
  /**
11235
11241
  * filter on started before (inclusive) timestamp
11236
11242
  */
11237
- startedBefore?: string;
11243
+ before?: string;
11244
+ withError?: boolean;
11238
11245
  };
11239
11246
  res: {
11240
11247
  /**
@@ -11246,7 +11253,8 @@ export type $OpenApiTs = {
11246
11253
  worker_group?: string;
11247
11254
  log_ts: string;
11248
11255
  file_path: string;
11249
- byte_size?: number;
11256
+ ok_lines?: number;
11257
+ err_lines?: number;
11250
11258
  }>;
11251
11259
  };
11252
11260
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-components",
3
- "version": "1.382.3",
3
+ "version": "1.382.7",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build",