@maxzima/wa-communicator 1.0.22 → 1.0.24
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.
- package/dist/engine/Communicator/Public/Communicator.js +5 -1
- package/dist/types/TCommunicator.d.ts +10 -1
- package/package.json +1 -1
- package/src/engine/Communicator/Public/Communicator.ts +5 -1
- package/src/types/TCommunicator.ts +10 -1
- package/test/__snapshots__/communicator.spec.ts.snap +2 -2
- package/test/testunits/communicator/general.ts +5 -0
- package/test/testunits/communicator/requests.ts +5 -0
|
@@ -42,7 +42,6 @@ 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_solution: '_',
|
|
46
45
|
device_id: data.deviceId,
|
|
47
46
|
meta,
|
|
48
47
|
mobile: data.phoneNumber,
|
|
@@ -141,6 +140,11 @@ export class Communicator {
|
|
|
141
140
|
device_type: data.deviceType,
|
|
142
141
|
ga_id: data.gaId,
|
|
143
142
|
origin: data.origin,
|
|
143
|
+
gc_id: data.gcId,
|
|
144
|
+
utm_source: data.utmSource,
|
|
145
|
+
utm_medium: data.utmMedium,
|
|
146
|
+
utm_campaign: data.utmCampaign,
|
|
147
|
+
utm_term: data.utmTerm,
|
|
144
148
|
} }));
|
|
145
149
|
return yield this.send({
|
|
146
150
|
method: 'POST',
|
|
@@ -18,7 +18,6 @@ declare type TResponse = {
|
|
|
18
18
|
ok: boolean;
|
|
19
19
|
};
|
|
20
20
|
declare type TSignInStartRequestBody = {
|
|
21
|
-
captcha_solution?: string;
|
|
22
21
|
device_id: string;
|
|
23
22
|
meta: TAccountMeta;
|
|
24
23
|
mobile?: string;
|
|
@@ -103,6 +102,11 @@ declare type TRegistrationRequestBodySource = {
|
|
|
103
102
|
device_type: TRegistrationRequestBodySourceDeviceType;
|
|
104
103
|
ga_id: string;
|
|
105
104
|
origin: string;
|
|
105
|
+
gc_id: string;
|
|
106
|
+
utm_source: string;
|
|
107
|
+
utm_medium: string;
|
|
108
|
+
utm_campaign: string;
|
|
109
|
+
utm_term: string;
|
|
106
110
|
};
|
|
107
111
|
declare type TRegistrationRequestBody = {
|
|
108
112
|
name: string;
|
|
@@ -120,6 +124,11 @@ declare type TRegistrationRequestData = {
|
|
|
120
124
|
hash: TRegistrationRequestBodySource['hash'];
|
|
121
125
|
gaId: TRegistrationRequestBodySource['ga_id'];
|
|
122
126
|
origin: TRegistrationRequestBodySource['origin'];
|
|
127
|
+
gcId: TRegistrationRequestBodySource['gc_id'];
|
|
128
|
+
utmSource: TRegistrationRequestBodySource['utm_source'];
|
|
129
|
+
utmMedium: TRegistrationRequestBodySource['utm_medium'];
|
|
130
|
+
utmCampaign: TRegistrationRequestBodySource['utm_campaign'];
|
|
131
|
+
utmTerm: TRegistrationRequestBodySource['utm_term'];
|
|
123
132
|
};
|
|
124
133
|
declare type TStorageRequestData = {
|
|
125
134
|
accessToken: string;
|
package/package.json
CHANGED
|
@@ -35,7 +35,6 @@ 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_solution: '_',
|
|
39
38
|
device_id: data.deviceId,
|
|
40
39
|
meta,
|
|
41
40
|
mobile: data.phoneNumber,
|
|
@@ -137,6 +136,11 @@ export class Communicator {
|
|
|
137
136
|
device_type: data.deviceType,
|
|
138
137
|
ga_id: data.gaId,
|
|
139
138
|
origin: data.origin,
|
|
139
|
+
gc_id: data.gcId,
|
|
140
|
+
utm_source: data.utmSource,
|
|
141
|
+
utm_medium: data.utmMedium,
|
|
142
|
+
utm_campaign: data.utmCampaign,
|
|
143
|
+
utm_term: data.utmTerm,
|
|
140
144
|
}
|
|
141
145
|
});
|
|
142
146
|
|
|
@@ -23,7 +23,6 @@ type TResponse = {
|
|
|
23
23
|
|
|
24
24
|
/* region signIn */
|
|
25
25
|
type TSignInStartRequestBody = {
|
|
26
|
-
captcha_solution?: string,
|
|
27
26
|
device_id: string,
|
|
28
27
|
meta: TAccountMeta,
|
|
29
28
|
mobile?: string,
|
|
@@ -147,6 +146,11 @@ type TRegistrationRequestBodySource = {
|
|
|
147
146
|
device_type: TRegistrationRequestBodySourceDeviceType,
|
|
148
147
|
ga_id: string,
|
|
149
148
|
origin: string,
|
|
149
|
+
gc_id: string,
|
|
150
|
+
utm_source: string,
|
|
151
|
+
utm_medium: string,
|
|
152
|
+
utm_campaign: string,
|
|
153
|
+
utm_term: string,
|
|
150
154
|
}
|
|
151
155
|
|
|
152
156
|
type TRegistrationRequestBody = {
|
|
@@ -167,6 +171,11 @@ type TRegistrationRequestData = {
|
|
|
167
171
|
hash: TRegistrationRequestBodySource['hash'],
|
|
168
172
|
gaId: TRegistrationRequestBodySource['ga_id'],
|
|
169
173
|
origin: TRegistrationRequestBodySource['origin'],
|
|
174
|
+
gcId: TRegistrationRequestBodySource['gc_id'],
|
|
175
|
+
utmSource: TRegistrationRequestBodySource['utm_source'],
|
|
176
|
+
utmMedium: TRegistrationRequestBodySource['utm_medium'],
|
|
177
|
+
utmCampaign: TRegistrationRequestBodySource['utm_campaign'],
|
|
178
|
+
utmTerm: TRegistrationRequestBodySource['utm_term'],
|
|
170
179
|
}
|
|
171
180
|
/* endregion registration */
|
|
172
181
|
|
|
@@ -84,7 +84,7 @@ Object {
|
|
|
84
84
|
|
|
85
85
|
exports[`Communicator requests registration 1`] = `
|
|
86
86
|
Object {
|
|
87
|
-
"body": "{\\"name\\":\\"_companyName_\\",\\"country_code\\":\\"CAN\\",\\"source\\":{\\"hash\\":\\"_hash_\\",\\"device_type\\":\\"mobile\\",\\"ga_id\\":\\"_gaId_\\",\\"origin\\":\\"_origin_\\"}}",
|
|
87
|
+
"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_\\"}}",
|
|
88
88
|
"headers": Object {
|
|
89
89
|
"Accept": "application/json, text/plain, */*",
|
|
90
90
|
"Authorization": "Bearer _accessToken_",
|
|
@@ -125,7 +125,7 @@ Object {
|
|
|
125
125
|
|
|
126
126
|
exports[`Communicator requests signIn 1`] = `
|
|
127
127
|
Object {
|
|
128
|
-
"body": "{\\"
|
|
128
|
+
"body": "{\\"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",
|
|
@@ -57,6 +57,11 @@ const registrationData: TRegistrationRequestData = {
|
|
|
57
57
|
hash: communicatorTestData.hash,
|
|
58
58
|
gaId: communicatorTestData.gaId,
|
|
59
59
|
origin: communicatorTestData.origin,
|
|
60
|
+
gcId: communicatorTestData.gcId,
|
|
61
|
+
utmSource: communicatorTestData.utmSource,
|
|
62
|
+
utmMedium: communicatorTestData.utmMedium,
|
|
63
|
+
utmCampaign: communicatorTestData.utmCampaign,
|
|
64
|
+
utmTerm: communicatorTestData.utmTerm,
|
|
60
65
|
};
|
|
61
66
|
|
|
62
67
|
const setStorageValuesData: TStorageRequestData = {
|