@or-sdk/flows
v2.9.2
Published
OneReach SDK client for Flows
Readme
@or-sdk/flows
OneReach SDK client for Flows.
When to use
- Use this package when integrating with the Flows capability on the OneReach platform.
- Use its typed client and exported models instead of hand-writing requests to that service.
When not to use
- Do not use it for a different platform capability; choose the dedicated
@or-sdk/*package instead. - Do not use it for generic third-party HTTP calls.
Installation
$ npm i @or-sdk/flowsUsage
import { Flows } from '@or-sdk/flows'
// with direct api url
const flows = new Flows({
token: 'my-account-token-string',
dataHubSvcUrl: 'http://example.data-hub-svc/endpoint',
deployerUrl: 'http://example.deployer/endpoint'
});
// with service discovery(slower)
const flows = new Flows({
token: 'my-account-token-string',
discoveryUrl: 'http://example.discovery/endpoint'
});Configuration
- Prefer
dataHubSvcUrlwhen the service URL is known; it avoids a discovery request. - Use
discoveryUrlonly when the service URL is not available. - Provide
tokenas a bearer-token string or getter where supported.
Common pitfalls
- Keep the client token current when it can expire; a token getter is preferable where the constructor accepts one.
- Treat the generated TypeScript types as the authoritative contract for optional parameters and response shapes.
Method map
| Method | Purpose |
|---|---|
| listFlows(...) | See the exported TypeScript signature for parameters and result. |
| getFlow(...) | See the exported TypeScript signature for parameters and result. |
| saveFlow(...) | See the exported TypeScript signature for parameters and result. |
| deleteFlow(...) | See the exported TypeScript signature for parameters and result. |
| recoverFlow(...) | See the exported TypeScript signature for parameters and result. |
| activateFlow(...) | See the exported TypeScript signature for parameters and result. |
| deactivateFlow(...) | See the exported TypeScript signature for parameters and result. |
| fetchFlowLogsChunk(...) | See the exported TypeScript signature for parameters and result. |
| fetchAllFlowLogs(...) | See the exported TypeScript signature for parameters and result. |
| listDataOuts(...) | See the exported TypeScript signature for parameters and result. |
| addTags(...) | See the exported TypeScript signature for parameters and result. |
More detail
Full signatures and exported types are available in src/ and dist/types/.
Additional API reference
Methods below were missing from the package guide. Signatures and return types are taken directly from the exported source API.
Flows
| Method | Returns | Purpose |
|---|---|---|
| removeTags(source: Flow, tagNames: string[]) | Promise<Flow> | Remove tags from flow |
| downloadTemplate(flowTemplateId: string, botId: string, shouldUpdateSteps = false) | Promise<DownloadTemplateResult> | Download flow template into Space (Bot) |
| listUnusedStepTemplates(source: Flow) | StepTemplateRaw[] | List unused step templates from flow source |
| deleteUnusedStepTemplates(source: Flow, stepTemplates?: StepTemplateToDelete[]) | Flow | Delete unused step templates from flow source |
| listFlowsByStepTemplate(params: ListFlowsByStepTemplateParams) | Promise<List<Flow>> | List account or library flows that have or don't have specific step templates. |
| listFlowsByStepTemplateGlobal(params: ListFlowsByStepTemplateGlobalParams) | Promise<List<Flow>> | Only for SUPER_ADMIN token. |
| listStepTemplateByFlowGlobal(params: ListStepTemplateParams) | Promise<List<StepTemplateRaw>> | Only for SUPER_ADMIN token. |
| listFlowCategories() | Promise<FlowCategoriesResponse> | List categories for library flows |
