@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.
Files changed (57) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/client.d.mts +6 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +6 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/agent-draft.d.mts +1311 -0
  12. package/resources/agent-draft.d.mts.map +1 -0
  13. package/resources/agent-draft.d.ts +1311 -0
  14. package/resources/agent-draft.d.ts.map +1 -0
  15. package/resources/agent-draft.js +83 -0
  16. package/resources/agent-draft.js.map +1 -0
  17. package/resources/agent-draft.mjs +79 -0
  18. package/resources/agent-draft.mjs.map +1 -0
  19. package/resources/agent-version.d.mts +767 -0
  20. package/resources/agent-version.d.mts.map +1 -0
  21. package/resources/agent-version.d.ts +767 -0
  22. package/resources/agent-version.d.ts.map +1 -0
  23. package/resources/agent-version.js +59 -0
  24. package/resources/agent-version.js.map +1 -0
  25. package/resources/agent-version.mjs +55 -0
  26. package/resources/agent-version.mjs.map +1 -0
  27. package/resources/agent.d.mts +2 -3
  28. package/resources/agent.d.mts.map +1 -1
  29. package/resources/agent.d.ts +2 -3
  30. package/resources/agent.d.ts.map +1 -1
  31. package/resources/index.d.mts +2 -0
  32. package/resources/index.d.mts.map +1 -1
  33. package/resources/index.d.ts +2 -0
  34. package/resources/index.d.ts.map +1 -1
  35. package/resources/index.js +5 -1
  36. package/resources/index.js.map +1 -1
  37. package/resources/index.mjs +2 -0
  38. package/resources/index.mjs.map +1 -1
  39. package/resources/phone-number.d.mts +66 -14
  40. package/resources/phone-number.d.mts.map +1 -1
  41. package/resources/phone-number.d.ts +66 -14
  42. package/resources/phone-number.d.ts.map +1 -1
  43. package/resources/phone-number.js +11 -8
  44. package/resources/phone-number.js.map +1 -1
  45. package/resources/phone-number.mjs +11 -8
  46. package/resources/phone-number.mjs.map +1 -1
  47. package/src/client.ts +46 -0
  48. package/src/resources/agent-draft.ts +1846 -0
  49. package/src/resources/agent-version.ts +1065 -0
  50. package/src/resources/agent.ts +2 -3
  51. package/src/resources/index.ts +20 -0
  52. package/src/resources/phone-number.ts +78 -14
  53. package/src/version.ts +1 -1
  54. package/version.d.mts +1 -1
  55. package/version.d.ts +1 -1
  56. package/version.js +1 -1
  57. package/version.mjs +1 -1
