@blaxel/core 0.2.96-preview.203 → 0.2.96-preview.205
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/README.md +37 -2
- package/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/client/sdk.gen.js +113 -2
- package/dist/cjs/common/pagination.js +92 -0
- package/dist/cjs/common/pagination.test.js +81 -0
- package/dist/cjs/common/settings.js +3 -3
- package/dist/cjs/common/settings.test.js +3 -3
- package/dist/cjs/drive/index.js +39 -4
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/jobs/jobs.js +42 -10
- package/dist/cjs/sandbox/client/sdk.gen.js +2 -2
- package/dist/cjs/sandbox/index.js +1 -0
- package/dist/cjs/sandbox/preview.js +8 -3
- package/dist/cjs/sandbox/sandbox.js +43 -33
- package/dist/cjs/sandbox/schedule.js +91 -0
- package/dist/cjs/types/client/sdk.gen.d.ts +31 -1
- package/dist/cjs/types/client/types.gen.d.ts +347 -0
- package/dist/cjs/types/common/pagination.d.ts +35 -0
- package/dist/cjs/types/common/pagination.test.d.ts +1 -0
- package/dist/cjs/types/drive/index.d.ts +35 -5
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/cjs/types/jobs/jobs.d.ts +33 -3
- package/dist/cjs/types/sandbox/client/sdk.gen.d.ts +2 -2
- package/dist/cjs/types/sandbox/client/types.gen.d.ts +28 -1
- package/dist/cjs/types/sandbox/index.d.ts +1 -0
- package/dist/cjs/types/sandbox/preview.d.ts +2 -2
- package/dist/cjs/types/sandbox/sandbox.d.ts +38 -3
- package/dist/cjs/types/sandbox/schedule.d.ts +16 -0
- package/dist/cjs/types/volume/index.d.ts +37 -4
- package/dist/cjs/volume/index.js +41 -4
- package/dist/cjs-browser/.tsbuildinfo +1 -1
- package/dist/cjs-browser/client/sdk.gen.js +113 -2
- package/dist/cjs-browser/common/pagination.js +92 -0
- package/dist/cjs-browser/common/pagination.test.js +81 -0
- package/dist/cjs-browser/common/settings.js +3 -3
- package/dist/cjs-browser/common/settings.test.js +3 -3
- package/dist/cjs-browser/drive/index.js +39 -4
- package/dist/cjs-browser/index.js +1 -0
- package/dist/cjs-browser/jobs/jobs.js +42 -10
- package/dist/cjs-browser/sandbox/client/sdk.gen.js +2 -2
- package/dist/cjs-browser/sandbox/index.js +1 -0
- package/dist/cjs-browser/sandbox/preview.js +8 -3
- package/dist/cjs-browser/sandbox/sandbox.js +43 -33
- package/dist/cjs-browser/sandbox/schedule.js +91 -0
- package/dist/cjs-browser/types/client/sdk.gen.d.ts +31 -1
- package/dist/cjs-browser/types/client/types.gen.d.ts +347 -0
- package/dist/cjs-browser/types/common/pagination.d.ts +35 -0
- package/dist/cjs-browser/types/common/pagination.test.d.ts +1 -0
- package/dist/cjs-browser/types/drive/index.d.ts +35 -5
- package/dist/cjs-browser/types/index.d.ts +1 -0
- package/dist/cjs-browser/types/jobs/jobs.d.ts +33 -3
- package/dist/cjs-browser/types/sandbox/client/sdk.gen.d.ts +2 -2
- package/dist/cjs-browser/types/sandbox/client/types.gen.d.ts +28 -1
- package/dist/cjs-browser/types/sandbox/index.d.ts +1 -0
- package/dist/cjs-browser/types/sandbox/preview.d.ts +2 -2
- package/dist/cjs-browser/types/sandbox/sandbox.d.ts +38 -3
- package/dist/cjs-browser/types/sandbox/schedule.d.ts +16 -0
- package/dist/cjs-browser/types/volume/index.d.ts +37 -4
- package/dist/cjs-browser/volume/index.js +41 -4
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/client/sdk.gen.js +104 -0
- package/dist/esm/common/pagination.js +88 -0
- package/dist/esm/common/pagination.test.js +79 -0
- package/dist/esm/common/settings.js +3 -3
- package/dist/esm/common/settings.test.js +3 -3
- package/dist/esm/drive/index.js +39 -4
- package/dist/esm/index.js +1 -0
- package/dist/esm/jobs/jobs.js +42 -10
- package/dist/esm/sandbox/client/sdk.gen.js +2 -2
- package/dist/esm/sandbox/index.js +1 -0
- package/dist/esm/sandbox/preview.js +8 -3
- package/dist/esm/sandbox/sandbox.js +43 -33
- package/dist/esm/sandbox/schedule.js +87 -0
- package/dist/esm/volume/index.js +41 -4
- package/dist/esm-browser/.tsbuildinfo +1 -1
- package/dist/esm-browser/client/sdk.gen.js +104 -0
- package/dist/esm-browser/common/pagination.js +88 -0
- package/dist/esm-browser/common/pagination.test.js +79 -0
- package/dist/esm-browser/common/settings.js +3 -3
- package/dist/esm-browser/common/settings.test.js +3 -3
- package/dist/esm-browser/drive/index.js +39 -4
- package/dist/esm-browser/index.js +1 -0
- package/dist/esm-browser/jobs/jobs.js +42 -10
- package/dist/esm-browser/sandbox/client/sdk.gen.js +2 -2
- package/dist/esm-browser/sandbox/index.js +1 -0
- package/dist/esm-browser/sandbox/preview.js +8 -3
- package/dist/esm-browser/sandbox/sandbox.js +43 -33
- package/dist/esm-browser/sandbox/schedule.js +87 -0
- package/dist/esm-browser/volume/index.js +41 -4
- package/package.json +1 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SandboxSchedules = void 0;
|
|
4
|
+
const index_js_1 = require("../client/index.js");
|
|
5
|
+
// Schedule list endpoints return a bare array on older API versions and a
|
|
6
|
+
// cursor-paginated `{ data, meta }` envelope starting on Blaxel-Version
|
|
7
|
+
// 2026-04-28. Handle both so the wrapper works regardless of the SDK's default
|
|
8
|
+
// version.
|
|
9
|
+
function unwrapPage(data) {
|
|
10
|
+
if (Array.isArray(data))
|
|
11
|
+
return data;
|
|
12
|
+
return data?.data ?? [];
|
|
13
|
+
}
|
|
14
|
+
// SandboxSchedules manages a sandbox's schedules. A schedule entry is a flat
|
|
15
|
+
// record (id/type/value/input) with no sub-resource of its own, so methods
|
|
16
|
+
// return the raw SandboxScheduleEntry rather than a wrapper class (the generated
|
|
17
|
+
// `SandboxSchedule` type is the array form `SandboxScheduleEntry[]`).
|
|
18
|
+
class SandboxSchedules {
|
|
19
|
+
sandbox;
|
|
20
|
+
constructor(sandbox) {
|
|
21
|
+
this.sandbox = sandbox;
|
|
22
|
+
}
|
|
23
|
+
get sandboxName() {
|
|
24
|
+
return this.sandbox.metadata.name;
|
|
25
|
+
}
|
|
26
|
+
async list(options = {}) {
|
|
27
|
+
const { data } = await (0, index_js_1.listSandboxSchedules)({
|
|
28
|
+
path: {
|
|
29
|
+
sandboxName: this.sandboxName,
|
|
30
|
+
},
|
|
31
|
+
query: options,
|
|
32
|
+
throwOnError: true,
|
|
33
|
+
});
|
|
34
|
+
return unwrapPage(data);
|
|
35
|
+
}
|
|
36
|
+
async create(schedule) {
|
|
37
|
+
const { data } = await (0, index_js_1.createSandboxSchedule)({
|
|
38
|
+
path: {
|
|
39
|
+
sandboxName: this.sandboxName,
|
|
40
|
+
},
|
|
41
|
+
body: schedule,
|
|
42
|
+
throwOnError: true,
|
|
43
|
+
});
|
|
44
|
+
return data;
|
|
45
|
+
}
|
|
46
|
+
async get(scheduleId) {
|
|
47
|
+
const { data } = await (0, index_js_1.getSandboxSchedule)({
|
|
48
|
+
path: {
|
|
49
|
+
sandboxName: this.sandboxName,
|
|
50
|
+
scheduleId,
|
|
51
|
+
},
|
|
52
|
+
throwOnError: true,
|
|
53
|
+
});
|
|
54
|
+
return data;
|
|
55
|
+
}
|
|
56
|
+
async update(scheduleId, schedule) {
|
|
57
|
+
const { data } = await (0, index_js_1.updateSandboxSchedule)({
|
|
58
|
+
path: {
|
|
59
|
+
sandboxName: this.sandboxName,
|
|
60
|
+
scheduleId,
|
|
61
|
+
},
|
|
62
|
+
body: schedule,
|
|
63
|
+
throwOnError: true,
|
|
64
|
+
});
|
|
65
|
+
return data;
|
|
66
|
+
}
|
|
67
|
+
async delete(scheduleId) {
|
|
68
|
+
const { data } = await (0, index_js_1.deleteSandboxSchedule)({
|
|
69
|
+
path: {
|
|
70
|
+
sandboxName: this.sandboxName,
|
|
71
|
+
scheduleId,
|
|
72
|
+
},
|
|
73
|
+
throwOnError: true,
|
|
74
|
+
});
|
|
75
|
+
return data;
|
|
76
|
+
}
|
|
77
|
+
// List the execution history of every schedule on the sandbox, newest first.
|
|
78
|
+
// Executions are sandbox-scoped, not per-schedule; filter by `scheduleId` on
|
|
79
|
+
// the returned records to isolate a single schedule's runs.
|
|
80
|
+
async executions(options = {}) {
|
|
81
|
+
const { data } = await (0, index_js_1.listSandboxScheduleExecutions)({
|
|
82
|
+
path: {
|
|
83
|
+
sandboxName: this.sandboxName,
|
|
84
|
+
},
|
|
85
|
+
query: options,
|
|
86
|
+
throwOnError: true,
|
|
87
|
+
});
|
|
88
|
+
return unwrapPage(data);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.SandboxSchedules = SandboxSchedules;
|
|
@@ -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, ListApplicationsData, CreateApplicationData, DeleteApplicationData, GetApplicationData, UpdateApplicationData, CreateApplicationCustomDomainData, ListApplicationRevisionsData, GetConfigurationData, ListCustomDomainsData, CreateCustomDomainData, DeleteCustomDomainData, GetCustomDomainData, UpdateCustomDomainData, VerifyCustomDomainData, ListDrivesData, CreateDriveData, DeleteDriveData, GetDriveData, UpdateDriveData, CreateDriveAccessTokenData, GetDriveJwksData, ListAllEgressGatewaysData, GetEgressGatewayUsageData, ListAllEgressIpsData, GetWorkspaceFeaturesData, TestFeatureFlagData, ListFunctionsData, CreateFunctionData, DeleteFunctionData, GetFunctionData, UpdateFunctionData, ListFunctionRevisionsData, CleanupImagesData, ListImagesData, CreateImageData, DeleteImageData, GetImageData, ListImageSharesData, ShareImageData, ShareImageResponse, UnshareImageData, DeleteImageTagData, GetIntegrationData, ListIntegrationConnectionsData, CreateIntegrationConnectionData, DeleteIntegrationConnectionData, GetIntegrationConnectionData, UpdateIntegrationConnectionData, GetIntegrationConnectionModelEndpointConfigurationsData, ListIntegrationConnectionModelsData, GetIntegrationConnectionModelData, ListJobsData, CreateJobData, DeleteJobData, GetJobData, UpdateJobData, ListJobExecutionsData, CreateJobExecutionData, DeleteJobExecutionData, GetJobExecutionData, ListJobExecutionTasksData, ListJobRevisionsData, ListLocationsData, ListMcpHubDefinitionsData, ListModelsData, CreateModelData, DeleteModelData, GetModelData, UpdateModelData, ListModelRevisionsData, ListPendingImageSharesData, AcceptImageShareData, DeclineImageShareData, ListPoliciesData, CreatePolicyData, DeletePolicyData, GetPolicyData, UpdatePolicyData, GetPolicyUsagesData, ListPublicIpsData, ListSandboxHubDefinitionsData, ListSandboxesData, CreateSandboxData, DeleteSandboxData, GetSandboxData, UpdateSandboxData, ListSandboxPreviewsData, CreateSandboxPreviewData, DeleteSandboxPreviewData, GetSandboxPreviewData, UpdateSandboxPreviewData, ListSandboxPreviewTokensData, CreateSandboxPreviewTokenData, DeleteSandboxPreviewTokenData, GetSandboxByExternalIdData, GetWorkspaceServiceAccountsData, CreateWorkspaceServiceAccountData, DeleteWorkspaceServiceAccountData, UpdateWorkspaceServiceAccountData, ListApiKeysForServiceAccountData, CreateApiKeyForServiceAccountData, DeleteApiKeyForServiceAccountData, ListTemplatesData, GetTemplateData, ListWorkspaceUsersData, InviteWorkspaceUserData, RemoveWorkspaceUserData, UpdateWorkspaceUserRoleData, ListVolumeTemplatesData, CreateVolumeTemplateData, DeleteVolumeTemplateData, GetVolumeTemplateData, UpdateVolumeTemplateData, DeleteVolumeTemplateVersionData, ListVolumesData, CreateVolumeData, DeleteVolumeData, GetVolumeData, UpdateVolumeData, ListVpcsData, CreateVpcData, DeleteVpcData, GetVpcData, ListEgressGatewaysData, CreateEgressGatewayData, DeleteEgressGatewayData, GetEgressGatewayData, ListEgressIpsData, CreateEgressIpData, DeleteEgressIpData, GetEgressIpData, ListWorkspacesData, CreateWorkspaceData, DeleteWorkspaceData, GetWorkspaceData, UpdateWorkspaceData, DeclineWorkspaceInvitationData, AcceptWorkspaceInvitationData, LeaveWorkspaceData, CheckWorkspaceAvailabilityData } from './types.gen.js';
|
|
2
|
+
import type { ListAgentsData, CreateAgentData, DeleteAgentData, GetAgentData, UpdateAgentData, ListAgentRevisionsData, ListApplicationsData, CreateApplicationData, DeleteApplicationData, GetApplicationData, UpdateApplicationData, CreateApplicationCustomDomainData, ListApplicationRevisionsData, GetConfigurationData, ListCustomDomainsData, CreateCustomDomainData, DeleteCustomDomainData, GetCustomDomainData, UpdateCustomDomainData, VerifyCustomDomainData, ListDrivesData, CreateDriveData, DeleteDriveData, GetDriveData, UpdateDriveData, CreateDriveAccessTokenData, GetDriveJwksData, ListAllEgressGatewaysData, GetEgressGatewayUsageData, ListAllEgressIpsData, GetWorkspaceFeaturesData, TestFeatureFlagData, ListFunctionsData, CreateFunctionData, DeleteFunctionData, GetFunctionData, UpdateFunctionData, ListFunctionRevisionsData, CleanupImagesData, ListImagesData, CreateImageData, DeleteImageData, GetImageData, ListImageSharesData, ShareImageData, ShareImageResponse, UnshareImageData, DeleteImageTagData, GetIntegrationData, ListIntegrationConnectionsData, CreateIntegrationConnectionData, DeleteIntegrationConnectionData, GetIntegrationConnectionData, UpdateIntegrationConnectionData, GetIntegrationConnectionModelEndpointConfigurationsData, ListIntegrationConnectionModelsData, GetIntegrationConnectionModelData, ListJobsData, CreateJobData, DeleteJobData, GetJobData, UpdateJobData, ListJobExecutionsData, CreateJobExecutionData, DeleteJobExecutionData, GetJobExecutionData, ListJobExecutionTasksData, ListJobRevisionsData, ListLocationsData, ListMcpHubDefinitionsData, ListModelsData, CreateModelData, DeleteModelData, GetModelData, UpdateModelData, ListModelRevisionsData, ListPendingImageSharesData, AcceptImageShareData, DeclineImageShareData, ListPoliciesData, CreatePolicyData, DeletePolicyData, GetPolicyData, UpdatePolicyData, GetPolicyUsagesData, ListPublicIpsData, ListSandboxHubDefinitionsData, ListSandboxesData, CreateSandboxData, DeleteSandboxData, GetSandboxData, UpdateSandboxData, ListSandboxPreviewsData, CreateSandboxPreviewData, DeleteSandboxPreviewData, GetSandboxPreviewData, UpdateSandboxPreviewData, ListSandboxPreviewTokensData, CreateSandboxPreviewTokenData, DeleteSandboxPreviewTokenData, ListSandboxScheduleExecutionsData, ListSandboxSchedulesData, CreateSandboxScheduleData, DeleteSandboxScheduleData, GetSandboxScheduleData, UpdateSandboxScheduleData, GetSandboxByExternalIdData, GetWorkspaceServiceAccountsData, CreateWorkspaceServiceAccountData, DeleteWorkspaceServiceAccountData, UpdateWorkspaceServiceAccountData, ListApiKeysForServiceAccountData, CreateApiKeyForServiceAccountData, DeleteApiKeyForServiceAccountData, ListTemplatesData, GetTemplateData, ListWorkspaceUsersData, InviteWorkspaceUserData, RemoveWorkspaceUserData, UpdateWorkspaceUserRoleData, ListVolumeTemplatesData, CreateVolumeTemplateData, DeleteVolumeTemplateData, GetVolumeTemplateData, UpdateVolumeTemplateData, DeleteVolumeTemplateVersionData, ListVolumesData, CreateVolumeData, DeleteVolumeData, GetVolumeData, UpdateVolumeData, ListVpcsData, CreateVpcData, DeleteVpcData, GetVpcData, ListEgressGatewaysData, CreateEgressGatewayData, DeleteEgressGatewayData, GetEgressGatewayData, ListEgressIpsData, CreateEgressIpData, DeleteEgressIpData, GetEgressIpData, ListWorkspacesData, CreateWorkspaceData, 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
|
|
@@ -533,6 +533,36 @@ export declare const createSandboxPreviewToken: <ThrowOnError extends boolean =
|
|
|
533
533
|
export declare const deleteSandboxPreviewToken: <ThrowOnError extends boolean = false>(options: Options<DeleteSandboxPreviewTokenData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
|
|
534
534
|
message?: string;
|
|
535
535
|
}, unknown, ThrowOnError>;
|
|
536
|
+
/**
|
|
537
|
+
* List Sandbox Schedule Executions
|
|
538
|
+
* Returns the execution history of a Sandbox's schedules (across all schedules of the sandbox), newest first. Cursor-paginated via the `cursor` and `limit` query parameters. Each item records the HTTP status of submitting the scheduled command and the process name for log lookup.
|
|
539
|
+
*/
|
|
540
|
+
export declare const listSandboxScheduleExecutions: <ThrowOnError extends boolean = false>(options: Options<ListSandboxScheduleExecutionsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").SandboxScheduleExecutionList, unknown, ThrowOnError>;
|
|
541
|
+
/**
|
|
542
|
+
* List Sandbox Schedules
|
|
543
|
+
* Returns the schedules configured on a Sandbox. Starting with API version 2026-04-28 the response is wrapped in `{data, meta}` and supports cursor pagination via the `cursor` and `limit` query parameters; older versions return a bare array.
|
|
544
|
+
*/
|
|
545
|
+
export declare const listSandboxSchedules: <ThrowOnError extends boolean = false>(options: Options<ListSandboxSchedulesData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").SandboxScheduleEntryList, unknown, ThrowOnError>;
|
|
546
|
+
/**
|
|
547
|
+
* Create Sandbox Schedule
|
|
548
|
+
* Adds a schedule to a Sandbox.
|
|
549
|
+
*/
|
|
550
|
+
export declare const createSandboxSchedule: <ThrowOnError extends boolean = false>(options: Options<CreateSandboxScheduleData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").SandboxScheduleEntry, unknown, ThrowOnError>;
|
|
551
|
+
/**
|
|
552
|
+
* Delete Sandbox Schedule
|
|
553
|
+
* Deletes a Sandbox Schedule by id.
|
|
554
|
+
*/
|
|
555
|
+
export declare const deleteSandboxSchedule: <ThrowOnError extends boolean = false>(options: Options<DeleteSandboxScheduleData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").SandboxScheduleEntry, unknown, ThrowOnError>;
|
|
556
|
+
/**
|
|
557
|
+
* Get Sandbox Schedule
|
|
558
|
+
* Returns a Sandbox Schedule by id.
|
|
559
|
+
*/
|
|
560
|
+
export declare const getSandboxSchedule: <ThrowOnError extends boolean = false>(options: Options<GetSandboxScheduleData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").SandboxScheduleEntry, unknown, ThrowOnError>;
|
|
561
|
+
/**
|
|
562
|
+
* Update Sandbox Schedule
|
|
563
|
+
* Updates a Sandbox Schedule by id.
|
|
564
|
+
*/
|
|
565
|
+
export declare const updateSandboxSchedule: <ThrowOnError extends boolean = false>(options: Options<UpdateSandboxScheduleData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").SandboxScheduleEntry, unknown, ThrowOnError>;
|
|
536
566
|
/**
|
|
537
567
|
* Get sandbox by external ID
|
|
538
568
|
* Returns the most recent non-terminated sandbox matching the given external ID. If no active sandbox is found, returns 404.
|
|
@@ -3626,6 +3626,195 @@ export type SandboxRuntime = {
|
|
|
3626
3626
|
*/
|
|
3627
3627
|
ttl?: string;
|
|
3628
3628
|
};
|
|
3629
|
+
/**
|
|
3630
|
+
* List of scheduled tasks for automated process execution inside the sandbox. Supports recurring cron expressions, one-off datetime targets, and sleep durations.
|
|
3631
|
+
*/
|
|
3632
|
+
export type SandboxSchedule = Array<SandboxScheduleEntry>;
|
|
3633
|
+
/**
|
|
3634
|
+
* List of scheduled tasks for automated process execution inside the sandbox. Supports recurring cron expressions, one-off datetime targets, and sleep durations.
|
|
3635
|
+
*/
|
|
3636
|
+
export type SandboxScheduleWritable = Array<SandboxScheduleEntryWritable>;
|
|
3637
|
+
/**
|
|
3638
|
+
* A scheduled task that executes a process inside the sandbox at specified times. Stored in the dedicated schedules table (no longer embedded in the sandbox spec).
|
|
3639
|
+
*/
|
|
3640
|
+
export type SandboxScheduleEntry = {
|
|
3641
|
+
/**
|
|
3642
|
+
* Creation timestamp (read-only).
|
|
3643
|
+
*/
|
|
3644
|
+
readonly createdAt?: string;
|
|
3645
|
+
/**
|
|
3646
|
+
* Unique identifier for this schedule within its sandbox. Auto-generated if not provided.
|
|
3647
|
+
*/
|
|
3648
|
+
id?: string;
|
|
3649
|
+
input?: SandboxScheduleInput;
|
|
3650
|
+
/**
|
|
3651
|
+
* Maximum number of execution records kept for this schedule. Once reached, recording a new execution deletes the oldest. Defaults to 100.
|
|
3652
|
+
*/
|
|
3653
|
+
maxExecutions?: number;
|
|
3654
|
+
/**
|
|
3655
|
+
* Type of schedule timing. 'cron' for recurring (5-field expression), 'at' for a specific RFC 3339 datetime, 'sleep' for a duration from now (resolved to 'at' on creation).
|
|
3656
|
+
*/
|
|
3657
|
+
type?: 'cron' | 'at' | 'sleep';
|
|
3658
|
+
/**
|
|
3659
|
+
* Timing value. For 'cron': a 5-field cron expression (e.g. '0 8 * * 1-5'). For 'at': an RFC 3339 datetime (e.g. '2026-07-01T09:00:00Z'). For 'sleep': a duration (e.g. '2h', '30m', '7d').
|
|
3660
|
+
*/
|
|
3661
|
+
value?: string;
|
|
3662
|
+
};
|
|
3663
|
+
/**
|
|
3664
|
+
* A scheduled task that executes a process inside the sandbox at specified times. Stored in the dedicated schedules table (no longer embedded in the sandbox spec).
|
|
3665
|
+
*/
|
|
3666
|
+
export type SandboxScheduleEntryWritable = {
|
|
3667
|
+
/**
|
|
3668
|
+
* Unique identifier for this schedule within its sandbox. Auto-generated if not provided.
|
|
3669
|
+
*/
|
|
3670
|
+
id?: string;
|
|
3671
|
+
input?: SandboxScheduleInput;
|
|
3672
|
+
/**
|
|
3673
|
+
* Maximum number of execution records kept for this schedule. Once reached, recording a new execution deletes the oldest. Defaults to 100.
|
|
3674
|
+
*/
|
|
3675
|
+
maxExecutions?: number;
|
|
3676
|
+
/**
|
|
3677
|
+
* Type of schedule timing. 'cron' for recurring (5-field expression), 'at' for a specific RFC 3339 datetime, 'sleep' for a duration from now (resolved to 'at' on creation).
|
|
3678
|
+
*/
|
|
3679
|
+
type?: 'cron' | 'at' | 'sleep';
|
|
3680
|
+
/**
|
|
3681
|
+
* Timing value. For 'cron': a 5-field cron expression (e.g. '0 8 * * 1-5'). For 'at': an RFC 3339 datetime (e.g. '2026-07-01T09:00:00Z'). For 'sleep': a duration (e.g. '2h', '30m', '7d').
|
|
3682
|
+
*/
|
|
3683
|
+
value?: string;
|
|
3684
|
+
};
|
|
3685
|
+
/**
|
|
3686
|
+
* Cursor-paginated list of a sandbox's schedule definitions.
|
|
3687
|
+
*/
|
|
3688
|
+
export type SandboxScheduleEntryList = {
|
|
3689
|
+
/**
|
|
3690
|
+
* Page of schedule definitions.
|
|
3691
|
+
*/
|
|
3692
|
+
data?: Array<SandboxScheduleEntry>;
|
|
3693
|
+
meta?: PaginationMeta;
|
|
3694
|
+
};
|
|
3695
|
+
/**
|
|
3696
|
+
* Cursor-paginated list of a sandbox's schedule definitions.
|
|
3697
|
+
*/
|
|
3698
|
+
export type SandboxScheduleEntryListWritable = {
|
|
3699
|
+
/**
|
|
3700
|
+
* Page of schedule definitions.
|
|
3701
|
+
*/
|
|
3702
|
+
data?: Array<SandboxScheduleEntryWritable>;
|
|
3703
|
+
meta?: PaginationMeta;
|
|
3704
|
+
};
|
|
3705
|
+
/**
|
|
3706
|
+
* One recorded execution of a sandbox schedule. statusCode is the HTTP status from submitting the command to the sandbox (the scheduler does not wait for the command to finish). Stored in the dedicated scheduleexecutions table.
|
|
3707
|
+
*/
|
|
3708
|
+
export type SandboxScheduleExecution = {
|
|
3709
|
+
/**
|
|
3710
|
+
* Creation timestamp (read-only).
|
|
3711
|
+
*/
|
|
3712
|
+
readonly createdAt?: string;
|
|
3713
|
+
/**
|
|
3714
|
+
* RFC 3339 time at which the command was submitted.
|
|
3715
|
+
*/
|
|
3716
|
+
executedAt?: string;
|
|
3717
|
+
/**
|
|
3718
|
+
* Unique id of this execution within the schedule.
|
|
3719
|
+
*/
|
|
3720
|
+
id?: string;
|
|
3721
|
+
/**
|
|
3722
|
+
* Name of the process started in the sandbox for this execution, used to look up its logs.
|
|
3723
|
+
*/
|
|
3724
|
+
processName?: string;
|
|
3725
|
+
/**
|
|
3726
|
+
* Id of the schedule this execution belongs to.
|
|
3727
|
+
*/
|
|
3728
|
+
scheduleId?: string;
|
|
3729
|
+
/**
|
|
3730
|
+
* HTTP status code returned when the scheduled command was submitted to the sandbox (0 if the sandbox could not be reached). 2xx/3xx means the command was accepted.
|
|
3731
|
+
*/
|
|
3732
|
+
statusCode?: number;
|
|
3733
|
+
/**
|
|
3734
|
+
* Process timeout in seconds for this execution. The UI uses it to scope the log view to [executedAt, executedAt+timeout]. 0 when the schedule set no timeout.
|
|
3735
|
+
*/
|
|
3736
|
+
timeout?: number;
|
|
3737
|
+
};
|
|
3738
|
+
/**
|
|
3739
|
+
* One recorded execution of a sandbox schedule. statusCode is the HTTP status from submitting the command to the sandbox (the scheduler does not wait for the command to finish). Stored in the dedicated scheduleexecutions table.
|
|
3740
|
+
*/
|
|
3741
|
+
export type SandboxScheduleExecutionWritable = {
|
|
3742
|
+
/**
|
|
3743
|
+
* RFC 3339 time at which the command was submitted.
|
|
3744
|
+
*/
|
|
3745
|
+
executedAt?: string;
|
|
3746
|
+
/**
|
|
3747
|
+
* Unique id of this execution within the schedule.
|
|
3748
|
+
*/
|
|
3749
|
+
id?: string;
|
|
3750
|
+
/**
|
|
3751
|
+
* Name of the process started in the sandbox for this execution, used to look up its logs.
|
|
3752
|
+
*/
|
|
3753
|
+
processName?: string;
|
|
3754
|
+
/**
|
|
3755
|
+
* Id of the schedule this execution belongs to.
|
|
3756
|
+
*/
|
|
3757
|
+
scheduleId?: string;
|
|
3758
|
+
/**
|
|
3759
|
+
* HTTP status code returned when the scheduled command was submitted to the sandbox (0 if the sandbox could not be reached). 2xx/3xx means the command was accepted.
|
|
3760
|
+
*/
|
|
3761
|
+
statusCode?: number;
|
|
3762
|
+
/**
|
|
3763
|
+
* Process timeout in seconds for this execution. The UI uses it to scope the log view to [executedAt, executedAt+timeout]. 0 when the schedule set no timeout.
|
|
3764
|
+
*/
|
|
3765
|
+
timeout?: number;
|
|
3766
|
+
};
|
|
3767
|
+
/**
|
|
3768
|
+
* Cursor-paginated list of a sandbox's schedule execution history (across all its schedules).
|
|
3769
|
+
*/
|
|
3770
|
+
export type SandboxScheduleExecutionList = {
|
|
3771
|
+
/**
|
|
3772
|
+
* Page of schedule executions.
|
|
3773
|
+
*/
|
|
3774
|
+
data?: Array<SandboxScheduleExecution>;
|
|
3775
|
+
meta?: PaginationMeta;
|
|
3776
|
+
};
|
|
3777
|
+
/**
|
|
3778
|
+
* Cursor-paginated list of a sandbox's schedule execution history (across all its schedules).
|
|
3779
|
+
*/
|
|
3780
|
+
export type SandboxScheduleExecutionListWritable = {
|
|
3781
|
+
/**
|
|
3782
|
+
* Page of schedule executions.
|
|
3783
|
+
*/
|
|
3784
|
+
data?: Array<SandboxScheduleExecutionWritable>;
|
|
3785
|
+
meta?: PaginationMeta;
|
|
3786
|
+
};
|
|
3787
|
+
/**
|
|
3788
|
+
* Process execution configuration for a scheduled sandbox task
|
|
3789
|
+
*/
|
|
3790
|
+
export type SandboxScheduleInput = {
|
|
3791
|
+
/**
|
|
3792
|
+
* Shell command to execute inside the sandbox
|
|
3793
|
+
*/
|
|
3794
|
+
command?: string;
|
|
3795
|
+
/**
|
|
3796
|
+
* Environment variables to set for the process. May contain secrets, so values are encrypted at rest and masked in API responses unless an admin requests show_secrets=true.
|
|
3797
|
+
*/
|
|
3798
|
+
env?: {
|
|
3799
|
+
[key: string]: string;
|
|
3800
|
+
};
|
|
3801
|
+
/**
|
|
3802
|
+
* Keep the sandbox alive (disable scale-to-zero) while the process runs. Defaults to true.
|
|
3803
|
+
*/
|
|
3804
|
+
keepAlive?: boolean;
|
|
3805
|
+
/**
|
|
3806
|
+
* Optional name for the process (used to retrieve status/logs)
|
|
3807
|
+
*/
|
|
3808
|
+
name?: string;
|
|
3809
|
+
/**
|
|
3810
|
+
* Timeout in seconds for the process. Defaults to 600 (10 minutes). Set to 0 for no timeout.
|
|
3811
|
+
*/
|
|
3812
|
+
timeout?: number;
|
|
3813
|
+
/**
|
|
3814
|
+
* Working directory for the command
|
|
3815
|
+
*/
|
|
3816
|
+
workingDir?: string;
|
|
3817
|
+
};
|
|
3629
3818
|
/**
|
|
3630
3819
|
* Configuration for a sandbox including its image, memory, ports, region, and lifecycle policies
|
|
3631
3820
|
*/
|
|
@@ -7202,6 +7391,164 @@ export type DeleteSandboxPreviewTokenResponses = {
|
|
|
7202
7391
|
};
|
|
7203
7392
|
};
|
|
7204
7393
|
export type DeleteSandboxPreviewTokenResponse = DeleteSandboxPreviewTokenResponses[keyof DeleteSandboxPreviewTokenResponses];
|
|
7394
|
+
export type ListSandboxScheduleExecutionsData = {
|
|
7395
|
+
body?: never;
|
|
7396
|
+
path: {
|
|
7397
|
+
/**
|
|
7398
|
+
* Name of the Sandbox
|
|
7399
|
+
*/
|
|
7400
|
+
sandboxName: string;
|
|
7401
|
+
};
|
|
7402
|
+
query?: {
|
|
7403
|
+
/**
|
|
7404
|
+
* Number of items per page
|
|
7405
|
+
*/
|
|
7406
|
+
limit?: number;
|
|
7407
|
+
/**
|
|
7408
|
+
* Opaque cursor returned by a previous response's meta.nextCursor. Only valid for the same query (workspace + filters); the server rejects cursors bound to a different query or older than 24h. Omit on the first page.
|
|
7409
|
+
*/
|
|
7410
|
+
cursor?: string;
|
|
7411
|
+
/**
|
|
7412
|
+
* Sort spec, formatted as `<key>:<direction>`. Allowed values are `createdAt:desc` (default), `createdAt:asc`, `name:asc`, `name:desc`. The cursor fingerprint is bound to the sort, so a cursor opened with one value cannot be reused with another. Only honoured starting on Blaxel-Version 2026-04-28.
|
|
7413
|
+
*/
|
|
7414
|
+
sort?: 'createdAt:desc' | 'createdAt:asc' | 'name:asc' | 'name:desc';
|
|
7415
|
+
/**
|
|
7416
|
+
* Substring search across `metadata.name`, `metadata.displayName` and labels (keys + values). Trimmed and lowercased server-side; queries shorter than 2 characters fall back to the unfiltered listing. Bound into the cursor fingerprint so a cursor opened with one query cannot be reused with another. Only honoured starting on Blaxel-Version 2026-04-28.
|
|
7417
|
+
*/
|
|
7418
|
+
q?: string;
|
|
7419
|
+
};
|
|
7420
|
+
url: '/sandboxes/{sandboxName}/schedule-executions';
|
|
7421
|
+
};
|
|
7422
|
+
export type ListSandboxScheduleExecutionsResponses = {
|
|
7423
|
+
/**
|
|
7424
|
+
* successful operation
|
|
7425
|
+
*/
|
|
7426
|
+
200: SandboxScheduleExecutionList;
|
|
7427
|
+
};
|
|
7428
|
+
export type ListSandboxScheduleExecutionsResponse = ListSandboxScheduleExecutionsResponses[keyof ListSandboxScheduleExecutionsResponses];
|
|
7429
|
+
export type ListSandboxSchedulesData = {
|
|
7430
|
+
body?: never;
|
|
7431
|
+
path: {
|
|
7432
|
+
/**
|
|
7433
|
+
* Name of the Sandbox
|
|
7434
|
+
*/
|
|
7435
|
+
sandboxName: string;
|
|
7436
|
+
};
|
|
7437
|
+
query?: {
|
|
7438
|
+
/**
|
|
7439
|
+
* Number of items per page
|
|
7440
|
+
*/
|
|
7441
|
+
limit?: number;
|
|
7442
|
+
/**
|
|
7443
|
+
* Opaque cursor returned by a previous response's meta.nextCursor. Only valid for the same query (workspace + filters); the server rejects cursors bound to a different query or older than 24h. Omit on the first page.
|
|
7444
|
+
*/
|
|
7445
|
+
cursor?: string;
|
|
7446
|
+
/**
|
|
7447
|
+
* Sort spec, formatted as `<key>:<direction>`. Allowed values are `createdAt:desc` (default), `createdAt:asc`, `name:asc`, `name:desc`. The cursor fingerprint is bound to the sort, so a cursor opened with one value cannot be reused with another. Only honoured starting on Blaxel-Version 2026-04-28.
|
|
7448
|
+
*/
|
|
7449
|
+
sort?: 'createdAt:desc' | 'createdAt:asc' | 'name:asc' | 'name:desc';
|
|
7450
|
+
/**
|
|
7451
|
+
* Substring search across `metadata.name`, `metadata.displayName` and labels (keys + values). Trimmed and lowercased server-side; queries shorter than 2 characters fall back to the unfiltered listing. Bound into the cursor fingerprint so a cursor opened with one query cannot be reused with another. Only honoured starting on Blaxel-Version 2026-04-28.
|
|
7452
|
+
*/
|
|
7453
|
+
q?: string;
|
|
7454
|
+
/**
|
|
7455
|
+
* Filter schedules by timing type. Only cron and at are stored (sleep resolves to at on creation); any other value is ignored.
|
|
7456
|
+
*/
|
|
7457
|
+
type?: 'cron' | 'at';
|
|
7458
|
+
};
|
|
7459
|
+
url: '/sandboxes/{sandboxName}/schedules';
|
|
7460
|
+
};
|
|
7461
|
+
export type ListSandboxSchedulesResponses = {
|
|
7462
|
+
/**
|
|
7463
|
+
* successful operation
|
|
7464
|
+
*/
|
|
7465
|
+
200: SandboxScheduleEntryList;
|
|
7466
|
+
};
|
|
7467
|
+
export type ListSandboxSchedulesResponse = ListSandboxSchedulesResponses[keyof ListSandboxSchedulesResponses];
|
|
7468
|
+
export type CreateSandboxScheduleData = {
|
|
7469
|
+
body: SandboxScheduleEntryWritable;
|
|
7470
|
+
path: {
|
|
7471
|
+
/**
|
|
7472
|
+
* Name of the Sandbox
|
|
7473
|
+
*/
|
|
7474
|
+
sandboxName: string;
|
|
7475
|
+
};
|
|
7476
|
+
query?: never;
|
|
7477
|
+
url: '/sandboxes/{sandboxName}/schedules';
|
|
7478
|
+
};
|
|
7479
|
+
export type CreateSandboxScheduleResponses = {
|
|
7480
|
+
/**
|
|
7481
|
+
* successful operation
|
|
7482
|
+
*/
|
|
7483
|
+
200: SandboxScheduleEntry;
|
|
7484
|
+
};
|
|
7485
|
+
export type CreateSandboxScheduleResponse = CreateSandboxScheduleResponses[keyof CreateSandboxScheduleResponses];
|
|
7486
|
+
export type DeleteSandboxScheduleData = {
|
|
7487
|
+
body?: never;
|
|
7488
|
+
path: {
|
|
7489
|
+
/**
|
|
7490
|
+
* Name of the Sandbox
|
|
7491
|
+
*/
|
|
7492
|
+
sandboxName: string;
|
|
7493
|
+
/**
|
|
7494
|
+
* Id of the Schedule
|
|
7495
|
+
*/
|
|
7496
|
+
scheduleId: string;
|
|
7497
|
+
};
|
|
7498
|
+
query?: never;
|
|
7499
|
+
url: '/sandboxes/{sandboxName}/schedules/{scheduleId}';
|
|
7500
|
+
};
|
|
7501
|
+
export type DeleteSandboxScheduleResponses = {
|
|
7502
|
+
/**
|
|
7503
|
+
* successful operation
|
|
7504
|
+
*/
|
|
7505
|
+
200: SandboxScheduleEntry;
|
|
7506
|
+
};
|
|
7507
|
+
export type DeleteSandboxScheduleResponse = DeleteSandboxScheduleResponses[keyof DeleteSandboxScheduleResponses];
|
|
7508
|
+
export type GetSandboxScheduleData = {
|
|
7509
|
+
body?: never;
|
|
7510
|
+
path: {
|
|
7511
|
+
/**
|
|
7512
|
+
* Name of the Sandbox
|
|
7513
|
+
*/
|
|
7514
|
+
sandboxName: string;
|
|
7515
|
+
/**
|
|
7516
|
+
* Id of the Schedule
|
|
7517
|
+
*/
|
|
7518
|
+
scheduleId: string;
|
|
7519
|
+
};
|
|
7520
|
+
query?: never;
|
|
7521
|
+
url: '/sandboxes/{sandboxName}/schedules/{scheduleId}';
|
|
7522
|
+
};
|
|
7523
|
+
export type GetSandboxScheduleResponses = {
|
|
7524
|
+
/**
|
|
7525
|
+
* successful operation
|
|
7526
|
+
*/
|
|
7527
|
+
200: SandboxScheduleEntry;
|
|
7528
|
+
};
|
|
7529
|
+
export type GetSandboxScheduleResponse = GetSandboxScheduleResponses[keyof GetSandboxScheduleResponses];
|
|
7530
|
+
export type UpdateSandboxScheduleData = {
|
|
7531
|
+
body: SandboxScheduleEntryWritable;
|
|
7532
|
+
path: {
|
|
7533
|
+
/**
|
|
7534
|
+
* Name of the Sandbox
|
|
7535
|
+
*/
|
|
7536
|
+
sandboxName: string;
|
|
7537
|
+
/**
|
|
7538
|
+
* Id of the Schedule
|
|
7539
|
+
*/
|
|
7540
|
+
scheduleId: string;
|
|
7541
|
+
};
|
|
7542
|
+
query?: never;
|
|
7543
|
+
url: '/sandboxes/{sandboxName}/schedules/{scheduleId}';
|
|
7544
|
+
};
|
|
7545
|
+
export type UpdateSandboxScheduleResponses = {
|
|
7546
|
+
/**
|
|
7547
|
+
* successful operation
|
|
7548
|
+
*/
|
|
7549
|
+
200: SandboxScheduleEntry;
|
|
7550
|
+
};
|
|
7551
|
+
export type UpdateSandboxScheduleResponse = UpdateSandboxScheduleResponses[keyof UpdateSandboxScheduleResponses];
|
|
7205
7552
|
export type GetSandboxByExternalIdData = {
|
|
7206
7553
|
body?: never;
|
|
7207
7554
|
path: {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type PaginatedListMeta = {
|
|
2
|
+
hasMore?: boolean;
|
|
3
|
+
nextCursor?: string;
|
|
4
|
+
total?: number;
|
|
5
|
+
};
|
|
6
|
+
export type CursorPaginationQuery = {
|
|
7
|
+
cursor?: string;
|
|
8
|
+
};
|
|
9
|
+
export type ListResponse<T> = T[] | {
|
|
10
|
+
data?: T[] | null;
|
|
11
|
+
meta?: PaginatedListMeta | null;
|
|
12
|
+
} | null | undefined;
|
|
13
|
+
export type AutoPagingEachCallback<T> = (item: T) => boolean | void | Promise<boolean | void>;
|
|
14
|
+
export type AutoPagingToArrayOptions = {
|
|
15
|
+
limit: number;
|
|
16
|
+
};
|
|
17
|
+
export type PaginatedList<T, TQuery extends CursorPaginationQuery = CursorPaginationQuery> = AsyncIterable<T> & {
|
|
18
|
+
data: T[];
|
|
19
|
+
meta: PaginatedListMeta;
|
|
20
|
+
hasMore: boolean;
|
|
21
|
+
nextCursor?: string;
|
|
22
|
+
nextPage(): Promise<PaginatedList<T, TQuery> | null>;
|
|
23
|
+
autoPagingEach(onItem: AutoPagingEachCallback<T>): Promise<void>;
|
|
24
|
+
autoPagingToArray(options: AutoPagingToArrayOptions): Promise<T[]>;
|
|
25
|
+
};
|
|
26
|
+
type CreatePaginatedListOptions<TRaw, TItem, TQuery extends CursorPaginationQuery> = {
|
|
27
|
+
response: ListResponse<TRaw>;
|
|
28
|
+
fetchPage: (query?: TQuery) => Promise<ListResponse<TRaw>>;
|
|
29
|
+
mapItem: (item: TRaw) => TItem | Promise<TItem>;
|
|
30
|
+
query?: TQuery;
|
|
31
|
+
seenCursors?: Set<string>;
|
|
32
|
+
};
|
|
33
|
+
export declare function unwrapListData<T>(response: ListResponse<T>): T[];
|
|
34
|
+
export declare function createPaginatedList<TRaw, TItem, TQuery extends CursorPaginationQuery = CursorPaginationQuery>({ response, fetchPage, mapItem, query, seenCursors, }: CreatePaginatedListOptions<TRaw, TItem, TQuery>): Promise<PaginatedList<TItem, TQuery>>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Drive } from "../client/index.js";
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import { type Drive, type DrivePermission, type ListDrivesData } from "../client/index.js";
|
|
2
|
+
export type DriveListQuery = NonNullable<ListDrivesData["query"]>;
|
|
3
|
+
export type DriveCreateConfiguration = {
|
|
4
4
|
name?: string;
|
|
5
5
|
displayName?: string;
|
|
6
6
|
labels?: Record<string, string>;
|
|
7
7
|
size?: number;
|
|
8
8
|
region?: string;
|
|
9
9
|
permissions?: Array<DrivePermission>;
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
11
|
export declare class DriveInstance {
|
|
12
12
|
private drive;
|
|
13
13
|
constructor(drive: Drive);
|
|
@@ -22,7 +22,37 @@ export declare class DriveInstance {
|
|
|
22
22
|
get permissions(): DrivePermission[] | undefined;
|
|
23
23
|
static create(config: DriveCreateConfiguration | Drive): Promise<DriveInstance>;
|
|
24
24
|
static get(driveName: string): Promise<DriveInstance>;
|
|
25
|
-
|
|
25
|
+
/**
|
|
26
|
+
* List one page of drives.
|
|
27
|
+
*
|
|
28
|
+
* The returned page exposes `data` for the current page, `meta` for cursor
|
|
29
|
+
* metadata, and helpers to fetch more pages only when you need them.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const page = await DriveInstance.list({ limit: 50 });
|
|
34
|
+
*
|
|
35
|
+
* for (const drive of page.data) {
|
|
36
|
+
* console.log(drive.name);
|
|
37
|
+
* }
|
|
38
|
+
*
|
|
39
|
+
* const nextPage = await page.nextPage();
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const allDrives = await (await DriveInstance.list()).autoPagingToArray({
|
|
45
|
+
* limit: 1000,
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
static list(query?: DriveListQuery): Promise<import("../common/pagination.js").PaginatedList<DriveInstance, {
|
|
50
|
+
cursor?: string;
|
|
51
|
+
limit?: number;
|
|
52
|
+
sort?: "createdAt:desc" | "createdAt:asc" | "name:asc" | "name:desc";
|
|
53
|
+
q?: string;
|
|
54
|
+
anchor?: "end";
|
|
55
|
+
}>>;
|
|
26
56
|
static delete(driveName: string): Promise<{
|
|
27
57
|
message?: string;
|
|
28
58
|
name?: string;
|
|
@@ -7,6 +7,7 @@ export * from "./common/node.js";
|
|
|
7
7
|
export * from "./common/errors.js";
|
|
8
8
|
export * from "./common/internal.js";
|
|
9
9
|
export * from "./common/logger.js";
|
|
10
|
+
export * from "./common/pagination.js";
|
|
10
11
|
export * from "./common/settings.js";
|
|
11
12
|
export * from "./common/webhook.js";
|
|
12
13
|
export * from "./drive/index.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { CreateJobExecutionRequest, JobExecution } from "../client/index.js";
|
|
1
|
+
import { type CreateJobExecutionRequest, type JobExecution, type ListJobExecutionsData } from "../client/index.js";
|
|
2
|
+
export type JobExecutionListQuery = NonNullable<ListJobExecutionsData["query"]>;
|
|
2
3
|
declare class BlJob {
|
|
3
4
|
jobName: string;
|
|
4
5
|
constructor(jobName: string);
|
|
@@ -16,9 +17,38 @@ declare class BlJob {
|
|
|
16
17
|
*/
|
|
17
18
|
getExecution(executionId: string): Promise<JobExecution>;
|
|
18
19
|
/**
|
|
19
|
-
* List
|
|
20
|
+
* List one page of executions for this job.
|
|
21
|
+
*
|
|
22
|
+
* The returned page exposes `data` for the current page, `meta` for cursor
|
|
23
|
+
* metadata, and helpers to fetch more pages only when you need them.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const job = blJob("daily-import");
|
|
28
|
+
* const page = await job.listExecutions({ limit: 50 });
|
|
29
|
+
*
|
|
30
|
+
* for (const execution of page.data) {
|
|
31
|
+
* console.log(execution.status);
|
|
32
|
+
* }
|
|
33
|
+
*
|
|
34
|
+
* const nextPage = await page.nextPage();
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const job = blJob("daily-import");
|
|
40
|
+
* const executions = await (await job.listExecutions()).autoPagingToArray({
|
|
41
|
+
* limit: 1000,
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
20
44
|
*/
|
|
21
|
-
listExecutions(): Promise<JobExecution
|
|
45
|
+
listExecutions(query?: JobExecutionListQuery): Promise<import("../common/pagination.js").PaginatedList<JobExecution, {
|
|
46
|
+
limit?: number;
|
|
47
|
+
offset?: number;
|
|
48
|
+
cursor?: string;
|
|
49
|
+
sort?: "createdAt:desc" | "createdAt:asc" | "name:asc" | "name:desc";
|
|
50
|
+
q?: string;
|
|
51
|
+
}>>;
|
|
22
52
|
/**
|
|
23
53
|
* Get the status of a specific execution
|
|
24
54
|
*/
|