@vuevox/sdk 0.4.0 → 0.6.0

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
@@ -8,6 +8,12 @@ TypeScript SDK for the VueVox Developer API.
8
8
  npm install @vuevox/sdk
9
9
  ```
10
10
 
11
+ Requirements:
12
+
13
+ - Node.js 18 or newer.
14
+ - A VueVox Developer API client ID and secret.
15
+ - Server-side usage only. Do not expose `clientSecret` in browser code.
16
+
11
17
  ## Create API Credentials
12
18
 
13
19
  In VueVox, open:
@@ -23,11 +29,14 @@ Available scopes:
23
29
  ```text
24
30
  hello:read
25
31
  spaces:read
32
+ agents:read
26
33
  calls:read
27
34
  leads:read
28
35
  ```
29
36
 
30
- ## Basic Usage
37
+ The token request can only request scopes that were granted to that API client.
38
+
39
+ ## Quickstart
31
40
 
32
41
  ```ts
33
42
  import { createVueVoxClient } from "@vuevox/sdk";
@@ -35,85 +44,84 @@ import { createVueVoxClient } from "@vuevox/sdk";
35
44
  const vuevox = createVueVoxClient({
36
45
  clientId: process.env.VUEVOX_CLIENT_ID!,
37
46
  clientSecret: process.env.VUEVOX_CLIENT_SECRET!,
38
- scope: ["hello:read", "spaces:read", "calls:read", "leads:read"],
47
+ scope: ["hello:read", "spaces:read", "agents:read", "calls:read", "leads:read"],
39
48
  });
40
49
 
41
50
  const hello = await vuevox.hello.get();
42
51
  console.log(hello.data.message, hello.requestId);
43
52
 
44
- const spaces = await vuevox.spaces.list({ limit: 50 });
45
- console.log(spaces.data.data, spaces.requestId);
46
-
47
53
  const calls = await vuevox.calls.list({ limit: 50 });
48
54
  console.log(calls.data.data, calls.requestId);
49
-
50
- const leads = await vuevox.leads.list({ limit: 50 });
51
- console.log(leads.data.data, leads.requestId);
52
55
  ```
53
56
 
54
57
  The SDK requests and caches a short-lived access token using client credentials, then sends it as a bearer token for API calls.
55
58
 
56
- ## Request IDs
59
+ ## Client Reference
57
60
 
58
- Every Developer API response includes an `X-Request-Id` header. SDK endpoint methods return response metadata with the response body so you can log that ID for support requests.
61
+ ### `createVueVoxClient(options)`
59
62
 
60
- ```ts
61
- const call = await vuevox.calls.get("call-id");
62
-
63
- console.log(call.requestId);
64
- console.log(call.data.data.transcript);
65
- ```
66
-
67
- For centralized logging, pass `onResponse`. The hook runs for every SDK-managed HTTP response, including the token request.
63
+ Creates a VueVox API client.
68
64
 
69
65
  ```ts
70
66
  const vuevox = createVueVoxClient({
67
+ baseUrl: "https://api.vuevox.com",
71
68
  clientId: process.env.VUEVOX_CLIENT_ID!,
72
69
  clientSecret: process.env.VUEVOX_CLIENT_SECRET!,
73
70
  scope: ["calls:read"],
71
+ retries: 2,
72
+ retryBaseDelayMs: 250,
73
+ retryMaxDelayMs: 2000,
74
74
  onResponse: ({ method, path, status, requestId }) => {
75
75
  console.log({ method, path, status, requestId });
76
76
  },
77
77
  });
