@signalhousellc/sdk 1.0.3 → 1.0.5
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
package/src/domains/Messages.js
CHANGED
|
@@ -137,7 +137,7 @@ export class Messages {
|
|
|
137
137
|
formData.append("recipientPhoneNumber", Array.isArray(recipientPhoneNumbers) ? JSON.stringify(recipientPhoneNumbers) : recipientPhoneNumbers);
|
|
138
138
|
formData.append("messageBody", messageBody);
|
|
139
139
|
|
|
140
|
-
if (mediaUrls) {
|
|
140
|
+
if (mediaUrls && mediaUrls.length > 0) {
|
|
141
141
|
formData.append("mediaUrls", JSON.stringify(mediaUrls));
|
|
142
142
|
}
|
|
143
143
|
|
|
@@ -193,7 +193,7 @@ export class Messages {
|
|
|
193
193
|
formData.append("recipientPhoneNumber", Array.isArray(recipientPhoneNumbers) ? JSON.stringify(recipientPhoneNumbers) : recipientPhoneNumbers);
|
|
194
194
|
formData.append("messageBody", messageBody);
|
|
195
195
|
|
|
196
|
-
if (mediaUrls) {
|
|
196
|
+
if (mediaUrls && mediaUrls.length > 0) {
|
|
197
197
|
formData.append("mediaUrls", JSON.stringify(mediaUrls));
|
|
198
198
|
}
|
|
199
199
|
|
package/src/domains/Subgroups.js
CHANGED
|
@@ -77,15 +77,15 @@ export class Subgroups {
|
|
|
77
77
|
* @roles api, admin, developer, billing, user
|
|
78
78
|
* @param {Object} params - The parameters for updating a subgroup (see UpdateSubgroupData typedef for details)
|
|
79
79
|
* @param {string} params.id - The ID of the subgroup to update
|
|
80
|
-
* @param {UpdateSubgroupData} params.
|
|
80
|
+
* @param {UpdateSubgroupData} params.updateData - The data for the subgroup to be updated, including fields such as subgroupName, contact information, and status
|
|
81
81
|
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
82
|
-
* @throws {Error} Throws an error if the id or
|
|
82
|
+
* @throws {Error} Throws an error if the id or updateData parameter is missing
|
|
83
83
|
* @returns {Promise<Object>} - The updated subgroup object returned from the server
|
|
84
84
|
*/
|
|
85
|
-
async updateSubgroup({ id,
|
|
86
|
-
this.client._require({ id,
|
|
85
|
+
async updateSubgroup({ id, updateData, options = {} }) {
|
|
86
|
+
this.client._require({ id, updateData });
|
|
87
87
|
const safeId = encodeURIComponent(id);
|
|
88
|
-
return this.client(`/subgroup/${safeId}`, { method: "PUT", body:
|
|
88
|
+
return this.client(`/subgroup/${safeId}`, { method: "PUT", body: updateData, ...options });
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
/**
|
package/src/domains/Webhooks.js
CHANGED
|
@@ -45,15 +45,15 @@ export class Webhooks {
|
|
|
45
45
|
* @roles api, admin, developer
|
|
46
46
|
* @param {Object} params - The parameters for updating a webhook
|
|
47
47
|
* @param {string} params.id - The ID of the webhook to update
|
|
48
|
-
* @param {Object} params.
|
|
48
|
+
* @param {Object} params.updateData - The data for the webhook to be updated, including fields such as endpoint URL and event types
|
|
49
49
|
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
50
|
-
* @throws {Error} Throws an error if the id or
|
|
50
|
+
* @throws {Error} Throws an error if the id or updateData parameter is missing
|
|
51
51
|
* @returns {Promise<Object>} The response from the server
|
|
52
52
|
*/
|
|
53
|
-
async updateWebhook({ id,
|
|
54
|
-
this.client._require({ id,
|
|
53
|
+
async updateWebhook({ id, updateData, options = {} }) {
|
|
54
|
+
this.client._require({ id, updateData });
|
|
55
55
|
const safeId = encodeURIComponent(id);
|
|
56
|
-
return this.client(`/webhook/${safeId}`, { method: "PUT", body:
|
|
56
|
+
return this.client(`/webhook/${safeId}`, { method: "PUT", body: updateData, ...options });
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/**
|