@maxzima/wa-communicator 1.0.59 → 1.0.61

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.
@@ -1 +1 @@
1
- export declare const registrationMetadataKeys: readonly ["wa.country_code", "wa.device_type", "wa.hash", "google.wa_gclid", "google._ga", "meta.wa_fbclid", "meta._fbp", "bing.wa_msclkid", "bing._uetvid", "linkedin.li_fat_id", "appsflyer.cuid", "wa.utm_source", "wa.utm_medium", "wa.utm_campaign", "wa.utm_term"];
1
+ export declare const registrationMetadataKeys: readonly ["wa.country_code", "wa.device_type", "wa.user_agent", "wa.hash", "wa.ip", "geo.city", "geo.region", "geo.country", "geo.postal", "google.wa_gclid", "google._ga", "meta.wa_fbclid", "meta._fbp", "bing.wa_msclkid", "bing._uetvid", "linkedin.li_fat_id", "appsflyer.cuid", "wa.utm_source", "wa.utm_medium", "wa.utm_campaign", "wa.utm_term"];
@@ -1,7 +1,13 @@
1
1
  export const registrationMetadataKeys = [
2
2
  'wa.country_code',
3
3
  'wa.device_type',
4
+ 'wa.user_agent',
4
5
  'wa.hash',
6
+ 'wa.ip',
7
+ 'geo.city',
8
+ 'geo.region',
9
+ 'geo.country',
10
+ 'geo.postal',
5
11
  'google.wa_gclid',
6
12
  'google._ga',
7
13
  'meta.wa_fbclid',
@@ -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.59",
2
+ "version": "1.0.61",
3
3
  "name": "@maxzima/wa-communicator",
4
4
  "description": "",
5
5
  "author": "Noname",
@@ -1,7 +1,13 @@
1
1
  export const registrationMetadataKeys = [
2
2
  'wa.country_code',
3
3
  'wa.device_type',
4
+ 'wa.user_agent',
4
5
  'wa.hash',
6
+ 'wa.ip',
7
+ 'geo.city',
8
+ 'geo.region',
9
+ 'geo.country',
10
+ 'geo.postal',
5
11
  'google.wa_gclid',
6
12
  'google._ga',
7
13
  'meta.wa_fbclid',
@@ -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