@signalhousellc/sdk 1.0.46 → 1.0.48
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/README.md +38 -38
- package/package.json +1 -1
- package/src/domains/Auth.js +54 -54
- package/src/domains/Billing.js +20 -0
- package/src/domains/Campaigns.js +17 -0
- package/src/domains/Groups.js +90 -90
- package/src/domains/Landings.js +132 -132
- package/src/domains/Messages.js +1 -1
- package/src/domains/Notifications.js +56 -56
- package/src/domains/Shortlinks.js +44 -44
- package/src/domains/Subgroups.js +110 -106
- package/src/domains/Subscriptions.js +140 -140
- package/src/domains/Webhooks.js +74 -74
package/README.md
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
# @signalhouse/sdk
|
|
2
|
-
|
|
3
|
-
A lightweight Node.js SDK for the Signal House platform.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @signalhouse/sdk
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Quick Start
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
import { SignalHouseSDK } from '@signalhouse/sdk';
|
|
15
|
-
|
|
16
|
-
const sdk = new SignalHouseSDK({
|
|
17
|
-
apiKey: 'your-api-key',
|
|
18
|
-
baseUrl: 'api url'
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const token = await sdk.auth.login({
|
|
22
|
-
email: 'youremail',
|
|
23
|
-
password: 'yourpassword'
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
console.log(token);
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Features
|
|
30
|
-
Full support for Signal House API v2
|
|
31
|
-
Integrated Axios with standardized returns
|
|
32
|
-
Lightweight and tree-shakeable
|
|
33
|
-
|
|
34
|
-
Documentation
|
|
35
|
-
For full API reference and advanced usage, visit https://api.signalhouse.io
|
|
36
|
-
|
|
37
|
-
License
|
|
38
|
-
ISC © Signal House
|
|
1
|
+
# @signalhouse/sdk
|
|
2
|
+
|
|
3
|
+
A lightweight Node.js SDK for the Signal House platform.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @signalhouse/sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Quick Start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
import { SignalHouseSDK } from '@signalhouse/sdk';
|
|
15
|
+
|
|
16
|
+
const sdk = new SignalHouseSDK({
|
|
17
|
+
apiKey: 'your-api-key',
|
|
18
|
+
baseUrl: 'api url'
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const token = await sdk.auth.login({
|
|
22
|
+
email: 'youremail',
|
|
23
|
+
password: 'yourpassword'
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
console.log(token);
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Features
|
|
30
|
+
Full support for Signal House API v2
|
|
31
|
+
Integrated Axios with standardized returns
|
|
32
|
+
Lightweight and tree-shakeable
|
|
33
|
+
|
|
34
|
+
Documentation
|
|
35
|
+
For full API reference and advanced usage, visit https://api.signalhouse.io
|
|
36
|
+
|
|
37
|
+
License
|
|
38
|
+
ISC © Signal House
|
package/package.json
CHANGED
package/src/domains/Auth.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
export class Auth {
|
|
2
|
-
constructor(client, enableAdmin) {
|
|
3
|
-
this.client = client;
|
|
4
|
-
this.enableAdmin = enableAdmin;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Login with email and password
|
|
9
|
-
* @async
|
|
10
|
-
* @roles public
|
|
11
|
-
* @param {Object} params
|
|
12
|
-
* @param {string} params.email - The user's email address
|
|
13
|
-
* @param {string} params.password - The user's password
|
|
14
|
-
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
15
|
-
* @returns {Promise<Object>} The response from the server
|
|
16
|
-
*/
|
|
17
|
-
async login({ email, password, options = {} }) {
|
|
18
|
-
return this.client(`/auth`, { method: "POST", body: { email, password }, ...options });
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Reset a user's password
|
|
23
|
-
* @async
|
|
24
|
-
* @roles api, admin, self
|
|
25
|
-
* @param {Object} params
|
|
26
|
-
* @param {string} params.userId - The id of the user
|
|
27
|
-
* @param {string} params.newPassword - The new password to set for the user
|
|
28
|
-
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
29
|
-
* @returns {Promise<Object>} The response from the server
|
|
30
|
-
*/
|
|
31
|
-
async resetPassword({ userId, newPassword, options = {} }) {
|
|
32
|
-
this.client._require({ userId, newPassword });
|
|
33
|
-
const safeUserId = encodeURIComponent(userId);
|
|
34
|
-
return this.client(`/auth/resetpassword/${safeUserId}`, { method: "PUT", body: { newPassword }, ...options });
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Get token login history for a group or user
|
|
39
|
-
* @async
|
|
40
|
-
* @roles signalhouse_admin, signalhouse_api, signalhouse_user, admin, api (groupId query); self (userId query)
|
|
41
|
-
* @param {Object} params
|
|
42
|
-
* @param {string} [params.groupId] - Returns history for all users in the group (one of groupId/userId required)
|
|
43
|
-
* @param {string} [params.userId] - Returns history for a specific user (one of groupId/userId required)
|
|
44
|
-
* @param {number} [params.page] - Page number (min 1, default 1)
|
|
45
|
-
* @param {number} [params.limit] - Results per page (min 1, max 100, default 20)
|
|
46
|
-
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
47
|
-
* @returns {Promise<Object>} The response from the server
|
|
48
|
-
*/
|
|
49
|
-
async getAuthHistory({ groupId, userId, page, limit, options = {} }) {
|
|
50
|
-
this.client._require({ "groupId or userId": groupId ?? userId });
|
|
51
|
-
const queryString = this.client._getQueryString({ groupId, userId, page, limit });
|
|
52
|
-
return this.client(`/auth/history${queryString}`, { method: "GET", ...options });
|
|
53
|
-
}
|
|
54
|
-
}
|
|
1
|
+
export class Auth {
|
|
2
|
+
constructor(client, enableAdmin) {
|
|
3
|
+
this.client = client;
|
|
4
|
+
this.enableAdmin = enableAdmin;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Login with email and password
|
|
9
|
+
* @async
|
|
10
|
+
* @roles public
|
|
11
|
+
* @param {Object} params
|
|
12
|
+
* @param {string} params.email - The user's email address
|
|
13
|
+
* @param {string} params.password - The user's password
|
|
14
|
+
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
15
|
+
* @returns {Promise<Object>} The response from the server
|
|
16
|
+
*/
|
|
17
|
+
async login({ email, password, options = {} }) {
|
|
18
|
+
return this.client(`/auth`, { method: "POST", body: { email, password }, ...options });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Reset a user's password
|
|
23
|
+
* @async
|
|
24
|
+
* @roles api, admin, self
|
|
25
|
+
* @param {Object} params
|
|
26
|
+
* @param {string} params.userId - The id of the user
|
|
27
|
+
* @param {string} params.newPassword - The new password to set for the user
|
|
28
|
+
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
29
|
+
* @returns {Promise<Object>} The response from the server
|
|
30
|
+
*/
|
|
31
|
+
async resetPassword({ userId, newPassword, options = {} }) {
|
|
32
|
+
this.client._require({ userId, newPassword });
|
|
33
|
+
const safeUserId = encodeURIComponent(userId);
|
|
34
|
+
return this.client(`/auth/resetpassword/${safeUserId}`, { method: "PUT", body: { newPassword }, ...options });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Get token login history for a group or user
|
|
39
|
+
* @async
|
|
40
|
+
* @roles signalhouse_admin, signalhouse_api, signalhouse_user, admin, api (groupId query); self (userId query)
|
|
41
|
+
* @param {Object} params
|
|
42
|
+
* @param {string} [params.groupId] - Returns history for all users in the group (one of groupId/userId required)
|
|
43
|
+
* @param {string} [params.userId] - Returns history for a specific user (one of groupId/userId required)
|
|
44
|
+
* @param {number} [params.page] - Page number (min 1, default 1)
|
|
45
|
+
* @param {number} [params.limit] - Results per page (min 1, max 100, default 20)
|
|
46
|
+
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
47
|
+
* @returns {Promise<Object>} The response from the server
|
|
48
|
+
*/
|
|
49
|
+
async getAuthHistory({ groupId, userId, page, limit, options = {} }) {
|
|
50
|
+
this.client._require({ "groupId or userId": groupId ?? userId });
|
|
51
|
+
const queryString = this.client._getQueryString({ groupId, userId, page, limit });
|
|
52
|
+
return this.client(`/auth/history${queryString}`, { method: "GET", ...options });
|
|
53
|
+
}
|
|
54
|
+
}
|
package/src/domains/Billing.js
CHANGED
|
@@ -73,6 +73,26 @@ export class Billing {
|
|
|
73
73
|
return this.client(`/billing/wallet/transactionHistory${queryString}`, { method: "GET", ...options });
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
/**
|
|
77
|
+
* Get payment history (wallet recharge transactions) with server-side pagination
|
|
78
|
+
* @async
|
|
79
|
+
* @roles api, admin, developer, billing, user
|
|
80
|
+
* @param {Object} params - The parameters for filtering payment history
|
|
81
|
+
* @param {string} params.groupId - The ID of the group to filter by
|
|
82
|
+
* @param {string} params.startDate - Start date in YYYY-MM-DD format (inclusive)
|
|
83
|
+
* @param {string} params.endDate - End date in YYYY-MM-DD format (inclusive)
|
|
84
|
+
* @param {number} [params.page=1] - Page number (positive integer)
|
|
85
|
+
* @param {number} [params.limit=10] - Results per page (positive integer, max 10000)
|
|
86
|
+
* @param {string} [params.timezone] - IANA timezone (default: "UTC")
|
|
87
|
+
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
88
|
+
* @returns {Promise<{data: Array<Object>, pagination: {page: number, limit: number, totalRecords: number, totalPages: number, totalAmount: number}}>}
|
|
89
|
+
*/
|
|
90
|
+
async getPaymentHistory({ groupId, startDate, endDate, page, limit, timezone, options = {} }) {
|
|
91
|
+
const filters = { groupId, startDate, endDate, page, limit, timezone };
|
|
92
|
+
const queryString = this.client._getQueryString(filters);
|
|
93
|
+
return this.client(`/billing/wallet/paymentHistory${queryString}`, { method: "GET", ...options });
|
|
94
|
+
}
|
|
95
|
+
|
|
76
96
|
/**
|
|
77
97
|
* Get the wallet information for a specific group
|
|
78
98
|
* @async
|
package/src/domains/Campaigns.js
CHANGED
|
@@ -163,6 +163,23 @@ export class Campaigns {
|
|
|
163
163
|
return this.client(`/campaign/${safeCampaignId}`, { method: "PUT", body: campaignData, ...options });
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
/**
|
|
167
|
+
* Add an internal comment/note to a campaign
|
|
168
|
+
* @async
|
|
169
|
+
* @roles signalhouse_admin, signalhouse_user
|
|
170
|
+
* @param {Object} params - The parameters for adding the comment
|
|
171
|
+
* @param {string} params.campaignId - The ID of the campaign
|
|
172
|
+
* @param {string} params.comment - The comment/note text
|
|
173
|
+
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
174
|
+
* @throws {Error} Throws an error if the campaignId or comment parameter is missing
|
|
175
|
+
* @returns {Promise<Object>} The updated campaign object
|
|
176
|
+
*/
|
|
177
|
+
async addCampaignComment({ campaignId, comment, options = {} }) {
|
|
178
|
+
this.client._require({ campaignId, comment });
|
|
179
|
+
const safeCampaignId = encodeURIComponent(campaignId);
|
|
180
|
+
return this.client(`/campaign/${safeCampaignId}/comments`, { method: "POST", body: { comment }, ...options });
|
|
181
|
+
}
|
|
182
|
+
|
|
166
183
|
/**
|
|
167
184
|
* Delete an existing campaign (mark it as EXPIRED). The campaign will still be retrievable
|
|
168
185
|
* @async
|
package/src/domains/Groups.js
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
export class Groups {
|
|
2
|
-
constructor(client, enableAdmin) {
|
|
3
|
-
this.client = client;
|
|
4
|
-
this.enableAdmin = enableAdmin;
|
|
5
|
-
|
|
6
|
-
// Hidden Admin namespace INSIDE the domain
|
|
7
|
-
if (enableAdmin) {
|
|
8
|
-
this.admin = {
|
|
9
|
-
/**
|
|
10
|
-
* Get a list of all groups with optional pagination parameters
|
|
11
|
-
* @async
|
|
12
|
-
* @roles signalhouse
|
|
13
|
-
* @param {Object} params - The parameters for getting groups
|
|
14
|
-
* @param {number} [params.page] - The page number for pagination
|
|
15
|
-
* @param {number} [params.limit] - The number of items per page
|
|
16
|
-
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
17
|
-
* @returns {Promise<Object>} - The list of groups returned from the server
|
|
18
|
-
*/
|
|
19
|
-
getGroups: async ({ page, limit, options = {} }) => {
|
|
20
|
-
const filters = { page, limit };
|
|
21
|
-
const queryString = this.client._getQueryString(filters);
|
|
22
|
-
return this.client(`/group${queryString}`, { method: "GET", ...options });
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Create a new group with the specified group data
|
|
27
|
-
* @async
|
|
28
|
-
* @roles signalhouse
|
|
29
|
-
* @param {Object} params - The parameters for creating a new group
|
|
30
|
-
* @param {Object} params.groupData - The data for the new group, including required fields such as groupName
|
|
31
|
-
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
32
|
-
* @throws {Error} Throws an error if the groupData parameter is missing or if required fields within groupData are missing
|
|
33
|
-
* @returns {Promise<Object>} - The created group object returned from the server
|
|
34
|
-
*/
|
|
35
|
-
createGroup: async ({ groupData, options = {} }) => {
|
|
36
|
-
this.client._require({ groupData: groupData });
|
|
37
|
-
return this.client(`/group`, { method: "POST", body: groupData, ...options });
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Delete a group with the specified group ID
|
|
42
|
-
* @async
|
|
43
|
-
* @roles signalhouse
|
|
44
|
-
* @param {Object} params - The parameters for deleting a group
|
|
45
|
-
* @param {string} params.groupId - The ID of the group to delete
|
|
46
|
-
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
47
|
-
* @throws {Error} Throws an error if the groupId parameter is missing
|
|
48
|
-
* @returns {Promise<Object>} - The deleted group object returned from the server
|
|
49
|
-
*/
|
|
50
|
-
deleteGroup: async ({ groupId, options = {} }) => {
|
|
51
|
-
this.client._require({ groupId });
|
|
52
|
-
const safeGroupId = encodeURIComponent(groupId);
|
|
53
|
-
return this.client(`/group/${safeGroupId}`, { method: "DELETE", ...options });
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Get details of a group by its ID
|
|
61
|
-
* @async
|
|
62
|
-
* @roles api, admin, developer, billing, user
|
|
63
|
-
* @param {Object} params - The parameters for getting a group
|
|
64
|
-
* @param {string} params.id - The ID of the group to retrieve
|
|
65
|
-
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
66
|
-
* @returns {Promise<Object>} - The group object returned from the server
|
|
67
|
-
*/
|
|
68
|
-
async getGroup({ id, options = {} }) {
|
|
69
|
-
const filters = { id };
|
|
70
|
-
const queryString = this.client._getQueryString(filters);
|
|
71
|
-
return this.client(`/group${queryString}`, { method: "GET", ...options });
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Update a group with the specified group data
|
|
76
|
-
* @async
|
|
77
|
-
* @roles api, admin, developer, billing
|
|
78
|
-
* @param {Object} params - The parameters for updating a group
|
|
79
|
-
* @param {string} params.id - The ID of the group to update
|
|
80
|
-
* @param {Object} params.groupData - The data for the group, including required fields such as groupName
|
|
81
|
-
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
82
|
-
* @throws {Error} Throws an error if the id or groupData parameter is missing
|
|
83
|
-
* @returns {Promise<Object>} - The updated group object returned from the server
|
|
84
|
-
*/
|
|
85
|
-
async updateGroup({ id, groupData, options = {} }) {
|
|
86
|
-
this.client._require({ id, groupData: groupData });
|
|
87
|
-
const safeId = encodeURIComponent(id);
|
|
88
|
-
return this.client(`/group/${safeId}`, { method: "PUT", body: groupData, ...options });
|
|
89
|
-
}
|
|
90
|
-
}
|
|
1
|
+
export class Groups {
|
|
2
|
+
constructor(client, enableAdmin) {
|
|
3
|
+
this.client = client;
|
|
4
|
+
this.enableAdmin = enableAdmin;
|
|
5
|
+
|
|
6
|
+
// Hidden Admin namespace INSIDE the domain
|
|
7
|
+
if (enableAdmin) {
|
|
8
|
+
this.admin = {
|
|
9
|
+
/**
|
|
10
|
+
* Get a list of all groups with optional pagination parameters
|
|
11
|
+
* @async
|
|
12
|
+
* @roles signalhouse
|
|
13
|
+
* @param {Object} params - The parameters for getting groups
|
|
14
|
+
* @param {number} [params.page] - The page number for pagination
|
|
15
|
+
* @param {number} [params.limit] - The number of items per page
|
|
16
|
+
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
17
|
+
* @returns {Promise<Object>} - The list of groups returned from the server
|
|
18
|
+
*/
|
|
19
|
+
getGroups: async ({ page, limit, options = {} }) => {
|
|
20
|
+
const filters = { page, limit };
|
|
21
|
+
const queryString = this.client._getQueryString(filters);
|
|
22
|
+
return this.client(`/group${queryString}`, { method: "GET", ...options });
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Create a new group with the specified group data
|
|
27
|
+
* @async
|
|
28
|
+
* @roles signalhouse
|
|
29
|
+
* @param {Object} params - The parameters for creating a new group
|
|
30
|
+
* @param {Object} params.groupData - The data for the new group, including required fields such as groupName
|
|
31
|
+
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
32
|
+
* @throws {Error} Throws an error if the groupData parameter is missing or if required fields within groupData are missing
|
|
33
|
+
* @returns {Promise<Object>} - The created group object returned from the server
|
|
34
|
+
*/
|
|
35
|
+
createGroup: async ({ groupData, options = {} }) => {
|
|
36
|
+
this.client._require({ groupData: groupData });
|
|
37
|
+
return this.client(`/group`, { method: "POST", body: groupData, ...options });
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Delete a group with the specified group ID
|
|
42
|
+
* @async
|
|
43
|
+
* @roles signalhouse
|
|
44
|
+
* @param {Object} params - The parameters for deleting a group
|
|
45
|
+
* @param {string} params.groupId - The ID of the group to delete
|
|
46
|
+
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
47
|
+
* @throws {Error} Throws an error if the groupId parameter is missing
|
|
48
|
+
* @returns {Promise<Object>} - The deleted group object returned from the server
|
|
49
|
+
*/
|
|
50
|
+
deleteGroup: async ({ groupId, options = {} }) => {
|
|
51
|
+
this.client._require({ groupId });
|
|
52
|
+
const safeGroupId = encodeURIComponent(groupId);
|
|
53
|
+
return this.client(`/group/${safeGroupId}`, { method: "DELETE", ...options });
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Get details of a group by its ID
|
|
61
|
+
* @async
|
|
62
|
+
* @roles api, admin, developer, billing, user
|
|
63
|
+
* @param {Object} params - The parameters for getting a group
|
|
64
|
+
* @param {string} params.id - The ID of the group to retrieve
|
|
65
|
+
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
66
|
+
* @returns {Promise<Object>} - The group object returned from the server
|
|
67
|
+
*/
|
|
68
|
+
async getGroup({ id, options = {} }) {
|
|
69
|
+
const filters = { id };
|
|
70
|
+
const queryString = this.client._getQueryString(filters);
|
|
71
|
+
return this.client(`/group${queryString}`, { method: "GET", ...options });
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Update a group with the specified group data
|
|
76
|
+
* @async
|
|
77
|
+
* @roles api, admin, developer, billing
|
|
78
|
+
* @param {Object} params - The parameters for updating a group
|
|
79
|
+
* @param {string} params.id - The ID of the group to update
|
|
80
|
+
* @param {Object} params.groupData - The data for the group, including required fields such as groupName
|
|
81
|
+
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
82
|
+
* @throws {Error} Throws an error if the id or groupData parameter is missing
|
|
83
|
+
* @returns {Promise<Object>} - The updated group object returned from the server
|
|
84
|
+
*/
|
|
85
|
+
async updateGroup({ id, groupData, options = {} }) {
|
|
86
|
+
this.client._require({ id, groupData: groupData });
|
|
87
|
+
const safeId = encodeURIComponent(id);
|
|
88
|
+
return this.client(`/group/${safeId}`, { method: "PUT", body: groupData, ...options });
|
|
89
|
+
}
|
|
90
|
+
}
|