@signalhousellc/sdk 1.0.35 → 1.0.37
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/Billing.js +21 -0
- package/src/domains/Users.js +14 -4
package/package.json
CHANGED
package/src/domains/Billing.js
CHANGED
|
@@ -26,6 +26,27 @@ export class Billing {
|
|
|
26
26
|
...options,
|
|
27
27
|
});
|
|
28
28
|
},
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Update fee schedule pricing for a customer group
|
|
32
|
+
* @async
|
|
33
|
+
* @roles signalhouse_admin, signalhouse_api, signalhouse_user
|
|
34
|
+
* @param {Object} params
|
|
35
|
+
* @param {string} params.groupId - The group ID to update fees for
|
|
36
|
+
* @param {Object} params.fees - Object of fee field names to microdollar values
|
|
37
|
+
* @param {boolean} [params.overrideActiveSubscription=false] - If true, also update the active subscription fees
|
|
38
|
+
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
39
|
+
* @returns {Promise<Object>} The updated fee schedule
|
|
40
|
+
*/
|
|
41
|
+
updateFees: async ({ groupId, fees, overrideActiveSubscription, options = {} }) => {
|
|
42
|
+
this.client._require({ groupId, fees });
|
|
43
|
+
const safeGroupId = encodeURIComponent(groupId);
|
|
44
|
+
return this.client(`/billing/fees/${safeGroupId}`, {
|
|
45
|
+
method: "PUT",
|
|
46
|
+
body: { fees, overrideActiveSubscription },
|
|
47
|
+
...options,
|
|
48
|
+
});
|
|
49
|
+
},
|
|
29
50
|
};
|
|
30
51
|
}
|
|
31
52
|
}
|
package/src/domains/Users.js
CHANGED
|
@@ -56,11 +56,16 @@ export class Users {
|
|
|
56
56
|
* @param {Object} params - The parameters for getting users
|
|
57
57
|
* @param {string} [params.email] - Filter users by email (partial match)
|
|
58
58
|
* @param {string} [params.userType] - Filter users by type (user, service)
|
|
59
|
+
* @param {number} [params.page] - Page number for pagination
|
|
60
|
+
* @param {number} [params.limit] - Items per page
|
|
61
|
+
* @param {string} [params.search] - Search users by email (case-insensitive)
|
|
62
|
+
* @param {string} [params.sortBy] - Field to sort by (createdAt, email, activeGroupId, companyName, status, _id)
|
|
63
|
+
* @param {string} [params.sortOrder] - Sort direction (asc, desc)
|
|
59
64
|
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
60
65
|
* @returns {Promise<Object>} - A promise that resolves to the list of users
|
|
61
66
|
*/
|
|
62
|
-
getUsers: async ({ email, userType, options = {} }) => {
|
|
63
|
-
const filters = { email, userType };
|
|
67
|
+
getUsers: async ({ email, userType, page, limit, search, sortBy, sortOrder, options = {} }) => {
|
|
68
|
+
const filters = { email, userType, page, limit, search, sortBy, sortOrder };
|
|
64
69
|
const queryString = this.client._getQueryString(filters);
|
|
65
70
|
return this.client(`/user${queryString}`, { method: "GET", ...options });
|
|
66
71
|
},
|
|
@@ -89,11 +94,16 @@ export class Users {
|
|
|
89
94
|
* @param {string} [params.id] - Filter by user ID
|
|
90
95
|
* @param {string} [params.groupId] - Filter by group ID
|
|
91
96
|
* @param {string} [params.userType] - Filter by user type (user, service)
|
|
97
|
+
* @param {number} [params.page] - Page number for pagination
|
|
98
|
+
* @param {number} [params.limit] - Items per page
|
|
99
|
+
* @param {string} [params.search] - Search users by email (case-insensitive)
|
|
100
|
+
* @param {string} [params.sortBy] - Field to sort by (createdAt, email, activeGroupId, companyName, status, _id)
|
|
101
|
+
* @param {string} [params.sortOrder] - Sort direction (asc, desc)
|
|
92
102
|
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
93
103
|
* @returns {Promise<Object>} - A promise that resolves to the list of users
|
|
94
104
|
*/
|
|
95
|
-
async getUsers({ id, groupId, userType, options = {} }) {
|
|
96
|
-
const filters = { id, groupId, userType };
|
|
105
|
+
async getUsers({ id, groupId, userType, page, limit, search, sortBy, sortOrder, options = {} }) {
|
|
106
|
+
const filters = { id, groupId, userType, page, limit, search, sortBy, sortOrder };
|
|
97
107
|
const queryString = this.client._getQueryString(filters);
|
|
98
108
|
return this.client(`/user${queryString}`, { method: "GET", ...options });
|
|
99
109
|
}
|