@maxzima/wa-communicator 1.0.20 → 1.0.22

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.
@@ -42,7 +42,8 @@ export class Communicator {
42
42
  const headers = this.getHeaders();
43
43
  const meta = this.getMeta(data.browserData);
44
44
  const body = JSON.stringify({
45
- captcha_response: '_',
45
+ captcha_solution: '_',
46
+ device_id: data.deviceId,
46
47
  meta,
47
48
  mobile: data.phoneNumber,
48
49
  });
@@ -18,7 +18,8 @@ declare type TResponse = {
18
18
  ok: boolean;
19
19
  };
20
20
  declare type TSignInStartRequestBody = {
21
- captcha_response?: string;
21
+ captcha_solution?: string;
22
+ device_id: string;
22
23
  meta: TAccountMeta;
23
24
  mobile?: string;
24
25
  };
@@ -39,6 +40,7 @@ declare type TAccountBrowserData = {
39
40
  };
40
41
  declare type TSignInByMobileRequestData = {
41
42
  phoneNumber: string;
43
+ deviceId: string;
42
44
  browserData: TAccountBrowserData;
43
45
  };
44
46
  declare type TSignInByMobileResponse = {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.20",
2
+ "version": "1.0.22",
3
3
  "name": "@maxzima/wa-communicator",
4
4
  "description": "",
5
5
  "author": "Noname",
@@ -7,7 +7,7 @@
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "engines": {
10
- "node": ">=14"
10
+ "node": ">=20.11.1 <21"
11
11
  },
12
12
  "repository": {
13
13
  "type": "git",
@@ -23,7 +23,8 @@
23
23
  }
24
24
  ],
25
25
  "scripts": {
26
- "prepublishOnly": "npm run test && npm run build && npm run size",
26
+ "postinstall": "engine-version",
27
+ "prepublishOnly": "engine-version && npm run test && npm run build && npm run size",
27
28
  "clean": "node tools/cleanup",
28
29
  "build": "npm run clean && run-p build:*",
29
30
  "build:esm": "tsc -p config/tsconfig.esm.json",
@@ -40,6 +41,7 @@
40
41
  "@types/jest": "28.1.8",
41
42
  "@typescript-eslint/eslint-plugin": "5.59.5",
42
43
  "@typescript-eslint/parser": "5.59.5",
44
+ "engine-version": "^1.0.2",
43
45
  "eslint": "8.40.0",
44
46
  "eslint-config-prettier": "8.8.0",
45
47
  "eslint-plugin-editorconfig": "4.0.3",
@@ -35,7 +35,8 @@ export class Communicator {
35
35
  const headers = this.getHeaders();
36
36
  const meta = this.getMeta(data.browserData);
37
37
  const body = JSON.stringify({
38
- captcha_response: '_',
38
+ captcha_solution: '_',
39
+ device_id: data.deviceId,
39
40
  meta,
40
41
  mobile: data.phoneNumber,
41
42
  } as TSignInStartRequestBody);
@@ -23,7 +23,8 @@ type TResponse = {
23
23
 
24
24
  /* region signIn */
25
25
  type TSignInStartRequestBody = {
26
- captcha_response?: string,
26
+ captcha_solution?: string,
27
+ device_id: string,
27
28
  meta: TAccountMeta,
28
29
  mobile?: string,
29
30
  }
@@ -47,6 +48,7 @@ type TAccountBrowserData = {
47
48
 
48
49
  type TSignInByMobileRequestData = {
49
50
  phoneNumber: string,
51
+ deviceId: string,
50
52
  browserData: TAccountBrowserData,
51
53
  }
52
54
 
@@ -125,7 +125,7 @@ Object {
125
125
 
126
126
  exports[`Communicator requests signIn 1`] = `
127
127
  Object {
128
- "body": "{\\"captcha_response\\":\\"_\\",\\"meta\\":{\\"audit_source_type\\":\\"Backend\\",\\"browser_page_resolution\\":\\"800x600\\",\\"cookies_enabled\\":true,\\"ip\\":\\"127.0.0.1\\",\\"js_enabled\\":true,\\"language\\":\\"ENG\\",\\"user_agent\\":\\"_userAgent_\\"},\\"mobile\\":\\"+16234401486\\"}",
128
+ "body": "{\\"captcha_solution\\":\\"_\\",\\"device_id\\":\\"ov4lNmyk7armoC5DMiOpL5hl846kVQgS\\",\\"meta\\":{\\"audit_source_type\\":\\"Backend\\",\\"browser_page_resolution\\":\\"800x600\\",\\"cookies_enabled\\":true,\\"ip\\":\\"127.0.0.1\\",\\"js_enabled\\":true,\\"language\\":\\"ENG\\",\\"user_agent\\":\\"_userAgent_\\"},\\"mobile\\":\\"+16234401486\\"}",
129
129
  "headers": Object {
130
130
  "Accept": "application/json, text/plain, */*",
131
131
  "Content-Type": "application/json",
@@ -18,6 +18,7 @@ const communicatorTestData = {
18
18
  challenge: 'email_otp' as TChallenge,
19
19
  companyName: '_companyName_',
20
20
  deviceType: 'mobile' as TRegistrationRequestBodySourceDeviceType,
21
+ deviceId: 'ov4lNmyk7armoC5DMiOpL5hl846kVQgS',
21
22
  otpCode: '123456',
22
23
  countryCode: 'CAN',
23
24
  authToken: '_authToken_',
@@ -14,6 +14,7 @@ import {communicatorTestData} from "./general";
14
14
  import {CountryTypeEnum} from "../../../src/enums";
15
15
 
16
16
  const signInData: TSignInByMobileRequestData = {
17
+ deviceId: communicatorTestData.deviceId,
17
18
  phoneNumber: communicatorTestData.phoneNumber,
18
19
  browserData: communicatorTestData.browserData,
19
20
  };