windmill-components 1.55.0 → 1.55.2

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.
Files changed (203) hide show
  1. package/common.d.ts +1 -1
  2. package/common.js +3 -0
  3. package/components/AppConnect.svelte +2 -2
  4. package/components/ArgInput.svelte +1 -1
  5. package/components/CronInput.svelte +54 -53
  6. package/components/Dropdown.svelte +21 -9
  7. package/components/Editor.svelte +10 -10
  8. package/components/EditorBar.svelte +2 -2
  9. package/components/FlowBuilder.svelte +41 -25
  10. package/components/FlowGraphViewer.svelte +6 -2
  11. package/components/FlowMetadata.svelte +8 -3
  12. package/components/FlowViewer.svelte +2 -2
  13. package/components/FolderEditor.svelte +299 -0
  14. package/components/FolderEditor.svelte.d.ts +16 -0
  15. package/components/FolderInfo.svelte +13 -0
  16. package/components/FolderInfo.svelte.d.ts +16 -0
  17. package/components/FolderUsageInfo.svelte +17 -0
  18. package/components/FolderUsageInfo.svelte.d.ts +16 -0
  19. package/components/GroupEditor.svelte +287 -0
  20. package/components/GroupEditor.svelte.d.ts +18 -0
  21. package/components/GroupInfo.svelte +22 -0
  22. package/components/GroupInfo.svelte.d.ts +16 -0
  23. package/components/InputTransformForm.svelte +16 -7
  24. package/components/MoveDrawer.svelte +75 -0
  25. package/components/MoveDrawer.svelte.d.ts +19 -0
  26. package/components/Path.svelte +243 -96
  27. package/components/Path.svelte.d.ts +1 -4
  28. package/components/RadioButton.svelte +2 -0
  29. package/components/RadioButton.svelte.d.ts +1 -0
  30. package/components/ResourceEditor.svelte +11 -16
  31. package/components/RunForm.svelte +21 -4
  32. package/components/RunForm.svelte.d.ts +1 -1
  33. package/components/ScheduleEditor.svelte +226 -0
  34. package/components/ScheduleEditor.svelte.d.ts +26 -0
  35. package/components/ScriptBuilder.svelte +109 -114
  36. package/components/ScriptEditor.svelte +17 -14
  37. package/components/ScriptEditor.svelte.d.ts +1 -0
  38. package/components/ScriptPicker.svelte +55 -29
  39. package/components/ScriptPicker.svelte.d.ts +1 -0
  40. package/components/ShareModal.svelte +94 -73
  41. package/components/ShareModal.svelte.d.ts +2 -4
  42. package/components/SimpleEditor.svelte +15 -10
  43. package/components/TemplateEditor.svelte +496 -0
  44. package/components/TemplateEditor.svelte.d.ts +25 -0
  45. package/components/TestJobLoader.svelte +1 -1
  46. package/components/VariableEditor.svelte +2 -1
  47. package/components/apps/CreateApp.svelte +1 -1
  48. package/components/apps/components/buttons/AppButton.svelte +3 -3
  49. package/components/apps/components/dataDisplay/AppBarChart.svelte +5 -4
  50. package/components/apps/components/dataDisplay/AppPieChart.svelte +3 -3
  51. package/components/apps/components/dateInputs/AppDateInput.svelte +34 -0
  52. package/components/apps/components/dateInputs/AppDateInput.svelte.d.ts +22 -0
  53. package/components/apps/components/form/AppForm.svelte +4 -5
  54. package/components/apps/components/form/AppForm.svelte.d.ts +0 -1
  55. package/components/apps/components/helpers/AlignWrapper.svelte +3 -4
  56. package/components/apps/components/helpers/AlignWrapper.svelte.d.ts +2 -3
  57. package/components/apps/components/helpers/InputValue.svelte +54 -5
  58. package/components/apps/components/helpers/InputValue.svelte.d.ts +1 -0
  59. package/components/apps/components/helpers/NonRunnableComponent.svelte +2 -1
  60. package/components/apps/components/helpers/RefreshButton.svelte +20 -0
  61. package/components/apps/components/helpers/RefreshButton.svelte.d.ts +16 -0
  62. package/components/apps/components/helpers/RunnableComponent.svelte +38 -42
  63. package/components/apps/components/helpers/RunnableWrapper.svelte +6 -3
  64. package/components/apps/components/numberInputs/AppNumberInput.svelte +8 -11
  65. package/components/apps/components/numberInputs/AppNumberInput.svelte.d.ts +1 -0
  66. package/components/apps/components/selectInputs/AppCheckbox.svelte +1 -1
  67. package/components/apps/components/selectInputs/AppSelect.svelte +26 -0
  68. package/components/apps/components/selectInputs/AppSelect.svelte.d.ts +22 -0
  69. package/components/apps/components/table/AppTable.svelte +159 -0
  70. package/components/apps/components/{dataDisplay → table}/AppTable.svelte.d.ts +0 -0
  71. package/components/apps/components/table/AppTableFooter.svelte +54 -0
  72. package/components/apps/components/table/AppTableFooter.svelte.d.ts +20 -0
  73. package/components/apps/components/table/tableOptions.d.ts +10 -0
  74. package/components/apps/components/table/tableOptions.js +11 -0
  75. package/components/apps/components/textInputs/AppTextInput.svelte +17 -10
  76. package/components/apps/components/textInputs/AppTextInput.svelte.d.ts +2 -0
  77. package/components/apps/editor/AppEditor.svelte +35 -20
  78. package/components/apps/editor/AppEditorHeader.svelte +15 -7
  79. package/components/apps/editor/AppPreview.svelte +5 -3
  80. package/components/apps/editor/AppPreview.svelte.d.ts +4 -1
  81. package/components/apps/editor/ComponentEditor.svelte +21 -3
  82. package/components/apps/editor/ComponentEditor.svelte.d.ts +2 -0
  83. package/components/apps/editor/ComponentHeader.svelte +21 -4
  84. package/components/apps/editor/ComponentHeader.svelte.d.ts +2 -0
  85. package/components/apps/editor/GridEditor.svelte +40 -20
  86. package/components/apps/editor/RecomputeAllComponents.svelte +5 -7
  87. package/components/apps/editor/componentsPanel/ComponentList.svelte +30 -82
  88. package/components/apps/editor/componentsPanel/data.js +78 -29
  89. package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +5 -1
  90. package/components/apps/editor/contextPanel/ContextPanel.svelte +35 -152
  91. package/components/apps/editor/contextPanel/ContextPanel.svelte.d.ts +1 -3
  92. package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +64 -0
  93. package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte.d.ts +18 -0
  94. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +95 -0
  95. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte.d.ts +20 -0
  96. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte +32 -0
  97. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte.d.ts +19 -0
  98. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +63 -0
  99. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte.d.ts +17 -0
  100. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +44 -0
  101. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte.d.ts +14 -0
  102. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +126 -0
  103. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte.d.ts +16 -0
  104. package/components/apps/editor/settingsPanel/AlignmentEditor.svelte +41 -0
  105. package/components/apps/editor/settingsPanel/AlignmentEditor.svelte.d.ts +17 -0
  106. package/components/apps/editor/settingsPanel/ComponentInputTypeEditor.svelte +44 -0
  107. package/components/apps/editor/settingsPanel/ComponentInputTypeEditor.svelte.d.ts +18 -0
  108. package/components/apps/editor/settingsPanel/ComponentPanel.svelte +48 -130
  109. package/components/apps/editor/settingsPanel/ComponentPanel.svelte.d.ts +3 -0
  110. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +2 -2
  111. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +1 -1
  112. package/components/apps/editor/settingsPanel/Recompute.svelte +2 -2
  113. package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +46 -0
  114. package/components/apps/editor/settingsPanel/SelectedRunnable.svelte.d.ts +17 -0
  115. package/components/apps/editor/settingsPanel/SubTypeEditor.svelte +1 -1
  116. package/components/apps/editor/settingsPanel/common/PanelSection.svelte +1 -1
  117. package/components/apps/editor/settingsPanel/{ConnectedInputEditor.svelte → inputEditor/ConnectedInputEditor.svelte} +1 -2
  118. package/components/apps/editor/settingsPanel/{ConnectedInputEditor.svelte.d.ts → inputEditor/ConnectedInputEditor.svelte.d.ts} +1 -1
  119. package/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte +12 -0
  120. package/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte.d.ts +17 -0
  121. package/components/apps/editor/settingsPanel/{StaticInputEditor.svelte → inputEditor/StaticInputEditor.svelte} +5 -5
  122. package/components/apps/editor/settingsPanel/{StaticInputEditor.svelte.d.ts → inputEditor/StaticInputEditor.svelte.d.ts} +1 -1
  123. package/components/apps/editor/settingsPanel/mainInput/InlineScriptList.svelte +6 -3
  124. package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +66 -22
  125. package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte.d.ts +2 -3
  126. package/components/apps/editor/settingsPanel/mainInput/WorkspaceFlowList.svelte +1 -1
  127. package/components/apps/gridUtils.d.ts +3 -1
  128. package/components/apps/gridUtils.js +16 -1
  129. package/components/apps/inputType.d.ts +10 -4
  130. package/components/apps/rx.d.ts +8 -8
  131. package/components/apps/rx.js +17 -9
  132. package/components/apps/types.d.ts +14 -2
  133. package/components/apps/utils.d.ts +4 -3
  134. package/components/apps/utils.js +37 -5
  135. package/components/common/drawer/Drawer.svelte +1 -1
  136. package/components/common/drawer/Drawer.svelte.d.ts +1 -0
  137. package/components/common/popup/Popup.svelte +0 -2
  138. package/components/common/popup/Popup.svelte.d.ts +0 -4
  139. package/components/common/table/FlowRow.svelte +21 -7
  140. package/components/common/table/FlowRow.svelte.d.ts +2 -0
  141. package/components/common/table/ScriptRow.svelte +22 -7
  142. package/components/common/table/ScriptRow.svelte.d.ts +2 -0
  143. package/components/common/toggleButton/ToggleButton.svelte +1 -1
  144. package/components/common/toggleButton/ToggleButtonGroup.svelte +1 -1
  145. package/components/common/toggleButton/ToggleButtonGroup.svelte.d.ts +1 -0
  146. package/components/flows/content/FlowEditorPanel.svelte +10 -16
  147. package/components/flows/content/FlowInputs.svelte +18 -4
  148. package/components/flows/content/FlowInputs.svelte.d.ts +1 -0
  149. package/components/flows/content/FlowModuleComponent.svelte +1 -1
  150. package/components/flows/content/FlowModuleWrapper.svelte +26 -1
  151. package/components/flows/content/FlowSchedules.svelte +5 -0
  152. package/components/flows/content/FlowSettings.svelte +16 -24
  153. package/components/flows/content/FlowSettings.svelte.d.ts +0 -1
  154. package/components/flows/header/FlowPreviewButtons.svelte +13 -10
  155. package/components/flows/map/FlowErrorHandlerItem.svelte +1 -1
  156. package/components/flows/map/FlowModuleSchemaMap.svelte +12 -3
  157. package/components/flows/map/FlowSettingsItem.svelte +8 -15
  158. package/components/flows/map/InsertModuleButton.svelte +29 -2
  159. package/components/flows/map/InsertModuleButton.svelte.d.ts +3 -1
  160. package/components/flows/map/MapItem.svelte +2 -1
  161. package/components/flows/map/MapItem.svelte.d.ts +1 -0
  162. package/components/flows/pickers/WorkspaceScriptPicker.svelte +3 -0
  163. package/components/flows/previousResults.js +1 -1
  164. package/components/graph/FlowGraph.svelte +15 -15
  165. package/components/graph/model.d.ts +35 -1
  166. package/components/home/ItemsList.svelte +20 -12
  167. package/components/jobs/JobDetail.svelte +9 -3
  168. package/components/sidebar/SidebarContent.svelte +4 -3
  169. package/components/sidebar/UserMenu.svelte +1 -1
  170. package/editorUtils.d.ts +7 -1
  171. package/editorUtils.js +98 -3
  172. package/es5.d.ts.txt +4526 -0
  173. package/gen/index.d.ts +2 -0
  174. package/gen/index.js +1 -0
  175. package/gen/models/CompletedJob.d.ts +1 -0
  176. package/gen/models/EditSchedule.d.ts +0 -2
  177. package/gen/models/Folder.d.ts +5 -0
  178. package/gen/models/Folder.js +4 -0
  179. package/gen/models/QueuedJob.d.ts +1 -0
  180. package/gen/models/Script.d.ts +1 -1
  181. package/gen/models/User.d.ts +1 -0
  182. package/gen/services/FolderService.d.ts +128 -0
  183. package/gen/services/FolderService.js +151 -0
  184. package/gen/services/GranularAclService.d.ts +3 -3
  185. package/gen/services/GroupService.d.ts +5 -1
  186. package/gen/services/GroupService.js +4 -1
  187. package/gen/services/JobService.d.ts +25 -5
  188. package/gen/services/JobService.js +10 -5
  189. package/gen/services/ScriptService.d.ts +2 -1
  190. package/gen/services/UserService.d.ts +9 -0
  191. package/gen/services/UserService.js +15 -0
  192. package/package.json +485 -461
  193. package/script_helpers.d.ts +2 -2
  194. package/script_helpers.js +4 -4
  195. package/stores.d.ts +1 -0
  196. package/utils.d.ts +3 -0
  197. package/utils.js +44 -7
  198. package/components/GroupModal.svelte +0 -98
  199. package/components/GroupModal.svelte.d.ts +0 -17
  200. package/components/apps/components/dataDisplay/AppTable.svelte +0 -132
  201. package/components/apps/components/dataDisplay/app.md +0 -49
  202. package/components/apps/editor/contextPanel/InlineScriptCreationPanel.svelte +0 -29
  203. package/components/apps/editor/contextPanel/InlineScriptCreationPanel.svelte.d.ts +0 -16
