@flashbacktech/flashbackclient 0.2.72 → 0.2.73

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, GetRepoResponse } 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, GetProviderApiKeysResponse, CreateProviderApiKeyRequest, CreateProviderApiKeyResponse, UpdateProviderApiKeyRequest, UpdateProviderApiKeyResponse, DeleteProviderApiKeyResponse, 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';
@@ -80,6 +80,10 @@ export declare class ApiClient implements IApiClient {
80
80
  getAvailableStorageBuckets: () => Promise<StorageBucket[]>;
81
81
  getStorageBucketStatus: (bucketId: string) => Promise<StorageBucketStatusResponse>;
82
82
  getBucketNodeStats: (bucketId: string, data: GetBucketNodeStatsRequest) => Promise<GetBucketNodeStatsResponse>;
83
+ getApiKeys: (workspaceId?: string) => Promise<GetProviderApiKeysResponse>;
84
+ createApiKey: (data: CreateProviderApiKeyRequest) => Promise<CreateProviderApiKeyResponse>;
85
+ updateApiKey: (apiKeyId: string, data: UpdateProviderApiKeyRequest) => Promise<UpdateProviderApiKeyResponse>;
86
+ deleteApiKey: (apiKeyId: string) => Promise<DeleteProviderApiKeyResponse>;
83
87
  createStorageRepo(data: CreateRepoRequest): Promise<CreateRepoResponse>;
84
88
  createStorageRepo(data: CreateRepoWithBucketsRequest): Promise<CreateRepoResponse>;
85
89
  getStorageRepos: (workspaceId?: string, walletAddress?: string, repoId?: string) => Promise<GetReposResponse>;
@@ -226,6 +226,22 @@ class ApiClient {
226
226
  this.getBucketNodeStats = async (bucketId, data) => {
227
227
  return this.makeRequest(`bucket/${bucketId}/stats`, 'POST', data);
228
228
  };
229
+ this.getApiKeys = async (workspaceId) => {
230
+ const queryParams = new URLSearchParams();
231
+ if (workspaceId) {
232
+ queryParams.append('workspaceId', workspaceId);
233
+ }
234
+ return this.makeRequest('apikeys?' + queryParams.toString(), 'GET', null);
235
+ };
236
+ this.createApiKey = async (data) => {
237
+ return this.makeRequest('apikeys', 'POST', data);
238
+ };
239
+ this.updateApiKey = async (apiKeyId, data) => {
240
+ return this.makeRequest(`apikeys/${apiKeyId}`, 'PUT', data);
241
+ };
242
+ this.deleteApiKey = async (apiKeyId) => {
243
+ return this.makeRequest(`apikeys/${apiKeyId}`, 'DELETE', null);
244
+ };
229
245
  this.getStorageRepos = async (workspaceId, walletAddress, repoId) => {
230
246
  const queryParams = new URLSearchParams();
231
247
  if (workspaceId) {
@@ -1,4 +1,4 @@
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/storage';
1
+ import { CreateRepoRequest, CreateRepoResponse, CreateRepoKeyRequest, CreateRepoKeyResponse, GetReposResponse, GetRepoKeysResponse, ActionResponse, UpdateRepoResponse, UpdateRepoRequest, UpdateRepoKeyRequest, UpdateRepoKeyResponse, ValidateRepoUnitsRequest, ValidateRepoUnitsResponse, GetBucketsResponse, CreateBucketRequest, CreateBucketResponse, UpdateBucketRequest, UpdateBucketResponse, ValidateBucketRequest, ValidateBucketResponse, GetProviderApiKeysResponse, CreateProviderApiKeyRequest, CreateProviderApiKeyResponse, UpdateProviderApiKeyRequest, UpdateProviderApiKeyResponse, DeleteProviderApiKeyResponse } from './types/storage/storage';
2
2
  import { RegisterBody, LoginBody, RegisterResponse, LoginResponse, LogoutResponse, ActivateUserRequest, ActivateUserResponse, DeactivateResponse, RefreshTokenResponse, RefreshTokenErrorResponse } from './types/platform/auth';
3
3
  import { StatsQueryParams, StatsResponse, NodeStatsMinuteResponse, NodeStatsDailyResponse, NodeStatsQueryParams } from './types/storage/stats';
4
4
  import { BuySubscriptionRequest, BuySubscriptionResponse, GetSubscriptionsResponse, MySubscriptionResponse, PaymentsListResponse, PaymentsQueryParams, CancelSubscriptionResponse } from './types/platform/subscriptions';
@@ -16,6 +16,10 @@ export interface IApiClient {
16
16
  updateStorageBucket(bucketId: string, data: UpdateBucketRequest): Promise<UpdateBucketResponse>;
17
17
  deleteStorageBucket(bucketId: string): Promise<ActionResponse>;
18
18
  validateStorageBucket(bucketId: string, data: ValidateBucketRequest): Promise<ValidateBucketResponse>;
19
+ getApiKeys(workspaceId?: string): Promise<GetProviderApiKeysResponse>;
20
+ createApiKey(data: CreateProviderApiKeyRequest): Promise<CreateProviderApiKeyResponse>;
21
+ updateApiKey(apiKeyId: string, data: UpdateProviderApiKeyRequest): Promise<UpdateProviderApiKeyResponse>;
22
+ deleteApiKey(apiKeyId: string): Promise<DeleteProviderApiKeyResponse>;
19
23
  createStorageRepo(data: CreateRepoRequest): Promise<CreateRepoResponse>;
20
24
  getStorageRepos(workspaceId?: string): Promise<GetReposResponse>;
21
25
  updateStorageRepo(repoId: string, data: UpdateRepoRequest): Promise<UpdateRepoResponse>;
@@ -280,11 +280,35 @@ export interface ProviderApiKeyDTO {
280
280
  region?: string;
281
281
  provider: string;
282
282
  createdAt: string;
283
+ bucket_count?: number;
284
+ aillm_count?: number;
283
285
  }
284
286
  export interface GetProviderApiKeysResponse {
285
287
  success: boolean;
286
288
  apiKeys: ProviderApiKeyDTO[];
287
289
  }
290
+ export interface CreateProviderApiKeyRequest {
291
+ key: string;
292
+ secret: string;
293
+ endpoint?: string;
294
+ region?: string;
295
+ provider: string;
296
+ workspaceId: string;
297
+ }
298
+ export interface CreateProviderApiKeyResponse extends ActionResponse {
299
+ apiKeyId: string;
300
+ }
301
+ export interface UpdateProviderApiKeyRequest {
302
+ key?: string;
303
+ secret?: string;
304
+ endpoint?: string;
305
+ region?: string;
306
+ provider?: string;
307
+ }
308
+ export interface UpdateProviderApiKeyResponse extends ActionResponse {
309
+ }
310
+ export interface DeleteProviderApiKeyResponse extends ActionResponse {
311
+ }
288
312
  export interface GetBucketNodeStatsRequest {
289
313
  day: Date;
290
314
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.2.72",
3
+ "version": "0.2.73",
4
4
  "type": "commonjs",
5
5
  "publishConfig": {
6
6
  "access": "public"