0.0.2 • Published 2 years ago

@io-orkes/conductor-typescript v0.0.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

Netflix Conductor SDK

conductor-typescript repository provides the client SDKs to build Task workers with Typescript

Quick Start

  1. Setup conductor-typescript
  2. Create and run Task Workers
  3. Create workflows using Code
  4. Api Docs

Setup conductor

Simple connection to conductor

const client = new ConductorClient({
  serverUrl: "https://play.orkes.io/api",
});

Using TLS

The client uses node-fetch which supports node.js's httpsAgent options. For example:

import {Agent} from "https"
import {ConductorClient} from "@io-orkes/conductor-typescript";

const agentOptions = {
  key: "<buffer>",
  cert: "<buffer>",
  ca: "<buffer>",
  servername: 'play.orkes.io',
  // ...
}

const client = new ConductorClient({
  serverUrl: 'https://play.orkes.io/api',
  AGENT: new Agent(agentOptions)
})

const taskManager = new TaskManager(client, [ /* workers */ ])
taskManager.startPolling()

Connect to conductor using Orkes

/**
 * Application keys generated from the Application menu > Create Application
 * then edit and create Access Keys
 *
 */
import { OrkesApiConfig, orkesConductorClient } from "@io-orkes/conductor-typescript";

const config: Partial<OrkesApiConfig> = {
  keyId: "aa17000e-a478-48cd-ae5c-d54c0fd850de",
  keySecret: "HUh57n1Q4DT5psfU0A42PDpwxID4ln5OgwNcSSWXXXzRqsJA",
  serverUrl: "https://play.orkes.io/api",
};

orkesConductorClient(config).then(client => ..... );