@sentdm/sentdm 0.43.0 → 0.44.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 +7 -0
- package/package.json +1 -1
- package/resources/messages.d.mts +76 -8
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +76 -8
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +30 -8
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +30 -8
- package/resources/messages.mjs.map +1 -1
- package/src/resources/messages.ts +78 -8
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.44.0](https://github.com/sentdm/sent-dm-typescript/compare/v0.43.0...v0.44.0) (2026-10-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **api:** sync OpenAPI spec from production ([cc6f215](https://github.com/sentdm/sent-dm-typescript/commit/cc6f2150133ca8466690a6356013936495423815))
|
|
9
|
+
|
|
3
10
|
## [0.43.0](https://github.com/sentdm/sent-dm-typescript/compare/v0.42.0...v0.43.0) (2026-10-06)
|
|
4
11
|
|
|
5
12
|
|
package/package.json
CHANGED
package/resources/messages.d.mts
CHANGED
|
@@ -49,13 +49,27 @@ export declare class Messages extends APIResource {
|
|
|
49
49
|
* Sends a message to one or more recipients using a template. Supports
|
|
50
50
|
* multi-channel broadcast — when multiple channels are specified (e.g. ["sms",
|
|
51
51
|
* "whatsapp"]), a separate message is created for each (recipient, channel) pair.
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* message
|
|
52
|
+
* To choose which of your own numbers a send goes out from, use 'channels':
|
|
53
|
+
* {"sms": [{"from": ["+12125550000", "+14155550000"]}]}. Each channel holds a list
|
|
54
|
+
* of entries, each with 'from' and optionally 'country' and 'strategy'; 'country'
|
|
55
|
+
* and 'strategy' are stored but not acted on yet, so every entry's numbers apply
|
|
56
|
+
* to every recipient on that channel. Every number listed must be an active sender
|
|
57
|
+
* on your account. Like the other account-level preconditions below, that is
|
|
58
|
+
* checked per message rather than when the request is received: the request is
|
|
59
|
+
* still accepted with 202, and each affected message is reported as BLOCKED with
|
|
60
|
+
* error code BUSINESS_029 on GET /messages/{id} and the message.blocked webhook.
|
|
61
|
+
* Each channel's numbers restrict which numbers that channel may use; it does not
|
|
62
|
+
* choose channels — 'channel' does, and the two can be combined. With 'channel'
|
|
63
|
+
* left at auto-detect, a recipient best served by a channel you listed no numbers
|
|
64
|
+
* for still goes out on it. Where several of the listed numbers could serve a
|
|
65
|
+
* recipient, routing prefers the one whose area code matches theirs. Keys: sms,
|
|
66
|
+
* whatsapp, rcs, mms. Returns immediately with per-recipient message IDs for async
|
|
67
|
+
* tracking via webhooks or the GET /messages/{id} endpoint. Sends gated before any
|
|
68
|
+
* delivery attempt do not reject the request — an account-level precondition such
|
|
69
|
+
* as insufficient balance, a template not approved for sending, or free-form
|
|
70
|
+
* content with no open conversation with the contact. The send is accepted with
|
|
71
|
+
* 202 and the affected messages are reported as BLOCKED on GET /messages/{id} and
|
|
72
|
+
* the message.blocked webhook. To send later, set scheduled_at (ISO-8601 with an
|
|
59
73
|
* explicit UTC offset; a value without one is rejected) between 1 minute and 30
|
|
60
74
|
* days ahead: the response is a ScheduledSendMessageResponse (the same fields plus
|
|
61
75
|
* scheduled_at; status is still QUEUED), each message then moves to SCHEDULED, is
|
|
@@ -69,7 +83,15 @@ export declare class Messages extends APIResource {
|
|
|
69
83
|
*
|
|
70
84
|
* @example
|
|
71
85
|
* ```ts
|
|
72
|
-
* const response = await client.messages.send(
|
|
86
|
+
* const response = await client.messages.send({
|
|
87
|
+
* channel: ['sms', 'whatsapp'],
|
|
88
|
+
* template: {
|
|
89
|
+
* id: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
|
|
90
|
+
* name: 'order_confirmation',
|
|
91
|
+
* parameters: { name: 'John Doe', order_id: '12345' },
|
|
92
|
+
* },
|
|
93
|
+
* to: ['+14155551234', '+14155555678'],
|
|
94
|
+
* });
|
|
73
95
|
* ```
|
|
74
96
|
*/
|
|
75
97
|
send(params: MessageSendParams, options?: RequestOptions): APIPromise<MessageSendResponse>;
|
|
@@ -485,6 +507,29 @@ export interface MessageSendParams {
|
|
|
485
507
|
* ["sent"] (auto-detect) if omitted.
|
|
486
508
|
*/
|
|
487
509
|
channel?: Array<string> | null;
|
|
510
|
+
/**
|
|
511
|
+
* Body param: Which of your own numbers to send from, keyed by channel, each
|
|
512
|
+
* channel holding a list of entries: {"sms": [{"country": "US", "from":
|
|
513
|
+
* ["+12125550000", "+14155550000"]}, {"from": ["+447700800001"]}]}. Any real
|
|
514
|
+
* channel may be a key; sent, which is auto-detect rather than a channel, is
|
|
515
|
+
* rejected. country and strategy are accepted and stored but not acted on yet:
|
|
516
|
+
* every entry's numbers apply to every recipient on that channel.
|
|
517
|
+
*
|
|
518
|
+
* This does not choose channels — Channel does, and the two combine: "channel":
|
|
519
|
+
* ["sms"] with an sms list sends on SMS from those numbers. Each list only narrows
|
|
520
|
+
* which of its own channel's routes may win, so with Channel left at auto-detect a
|
|
521
|
+
* recipient best served by a channel with no list still goes out on it. Routing
|
|
522
|
+
* itself is unchanged: the same rules are scored and ranked the same way, with
|
|
523
|
+
* routes pinned to numbers you did not list removed from the running.
|
|
524
|
+
*
|
|
525
|
+
* Every number must be an active sender on your account. The request itself is
|
|
526
|
+
* still accepted (202) if one is not — like every other send-time rule, that is
|
|
527
|
+
* decided per message, so each affected message is recorded BLOCKED with error
|
|
528
|
+
* code BUSINESS_029 and reported on GET /v3/messages and the status webhook.
|
|
529
|
+
*/
|
|
530
|
+
channels?: {
|
|
531
|
+
[key: string]: Array<MessageSendParams.Channel>;
|
|
532
|
+
} | null;
|
|
488
533
|
/**
|
|
489
534
|
* Body param: Attachments for this send, as publicly fetchable https URLs. Used by
|
|
490
535
|
* the MMS channel and ignored by every other one.
|
|
@@ -555,6 +600,29 @@ export interface MessageSendParams {
|
|
|
555
600
|
'x-profile-id'?: string;
|
|
556
601
|
}
|
|
557
602
|
export declare namespace MessageSendParams {
|
|
603
|
+
/**
|
|
604
|
+
* One entry of a channel's list in Channels, e.g. {"country": "US", "from":
|
|
605
|
+
* ["+15559990002", "+15559990003"], "strategy": "sticky"}.
|
|
606
|
+
*/
|
|
607
|
+
interface Channel {
|
|
608
|
+
/**
|
|
609
|
+
* Recipient country this entry is meant for (ISO 3166-1 alpha-2, e.g. US).
|
|
610
|
+
* Optional. Accepted and stored, not acted on yet.
|
|
611
|
+
*/
|
|
612
|
+
country?: string | null;
|
|
613
|
+
/**
|
|
614
|
+
* Sender numbers in E.164. Each must be an active sender on your account for this
|
|
615
|
+
* channel. That is account state rather than request shape, so it is decided per
|
|
616
|
+
* message: the request is accepted with 202 and a message naming an unusable
|
|
617
|
+
* number is recorded BLOCKED with error code BUSINESS_029.
|
|
618
|
+
*/
|
|
619
|
+
from?: Array<string> | null;
|
|
620
|
+
/**
|
|
621
|
+
* How to pick a number from From, e.g. sticky or geo. Optional. Accepted and
|
|
622
|
+
* stored, not acted on yet.
|
|
623
|
+
*/
|
|
624
|
+
strategy?: string | null;
|
|
625
|
+
}
|
|
558
626
|
/**
|
|
559
627
|
* SDK-style template reference: resolve by ID or by name, with optional
|
|
560
628
|
* parameters.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.mts","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,KAAK,WAAW,uBAAmB;AAC1C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAG7D;;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,MAAM,GAAG,IAAI,CAAC;KAC1B;IAED;;;OAGG;IACH,UAAiB,QAAQ;QACvB;;WAEG;QACH,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAEnB;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAErB;;;;;;;;;;;;;;;WAeG;QACH,UAAU,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,GAAG,IAAI,CAAC;KAC/C;CACF;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
|
package/resources/messages.d.ts
CHANGED
|
@@ -49,13 +49,27 @@ export declare class Messages extends APIResource {
|
|
|
49
49
|
* Sends a message to one or more recipients using a template. Supports
|
|
50
50
|
* multi-channel broadcast — when multiple channels are specified (e.g. ["sms",
|
|
51
51
|
* "whatsapp"]), a separate message is created for each (recipient, channel) pair.
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* message
|
|
52
|
+
* To choose which of your own numbers a send goes out from, use 'channels':
|
|
53
|
+
* {"sms": [{"from": ["+12125550000", "+14155550000"]}]}. Each channel holds a list
|
|
54
|
+
* of entries, each with 'from' and optionally 'country' and 'strategy'; 'country'
|
|
55
|
+
* and 'strategy' are stored but not acted on yet, so every entry's numbers apply
|
|
56
|
+
* to every recipient on that channel. Every number listed must be an active sender
|
|
57
|
+
* on your account. Like the other account-level preconditions below, that is
|
|
58
|
+
* checked per message rather than when the request is received: the request is
|
|
59
|
+
* still accepted with 202, and each affected message is reported as BLOCKED with
|
|
60
|
+
* error code BUSINESS_029 on GET /messages/{id} and the message.blocked webhook.
|
|
61
|
+
* Each channel's numbers restrict which numbers that channel may use; it does not
|
|
62
|
+
* choose channels — 'channel' does, and the two can be combined. With 'channel'
|
|
63
|
+
* left at auto-detect, a recipient best served by a channel you listed no numbers
|
|
64
|
+
* for still goes out on it. Where several of the listed numbers could serve a
|
|
65
|
+
* recipient, routing prefers the one whose area code matches theirs. Keys: sms,
|
|
66
|
+
* whatsapp, rcs, mms. Returns immediately with per-recipient message IDs for async
|
|
67
|
+
* tracking via webhooks or the GET /messages/{id} endpoint. Sends gated before any
|
|
68
|
+
* delivery attempt do not reject the request — an account-level precondition such
|
|
69
|
+
* as insufficient balance, a template not approved for sending, or free-form
|
|
70
|
+
* content with no open conversation with the contact. The send is accepted with
|
|
71
|
+
* 202 and the affected messages are reported as BLOCKED on GET /messages/{id} and
|
|
72
|
+
* the message.blocked webhook. To send later, set scheduled_at (ISO-8601 with an
|
|
59
73
|
* explicit UTC offset; a value without one is rejected) between 1 minute and 30
|
|
60
74
|
* days ahead: the response is a ScheduledSendMessageResponse (the same fields plus
|
|
61
75
|
* scheduled_at; status is still QUEUED), each message then moves to SCHEDULED, is
|
|
@@ -69,7 +83,15 @@ export declare class Messages extends APIResource {
|
|
|
69
83
|
*
|
|
70
84
|
* @example
|
|
71
85
|
* ```ts
|
|
72
|
-
* const response = await client.messages.send(
|
|
86
|
+
* const response = await client.messages.send({
|
|
87
|
+
* channel: ['sms', 'whatsapp'],
|
|
88
|
+
* template: {
|
|
89
|
+
* id: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
|
|
90
|
+
* name: 'order_confirmation',
|
|
91
|
+
* parameters: { name: 'John Doe', order_id: '12345' },
|
|
92
|
+
* },
|
|
93
|
+
* to: ['+14155551234', '+14155555678'],
|
|
94
|
+
* });
|
|
73
95
|
* ```
|
|
74
96
|
*/
|
|
75
97
|
send(params: MessageSendParams, options?: RequestOptions): APIPromise<MessageSendResponse>;
|
|
@@ -485,6 +507,29 @@ export interface MessageSendParams {
|
|
|
485
507
|
* ["sent"] (auto-detect) if omitted.
|
|
486
508
|
*/
|
|
487
509
|
channel?: Array<string> | null;
|
|
510
|
+
/**
|
|
511
|
+
* Body param: Which of your own numbers to send from, keyed by channel, each
|
|
512
|
+
* channel holding a list of entries: {"sms": [{"country": "US", "from":
|
|
513
|
+
* ["+12125550000", "+14155550000"]}, {"from": ["+447700800001"]}]}. Any real
|
|
514
|
+
* channel may be a key; sent, which is auto-detect rather than a channel, is
|
|
515
|
+
* rejected. country and strategy are accepted and stored but not acted on yet:
|
|
516
|
+
* every entry's numbers apply to every recipient on that channel.
|
|
517
|
+
*
|
|
518
|
+
* This does not choose channels — Channel does, and the two combine: "channel":
|
|
519
|
+
* ["sms"] with an sms list sends on SMS from those numbers. Each list only narrows
|
|
520
|
+
* which of its own channel's routes may win, so with Channel left at auto-detect a
|
|
521
|
+
* recipient best served by a channel with no list still goes out on it. Routing
|
|
522
|
+
* itself is unchanged: the same rules are scored and ranked the same way, with
|
|
523
|
+
* routes pinned to numbers you did not list removed from the running.
|
|
524
|
+
*
|
|
525
|
+
* Every number must be an active sender on your account. The request itself is
|
|
526
|
+
* still accepted (202) if one is not — like every other send-time rule, that is
|
|
527
|
+
* decided per message, so each affected message is recorded BLOCKED with error
|
|
528
|
+
* code BUSINESS_029 and reported on GET /v3/messages and the status webhook.
|
|
529
|
+
*/
|
|
530
|
+
channels?: {
|
|
531
|
+
[key: string]: Array<MessageSendParams.Channel>;
|
|
532
|
+
} | null;
|
|
488
533
|
/**
|
|
489
534
|
* Body param: Attachments for this send, as publicly fetchable https URLs. Used by
|
|
490
535
|
* the MMS channel and ignored by every other one.
|
|
@@ -555,6 +600,29 @@ export interface MessageSendParams {
|
|
|
555
600
|
'x-profile-id'?: string;
|
|
556
601
|
}
|
|
557
602
|
export declare namespace MessageSendParams {
|
|
603
|
+
/**
|
|
604
|
+
* One entry of a channel's list in Channels, e.g. {"country": "US", "from":
|
|
605
|
+
* ["+15559990002", "+15559990003"], "strategy": "sticky"}.
|
|
606
|
+
*/
|
|
607
|
+
interface Channel {
|
|
608
|
+
/**
|
|
609
|
+
* Recipient country this entry is meant for (ISO 3166-1 alpha-2, e.g. US).
|
|
610
|
+
* Optional. Accepted and stored, not acted on yet.
|
|
611
|
+
*/
|
|
612
|
+
country?: string | null;
|
|
613
|
+
/**
|
|
614
|
+
* Sender numbers in E.164. Each must be an active sender on your account for this
|
|
615
|
+
* channel. That is account state rather than request shape, so it is decided per
|
|
616
|
+
* message: the request is accepted with 202 and a message naming an unusable
|
|
617
|
+
* number is recorded BLOCKED with error code BUSINESS_029.
|
|
618
|
+
*/
|
|
619
|
+
from?: Array<string> | null;
|
|
620
|
+
/**
|
|
621
|
+
* How to pick a number from From, e.g. sticky or geo. Optional. Accepted and
|
|
622
|
+
* stored, not acted on yet.
|
|
623
|
+
*/
|
|
624
|
+
strategy?: string | null;
|
|
625
|
+
}
|
|
558
626
|
/**
|
|
559
627
|
* SDK-style template reference: resolve by ID or by name, with optional
|
|
560
628
|
* parameters.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,KAAK,WAAW,sBAAmB;AAC1C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D;;;;;;;;;;GAUG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAChB,EAAE,EAAE,MAAM,EACV,MAAM,GAAE,+BAA+B,GAAG,IAAI,GAAG,SAAc,EAC/D,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iCAAiC,CAAC;IAWhD;;;;;;;;;;;;;;;OAeG;IACH,cAAc,CAC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M,GAAG,MAAM,CAAA;SAAE,GAAG,IAAI,CAAC;KAC/C;CACF;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
|
package/resources/messages.js
CHANGED
|
@@ -70,13 +70,27 @@ class Messages extends resource_1.APIResource {
|
|
|
70
70
|
* Sends a message to one or more recipients using a template. Supports
|
|
71
71
|
* multi-channel broadcast — when multiple channels are specified (e.g. ["sms",
|
|
72
72
|
* "whatsapp"]), a separate message is created for each (recipient, channel) pair.
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* message
|
|
73
|
+
* To choose which of your own numbers a send goes out from, use 'channels':
|
|
74
|
+
* {"sms": [{"from": ["+12125550000", "+14155550000"]}]}. Each channel holds a list
|
|
75
|
+
* of entries, each with 'from' and optionally 'country' and 'strategy'; 'country'
|
|
76
|
+
* and 'strategy' are stored but not acted on yet, so every entry's numbers apply
|
|
77
|
+
* to every recipient on that channel. Every number listed must be an active sender
|
|
78
|
+
* on your account. Like the other account-level preconditions below, that is
|
|
79
|
+
* checked per message rather than when the request is received: the request is
|
|
80
|
+
* still accepted with 202, and each affected message is reported as BLOCKED with
|
|
81
|
+
* error code BUSINESS_029 on GET /messages/{id} and the message.blocked webhook.
|
|
82
|
+
* Each channel's numbers restrict which numbers that channel may use; it does not
|
|
83
|
+
* choose channels — 'channel' does, and the two can be combined. With 'channel'
|
|
84
|
+
* left at auto-detect, a recipient best served by a channel you listed no numbers
|
|
85
|
+
* for still goes out on it. Where several of the listed numbers could serve a
|
|
86
|
+
* recipient, routing prefers the one whose area code matches theirs. Keys: sms,
|
|
87
|
+
* whatsapp, rcs, mms. Returns immediately with per-recipient message IDs for async
|
|
88
|
+
* tracking via webhooks or the GET /messages/{id} endpoint. Sends gated before any
|
|
89
|
+
* delivery attempt do not reject the request — an account-level precondition such
|
|
90
|
+
* as insufficient balance, a template not approved for sending, or free-form
|
|
91
|
+
* content with no open conversation with the contact. The send is accepted with
|
|
92
|
+
* 202 and the affected messages are reported as BLOCKED on GET /messages/{id} and
|
|
93
|
+
* the message.blocked webhook. To send later, set scheduled_at (ISO-8601 with an
|
|
80
94
|
* explicit UTC offset; a value without one is rejected) between 1 minute and 30
|
|
81
95
|
* days ahead: the response is a ScheduledSendMessageResponse (the same fields plus
|
|
82
96
|
* scheduled_at; status is still QUEUED), each message then moves to SCHEDULED, is
|
|
@@ -90,7 +104,15 @@ class Messages extends resource_1.APIResource {
|
|
|
90
104
|
*
|
|
91
105
|
* @example
|
|
92
106
|
* ```ts
|
|
93
|
-
* const response = await client.messages.send(
|
|
107
|
+
* const response = await client.messages.send({
|
|
108
|
+
* channel: ['sms', 'whatsapp'],
|
|
109
|
+
* template: {
|
|
110
|
+
* id: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
|
|
111
|
+
* name: 'order_confirmation',
|
|
112
|
+
* parameters: { name: 'John Doe', order_id: '12345' },
|
|
113
|
+
* },
|
|
114
|
+
* to: ['+14155551234', '+14155555678'],
|
|
115
|
+
* });
|
|
94
116
|
* ```
|
|
95
117
|
*/
|
|
96
118
|
send(params, options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAAmD;AAEnD,oDAA8C;AAE9C;;;;;;;;;;GAUG;AACH,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAChB,EAAU,EAC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gBACpB;oBACE,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;oBAC/E,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;iBACrE;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF;AA3HD,4BA2HC"}
|
package/resources/messages.mjs
CHANGED
|
@@ -67,13 +67,27 @@ export class Messages extends APIResource {
|
|
|
67
67
|
* Sends a message to one or more recipients using a template. Supports
|
|
68
68
|
* multi-channel broadcast — when multiple channels are specified (e.g. ["sms",
|
|
69
69
|
* "whatsapp"]), a separate message is created for each (recipient, channel) pair.
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* message
|
|
70
|
+
* To choose which of your own numbers a send goes out from, use 'channels':
|
|
71
|
+
* {"sms": [{"from": ["+12125550000", "+14155550000"]}]}. Each channel holds a list
|
|
72
|
+
* of entries, each with 'from' and optionally 'country' and 'strategy'; 'country'
|
|
73
|
+
* and 'strategy' are stored but not acted on yet, so every entry's numbers apply
|
|
74
|
+
* to every recipient on that channel. Every number listed must be an active sender
|
|
75
|
+
* on your account. Like the other account-level preconditions below, that is
|
|
76
|
+
* checked per message rather than when the request is received: the request is
|
|
77
|
+
* still accepted with 202, and each affected message is reported as BLOCKED with
|
|
78
|
+
* error code BUSINESS_029 on GET /messages/{id} and the message.blocked webhook.
|
|
79
|
+
* Each channel's numbers restrict which numbers that channel may use; it does not
|
|
80
|
+
* choose channels — 'channel' does, and the two can be combined. With 'channel'
|
|
81
|
+
* left at auto-detect, a recipient best served by a channel you listed no numbers
|
|
82
|
+
* for still goes out on it. Where several of the listed numbers could serve a
|
|
83
|
+
* recipient, routing prefers the one whose area code matches theirs. Keys: sms,
|
|
84
|
+
* whatsapp, rcs, mms. Returns immediately with per-recipient message IDs for async
|
|
85
|
+
* tracking via webhooks or the GET /messages/{id} endpoint. Sends gated before any
|
|
86
|
+
* delivery attempt do not reject the request — an account-level precondition such
|
|
87
|
+
* as insufficient balance, a template not approved for sending, or free-form
|
|
88
|
+
* content with no open conversation with the contact. The send is accepted with
|
|
89
|
+
* 202 and the affected messages are reported as BLOCKED on GET /messages/{id} and
|
|
90
|
+
* the message.blocked webhook. To send later, set scheduled_at (ISO-8601 with an
|
|
77
91
|
* explicit UTC offset; a value without one is rejected) between 1 minute and 30
|
|
78
92
|
* days ahead: the response is a ScheduledSendMessageResponse (the same fields plus
|
|
79
93
|
* scheduled_at; status is still QUEUED), each message then moves to SCHEDULED, is
|
|
@@ -87,7 +101,15 @@ export class Messages extends APIResource {
|
|
|
87
101
|
*
|
|
88
102
|
* @example
|
|
89
103
|
* ```ts
|
|
90
|
-
* const response = await client.messages.send(
|
|
104
|
+
* const response = await client.messages.send({
|
|
105
|
+
* channel: ['sms', 'whatsapp'],
|
|
106
|
+
* template: {
|
|
107
|
+
* id: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
|
|
108
|
+
* name: 'order_confirmation',
|
|
109
|
+
* parameters: { name: 'John Doe', order_id: '12345' },
|
|
110
|
+
* },
|
|
111
|
+
* to: ['+14155551234', '+14155555678'],
|
|
112
|
+
* });
|
|
91
113
|
* ```
|
|
92
114
|
*/
|
|
93
115
|
send(params, options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAEnD,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;;;;;;;;;GAUG;AACH,MAAM,OAAO,QAAS,SAAQ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,CAAC,cAAc,EAAE;YACvC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB;oBACE,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;oBAC/E,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;iBACrE;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -82,13 +82,27 @@ export class Messages extends APIResource {
|
|
|
82
82
|
* Sends a message to one or more recipients using a template. Supports
|
|
83
83
|
* multi-channel broadcast — when multiple channels are specified (e.g. ["sms",
|
|
84
84
|
* "whatsapp"]), a separate message is created for each (recipient, channel) pair.
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* message
|
|
85
|
+
* To choose which of your own numbers a send goes out from, use 'channels':
|
|
86
|
+
* {"sms": [{"from": ["+12125550000", "+14155550000"]}]}. Each channel holds a list
|
|
87
|
+
* of entries, each with 'from' and optionally 'country' and 'strategy'; 'country'
|
|
88
|
+
* and 'strategy' are stored but not acted on yet, so every entry's numbers apply
|
|
89
|
+
* to every recipient on that channel. Every number listed must be an active sender
|
|
90
|
+
* on your account. Like the other account-level preconditions below, that is
|
|
91
|
+
* checked per message rather than when the request is received: the request is
|
|
92
|
+
* still accepted with 202, and each affected message is reported as BLOCKED with
|
|
93
|
+
* error code BUSINESS_029 on GET /messages/{id} and the message.blocked webhook.
|
|
94
|
+
* Each channel's numbers restrict which numbers that channel may use; it does not
|
|
95
|
+
* choose channels — 'channel' does, and the two can be combined. With 'channel'
|
|
96
|
+
* left at auto-detect, a recipient best served by a channel you listed no numbers
|
|
97
|
+
* for still goes out on it. Where several of the listed numbers could serve a
|
|
98
|
+
* recipient, routing prefers the one whose area code matches theirs. Keys: sms,
|
|
99
|
+
* whatsapp, rcs, mms. Returns immediately with per-recipient message IDs for async
|
|
100
|
+
* tracking via webhooks or the GET /messages/{id} endpoint. Sends gated before any
|
|
101
|
+
* delivery attempt do not reject the request — an account-level precondition such
|
|
102
|
+
* as insufficient balance, a template not approved for sending, or free-form
|
|
103
|
+
* content with no open conversation with the contact. The send is accepted with
|
|
104
|
+
* 202 and the affected messages are reported as BLOCKED on GET /messages/{id} and
|
|
105
|
+
* the message.blocked webhook. To send later, set scheduled_at (ISO-8601 with an
|
|
92
106
|
* explicit UTC offset; a value without one is rejected) between 1 minute and 30
|
|
93
107
|
* days ahead: the response is a ScheduledSendMessageResponse (the same fields plus
|
|
94
108
|
* scheduled_at; status is still QUEUED), each message then moves to SCHEDULED, is
|
|
@@ -102,7 +116,15 @@ export class Messages extends APIResource {
|
|
|
102
116
|
*
|
|
103
117
|
* @example
|
|
104
118
|
* ```ts
|
|
105
|
-
* const response = await client.messages.send(
|
|
119
|
+
* const response = await client.messages.send({
|
|
120
|
+
* channel: ['sms', 'whatsapp'],
|
|
121
|
+
* template: {
|
|
122
|
+
* id: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
|
|
123
|
+
* name: 'order_confirmation',
|
|
124
|
+
* parameters: { name: 'John Doe', order_id: '12345' },
|
|
125
|
+
* },
|
|
126
|
+
* to: ['+14155551234', '+14155555678'],
|
|
127
|
+
* });
|
|
106
128
|
* ```
|
|
107
129
|
*/
|
|
108
130
|
send(params: MessageSendParams, options?: RequestOptions): APIPromise<MessageSendResponse> {
|
|
@@ -609,6 +631,28 @@ export interface MessageSendParams {
|
|
|
609
631
|
*/
|
|
610
632
|
channel?: Array<string> | null;
|
|
611
633
|
|
|
634
|
+
/**
|
|
635
|
+
* Body param: Which of your own numbers to send from, keyed by channel, each
|
|
636
|
+
* channel holding a list of entries: {"sms": [{"country": "US", "from":
|
|
637
|
+
* ["+12125550000", "+14155550000"]}, {"from": ["+447700800001"]}]}. Any real
|
|
638
|
+
* channel may be a key; sent, which is auto-detect rather than a channel, is
|
|
639
|
+
* rejected. country and strategy are accepted and stored but not acted on yet:
|
|
640
|
+
* every entry's numbers apply to every recipient on that channel.
|
|
641
|
+
*
|
|
642
|
+
* This does not choose channels — Channel does, and the two combine: "channel":
|
|
643
|
+
* ["sms"] with an sms list sends on SMS from those numbers. Each list only narrows
|
|
644
|
+
* which of its own channel's routes may win, so with Channel left at auto-detect a
|
|
645
|
+
* recipient best served by a channel with no list still goes out on it. Routing
|
|
646
|
+
* itself is unchanged: the same rules are scored and ranked the same way, with
|
|
647
|
+
* routes pinned to numbers you did not list removed from the running.
|
|
648
|
+
*
|
|
649
|
+
* Every number must be an active sender on your account. The request itself is
|
|
650
|
+
* still accepted (202) if one is not — like every other send-time rule, that is
|
|
651
|
+
* decided per message, so each affected message is recorded BLOCKED with error
|
|
652
|
+
* code BUSINESS_029 and reported on GET /v3/messages and the status webhook.
|
|
653
|
+
*/
|
|
654
|
+
channels?: { [key: string]: Array<MessageSendParams.Channel> } | null;
|
|
655
|
+
|
|
612
656
|
/**
|
|
613
657
|
* Body param: Attachments for this send, as publicly fetchable https URLs. Used by
|
|
614
658
|
* the MMS channel and ignored by every other one.
|
|
@@ -688,6 +732,32 @@ export interface MessageSendParams {
|
|
|
688
732
|
}
|
|
689
733
|
|
|
690
734
|
export namespace MessageSendParams {
|
|
735
|
+
/**
|
|
736
|
+
* One entry of a channel's list in Channels, e.g. {"country": "US", "from":
|
|
737
|
+
* ["+15559990002", "+15559990003"], "strategy": "sticky"}.
|
|
738
|
+
*/
|
|
739
|
+
export interface Channel {
|
|
740
|
+
/**
|
|
741
|
+
* Recipient country this entry is meant for (ISO 3166-1 alpha-2, e.g. US).
|
|
742
|
+
* Optional. Accepted and stored, not acted on yet.
|
|
743
|
+
*/
|
|
744
|
+
country?: string | null;
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* Sender numbers in E.164. Each must be an active sender on your account for this
|
|
748
|
+
* channel. That is account state rather than request shape, so it is decided per
|
|
749
|
+
* message: the request is accepted with 202 and a message naming an unusable
|
|
750
|
+
* number is recorded BLOCKED with error code BUSINESS_029.
|
|
751
|
+
*/
|
|
752
|
+
from?: Array<string> | null;
|
|
753
|
+
|
|
754
|
+
/**
|
|
755
|
+
* How to pick a number from From, e.g. sticky or geo. Optional. Accepted and
|
|
756
|
+
* stored, not acted on yet.
|
|
757
|
+
*/
|
|
758
|
+
strategy?: string | null;
|
|
759
|
+
}
|
|
760
|
+
|
|
691
761
|
/**
|
|
692
762
|
* SDK-style template reference: resolve by ID or by name, with optional
|
|
693
763
|
* parameters.
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.44.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.44.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.44.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.44.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|