@signalhousellc/sdk 1.0.34 → 1.0.35

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.34",
3
+ "version": "1.0.35",
4
4
  "description": "Signal House SDK for use with the Signal House platform",
5
5
  "type": "module",
6
6
  "main": "src/SignalHouseSDK.js",
@@ -2,6 +2,32 @@ export class Billing {
2
2
  constructor(client, enableAdmin) {
3
3
  this.client = client;
4
4
  this.enableAdmin = enableAdmin;
5
+
6
+ if (enableAdmin) {
7
+ this.admin = {
8
+ /**
9
+ * Issue a credit to a customer's wallet
10
+ * @async
11
+ * @roles signalhouse_admin, signalhouse_api, signalhouse_user
12
+ * @param {Object} params
13
+ * @param {string} params.groupId - The group ID to credit
14
+ * @param {number} params.amount - Amount in microdollars
15
+ * @param {string} params.transactionType - Type of credit (e.g. "Goodwill Credit", "Billing Correction")
16
+ * @param {string} params.description - Reason for the credit (1-500 characters)
17
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
18
+ * @returns {Promise<Object>} The created transaction object
19
+ */
20
+ issueCredit: async ({ groupId, amount, transactionType, description, options = {} }) => {
21
+ this.client._require({ groupId, amount, transactionType, description });
22
+ const safeGroupId = encodeURIComponent(groupId);
23
+ return this.client(`/billing/wallet/credit/${safeGroupId}`, {
24
+ method: "POST",
25
+ body: { amount, transactionType, description },
26
+ ...options,
27
+ });
28
+ },
29
+ };
30
+ }
5
31
  }
6
32
 
7
33
  /**