@flashbacktech/flashbackclient 0.1.95 → 0.2.1

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, StorageUnitStatusResponse, GetUnitNodeStatsResponse, GetUnitNodeStatsRequest, CreateBucketRequest, CreateBucketResponse, UpdateBucketRequest, UpdateBucketResponse, ValidateBucketRequest, ValidateBucketResponse, StorageBucket, GetBucketsResponse, StorageBucketStatusResponse, GetBucketNodeStatsRequest, GetBucketNodeStatsResponse, CreateRepoWithBucketsRequest, UpdateRepoWithBucketsRequest, ValidateRepoBucketsRequest, ValidateRepoBucketsResponse } from './types/storage';
1
+ import { CreateRepoRequest, CreateRepoResponse, CreateRepoKeyRequest, CreateRepoKeyResponse, GetReposResponse, GetRepoKeysResponse, ActionResponse, UpdateRepoRequest, UpdateRepoResponse, UpdateRepoKeyRequest, UpdateRepoKeyResponse, ValidateRepoUnitsRequest, ValidateRepoUnitsResponse, 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, Web3RegisterBody } from './types/auth';
4
4
  import { StatsQueryParams, StatsResponse, NodeStatsMinuteResponse, NodeStatsDailyResponse, NodeStatsQueryParams, UnitStatsResponse, RepoStatsResponse, NodeStatsDailyQueryParams, BucketStatsResponse, StatsQueryWithBucketParams, NodeStatsQueryWithBucketParams, NodeStatsDailyQueryWithBucketParams } from './types/stats';
@@ -61,16 +61,8 @@ export declare class ApiClient implements IApiClient {
61
61
  revokeToken: (tokenId: string) => Promise<{
62
62
  success: boolean;
63
63
  }>;
64
- createStorageUnit: (data: CreateUnitRequest) => Promise<CreateUnitResponse>;
65
- getStorageUnits: () => Promise<GetUnitsResponse>;
66
- validateStorageUnit: (unitId: string, data: ValidateUnitRequest) => Promise<ValidateUnitResponse>;
67
- updateStorageUnit: (unitId: string, data: UpdateUnitRequest) => Promise<UpdateUnitResponse>;
68
- deleteStorageUnit: (unitId: string) => Promise<ActionResponse>;
69
- getAvailableStorageUnits: () => Promise<StorageUnit[]>;
70
- getStorageUnitStatus: (unitId: string) => Promise<StorageUnitStatusResponse>;
71
- getUnitNodeStats: (unitId: string, data: GetUnitNodeStatsRequest) => Promise<GetUnitNodeStatsResponse>;
72
64
  createStorageBucket: (data: CreateBucketRequest) => Promise<CreateBucketResponse>;
73
- getStorageBuckets: () => Promise<GetBucketsResponse>;
65
+ getStorageBuckets: (workspaceId?: string) => Promise<GetBucketsResponse>;
74
66
  validateStorageBucket: (bucketId: string, data: ValidateBucketRequest) => Promise<ValidateBucketResponse>;
75
67
  updateStorageBucket: (bucketId: string, data: UpdateBucketRequest) => Promise<UpdateBucketResponse>;
76
68
  deleteStorageBucket: (bucketId: string) => Promise<ActionResponse>;
@@ -79,7 +71,7 @@ export declare class ApiClient implements IApiClient {
79
71
  getBucketNodeStats: (bucketId: string, data: GetBucketNodeStatsRequest) => Promise<GetBucketNodeStatsResponse>;
80
72
  createStorageRepo(data: CreateRepoRequest): Promise<CreateRepoResponse>;
81
73
  createStorageRepo(data: CreateRepoWithBucketsRequest): Promise<CreateRepoResponse>;
82
- getStorageRepos: () => Promise<GetReposResponse>;
74
+ getStorageRepos: (workspaceId?: string) => Promise<GetReposResponse>;
83
75
  updateStorageRepo(repoId: string, data: UpdateRepoRequest): Promise<UpdateRepoResponse>;
84
76
  updateStorageRepo(repoId: string, data: UpdateRepoWithBucketsRequest): Promise<UpdateRepoResponse>;
85
77
  deleteStorageRepo: (repoId: string) => Promise<ActionResponse>;
@@ -162,37 +162,12 @@ class ApiClient {
162
162
  this.revokeToken = async (tokenId) => {
163
163
  return this.makeRequest(`token/${tokenId}`, 'DELETE', null);
164
164
  };
165
- ////// Units API
166
- this.createStorageUnit = async (data) => {
167
- return this.makeRequest('unit', 'POST', data);
168
- };
169
- this.getStorageUnits = async () => {
170
- return this.makeRequest('unit', 'GET', null);
171
- };
172
- this.validateStorageUnit = async (unitId, data) => {
173
- return this.makeRequest(`unit/${unitId}/validate`, 'POST', data);
174
- };
175
- this.updateStorageUnit = async (unitId, data) => {
176
- return this.makeRequest(`unit/${unitId}`, 'PUT', data);
177
- };
178
- this.deleteStorageUnit = async (unitId) => {
179
- return this.makeRequest(`unit/${unitId}`, 'DELETE', null);
180
- };
181
- this.getAvailableStorageUnits = async () => {
182
- return this.makeRequest('unit/available', 'GET', null);
183
- };
184
- this.getStorageUnitStatus = async (unitId) => {
185
- return this.makeRequest(`unit/${unitId}/status`, 'GET', null);
186
- };
187
- this.getUnitNodeStats = async (unitId, data) => {
188
- return this.makeRequest(`unit/${unitId}/stats`, 'POST', data);
189
- };
190
165
  ////// Buckets API (new bucket-based endpoints)
191
166
  this.createStorageBucket = async (data) => {
192
167
  return this.makeRequest('bucket', 'POST', data);
193
168
  };
194
- this.getStorageBuckets = async () => {
195
- return this.makeRequest('bucket', 'GET', null);
169
+ this.getStorageBuckets = async (workspaceId) => {
170
+ return this.makeRequest('bucket?', 'GET', null);
196
171
  };
197
172
  this.validateStorageBucket = async (bucketId, data) => {
198
173
  return this.makeRequest(`bucket/${bucketId}/validate`, 'POST', data);
@@ -212,8 +187,8 @@ class ApiClient {
212
187
  this.getBucketNodeStats = async (bucketId, data) => {
213
188
  return this.makeRequest(`bucket/${bucketId}/stats`, 'POST', data);
214
189
  };
215
- this.getStorageRepos = async () => {
216
- return this.makeRequest('repo', 'GET', null);
190
+ this.getStorageRepos = async (workspaceId) => {
191
+ return this.makeRequest('repo?workspaceId=' + workspaceId, 'GET', null);
217
192
  };
218
193
  this.deleteStorageRepo = async (repoId) => {
219
194
  return this.makeRequest(`repo/${repoId}`, 'DELETE', null);
@@ -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, GetUnitNodeStatsRequest, GetUnitNodeStatsResponse } from './types/storage';
1
+ import { CreateRepoRequest, CreateRepoResponse, CreateRepoKeyRequest, CreateRepoKeyResponse, GetReposResponse, GetRepoKeysResponse, ActionResponse, UpdateRepoResponse, UpdateRepoRequest, UpdateRepoKeyRequest, UpdateRepoKeyResponse, ValidateRepoUnitsRequest, ValidateRepoUnitsResponse, GetBucketsResponse, CreateBucketRequest, CreateBucketResponse, UpdateBucketRequest, UpdateBucketResponse, ValidateBucketRequest, ValidateBucketResponse } from './types/storage';
2
2
  import { RegisterBody, LoginBody, RegisterResponse, LoginResponse, LogoutResponse, ActivateResponse, DeactivateResponse, RefreshTokenResponse, RefreshTokenErrorResponse } from './types/auth';
3
3
  import { StatsQueryParams, StatsResponse, NodeStatsMinuteResponse, NodeStatsDailyResponse, NodeStatsQueryParams } from './types/stats';
4
4
  import { BuySubscriptionRequest, BuySubscriptionResponse, GetSubscriptionsResponse, MySubscriptionResponse, PaymentsListResponse, PaymentsQueryParams, CancelSubscriptionResponse } from './types/subscriptions';
@@ -10,15 +10,13 @@ export declare enum ProviderType {
10
10
  }
11
11
  export interface IApiClient {
12
12
  authenticate(token: string, provider: ProviderType): Promise<any>;
13
- createStorageUnit(data: CreateUnitRequest): Promise<CreateUnitResponse>;
14
- getStorageUnits(): Promise<GetUnitsResponse>;
15
- updateStorageUnit(unitId: string, data: UpdateUnitRequest): Promise<UpdateUnitResponse>;
16
- deleteStorageUnit(unitId: string): Promise<ActionResponse>;
17
- validateStorageUnit(unitId: string, data: ValidateUnitRequest): Promise<ValidateUnitResponse>;
18
- getAvailableStorageUnits(): Promise<StorageUnit[]>;
19
- getUnitNodeStats(unitId: string, data: GetUnitNodeStatsRequest): Promise<GetUnitNodeStatsResponse>;
13
+ getStorageBuckets(workspaceId?: string): Promise<GetBucketsResponse>;
14
+ createStorageBucket(data: CreateBucketRequest): Promise<CreateBucketResponse>;
15
+ updateStorageBucket(bucketId: string, data: UpdateBucketRequest): Promise<UpdateBucketResponse>;
16
+ deleteStorageBucket(bucketId: string): Promise<ActionResponse>;
17
+ validateStorageBucket(bucketId: string, data: ValidateBucketRequest): Promise<ValidateBucketResponse>;
20
18
  createStorageRepo(data: CreateRepoRequest): Promise<CreateRepoResponse>;
21
- getStorageRepos(): Promise<GetReposResponse>;
19
+ getStorageRepos(workspaceId?: string): Promise<GetReposResponse>;
22
20
  updateStorageRepo(repoId: string, data: UpdateRepoRequest): Promise<UpdateRepoResponse>;
23
21
  deleteStorageRepo(repoId: string): Promise<ActionResponse>;
24
22
  createRepoKey(data: CreateRepoKeyRequest): Promise<CreateRepoKeyResponse>;
@@ -225,6 +225,7 @@ export interface StorageRepoWithBuckets {
225
225
  name: string;
226
226
  storageType: StorageType;
227
227
  mode: ModeType;
228
+ workspaceId: string;
228
229
  buckets: RepoBucketInfo[];
229
230
  apiKeys?: ApiKey[];
230
231
  createdAt: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.1.95",
3
+ "version": "0.2.1",
4
4
  "type": "commonjs",
5
5
  "publishConfig": {
6
6
  "access": "public"