sendblue 3.10.1 → 3.11.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 +33 -0
- package/README.md +7 -7
- package/client.d.mts +37 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +37 -4
- package/client.d.ts.map +1 -1
- package/client.js +33 -0
- package/client.js.map +1 -1
- package/client.mjs +33 -0
- package/client.mjs.map +1 -1
- package/core/streaming.d.mts +33 -0
- package/core/streaming.d.mts.map +1 -0
- package/core/streaming.d.ts +33 -0
- package/core/streaming.d.ts.map +1 -0
- package/core/streaming.js +263 -0
- package/core/streaming.js.map +1 -0
- package/core/streaming.mjs +258 -0
- package/core/streaming.mjs.map +1 -0
- package/internal/decoders/line.d.mts +17 -0
- package/internal/decoders/line.d.mts.map +1 -0
- package/internal/decoders/line.d.ts +17 -0
- package/internal/decoders/line.d.ts.map +1 -0
- package/internal/decoders/line.js +113 -0
- package/internal/decoders/line.js.map +1 -0
- package/internal/decoders/line.mjs +108 -0
- package/internal/decoders/line.mjs.map +1 -0
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +10 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +10 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/request-options.d.mts +2 -0
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +2 -0
- package/internal/request-options.d.ts.map +1 -1
- package/internal/request-options.js.map +1 -1
- package/internal/request-options.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/package.json +11 -1
- package/resources/auth/auth.d.mts +10 -0
- package/resources/auth/auth.d.mts.map +1 -0
- package/resources/auth/auth.d.ts +10 -0
- package/resources/auth/auth.d.ts.map +1 -0
- package/resources/auth/auth.js +17 -0
- package/resources/auth/auth.js.map +1 -0
- package/resources/auth/auth.mjs +12 -0
- package/resources/auth/auth.mjs.map +1 -0
- package/resources/auth/index.d.mts +3 -0
- package/resources/auth/index.d.mts.map +1 -0
- package/resources/auth/index.d.ts +3 -0
- package/resources/auth/index.d.ts.map +1 -0
- package/resources/auth/index.js +9 -0
- package/resources/auth/index.js.map +1 -0
- package/resources/auth/index.mjs +4 -0
- package/resources/auth/index.mjs.map +1 -0
- package/resources/auth/tokens.d.mts +77 -0
- package/resources/auth/tokens.d.mts.map +1 -0
- package/resources/auth/tokens.d.ts +77 -0
- package/resources/auth/tokens.d.ts.map +1 -0
- package/resources/auth/tokens.js +51 -0
- package/resources/auth/tokens.js.map +1 -0
- package/resources/auth/tokens.mjs +47 -0
- package/resources/auth/tokens.mjs.map +1 -0
- package/resources/auth.d.mts +2 -0
- package/resources/auth.d.mts.map +1 -0
- package/resources/auth.d.ts +2 -0
- package/resources/auth.d.ts.map +1 -0
- package/resources/auth.js +6 -0
- package/resources/auth.js.map +1 -0
- package/resources/auth.mjs +3 -0
- package/resources/auth.mjs.map +1 -0
- package/resources/contacts/contacts.d.mts +8 -0
- package/resources/contacts/contacts.d.mts.map +1 -1
- package/resources/contacts/contacts.d.ts +8 -0
- package/resources/contacts/contacts.d.ts.map +1 -1
- package/resources/contacts/contacts.js.map +1 -1
- package/resources/contacts/contacts.mjs.map +1 -1
- package/resources/events.d.mts +45 -0
- package/resources/events.d.mts.map +1 -0
- package/resources/events.d.ts +45 -0
- package/resources/events.d.ts.map +1 -0
- package/resources/events.js +37 -0
- package/resources/events.js.map +1 -0
- package/resources/events.mjs +33 -0
- package/resources/events.mjs.map +1 -0
- package/resources/groups.d.mts +25 -0
- package/resources/groups.d.mts.map +1 -1
- package/resources/groups.d.ts +25 -0
- package/resources/groups.d.ts.map +1 -1
- package/resources/index.d.mts +8 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +8 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +13 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +6 -0
- package/resources/index.mjs.map +1 -1
- package/resources/lines/call-forwarding.d.mts +3 -0
- package/resources/lines/call-forwarding.d.mts.map +1 -1
- package/resources/lines/call-forwarding.d.ts +3 -0
- package/resources/lines/call-forwarding.d.ts.map +1 -1
- package/resources/lines/call-forwarding.js +3 -0
- package/resources/lines/call-forwarding.js.map +1 -1
- package/resources/lines/call-forwarding.mjs +3 -0
- package/resources/lines/call-forwarding.mjs.map +1 -1
- package/resources/lines/index.d.mts +1 -1
- package/resources/lines/index.d.mts.map +1 -1
- package/resources/lines/index.d.ts +1 -1
- package/resources/lines/index.d.ts.map +1 -1
- package/resources/lines/index.js.map +1 -1
- package/resources/lines/index.mjs.map +1 -1
- package/resources/lines/lines.d.mts +30 -0
- package/resources/lines/lines.d.mts.map +1 -1
- package/resources/lines/lines.d.ts +30 -0
- package/resources/lines/lines.d.ts.map +1 -1
- package/resources/lines/lines.js +15 -0
- package/resources/lines/lines.js.map +1 -1
- package/resources/lines/lines.mjs +15 -0
- package/resources/lines/lines.mjs.map +1 -1
- package/resources/location.d.mts +156 -0
- package/resources/location.d.mts.map +1 -0
- package/resources/location.d.ts +156 -0
- package/resources/location.d.ts.map +1 -0
- package/resources/location.js +57 -0
- package/resources/location.js.map +1 -0
- package/resources/location.mjs +53 -0
- package/resources/location.mjs.map +1 -0
- package/resources/messages.d.mts +507 -9
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +507 -9
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +16 -2
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +16 -2
- package/resources/messages.mjs.map +1 -1
- package/resources/request-location.d.mts +54 -0
- package/resources/request-location.d.mts.map +1 -0
- package/resources/request-location.d.ts +54 -0
- package/resources/request-location.d.ts.map +1 -0
- package/resources/request-location.js +30 -0
- package/resources/request-location.js.map +1 -0
- package/resources/request-location.mjs +26 -0
- package/resources/request-location.mjs.map +1 -0
- package/resources/send-carousel.d.mts +67 -0
- package/resources/send-carousel.d.mts.map +1 -1
- package/resources/send-carousel.d.ts +67 -0
- package/resources/send-carousel.d.ts.map +1 -1
- package/resources/v2/groups.d.mts +82 -0
- package/resources/v2/groups.d.mts.map +1 -0
- package/resources/v2/groups.d.ts +82 -0
- package/resources/v2/groups.d.ts.map +1 -0
- package/resources/v2/groups.js +27 -0
- package/resources/v2/groups.js.map +1 -0
- package/resources/v2/groups.mjs +23 -0
- package/resources/v2/groups.mjs.map +1 -0
- package/resources/v2/index.d.mts +1 -0
- package/resources/v2/index.d.mts.map +1 -1
- package/resources/v2/index.d.ts +1 -0
- package/resources/v2/index.d.ts.map +1 -1
- package/resources/v2/index.js +3 -1
- package/resources/v2/index.js.map +1 -1
- package/resources/v2/index.mjs +1 -0
- package/resources/v2/index.mjs.map +1 -1
- package/resources/v2/v2.d.mts +4 -0
- package/resources/v2/v2.d.mts.map +1 -1
- package/resources/v2/v2.d.ts +4 -0
- package/resources/v2/v2.d.ts.map +1 -1
- package/resources/v2/v2.js +4 -0
- package/resources/v2/v2.js.map +1 -1
- package/resources/v2/v2.mjs +4 -0
- package/resources/v2/v2.mjs.map +1 -1
- package/resources/verified-contacts.d.mts +152 -0
- package/resources/verified-contacts.d.mts.map +1 -0
- package/resources/verified-contacts.d.ts +152 -0
- package/resources/verified-contacts.d.ts.map +1 -0
- package/resources/verified-contacts.js +56 -0
- package/resources/verified-contacts.js.map +1 -0
- package/resources/verified-contacts.mjs +52 -0
- package/resources/verified-contacts.mjs.map +1 -0
- package/resources/verify/index.d.mts +3 -0
- package/resources/verify/index.d.mts.map +1 -0
- package/resources/verify/index.d.ts +3 -0
- package/resources/verify/index.d.ts.map +1 -0
- package/resources/verify/index.js +9 -0
- package/resources/verify/index.js.map +1 -0
- package/resources/verify/index.mjs +4 -0
- package/resources/verify/index.mjs.map +1 -0
- package/resources/verify/verifications.d.mts +45 -0
- package/resources/verify/verifications.d.mts.map +1 -0
- package/resources/verify/verifications.d.ts +45 -0
- package/resources/verify/verifications.d.ts.map +1 -0
- package/resources/verify/verifications.js +19 -0
- package/resources/verify/verifications.js.map +1 -0
- package/resources/verify/verifications.mjs +15 -0
- package/resources/verify/verifications.mjs.map +1 -0
- package/resources/verify/verify.d.mts +10 -0
- package/resources/verify/verify.d.mts.map +1 -0
- package/resources/verify/verify.d.ts +10 -0
- package/resources/verify/verify.d.ts.map +1 -0
- package/resources/verify/verify.js +17 -0
- package/resources/verify/verify.js.map +1 -0
- package/resources/verify/verify.mjs +12 -0
- package/resources/verify/verify.mjs.map +1 -0
- package/resources/verify.d.mts +2 -0
- package/resources/verify.d.mts.map +1 -0
- package/resources/verify.d.ts +2 -0
- package/resources/verify.d.ts.map +1 -0
- package/resources/verify.js +6 -0
- package/resources/verify.js.map +1 -0
- package/resources/verify.mjs +3 -0
- package/resources/verify.mjs.map +1 -0
- package/resources/webhooks.d.mts +26 -10
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +26 -10
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +13 -2
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +13 -2
- package/resources/webhooks.mjs.map +1 -1
- package/src/client.ts +85 -2
- package/src/core/streaming.ts +319 -0
- package/src/internal/decoders/line.ts +135 -0
- package/src/internal/parse.ts +14 -0
- package/src/internal/request-options.ts +2 -0
- package/src/resources/auth/auth.ts +19 -0
- package/src/resources/auth/index.ts +4 -0
- package/src/resources/auth/tokens.ts +101 -0
- package/src/resources/auth.ts +3 -0
- package/src/resources/contacts/contacts.ts +10 -0
- package/src/resources/events.ts +75 -0
- package/src/resources/groups.ts +28 -0
- package/src/resources/index.ts +26 -1
- package/src/resources/lines/call-forwarding.ts +3 -0
- package/src/resources/lines/index.ts +1 -1
- package/src/resources/lines/lines.ts +44 -0
- package/src/resources/location.ts +237 -0
- package/src/resources/messages.ts +634 -9
- package/src/resources/request-location.ts +72 -0
- package/src/resources/send-carousel.ts +76 -0
- package/src/resources/v2/groups.ts +106 -0
- package/src/resources/v2/index.ts +1 -0
- package/src/resources/v2/v2.ts +6 -0
- package/src/resources/verified-contacts.ts +204 -0
- package/src/resources/verify/index.ts +9 -0
- package/src/resources/verify/verifications.ts +75 -0
- package/src/resources/verify/verify.ts +25 -0
- package/src/resources/verify.ts +3 -0
- package/src/resources/webhooks.ts +27 -10
- package/src/streaming.ts +2 -0
- package/src/version.ts +1 -1
- package/streaming.d.mts +3 -0
- package/streaming.d.mts.map +1 -0
- package/streaming.d.ts +3 -0
- package/streaming.d.ts.map +1 -0
- package/streaming.js +6 -0
- package/streaming.js.map +1 -0
- package/streaming.mjs +3 -0
- package/streaming.mjs.map +1 -0
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Operations for sending and managing messages
|
|
9
|
+
*/
|
|
10
|
+
export class RequestLocation extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Send a Find My location request to an iMessage recipient from a dedicated
|
|
13
|
+
* Mac-backed Sendblue line. Shared lines cannot initiate location sharing. The
|
|
14
|
+
* request is queued like a normal outbound iMessage. If the recipient accepts and
|
|
15
|
+
* shares, the location is delivered later as an inbound `message_type: location`
|
|
16
|
+
* webhook. Passive inbound location webhooks remain available on shared lines as
|
|
17
|
+
* part of the iMessage conversation.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const requestLocation = await client.requestLocation.create(
|
|
22
|
+
* { from_number: '+18887776666', number: '+19998887777' },
|
|
23
|
+
* );
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
create(
|
|
27
|
+
body: RequestLocationCreateParams,
|
|
28
|
+
options?: RequestOptions,
|
|
29
|
+
): APIPromise<RequestLocationCreateResponse> {
|
|
30
|
+
return this._client.post('/api/request-location', { body, ...options });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface RequestLocationCreateResponse {
|
|
35
|
+
message?: string;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Unique identifier for tracking the request message
|
|
39
|
+
*/
|
|
40
|
+
message_handle?: string;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Recipient phone number
|
|
44
|
+
*/
|
|
45
|
+
number?: string;
|
|
46
|
+
|
|
47
|
+
status?: 'QUEUED';
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Unique identifier for tracking the request message
|
|
51
|
+
*/
|
|
52
|
+
uuid?: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface RequestLocationCreateParams {
|
|
56
|
+
/**
|
|
57
|
+
* Your supported Sendblue number in E.164 format
|
|
58
|
+
*/
|
|
59
|
+
from_number: string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Recipient phone number in E.164 format
|
|
63
|
+
*/
|
|
64
|
+
number: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export declare namespace RequestLocation {
|
|
68
|
+
export {
|
|
69
|
+
type RequestLocationCreateResponse as RequestLocationCreateResponse,
|
|
70
|
+
type RequestLocationCreateParams as RequestLocationCreateParams,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
@@ -61,7 +61,55 @@ export interface SendCarouselSendResponse {
|
|
|
61
61
|
*/
|
|
62
62
|
number?: string;
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Immediate parent of an iMessage inline reply. The target must belong to the same
|
|
66
|
+
* account, conversation, and sending line.
|
|
67
|
+
*/
|
|
68
|
+
reply_to?: SendCarouselSendResponse.ReplyTo;
|
|
69
|
+
|
|
64
70
|
status?: string;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Message that originated an iMessage inline-reply thread.
|
|
74
|
+
*/
|
|
75
|
+
thread_originator?: SendCarouselSendResponse.ThreadOriginator;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export namespace SendCarouselSendResponse {
|
|
79
|
+
/**
|
|
80
|
+
* Immediate parent of an iMessage inline reply. The target must belong to the same
|
|
81
|
+
* account, conversation, and sending line.
|
|
82
|
+
*/
|
|
83
|
+
export interface ReplyTo {
|
|
84
|
+
/**
|
|
85
|
+
* Public handle of the immediate parent message
|
|
86
|
+
*/
|
|
87
|
+
message_handle: string;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Advanced override for a known part of a multipart target. Omit this in normal
|
|
91
|
+
* reply requests and never guess it; requests default to 0. When replying to an
|
|
92
|
+
* attachment represented by its own webhook, use that webhook's `message_handle`
|
|
93
|
+
* and omit `part_index` so Sendblue can use the stored authoritative part.
|
|
94
|
+
* Responses omit it when no authoritative immediate-parent part is available.
|
|
95
|
+
*/
|
|
96
|
+
part_index?: number;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Message that originated an iMessage inline-reply thread.
|
|
101
|
+
*/
|
|
102
|
+
export interface ThreadOriginator {
|
|
103
|
+
/**
|
|
104
|
+
* Public handle of the thread's root message
|
|
105
|
+
*/
|
|
106
|
+
message_handle: string;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Opaque Apple thread-originator part descriptor
|
|
110
|
+
*/
|
|
111
|
+
part?: string;
|
|
112
|
+
}
|
|
65
113
|
}
|
|
66
114
|
|
|
67
115
|
export interface SendCarouselSendParams {
|
|
@@ -85,6 +133,12 @@ export interface SendCarouselSendParams {
|
|
|
85
133
|
*/
|
|
86
134
|
metadata?: unknown;
|
|
87
135
|
|
|
136
|
+
/**
|
|
137
|
+
* Immediate parent of an iMessage inline reply. The target must belong to the same
|
|
138
|
+
* account, conversation, and sending line.
|
|
139
|
+
*/
|
|
140
|
+
reply_to?: SendCarouselSendParams.ReplyTo;
|
|
141
|
+
|
|
88
142
|
/**
|
|
89
143
|
* Optional. Identifies the seat (user) sending the carousel so it is attributed to
|
|
90
144
|
* a specific rep. Accepts either the seat UUID or the Firebase Auth subject. When
|
|
@@ -117,6 +171,28 @@ export interface SendCarouselSendParams {
|
|
|
117
171
|
status_callback?: string;
|
|
118
172
|
}
|
|
119
173
|
|
|
174
|
+
export namespace SendCarouselSendParams {
|
|
175
|
+
/**
|
|
176
|
+
* Immediate parent of an iMessage inline reply. The target must belong to the same
|
|
177
|
+
* account, conversation, and sending line.
|
|
178
|
+
*/
|
|
179
|
+
export interface ReplyTo {
|
|
180
|
+
/**
|
|
181
|
+
* Public handle of the immediate parent message
|
|
182
|
+
*/
|
|
183
|
+
message_handle: string;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Advanced override for a known part of a multipart target. Omit this in normal
|
|
187
|
+
* reply requests and never guess it; requests default to 0. When replying to an
|
|
188
|
+
* attachment represented by its own webhook, use that webhook's `message_handle`
|
|
189
|
+
* and omit `part_index` so Sendblue can use the stored authoritative part.
|
|
190
|
+
* Responses omit it when no authoritative immediate-parent part is available.
|
|
191
|
+
*/
|
|
192
|
+
part_index?: number;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
120
196
|
export declare namespace SendCarousel {
|
|
121
197
|
export {
|
|
122
198
|
type SendCarouselSendResponse as SendCarouselSendResponse,
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
import { path } from '../../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Operations for group messaging (beta)
|
|
10
|
+
*/
|
|
11
|
+
export class Groups extends APIResource {
|
|
12
|
+
/**
|
|
13
|
+
* Retrieve the current complete membership for a group owned by the authenticated
|
|
14
|
+
* account.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const group = await client.v2.groups.retrieve(
|
|
19
|
+
* 'sb_group_608acc54-d0d7-4b41-8092-9ff6e1e70455',
|
|
20
|
+
* );
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
retrieve(groupID: string, options?: RequestOptions): APIPromise<GroupRetrieveResponse> {
|
|
24
|
+
return this._client.get(path`/api/v2/groups/${groupID}`, options);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface GroupRetrieveResponse {
|
|
29
|
+
data?: GroupRetrieveResponse.Data;
|
|
30
|
+
|
|
31
|
+
status?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export namespace GroupRetrieveResponse {
|
|
35
|
+
export interface Data {
|
|
36
|
+
created_at?: string;
|
|
37
|
+
|
|
38
|
+
group_id?: string;
|
|
39
|
+
|
|
40
|
+
group_name?: string;
|
|
41
|
+
|
|
42
|
+
latest_comm_at?: string | null;
|
|
43
|
+
|
|
44
|
+
latest_message_id?: string | null;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Convenience list of resolved participant phone numbers. Participants with
|
|
48
|
+
* email-only handles remain in participants but are omitted here.
|
|
49
|
+
*/
|
|
50
|
+
participant_numbers?: Array<string>;
|
|
51
|
+
|
|
52
|
+
participants?: Array<Data.Participant>;
|
|
53
|
+
|
|
54
|
+
updated_at?: string;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Worker-local iMessage group identifier when known
|
|
58
|
+
*/
|
|
59
|
+
worker_group_id?: string | null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export namespace Data {
|
|
63
|
+
export interface Participant {
|
|
64
|
+
/**
|
|
65
|
+
* Contact ID when this participant is linked to a contact
|
|
66
|
+
*/
|
|
67
|
+
contact_id?: string | null;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Raw participant handle, usually an E.164 phone number but sometimes an iMessage
|
|
71
|
+
* email handle
|
|
72
|
+
*/
|
|
73
|
+
handle?: string | null;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Contact or seat display name when available
|
|
77
|
+
*/
|
|
78
|
+
name?: string | null;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Unique participant row identifier
|
|
82
|
+
*/
|
|
83
|
+
participant_id?: string;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Resolved participant phone number, preferring the stored group phone handle and
|
|
87
|
+
* falling back to contact phone. Email handles remain available in handle.
|
|
88
|
+
*/
|
|
89
|
+
phone?: string | null;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Seat ID when this participant is a team member
|
|
93
|
+
*/
|
|
94
|
+
seat_id?: string | null;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Participant kind
|
|
98
|
+
*/
|
|
99
|
+
type?: 'contact' | 'seat';
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export declare namespace Groups {
|
|
105
|
+
export { type GroupRetrieveResponse as GroupRetrieveResponse };
|
|
106
|
+
}
|
package/src/resources/v2/v2.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as GroupsAPI from './groups';
|
|
5
|
+
import { GroupRetrieveResponse, Groups } from './groups';
|
|
4
6
|
import * as SeatsAPI from './seats';
|
|
5
7
|
import {
|
|
6
8
|
SeatCountParams,
|
|
@@ -16,10 +18,12 @@ import { Totp, TotpGetCodeResponse } from './totp/totp';
|
|
|
16
18
|
export class V2 extends APIResource {
|
|
17
19
|
totp: TotpAPI.Totp = new TotpAPI.Totp(this._client);
|
|
18
20
|
seats: SeatsAPI.Seats = new SeatsAPI.Seats(this._client);
|
|
21
|
+
groups: GroupsAPI.Groups = new GroupsAPI.Groups(this._client);
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
V2.Totp = Totp;
|
|
22
25
|
V2.Seats = Seats;
|
|
26
|
+
V2.Groups = Groups;
|
|
23
27
|
|
|
24
28
|
export declare namespace V2 {
|
|
25
29
|
export { Totp as Totp, type TotpGetCodeResponse as TotpGetCodeResponse };
|
|
@@ -32,4 +36,6 @@ export declare namespace V2 {
|
|
|
32
36
|
type SeatListParams as SeatListParams,
|
|
33
37
|
type SeatCountParams as SeatCountParams,
|
|
34
38
|
};
|
|
39
|
+
|
|
40
|
+
export { Groups as Groups, type GroupRetrieveResponse as GroupRetrieveResponse };
|
|
35
41
|
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
import { path } from '../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Operations for managing verified-contact access to shared iMessage lines
|
|
10
|
+
*/
|
|
11
|
+
export class VerifiedContacts extends APIResource {
|
|
12
|
+
/**
|
|
13
|
+
* Creates or returns a verified-contact route for the authenticated account's
|
|
14
|
+
* shared iMessage line. Pending contacts become verified after the recipient sends
|
|
15
|
+
* an inbound iMessage or SMS to the returned line phone number.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const verifiedContact =
|
|
20
|
+
* await client.verifiedContacts.create({
|
|
21
|
+
* phone_number: '+12125550199',
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
create(
|
|
26
|
+
body: VerifiedContactCreateParams,
|
|
27
|
+
options?: RequestOptions,
|
|
28
|
+
): APIPromise<VerifiedContactCreateResponse> {
|
|
29
|
+
return this._client.post('/v3/verified-contacts', { body, ...options });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Retrieve one verified-contact route by phone number for the authenticated
|
|
34
|
+
* account.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const verifiedContact =
|
|
39
|
+
* await client.verifiedContacts.retrieve('+12125550199');
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
retrieve(phoneNumber: string, options?: RequestOptions): APIPromise<VerifiedContactRetrieveResponse> {
|
|
43
|
+
return this._client.get(path`/v3/verified-contacts/${phoneNumber}`, options);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Lists contacts attached to the authenticated account's shared iMessage line.
|
|
48
|
+
* Contacts start as `pending`; they become `verified` after the recipient sends an
|
|
49
|
+
* inbound iMessage or SMS to the shared line.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const verifiedContacts =
|
|
54
|
+
* await client.verifiedContacts.list();
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
list(options?: RequestOptions): APIPromise<VerifiedContactListResponse> {
|
|
58
|
+
return this._client.get('/v3/verified-contacts', options);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface VerifiedContactCreateResponse {
|
|
63
|
+
data?: VerifiedContactCreateResponse.Data;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export namespace VerifiedContactCreateResponse {
|
|
67
|
+
export interface Data {
|
|
68
|
+
contact: Data.Contact;
|
|
69
|
+
|
|
70
|
+
line: Data.Line | null;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Null when the contact is already verified
|
|
74
|
+
*/
|
|
75
|
+
verification_instructions: string | null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export namespace Data {
|
|
79
|
+
export interface Contact {
|
|
80
|
+
created_at: string;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Contact phone number in E.164 format
|
|
84
|
+
*/
|
|
85
|
+
phone_number: string;
|
|
86
|
+
|
|
87
|
+
updated_at: string;
|
|
88
|
+
|
|
89
|
+
verification_status: 'pending' | 'verified';
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Whether this contact has completed verification by messaging the shared line
|
|
93
|
+
*/
|
|
94
|
+
verified: boolean;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface Line {
|
|
98
|
+
/**
|
|
99
|
+
* Shared Sendblue line the contact must message to complete verification
|
|
100
|
+
*/
|
|
101
|
+
phone_number: string | null;
|
|
102
|
+
|
|
103
|
+
type: 'shared';
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface VerifiedContactRetrieveResponse {
|
|
109
|
+
data?: VerifiedContactRetrieveResponse.Data;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export namespace VerifiedContactRetrieveResponse {
|
|
113
|
+
export interface Data {
|
|
114
|
+
contact: Data.Contact | null;
|
|
115
|
+
|
|
116
|
+
line: Data.Line | null;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export namespace Data {
|
|
120
|
+
export interface Contact {
|
|
121
|
+
created_at: string;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Contact phone number in E.164 format
|
|
125
|
+
*/
|
|
126
|
+
phone_number: string;
|
|
127
|
+
|
|
128
|
+
updated_at: string;
|
|
129
|
+
|
|
130
|
+
verification_status: 'pending' | 'verified';
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Whether this contact has completed verification by messaging the shared line
|
|
134
|
+
*/
|
|
135
|
+
verified: boolean;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface Line {
|
|
139
|
+
/**
|
|
140
|
+
* Shared Sendblue line the contact must message to complete verification
|
|
141
|
+
*/
|
|
142
|
+
phone_number: string | null;
|
|
143
|
+
|
|
144
|
+
type: 'shared';
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface VerifiedContactListResponse {
|
|
150
|
+
data?: VerifiedContactListResponse.Data;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export namespace VerifiedContactListResponse {
|
|
154
|
+
export interface Data {
|
|
155
|
+
contacts: Array<Data.Contact>;
|
|
156
|
+
|
|
157
|
+
line: Data.Line | null;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export namespace Data {
|
|
161
|
+
export interface Contact {
|
|
162
|
+
created_at: string;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Contact phone number in E.164 format
|
|
166
|
+
*/
|
|
167
|
+
phone_number: string;
|
|
168
|
+
|
|
169
|
+
updated_at: string;
|
|
170
|
+
|
|
171
|
+
verification_status: 'pending' | 'verified';
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Whether this contact has completed verification by messaging the shared line
|
|
175
|
+
*/
|
|
176
|
+
verified: boolean;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface Line {
|
|
180
|
+
/**
|
|
181
|
+
* Shared Sendblue line the contact must message to complete verification
|
|
182
|
+
*/
|
|
183
|
+
phone_number: string | null;
|
|
184
|
+
|
|
185
|
+
type: 'shared';
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export interface VerifiedContactCreateParams {
|
|
191
|
+
/**
|
|
192
|
+
* Contact phone number. E.164 is recommended; US local numbers are accepted.
|
|
193
|
+
*/
|
|
194
|
+
phone_number: string;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export declare namespace VerifiedContacts {
|
|
198
|
+
export {
|
|
199
|
+
type VerifiedContactCreateResponse as VerifiedContactCreateResponse,
|
|
200
|
+
type VerifiedContactRetrieveResponse as VerifiedContactRetrieveResponse,
|
|
201
|
+
type VerifiedContactListResponse as VerifiedContactListResponse,
|
|
202
|
+
type VerifiedContactCreateParams as VerifiedContactCreateParams,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Verifications,
|
|
5
|
+
type VerificationState,
|
|
6
|
+
type VerificationListResponse,
|
|
7
|
+
type VerificationListParams,
|
|
8
|
+
} from './verifications';
|
|
9
|
+
export { Verify } from './verify';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Sendblue Verify issuance and recovery state
|
|
9
|
+
*/
|
|
10
|
+
export class Verifications extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Account-scoped verification state used to recover terminal Verify events after
|
|
13
|
+
* an SSE gap.
|
|
14
|
+
*/
|
|
15
|
+
list(
|
|
16
|
+
query: VerificationListParams | null | undefined = {},
|
|
17
|
+
options?: RequestOptions,
|
|
18
|
+
): APIPromise<VerificationListResponse> {
|
|
19
|
+
return this._client.get('/api/v2/verify/verifications', { query, ...options });
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface VerificationState {
|
|
24
|
+
channel: string;
|
|
25
|
+
|
|
26
|
+
date_created: string;
|
|
27
|
+
|
|
28
|
+
date_updated: string;
|
|
29
|
+
|
|
30
|
+
service_sid: string;
|
|
31
|
+
|
|
32
|
+
sid: string;
|
|
33
|
+
|
|
34
|
+
status: string;
|
|
35
|
+
|
|
36
|
+
date_completed?: string | null;
|
|
37
|
+
|
|
38
|
+
to?: string | null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface VerificationListResponse {
|
|
42
|
+
data: Array<VerificationState>;
|
|
43
|
+
|
|
44
|
+
pagination: VerificationListResponse.Pagination;
|
|
45
|
+
|
|
46
|
+
status: 'OK';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export namespace VerificationListResponse {
|
|
50
|
+
export interface Pagination {
|
|
51
|
+
count?: number;
|
|
52
|
+
|
|
53
|
+
has_more?: boolean;
|
|
54
|
+
|
|
55
|
+
limit?: number;
|
|
56
|
+
|
|
57
|
+
offset?: number;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface VerificationListParams {
|
|
62
|
+
limit?: number;
|
|
63
|
+
|
|
64
|
+
offset?: number;
|
|
65
|
+
|
|
66
|
+
updated_at_gte?: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export declare namespace Verifications {
|
|
70
|
+
export {
|
|
71
|
+
type VerificationState as VerificationState,
|
|
72
|
+
type VerificationListResponse as VerificationListResponse,
|
|
73
|
+
type VerificationListParams as VerificationListParams,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as VerificationsAPI from './verifications';
|
|
5
|
+
import {
|
|
6
|
+
VerificationListParams,
|
|
7
|
+
VerificationListResponse,
|
|
8
|
+
VerificationState,
|
|
9
|
+
Verifications,
|
|
10
|
+
} from './verifications';
|
|
11
|
+
|
|
12
|
+
export class Verify extends APIResource {
|
|
13
|
+
verifications: VerificationsAPI.Verifications = new VerificationsAPI.Verifications(this._client);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
Verify.Verifications = Verifications;
|
|
17
|
+
|
|
18
|
+
export declare namespace Verify {
|
|
19
|
+
export {
|
|
20
|
+
Verifications as Verifications,
|
|
21
|
+
type VerificationState as VerificationState,
|
|
22
|
+
type VerificationListResponse as VerificationListResponse,
|
|
23
|
+
type VerificationListParams as VerificationListParams,
|
|
24
|
+
};
|
|
25
|
+
}
|