@flashbacktech/flashbackclient 0.0.56 → 0.0.57

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, CreateRepoKeyRequest, CreateRepoKeyResponse, GetUnitsResponse, GetReposResponse, GetRepoKeysResponse, UpdateUnitRequest, UpdateUnitResponse, ActionResponse, UpdateRepoRequest, UpdateRepoResponse, UpdateRepoKeyRequest, UpdateRepoKeyResponse } from './types/storage';
1
+ import { CreateUnitRequest, CreateUnitResponse, CreateRepoRequest, CreateRepoResponse, CreateRepoKeyRequest, CreateRepoKeyResponse, GetUnitsResponse, GetReposResponse, GetRepoKeysResponse, UpdateUnitRequest, UpdateUnitResponse, ActionResponse, UpdateRepoRequest, UpdateRepoResponse, UpdateRepoKeyRequest, UpdateRepoKeyResponse, ValidateUnitRequest, ValidateUnitResponse } from './types/storage';
2
2
  import { IApiClient, ProviderType } from './interfaces';
3
3
  import { OAuth2ResponseDTO, RefreshTokenResponse } from './types/auth';
4
4
  interface ErrorResponse {
@@ -37,6 +37,7 @@ export declare class ApiClient implements IApiClient {
37
37
  private exchangeGoogleCode;
38
38
  createStorageUnit: (data: CreateUnitRequest) => Promise<CreateUnitResponse>;
39
39
  getStorageUnits: () => Promise<GetUnitsResponse>;
40
+ validateStorageUnit: (unitId: string, data: ValidateUnitRequest) => Promise<ValidateUnitResponse>;
40
41
  updateStorageUnit: (unitId: string, data: UpdateUnitRequest) => Promise<UpdateUnitResponse>;
41
42
  deleteStorageUnit: (unitId: string) => Promise<ActionResponse>;
42
43
  createRepo: (data: CreateRepoRequest) => Promise<CreateRepoResponse>;
@@ -145,6 +145,9 @@ class ApiClient {
145
145
  this.getStorageUnits = async () => {
146
146
  return this.makeRequest('unit', 'GET', null);
147
147
  };
148
+ this.validateStorageUnit = async (unitId, data) => {
149
+ return this.makeRequest(`unit/${unitId}/validate`, 'POST', data);
150
+ };
148
151
  this.updateStorageUnit = async (unitId, data) => {
149
152
  return this.makeRequest(`unit/${unitId}`, 'PUT', data);
150
153
  };
@@ -1,4 +1,4 @@
1
- import { CreateUnitRequest, CreateUnitResponse, CreateRepoRequest, CreateRepoResponse, CreateRepoKeyRequest, CreateRepoKeyResponse, GetUnitsResponse, GetReposResponse, GetRepoKeysResponse, UpdateUnitRequest, UpdateUnitResponse, ActionResponse, UpdateRepoResponse, UpdateRepoRequest, UpdateRepoKeyRequest, UpdateRepoKeyResponse } from "./types/storage";
1
+ import { CreateUnitRequest, CreateUnitResponse, CreateRepoRequest, CreateRepoResponse, CreateRepoKeyRequest, CreateRepoKeyResponse, GetUnitsResponse, GetReposResponse, GetRepoKeysResponse, UpdateUnitRequest, UpdateUnitResponse, ActionResponse, UpdateRepoResponse, UpdateRepoRequest, UpdateRepoKeyRequest, UpdateRepoKeyResponse, ValidateUnitRequest, ValidateUnitResponse } from "./types/storage";
2
2
  export declare enum ProviderType {
3
3
  GOOGLE = "GOOGLE",
4
4
  GITHUB = "GITHUB",
@@ -10,6 +10,7 @@ export interface IApiClient {
10
10
  getStorageUnits(): Promise<GetUnitsResponse>;
11
11
  updateStorageUnit(unitId: string, data: UpdateUnitRequest): Promise<UpdateUnitResponse>;
12
12
  deleteStorageUnit(unitId: string): Promise<ActionResponse>;
13
+ validateStorageUnit(unitId: string, data: ValidateUnitRequest): Promise<ValidateUnitResponse>;
13
14
  createRepo(data: CreateRepoRequest): Promise<CreateRepoResponse>;
14
15
  getRepos(): Promise<GetReposResponse>;
15
16
  updateRepo(repoId: string, data: UpdateRepoRequest): Promise<UpdateRepoResponse>;
@@ -87,9 +87,7 @@ export interface StorageUnit {
87
87
  bucket: string;
88
88
  storageType: StorageType;
89
89
  key: string;
90
- secret: string;
91
90
  endpoint?: string;
92
- regionId?: string;
93
91
  }
94
92
  export interface GetUnitsResponse {
95
93
  success: boolean;
@@ -103,3 +101,13 @@ export interface GetRepoKeysResponse {
103
101
  success: boolean;
104
102
  keys: ApiKey[];
105
103
  }
104
+ export interface ValidateUnitRequest {
105
+ key: string;
106
+ secret: string;
107
+ endpoint?: string;
108
+ bucket: string;
109
+ }
110
+ export interface ValidateUnitResponse {
111
+ success: boolean;
112
+ message?: string;
113
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.0.56",
3
+ "version": "0.0.57",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },