@signalhousellc/sdk 1.0.54 → 1.0.55
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/package.json +1 -1
- package/src/domains/Messages.js +14 -4
package/package.json
CHANGED
package/src/domains/Messages.js
CHANGED
|
@@ -18,6 +18,8 @@ export class Messages {
|
|
|
18
18
|
* @param {string} [params.status] - Filter messages by their status (ENQUEUED, DEQUEUED, SENT, FAILED, DELIVERED)
|
|
19
19
|
* @param {string} [params.direction] - Filter messages by their direction (INBOUND, OUTBOUND)
|
|
20
20
|
* @param {string|string[]} [params.messageType] - Filter messages by their type. Accepts a single value or an array (e.g. ["SMS", "MMS"]). Allowed values: SMS, MMS, RCS, WHATSAPP, VIBER, P2P. When omitted, defaults to all non-P2P types.
|
|
21
|
+
* @param {string|string[]} [params.channel] - Filter messages by messaging channel. Accepts a single value or an array (cumulative). Allowed values: TEN_DLC, TOLL_FREE, P2P. Channel is derived on read from the associated campaign/brand registrationType (or messageType "P2P"); it is not stored on the message. Ignored when matchAny is true (matchAny takes precedence).
|
|
22
|
+
* @param {boolean} [params.matchAny] - When true, the provided campaignId/brandId/phoneNumber filters are OR'd (a message matches ANY of them) instead of the default most-specific-single behavior. subgroupId stays an AND scope. Opt-in/additive.
|
|
21
23
|
* @param {string} [params.carrier] - Filter messages by the carrier used for sending
|
|
22
24
|
* @param {string} [params.senderPhoneNumber] - Filter messages by the sender's phone number
|
|
23
25
|
* @param {string} [params.recipientPhoneNumber] - Filter messages by the recipient's phone number
|
|
@@ -42,6 +44,8 @@ export class Messages {
|
|
|
42
44
|
status,
|
|
43
45
|
direction,
|
|
44
46
|
messageType,
|
|
47
|
+
channel,
|
|
48
|
+
matchAny,
|
|
45
49
|
carrier,
|
|
46
50
|
startDate,
|
|
47
51
|
endDate,
|
|
@@ -51,7 +55,7 @@ export class Messages {
|
|
|
51
55
|
limit,
|
|
52
56
|
options = {},
|
|
53
57
|
}) {
|
|
54
|
-
const filters = { id, campaignId, brandId, subgroupId, groupId, phoneNumber, senderPhoneNumber, recipientPhoneNumber, status, direction, messageType, carrier, startDate, endDate, sortField, sortOrder, page, limit };
|
|
58
|
+
const filters = { id, campaignId, brandId, subgroupId, groupId, phoneNumber, senderPhoneNumber, recipientPhoneNumber, status, direction, messageType, channel, matchAny, carrier, startDate, endDate, sortField, sortOrder, page, limit };
|
|
55
59
|
const queryString = this.client._getQueryString(filters);
|
|
56
60
|
return this.client(`/message${queryString}`, { method: "GET", ...options });
|
|
57
61
|
}
|
|
@@ -89,11 +93,13 @@ export class Messages {
|
|
|
89
93
|
* @param {string} [params.carrier] - Filter analytics by the carrier used for sending
|
|
90
94
|
* @param {string} [params.startDate] - ISO-8601 date or timestamp; normalized to start-of-UTC-day (inclusive)
|
|
91
95
|
* @param {string} [params.endDate] - ISO-8601 date or timestamp; normalized to end-of-UTC-day (inclusive). Hourly resolution is not supported
|
|
96
|
+
* @param {boolean} [params.matchAny] - When true, the provided campaignId/brandId/phoneNumber filters are OR'd (match ANY) instead of the default most-specific-single behavior. subgroupId stays an AND scope. Opt-in/additive.
|
|
97
|
+
* @param {string|string[]} [params.channel] - Filter analytics by messaging channel (TEN_DLC, TOLL_FREE). Derived on read from the campaign/brand registrationType; resolves to the channel's campaigns so the analytics count matches the channel-filtered message list. Accepts a single value or array (cumulative). Ignored when matchAny is true (matchAny takes precedence).
|
|
92
98
|
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
93
99
|
* @returns {Promise<Object>} - A promise that resolves to the analytics data
|
|
94
100
|
*/
|
|
95
|
-
async getAnalytics({ groupId, subgroupId, brandId, campaignId, phoneNumber, carrier, startDate, endDate, options = {} }) {
|
|
96
|
-
const filters = { groupId, subgroupId, brandId, campaignId, phoneNumber, carrier, startDate, endDate };
|
|
101
|
+
async getAnalytics({ groupId, subgroupId, brandId, campaignId, phoneNumber, carrier, startDate, endDate, channel, matchAny, options = {} }) {
|
|
102
|
+
const filters = { groupId, subgroupId, brandId, campaignId, phoneNumber, carrier, startDate, endDate, channel, matchAny };
|
|
97
103
|
const queryString = this.client._getQueryString(filters);
|
|
98
104
|
return this.client(`/message/analytics${queryString}`, { method: "GET", ...options });
|
|
99
105
|
}
|
|
@@ -267,13 +273,17 @@ export class Messages {
|
|
|
267
273
|
* @param {string[]} params.recipientPhoneNumbers - The phone number(s) to send the message to
|
|
268
274
|
* @param {string} params.messageBody - The body of the P2P message
|
|
269
275
|
* @param {string} [params.statusCallbackUrl] - The URL to receive status callbacks
|
|
276
|
+
* @param {boolean} [params.useSignalHouseShortlinks] - When false, SignalHouse applies no link-shortening
|
|
277
|
+
* or text-spin and your pre-spun links/content are sent verbatim (bring-your-own spinner). Defaults to
|
|
278
|
+
* true server-side (the SignalHouse shortlink system, which mints unique per-recipient links).
|
|
270
279
|
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
271
280
|
* @returns {Promise<Object>} - A promise that resolves to the response data from the server
|
|
272
281
|
*/
|
|
273
|
-
async sendP2P({ recipientPhoneNumbers, messageBody, statusCallbackUrl, options = {} }) {
|
|
282
|
+
async sendP2P({ recipientPhoneNumbers, messageBody, statusCallbackUrl, useSignalHouseShortlinks, options = {} }) {
|
|
274
283
|
this.client._require({ recipientPhoneNumbers, messageBody });
|
|
275
284
|
const body = { recipientPhoneNumber: recipientPhoneNumbers, messageBody };
|
|
276
285
|
if (statusCallbackUrl) body.statusCallbackUrl = statusCallbackUrl;
|
|
286
|
+
if (typeof useSignalHouseShortlinks === "boolean") body.useSignalHouseShortlinks = useSignalHouseShortlinks;
|
|
277
287
|
return this.client(`/message/p2p`, {
|
|
278
288
|
method: "POST",
|
|
279
289
|
body,
|