@signalhousellc/sdk 1.0.43 → 1.0.44

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalhousellc/sdk",
3
- "version": "1.0.43",
3
+ "version": "1.0.44",
4
4
  "description": "Signal House SDK for use with the Signal House platform",
5
5
  "type": "module",
6
6
  "main": "src/SignalHouseSDK.js",
@@ -100,6 +100,22 @@ export class Messages {
100
100
  return this.client(`/message/analytics/detail${queryString}`, { method: "GET", ...options });
101
101
  }
102
102
 
103
+ /**
104
+ * Get filter dropdown options (subgroups, brands, campaigns, phone numbers) for the Analytics page,
105
+ * scoped to a single group. Sourced from ClickHouse — only items with at least one message are returned.
106
+ * @async
107
+ * @roles api, admin, developer, billing, user
108
+ * @param {Object} params - The parameters for getting analytics filter options
109
+ * @param {string} params.groupId - The ID of the group whose filter options to load
110
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
111
+ * @returns {Promise<Object>} - A promise that resolves to { subgroups, brands, campaigns, phoneNumbers }
112
+ */
113
+ async getAnalyticsFilterOptions({ groupId, options = {} }) {
114
+ const filters = { groupId };
115
+ const queryString = this.client._getQueryString(filters);
116
+ return this.client(`/message/analytics/filter-options${queryString}`, { method: "GET", ...options });
117
+ }
118
+
103
119
  /**
104
120
  * Get aggregated DNC (Do Not Contact) opt-out analytics with optional filters
105
121
  * @async
@@ -171,6 +187,28 @@ export class Messages {
171
187
  });
172
188
  }
173
189
 
190
+ /**
191
+ * Send a P2P message via Rogue Mobile SMPP
192
+ * @async
193
+ * @roles api, admin, developer, billing, user
194
+ * @param {Object} params - The parameters for sending a P2P message
195
+ * @param {string[]} params.recipientPhoneNumbers - The phone number(s) to send the message to
196
+ * @param {string} params.messageBody - The body of the P2P message
197
+ * @param {string} [params.statusCallbackUrl] - The URL to receive status callbacks
198
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
199
+ * @returns {Promise<Object>} - A promise that resolves to the response data from the server
200
+ */
201
+ async sendP2P({ recipientPhoneNumbers, messageBody, statusCallbackUrl, options = {} }) {
202
+ this.client._require({ recipientPhoneNumbers, messageBody });
203
+ const body = { recipientPhoneNumber: recipientPhoneNumbers, messageBody };
204
+ if (statusCallbackUrl) body.statusCallbackUrl = statusCallbackUrl;
205
+ return this.client(`/message/p2p`, {
206
+ method: "POST",
207
+ body,
208
+ ...options,
209
+ });
210
+ }
211
+
174
212
  /**
175
213
  * Send an MMS message to one or more recipient phone numbers, with optional media attachments and status callback
176
214
  * @async