@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 CHANGED
@@ -1,66 +1,40 @@
1
- # Conductor Javascript SDK
1
+ # Netflix Conductor Javascript/Typescript SDK
2
2
 
3
- This project provides client SDKs to interact with [Netflix](https://conductor.netflix.com/) and [Orkes](https://orkes.io/) conductor servers.
3
+ The `conductor-javascript` repository provides the client SDKs to build task workers in javascript/typescript.
4
4
 
5
- ## Quick Start
5
+ Building the task workers in javascript mainly consists of the following steps:
6
6
 
7
- 1. [Setup](#Setup-conductor)
8
- 2. [Create and run Task Workers](docs/worker/README.md)
9
- 3. [Create workflows using Code](docs/workflow/README.md)
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
- ### Setup conductor
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
- ### Running Custom Workers
24
-
25
- ```typescript
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
- const taskManager = new TaskRunner({
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
- taskManager.startPolling();
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
- #### Connect to conductor using Orkes
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)