@roarkanalytics/sdk 5.19.0 → 5.21.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/package.json +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/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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [5.21.0](https://github.com/roarkhq/sdk-roark-analytics-node/compare/v5.20.0...v5.21.0) (2026-10-28)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **api:** api update ([#1398](https://github.com/roarkhq/sdk-roark-analytics-node/issues/1398)) ([a8c9f2d](https://github.com/roarkhq/sdk-roark-analytics-node/commit/a8c9f2d9088ee2d7169deff1afd72bea2ecf1045))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Chores
|
|
12
|
+
|
|
13
|
+
* fold next into main ([7030fc3](https://github.com/roarkhq/sdk-roark-analytics-node/commit/7030fc3e9c17cdde0a9495c08ddbc67665800fdc))
|
|
14
|
+
|
|
15
|
+
## [5.20.0](https://github.com/roarkhq/sdk-roark-analytics-node/compare/v5.19.0...v5.20.0) (2026-10-27)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **api:** api update ([#1395](https://github.com/roarkhq/sdk-roark-analytics-node/issues/1395)) ([a396982](https://github.com/roarkhq/sdk-roark-analytics-node/commit/a39698275fabaf6c9ef7a0e1a94e24877b01293d))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Chores
|
|
24
|
+
|
|
25
|
+
* fold next into main ([f01557a](https://github.com/roarkhq/sdk-roark-analytics-node/commit/f01557a20106bdd82756209d892f17ea5832e4c5))
|
|
26
|
+
|
|
3
27
|
## [5.19.0](https://github.com/roarkhq/sdk-roark-analytics-node/compare/v5.18.0...v5.19.0) (2026-10-27)
|
|
4
28
|
|
|
5
29
|
|
package/package.json
CHANGED
|
@@ -3,17 +3,17 @@ import { APIPromise } from "../core/api-promise.mjs";
|
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
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.mts","sourceRoot":"","sources":["../src/resources/phone-number.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAG7D,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;OAUG;IACH,MAAM,
|
|
1
|
+
{"version":3,"file":"phone-number.d.mts","sourceRoot":"","sources":["../src/resources/phone-number.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,g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EG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;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"}
|
|
@@ -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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AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,8BAA8B;IAC7C;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;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,
|
|
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AC,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF"}
|
|
@@ -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
|
|
11
|
-
*
|
|
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(
|
|
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,
|
|
89
|
-
* the number must contain.
|
|
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
|
|
408
|
+
* The agent to assign the number to
|
|
397
409
|
*/
|
|
398
|
-
|
|
410
|
+
agentId?: string;
|
|
399
411
|
|
|
400
412
|
/**
|
|
401
|
-
*
|
|
413
|
+
* Let Roark pick a matching number instead of naming one. Give this or e164.
|
|
402
414
|
*/
|
|
403
|
-
|
|
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
|
|
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
|
-
*
|
|
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.
|
|
1
|
+
export const VERSION = '5.21.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "5.
|
|
1
|
+
export declare const VERSION = "5.21.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "5.
|
|
1
|
+
export declare const VERSION = "5.21.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '5.
|
|
1
|
+
export const VERSION = '5.21.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|