@@ -355,10 +355,9 @@ export namespace AgentBuildParams {
355
355
  */
356
356
  export interface Tts {
357
357
  /**
358
- * Text-to-speech provider, for example ELEVENLABS. Not checked against a known
359
- * list.
358
+ * Text-to-speech provider, for example ELEVENLABS
360
359
  */
361
- provider: string;
360
+ provider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME';
362
361
 
363
362
  /**
364
363
  * The provider's id for the voice
@@ -24,6 +24,17 @@ export {
24
24
  type AgentConfigUpdateParams,
25
25
  type AgentConfigResolveParams,
26
26
  } from './agent-config';
27
+ export {
28
+ AgentDraft,
29
+ type AgentDraftCreateResponse,
30
+ type AgentDraftUpdateResponse,
31
+ type AgentDraftDeleteResponse,
32
+ type AgentDraftGetResponse,
33
+ type AgentDraftPublishResponse,
34
+ type AgentDraftCreateParams,
35
+ type AgentDraftUpdateParams,
36
+ type AgentDraftPublishParams,
37
+ } from './agent-draft';
27
38
  export {
28
39
  AgentEndpoint,
29
40
  type AgentEndpointCreateResponse,
@@ -42,6 +53,15 @@ export {
42
53
  type AgentPromptUpdateParams,
43
54
  type AgentPromptListVersionsParams,
44
55
  } from './agent-prompt';
56
+ export {
57
+ AgentVersion,
58
+ type AgentVersionListResponse,
59
+ type AgentVersionGetByIDResponse,
60
+ type AgentVersionRestoreResponse,
61
+ type AgentVersionListParams,
62
+ type AgentVersionGetByIDParams,
63
+ type AgentVersionRestoreParams,
64
+ } from './agent-version';
45
65
  export {
46
66
  Analytics,
47
67
  type AnalyticsGetSchemaResponse,
@@ -7,17 +7,20 @@ import { path } from '../internal/utils/path';
7
7
 
8
8
  export class PhoneNumber extends APIResource {
9
9
  /**
10
- * Buys a number from the carrier for this project. Free inside the plan allowance;
11
- * past it, the first month of rent is charged now and monthly after that.
10
+ * Buys a number from the carrier for this project: the one named by e164, or one
11
+ * Roark picks to match autoPick (trying the next match if the carrier has just
12
+ * sold one). Free inside the plan allowance; past it, the first month of rent is
13
+ * charged now and monthly after that.
12
14
  *
13
15
  * @example
14
16
  * ```ts
15
- * const phoneNumber = await client.phoneNumber.create({
16
- * e164: '+14155550123',
17
- * });
17
+ * const phoneNumber = await client.phoneNumber.create();
18
18
  * ```
19
19
  */
20
- create(body: PhoneNumberCreateParams, options?: RequestOptions): APIPromise<PhoneNumberCreateResponse> {
20
+ create(
21
+ body: PhoneNumberCreateParams | null | undefined = {},
22
+ options?: RequestOptions,
23
+ ): APIPromise<PhoneNumberCreateResponse> {
21
24
  return this._client.post('/v1/phone-number', { body, ...options });
22
25
  }
23
26
 
@@ -85,8 +88,11 @@ export class PhoneNumber extends APIResource {
85
88
  }
86
89
 
87
90
  /**
88
- * Returns US numbers the carrier has for sale, narrowed by area code or by digits
89
- * the number must contain. Buy one with POST /v1/phone-number.
91
+ * Returns US or Canadian numbers the carrier has for sale, local or toll-free,
92
+ * narrowed by area code or by digits the number must contain. When an area code
93
+ * has no numbers, nearby ones are returned flagged bestEffort; an empty list means
94
+ * nothing matched. Buy one with POST /v1/phone-number, or let Roark pick with
95
+ * autoPick.
90
96
  *
91
97
  * @example
92
98
  * ```ts
@@ -374,6 +380,12 @@ export namespace PhoneNumberListAvailableResponse {
374
380
  * A number the carrier has for sale
375
381
  */
376
382
  export interface Data {
383
+ /**
384
+ * True when the area code asked for had no numbers and the carrier offered this
385
+ * nearby one instead
386
+ */
387
+ bestEffort: boolean;
388
+
377
389
  /**
378
390
  * The number in E.164 format
379
391
  */
@@ -393,14 +405,25 @@ export namespace PhoneNumberListAvailableResponse {
393
405
 
394
406
  export interface PhoneNumberCreateParams {
395
407
  /**
396
- * The number to buy, in E.164 format, from a search result
408
+ * The agent to assign the number to
397
409
  */
398
- e164: string;
410
+ agentId?: string;
399
411
 
400
412
  /**
401
- * The agent to assign the number to
413
+ * Let Roark pick a matching number instead of naming one. Give this or e164.
402
414
  */
403
- agentId?: string;
415
+ autoPick?: PhoneNumberCreateParams.AutoPick;
416
+
417
+ /**
418
+ * The country of the number given by e164 (default: US). An auto-picked number
419
+ * uses autoPick.country.
420
+ */
421
+ country?: 'US' | 'CA';
422
+
423
+ /**
424
+ * The number to buy, in E.164 format, from a search result. Give this or autoPick.
425
+ */
426
+ e164?: string;
404
427
 
405
428
  /**
406
429
  * Whether you expect this number to be free (from the allowance). The purchase is
@@ -420,6 +443,35 @@ export interface PhoneNumberCreateParams {
420
443
  name?: string;
421
444
  }
422
445
 
446
+ export namespace PhoneNumberCreateParams {
447
+ /**
448
+ * Let Roark pick a matching number instead of naming one. Give this or e164.
449
+ */
450
+ export interface AutoPick {
451
+ /**
452
+ * Three-digit area code, or a toll-free prefix such as 800. When it has no
453
+ * numbers, nearby ones are returned instead, flagged bestEffort.
454
+ */
455
+ areaCode?: string;
456
+
457
+ /**
458
+ * Digits or letters the number must contain (1 to 7, \* matches any digit)
459
+ */
460
+ contains?: string;
461
+
462
+ /**
463
+ * ISO 3166-1 alpha-2 country of the number: US or CA
464
+ */
465
+ country?: 'US' | 'CA';
466
+
467
+ /**
468
+ * LOCAL for a number in an area code, TOLL_FREE for one from the shared US and
469
+ * Canada toll-free pool
470
+ */
471
+ numberType?: 'LOCAL' | 'TOLL_FREE';
472
+ }
473
+ }
474
+
423
475
  export interface PhoneNumberUpdateParams {
424
476
  /**
425
477
  * Agent to assign the number to; null unassigns, omit to leave it alone
@@ -441,7 +493,8 @@ export interface PhoneNumberListParams {
441
493
 
442
494
  export interface PhoneNumberListAvailableParams {
443
495
  /**
444
- * Three-digit US area code
496
+ * Three-digit area code, or a toll-free prefix such as 800. When it has no
497
+ * numbers, nearby ones are returned instead, flagged bestEffort.
445
498
  */
446
499
  areaCode?: string;
447
500
 
@@ -451,9 +504,20 @@ export interface PhoneNumberListAvailableParams {
451
504
  contains?: string;
452
505
 
453
506
  /**
454
- * Maximum number of results (default: 20, max: 50)
507
+ * ISO 3166-1 alpha-2 country of the number: US or CA
508
+ */
509
+ country?: 'US' | 'CA';
510
+
511
+ /**
512
+ * Maximum number of results (default: 20, max: 100)
455
513
  */
456
514
  limit?: number;
515
+
516
+ /**
517
+ * LOCAL for a number in an area code, TOLL_FREE for one from the shared US and
518
+ * Canada toll-free pool
519
+ */
520
+ numberType?: 'LOCAL' | 'TOLL_FREE';
457
521
  }
458
522
 
459
523
  export declare namespace PhoneNumber {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '5.20.0'; // x-release-please-version
1
+ export const VERSION = '5.22.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "5.20.0";
1
+ export declare const VERSION = "5.22.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "5.20.0";
1
+ export declare const VERSION = "5.22.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '5.20.0'; // x-release-please-version
4
+ exports.VERSION = '5.22.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '5.20.0'; // x-release-please-version
1
+ export const VERSION = '5.22.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map