@blaxel/core 0.2.0-preview2 → 0.2.0-preview3
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/client/sdk.gen.d.ts +3 -8
- package/dist/client/sdk.gen.js +3 -3
- package/dist/client/types.gen.d.ts +13 -23
- package/dist/sandbox/preview.d.ts +19 -1
- package/dist/sandbox/preview.js +65 -1
- package/package.json +1 -1
package/dist/client/sdk.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
|
|
2
|
-
import type { ListAgentsData, CreateAgentData, DeleteAgentData, GetAgentData, UpdateAgentData, ListAgentRevisionsData, GetConfigurationData, ListFunctionsData, CreateFunctionData, DeleteFunctionData, GetFunctionData, UpdateFunctionData, ListFunctionRevisionsData, GetIntegrationData, ListIntegrationConnectionsData, CreateIntegrationConnectionData, DeleteIntegrationConnectionData, GetIntegrationConnectionData, UpdateIntegrationConnectionData, GetIntegrationConnectionModelEndpointConfigurationsData, ListIntegrationConnectionModelsData, GetIntegrationConnectionModelData, ListKnowledgebasesData, CreateKnowledgebaseData, DeleteKnowledgebaseData, GetKnowledgebaseData, UpdateKnowledgebaseData, ListKnowledgebaseRevisionsData, ListLocationsData, ListMcpHubDefinitionsData, ListModelsData, CreateModelData, DeleteModelData, GetModelData, UpdateModelData, ListModelRevisionsData, ListPoliciesData, CreatePolicyData, DeletePolicyData, GetPolicyData, UpdatePolicyData, ListPrivateClustersData, CreatePrivateClusterData, DeletePrivateClusterData, GetPrivateClusterData, UpdatePrivateClusterData, GetPrivateClusterHealthData, UpdatePrivateClusterHealthData, ListAllPendingInvitationsData, ListSandboxHubDefinitionsData, ListSandboxesData, CreateSandboxData, DeleteSandboxData, GetSandboxData, UpdateSandboxData, ListSandboxPreviewsData, CreateSandboxPreviewData, DeleteSandboxPreviewData, GetSandboxPreviewData, UpdateSandboxPreviewData,
|
|
2
|
+
import type { ListAgentsData, CreateAgentData, DeleteAgentData, GetAgentData, UpdateAgentData, ListAgentRevisionsData, GetConfigurationData, ListFunctionsData, CreateFunctionData, DeleteFunctionData, GetFunctionData, UpdateFunctionData, ListFunctionRevisionsData, GetIntegrationData, ListIntegrationConnectionsData, CreateIntegrationConnectionData, DeleteIntegrationConnectionData, GetIntegrationConnectionData, UpdateIntegrationConnectionData, GetIntegrationConnectionModelEndpointConfigurationsData, ListIntegrationConnectionModelsData, GetIntegrationConnectionModelData, ListKnowledgebasesData, CreateKnowledgebaseData, DeleteKnowledgebaseData, GetKnowledgebaseData, UpdateKnowledgebaseData, ListKnowledgebaseRevisionsData, ListLocationsData, ListMcpHubDefinitionsData, ListModelsData, CreateModelData, DeleteModelData, GetModelData, UpdateModelData, ListModelRevisionsData, ListPoliciesData, CreatePolicyData, DeletePolicyData, GetPolicyData, UpdatePolicyData, ListPrivateClustersData, CreatePrivateClusterData, DeletePrivateClusterData, GetPrivateClusterData, UpdatePrivateClusterData, GetPrivateClusterHealthData, UpdatePrivateClusterHealthData, ListAllPendingInvitationsData, ListSandboxHubDefinitionsData, ListSandboxesData, CreateSandboxData, DeleteSandboxData, GetSandboxData, UpdateSandboxData, ListSandboxPreviewsData, CreateSandboxPreviewData, DeleteSandboxPreviewData, GetSandboxPreviewData, UpdateSandboxPreviewData, ListSandboxPreviewTokensData, CreateSandboxPreviewTokenData, DeleteSandboxPreviewTokenData, StartSandboxData, StopSandboxData, GetWorkspaceServiceAccountsData, CreateWorkspaceServiceAccountData, DeleteWorkspaceServiceAccountData, UpdateWorkspaceServiceAccountData, ListApiKeysForServiceAccountData, CreateApiKeyForServiceAccountData, DeleteApiKeyForServiceAccountData, ListTemplatesData, GetTemplateData, GetTemplateContentsData, GetTemplateFileContentsData, ListWorkspaceUsersData, InviteWorkspaceUserData, RemoveWorkspaceUserData, UpdateWorkspaceUserRoleData, ListWorkspacesData, CreateWorspaceData, DeleteWorkspaceData, GetWorkspaceData, UpdateWorkspaceData, DeclineWorkspaceInvitationData, AcceptWorkspaceInvitationData, LeaveWorkspaceData, CheckWorkspaceAvailabilityData } from './types.gen.js';
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -290,17 +290,12 @@ export declare const updateSandboxPreview: <ThrowOnError extends boolean = false
|
|
|
290
290
|
* Get tokens for Sandbox Preview
|
|
291
291
|
* Gets tokens for a Sandbox Preview.
|
|
292
292
|
*/
|
|
293
|
-
export declare const
|
|
294
|
-
created_at?: string;
|
|
295
|
-
name?: string;
|
|
296
|
-
}[], unknown, ThrowOnError>;
|
|
293
|
+
export declare const listSandboxPreviewTokens: <ThrowOnError extends boolean = false>(options: Options<ListSandboxPreviewTokensData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").PreviewToken[], unknown, ThrowOnError>;
|
|
297
294
|
/**
|
|
298
295
|
* Create token for Sandbox Preview
|
|
299
296
|
* Creates a token for a Sandbox Preview.
|
|
300
297
|
*/
|
|
301
|
-
export declare const createSandboxPreviewToken: <ThrowOnError extends boolean = false>(options: Options<CreateSandboxPreviewTokenData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<
|
|
302
|
-
token?: string;
|
|
303
|
-
}, unknown, ThrowOnError>;
|
|
298
|
+
export declare const createSandboxPreviewToken: <ThrowOnError extends boolean = false>(options: Options<CreateSandboxPreviewTokenData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").PreviewToken, unknown, ThrowOnError>;
|
|
304
299
|
/**
|
|
305
300
|
* Delete token for Sandbox Preview
|
|
306
301
|
* Deletes a token for a Sandbox Preview by name.
|
package/dist/client/sdk.gen.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.listSandboxHubDefinitions = exports.listAllPendingInvitations = exports.updatePrivateClusterHealth = exports.getPrivateClusterHealth = exports.updatePrivateCluster = exports.getPrivateCluster = exports.deletePrivateCluster = exports.createPrivateCluster = exports.listPrivateClusters = exports.updatePolicy = exports.getPolicy = exports.deletePolicy = exports.createPolicy = exports.listPolicies = exports.listModelRevisions = exports.updateModel = exports.getModel = exports.deleteModel = exports.createModel = exports.listModels = exports.listMcpHubDefinitions = exports.listLocations = exports.listKnowledgebaseRevisions = exports.updateKnowledgebase = exports.getKnowledgebase = exports.deleteKnowledgebase = exports.createKnowledgebase = exports.listKnowledgebases = exports.getIntegrationConnectionModel = exports.listIntegrationConnectionModels = exports.getIntegrationConnectionModelEndpointConfigurations = exports.updateIntegrationConnection = exports.getIntegrationConnection = exports.deleteIntegrationConnection = exports.createIntegrationConnection = exports.listIntegrationConnections = exports.getIntegration = exports.listFunctionRevisions = exports.updateFunction = exports.getFunction = exports.deleteFunction = exports.createFunction = exports.listFunctions = exports.getConfiguration = exports.listAgentRevisions = exports.updateAgent = exports.getAgent = exports.deleteAgent = exports.createAgent = exports.listAgents = void 0;
|
|
5
|
-
exports.checkWorkspaceAvailability = exports.leaveWorkspace = exports.acceptWorkspaceInvitation = exports.declineWorkspaceInvitation = exports.updateWorkspace = exports.getWorkspace = exports.deleteWorkspace = exports.createWorspace = exports.listWorkspaces = exports.updateWorkspaceUserRole = exports.removeWorkspaceUser = exports.inviteWorkspaceUser = exports.listWorkspaceUsers = exports.getTemplateFileContents = exports.getTemplateContents = exports.getTemplate = exports.listTemplates = exports.deleteApiKeyForServiceAccount = exports.createApiKeyForServiceAccount = exports.listApiKeysForServiceAccount = exports.updateWorkspaceServiceAccount = exports.deleteWorkspaceServiceAccount = exports.createWorkspaceServiceAccount = exports.getWorkspaceServiceAccounts = exports.stopSandbox = exports.startSandbox = exports.deleteSandboxPreviewToken = exports.createSandboxPreviewToken = exports.
|
|
5
|
+
exports.checkWorkspaceAvailability = exports.leaveWorkspace = exports.acceptWorkspaceInvitation = exports.declineWorkspaceInvitation = exports.updateWorkspace = exports.getWorkspace = exports.deleteWorkspace = exports.createWorspace = exports.listWorkspaces = exports.updateWorkspaceUserRole = exports.removeWorkspaceUser = exports.inviteWorkspaceUser = exports.listWorkspaceUsers = exports.getTemplateFileContents = exports.getTemplateContents = exports.getTemplate = exports.listTemplates = exports.deleteApiKeyForServiceAccount = exports.createApiKeyForServiceAccount = exports.listApiKeysForServiceAccount = exports.updateWorkspaceServiceAccount = exports.deleteWorkspaceServiceAccount = exports.createWorkspaceServiceAccount = exports.getWorkspaceServiceAccounts = exports.stopSandbox = exports.startSandbox = exports.deleteSandboxPreviewToken = exports.createSandboxPreviewToken = exports.listSandboxPreviewTokens = exports.updateSandboxPreview = exports.getSandboxPreview = exports.deleteSandboxPreview = exports.createSandboxPreview = exports.listSandboxPreviews = exports.updateSandbox = exports.getSandbox = exports.deleteSandbox = exports.createSandbox = exports.listSandboxes = void 0;
|
|
6
6
|
const client_gen_1 = require("./client.gen");
|
|
7
7
|
/**
|
|
8
8
|
* List all agents
|
|
@@ -1065,7 +1065,7 @@ exports.updateSandboxPreview = updateSandboxPreview;
|
|
|
1065
1065
|
* Get tokens for Sandbox Preview
|
|
1066
1066
|
* Gets tokens for a Sandbox Preview.
|
|
1067
1067
|
*/
|
|
1068
|
-
const
|
|
1068
|
+
const listSandboxPreviewTokens = (options) => {
|
|
1069
1069
|
return (options.client ?? client_gen_1.client).get({
|
|
1070
1070
|
security: [
|
|
1071
1071
|
{
|
|
@@ -1077,7 +1077,7 @@ const getSandboxPreviewTokens = (options) => {
|
|
|
1077
1077
|
...options
|
|
1078
1078
|
});
|
|
1079
1079
|
};
|
|
1080
|
-
exports.
|
|
1080
|
+
exports.listSandboxPreviewTokens = listSandboxPreviewTokens;
|
|
1081
1081
|
/**
|
|
1082
1082
|
* Create token for Sandbox Preview
|
|
1083
1083
|
* Creates a token for a Sandbox Preview.
|
|
@@ -801,6 +801,10 @@ export type Metrics = {
|
|
|
801
801
|
rpsPerCode?: {
|
|
802
802
|
[key: string]: unknown;
|
|
803
803
|
};
|
|
804
|
+
/**
|
|
805
|
+
* Metrics for sandboxes
|
|
806
|
+
*/
|
|
807
|
+
sandboxes?: unknown;
|
|
804
808
|
};
|
|
805
809
|
/**
|
|
806
810
|
* Logical object representing a model
|
|
@@ -1158,14 +1162,14 @@ export type PreviewTokenSpec = {
|
|
|
1158
1162
|
* Expiration time of the token
|
|
1159
1163
|
*/
|
|
1160
1164
|
expiresAt?: string;
|
|
1161
|
-
/**
|
|
1162
|
-
* JWT token
|
|
1163
|
-
*/
|
|
1164
|
-
jwt?: string;
|
|
1165
1165
|
/**
|
|
1166
1166
|
* Whether the token is public
|
|
1167
1167
|
*/
|
|
1168
1168
|
public?: boolean;
|
|
1169
|
+
/**
|
|
1170
|
+
* Token
|
|
1171
|
+
*/
|
|
1172
|
+
token?: string;
|
|
1169
1173
|
};
|
|
1170
1174
|
/**
|
|
1171
1175
|
* A private cluster where models can be located on.
|
|
@@ -3131,7 +3135,7 @@ export type UpdateSandboxPreviewResponses = {
|
|
|
3131
3135
|
200: Preview;
|
|
3132
3136
|
};
|
|
3133
3137
|
export type UpdateSandboxPreviewResponse = UpdateSandboxPreviewResponses[keyof UpdateSandboxPreviewResponses];
|
|
3134
|
-
export type
|
|
3138
|
+
export type ListSandboxPreviewTokensData = {
|
|
3135
3139
|
body?: never;
|
|
3136
3140
|
path: {
|
|
3137
3141
|
/**
|
|
@@ -3146,22 +3150,13 @@ export type GetSandboxPreviewTokensData = {
|
|
|
3146
3150
|
query?: never;
|
|
3147
3151
|
url: '/sandboxes/{sandboxName}/previews/{previewName}/tokens';
|
|
3148
3152
|
};
|
|
3149
|
-
export type
|
|
3153
|
+
export type ListSandboxPreviewTokensResponses = {
|
|
3150
3154
|
/**
|
|
3151
3155
|
* successful operation
|
|
3152
3156
|
*/
|
|
3153
|
-
200: Array<
|
|
3154
|
-
/**
|
|
3155
|
-
* When the token was created
|
|
3156
|
-
*/
|
|
3157
|
-
created_at?: string;
|
|
3158
|
-
/**
|
|
3159
|
-
* The name of the token
|
|
3160
|
-
*/
|
|
3161
|
-
name?: string;
|
|
3162
|
-
}>;
|
|
3157
|
+
200: Array<PreviewToken>;
|
|
3163
3158
|
};
|
|
3164
|
-
export type
|
|
3159
|
+
export type ListSandboxPreviewTokensResponse = ListSandboxPreviewTokensResponses[keyof ListSandboxPreviewTokensResponses];
|
|
3165
3160
|
export type CreateSandboxPreviewTokenData = {
|
|
3166
3161
|
body: PreviewToken;
|
|
3167
3162
|
path: {
|
|
@@ -3181,12 +3176,7 @@ export type CreateSandboxPreviewTokenResponses = {
|
|
|
3181
3176
|
/**
|
|
3182
3177
|
* successful operation
|
|
3183
3178
|
*/
|
|
3184
|
-
200:
|
|
3185
|
-
/**
|
|
3186
|
-
* The generated token for the preview
|
|
3187
|
-
*/
|
|
3188
|
-
token?: string;
|
|
3189
|
-
};
|
|
3179
|
+
200: PreviewToken;
|
|
3190
3180
|
};
|
|
3191
3181
|
export type CreateSandboxPreviewTokenResponse = CreateSandboxPreviewTokenResponses[keyof CreateSandboxPreviewTokenResponses];
|
|
3192
3182
|
export type DeleteSandboxPreviewTokenData = {
|
|
@@ -1,6 +1,24 @@
|
|
|
1
|
-
import { Preview, Sandbox } from "../client/index.js";
|
|
1
|
+
import { Preview, PreviewToken, Sandbox } from "../client/index.js";
|
|
2
|
+
export declare class SandboxPreviewToken {
|
|
3
|
+
private previewToken;
|
|
4
|
+
constructor(previewToken: PreviewToken);
|
|
5
|
+
get value(): string;
|
|
6
|
+
get expiresAt(): string | Date;
|
|
7
|
+
}
|
|
8
|
+
export declare class SandboxPreviewTokens {
|
|
9
|
+
private preview;
|
|
10
|
+
constructor(preview: Preview);
|
|
11
|
+
get previewName(): string;
|
|
12
|
+
get resourceName(): string;
|
|
13
|
+
create(expiresAt: Date): Promise<SandboxPreviewToken>;
|
|
14
|
+
list(): Promise<SandboxPreviewToken[]>;
|
|
15
|
+
delete(tokenName: string): Promise<{
|
|
16
|
+
message?: string;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
2
19
|
export declare class SandboxPreview {
|
|
3
20
|
private preview;
|
|
21
|
+
tokens: SandboxPreviewTokens;
|
|
4
22
|
constructor(preview: Preview);
|
|
5
23
|
get name(): string;
|
|
6
24
|
get metadata(): import("../client/types.gen.js").PreviewMetadata | undefined;
|
package/dist/sandbox/preview.js
CHANGED
|
@@ -1,11 +1,75 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SandboxPreviews = exports.SandboxPreview = void 0;
|
|
3
|
+
exports.SandboxPreviews = exports.SandboxPreview = exports.SandboxPreviewTokens = exports.SandboxPreviewToken = void 0;
|
|
4
4
|
const index_js_1 = require("../client/index.js");
|
|
5
|
+
class SandboxPreviewToken {
|
|
6
|
+
previewToken;
|
|
7
|
+
constructor(previewToken) {
|
|
8
|
+
this.previewToken = previewToken;
|
|
9
|
+
}
|
|
10
|
+
get value() {
|
|
11
|
+
return this.previewToken.spec?.token ?? "";
|
|
12
|
+
}
|
|
13
|
+
get expiresAt() {
|
|
14
|
+
return this.previewToken.spec?.expiresAt ?? new Date();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.SandboxPreviewToken = SandboxPreviewToken;
|
|
18
|
+
class SandboxPreviewTokens {
|
|
19
|
+
preview;
|
|
20
|
+
constructor(preview) {
|
|
21
|
+
this.preview = preview;
|
|
22
|
+
}
|
|
23
|
+
get previewName() {
|
|
24
|
+
return this.preview.metadata?.name ?? "";
|
|
25
|
+
}
|
|
26
|
+
get resourceName() {
|
|
27
|
+
return this.preview.metadata?.resourceName ?? "";
|
|
28
|
+
}
|
|
29
|
+
async create(expiresAt) {
|
|
30
|
+
const { data } = await (0, index_js_1.createSandboxPreviewToken)({
|
|
31
|
+
path: {
|
|
32
|
+
sandboxName: this.resourceName,
|
|
33
|
+
previewName: this.previewName,
|
|
34
|
+
},
|
|
35
|
+
body: {
|
|
36
|
+
spec: {
|
|
37
|
+
expiresAt: expiresAt.toISOString(),
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
throwOnError: true,
|
|
41
|
+
});
|
|
42
|
+
return new SandboxPreviewToken(data);
|
|
43
|
+
}
|
|
44
|
+
async list() {
|
|
45
|
+
const { data } = await (0, index_js_1.listSandboxPreviewTokens)({
|
|
46
|
+
path: {
|
|
47
|
+
sandboxName: this.resourceName,
|
|
48
|
+
previewName: this.previewName,
|
|
49
|
+
},
|
|
50
|
+
throwOnError: true,
|
|
51
|
+
});
|
|
52
|
+
return data.map((token) => new SandboxPreviewToken(token));
|
|
53
|
+
}
|
|
54
|
+
async delete(tokenName) {
|
|
55
|
+
const { data } = await (0, index_js_1.deleteSandboxPreviewToken)({
|
|
56
|
+
path: {
|
|
57
|
+
sandboxName: this.resourceName,
|
|
58
|
+
previewName: this.previewName,
|
|
59
|
+
tokenName,
|
|
60
|
+
},
|
|
61
|
+
throwOnError: true,
|
|
62
|
+
});
|
|
63
|
+
return data;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.SandboxPreviewTokens = SandboxPreviewTokens;
|
|
5
67
|
class SandboxPreview {
|
|
6
68
|
preview;
|
|
69
|
+
tokens;
|
|
7
70
|
constructor(preview) {
|
|
8
71
|
this.preview = preview;
|
|
72
|
+
this.tokens = new SandboxPreviewTokens(this);
|
|
9
73
|
}
|
|
10
74
|
get name() {
|
|
11
75
|
return this.preview.metadata?.name ?? "";
|