1.1.14 • Published 3 years ago

nwc-sdk v1.1.14

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

nwc-sdk

Welcome to the unofficial Nintex Workflow Cloud SDK repoistory. This SDK can be used to programmatically interact with the Nintex Workflow Cloud platfrorm.

Disclaimer: This is an unofficial, community driven effort, not officially supported ny Nintex.

The sdk is created using typescript, with all available type and interface definitions included.

How to use the SDK

  1. For each NWC tenant you want to access via the SDK, you need to create an App
    1. Go to Settings > Apps and tokens
    2. Click the Add App button
    3. Name your app with something that relates to the nwc sdk usage - i.e. nwcdsk. You can choose whatever name you want. If required, provide a description as well.
  2. Add the sdk to your node.js project using npm: npm -i nwc-sdk
  3. For each tenant, create a json file in your project with the following contents - i.e. myTenantName.json:
{
	"clientId": "{The client id of the app you created}",
	"clientSecret": "{The client secret of the app you created}",
	"region" : "{Your tenant's region | us, eu, au}",
	"tenantName": "{The name of your tenant}"
}
  1. In your project, import the json file into a variable:
import * as tenantConnectionConfig from './myTenantName.json';
  1. Connect to your tenant:
import { NWCTenant } from 'nwc-sdk';

async function connect() {
	const tenant = new NWCTenant();
	await tenant.connect(tenantConnectionConfig);
	return tenant;
}
  1. You can also create the connection configuration programmatically:
import { INWCConnectionInfo } from 'nwc-sdk';
const tenantConnectionConfig = {
	"clientId": "{The client id of the app you created}",
	"clientSecret": "{The client secret of the app you created}",
	"region" : "{Your tenant's region | us, eu, au}",
	"tenantName": "{The name of your tenant}"
} : INWCConnectionInfo

Supported SDK functions

The following functions are available on the NWCTenant class - the class representing a Nintex Workflow Cloud tenancy

connect

public async connect(connectionInfo :INWCTenantConnectionInfo, retrieveTenantData: boolean = true ) : Promise<void>

Connects to the tenant and retrieves the following details - based on the value of the retrieveTenantData parameter

  • tenant information
  • available connectors
  • configured connections
  • configured datasources
  • workflows

retrieveTenantData

public async retrieveTenantData()

Retrieves the following tenant details of a connected tenant:

  • available connectors
  • configured connections
  • configured datasources
  • workflows

getWorkflow

public async getWorkflow(workflowId: string) : Promise<INWCWorkflowInfo> {

Retrieves the data of a workflow, based on the workflow id.

getWorkflowSource

public async getWorkflowSource(workflowId: string) : Promise<INWCWorkflowSource>

Retrieves the source definition of a workflow, based on the workflow id.

deleteWorkflowSource

public async deleteWorkflowSource(workflowId: string) : Promise<void>

Deletes the workflow with the corresponding workflowId

checkIfWorkflowExists

public async checkIfWorkflowExists(workflowName:string) : Promise<boolean>

Checks if a workflow with the provided name exists on a tenant

exportWorkflow

public async exportWorkflow(workflowId: string) : Promise<string>

Generates a non-expiring export key for the provided workflowId

importWorkflow

public async importWorkflow(workflowExportKey: string, workflowName: string)

Imports a workflow with a pre-generated export key using the provided workflow name

publishWorkflow

public async publishWorkflow(workflowId: string, payload:INWCWorkflowPublishPayload)

Publishes a draft workflow with the providedId

getConnectionsOfConnector

public getConnectionsOfConnector(connectorName: string, includeInvalid: boolean = false): INWCConnectionInfo[]

Retrieves all configured connections of a connector. The includeInvalid parameter can be used to include invalid connections - i.e. connections with expired credentials.

1.1.14

3 years ago

1.1.12

3 years ago

1.1.13

3 years ago

1.1.11

3 years ago

1.1.9

3 years ago

1.1.10

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago