workflow-common 1.0.0

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 (54) hide show
  1. package/README.md +25 -0
  2. package/package.json +24 -0
  3. package/src/index.ts +2 -0
  4. package/src/tasks/AddPropertyToJsonTask.ts +31 -0
  5. package/src/tasks/ApplySessionSorageTask.ts +31 -0
  6. package/src/tasks/CheckElementExistsTask.ts +30 -0
  7. package/src/tasks/ClearInputTask.ts +26 -0
  8. package/src/tasks/ClickElementTask.ts +26 -0
  9. package/src/tasks/CloseBrowserTask.ts +16 -0
  10. package/src/tasks/DeliverViaWebhookTask.ts +21 -0
  11. package/src/tasks/DoubleClickElementTask.ts +26 -0
  12. package/src/tasks/ExtractElementByTextTask.ts +46 -0
  13. package/src/tasks/ExtractTextAndValidateTask.ts +36 -0
  14. package/src/tasks/FillCredentialsTask.ts +31 -0
  15. package/src/tasks/FillInputTask.ts +31 -0
  16. package/src/tasks/GoForwardTask.ts +21 -0
  17. package/src/tasks/GobackTask.ts +21 -0
  18. package/src/tasks/HoverElementTask.ts +26 -0
  19. package/src/tasks/HttpRequestTask.ts +57 -0
  20. package/src/tasks/LaunchBrowserTask.ts +20 -0
  21. package/src/tasks/LogMessageTask.ts +36 -0
  22. package/src/tasks/LoginViaBasicAuthTask.ts +31 -0
  23. package/src/tasks/NavigateUrlTask.ts +26 -0
  24. package/src/tasks/PageToHtmlTask.ts +25 -0
  25. package/src/tasks/PressKeyTask.ts +33 -0
  26. package/src/tasks/ReadPropertyFromJsonTask.ts +26 -0
  27. package/src/tasks/ReloadPageTask.ts +21 -0
  28. package/src/tasks/RightClickElementTask.ts +26 -0
  29. package/src/tasks/ScrollToBottomTask.ts +26 -0
  30. package/src/tasks/ScrollToElementTask.ts +26 -0
  31. package/src/tasks/ScrollToTopTask.ts +26 -0
  32. package/src/tasks/SelectDropdownTask.ts +31 -0
  33. package/src/tasks/SetCookieTask.ts +47 -0
  34. package/src/tasks/StoreAuthTokenTask.ts +45 -0
  35. package/src/tasks/TaskRegisteryTask.ts +171 -0
  36. package/src/tasks/ToogleCheckboxTask.ts +32 -0
  37. package/src/tasks/UploadFileTask.ts +31 -0
  38. package/src/tasks/ValidateCheckboxTask.ts +42 -0
  39. package/src/tasks/WaitForElementTask.ts +42 -0
  40. package/src/tasks/WaitForNavigationTask.ts +21 -0
  41. package/src/tasks/WaitForTimeTask.ts +27 -0
  42. package/src/tasks/index.ts +38 -0
  43. package/src/types/appNode.ts +25 -0
  44. package/src/types/common.ts +5 -0
  45. package/src/types/execution.ts +40 -0
  46. package/src/types/executor.ts +33 -0
  47. package/src/types/index.ts +10 -0
  48. package/src/types/log.ts +16 -0
  49. package/src/types/schedule.ts +119 -0
  50. package/src/types/suites.ts +13 -0
  51. package/src/types/task.ts +80 -0
  52. package/src/types/workflow.ts +49 -0
  53. package/src/types/workflowTasks.ts +9 -0
  54. package/tsconfig.json +13 -0
