@flashbacktech/flashbackclient 0.2.42 → 0.2.44

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);
@@ -107,6 +107,7 @@ export interface StorageRepo {
107
107
  units: RepoUnitInfo[];
108
108
  aiLlms?: RepoAiLlmInfo[];
109
109
  apiKeys?: ApiKey[];
110
+ aiApiKeys?: RepoAiApiKeyDTO[];
110
111
  createdAt: string;
111
112
  disabled?: boolean;
112
113
  workspaceId: string;
@@ -156,6 +157,10 @@ export interface GetReposResponse {
156
157
  success: boolean;
157
158
  repos: StorageRepoWithBuckets[];
158
159
  }
160
+ export interface GetRepoResponse {
161
+ success: boolean;
162
+ repo: StorageRepoWithBuckets;
163
+ }
159
164
  export interface GetRepoKeysResponse {
160
165
  success: boolean;
161
166
  keys: ApiKey[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.2.42",
3
+ "version": "0.2.44",
4
4
  "type": "commonjs",
5
5
  "publishConfig": {
6
6
  "access": "public"