@signalhousellc/sdk 1.0.46 → 1.0.47

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.46",
3
+ "version": "1.0.47",
4
4
  "description": "Signal House SDK for use with the Signal House platform",
5
5
  "type": "module",
6
6
  "main": "src/SignalHouseSDK.js",
@@ -73,6 +73,26 @@ export class Billing {
73
73
  return this.client(`/billing/wallet/transactionHistory${queryString}`, { method: "GET", ...options });
74
74
  }
75
75
 
76
+ /**
77
+ * Get payment history (wallet recharge transactions) with server-side pagination
78
+ * @async
79
+ * @roles api, admin, developer, billing, user
80
+ * @param {Object} params - The parameters for filtering payment history
81
+ * @param {string} params.groupId - The ID of the group to filter by
82
+ * @param {string} params.startDate - Start date in YYYY-MM-DD format (inclusive)
83
+ * @param {string} params.endDate - End date in YYYY-MM-DD format (inclusive)
84
+ * @param {number} [params.page=1] - Page number (positive integer)
85
+ * @param {number} [params.limit=10] - Results per page (positive integer, max 10000)
86
+ * @param {string} [params.timezone] - IANA timezone (default: "UTC")
87
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
88
+ * @returns {Promise<{data: Array<Object>, pagination: {page: number, limit: number, totalRecords: number, totalPages: number, totalAmount: number}}>}
89
+ */
90
+ async getPaymentHistory({ groupId, startDate, endDate, page, limit, timezone, options = {} }) {
91
+ const filters = { groupId, startDate, endDate, page, limit, timezone };
92
+ const queryString = this.client._getQueryString(filters);
93
+ return this.client(`/billing/wallet/paymentHistory${queryString}`, { method: "GET", ...options });
94
+ }
95
+
76
96
  /**
77
97
  * Get the wallet information for a specific group
78
98
  * @async
@@ -134,7 +134,7 @@ export class Messages {
134
134
  * @param {number} [params.limit=50] - max 50 per page
135
135
  * @param {"tenDLC"|"p2p"|"both"} [params.channel="both"] - Scope the ORDER BY + row inclusion. "tenDLC" excludes rows with no SMS/MMS activity; "p2p" excludes rows with no P2P activity; "both" returns rows with any activity.
136
136
  * @param {import('../SignalHouseSDK').RequestOptions} [params.options]
137
- * @returns {Promise<Object>} - { rows, totalCount, page, limit }
137
+ * @returns {Promise<Object>} - { rows, totalCount, page, limit }. Each row carries sms/mms/p2p metric columns plus `smsOptOuts` and `mmsOptOuts` from the DNC analytics MV (P2P has no opt-outs).
138
138
  */
139
139
  async getAnalyticsBySubgroup({ groupId, subgroupId, brandId, campaignId, phoneNumber, carrier, startDate, endDate, page, limit, channel, options = {} }) {
140
140
  const filters = { groupId, subgroupId, brandId, campaignId, phoneNumber, carrier, startDate, endDate, page, limit, channel };