@blaxel/core 0.2.96-preview.205 → 0.2.96-preview.206
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 +1 -1
- package/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/common/settings.js +2 -2
- package/dist/cjs/sandbox/schedule.js +51 -21
- package/dist/cjs/types/sandbox/schedule.d.ts +35 -2
- package/dist/cjs-browser/.tsbuildinfo +1 -1
- package/dist/cjs-browser/common/settings.js +2 -2
- package/dist/cjs-browser/sandbox/schedule.js +51 -21
- package/dist/cjs-browser/types/sandbox/schedule.d.ts +35 -2
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/common/settings.js +2 -2
- package/dist/esm/sandbox/schedule.js +51 -21
- package/dist/esm-browser/.tsbuildinfo +1 -1
- package/dist/esm-browser/common/settings.js +2 -2
- package/dist/esm-browser/sandbox/schedule.js +51 -21
- package/package.json +1 -1
|
@@ -22,8 +22,8 @@ function missingCredentialsMessage() {
|
|
|
22
22
|
return "No Blaxel credentials found. Set the BL_API_KEY and BL_WORKSPACE environment variables, or run `bl login`.";
|
|
23
23
|
}
|
|
24
24
|
// Build info - these placeholders are replaced at build time by build:replace-imports
|
|
25
|
-
const BUILD_VERSION = "0.2.96-preview.
|
|
26
|
-
const BUILD_COMMIT = "
|
|
25
|
+
const BUILD_VERSION = "0.2.96-preview.206";
|
|
26
|
+
const BUILD_COMMIT = "f48d4c2e1e8d3bd3ee61decfacc3cd4f3ab0323d";
|
|
27
27
|
const BUILD_SENTRY_DSN = "https://fd5e60e1c9820e1eef5ccebb84a07127@o4508714045276160.ingest.us.sentry.io/4510465864564736";
|
|
28
28
|
const BLAXEL_API_VERSION = "2026-04-28";
|
|
29
29
|
// Cache for config.yaml tracking value
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { createSandboxSchedule, deleteSandboxSchedule, getSandboxSchedule, listSandboxScheduleExecutions, listSandboxSchedules, updateSandboxSchedule } from "../client/index.js";
|
|
2
|
-
|
|
3
|
-
// cursor-paginated `{ data, meta }` envelope starting on Blaxel-Version
|
|
4
|
-
// 2026-04-28. Handle both so the wrapper works regardless of the SDK's default
|
|
5
|
-
// version.
|
|
6
|
-
function unwrapPage(data) {
|
|
7
|
-
if (Array.isArray(data))
|
|
8
|
-
return data;
|
|
9
|
-
return data?.data ?? [];
|
|
10
|
-
}
|
|
2
|
+
import { createPaginatedList } from "../common/pagination.js";
|
|
11
3
|
// SandboxSchedules manages a sandbox's schedules. A schedule entry is a flat
|
|
12
4
|
// record (id/type/value/input) with no sub-resource of its own, so methods
|
|
13
5
|
// return the raw SandboxScheduleEntry rather than a wrapper class (the generated
|
|
@@ -20,15 +12,38 @@ export class SandboxSchedules {
|
|
|
20
12
|
get sandboxName() {
|
|
21
13
|
return this.sandbox.metadata.name;
|
|
22
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* List one page of the sandbox's schedules.
|
|
17
|
+
*
|
|
18
|
+
* The returned page exposes `data` for the current page, `meta` for cursor
|
|
19
|
+
* metadata, and `nextPage()` / `autoPagingEach()` / `autoPagingToArray()`
|
|
20
|
+
* helpers. Iterate it directly with `for await` to walk every page.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const page = await sandbox.schedules.list({ limit: 50 });
|
|
25
|
+
* for await (const schedule of page) {
|
|
26
|
+
* console.log(schedule.id);
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
23
30
|
async list(options = {}) {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
const fetchPage = async (query) => {
|
|
32
|
+
const { data } = await listSandboxSchedules({
|
|
33
|
+
path: {
|
|
34
|
+
sandboxName: this.sandboxName,
|
|
35
|
+
},
|
|
36
|
+
query,
|
|
37
|
+
throwOnError: true,
|
|
38
|
+
});
|
|
39
|
+
return data;
|
|
40
|
+
};
|
|
41
|
+
return createPaginatedList({
|
|
42
|
+
response: await fetchPage(options),
|
|
43
|
+
fetchPage,
|
|
44
|
+
mapItem: (entry) => entry,
|
|
28
45
|
query: options,
|
|
29
|
-
throwOnError: true,
|
|
30
46
|
});
|
|
31
|
-
return unwrapPage(data);
|
|
32
47
|
}
|
|
33
48
|
async create(schedule) {
|
|
34
49
|
const { data } = await createSandboxSchedule({
|
|
@@ -74,14 +89,29 @@ export class SandboxSchedules {
|
|
|
74
89
|
// List the execution history of every schedule on the sandbox, newest first.
|
|
75
90
|
// Executions are sandbox-scoped, not per-schedule; filter by `scheduleId` on
|
|
76
91
|
// the returned records to isolate a single schedule's runs.
|
|
92
|
+
/**
|
|
93
|
+
* List one page of schedule executions, newest first.
|
|
94
|
+
*
|
|
95
|
+
* The returned page exposes `data`, `meta`, and `nextPage()` /
|
|
96
|
+
* `autoPagingEach()` / `autoPagingToArray()` helpers. Iterate it directly
|
|
97
|
+
* with `for await` to walk every page.
|
|
98
|
+
*/
|
|
77
99
|
async executions(options = {}) {
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
100
|
+
const fetchPage = async (query) => {
|
|
101
|
+
const { data } = await listSandboxScheduleExecutions({
|
|
102
|
+
path: {
|
|
103
|
+
sandboxName: this.sandboxName,
|
|
104
|
+
},
|
|
105
|
+
query,
|
|
106
|
+
throwOnError: true,
|
|
107
|
+
});
|
|
108
|
+
return data;
|
|
109
|
+
};
|
|
110
|
+
return createPaginatedList({
|
|
111
|
+
response: await fetchPage(options),
|
|
112
|
+
fetchPage,
|
|
113
|
+
mapItem: (execution) => execution,
|
|
82
114
|
query: options,
|
|
83
|
-
throwOnError: true,
|
|
84
115
|
});
|
|
85
|
-
return unwrapPage(data);
|
|
86
116
|
}
|
|
87
117
|
}
|