@maxzima/wa-communicator 1.0.41 → 1.0.43
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/AccountTracker/Enums/AccountTrackerEnum.d.ts +3 -1
- package/dist/engine/AccountTracker/Enums/AccountTrackerEnum.js +2 -0
- package/dist/engine/AccountTracker/Public/AccountTracker.d.ts +2 -0
- package/dist/engine/AccountTracker/Public/AccountTracker.js +6 -0
- package/dist/engine/AccountTracker/Types/TAccountTracker.d.ts +11 -1
- package/dist/engine/AccountTracker/Types/TAccountTracker.js +1 -1
- package/dist/index.d.ts +1 -1
- package/jest.config.js +11 -6
- package/package.json +17 -14
- package/src/engine/AccountTracker/Enums/AccountTrackerEnum.ts +2 -0
- package/src/engine/AccountTracker/Public/AccountTracker.ts +9 -1
- package/src/engine/AccountTracker/Types/TAccountTracker.ts +16 -1
- package/src/index.ts +8 -8
- package/test/__snapshots__/communicator.spec.ts.snap +39 -39
- package/test/accountTracker.spec.ts +13 -0
- package/test/testunits/accountTracker/events.ts +24 -1
- package/tsconfig.json +2 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare enum GTMEventEnum {
|
|
2
2
|
SIGN_UP = "sign_up",
|
|
3
|
-
SIGN_UP_ONLINE = "sign_up_online"
|
|
3
|
+
SIGN_UP_ONLINE = "sign_up_online",
|
|
4
|
+
VERIFY_EMAIL_ONLINE = "verify_email_online",
|
|
5
|
+
VERIFY_PHONE_ONLINE = "verify_phone_online"
|
|
4
6
|
}
|
|
5
7
|
export declare enum GTMEventParamsEnum {
|
|
6
8
|
GCLID = "gclid",
|
|
@@ -2,6 +2,8 @@ export var GTMEventEnum;
|
|
|
2
2
|
(function (GTMEventEnum) {
|
|
3
3
|
GTMEventEnum["SIGN_UP"] = "sign_up";
|
|
4
4
|
GTMEventEnum["SIGN_UP_ONLINE"] = "sign_up_online";
|
|
5
|
+
GTMEventEnum["VERIFY_EMAIL_ONLINE"] = "verify_email_online";
|
|
6
|
+
GTMEventEnum["VERIFY_PHONE_ONLINE"] = "verify_phone_online";
|
|
5
7
|
})(GTMEventEnum || (GTMEventEnum = {}));
|
|
6
8
|
export var GTMEventParamsEnum;
|
|
7
9
|
(function (GTMEventParamsEnum) {
|
|
@@ -3,6 +3,8 @@ export declare class AccountTracker {
|
|
|
3
3
|
private props;
|
|
4
4
|
constructor(props: TAccountTrackerProps);
|
|
5
5
|
sendRegistrationSuccessEvent(eventParams: TAccountTrackerEventParams): void;
|
|
6
|
+
sendVerifyPhoneSuccessEvent(eventParams: TAccountTrackerEventParams): void;
|
|
7
|
+
sendVerifyEmailSuccessEvent(eventParams: TAccountTrackerEventParams): void;
|
|
6
8
|
private sendGtmEvent;
|
|
7
9
|
private sendLinkedInEvent;
|
|
8
10
|
}
|
|
@@ -27,4 +27,10 @@ export class AccountTracker {
|
|
|
27
27
|
this.sendGtmEvent(GTMEventEnum.SIGN_UP_ONLINE, eventParams.gtm);
|
|
28
28
|
this.sendLinkedInEvent(LintrkEventIdEnum.REGISTRATION);
|
|
29
29
|
}
|
|
30
|
+
sendVerifyPhoneSuccessEvent(eventParams) {
|
|
31
|
+
this.sendGtmEvent(GTMEventEnum.VERIFY_PHONE_ONLINE, eventParams.gtm);
|
|
32
|
+
}
|
|
33
|
+
sendVerifyEmailSuccessEvent(eventParams) {
|
|
34
|
+
this.sendGtmEvent(GTMEventEnum.VERIFY_EMAIL_ONLINE, eventParams.gtm);
|
|
35
|
+
}
|
|
30
36
|
}
|
|
@@ -12,7 +12,7 @@ export type TAccountTrackerEventParams = {
|
|
|
12
12
|
export type TAccountTrackerGtmEventParamsMapping = {
|
|
13
13
|
[event in GTMEventEnum]: TAccountTrackerGtmEventParams;
|
|
14
14
|
};
|
|
15
|
-
export type TAccountTrackerGtmEventParams = TAccountTrackerGtmSignUpEventParams | TAccountTrackerGtmSignUpOnlineEventParams;
|
|
15
|
+
export type TAccountTrackerGtmEventParams = TAccountTrackerGtmSignUpEventParams | TAccountTrackerGtmSignUpOnlineEventParams | TAccountTrackerGtmVerifyPhoneOnlineEventParams | TAccountTrackerGtmVerifyEmailOnlineEventParams;
|
|
16
16
|
export type TAccountTrackerGtmSignUpEventParams = {
|
|
17
17
|
[GTMEventParamsEnum.GCLID]: string;
|
|
18
18
|
[GTMEventParamsEnum.EMAIL]: string;
|
|
@@ -23,3 +23,13 @@ export type TAccountTrackerGtmSignUpOnlineEventParams = {
|
|
|
23
23
|
[GTMEventParamsEnum.SEND_TO]: string;
|
|
24
24
|
[GTMEventParamsEnum.GCL_ID]: string;
|
|
25
25
|
};
|
|
26
|
+
export type TAccountTrackerGtmVerifyPhoneOnlineEventParams = {
|
|
27
|
+
[GTMEventParamsEnum.ORIGIN]: string;
|
|
28
|
+
[GTMEventParamsEnum.SEND_TO]: string;
|
|
29
|
+
[GTMEventParamsEnum.GCL_ID]: string;
|
|
30
|
+
};
|
|
31
|
+
export type TAccountTrackerGtmVerifyEmailOnlineEventParams = {
|
|
32
|
+
[GTMEventParamsEnum.ORIGIN]: string;
|
|
33
|
+
[GTMEventParamsEnum.SEND_TO]: string;
|
|
34
|
+
[GTMEventParamsEnum.GCL_ID]: string;
|
|
35
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import { GTMEventParamsEnum } from "./../Enums/AccountTrackerEnum";
|
|
1
|
+
import { GTMEventEnum, GTMEventParamsEnum, LintrkActionTypeEnum, LintrkEventIdEnum } from "./../Enums/AccountTrackerEnum";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { Communicator, AccountTracker } from "./engine";
|
|
2
2
|
export { CommunicatorUpdateChallengeCustomErrorCodeEnum, CommunicatorVerifyChallengeCustomErrorCodeEnum, CommunicatorEmailCustomErrorCodeEnum, } from "./enums";
|
|
3
|
-
export {
|
|
3
|
+
export type { TChallenge, TResponse, TSignInByMobileResponse, TSetupChallengeResponse, TVerifyChallengeResponse, TCreateSessionResponse, TGetCurrentUserProfileResponseUser, } from "./types";
|
package/jest.config.js
CHANGED
|
@@ -2,17 +2,22 @@
|
|
|
2
2
|
const { defaultsESM: tsjPreset } = require('ts-jest/presets');
|
|
3
3
|
|
|
4
4
|
module.exports = {
|
|
5
|
+
preset: 'ts-jest/presets/default-esm',
|
|
5
6
|
roots: ['<rootDir>/test'],
|
|
7
|
+
testEnvironment: 'node',
|
|
8
|
+
extensionsToTreatAsEsm: ['.ts'],
|
|
6
9
|
testMatch: [
|
|
7
10
|
'**/__tests__/**/*.+(ts|js)',
|
|
8
11
|
'**/?(*.)+(spec).+(ts|js)',
|
|
9
12
|
],
|
|
10
13
|
transform: {
|
|
11
|
-
|
|
14
|
+
'^.+\\.tsx?$': ['ts-jest', {
|
|
15
|
+
tsconfig: 'tsconfig.json',
|
|
16
|
+
useESM: true,
|
|
17
|
+
// isolatedModules: true,
|
|
18
|
+
}],
|
|
19
|
+
},
|
|
20
|
+
moduleNameMapper: {
|
|
21
|
+
'^src/(.*)$': '<rootDir>/src/$1',
|
|
12
22
|
},
|
|
13
|
-
globals: {
|
|
14
|
-
'ts-jest': {
|
|
15
|
-
'tsconfig': 'tsconfig.json'
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
23
|
};
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.0.
|
|
2
|
+
"version": "1.0.43",
|
|
3
3
|
"name": "@maxzima/wa-communicator",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Noname",
|
|
@@ -36,23 +36,26 @@
|
|
|
36
36
|
"size": "size-limit"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@size-limit/preset-small-lib": "
|
|
40
|
-
"@types/gtag.js": "0.0.
|
|
41
|
-
"@types/jest": "
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "
|
|
43
|
-
"@typescript-eslint/parser": "
|
|
39
|
+
"@size-limit/preset-small-lib": "11.2.0",
|
|
40
|
+
"@types/gtag.js": "0.0.20",
|
|
41
|
+
"@types/jest": "30.0.0",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "8.35.0",
|
|
43
|
+
"@typescript-eslint/parser": "8.35.0",
|
|
44
44
|
"engine-version": "^1.0.2",
|
|
45
|
-
"eslint": "
|
|
46
|
-
"eslint-config-prettier": "
|
|
45
|
+
"eslint": "9.29.0",
|
|
46
|
+
"eslint-config-prettier": "10.1.5",
|
|
47
47
|
"eslint-plugin-editorconfig": "4.0.3",
|
|
48
48
|
"eslint-plugin-eslint-comments": "3.2.0",
|
|
49
|
-
"eslint-plugin-import": "2.
|
|
50
|
-
"eslint-plugin-prettier": "
|
|
51
|
-
"jest": "
|
|
49
|
+
"eslint-plugin-import": "2.32.0",
|
|
50
|
+
"eslint-plugin-prettier": "5.5.1",
|
|
51
|
+
"jest": "30.0.3",
|
|
52
52
|
"npm-run-all": "4.1.5",
|
|
53
|
-
"prettier": "
|
|
54
|
-
"size-limit": "
|
|
55
|
-
"ts-jest": "
|
|
53
|
+
"prettier": "3.6.1",
|
|
54
|
+
"size-limit": "11.2.0",
|
|
55
|
+
"ts-jest": "29.4.0",
|
|
56
56
|
"typescript": "5.8.3"
|
|
57
|
+
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"tslib": "^2.8.1"
|
|
57
60
|
}
|
|
58
61
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {GTMEventEnum, LintrkActionTypeEnum, LintrkEventIdEnum} from "./../Enums/AccountTrackerEnum";
|
|
1
|
+
import { GTMEventEnum, LintrkActionTypeEnum, LintrkEventIdEnum } from "./../Enums/AccountTrackerEnum";
|
|
2
2
|
import type {
|
|
3
3
|
TAccountTrackerEventParams,
|
|
4
4
|
TAccountTrackerGtmEventParamsMapping,
|
|
@@ -18,6 +18,14 @@ export class AccountTracker {
|
|
|
18
18
|
this.sendLinkedInEvent(LintrkEventIdEnum.REGISTRATION);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
public sendVerifyPhoneSuccessEvent (eventParams: TAccountTrackerEventParams) {
|
|
22
|
+
this.sendGtmEvent(GTMEventEnum.VERIFY_PHONE_ONLINE, eventParams.gtm);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public sendVerifyEmailSuccessEvent (eventParams: TAccountTrackerEventParams) {
|
|
26
|
+
this.sendGtmEvent(GTMEventEnum.VERIFY_EMAIL_ONLINE, eventParams.gtm);
|
|
27
|
+
}
|
|
28
|
+
|
|
21
29
|
private sendGtmEvent = (event: GTMEventEnum, eventParams: TAccountTrackerGtmEventParamsMapping) => {
|
|
22
30
|
if (typeof this.props.gtmDataLayer === 'undefined') {
|
|
23
31
|
return;
|
|
@@ -21,7 +21,10 @@ export type TAccountTrackerGtmEventParamsMapping = {
|
|
|
21
21
|
[event in GTMEventEnum]: TAccountTrackerGtmEventParams;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
export type TAccountTrackerGtmEventParams = TAccountTrackerGtmSignUpEventParams
|
|
24
|
+
export type TAccountTrackerGtmEventParams = TAccountTrackerGtmSignUpEventParams
|
|
25
|
+
| TAccountTrackerGtmSignUpOnlineEventParams
|
|
26
|
+
| TAccountTrackerGtmVerifyPhoneOnlineEventParams
|
|
27
|
+
| TAccountTrackerGtmVerifyEmailOnlineEventParams;
|
|
25
28
|
|
|
26
29
|
export type TAccountTrackerGtmSignUpEventParams = {
|
|
27
30
|
[GTMEventParamsEnum.GCLID]: string;
|
|
@@ -34,3 +37,15 @@ export type TAccountTrackerGtmSignUpOnlineEventParams = {
|
|
|
34
37
|
[GTMEventParamsEnum.SEND_TO]: string;
|
|
35
38
|
[GTMEventParamsEnum.GCL_ID]: string;
|
|
36
39
|
}
|
|
40
|
+
|
|
41
|
+
export type TAccountTrackerGtmVerifyPhoneOnlineEventParams = {
|
|
42
|
+
[GTMEventParamsEnum.ORIGIN]: string;
|
|
43
|
+
[GTMEventParamsEnum.SEND_TO]: string;
|
|
44
|
+
[GTMEventParamsEnum.GCL_ID]: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type TAccountTrackerGtmVerifyEmailOnlineEventParams = {
|
|
48
|
+
[GTMEventParamsEnum.ORIGIN]: string;
|
|
49
|
+
[GTMEventParamsEnum.SEND_TO]: string;
|
|
50
|
+
[GTMEventParamsEnum.GCL_ID]: string;
|
|
51
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -9,12 +9,12 @@ export {
|
|
|
9
9
|
CommunicatorEmailCustomErrorCodeEnum,
|
|
10
10
|
} from "./enums";
|
|
11
11
|
|
|
12
|
-
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
export type {
|
|
13
|
+
TChallenge,
|
|
14
|
+
TResponse,
|
|
15
|
+
TSignInByMobileResponse,
|
|
16
|
+
TSetupChallengeResponse,
|
|
17
|
+
TVerifyChallengeResponse,
|
|
18
|
+
TCreateSessionResponse,
|
|
19
|
+
TGetCurrentUserProfileResponseUser,
|
|
20
20
|
} from "./types";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`Communicator getHeaders headers with token 1`] = `
|
|
4
|
-
|
|
4
|
+
{
|
|
5
5
|
"Accept": "application/json, text/plain, */*",
|
|
6
6
|
"Authorization": "Bearer _token_",
|
|
7
7
|
"Content-Type": "application/json",
|
|
@@ -9,14 +9,14 @@ Object {
|
|
|
9
9
|
`;
|
|
10
10
|
|
|
11
11
|
exports[`Communicator getHeaders headers without token 1`] = `
|
|
12
|
-
|
|
12
|
+
{
|
|
13
13
|
"Accept": "application/json, text/plain, */*",
|
|
14
14
|
"Content-Type": "application/json",
|
|
15
15
|
}
|
|
16
16
|
`;
|
|
17
17
|
|
|
18
18
|
exports[`Communicator getMeta meta normal 1`] = `
|
|
19
|
-
|
|
19
|
+
{
|
|
20
20
|
"audit_source_type": "Backend",
|
|
21
21
|
"browser_page_resolution": "800x600",
|
|
22
22
|
"cookies_enabled": true,
|
|
@@ -32,8 +32,8 @@ exports[`Communicator processingQueryParams queryParams multi 1`] = `"queryParam
|
|
|
32
32
|
exports[`Communicator processingQueryParams queryParams normal 1`] = `"queryParamKey1=queryParamValue1"`;
|
|
33
33
|
|
|
34
34
|
exports[`Communicator requests createSession 1`] = `
|
|
35
|
-
|
|
36
|
-
"headers":
|
|
35
|
+
{
|
|
36
|
+
"headers": {
|
|
37
37
|
"Accept": "application/json, text/plain, */*",
|
|
38
38
|
"Authorization": "Bearer _authToken_",
|
|
39
39
|
"Content-Type": "application/json",
|
|
@@ -44,9 +44,9 @@ Object {
|
|
|
44
44
|
`;
|
|
45
45
|
|
|
46
46
|
exports[`Communicator requests emailUpdate 1`] = `
|
|
47
|
-
|
|
48
|
-
"body": "{
|
|
49
|
-
"headers":
|
|
47
|
+
{
|
|
48
|
+
"body": "{"email":"test@test.com"}",
|
|
49
|
+
"headers": {
|
|
50
50
|
"Accept": "application/json, text/plain, */*",
|
|
51
51
|
"Authorization": "Bearer _authToken_",
|
|
52
52
|
"Content-Type": "application/json",
|
|
@@ -57,8 +57,8 @@ Object {
|
|
|
57
57
|
`;
|
|
58
58
|
|
|
59
59
|
exports[`Communicator requests getAssignedProducts 1`] = `
|
|
60
|
-
|
|
61
|
-
"headers":
|
|
60
|
+
{
|
|
61
|
+
"headers": {
|
|
62
62
|
"Accept": "application/json, text/plain, */*",
|
|
63
63
|
"Authorization": "Bearer _accessToken_",
|
|
64
64
|
"Content-Type": "application/json",
|
|
@@ -69,8 +69,8 @@ Object {
|
|
|
69
69
|
`;
|
|
70
70
|
|
|
71
71
|
exports[`Communicator requests getCurrentUserProfile 1`] = `
|
|
72
|
-
|
|
73
|
-
"headers":
|
|
72
|
+
{
|
|
73
|
+
"headers": {
|
|
74
74
|
"Accept": "application/json, text/plain, */*",
|
|
75
75
|
"Authorization": "Bearer _accessToken_",
|
|
76
76
|
"Content-Type": "application/json",
|
|
@@ -81,13 +81,13 @@ Object {
|
|
|
81
81
|
`;
|
|
82
82
|
|
|
83
83
|
exports[`Communicator requests getRestrictedCountries 1`] = `
|
|
84
|
-
|
|
85
|
-
"headers":
|
|
84
|
+
{
|
|
85
|
+
"headers": {
|
|
86
86
|
"Accept": "application/json, text/plain, */*",
|
|
87
87
|
"Content-Type": "application/json",
|
|
88
88
|
},
|
|
89
89
|
"method": "GET",
|
|
90
|
-
"queryParams":
|
|
90
|
+
"queryParams": {
|
|
91
91
|
"entity_type": "global",
|
|
92
92
|
},
|
|
93
93
|
"url": "https://google.com/access-control/restricted-countries",
|
|
@@ -95,8 +95,8 @@ Object {
|
|
|
95
95
|
`;
|
|
96
96
|
|
|
97
97
|
exports[`Communicator requests profileAssign 1`] = `
|
|
98
|
-
|
|
99
|
-
"headers":
|
|
98
|
+
{
|
|
99
|
+
"headers": {
|
|
100
100
|
"Accept": "application/json, text/plain, */*",
|
|
101
101
|
"Authorization": "Bearer _accessToken_",
|
|
102
102
|
"Content-Type": "application/json",
|
|
@@ -107,9 +107,9 @@ Object {
|
|
|
107
107
|
`;
|
|
108
108
|
|
|
109
109
|
exports[`Communicator requests registration 1`] = `
|
|
110
|
-
|
|
111
|
-
"body": "{
|
|
112
|
-
"headers":
|
|
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_"}}",
|
|
112
|
+
"headers": {
|
|
113
113
|
"Accept": "application/json, text/plain, */*",
|
|
114
114
|
"Authorization": "Bearer _accessToken_",
|
|
115
115
|
"Content-Type": "application/json",
|
|
@@ -120,9 +120,9 @@ Object {
|
|
|
120
120
|
`;
|
|
121
121
|
|
|
122
122
|
exports[`Communicator requests setStorageValues 1`] = `
|
|
123
|
-
|
|
124
|
-
"body": "{
|
|
125
|
-
"headers":
|
|
123
|
+
{
|
|
124
|
+
"body": "{"seo_source":"_origin_"}",
|
|
125
|
+
"headers": {
|
|
126
126
|
"Accept": "application/json, text/plain, */*",
|
|
127
127
|
"Authorization": "Bearer _accessToken_",
|
|
128
128
|
"Content-Type": "application/json",
|
|
@@ -133,14 +133,14 @@ Object {
|
|
|
133
133
|
`;
|
|
134
134
|
|
|
135
135
|
exports[`Communicator requests setupChallenge 1`] = `
|
|
136
|
-
|
|
137
|
-
"headers":
|
|
136
|
+
{
|
|
137
|
+
"headers": {
|
|
138
138
|
"Accept": "application/json, text/plain, */*",
|
|
139
139
|
"Authorization": "Bearer _authToken_",
|
|
140
140
|
"Content-Type": "application/json",
|
|
141
141
|
},
|
|
142
142
|
"method": "GET",
|
|
143
|
-
"queryParams":
|
|
143
|
+
"queryParams": {
|
|
144
144
|
"type": "email_otp",
|
|
145
145
|
},
|
|
146
146
|
"url": "https://google.com/sign-in/challenge",
|
|
@@ -148,22 +148,22 @@ Object {
|
|
|
148
148
|
`;
|
|
149
149
|
|
|
150
150
|
exports[`Communicator requests signIn 1`] = `
|
|
151
|
-
|
|
152
|
-
"body": "{
|
|
153
|
-
"headers":
|
|
151
|
+
{
|
|
152
|
+
"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"}",
|
|
153
|
+
"headers": {
|
|
154
154
|
"Accept": "application/json, text/plain, */*",
|
|
155
155
|
"Content-Type": "application/json",
|
|
156
156
|
},
|
|
157
157
|
"method": "POST",
|
|
158
|
-
"queryParams":
|
|
158
|
+
"queryParams": {},
|
|
159
159
|
"url": "https://google.com/sign-in",
|
|
160
160
|
}
|
|
161
161
|
`;
|
|
162
162
|
|
|
163
163
|
exports[`Communicator requests signInByApp 1`] = `
|
|
164
|
-
|
|
165
|
-
"body": "{
|
|
166
|
-
"headers":
|
|
164
|
+
{
|
|
165
|
+
"body": "{"type":"out_of_band","value":"123456","request_id":"7ae2cefb-2f3b-4ecf-b478-67486aca2eaf"}",
|
|
166
|
+
"headers": {
|
|
167
167
|
"Accept": "application/json, text/plain, */*",
|
|
168
168
|
"Authorization": "Bearer _authToken_",
|
|
169
169
|
"Content-Type": "application/json",
|
|
@@ -174,9 +174,9 @@ Object {
|
|
|
174
174
|
`;
|
|
175
175
|
|
|
176
176
|
exports[`Communicator requests signUp 1`] = `
|
|
177
|
-
|
|
178
|
-
"body": "{
|
|
179
|
-
"headers":
|
|
177
|
+
{
|
|
178
|
+
"body": "{"locale":"en","mobile":"+16234401486","timezone_name":"Europe/Tallin"}",
|
|
179
|
+
"headers": {
|
|
180
180
|
"Accept": "application/json, text/plain, */*",
|
|
181
181
|
"Content-Type": "application/json",
|
|
182
182
|
},
|
|
@@ -186,9 +186,9 @@ Object {
|
|
|
186
186
|
`;
|
|
187
187
|
|
|
188
188
|
exports[`Communicator requests verifyChallenge 1`] = `
|
|
189
|
-
|
|
190
|
-
"body": "{
|
|
191
|
-
"headers":
|
|
189
|
+
{
|
|
190
|
+
"body": "{"type":"email_otp","value":"123456"}",
|
|
191
|
+
"headers": {
|
|
192
192
|
"Accept": "application/json, text/plain, */*",
|
|
193
193
|
"Authorization": "Bearer _authToken_",
|
|
194
194
|
"Content-Type": "application/json",
|
|
@@ -20,9 +20,22 @@ describe('AccountTracker', () => {
|
|
|
20
20
|
accountTracker.sendRegistrationSuccessEvent(registrationSuccessEventParams);
|
|
21
21
|
|
|
22
22
|
expect(mockGtmDataLayer[0]).toEqual({...registrationSuccessEvents.gtm.sign_up});
|
|
23
|
+
expect(mockGtmDataLayer[1]).toEqual({...registrationSuccessEvents.gtm.sign_up_online});
|
|
23
24
|
|
|
24
25
|
expect(mockLintrk.mock.calls[0][0]).toBe(registrationSuccessEvents.linkedIn.action);
|
|
25
26
|
expect(mockLintrk.mock.calls[0][1]).toEqual(registrationSuccessEvents.linkedIn.event);
|
|
26
27
|
expect(mockLintrk).toHaveBeenCalled();
|
|
27
28
|
});
|
|
29
|
+
|
|
30
|
+
test('sendVerifyPhoneSuccessEvent', () => {
|
|
31
|
+
accountTracker.sendVerifyPhoneSuccessEvent(registrationSuccessEventParams);
|
|
32
|
+
|
|
33
|
+
expect(mockGtmDataLayer[2]).toEqual({...registrationSuccessEvents.gtm.verify_phone_online});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test('sendVerifyEmailSuccessEvent', () => {
|
|
37
|
+
accountTracker.sendVerifyEmailSuccessEvent(registrationSuccessEventParams);
|
|
38
|
+
|
|
39
|
+
expect(mockGtmDataLayer[3]).toEqual({...registrationSuccessEvents.gtm.verify_email_online});
|
|
40
|
+
});
|
|
28
41
|
});
|
|
@@ -10,7 +10,20 @@ const registrationSuccessEvents = {
|
|
|
10
10
|
},
|
|
11
11
|
sign_up_online: {
|
|
12
12
|
event: 'sign_up_online',
|
|
13
|
-
|
|
13
|
+
origin: communicatorTestData.gtmId,
|
|
14
|
+
send_to: communicatorTestData.ga4Id,
|
|
15
|
+
gcl_id: communicatorTestData.gcId,
|
|
16
|
+
},
|
|
17
|
+
verify_phone_online: {
|
|
18
|
+
event: 'verify_phone_online',
|
|
19
|
+
origin: communicatorTestData.gtmId,
|
|
20
|
+
send_to: communicatorTestData.ga4Id,
|
|
21
|
+
gcl_id: communicatorTestData.gcId,
|
|
22
|
+
},
|
|
23
|
+
verify_email_online: {
|
|
24
|
+
event: 'verify_email_online',
|
|
25
|
+
origin: communicatorTestData.gtmId,
|
|
26
|
+
send_to: communicatorTestData.ga4Id,
|
|
14
27
|
gcl_id: communicatorTestData.gcId,
|
|
15
28
|
}
|
|
16
29
|
},
|
|
@@ -33,6 +46,16 @@ const registrationSuccessEventParams = {
|
|
|
33
46
|
origin: communicatorTestData.gtmId,
|
|
34
47
|
send_to: communicatorTestData.ga4Id,
|
|
35
48
|
gcl_id: communicatorTestData.gcId,
|
|
49
|
+
},
|
|
50
|
+
verify_phone_online: {
|
|
51
|
+
origin: communicatorTestData.gtmId,
|
|
52
|
+
send_to: communicatorTestData.ga4Id,
|
|
53
|
+
gcl_id: communicatorTestData.gcId,
|
|
54
|
+
},
|
|
55
|
+
verify_email_online: {
|
|
56
|
+
origin: communicatorTestData.gtmId,
|
|
57
|
+
send_to: communicatorTestData.ga4Id,
|
|
58
|
+
gcl_id: communicatorTestData.gcId,
|
|
36
59
|
}
|
|
37
60
|
}
|
|
38
61
|
}
|