@signalhousellc/sdk 1.0.48 → 1.0.50

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.48",
3
+ "version": "1.0.50",
4
4
  "description": "Signal House SDK for use with the Signal House platform",
5
5
  "type": "module",
6
6
  "main": "src/SignalHouseSDK.js",
@@ -51,4 +51,16 @@ export class Auth {
51
51
  const queryString = this.client._getQueryString({ groupId, userId, page, limit });
52
52
  return this.client(`/auth/history${queryString}`, { method: "GET", ...options });
53
53
  }
54
+
55
+ /**
56
+ * Log out all other users in the caller's active group
57
+ * @async
58
+ * @roles admin
59
+ * @param {Object} [params]
60
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
61
+ * @returns {Promise<Object>} The response containing loggedOutCount
62
+ */
63
+ async logoutAll({ options = {} } = {}) {
64
+ return this.client(`/auth/logout-all`, { method: "POST", ...options });
65
+ }
54
66
  }
@@ -103,6 +103,17 @@ export class Campaigns {
103
103
  const safeCampaignId = encodeURIComponent(campaignId);
104
104
  return this.client(`/campaign/reject/${safeCampaignId}`, { method: "POST", ...options });
105
105
  },
106
+ /**
107
+ * Get CNP campaigns shared with Signal House
108
+ * @async
109
+ * @roles signalhouse
110
+ * @param {Object} params - The parameters for retrieving CNP campaigns
111
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
112
+ * @returns {Promise<Array>} The response from the server
113
+ */
114
+ getCNPCampaigns: async ({ options = {} } = {}) => {
115
+ return this.client(`/campaign/cnp`, { method: "GET", ...options });
116
+ },
106
117
  };
107
118
  }
108
119
  }
@@ -77,7 +77,8 @@ export class Groups {
77
77
  * @roles api, admin, developer, billing
78
78
  * @param {Object} params - The parameters for updating a group
79
79
  * @param {string} params.id - The ID of the group to update
80
- * @param {Object} params.groupData - The data for the group, including required fields such as groupName
80
+ * @param {Object} params.groupData - The data for the group, including required fields such as groupName.
81
+ * Optional CNP fields: cspId (string|null), defaultCnpSubgroupId (string|null)
81
82
  * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
82
83
  * @throws {Error} Throws an error if the id or groupData parameter is missing
83
84
  * @returns {Promise<Object>} - The updated group object returned from the server
@@ -42,6 +42,21 @@ export class Landings {
42
42
  return this.client(`/landing/${safeLandingId}`, { method: "GET", ...options });
43
43
  }
44
44
 
45
+ /**
46
+ * Get a public (published) landing page by its ID. This endpoint is public and does not require authentication.
47
+ * @async
48
+ * @param {Object} params - The parameters for getting a public landing page
49
+ * @param {string} params.landingId - The ID of the public landing page to retrieve
50
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
51
+ * @throws {Error} Throws an error if the landingId parameter is missing
52
+ * @returns {Promise<Object>} - The public landing page object returned from the server
53
+ */
54
+ async getPublicLanding({ landingId, options = {} }) {
55
+ this.client._require({ landingId });
56
+ const safeLandingId = encodeURIComponent(landingId);
57
+ return this.client(`/landing/public/${safeLandingId}`, { method: "GET", ...options });
58
+ }
59
+
45
60
  /**
46
61
  * Create a new landing page with the specified landing data and logo file
47
62
  * @async
@@ -56,6 +56,26 @@ export class Messages {
56
56
  return this.client(`/message${queryString}`, { method: "GET", ...options });
57
57
  }
58
58
 
59
+ /**
60
+ * Fetch the latest upstream carrier delivery report for a set of messages by ID (SHGHL-1856).
61
+ * Useful for reconciling messages stuck in a non-terminal state. SMS and MMS messages are looked up
62
+ * against the carrier; other message types are returned with their stored status.
63
+ * @async
64
+ * @roles api, admin, developer, billing, user
65
+ * @param {Object} params - The parameters for fetching delivery reports
66
+ * @param {string[]} params.messageIds - The message IDs to fetch carrier delivery reports for (1-100)
67
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
68
+ * @returns {Promise<Object>} - A promise that resolves to an array of carrier delivery reports
69
+ */
70
+ async getDeliveryReports({ messageIds, options = {} }) {
71
+ this.client._require({ messageIds });
72
+ return this.client(`/message/delivery-report`, {
73
+ method: "POST",
74
+ body: { messageIds },
75
+ ...options,
76
+ });
77
+ }
78
+
59
79
  /**
60
80
  * Get aggregated analytics for messages with optional filters
61
81
  * @async
@@ -261,6 +281,22 @@ export class Messages {
261
281
  });
262
282
  }
263
283
 
284
+ /**
285
+ * Get the details of a P2P batch by its ID
286
+ * @async
287
+ * @roles api, admin, developer, billing, user
288
+ * @param {Object} params - The parameters for getting a P2P batch
289
+ * @param {string} params.batchId - The ID of the P2P batch to retrieve
290
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
291
+ * @throws {Error} Throws an error if the batchId parameter is missing
292
+ * @returns {Promise<Object>} - The P2P batch object returned from the server
293
+ */
294
+ async getP2PBatch({ batchId, options = {} }) {
295
+ this.client._require({ batchId });
296
+ const safeBatchId = encodeURIComponent(batchId);
297
+ return this.client(`/message/p2p/batches/${safeBatchId}`, { method: "GET", ...options });
298
+ }
299
+
264
300
  /**
265
301
  * Send an MMS message to one or more recipient phone numbers, with optional media attachments and status callback
266
302
  * @async