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.
- package/README.md +25 -0
- package/package.json +24 -0
- package/src/index.ts +2 -0
- package/src/tasks/AddPropertyToJsonTask.ts +31 -0
- package/src/tasks/ApplySessionSorageTask.ts +31 -0
- package/src/tasks/CheckElementExistsTask.ts +30 -0
- package/src/tasks/ClearInputTask.ts +26 -0
- package/src/tasks/ClickElementTask.ts +26 -0
- package/src/tasks/CloseBrowserTask.ts +16 -0
- package/src/tasks/DeliverViaWebhookTask.ts +21 -0
- package/src/tasks/DoubleClickElementTask.ts +26 -0
- package/src/tasks/ExtractElementByTextTask.ts +46 -0
- package/src/tasks/ExtractTextAndValidateTask.ts +36 -0
- package/src/tasks/FillCredentialsTask.ts +31 -0
- package/src/tasks/FillInputTask.ts +31 -0
- package/src/tasks/GoForwardTask.ts +21 -0
- package/src/tasks/GobackTask.ts +21 -0
- package/src/tasks/HoverElementTask.ts +26 -0
- package/src/tasks/HttpRequestTask.ts +57 -0
- package/src/tasks/LaunchBrowserTask.ts +20 -0
- package/src/tasks/LogMessageTask.ts +36 -0
- package/src/tasks/LoginViaBasicAuthTask.ts +31 -0
- package/src/tasks/NavigateUrlTask.ts +26 -0
- package/src/tasks/PageToHtmlTask.ts +25 -0
- package/src/tasks/PressKeyTask.ts +33 -0
- package/src/tasks/ReadPropertyFromJsonTask.ts +26 -0
- package/src/tasks/ReloadPageTask.ts +21 -0
- package/src/tasks/RightClickElementTask.ts +26 -0
- package/src/tasks/ScrollToBottomTask.ts +26 -0
- package/src/tasks/ScrollToElementTask.ts +26 -0
- package/src/tasks/ScrollToTopTask.ts +26 -0
- package/src/tasks/SelectDropdownTask.ts +31 -0
- package/src/tasks/SetCookieTask.ts +47 -0
- package/src/tasks/StoreAuthTokenTask.ts +45 -0
- package/src/tasks/TaskRegisteryTask.ts +171 -0
- package/src/tasks/ToogleCheckboxTask.ts +32 -0
- package/src/tasks/UploadFileTask.ts +31 -0
- package/src/tasks/ValidateCheckboxTask.ts +42 -0
- package/src/tasks/WaitForElementTask.ts +42 -0
- package/src/tasks/WaitForNavigationTask.ts +21 -0
- package/src/tasks/WaitForTimeTask.ts +27 -0
- package/src/tasks/index.ts +38 -0
- package/src/types/appNode.ts +25 -0
- package/src/types/common.ts +5 -0
- package/src/types/execution.ts +40 -0
- package/src/types/executor.ts +33 -0
- package/src/types/index.ts +10 -0
- package/src/types/log.ts +16 -0
- package/src/types/schedule.ts +119 -0
- package/src/types/suites.ts +13 -0
- package/src/types/task.ts +80 -0
- package/src/types/workflow.ts +49 -0
- package/src/types/workflowTasks.ts +9 -0
- package/tsconfig.json +13 -0
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Workflow Common Library
|
|
2
|
+
|
|
3
|
+
The **Workflow Common Library** is a shared library designed to support both the **Bolt UI** and backend systems. It provides a collection of reusable tasks, types, and utilities to streamline workflow execution and automation processes.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Reusable Tasks**: Includes a variety of pre-built tasks such as browser automation, HTTP requests, form filling, and more.
|
|
10
|
+
- **Type Definitions**: Provides strongly-typed models for workflows, tasks, execution plans, and more.
|
|
11
|
+
- **Integration with Playwright**: Leverages Playwright for browser automation and testing.
|
|
12
|
+
- **Firebase Support**: Includes utilities for Firebase integration.
|
|
13
|
+
- **Date Utilities**: Uses `date-fns` for date manipulation and formatting.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Getting Started
|
|
18
|
+
|
|
19
|
+
### Installation
|
|
20
|
+
|
|
21
|
+
To use this library in your project, install it via npm:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install workflow-common
|
|
25
|
+
```
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "workflow-common",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "this is shared library project for bolt ui and backend",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"watch": "tsc -w"
|
|
11
|
+
},
|
|
12
|
+
"author": "Aviral Kesarwani",
|
|
13
|
+
"license": "ISC",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@playwright/test": "^1.53.2",
|
|
16
|
+
"@xyflow/react": "^12.8.2",
|
|
17
|
+
"date-fns": "^4.1.0",
|
|
18
|
+
"firebase": "^11.10.0",
|
|
19
|
+
"typescript": "^5.8.3"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/react": "^19.1.9"
|
|
23
|
+
}
|
|
24
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { WorkflowTask } from '../types/workflowTasks';
|
|
2
|
+
import { TaskParamType, TaskType } from '../types/task';
|
|
3
|
+
|
|
4
|
+
export const ExtractElementByTextTask: WorkflowTask = {
|
|
5
|
+
type: TaskType.EXTRACT_ELEMENT_BY_TEXT,
|
|
6
|
+
label: 'Extract Element by text',
|
|
7
|
+
isEntryPoint: false,
|
|
8
|
+
inputs: [
|
|
9
|
+
{
|
|
10
|
+
name: 'Web page',
|
|
11
|
+
type: TaskParamType.BROWSER_INSTANCE,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'text',
|
|
16
|
+
type: TaskParamType.STRING,
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'element',
|
|
21
|
+
type: TaskParamType.SELECT,
|
|
22
|
+
hideHandle: true,
|
|
23
|
+
required: true,
|
|
24
|
+
options: [
|
|
25
|
+
{
|
|
26
|
+
label: 'div',
|
|
27
|
+
value: 'div',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: 'button',
|
|
31
|
+
value: 'button',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
] as const,
|
|
36
|
+
outputs: [
|
|
37
|
+
{
|
|
38
|
+
name: 'Web page',
|
|
39
|
+
type: TaskParamType.BROWSER_INSTANCE,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'Element Selector',
|
|
43
|
+
type: TaskParamType.STRING,
|
|
44
|
+
},
|
|
45
|
+
] as const,
|
|
46
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { WorkflowTask } from '../types/workflowTasks';
|
|
2
|
+
import { TaskParamType, TaskType } from '../types/task';
|
|
3
|
+
|
|
4
|
+
export const ExtractTextAndValidateTask: WorkflowTask = {
|
|
5
|
+
type: TaskType.EXTRACT_TEXT_AND_VALIDATE,
|
|
6
|
+
label: 'Extract text and validate',
|
|
7
|
+
isEntryPoint: false,
|
|
8
|
+
inputs: [
|
|
9
|
+
{
|
|
10
|
+
name: 'Web page',
|
|
11
|
+
type: TaskParamType.BROWSER_INSTANCE,
|
|
12
|
+
required: true,
|
|
13
|
+
variant: 'textarea',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'Selector',
|
|
17
|
+
type: TaskParamType.STRING,
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Exptected text',
|
|
22
|
+
type: TaskParamType.STRING,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
] as const,
|
|
26
|
+
outputs: [
|
|
27
|
+
{
|
|
28
|
+
name: 'Extracted text',
|
|
29
|
+
type: TaskParamType.STRING,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'Web page',
|
|
33
|
+
type: TaskParamType.BROWSER_INSTANCE,
|
|
34
|
+
},
|
|
35
|
+
] as const,
|
|
36
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { WorkflowTask } from '../types/workflowTasks';
|
|
2
|
+
import { TaskParamType, TaskType } from '../types/task';
|
|
3
|
+
|
|
4
|
+
export const FillCredentialTask: WorkflowTask = {
|
|
5
|
+
type: TaskType.FILL_CREDENTIAL,
|
|
6
|
+
label: 'Fill Credential',
|
|
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: 'Credential',
|
|
21
|
+
type: TaskParamType.CREDENTIAL,
|
|
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,31 @@
|
|
|
1
|
+
import { WorkflowTask } from '../types/workflowTasks';
|
|
2
|
+
import { TaskParamType, TaskType } from '../types/task';
|
|
3
|
+
|
|
4
|
+
export const FillInputTask: WorkflowTask = {
|
|
5
|
+
type: TaskType.FILL_INPUT,
|
|
6
|
+
label: 'Fill Input',
|
|
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,21 @@
|
|
|
1
|
+
import { WorkflowTask } from '../types/workflowTasks';
|
|
2
|
+
import { TaskParamType, TaskType } from '../types/task';
|
|
3
|
+
|
|
4
|
+
export const GoForwardTask: WorkflowTask = {
|
|
5
|
+
type: TaskType.GO_FORWARD,
|
|
6
|
+
label: 'Go Forward',
|
|
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,21 @@
|
|
|
1
|
+
import { WorkflowTask } from '../types/workflowTasks';
|
|
2
|
+
import { TaskParamType, TaskType } from '../types/task';
|
|
3
|
+
|
|
4
|
+
export const GoBackTask: WorkflowTask = {
|
|
5
|
+
type: TaskType.GO_BACK,
|
|
6
|
+
label: 'Go Back',
|
|
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 HoverElementTask: WorkflowTask = {
|
|
5
|
+
type: TaskType.HOVER_ELEMENT,
|
|
6
|
+
label: 'Hover Over 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,57 @@
|
|
|
1
|
+
import { WorkflowTask } from '../types/workflowTasks';
|
|
2
|
+
import { TaskParamType, TaskType } from '../types/task';
|
|
3
|
+
|
|
4
|
+
export const HttpRequestTask: WorkflowTask = {
|
|
5
|
+
type: TaskType.HTTP_REQUEST,
|
|
6
|
+
label: 'HTTP Request',
|
|
7
|
+
isEntryPoint: false,
|
|
8
|
+
inputs: [
|
|
9
|
+
{
|
|
10
|
+
name: 'Web Page',
|
|
11
|
+
type: TaskParamType.BROWSER_INSTANCE,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'URL',
|
|
16
|
+
type: TaskParamType.STRING,
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'Method',
|
|
21
|
+
type: TaskParamType.SELECT,
|
|
22
|
+
required: true,
|
|
23
|
+
options: [
|
|
24
|
+
{ label: 'GET', value: 'GET' },
|
|
25
|
+
{ label: 'POST', value: 'POST' },
|
|
26
|
+
{ label: 'PUT', value: 'PUT' },
|
|
27
|
+
{ label: 'DELETE', value: 'DELETE' },
|
|
28
|
+
{ label: 'PATCH', value: 'PATCH' },
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'Headers (JSON)',
|
|
33
|
+
type: TaskParamType.JSON,
|
|
34
|
+
required: false,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'Body (JSON)',
|
|
38
|
+
type: TaskParamType.JSON,
|
|
39
|
+
required: false,
|
|
40
|
+
},
|
|
41
|
+
] as const,
|
|
42
|
+
outputs: [
|
|
43
|
+
{
|
|
44
|
+
name: 'Response Status',
|
|
45
|
+
type: TaskParamType.NUMBER,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'Response Body',
|
|
49
|
+
type: TaskParamType.JSON,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'Web Page',
|
|
53
|
+
type: TaskParamType.BROWSER_INSTANCE,
|
|
54
|
+
required: true,
|
|
55
|
+
},
|
|
56
|
+
] as const,
|
|
57
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { WorkflowTask } from '../types/workflowTasks';
|
|
2
|
+
import { TaskParamType, TaskType } from '../types/task';
|
|
3
|
+
|
|
4
|
+
export const LaunchBrowserTask: WorkflowTask = {
|
|
5
|
+
type: TaskType.LAUNCH_BROWSER,
|
|
6
|
+
label: 'Launch Browser',
|
|
7
|
+
isEntryPoint: true,
|
|
8
|
+
inputs: [
|
|
9
|
+
{
|
|
10
|
+
name: 'Website URL',
|
|
11
|
+
type: TaskParamType.STRING,
|
|
12
|
+
helperText: 'eg: https://www.google.com',
|
|
13
|
+
required: true,
|
|
14
|
+
hideHandle: true,
|
|
15
|
+
},
|
|
16
|
+
] as const,
|
|
17
|
+
outputs: [
|
|
18
|
+
{ name: 'Web Page', type: TaskParamType.BROWSER_INSTANCE },
|
|
19
|
+
] as const,
|
|
20
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { WorkflowTask } from '../types/workflowTasks';
|
|
2
|
+
import { TaskParamType, TaskType } from '../types/task';
|
|
3
|
+
|
|
4
|
+
export const LogMessageTask: WorkflowTask = {
|
|
5
|
+
type: TaskType.LOG_MESSAGE,
|
|
6
|
+
label: 'Log Message',
|
|
7
|
+
isEntryPoint: false,
|
|
8
|
+
inputs: [
|
|
9
|
+
{
|
|
10
|
+
name: 'Web Page',
|
|
11
|
+
type: TaskParamType.BROWSER_INSTANCE,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'Message',
|
|
16
|
+
type: TaskParamType.STRING,
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'Message Type',
|
|
21
|
+
type: TaskParamType.SELECT,
|
|
22
|
+
required: true,
|
|
23
|
+
options: [
|
|
24
|
+
{ label: 'Info', value: 'info' },
|
|
25
|
+
{ label: 'Error', value: 'error' },
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
] as const,
|
|
29
|
+
outputs: [
|
|
30
|
+
{
|
|
31
|
+
name: 'Web Page',
|
|
32
|
+
type: TaskParamType.BROWSER_INSTANCE,
|
|
33
|
+
required: true,
|
|
34
|
+
},
|
|
35
|
+
] as const,
|
|
36
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { WorkflowTask } from '../types/workflowTasks';
|
|
2
|
+
import { TaskParamType, TaskType } from '../types/task';
|
|
3
|
+
|
|
4
|
+
export const LoginViaBasicAuthTask: WorkflowTask = {
|
|
5
|
+
type: TaskType.LOGIN_VIA_BASIC_AUTH,
|
|
6
|
+
label: 'Login via Basic Auth',
|
|
7
|
+
isEntryPoint: false,
|
|
8
|
+
inputs: [
|
|
9
|
+
{
|
|
10
|
+
name: 'Web page',
|
|
11
|
+
type: TaskParamType.BROWSER_INSTANCE,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'Username',
|
|
16
|
+
type: TaskParamType.STRING,
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'Password',
|
|
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,26 @@
|
|
|
1
|
+
import { WorkflowTask } from '../types/workflowTasks';
|
|
2
|
+
import { TaskParamType, TaskType } from '../types/task';
|
|
3
|
+
|
|
4
|
+
export const NavigateUrlTask: WorkflowTask = {
|
|
5
|
+
type: TaskType.NAVIGATE_URL,
|
|
6
|
+
label: 'Navigate Url',
|
|
7
|
+
isEntryPoint: false,
|
|
8
|
+
inputs: [
|
|
9
|
+
{
|
|
10
|
+
name: 'Web page',
|
|
11
|
+
type: TaskParamType.BROWSER_INSTANCE,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'Url',
|
|
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,25 @@
|
|
|
1
|
+
import { WorkflowTask } from '../types/workflowTasks';
|
|
2
|
+
import { TaskParamType, TaskType } from '../types/task';
|
|
3
|
+
|
|
4
|
+
export const PageToHtmlTask: WorkflowTask = {
|
|
5
|
+
type: TaskType.PAGE_TO_HTML,
|
|
6
|
+
label: 'Get Web page HTML',
|
|
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: 'Html',
|
|
18
|
+
type: TaskParamType.STRING,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Web Page',
|
|
22
|
+
type: TaskParamType.BROWSER_INSTANCE,
|
|
23
|
+
},
|
|
24
|
+
] as const,
|
|
25
|
+
};
|