@flashbacktech/flashbackclient 0.0.98 → 0.0.99
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/api/client.d.ts +2 -2
- package/dist/api/client.js +14 -2
- package/dist/api/types/stats.d.ts +3 -1
- package/package.json +1 -1
package/dist/api/client.d.ts
CHANGED
|
@@ -63,8 +63,8 @@ export declare class ApiClient implements IApiClient {
|
|
|
63
63
|
private validateDateRange;
|
|
64
64
|
getDailyStats: (params: StatsQueryParams) => Promise<StatsResponse>;
|
|
65
65
|
getMinuteStats: (params: StatsQueryParams) => Promise<StatsResponse>;
|
|
66
|
-
getNodeStatsMinute: (params
|
|
67
|
-
getNodeStatsDaily: (params
|
|
66
|
+
getNodeStatsMinute: (params: NodeStatsQueryParams) => Promise<NodeStatsMinuteResponse>;
|
|
67
|
+
getNodeStatsDaily: (params: NodeStatsQueryParams) => Promise<NodeStatsDailyResponse>;
|
|
68
68
|
getRepoStats: (params?: {
|
|
69
69
|
repoId?: string[];
|
|
70
70
|
}) => Promise<RepoStatsResponse>;
|
package/dist/api/client.js
CHANGED
|
@@ -252,9 +252,15 @@ class ApiClient {
|
|
|
252
252
|
};
|
|
253
253
|
this.getNodeStatsMinute = async (params) => {
|
|
254
254
|
const queryParams = new URLSearchParams();
|
|
255
|
-
if (params
|
|
255
|
+
if (params.unitId.length > 0) {
|
|
256
256
|
queryParams.append('unitId', params.unitId.join(','));
|
|
257
257
|
}
|
|
258
|
+
if (params.startDate) {
|
|
259
|
+
queryParams.append('startDate', params.startDate.toISOString());
|
|
260
|
+
}
|
|
261
|
+
if (params.endDate) {
|
|
262
|
+
queryParams.append('endDate', params.endDate.toISOString());
|
|
263
|
+
}
|
|
258
264
|
const response = await this.makeRequest(`stats/nodes/minute?${queryParams.toString() ? `?${queryParams.toString()}` : ''}`, 'GET', null);
|
|
259
265
|
// Process the response to convert lastUpdated strings to Date objects
|
|
260
266
|
const processedData = response.data.map((item) => ({
|
|
@@ -268,9 +274,15 @@ class ApiClient {
|
|
|
268
274
|
};
|
|
269
275
|
this.getNodeStatsDaily = async (params) => {
|
|
270
276
|
const queryParams = new URLSearchParams();
|
|
271
|
-
if (params
|
|
277
|
+
if (params.unitId.length > 0) {
|
|
272
278
|
queryParams.append('unitId', params.unitId.join(','));
|
|
273
279
|
}
|
|
280
|
+
if (params.startDate) {
|
|
281
|
+
queryParams.append('startDate', params.startDate.toISOString());
|
|
282
|
+
}
|
|
283
|
+
if (params.endDate) {
|
|
284
|
+
queryParams.append('endDate', params.endDate.toISOString());
|
|
285
|
+
}
|
|
274
286
|
return this.makeRequest(`stats/nodes/daily${queryParams.toString() ? `?${queryParams.toString()}` : ''}`, 'GET', null);
|
|
275
287
|
};
|
|
276
288
|
this.getRepoStats = async (params) => {
|