78
78
  ```
79
79
 
80
- ## Error Handling
80
+ Options:
81
81
 
82
- API errors throw `VueVoxApiError`. The SDK exposes `error.requestId`, `error.details`, `error.retryAfter`, and `error.isRateLimited`.
82
+ | Option | Type | Required | Description |
83
+ | --- | --- | --- | --- |
84
+ | `clientId` | `string` | Yes | Developer API client ID. |
85
+ | `clientSecret` | `string` | Yes | Developer API client secret. Keep this server-side. |
86
+ | `baseUrl` | `string` | No | API base URL. Defaults to `https://api.vuevox.com`. |
87
+ | `scope` | `string \| string[]` | No | Space-separated string or array of requested token scopes. If omitted, the token request uses all scopes granted to the client. |
88
+ | `fetch` | `typeof fetch` | No | Custom fetch implementation. Defaults to global `fetch`. |
89
+ | `onResponse` | `(event: VueVoxResponseEvent) => void` | No | Called for every SDK-managed HTTP response, including token requests. |
90
+ | `retries` | `number` | No | Retry count for token requests and GET endpoints. Defaults to `0`. |
91
+ | `retryBaseDelayMs` | `number` | No | Initial retry delay. Defaults to `250`. |
92
+ | `retryMaxDelayMs` | `number` | No | Maximum retry delay. Defaults to `2000`. |
93
+
94
+ Returns a namespaced client:
83
95
 
84
96
  ```ts
85
- import { VueVoxApiError, createVueVoxClient } from "@vuevox/sdk";
97
+ vuevox.getAccessToken();
98
+ vuevox.hello.get();
99
+ vuevox.spaces.list();
100
+ vuevox.spaces.paginate();
101
+ vuevox.agents.list();
102
+ vuevox.agents.paginate();
103
+ vuevox.calls.list();
104
+ vuevox.calls.get("call-id");
105
+ vuevox.calls.paginate();
106
+ vuevox.leads.list();
107
+ vuevox.leads.get("lead-id");
108
+ vuevox.leads.paginate();
109
+ vuevox.raw.GET("/v1/hello", { headers: { Authorization: `Bearer ${await vuevox.getAccessToken()}` } });
110
+ ```
86
111
 
87
- const vuevox = createVueVoxClient({
88
- clientId: process.env.VUEVOX_CLIENT_ID!,
89
- clientSecret: process.env.VUEVOX_CLIENT_SECRET!,
90
- scope: ["calls:read"],
91
- });
112
+ ## Response Envelope
92
113
 
93
- try {
94
- await vuevox.calls.list({ limit: 50 });
95
- } catch (error) {
96
- if (error instanceof VueVoxApiError) {
97
- console.error(error.status, error.code, error.message, error.requestId);
98
- }
114
+ All SDK endpoint methods return a response envelope:
99
115
 
100
- throw error;
101
- }
116
+ ```ts
117
+ type VueVoxApiResponse<T> = {
118
+ data: T;
119
+ status: number;
120
+ requestId?: string;
121
+ };
102
122
  ```
103
123
 
104
- Common API error codes:
105
-
106
- ```text
107
- missing_token
108
- invalid_token
109
- invalid_client
110
- invalid_scope
111
- insufficient_scope
112
- rate_limited
113
- invalid_request
114
- call_not_found
115
- lead_not_found
116
- ```
124
+ Use `requestId` in logs and support requests. It maps to the API `X-Request-Id` response header.
117
125
 
118
126
  ## Pagination
119
127
 
@@ -130,6 +138,13 @@ if (firstPage.data.pagination.nextCursor) {
130
138
  }
131
139
  ```
132
140
 
141
+ List option fields shared by paginated endpoints:
142
+
143
+ | Option | Type | Description |
144
+ | --- | --- | --- |
145
+ | `limit` | `number` | Number of items to return. Defaults to `50`; maximum is `100`. |
146
+ | `cursor` | `string` | Cursor from the previous response's `pagination.nextCursor`. |
147
+
133
148
  The SDK also includes async iterable helpers:
134
149
 
135
150
  ```ts
@@ -138,7 +153,283 @@ for await (const call of vuevox.calls.paginate({ limit: 50 })) {
138
153
  }
