@signalhousellc/sdk 1.0.36 → 1.0.38

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.36",
3
+ "version": "1.0.38",
4
4
  "description": "Signal House SDK for use with the Signal House platform",
5
5
  "type": "module",
6
6
  "main": "src/SignalHouseSDK.js",
@@ -119,11 +119,14 @@ export class Campaigns {
119
119
  * @param {number} [params.page] - The page number for pagination
120
120
  * @param {number} [params.limit] - The number of items per page
121
121
  * @param {string} [params.status] - The status of the campaign to filter by
122
+ * @param {string} [params.search] - Search term to filter campaigns by campaignId or brandId
123
+ * @param {string} [params.sortBy] - Field to sort by (e.g. "createdAt", "campaignId", "brandId", "groupId", "subgroupId", "usecase", "status")
124
+ * @param {string} [params.sortOrder] - Sort direction ("asc" or "desc")
122
125
  * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
123
- * @returns {Promise<Array>} The response from the server
126
+ * @returns {Promise<Array|Object>} The response from the server - array when unpaginated, or { data, total, page, limit, totalPages } when paginated
124
127
  */
125
- async getCampaigns({ id, brandId, subgroupId, groupId, page, limit, status, options = {} }) {
126
- const filters = { id, brandId, subgroupId, groupId, page, limit, status };
128
+ async getCampaigns({ id, brandId, subgroupId, groupId, page, limit, status, search, sortBy, sortOrder, options = {} }) {
129
+ const filters = { id, brandId, subgroupId, groupId, page, limit, status, search, sortBy, sortOrder };
127
130
  const queryString = this.client._getQueryString(filters);
128
131
  return this.client(`/campaign${queryString}`, { method: "GET", ...options });
129
132
  }
@@ -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
  }