@flashbacktech/flashbackclient 0.1.24 → 0.1.25
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 +9 -5
- package/dist/api/client.js +12 -13
- package/dist/api/types/storage.d.ts +3 -1
- package/package.json +1 -1
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, GetUnitNodeStatsResponse, GetUnitNodeStatsRequest, CreateBucketRequest, CreateBucketResponse, UpdateBucketRequest, UpdateBucketResponse, ValidateBucketRequest, ValidateBucketResponse, StorageBucket, GetBucketsResponse, StorageBucketStatusResponse, GetBucketNodeStatsRequest, GetBucketNodeStatsResponse } 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, CreateBucketRequest, CreateBucketResponse, UpdateBucketRequest, UpdateBucketResponse, ValidateBucketRequest, ValidateBucketResponse, StorageBucket, GetBucketsResponse, StorageBucketStatusResponse, GetBucketNodeStatsRequest, GetBucketNodeStatsResponse, CreateRepoWithBucketsRequest, UpdateRepoWithBucketsRequest, ValidateRepoBucketsRequest, ValidateRepoBucketsResponse } from './types/storage';
|
|
2
2
|
import { IApiClient, ProviderType } from './interfaces';
|
|
3
3
|
import { ActivateResponse, DeactivateResponse, LoginBody, LoginResponse, LogoutResponse, OAuth2ResponseDTO, RefreshTokenErrorResponse, RefreshTokenResponse, RegisterBody, RegisterResponse, ResetPasswordBody } from './types/auth';
|
|
4
4
|
import { StatsQueryParams, StatsResponse, NodeStatsMinuteResponse, NodeStatsDailyResponse, NodeStatsQueryParams, UnitStatsResponse, RepoStatsResponse, NodeStatsDailyQueryParams } from './types/stats';
|
|
@@ -55,12 +55,16 @@ export declare class ApiClient implements IApiClient {
|
|
|
55
55
|
getAvailableStorageBuckets: () => Promise<StorageBucket[]>;
|
|
56
56
|
getStorageBucketStatus: (bucketId: string) => Promise<StorageBucketStatusResponse>;
|
|
57
57
|
getBucketNodeStats: (bucketId: string, data: GetBucketNodeStatsRequest) => Promise<GetBucketNodeStatsResponse>;
|
|
58
|
-
createStorageRepo
|
|
58
|
+
createStorageRepo(data: CreateRepoRequest): Promise<CreateRepoResponse>;
|
|
59
|
+
createStorageRepo(data: CreateRepoWithBucketsRequest): Promise<CreateRepoResponse>;
|
|
59
60
|
getStorageRepos: () => Promise<GetReposResponse>;
|
|
60
|
-
updateStorageRepo
|
|
61
|
+
updateStorageRepo(repoId: string, data: UpdateRepoRequest): Promise<UpdateRepoResponse>;
|
|
62
|
+
updateStorageRepo(repoId: string, data: UpdateRepoWithBucketsRequest): Promise<UpdateRepoResponse>;
|
|
61
63
|
deleteStorageRepo: (repoId: string) => Promise<ActionResponse>;
|
|
62
|
-
validateNewRepoUnits
|
|
63
|
-
|
|
64
|
+
validateNewRepoUnits(data: ValidateRepoUnitsRequest): Promise<ValidateRepoUnitsResponse>;
|
|
65
|
+
validateNewRepoUnits(data: ValidateRepoBucketsRequest): Promise<ValidateRepoBucketsResponse>;
|
|
66
|
+
validateUpdateRepoUnits(data: ValidateRepoUnitsRequest): Promise<ValidateRepoUnitsResponse>;
|
|
67
|
+
validateUpdateRepoUnits(data: ValidateRepoBucketsRequest): Promise<ValidateRepoBucketsResponse>;
|
|
64
68
|
createRepoKey: (data: CreateRepoKeyRequest) => Promise<CreateRepoKeyResponse>;
|
|
65
69
|
getRepoKeys: (repoId: string) => Promise<GetRepoKeysResponse>;
|
|
66
70
|
updateRepoKey: (repoId: string, keyId: string, data: UpdateRepoKeyRequest) => Promise<UpdateRepoKeyResponse>;
|
package/dist/api/client.js
CHANGED
|
@@ -199,25 +199,12 @@ class ApiClient {
|
|
|
199
199
|
this.getBucketNodeStats = async (bucketId, data) => {
|
|
200
200
|
return this.makeRequest(`bucket/${bucketId}/stats`, 'POST', data);
|
|
201
201
|
};
|
|
202
|
-
////// Repos API
|
|
203
|
-
this.createStorageRepo = async (data) => {
|
|
204
|
-
return this.makeRequest('repo', 'POST', data);
|
|
205
|
-
};
|
|
206
202
|
this.getStorageRepos = async () => {
|
|
207
203
|
return this.makeRequest('repo', 'GET', null);
|
|
208
204
|
};
|
|
209
|
-
this.updateStorageRepo = async (repoId, data) => {
|
|
210
|
-
return this.makeRequest(`repo/${repoId}`, 'PUT', data);
|
|
211
|
-
};
|
|
212
205
|
this.deleteStorageRepo = async (repoId) => {
|
|
213
206
|
return this.makeRequest(`repo/${repoId}`, 'DELETE', null);
|
|
214
207
|
};
|
|
215
|
-
this.validateNewRepoUnits = async (data) => {
|
|
216
|
-
return this.makeRequest('repo/validate', 'POST', data);
|
|
217
|
-
};
|
|
218
|
-
this.validateUpdateRepoUnits = async (data) => {
|
|
219
|
-
return this.makeRequest(`repo/${data.repoId}/validate`, 'POST', data);
|
|
220
|
-
};
|
|
221
208
|
////// Keys API
|
|
222
209
|
this.createRepoKey = async (data) => {
|
|
223
210
|
return this.makeRequest(`repo/${data.repoId}/apikey`, 'POST', data);
|
|
@@ -345,6 +332,18 @@ class ApiClient {
|
|
|
345
332
|
this.headers = {};
|
|
346
333
|
this.debug = false;
|
|
347
334
|
}
|
|
335
|
+
async createStorageRepo(data) {
|
|
336
|
+
return this.makeRequest('repo', 'POST', data);
|
|
337
|
+
}
|
|
338
|
+
async updateStorageRepo(repoId, data) {
|
|
339
|
+
return this.makeRequest(`repo/${repoId}`, 'PUT', data);
|
|
340
|
+
}
|
|
341
|
+
async validateNewRepoUnits(data) {
|
|
342
|
+
return this.makeRequest('repo/validate', 'POST', data);
|
|
343
|
+
}
|
|
344
|
+
async validateUpdateRepoUnits(data) {
|
|
345
|
+
return this.makeRequest(`repo/${data.repoId}/validate`, 'POST', data);
|
|
346
|
+
}
|
|
348
347
|
////// Stats API
|
|
349
348
|
validateDateRange(startDate, endDate) {
|
|
350
349
|
if (startDate && endDate) {
|
|
@@ -189,7 +189,9 @@ export interface ValidateBucketResponse extends ValidateUnitResponse {
|
|
|
189
189
|
}
|
|
190
190
|
export interface StorageBucket extends StorageUnit {
|
|
191
191
|
}
|
|
192
|
-
export interface GetBucketsResponse
|
|
192
|
+
export interface GetBucketsResponse {
|
|
193
|
+
success: boolean;
|
|
194
|
+
buckets: StorageBucket[];
|
|
193
195
|
}
|
|
194
196
|
export interface CreateBucketResponse {
|
|
195
197
|
success: boolean;
|