@flashbacktech/flashbackclient 0.0.99 → 0.1.2
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 +0 -6
- package/dist/api/types/stats.d.ts +5 -2
- package/package.json +1 -1
package/dist/api/client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CreateUnitRequest, CreateUnitResponse, CreateRepoRequest, CreateRepoResponse, StorageUnit, CreateRepoKeyRequest, CreateRepoKeyResponse, GetUnitsResponse, GetReposResponse, GetRepoKeysResponse, UpdateUnitRequest, UpdateUnitResponse, ActionResponse, UpdateRepoRequest, UpdateRepoResponse, UpdateRepoKeyRequest, UpdateRepoKeyResponse, ValidateUnitRequest, ValidateUnitResponse, ValidateRepoUnitsRequest, ValidateRepoUnitsResponse, StorageUnitStatusResponse, GetUnitNodeStatsResponse, GetUnitNodeStatsRequest } from './types/storage';
|
|
2
2
|
import { IApiClient, ProviderType } from './interfaces';
|
|
3
3
|
import { ActivateResponse, DeactivateResponse, LoginBody, LoginResponse, LogoutResponse, OAuth2ResponseDTO, RefreshTokenErrorResponse, RefreshTokenResponse, RegisterBody, RegisterResponse } from './types/auth';
|
|
4
|
-
import { StatsQueryParams, StatsResponse, NodeStatsMinuteResponse, NodeStatsDailyResponse, NodeStatsQueryParams, UnitStatsResponse, RepoStatsResponse } from './types/stats';
|
|
4
|
+
import { StatsQueryParams, StatsResponse, NodeStatsMinuteResponse, NodeStatsDailyResponse, NodeStatsQueryParams, UnitStatsResponse, RepoStatsResponse, NodeStatsDailyQueryParams } from './types/stats';
|
|
5
5
|
interface ErrorResponse {
|
|
6
6
|
message?: string;
|
|
7
7
|
[key: string]: any;
|
|
@@ -64,7 +64,7 @@ export declare class ApiClient implements IApiClient {
|
|
|
64
64
|
getDailyStats: (params: StatsQueryParams) => Promise<StatsResponse>;
|
|
65
65
|
getMinuteStats: (params: StatsQueryParams) => Promise<StatsResponse>;
|
|
66
66
|
getNodeStatsMinute: (params: NodeStatsQueryParams) => Promise<NodeStatsMinuteResponse>;
|
|
67
|
-
getNodeStatsDaily: (params:
|
|
67
|
+
getNodeStatsDaily: (params: NodeStatsDailyQueryParams) => Promise<NodeStatsDailyResponse>;
|
|
68
68
|
getRepoStats: (params?: {
|
|
69
69
|
repoId?: string[];
|
|
70
70
|
}) => Promise<RepoStatsResponse>;
|
package/dist/api/client.js
CHANGED
|
@@ -255,12 +255,6 @@ class ApiClient {
|
|
|
255
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
|
-
}
|
|
264
258
|
const response = await this.makeRequest(`stats/nodes/minute?${queryParams.toString() ? `?${queryParams.toString()}` : ''}`, 'GET', null);
|
|
265
259
|
// Process the response to convert lastUpdated strings to Date objects
|
|
266
260
|
const processedData = response.data.map((item) => ({
|
|
@@ -50,8 +50,11 @@ export interface NodeStatsDailyData {
|
|
|
50
50
|
}
|
|
51
51
|
export interface NodeStatsQueryParams {
|
|
52
52
|
unitId: string[];
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
}
|
|
54
|
+
export interface NodeStatsDailyQueryParams {
|
|
55
|
+
unitId: string[];
|
|
56
|
+
startDate?: number;
|
|
57
|
+
endDate?: number;
|
|
55
58
|
}
|
|
56
59
|
export interface RepoStatsResponse {
|
|
57
60
|
success: boolean;
|