@flashbacktech/flashbackclient 0.2.71 → 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>;
@@ -23,12 +23,13 @@ export interface CreateUnitRequest {
23
23
  name: string;
24
24
  bucket: string;
25
25
  storageType: StorageType;
26
- key: string;
27
- secret: string;
26
+ key?: string;
27
+ secret?: string;
28
28
  endpoint?: string;
29
29
  region?: string;
30
30
  workspaceId: string;
31
31
  walletAddress?: string;
32
+ apiKeyUuid?: string;
32
33
  }
33
34
  export interface GetUnitNodeStatsRequest {
34
35
  day: Date;
@@ -138,7 +139,7 @@ export interface StorageBucket {
138
139
  name: string;
139
140
  bucket: string;
140
141
  storageType: StorageType;
141
- key: string;
142
+ key?: string;
142
143
  secret?: EncryptedKey;
143
144
  endpoint?: string;
144
145
  region?: string;
@@ -148,6 +149,7 @@ export interface StorageBucket {
148
149
  workspaceId: string;
149
150
  walletAddress?: string;
150
151
  repos?: StorageRepoBasic[];
152
+ apiKeyId?: string;
151
153
  }
152
154
  export interface GetUnitsResponse {
153
155
  success: boolean;
@@ -166,10 +168,11 @@ export interface GetRepoKeysResponse {
166
168
  keys: ApiKey[];
167
169
  }
168
170
  export interface ValidateUnitRequest {
169
- key: string;
170
- secret: string;
171
+ key?: string;
172
+ secret?: string;
171
173
  endpoint?: string;
172
174
  bucket: string;
175
+ apiKeyUuid?: string;
173
176
  }
174
177
  export interface ValidateUnitResponse {
175
178
  success: boolean;
@@ -270,6 +273,42 @@ export interface StorageBucketStatusResponse {
270
273
  bucketId: string;
271
274
  nodeStatus: NodeStatusInfo[];
272
275
  }
276
+ export interface ProviderApiKeyDTO {
277
+ id: string;
278
+ key: string;
279
+ endpoint?: string;
280
+ region?: string;
281
+ provider: string;
282
+ createdAt: string;
283
+ bucket_count?: number;
284
+ aillm_count?: number;
285
+ }
286
+ export interface GetProviderApiKeysResponse {
287
+ success: boolean;
288
+ apiKeys: ProviderApiKeyDTO[];
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
+ }
273
312
  export interface GetBucketNodeStatsRequest {
274
313
  day: Date;
275
314
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.2.71",
3
+ "version": "0.2.73",
4
4
  "type": "commonjs",
5
5
  "publishConfig": {
6
6
  "access": "public"