sendblue 2.1.0 → 3.3.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 +160 -0
- package/LICENSE +1 -1
- package/README.md +34 -5
- package/client.d.mts +25 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +25 -3
- package/client.d.ts.map +1 -1
- package/client.js +41 -17
- package/client.js.map +1 -1
- package/client.mjs +41 -17
- package/client.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/utils/query.d.mts +5 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +5 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +23 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +20 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +1 -1
- package/resources/contacts/bulk.d.mts +25 -3
- package/resources/contacts/bulk.d.mts.map +1 -1
- package/resources/contacts/bulk.d.ts +25 -3
- package/resources/contacts/bulk.d.ts.map +1 -1
- package/resources/contacts/bulk.js +3 -0
- package/resources/contacts/bulk.js.map +1 -1
- package/resources/contacts/bulk.mjs +3 -0
- package/resources/contacts/bulk.mjs.map +1 -1
- package/resources/contacts/contacts.d.mts +105 -18
- package/resources/contacts/contacts.d.mts.map +1 -1
- package/resources/contacts/contacts.d.ts +105 -18
- package/resources/contacts/contacts.d.ts.map +1 -1
- package/resources/contacts/contacts.js +5 -2
- package/resources/contacts/contacts.js.map +1 -1
- package/resources/contacts/contacts.mjs +5 -2
- package/resources/contacts/contacts.mjs.map +1 -1
- package/resources/contacts/index.d.mts +1 -1
- package/resources/contacts/index.d.mts.map +1 -1
- package/resources/contacts/index.d.ts +1 -1
- package/resources/contacts/index.d.ts.map +1 -1
- package/resources/contacts/index.js.map +1 -1
- package/resources/contacts/index.mjs.map +1 -1
- package/resources/groups.d.mts +3 -0
- package/resources/groups.d.mts.map +1 -1
- package/resources/groups.d.ts +3 -0
- package/resources/groups.d.ts.map +1 -1
- package/resources/groups.js +3 -0
- package/resources/groups.js.map +1 -1
- package/resources/groups.mjs +3 -0
- package/resources/groups.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/lookups.d.mts +3 -0
- package/resources/lookups.d.mts.map +1 -1
- package/resources/lookups.d.ts +3 -0
- package/resources/lookups.d.ts.map +1 -1
- package/resources/lookups.js +3 -0
- package/resources/lookups.js.map +1 -1
- package/resources/lookups.mjs +3 -0
- package/resources/lookups.mjs.map +1 -1
- package/resources/media-objects.d.mts +3 -0
- package/resources/media-objects.d.mts.map +1 -1
- package/resources/media-objects.d.ts +3 -0
- package/resources/media-objects.d.ts.map +1 -1
- package/resources/media-objects.js +3 -0
- package/resources/media-objects.js.map +1 -1
- package/resources/media-objects.mjs +3 -0
- package/resources/media-objects.mjs.map +1 -1
- package/resources/messages.d.mts +50 -7
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +50 -7
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +19 -0
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +19 -0
- package/resources/messages.mjs.map +1 -1
- package/resources/typing-indicators.d.mts +10 -2
- package/resources/typing-indicators.d.mts.map +1 -1
- package/resources/typing-indicators.d.ts +10 -2
- package/resources/typing-indicators.d.ts.map +1 -1
- package/resources/typing-indicators.js +5 -2
- package/resources/typing-indicators.js.map +1 -1
- package/resources/typing-indicators.mjs +5 -2
- package/resources/typing-indicators.mjs.map +1 -1
- package/resources/webhooks.d.mts +149 -145
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +149 -145
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +11 -57
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +11 -57
- package/resources/webhooks.mjs.map +1 -1
- package/src/client.ts +48 -22
- package/src/internal/parse.ts +6 -0
- package/src/internal/utils/query.ts +23 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/contacts/bulk.ts +24 -3
- package/src/resources/contacts/contacts.ts +118 -18
- package/src/resources/contacts/index.ts +1 -0
- package/src/resources/groups.ts +3 -0
- package/src/resources/index.ts +1 -0
- package/src/resources/lookups.ts +3 -0
- package/src/resources/media-objects.ts +3 -0
- package/src/resources/messages.ts +52 -7
- package/src/resources/typing-indicators.ts +11 -2
- package/src/resources/webhooks.ts +185 -154
- 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/resources/webhooks.d.ts
CHANGED
|
@@ -1,222 +1,226 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import * as WebhooksAPI from "./webhooks.js";
|
|
2
3
|
import { APIPromise } from "../core/api-promise.js";
|
|
3
4
|
import { RequestOptions } from "../internal/request-options.js";
|
|
5
|
+
/**
|
|
6
|
+
* Operations for managing webhook subscriptions
|
|
7
|
+
*/
|
|
4
8
|
export declare class Webhooks extends APIResource {
|
|
5
9
|
/**
|
|
6
|
-
* Add new webhooks to
|
|
7
|
-
* list.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* const webhook = await client.webhooks.create({
|
|
12
|
-
* webhooks: [
|
|
13
|
-
* 'https://example.com/new-webhook',
|
|
14
|
-
* {
|
|
15
|
-
* url: 'https://example.com/webhook-with-secret',
|
|
16
|
-
* secret: 'my-webhook-secret',
|
|
17
|
-
* },
|
|
18
|
-
* ],
|
|
19
|
-
* globalSecret: 'optional-global-secret',
|
|
20
|
-
* type: 'receive',
|
|
21
|
-
* });
|
|
22
|
-
* ```
|
|
10
|
+
* Add new webhooks to the account. Webhooks are appended to existing ones.
|
|
23
11
|
*/
|
|
24
12
|
create(body: WebhookCreateParams, options?: RequestOptions): APIPromise<WebhookCreateResponse>;
|
|
25
13
|
/**
|
|
26
|
-
* Replace all webhooks for
|
|
27
|
-
* existing webhook configuration.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```ts
|
|
31
|
-
* const webhook = await client.webhooks.update({
|
|
32
|
-
* webhooks: {
|
|
33
|
-
* receive: [
|
|
34
|
-
* 'https://example.com/webhook1',
|
|
35
|
-
* {
|
|
36
|
-
* url: 'https://example.com/webhook2',
|
|
37
|
-
* secret: 'webhook-secret',
|
|
38
|
-
* },
|
|
39
|
-
* ],
|
|
40
|
-
* call_log: ['https://example.com/call-webhook'],
|
|
41
|
-
* contact_created: [
|
|
42
|
-
* 'https://example.com/contact-webhook',
|
|
43
|
-
* ],
|
|
44
|
-
* globalSecret: 'my-global-secret',
|
|
45
|
-
* },
|
|
46
|
-
* });
|
|
47
|
-
* ```
|
|
14
|
+
* Replace all webhooks for the account. This overwrites existing webhooks.
|
|
48
15
|
*/
|
|
49
16
|
update(body: WebhookUpdateParams, options?: RequestOptions): APIPromise<WebhookUpdateResponse>;
|
|
50
17
|
/**
|
|
51
|
-
* Get all webhooks configured for
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```ts
|
|
55
|
-
* const webhooks = await client.webhooks.list();
|
|
56
|
-
* ```
|
|
18
|
+
* Get all webhooks configured for the authenticated account
|
|
57
19
|
*/
|
|
58
20
|
list(options?: RequestOptions): APIPromise<WebhookListResponse>;
|
|
59
21
|
/**
|
|
60
|
-
* Delete specific webhooks from
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
* ```ts
|
|
64
|
-
* const webhook = await client.webhooks.delete({
|
|
65
|
-
* webhooks: ['https://example.com'],
|
|
66
|
-
* });
|
|
67
|
-
* ```
|
|
22
|
+
* Delete specific webhooks from the account
|
|
68
23
|
*/
|
|
69
24
|
delete(body: WebhookDeleteParams, options?: RequestOptions): APIPromise<WebhookDeleteResponse>;
|
|
70
25
|
}
|
|
71
26
|
export interface WebhookConfiguration {
|
|
72
27
|
/**
|
|
73
|
-
*
|
|
28
|
+
* Webhook endpoint URL for receiving callbacks
|
|
74
29
|
*/
|
|
75
|
-
|
|
30
|
+
url: string;
|
|
76
31
|
/**
|
|
77
|
-
*
|
|
78
|
-
*/
|
|
79
|
-
contact_created?: Array<string>;
|
|
80
|
-
/**
|
|
81
|
-
* Global secret applied to all webhooks
|
|
82
|
-
*/
|
|
83
|
-
globalSecret?: string;
|
|
84
|
-
/**
|
|
85
|
-
* Webhooks for line assignment
|
|
86
|
-
*/
|
|
87
|
-
line_assigned?: Array<string | WebhookConfiguration.WebhookObject>;
|
|
88
|
-
/**
|
|
89
|
-
* Webhooks for blocked lines
|
|
90
|
-
*/
|
|
91
|
-
line_blocked?: Array<string | WebhookConfiguration.WebhookObject>;
|
|
92
|
-
/**
|
|
93
|
-
* Webhooks for outbound messages
|
|
94
|
-
*/
|
|
95
|
-
outbound?: Array<string | WebhookConfiguration.WebhookObject>;
|
|
96
|
-
/**
|
|
97
|
-
* Webhooks for inbound messages
|
|
98
|
-
*/
|
|
99
|
-
receive?: Array<string | WebhookConfiguration.WebhookObject>;
|
|
100
|
-
/**
|
|
101
|
-
* Legacy secret field
|
|
32
|
+
* Secret for webhook signature verification
|
|
102
33
|
*/
|
|
103
34
|
secret?: string;
|
|
104
35
|
}
|
|
105
|
-
export
|
|
106
|
-
|
|
36
|
+
export interface WebhookCreateResponse {
|
|
37
|
+
message?: string;
|
|
38
|
+
status?: string;
|
|
39
|
+
webhooks?: WebhookCreateResponse.Webhooks;
|
|
40
|
+
}
|
|
41
|
+
export declare namespace WebhookCreateResponse {
|
|
42
|
+
interface Webhooks {
|
|
107
43
|
/**
|
|
108
|
-
*
|
|
44
|
+
* Webhooks for call log events
|
|
109
45
|
*/
|
|
110
|
-
|
|
46
|
+
call_log?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
111
47
|
/**
|
|
112
|
-
*
|
|
48
|
+
* Webhooks for contact created events (URL strings only)
|
|
113
49
|
*/
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
interface WebhookObject {
|
|
50
|
+
contact_created?: Array<string>;
|
|
117
51
|
/**
|
|
118
|
-
*
|
|
52
|
+
* Global secret applied to all webhooks
|
|
119
53
|
*/
|
|
120
|
-
|
|
54
|
+
globalSecret?: string;
|
|
121
55
|
/**
|
|
122
|
-
*
|
|
56
|
+
* Webhooks for line assigned events
|
|
123
57
|
*/
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
interface WebhookObject {
|
|
58
|
+
line_assigned?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
127
59
|
/**
|
|
128
|
-
*
|
|
60
|
+
* Webhooks for line blocked events
|
|
129
61
|
*/
|
|
130
|
-
|
|
62
|
+
line_blocked?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
131
63
|
/**
|
|
132
|
-
*
|
|
64
|
+
* Webhooks for outbound message status updates
|
|
133
65
|
*/
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
interface WebhookObject {
|
|
66
|
+
outbound?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
137
67
|
/**
|
|
138
|
-
*
|
|
68
|
+
* Webhooks for inbound message events
|
|
139
69
|
*/
|
|
140
|
-
|
|
70
|
+
receive?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
141
71
|
/**
|
|
142
|
-
*
|
|
72
|
+
* Webhooks for typing indicator events
|
|
143
73
|
*/
|
|
144
|
-
|
|
74
|
+
typing_indicator?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
145
75
|
}
|
|
146
|
-
|
|
76
|
+
}
|
|
77
|
+
export interface WebhookUpdateResponse {
|
|
78
|
+
message?: string;
|
|
79
|
+
status?: string;
|
|
80
|
+
webhooks?: WebhookUpdateResponse.Webhooks;
|
|
81
|
+
}
|
|
82
|
+
export declare namespace WebhookUpdateResponse {
|
|
83
|
+
interface Webhooks {
|
|
84
|
+
/**
|
|
85
|
+
* Webhooks for call log events
|
|
86
|
+
*/
|
|
87
|
+
call_log?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
88
|
+
/**
|
|
89
|
+
* Webhooks for contact created events (URL strings only)
|
|
90
|
+
*/
|
|
91
|
+
contact_created?: Array<string>;
|
|
92
|
+
/**
|
|
93
|
+
* Global secret applied to all webhooks
|
|
94
|
+
*/
|
|
95
|
+
globalSecret?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Webhooks for line assigned events
|
|
98
|
+
*/
|
|
99
|
+
line_assigned?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
100
|
+
/**
|
|
101
|
+
* Webhooks for line blocked events
|
|
102
|
+
*/
|
|
103
|
+
line_blocked?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
104
|
+
/**
|
|
105
|
+
* Webhooks for outbound message status updates
|
|
106
|
+
*/
|
|
107
|
+
outbound?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
147
108
|
/**
|
|
148
|
-
*
|
|
109
|
+
* Webhooks for inbound message events
|
|
149
110
|
*/
|
|
150
|
-
|
|
111
|
+
receive?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
151
112
|
/**
|
|
152
|
-
*
|
|
113
|
+
* Webhooks for typing indicator events
|
|
153
114
|
*/
|
|
154
|
-
|
|
115
|
+
typing_indicator?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
155
116
|
}
|
|
156
117
|
}
|
|
157
|
-
export interface WebhookCreateResponse {
|
|
158
|
-
status: 'OK' | 'ERROR';
|
|
159
|
-
message?: string;
|
|
160
|
-
/**
|
|
161
|
-
* Updated webhook configration (partial)
|
|
162
|
-
*/
|
|
163
|
-
webhooks?: WebhookConfiguration;
|
|
164
|
-
}
|
|
165
|
-
export interface WebhookUpdateResponse {
|
|
166
|
-
status: 'OK' | 'ERROR';
|
|
167
|
-
message?: string;
|
|
168
|
-
/**
|
|
169
|
-
* Updated webhook configration (partial)
|
|
170
|
-
*/
|
|
171
|
-
webhooks?: WebhookConfiguration;
|
|
172
|
-
}
|
|
173
118
|
export interface WebhookListResponse {
|
|
174
|
-
status
|
|
175
|
-
|
|
176
|
-
|
|
119
|
+
status?: string;
|
|
120
|
+
webhooks?: WebhookListResponse.Webhooks;
|
|
121
|
+
}
|
|
122
|
+
export declare namespace WebhookListResponse {
|
|
123
|
+
interface Webhooks {
|
|
124
|
+
/**
|
|
125
|
+
* Webhooks for call log events
|
|
126
|
+
*/
|
|
127
|
+
call_log?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
128
|
+
/**
|
|
129
|
+
* Webhooks for contact created events (URL strings only)
|
|
130
|
+
*/
|
|
131
|
+
contact_created?: Array<string>;
|
|
132
|
+
/**
|
|
133
|
+
* Global secret applied to all webhooks
|
|
134
|
+
*/
|
|
135
|
+
globalSecret?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Webhooks for line assigned events
|
|
138
|
+
*/
|
|
139
|
+
line_assigned?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
140
|
+
/**
|
|
141
|
+
* Webhooks for line blocked events
|
|
142
|
+
*/
|
|
143
|
+
line_blocked?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
144
|
+
/**
|
|
145
|
+
* Webhooks for outbound message status updates
|
|
146
|
+
*/
|
|
147
|
+
outbound?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
148
|
+
/**
|
|
149
|
+
* Webhooks for inbound message events
|
|
150
|
+
*/
|
|
151
|
+
receive?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
152
|
+
/**
|
|
153
|
+
* Webhooks for typing indicator events
|
|
154
|
+
*/
|
|
155
|
+
typing_indicator?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
156
|
+
}
|
|
177
157
|
}
|
|
178
158
|
export interface WebhookDeleteResponse {
|
|
179
|
-
status: 'OK' | 'ERROR';
|
|
180
159
|
message?: string;
|
|
160
|
+
status?: string;
|
|
181
161
|
}
|
|
182
162
|
export interface WebhookCreateParams {
|
|
183
163
|
/**
|
|
184
|
-
* Array of webhook URLs or webhook objects
|
|
164
|
+
* Array of webhook URLs or webhook objects
|
|
185
165
|
*/
|
|
186
|
-
webhooks: Array<string |
|
|
166
|
+
webhooks: Array<string | WebhookConfiguration>;
|
|
187
167
|
/**
|
|
188
|
-
*
|
|
168
|
+
* Global secret for webhook signature verification
|
|
189
169
|
*/
|
|
190
170
|
globalSecret?: string;
|
|
191
171
|
/**
|
|
192
|
-
*
|
|
172
|
+
* Type of webhook to add
|
|
193
173
|
*/
|
|
194
|
-
type?: 'receive' | '
|
|
174
|
+
type?: 'receive' | 'line_blocked' | 'line_assigned' | 'outbound' | 'typing_indicator' | 'call_log' | 'contact_created';
|
|
175
|
+
}
|
|
176
|
+
export interface WebhookUpdateParams {
|
|
177
|
+
webhooks: WebhookUpdateParams.Webhooks;
|
|
195
178
|
}
|
|
196
|
-
export declare namespace
|
|
197
|
-
interface
|
|
179
|
+
export declare namespace WebhookUpdateParams {
|
|
180
|
+
interface Webhooks {
|
|
181
|
+
/**
|
|
182
|
+
* Webhooks for call log events
|
|
183
|
+
*/
|
|
184
|
+
call_log?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
185
|
+
/**
|
|
186
|
+
* Webhooks for contact created events (URL strings only)
|
|
187
|
+
*/
|
|
188
|
+
contact_created?: Array<string>;
|
|
198
189
|
/**
|
|
199
|
-
*
|
|
190
|
+
* Global secret applied to all webhooks
|
|
200
191
|
*/
|
|
201
|
-
|
|
192
|
+
globalSecret?: string;
|
|
202
193
|
/**
|
|
203
|
-
*
|
|
194
|
+
* Webhooks for line assigned events
|
|
204
195
|
*/
|
|
205
|
-
|
|
196
|
+
line_assigned?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
197
|
+
/**
|
|
198
|
+
* Webhooks for line blocked events
|
|
199
|
+
*/
|
|
200
|
+
line_blocked?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
201
|
+
/**
|
|
202
|
+
* Webhooks for outbound message status updates
|
|
203
|
+
*/
|
|
204
|
+
outbound?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
205
|
+
/**
|
|
206
|
+
* Webhooks for inbound message events
|
|
207
|
+
*/
|
|
208
|
+
receive?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
209
|
+
/**
|
|
210
|
+
* Webhooks for typing indicator events
|
|
211
|
+
*/
|
|
212
|
+
typing_indicator?: Array<string | WebhooksAPI.WebhookConfiguration>;
|
|
206
213
|
}
|
|
207
214
|
}
|
|
208
|
-
export interface WebhookUpdateParams {
|
|
209
|
-
webhooks: WebhookConfiguration;
|
|
210
|
-
}
|
|
211
215
|
export interface WebhookDeleteParams {
|
|
212
216
|
/**
|
|
213
217
|
* Array of webhook URLs to delete
|
|
214
218
|
*/
|
|
215
219
|
webhooks: Array<string>;
|
|
216
220
|
/**
|
|
217
|
-
*
|
|
221
|
+
* Type of webhook to delete from
|
|
218
222
|
*/
|
|
219
|
-
type?: 'receive' | '
|
|
223
|
+
type?: 'receive' | 'line_blocked' | 'line_assigned' | 'outbound' | 'typing_indicator' | 'call_log' | 'contact_created';
|
|
220
224
|
}
|
|
221
225
|
export declare namespace Webhooks {
|
|
222
226
|
export { type WebhookConfiguration as WebhookConfiguration, type WebhookCreateResponse as WebhookCreateResponse, type WebhookUpdateResponse as WebhookUpdateResponse, type WebhookListResponse as WebhookListResponse, type WebhookDeleteResponse as WebhookDeleteResponse, type WebhookCreateParams as WebhookCreateParams, type WebhookUpdateParams as WebhookUpdateParams, type WebhookDeleteParams as WebhookDeleteParams, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,QAAS,SAAQ,WAAW;IACvC
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;GAEG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAI9F;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAI9F;;OAEG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,mBAAmB,CAAC;IAI/D;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;CAG/F;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,QAAQ,CAAC,EAAE,qBAAqB,CAAC,QAAQ,CAAC;CAC3C;AAED,yBAAiB,qBAAqB,CAAC;IACrC,UAAiB,QAAQ;QACvB;;WAEG;QACH,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC,o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,CAAC,EACD,SAAS,GACT,cAAc,GACd,eAAe,GACf,UAAU,GACV,kBAAkB,GAClB,UAAU,GACV,iBAAiB,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
package/resources/webhooks.js
CHANGED
|
@@ -3,79 +3,33 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Webhooks = void 0;
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
|
+
/**
|
|
7
|
+
* Operations for managing webhook subscriptions
|
|
8
|
+
*/
|
|
6
9
|
class Webhooks extends resource_1.APIResource {
|
|
7
10
|
/**
|
|
8
|
-
* Add new webhooks to
|
|
9
|
-
* list.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* const webhook = await client.webhooks.create({
|
|
14
|
-
* webhooks: [
|
|
15
|
-
* 'https://example.com/new-webhook',
|
|
16
|
-
* {
|
|
17
|
-
* url: 'https://example.com/webhook-with-secret',
|
|
18
|
-
* secret: 'my-webhook-secret',
|
|
19
|
-
* },
|
|
20
|
-
* ],
|
|
21
|
-
* globalSecret: 'optional-global-secret',
|
|
22
|
-
* type: 'receive',
|
|
23
|
-
* });
|
|
24
|
-
* ```
|
|
11
|
+
* Add new webhooks to the account. Webhooks are appended to existing ones.
|
|
25
12
|
*/
|
|
26
13
|
create(body, options) {
|
|
27
|
-
return this._client.post('/api/
|
|
14
|
+
return this._client.post('/api/account/webhooks', { body, ...options });
|
|
28
15
|
}
|
|
29
16
|
/**
|
|
30
|
-
* Replace all webhooks for
|
|
31
|
-
* existing webhook configuration.
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```ts
|
|
35
|
-
* const webhook = await client.webhooks.update({
|
|
36
|
-
* webhooks: {
|
|
37
|
-
* receive: [
|
|
38
|
-
* 'https://example.com/webhook1',
|
|
39
|
-
* {
|
|
40
|
-
* url: 'https://example.com/webhook2',
|
|
41
|
-
* secret: 'webhook-secret',
|
|
42
|
-
* },
|
|
43
|
-
* ],
|
|
44
|
-
* call_log: ['https://example.com/call-webhook'],
|
|
45
|
-
* contact_created: [
|
|
46
|
-
* 'https://example.com/contact-webhook',
|
|
47
|
-
* ],
|
|
48
|
-
* globalSecret: 'my-global-secret',
|
|
49
|
-
* },
|
|
50
|
-
* });
|
|
51
|
-
* ```
|
|
17
|
+
* Replace all webhooks for the account. This overwrites existing webhooks.
|
|
52
18
|
*/
|
|
53
19
|
update(body, options) {
|
|
54
|
-
return this._client.put('/api/
|
|
20
|
+
return this._client.put('/api/account/webhooks', { body, ...options });
|
|
55
21
|
}
|
|
56
22
|
/**
|
|
57
|
-
* Get all webhooks configured for
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* ```ts
|
|
61
|
-
* const webhooks = await client.webhooks.list();
|
|
62
|
-
* ```
|
|
23
|
+
* Get all webhooks configured for the authenticated account
|
|
63
24
|
*/
|
|
64
25
|
list(options) {
|
|
65
|
-
return this._client.get('/api/
|
|
26
|
+
return this._client.get('/api/account/webhooks', options);
|
|
66
27
|
}
|
|
67
28
|
/**
|
|
68
|
-
* Delete specific webhooks from
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* ```ts
|
|
72
|
-
* const webhook = await client.webhooks.delete({
|
|
73
|
-
* webhooks: ['https://example.com'],
|
|
74
|
-
* });
|
|
75
|
-
* ```
|
|
29
|
+
* Delete specific webhooks from the account
|
|
76
30
|
*/
|
|
77
31
|
delete(body, options) {
|
|
78
|
-
return this._client.delete('/api/
|
|
32
|
+
return this._client.delete('/api/account/webhooks', { body, ...options });
|
|
79
33
|
}
|
|
80
34
|
}
|
|
81
35
|
exports.Webhooks = Webhooks;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;
|
|
1
|
+
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAK/C;;GAEG;AACH,MAAa,QAAS,SAAQ,sBAAW;IACvC;;OAEG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;CACF;AA5BD,4BA4BC"}
|
package/resources/webhooks.mjs
CHANGED
|
@@ -1,78 +1,32 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Operations for managing webhook subscriptions
|
|
5
|
+
*/
|
|
3
6
|
export class Webhooks extends APIResource {
|
|
4
7
|
/**
|
|
5
|
-
* Add new webhooks to
|
|
6
|
-
* list.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```ts
|
|
10
|
-
* const webhook = await client.webhooks.create({
|
|
11
|
-
* webhooks: [
|
|
12
|
-
* 'https://example.com/new-webhook',
|
|
13
|
-
* {
|
|
14
|
-
* url: 'https://example.com/webhook-with-secret',
|
|
15
|
-
* secret: 'my-webhook-secret',
|
|
16
|
-
* },
|
|
17
|
-
* ],
|
|
18
|
-
* globalSecret: 'optional-global-secret',
|
|
19
|
-
* type: 'receive',
|
|
20
|
-
* });
|
|
21
|
-
* ```
|
|
8
|
+
* Add new webhooks to the account. Webhooks are appended to existing ones.
|
|
22
9
|
*/
|
|
23
10
|
create(body, options) {
|
|
24
|
-
return this._client.post('/api/
|
|
11
|
+
return this._client.post('/api/account/webhooks', { body, ...options });
|
|
25
12
|
}
|
|
26
13
|
/**
|
|
27
|
-
* Replace all webhooks for
|
|
28
|
-
* existing webhook configuration.
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```ts
|
|
32
|
-
* const webhook = await client.webhooks.update({
|
|
33
|
-
* webhooks: {
|
|
34
|
-
* receive: [
|
|
35
|
-
* 'https://example.com/webhook1',
|
|
36
|
-
* {
|
|
37
|
-
* url: 'https://example.com/webhook2',
|
|
38
|
-
* secret: 'webhook-secret',
|
|
39
|
-
* },
|
|
40
|
-
* ],
|
|
41
|
-
* call_log: ['https://example.com/call-webhook'],
|
|
42
|
-
* contact_created: [
|
|
43
|
-
* 'https://example.com/contact-webhook',
|
|
44
|
-
* ],
|
|
45
|
-
* globalSecret: 'my-global-secret',
|
|
46
|
-
* },
|
|
47
|
-
* });
|
|
48
|
-
* ```
|
|
14
|
+
* Replace all webhooks for the account. This overwrites existing webhooks.
|
|
49
15
|
*/
|
|
50
16
|
update(body, options) {
|
|
51
|
-
return this._client.put('/api/
|
|
17
|
+
return this._client.put('/api/account/webhooks', { body, ...options });
|
|
52
18
|
}
|
|
53
19
|
/**
|
|
54
|
-
* Get all webhooks configured for
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* ```ts
|
|
58
|
-
* const webhooks = await client.webhooks.list();
|
|
59
|
-
* ```
|
|
20
|
+
* Get all webhooks configured for the authenticated account
|
|
60
21
|
*/
|
|
61
22
|
list(options) {
|
|
62
|
-
return this._client.get('/api/
|
|
23
|
+
return this._client.get('/api/account/webhooks', options);
|
|
63
24
|
}
|
|
64
25
|
/**
|
|
65
|
-
* Delete specific webhooks from
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* ```ts
|
|
69
|
-
* const webhook = await client.webhooks.delete({
|
|
70
|
-
* webhooks: ['https://example.com'],
|
|
71
|
-
* });
|
|
72
|
-
* ```
|
|
26
|
+
* Delete specific webhooks from the account
|
|
73
27
|
*/
|
|
74
28
|
delete(body, options) {
|
|
75
|
-
return this._client.delete('/api/
|
|
29
|
+
return this._client.delete('/api/account/webhooks', { body, ...options });
|
|
76
30
|
}
|
|
77
31
|
}
|
|
78
32
|
//# sourceMappingURL=webhooks.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.mjs","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"webhooks.mjs","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAKtB;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;CACF"}
|