@flashbacktech/flashbackclient 0.0.85 → 0.0.87
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
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateUnitRequest, CreateUnitResponse, CreateRepoRequest, CreateRepoResponse, StorageUnit, CreateRepoKeyRequest, CreateRepoKeyResponse, GetUnitsResponse, GetReposResponse, GetRepoKeysResponse, UpdateUnitRequest, UpdateUnitResponse, ActionResponse, UpdateRepoRequest, UpdateRepoResponse, UpdateRepoKeyRequest, UpdateRepoKeyResponse, ValidateUnitRequest, ValidateUnitResponse, ValidateRepoUnitsRequest, ValidateRepoUnitsResponse, StorageUnitStatusResponse } from './types/storage';
|
|
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, RefreshTokenResponse, RegisterBody, RegisterResponse } from './types/auth';
|
|
4
4
|
interface ErrorResponse {
|
|
@@ -42,6 +42,7 @@ export declare class ApiClient implements IApiClient {
|
|
|
42
42
|
deleteStorageUnit: (unitId: string) => Promise<ActionResponse>;
|
|
43
43
|
getAvailableStorageUnits: () => Promise<StorageUnit[]>;
|
|
44
44
|
getStorageUnitStatus: (unitId: string) => Promise<StorageUnitStatusResponse>;
|
|
45
|
+
getUnitNodeStats: (unitId: string, data: GetUnitNodeStatsRequest) => Promise<GetUnitNodeStatsResponse>;
|
|
45
46
|
createStorageRepo: (data: CreateRepoRequest) => Promise<CreateRepoResponse>;
|
|
46
47
|
getStorageRepos: () => Promise<GetReposResponse>;
|
|
47
48
|
updateStorageRepo: (repoId: string, data: UpdateRepoRequest) => Promise<UpdateRepoResponse>;
|
package/dist/api/client.js
CHANGED
|
@@ -164,6 +164,9 @@ class ApiClient {
|
|
|
164
164
|
this.getStorageUnitStatus = async (unitId) => {
|
|
165
165
|
return this.makeRequest(`unit/${unitId}/status`, 'GET', null);
|
|
166
166
|
};
|
|
167
|
+
this.getUnitNodeStats = async (unitId, data) => {
|
|
168
|
+
return this.makeRequest(`unit/${unitId}/stats`, 'GET', data);
|
|
169
|
+
};
|
|
167
170
|
////// Repos API
|
|
168
171
|
this.createStorageRepo = async (data) => {
|
|
169
172
|
return this.makeRequest('repo', 'POST', data);
|
package/dist/api/interfaces.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StorageUnit, CreateUnitRequest, CreateUnitResponse, CreateRepoRequest, CreateRepoResponse, CreateRepoKeyRequest, CreateRepoKeyResponse, GetUnitsResponse, GetReposResponse, GetRepoKeysResponse, UpdateUnitRequest, UpdateUnitResponse, ActionResponse, UpdateRepoResponse, UpdateRepoRequest, UpdateRepoKeyRequest, UpdateRepoKeyResponse, ValidateUnitRequest, ValidateUnitResponse, ValidateRepoUnitsRequest, ValidateRepoUnitsResponse } from "./types/storage";
|
|
1
|
+
import { StorageUnit, CreateUnitRequest, CreateUnitResponse, CreateRepoRequest, CreateRepoResponse, CreateRepoKeyRequest, CreateRepoKeyResponse, GetUnitsResponse, GetReposResponse, GetRepoKeysResponse, UpdateUnitRequest, UpdateUnitResponse, ActionResponse, UpdateRepoResponse, UpdateRepoRequest, UpdateRepoKeyRequest, UpdateRepoKeyResponse, ValidateUnitRequest, ValidateUnitResponse, ValidateRepoUnitsRequest, ValidateRepoUnitsResponse, GetUnitNodeStatsRequest, GetUnitNodeStatsResponse } from "./types/storage";
|
|
2
2
|
import { RegisterBody, LoginBody, RegisterResponse, LoginResponse, LogoutResponse, ActivateResponse, DeactivateResponse, RefreshTokenResponse } from "./types/auth";
|
|
3
3
|
export declare enum ProviderType {
|
|
4
4
|
GOOGLE = "GOOGLE",
|
|
@@ -14,6 +14,7 @@ export interface IApiClient {
|
|
|
14
14
|
deleteStorageUnit(unitId: string): Promise<ActionResponse>;
|
|
15
15
|
validateStorageUnit(unitId: string, data: ValidateUnitRequest): Promise<ValidateUnitResponse>;
|
|
16
16
|
getAvailableStorageUnits(): Promise<StorageUnit[]>;
|
|
17
|
+
getUnitNodeStats(unitId: string, data: GetUnitNodeStatsRequest): Promise<GetUnitNodeStatsResponse>;
|
|
17
18
|
createStorageRepo(data: CreateRepoRequest): Promise<CreateRepoResponse>;
|
|
18
19
|
getStorageRepos(): Promise<GetReposResponse>;
|
|
19
20
|
updateStorageRepo(repoId: string, data: UpdateRepoRequest): Promise<UpdateRepoResponse>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NodeStatusInfo } from "./bridge";
|
|
1
|
+
import { NodeStatusInfo, NodeStatusType } from "./bridge";
|
|
2
2
|
export declare enum StorageType {
|
|
3
3
|
S3 = "S3",
|
|
4
4
|
GCS = "GCS",
|
|
@@ -26,6 +26,23 @@ export interface CreateUnitRequest {
|
|
|
26
26
|
endpoint?: string;
|
|
27
27
|
region?: string;
|
|
28
28
|
}
|
|
29
|
+
export interface GetUnitNodeStatsRequest {
|
|
30
|
+
day: Date;
|
|
31
|
+
}
|
|
32
|
+
export interface GetUnitNodeStatsResponse {
|
|
33
|
+
success: boolean;
|
|
34
|
+
nodeStats: UnitNodeStatsDailyInfo[];
|
|
35
|
+
}
|
|
36
|
+
export interface UnitNodeStatsDailyInfo {
|
|
37
|
+
ip: string;
|
|
38
|
+
host: string;
|
|
39
|
+
perc_uptime: number;
|
|
40
|
+
avg_latency_ms: number;
|
|
41
|
+
version: string;
|
|
42
|
+
node_status: NodeStatusType;
|
|
43
|
+
last_updated: string;
|
|
44
|
+
last_latency_ms: number;
|
|
45
|
+
}
|
|
29
46
|
export interface UpdateUnitRequest extends CreateUnitRequest {
|
|
30
47
|
}
|
|
31
48
|
export interface CreateUnitResponse {
|