workflow-common 1.0.0 → 1.0.1

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 (152) hide show
  1. package/README.md +24 -1
  2. package/{src/index.ts → index.d.ts} +2 -2
  3. package/index.js +18 -0
  4. package/package.json +1 -1
  5. package/tasks/AddPropertyToJsonTask.d.ts +2 -0
  6. package/tasks/AddPropertyToJsonTask.js +32 -0
  7. package/tasks/ApplySessionSorageTask.d.ts +2 -0
  8. package/tasks/ApplySessionSorageTask.js +32 -0
  9. package/tasks/CheckElementExistsTask.d.ts +2 -0
  10. package/tasks/CheckElementExistsTask.js +31 -0
  11. package/tasks/ClearInputTask.d.ts +2 -0
  12. package/tasks/ClearInputTask.js +27 -0
  13. package/tasks/ClickElementTask.d.ts +2 -0
  14. package/tasks/ClickElementTask.js +27 -0
  15. package/tasks/CloseBrowserTask.d.ts +2 -0
  16. package/tasks/CloseBrowserTask.js +17 -0
  17. package/tasks/DeliverViaWebhookTask.d.ts +2 -0
  18. package/tasks/DeliverViaWebhookTask.js +22 -0
  19. package/tasks/DoubleClickElementTask.d.ts +2 -0
  20. package/tasks/DoubleClickElementTask.js +27 -0
  21. package/tasks/ExtractElementByTextTask.d.ts +2 -0
  22. package/tasks/ExtractElementByTextTask.js +47 -0
  23. package/tasks/ExtractTextAndValidateTask.d.ts +2 -0
  24. package/tasks/ExtractTextAndValidateTask.js +37 -0
  25. package/tasks/FillCredentialsTask.d.ts +2 -0
  26. package/tasks/FillCredentialsTask.js +32 -0
  27. package/tasks/FillInputTask.d.ts +2 -0
  28. package/tasks/FillInputTask.js +32 -0
  29. package/tasks/GoForwardTask.d.ts +2 -0
  30. package/tasks/GoForwardTask.js +22 -0
  31. package/tasks/GobackTask.d.ts +2 -0
  32. package/tasks/GobackTask.js +22 -0
  33. package/tasks/HoverElementTask.d.ts +2 -0
  34. package/tasks/HoverElementTask.js +27 -0
  35. package/tasks/HttpRequestTask.d.ts +2 -0
  36. package/tasks/HttpRequestTask.js +58 -0
  37. package/tasks/LaunchBrowserTask.d.ts +2 -0
  38. package/tasks/LaunchBrowserTask.js +21 -0
  39. package/tasks/LogMessageTask.d.ts +2 -0
  40. package/tasks/LogMessageTask.js +37 -0
  41. package/tasks/LoginViaBasicAuthTask.d.ts +2 -0
  42. package/tasks/LoginViaBasicAuthTask.js +32 -0
  43. package/tasks/NavigateUrlTask.d.ts +2 -0
  44. package/tasks/NavigateUrlTask.js +27 -0
  45. package/tasks/PageToHtmlTask.d.ts +2 -0
  46. package/tasks/PageToHtmlTask.js +26 -0
  47. package/tasks/PressKeyTask.d.ts +2 -0
  48. package/tasks/PressKeyTask.js +34 -0
  49. package/tasks/ReadPropertyFromJsonTask.d.ts +2 -0
  50. package/tasks/ReadPropertyFromJsonTask.js +27 -0
  51. package/tasks/ReloadPageTask.d.ts +2 -0
  52. package/tasks/ReloadPageTask.js +22 -0
  53. package/tasks/RightClickElementTask.d.ts +2 -0
  54. package/tasks/RightClickElementTask.js +27 -0
  55. package/tasks/ScrollToBottomTask.d.ts +2 -0
  56. package/tasks/ScrollToBottomTask.js +27 -0
  57. package/tasks/ScrollToElementTask.d.ts +2 -0
  58. package/tasks/ScrollToElementTask.js +27 -0
  59. package/tasks/ScrollToTopTask.d.ts +2 -0
  60. package/tasks/ScrollToTopTask.js +27 -0
  61. package/tasks/SelectDropdownTask.d.ts +2 -0
  62. package/tasks/SelectDropdownTask.js +32 -0
  63. package/tasks/SetCookieTask.d.ts +2 -0
  64. package/tasks/SetCookieTask.js +48 -0
  65. package/tasks/StoreAuthTokenTask.d.ts +2 -0
  66. package/tasks/StoreAuthTokenTask.js +46 -0
  67. package/tasks/TaskRegisteryTask.d.ts +41 -0
  68. package/tasks/TaskRegisteryTask.js +157 -0
  69. package/tasks/ToogleCheckboxTask.d.ts +0 -0
  70. package/{src/tasks/ToogleCheckboxTask.ts → tasks/ToogleCheckboxTask.js} +32 -32
  71. package/tasks/UploadFileTask.d.ts +2 -0
  72. package/tasks/UploadFileTask.js +32 -0
  73. package/tasks/ValidateCheckboxTask.d.ts +2 -0
  74. package/tasks/ValidateCheckboxTask.js +43 -0
  75. package/tasks/WaitForElementTask.d.ts +2 -0
  76. package/tasks/WaitForElementTask.js +43 -0
  77. package/tasks/WaitForNavigationTask.d.ts +2 -0
  78. package/tasks/WaitForNavigationTask.js +22 -0
  79. package/tasks/WaitForTimeTask.d.ts +2 -0
  80. package/tasks/WaitForTimeTask.js +28 -0
  81. package/{src/tasks/index.ts → tasks/index.d.ts} +37 -38
  82. package/tasks/index.js +54 -0
  83. package/types/appNode.d.ts +21 -0
  84. package/types/appNode.js +2 -0
  85. package/types/common.d.ts +4 -0
  86. package/types/common.js +8 -0
  87. package/types/execution.d.ts +37 -0
  88. package/types/execution.js +2 -0
  89. package/types/executor.d.ts +30 -0
  90. package/types/executor.js +2 -0
  91. package/{src/types/index.ts → types/index.d.ts} +10 -10
  92. package/types/index.js +26 -0
  93. package/types/log.d.ts +15 -0
  94. package/types/log.js +2 -0
  95. package/types/schedule.d.ts +52 -0
  96. package/types/schedule.js +75 -0
  97. package/types/suites.d.ts +12 -0
  98. package/types/suites.js +2 -0
  99. package/types/task.d.ts +61 -0
  100. package/types/task.js +63 -0
  101. package/types/workflow.d.ts +41 -0
  102. package/types/workflow.js +35 -0
  103. package/types/workflowTasks.d.ts +8 -0
  104. package/types/workflowTasks.js +2 -0
  105. package/src/tasks/AddPropertyToJsonTask.ts +0 -31
  106. package/src/tasks/ApplySessionSorageTask.ts +0 -31
  107. package/src/tasks/CheckElementExistsTask.ts +0 -30
  108. package/src/tasks/ClearInputTask.ts +0 -26
  109. package/src/tasks/ClickElementTask.ts +0 -26
  110. package/src/tasks/CloseBrowserTask.ts +0 -16
  111. package/src/tasks/DeliverViaWebhookTask.ts +0 -21
  112. package/src/tasks/DoubleClickElementTask.ts +0 -26
  113. package/src/tasks/ExtractElementByTextTask.ts +0 -46
  114. package/src/tasks/ExtractTextAndValidateTask.ts +0 -36
  115. package/src/tasks/FillCredentialsTask.ts +0 -31
  116. package/src/tasks/FillInputTask.ts +0 -31
  117. package/src/tasks/GoForwardTask.ts +0 -21
  118. package/src/tasks/GobackTask.ts +0 -21
  119. package/src/tasks/HoverElementTask.ts +0 -26
  120. package/src/tasks/HttpRequestTask.ts +0 -57
  121. package/src/tasks/LaunchBrowserTask.ts +0 -20
  122. package/src/tasks/LogMessageTask.ts +0 -36
  123. package/src/tasks/LoginViaBasicAuthTask.ts +0 -31
  124. package/src/tasks/NavigateUrlTask.ts +0 -26
  125. package/src/tasks/PageToHtmlTask.ts +0 -25
  126. package/src/tasks/PressKeyTask.ts +0 -33
  127. package/src/tasks/ReadPropertyFromJsonTask.ts +0 -26
  128. package/src/tasks/ReloadPageTask.ts +0 -21
  129. package/src/tasks/RightClickElementTask.ts +0 -26
  130. package/src/tasks/ScrollToBottomTask.ts +0 -26
  131. package/src/tasks/ScrollToElementTask.ts +0 -26
  132. package/src/tasks/ScrollToTopTask.ts +0 -26
  133. package/src/tasks/SelectDropdownTask.ts +0 -31
  134. package/src/tasks/SetCookieTask.ts +0 -47
  135. package/src/tasks/StoreAuthTokenTask.ts +0 -45
  136. package/src/tasks/TaskRegisteryTask.ts +0 -171
  137. package/src/tasks/UploadFileTask.ts +0 -31
  138. package/src/tasks/ValidateCheckboxTask.ts +0 -42
  139. package/src/tasks/WaitForElementTask.ts +0 -42
  140. package/src/tasks/WaitForNavigationTask.ts +0 -21
  141. package/src/tasks/WaitForTimeTask.ts +0 -27
  142. package/src/types/appNode.ts +0 -25
  143. package/src/types/common.ts +0 -5
  144. package/src/types/execution.ts +0 -40
  145. package/src/types/executor.ts +0 -33
  146. package/src/types/log.ts +0 -16
  147. package/src/types/schedule.ts +0 -119
  148. package/src/types/suites.ts +0 -13
  149. package/src/types/task.ts +0 -80
  150. package/src/types/workflow.ts +0 -49
  151. package/src/types/workflowTasks.ts +0 -9
  152. package/tsconfig.json +0 -13