@@ -0,0 +1,33 @@
1
+ import { WorkflowTask } from '../types/workflowTasks';
2
+ import { TaskParamType, TaskType } from '../types/task';
3
+
4
+ export const PressKeyTask: WorkflowTask = {
5
+ type: TaskType.PRESS_KEY,
6
+ label: 'Press Key',
7
+ isEntryPoint: false,
8
+ inputs: [
9
+ {
10
+ name: 'Web page',
11
+ type: TaskParamType.BROWSER_INSTANCE,
12
+ required: true,
13
+ },
14
+ {
15
+ name: 'Key',
16
+ type: TaskParamType.SELECT,
17
+ required: true,
18
+ options: [
19
+ { label: 'Enter', value: 'Enter' },
20
+ { label: 'Tab', value: 'Tab' },
21
+ { label: 'Escape', value: 'Escape' },
22
+ { label: 'Arrow Up', value: 'ArrowUp' },
23
+ { label: 'Arrow Down', value: 'ArrowDown' },
24
+ ],
25
+ },
26
+ ] as const,
27
+ outputs: [
28
+ {
29
+ name: 'Web page',
30
+ type: TaskParamType.BROWSER_INSTANCE,
31
+ },
32
+ ] as const,
33
+ };
@@ -0,0 +1,26 @@
1
+ import { WorkflowTask } from '../types/workflowTasks';
2
+ import { TaskParamType, TaskType } from '../types/task';
3
+
4
+ export const ReadPropertyFromJsonTask: WorkflowTask = {
5
+ type: TaskType.READ_PROPERTY_FROM_JSON,
6
+ label: 'Read Property from JSON',
7
+ isEntryPoint: false,
8
+ inputs: [
9
+ {
10
+ name: 'JSON',
11
+ type: TaskParamType.STRING,
12
+ required: true,
13
+ },
14
+ {
15
+ name: 'Property name',
16
+ type: TaskParamType.STRING,
17
+ required: true,
18
+ },
19
+ ] as const,
20
+ outputs: [
21
+ {
22
+ name: 'Property value',
23
+ type: TaskParamType.STRING,
24
+ },
25
+ ] as const,
26
+ };
@@ -0,0 +1,21 @@
1
+ import { WorkflowTask } from '../types/workflowTasks';
2
+ import { TaskParamType, TaskType } from '../types/task';
3
+
4
+ export const ReloadPageTask: WorkflowTask = {
5
+ type: TaskType.RELOAD_PAGE,
6
+ label: 'Reload Page',
7
+ isEntryPoint: false,
8
+ inputs: [
9
+ {
10
+ name: 'Web page',
11
+ type: TaskParamType.BROWSER_INSTANCE,
12
+ required: true,
13
+ },
14
+ ] as const,
15
+ outputs: [
16
+ {
17
+ name: 'Web page',
18
+ type: TaskParamType.BROWSER_INSTANCE,
19
+ },
20
+ ] as const,
21
+ };
@@ -0,0 +1,26 @@
1
+ import { WorkflowTask } from '../types/workflowTasks';
2
+ import { TaskParamType, TaskType } from '../types/task';
3
+
4
+ export const RightClickElementTask: WorkflowTask = {
5
+ type: TaskType.RIGHT_CLICK_ELEMENT,
6
+ label: 'Right Click Element',
7
+ isEntryPoint: false,
8
+ inputs: [
9
+ {
10
+ name: 'Web page',
11
+ type: TaskParamType.BROWSER_INSTANCE,
12
+ required: true,
13
+ },
14
+ {
15
+ name: 'Selector',
16
+ type: TaskParamType.STRING,
17
+ required: true,
18
+ },
19
+ ] as const,
20
+ outputs: [
21
+ {
22
+ name: 'Web page',
23
+ type: TaskParamType.BROWSER_INSTANCE,
24
+ },
25
+ ] as const,
26
+ };
@@ -0,0 +1,26 @@
1
+ import { WorkflowTask } from '../types/workflowTasks';
2
+ import { TaskParamType, TaskType } from '../types/task';
3
+
4
+ export const ScrollToBottomTask: WorkflowTask = {
5
+ type: TaskType.SCROLL_TO_TOP,
6
+ label: 'Scroll to element',
7
+ isEntryPoint: false,
8
+ inputs: [
9
+ {
10
+ name: 'Web page',
11
+ type: TaskParamType.BROWSER_INSTANCE,
12
+ required: true,
13
+ },
14
+ {
15
+ name: 'Selector',
16
+ type: TaskParamType.STRING,
17
+ required: true,
18
+ },
19
+ ] as const,
20
+ outputs: [
21
+ {
22
+ name: 'Web page',
23
+ type: TaskParamType.BROWSER_INSTANCE,
24
+ },
25
+ ] as const,
26
+ };
@@ -0,0 +1,26 @@
1
+ import { WorkflowTask } from '../types/workflowTasks';
2
+ import { TaskParamType, TaskType } from '../types/task';
3
+
4
+ export const ScrollToElementTask: WorkflowTask = {
5
+ type: TaskType.SCROLL_TO_ELEMENT,
6
+ label: 'Scroll to element',
7
+ isEntryPoint: false,
8
+ inputs: [
9
+ {
10
+ name: 'Web page',
11
+ type: TaskParamType.BROWSER_INSTANCE,
12
+ required: true,
13
+ },
14
+ {
15
+ name: 'Selector',
16
+ type: TaskParamType.STRING,
17
+ required: true,
18
+ },
19
+ ] as const,
20
+ outputs: [
21
+ {
22
+ name: 'Web page',
23
+ type: TaskParamType.BROWSER_INSTANCE,
24
+ },
25
+ ] as const,
26
+ };
@@ -0,0 +1,26 @@
1
+ import { WorkflowTask } from '../types/workflowTasks';
2
+ import { TaskParamType, TaskType } from '../types/task';
3
+
4
+ export const ScrollToTopTask: WorkflowTask = {
5
+ type: TaskType.SCROLL_TO_TOP,
6
+ label: 'Scroll to element',
7
+ isEntryPoint: false,
8
+ inputs: [
9
+ {
10
+ name: 'Web page',
11
+ type: TaskParamType.BROWSER_INSTANCE,
12
+ required: true,
13
+ },
14
+ {
15
+ name: 'Selector',
16
+ type: TaskParamType.STRING,
17
+ required: true,
18
+ },
19
+ ] as const,
20
+ outputs: [
21
+ {
22
+ name: 'Web page',
23
+ type: TaskParamType.BROWSER_INSTANCE,
24
+ },
25
+ ] as const,
26
+ };
@@ -0,0 +1,31 @@
1
+ import { WorkflowTask } from '../types/workflowTasks';
2
+ import { TaskParamType, TaskType } from '../types/task';
3
+
4
+ export const SelectDropdownTask: WorkflowTask = {
5
+ type: TaskType.SELECT_DROPDOWN,
6
+ label: 'Select Dropdown Value',
7
+ isEntryPoint: false,
8
+ inputs: [
9
+ {
10
+ name: 'Web Page',
11
+ type: TaskParamType.BROWSER_INSTANCE,
12
+ required: true,
13
+ },
14
+ {
15
+ name: 'Selector',
16
+ type: TaskParamType.STRING,
17
+ required: true,
18
+ },
19
+ {
20
+ name: 'value',
21
+ type: TaskParamType.STRING,
22
+ required: true,
23
+ },
24
+ ] as const,
25
+ outputs: [
26
+ {
27
+ name: 'Web page',
28
+ type: TaskParamType.BROWSER_INSTANCE,
29
+ },
30
+ ] as const,
31
+ };
@@ -0,0 +1,47 @@
1
+ import { WorkflowTask } from '../types/workflowTasks';
2
+ import { TaskParamType, TaskType } from '../types/task';
3
+
4
+ export const SetCookieTask: WorkflowTask = {
5
+ type: TaskType.SET_COOKIE,
6
+ label: 'Set Cookie',
7
+ isEntryPoint: false,
8
+ inputs: [
9
+ {
10
+ name: 'Web page',
11
+ type: TaskParamType.BROWSER_INSTANCE,
12
+ required: true,
13
+ },
14
+ {
15
+ name: 'Name',
16
+ type: TaskParamType.STRING,
17
+ required: true,
18
+ },
19
+ {
20
+ name: 'Value',
21
+ type: TaskParamType.STRING,
22
+ required: true,
23
+ },
24
+ {
25
+ name: 'Domain',
26
+ type: TaskParamType.STRING,
27
+ required: true,
28
+ },
29
+ {
30
+ name: 'Path',
31
+ type: TaskParamType.STRING,
32
+ required: false,
33
+ defaultValue: '/',
34
+ },
35
+ {
36
+ name: 'Expires (Unix timestamp)',
37
+ type: TaskParamType.NUMBER,
38
+ required: false,
39
+ },
40
+ ] as const,
41
+ outputs: [
42
+ {
43
+ name: 'Web page',
44
+ type: TaskParamType.BROWSER_INSTANCE,
45
+ },
46
+ ] as const,
47
+ };
@@ -0,0 +1,45 @@
1
+ import { WorkflowTask } from '../types/workflowTasks';
2
+ import { TaskParamType, TaskType } from '../types/task';
3
+
4
+ export const StoreAuthTokenTask: WorkflowTask = {
5
+ type: TaskType.STORE_AUTH_TOKEN,
6
+ label: 'Store Auth Token',
7
+ isEntryPoint: false,
8
+ inputs: [
9
+ {
10
+ name: 'Web page',
11
+ type: TaskParamType.BROWSER_INSTANCE,
12
+ required: true,
13
+ },
14
+ {
15
+ name: 'Token',
16
+ type: TaskParamType.STRING,
17
+ required: true,
18
+ },
19
+ {
20
+ name: 'Storage Key',
21
+ type: TaskParamType.STRING,
22
+ required: true,
23
+ },
24
+ {
25
+ name: 'Storage Type',
26
+ type: TaskParamType.SELECT,
27
+ required: true,
28
+ options: [
29
+ { label: 'Local Storage', value: 'localStorage' },
30
+ { label: 'Session Storage', value: 'sessionStorage' },
31
+ ],
32
+ },
33
+ ] as const,
34
+ outputs: [
35
+ {
36
+ name: 'Web page',
37
+ type: TaskParamType.BROWSER_INSTANCE,
38
+ required: true,
39
+ },
40
+ {
41
+ name: 'Success',
42
+ type: TaskParamType.BOOLEAN,
43
+ },
44
+ ] as const,
45
+ };
@@ -0,0 +1,171 @@
1
+ import { TaskType } from '../types/task';
2
+ import { WorkflowTask } from '../types/workflowTasks';
3
+ import { AddPropertyToJsonTask } from './AddPropertyToJsonTask';
4
+ import { ApplySessionStorageTask } from './ApplySessionSorageTask';
5
+ import { CheckElementExistsTask } from './CheckElementExistsTask';
6
+ import { ClearInputTask } from './ClearInputTask';
7
+ import { ClickElementTask } from './ClickElementTask';
8
+ import { CloseBrowserTask } from './CloseBrowserTask';
9
+ import { DeliverViaWebhookTask } from './DeliverViaWebhookTask';
10
+ import { DoubleClickElementTask } from './DoubleClickElementTask';
11
+ import { ExtractElementByTextTask } from './ExtractElementByTextTask';
12
+ import { ExtractTextAndValidateTask } from './ExtractTextAndValidateTask';
13
+ import { FillCredentialTask } from './FillCredentialsTask';
14
+ import { FillInputTask } from './FillInputTask';
15
+ import { GoBackTask } from './GobackTask';
16
+ import { GoForwardTask } from './GoForwardTask';
17
+ import { HoverElementTask } from './HoverElementTask';
18
+ import { HttpRequestTask } from './HttpRequestTask';
19
+ import { LaunchBrowserTask } from './LaunchBrowserTask';
20
+ import { LoginViaBasicAuthTask } from './LoginViaBasicAuthTask';
21
+ import { LogMessageTask } from './LogMessageTask';
22
+ import { NavigateUrlTask } from './NavigateUrlTask';
23
+ import { PageToHtmlTask } from './PageToHtmlTask';
24
+ import { PressKeyTask } from './PressKeyTask';
25
+ import { ReadPropertyFromJsonTask } from './ReadPropertyFromJsonTask';
26
+ import { ReloadPageTask } from './ReloadPageTask';
27
+ import { RightClickElementTask } from './RightClickElementTask';
28
+ import { ScrollToBottomTask } from './ScrollToBottomTask';
29
+ import { ScrollToElementTask } from './ScrollToElementTask';
30
+ import { ScrollToTopTask } from './ScrollToTopTask';
31
+ import { SelectDropdownTask } from './SelectDropdownTask';
32
+ import { SetCookieTask } from './SetCookieTask';
33
+ import { StoreAuthTokenTask } from './StoreAuthTokenTask';
34
+ //import { ToggleCheckboxTask } from './ToogleCheckboxTask';
35
+ import { UploadFileTask } from './UploadFileTask';
36
+ import { ValidateCheckboxTask } from './ValidateCheckboxTask';
37
+ import { WaitForElementTask } from './WaitForElementTask';
38
+ import { WaitForNavigationTask } from './WaitForNavigationTask';
39
+ import { WaitForTimeTask } from './WaitForTimeTask';
40
+
41
+ // Type-safe registry
42
+ type TaskRegistry = {
43
+ [K in TaskType]: WorkflowTask;
44
+ };
45
+
46
+ export const TaskRegistry: TaskRegistry = {
47
+ // Browser & Page Control
48
+ LAUNCH_BROWSER: LaunchBrowserTask,
49
+ CLOSE_BROWSER: CloseBrowserTask,
50
+ RELOAD_PAGE: ReloadPageTask,
51
+ NAVIGATE_URL: NavigateUrlTask,
52
+ GO_BACK: GoBackTask,
53
+ GO_FORWARD: GoForwardTask,
54
+
55
+ // Page Content Extraction
56
+ PAGE_TO_HTML: PageToHtmlTask,
57
+ EXTRACT_ELEMENT_BY_TEXT: ExtractElementByTextTask,
58
+
59
+ // Interactions & Form Handling
60
+ FILL_INPUT: FillInputTask,
61
+ FILL_CREDENTIAL: FillCredentialTask,
62
+ CLICK_ELEMENT: ClickElementTask,
63
+ SELECT_DROPDOWN: SelectDropdownTask,
64
+ VALIDATE_CHECKBOX: ValidateCheckboxTask,
65
+ CLEAR_INPUT: ClearInputTask,
66
+ UPLOAD_FILE: UploadFileTask,
67
+ HOVER_ELEMENT: HoverElementTask,
68
+ DOUBLE_CLICK_ELEMENT: DoubleClickElementTask,
69
+ RIGHT_CLICK_ELEMENT: RightClickElementTask,
70
+ PRESS_KEY: PressKeyTask,
71
+ //TOGGLE_CHECKBOX: ToggleCheckboxTask,
72
+
73
+ // Waits & Conditions
74
+ WAIT_FOR_ELEMENT: WaitForElementTask,
75
+ WAIT_FOR_TIME: WaitForTimeTask,
76
+ WAIT_FOR_NAVIGATION: WaitForNavigationTask,
77
+ CHECK_ELEMENT_EXISTS: CheckElementExistsTask,
78
+ EXTRACT_TEXT_AND_VALIDATE: ExtractTextAndValidateTask,
79
+
80
+ // Scrolling
81
+ SCROLL_TO_ELEMENT: ScrollToElementTask,
82
+ SCROLL_TO_TOP: ScrollToTopTask,
83
+ SCROLL_TO_BOTTOM: ScrollToBottomTask,
84
+
85
+ // Flow & Data Manipulation
86
+ READ_PROPERTY_FROM_JSON: ReadPropertyFromJsonTask,
87
+ ADD_PROPERTY_TO_JSON: AddPropertyToJsonTask,
88
+
89
+ // Authentication & Session
90
+ SET_COOKIE: SetCookieTask,
91
+ LOGIN_VIA_BASIC_AUTH: LoginViaBasicAuthTask,
92
+ APPLY_SESSION_STORAGE: ApplySessionStorageTask,
93
+ STORE_AUTH_TOKEN: StoreAuthTokenTask,
94
+
95
+ //Delivery & Output
96
+ DELIVER_VIA_WEBHOOK: DeliverViaWebhookTask,
97
+ HTTP_REQUEST: HttpRequestTask,
98
+ LOG_MESSAGE: LogMessageTask,
99
+ } as const;
100
+
101
+ // Keep existing exports for backward compatibility
102
+ export const allTasks = Object.values(TaskRegistry);
103
+
104
+ // Group tasks by category
105
+ export const taskCategories = [
106
+ {
107
+ title: 'Browser & Page Control',
108
+ content: 'Tasks for browser automation.',
109
+ tasks: [
110
+ LaunchBrowserTask,
111
+ CloseBrowserTask,
112
+ ReloadPageTask,
113
+ NavigateUrlTask,
114
+ GoBackTask,
115
+ GoForwardTask,
116
+ ],
117
+ },
118
+ {
119
+ title: 'Page Content Extraction',
120
+ content: 'Extract data from Web page.',
121
+ tasks: [PageToHtmlTask, ExtractElementByTextTask],
122
+ },
123
+ {
124
+ title: 'Interactions & Form Handling',
125
+ content: 'Interacting with page elements.',
126
+ tasks: [
127
+ FillInputTask,
128
+ ClickElementTask,
129
+ SelectDropdownTask,
130
+ ValidateCheckboxTask,
131
+ ClearInputTask,
132
+ UploadFileTask,
133
+ HoverElementTask,
134
+ DoubleClickElementTask,
135
+ RightClickElementTask,
136
+ PressKeyTask,
137
+ //ToggleCheckboxTask,
138
+ ],
139
+ },
140
+ {
141
+ title: 'Waits & Conditions',
142
+ content: 'Wait and conditional tasks',
143
+ tasks: [
144
+ WaitForElementTask,
145
+ WaitForTimeTask,
146
+ WaitForNavigationTask,
147
+ CheckElementExistsTask,
148
+ ExtractTextAndValidateTask,
149
+ ],
150
+ },
151
+ {
152
+ title: 'Scrolling',
153
+ content: 'Tasks for scrolling options',
154
+ tasks: [ScrollToElementTask, ScrollToTopTask, ScrollToBottomTask],
155
+ },
156
+ {
157
+ title: 'Flow & Data Manipulation',
158
+ content: 'Tasks for manipulating data',
159
+ tasks: [ReadPropertyFromJsonTask, AddPropertyToJsonTask],
160
+ },
161
+ {
162
+ title: 'Authentication & Session',
163
+ content: 'Tasks for authentication and sessions',
164
+ tasks: [SetCookieTask, LoginViaBasicAuthTask, ApplySessionStorageTask],
165
+ },
166
+ {
167
+ title: 'Delivery & Output',
168
+ content: 'Tasks for delivery and API requests',
169
+ tasks: [DeliverViaWebhookTask, HttpRequestTask, LogMessageTask],
170
+ },
171
+ ] as const;
@@ -0,0 +1,32 @@
1
+ // import { WorkflowTask } from '../types/workflowTasks';
2
+ // import { TaskParamType, TaskType } from '../types/task';
3
+
4
+ // export const ToggleCheckboxTask: WorkflowTask = {
5
+ // type: TaskType.TOGGLE_CHECKBOX,
6
+ // label: 'Toggle Checkbox',
7
+ // isEntryPoint: false,
8
+ // inputs: [
9
+ // {
10
+ // name: 'Web page',
11
+ // type: TaskParamType.BROWSER_INSTANCE,
12
+ // required: true,
13
+ // },
14
+ // {
15
+ // name: 'Selector',
16
+ // type: TaskParamType.STRING,
17
+ // required: true,
18
+ // },
19
+ // {
20
+ // name: 'Check',
21
+ // type: TaskParamType.BOOLEAN,
22
+ // required: true,
23
+ // description: 'True to check, false to uncheck',
24
+ // },
25
+ // ] as const,
26
+ // outputs: [
27
+ // {
28
+ // name: 'Web page',
29
+ // type: TaskParamType.BROWSER_INSTANCE,
30
+ // },
31
+ // ] as const,
32
+ // };
@@ -0,0 +1,31 @@
1
+ import { WorkflowTask } from '../types/workflowTasks';
2
+ import { TaskParamType, TaskType } from '../types/task';
3
+
4
+ export const UploadFileTask: WorkflowTask = {
5
+ type: TaskType.UPLOAD_FILE,
6
+ label: 'Upload File',
7
+ isEntryPoint: false,
8
+ inputs: [
9
+ {
10
+ name: 'Web page',
11
+ type: TaskParamType.BROWSER_INSTANCE,
12
+ required: true,
13
+ },
14
+ {
15
+ name: 'Selector',
16
+ type: TaskParamType.STRING,
17
+ required: true,
18
+ },
19
+ {
20
+ name: 'File Path',
21
+ type: TaskParamType.STRING,
22
+ required: true,
23
+ },
24
+ ] as const,
25
+ outputs: [
26
+ {
27
+ name: 'Web page',
28
+ type: TaskParamType.BROWSER_INSTANCE,
29
+ },
30
+ ] as const,
31
+ };
@@ -0,0 +1,42 @@
1
+ import { WorkflowTask } from '../types/workflowTasks';
2
+ import { TaskParamType, TaskType } from '../types/task';
3
+
4
+ export const ValidateCheckboxTask: WorkflowTask = {
5
+ type: TaskType.VALIDATE_CHECKBOX,
6
+ label: 'Validates Check box',
7
+ isEntryPoint: false,
8
+ inputs: [
9
+ {
10
+ name: 'Web page',
11
+ type: TaskParamType.BROWSER_INSTANCE,
12
+ required: true,
13
+ },
14
+ {
15
+ name: 'Selector',
16
+ type: TaskParamType.STRING,
17
+ required: true,
18
+ },
19
+ {
20
+ name: 'Checked',
21
+ type: TaskParamType.SELECT,
22
+ hideHandle: true,
23
+ required: true,
24
+ options: [
25
+ {
26
+ label: 'true',
27
+ value: 'true',
28
+ },
29
+ {
30
+ label: 'false',
31
+ value: 'false',
32
+ },
33
+ ],
34
+ },
35
+ ] as const,
36
+ outputs: [
37
+ {
38
+ name: 'Web page',
39
+ type: TaskParamType.BROWSER_INSTANCE,
40
+ },
41
+ ] as const,
42
+ };
@@ -0,0 +1,42 @@
1
+ import { WorkflowTask } from '../types/workflowTasks';
2
+ import { TaskParamType, TaskType } from '../types/task';
3
+
4
+ export const WaitForElementTask: WorkflowTask = {
5
+ type: TaskType.WAIT_FOR_ELEMENT,
6
+ label: 'Wait for element',
7
+ isEntryPoint: false,
8
+ inputs: [
9
+ {
10
+ name: 'Web page',
11
+ type: TaskParamType.BROWSER_INSTANCE,
12
+ required: true,
13
+ },
14
+ {
15
+ name: 'Selector',
16
+ type: TaskParamType.STRING,
17
+ required: true,
18
+ },
19
+ {
20
+ name: 'Visibility',
21
+ type: TaskParamType.SELECT,
22
+ hideHandle: true,
23
+ required: true,
24
+ options: [
25
+ {
26
+ label: 'Visible',
27
+ value: 'visible',
28
+ },
29
+ {
30
+ label: 'Hidden',
31
+ value: 'hidden',
32
+ },
33
+ ],
34
+ },
35
+ ] as const,
36
+ outputs: [
37
+ {
38
+ name: 'Web page',
39
+ type: TaskParamType.BROWSER_INSTANCE,
40
+ },
41
+ ] as const,
42
+ };
@@ -0,0 +1,21 @@
1
+ import { WorkflowTask } from '../types/workflowTasks';
2
+ import { TaskParamType, TaskType } from '../types/task';
3
+
4
+ export const WaitForNavigationTask: WorkflowTask = {
5
+ type: TaskType.WAIT_FOR_NAVIGATION,
6
+ label: 'Wait for Navigation',
7
+ isEntryPoint: false,
8
+ inputs: [
9
+ {
10
+ name: 'Web page',
11
+ type: TaskParamType.BROWSER_INSTANCE,
12
+ required: true,
13
+ },
14
+ ] as const,
15
+ outputs: [
16
+ {
17
+ name: 'Web page',
18
+ type: TaskParamType.BROWSER_INSTANCE,
19
+ },
20
+ ] as const,
21
+ };
@@ -0,0 +1,27 @@
1
+ import { WorkflowTask } from '../types/workflowTasks';
2
+ import { TaskParamType, TaskType } from '../types/task';
3
+
4
+ export const WaitForTimeTask: WorkflowTask = {
5
+ type: TaskType.WAIT_FOR_TIME,
6
+ label: 'Wait for Time',
7
+ isEntryPoint: false,
8
+ inputs: [
9
+ {
10
+ name: 'Web page',
11
+ type: TaskParamType.BROWSER_INSTANCE,
12
+ required: true,
13
+ },
14
+ {
15
+ name: 'Duration (ms)',
16
+ type: TaskParamType.NUMBER,
17
+ required: true,
18
+ description: 'Time to wait in milliseconds',
19
+ },
20
+ ] as const,
21
+ outputs: [
22
+ {
23
+ name: 'Web page',
24
+ type: TaskParamType.BROWSER_INSTANCE,
25
+ },
26
+ ] as const,
27
+ };