@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/dist/cdn_bundle.js +1 -1
- package/dist/cjs_bundle.js +1 -1
- package/package.json +1 -1
- package/src/index.d.ts +5 -5
- package/src/preferences.js +7 -6
package/package.json
CHANGED
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?: {
|
|
75
|
+
get_preferences(args?: { tenant_id?: string }): Promise<PreferencesResponse>;
|
|
76
76
|
|
|
77
77
|
get_categories(args?: {
|
|
78
|
-
|
|
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?: {
|
|
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
|
-
|
|
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
|
-
|
|
103
|
+
tenant_id?: string;
|
|
104
104
|
}
|
|
105
105
|
): PreferencesResponse;
|
|
106
106
|
|
package/src/preferences.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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 = {
|
|
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
|
-
{
|
|
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
|
-
{
|
|
417
|
+
{ tenant_id: args?.tenant_id }
|
|
417
418
|
);
|
|
418
419
|
|
|
419
420
|
return this.data;
|