139
154
  ```
140
155
 
141
- Pagination helpers are available for `spaces`, `calls`, and `leads`.
156
+ Pagination helpers are available for `spaces`, `agents`, `calls`, and `leads`.
157
+
158
+ ## Methods
159
+
160
+ ### `vuevox.getAccessToken()`
161
+
162
+ Requests or returns a cached bearer token.
163
+
164
+ ```ts
165
+ const token = await vuevox.getAccessToken();
166
+ ```
167
+
168
+ Returns: `Promise<string>`.
169
+
170
+ ### `vuevox.hello.get()`
171
+
172
+ Checks credentials and connectivity.
173
+
174
+ Required scope: `hello:read`.
175
+
176
+ ```ts
177
+ const response = await vuevox.hello.get();
178
+ console.log(response.data.message);
179
+ ```
180
+
181
+ Returns: `Promise<VueVoxApiResponse<HelloResponse>>`.
182
+
183
+ ### `vuevox.spaces.list(options?)`
184
+
185
+ Lists organization spaces.
186
+
187
+ Required scope: `spaces:read`.
188
+
189
+ Options: `ListSpacesOptions`
190
+
191
+ ```ts
192
+ const response = await vuevox.spaces.list({ limit: 50 });
193
+
194
+ for (const space of response.data.data) {
195
+ console.log(space.id, space.name);
196
+ }
197
+ ```
198
+
199
+ Returns: `Promise<VueVoxApiResponse<SpacesListResponse>>`.
200
+
201
+ ### `vuevox.spaces.paginate(options?)`
202
+
203
+ Iterates organization spaces across all pages.
204
+
205
+ Required scope: `spaces:read`.
206
+
207
+ Options: `ListSpacesOptions`
208
+
209
+ ```ts
210
+ for await (const space of vuevox.spaces.paginate({ limit: 100 })) {
211
+ console.log(space.id, space.name);
212
+ }
213
+ ```
214
+
215
+ Returns: `AsyncGenerator<Space>`.
216
+
217
+ ### `vuevox.agents.list(options?)`
218
+
219
+ Lists organization agents.
220
+
221
+ Agent records include nullable `externalId` when you store an ID from another system.
222
+
223
+ Required scope: `agents:read`.
224
+
225
+ Options: `ListAgentsOptions`
226
+
227
+ | Option | Type | Description |
228
+ | --- | --- | --- |
229
+ | `limit` | `number` | Number of agents to return. Defaults to `50`; maximum is `100`. |
230
+ | `cursor` | `string` | Cursor from the previous response. |
231
+ | `spaceId` | `string` | Optional space ID filter. |
232
+
233
+ ```ts
234
+ const response = await vuevox.agents.list({ limit: 50, spaceId: "space-id" });
235
+
236
+ for (const agent of response.data.data) {
237
+ console.log(agent.id, agent.externalId, agent.name);
238
+ }
239
+ ```
240
+
241
+ Returns: `Promise<VueVoxApiResponse<AgentsListResponse>>`.
242
+
243
+ ### `vuevox.agents.paginate(options?)`
244
+
245
+ Iterates organization agents across all pages.
246
+
247
+ Required scope: `agents:read`.
248
+
249
+ Options: `ListAgentsOptions`
250
+
251
+ ```ts
252
+ for await (const agent of vuevox.agents.paginate({ spaceId: "space-id" })) {
253
+ console.log(agent.id, agent.externalId, agent.name);
254
+ }
255
+ ```
256
+
257
+ Returns: `AsyncGenerator<Agent>`.
258
+
259
+ ### `vuevox.calls.list(options?)`
260
+
261
+ Lists organization calls. List responses do not include transcripts.
262
+
263
+ Required scope: `calls:read`.
264
+
265
+ Options: `ListCallsOptions`
266
+
267
+ | Option | Type | Description |
268
+ | --- | --- | --- |
269
+ | `limit` | `number` | Number of calls to return. Defaults to `50`; maximum is `100`. |
270
+ | `cursor` | `string` | Cursor from the previous response. |
271
+ | `spaceId` | `string` | Optional space ID filter. |
272
+ | `leadId` | `string` | Optional lead ID filter. |
273
+ | `agentId` | `string` | Optional agent ID filter. |
274
+ | `createdAfter` | `string` | Optional ISO 8601 lower bound for call creation time. |
275
+ | `createdBefore` | `string` | Optional ISO 8601 upper bound for call creation time. |
276
+
277
+ ```ts
278
+ const response = await vuevox.calls.list({
279
+ limit: 50,
280
+ spaceId: "space-id",
281
+ createdAfter: "2026-01-01T00:00:00.000Z",
282
+ });
283
+
284
+ for (const call of response.data.data) {
285
+ console.log(call.id, call.status, call.createdAt);
286
+ }
287
+ ```
288
+
289
+ Returns: `Promise<VueVoxApiResponse<CallsListResponse>>`.
290
+
291
+ ### `vuevox.calls.get(callId)`
292
+
293
+ Gets a call detail record, including transcript data when available.
294
+
295
+ Required scope: `calls:read`.
296
+
297
+ ```ts
298
+ const response = await vuevox.calls.get("call-id");
299
+ console.log(response.data.data.transcript);
300
+ ```
301
+
302
+ Returns: `Promise<VueVoxApiResponse<CallDetailResponse>>`.
303
+
304
+ ### `vuevox.calls.paginate(options?)`
305
+
306
+ Iterates organization calls across all pages.
307
+
308
+ Required scope: `calls:read`.
309
+
310
+ Options: `ListCallsOptions`
311
+
312
+ ```ts
313
+ for await (const call of vuevox.calls.paginate({ leadId: "lead-id" })) {
314
+ console.log(call.id);
315
+ }
316
+ ```
317
+
318
+ Returns: `AsyncGenerator<CallSummary>`.
319
+
320
+ ### `vuevox.leads.list(options?)`
321
+
322
+ Lists organization leads. The `leads:read` scope includes lead email and phone contact details.
323
+
324
+ Lead records include nullable `externalId` when you store an ID from another system.
325
+
326
+ Required scope: `leads:read`.
327
+
328
+ Options: `ListLeadsOptions`
329
+
330
+ | Option | Type | Description |
331
+ | --- | --- | --- |
332
+ | `limit` | `number` | Number of leads to return. Defaults to `50`; maximum is `100`. |
333
+ | `cursor` | `string` | Cursor from the previous response. |
334
+ | `spaceId` | `string` | Optional space ID filter. |
335
+ | `createdAfter` | `string` | Optional ISO 8601 lower bound for lead creation time. |
336
+ | `createdBefore` | `string` | Optional ISO 8601 upper bound for lead creation time. |
337
+
338
+ ```ts
339
+ const response = await vuevox.leads.list({ limit: 50, spaceId: "space-id" });
340
+
341
+ for (const lead of response.data.data) {
342
+ console.log(lead.id, lead.externalId, lead.email, lead.phone);
343
+ }
344
+ ```
345
+
346
+ Returns: `Promise<VueVoxApiResponse<LeadsListResponse>>`.
347
+
348
+ ### `vuevox.leads.get(leadId)`
349
+
350
+ Gets a lead detail record, including email and phone contact details.
351
+
352
+ Required scope: `leads:read`.
353
+
354
+ ```ts
355
+ const response = await vuevox.leads.get("lead-id");
356
+ console.log(response.data.externalId, response.data.email, response.data.phone);
357
+ ```
358
+
359
+ Returns: `Promise<VueVoxApiResponse<LeadDetailResponse>>`.
360
+
361
+ ### `vuevox.leads.paginate(options?)`
362
+
363
+ Iterates organization leads across all pages.
364
+
365
+ Required scope: `leads:read`.
366
+
367
+ Options: `ListLeadsOptions`
368
+
369
+ ```ts
370
+ for await (const lead of vuevox.leads.paginate({ createdAfter: "2026-01-01T00:00:00.000Z" })) {
371
+ console.log(lead.id, lead.externalId);
372
+ }
373
+ ```
374
+
375
+ Returns: `AsyncGenerator<Lead>`.
376
+
377
+ ## Lower-Level Calls
378
+
379
+ For advanced integrations, `raw` exposes a typed lower-level OpenAPI client. You must attach authorization yourself.
380
+
381
+ ```ts
382
+ const { data, error } = await vuevox.raw.GET("/v1/hello", {
383
+ headers: {
384
+ Authorization: `Bearer ${await vuevox.getAccessToken()}`,
385
+ },
386
+ });
387
+ ```
388
+
389
+ ## Errors
390
+
391
+ API errors throw `VueVoxApiError`.
392
+
393
+ ```ts
394
+ import { VueVoxApiError, createVueVoxClient } from "@vuevox/sdk";
395
+
396
+ try {
397
+ await vuevox.calls.list({ limit: 50 });
398
+ } catch (error) {
399
+ if (error instanceof VueVoxApiError) {
400
+ console.error(error.status, error.code, error.message, error.requestId);
401
+ }
402
+
403
+ throw error;
404
+ }
405
+ ```
406
+
407
+ Error fields:
408
+
409
+ | Field | Type | Description |
410
+ | --- | --- | --- |
411
+ | `status` | `number` | HTTP status code. |
412
+ | `code` | `string` | Stable API error code. |
413
+ | `message` | `string` | Human-readable message. |
414
+ | `requestId` | `string \| undefined` | Request ID from `X-Request-Id` or error body. |
415
+ | `details` | `Record<string, unknown> \| undefined` | Structured error details when present. |
416
+ | `retryAfter` | `number \| undefined` | Seconds to wait before retrying when present. |
417
+ | `isRateLimited` | `boolean` | `true` for rate limit errors. |
418
+ | `response` | `VueVoxErrorResponse \| undefined` | Full API error response when available. |
419
+
420
+ Common API error codes:
421
+
422
+ ```text
423
+ missing_token
424
+ invalid_token
425
+ invalid_client
426
+ invalid_scope
427
+ insufficient_scope
428
+ rate_limited
429
+ invalid_request
430
+ call_not_found
431
+ lead_not_found
432
+ ```
142
433
 
143
434
  ## Retries
144
435
 
@@ -183,14 +474,33 @@ const vuevox = createVueVoxClient({
183
474
  });
184
475
  ```
