@surgeapi/node 0.34.0 → 0.35.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 +23 -0
- package/README.md +31 -0
- package/client.d.mts +12 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +12 -6
- package/client.d.ts.map +1 -1
- package/client.js +11 -2
- package/client.js.map +1 -1
- package/client.mjs +14 -5
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +60 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +60 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +115 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +109 -0
- package/core/pagination.mjs.map +1 -0
- package/index.d.mts +1 -0
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/package.json +11 -1
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resources/blasts.d.mts +4 -4
- package/resources/blasts.d.mts.map +1 -1
- package/resources/blasts.d.ts +4 -4
- package/resources/blasts.d.ts.map +1 -1
- package/resources/contacts.d.mts +19 -1
- package/resources/contacts.d.mts.map +1 -1
- package/resources/contacts.d.ts +19 -1
- package/resources/contacts.d.ts.map +1 -1
- package/resources/contacts.js +20 -0
- package/resources/contacts.js.map +1 -1
- package/resources/contacts.mjs +20 -0
- package/resources/contacts.mjs.map +1 -1
- package/resources/index.d.mts +3 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -3
- package/resources/index.mjs.map +1 -1
- package/resources/messages.d.mts +20 -2
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +20 -2
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +20 -0
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +20 -0
- package/resources/messages.mjs.map +1 -1
- package/resources/phone-numbers.d.mts +19 -1
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +19 -1
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/phone-numbers.js +20 -0
- package/resources/phone-numbers.js.map +1 -1
- package/resources/phone-numbers.mjs +20 -0
- package/resources/phone-numbers.mjs.map +1 -1
- package/resources/webhooks.d.mts +4 -4
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +4 -4
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +60 -6
- package/src/core/pagination.ts +176 -0
- package/src/index.ts +1 -0
- package/src/internal/parse.ts +6 -0
- package/src/pagination.ts +2 -0
- package/src/resources/blasts.ts +4 -4
- package/src/resources/contacts.ts +31 -0
- package/src/resources/index.ts +22 -3
- package/src/resources/messages.ts +36 -2
- package/src/resources/phone-numbers.ts +35 -1
- package/src/resources/webhooks.ts +4 -4
- 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
|
@@ -2,10 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
4
|
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { Cursor, type CursorParams, PagePromise } from '../core/pagination';
|
|
5
6
|
import { RequestOptions } from '../internal/request-options';
|
|
6
7
|
import { path } from '../internal/utils/path';
|
|
7
8
|
|
|
8
9
|
export class PhoneNumbers extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* List all phone numbers for an account with cursor-based pagination.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* // Automatically fetches more pages as needed.
|
|
16
|
+
* for await (const phoneNumber of client.phoneNumbers.list(
|
|
17
|
+
* 'acct_01j9a43avnfqzbjfch6pygv1td',
|
|
18
|
+
* )) {
|
|
19
|
+
* // ...
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
list(
|
|
24
|
+
accountID: string,
|
|
25
|
+
query: PhoneNumberListParams | null | undefined = {},
|
|
26
|
+
options?: RequestOptions,
|
|
27
|
+
): PagePromise<PhoneNumbersCursor, PhoneNumber> {
|
|
28
|
+
return this._client.getAPIList(path`/accounts/${accountID}/phone_numbers`, Cursor<PhoneNumber>, {
|
|
29
|
+
query,
|
|
30
|
+
...options,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
9
34
|
/**
|
|
10
35
|
* Purchase a new phone number for the account. You can specify search criteria or
|
|
11
36
|
* let the system select a random number.
|
|
@@ -26,6 +51,8 @@ export class PhoneNumbers extends APIResource {
|
|
|
26
51
|
}
|
|
27
52
|
}
|
|
28
53
|
|
|
54
|
+
export type PhoneNumbersCursor = Cursor<PhoneNumber>;
|
|
55
|
+
|
|
29
56
|
/**
|
|
30
57
|
* A phone number that can be used to send and receive messages and calls
|
|
31
58
|
*/
|
|
@@ -46,6 +73,8 @@ export interface PhoneNumber {
|
|
|
46
73
|
type: 'local' | 'short_code' | 'toll_free';
|
|
47
74
|
}
|
|
48
75
|
|
|
76
|
+
export interface PhoneNumberListParams extends CursorParams {}
|
|
77
|
+
|
|
49
78
|
export interface PhoneNumberPurchaseParams {
|
|
50
79
|
/**
|
|
51
80
|
* The desired area code for this phone number. If provided without type, the type
|
|
@@ -73,5 +102,10 @@ export interface PhoneNumberPurchaseParams {
|
|
|
73
102
|
}
|
|
74
103
|
|
|
75
104
|
export declare namespace PhoneNumbers {
|
|
76
|
-
export {
|
|
105
|
+
export {
|
|
106
|
+
type PhoneNumber as PhoneNumber,
|
|
107
|
+
type PhoneNumbersCursor as PhoneNumbersCursor,
|
|
108
|
+
type PhoneNumberListParams as PhoneNumberListParams,
|
|
109
|
+
type PhoneNumberPurchaseParams as PhoneNumberPurchaseParams,
|
|
110
|
+
};
|
|
77
111
|
}
|
|
@@ -313,7 +313,7 @@ export namespace MessageDeliveredWebhookEvent {
|
|
|
313
313
|
/**
|
|
314
314
|
* The content of the message
|
|
315
315
|
*/
|
|
316
|
-
body: string;
|
|
316
|
+
body: string | null;
|
|
317
317
|
|
|
318
318
|
/**
|
|
319
319
|
* The conversation this message belongs to
|
|
@@ -412,7 +412,7 @@ export namespace MessageFailedWebhookEvent {
|
|
|
412
412
|
/**
|
|
413
413
|
* The content of the message
|
|
414
414
|
*/
|
|
415
|
-
body: string;
|
|
415
|
+
body: string | null;
|
|
416
416
|
|
|
417
417
|
/**
|
|
418
418
|
* The conversation this message belongs to
|
|
@@ -516,7 +516,7 @@ export namespace MessageReceivedWebhookEvent {
|
|
|
516
516
|
/**
|
|
517
517
|
* The content of the message
|
|
518
518
|
*/
|
|
519
|
-
body: string;
|
|
519
|
+
body: string | null;
|
|
520
520
|
|
|
521
521
|
/**
|
|
522
522
|
* The conversation this message belongs to
|
|
@@ -615,7 +615,7 @@ export namespace MessageSentWebhookEvent {
|
|
|
615
615
|
/**
|
|
616
616
|
* The content of the message
|
|
617
617
|
*/
|
|
618
|
-
body: string;
|
|
618
|
+
body: string | null;
|
|
619
619
|
|
|
620
620
|
/**
|
|
621
621
|
* The conversation this message belongs to
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.35.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.35.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.35.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.35.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|