@unboundcx/sdk 4.13.105 → 4.13.107

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unboundcx/sdk",
3
- "version": "4.13.105",
3
+ "version": "4.13.107",
4
4
  "description": "Official JavaScript SDK for the Unbound API - A comprehensive toolkit for integrating with Unbound's communication, AI, and data management services",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -0,0 +1,74 @@
1
+ import { internalRequest } from '../base.js';
2
+
3
+ // P5 "REST twin + SDK" / "Auth" rows: workflows.tools.{list,call} +
4
+ // workflows.mcpTokens.{create,list,revoke}. Kept in its own file (repo
5
+ // file-size convention) rather than growing workflows.js further.
6
+
7
+ export class WorkflowToolsService {
8
+ constructor(sdk) {
9
+ this.sdk = sdk;
10
+ }
11
+
12
+ // GET /workflows/tools -> [{name, description, inputSchema, outputSchema, annotations}]
13
+ async list() {
14
+ const result = await internalRequest(this.sdk, '/workflows/tools', 'GET');
15
+ return result;
16
+ }
17
+
18
+ // POST /workflows/tools/:slug/call -> {completed, outputs, isError, message, sessionId}
19
+ async call(slug, input) {
20
+ this.sdk.validateParams(
21
+ { slug },
22
+ { slug: { type: 'string', required: true } },
23
+ );
24
+
25
+ const params = { body: { input: input || {} } };
26
+ const result = await internalRequest(
27
+ this.sdk,
28
+ `/workflows/tools/${slug}/call`,
29
+ 'POST',
30
+ params,
31
+ );
32
+ return result;
33
+ }
34
+ }
35
+
36
+ export class WorkflowMcpTokensService {
37
+ constructor(sdk) {
38
+ this.sdk = sdk;
39
+ }
40
+
41
+ // POST /workflows/mcp/tokens -> {id, token, name} -- `token` (the raw
42
+ // JWT) is shown exactly once, never retrievable again.
43
+ async create({ name } = {}) {
44
+ const params = { body: name ? { name } : {} };
45
+ const result = await internalRequest(
46
+ this.sdk,
47
+ '/workflows/mcp/tokens',
48
+ 'POST',
49
+ params,
50
+ );
51
+ return result;
52
+ }
53
+
54
+ // GET /workflows/mcp/tokens -> {tokens: [{id, name, createdAt, lastUsedAt, revokedAt}]}
55
+ async list() {
56
+ const result = await internalRequest(this.sdk, '/workflows/mcp/tokens', 'GET');
57
+ return result;
58
+ }
59
+
60
+ // DELETE /workflows/mcp/tokens/:id -> {id, revoked:true}
61
+ async revoke(id) {
62
+ this.sdk.validateParams(
63
+ { id },
64
+ { id: { type: 'string', required: true } },
65
+ );
66
+
67
+ const result = await internalRequest(
68
+ this.sdk,
69
+ `/workflows/mcp/tokens/${id}`,
70
+ 'DELETE',
71
+ );
72
+ return result;
73
+ }
74
+ }
@@ -1,10 +1,15 @@
1
1
  import { internalRequest } from '../base.js';
2
+ import { WorkflowToolsService, WorkflowMcpTokensService } from './workflowTools.js';
3
+
2
4
  export class WorkflowsService {
3
5
  constructor(sdk) {
4
6
  this.sdk = sdk;
5
7
  this.items = new WorkflowItemsService(sdk);
6
8
  this.connections = new WorkflowConnectionsService(sdk);
7
9
  this.sessions = new WorkflowSessionsService(sdk);
10
+ // P5: MCP tools/tokens surface (workflows-v2-plan.md "REST twin + SDK" row).
11
+ this.tools = new WorkflowToolsService(sdk);
12
+ this.mcpTokens = new WorkflowMcpTokensService(sdk);
8
13
  }
9
14
 
10
15
  async listModules({ workflowType } = {}) {
@@ -91,6 +96,24 @@ export class WorkflowsService {
91
96
  );
92
97
  return result;
93
98
  }
99
+
100
+ // P6 §6 — variable catalogue (inputs/system/context/module outputs) for
101
+ // the designer's `{{` autocomplete + variables panel.
102
+ async variables(versionId) {
103
+ this.sdk.validateParams(
104
+ { versionId },
105
+ {
106
+ versionId: { type: 'string', required: true },
107
+ },
108
+ );
109
+
110
+ const result = await internalRequest(
111
+ this.sdk,
112
+ `/workflows/${versionId}/variables`,
113
+ 'GET',
114
+ );
115
+ return result;
116
+ }
94
117
  }
95
118
 
96
119
  export class WorkflowItemsService {
@@ -481,7 +504,7 @@ export class WorkflowSessionsService {
481
504
  query: { startDate, endDate },
482
505
  };
483
506
 
484
- const result = await internalRequest(this.sdk,
507
+ const result = await internalRequest(this.sdk,
485
508
  `/workflows/${workflowVersionId}/analytics`,
486
509
  'GET',
487
510
  params,