@signalhousellc/sdk 1.0.47 → 1.0.49
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/Campaigns.js +28 -0
- package/src/domains/Groups.js +91 -90
- package/src/domains/Subgroups.js +110 -106
package/package.json
CHANGED
package/src/domains/Campaigns.js
CHANGED
|
@@ -103,6 +103,17 @@ export class Campaigns {
|
|
|
103
103
|
const safeCampaignId = encodeURIComponent(campaignId);
|
|
104
104
|
return this.client(`/campaign/reject/${safeCampaignId}`, { method: "POST", ...options });
|
|
105
105
|
},
|
|
106
|
+
/**
|
|
107
|
+
* Get CNP campaigns shared with Signal House
|
|
108
|
+
* @async
|
|
109
|
+
* @roles signalhouse
|
|
110
|
+
* @param {Object} params - The parameters for retrieving CNP campaigns
|
|
111
|
+
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
112
|
+
* @returns {Promise<Array>} The response from the server
|
|
113
|
+
*/
|
|
114
|
+
getCNPCampaigns: async ({ options = {} } = {}) => {
|
|
115
|
+
return this.client(`/campaign/cnp`, { method: "GET", ...options });
|
|
116
|
+
},
|
|
106
117
|
};
|
|
107
118
|
}
|
|
108
119
|
}
|
|
@@ -163,6 +174,23 @@ export class Campaigns {
|
|
|
163
174
|
return this.client(`/campaign/${safeCampaignId}`, { method: "PUT", body: campaignData, ...options });
|
|
164
175
|
}
|
|
165
176
|
|
|
177
|
+
/**
|
|
178
|
+
* Add an internal comment/note to a campaign
|
|
179
|
+
* @async
|
|
180
|
+
* @roles signalhouse_admin, signalhouse_user
|
|
181
|
+
* @param {Object} params - The parameters for adding the comment
|
|
182
|
+
* @param {string} params.campaignId - The ID of the campaign
|
|
183
|
+
* @param {string} params.comment - The comment/note text
|
|
184
|
+
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
185
|
+
* @throws {Error} Throws an error if the campaignId or comment parameter is missing
|
|
186
|
+
* @returns {Promise<Object>} The updated campaign object
|
|
187
|
+
*/
|
|
188
|
+
async addCampaignComment({ campaignId, comment, options = {} }) {
|
|
189
|
+
this.client._require({ campaignId, comment });
|
|
190
|
+
const safeCampaignId = encodeURIComponent(campaignId);
|
|
191
|
+
return this.client(`/campaign/${safeCampaignId}/comments`, { method: "POST", body: { comment }, ...options });
|
|
192
|
+
}
|
|
193
|
+
|
|
166
194
|
/**
|
|
167
195
|
* Delete an existing campaign (mark it as EXPIRED). The campaign will still be retrievable
|
|
168
196
|
* @async
|
package/src/domains/Groups.js
CHANGED
|
@@ -1,90 +1,91 @@
|
|
|
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
|
-
*
|
|
82
|
-
* @
|
|
83
|
-
* @
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
+
* Optional CNP fields: cspId (string|null), defaultCnpSubgroupId (string|null)
|
|
82
|
+
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
83
|
+
* @throws {Error} Throws an error if the id or groupData parameter is missing
|
|
84
|
+
* @returns {Promise<Object>} - The updated group object returned from the server
|
|
85
|
+
*/
|
|
86
|
+
async updateGroup({ id, groupData, options = {} }) {
|
|
87
|
+
this.client._require({ id, groupData: groupData });
|
|
88
|
+
const safeId = encodeURIComponent(id);
|
|
89
|
+
return this.client(`/group/${safeId}`, { method: "PUT", body: groupData, ...options });
|
|
90
|
+
}
|
|
91
|
+
}
|
package/src/domains/Subgroups.js
CHANGED
|
@@ -1,106 +1,110 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {Object} CreateSubgroupData
|
|
3
|
-
* @property {string} groupId - The ID of the parent group for the subgroup (must be at least 8 characters long and start with 'G')
|
|
4
|
-
* @property {string} subgroupName - The name of the subgroup (required)
|
|
5
|
-
* @property {string} [contactFirstName] - The first name of the contact person for the subgroup
|
|
6
|
-
* @property {string} [contactLastName] - The last name of the contact person for the subgroup
|
|
7
|
-
* @property {string} [contactMiddleName] - The middle name of the contact person for the subgroup
|
|
8
|
-
* @property {string} [subgroupCompanyName] - The company name associated with the subgroup
|
|
9
|
-
* @property {string} [addressLine1] - The first line of the address for the subgroup
|
|
10
|
-
* @property {string} [addressLine2] - The second line of the address for the subgroup
|
|
11
|
-
* @property {string} [city] - The city for the subgroup's address
|
|
12
|
-
* @property {string} [state] - The state for the subgroup's address
|
|
13
|
-
* @property {string} [country] - The country for the subgroup's address
|
|
14
|
-
* @property {string} [postalCode] - The postal code for the subgroup's address
|
|
15
|
-
* @property {string} [phone] - The phone number for the subgroup
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* @
|
|
22
|
-
* @property {string} [
|
|
23
|
-
* @property {string} [
|
|
24
|
-
* @property {string} [
|
|
25
|
-
* @property {string} [
|
|
26
|
-
* @property {string} [
|
|
27
|
-
* @property {string} [
|
|
28
|
-
* @property {string} [
|
|
29
|
-
* @property {string} [
|
|
30
|
-
* @property {string} [
|
|
31
|
-
* @property {string} [
|
|
32
|
-
* @property {string} [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
*
|
|
47
|
-
* @
|
|
48
|
-
* @
|
|
49
|
-
* @param {
|
|
50
|
-
* @param {
|
|
51
|
-
* @
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
*
|
|
65
|
-
* @
|
|
66
|
-
* @
|
|
67
|
-
* @
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
*
|
|
80
|
-
* @
|
|
81
|
-
* @
|
|
82
|
-
* @
|
|
83
|
-
* @
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
*
|
|
97
|
-
* @
|
|
98
|
-
* @
|
|
99
|
-
* @
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} CreateSubgroupData
|
|
3
|
+
* @property {string} groupId - The ID of the parent group for the subgroup (must be at least 8 characters long and start with 'G')
|
|
4
|
+
* @property {string} subgroupName - The name of the subgroup (required)
|
|
5
|
+
* @property {string} [contactFirstName] - The first name of the contact person for the subgroup
|
|
6
|
+
* @property {string} [contactLastName] - The last name of the contact person for the subgroup
|
|
7
|
+
* @property {string} [contactMiddleName] - The middle name of the contact person for the subgroup
|
|
8
|
+
* @property {string} [subgroupCompanyName] - The company name associated with the subgroup
|
|
9
|
+
* @property {string} [addressLine1] - The first line of the address for the subgroup
|
|
10
|
+
* @property {string} [addressLine2] - The second line of the address for the subgroup
|
|
11
|
+
* @property {string} [city] - The city for the subgroup's address
|
|
12
|
+
* @property {string} [state] - The state for the subgroup's address
|
|
13
|
+
* @property {string} [country] - The country for the subgroup's address
|
|
14
|
+
* @property {string} [postalCode] - The postal code for the subgroup's address
|
|
15
|
+
* @property {string} [phone] - The phone number for the subgroup
|
|
16
|
+
* @property {string} [carrierIdFamily] - Optional agency-managed carrier ID selection ("Default", "ATT", "TMobile", "Verizon", "USCellular", "GoogleVoice", "ClearSky", "Interop"). Setting this field requires signalhouse_api, signalhouse_admin, signalhouse_user, api, admin, developer, or billing role.
|
|
17
|
+
* @property {string|null} [carrierIdRegion] - Optional ClearSky region ("PRClaro", "GuamDocomo", "GuamGTA", "GuamITE") or null; only valid when carrierIdFamily is "ClearSky". Setting this field requires signalhouse_api, signalhouse_admin, signalhouse_user, api, admin, developer, or billing role.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @typedef {Object} UpdateSubgroupData
|
|
22
|
+
* @property {string} [subgroupName] - The name of the subgroup
|
|
23
|
+
* @property {string} [contactFirstName] - The first name of the contact person for the subgroup
|
|
24
|
+
* @property {string} [contactLastName] - The last name of the contact person for the subgroup
|
|
25
|
+
* @property {string} [contactMiddleName] - The middle name of the contact person for the subgroup
|
|
26
|
+
* @property {string} [subgroupCompanyName] - The company name associated with the subgroup
|
|
27
|
+
* @property {string} [addressLine1] - The first line of the address for the subgroup
|
|
28
|
+
* @property {string} [addressLine2] - The second line of the address for the subgroup
|
|
29
|
+
* @property {string} [city] - The city for the subgroup's address
|
|
30
|
+
* @property {string} [state] - The state for the subgroup's address
|
|
31
|
+
* @property {string} [country] - The country for the subgroup's address
|
|
32
|
+
* @property {string} [postalCode] - The postal code for the subgroup's address
|
|
33
|
+
* @property {string} [phone] - The phone number for the subgroup
|
|
34
|
+
* @property {string} [status] - The status of the subgroup (e.g., "active", "inactive")
|
|
35
|
+
* @property {string} [carrierIdFamily] - Optional agency-managed carrier ID selection ("Default", "ATT", "TMobile", "Verizon", "USCellular", "GoogleVoice", "ClearSky", "Interop"). Setting this field requires signalhouse_api, signalhouse_admin, signalhouse_user, api, admin, developer, or billing role.
|
|
36
|
+
* @property {string|null} [carrierIdRegion] - Optional ClearSky region ("PRClaro", "GuamDocomo", "GuamGTA", "GuamITE") or null; only valid when carrierIdFamily is "ClearSky". Setting this field requires signalhouse_api, signalhouse_admin, signalhouse_user, api, admin, developer, or billing role.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
export class Subgroups {
|
|
40
|
+
constructor(client, enableAdmin) {
|
|
41
|
+
this.client = client;
|
|
42
|
+
this.enableAdmin = enableAdmin;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Get a list of subgroups with optional filters
|
|
47
|
+
* @async
|
|
48
|
+
* @roles api, admin, developer, billing, user
|
|
49
|
+
* @param {Object} params - The parameters for getting subgroups
|
|
50
|
+
* @param {string} [params.id] - Filter by subgroup ID
|
|
51
|
+
* @param {string} [params.groupId] - Filter by parent group ID
|
|
52
|
+
* @param {number} [params.page] - The page number for pagination
|
|
53
|
+
* @param {number} [params.limit] - The number of items per page for pagination
|
|
54
|
+
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
55
|
+
* @returns {Promise<Object>} - The list of subgroups returned from the server
|
|
56
|
+
*/
|
|
57
|
+
async getSubgroups({ id, groupId, page, limit, options = {} }) {
|
|
58
|
+
const filters = { id, groupId, page, limit };
|
|
59
|
+
const queryString = this.client._getQueryString(filters);
|
|
60
|
+
return this.client(`/subgroup${queryString}`, { method: "GET", ...options });
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Create a new subgroup with the specified subgroup data
|
|
65
|
+
* @async
|
|
66
|
+
* @roles api, admin, developer, billing, user
|
|
67
|
+
* @param {Object} params - The parameters for creating a subgroup (see CreateSubgroupData typedef for details)
|
|
68
|
+
* @param {CreateSubgroupData} params.subgroupData - The data for the subgroup to be created, including required fields such as groupId and subgroupName
|
|
69
|
+
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
70
|
+
* @throws {Error} Throws an error if the subgroupData parameter is missing or if required fields in subgroupData are missing
|
|
71
|
+
* @returns {Promise<Object>} - The created subgroup object returned from the server
|
|
72
|
+
*/
|
|
73
|
+
async createSubgroup({ subgroupData, options = {} }) {
|
|
74
|
+
this.client._require({ subgroupData: subgroupData });
|
|
75
|
+
return this.client(`/subgroup`, { method: "POST", body: subgroupData, ...options });
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Update an existing subgroup with the specified subgroup data
|
|
80
|
+
* @async
|
|
81
|
+
* @roles api, admin, developer, billing, user
|
|
82
|
+
* @param {Object} params - The parameters for updating a subgroup (see UpdateSubgroupData typedef for details)
|
|
83
|
+
* @param {string} params.id - The ID of the subgroup to update
|
|
84
|
+
* @param {UpdateSubgroupData} params.updateData - The data for the subgroup to be updated, including fields such as subgroupName, contact information, and status
|
|
85
|
+
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
86
|
+
* @throws {Error} Throws an error if the id or updateData parameter is missing
|
|
87
|
+
* @returns {Promise<Object>} - The updated subgroup object returned from the server
|
|
88
|
+
*/
|
|
89
|
+
async updateSubgroup({ id, updateData, options = {} }) {
|
|
90
|
+
this.client._require({ id, updateData });
|
|
91
|
+
const safeId = encodeURIComponent(id);
|
|
92
|
+
return this.client(`/subgroup/${safeId}`, { method: "PUT", body: updateData, ...options });
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Delete a subgroup by its ID (mark as inactive)
|
|
97
|
+
* @async
|
|
98
|
+
* @roles api, admin, developer, billing, user
|
|
99
|
+
* @param {Object} params - The parameters for deleting a subgroup
|
|
100
|
+
* @param {string} params.id - The ID of the subgroup to delete
|
|
101
|
+
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
102
|
+
* @throws {Error} Throws an error if the id parameter is missing
|
|
103
|
+
* @returns {Promise<Object>} - The deleted subgroup object returned from the server
|
|
104
|
+
*/
|
|
105
|
+
async deleteSubgroup({ id, options = {} }) {
|
|
106
|
+
this.client._require({ id });
|
|
107
|
+
const safeId = encodeURIComponent(id);
|
|
108
|
+
return this.client(`/subgroup/${safeId}`, { method: "DELETE", ...options });
|
|
109
|
+
}
|
|
110
|
+
}
|