@@ -14,6 +14,21 @@ function disableDrag(component) {
14
14
  });
15
15
  return component;
16
16
  }
17
+ function toggleFixed(component) {
18
+ gridColumns.forEach((column) => {
19
+ component[column].fixed = !component[column].fixed;
20
+ });
21
+ return component;
22
+ }
23
+ function isFixed(component) {
24
+ let fixed = false;
25
+ gridColumns.forEach((column) => {
26
+ if (component[column].fixed) {
27
+ fixed = true;
28
+ }
29
+ });
30
+ return fixed;
31
+ }
17
32
  function enableDrag(component) {
18
33
  gridColumns.forEach((column) => {
19
34
  component[column].customDragger = false;
@@ -21,4 +36,4 @@ function enableDrag(component) {
21
36
  });
22
37
  return component;
23
38
  }
24
- export { gridColumns, columnConfiguration, disableDrag, enableDrag, Breakpoints };
39
+ export { gridColumns, columnConfiguration, disableDrag, enableDrag, Breakpoints, toggleFixed, isFixed };
@@ -1,5 +1,6 @@
1
1
  import type { staticValues } from './editor/componentsPanel/componentStaticValues';
2
- export type InputType = 'text' | 'textarea' | 'number' | 'boolean' | 'select' | 'date' | 'time' | 'datetime' | 'object' | 'array';
2
+ import type { InlineScript } from './types';
3
+ export type InputType = 'text' | 'textarea' | 'number' | 'boolean' | 'select' | 'date' | 'time' | 'datetime' | 'object' | 'array' | 'any';
3
4
  export type InputConnection = {
4
5
  componentId: string;
5
6
  path: string;
@@ -17,13 +18,18 @@ export type StaticInput<U> = {
17
18
  type: 'static';
18
19
  visible?: boolean | undefined;
19
20
  };
21
+ export type TemplateInput = {
22
+ eval: string;
23
+ type: 'template';
24
+ };
20
25
  type RunnableByPath = {
21
26
  path: string;
22
27
  runType: 'script' | 'flow' | 'hubscript';
23
28
  type: 'runnableByPath';
24
29
  };
25
30
  type RunnableByName = {
26
- inlineScriptName: string;
31
+ name: string;
32
+ inlineScript: InlineScript | undefined;
27
33
  type: 'runnableByName';
28
34
  };
29
35
  export type Runnable = RunnableByPath | RunnableByName | undefined;
@@ -32,13 +38,13 @@ export type ResultInput = {
32
38
  fields: Record<string, StaticAppInput | ConnectedAppInput>;
33
39
  type: 'runnable';
34
40
  };
35
- type AppInputSpec<T extends InputType, U, V extends InputType = never> = (StaticInput<U> | ConnectedInput | UserInput<U> | ResultInput) & InputConfiguration<T, U, V>;
41
+ type AppInputSpec<T extends InputType, U, V extends InputType = never> = (StaticInput<U> | ConnectedInput | UserInput<U> | ResultInput | TemplateInput) & InputConfiguration<T, U, V>;
36
42
  type InputConfiguration<T extends InputType, U, V extends InputType> = {
37
43
  fieldType: T;
38
44
  defaultValue: U;
39
45
  subFieldType?: V;
40
46
  };
41
- export type AppInput = AppInputSpec<'text', string> | AppInputSpec<'textarea', string> | AppInputSpec<'number', number> | AppInputSpec<'boolean', boolean> | AppInputSpec<'date', string> | AppInputSpec<'time', string> | AppInputSpec<'datetime', string> | AppInputSpec<'object', Record<string | number, any>> | (AppInputSpec<'select', string> & {
47
+ export type AppInput = AppInputSpec<'text', string> | AppInputSpec<'textarea', string> | AppInputSpec<'number', number> | AppInputSpec<'boolean', boolean> | AppInputSpec<'date', string> | AppInputSpec<'time', string> | AppInputSpec<'datetime', string> | AppInputSpec<'any', any> | AppInputSpec<'object', Record<string | number, any>> | (AppInputSpec<'select', string> & {
42
48
  /**
43
49
  * One of the keys of `staticValues` from `lib/components/apps/editor/componentsPanel/componentStaticValues`
44
50
  */
@@ -1,4 +1,5 @@
1
1
  import type { AppInput } from './inputType';
2
+ import { type Writable } from 'svelte/store';
2
3
  export interface Subscriber<T> {
3
4
  next(v: T): any;
4
5
  }
@@ -7,21 +8,20 @@ export interface Observable<T> {
7
8
  }
8
9
  export interface Output<T> extends Observable<T> {
9
10
  set(x: T, force?: boolean): void;
11
+ peak(): T | any | undefined;
10
12
  }
11
13
  export interface Input<T> extends Subscriber<T> {
12
14
  peak(): T | any | undefined;
13
15
  }
14
16
  export type World = {
15
17
  outputsById: Record<string, Record<string, Output<any>>>;
16
- connect: <T>(inputSpec: AppInput, next: (x: T) => void) => Input<T>;
17
- };
18
- export declare function buildWorld(components: Record<string, string[]>): {
19
- outputsById: Record<string, Record<string, Output<any>>>;
20
- connect: <T>(inputSpec: AppInput, next: (x: T) => void) => Input<T>;
18
+ connect: <T>(inputSpec: AppInput, next: (x: T) => void, previousValue: T) => Input<T>;
19
+ state: Writable<number>;
21
20
  };
21
+ export declare function buildWorld(components: Record<string, string[]>, previousWorld: World | undefined): World;
22
22
  export declare function buildObservableWorld(): {
23
- connect: <T>(inputSpec: AppInput, next: (x: T) => void) => Input<T>;
24
- newOutput: <T_1>(id: string, name: string) => Output<T_1>;
23
+ connect: <T>(inputSpec: AppInput, next: (x: T) => void, previousValue: T) => Input<T>;
24
+ newOutput: <T_1>(id: string, name: string, state: Writable<number>, previousValue: T_1) => Output<T_1>;
25
25
  };
26
26
  export declare function cachedInput<T>(nextParan: (x: T) => void): Input<T>;
27
- export declare function settableOutput<T>(): Output<T>;
27
+ export declare function settableOutput<T>(state: Writable<number>, previousValue: T): Output<T>;
@@ -1,17 +1,20 @@
1
- export function buildWorld(components) {
1
+ import { writable } from 'svelte/store';
2
+ export function buildWorld(components, previousWorld) {
2
3
  const newWorld = buildObservableWorld();
3
4
  const outputsById = {};
5
+ const state = writable(0);
4
6
  for (const [k, outputs] of Object.entries(components)) {
5
7
  outputsById[k] = {};
6
8
  for (const o of outputs) {
7
- outputsById[k][o] = newWorld.newOutput(k, o);
9
+ outputsById[k][o] = newWorld.newOutput(k, o, state, previousWorld?.outputsById[k]?.[o].peak());
8
10
  }
9
11
  }
10
- return { outputsById, connect: newWorld.connect };
12
+ state.update((x) => x + 1);
13
+ return { outputsById, connect: newWorld.connect, state };
11
14
  }
12
15
  export function buildObservableWorld() {
13
16
  const observables = {};
14
- function connect(inputSpec, next) {
17
+ function connect(inputSpec, next, previousValue) {
15
18
  if (inputSpec.type === 'static') {
16
19
  return {
17
20
  peak: () => inputSpec.value,
@@ -50,8 +53,8 @@ export function buildObservableWorld() {
50
53
  throw Error('Unknown input type ' + inputSpec);
51
54
  }
52
55
  }
53
- function newOutput(id, name) {
54
- const output = settableOutput();
56
+ function newOutput(id, name, state, previousValue) {
57
+ const output = settableOutput(state, previousValue);
55
58
  observables[`${id}.${name}`] = output;
56
59
  return output;
57
60
  }
@@ -74,8 +77,8 @@ export function cachedInput(nextParan) {
74
77
  next
75
78
  };
76
79
  }
77
- export function settableOutput() {
78
- let value = undefined;
80
+ export function settableOutput(state, previousValue) {
81
+ let value = previousValue;
79
82
  const subscribers = [];
80
83
  function subscribe(x) {
81
84
  if (!subscribers.includes(x)) {
@@ -88,12 +91,17 @@ export function settableOutput() {
88
91
  }
89
92
  function set(x, force = false) {
90
93
  if (value != x || force) {
94
+ state.update((x) => x + 1);
91
95
  value = x;
92
96
  subscribers.forEach((x) => x.next(value));
93
97
  }
94
98
  }
99
+ function peak() {
100
+ return value;
101
+ }
95
102
  return {
96
103
  subscribe,
97
- set
104
+ set,
105
+ peak
98
106
  };
99
107
  }
@@ -9,6 +9,8 @@ type BaseComponent<T extends string> = {
9
9
  };
10
10
  export type TextComponent = BaseComponent<'textcomponent'>;
11
11
  export type TextInputComponent = BaseComponent<'textinputcomponent'>;
12
+ export type PasswordInputComponent = BaseComponent<'passwordinputcomponent'>;
13
+ export type DateInputComponent = BaseComponent<'dateinputcomponent'>;
12
14
  export type NumberInputComponent = BaseComponent<'numberinputcomponent'>;
13
15
  export type ButtonComponent = BaseComponent<'buttoncomponent'> & {
14
16
  recomputeIds: string[] | undefined;
@@ -39,8 +41,14 @@ export interface BaseAppComponent extends Partial<Aligned> {
39
41
  componentInput: AppInput | undefined;
40
42
  configuration: Record<string, StaticAppInput | ConnectedAppInput | UserAppInput>;
41
43
  card: boolean | undefined;
44
+ /**
45
+ * If `true` then the wrapper will allow items to flow outside of it's borders.
46
+ *
47
+ * *For example when the component has a popup like `Select`*
48
+ */
49
+ softWrap?: boolean;
42
50
  }
43
- export type AppComponent = BaseAppComponent & (RunFormComponent | DisplayComponent | TextInputComponent | NumberInputComponent | BarChartComponent | TableComponent | TextComponent | TableComponent | ButtonComponent | PieChartComponent | ImageComponent | InputComponent | SelectComponent | CheckboxComponent | RadioComponent | FormComponent);
51
+ export type AppComponent = BaseAppComponent & (RunFormComponent | DisplayComponent | TextInputComponent | PasswordInputComponent | DateInputComponent | NumberInputComponent | BarChartComponent | TableComponent | TextComponent | TableComponent | ButtonComponent | PieChartComponent | ImageComponent | InputComponent | SelectComponent | CheckboxComponent | RadioComponent | FormComponent);
44
52
  export type ComponentSet = {
45
53
  title: string;
46
54
  components: AppComponent[];
@@ -62,8 +70,11 @@ export type InlineScript = {
62
70
  };
63
71
  export type App = {
64
72
  grid: GridItem[];
65
- inlineScripts: Record<string, InlineScript>;
66
73
  title: string;
74
+ unusedInlineScripts: Array<{
75
+ name: string;
76
+ inlineScript: InlineScript;
77
+ }>;
67
78
  };
68
79
  export type ConnectingInput = {
69
80
  opened: boolean;
@@ -79,6 +90,7 @@ export type AppEditorContext = {
79
90
  connectingInput: Writable<ConnectingInput>;
80
91
  breakpoint: Writable<EditorBreakpoint>;
81
92
  runnableComponents: Writable<Record<string, () => void>>;
93
+ appPath: string;
82
94
  };
83
95
  export type EditorMode = 'dnd' | 'preview';
84
96
  export type EditorBreakpoint = 'sm' | 'lg';
@@ -1,7 +1,5 @@
1
- /// <reference types="node" />
2
1
  import type { Schema } from '../../common';
3
- import type { InputType } from 'zlib';
4
- import type { AppInputs } from './inputType';
2
+ import type { AppInput, AppInputs, InputType, ResultAppInput } from './inputType';
5
3
  import type { AppComponent } from './types';
6
4
  export declare function loadSchema(workspace: string, path: string, runType: 'script' | 'flow' | 'hubscript'): Promise<Schema>;
7
5
  export declare function schemaToInputsSpec(schema: Schema): AppInputs;
@@ -11,3 +9,6 @@ export declare const displayData: Record<AppComponent['type'], {
11
9
  }>;
12
10
  export declare function accessPropertyByPath<T>(object: T, path: string): T | undefined;
13
11
  export declare function fieldTypeToTsType(inputType: InputType): string;
12
+ export declare function isScriptByNameDefined(appInput: AppInput | undefined): boolean;
13
+ export declare function isScriptByPathDefined(appInput: AppInput | undefined): boolean;
14
+ export declare function clearResultAppInput(appInput: ResultAppInput): ResultAppInput;
@@ -1,5 +1,5 @@
1
1
  import { FlowService, ScriptService } from '../../gen';
2
- import { BarChart4, Binary, BoxSelect, CircleDot, FormInput, Inspect, List, Monitor, PieChart, Play, Table2, TextCursorInput, Type, FolderInput } from 'lucide-svelte';
2
+ import { BarChart4, Binary, CircleDot, FormInput, Inspect, List, Monitor, PieChart, Play, Table2, TextCursorInput, Type, Lock, Calendar, ToggleLeft } from 'lucide-svelte';
3
3
  export async function loadSchema(workspace, path, runType) {
4
4
  if (runType === 'script') {
5
5
  const script = await ScriptService.getScriptByPath({
@@ -19,7 +19,6 @@ export async function loadSchema(workspace, path, runType) {
19
19
  const script = await ScriptService.getHubScriptByPath({
20
20
  path
21
21
  });
22
- debugger;
23
22
  return script.schema;
24
23
  }
25
24
  }
@@ -51,7 +50,7 @@ export const displayData = {
51
50
  },
52
51
  formcomponent: {
53
52
  name: 'Form',
54
- icon: FolderInput
53
+ icon: FormInput
55
54
  },
56
55
  piechartcomponent: {
57
56
  name: 'Pie chart',
@@ -66,8 +65,8 @@ export const displayData = {
66
65
  icon: Table2
67
66
  },
68
67
  checkboxcomponent: {
69
- name: 'Checkbox',
70
- icon: BoxSelect
68
+ name: 'Toggle',
69
+ icon: ToggleLeft
71
70
  },
72
71
  textinputcomponent: {
73
72
  name: 'Text input',
@@ -96,6 +95,14 @@ export const displayData = {
96
95
  numberinputcomponent: {
97
96
  name: 'Number input',
98
97
  icon: Binary
98
+ },
99
+ passwordinputcomponent: {
100
+ name: 'Password input',
101
+ icon: Lock
102
+ },
103
+ dateinputcomponent: {
104
+ name: 'Date input',
105
+ icon: Calendar
99
106
  }
100
107
  };
101
108
  export function accessPropertyByPath(object, path) {
@@ -126,7 +133,32 @@ export function fieldTypeToTsType(inputType) {
126
133
  return 'object';
127
134
  case 'array':
128
135
  return 'array';
136
+ case 'any':
137
+ return 'any';
129
138
  default:
130
139
  return 'string';
131
140
  }
132
141
  }
142
+ export function isScriptByNameDefined(appInput) {
143
+ if (!appInput) {
144
+ return false;
145
+ }
146
+ if (appInput.type === 'runnable' && appInput.runnable?.type == 'runnableByName') {
147
+ return Boolean(appInput.runnable?.name);
148
+ }
149
+ return false;
150
+ }
151
+ export function isScriptByPathDefined(appInput) {
152
+ if (!appInput) {
153
+ return false;
154
+ }
155
+ if (appInput.type === 'runnable' && appInput.runnable?.type == 'runnableByPath') {
156
+ return Boolean(appInput.runnable?.path);
157
+ }
158
+ return false;
159
+ }
160
+ export function clearResultAppInput(appInput) {
161
+ appInput.runnable = undefined;
162
+ appInput.fields = {};
163
+ return appInput;
164
+ }
@@ -55,7 +55,7 @@ onMount(() => {
55
55
 
56
56
  <svelte:window on:keydown={onKeyDown} />
57
57
 
58
- <aside class="drawer" class:open class:close={!open && timeout} {style}>
58
+ <aside class="drawer {$$props.class}" class:open class:close={!open && timeout} {style}>
59
59
  <div class="overlay" on:click={handleClickAway} />
60
60
  <div class="panel {placement}" class:size>
61
61
  {#if open || !timeout}
@@ -1,6 +1,7 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
+ [x: string]: any;
4
5
  open?: boolean | undefined;
5
6
  duration?: number | undefined;
6
7
  placement?: string | undefined;
@@ -4,7 +4,6 @@
4
4
  import { slide } from 'svelte/transition';
5
5
  import { createPopperActions } from 'svelte-popperjs';
6
6
  import { clickOutside } from '../../../utils';
7
- import { Kbd } from '..';
8
7
  import { createStateMachine } from '../../../stateMachine';
9
8
  export let ref;
10
9
  export let options = { placement: 'auto' };
@@ -12,7 +11,6 @@ export let options = { placement: 'auto' };
12
11
  export let openOn = ['focus'];
13
12
  /** Events on the reference element */
14
13
  export let closeOn = ['blur'];
15
- export let disableInstruction = false;
16
14
  export let innerClasses = '';
17
15
  export let outerClasses = '';
18
16
  const states = ['closed', 'open-focus-in', 'open-focus-out'];
@@ -6,7 +6,6 @@ declare const __propDef: {
6
6
  options?: PopperOptions<any>;
7
7
  /** Events on the reference element */ openOn?: (keyof HTMLElementEventMap)[] | undefined;
8
8
  /** Events on the reference element */ closeOn?: (keyof HTMLElementEventMap)[] | undefined;
9
- disableInstruction?: boolean | undefined;
10
9
  innerClasses?: string | undefined;
11
10
  outerClasses?: string | undefined;
12
11
  };
@@ -33,9 +32,6 @@ export default class Popup extends SvelteComponentTyped<PopupProps, PopupEvents,
33
32
  get closeOn(): (keyof HTMLElementEventMap)[] | undefined;
34
33
  /**accessor*/
35
34
  set closeOn(_: (keyof HTMLElementEventMap)[] | undefined);
36
- get disableInstruction(): boolean | undefined;
37
- /**accessor*/
38
- set disableInstruction(_: boolean | undefined);
39
35
  get innerClasses(): string | undefined;
40
36
  /**accessor*/
41
37
  set innerClasses(_: string | undefined);
@@ -1,9 +1,11 @@
1
- <script>import Dropdown from '../../Dropdown.svelte';
1
+ <script>import { goto } from '$app/navigation';
2
+ import Dropdown from '../../Dropdown.svelte';
3
+ import ScheduleEditor from '../../ScheduleEditor.svelte';
2
4
  import SharedBadge from '../../SharedBadge.svelte';
3
5
  import { FlowService } from '../../../gen';
4
6
  import { userStore, workspaceStore } from '../../../stores';
5
7
  import { sendUserToast } from '../../../utils';
6
- import { faArchive, faCalendarAlt, faCodeFork, faEdit, faEye, faList, faPlay, faShare } from '@fortawesome/free-solid-svg-icons';
8
+ import { faArchive, faCalendarAlt, faCodeFork, faEdit, faEye, faFileExport, faList, faPlay, faShare } from '@fortawesome/free-solid-svg-icons';
7
9
  import { createEventDispatcher } from 'svelte';
8
10
  import Button from '../button/Button.svelte';
9
11
  import Row from './Row.svelte';
@@ -11,6 +13,7 @@ export let flow;
11
13
  export let marked;
12
14
  export let starred;
13
15
  export let shareModal;
16
+ export let moveDrawer;
14
17
  let { summary, path, extra_perms, canWrite, workspace_id } = flow;
15
18
  const dispatch = createEventDispatcher();
16
19
  async function archiveFlow(path) {
@@ -23,8 +26,10 @@ async function archiveFlow(path) {
23
26
  sendUserToast(`Could not archive this flow ${err.body}`, true);
24
27
  }
25
28
  }
29
+ let scheduleEditor;
26
30
  </script>
27
31
 
32
+ <ScheduleEditor on:update={() => goto('/schedules')} bind:this={scheduleEditor} />
28
33
  <Row
29
34
  href={`/flows/run/${path}`}
30
35
  kind="flow"
@@ -113,18 +118,27 @@ async function archiveFlow(path) {
113
118
  icon: faList,
114
119
  href: `/runs/${path}`
115
120
  },
121
+ {
122
+ displayName: 'Move',
123
+ icon: faFileExport,
124
+ action: () => {
125
+ moveDrawer.openDrawer(path, 'flow')
126
+ },
127
+ disabled: !canWrite
128
+ },
116
129
  {
117
130
  displayName: 'Schedule',
118
131
  icon: faCalendarAlt,
119
- href: `/schedule/add?path=${path}&isFlow=true`
132
+ action: () => {
133
+ scheduleEditor.openNew(true, path)
134
+ }
120
135
  },
121
136
  {
122
- displayName: 'Share',
137
+ displayName: canWrite ? 'Share' : 'See Permissions',
123
138
  icon: faShare,
124
139
  action: () => {
125
- shareModal.openDrawer && shareModal.openDrawer(path)
126
- },
127
- disabled: !canWrite
140
+ shareModal.openDrawer && shareModal.openDrawer(path, 'flow')
141
+ }
128
142
  },
129
143
  {
130
144
  displayName: 'Archive',
@@ -1,4 +1,5 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
+ import type MoveDrawer from '../../MoveDrawer.svelte';
2
3
  import type ShareModal from '../../ShareModal.svelte';
3
4
  import { type Flow } from '../../../gen';
4
5
  declare const __propDef: {
@@ -9,6 +10,7 @@ declare const __propDef: {
9
10
  marked: string | undefined;
10
11
  starred: boolean;
11
12
  shareModal: ShareModal;
13
+ moveDrawer: MoveDrawer;
12
14
  };
13
15
  events: {
14
16
  change: CustomEvent<any>;
@@ -1,9 +1,11 @@
1
- <script>import Dropdown from '../../Dropdown.svelte';
1
+ <script>import { goto } from '$app/navigation';
2
+ import Dropdown from '../../Dropdown.svelte';
3
+ import ScheduleEditor from '../../ScheduleEditor.svelte';
2
4
  import SharedBadge from '../../SharedBadge.svelte';
3
5
  import { ScriptService } from '../../../gen';
4
6
  import { userStore, workspaceStore } from '../../../stores';
5
7
  import { capitalize, sendUserToast } from '../../../utils';
6
- import { faArchive, faCalendarAlt, faCodeFork, faEdit, faEye, faList, faPlay, faShare } from '@fortawesome/free-solid-svg-icons';
8
+ import { faArchive, faCalendarAlt, faCodeFork, faEdit, faEye, faFileExport, faList, faPlay, faShare } from '@fortawesome/free-solid-svg-icons';
7
9
  import { createEventDispatcher } from 'svelte';
8
10
  import Badge from '../badge/Badge.svelte';
9
11
  import Button from '../button/Button.svelte';
@@ -13,6 +15,7 @@ export let script;
13
15
  export let marked;
14
16
  export let starred;
15
17
  export let shareModal;
18
+ export let moveDrawer;
16
19
  let { summary, path, hash, language, extra_perms, canWrite, lock_error_logs, kind, workspace_id } = script;
17
20
  const dispatch = createEventDispatcher();
18
21
  async function archiveScript(path) {
@@ -20,8 +23,11 @@ async function archiveScript(path) {
20
23
  dispatch('change');
21
24
  sendUserToast(`Archived script ${path}`);
22
25
  }
26
+ let scheduleEditor;
23
27
  </script>
24
28
 
29
+ <ScheduleEditor on:update={() => goto('/schedules')} bind:this={scheduleEditor} />
30
+
25
31
  <Row
26
32
  href={`/scripts/run/${hash}`}
27
33
  kind="script"
@@ -122,6 +128,14 @@ async function archiveScript(path) {
122
128
  icon: faCodeFork,
123
129
  href: `/scripts/add?template=${path}`
124
130
  },
131
+ {
132
+ displayName: 'Move',
133
+ icon: faFileExport,
134
+ action: () => {
135
+ moveDrawer.openDrawer(path, 'script')
136
+ },
137
+ disabled: !canWrite
138
+ },
125
139
  {
126
140
  displayName: 'View runs',
127
141
  icon: faList,
@@ -130,15 +144,16 @@ async function archiveScript(path) {
130
144
  {
131
145
  displayName: 'Schedule',
132
146
  icon: faCalendarAlt,
133
- href: `/schedule/add?path=${path}`
147
+ action: () => {
148
+ scheduleEditor.openNew(false, path)
149
+ }
134
150
  },
135
151
  {
136
- displayName: 'Share',
152
+ displayName: canWrite ? 'Share' : 'See Permissions',
137
153
  icon: faShare,
138
154
  action: () => {
139
- shareModal.openDrawer && shareModal.openDrawer(path)
140
- },
141
- disabled: !canWrite
155
+ shareModal.openDrawer && shareModal.openDrawer(path, 'script')
156
+ }
142
157
  },
143
158
  {
144
159
  displayName: 'Archive',
@@ -1,4 +1,5 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
+ import type MoveDrawer from '../../MoveDrawer.svelte';
2
3
  import type ShareModal from '../../ShareModal.svelte';
3
4
  import { type Script } from '../../../gen';
4
5
  declare const __propDef: {
@@ -9,6 +10,7 @@ declare const __propDef: {
9
10
  marked: string | undefined;
10
11
  starred: boolean;
11
12
  shareModal: ShareModal;
13
+ moveDrawer: MoveDrawer;
12
14
  };
13
15
  events: {
14
16
  change: CustomEvent<any>;
@@ -16,7 +16,7 @@ const { select, selected } = getContext('ToggleButtonGroup');
16
16
  position === 'center' ? 'rounded-none border-t border-b border-r' : '',
17
17
  position === 'right' ? 'rounded-none rounded-r-md border-r border-y' : ''
18
18
  )}
19
- color={$selected === value ? (light ? 'dark' : 'dark') : 'light'}
19
+ color={$selected === value ? (light ? 'gray' : 'dark') : 'light'}
20
20
  variant="contained"
21
21
  >
22
22
  <slot />
@@ -21,6 +21,6 @@ setContext('ToggleButtonGroup', {
21
21
  });
22
22
  </script>
23
23
 
24
- <div class:flex-col={col} class="flex rounded-md" role="group">
24
+ <div class:flex-col={col} class="flex rounded-md {$$props.class}" role="group">
25
25
  <slot />
26
26
  </div>
@@ -6,6 +6,7 @@ export type ToggleButtonContext = {
6
6
  import { type Writable } from 'svelte/store';
7
7
  declare const __propDef: {
8
8
  props: {
9
+ [x: string]: any;
9
10
  selected: any;
10
11
  col?: boolean | undefined;
11
12
  };
@@ -8,22 +8,16 @@ export let initialPath;
8
8
  const { selectedId } = getContext('FlowEditorContext');
9
9
  </script>
10
10
 
11
- {#key $selectedId}
12
- {#if $selectedId === 'settings'}
13
- <FlowSettings {initialPath} />
14
- {:else if $selectedId === 'inputs'}
15
- <FlowInput />
16
- {:else if $selectedId === 'settings-schedule'}
17
- <FlowSettings {initialPath} defaultTab="schedule" />
18
- {:else if $selectedId === 'settings-same-worker'}
19
- <FlowSettings {initialPath} defaultTab="same-worker" />
20
- {:else if $selectedId === 'settings-graph'}
21
- <FlowSettings {initialPath} defaultTab="graph" />
22
- {:else if $selectedId === 'failure'}
23
- <FlowFailureModule />
24
- {:else}
11
+ {#if $selectedId?.startsWith('settings')}
12
+ <FlowSettings {initialPath} />
13
+ {:else if $selectedId === 'inputs'}
14
+ <FlowInput />
15
+ {:else if $selectedId === 'failure'}
16
+ <FlowFailureModule />
17
+ {:else}
18
+ {#key $selectedId}
25
19
  {#each $flowStore.value.modules as flowModule, index (flowModule.id ?? index)}
26
20
  <FlowModuleWrapper bind:flowModule previousModule={$flowStore.value.modules[index - 1]} />
27
21
  {/each}
28
- {/if}
29
- {/key}
22
+ {/key}
23
+ {/if}
@@ -1,4 +1,4 @@
1
- <script>import { ToggleButton, ToggleButtonGroup } from '../../common';
1
+ <script>import { Alert, ToggleButton, ToggleButtonGroup } from '../../common';
2
2
  import ToggleHubWorkspace from '../../ToggleHubWorkspace.svelte';
3
3
  import Tooltip from '../../Tooltip.svelte';
4
4
  import { RawScript, Script } from '../../../gen';
@@ -9,8 +9,15 @@ import PickHubScript from '../pickers/PickHubScript.svelte';
9
9
  import WorkspaceScriptPicker from '../pickers/WorkspaceScriptPicker.svelte';
10
10
  export let failureModule;
11
11
  export let shouldDisableTriggerScripts = false;
12
+ export let summary = undefined;
12
13
  const dispatch = createEventDispatcher();
13
- let kind = failureModule ? 'failure' : 'script';
14
+ let kind = failureModule
15
+ ? 'failure'
16
+ : summary == 'Trigger'
17
+ ? 'trigger'
18
+ : summary == 'Approval'
19
+ ? 'approval'
20
+ : 'script';
14
21
  let pick_existing = 'hub';
15
22
  let filter = '';
16
23
  </script>
@@ -21,8 +28,8 @@ let filter = '';
21
28
  <div class="max-w-min">
22
29
  <ToggleButtonGroup bind:selected={kind}>
23
30
  <ToggleButton position="left" value="script" size="sm" startIcon={{ icon: faCode }}>
24
- Common &nbsp;<Tooltip>
25
- A common script is simply a script that is neither a trigger nor an approval script.
31
+ Action &nbsp;<Tooltip>
32
+ An action script is simply a script that is neither a trigger nor an approval script.
26
33
  Those are the majority of the scripts.
27
34
  </Tooltip>
28
35
  </ToggleButton>
@@ -47,6 +54,13 @@ let filter = '';
47
54
  </div>
48
55
  </div>
49
56
  {/if}
57
+ {#if kind == 'trigger'}
58
+ <div class="mt-2" />
59
+ <Alert title="Trigger script automatic schedule" role="info">
60
+ A schedule will be automatically attached to this flow to run every 15 minutes. Adjust
61
+ frequency in 'Settings -> Schedule'</Alert
62
+ >
63
+ {/if}
50
64
  <h3 class="pb-2 pt-4">
51
65
  Inline new <span class="text-blue-500">{kind == 'script' ? 'common' : kind}</span> script
52
66
  <Tooltip>
@@ -3,6 +3,7 @@ declare const __propDef: {
3
3
  props: {
4
4
  failureModule: boolean;
5
5
  shouldDisableTriggerScripts?: boolean | undefined;
6
+ summary?: string | undefined;
6
7
  };
7
8
  events: {
8
9
  pick: CustomEvent<any>;