185
476
 
186
- ## Lower-Level Calls
477
+ ## Exported Types
187
478
 
188
- For advanced integrations, `raw` exposes a typed lower-level API client.
479
+ The package exports these TypeScript types:
189
480
 
190
481
  ```ts
191
- const { data, error } = await vuevox.raw.GET("/v1/hello", {
192
- headers: {
193
- Authorization: `Bearer ${await vuevox.getAccessToken()}`,
194
- },
195
- });
482
+ import type {
483
+ Agent,
484
+ AgentsListResponse,
485
+ CallDetailResponse,
486
+ CallsListResponse,
487
+ CallSummary,
488
+ HelloResponse,
489
+ Lead,
490
+ LeadDetailResponse,
491
+ LeadsListResponse,
492
+ ListAgentsOptions,
493
+ ListCallsOptions,
494
+ ListLeadsOptions,
495
+ ListSpacesOptions,
496
+ Space,
497
+ SpacesListResponse,
498
+ VueVoxApiResponse,
499
+ VueVoxClientOptions,
500
+ VueVoxErrorResponse,
501
+ VueVoxResponseEvent,
502
+ VueVoxResponseMetadata,
503
+ } from "@vuevox/sdk";
196
504
  ```
505
+
506
+ Generated OpenAPI-derived types are included in the package declaration files, so editors can inspect the exact response fields for each method.
package/dist/client.d.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  import type { components, paths } from "./generated/schema.js";
2
2
  type HelloResponse = components["schemas"]["HelloResponse"];
