@maxzima/wa-communicator 1.0.58 → 1.0.60

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.
@@ -4,8 +4,8 @@ export function prepareMetadata(obj) {
4
4
  const result = [];
5
5
  for (const key of registrationMetadataKeys) {
6
6
  const value = (_a = obj[key]) === null || _a === void 0 ? void 0 : _a.trim();
7
- if (typeof value === 'string' && value) {
8
- result.push({ key, value });
7
+ if (value) {
8
+ result.push({ key, value: encodeURIComponent(value) });
9
9
  }
10
10
  }
11
11
  return result;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.58",
2
+ "version": "1.0.60",
3
3
  "name": "@maxzima/wa-communicator",
4
4
  "description": "",
5
5
  "author": "Noname",
@@ -6,8 +6,8 @@ export function prepareMetadata(obj: TRegistrationMetadata): TRegistrationReques
6
6
 
7
7
  for (const key of registrationMetadataKeys) {
8
8
  const value = obj[key]?.trim();
9
- if (typeof value === 'string' && value) {
10
- result.push({ key, value });
9
+ if (value) {
10
+ result.push({ key, value: encodeURIComponent(value) });
11
11
  }
12
12
  }
13
13
 
@@ -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_"},"metadata":[{"key":"wa.country_code","value":"CAN"},{"key":"wa.device_type","value":"mobile"},{"key":"wa.hash","value":"_hash_"},{"key":"google._ga","value":"_ga_"},{"key":"meta._fbp","value":"_fbp_"},{"key":"linkedin.li_fat_id","value":"_li_fat_id_"},{"key":"appsflyer.cuid","value":"_cuid_"}]}",
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_"},"metadata":[{"key":"wa.country_code","value":"CAN"},{"key":"wa.device_type","value":"mobile"},{"key":"wa.hash","value":"_hash_"},{"key":"google.wa_gclid","value":"_gclid_"},{"key":"google._ga","value":"_ga_"},{"key":"meta.wa_fbclid","value":"_fbclid_"},{"key":"meta._fbp","value":"_fbp_"},{"key":"bing.wa_msclkid","value":"_msclkid_"},{"key":"bing._uetvid","value":"_uetvid_"},{"key":"linkedin.li_fat_id","value":"_li_fat_id_"},{"key":"appsflyer.cuid","value":"_cuid_"},{"key":"wa.utm_source","value":"_utmSource_"},{"key":"wa.utm_medium","value":"_utmMedium_"},{"key":"wa.utm_campaign","value":"_utmCampaign_"},{"key":"wa.utm_term","value":"_utmTerm_"}]}",
112
112
  "headers": {
113
113
  "Accept": "application/json, text/plain, */*",
114
114
  "Authorization": "Bearer _accessToken_",
@@ -41,18 +41,18 @@ const communicatorTestData = {
41
41
  'wa.country_code': 'CAN',
42
42
  'wa.device_type': 'mobile' as TRegistrationRequestBodySourceDeviceType,
43
43
  'wa.hash': '_hash_',
44
- 'google._gcl_aw': '_gcl_aw_',
44
+ 'google.wa_gclid': '_gclid_',
45
45
  'google._ga': '_ga_',
46
- 'meta._fbc': '_fbc_',
46
+ 'meta.wa_fbclid': '_fbclid_',
47
47
  'meta._fbp': '_fbp_',
48
- 'microsoft._uetmsclkid': '_uetmsclkid_',
49
- 'microsoft._uetvid': '_uetvid_',
48
+ 'bing.wa_msclkid': '_msclkid_',
49
+ 'bing._uetvid': '_uetvid_',
50
50
  'linkedin.li_fat_id': '_li_fat_id_',
51
51
  'appsflyer.cuid': '_cuid_',
52
- 'utm.source': '_utmSource_',
53
- 'utm.medium': '_utmMedium_',
54
- 'utm.campaign': '_utmCampaign_',
55
- 'utm.term': '_utmTerm_',
52
+ 'wa.utm_source': '_utmSource_',
53
+ 'wa.utm_medium': '_utmMedium_',
54
+ 'wa.utm_campaign': '_utmCampaign_',
55
+ 'wa.utm_term': '_utmTerm_',
56
56
  }
57
57
  };
58
58