@signalhousellc/sdk 1.0.2 → 1.0.4

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.2",
3
+ "version": "1.0.4",
4
4
  "description": "Signal House SDK for use with the Signal House platform",
5
5
  "type": "module",
6
6
  "main": "src/SignalHouseSDK.js",
@@ -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, "brandData.subgroupId": brandData.subgroupId });
111
+ this.client._require({ brandData: brandData });
112
112
  return this.client(`/brand`, { method: "POST", body: brandData, ...options });
113
113
  }
114
114
 
@@ -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, "campaignData.brandId": campaignData.brandId });
142
+ this.client._require({ campaignData: campaignData });
143
143
  return this.client(`/campaign`, { method: "POST", body: campaignData, ...options });
144
144
  }
145
145
 
@@ -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, "groupData.groupName": groupData.groupName });
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, "groupData.groupName": groupData.groupName });
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
  }
@@ -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, "subgroupData.subgroupName": subgroupData.subgroupName, "subgroupData.groupId": subgroupData.groupId });
70
+ this.client._require({ subgroupData: subgroupData });
71
71
  return this.client(`/subgroup`, { method: "POST", body: subgroupData, ...options });
72
72
  }
73
73
 
@@ -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.subgroupData - The data for the subgroup to be updated, including fields such as subgroupName, contact information, and status
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 subgroupData parameter is missing
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, subgroupData, options = {} }) {
86
- this.client._require({ id, subgroupData });
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: { updateData: subgroupData }, ...options });
88
+ return this.client(`/subgroup/${safeId}`, { method: "PUT", body: updateData, ...options });
89
89
  }
90
90
 
91
91
  /**
@@ -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, "templateData.templateName": templateData.templateName, "templateData.monthlyFee": templateData.monthlyFee });
34
+ this.client._require({ templateData: templateData });
35
35
  return this.client(`/subscription/template`, { method: "POST", body: templateData, ...options });
36
36
  },
37
37
 
@@ -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, "data.role": data.role, "data.email": data.email, "data.password": data.password });
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 (groupId, email, password)
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, "data.groupId": data.groupId, "data.email": data.email, "data.password": data.password });
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 (groupId, name, role)
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, "data.groupId": data.groupId, "data.name": data.name, "data.role": data.role });
127
+ this.client._require({ data: data });
128
128
  return this.client(`/user/serviceuser`, { method: "POST", body: data, ...options });
129
129
  }
130
130
 
@@ -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.webhookData - The data for the webhook to be updated, including fields such as endpoint URL and event types
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 webhookData parameter is missing
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, webhookData, options = {} }) {
54
- this.client._require({ id, webhookData: webhookData });
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: { updateData: webhookData }, ...options });
56
+ return this.client(`/webhook/${safeId}`, { method: "PUT", body: updateData, ...options });
57
57
  }
58
58
 
59
59
  /**