@suprsend/web-sdk 1.2.4 → 1.2.6

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": "@suprsend/web-sdk",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "This is sdk used to integrate suprsend functionality in javascript applications",
5
5
  "main": "dist/cjs_bundle.js",
6
6
  "scripts": {
package/src/index.d.ts CHANGED
@@ -72,17 +72,17 @@ interface GetOverAllChannelPreferencesResponse extends PreferenceErrorData {
72
72
  interface Preferences {
73
73
  data: PreferenceData;
74
74
 
75
- get_preferences(args?: { brand_id?: string }): Promise<PreferencesResponse>;
75
+ get_preferences(args?: { tenant_id?: string }): Promise<PreferencesResponse>;
76
76
 
77
77
  get_categories(args?: {
78
- brand_id?: string;
78
+ tenant_id?: string;
79
79
  limit?: number;
80
80
  offset?: number;
81
81
  }): Promise<GetCategoriesResponse>;
82
82
 
83
83
  get_category(
84
84
  category: string,
85
- args?: { brand_id?: string }
85
+ args?: { tenant_id?: string }
86
86
  ): Promise<Category>;
87
87
 
88
88
  get_overall_channel_preferences(): Promise<GetOverAllChannelPreferencesResponse>;
@@ -91,7 +91,7 @@ interface Preferences {
91
91
  category: string,
92
92
  preference: PreferenceOptions,
93
93
  args?: {
94
- brand_id?: string;
94
+ tenant_id?: string;
95
95
  }
96
96
  ): PreferencesResponse;
97
97
 
@@ -100,7 +100,7 @@ interface Preferences {
100
100
  preference: PreferenceOptions,
101
101
  category: string,
102
102
  args?: {
103
- brand_id?: string;
103
+ tenant_id?: string;
104
104
  }
105
105
  ): PreferencesResponse;
106
106
 
@@ -12,7 +12,7 @@ class Preferences {
12
12
  constructor(instance, emitter) {
13
13
  this.ss_instance = instance;
14
14
  this._preference_data;
15
- this._preference_args;
15
+ this._preference_args; // used internally after over_all_channel_preferences update
16
16
  this._emitter = emitter;
17
17
 
18
18
  this._debounced_update_category_preferences = utils.debounce_by_type(
@@ -181,7 +181,8 @@ class Preferences {
181
181
 
182
182
  async get_preferences(args = {}) {
183
183
  let url_path = "full_preference";
184
- let query_params = { brand_id: args?.brand_id };
184
+ this._preference_args = args;
185
+ let query_params = { tenant_id: args?.tenant_id };
185
186
 
186
187
  const response = await this._get_request(url_path, query_params);
187
188
  if (!response?.error) {
@@ -193,7 +194,7 @@ class Preferences {
193
194
  async get_categories(args = {}) {
194
195
  let url_path = "category";
195
196
  const query_params = {
196
- brand_id: args?.brand_id,
197
+ tenant_id: args?.tenant_id,
197
198
  limit: args?.limit,
198
199
  offset: args?.offset,
199
200
  };
@@ -211,7 +212,7 @@ class Preferences {
211
212
  }
212
213
 
213
214
  let url_path = `category/${category}`;
214
- let query_params = { brand_id: args?.brand_id };
215
+ let query_params = { tenant_id: args?.tenant_id };
215
216
 
216
217
  const response = await this._get_request(url_path, query_params);
217
218
  return response;
@@ -302,7 +303,7 @@ class Preferences {
302
303
  category,
303
304
  request_payload,
304
305
  category_data,
305
- { brand_id: args?.brand_id }
306
+ { tenant_id: args?.tenant_id }
306
307
  );
307
308
 
308
309
  return this.data;
@@ -413,7 +414,7 @@ class Preferences {
413
414
  category,
414
415
  request_payload,
415
416
  category_data,
416
- { brand_id: args?.brand_id }
417
+ { tenant_id: args?.tenant_id }
417
418
  );
418
419
 
419
420
  return this.data;