@bytexbyte/berify-analytics-api 2.2.6 → 2.2.7
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/lib/berifyAnalyticsApi/src/Heatmap/index.js +9 -8
- package/lib/berifyAnalyticsApi/src/Heatmap/type.d.ts +15 -7
- package/lib/berifyAnalyticsApi/src/Reskin/index.js +31 -30
- package/lib/berifyAnalyticsApi/src/Reskin/type.d.ts +1 -1
- package/lib/berifyAnalyticsApi/src/ScanChart/index.js +17 -16
- package/lib/berifyAnalyticsApi/src/ScanChart/type.d.ts +1 -1
- package/lib/berifyAnalyticsApi/src/index.d.ts +3 -5
- package/lib/berifyAnalyticsApi/src/index.js +0 -2
- package/package.json +1 -1
|
@@ -4,18 +4,19 @@ const bxb_api_1 = require("@bytexbyte/bxb-api");
|
|
|
4
4
|
class BerifyHeatMapApi extends bxb_api_1.default {
|
|
5
5
|
constructor({ host, secretKey, secret }) {
|
|
6
6
|
super({
|
|
7
|
-
host,
|
|
7
|
+
host,
|
|
8
|
+
moduleName: 'heatmap',
|
|
8
9
|
secretKey: secretKey ?? 'secretKey',
|
|
9
|
-
secret: secret ?? 'secret'
|
|
10
|
+
secret: secret ?? 'secret',
|
|
10
11
|
});
|
|
11
12
|
}
|
|
12
13
|
async getHeatmap(form) {
|
|
13
14
|
const response = await this.bxbFetch({
|
|
14
15
|
method: 'POST',
|
|
15
16
|
headers: {
|
|
16
|
-
'Content-Type': 'application/json'
|
|
17
|
+
'Content-Type': 'application/json',
|
|
17
18
|
},
|
|
18
|
-
body: JSON.stringify(form)
|
|
19
|
+
body: JSON.stringify(form),
|
|
19
20
|
});
|
|
20
21
|
return response.json();
|
|
21
22
|
}
|
|
@@ -23,8 +24,8 @@ class BerifyHeatMapApi extends bxb_api_1.default {
|
|
|
23
24
|
const response = await this.bxbFetch({
|
|
24
25
|
method: 'GET',
|
|
25
26
|
headers: {
|
|
26
|
-
'Content-Type': 'application/json'
|
|
27
|
-
}
|
|
27
|
+
'Content-Type': 'application/json',
|
|
28
|
+
},
|
|
28
29
|
});
|
|
29
30
|
return response.json();
|
|
30
31
|
}
|
|
@@ -32,9 +33,9 @@ class BerifyHeatMapApi extends bxb_api_1.default {
|
|
|
32
33
|
const response = await this.bxbFetch({
|
|
33
34
|
method: 'POST',
|
|
34
35
|
headers: {
|
|
35
|
-
'Content-Type': 'application/json'
|
|
36
|
+
'Content-Type': 'application/json',
|
|
36
37
|
},
|
|
37
|
-
body: JSON.stringify(form)
|
|
38
|
+
body: JSON.stringify(form),
|
|
38
39
|
}, 'date-range');
|
|
39
40
|
return response.json();
|
|
40
41
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ScanType } from "../../../interfaces";
|
|
1
|
+
import { ScanType } from '../../../interfaces';
|
|
3
2
|
export type HeatmapApi = (form: HeatmapRequest) => Promise<HeatmapResponse>;
|
|
4
3
|
declare enum TimeInterval {
|
|
5
4
|
All = "All Time",
|
|
@@ -16,6 +15,7 @@ export type HeatmapRequest = {
|
|
|
16
15
|
collectionRuleId?: string;
|
|
17
16
|
timeInterval: TimeInterval;
|
|
18
17
|
scanTypes?: ScanType[] | ScanType;
|
|
18
|
+
zoom?: number;
|
|
19
19
|
};
|
|
20
20
|
export type ReskinHeatmapRequest = {
|
|
21
21
|
userId: string;
|
|
@@ -26,14 +26,22 @@ export type ReskinHeatmapRequest = {
|
|
|
26
26
|
startDate: Date;
|
|
27
27
|
endDate: Date;
|
|
28
28
|
};
|
|
29
|
-
export type
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
export type HeatmapCell = {
|
|
30
|
+
h3: string;
|
|
31
|
+
count: number;
|
|
32
|
+
lat: number;
|
|
33
|
+
lng: number;
|
|
34
|
+
};
|
|
35
|
+
export type HeatmapResult = HeatmapCell[];
|
|
36
|
+
export type HeatmapMeta = {
|
|
37
|
+
resolution: number;
|
|
38
|
+
totalPoints: number;
|
|
39
|
+
cellCount: number;
|
|
40
|
+
};
|
|
34
41
|
export type HeatmapResponse = {
|
|
35
42
|
status: 'ok' | 'error';
|
|
36
43
|
data?: HeatmapResult;
|
|
44
|
+
meta?: HeatmapMeta;
|
|
37
45
|
error?: string;
|
|
38
46
|
};
|
|
39
47
|
export type LastUpdatedAtResponse = {
|
|
@@ -4,18 +4,19 @@ const bxb_api_1 = require("@bytexbyte/bxb-api");
|
|
|
4
4
|
class BerifyReskinApi extends bxb_api_1.default {
|
|
5
5
|
constructor({ host, secretKey, secret }) {
|
|
6
6
|
super({
|
|
7
|
-
host,
|
|
7
|
+
host,
|
|
8
|
+
moduleName: 'reskin',
|
|
8
9
|
secretKey: secretKey ?? 'secretKey',
|
|
9
|
-
secret: secret ?? 'secret'
|
|
10
|
+
secret: secret ?? 'secret',
|
|
10
11
|
});
|
|
11
12
|
}
|
|
12
13
|
async getScanCount(user, form) {
|
|
13
14
|
const response = await this.bxbFetch({
|
|
14
15
|
method: 'POST',
|
|
15
16
|
headers: {
|
|
16
|
-
'Content-Type': 'application/json'
|
|
17
|
+
'Content-Type': 'application/json',
|
|
17
18
|
},
|
|
18
|
-
body: JSON.stringify({ user, form })
|
|
19
|
+
body: JSON.stringify({ user, form }),
|
|
19
20
|
}, 'scan-count');
|
|
20
21
|
return response.json();
|
|
21
22
|
}
|
|
@@ -23,9 +24,9 @@ class BerifyReskinApi extends bxb_api_1.default {
|
|
|
23
24
|
const response = await this.bxbFetch({
|
|
24
25
|
method: 'POST',
|
|
25
26
|
headers: {
|
|
26
|
-
'Content-Type': 'application/json'
|
|
27
|
+
'Content-Type': 'application/json',
|
|
27
28
|
},
|
|
28
|
-
body: JSON.stringify({ user, form })
|
|
29
|
+
body: JSON.stringify({ user, form }),
|
|
29
30
|
}, 'new-user-count');
|
|
30
31
|
return response.json();
|
|
31
32
|
}
|
|
@@ -33,9 +34,9 @@ class BerifyReskinApi extends bxb_api_1.default {
|
|
|
33
34
|
const response = await this.bxbFetch({
|
|
34
35
|
method: 'POST',
|
|
35
36
|
headers: {
|
|
36
|
-
'Content-Type': 'application/json'
|
|
37
|
+
'Content-Type': 'application/json',
|
|
37
38
|
},
|
|
38
|
-
body: JSON.stringify({ user, form })
|
|
39
|
+
body: JSON.stringify({ user, form }),
|
|
39
40
|
}, 'unique-scan-count');
|
|
40
41
|
return response.json();
|
|
41
42
|
}
|
|
@@ -43,9 +44,9 @@ class BerifyReskinApi extends bxb_api_1.default {
|
|
|
43
44
|
const response = await this.bxbFetch({
|
|
44
45
|
method: 'POST',
|
|
45
46
|
headers: {
|
|
46
|
-
'Content-Type': 'application/json'
|
|
47
|
+
'Content-Type': 'application/json',
|
|
47
48
|
},
|
|
48
|
-
body: JSON.stringify({ user, form })
|
|
49
|
+
body: JSON.stringify({ user, form }),
|
|
49
50
|
}, 'session-duration-avg');
|
|
50
51
|
return response.json();
|
|
51
52
|
}
|
|
@@ -53,9 +54,9 @@ class BerifyReskinApi extends bxb_api_1.default {
|
|
|
53
54
|
const response = await this.bxbFetch({
|
|
54
55
|
method: 'POST',
|
|
55
56
|
headers: {
|
|
56
|
-
'Content-Type': 'application/json'
|
|
57
|
+
'Content-Type': 'application/json',
|
|
57
58
|
},
|
|
58
|
-
body: JSON.stringify({ user, form })
|
|
59
|
+
body: JSON.stringify({ user, form }),
|
|
59
60
|
}, 'promo-modal-open-count');
|
|
60
61
|
return response.json();
|
|
61
62
|
}
|
|
@@ -63,9 +64,9 @@ class BerifyReskinApi extends bxb_api_1.default {
|
|
|
63
64
|
const response = await this.bxbFetch({
|
|
64
65
|
method: 'POST',
|
|
65
66
|
headers: {
|
|
66
|
-
'Content-Type': 'application/json'
|
|
67
|
+
'Content-Type': 'application/json',
|
|
67
68
|
},
|
|
68
|
-
body: JSON.stringify({ user, form })
|
|
69
|
+
body: JSON.stringify({ user, form }),
|
|
69
70
|
}, 'community-modal-open-count');
|
|
70
71
|
return response.json();
|
|
71
72
|
}
|
|
@@ -73,9 +74,9 @@ class BerifyReskinApi extends bxb_api_1.default {
|
|
|
73
74
|
const response = await this.bxbFetch({
|
|
74
75
|
method: 'POST',
|
|
75
76
|
headers: {
|
|
76
|
-
'Content-Type': 'application/json'
|
|
77
|
+
'Content-Type': 'application/json',
|
|
77
78
|
},
|
|
78
|
-
body: JSON.stringify({ user, form })
|
|
79
|
+
body: JSON.stringify({ user, form }),
|
|
79
80
|
}, 'bounce-rate');
|
|
80
81
|
return response.json();
|
|
81
82
|
}
|
|
@@ -83,9 +84,9 @@ class BerifyReskinApi extends bxb_api_1.default {
|
|
|
83
84
|
const response = await this.bxbFetch({
|
|
84
85
|
method: 'POST',
|
|
85
86
|
headers: {
|
|
86
|
-
'Content-Type': 'application/json'
|
|
87
|
+
'Content-Type': 'application/json',
|
|
87
88
|
},
|
|
88
|
-
body: JSON.stringify({ user, form })
|
|
89
|
+
body: JSON.stringify({ user, form }),
|
|
89
90
|
}, 'experience-engagement');
|
|
90
91
|
return response.json();
|
|
91
92
|
}
|
|
@@ -93,9 +94,9 @@ class BerifyReskinApi extends bxb_api_1.default {
|
|
|
93
94
|
const response = await this.bxbFetch({
|
|
94
95
|
method: 'POST',
|
|
95
96
|
headers: {
|
|
96
|
-
'Content-Type': 'application/json'
|
|
97
|
+
'Content-Type': 'application/json',
|
|
97
98
|
},
|
|
98
|
-
body: JSON.stringify({ user, form })
|
|
99
|
+
body: JSON.stringify({ user, form }),
|
|
99
100
|
}, 'gender-breakdown');
|
|
100
101
|
return response.json();
|
|
101
102
|
}
|
|
@@ -103,9 +104,9 @@ class BerifyReskinApi extends bxb_api_1.default {
|
|
|
103
104
|
const response = await this.bxbFetch({
|
|
104
105
|
method: 'POST',
|
|
105
106
|
headers: {
|
|
106
|
-
'Content-Type': 'application/json'
|
|
107
|
+
'Content-Type': 'application/json',
|
|
107
108
|
},
|
|
108
|
-
body: JSON.stringify({ user, form })
|
|
109
|
+
body: JSON.stringify({ user, form }),
|
|
109
110
|
}, 'age-distribution');
|
|
110
111
|
return response.json();
|
|
111
112
|
}
|
|
@@ -113,9 +114,9 @@ class BerifyReskinApi extends bxb_api_1.default {
|
|
|
113
114
|
const response = await this.bxbFetch({
|
|
114
115
|
method: 'POST',
|
|
115
116
|
headers: {
|
|
116
|
-
'Content-Type': 'application/json'
|
|
117
|
+
'Content-Type': 'application/json',
|
|
117
118
|
},
|
|
118
|
-
body: JSON.stringify({ user, form })
|
|
119
|
+
body: JSON.stringify({ user, form }),
|
|
119
120
|
}, 'device-type');
|
|
120
121
|
return response.json();
|
|
121
122
|
}
|
|
@@ -123,9 +124,9 @@ class BerifyReskinApi extends bxb_api_1.default {
|
|
|
123
124
|
const response = await this.bxbFetch({
|
|
124
125
|
method: 'POST',
|
|
125
126
|
headers: {
|
|
126
|
-
'Content-Type': 'application/json'
|
|
127
|
+
'Content-Type': 'application/json',
|
|
127
128
|
},
|
|
128
|
-
body: JSON.stringify({ user, form })
|
|
129
|
+
body: JSON.stringify({ user, form }),
|
|
129
130
|
}, 'heatmap');
|
|
130
131
|
return response.json();
|
|
131
132
|
}
|
|
@@ -133,9 +134,9 @@ class BerifyReskinApi extends bxb_api_1.default {
|
|
|
133
134
|
const response = await this.bxbFetch({
|
|
134
135
|
method: 'POST',
|
|
135
136
|
headers: {
|
|
136
|
-
'Content-Type': 'application/json'
|
|
137
|
+
'Content-Type': 'application/json',
|
|
137
138
|
},
|
|
138
|
-
body: JSON.stringify({ user, form })
|
|
139
|
+
body: JSON.stringify({ user, form }),
|
|
139
140
|
}, 'daily-scan-count');
|
|
140
141
|
return response.json();
|
|
141
142
|
}
|
|
@@ -143,9 +144,9 @@ class BerifyReskinApi extends bxb_api_1.default {
|
|
|
143
144
|
const response = await this.bxbFetch({
|
|
144
145
|
method: 'POST',
|
|
145
146
|
headers: {
|
|
146
|
-
'Content-Type': 'application/json'
|
|
147
|
+
'Content-Type': 'application/json',
|
|
147
148
|
},
|
|
148
|
-
body: JSON.stringify({ user, form })
|
|
149
|
+
body: JSON.stringify({ user, form }),
|
|
149
150
|
}, 'active-time');
|
|
150
151
|
return response.json();
|
|
151
152
|
}
|
|
@@ -4,18 +4,19 @@ const bxb_api_1 = require("@bytexbyte/bxb-api");
|
|
|
4
4
|
class BerifyScanChartApi extends bxb_api_1.default {
|
|
5
5
|
constructor({ host, secretKey, secret }) {
|
|
6
6
|
super({
|
|
7
|
-
host,
|
|
7
|
+
host,
|
|
8
|
+
moduleName: 'scan-chart',
|
|
8
9
|
secretKey: secretKey ?? 'secretKey',
|
|
9
|
-
secret: secret ?? 'secret'
|
|
10
|
+
secret: secret ?? 'secret',
|
|
10
11
|
});
|
|
11
12
|
}
|
|
12
13
|
async getScanReport(user, form) {
|
|
13
14
|
const response = await this.bxbFetch({
|
|
14
15
|
method: 'POST',
|
|
15
16
|
headers: {
|
|
16
|
-
'Content-Type': 'application/json'
|
|
17
|
+
'Content-Type': 'application/json',
|
|
17
18
|
},
|
|
18
|
-
body: JSON.stringify({ user, form })
|
|
19
|
+
body: JSON.stringify({ user, form }),
|
|
19
20
|
}, 'scan-report');
|
|
20
21
|
return response.json();
|
|
21
22
|
}
|
|
@@ -23,9 +24,9 @@ class BerifyScanChartApi extends bxb_api_1.default {
|
|
|
23
24
|
const response = await this.bxbFetch({
|
|
24
25
|
method: 'POST',
|
|
25
26
|
headers: {
|
|
26
|
-
'Content-Type': 'application/json'
|
|
27
|
+
'Content-Type': 'application/json',
|
|
27
28
|
},
|
|
28
|
-
body: JSON.stringify({ user, form })
|
|
29
|
+
body: JSON.stringify({ user, form }),
|
|
29
30
|
}, 'user-report');
|
|
30
31
|
return response.json();
|
|
31
32
|
}
|
|
@@ -33,9 +34,9 @@ class BerifyScanChartApi extends bxb_api_1.default {
|
|
|
33
34
|
const response = await this.bxbFetch({
|
|
34
35
|
method: 'POST',
|
|
35
36
|
headers: {
|
|
36
|
-
'Content-Type': 'application/json'
|
|
37
|
+
'Content-Type': 'application/json',
|
|
37
38
|
},
|
|
38
|
-
body: JSON.stringify({ user, form })
|
|
39
|
+
body: JSON.stringify({ user, form }),
|
|
39
40
|
}, 'scan-rate-all');
|
|
40
41
|
return response.json();
|
|
41
42
|
}
|
|
@@ -43,9 +44,9 @@ class BerifyScanChartApi extends bxb_api_1.default {
|
|
|
43
44
|
const response = await this.bxbFetch({
|
|
44
45
|
method: 'POST',
|
|
45
46
|
headers: {
|
|
46
|
-
'Content-Type': 'application/json'
|
|
47
|
+
'Content-Type': 'application/json',
|
|
47
48
|
},
|
|
48
|
-
body: JSON.stringify({ user, form })
|
|
49
|
+
body: JSON.stringify({ user, form }),
|
|
49
50
|
}, 'scan-rate-by-time');
|
|
50
51
|
return response.json();
|
|
51
52
|
}
|
|
@@ -53,9 +54,9 @@ class BerifyScanChartApi extends bxb_api_1.default {
|
|
|
53
54
|
const response = await this.bxbFetch({
|
|
54
55
|
method: 'POST',
|
|
55
56
|
headers: {
|
|
56
|
-
'Content-Type': 'application/json'
|
|
57
|
+
'Content-Type': 'application/json',
|
|
57
58
|
},
|
|
58
|
-
body: JSON.stringify({ form })
|
|
59
|
+
body: JSON.stringify({ form }),
|
|
59
60
|
}, 'batch-scan-data');
|
|
60
61
|
return response.json();
|
|
61
62
|
}
|
|
@@ -63,9 +64,9 @@ class BerifyScanChartApi extends bxb_api_1.default {
|
|
|
63
64
|
const response = await this.bxbFetch({
|
|
64
65
|
method: 'POST',
|
|
65
66
|
headers: {
|
|
66
|
-
'Content-Type': 'application/json'
|
|
67
|
+
'Content-Type': 'application/json',
|
|
67
68
|
},
|
|
68
|
-
body: JSON.stringify({ user, form })
|
|
69
|
+
body: JSON.stringify({ user, form }),
|
|
69
70
|
}, 'leaderBoard');
|
|
70
71
|
return response.json();
|
|
71
72
|
}
|
|
@@ -73,9 +74,9 @@ class BerifyScanChartApi extends bxb_api_1.default {
|
|
|
73
74
|
const response = await this.bxbFetch({
|
|
74
75
|
method: 'POST',
|
|
75
76
|
headers: {
|
|
76
|
-
'Content-Type': 'application/json'
|
|
77
|
+
'Content-Type': 'application/json',
|
|
77
78
|
},
|
|
78
|
-
body: JSON.stringify({ form })
|
|
79
|
+
body: JSON.stringify({ form }),
|
|
79
80
|
}, 'tagScanHistory');
|
|
80
81
|
return response.json();
|
|
81
82
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import BerifyHeatMapApi from
|
|
2
|
-
import BerifyReskinApi from
|
|
3
|
-
import BerifyScanChartApi from
|
|
4
|
-
import BerifyReportApi from "./Report";
|
|
1
|
+
import BerifyHeatMapApi from './Heatmap';
|
|
2
|
+
import BerifyReskinApi from './Reskin';
|
|
3
|
+
import BerifyScanChartApi from './ScanChart';
|
|
5
4
|
declare class BerifyAnalyticsApi {
|
|
6
5
|
host: string;
|
|
7
6
|
secretKey?: string;
|
|
@@ -9,7 +8,6 @@ declare class BerifyAnalyticsApi {
|
|
|
9
8
|
heatmap: BerifyHeatMapApi;
|
|
10
9
|
scanChart: BerifyScanChartApi;
|
|
11
10
|
reskin: BerifyReskinApi;
|
|
12
|
-
report: BerifyReportApi;
|
|
13
11
|
constructor({ host, secretKey, secret }: {
|
|
14
12
|
host: string;
|
|
15
13
|
secretKey?: string;
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const Heatmap_1 = require("./Heatmap");
|
|
4
4
|
const Reskin_1 = require("./Reskin");
|
|
5
5
|
const ScanChart_1 = require("./ScanChart");
|
|
6
|
-
const Report_1 = require("./Report");
|
|
7
6
|
class BerifyAnalyticsApi {
|
|
8
7
|
constructor({ host, secretKey, secret }) {
|
|
9
8
|
this.host = host;
|
|
@@ -12,7 +11,6 @@ class BerifyAnalyticsApi {
|
|
|
12
11
|
this.heatmap = new Heatmap_1.default({ host, secretKey, secret });
|
|
13
12
|
this.scanChart = new ScanChart_1.default({ host, secretKey, secret });
|
|
14
13
|
this.reskin = new Reskin_1.default({ host, secretKey, secret });
|
|
15
|
-
this.report = new Report_1.default({ host, secretKey, secret });
|
|
16
14
|
}
|
|
17
15
|
}
|
|
18
16
|
exports.default = BerifyAnalyticsApi;
|