@signalhousellc/sdk 1.0.1 → 1.0.3
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/Auth.js
CHANGED
|
@@ -31,6 +31,6 @@ export class Auth {
|
|
|
31
31
|
async resetPassword({ userId, newPassword, options = {} }) {
|
|
32
32
|
this.client._require({ userId, newPassword });
|
|
33
33
|
const safeUserId = encodeURIComponent(userId);
|
|
34
|
-
return this.client(`/auth/resetpassword/${safeUserId}`, { method: "
|
|
34
|
+
return this.client(`/auth/resetpassword/${safeUserId}`, { method: "PUT", body: { newPassword }, ...options });
|
|
35
35
|
}
|
|
36
36
|
}
|
package/src/domains/Brands.js
CHANGED
|
@@ -108,7 +108,7 @@ export class Brands {
|
|
|
108
108
|
* @returns {Promise<Object>} The response from the server
|
|
109
109
|
*/
|
|
110
110
|
async createBrand({ brandData, options = {} }) {
|
|
111
|
-
this.client._require({ brandData: brandData
|
|
111
|
+
this.client._require({ brandData: brandData });
|
|
112
112
|
return this.client(`/brand`, { method: "POST", body: brandData, ...options });
|
|
113
113
|
}
|
|
114
114
|
|
package/src/domains/Campaigns.js
CHANGED
|
@@ -139,7 +139,7 @@ export class Campaigns {
|
|
|
139
139
|
* @returns {Promise<Object>} The response from the server
|
|
140
140
|
*/
|
|
141
141
|
async createCampaign({ campaignData, options = {} }) {
|
|
142
|
-
this.client._require({ campaignData: campaignData
|
|
142
|
+
this.client._require({ campaignData: campaignData });
|
|
143
143
|
return this.client(`/campaign`, { method: "POST", body: campaignData, ...options });
|
|
144
144
|
}
|
|
145
145
|
|
package/src/domains/Groups.js
CHANGED
|
@@ -33,7 +33,7 @@ export class Groups {
|
|
|
33
33
|
* @returns {Promise<Object>} - The created group object returned from the server
|
|
34
34
|
*/
|
|
35
35
|
createGroup: async ({ groupData, options = {} }) => {
|
|
36
|
-
this.client._require({ groupData: groupData
|
|
36
|
+
this.client._require({ groupData: groupData });
|
|
37
37
|
return this.client(`/group`, { method: "POST", body: groupData, ...options });
|
|
38
38
|
},
|
|
39
39
|
|
|
@@ -63,11 +63,9 @@ export class Groups {
|
|
|
63
63
|
* @param {Object} params - The parameters for getting a group
|
|
64
64
|
* @param {string} params.id - The ID of the group to retrieve
|
|
65
65
|
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
66
|
-
* @throws {Error} Throws an error if the id parameter is missing
|
|
67
66
|
* @returns {Promise<Object>} - The group object returned from the server
|
|
68
67
|
*/
|
|
69
68
|
async getGroup({ id, options = {} }) {
|
|
70
|
-
this.client._require({ id });
|
|
71
69
|
const filters = { id };
|
|
72
70
|
const queryString = this.client._getQueryString(filters);
|
|
73
71
|
return this.client(`/group${queryString}`, { method: "GET", ...options });
|
|
@@ -85,7 +83,7 @@ export class Groups {
|
|
|
85
83
|
* @returns {Promise<Object>} - The updated group object returned from the server
|
|
86
84
|
*/
|
|
87
85
|
async updateGroup({ id, groupData, options = {} }) {
|
|
88
|
-
this.client._require({ id, groupData: groupData
|
|
86
|
+
this.client._require({ id, groupData: groupData });
|
|
89
87
|
const safeId = encodeURIComponent(id);
|
|
90
88
|
return this.client(`/group/${safeId}`, { method: "PUT", body: groupData, ...options });
|
|
91
89
|
}
|
package/src/domains/Subgroups.js
CHANGED
|
@@ -67,7 +67,7 @@ export class Subgroups {
|
|
|
67
67
|
* @returns {Promise<Object>} - The created subgroup object returned from the server
|
|
68
68
|
*/
|
|
69
69
|
async createSubgroup({ subgroupData, options = {} }) {
|
|
70
|
-
this.client._require({ subgroupData: subgroupData
|
|
70
|
+
this.client._require({ subgroupData: subgroupData });
|
|
71
71
|
return this.client(`/subgroup`, { method: "POST", body: subgroupData, ...options });
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -31,7 +31,7 @@ export class Subscriptions {
|
|
|
31
31
|
* @returns {Promise<Object>} - The created subscription template object returned from the server
|
|
32
32
|
*/
|
|
33
33
|
createTemplate: async ({ templateData, options = {} }) => {
|
|
34
|
-
this.client._require({ templateData
|
|
34
|
+
this.client._require({ templateData: templateData });
|
|
35
35
|
return this.client(`/subscription/template`, { method: "POST", body: templateData, ...options });
|
|
36
36
|
},
|
|
37
37
|
|
package/src/domains/Users.js
CHANGED
|
@@ -74,7 +74,7 @@ export class Users {
|
|
|
74
74
|
* @returns {Promise<Object>} - A promise that resolves to the created internal user
|
|
75
75
|
*/
|
|
76
76
|
createInternalUser: async ({ data, options = {} }) => {
|
|
77
|
-
this.client._require({ data: data
|
|
77
|
+
this.client._require({ data: data });
|
|
78
78
|
return this.client(`/user`, { method: "POST", body: data, ...options });
|
|
79
79
|
},
|
|
80
80
|
};
|
|
@@ -105,11 +105,11 @@ export class Users {
|
|
|
105
105
|
* @param {Object} params - The parameters for creating a user (see CreateUserData typedef for details)
|
|
106
106
|
* @param {CreateUserData} params.data - The data for the new user
|
|
107
107
|
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
108
|
-
* @throws {Error} Throws an error if required fields in the data parameter are missing
|
|
108
|
+
* @throws {Error} Throws an error if required fields in the data parameter are missing
|
|
109
109
|
* @returns {Promise<Object>} - A promise that resolves to the created user
|
|
110
110
|
*/
|
|
111
111
|
async createUser({ data, options = {} }) {
|
|
112
|
-
this.client._require({ data: data
|
|
112
|
+
this.client._require({ data: data });
|
|
113
113
|
return this.client(`/user`, { method: "POST", body: data, ...options });
|
|
114
114
|
}
|
|
115
115
|
|
|
@@ -120,11 +120,11 @@ export class Users {
|
|
|
120
120
|
* @param {Object} params - The parameters for creating a service user (see CreateServiceUserData typedef for details)
|
|
121
121
|
* @param {CreateServiceUserData} params.data - The data for the new service user
|
|
122
122
|
* @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
|
|
123
|
-
* @throws {Error} Throws an error if required fields in the data parameter are missing
|
|
123
|
+
* @throws {Error} Throws an error if required fields in the data parameter are missing
|
|
124
124
|
* @returns {Promise<Object>} - A promise that resolves to the created service user
|
|
125
125
|
*/
|
|
126
126
|
async createServiceUser({ data, options = {} }) {
|
|
127
|
-
this.client._require({ data: data
|
|
127
|
+
this.client._require({ data: data });
|
|
128
128
|
return this.client(`/user/serviceuser`, { method: "POST", body: data, ...options });
|
|
129
129
|
}
|
|
130
130
|
|