@flashbacktech/flashbackclient 0.2.81 → 0.2.83
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, GetProviderApiKeysResponse, CreateProviderApiKeyRequest, CreateProviderApiKeyResponse, UpdateProviderApiKeyRequest, UpdateProviderApiKeyResponse, DeleteProviderApiKeyResponse, 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, GetProviderApiKeysParams, 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';
|
|
@@ -81,7 +81,7 @@ export declare class ApiClient implements IApiClient {
|
|
|
81
81
|
getAvailableStorageBuckets: () => Promise<StorageBucket[]>;
|
|
82
82
|
getStorageBucketStatus: (bucketId: string) => Promise<StorageBucketStatusResponse>;
|
|
83
83
|
getBucketNodeStats: (bucketId: string, data: GetBucketNodeStatsRequest) => Promise<GetBucketNodeStatsResponse>;
|
|
84
|
-
getApiKeys: (
|
|
84
|
+
getApiKeys: (params?: string | GetProviderApiKeysParams) => Promise<GetProviderApiKeysResponse>;
|
|
85
85
|
createApiKey: (data: CreateProviderApiKeyRequest) => Promise<CreateProviderApiKeyResponse>;
|
|
86
86
|
updateApiKey: (apiKeyId: string, data: UpdateProviderApiKeyRequest) => Promise<UpdateProviderApiKeyResponse>;
|
|
87
87
|
deleteApiKey: (apiKeyId: string) => Promise<DeleteProviderApiKeyResponse>;
|
package/dist/api/client.js
CHANGED
|
@@ -226,10 +226,18 @@ 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 (
|
|
229
|
+
this.getApiKeys = async (params) => {
|
|
230
230
|
const queryParams = new URLSearchParams();
|
|
231
|
-
if (
|
|
232
|
-
|
|
231
|
+
if (params !== undefined) {
|
|
232
|
+
if (typeof params === 'string') {
|
|
233
|
+
queryParams.append('workspaceId', params);
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
if (params.workspaceId)
|
|
237
|
+
queryParams.append('workspaceId', params.workspaceId);
|
|
238
|
+
if (params.capability !== undefined)
|
|
239
|
+
queryParams.append('capability', String(params.capability));
|
|
240
|
+
}
|
|
233
241
|
}
|
|
234
242
|
return this.makeRequest('apikeys?' + queryParams.toString(), 'GET', null);
|
|
235
243
|
};
|
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, GetProviderApiKeysResponse, CreateProviderApiKeyRequest, CreateProviderApiKeyResponse, UpdateProviderApiKeyRequest, UpdateProviderApiKeyResponse, DeleteProviderApiKeyResponse } 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, GetProviderApiKeysParams, 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,7 +16,7 @@ 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(
|
|
19
|
+
getApiKeys(params?: string | GetProviderApiKeysParams): Promise<GetProviderApiKeysResponse>;
|
|
20
20
|
createApiKey(data: CreateProviderApiKeyRequest): Promise<CreateProviderApiKeyResponse>;
|
|
21
21
|
updateApiKey(apiKeyId: string, data: UpdateProviderApiKeyRequest): Promise<UpdateProviderApiKeyResponse>;
|
|
22
22
|
deleteApiKey(apiKeyId: string): Promise<DeleteProviderApiKeyResponse>;
|
|
@@ -273,6 +273,19 @@ export interface StorageBucketStatusResponse {
|
|
|
273
273
|
bucketId: string;
|
|
274
274
|
nodeStatus: NodeStatusInfo[];
|
|
275
275
|
}
|
|
276
|
+
/** Capability bitmask for filtering API keys by provider support (backend Provider.capabilities). Shared by client and backend. */
|
|
277
|
+
export declare enum ProviderCapability {
|
|
278
|
+
Storage = 1,
|
|
279
|
+
AI = 2,
|
|
280
|
+
/** General / all (e.g. OTHER provider). */
|
|
281
|
+
All = 255
|
|
282
|
+
}
|
|
283
|
+
/** Query params for GET /apikeys. When capability is set, only keys whose provider supports that capability are returned. */
|
|
284
|
+
export interface GetProviderApiKeysParams {
|
|
285
|
+
workspaceId?: string;
|
|
286
|
+
/** Filter to providers that support this capability (e.g. ProviderCapability.Storage or ProviderCapability.AI). */
|
|
287
|
+
capability?: ProviderCapability;
|
|
288
|
+
}
|
|
276
289
|
export interface ProviderApiKeyDTO {
|
|
277
290
|
id: string;
|
|
278
291
|
key: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RepoErrorCodes = exports.ModeType = exports.AccessType = exports.StorageType = void 0;
|
|
3
|
+
exports.ProviderCapability = exports.RepoErrorCodes = exports.ModeType = exports.AccessType = exports.StorageType = void 0;
|
|
4
4
|
var StorageType;
|
|
5
5
|
(function (StorageType) {
|
|
6
6
|
StorageType["S3"] = "S3";
|
|
@@ -31,3 +31,11 @@ var RepoErrorCodes;
|
|
|
31
31
|
RepoErrorCodes["NORMAL_UNIT_CANNOT_EDIT_FOLDER"] = "NORMAL_UNIT_CANNOT_EDIT_FOLDER";
|
|
32
32
|
RepoErrorCodes["QUOTA_EXCEEDED"] = "QUOTA_EXCEEDED";
|
|
33
33
|
})(RepoErrorCodes || (exports.RepoErrorCodes = RepoErrorCodes = {}));
|
|
34
|
+
/** Capability bitmask for filtering API keys by provider support (backend Provider.capabilities). Shared by client and backend. */
|
|
35
|
+
var ProviderCapability;
|
|
36
|
+
(function (ProviderCapability) {
|
|
37
|
+
ProviderCapability[ProviderCapability["Storage"] = 1] = "Storage";
|
|
38
|
+
ProviderCapability[ProviderCapability["AI"] = 2] = "AI";
|
|
39
|
+
/** General / all (e.g. OTHER provider). */
|
|
40
|
+
ProviderCapability[ProviderCapability["All"] = 255] = "All";
|
|
41
|
+
})(ProviderCapability || (exports.ProviderCapability = ProviderCapability = {}));
|