@bytexbyte/berify-analytics-api 1.4.9 → 1.5.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.
@@ -169,7 +169,7 @@ var BerifyScanChartApi = /** @class */ (function (_super) {
169
169
  'Content-Type': 'application/json'
170
170
  },
171
171
  body: JSON.stringify({ user: user, form: form })
172
- }, 'leader-board')];
172
+ }, 'leaderBoard')];
173
173
  case 1:
174
174
  response = _a.sent();
175
175
  return [2 /*return*/, response.json()];
@@ -124,6 +124,8 @@ export type LeaderBoardRequest = {
124
124
  tagTokenId?: string;
125
125
  batchId?: string;
126
126
  companyId?: number;
127
+ page?: number;
128
+ pageSize?: number;
127
129
  };
128
130
  export type LeaderBoardResult = {
129
131
  position: number;
@@ -133,6 +135,9 @@ export type LeaderBoardResult = {
133
135
  }[];
134
136
  export type LeaderBoardResponse = {
135
137
  status: 'ok' | 'error';
136
- data?: LeaderBoardResult;
138
+ data?: {
139
+ data: LeaderBoardResult;
140
+ totalDatasNumber: number;
141
+ };
137
142
  error?: string;
138
143
  };
@@ -0,0 +1,12 @@
1
+ import BxBApi from '@bytexbyte/bxb-api';
2
+ import { HeatmapRequest, HeatmapResponse, LastUpdatedAtResponse } from './type';
3
+ declare class BerifyHeatMapApi extends BxBApi {
4
+ constructor({ host, secretKey, secret }: {
5
+ host: string;
6
+ secretKey?: string;
7
+ secret?: string;
8
+ });
9
+ getHeatmap(form: HeatmapRequest): Promise<HeatmapResponse>;
10
+ getLastUpdatedAt(): Promise<LastUpdatedAtResponse>;
11
+ }
12
+ export default BerifyHeatMapApi;
@@ -0,0 +1,105 @@
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 BerifyHeatMapApi = /** @class */ (function (_super) {
56
+ __extends(BerifyHeatMapApi, _super);
57
+ function BerifyHeatMapApi(_a) {
58
+ var host = _a.host, secretKey = _a.secretKey, secret = _a.secret;
59
+ return _super.call(this, {
60
+ host: host,
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
+ });
83
+ });
84
+ };
85
+ BerifyHeatMapApi.prototype.getLastUpdatedAt = function () {
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: 'GET',
92
+ headers: {
93
+ 'Content-Type': 'application/json'
94
+ }
95
+ })];
96
+ case 1:
97
+ response = _a.sent();
98
+ return [2 /*return*/, response.json()];
99
+ }
100
+ });
101
+ });
102
+ };
103
+ return BerifyHeatMapApi;
104
+ }(bxb_api_1.default));
105
+ exports.default = BerifyHeatMapApi;
@@ -0,0 +1,33 @@
1
+ import { Decimal } from "@prisma/client/runtime/library";
2
+ export type HeatmapApi = (form: HeatmapRequest) => Promise<HeatmapResponse>;
3
+ declare enum TimeInterval {
4
+ All = "All Time",
5
+ LastHour = "Last hour",
6
+ LastDay = "Last day",
7
+ LastWeek = "Last week",
8
+ LastMonth = "Last month"
9
+ }
10
+ export type HeatmapRequest = {
11
+ userId: string;
12
+ companyId?: number;
13
+ tagTokenId?: string;
14
+ batchId?: string;
15
+ collectionRuleId?: number;
16
+ timeInterval: TimeInterval;
17
+ };
18
+ export type HeatmapResult = {
19
+ id: number;
20
+ latitude: Decimal | null;
21
+ longitude: Decimal | null;
22
+ }[];
23
+ export type HeatmapResponse = {
24
+ status: 'ok' | 'error';
25
+ data?: HeatmapResult;
26
+ error?: string;
27
+ };
28
+ export type LastUpdatedAtResponse = {
29
+ status: 'ok' | 'error';
30
+ data?: Date;
31
+ error?: string;
32
+ };
33
+ export {};
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var TimeInterval;
4
+ (function (TimeInterval) {
5
+ TimeInterval["All"] = "All Time";
6
+ TimeInterval["LastHour"] = "Last hour";
7
+ TimeInterval["LastDay"] = "Last day";
8
+ TimeInterval["LastWeek"] = "Last week";
9
+ TimeInterval["LastMonth"] = "Last month";
10
+ })(TimeInterval || (TimeInterval = {}));
@@ -0,0 +1,17 @@
1
+ import BxBApi from '@bytexbyte/bxb-api';
2
+ import { ScanReportRequest, ScanReportResponse, UserReportRequest, UserReportResponse, ScanRateResponse, ScanRateByTimeRequest, ScanRateByTimeResponse, User, BatchScanDataRequest, BatchScanDataResponse, LeaderBoardResponse, LeaderBoardRequest, TagSearchRequest, TagScanResponse } from './type';
3
+ declare class BerifyScanChartApi extends BxBApi {
4
+ constructor({ host, secretKey, secret }: {
5
+ host: string;
6
+ secretKey?: string;
7
+ secret?: string;
8
+ });
9
+ getScanReport(user: User, form: ScanReportRequest): Promise<ScanReportResponse>;
10
+ getUserReport(user: User, form: UserReportRequest): Promise<UserReportResponse>;
11
+ getScanRateAll(user: User, form: UserReportRequest): Promise<ScanRateResponse>;
12
+ getScanRateByTime(user: User, form: ScanRateByTimeRequest): Promise<ScanRateByTimeResponse>;
13
+ getBatchScanData(form: BatchScanDataRequest): Promise<BatchScanDataResponse>;
14
+ getLeaderBoard(user: User, form: LeaderBoardRequest): Promise<LeaderBoardResponse>;
15
+ getTagScanHistory(form: TagSearchRequest): Promise<TagScanResponse>;
16
+ }
17
+ export default BerifyScanChartApi;
@@ -0,0 +1,201 @@
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 BerifyScanChartApi = /** @class */ (function (_super) {
56
+ __extends(BerifyScanChartApi, _super);
57
+ function BerifyScanChartApi(_a) {
58
+ var host = _a.host, secretKey = _a.secretKey, secret = _a.secret;
59
+ return _super.call(this, {
60
+ host: host,
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
+ });
197
+ });
198
+ };
199
+ return BerifyScanChartApi;
200
+ }(bxb_api_1.default));
201
+ exports.default = BerifyScanChartApi;
@@ -0,0 +1,169 @@
1
+ import { Scan } from "../../../interfaces";
2
+ export type ScanReportRequest = {
3
+ tagTokenId?: string;
4
+ batchId?: string;
5
+ companyId?: number;
6
+ };
7
+ export type ScanReportResult = {
8
+ anonymous: number;
9
+ unique: number;
10
+ returning: number;
11
+ total: number;
12
+ };
13
+ export type ScanReportResponse = {
14
+ status: 'ok' | 'error';
15
+ data?: ScanReportResult;
16
+ error?: string;
17
+ };
18
+ export type UserReportRequest = {
19
+ tagTokenId?: string;
20
+ batchId?: string;
21
+ companyId?: number;
22
+ };
23
+ export type UserReportResult = {
24
+ appClip: number;
25
+ appUser: number;
26
+ registeredAppUser: number;
27
+ total: number;
28
+ };
29
+ export type UserReportResponse = {
30
+ status: 'ok' | 'error';
31
+ data?: UserReportResult;
32
+ error?: string;
33
+ };
34
+ export type ScanRateResponse = {
35
+ status: 'ok' | 'error';
36
+ data?: {
37
+ month: string;
38
+ scanCounts: number;
39
+ }[];
40
+ error?: string;
41
+ };
42
+ export declare enum TimeInterval {
43
+ All = "All Time",
44
+ LastHour = "Last hour",
45
+ LastDay = "Last day",
46
+ LastWeek = "Last week",
47
+ LastMonth = "Last month"
48
+ }
49
+ export type ScanRateByTimeRequest = {
50
+ batchId?: string;
51
+ companyId?: number;
52
+ tagTokenId?: string;
53
+ time: TimeInterval;
54
+ };
55
+ export type ScanRateByTimeResponse = {
56
+ status: 'ok' | 'error';
57
+ data?: {
58
+ scanCounts: number;
59
+ date?: Date;
60
+ year?: string;
61
+ month?: string;
62
+ day?: string;
63
+ hour?: string;
64
+ minute?: string;
65
+ }[];
66
+ error?: string;
67
+ };
68
+ export type CompanyRoleType = 'super' | 'admin' | 'marketing' | 'supplier' | 'seo' | 'associate';
69
+ export type User = {
70
+ id: string;
71
+ companyId: number;
72
+ companyRole: CompanyRoleType;
73
+ };
74
+ export type ScanRateType = {
75
+ date?: Date;
76
+ year?: string;
77
+ month?: string;
78
+ day?: string;
79
+ hour?: string;
80
+ minute?: string;
81
+ scanCounts: number;
82
+ };
83
+ export type BatchScanDataRequest = {
84
+ batchId: string;
85
+ page: string;
86
+ pageSize: string;
87
+ sort: 'lastScanned' | 'totalScan' | 'uniqueCount';
88
+ order: 'asc' | 'desc';
89
+ gtRedeemStatus?: 'redeemed' | 'not_redeemed' | 'none';
90
+ search?: string;
91
+ };
92
+ export type BlockChainStatusType = 'transferred' | 'minted' | 'queued' | 'transferring' | 'fail';
93
+ export type BatchScanDataResult = {
94
+ tagTokenId: string;
95
+ totalScan: number;
96
+ uniqueCount: number;
97
+ lastScanned: Date;
98
+ goldenTicketPrize: {
99
+ id: number;
100
+ tagTokenId: string;
101
+ goldenTicketPrizeId: number;
102
+ };
103
+ goldenTicketRedeem: {
104
+ id: number;
105
+ tagTokenId: string;
106
+ goldenTicketRedeemId: number;
107
+ };
108
+ tagNft: {
109
+ id: number;
110
+ tagTokenId: string;
111
+ blockchainStatus: BlockChainStatusType;
112
+ updatedAt: Date;
113
+ };
114
+ };
115
+ export type BatchScanDataResponse = {
116
+ status: 'ok' | 'error';
117
+ data?: BatchScanDataResult[];
118
+ error?: string;
119
+ currentPage: number;
120
+ totalPages: number;
121
+ pageSize: number;
122
+ totalItems: number;
123
+ };
124
+ export type LeaderBoardRequest = {
125
+ tagTokenId?: string;
126
+ batchId?: string;
127
+ companyId?: number;
128
+ page?: number;
129
+ pageSize?: number;
130
+ };
131
+ export type LeaderBoardResult = {
132
+ position: number;
133
+ batchId: string;
134
+ batchName: string;
135
+ totalScans: number;
136
+ }[];
137
+ export type LeaderBoardResponse = {
138
+ status: 'ok' | 'error';
139
+ data?: {
140
+ data: LeaderBoardResult;
141
+ totalDatasNumber: number;
142
+ };
143
+ error?: string;
144
+ };
145
+ export type TagSearchRequest = {
146
+ tagTokenId: string;
147
+ page: string;
148
+ size: string;
149
+ order: 'asc' | 'desc';
150
+ filter: string;
151
+ };
152
+ export type GeneralUser = {
153
+ id: string;
154
+ firstName: string;
155
+ lastName: string;
156
+ email: string;
157
+ phone: string;
158
+ };
159
+ export interface ScanWithUser extends Scan {
160
+ generalUser?: GeneralUser;
161
+ }
162
+ export type TagScanResponse = {
163
+ status: 'ok' | 'error';
164
+ data?: {
165
+ scanList: ScanWithUser;
166
+ scanListCount: number;
167
+ };
168
+ error?: string;
169
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TimeInterval = void 0;
4
+ var TimeInterval;
5
+ (function (TimeInterval) {
6
+ TimeInterval["All"] = "All Time";
7
+ TimeInterval["LastHour"] = "Last hour";
8
+ TimeInterval["LastDay"] = "Last day";
9
+ TimeInterval["LastWeek"] = "Last week";
10
+ TimeInterval["LastMonth"] = "Last month";
11
+ })(TimeInterval = exports.TimeInterval || (exports.TimeInterval = {}));
@@ -0,0 +1 @@
1
+ export declare const AnalyticsApiSecret = "Analytics-Api-Secret";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AnalyticsApiSecret = void 0;
4
+ exports.AnalyticsApiSecret = 'Analytics-Api-Secret';
@@ -0,0 +1,15 @@
1
+ import BerifyHeatMapApi from "./Heatmap";
2
+ import BerifyScanChartApi from "./ScanChart";
3
+ declare class BerifyAnalyticsApi {
4
+ host: string;
5
+ secretKey?: string;
6
+ secret?: string;
7
+ heatmap: BerifyHeatMapApi;
8
+ scanChart: BerifyScanChartApi;
9
+ constructor({ host, secretKey, secret }: {
10
+ host: string;
11
+ secretKey?: string;
12
+ secret?: string;
13
+ });
14
+ }
15
+ export default BerifyAnalyticsApi;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var Heatmap_1 = require("./Heatmap");
4
+ var ScanChart_1 = require("./ScanChart");
5
+ var BerifyAnalyticsApi = /** @class */ (function () {
6
+ function BerifyAnalyticsApi(_a) {
7
+ var host = _a.host, secretKey = _a.secretKey, secret = _a.secret;
8
+ this.host = host;
9
+ this.secretKey = secretKey;
10
+ this.secret = secret;
11
+ this.heatmap = new Heatmap_1.default({ host: host, secretKey: secretKey, secret: secret });
12
+ this.scanChart = new ScanChart_1.default({ host: host, secretKey: secretKey, secret: secret });
13
+ }
14
+ return BerifyAnalyticsApi;
15
+ }());
16
+ exports.default = BerifyAnalyticsApi;
@@ -0,0 +1,39 @@
1
+ import { Decimal } from "@prisma/client/runtime/library";
2
+ export declare enum CompanyRoleType {
3
+ super = "super",
4
+ admin = "admin",
5
+ marketing = "marketing",
6
+ supplier = "supplier",
7
+ seo = "seo"
8
+ }
9
+ export declare enum ScanType {
10
+ AppClip = "AppClip",
11
+ App = "App",
12
+ Web = "Web"
13
+ }
14
+ export interface User {
15
+ id: string;
16
+ companyId: number;
17
+ companyRole: CompanyRoleType;
18
+ }
19
+ export interface FilterOptions {
20
+ batchId?: string;
21
+ companyId?: number;
22
+ tagTokenId?: string;
23
+ }
24
+ export interface Scan {
25
+ id: number;
26
+ latitude: Decimal | null;
27
+ longitude: Decimal | null;
28
+ createdAt: Date;
29
+ tagTokenId: string;
30
+ userId: string;
31
+ type: ScanType;
32
+ tag: {
33
+ batchId: string;
34
+ batch: {
35
+ companyId: number;
36
+ name: string;
37
+ };
38
+ };
39
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ScanType = exports.CompanyRoleType = void 0;
4
+ var CompanyRoleType;
5
+ (function (CompanyRoleType) {
6
+ CompanyRoleType["super"] = "super";
7
+ CompanyRoleType["admin"] = "admin";
8
+ CompanyRoleType["marketing"] = "marketing";
9
+ CompanyRoleType["supplier"] = "supplier";
10
+ CompanyRoleType["seo"] = "seo";
11
+ })(CompanyRoleType = exports.CompanyRoleType || (exports.CompanyRoleType = {}));
12
+ var ScanType;
13
+ (function (ScanType) {
14
+ ScanType["AppClip"] = "AppClip";
15
+ ScanType["App"] = "App";
16
+ ScanType["Web"] = "Web";
17
+ })(ScanType = exports.ScanType || (exports.ScanType = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytexbyte/berify-analytics-api",
3
- "version": "1.4.9",
3
+ "version": "1.5.1",
4
4
  "description": "api",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",