@maxzima/wa-communicator 1.0.66 → 1.0.68

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", "wa.fp_uid", "google.wa_gclid", "google.wa_dclid", "google._ga", "meta.wa_fbclid", "meta._fbp", "bing.wa_msclkid", "bing._uetvid", "linkedin.wa_li_fat_id", "appsflyer.cuid", "appsflyer.uid", "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.hash", "wa.fp_uid", "google.wa_gclid", "google.wa_dclid", "google._ga", "meta.wa_fbclid", "meta._fbp", "bing.wa_msclkid", "bing._uetvid", "linkedin.wa_li_fat_id", "appsflyer.wa_cuid", "appsflyer.wa_uid", "wa.utm_source", "wa.utm_medium", "wa.utm_campaign", "wa.utm_term"];
@@ -11,8 +11,8 @@ export const registrationMetadataKeys = [
11
11
  'bing.wa_msclkid',
12
12
  'bing._uetvid',
13
13
  'linkedin.wa_li_fat_id',
14
- 'appsflyer.cuid',
15
- 'appsflyer.uid',
14
+ 'appsflyer.wa_cuid',
15
+ 'appsflyer.wa_uid',
16
16
  'wa.utm_source',
17
17
  'wa.utm_medium',
18
18
  'wa.utm_campaign',
@@ -44,11 +44,7 @@ export class Communicator {
44
44
  }
45
45
  const headers = this.getHeaders();
46
46
  const meta = this.getMeta(data.browserData);
47
- const body = JSON.stringify({
48
- device_id: data.deviceId,
49
- meta,
50
- mobile: data.phoneNumber,
51
- });
47
+ const body = JSON.stringify(Object.assign(Object.assign({ device_id: data.deviceId, meta, mobile: data.phoneNumber }, (data.captchaSolution && { captcha_solution: data.captchaSolution })), (data.captchaSolutionDecisionSeconds && { captcha_solution_decision_seconds: data.captchaSolutionDecisionSeconds })));
52
48
  const queryParams = {};
53
49
  if (data.outOfBandAllowed) {
54
50
  queryParams['out_of_band_allowed'] = 'true';
@@ -52,6 +52,8 @@ type TSignInByMobileRequestData = {
52
52
  deviceId: string;
53
53
  browserData: TAccountBrowserData;
54
54
  outOfBandAllowed?: boolean;
55
+ captchaSolution?: string;
56
+ captchaSolutionDecisionSeconds?: number;
55
57
  };
56
58
  type TSignInByAppRequestData = {
57
59
  authToken: string;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.66",
2
+ "version": "1.0.68",
3
3
  "name": "@maxzima/wa-communicator",
4
4
  "description": "",
5
5
  "author": "Noname",
@@ -11,8 +11,8 @@ export const registrationMetadataKeys = [
11
11
  'bing.wa_msclkid',
12
12
  'bing._uetvid',
13
13
  'linkedin.wa_li_fat_id',
14
- 'appsflyer.cuid',
15
- 'appsflyer.uid',
14
+ 'appsflyer.wa_cuid',
15
+ 'appsflyer.wa_uid',
16
16
  'wa.utm_source',
17
17
  'wa.utm_medium',
18
18
  'wa.utm_campaign',
@@ -49,6 +49,8 @@ export class Communicator {
49
49
  device_id: data.deviceId,
50
50
  meta,
51
51
  mobile: data.phoneNumber,
52
+ ...(data.captchaSolution && { captcha_solution: data.captchaSolution }),
53
+ ...(data.captchaSolutionDecisionSeconds && { captcha_solution_decision_seconds: data.captchaSolutionDecisionSeconds }),
52
54
  } as TSignInStartRequestBody);
53
55
 
54
56
  const queryParams: TRequestQueryParams = {};
@@ -59,6 +59,8 @@ type TSignInByMobileRequestData = {
59
59
  deviceId: string,
60
60
  browserData: TAccountBrowserData,
61
61
  outOfBandAllowed?: boolean,
62
+ captchaSolution?: string,
63
+ captchaSolutionDecisionSeconds?: number,
62
64
  }
63
65
 
64
66
  type TSignInByAppRequestData = {
@@ -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":"wa.fp_uid","value":"_fp_iud_"},{"key":"google.wa_gclid","value":"_gclid_"},{"key":"google.wa_dclid","value":"_dclid_"},{"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.wa_li_fat_id","value":"_li_fat_id_"},{"key":"appsflyer.cuid","value":"_cuid_"},{"key":"appsflyer.uid","value":"_uid_"},{"key":"wa.utm_source","value":"_utmSource_"},{"key":"wa.utm_medium","value":"_utmMedium_"},{"key":"wa.utm_campaign","value":"_utmCampaign_"},{"key":"wa.utm_term","value":"_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_"},"metadata":[{"key":"wa.country_code","value":"CAN"},{"key":"wa.device_type","value":"mobile"},{"key":"wa.hash","value":"_hash_"},{"key":"wa.fp_uid","value":"_fp_iud_"},{"key":"google.wa_gclid","value":"_gclid_"},{"key":"google.wa_dclid","value":"_dclid_"},{"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.wa_li_fat_id","value":"_li_fat_id_"},{"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_",