@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.
@@ -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?: NodeStatsQueryParams) => Promise<NodeStatsMinuteResponse>;
67
- getNodeStatsDaily: (params?: NodeStatsQueryParams) => Promise<NodeStatsDailyResponse>;
66
+ getNodeStatsMinute: (params: NodeStatsQueryParams) => Promise<NodeStatsMinuteResponse>;
67
+ getNodeStatsDaily: (params: NodeStatsQueryParams) => Promise<NodeStatsDailyResponse>;
68
68
  getRepoStats: (params?: {
69
69
  repoId?: string[];
70
70
  }) => Promise<RepoStatsResponse>;
@@ -252,9 +252,15 @@ class ApiClient {
252
252
  };
253
253
  this.getNodeStatsMinute = async (params) => {
254
254
  const queryParams = new URLSearchParams();
255
- if (params && params.unitId && params.unitId.length > 0) {
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 && params.unitId && params.unitId.length > 0) {
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) => {
@@ -49,7 +49,9 @@ export interface NodeStatsDailyData {
49
49
  version: string;
50
50
  }
51
51
  export interface NodeStatsQueryParams {
52
- unitId?: string[];
52
+ unitId: string[];
53
+ startDate?: Date;
54
+ endDate?: Date;
53
55
  }
54
56
  export interface RepoStatsResponse {
55
57
  success: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.0.98",
3
+ "version": "0.0.99",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"