@@ -1,45 +0,0 @@
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
- };
@@ -1,171 +0,0 @@
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;
@@ -1,31 +0,0 @@
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
- };
@@ -1,42 +0,0 @@
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
- };
@@ -1,42 +0,0 @@
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
- };
@@ -1,21 +0,0 @@
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
- };
@@ -1,27 +0,0 @@
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
- };
@@ -1,25 +0,0 @@
1
- import { Node } from '@xyflow/react';
2
- import { TaskParam, TaskType } from './task';
3
-
4
- export interface AppNodeData {
5
- [key: string]: unknown;
6
- type: TaskType;
7
- inputs: Record<string, string>;
8
- label: string;
9
- }
10
-
11
- export interface AppNode extends Node {
12
- data: AppNodeData;
13
- }
14
-
15
- export interface ParamsProps {
16
- param: TaskParam;
17
- value: string;
18
- updateNodeParamValue: (newValue: string) => void;
19
- disabled?: boolean;
20
- }
21
-
22
- export type AppNodeMissingInputs = {
23
- nodeId: string;
24
- inputs: string[];
25
- };
@@ -1,5 +0,0 @@
1
- export const Browsers = [
2
- { label: 'Chrome', value: 'chrome' },
3
- { label: 'Firefox', value: 'firefox' },
4
- { label: 'Safari (WebKit)', value: 'safari' },
5
- ];
@@ -1,40 +0,0 @@
1
- import { WorkflowExecutionStatus, WorkflowExecutionTrigger } from './workflow';
2
-
3
- export type WorkflowExecution = {
4
- id: string;
5
- workflowId: string;
6
- userId: string;
7
- status: WorkflowExecutionStatus;
8
- startedAt?: Date | null;
9
- endedAt?: string | null;
10
- trigger: WorkflowExecutionTrigger;
11
- definition?: string | null;
12
- phases?: ExecutionPhase[];
13
- browser: string;
14
- videoUrl: string | null;
15
- };
16
-
17
- export type ExecutionPhase = {
18
- id: string;
19
- number: number;
20
- userId: string;
21
- status: string;
22
- startedAt: Date | null;
23
- completedAt: Date | null;
24
- name: string;
25
- node: string;
26
- inputs: string | null;
27
- outputs: string | null;
28
- screenshot: string | null;
29
- workflowExecutionId: string;
30
- logs: Logs[];
31
- };
32
-
33
- export type Logs = {
34
- id: string;
35
- phaseId: string;
36
- timestamp: Date;
37
- message: string;
38
- type: string;
39
- logLevel: 'info' | 'error' | 'debug' | 'warn';
40
- };
@@ -1,33 +0,0 @@
1
- import { Browser, Page } from 'playwright';
2
- import { LogCollector } from './log';
3
- import { Workflowtask } from './workflow';
4
-
5
- export interface Environment {
6
- phases: {
7
- [key: string]: {
8
- inputs: { [key: string]: string };
9
- outputs: { [key: string]: string };
10
- screenshot?: string;
11
- };
12
- };
13
- browser?: Browser;
14
- page?: Page;
15
- browserType?: string;
16
- }
17
-
18
- export interface ExecutionEnvironmentType<T extends Workflowtask> {
19
- getInput(name: T['inputs'][number]['name']): string;
20
- setOutput(name: T['outputs'][number]['name'], value: string): void;
21
-
22
- getBrowser(): Browser | undefined;
23
- setBrowser(browser: Browser): void;
24
-
25
- getPage(): Page | undefined;
26
- setPage(page: Page): void;
27
-
28
- setScreenshot(screenshot: string): void;
29
-
30
- getBrowserType(): string;
31
-
32
- log: LogCollector;
33
- }
package/src/types/log.ts DELETED
@@ -1,16 +0,0 @@
1
- export interface LogEntry {
2
- message: string;
3
- timestamp: Date;
4
- level: string;
5
- type?: string;
6
- }
7
-
8
- export interface LogCollector {
9
- info: (message: string) => void;
10
- warn: (message: string) => void;
11
- error: (message: string) => void;
12
- debug: (message: string) => void;
13
- console: (message: string) => void;
14
- getStandardLogs: () => LogEntry[];
15
- getConsoleLogs: () => LogEntry[];
16
- }
@@ -1,119 +0,0 @@
1
- import { Timestamp } from "firebase/firestore";
2
- import { addDays, addWeeks, addMonths, set, isBefore } from "date-fns";
3
-
4
- export enum ScheduleStatus {
5
- ENABLED = "ENABLED",
6
- DISABLED = "DISABLED",
7
- PAUSED = "PAUSED",
8
- }
9
-
10
- export enum ScheduleFrequency {
11
- ONCE = "ONCE",
12
- DAILY = "DAILY",
13
- WEEKLY = "WEEKLY",
14
- MONTHLY = "MONTHLY",
15
- }
16
-
17
- export interface Schedule {
18
- id: string;
19
- workflowId: string;
20
- applicationId: string;
21
- name: string;
22
- description?: string;
23
- status: ScheduleStatus;
24
- frequency: ScheduleFrequency;
25
- nextRunAt: Timestamp;
26
- lastRunAt?: Timestamp;
27
- lastRunId?: string;
28
- lastRunStatus?: "COMPLETED" | "FAILED";
29
- createdAt: Timestamp;
30
- createdBy: string;
31
- updatedAt: Timestamp;
32
- updatedBy: string;
33
- timezone: string;
34
- retryCount: number;
35
- maxRetries: number;
36
- retryDelay: number; // in minutes
37
- configuration: configuration;
38
- }
39
-
40
- export interface configuration {
41
- time?: string; // HH:mm format
42
- dayOfWeek?: number; // 0-6 (Sunday-Saturday)
43
- dayOfMonth?: number; // 1-31
44
- browser: string;
45
- }
46
-
47
- export interface ScheduleExecution {
48
- id: string;
49
- scheduleId: string;
50
- workflowId: string;
51
- status: "PENDING" | "IN_PROGRESS" | "COMPLETED" | "FAILED";
52
- startedAt: Timestamp;
53
- completedAt?: Timestamp;
54
- error?: string;
55
- retryCount: number;
56
- nextRetryAt?: Timestamp;
57
- }
58
-
59
- export function calculateNextRunAt(
60
- frequency: ScheduleFrequency,
61
- configuration: configuration
62
- ) {
63
- const now = new Date();
64
- const [hour, minute] = (configuration.time || "00:00").split(":").map(Number);
65
-
66
- switch (frequency) {
67
- case "ONCE": {
68
- const runDate = set(now, {
69
- hours: hour,
70
- minutes: minute,
71
- seconds: 0,
72
- milliseconds: 0,
73
- });
74
- return Timestamp.fromDate(runDate);
75
- }
76
-
77
- case "DAILY": {
78
- let next = set(now, {
79
- hours: hour,
80
- minutes: minute,
81
- seconds: 0,
82
- milliseconds: 0,
83
- });
84
- if (isBefore(next, now)) next = addDays(next, 1);
85
- return Timestamp.fromDate(next);
86
- }
87
-
88
- case "WEEKLY": {
89
- const targetWeekday = configuration.dayOfWeek ?? 0; // Sunday = 0
90
- let next = set(now, {
91
- hours: hour,
92
- minutes: minute,
93
- seconds: 0,
94
- milliseconds: 0,
95
- });
96
- while (next.getDay() !== targetWeekday) {
97
- next = addDays(next, 1);
98
- }
99
- if (isBefore(next, now)) next = addWeeks(next, 1);
100
- return Timestamp.fromDate(next);
101
- }
102
-
103
- case "MONTHLY": {
104
- const targetDay = configuration.dayOfMonth ?? 1;
105
- let next = set(now, {
106
- date: targetDay,
107
- hours: hour,
108
- minutes: minute,
109
- seconds: 0,
110
- milliseconds: 0,
111
- });
112
- if (isBefore(next, now)) next = addMonths(next, 1);
113
- return Timestamp.fromDate(next);
114
- }
115
-
116
- default:
117
- throw new Error("Invalid frequency type");
118
- }
119
- }
@@ -1,13 +0,0 @@
1
- import { WorkflowExecutionStatus, WorkflowExecutionTrigger } from './workflow';
2
-
3
- export type SuiteExecution = {
4
- id: string;
5
- status: WorkflowExecutionStatus;
6
- startedAt?: Date | null;
7
- endedAt?: string | null;
8
- trigger: WorkflowExecutionTrigger;
9
- browser: string;
10
- executionType: string;
11
- executionIds: string[];
12
- suiteId: string;
13
- };