@bytexbyte/berify-analytics-api 2.2.2 → 2.2.4

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.
@@ -1,5 +1,5 @@
1
1
  import BxBApi from '@bytexbyte/bxb-api';
2
- import { ScanReportRequest, ScanReportResponse, UserReportRequest, UserReportResponse, ScanRateResponse, ScanRateByTimeRequest, ScanRateByTimeResponse, User, BatchScanDataRequest, BatchScanDataResponse, LeaderBoardResponse, LeaderBoardRequest, TagSearchRequest, TagScanResponse, BatchScannedUsersExportRequest, BatchScannedUsersExportResponse } from './type';
2
+ import { ScanReportRequest, ScanReportResponse, UserReportRequest, UserReportResponse, ScanRateResponse, ScanRateByTimeRequest, ScanRateByTimeResponse, User, BatchScanDataRequest, BatchScanDataResponse, LeaderBoardResponse, LeaderBoardRequest, TagSearchRequest, TagScanResponse, BatchScannedUsersExportRequest, BatchScannedUsersExportResponse, BatchScanDataExportRequest, BatchScanDataExportResponse, ScanHistoryExportRequest, ScanHistoryExportResponse } from './type';
3
3
  declare class BerifyScanChartApi extends BxBApi {
4
4
  constructor({ host, secretKey, secret }: {
5
5
  host: string;
@@ -14,5 +14,7 @@ declare class BerifyScanChartApi extends BxBApi {
14
14
  getLeaderBoard(user: User, form: LeaderBoardRequest): Promise<LeaderBoardResponse>;
15
15
  getTagScanHistory(form: TagSearchRequest): Promise<TagScanResponse>;
16
16
  exportBatchScannedUsers(user: User, form: BatchScannedUsersExportRequest): Promise<BatchScannedUsersExportResponse>;
17
+ exportBatchScanData(user: User, form: BatchScanDataExportRequest): Promise<BatchScanDataExportResponse>;
18
+ exportScanHistory(user: User, form: ScanHistoryExportRequest): Promise<ScanHistoryExportResponse>;
17
19
  }
18
20
  export default BerifyScanChartApi;
@@ -86,7 +86,27 @@ class BerifyScanChartApi extends bxb_api_1.default {
86
86
  'Content-Type': 'application/json',
87
87
  },
88
88
  body: JSON.stringify({ user, form }),
89
- }, 'export/batch-scanned-users');
89
+ }, 'batch-scanned-users');
90
+ return response.json();
91
+ }
92
+ async exportBatchScanData(user, form) {
93
+ const response = await this.bxbFetch({
94
+ method: 'POST',
95
+ headers: {
96
+ 'Content-Type': 'application/json',
97
+ },
98
+ body: JSON.stringify({ user, form }),
99
+ }, 'export-batch-scan-data');
100
+ return response.json();
101
+ }
102
+ async exportScanHistory(user, form) {
103
+ const response = await this.bxbFetch({
104
+ method: 'POST',
105
+ headers: {
106
+ 'Content-Type': 'application/json',
107
+ },
108
+ body: JSON.stringify({ user, form }),
109
+ }, 'export-scan-history');
90
110
  return response.json();
91
111
  }
92
112
  }
@@ -137,6 +137,35 @@ export type BatchScannedUsersExportResponse = {
137
137
  };
138
138
  error?: string;
139
139
  };
140
+ export type BatchScanDataExportRequest = {
141
+ batchId: string;
142
+ };
143
+ export type BatchScanDataExportResponse = {
144
+ status: 'ok' | 'error';
145
+ data?: {
146
+ downloadUrl: string;
147
+ totalRows?: number;
148
+ };
149
+ error?: string;
150
+ };
151
+ export type ScanHistoryExportFilter = 'AppUser' | 'AppClipUser' | 'RegisteredAppUser';
152
+ export type ScanHistoryExportRequest = {
153
+ filter: ScanHistoryExportFilter[];
154
+ batchId: string;
155
+ tagId?: undefined;
156
+ } | {
157
+ filter: ScanHistoryExportFilter[];
158
+ batchId?: undefined;
159
+ tagId: string;
160
+ };
161
+ export type ScanHistoryExportResponse = {
162
+ status: 'ok' | 'error';
163
+ data?: {
164
+ downloadUrl: string;
165
+ totalRows: number;
166
+ };
167
+ error?: string;
168
+ };
140
169
  export type LeaderBoardRequest = {
141
170
  tagId?: string;
142
171
  batchId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytexbyte/berify-analytics-api",
3
- "version": "2.2.2",
3
+ "version": "2.2.4",
4
4
  "description": "api",
5
5
  "main": "lib/berifyAnalyticsApi/src/index.js",
6
6
  "types": "lib/berifyAnalyticsApi/src/index.d.ts",