@maxzima/wa-communicator 1.0.50 → 1.0.51

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.
@@ -227,7 +227,7 @@ export class Communicator {
227
227
  setStorageValues(data) {
228
228
  return __awaiter(this, void 0, void 0, function* () {
229
229
  const headers = this.getHeaders(data.accessToken);
230
- const body = JSON.stringify(Object.assign({ seo_source: data.origin }, (data.productId && { last_profile_id: data.productId })));
230
+ const body = JSON.stringify(Object.assign({ seo_source: data.origin }, (data.profileId && { last_profile_id: data.profileId })));
231
231
  return yield this.send({
232
232
  method: 'POST',
233
233
  url: `${this.props.clientFAPIBaseUrl}${CommunicatorFAPIEndpointEnum.STORAGE}`,
@@ -168,7 +168,7 @@ type TRegistrationRequestData = {
168
168
  type TStorageRequestData = {
169
169
  accessToken: string;
170
170
  origin: string;
171
- productId?: string;
171
+ profileId?: string;
172
172
  };
173
173
  type TGetRestrictedCountriesData = {
174
174
  entityType?: import('@root/enums').CountryTypeEnum;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.50",
2
+ "version": "1.0.51",
3
3
  "name": "@maxzima/wa-communicator",
4
4
  "description": "",
5
5
  "author": "Noname",
@@ -244,7 +244,7 @@ export class Communicator {
244
244
  const headers = this.getHeaders(data.accessToken);
245
245
  const body = JSON.stringify({
246
246
  seo_source: data.origin,
247
- ...(data.productId && { last_profile_id: data.productId })
247
+ ...(data.profileId && { last_profile_id: data.profileId })
248
248
  });
249
249
 
250
250
  return await this.send({
@@ -223,7 +223,7 @@ type TRegistrationRequestData = {
223
223
  type TStorageRequestData = {
224
224
  accessToken: string,
225
225
  origin: string,
226
- productId?: string,
226
+ profileId?: string,
227
227
  }
228
228
  /* endregion registration */
229
229
 
@@ -108,7 +108,7 @@ exports[`Communicator requests profileAssign 1`] = `
108
108
 
109
109
  exports[`Communicator requests registration 1`] = `
110
110
  {
111
- "body": "{"name":"_companyName_","country_code":"CAN","source":{"hash":"_hash_","device_type":"mobile","ga_id":"_gaId_","origin":"_origin_","gc_id":"_gcId_","utm_source":"_utmSource_","utm_medium":"_utmMedium_","utm_campaign":"_utmCampaign_","utm_term":"_utmTerm_"}}",
111
+ "body": "{"name":"_companyName_","country_code":"CAN","source":{"hash":"_hash_","device_type":"mobile","ga_id":"_gaId_","origin":"_origin_","gc_id":"_gcId_","utm_source":"_utmSource_","utm_medium":"_utmMedium_","utm_campaign":"_utmCampaign_","utm_term":"_utmTerm_","fbclid":"_fbclid_"}}",
112
112
  "headers": {
113
113
  "Accept": "application/json, text/plain, */*",
114
114
  "Authorization": "Bearer _accessToken_",
@@ -134,7 +134,7 @@ exports[`Communicator requests setStorageValues 1`] = `
134
134
 
135
135
  exports[`Communicator requests setStorageValuesWithProductId 1`] = `
136
136
  {
137
- "body": "{"seo_source":"_origin_","last_profile_id":"_productId_"}",
137
+ "body": "{"seo_source":"_origin_","last_profile_id":"_profileId_"}",
138
138
  "headers": {
139
139
  "Accept": "application/json, text/plain, */*",
140
140
  "Authorization": "Bearer _accessToken_",
@@ -17,7 +17,8 @@ import {
17
17
  setStorageValuesData,
18
18
  getRestrictedCountriesData,
19
19
  getAssignedProductsData,
20
- profileAssignData, setStorageValuesDataWithProductId,
20
+ profileAssignData,
21
+ setStorageValuesDataWithProfileId,
21
22
  } from "./testunits/communicator/requests";
22
23
  import {communicatorTestData} from "./testunits/communicator/general";
23
24
 
@@ -113,7 +114,7 @@ describe('Communicator requests', () => {
113
114
  });
114
115
 
115
116
  test('setStorageValuesWithProductId', async () => {
116
- const setStorageValuesRequestData = await communicator.setStorageValues(setStorageValuesDataWithProductId);
117
+ const setStorageValuesRequestData = await communicator.setStorageValues(setStorageValuesDataWithProfileId);
117
118
  expect(setStorageValuesRequestData).toMatchSnapshot();
118
119
  });
119
120
 
@@ -35,8 +35,9 @@ const communicatorTestData = {
35
35
  utmMedium: '_utmMedium_',
36
36
  utmCampaign: '_utmCampaign_',
37
37
  utmTerm: '_utmTerm_',
38
+ fbclid: '_fbclid_',
38
39
  userId: '_userId_',
39
- productId: '_productId_',
40
+ profileId: '_profileId_',
40
41
  };
41
42
 
42
43
  export {
@@ -72,6 +72,7 @@ const registrationData: TRegistrationRequestData = {
72
72
  utmMedium: communicatorTestData.utmMedium,
73
73
  utmCampaign: communicatorTestData.utmCampaign,
74
74
  utmTerm: communicatorTestData.utmTerm,
75
+ fbclid: communicatorTestData.fbclid,
75
76
  };
76
77
 
77
78
  const setStorageValuesData: TStorageRequestData = {
@@ -79,10 +80,10 @@ const setStorageValuesData: TStorageRequestData = {
79
80
  origin: communicatorTestData.origin,
80
81
  };
81
82
 
82
- const setStorageValuesDataWithProductId: TStorageRequestData = {
83
+ const setStorageValuesDataWithProfileId: TStorageRequestData = {
83
84
  accessToken: communicatorTestData.accessToken,
84
85
  origin: communicatorTestData.origin,
85
- productId: communicatorTestData.productId
86
+ profileId: communicatorTestData.profileId
86
87
  };
87
88
 
88
89
  const getRestrictedCountriesData: TGetRestrictedCountriesData = {
@@ -109,7 +110,7 @@ export {
109
110
  getCurrentUserProfileData,
110
111
  registrationData,
111
112
  setStorageValuesData,
112
- setStorageValuesDataWithProductId,
113
+ setStorageValuesDataWithProfileId,
113
114
  getRestrictedCountriesData,
114
115
  profileAssignData,
115
116
  getAssignedProductsData