@io-orkes/conductor-javascript 0.9.1 → 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.
- package/README.md +27 -51
- package/dist/index.d.ts +423 -49
- package/dist/index.js +317 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +306 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -7
package/README.md
CHANGED
|
@@ -1,66 +1,40 @@
|
|
|
1
|
-
# Conductor Javascript SDK
|
|
1
|
+
# Netflix Conductor Javascript/Typescript SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The `conductor-javascript` repository provides the client SDKs to build task workers in javascript/typescript.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Building the task workers in javascript mainly consists of the following steps:
|
|
6
6
|
|
|
7
|
-
1.
|
|
8
|
-
2. [Create and run
|
|
9
|
-
3. [Create workflows using
|
|
7
|
+
1. Setup conductor-javascript package
|
|
8
|
+
2. [Create and run task workers](workers_sdk.md)
|
|
9
|
+
3. [Create workflows using code](workflow_sdk.md)
|
|
10
10
|
4. [Api Docs](docs/api/README.md)
|
|
11
|
+
|
|
12
|
+
### Setup Conductor Javascript Package
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Simple connection to conductor
|
|
15
|
-
|
|
16
|
-
```typescript
|
|
17
|
-
const client = new ConductorClient({
|
|
18
|
-
serverUrl: "https://play.orkes.io/api",
|
|
19
|
-
});
|
|
14
|
+
* Get the package from npm
|
|
20
15
|
|
|
16
|
+
```shell
|
|
17
|
+
npm i @io-orkes/conductor-javascript
|
|
21
18
|
```
|
|
19
|
+
or
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
import { OrkesApiConfig, orkesConductorClient, TaskRunner } from "@io-orkes/conductor-javascript";
|
|
28
|
-
|
|
29
|
-
const clientPromise = orkesConductorClient({
|
|
30
|
-
serverUrl: 'https://play.orkes.io/api',
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
const client = await clientPromise;
|
|
21
|
+
```shell
|
|
22
|
+
yarn add @io-orkes/conductor-javascript
|
|
23
|
+
```
|
|
34
24
|
|
|
35
|
-
|
|
36
|
-
taskResource: client.taskResource,
|
|
37
|
-
worker: {
|
|
38
|
-
taskDefName: "MyCustomWorker",
|
|
39
|
-
execute: async ({ inputData, taskId }) => {
|
|
40
|
-
return {
|
|
41
|
-
outputData: {
|
|
42
|
-
greeting: "Hello World",
|
|
43
|
-
},
|
|
44
|
-
status: "COMPLETED",
|
|
45
|
-
};
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
options: {
|
|
49
|
-
pollInterval: 10,
|
|
50
|
-
domain: undefined,
|
|
51
|
-
concurrency: 1,
|
|
52
|
-
workerID: "",
|
|
53
|
-
},
|
|
54
|
-
});
|
|
25
|
+
## Configurations
|
|
55
26
|
|
|
56
|
-
|
|
27
|
+
### Authentication Settings (Optional)
|
|
28
|
+
Configure the authentication settings if your Conductor server requires authentication.
|
|
29
|
+
* keyId: Key for authentication.
|
|
30
|
+
* keySecret: Secret for the key.
|
|
57
31
|
|
|
58
|
-
|
|
32
|
+
### Access Control Setup
|
|
33
|
+
See [Access Control](https://orkes.io/content/docs/getting-started/concepts/access-control) for more details on role-based access control with Conductor and generating API keys for your environment.
|
|
59
34
|
|
|
60
|
-
|
|
35
|
+
### Configure API Client
|
|
61
36
|
|
|
62
37
|
```typescript
|
|
63
|
-
|
|
64
38
|
/**
|
|
65
39
|
* Application keys generated from the Application menu > Create Application
|
|
66
40
|
* then edit and create Access Keys
|
|
@@ -69,11 +43,13 @@ taskManager.startPolling();
|
|
|
69
43
|
import { OrkesApiConfig, orkesConductorClient } from "@io-orkes/conductor-javascript";
|
|
70
44
|
|
|
71
45
|
const config: Partial<OrkesApiConfig> = {
|
|
72
|
-
keyId: "XXX",
|
|
73
|
-
keySecret: "XXXX",
|
|
46
|
+
keyId: "XXX", // optional
|
|
47
|
+
keySecret: "XXXX", // optional
|
|
74
48
|
serverUrl: "https://play.orkes.io/api",
|
|
75
49
|
};
|
|
76
50
|
|
|
77
51
|
orkesConductorClient(config).then(client => ..... );
|
|
78
52
|
|
|
79
53
|
```
|
|
54
|
+
|
|
55
|
+
### Next: [Create and run task workers](workers_sdk.md)
|