@roarkanalytics/sdk 5.20.0 → 5.22.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/CHANGELOG.md +24 -0
- package/client.d.mts +6 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -0
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agent-draft.d.mts +1311 -0
- package/resources/agent-draft.d.mts.map +1 -0
- package/resources/agent-draft.d.ts +1311 -0
- package/resources/agent-draft.d.ts.map +1 -0
- package/resources/agent-draft.js +83 -0
- package/resources/agent-draft.js.map +1 -0
- package/resources/agent-draft.mjs +79 -0
- package/resources/agent-draft.mjs.map +1 -0
- package/resources/agent-version.d.mts +767 -0
- package/resources/agent-version.d.mts.map +1 -0
- package/resources/agent-version.d.ts +767 -0
- package/resources/agent-version.d.ts.map +1 -0
- package/resources/agent-version.js +59 -0
- package/resources/agent-version.js.map +1 -0
- package/resources/agent-version.mjs +55 -0
- package/resources/agent-version.mjs.map +1 -0
- package/resources/agent.d.mts +2 -3
- package/resources/agent.d.mts.map +1 -1
- package/resources/agent.d.ts +2 -3
- package/resources/agent.d.ts.map +1 -1
- package/resources/index.d.mts +2 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/phone-number.d.mts +66 -14
- package/resources/phone-number.d.mts.map +1 -1
- package/resources/phone-number.d.ts +66 -14
- package/resources/phone-number.d.ts.map +1 -1
- package/resources/phone-number.js +11 -8
- package/resources/phone-number.js.map +1 -1
- package/resources/phone-number.mjs +11 -8
- package/resources/phone-number.mjs.map +1 -1
- package/src/client.ts +46 -0
- package/src/resources/agent-draft.ts +1846 -0
- package/src/resources/agent-version.ts +1065 -0
- package/src/resources/agent.ts +2 -3
- package/src/resources/index.ts +20 -0
- package/src/resources/phone-number.ts +78 -14
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -3,17 +3,17 @@ import { APIPromise } from "../core/api-promise.js";
|
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.js";
|
|
4
4
|
export declare class PhoneNumber extends APIResource {
|
|
5
5
|
/**
|
|
6
|
-
* Buys a number from the carrier for this project
|
|
7
|
-
*
|
|
6
|
+
* Buys a number from the carrier for this project: the one named by e164, or one
|
|
7
|
+
* Roark picks to match autoPick (trying the next match if the carrier has just
|
|
8
|
+
* sold one). Free inside the plan allowance; past it, the first month of rent is
|
|
9
|
+
* charged now and monthly after that.
|
|
8
10
|
*
|
|
9
11
|
* @example
|
|
10
12
|
* ```ts
|
|
11
|
-
* const phoneNumber = await client.phoneNumber.create(
|
|
12
|
-
* e164: '+14155550123',
|
|
13
|
-
* });
|
|
13
|
+
* const phoneNumber = await client.phoneNumber.create();
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
|
-
create(body
|
|
16
|
+
create(body?: PhoneNumberCreateParams | null | undefined, options?: RequestOptions): APIPromise<PhoneNumberCreateResponse>;
|
|
17
17
|
/**
|
|
18
18
|
* Relabels a number or changes which agent it is assigned to. A field left out is
|
|
19
19
|
* untouched; null clears it.
|
|
@@ -59,8 +59,11 @@ export declare class PhoneNumber extends APIResource {
|
|
|
59
59
|
*/
|
|
60
60
|
getAllowance(options?: RequestOptions): APIPromise<PhoneNumberGetAllowanceResponse>;
|
|
61
61
|
/**
|
|
62
|
-
* Returns US numbers the carrier has for sale,
|
|
63
|
-
* the number must contain.
|
|
62
|
+
* Returns US or Canadian numbers the carrier has for sale, local or toll-free,
|
|
63
|
+
* narrowed by area code or by digits the number must contain. When an area code
|
|
64
|
+
* has no numbers, nearby ones are returned flagged bestEffort; an empty list means
|
|
65
|
+
* nothing matched. Buy one with POST /v1/phone-number, or let Roark pick with
|
|
66
|
+
* autoPick.
|
|
64
67
|
*
|
|
65
68
|
* @example
|
|
66
69
|
* ```ts
|
|
@@ -293,6 +296,11 @@ export declare namespace PhoneNumberListAvailableResponse {
|
|
|
293
296
|
* A number the carrier has for sale
|
|
294
297
|
*/
|
|
295
298
|
interface Data {
|
|
299
|
+
/**
|
|
300
|
+
* True when the area code asked for had no numbers and the carrier offered this
|
|
301
|
+
* nearby one instead
|
|
302
|
+
*/
|
|
303
|
+
bestEffort: boolean;
|
|
296
304
|
/**
|
|
297
305
|
* The number in E.164 format
|
|
298
306
|
*/
|
|
@@ -308,14 +316,23 @@ export declare namespace PhoneNumberListAvailableResponse {
|
|
|
308
316
|
}
|
|
309
317
|
}
|
|
310
318
|
export interface PhoneNumberCreateParams {
|
|
311
|
-
/**
|
|
312
|
-
* The number to buy, in E.164 format, from a search result
|
|
313
|
-
*/
|
|
314
|
-
e164: string;
|
|
315
319
|
/**
|
|
316
320
|
* The agent to assign the number to
|
|
317
321
|
*/
|
|
318
322
|
agentId?: string;
|
|
323
|
+
/**
|
|
324
|
+
* Let Roark pick a matching number instead of naming one. Give this or e164.
|
|
325
|
+
*/
|
|
326
|
+
autoPick?: PhoneNumberCreateParams.AutoPick;
|
|
327
|
+
/**
|
|
328
|
+
* The country of the number given by e164 (default: US). An auto-picked number
|
|
329
|
+
* uses autoPick.country.
|
|
330
|
+
*/
|
|
331
|
+
country?: 'US' | 'CA';
|
|
332
|
+
/**
|
|
333
|
+
* The number to buy, in E.164 format, from a search result. Give this or autoPick.
|
|
334
|
+
*/
|
|
335
|
+
e164?: string;
|
|
319
336
|
/**
|
|
320
337
|
* Whether you expect this number to be free (from the allowance). The purchase is
|
|
321
338
|
* refused with 409 if that has changed since you checked.
|
|
@@ -331,6 +348,31 @@ export interface PhoneNumberCreateParams {
|
|
|
331
348
|
*/
|
|
332
349
|
name?: string;
|
|
333
350
|
}
|
|
351
|
+
export declare namespace PhoneNumberCreateParams {
|
|
352
|
+
/**
|
|
353
|
+
* Let Roark pick a matching number instead of naming one. Give this or e164.
|
|
354
|
+
*/
|
|
355
|
+
interface AutoPick {
|
|
356
|
+
/**
|
|
357
|
+
* Three-digit area code, or a toll-free prefix such as 800. When it has no
|
|
358
|
+
* numbers, nearby ones are returned instead, flagged bestEffort.
|
|
359
|
+
*/
|
|
360
|
+
areaCode?: string;
|
|
361
|
+
/**
|
|
362
|
+
* Digits or letters the number must contain (1 to 7, \* matches any digit)
|
|
363
|
+
*/
|
|
364
|
+
contains?: string;
|
|
365
|
+
/**
|
|
366
|
+
* ISO 3166-1 alpha-2 country of the number: US or CA
|
|
367
|
+
*/
|
|
368
|
+
country?: 'US' | 'CA';
|
|
369
|
+
/**
|
|
370
|
+
* LOCAL for a number in an area code, TOLL_FREE for one from the shared US and
|
|
371
|
+
* Canada toll-free pool
|
|
372
|
+
*/
|
|
373
|
+
numberType?: 'LOCAL' | 'TOLL_FREE';
|
|
374
|
+
}
|
|
375
|
+
}
|
|
334
376
|
export interface PhoneNumberUpdateParams {
|
|
335
377
|
/**
|
|
336
378
|
* Agent to assign the number to; null unassigns, omit to leave it alone
|
|
@@ -349,7 +391,8 @@ export interface PhoneNumberListParams {
|
|
|
349
391
|
}
|
|
350
392
|
export interface PhoneNumberListAvailableParams {
|
|
351
393
|
/**
|
|
352
|
-
* Three-digit
|
|
394
|
+
* Three-digit area code, or a toll-free prefix such as 800. When it has no
|
|
395
|
+
* numbers, nearby ones are returned instead, flagged bestEffort.
|
|
353
396
|
*/
|
|
354
397
|
areaCode?: string;
|
|
355
398
|
/**
|
|
@@ -357,9 +400,18 @@ export interface PhoneNumberListAvailableParams {
|
|
|
357
400
|
*/
|
|
358
401
|
contains?: string;
|
|
359
402
|
/**
|
|
360
|
-
*
|
|
403
|
+
* ISO 3166-1 alpha-2 country of the number: US or CA
|
|
404
|
+
*/
|
|
405
|
+
country?: 'US' | 'CA';
|
|
406
|
+
/**
|
|
407
|
+
* Maximum number of results (default: 20, max: 100)
|
|
361
408
|
*/
|
|
362
409
|
limit?: number;
|
|
410
|
+
/**
|
|
411
|
+
* LOCAL for a number in an area code, TOLL_FREE for one from the shared US and
|
|
412
|
+
* Canada toll-free pool
|
|
413
|
+
*/
|
|
414
|
+
numberType?: 'LOCAL' | 'TOLL_FREE';
|
|
363
415
|
}
|
|
364
416
|
export declare namespace PhoneNumber {
|
|
365
417
|
export { type PhoneNumberCreateResponse as PhoneNumberCreateResponse, type PhoneNumberUpdateResponse as PhoneNumberUpdateResponse, type PhoneNumberListResponse as PhoneNumberListResponse, type PhoneNumberDeleteResponse as PhoneNumberDeleteResponse, type PhoneNumberGetAllowanceResponse as PhoneNumberGetAllowanceResponse, type PhoneNumberListAvailableResponse as PhoneNumberListAvailableResponse, type PhoneNumberCreateParams as PhoneNumberCreateParams, type PhoneNumberUpdateParams as PhoneNumberUpdateParams, type PhoneNumberListParams as PhoneNumberListParams, type PhoneNumberListAvailableParams as PhoneNumberListAvailableParams, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-number.d.ts","sourceRoot":"","sources":["../src/resources/phone-number.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;OAUG;IACH,MAAM,
|
|
1
|
+
{"version":3,"file":"phone-number.d.ts","sourceRoot":"","sources":["../src/resources/phone-number.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;OAUG;IACH,MAAM,CACJ,IAAI,GAAE,uBAAuB,GAAG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AC;IAEf;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;CACpC;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,8BAA8B,IAAI,8BAA8B,GACtE,CAAC;CACH"}
|
|
@@ -6,17 +6,17 @@ const resource_1 = require("../core/resource.js");
|
|
|
6
6
|
const path_1 = require("../internal/utils/path.js");
|
|
7
7
|
class PhoneNumber extends resource_1.APIResource {
|
|
8
8
|
/**
|
|
9
|
-
* Buys a number from the carrier for this project
|
|
10
|
-
*
|
|
9
|
+
* Buys a number from the carrier for this project: the one named by e164, or one
|
|
10
|
+
* Roark picks to match autoPick (trying the next match if the carrier has just
|
|
11
|
+
* sold one). Free inside the plan allowance; past it, the first month of rent is
|
|
12
|
+
* charged now and monthly after that.
|
|
11
13
|
*
|
|
12
14
|
* @example
|
|
13
15
|
* ```ts
|
|
14
|
-
* const phoneNumber = await client.phoneNumber.create(
|
|
15
|
-
* e164: '+14155550123',
|
|
16
|
-
* });
|
|
16
|
+
* const phoneNumber = await client.phoneNumber.create();
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
|
-
create(body, options) {
|
|
19
|
+
create(body = {}, options) {
|
|
20
20
|
return this._client.post('/v1/phone-number', { body, ...options });
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -72,8 +72,11 @@ class PhoneNumber extends resource_1.APIResource {
|
|
|
72
72
|
return this._client.get('/v1/phone-number/allowance', options);
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
|
-
* Returns US numbers the carrier has for sale,
|
|
76
|
-
* the number must contain.
|
|
75
|
+
* Returns US or Canadian numbers the carrier has for sale, local or toll-free,
|
|
76
|
+
* narrowed by area code or by digits the number must contain. When an area code
|
|
77
|
+
* has no numbers, nearby ones are returned flagged bestEffort; an empty list means
|
|
78
|
+
* nothing matched. Buy one with POST /v1/phone-number, or let Roark pick with
|
|
79
|
+
* autoPick.
|
|
77
80
|
*
|
|
78
81
|
* @example
|
|
79
82
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-number.js","sourceRoot":"","sources":["../src/resources/phone-number.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;OAUG;IACH,MAAM,
|
|
1
|
+
{"version":3,"file":"phone-number.js","sourceRoot":"","sources":["../src/resources/phone-number.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;OAUG;IACH,MAAM,CACJ,OAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CACJ,aAAqB,EACrB,OAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oBAAoB,aAAa,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CACF,QAAkD,EAAE,EACpD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,aAAqB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,oBAAoB,aAAa,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;OAQG;IACH,YAAY,CAAC,OAAwB;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;;;OAWG;IACH,aAAa,CACX,QAA2D,EAAE,EAC7D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF;AApGD,kCAoGC"}
|
|
@@ -3,17 +3,17 @@ import { APIResource } from "../core/resource.mjs";
|
|
|
3
3
|
import { path } from "../internal/utils/path.mjs";
|
|
4
4
|
export class PhoneNumber extends APIResource {
|
|
5
5
|
/**
|
|
6
|
-
* Buys a number from the carrier for this project
|
|
7
|
-
*
|
|
6
|
+
* Buys a number from the carrier for this project: the one named by e164, or one
|
|
7
|
+
* Roark picks to match autoPick (trying the next match if the carrier has just
|
|
8
|
+
* sold one). Free inside the plan allowance; past it, the first month of rent is
|
|
9
|
+
* charged now and monthly after that.
|
|
8
10
|
*
|
|
9
11
|
* @example
|
|
10
12
|
* ```ts
|
|
11
|
-
* const phoneNumber = await client.phoneNumber.create(
|
|
12
|
-
* e164: '+14155550123',
|
|
13
|
-
* });
|
|
13
|
+
* const phoneNumber = await client.phoneNumber.create();
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
|
-
create(body, options) {
|
|
16
|
+
create(body = {}, options) {
|
|
17
17
|
return this._client.post('/v1/phone-number', { body, ...options });
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
@@ -69,8 +69,11 @@ export class PhoneNumber extends APIResource {
|
|
|
69
69
|
return this._client.get('/v1/phone-number/allowance', options);
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
|
-
* Returns US numbers the carrier has for sale,
|
|
73
|
-
* the number must contain.
|
|
72
|
+
* Returns US or Canadian numbers the carrier has for sale, local or toll-free,
|
|
73
|
+
* narrowed by area code or by digits the number must contain. When an area code
|
|
74
|
+
* has no numbers, nearby ones are returned flagged bestEffort; an empty list means
|
|
75
|
+
* nothing matched. Buy one with POST /v1/phone-number, or let Roark pick with
|
|
76
|
+
* autoPick.
|
|
74
77
|
*
|
|
75
78
|
* @example
|
|
76
79
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-number.mjs","sourceRoot":"","sources":["../src/resources/phone-number.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;OAUG;IACH,MAAM,
|
|
1
|
+
{"version":3,"file":"phone-number.mjs","sourceRoot":"","sources":["../src/resources/phone-number.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;OAUG;IACH,MAAM,CACJ,OAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CACJ,aAAqB,EACrB,OAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,oBAAoB,aAAa,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CACF,QAAkD,EAAE,EACpD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,aAAqB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,oBAAoB,aAAa,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;OAQG;IACH,YAAY,CAAC,OAAwB;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;;;OAWG;IACH,aAAa,CACX,QAA2D,EAAE,EAC7D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF"}
|
package/src/client.ts
CHANGED
|
@@ -41,6 +41,17 @@ import {
|
|
|
41
41
|
AgentConfigUpdateResponse,
|
|
42
42
|
ManagedAgentConfigRevision,
|
|
43
43
|
} from './resources/agent-config';
|
|
44
|
+
import {
|
|
45
|
+
AgentDraft,
|
|
46
|
+
AgentDraftCreateParams,
|
|
47
|
+
AgentDraftCreateResponse,
|
|
48
|
+
AgentDraftDeleteResponse,
|
|
49
|
+
AgentDraftGetResponse,
|
|
50
|
+
AgentDraftPublishParams,
|
|
51
|
+
AgentDraftPublishResponse,
|
|
52
|
+
AgentDraftUpdateParams,
|
|
53
|
+
AgentDraftUpdateResponse,
|
|
54
|
+
} from './resources/agent-draft';
|
|
44
55
|
import {
|
|
45
56
|
AgentEndpoint,
|
|
46
57
|
AgentEndpointCreateParams,
|
|
@@ -59,6 +70,15 @@ import {
|
|
|
59
70
|
AgentPromptUpdateParams,
|
|
60
71
|
AgentPromptUpdateResponse,
|
|
61
72
|
} from './resources/agent-prompt';
|
|
73
|
+
import {
|
|
74
|
+
AgentVersion,
|
|
75
|
+
AgentVersionGetByIDParams,
|
|
76
|
+
AgentVersionGetByIDResponse,
|
|
77
|
+
AgentVersionListParams,
|
|
78
|
+
AgentVersionListResponse,
|
|
79
|
+
AgentVersionRestoreParams,
|
|
80
|
+
AgentVersionRestoreResponse,
|
|
81
|
+
} from './resources/agent-version';
|
|
62
82
|
import {
|
|
63
83
|
Analytics,
|
|
64
84
|
AnalyticsGetSchemaResponse,
|
|
@@ -1130,6 +1150,8 @@ export class Roark {
|
|
|
1130
1150
|
agentEndpoint: API.AgentEndpoint = new API.AgentEndpoint(this);
|
|
1131
1151
|
phoneNumber: API.PhoneNumber = new API.PhoneNumber(this);
|
|
1132
1152
|
agentPrompt: API.AgentPrompt = new API.AgentPrompt(this);
|
|
1153
|
+
agentVersion: API.AgentVersion = new API.AgentVersion(this);
|
|
1154
|
+
agentDraft: API.AgentDraft = new API.AgentDraft(this);
|
|
1133
1155
|
httpRequestDefinition: API.HTTPRequestDefinition = new API.HTTPRequestDefinition(this);
|
|
1134
1156
|
webhook: API.Webhook = new API.Webhook(this);
|
|
1135
1157
|
benchmark: API.Benchmark = new API.Benchmark(this);
|
|
@@ -1166,6 +1188,8 @@ Roark.Agent = Agent;
|
|
|
1166
1188
|
Roark.AgentEndpoint = AgentEndpoint;
|
|
1167
1189
|
Roark.PhoneNumber = PhoneNumber;
|
|
1168
1190
|
Roark.AgentPrompt = AgentPrompt;
|
|
1191
|
+
Roark.AgentVersion = AgentVersion;
|
|
1192
|
+
Roark.AgentDraft = AgentDraft;
|
|
1169
1193
|
Roark.HTTPRequestDefinition = HTTPRequestDefinition;
|
|
1170
1194
|
Roark.Webhook = Webhook;
|
|
1171
1195
|
Roark.Benchmark = Benchmark;
|
|
@@ -1502,6 +1526,28 @@ export declare namespace Roark {
|
|
|
1502
1526
|
type AgentPromptListVersionsParams as AgentPromptListVersionsParams,
|
|
1503
1527
|
};
|
|
1504
1528
|
|
|
1529
|
+
export {
|
|
1530
|
+
AgentVersion as AgentVersion,
|
|
1531
|
+
type AgentVersionListResponse as AgentVersionListResponse,
|
|
1532
|
+
type AgentVersionGetByIDResponse as AgentVersionGetByIDResponse,
|
|
1533
|
+
type AgentVersionRestoreResponse as AgentVersionRestoreResponse,
|
|
1534
|
+
type AgentVersionListParams as AgentVersionListParams,
|
|
1535
|
+
type AgentVersionGetByIDParams as AgentVersionGetByIDParams,
|
|
1536
|
+
type AgentVersionRestoreParams as AgentVersionRestoreParams,
|
|
1537
|
+
};
|
|
1538
|
+
|
|
1539
|
+
export {
|
|
1540
|
+
AgentDraft as AgentDraft,
|
|
1541
|
+
type AgentDraftCreateResponse as AgentDraftCreateResponse,
|
|
1542
|
+
type AgentDraftUpdateResponse as AgentDraftUpdateResponse,
|
|
1543
|
+
type AgentDraftDeleteResponse as AgentDraftDeleteResponse,
|
|
1544
|
+
type AgentDraftGetResponse as AgentDraftGetResponse,
|
|
1545
|
+
type AgentDraftPublishResponse as AgentDraftPublishResponse,
|
|
1546
|
+
type AgentDraftCreateParams as AgentDraftCreateParams,
|
|
1547
|
+
type AgentDraftUpdateParams as AgentDraftUpdateParams,
|
|
1548
|
+
type AgentDraftPublishParams as AgentDraftPublishParams,
|
|
1549
|
+
};
|
|
1550
|
+
|
|
1505
1551
|
export {
|
|
1506
1552
|
HTTPRequestDefinition as HTTPRequestDefinition,
|
|
1507
1553
|
type HTTPRequestDefinitionCreateResponse as HTTPRequestDefinitionCreateResponse,
|