@flashbacktech/flashbackclient 0.0.81 → 0.0.83

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,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 } 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 } from './types/storage';
2
2
  import { IApiClient, ProviderType } from './interfaces';
3
3
  import { OAuth2ResponseDTO, RefreshTokenResponse } from './types/auth';
4
4
  interface ErrorResponse {
@@ -41,6 +41,7 @@ export declare class ApiClient implements IApiClient {
41
41
  updateStorageUnit: (unitId: string, data: UpdateUnitRequest) => Promise<UpdateUnitResponse>;
42
42
  deleteStorageUnit: (unitId: string) => Promise<ActionResponse>;
43
43
  getAvailableStorageUnits: () => Promise<StorageUnit[]>;
44
+ getStorageUnitStatus: (unitId: string) => Promise<StorageUnitStatusResponse>;
44
45
  createStorageRepo: (data: CreateRepoRequest) => Promise<CreateRepoResponse>;
45
46
  getStorageRepos: () => Promise<GetReposResponse>;
46
47
  updateStorageRepo: (repoId: string, data: UpdateRepoRequest) => Promise<UpdateRepoResponse>;
@@ -157,6 +157,9 @@ class ApiClient {
157
157
  this.getAvailableStorageUnits = async () => {
158
158
  return this.makeRequest('unit/available', 'GET', null);
159
159
  };
160
+ this.getStorageUnitStatus = async (unitId) => {
161
+ return this.makeRequest(`unit/${unitId}/status`, 'GET', null);
162
+ };
160
163
  ////// Repos API
161
164
  this.createStorageRepo = async (data) => {
162
165
  return this.makeRequest('repo', 'POST', data);
@@ -1,4 +1,4 @@
1
- export declare enum BucketStatusType {
1
+ export declare enum NodeStatusType {
2
2
  ONLINE = "ONLINE",
3
3
  OFFLINE = "OFFLINE",
4
4
  DISCONNECTED = "DISCONNECTED"
@@ -9,18 +9,24 @@ interface NodeSignedMessage {
9
9
  timestamp: number;
10
10
  signature: string;
11
11
  }
12
+ export interface NodeStatusInfo {
13
+ ip: string;
14
+ region: string;
15
+ version: string;
16
+ status: NodeStatusType;
17
+ latencyMs?: number;
18
+ lastUpdated: string;
19
+ }
12
20
  export interface BucketStatus {
13
21
  unitId: string;
14
- status: BucketStatusType;
15
- latency_ms?: number;
22
+ status: NodeStatusType;
23
+ latencyMs?: number;
16
24
  createdAt: string;
17
25
  }
18
26
  export interface NodeStatusRequest extends NodeSignedMessage {
19
27
  buckets: BucketStatus[];
20
28
  }
21
- export interface NodeStatusResponse {
22
- nodeIP: string;
23
- buckets: BucketStatus[];
29
+ export interface NodeStatusResponse extends RegisterResponse {
24
30
  }
25
31
  export interface RegisterRequest extends NodeSignedMessage {
26
32
  provider: string;
@@ -31,7 +37,7 @@ export interface RegisterRequest extends NodeSignedMessage {
31
37
  export interface RegisterResponse {
32
38
  success: boolean;
33
39
  message: string;
34
- error_code?: string;
35
- error_message?: string;
40
+ errorCode?: string;
41
+ errorMessage?: string;
36
42
  }
37
43
  export {};
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BucketStatusType = void 0;
4
- var BucketStatusType;
5
- (function (BucketStatusType) {
6
- BucketStatusType["ONLINE"] = "ONLINE";
7
- BucketStatusType["OFFLINE"] = "OFFLINE";
8
- BucketStatusType["DISCONNECTED"] = "DISCONNECTED";
9
- })(BucketStatusType || (exports.BucketStatusType = BucketStatusType = {}));
3
+ exports.NodeStatusType = void 0;
4
+ var NodeStatusType;
5
+ (function (NodeStatusType) {
6
+ NodeStatusType["ONLINE"] = "ONLINE";
7
+ NodeStatusType["OFFLINE"] = "OFFLINE";
8
+ NodeStatusType["DISCONNECTED"] = "DISCONNECTED";
9
+ })(NodeStatusType || (exports.NodeStatusType = NodeStatusType = {}));
@@ -1,3 +1,4 @@
1
+ import { NodeStatusInfo } from "./bridge";
1
2
  export declare enum StorageType {
2
3
  S3 = "S3",
3
4
  GCS = "GCS",
@@ -144,6 +145,10 @@ export interface ValidateRepoUnitsResponse {
144
145
  error_code?: RepoErrorCodes;
145
146
  error_message?: string;
146
147
  }
148
+ export interface StorageUnitStatusResponse {
149
+ unitId: string;
150
+ nodeStatus: NodeStatusInfo[];
151
+ }
147
152
  export declare enum RepoErrorCodes {
148
153
  SUCCESS = "SUCCESS",
149
154
  NOT_FOUND = "NOT_FOUND",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.0.81",
3
+ "version": "0.0.83",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },