@flashbacktech/flashbackclient 0.2.41 → 0.2.43

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 { 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/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, GetRepoResponse } from './types/storage/storage';
2
2
  import { IApiClient, ProviderType } from './interfaces';
3
3
  import { ActivateUserRequest, ActivateUserResponse, DeactivateResponse, DemoRequestBody, DemoRequestResponse, LoginBody, LoginResponse, LogoutResponse, OAuth2ResponseDTO, RefreshTokenErrorResponse, RefreshTokenResponse, RegisterBody, RegisterResponse, ResendVerificationEmailResponse, ResetPasswordBody, Web3RegisterBody } from './types/platform/auth';
4
4
  import { StatsQueryParams, StatsResponse, NodeStatsMinuteResponse, NodeStatsDailyResponse, NodeStatsQueryParams, UnitStatsResponse, RepoStatsResponse, NodeStatsDailyQueryParams, BucketStatsResponse, StatsQueryWithBucketParams, NodeStatsQueryWithBucketParams, NodeStatsDailyQueryWithBucketParams } from './types/storage/stats';
@@ -77,7 +77,8 @@ export declare class ApiClient implements IApiClient {
77
77
  getBucketNodeStats: (bucketId: string, data: GetBucketNodeStatsRequest) => Promise<GetBucketNodeStatsResponse>;
78
78
  createStorageRepo(data: CreateRepoRequest): Promise<CreateRepoResponse>;
79
79
  createStorageRepo(data: CreateRepoWithBucketsRequest): Promise<CreateRepoResponse>;
80
- getStorageRepos: (workspaceId?: string, walletAddress?: string) => Promise<GetReposResponse>;
80
+ getStorageRepos: (workspaceId?: string, walletAddress?: string, repoId?: string) => Promise<GetReposResponse>;
81
+ getStorageRepo: (repoId: string) => Promise<GetRepoResponse>;
81
82
  updateStorageRepo(repoId: string, data: UpdateRepoRequest): Promise<UpdateRepoResponse>;
82
83
  updateStorageRepo(repoId: string, data: UpdateRepoWithBucketsRequest): Promise<UpdateRepoResponse>;
83
84
  deleteStorageRepo: (repoId: string) => Promise<ActionResponse>;
@@ -187,8 +187,25 @@ class ApiClient {
187
187
  this.getBucketNodeStats = async (bucketId, data) => {
188
188
  return this.makeRequest(`bucket/${bucketId}/stats`, 'POST', data);
189
189
  };
190
- this.getStorageRepos = async (workspaceId, walletAddress) => {
191
- return this.makeRequest('repo?workspaceId=' + workspaceId + '&walletAddress=' + walletAddress, 'GET', null);
190
+ this.getStorageRepos = async (workspaceId, walletAddress, repoId) => {
191
+ const queryParams = new URLSearchParams();
192
+ if (workspaceId) {
193
+ queryParams.append('workspaceId', workspaceId);
194
+ }
195
+ if (repoId) {
196
+ queryParams.append('repoId', repoId);
197
+ }
198
+ if (walletAddress) {
199
+ queryParams.append('walletAddress', walletAddress);
200
+ }
201
+ return this.makeRequest('repo?' + queryParams.toString(), 'GET', null);
202
+ };
203
+ this.getStorageRepo = async (repoId) => {
204
+ const response = await this.getStorageRepos(undefined, undefined, repoId);
205
+ if (response.success && response.repos.length > 0) {
206
+ return { success: true, repo: response.repos[0] };
207
+ }
208
+ return { success: false, repo: {} };
192
209
  };
193
210
  this.deleteStorageRepo = async (repoId) => {
194
211
  return this.makeRequest(`repo/${repoId}`, 'DELETE', null);
@@ -18,6 +18,7 @@ export interface SystemEventResponse {
18
18
  orgId: string;
19
19
  userId: string;
20
20
  userName: string;
21
+ userEmail: string;
21
22
  workspaceId: string | null;
22
23
  jsonData: string | null;
23
24
  }
@@ -156,6 +156,10 @@ export interface GetReposResponse {
156
156
  success: boolean;
157
157
  repos: StorageRepoWithBuckets[];
158
158
  }
159
+ export interface GetRepoResponse {
160
+ success: boolean;
161
+ repo: StorageRepoWithBuckets;
162
+ }
159
163
  export interface GetRepoKeysResponse {
160
164
  success: boolean;
161
165
  keys: ApiKey[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.2.41",
3
+ "version": "0.2.43",
4
4
  "type": "commonjs",
5
5
  "publishConfig": {
6
6
  "access": "public"