@flashbacktech/flashbackclient 0.2.72 → 0.2.74
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.
package/dist/api/client.d.ts
CHANGED
|
@@ -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>;
|
|
@@ -134,7 +138,7 @@ export declare class ApiClient implements IApiClient {
|
|
|
134
138
|
getBucketStats: (params?: {
|
|
135
139
|
bucketId?: string[];
|
|
136
140
|
}) => Promise<BucketStatsResponse>;
|
|
137
|
-
getNodeInfo: () => Promise<NodeInfoResponse>;
|
|
141
|
+
getNodeInfo: (nodeServices: number) => Promise<NodeInfoResponse>;
|
|
138
142
|
getPrivateNodeInfo: (orgId: string) => Promise<NodeInfoResponse>;
|
|
139
143
|
deletePrivateNode: (orgId: string, nodeId: string) => Promise<{
|
|
140
144
|
success: boolean;
|
package/dist/api/client.js
CHANGED
|
@@ -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) {
|
|
@@ -361,8 +377,8 @@ class ApiClient {
|
|
|
361
377
|
}
|
|
362
378
|
return this.makeRequest(`bucket/stats${queryParams.toString() ? `?${queryParams.toString()}` : ''}`, 'GET', null);
|
|
363
379
|
};
|
|
364
|
-
this.getNodeInfo = async () => {
|
|
365
|
-
return this.makeRequest('node', 'GET', null);
|
|
380
|
+
this.getNodeInfo = async (nodeServices) => {
|
|
381
|
+
return this.makeRequest('node?nodeServices=' + nodeServices, 'GET', null);
|
|
366
382
|
};
|
|
367
383
|
this.getPrivateNodeInfo = async (orgId) => {
|
|
368
384
|
return this.makeRequest(`organization/${orgId}/nodes`, 'GET', null);
|
package/dist/api/interfaces.d.ts
CHANGED
|
@@ -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>;
|
|
@@ -52,10 +52,17 @@ export interface NodeInfo {
|
|
|
52
52
|
lastUpdated: string;
|
|
53
53
|
url: string;
|
|
54
54
|
id_org?: string;
|
|
55
|
+
nodeServices: number;
|
|
55
56
|
}
|
|
56
57
|
export interface NodeInfoResponse {
|
|
57
58
|
success: true;
|
|
58
59
|
data: NodeInfo[];
|
|
59
60
|
total: number;
|
|
60
61
|
}
|
|
62
|
+
export declare enum ServiceFlag {
|
|
63
|
+
SERVICE_FLAG_NONE = 0,
|
|
64
|
+
SERVICE_FLAG_STORAGE = 1,
|
|
65
|
+
SERVICE_FLAG_AILLM = 2,
|
|
66
|
+
SERVICE_FLAG_CHAT = 4
|
|
67
|
+
}
|
|
61
68
|
export {};
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NodeStatusType = void 0;
|
|
3
|
+
exports.ServiceFlag = exports.NodeStatusType = void 0;
|
|
4
4
|
var NodeStatusType;
|
|
5
5
|
(function (NodeStatusType) {
|
|
6
6
|
NodeStatusType["ONLINE"] = "ONLINE";
|
|
7
7
|
NodeStatusType["OFFLINE"] = "OFFLINE";
|
|
8
8
|
NodeStatusType["DISCONNECTED"] = "DISCONNECTED";
|
|
9
9
|
})(NodeStatusType || (exports.NodeStatusType = NodeStatusType = {}));
|
|
10
|
+
var ServiceFlag;
|
|
11
|
+
(function (ServiceFlag) {
|
|
12
|
+
ServiceFlag[ServiceFlag["SERVICE_FLAG_NONE"] = 0] = "SERVICE_FLAG_NONE";
|
|
13
|
+
ServiceFlag[ServiceFlag["SERVICE_FLAG_STORAGE"] = 1] = "SERVICE_FLAG_STORAGE";
|
|
14
|
+
ServiceFlag[ServiceFlag["SERVICE_FLAG_AILLM"] = 2] = "SERVICE_FLAG_AILLM";
|
|
15
|
+
ServiceFlag[ServiceFlag["SERVICE_FLAG_CHAT"] = 4] = "SERVICE_FLAG_CHAT";
|
|
16
|
+
})(ServiceFlag || (exports.ServiceFlag = ServiceFlag = {}));
|
|
@@ -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
|
}
|