3
3
  type SpacesListResponse = components["schemas"]["SpacesListResponse"];
4
+ type AgentsListResponse = components["schemas"]["AgentsListResponse"];
4
5
  type CallsListResponse = components["schemas"]["CallsListResponse"];
5
6
  type CallDetailResponse = components["schemas"]["CallDetailResponse"];
6
7
  type LeadsListResponse = components["schemas"]["LeadsListResponse"];
7
8
  type LeadDetailResponse = components["schemas"]["LeadDetailResponse"];
8
9
  type Space = components["schemas"]["Space"];
10
+ type Agent = components["schemas"]["Agent"];
9
11
  type CallSummary = components["schemas"]["CallSummary"];
10
12
  type Lead = components["schemas"]["Lead"];
11
13
  export interface ListSpacesOptions {
@@ -19,6 +21,9 @@ export interface ListCallsOptions extends ListSpacesOptions {
19
21
  createdAfter?: string;
20
22
  createdBefore?: string;
21
23
  }
24
+ export interface ListAgentsOptions extends ListSpacesOptions {
25
+ spaceId?: string;
26
+ }
22
27
  export interface ListLeadsOptions extends ListSpacesOptions {
23
28
  spaceId?: string;
24
29
  createdAfter?: string;
@@ -62,6 +67,17 @@ export declare function createVueVoxClient(options: VueVoxClientOptions): {
62
67
  updatedAt: string;
63
68
  }, any, any>;
64
69
  };
70
+ agents: {
71
+ list: (listOptions?: ListAgentsOptions) => Promise<VueVoxApiResponse<AgentsListResponse>>;
72
+ paginate: (listOptions?: ListAgentsOptions) => AsyncGenerator<{
73
+ id: string;
74
+ externalId: string | null;
75
+ name: string;
76
+ spaces: components["schemas"]["ResourceSummary"][];
77
+ createdAt: string;
78
+ updatedAt: string;
79
+ }, any, any>;
80
+ };
65
81
  calls: {
66
82
  list: (listOptions?: ListCallsOptions) => Promise<VueVoxApiResponse<CallsListResponse>>;
67
83
  get: (callId: string) => Promise<VueVoxApiResponse<CallDetailResponse>>;
@@ -69,7 +85,7 @@ export declare function createVueVoxClient(options: VueVoxClientOptions): {
69
85
  id: string;
70
86
  space: components["schemas"]["ResourceSummary"];
71
87
  lead: components["schemas"]["LeadSummary"];
72
- agent: components["schemas"]["ResourceSummary"];
88
+ agent: components["schemas"]["AgentSummary"];
73
89
  duration: number;
74
90
  score: number | null;
75
91
  sentiment: string | null;
@@ -84,6 +100,7 @@ export declare function createVueVoxClient(options: VueVoxClientOptions): {
84
100
  get: (leadId: string) => Promise<VueVoxApiResponse<LeadDetailResponse>>;
85
101
  paginate: (listOptions?: ListLeadsOptions) => AsyncGenerator<{
86
102
  id: string;
103
+ externalId: string | null;
87
104
  firstName: string;
88
105
  lastName: string;
89
106
  email: string | null;
@@ -95,4 +112,4 @@ export declare function createVueVoxClient(options: VueVoxClientOptions): {
95
112
  };
96
113
  raw: import("openapi-fetch").Client<paths, `${string}/${string}`>;
97
114
  };
98
- export type { CallDetailResponse, CallsListResponse, CallSummary, HelloResponse, Lead, LeadDetailResponse, LeadsListResponse, Space, SpacesListResponse };
115
+ export type { Agent, AgentsListResponse, CallDetailResponse, CallsListResponse, CallSummary, HelloResponse, Lead, LeadDetailResponse, LeadsListResponse, Space, SpacesListResponse };
package/dist/client.js CHANGED
@@ -37,6 +37,9 @@ export function createVueVoxClient(options) {
37
37
  async function listSpaces(listOptions = {}) {
38
38
  return apiGet("/v1/spaces", listOptions);
39
39
  }
40
+ async function listAgents(listOptions = {}) {
41
+ return apiGet("/v1/agents", listOptions);
42
+ }
40
43
  async function listCalls(listOptions = {}) {
41
44
  return apiGet("/v1/calls", listOptions);
42
45
  }
@@ -96,6 +99,10 @@ export function createVueVoxClient(options) {
96
99
  list: listSpaces,
97
100
  paginate: (listOptions = {}) => paginate(listSpaces, listOptions),
98
101
  },
102
+ agents: {
103
+ list: listAgents,
104
+ paginate: (listOptions = {}) => paginate(listAgents, listOptions),
105
+ },
99
106
  calls: {
100
107
  list: listCalls,
101
108
  get: getCall,
@@ -64,6 +64,26 @@ export interface paths {
64
64
  patch?: never;
65
65
  trace?: never;
66
66
  };
67
+ "/v1/agents": {
68
+ parameters: {
69
+ query?: never;
70
+ header?: never;
71
+ path?: never;
72
+ cookie?: never;
73
+ };
74
+ /**
75
+ * List organization agents
76
+ * @description Returns agents for the API client's organization using cursor pagination. Optionally filter agents by space ID.
77
+ */
78
+ get: operations["listAgents"];
79
+ put?: never;
80
+ post?: never;
81
+ delete?: never;
82
+ options?: never;
83
+ head?: never;
84
+ patch?: never;
85
+ trace?: never;
86
+ };
67
87
  "/v1/calls": {
68
88
  parameters: {
69
89
  query?: never;
@@ -155,7 +175,7 @@ export interface components {
155
175
  client_secret: string;
156
176
  /**
157
177
  * @description Space-separated scopes requested for the access token.
158
- * @example hello:read spaces:read calls:read leads:read
178
+ * @example hello:read spaces:read agents:read calls:read leads:read
159
179
  */
160
180
  scope?: string;
161
181
  };
@@ -165,7 +185,7 @@ export interface components {
165
185
  token_type: "Bearer";
166
186
  /** @example 3600 */
167
187
  expires_in: number;
168
- /** @example hello:read spaces:read calls:read leads:read */
188
+ /** @example hello:read spaces:read agents:read calls:read leads:read */
169
189
  scope: string;
170
190
  };
171
191
  HelloResponse: {
@@ -188,6 +208,23 @@ export interface components {
188
208
  data: components["schemas"]["Space"][];
189
209
  pagination: components["schemas"]["CursorPagination"];
190
210
  };
211
+ Agent: {
212
+ /** Format: uuid */
213
+ id: string;
214
+ /** @description Optional ID from an external system. */
215
+ externalId: string | null;
216
+ /** @example Morgan Agent */
217
+ name: string;
218
+ spaces: components["schemas"]["ResourceSummary"][];
219
+ /** Format: date-time */
220
+ createdAt: string;
221
+ /** Format: date-time */
222
+ updatedAt: string;
223
+ };
224
+ AgentsListResponse: {
225
+ data: components["schemas"]["Agent"][];
226
+ pagination: components["schemas"]["CursorPagination"];
227
+ };
191
228
  ResourceSummary: {
192
229
  /** Format: uuid */
193
230
  id: string;
@@ -196,15 +233,24 @@ export interface components {
196
233
  LeadSummary: {
197
234
  /** Format: uuid */
198
235
  id: string;
236
+ /** @description Optional ID from an external system. */
237
+ externalId: string | null;
199
238
  firstName: string;
200
239
  lastName: string;
201
240
  } | null;
241
+ AgentSummary: {
242
+ /** Format: uuid */
243
+ id: string;
244
+ /** @description Optional ID from an external system. */
245
+ externalId: string | null;
246
+ name: string;
247
+ } | null;
202
248
  CallSummary: {
203
249
  /** Format: uuid */
204
250
  id: string;
205
251
  space: components["schemas"]["ResourceSummary"];
206
252
  lead: components["schemas"]["LeadSummary"];
207
- agent: components["schemas"]["ResourceSummary"];
253
+ agent: components["schemas"]["AgentSummary"];
208
254
  /** @description Call duration in seconds. */
209
255
  duration: number;
210
256
  score: number | null;
@@ -245,6 +291,8 @@ export interface components {
245
291
  Lead: {
246
292
  /** Format: uuid */
247
293
  id: string;
294
+ /** @description Optional ID from an external system. */
295
+ externalId: string | null;
248
296
  firstName: string;
249
297
  lastName: string;
250
298
  /** Format: email */
@@ -461,6 +509,73 @@ export interface operations {
461
509
  };
462
510
  };
463
511
  };
512
+ listAgents: {
513
+ parameters: {
514
+ query?: {
515
+ /** @description Number of agents to return. Defaults to 50. Maximum is 100. */
516
+ limit?: number;
517
+ /** @description Opaque cursor from the previous response's pagination.nextCursor value. */
518
+ cursor?: string;
519
+ /** @description Filter agents assigned to a space ID. */
520
+ spaceId?: string;
521
+ };
522
+ header?: never;
523
+ path?: never;
524
+ cookie?: never;
525
+ };
526
+ requestBody?: never;
527
+ responses: {
528
+ /** @description Paginated agents response. */
529
+ 200: {
530
+ headers: {
531
+ [name: string]: unknown;
532
+ };
533
+ content: {
534
+ "application/json": components["schemas"]["AgentsListResponse"];
535
+ };
536
+ };
537
+ /** @description Bearer token is missing, invalid, or expired. */
538
+ 401: {
539
+ headers: {
540
+ [name: string]: unknown;
541
+ };
542
+ content: {
543
+ "application/json": components["schemas"]["ErrorResponse"];
544
+ };
545
+ };
546
+ /** @description Bearer token does not include the required scope. */
547
+ 403: {
548
+ headers: {
549
+ [name: string]: unknown;
550
+ };
551
+ content: {
552
+ "application/json": components["schemas"]["ErrorResponse"];
553
+ };
554
+ };
555
+ /** @description Query parameters failed validation. */
556
+ 422: {
557
+ headers: {
558
+ [name: string]: unknown;
559
+ };
560
+ content: {
561
+ "application/json": components["schemas"]["ErrorResponse"];
562
+ };
563
+ };
564
+ /** @description Per-client rate limit exceeded. */
565
+ 429: {
566
+ headers: {
567
+ /** @description Seconds to wait before retrying. */
568
+ "Retry-After"?: string;
569
+ /** @description Request limit per minute for this API client. */
570
+ "X-RateLimit-Limit"?: string;
571
+ [name: string]: unknown;
572
+ };
573
+ content: {
574
+ "application/json": components["schemas"]["ErrorResponse"];
575
+ };
576
+ };
577
+ };
578
+ };
464
579
  listCalls: {
465
580
  parameters: {
466
581
  query?: {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { createVueVoxClient } from "./client.js";
2
- export type { CallDetailResponse, CallsListResponse, CallSummary, HelloResponse, Lead, LeadDetailResponse, LeadsListResponse, ListCallsOptions, ListLeadsOptions, ListSpacesOptions, Space, SpacesListResponse, VueVoxApiResponse, VueVoxClientOptions, VueVoxResponseEvent, VueVoxResponseMetadata, } from "./client.js";
2
+ export type { Agent, AgentsListResponse, CallDetailResponse, CallsListResponse, CallSummary, HelloResponse, Lead, LeadDetailResponse, LeadsListResponse, ListAgentsOptions, ListCallsOptions, ListLeadsOptions, ListSpacesOptions, Space, SpacesListResponse, VueVoxApiResponse, VueVoxClientOptions, VueVoxResponseEvent, VueVoxResponseMetadata, } from "./client.js";
3
3
  export { VueVoxApiError } from "./errors.js";
4
4
  export type { VueVoxErrorResponse } from "./errors.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuevox/sdk",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "TypeScript SDK for the VueVox Developer API.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",