@bytexbyte/berify-analytics-api 1.6.7 → 2.0.1
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.d.ts +1 -2
- package/lib/berifyAnalyticsApi/src/Heatmap/index.js +26 -118
- package/lib/berifyAnalyticsApi/src/Heatmap/type.d.ts +4 -13
- package/lib/berifyAnalyticsApi/src/ScanChart/index.js +79 -197
- package/lib/berifyAnalyticsApi/src/ScanChart/type.d.ts +19 -19
- package/lib/berifyAnalyticsApi/src/ScanChart/type.js +1 -1
- package/lib/berifyAnalyticsApi/src/index.d.ts +0 -2
- package/lib/berifyAnalyticsApi/src/index.js +7 -11
- package/lib/interfaces/index.d.ts +6 -10
- package/lib/interfaces/index.js +2 -2
- package/package.json +1 -1
- package/lib/berifyAnalyticsApi/src/Reskin/index.d.ts +0 -81
- package/lib/berifyAnalyticsApi/src/Reskin/index.js +0 -334
- package/lib/berifyAnalyticsApi/src/Reskin/type.d.ts +0 -40
- package/lib/berifyAnalyticsApi/src/Reskin/type.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BxBApi from '@bytexbyte/bxb-api';
|
|
2
|
-
import { HeatmapRequest, HeatmapResponse, LastUpdatedAtResponse
|
|
2
|
+
import { HeatmapRequest, HeatmapResponse, LastUpdatedAtResponse } from './type';
|
|
3
3
|
declare class BerifyHeatMapApi extends BxBApi {
|
|
4
4
|
constructor({ host, secretKey, secret }: {
|
|
5
5
|
host: string;
|
|
@@ -8,6 +8,5 @@ declare class BerifyHeatMapApi extends BxBApi {
|
|
|
8
8
|
});
|
|
9
9
|
getHeatmap(form: HeatmapRequest): Promise<HeatmapResponse>;
|
|
10
10
|
getLastUpdatedAt(): Promise<LastUpdatedAtResponse>;
|
|
11
|
-
getHeatmapByDateRange(form: ReskinHeatmapRequest): Promise<HeatmapResponse>;
|
|
12
11
|
}
|
|
13
12
|
export default BerifyHeatMapApi;
|
|
@@ -1,124 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
moduleName: 'heatmap',
|
|
62
|
-
secretKey: secretKey !== null && secretKey !== void 0 ? secretKey : 'secretKey',
|
|
63
|
-
secret: secret !== null && secret !== void 0 ? secret : 'secret'
|
|
64
|
-
}) || this;
|
|
65
|
-
}
|
|
66
|
-
BerifyHeatMapApi.prototype.getHeatmap = function (form) {
|
|
67
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
68
|
-
var response;
|
|
69
|
-
return __generator(this, function (_a) {
|
|
70
|
-
switch (_a.label) {
|
|
71
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
72
|
-
method: 'POST',
|
|
73
|
-
headers: {
|
|
74
|
-
'Content-Type': 'application/json'
|
|
75
|
-
},
|
|
76
|
-
body: JSON.stringify(form)
|
|
77
|
-
})];
|
|
78
|
-
case 1:
|
|
79
|
-
response = _a.sent();
|
|
80
|
-
return [2 /*return*/, response.json()];
|
|
81
|
-
}
|
|
82
|
-
});
|
|
3
|
+
const bxb_api_1 = require("@bytexbyte/bxb-api");
|
|
4
|
+
class BerifyHeatMapApi extends bxb_api_1.default {
|
|
5
|
+
constructor({ host, secretKey, secret }) {
|
|
6
|
+
super({
|
|
7
|
+
host, moduleName: 'heatmap',
|
|
8
|
+
secretKey: secretKey ?? 'secretKey',
|
|
9
|
+
secret: secret ?? 'secret'
|
|
83
10
|
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
headers: {
|
|
93
|
-
'Content-Type': 'application/json'
|
|
94
|
-
}
|
|
95
|
-
})];
|
|
96
|
-
case 1:
|
|
97
|
-
response = _a.sent();
|
|
98
|
-
return [2 /*return*/, response.json()];
|
|
99
|
-
}
|
|
100
|
-
});
|
|
11
|
+
}
|
|
12
|
+
async getHeatmap(form) {
|
|
13
|
+
const response = await this.bxbFetch({
|
|
14
|
+
method: 'POST',
|
|
15
|
+
headers: {
|
|
16
|
+
'Content-Type': 'application/json'
|
|
17
|
+
},
|
|
18
|
+
body: JSON.stringify(form)
|
|
101
19
|
});
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
headers: {
|
|
111
|
-
'Content-Type': 'application/json'
|
|
112
|
-
},
|
|
113
|
-
body: JSON.stringify(form)
|
|
114
|
-
}, 'date-range')];
|
|
115
|
-
case 1:
|
|
116
|
-
response = _a.sent();
|
|
117
|
-
return [2 /*return*/, response.json()];
|
|
118
|
-
}
|
|
119
|
-
});
|
|
20
|
+
return response.json();
|
|
21
|
+
}
|
|
22
|
+
async getLastUpdatedAt() {
|
|
23
|
+
const response = await this.bxbFetch({
|
|
24
|
+
method: 'GET',
|
|
25
|
+
headers: {
|
|
26
|
+
'Content-Type': 'application/json'
|
|
27
|
+
}
|
|
120
28
|
});
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
29
|
+
return response.json();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
124
32
|
exports.default = BerifyHeatMapApi;
|
|
@@ -9,23 +9,14 @@ declare enum TimeInterval {
|
|
|
9
9
|
}
|
|
10
10
|
export type HeatmapRequest = {
|
|
11
11
|
userId: string;
|
|
12
|
-
companyId?:
|
|
13
|
-
|
|
12
|
+
companyId?: string;
|
|
13
|
+
tagId?: string;
|
|
14
14
|
batchId?: string;
|
|
15
|
-
collectionRuleId?:
|
|
15
|
+
collectionRuleId?: string;
|
|
16
16
|
timeInterval: TimeInterval;
|
|
17
17
|
};
|
|
18
|
-
export type ReskinHeatmapRequest = {
|
|
19
|
-
userId: string;
|
|
20
|
-
companyId?: number;
|
|
21
|
-
tagTokenId?: string;
|
|
22
|
-
batchId?: string;
|
|
23
|
-
collectionRuleId?: number;
|
|
24
|
-
startDate: Date;
|
|
25
|
-
endDate: Date;
|
|
26
|
-
};
|
|
27
18
|
export type HeatmapResult = {
|
|
28
|
-
id:
|
|
19
|
+
id: string;
|
|
29
20
|
latitude: Decimal | null;
|
|
30
21
|
longitude: Decimal | null;
|
|
31
22
|
}[];
|
|
@@ -1,201 +1,83 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
moduleName: 'scan-chart',
|
|
62
|
-
secretKey: secretKey !== null && secretKey !== void 0 ? secretKey : 'secretKey',
|
|
63
|
-
secret: secret !== null && secret !== void 0 ? secret : 'secret'
|
|
64
|
-
}) || this;
|
|
65
|
-
}
|
|
66
|
-
BerifyScanChartApi.prototype.getScanReport = function (user, form) {
|
|
67
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
68
|
-
var response;
|
|
69
|
-
return __generator(this, function (_a) {
|
|
70
|
-
switch (_a.label) {
|
|
71
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
72
|
-
method: 'POST',
|
|
73
|
-
headers: {
|
|
74
|
-
'Content-Type': 'application/json'
|
|
75
|
-
},
|
|
76
|
-
body: JSON.stringify({ user: user, form: form })
|
|
77
|
-
}, 'scan-report')];
|
|
78
|
-
case 1:
|
|
79
|
-
response = _a.sent();
|
|
80
|
-
return [2 /*return*/, response.json()];
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
|
-
BerifyScanChartApi.prototype.getUserReport = function (user, form) {
|
|
86
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
87
|
-
var response;
|
|
88
|
-
return __generator(this, function (_a) {
|
|
89
|
-
switch (_a.label) {
|
|
90
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
91
|
-
method: 'POST',
|
|
92
|
-
headers: {
|
|
93
|
-
'Content-Type': 'application/json'
|
|
94
|
-
},
|
|
95
|
-
body: JSON.stringify({ user: user, form: form })
|
|
96
|
-
}, 'user-report')];
|
|
97
|
-
case 1:
|
|
98
|
-
response = _a.sent();
|
|
99
|
-
return [2 /*return*/, response.json()];
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
BerifyScanChartApi.prototype.getScanRateAll = function (user, form) {
|
|
105
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
106
|
-
var response;
|
|
107
|
-
return __generator(this, function (_a) {
|
|
108
|
-
switch (_a.label) {
|
|
109
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
110
|
-
method: 'POST',
|
|
111
|
-
headers: {
|
|
112
|
-
'Content-Type': 'application/json'
|
|
113
|
-
},
|
|
114
|
-
body: JSON.stringify({ user: user, form: form })
|
|
115
|
-
}, 'scan-rate-all')];
|
|
116
|
-
case 1:
|
|
117
|
-
response = _a.sent();
|
|
118
|
-
return [2 /*return*/, response.json()];
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
};
|
|
123
|
-
BerifyScanChartApi.prototype.getScanRateByTime = function (user, form) {
|
|
124
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
125
|
-
var response;
|
|
126
|
-
return __generator(this, function (_a) {
|
|
127
|
-
switch (_a.label) {
|
|
128
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
129
|
-
method: 'POST',
|
|
130
|
-
headers: {
|
|
131
|
-
'Content-Type': 'application/json'
|
|
132
|
-
},
|
|
133
|
-
body: JSON.stringify({ user: user, form: form })
|
|
134
|
-
}, 'scan-rate-by-time')];
|
|
135
|
-
case 1:
|
|
136
|
-
response = _a.sent();
|
|
137
|
-
return [2 /*return*/, response.json()];
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
};
|
|
142
|
-
BerifyScanChartApi.prototype.getBatchScanData = function (form) {
|
|
143
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
144
|
-
var response;
|
|
145
|
-
return __generator(this, function (_a) {
|
|
146
|
-
switch (_a.label) {
|
|
147
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
148
|
-
method: 'POST',
|
|
149
|
-
headers: {
|
|
150
|
-
'Content-Type': 'application/json'
|
|
151
|
-
},
|
|
152
|
-
body: JSON.stringify({ form: form })
|
|
153
|
-
}, 'batch-scan-data')];
|
|
154
|
-
case 1:
|
|
155
|
-
response = _a.sent();
|
|
156
|
-
return [2 /*return*/, response.json()];
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
};
|
|
161
|
-
BerifyScanChartApi.prototype.getLeaderBoard = function (user, form) {
|
|
162
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
163
|
-
var response;
|
|
164
|
-
return __generator(this, function (_a) {
|
|
165
|
-
switch (_a.label) {
|
|
166
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
167
|
-
method: 'POST',
|
|
168
|
-
headers: {
|
|
169
|
-
'Content-Type': 'application/json'
|
|
170
|
-
},
|
|
171
|
-
body: JSON.stringify({ user: user, form: form })
|
|
172
|
-
}, 'leaderBoard')];
|
|
173
|
-
case 1:
|
|
174
|
-
response = _a.sent();
|
|
175
|
-
return [2 /*return*/, response.json()];
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
});
|
|
179
|
-
};
|
|
180
|
-
BerifyScanChartApi.prototype.getTagScanHistory = function (form) {
|
|
181
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
182
|
-
var response;
|
|
183
|
-
return __generator(this, function (_a) {
|
|
184
|
-
switch (_a.label) {
|
|
185
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
186
|
-
method: 'POST',
|
|
187
|
-
headers: {
|
|
188
|
-
'Content-Type': 'application/json'
|
|
189
|
-
},
|
|
190
|
-
body: JSON.stringify({ form: form })
|
|
191
|
-
}, 'tagScanHistory')];
|
|
192
|
-
case 1:
|
|
193
|
-
response = _a.sent();
|
|
194
|
-
return [2 /*return*/, response.json()];
|
|
195
|
-
}
|
|
196
|
-
});
|
|
3
|
+
const bxb_api_1 = require("@bytexbyte/bxb-api");
|
|
4
|
+
class BerifyScanChartApi extends bxb_api_1.default {
|
|
5
|
+
constructor({ host, secretKey, secret }) {
|
|
6
|
+
super({
|
|
7
|
+
host, moduleName: 'scan-chart',
|
|
8
|
+
secretKey: secretKey ?? 'secretKey',
|
|
9
|
+
secret: secret ?? 'secret'
|
|
197
10
|
});
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
|
|
11
|
+
}
|
|
12
|
+
async getScanReport(user, form) {
|
|
13
|
+
const response = await this.bxbFetch({
|
|
14
|
+
method: 'POST',
|
|
15
|
+
headers: {
|
|
16
|
+
'Content-Type': 'application/json'
|
|
17
|
+
},
|
|
18
|
+
body: JSON.stringify({ user, form })
|
|
19
|
+
}, 'scan-report');
|
|
20
|
+
return response.json();
|
|
21
|
+
}
|
|
22
|
+
async getUserReport(user, form) {
|
|
23
|
+
const response = await this.bxbFetch({
|
|
24
|
+
method: 'POST',
|
|
25
|
+
headers: {
|
|
26
|
+
'Content-Type': 'application/json'
|
|
27
|
+
},
|
|
28
|
+
body: JSON.stringify({ user, form })
|
|
29
|
+
}, 'user-report');
|
|
30
|
+
return response.json();
|
|
31
|
+
}
|
|
32
|
+
async getScanRateAll(user, form) {
|
|
33
|
+
const response = await this.bxbFetch({
|
|
34
|
+
method: 'POST',
|
|
35
|
+
headers: {
|
|
36
|
+
'Content-Type': 'application/json'
|
|
37
|
+
},
|
|
38
|
+
body: JSON.stringify({ user, form })
|
|
39
|
+
}, 'scan-rate-all');
|
|
40
|
+
return response.json();
|
|
41
|
+
}
|
|
42
|
+
async getScanRateByTime(user, form) {
|
|
43
|
+
const response = await this.bxbFetch({
|
|
44
|
+
method: 'POST',
|
|
45
|
+
headers: {
|
|
46
|
+
'Content-Type': 'application/json'
|
|
47
|
+
},
|
|
48
|
+
body: JSON.stringify({ user, form })
|
|
49
|
+
}, 'scan-rate-by-time');
|
|
50
|
+
return response.json();
|
|
51
|
+
}
|
|
52
|
+
async getBatchScanData(form) {
|
|
53
|
+
const response = await this.bxbFetch({
|
|
54
|
+
method: 'POST',
|
|
55
|
+
headers: {
|
|
56
|
+
'Content-Type': 'application/json'
|
|
57
|
+
},
|
|
58
|
+
body: JSON.stringify({ form })
|
|
59
|
+
}, 'batch-scan-data');
|
|
60
|
+
return response.json();
|
|
61
|
+
}
|
|
62
|
+
async getLeaderBoard(user, form) {
|
|
63
|
+
const response = await this.bxbFetch({
|
|
64
|
+
method: 'POST',
|
|
65
|
+
headers: {
|
|
66
|
+
'Content-Type': 'application/json'
|
|
67
|
+
},
|
|
68
|
+
body: JSON.stringify({ user, form })
|
|
69
|
+
}, 'leaderBoard');
|
|
70
|
+
return response.json();
|
|
71
|
+
}
|
|
72
|
+
async getTagScanHistory(form) {
|
|
73
|
+
const response = await this.bxbFetch({
|
|
74
|
+
method: 'POST',
|
|
75
|
+
headers: {
|
|
76
|
+
'Content-Type': 'application/json'
|
|
77
|
+
},
|
|
78
|
+
body: JSON.stringify({ form })
|
|
79
|
+
}, 'tagScanHistory');
|
|
80
|
+
return response.json();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
201
83
|
exports.default = BerifyScanChartApi;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Scan } from "../../../interfaces";
|
|
2
2
|
export type ScanReportRequest = {
|
|
3
|
-
|
|
3
|
+
tagId?: string;
|
|
4
4
|
batchId?: string;
|
|
5
|
-
companyId?:
|
|
5
|
+
companyId?: string;
|
|
6
6
|
};
|
|
7
7
|
export type ScanReportResult = {
|
|
8
8
|
anonymous: number;
|
|
@@ -16,9 +16,9 @@ export type ScanReportResponse = {
|
|
|
16
16
|
error?: string;
|
|
17
17
|
};
|
|
18
18
|
export type UserReportRequest = {
|
|
19
|
-
|
|
19
|
+
tagId?: string;
|
|
20
20
|
batchId?: string;
|
|
21
|
-
companyId?:
|
|
21
|
+
companyId?: string;
|
|
22
22
|
};
|
|
23
23
|
export type UserReportResult = {
|
|
24
24
|
appClip: number;
|
|
@@ -48,8 +48,8 @@ export declare enum TimeInterval {
|
|
|
48
48
|
}
|
|
49
49
|
export type ScanRateByTimeRequest = {
|
|
50
50
|
batchId?: string;
|
|
51
|
-
companyId?:
|
|
52
|
-
|
|
51
|
+
companyId?: string;
|
|
52
|
+
tagId?: string;
|
|
53
53
|
time: TimeInterval;
|
|
54
54
|
};
|
|
55
55
|
export type ScanRateByTimeResponse = {
|
|
@@ -68,7 +68,7 @@ export type ScanRateByTimeResponse = {
|
|
|
68
68
|
export type CompanyRoleType = 'super' | 'admin' | 'marketing' | 'supplier' | 'seo' | 'associate';
|
|
69
69
|
export type User = {
|
|
70
70
|
id: string;
|
|
71
|
-
companyId:
|
|
71
|
+
companyId: string;
|
|
72
72
|
companyRole: CompanyRoleType;
|
|
73
73
|
};
|
|
74
74
|
export type ScanRateType = {
|
|
@@ -91,23 +91,23 @@ export type BatchScanDataRequest = {
|
|
|
91
91
|
};
|
|
92
92
|
export type BlockChainStatusType = 'transferred' | 'minted' | 'queued' | 'transferring' | 'fail';
|
|
93
93
|
export type BatchScanDataResult = {
|
|
94
|
-
|
|
94
|
+
tagId: string;
|
|
95
95
|
totalScan: number;
|
|
96
96
|
uniqueCount: number;
|
|
97
97
|
lastScanned: Date;
|
|
98
98
|
goldenTicketPrize: {
|
|
99
|
-
id:
|
|
100
|
-
|
|
101
|
-
goldenTicketPrizeId:
|
|
99
|
+
id: string;
|
|
100
|
+
tagId: string;
|
|
101
|
+
goldenTicketPrizeId: string;
|
|
102
102
|
};
|
|
103
103
|
goldenTicketRedeem: {
|
|
104
|
-
id:
|
|
105
|
-
|
|
106
|
-
goldenTicketRedeemId:
|
|
104
|
+
id: string;
|
|
105
|
+
tagId: string;
|
|
106
|
+
goldenTicketRedeemId: string;
|
|
107
107
|
};
|
|
108
108
|
tagNft: {
|
|
109
|
-
id:
|
|
110
|
-
|
|
109
|
+
id: string;
|
|
110
|
+
tagId: string;
|
|
111
111
|
blockchainStatus: BlockChainStatusType;
|
|
112
112
|
updatedAt: Date;
|
|
113
113
|
};
|
|
@@ -122,9 +122,9 @@ export type BatchScanDataResponse = {
|
|
|
122
122
|
totalItems: number;
|
|
123
123
|
};
|
|
124
124
|
export type LeaderBoardRequest = {
|
|
125
|
-
|
|
125
|
+
tagId?: string;
|
|
126
126
|
batchId?: string;
|
|
127
|
-
companyId?:
|
|
127
|
+
companyId?: string;
|
|
128
128
|
page?: number;
|
|
129
129
|
pageSize?: number;
|
|
130
130
|
};
|
|
@@ -143,7 +143,7 @@ export type LeaderBoardResponse = {
|
|
|
143
143
|
error?: string;
|
|
144
144
|
};
|
|
145
145
|
export type TagSearchRequest = {
|
|
146
|
-
|
|
146
|
+
tagId: string;
|
|
147
147
|
page: string;
|
|
148
148
|
size: string;
|
|
149
149
|
order: 'asc' | 'desc';
|
|
@@ -8,4 +8,4 @@ var TimeInterval;
|
|
|
8
8
|
TimeInterval["LastDay"] = "Last day";
|
|
9
9
|
TimeInterval["LastWeek"] = "Last week";
|
|
10
10
|
TimeInterval["LastMonth"] = "Last month";
|
|
11
|
-
})(TimeInterval
|
|
11
|
+
})(TimeInterval || (exports.TimeInterval = TimeInterval = {}));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import BerifyHeatMapApi from "./Heatmap";
|
|
2
|
-
import BerifyReskinApi from "./Reskin";
|
|
3
2
|
import BerifyScanChartApi from "./ScanChart";
|
|
4
3
|
declare class BerifyAnalyticsApi {
|
|
5
4
|
host: string;
|
|
@@ -7,7 +6,6 @@ declare class BerifyAnalyticsApi {
|
|
|
7
6
|
secret?: string;
|
|
8
7
|
heatmap: BerifyHeatMapApi;
|
|
9
8
|
scanChart: BerifyScanChartApi;
|
|
10
|
-
reskin: BerifyReskinApi;
|
|
11
9
|
constructor({ host, secretKey, secret }: {
|
|
12
10
|
host: string;
|
|
13
11
|
secretKey?: string;
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function BerifyAnalyticsApi(_a) {
|
|
8
|
-
var host = _a.host, secretKey = _a.secretKey, secret = _a.secret;
|
|
3
|
+
const Heatmap_1 = require("./Heatmap");
|
|
4
|
+
const ScanChart_1 = require("./ScanChart");
|
|
5
|
+
class BerifyAnalyticsApi {
|
|
6
|
+
constructor({ host, secretKey, secret }) {
|
|
9
7
|
this.host = host;
|
|
10
8
|
this.secretKey = secretKey;
|
|
11
9
|
this.secret = secret;
|
|
12
|
-
this.heatmap = new Heatmap_1.default({ host
|
|
13
|
-
this.scanChart = new ScanChart_1.default({ host
|
|
14
|
-
this.reskin = new Reskin_1.default({ host: host, secretKey: secretKey, secret: secret });
|
|
10
|
+
this.heatmap = new Heatmap_1.default({ host, secretKey, secret });
|
|
11
|
+
this.scanChart = new ScanChart_1.default({ host, secretKey, secret });
|
|
15
12
|
}
|
|
16
|
-
|
|
17
|
-
}());
|
|
13
|
+
}
|
|
18
14
|
exports.default = BerifyAnalyticsApi;
|
|
@@ -13,32 +13,28 @@ export declare enum ScanType {
|
|
|
13
13
|
}
|
|
14
14
|
export interface User {
|
|
15
15
|
id: string;
|
|
16
|
-
companyId:
|
|
16
|
+
companyId: string;
|
|
17
17
|
companyRole: CompanyRoleType;
|
|
18
18
|
}
|
|
19
19
|
export interface FilterOptions {
|
|
20
20
|
batchId?: string;
|
|
21
|
-
companyId?:
|
|
22
|
-
|
|
21
|
+
companyId?: string;
|
|
22
|
+
tagId?: string;
|
|
23
23
|
}
|
|
24
24
|
export interface Scan {
|
|
25
|
-
id:
|
|
25
|
+
id: string;
|
|
26
26
|
latitude: Decimal | null;
|
|
27
27
|
longitude: Decimal | null;
|
|
28
28
|
location: string | null;
|
|
29
29
|
createdAt: Date;
|
|
30
|
-
|
|
30
|
+
tagId: string;
|
|
31
31
|
userId: string;
|
|
32
32
|
type: ScanType;
|
|
33
33
|
tag: {
|
|
34
34
|
batchId: string;
|
|
35
35
|
batch: {
|
|
36
|
-
companyId:
|
|
36
|
+
companyId: string;
|
|
37
37
|
name: string;
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
export type DataWithDate = {
|
|
42
|
-
date: string;
|
|
43
|
-
value: number;
|
|
44
|
-
};
|
package/lib/interfaces/index.js
CHANGED
|
@@ -8,10 +8,10 @@ var CompanyRoleType;
|
|
|
8
8
|
CompanyRoleType["marketing"] = "marketing";
|
|
9
9
|
CompanyRoleType["supplier"] = "supplier";
|
|
10
10
|
CompanyRoleType["seo"] = "seo";
|
|
11
|
-
})(CompanyRoleType
|
|
11
|
+
})(CompanyRoleType || (exports.CompanyRoleType = CompanyRoleType = {}));
|
|
12
12
|
var ScanType;
|
|
13
13
|
(function (ScanType) {
|
|
14
14
|
ScanType["AppClip"] = "AppClip";
|
|
15
15
|
ScanType["App"] = "App";
|
|
16
16
|
ScanType["Web"] = "Web";
|
|
17
|
-
})(ScanType
|
|
17
|
+
})(ScanType || (exports.ScanType = ScanType = {}));
|
package/package.json
CHANGED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import BxBApi from '@bytexbyte/bxb-api';
|
|
2
|
-
import { DataWithDate } from '../../../interfaces';
|
|
3
|
-
import { AgeResult, DeviceTypeResult, GenderResult, HeatmapResult, ReskinChartRequest, User } from './type';
|
|
4
|
-
declare class BerifyReskinApi extends BxBApi {
|
|
5
|
-
constructor({ host, secretKey, secret }: {
|
|
6
|
-
host: string;
|
|
7
|
-
secretKey?: string;
|
|
8
|
-
secret?: string;
|
|
9
|
-
});
|
|
10
|
-
getScanCount(user: User, form: ReskinChartRequest): Promise<{
|
|
11
|
-
data: number;
|
|
12
|
-
} | {
|
|
13
|
-
error: 'session not found' | 'user not found' | 'startDate and endDate are required' | 'Permission denied' | 'Internal Server Error';
|
|
14
|
-
}>;
|
|
15
|
-
getNewUserCount(user: User, form: ReskinChartRequest): Promise<{
|
|
16
|
-
data: number;
|
|
17
|
-
} | {
|
|
18
|
-
error: 'session not found' | 'user not found' | 'startDate and endDate are required' | 'Permission denied' | 'Internal Server Error';
|
|
19
|
-
}>;
|
|
20
|
-
getUniqueScanCount(user: User, form: ReskinChartRequest): Promise<{
|
|
21
|
-
data: number;
|
|
22
|
-
} | {
|
|
23
|
-
error: 'session not found' | 'user not found' | 'startDate and endDate are required' | 'Permission denied' | 'Internal Server Error';
|
|
24
|
-
}>;
|
|
25
|
-
getSessionDurationAvg(user: User, form: ReskinChartRequest): Promise<{
|
|
26
|
-
data: number;
|
|
27
|
-
} | {
|
|
28
|
-
error: 'session not found' | 'user not found' | 'startDate and endDate are required' | 'Permission denied' | 'Internal Server Error';
|
|
29
|
-
}>;
|
|
30
|
-
getPromoModalOpenCount(user: User, form: ReskinChartRequest): Promise<{
|
|
31
|
-
data: number;
|
|
32
|
-
} | {
|
|
33
|
-
error: 'session not found' | 'user not found' | 'startDate and endDate are required' | 'Permission denied' | 'Internal Server Error';
|
|
34
|
-
}>;
|
|
35
|
-
getCommunityModalOpenCount(user: User, form: ReskinChartRequest): Promise<{
|
|
36
|
-
data: number;
|
|
37
|
-
} | {
|
|
38
|
-
error: 'session not found' | 'user not found' | 'startDate and endDate are required' | 'Permission denied' | 'Internal Server Error';
|
|
39
|
-
}>;
|
|
40
|
-
getBounceRate(user: User, form: ReskinChartRequest): Promise<{
|
|
41
|
-
data: number;
|
|
42
|
-
} | {
|
|
43
|
-
error: 'session not found' | 'user not found' | 'startDate and endDate are required' | 'Permission denied' | 'Internal Server Error';
|
|
44
|
-
}>;
|
|
45
|
-
getExperienceEngagement(user: User, form: ReskinChartRequest): Promise<{
|
|
46
|
-
data: number;
|
|
47
|
-
} | {
|
|
48
|
-
error: 'session not found' | 'user not found' | 'startDate and endDate are required' | 'Permission denied' | 'Internal Server Error';
|
|
49
|
-
}>;
|
|
50
|
-
getGenderBreakdown(user: User, form: ReskinChartRequest): Promise<{
|
|
51
|
-
data: GenderResult;
|
|
52
|
-
} | {
|
|
53
|
-
error: 'session not found' | 'user not found' | 'startDate and endDate are required' | 'Permission denied' | 'Internal Server Error';
|
|
54
|
-
}>;
|
|
55
|
-
getAgeDistribution(user: User, form: ReskinChartRequest): Promise<{
|
|
56
|
-
data: AgeResult;
|
|
57
|
-
} | {
|
|
58
|
-
error: 'session not found' | 'user not found' | 'startDate and endDate are required' | 'Permission denied' | 'Internal Server Error';
|
|
59
|
-
}>;
|
|
60
|
-
getDeviceType(user: User, form: ReskinChartRequest): Promise<{
|
|
61
|
-
data: DeviceTypeResult;
|
|
62
|
-
} | {
|
|
63
|
-
error: 'session not found' | 'user not found' | 'startDate and endDate are required' | 'Permission denied' | 'Internal Server Error';
|
|
64
|
-
}>;
|
|
65
|
-
getHeatmap(user: User, form: ReskinChartRequest): Promise<{
|
|
66
|
-
data: HeatmapResult;
|
|
67
|
-
} | {
|
|
68
|
-
error: 'session not found' | 'user not found' | 'startDate and endDate are required' | 'Permission denied' | 'Internal Server Error';
|
|
69
|
-
}>;
|
|
70
|
-
getDailyScanCount(user: User, form: ReskinChartRequest): Promise<{
|
|
71
|
-
data: DataWithDate[];
|
|
72
|
-
} | {
|
|
73
|
-
error: 'session not found' | 'user not found' | 'startDate and endDate are required' | 'Permission denied' | 'Internal Server Error';
|
|
74
|
-
}>;
|
|
75
|
-
getActiveTime(user: User, form: ReskinChartRequest): Promise<{
|
|
76
|
-
data: number[];
|
|
77
|
-
} | {
|
|
78
|
-
error: 'session not found' | 'user not found' | 'startDate and endDate are required' | 'Permission denied' | 'Internal Server Error';
|
|
79
|
-
}>;
|
|
80
|
-
}
|
|
81
|
-
export default BerifyReskinApi;
|
|
@@ -1,334 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
-
var bxb_api_1 = require("@bytexbyte/bxb-api");
|
|
55
|
-
var BerifyReskinApi = /** @class */ (function (_super) {
|
|
56
|
-
__extends(BerifyReskinApi, _super);
|
|
57
|
-
function BerifyReskinApi(_a) {
|
|
58
|
-
var host = _a.host, secretKey = _a.secretKey, secret = _a.secret;
|
|
59
|
-
return _super.call(this, {
|
|
60
|
-
host: host,
|
|
61
|
-
moduleName: 'reskin',
|
|
62
|
-
secretKey: secretKey !== null && secretKey !== void 0 ? secretKey : 'secretKey',
|
|
63
|
-
secret: secret !== null && secret !== void 0 ? secret : 'secret'
|
|
64
|
-
}) || this;
|
|
65
|
-
}
|
|
66
|
-
BerifyReskinApi.prototype.getScanCount = function (user, form) {
|
|
67
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
68
|
-
var response;
|
|
69
|
-
return __generator(this, function (_a) {
|
|
70
|
-
switch (_a.label) {
|
|
71
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
72
|
-
method: 'POST',
|
|
73
|
-
headers: {
|
|
74
|
-
'Content-Type': 'application/json'
|
|
75
|
-
},
|
|
76
|
-
body: JSON.stringify({ user: user, form: form })
|
|
77
|
-
}, 'scan-count')];
|
|
78
|
-
case 1:
|
|
79
|
-
response = _a.sent();
|
|
80
|
-
return [2 /*return*/, response.json()];
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
|
-
BerifyReskinApi.prototype.getNewUserCount = function (user, form) {
|
|
86
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
87
|
-
var response;
|
|
88
|
-
return __generator(this, function (_a) {
|
|
89
|
-
switch (_a.label) {
|
|
90
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
91
|
-
method: 'POST',
|
|
92
|
-
headers: {
|
|
93
|
-
'Content-Type': 'application/json'
|
|
94
|
-
},
|
|
95
|
-
body: JSON.stringify({ user: user, form: form })
|
|
96
|
-
}, 'new-user-count')];
|
|
97
|
-
case 1:
|
|
98
|
-
response = _a.sent();
|
|
99
|
-
return [2 /*return*/, response.json()];
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
BerifyReskinApi.prototype.getUniqueScanCount = function (user, form) {
|
|
105
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
106
|
-
var response;
|
|
107
|
-
return __generator(this, function (_a) {
|
|
108
|
-
switch (_a.label) {
|
|
109
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
110
|
-
method: 'POST',
|
|
111
|
-
headers: {
|
|
112
|
-
'Content-Type': 'application/json'
|
|
113
|
-
},
|
|
114
|
-
body: JSON.stringify({ user: user, form: form })
|
|
115
|
-
}, 'unique-scan-count')];
|
|
116
|
-
case 1:
|
|
117
|
-
response = _a.sent();
|
|
118
|
-
return [2 /*return*/, response.json()];
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
};
|
|
123
|
-
BerifyReskinApi.prototype.getSessionDurationAvg = function (user, form) {
|
|
124
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
125
|
-
var response;
|
|
126
|
-
return __generator(this, function (_a) {
|
|
127
|
-
switch (_a.label) {
|
|
128
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
129
|
-
method: 'POST',
|
|
130
|
-
headers: {
|
|
131
|
-
'Content-Type': 'application/json'
|
|
132
|
-
},
|
|
133
|
-
body: JSON.stringify({ user: user, form: form })
|
|
134
|
-
}, 'session-duration-avg')];
|
|
135
|
-
case 1:
|
|
136
|
-
response = _a.sent();
|
|
137
|
-
return [2 /*return*/, response.json()];
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
};
|
|
142
|
-
BerifyReskinApi.prototype.getPromoModalOpenCount = function (user, form) {
|
|
143
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
144
|
-
var response;
|
|
145
|
-
return __generator(this, function (_a) {
|
|
146
|
-
switch (_a.label) {
|
|
147
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
148
|
-
method: 'POST',
|
|
149
|
-
headers: {
|
|
150
|
-
'Content-Type': 'application/json'
|
|
151
|
-
},
|
|
152
|
-
body: JSON.stringify({ user: user, form: form })
|
|
153
|
-
}, 'promo-modal-open-count')];
|
|
154
|
-
case 1:
|
|
155
|
-
response = _a.sent();
|
|
156
|
-
return [2 /*return*/, response.json()];
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
};
|
|
161
|
-
BerifyReskinApi.prototype.getCommunityModalOpenCount = function (user, form) {
|
|
162
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
163
|
-
var response;
|
|
164
|
-
return __generator(this, function (_a) {
|
|
165
|
-
switch (_a.label) {
|
|
166
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
167
|
-
method: 'POST',
|
|
168
|
-
headers: {
|
|
169
|
-
'Content-Type': 'application/json'
|
|
170
|
-
},
|
|
171
|
-
body: JSON.stringify({ user: user, form: form })
|
|
172
|
-
}, 'community-modal-open-count')];
|
|
173
|
-
case 1:
|
|
174
|
-
response = _a.sent();
|
|
175
|
-
return [2 /*return*/, response.json()];
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
});
|
|
179
|
-
};
|
|
180
|
-
BerifyReskinApi.prototype.getBounceRate = function (user, form) {
|
|
181
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
182
|
-
var response;
|
|
183
|
-
return __generator(this, function (_a) {
|
|
184
|
-
switch (_a.label) {
|
|
185
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
186
|
-
method: 'POST',
|
|
187
|
-
headers: {
|
|
188
|
-
'Content-Type': 'application/json'
|
|
189
|
-
},
|
|
190
|
-
body: JSON.stringify({ user: user, form: form })
|
|
191
|
-
}, 'bounce-rate')];
|
|
192
|
-
case 1:
|
|
193
|
-
response = _a.sent();
|
|
194
|
-
return [2 /*return*/, response.json()];
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
});
|
|
198
|
-
};
|
|
199
|
-
BerifyReskinApi.prototype.getExperienceEngagement = function (user, form) {
|
|
200
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
201
|
-
var response;
|
|
202
|
-
return __generator(this, function (_a) {
|
|
203
|
-
switch (_a.label) {
|
|
204
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
205
|
-
method: 'POST',
|
|
206
|
-
headers: {
|
|
207
|
-
'Content-Type': 'application/json'
|
|
208
|
-
},
|
|
209
|
-
body: JSON.stringify({ user: user, form: form })
|
|
210
|
-
}, 'experience-engagement')];
|
|
211
|
-
case 1:
|
|
212
|
-
response = _a.sent();
|
|
213
|
-
return [2 /*return*/, response.json()];
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
});
|
|
217
|
-
};
|
|
218
|
-
BerifyReskinApi.prototype.getGenderBreakdown = function (user, form) {
|
|
219
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
220
|
-
var response;
|
|
221
|
-
return __generator(this, function (_a) {
|
|
222
|
-
switch (_a.label) {
|
|
223
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
224
|
-
method: 'POST',
|
|
225
|
-
headers: {
|
|
226
|
-
'Content-Type': 'application/json'
|
|
227
|
-
},
|
|
228
|
-
body: JSON.stringify({ user: user, form: form })
|
|
229
|
-
}, 'gender-breakdown')];
|
|
230
|
-
case 1:
|
|
231
|
-
response = _a.sent();
|
|
232
|
-
return [2 /*return*/, response.json()];
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
});
|
|
236
|
-
};
|
|
237
|
-
BerifyReskinApi.prototype.getAgeDistribution = function (user, form) {
|
|
238
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
239
|
-
var response;
|
|
240
|
-
return __generator(this, function (_a) {
|
|
241
|
-
switch (_a.label) {
|
|
242
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
243
|
-
method: 'POST',
|
|
244
|
-
headers: {
|
|
245
|
-
'Content-Type': 'application/json'
|
|
246
|
-
},
|
|
247
|
-
body: JSON.stringify({ user: user, form: form })
|
|
248
|
-
}, 'age-distribution')];
|
|
249
|
-
case 1:
|
|
250
|
-
response = _a.sent();
|
|
251
|
-
return [2 /*return*/, response.json()];
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
});
|
|
255
|
-
};
|
|
256
|
-
BerifyReskinApi.prototype.getDeviceType = function (user, form) {
|
|
257
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
258
|
-
var response;
|
|
259
|
-
return __generator(this, function (_a) {
|
|
260
|
-
switch (_a.label) {
|
|
261
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
262
|
-
method: 'POST',
|
|
263
|
-
headers: {
|
|
264
|
-
'Content-Type': 'application/json'
|
|
265
|
-
},
|
|
266
|
-
body: JSON.stringify({ user: user, form: form })
|
|
267
|
-
}, 'device-type')];
|
|
268
|
-
case 1:
|
|
269
|
-
response = _a.sent();
|
|
270
|
-
return [2 /*return*/, response.json()];
|
|
271
|
-
}
|
|
272
|
-
});
|
|
273
|
-
});
|
|
274
|
-
};
|
|
275
|
-
BerifyReskinApi.prototype.getHeatmap = function (user, form) {
|
|
276
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
277
|
-
var response;
|
|
278
|
-
return __generator(this, function (_a) {
|
|
279
|
-
switch (_a.label) {
|
|
280
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
281
|
-
method: 'POST',
|
|
282
|
-
headers: {
|
|
283
|
-
'Content-Type': 'application/json'
|
|
284
|
-
},
|
|
285
|
-
body: JSON.stringify({ user: user, form: form })
|
|
286
|
-
}, 'heatmap')];
|
|
287
|
-
case 1:
|
|
288
|
-
response = _a.sent();
|
|
289
|
-
return [2 /*return*/, response.json()];
|
|
290
|
-
}
|
|
291
|
-
});
|
|
292
|
-
});
|
|
293
|
-
};
|
|
294
|
-
BerifyReskinApi.prototype.getDailyScanCount = function (user, form) {
|
|
295
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
296
|
-
var response;
|
|
297
|
-
return __generator(this, function (_a) {
|
|
298
|
-
switch (_a.label) {
|
|
299
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
300
|
-
method: 'POST',
|
|
301
|
-
headers: {
|
|
302
|
-
'Content-Type': 'application/json'
|
|
303
|
-
},
|
|
304
|
-
body: JSON.stringify({ user: user, form: form })
|
|
305
|
-
}, 'daily-scan-count')];
|
|
306
|
-
case 1:
|
|
307
|
-
response = _a.sent();
|
|
308
|
-
return [2 /*return*/, response.json()];
|
|
309
|
-
}
|
|
310
|
-
});
|
|
311
|
-
});
|
|
312
|
-
};
|
|
313
|
-
BerifyReskinApi.prototype.getActiveTime = function (user, form) {
|
|
314
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
315
|
-
var response;
|
|
316
|
-
return __generator(this, function (_a) {
|
|
317
|
-
switch (_a.label) {
|
|
318
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
319
|
-
method: 'POST',
|
|
320
|
-
headers: {
|
|
321
|
-
'Content-Type': 'application/json'
|
|
322
|
-
},
|
|
323
|
-
body: JSON.stringify({ user: user, form: form })
|
|
324
|
-
}, 'active-time')];
|
|
325
|
-
case 1:
|
|
326
|
-
response = _a.sent();
|
|
327
|
-
return [2 /*return*/, response.json()];
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
});
|
|
331
|
-
};
|
|
332
|
-
return BerifyReskinApi;
|
|
333
|
-
}(bxb_api_1.default));
|
|
334
|
-
exports.default = BerifyReskinApi;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Decimal } from "@prisma/client/runtime/library";
|
|
2
|
-
export type CompanyRoleType = 'super' | 'admin' | 'marketing' | 'supplier' | 'seo' | 'associate';
|
|
3
|
-
export type User = {
|
|
4
|
-
id: string;
|
|
5
|
-
companyId: number;
|
|
6
|
-
companyRole: CompanyRoleType;
|
|
7
|
-
};
|
|
8
|
-
export interface ReskinChartRequest {
|
|
9
|
-
startDate: string;
|
|
10
|
-
endDate: string;
|
|
11
|
-
batchId?: string;
|
|
12
|
-
companyId?: string;
|
|
13
|
-
country?: string;
|
|
14
|
-
state?: string;
|
|
15
|
-
city?: string;
|
|
16
|
-
}
|
|
17
|
-
export type GenderResult = {
|
|
18
|
-
male: number;
|
|
19
|
-
female: number;
|
|
20
|
-
unknown: number;
|
|
21
|
-
};
|
|
22
|
-
export type AgeResult = {
|
|
23
|
-
'18-24': number;
|
|
24
|
-
'25-34': number;
|
|
25
|
-
'35-44': number;
|
|
26
|
-
'45-54': number;
|
|
27
|
-
'55-64': number;
|
|
28
|
-
'65+': number;
|
|
29
|
-
unknown: number;
|
|
30
|
-
};
|
|
31
|
-
export type DeviceTypeResult = {
|
|
32
|
-
iOS: number;
|
|
33
|
-
Android: number;
|
|
34
|
-
Web: number;
|
|
35
|
-
};
|
|
36
|
-
export type HeatmapResult = {
|
|
37
|
-
id: number;
|
|
38
|
-
latitude: Decimal | null;
|
|
39
|
-
longitude: Decimal | null;
|
|
40
|
-
}[];
|