@surgeapi/node 0.36.0 → 0.38.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 +47 -0
- package/README.md +8 -8
- package/client.d.mts +7 -7
- package/client.d.mts.map +1 -1
- package/client.d.ts +7 -7
- package/client.d.ts.map +1 -1
- package/client.js +15 -7
- package/client.js.map +1 -1
- package/client.mjs +16 -8
- package/client.mjs.map +1 -1
- package/internal/tslib.js +22 -22
- package/internal/utils/query.d.mts +2 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +10 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -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 +7 -1
- package/resources/blasts.d.mts +3 -2
- package/resources/blasts.d.mts.map +1 -1
- package/resources/blasts.d.ts +3 -2
- package/resources/blasts.d.ts.map +1 -1
- package/resources/campaigns.d.mts +20 -2
- package/resources/campaigns.d.mts.map +1 -1
- package/resources/campaigns.d.ts +20 -2
- package/resources/campaigns.d.ts.map +1 -1
- package/resources/campaigns.js +20 -0
- package/resources/campaigns.js.map +1 -1
- package/resources/campaigns.mjs +20 -0
- package/resources/campaigns.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 +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/messages.d.mts +1 -1
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +1 -1
- package/resources/messages.d.ts.map +1 -1
- package/resources/phone-numbers.d.mts +4 -0
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +4 -0
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/recordings.d.mts +58 -1
- package/resources/recordings.d.mts.map +1 -1
- package/resources/recordings.d.ts +58 -1
- package/resources/recordings.d.ts.map +1 -1
- package/resources/recordings.js +14 -0
- package/resources/recordings.js.map +1 -1
- package/resources/recordings.mjs +14 -0
- package/resources/recordings.mjs.map +1 -1
- package/resources/webhooks.d.mts +68 -2
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +68 -2
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +36 -13
- package/src/internal/utils/query.ts +7 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/blasts.ts +3 -2
- package/src/resources/campaigns.ts +36 -2
- package/src/resources/index.ts +9 -2
- package/src/resources/messages.ts +1 -1
- package/src/resources/phone-numbers.ts +5 -0
- package/src/resources/recordings.ts +81 -1
- package/src/resources/webhooks.ts +72 -0
- 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/src/client.ts
CHANGED
|
@@ -11,7 +11,7 @@ import type { APIResponseProps } from './internal/parse';
|
|
|
11
11
|
import { getPlatformHeaders } from './internal/detect-platform';
|
|
12
12
|
import * as Shims from './internal/shims';
|
|
13
13
|
import * as Opts from './internal/request-options';
|
|
14
|
-
import
|
|
14
|
+
import { stringifyQuery } from './internal/utils/query';
|
|
15
15
|
import { VERSION } from './version';
|
|
16
16
|
import * as Errors from './core/error';
|
|
17
17
|
import * as Pagination from './core/pagination';
|
|
@@ -29,7 +29,13 @@ import {
|
|
|
29
29
|
Organization,
|
|
30
30
|
} from './resources/accounts';
|
|
31
31
|
import { Blast, BlastCreateParams, Blasts } from './resources/blasts';
|
|
32
|
-
import {
|
|
32
|
+
import {
|
|
33
|
+
Campaign,
|
|
34
|
+
CampaignCreateParams,
|
|
35
|
+
CampaignListParams,
|
|
36
|
+
Campaigns,
|
|
37
|
+
CampaignsCursor,
|
|
38
|
+
} from './resources/campaigns';
|
|
33
39
|
import {
|
|
34
40
|
Contact,
|
|
35
41
|
ContactCreateParams,
|
|
@@ -52,7 +58,7 @@ import {
|
|
|
52
58
|
PhoneNumbers,
|
|
53
59
|
PhoneNumbersCursor,
|
|
54
60
|
} from './resources/phone-numbers';
|
|
55
|
-
import { RecordingGetFileResponse, Recordings } from './resources/recordings';
|
|
61
|
+
import { RecordingDeleteResponse, RecordingGetFileResponse, Recordings } from './resources/recordings';
|
|
56
62
|
import {
|
|
57
63
|
User,
|
|
58
64
|
UserCreateParams,
|
|
@@ -79,6 +85,7 @@ import {
|
|
|
79
85
|
MessageFailedWebhookEvent,
|
|
80
86
|
MessageReceivedWebhookEvent,
|
|
81
87
|
MessageSentWebhookEvent,
|
|
88
|
+
PhoneNumberAttachedToCampaignWebhookEvent,
|
|
82
89
|
RecordingCompletedWebhookEvent,
|
|
83
90
|
UnwrapWebhookEvent,
|
|
84
91
|
VoicemailReceivedWebhookEvent,
|
|
@@ -288,8 +295,8 @@ export class Surge {
|
|
|
288
295
|
return buildHeaders([{ Authorization: `Bearer ${this.apiKey}` }]);
|
|
289
296
|
}
|
|
290
297
|
|
|
291
|
-
protected stringifyQuery(query: Record<string, unknown>): string {
|
|
292
|
-
return
|
|
298
|
+
protected stringifyQuery(query: object | Record<string, unknown>): string {
|
|
299
|
+
return stringifyQuery(query);
|
|
293
300
|
}
|
|
294
301
|
|
|
295
302
|
private getUserAgent(): string {
|
|
@@ -321,12 +328,13 @@ export class Surge {
|
|
|
321
328
|
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
|
|
322
329
|
|
|
323
330
|
const defaultQuery = this.defaultQuery();
|
|
324
|
-
|
|
325
|
-
|
|
331
|
+
const pathQuery = Object.fromEntries(url.searchParams);
|
|
332
|
+
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
|
|
333
|
+
query = { ...pathQuery, ...defaultQuery, ...query };
|
|
326
334
|
}
|
|
327
335
|
|
|
328
336
|
if (typeof query === 'object' && query && !Array.isArray(query)) {
|
|
329
|
-
url.search = this.stringifyQuery(query
|
|
337
|
+
url.search = this.stringifyQuery(query);
|
|
330
338
|
}
|
|
331
339
|
|
|
332
340
|
return url.toString();
|
|
@@ -510,7 +518,7 @@ export class Surge {
|
|
|
510
518
|
loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
|
|
511
519
|
|
|
512
520
|
const errText = await response.text().catch((err: any) => castToError(err).message);
|
|
513
|
-
const errJSON = safeJSON(errText);
|
|
521
|
+
const errJSON = safeJSON(errText) as any;
|
|
514
522
|
const errMessage = errJSON ? undefined : errText;
|
|
515
523
|
|
|
516
524
|
loggerFor(this).debug(
|
|
@@ -655,9 +663,9 @@ export class Surge {
|
|
|
655
663
|
}
|
|
656
664
|
}
|
|
657
665
|
|
|
658
|
-
// If the API asks us to wait a certain amount of time
|
|
659
|
-
//
|
|
660
|
-
if (
|
|
666
|
+
// If the API asks us to wait a certain amount of time, just do what it
|
|
667
|
+
// says, but otherwise calculate a default
|
|
668
|
+
if (timeoutMillis === undefined) {
|
|
661
669
|
const maxRetries = options.maxRetries ?? this.maxRetries;
|
|
662
670
|
timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
|
|
663
671
|
}
|
|
@@ -783,6 +791,14 @@ export class Surge {
|
|
|
783
791
|
(Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
|
|
784
792
|
) {
|
|
785
793
|
return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
|
|
794
|
+
} else if (
|
|
795
|
+
typeof body === 'object' &&
|
|
796
|
+
headers.values.get('content-type') === 'application/x-www-form-urlencoded'
|
|
797
|
+
) {
|
|
798
|
+
return {
|
|
799
|
+
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
|
|
800
|
+
body: this.stringifyQuery(body),
|
|
801
|
+
};
|
|
786
802
|
} else {
|
|
787
803
|
return this.#encoder({ body, headers });
|
|
788
804
|
}
|
|
@@ -851,7 +867,9 @@ export declare namespace Surge {
|
|
|
851
867
|
export {
|
|
852
868
|
Campaigns as Campaigns,
|
|
853
869
|
type Campaign as Campaign,
|
|
870
|
+
type CampaignsCursor as CampaignsCursor,
|
|
854
871
|
type CampaignCreateParams as CampaignCreateParams,
|
|
872
|
+
type CampaignListParams as CampaignListParams,
|
|
855
873
|
};
|
|
856
874
|
|
|
857
875
|
export {
|
|
@@ -879,7 +897,11 @@ export declare namespace Surge {
|
|
|
879
897
|
type PhoneNumberPurchaseParams as PhoneNumberPurchaseParams,
|
|
880
898
|
};
|
|
881
899
|
|
|
882
|
-
export {
|
|
900
|
+
export {
|
|
901
|
+
Recordings as Recordings,
|
|
902
|
+
type RecordingDeleteResponse as RecordingDeleteResponse,
|
|
903
|
+
type RecordingGetFileResponse as RecordingGetFileResponse,
|
|
904
|
+
};
|
|
883
905
|
|
|
884
906
|
export {
|
|
885
907
|
Users as Users,
|
|
@@ -910,6 +932,7 @@ export declare namespace Surge {
|
|
|
910
932
|
type MessageFailedWebhookEvent as MessageFailedWebhookEvent,
|
|
911
933
|
type MessageReceivedWebhookEvent as MessageReceivedWebhookEvent,
|
|
912
934
|
type MessageSentWebhookEvent as MessageSentWebhookEvent,
|
|
935
|
+
type PhoneNumberAttachedToCampaignWebhookEvent as PhoneNumberAttachedToCampaignWebhookEvent,
|
|
913
936
|
type RecordingCompletedWebhookEvent as RecordingCompletedWebhookEvent,
|
|
914
937
|
type VoicemailReceivedWebhookEvent as VoicemailReceivedWebhookEvent,
|
|
915
938
|
type UnwrapWebhookEvent as UnwrapWebhookEvent,
|
package/src/internal/utils.ts
CHANGED
package/src/resources/blasts.ts
CHANGED
|
@@ -83,7 +83,8 @@ export interface BlastCreateParams {
|
|
|
83
83
|
name?: string;
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
|
-
* @deprecated Use `to` to specify
|
|
86
|
+
* @deprecated Use `to` with audience IDs (`aud_...`) to specify audience
|
|
87
|
+
* recipients instead.
|
|
87
88
|
*/
|
|
88
89
|
segments?: Array<string>;
|
|
89
90
|
|
|
@@ -94,7 +95,7 @@ export interface BlastCreateParams {
|
|
|
94
95
|
|
|
95
96
|
/**
|
|
96
97
|
* List of recipients to whom the blast should be sent. This can be a combination
|
|
97
|
-
* of contact IDs,
|
|
98
|
+
* of contact IDs, audience IDs, and phone numbers.
|
|
98
99
|
*/
|
|
99
100
|
to?: Array<string>;
|
|
100
101
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
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
|
|
|
@@ -51,8 +52,34 @@ export class Campaigns extends APIResource {
|
|
|
51
52
|
retrieve(id: string, options?: RequestOptions): APIPromise<Campaign> {
|
|
52
53
|
return this._client.get(path`/campaigns/${id}`, options);
|
|
53
54
|
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* List all campaigns for an account with cursor-based pagination.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* // Automatically fetches more pages as needed.
|
|
62
|
+
* for await (const campaign of client.campaigns.list(
|
|
63
|
+
* 'acct_01j9a43avnfqzbjfch6pygv1td',
|
|
64
|
+
* )) {
|
|
65
|
+
* // ...
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
list(
|
|
70
|
+
accountID: string,
|
|
71
|
+
query: CampaignListParams | null | undefined = {},
|
|
72
|
+
options?: RequestOptions,
|
|
73
|
+
): PagePromise<CampaignsCursor, Campaign> {
|
|
74
|
+
return this._client.getAPIList(path`/accounts/${accountID}/campaigns`, Cursor<Campaign>, {
|
|
75
|
+
query,
|
|
76
|
+
...options,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
54
79
|
}
|
|
55
80
|
|
|
81
|
+
export type CampaignsCursor = Cursor<Campaign>;
|
|
82
|
+
|
|
56
83
|
/**
|
|
57
84
|
* A campaign represents the context in which one or more of your phone numbers
|
|
58
85
|
* communicates with your contacts. Consent and opt-outs are tied to the campaign.
|
|
@@ -111,7 +138,7 @@ export interface Campaign {
|
|
|
111
138
|
/**
|
|
112
139
|
* The current status of the campaign.
|
|
113
140
|
*/
|
|
114
|
-
status: 'active' | 'canceled' | 'created' | 'deactivated' | 'in_review' | '
|
|
141
|
+
status: 'active' | 'canceled' | 'created' | 'deactivated' | 'in_review' | 'rejected';
|
|
115
142
|
|
|
116
143
|
/**
|
|
117
144
|
* A list containing 1-5 types of messages that will be sent with this campaign.
|
|
@@ -318,6 +345,13 @@ export declare namespace CampaignCreateParams {
|
|
|
318
345
|
}
|
|
319
346
|
}
|
|
320
347
|
|
|
348
|
+
export interface CampaignListParams extends CursorParams {}
|
|
349
|
+
|
|
321
350
|
export declare namespace Campaigns {
|
|
322
|
-
export {
|
|
351
|
+
export {
|
|
352
|
+
type Campaign as Campaign,
|
|
353
|
+
type CampaignsCursor as CampaignsCursor,
|
|
354
|
+
type CampaignCreateParams as CampaignCreateParams,
|
|
355
|
+
type CampaignListParams as CampaignListParams,
|
|
356
|
+
};
|
|
323
357
|
}
|
package/src/resources/index.ts
CHANGED
|
@@ -11,7 +11,13 @@ export {
|
|
|
11
11
|
type AccountRetrieveStatusParams,
|
|
12
12
|
} from './accounts';
|
|
13
13
|
export { Blasts, type Blast, type BlastCreateParams } from './blasts';
|
|
14
|
-
export {
|
|
14
|
+
export {
|
|
15
|
+
Campaigns,
|
|
16
|
+
type Campaign,
|
|
17
|
+
type CampaignCreateParams,
|
|
18
|
+
type CampaignListParams,
|
|
19
|
+
type CampaignsCursor,
|
|
20
|
+
} from './campaigns';
|
|
15
21
|
export {
|
|
16
22
|
Contacts,
|
|
17
23
|
type Contact,
|
|
@@ -34,7 +40,7 @@ export {
|
|
|
34
40
|
type PhoneNumberPurchaseParams,
|
|
35
41
|
type PhoneNumbersCursor,
|
|
36
42
|
} from './phone-numbers';
|
|
37
|
-
export { Recordings, type RecordingGetFileResponse } from './recordings';
|
|
43
|
+
export { Recordings, type RecordingDeleteResponse, type RecordingGetFileResponse } from './recordings';
|
|
38
44
|
export {
|
|
39
45
|
Users,
|
|
40
46
|
type User,
|
|
@@ -62,6 +68,7 @@ export {
|
|
|
62
68
|
type MessageFailedWebhookEvent,
|
|
63
69
|
type MessageReceivedWebhookEvent,
|
|
64
70
|
type MessageSentWebhookEvent,
|
|
71
|
+
type PhoneNumberAttachedToCampaignWebhookEvent,
|
|
65
72
|
type RecordingCompletedWebhookEvent,
|
|
66
73
|
type VoicemailReceivedWebhookEvent,
|
|
67
74
|
type UnwrapWebhookEvent,
|
|
@@ -1,12 +1,28 @@
|
|
|
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 ContactsAPI from './contacts';
|
|
4
5
|
import * as Shared from './shared';
|
|
5
6
|
import { APIPromise } from '../core/api-promise';
|
|
6
7
|
import { RequestOptions } from '../internal/request-options';
|
|
7
8
|
import { path } from '../internal/utils/path';
|
|
8
9
|
|
|
9
10
|
export class Recordings extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Deletes a recording. The recording file will be removed from storage
|
|
13
|
+
* asynchronously.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const recording = await client.recordings.delete(
|
|
18
|
+
* 'rec_01kfyc9dgdec1avkgs7tng8htg',
|
|
19
|
+
* );
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
delete(id: string, options?: RequestOptions): APIPromise<RecordingDeleteResponse> {
|
|
23
|
+
return this._client.delete(path`/recordings/${id}`, options);
|
|
24
|
+
}
|
|
25
|
+
|
|
10
26
|
/**
|
|
11
27
|
* Redirects to a signed URL where the recording audio file can be downloaded. URL
|
|
12
28
|
* is short-lived, so redirect should be followed immediately.
|
|
@@ -23,6 +39,67 @@ export class Recordings extends APIResource {
|
|
|
23
39
|
}
|
|
24
40
|
}
|
|
25
41
|
|
|
42
|
+
/**
|
|
43
|
+
* A call recording
|
|
44
|
+
*/
|
|
45
|
+
export interface RecordingDeleteResponse {
|
|
46
|
+
/**
|
|
47
|
+
* The unique identifier for the recording
|
|
48
|
+
*/
|
|
49
|
+
id: string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The call that produced this recording
|
|
53
|
+
*/
|
|
54
|
+
call: RecordingDeleteResponse.Call;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The duration of the recording in seconds
|
|
58
|
+
*/
|
|
59
|
+
duration: number;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export namespace RecordingDeleteResponse {
|
|
63
|
+
/**
|
|
64
|
+
* The call that produced this recording
|
|
65
|
+
*/
|
|
66
|
+
export interface Call {
|
|
67
|
+
/**
|
|
68
|
+
* The unique identifier for the call
|
|
69
|
+
*/
|
|
70
|
+
id: string;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* A contact who has consented to receive messages
|
|
74
|
+
*/
|
|
75
|
+
contact: ContactsAPI.Contact;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The duration of the call in seconds
|
|
79
|
+
*/
|
|
80
|
+
duration: number;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* When the call was initiated
|
|
84
|
+
*/
|
|
85
|
+
initiated_at: string;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The status of the call
|
|
89
|
+
*/
|
|
90
|
+
status:
|
|
91
|
+
| 'busy'
|
|
92
|
+
| 'canceled'
|
|
93
|
+
| 'completed'
|
|
94
|
+
| 'failed'
|
|
95
|
+
| 'in_progress'
|
|
96
|
+
| 'missed'
|
|
97
|
+
| 'no_answer'
|
|
98
|
+
| 'queued'
|
|
99
|
+
| 'ringing';
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
26
103
|
/**
|
|
27
104
|
* An error response
|
|
28
105
|
*/
|
|
@@ -34,5 +111,8 @@ export interface RecordingGetFileResponse {
|
|
|
34
111
|
}
|
|
35
112
|
|
|
36
113
|
export declare namespace Recordings {
|
|
37
|
-
export {
|
|
114
|
+
export {
|
|
115
|
+
type RecordingDeleteResponse as RecordingDeleteResponse,
|
|
116
|
+
type RecordingGetFileResponse as RecordingGetFileResponse,
|
|
117
|
+
};
|
|
38
118
|
}
|
|
@@ -325,6 +325,11 @@ export namespace MessageDeliveredWebhookEvent {
|
|
|
325
325
|
*/
|
|
326
326
|
delivered_at: string;
|
|
327
327
|
|
|
328
|
+
/**
|
|
329
|
+
* Set of key-value pairs that will be stored with the object.
|
|
330
|
+
*/
|
|
331
|
+
metadata: { [key: string]: string };
|
|
332
|
+
|
|
328
333
|
/**
|
|
329
334
|
* Attachments included with the message
|
|
330
335
|
*/
|
|
@@ -429,6 +434,11 @@ export namespace MessageFailedWebhookEvent {
|
|
|
429
434
|
*/
|
|
430
435
|
failure_reason: string;
|
|
431
436
|
|
|
437
|
+
/**
|
|
438
|
+
* Set of key-value pairs that will be stored with the object.
|
|
439
|
+
*/
|
|
440
|
+
metadata: { [key: string]: string };
|
|
441
|
+
|
|
432
442
|
/**
|
|
433
443
|
* Attachments included with the message
|
|
434
444
|
*/
|
|
@@ -523,6 +533,11 @@ export namespace MessageReceivedWebhookEvent {
|
|
|
523
533
|
*/
|
|
524
534
|
conversation: Data.Conversation;
|
|
525
535
|
|
|
536
|
+
/**
|
|
537
|
+
* Set of key-value pairs that will be stored with the object.
|
|
538
|
+
*/
|
|
539
|
+
metadata: { [key: string]: string };
|
|
540
|
+
|
|
526
541
|
/**
|
|
527
542
|
* When the message was received
|
|
528
543
|
*/
|
|
@@ -622,6 +637,11 @@ export namespace MessageSentWebhookEvent {
|
|
|
622
637
|
*/
|
|
623
638
|
conversation: Data.Conversation;
|
|
624
639
|
|
|
640
|
+
/**
|
|
641
|
+
* Set of key-value pairs that will be stored with the object.
|
|
642
|
+
*/
|
|
643
|
+
metadata: { [key: string]: string };
|
|
644
|
+
|
|
625
645
|
/**
|
|
626
646
|
* When the message was sent
|
|
627
647
|
*/
|
|
@@ -679,6 +699,56 @@ export namespace MessageSentWebhookEvent {
|
|
|
679
699
|
}
|
|
680
700
|
}
|
|
681
701
|
|
|
702
|
+
export interface PhoneNumberAttachedToCampaignWebhookEvent {
|
|
703
|
+
/**
|
|
704
|
+
* The ID of the account in which this event occurred
|
|
705
|
+
*/
|
|
706
|
+
account_id: string;
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* The data associated with the event
|
|
710
|
+
*/
|
|
711
|
+
data: PhoneNumberAttachedToCampaignWebhookEvent.Data;
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* The timestamp when this event occurred, in ISO8601 format
|
|
715
|
+
*/
|
|
716
|
+
timestamp: string;
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* The type of the event. Always `phone_number.attached_to_campaign` for this
|
|
720
|
+
* event.
|
|
721
|
+
*/
|
|
722
|
+
type: 'phone_number.attached_to_campaign';
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
export namespace PhoneNumberAttachedToCampaignWebhookEvent {
|
|
726
|
+
/**
|
|
727
|
+
* The data associated with the event
|
|
728
|
+
*/
|
|
729
|
+
export interface Data {
|
|
730
|
+
/**
|
|
731
|
+
* The unique identifier for the phone number
|
|
732
|
+
*/
|
|
733
|
+
id: string;
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
* The unique identifier of the campaign this phone number is attached to
|
|
737
|
+
*/
|
|
738
|
+
campaign_id: string;
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* The phone number in E.164 format
|
|
742
|
+
*/
|
|
743
|
+
number: string;
|
|
744
|
+
|
|
745
|
+
/**
|
|
746
|
+
* Whether the phone number is local, toll-free, or short code
|
|
747
|
+
*/
|
|
748
|
+
type: 'local' | 'short_code' | 'toll_free';
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
|
|
682
752
|
export interface RecordingCompletedWebhookEvent {
|
|
683
753
|
/**
|
|
684
754
|
* The ID of the account in which this event occurred
|
|
@@ -865,6 +935,7 @@ export type UnwrapWebhookEvent =
|
|
|
865
935
|
| MessageFailedWebhookEvent
|
|
866
936
|
| MessageReceivedWebhookEvent
|
|
867
937
|
| MessageSentWebhookEvent
|
|
938
|
+
| PhoneNumberAttachedToCampaignWebhookEvent
|
|
868
939
|
| RecordingCompletedWebhookEvent
|
|
869
940
|
| VoicemailReceivedWebhookEvent;
|
|
870
941
|
|
|
@@ -880,6 +951,7 @@ export declare namespace Webhooks {
|
|
|
880
951
|
type MessageFailedWebhookEvent as MessageFailedWebhookEvent,
|
|
881
952
|
type MessageReceivedWebhookEvent as MessageReceivedWebhookEvent,
|
|
882
953
|
type MessageSentWebhookEvent as MessageSentWebhookEvent,
|
|
954
|
+
type PhoneNumberAttachedToCampaignWebhookEvent as PhoneNumberAttachedToCampaignWebhookEvent,
|
|
883
955
|
type RecordingCompletedWebhookEvent as RecordingCompletedWebhookEvent,
|
|
884
956
|
type VoicemailReceivedWebhookEvent as VoicemailReceivedWebhookEvent,
|
|
885
957
|
type UnwrapWebhookEvent as UnwrapWebhookEvent,
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.38.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.38.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.38.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.38.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|