@signalhousellc/sdk 1.0.15 → 1.0.16

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.15",
3
+ "version": "1.0.16",
4
4
  "description": "Signal House SDK for use with the Signal House platform",
5
5
  "type": "module",
6
6
  "main": "src/SignalHouseSDK.js",
@@ -160,4 +160,35 @@ export class Users {
160
160
  const safeId = encodeURIComponent(id);
161
161
  return this.client(`/user/${safeId}`, { method: "DELETE", ...options });
162
162
  }
163
+
164
+ /**
165
+ * Get notification preferences for a user
166
+ * @async
167
+ * @roles api, admin, self
168
+ * @param {Object} params
169
+ * @param {string} params.id - The ID of the user
170
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
171
+ * @returns {Promise<Object>} The response from the server
172
+ */
173
+ async getNotificationPreferences({ id, options = {} }) {
174
+ this.client._require({ id });
175
+ const safeId = encodeURIComponent(id);
176
+ return this.client(`/user/${safeId}/notification-preferences`, { method: "GET", ...options });
177
+ }
178
+
179
+ /**
180
+ * Update notification preferences for a user
181
+ * @async
182
+ * @roles api, admin, self
183
+ * @param {Object} params
184
+ * @param {string} params.id - The ID of the user
185
+ * @param {Array<{name: string, web: boolean, email: boolean}>} params.notificationPreferences - Array of notification preference objects
186
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
187
+ * @returns {Promise<Object>} The response from the server
188
+ */
189
+ async updateNotificationPreferences({ id, notificationPreferences, options = {} }) {
190
+ this.client._require({ id, notificationPreferences });
191
+ const safeId = encodeURIComponent(id);
192
+ return this.client(`/user/${safeId}/notification-preferences`, { method: "PUT", body: { notificationPreferences }, ...options });
193
+ }
163
194
  }