workflow-common 1.0.0 → 1.0.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 (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
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +1,10 @@
1
- export * from './appNode';
2
- export * from './executor';
3
- export * from './common';
4
- export * from './execution';
5
- export * from './log';
6
- export * from './schedule';
7
- export * from './task';
8
- export * from './workflow';
9
- export * from './workflowTasks';
10
- export * from './suites';
1
+ export * from './appNode';
2
+ export * from './executor';
3
+ export * from './common';
4
+ export * from './execution';
5
+ export * from './log';
6
+ export * from './schedule';
7
+ export * from './task';
8
+ export * from './workflow';
9
+ export * from './workflowTasks';
10
+ export * from './suites';
package/types/index.js ADDED
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./appNode"), exports);
18
+ __exportStar(require("./executor"), exports);
19
+ __exportStar(require("./common"), exports);
20
+ __exportStar(require("./execution"), exports);
21
+ __exportStar(require("./log"), exports);
22
+ __exportStar(require("./schedule"), exports);
23
+ __exportStar(require("./task"), exports);
24
+ __exportStar(require("./workflow"), exports);
25
+ __exportStar(require("./workflowTasks"), exports);
26
+ __exportStar(require("./suites"), exports);
package/types/log.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ export interface LogEntry {
2
+ message: string;
3
+ timestamp: Date;
4
+ level: string;
5
+ type?: string;
6
+ }
7
+ export interface LogCollector {
8
+ info: (message: string) => void;
9
+ warn: (message: string) => void;
10
+ error: (message: string) => void;
11
+ debug: (message: string) => void;
12
+ console: (message: string) => void;
13
+ getStandardLogs: () => LogEntry[];
14
+ getConsoleLogs: () => LogEntry[];
15
+ }
package/types/log.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,52 @@
1
+ import { Timestamp } from "firebase/firestore";
2
+ export declare enum ScheduleStatus {
3
+ ENABLED = "ENABLED",
4
+ DISABLED = "DISABLED",
5
+ PAUSED = "PAUSED"
6
+ }
7
+ export declare enum ScheduleFrequency {
8
+ ONCE = "ONCE",
9
+ DAILY = "DAILY",
10
+ WEEKLY = "WEEKLY",
11
+ MONTHLY = "MONTHLY"
12
+ }
13
+ export interface Schedule {
14
+ id: string;
15
+ workflowId: string;
16
+ applicationId: string;
17
+ name: string;
18
+ description?: string;
19
+ status: ScheduleStatus;
20
+ frequency: ScheduleFrequency;
21
+ nextRunAt: Timestamp;
22
+ lastRunAt?: Timestamp;
23
+ lastRunId?: string;
24
+ lastRunStatus?: "COMPLETED" | "FAILED";
25
+ createdAt: Timestamp;
26
+ createdBy: string;
27
+ updatedAt: Timestamp;
28
+ updatedBy: string;
29
+ timezone: string;
30
+ retryCount: number;
31
+ maxRetries: number;
32
+ retryDelay: number;
33
+ configuration: configuration;
34
+ }
35
+ export interface configuration {
36
+ time?: string;
37
+ dayOfWeek?: number;
38
+ dayOfMonth?: number;
39
+ browser: string;
40
+ }
41
+ export interface ScheduleExecution {
42
+ id: string;
43
+ scheduleId: string;
44
+ workflowId: string;
45
+ status: "PENDING" | "IN_PROGRESS" | "COMPLETED" | "FAILED";
46
+ startedAt: Timestamp;
47
+ completedAt?: Timestamp;
48
+ error?: string;
49
+ retryCount: number;
50
+ nextRetryAt?: Timestamp;
51
+ }
52
+ export declare function calculateNextRunAt(frequency: ScheduleFrequency, configuration: configuration): Timestamp;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ScheduleFrequency = exports.ScheduleStatus = void 0;
4
+ exports.calculateNextRunAt = calculateNextRunAt;
5
+ const firestore_1 = require("firebase/firestore");
6
+ const date_fns_1 = require("date-fns");
7
+ var ScheduleStatus;
8
+ (function (ScheduleStatus) {
9
+ ScheduleStatus["ENABLED"] = "ENABLED";
10
+ ScheduleStatus["DISABLED"] = "DISABLED";
11
+ ScheduleStatus["PAUSED"] = "PAUSED";
12
+ })(ScheduleStatus || (exports.ScheduleStatus = ScheduleStatus = {}));
13
+ var ScheduleFrequency;
14
+ (function (ScheduleFrequency) {
15
+ ScheduleFrequency["ONCE"] = "ONCE";
16
+ ScheduleFrequency["DAILY"] = "DAILY";
17
+ ScheduleFrequency["WEEKLY"] = "WEEKLY";
18
+ ScheduleFrequency["MONTHLY"] = "MONTHLY";
19
+ })(ScheduleFrequency || (exports.ScheduleFrequency = ScheduleFrequency = {}));
20
+ function calculateNextRunAt(frequency, configuration) {
21
+ const now = new Date();
22
+ const [hour, minute] = (configuration.time || "00:00").split(":").map(Number);
23
+ switch (frequency) {
24
+ case "ONCE": {
25
+ const runDate = (0, date_fns_1.set)(now, {
26
+ hours: hour,
27
+ minutes: minute,
28
+ seconds: 0,
29
+ milliseconds: 0,
30
+ });
31
+ return firestore_1.Timestamp.fromDate(runDate);
32
+ }
33
+ case "DAILY": {
34
+ let next = (0, date_fns_1.set)(now, {
35
+ hours: hour,
36
+ minutes: minute,
37
+ seconds: 0,
38
+ milliseconds: 0,
39
+ });
40
+ if ((0, date_fns_1.isBefore)(next, now))
41
+ next = (0, date_fns_1.addDays)(next, 1);
42
+ return firestore_1.Timestamp.fromDate(next);
43
+ }
44
+ case "WEEKLY": {
45
+ const targetWeekday = configuration.dayOfWeek ?? 0; // Sunday = 0
46
+ let next = (0, date_fns_1.set)(now, {
47
+ hours: hour,
48
+ minutes: minute,
49
+ seconds: 0,
50
+ milliseconds: 0,
51
+ });
52
+ while (next.getDay() !== targetWeekday) {
53
+ next = (0, date_fns_1.addDays)(next, 1);
54
+ }
55
+ if ((0, date_fns_1.isBefore)(next, now))
56
+ next = (0, date_fns_1.addWeeks)(next, 1);
57
+ return firestore_1.Timestamp.fromDate(next);
58
+ }
59
+ case "MONTHLY": {
60
+ const targetDay = configuration.dayOfMonth ?? 1;
61
+ let next = (0, date_fns_1.set)(now, {
62
+ date: targetDay,
63
+ hours: hour,
64
+ minutes: minute,
65
+ seconds: 0,
66
+ milliseconds: 0,
67
+ });
68
+ if ((0, date_fns_1.isBefore)(next, now))
69
+ next = (0, date_fns_1.addMonths)(next, 1);
70
+ return firestore_1.Timestamp.fromDate(next);
71
+ }
72
+ default:
73
+ throw new Error("Invalid frequency type");
74
+ }
75
+ }
@@ -0,0 +1,12 @@
1
+ import { WorkflowExecutionStatus, WorkflowExecutionTrigger } from './workflow';
2
+ export type SuiteExecution = {
3
+ id: string;
4
+ status: WorkflowExecutionStatus;
5
+ startedAt?: Date | null;
6
+ endedAt?: string | null;
7
+ trigger: WorkflowExecutionTrigger;
8
+ browser: string;
9
+ executionType: string;
10
+ executionIds: string[];
11
+ suiteId: string;
12
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,61 @@
1
+ export declare enum TaskType {
2
+ LAUNCH_BROWSER = "LAUNCH_BROWSER",
3
+ CLOSE_BROWSER = "CLOSE_BROWSER",
4
+ RELOAD_PAGE = "RELOAD_PAGE",
5
+ NAVIGATE_URL = "NAVIGATE_URL",
6
+ GO_BACK = "GO_BACK",
7
+ GO_FORWARD = "GO_FORWARD",
8
+ PAGE_TO_HTML = "PAGE_TO_HTML",
9
+ EXTRACT_ELEMENT_BY_TEXT = "EXTRACT_ELEMENT_BY_TEXT",
10
+ FILL_INPUT = "FILL_INPUT",
11
+ FILL_CREDENTIAL = "FILL_CREDENTIAL",
12
+ CLICK_ELEMENT = "CLICK_ELEMENT",
13
+ SELECT_DROPDOWN = "SELECT_DROPDOWN",
14
+ VALIDATE_CHECKBOX = "VALIDATE_CHECKBOX",
15
+ CLEAR_INPUT = "CLEAR_INPUT",
16
+ UPLOAD_FILE = "UPLOAD_FILE",
17
+ HOVER_ELEMENT = "HOVER_ELEMENT",
18
+ DOUBLE_CLICK_ELEMENT = "DOUBLE_CLICK_ELEMENT",
19
+ RIGHT_CLICK_ELEMENT = "RIGHT_CLICK_ELEMENT",
20
+ PRESS_KEY = "PRESS_KEY",
21
+ WAIT_FOR_ELEMENT = "WAIT_FOR_ELEMENT",
22
+ WAIT_FOR_TIME = "WAIT_FOR_TIME",
23
+ WAIT_FOR_NAVIGATION = "WAIT_FOR_NAVIGATION",
24
+ CHECK_ELEMENT_EXISTS = "CHECK_ELEMENT_EXISTS",
25
+ EXTRACT_TEXT_AND_VALIDATE = "EXTRACT_TEXT_AND_VALIDATE",
26
+ SCROLL_TO_ELEMENT = "SCROLL_TO_ELEMENT",
27
+ SCROLL_TO_TOP = "SCROLL_TO_TOP",
28
+ SCROLL_TO_BOTTOM = "SCROLL_TO_BOTTOM",
29
+ READ_PROPERTY_FROM_JSON = "READ_PROPERTY_FROM_JSON",
30
+ ADD_PROPERTY_TO_JSON = "ADD_PROPERTY_TO_JSON",
31
+ SET_COOKIE = "SET_COOKIE",
32
+ LOGIN_VIA_BASIC_AUTH = "LOGIN_VIA_BASIC_AUTH",
33
+ APPLY_SESSION_STORAGE = "APPLY_SESSION_STORAGE",
34
+ STORE_AUTH_TOKEN = "STORE_AUTH_TOKEN",
35
+ DELIVER_VIA_WEBHOOK = "DELIVER_VIA_WEBHOOK",
36
+ HTTP_REQUEST = "HTTP_REQUEST",
37
+ LOG_MESSAGE = "LOG_MESSAGE"
38
+ }
39
+ export declare enum TaskParamType {
40
+ STRING = "STRING",
41
+ BROWSER_INSTANCE = "BROWSER_INSTANCE",
42
+ SELECT = "SELECT",
43
+ CREDENTIAL = "CREDENTIAL",
44
+ JSON = "JSON",
45
+ NUMBER = "NUMBER",
46
+ BOOLEAN = "BOOLEAN",
47
+ ARRAY = "ARRAY",
48
+ OBJECT = "OBJECT"
49
+ }
50
+ export interface TaskParam {
51
+ name: string;
52
+ type: TaskParamType;
53
+ helperText?: string;
54
+ required?: boolean;
55
+ hideHandle?: boolean;
56
+ [key: string]: unknown;
57
+ }
58
+ export interface TaskOutput {
59
+ name: string;
60
+ type: TaskParamType;
61
+ }
package/types/task.js ADDED
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TaskParamType = exports.TaskType = void 0;
4
+ var TaskType;
5
+ (function (TaskType) {
6
+ //Browser & Page Control
7
+ TaskType["LAUNCH_BROWSER"] = "LAUNCH_BROWSER";
8
+ TaskType["CLOSE_BROWSER"] = "CLOSE_BROWSER";
9
+ TaskType["RELOAD_PAGE"] = "RELOAD_PAGE";
10
+ TaskType["NAVIGATE_URL"] = "NAVIGATE_URL";
11
+ TaskType["GO_BACK"] = "GO_BACK";
12
+ TaskType["GO_FORWARD"] = "GO_FORWARD";
13
+ //Page Content Extraction
14
+ TaskType["PAGE_TO_HTML"] = "PAGE_TO_HTML";
15
+ TaskType["EXTRACT_ELEMENT_BY_TEXT"] = "EXTRACT_ELEMENT_BY_TEXT";
16
+ //Interactions & Form Handling
17
+ TaskType["FILL_INPUT"] = "FILL_INPUT";
18
+ TaskType["FILL_CREDENTIAL"] = "FILL_CREDENTIAL";
19
+ TaskType["CLICK_ELEMENT"] = "CLICK_ELEMENT";
20
+ TaskType["SELECT_DROPDOWN"] = "SELECT_DROPDOWN";
21
+ TaskType["VALIDATE_CHECKBOX"] = "VALIDATE_CHECKBOX";
22
+ TaskType["CLEAR_INPUT"] = "CLEAR_INPUT";
23
+ // TOGGLE_CHECKBOX = 'TOGGLE_CHECKBOX',
24
+ TaskType["UPLOAD_FILE"] = "UPLOAD_FILE";
25
+ TaskType["HOVER_ELEMENT"] = "HOVER_ELEMENT";
26
+ TaskType["DOUBLE_CLICK_ELEMENT"] = "DOUBLE_CLICK_ELEMENT";
27
+ TaskType["RIGHT_CLICK_ELEMENT"] = "RIGHT_CLICK_ELEMENT";
28
+ TaskType["PRESS_KEY"] = "PRESS_KEY";
29
+ //Waits & Conditions
30
+ TaskType["WAIT_FOR_ELEMENT"] = "WAIT_FOR_ELEMENT";
31
+ TaskType["WAIT_FOR_TIME"] = "WAIT_FOR_TIME";
32
+ TaskType["WAIT_FOR_NAVIGATION"] = "WAIT_FOR_NAVIGATION";
33
+ TaskType["CHECK_ELEMENT_EXISTS"] = "CHECK_ELEMENT_EXISTS";
34
+ TaskType["EXTRACT_TEXT_AND_VALIDATE"] = "EXTRACT_TEXT_AND_VALIDATE";
35
+ //Scrolling
36
+ TaskType["SCROLL_TO_ELEMENT"] = "SCROLL_TO_ELEMENT";
37
+ TaskType["SCROLL_TO_TOP"] = "SCROLL_TO_TOP";
38
+ TaskType["SCROLL_TO_BOTTOM"] = "SCROLL_TO_BOTTOM";
39
+ //Flow & Data Manipulation
40
+ TaskType["READ_PROPERTY_FROM_JSON"] = "READ_PROPERTY_FROM_JSON";
41
+ TaskType["ADD_PROPERTY_TO_JSON"] = "ADD_PROPERTY_TO_JSON";
42
+ //Authentication & Session
43
+ TaskType["SET_COOKIE"] = "SET_COOKIE";
44
+ TaskType["LOGIN_VIA_BASIC_AUTH"] = "LOGIN_VIA_BASIC_AUTH";
45
+ TaskType["APPLY_SESSION_STORAGE"] = "APPLY_SESSION_STORAGE";
46
+ TaskType["STORE_AUTH_TOKEN"] = "STORE_AUTH_TOKEN";
47
+ //Delivery & Output
48
+ TaskType["DELIVER_VIA_WEBHOOK"] = "DELIVER_VIA_WEBHOOK";
49
+ TaskType["HTTP_REQUEST"] = "HTTP_REQUEST";
50
+ TaskType["LOG_MESSAGE"] = "LOG_MESSAGE";
51
+ })(TaskType || (exports.TaskType = TaskType = {}));
52
+ var TaskParamType;
53
+ (function (TaskParamType) {
54
+ TaskParamType["STRING"] = "STRING";
55
+ TaskParamType["BROWSER_INSTANCE"] = "BROWSER_INSTANCE";
56
+ TaskParamType["SELECT"] = "SELECT";
57
+ TaskParamType["CREDENTIAL"] = "CREDENTIAL";
58
+ TaskParamType["JSON"] = "JSON";
59
+ TaskParamType["NUMBER"] = "NUMBER";
60
+ TaskParamType["BOOLEAN"] = "BOOLEAN";
61
+ TaskParamType["ARRAY"] = "ARRAY";
62
+ TaskParamType["OBJECT"] = "OBJECT";
63
+ })(TaskParamType || (exports.TaskParamType = TaskParamType = {}));
@@ -0,0 +1,41 @@
1
+ import { TaskParam, TaskType } from './task';
2
+ import { AppNode } from './appNode';
3
+ export declare enum WorkflowStatus {
4
+ DRAFT = "DRAFT",
5
+ PUBLISHED = "PUBLISHED"
6
+ }
7
+ export type Workflowtask = {
8
+ label: string;
9
+ type: TaskType;
10
+ isEntryPoint?: boolean;
11
+ inputs: TaskParam[];
12
+ outputs: TaskParam[];
13
+ };
14
+ export type WorkflowExecutionPlan = WorkflowExecutionPlanPhase[];
15
+ export type WorkflowExecutionPlanPhase = {
16
+ phase: number;
17
+ nodes: AppNode[];
18
+ };
19
+ export declare enum WorkflowExecutionStatus {
20
+ PENDING = "PENDING",
21
+ RUNNING = "RUNNING",
22
+ COMPLETED = "COMPLETED",
23
+ FAILED = "FAILED"
24
+ }
25
+ export declare enum ExecutionPhaseStatus {
26
+ CREATED = "CREATED",
27
+ PENDING = "PENDING",
28
+ RUNNING = "RUNNING",
29
+ COMPLETED = "COMPLETED",
30
+ FAILED = "FAILED"
31
+ }
32
+ export declare enum WorkflowExecutionTrigger {
33
+ MANUAL = "MANUAL",
34
+ SCHEDULED = "SCHEDULED"
35
+ }
36
+ export declare enum ScheduleExecutionStatus {
37
+ PENDING = "PENDING",
38
+ RUNNING = "RUNNING",
39
+ COMPLETED = "COMPLETED",
40
+ FAILED = "FAILED"
41
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ScheduleExecutionStatus = exports.WorkflowExecutionTrigger = exports.ExecutionPhaseStatus = exports.WorkflowExecutionStatus = exports.WorkflowStatus = void 0;
4
+ var WorkflowStatus;
5
+ (function (WorkflowStatus) {
6
+ WorkflowStatus["DRAFT"] = "DRAFT";
7
+ WorkflowStatus["PUBLISHED"] = "PUBLISHED";
8
+ })(WorkflowStatus || (exports.WorkflowStatus = WorkflowStatus = {}));
9
+ var WorkflowExecutionStatus;
10
+ (function (WorkflowExecutionStatus) {
11
+ WorkflowExecutionStatus["PENDING"] = "PENDING";
12
+ WorkflowExecutionStatus["RUNNING"] = "RUNNING";
13
+ WorkflowExecutionStatus["COMPLETED"] = "COMPLETED";
14
+ WorkflowExecutionStatus["FAILED"] = "FAILED";
15
+ })(WorkflowExecutionStatus || (exports.WorkflowExecutionStatus = WorkflowExecutionStatus = {}));
16
+ var ExecutionPhaseStatus;
17
+ (function (ExecutionPhaseStatus) {
18
+ ExecutionPhaseStatus["CREATED"] = "CREATED";
19
+ ExecutionPhaseStatus["PENDING"] = "PENDING";
20
+ ExecutionPhaseStatus["RUNNING"] = "RUNNING";
21
+ ExecutionPhaseStatus["COMPLETED"] = "COMPLETED";
22
+ ExecutionPhaseStatus["FAILED"] = "FAILED";
23
+ })(ExecutionPhaseStatus || (exports.ExecutionPhaseStatus = ExecutionPhaseStatus = {}));
24
+ var WorkflowExecutionTrigger;
25
+ (function (WorkflowExecutionTrigger) {
26
+ WorkflowExecutionTrigger["MANUAL"] = "MANUAL";
27
+ WorkflowExecutionTrigger["SCHEDULED"] = "SCHEDULED";
28
+ })(WorkflowExecutionTrigger || (exports.WorkflowExecutionTrigger = WorkflowExecutionTrigger = {}));
29
+ var ScheduleExecutionStatus;
30
+ (function (ScheduleExecutionStatus) {
31
+ ScheduleExecutionStatus["PENDING"] = "PENDING";
32
+ ScheduleExecutionStatus["RUNNING"] = "RUNNING";
33
+ ScheduleExecutionStatus["COMPLETED"] = "COMPLETED";
34
+ ScheduleExecutionStatus["FAILED"] = "FAILED";
35
+ })(ScheduleExecutionStatus || (exports.ScheduleExecutionStatus = ScheduleExecutionStatus = {}));
@@ -0,0 +1,8 @@
1
+ import { TaskParam, TaskType } from './task';
2
+ export type WorkflowTask = {
3
+ label: string;
4
+ type: TaskType;
5
+ isEntryPoint?: boolean;
6
+ inputs: TaskParam[];
7
+ outputs: TaskParam[];
8
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,31 +0,0 @@
1
- import { WorkflowTask } from '../types/workflowTasks';
2
- import { TaskParamType, TaskType } from '../types/task';
3
-
4
- export const AddPropertyToJsonTask: WorkflowTask = {
5
- type: TaskType.ADD_PROPERTY_TO_JSON,
6
- label: 'Add Property to 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
- {
20
- name: 'Property value',
21
- type: TaskParamType.STRING,
22
- required: true,
23
- },
24
- ] as const,
25
- outputs: [
26
- {
27
- name: 'Updated JSON',
28
- type: TaskParamType.STRING,
29
- },
30
- ] as const,
31
- };
@@ -1,31 +0,0 @@
1
- import { WorkflowTask } from '../types/workflowTasks';
2
- import { TaskParamType, TaskType } from '../types/task';
3
-
4
- export const ApplySessionStorageTask: WorkflowTask = {
5
- type: TaskType.APPLY_SESSION_STORAGE,
6
- label: 'Apply Session Storage',
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.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
- };
@@ -1,30 +0,0 @@
1
- import { WorkflowTask } from '../types/workflowTasks';
2
- import { TaskParamType, TaskType } from '../types/task';
3
-
4
- export const CheckElementExistsTask: WorkflowTask = {
5
- type: TaskType.CHECK_ELEMENT_EXISTS,
6
- label: 'Check Element Exists',
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: 'Exists',
23
- type: TaskParamType.BOOLEAN,
24
- },
25
- {
26
- name: 'Web page',
27
- type: TaskParamType.BROWSER_INSTANCE,
28
- },
29
- ] as const,
30
- };
@@ -1,26 +0,0 @@
1
- import { WorkflowTask } from '../types/workflowTasks';
2
- import { TaskParamType, TaskType } from '../types/task';
3
-
4
- export const ClearInputTask: WorkflowTask = {
5
- type: TaskType.CLEAR_INPUT,
6
- label: 'Clear Input Field',
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
- };
@@ -1,26 +0,0 @@
1
- import { WorkflowTask } from '../types/workflowTasks';
2
- import { TaskParamType, TaskType } from '../types/task';
3
-
4
- export const ClickElementTask: WorkflowTask = {
5
- type: TaskType.CLICK_ELEMENT,
6
- label: '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
- };
@@ -1,16 +0,0 @@
1
- import { WorkflowTask } from '../types/workflowTasks';
2
- import { TaskParamType, TaskType } from '../types/task';
3
-
4
- export const CloseBrowserTask: WorkflowTask = {
5
- type: TaskType.CLOSE_BROWSER,
6
- label: 'Close Browser',
7
- isEntryPoint: false,
8
- inputs: [
9
- {
10
- name: 'Web page',
11
- type: TaskParamType.BROWSER_INSTANCE,
12
- required: true,
13
- },
14
- ] as const,
15
- outputs: [] as const, // No output because browser is closed
16
- };
@@ -1,21 +0,0 @@
1
- import { WorkflowTask } from '../types/workflowTasks';
2
- import { TaskParamType, TaskType } from '../types/task';
3
-
4
- export const DeliverViaWebhookTask: WorkflowTask = {
5
- type: TaskType.DELIVER_VIA_WEBHOOK,
6
- label: 'Deliver via webhook',
7
- isEntryPoint: false,
8
- inputs: [
9
- {
10
- name: 'Target URL',
11
- type: TaskParamType.STRING,
12
- required: true,
13
- },
14
- {
15
- name: 'Body',
16
- type: TaskParamType.STRING,
17
- required: true,
18
- },
19
- ] as const,
20
- outputs: [] as const,
21
- };
@@ -1,26 +0,0 @@
1
- import { WorkflowTask } from '../types/workflowTasks';
2
- import { TaskParamType, TaskType } from '../types/task';
3
-
4
- export const DoubleClickElementTask: WorkflowTask = {
5
- type: TaskType.DOUBLE_CLICK_ELEMENT,
6
- label: 'Double 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
- };