@b3os/sdk 0.0.0-stage → 0.0.1
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/LICENSE +202 -0
- package/README.md +233 -2
- package/dist/cjs/core/client.d.ts +165 -0
- package/dist/cjs/core/client.js +825 -0
- package/dist/cjs/core/client.js.map +1 -0
- package/dist/cjs/core/errors.d.ts +101 -0
- package/dist/cjs/core/errors.js +249 -0
- package/dist/cjs/core/errors.js.map +1 -0
- package/dist/cjs/core/index.d.ts +12 -0
- package/dist/cjs/core/index.js +42 -0
- package/dist/cjs/core/index.js.map +1 -0
- package/dist/cjs/core/jobs.d.ts +31 -0
- package/dist/cjs/core/jobs.js +72 -0
- package/dist/cjs/core/jobs.js.map +1 -0
- package/dist/cjs/core/namespace.d.ts +7 -0
- package/dist/cjs/core/namespace.js +13 -0
- package/dist/cjs/core/namespace.js.map +1 -0
- package/dist/cjs/core/op.d.ts +47 -0
- package/dist/cjs/core/op.js +5 -0
- package/dist/cjs/core/op.js.map +1 -0
- package/dist/cjs/core/promise.d.ts +106 -0
- package/dist/cjs/core/promise.js +200 -0
- package/dist/cjs/core/promise.js.map +1 -0
- package/dist/cjs/core/response.d.ts +54 -0
- package/dist/cjs/core/response.js +92 -0
- package/dist/cjs/core/response.js.map +1 -0
- package/dist/cjs/core/sse.d.ts +79 -0
- package/dist/cjs/core/sse.js +291 -0
- package/dist/cjs/core/sse.js.map +1 -0
- package/dist/cjs/core/timing.d.ts +20 -0
- package/dist/cjs/core/timing.js +96 -0
- package/dist/cjs/core/timing.js.map +1 -0
- package/dist/cjs/core/transport.d.ts +80 -0
- package/dist/cjs/core/transport.js +472 -0
- package/dist/cjs/core/transport.js.map +1 -0
- package/dist/cjs/core/util.d.ts +25 -0
- package/dist/cjs/core/util.js +142 -0
- package/dist/cjs/core/util.js.map +1 -0
- package/dist/cjs/core/ws.d.ts +52 -0
- package/dist/cjs/core/ws.js +181 -0
- package/dist/cjs/core/ws.js.map +1 -0
- package/dist/cjs/generated/client.d.ts +62 -0
- package/dist/cjs/generated/client.js +130 -0
- package/dist/cjs/generated/client.js.map +1 -0
- package/dist/cjs/generated/errors.d.ts +4 -0
- package/dist/cjs/generated/errors.js +160 -0
- package/dist/cjs/generated/errors.js.map +1 -0
- package/dist/cjs/generated/ids.d.ts +114 -0
- package/dist/cjs/generated/ids.js +47 -0
- package/dist/cjs/generated/ids.js.map +1 -0
- package/dist/cjs/generated/jobs.d.ts +10 -0
- package/dist/cjs/generated/jobs.js +24 -0
- package/dist/cjs/generated/jobs.js.map +1 -0
- package/dist/cjs/generated/ns/actions.d.ts +161 -0
- package/dist/cjs/generated/ns/actions.js +304 -0
- package/dist/cjs/generated/ns/actions.js.map +1 -0
- package/dist/cjs/generated/ns/infer.d.ts +190 -0
- package/dist/cjs/generated/ns/infer.js +253 -0
- package/dist/cjs/generated/ns/infer.js.map +1 -0
- package/dist/cjs/generated/ns/keys.d.ts +76 -0
- package/dist/cjs/generated/ns/keys.js +144 -0
- package/dist/cjs/generated/ns/keys.js.map +1 -0
- package/dist/cjs/generated/ns/limits.d.ts +22 -0
- package/dist/cjs/generated/ns/limits.js +32 -0
- package/dist/cjs/generated/ns/limits.js.map +1 -0
- package/dist/cjs/generated/ns/orgs.d.ts +38 -0
- package/dist/cjs/generated/ns/orgs.js +68 -0
- package/dist/cjs/generated/ns/orgs.js.map +1 -0
- package/dist/cjs/generated/ns/projects.d.ts +57 -0
- package/dist/cjs/generated/ns/projects.js +115 -0
- package/dist/cjs/generated/ns/projects.js.map +1 -0
- package/dist/cjs/generated/ns/render.d.ts +159 -0
- package/dist/cjs/generated/ns/render.js +299 -0
- package/dist/cjs/generated/ns/render.js.map +1 -0
- package/dist/cjs/generated/ns/requests.d.ts +36 -0
- package/dist/cjs/generated/ns/requests.js +54 -0
- package/dist/cjs/generated/ns/requests.js.map +1 -0
- package/dist/cjs/generated/ns/routines.d.ts +212 -0
- package/dist/cjs/generated/ns/routines.js +419 -0
- package/dist/cjs/generated/ns/routines.js.map +1 -0
- package/dist/cjs/generated/ns/sandboxes.d.ts +318 -0
- package/dist/cjs/generated/ns/sandboxes.js +549 -0
- package/dist/cjs/generated/ns/sandboxes.js.map +1 -0
- package/dist/cjs/generated/ns/usage.d.ts +30 -0
- package/dist/cjs/generated/ns/usage.js +49 -0
- package/dist/cjs/generated/ns/usage.js.map +1 -0
- package/dist/cjs/generated/ns/vault.d.ts +69 -0
- package/dist/cjs/generated/ns/vault.js +122 -0
- package/dist/cjs/generated/ns/vault.js.map +1 -0
- package/dist/cjs/generated/ns/vision.d.ts +376 -0
- package/dist/cjs/generated/ns/vision.js +736 -0
- package/dist/cjs/generated/ns/vision.js.map +1 -0
- package/dist/cjs/generated/ns/webhooks.d.ts +50 -0
- package/dist/cjs/generated/ns/webhooks.js +91 -0
- package/dist/cjs/generated/ns/webhooks.js.map +1 -0
- package/dist/cjs/generated/types.d.ts +4613 -0
- package/dist/cjs/generated/types.js +4 -0
- package/dist/cjs/generated/types.js.map +1 -0
- package/dist/cjs/index.d.ts +22 -0
- package/dist/cjs/index.js +81 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/webhooks.d.ts +19 -0
- package/dist/cjs/webhooks.js +85 -0
- package/dist/cjs/webhooks.js.map +1 -0
- package/dist/esm/core/client.d.ts +165 -0
- package/dist/esm/core/client.js +821 -0
- package/dist/esm/core/client.js.map +1 -0
- package/dist/esm/core/errors.d.ts +101 -0
- package/dist/esm/core/errors.js +239 -0
- package/dist/esm/core/errors.js.map +1 -0
- package/dist/esm/core/index.d.ts +12 -0
- package/dist/esm/core/index.js +15 -0
- package/dist/esm/core/index.js.map +1 -0
- package/dist/esm/core/jobs.d.ts +31 -0
- package/dist/esm/core/jobs.js +66 -0
- package/dist/esm/core/jobs.js.map +1 -0
- package/dist/esm/core/namespace.d.ts +7 -0
- package/dist/esm/core/namespace.js +9 -0
- package/dist/esm/core/namespace.js.map +1 -0
- package/dist/esm/core/op.d.ts +47 -0
- package/dist/esm/core/op.js +4 -0
- package/dist/esm/core/op.js.map +1 -0
- package/dist/esm/core/promise.d.ts +106 -0
- package/dist/esm/core/promise.js +193 -0
- package/dist/esm/core/promise.js.map +1 -0
- package/dist/esm/core/response.d.ts +54 -0
- package/dist/esm/core/response.js +86 -0
- package/dist/esm/core/response.js.map +1 -0
- package/dist/esm/core/sse.d.ts +79 -0
- package/dist/esm/core/sse.js +286 -0
- package/dist/esm/core/sse.js.map +1 -0
- package/dist/esm/core/timing.d.ts +20 -0
- package/dist/esm/core/timing.js +92 -0
- package/dist/esm/core/timing.js.map +1 -0
- package/dist/esm/core/transport.d.ts +80 -0
- package/dist/esm/core/transport.js +465 -0
- package/dist/esm/core/transport.js.map +1 -0
- package/dist/esm/core/util.d.ts +25 -0
- package/dist/esm/core/util.js +128 -0
- package/dist/esm/core/util.js.map +1 -0
- package/dist/esm/core/ws.d.ts +52 -0
- package/dist/esm/core/ws.js +175 -0
- package/dist/esm/core/ws.js.map +1 -0
- package/dist/esm/generated/client.d.ts +62 -0
- package/dist/esm/generated/client.js +126 -0
- package/dist/esm/generated/client.js.map +1 -0
- package/dist/esm/generated/errors.d.ts +4 -0
- package/dist/esm/generated/errors.js +157 -0
- package/dist/esm/generated/errors.js.map +1 -0
- package/dist/esm/generated/ids.d.ts +114 -0
- package/dist/esm/generated/ids.js +42 -0
- package/dist/esm/generated/ids.js.map +1 -0
- package/dist/esm/generated/jobs.d.ts +10 -0
- package/dist/esm/generated/jobs.js +21 -0
- package/dist/esm/generated/jobs.js.map +1 -0
- package/dist/esm/generated/ns/actions.d.ts +161 -0
- package/dist/esm/generated/ns/actions.js +300 -0
- package/dist/esm/generated/ns/actions.js.map +1 -0
- package/dist/esm/generated/ns/infer.d.ts +190 -0
- package/dist/esm/generated/ns/infer.js +249 -0
- package/dist/esm/generated/ns/infer.js.map +1 -0
- package/dist/esm/generated/ns/keys.d.ts +76 -0
- package/dist/esm/generated/ns/keys.js +140 -0
- package/dist/esm/generated/ns/keys.js.map +1 -0
- package/dist/esm/generated/ns/limits.d.ts +22 -0
- package/dist/esm/generated/ns/limits.js +28 -0
- package/dist/esm/generated/ns/limits.js.map +1 -0
- package/dist/esm/generated/ns/orgs.d.ts +38 -0
- package/dist/esm/generated/ns/orgs.js +64 -0
- package/dist/esm/generated/ns/orgs.js.map +1 -0
- package/dist/esm/generated/ns/projects.d.ts +57 -0
- package/dist/esm/generated/ns/projects.js +111 -0
- package/dist/esm/generated/ns/projects.js.map +1 -0
- package/dist/esm/generated/ns/render.d.ts +159 -0
- package/dist/esm/generated/ns/render.js +295 -0
- package/dist/esm/generated/ns/render.js.map +1 -0
- package/dist/esm/generated/ns/requests.d.ts +36 -0
- package/dist/esm/generated/ns/requests.js +50 -0
- package/dist/esm/generated/ns/requests.js.map +1 -0
- package/dist/esm/generated/ns/routines.d.ts +212 -0
- package/dist/esm/generated/ns/routines.js +415 -0
- package/dist/esm/generated/ns/routines.js.map +1 -0
- package/dist/esm/generated/ns/sandboxes.d.ts +318 -0
- package/dist/esm/generated/ns/sandboxes.js +545 -0
- package/dist/esm/generated/ns/sandboxes.js.map +1 -0
- package/dist/esm/generated/ns/usage.d.ts +30 -0
- package/dist/esm/generated/ns/usage.js +45 -0
- package/dist/esm/generated/ns/usage.js.map +1 -0
- package/dist/esm/generated/ns/vault.d.ts +69 -0
- package/dist/esm/generated/ns/vault.js +118 -0
- package/dist/esm/generated/ns/vault.js.map +1 -0
- package/dist/esm/generated/ns/vision.d.ts +376 -0
- package/dist/esm/generated/ns/vision.js +732 -0
- package/dist/esm/generated/ns/vision.js.map +1 -0
- package/dist/esm/generated/ns/webhooks.d.ts +50 -0
- package/dist/esm/generated/ns/webhooks.js +87 -0
- package/dist/esm/generated/ns/webhooks.js.map +1 -0
- package/dist/esm/generated/types.d.ts +4613 -0
- package/dist/esm/generated/types.js +3 -0
- package/dist/esm/generated/types.js.map +1 -0
- package/dist/esm/index.d.ts +22 -0
- package/dist/esm/index.js +28 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/webhooks.d.ts +19 -0
- package/dist/esm/webhooks.js +79 -0
- package/dist/esm/webhooks.js.map +1 -0
- package/package.json +98 -4
- package/src/core/client.ts +1022 -0
- package/src/core/errors.ts +296 -0
- package/src/core/index.ts +45 -0
- package/src/core/jobs.ts +94 -0
- package/src/core/namespace.ts +10 -0
- package/src/core/op.ts +53 -0
- package/src/core/promise.ts +268 -0
- package/src/core/response.ts +115 -0
- package/src/core/sse.ts +305 -0
- package/src/core/timing.ts +106 -0
- package/src/core/transport.ts +489 -0
- package/src/core/util.ts +138 -0
- package/src/core/ws.ts +215 -0
- package/src/generated/client.ts +143 -0
- package/src/generated/errors.ts +313 -0
- package/src/generated/ids.ts +47 -0
- package/src/generated/jobs.ts +25 -0
- package/src/generated/ns/actions.ts +353 -0
- package/src/generated/ns/infer.ts +332 -0
- package/src/generated/ns/keys.ts +152 -0
- package/src/generated/ns/limits.ts +35 -0
- package/src/generated/ns/orgs.ts +77 -0
- package/src/generated/ns/projects.ts +122 -0
- package/src/generated/ns/render.ts +348 -0
- package/src/generated/ns/requests.ts +61 -0
- package/src/generated/ns/routines.ts +474 -0
- package/src/generated/ns/sandboxes.ts +671 -0
- package/src/generated/ns/usage.ts +56 -0
- package/src/generated/ns/vault.ts +136 -0
- package/src/generated/ns/vision.ts +836 -0
- package/src/generated/ns/webhooks.ts +100 -0
- package/src/generated/types.ts +5131 -0
- package/src/index.ts +30 -0
- package/src/webhooks.ts +100 -0
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
// Generated by packages/sdk/scripts/generate.mjs from packages/spec/dist. Do not edit; run `pnpm generate`.
|
|
2
|
+
import { isTerminalJobEvent } from "../../core/jobs.js";
|
|
3
|
+
import { Namespace } from "../../core/namespace.js";
|
|
4
|
+
const getArtifactOp = {
|
|
5
|
+
id: "renderGetArtifact",
|
|
6
|
+
method: "GET",
|
|
7
|
+
path: "/v1/render/artifacts/{artifact_id}",
|
|
8
|
+
params: ["artifact_id"],
|
|
9
|
+
timeoutMs: 10000,
|
|
10
|
+
scope: "render:read",
|
|
11
|
+
};
|
|
12
|
+
const listPresetsOp = {
|
|
13
|
+
id: "renderListPresets",
|
|
14
|
+
method: "GET",
|
|
15
|
+
path: "/v1/render/presets",
|
|
16
|
+
timeoutMs: 10000,
|
|
17
|
+
scope: "render:read",
|
|
18
|
+
};
|
|
19
|
+
const listScreenshotsOp = {
|
|
20
|
+
id: "renderListScreenshots",
|
|
21
|
+
method: "GET",
|
|
22
|
+
path: "/v1/render/screenshots",
|
|
23
|
+
timeoutMs: 10000,
|
|
24
|
+
scope: "render:read",
|
|
25
|
+
};
|
|
26
|
+
const createScreenshotOp = {
|
|
27
|
+
id: "renderCreateScreenshot",
|
|
28
|
+
method: "POST",
|
|
29
|
+
path: "/v1/render/screenshots",
|
|
30
|
+
body: "json",
|
|
31
|
+
idem: true,
|
|
32
|
+
timeoutMs: 65000,
|
|
33
|
+
scope: "render:run",
|
|
34
|
+
};
|
|
35
|
+
const deleteScreenshotOp = {
|
|
36
|
+
id: "renderDeleteScreenshot",
|
|
37
|
+
method: "DELETE",
|
|
38
|
+
path: "/v1/render/screenshots/{screenshot_id}",
|
|
39
|
+
params: ["screenshot_id"],
|
|
40
|
+
timeoutMs: 10000,
|
|
41
|
+
scope: "render:write",
|
|
42
|
+
};
|
|
43
|
+
const getScreenshotOp = {
|
|
44
|
+
id: "renderGetScreenshot",
|
|
45
|
+
method: "GET",
|
|
46
|
+
path: "/v1/render/screenshots/{screenshot_id}",
|
|
47
|
+
params: ["screenshot_id"],
|
|
48
|
+
timeoutMs: 10000,
|
|
49
|
+
scope: "render:read",
|
|
50
|
+
};
|
|
51
|
+
const listVideosOp = {
|
|
52
|
+
id: "renderListVideos",
|
|
53
|
+
method: "GET",
|
|
54
|
+
path: "/v1/render/videos",
|
|
55
|
+
timeoutMs: 10000,
|
|
56
|
+
scope: "render:read",
|
|
57
|
+
};
|
|
58
|
+
const deleteVideoOp = {
|
|
59
|
+
id: "renderDeleteVideo",
|
|
60
|
+
method: "DELETE",
|
|
61
|
+
path: "/v1/render/videos/{video_id}",
|
|
62
|
+
params: ["video_id"],
|
|
63
|
+
timeoutMs: 10000,
|
|
64
|
+
scope: "render:write",
|
|
65
|
+
};
|
|
66
|
+
const getVideoOp = {
|
|
67
|
+
id: "renderGetVideo",
|
|
68
|
+
method: "GET",
|
|
69
|
+
path: "/v1/render/videos/{video_id}",
|
|
70
|
+
params: ["video_id"],
|
|
71
|
+
timeoutMs: 10000,
|
|
72
|
+
scope: "render:read",
|
|
73
|
+
};
|
|
74
|
+
const cancelVideoOp = {
|
|
75
|
+
id: "renderCancelVideo",
|
|
76
|
+
method: "POST",
|
|
77
|
+
path: "/v1/render/videos/{video_id}/cancel",
|
|
78
|
+
params: ["video_id"],
|
|
79
|
+
timeoutMs: 10000,
|
|
80
|
+
scope: "render:run",
|
|
81
|
+
};
|
|
82
|
+
const videoEventsOp = {
|
|
83
|
+
id: "renderVideoEvents",
|
|
84
|
+
method: "GET",
|
|
85
|
+
path: "/v1/render/videos/{video_id}/events",
|
|
86
|
+
params: ["video_id"],
|
|
87
|
+
stream: "sse",
|
|
88
|
+
timeoutMs: 3600000,
|
|
89
|
+
scope: "render:read",
|
|
90
|
+
};
|
|
91
|
+
const getVideoTimelineOp = {
|
|
92
|
+
id: "renderGetVideoTimeline",
|
|
93
|
+
method: "GET",
|
|
94
|
+
path: "/v1/render/videos/{video_id}/timeline",
|
|
95
|
+
params: ["video_id"],
|
|
96
|
+
timeoutMs: 15000,
|
|
97
|
+
scope: "render:read",
|
|
98
|
+
};
|
|
99
|
+
const createVideoOp = {
|
|
100
|
+
id: "renderCreateVideo",
|
|
101
|
+
method: "POST",
|
|
102
|
+
path: "/v1/render/videos",
|
|
103
|
+
body: "json",
|
|
104
|
+
idem: true,
|
|
105
|
+
stream: "sse",
|
|
106
|
+
timeoutMs: 3600000,
|
|
107
|
+
scope: "render:run",
|
|
108
|
+
job: { get: getVideoOp, events: videoEventsOp, cancel: cancelVideoOp },
|
|
109
|
+
};
|
|
110
|
+
const restyleVideoOp = {
|
|
111
|
+
id: "renderRestyleVideo",
|
|
112
|
+
method: "POST",
|
|
113
|
+
path: "/v1/render/videos/{video_id}/restyle",
|
|
114
|
+
params: ["video_id"],
|
|
115
|
+
body: "json",
|
|
116
|
+
idem: true,
|
|
117
|
+
stream: "sse",
|
|
118
|
+
timeoutMs: 3600000,
|
|
119
|
+
scope: "render:run",
|
|
120
|
+
job: { get: getVideoOp, events: videoEventsOp, cancel: cancelVideoOp },
|
|
121
|
+
};
|
|
122
|
+
/** Descriptors of every render operation, keyed by method name (for tooling and custom clients). */
|
|
123
|
+
export const renderOps = {
|
|
124
|
+
getArtifact: getArtifactOp,
|
|
125
|
+
listPresets: listPresetsOp,
|
|
126
|
+
listScreenshots: listScreenshotsOp,
|
|
127
|
+
createScreenshot: createScreenshotOp,
|
|
128
|
+
deleteScreenshot: deleteScreenshotOp,
|
|
129
|
+
getScreenshot: getScreenshotOp,
|
|
130
|
+
listVideos: listVideosOp,
|
|
131
|
+
createVideo: createVideoOp,
|
|
132
|
+
deleteVideo: deleteVideoOp,
|
|
133
|
+
getVideo: getVideoOp,
|
|
134
|
+
cancelVideo: cancelVideoOp,
|
|
135
|
+
videoEvents: videoEventsOp,
|
|
136
|
+
restyleVideo: restyleVideoOp,
|
|
137
|
+
getVideoTimeline: getVideoTimelineOp,
|
|
138
|
+
};
|
|
139
|
+
/** Styled screenshots and product videos (`/v1/render`). */
|
|
140
|
+
export class RenderAPI extends Namespace {
|
|
141
|
+
/**
|
|
142
|
+
* Get an artifact
|
|
143
|
+
*
|
|
144
|
+
* Returns an artifact's metadata with a fresh signed URL (valid for 24 hours). The URL needs no credentials and
|
|
145
|
+
* is safe to embed: it works for anyone who has it until `url_expires_at`, and the bytes are always served with
|
|
146
|
+
* `Content-Security-Policy: sandbox` (URL format: `renderGetArtifactContent`).
|
|
147
|
+
*
|
|
148
|
+
* `GET /v1/render/artifacts/{artifact_id}` · scope `render:read` · served by the node
|
|
149
|
+
*/
|
|
150
|
+
getArtifact(artifactId, options) {
|
|
151
|
+
return this._client._call(getArtifactOp, { path: [artifactId] }, options);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* List style presets
|
|
155
|
+
*
|
|
156
|
+
* Lists the style presets `style` can name (backgrounds, window frames, cursors, caption styles, click effects), with a preview image for each.
|
|
157
|
+
*
|
|
158
|
+
* `GET /v1/render/presets` · scope `render:read` · served by the node
|
|
159
|
+
*/
|
|
160
|
+
listPresets(params, options) {
|
|
161
|
+
return this._client._call(listPresetsOp, { query: params }, options);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* List screenshots
|
|
165
|
+
*
|
|
166
|
+
* Lists screenshots in this project, newest first. Screenshots are kept for 7 days.
|
|
167
|
+
*
|
|
168
|
+
* `GET /v1/render/screenshots` · scope `render:read` · served by the node
|
|
169
|
+
*/
|
|
170
|
+
listScreenshots(params, options) {
|
|
171
|
+
return this._client._list(listScreenshotsOp, { query: params }, options);
|
|
172
|
+
}
|
|
173
|
+
createScreenshot(body, options = {}) {
|
|
174
|
+
const { accept, ...rest } = options;
|
|
175
|
+
if (accept && accept !== "application/json") {
|
|
176
|
+
return this._client._call(createScreenshotOp, { body }, rest, accept, "bytes");
|
|
177
|
+
}
|
|
178
|
+
return this._client._call(createScreenshotOp, { body }, rest);
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Delete a screenshot
|
|
182
|
+
*
|
|
183
|
+
* Deletes the screenshot and its artifacts. Signed URLs stop working within a minute.
|
|
184
|
+
*
|
|
185
|
+
* `DELETE /v1/render/screenshots/{screenshot_id}` · scope `render:write` · served by the node
|
|
186
|
+
*/
|
|
187
|
+
deleteScreenshot(screenshotId, options) {
|
|
188
|
+
return this._client._call(deleteScreenshotOp, { path: [screenshotId] }, options);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Get a screenshot
|
|
192
|
+
*
|
|
193
|
+
* Returns the screenshot with fresh signed URLs for its artifacts.
|
|
194
|
+
*
|
|
195
|
+
* `GET /v1/render/screenshots/{screenshot_id}` · scope `render:read` · served by the node
|
|
196
|
+
*/
|
|
197
|
+
getScreenshot(screenshotId, options) {
|
|
198
|
+
return this._client._call(getScreenshotOp, { path: [screenshotId] }, options);
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* List videos
|
|
202
|
+
*
|
|
203
|
+
* Lists videos in this project, newest first. Videos and their artifacts are kept for 7 days.
|
|
204
|
+
*
|
|
205
|
+
* `GET /v1/render/videos` · scope `render:read` · served by the node
|
|
206
|
+
*/
|
|
207
|
+
listVideos(params, options) {
|
|
208
|
+
return this._client._list(listVideosOp, { query: params }, options);
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Record a video
|
|
212
|
+
*
|
|
213
|
+
* Starts a job that records a scripted demo of `source.url`. Narration (`say`) is synthesized first with
|
|
214
|
+
* `/v1/infer/audio/speech`; the director then places each beat's steps on its narration, plans cursor and
|
|
215
|
+
* camera, records segments in parallel on a virtual clock, composes at the output frame rate and encodes MP4
|
|
216
|
+
* (H.264, BT.709), GIF, poster and captions. Artifacts appear as they finish (`video.artifact` events, poster
|
|
217
|
+
* first). Bills `render.video_s` per second of output.
|
|
218
|
+
*
|
|
219
|
+
* `POST /v1/render/videos` · scope `render:run` · served by the node
|
|
220
|
+
*/
|
|
221
|
+
createVideo(body, options) {
|
|
222
|
+
return this._client._job(createVideoOp, { body }, options);
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Delete a video
|
|
226
|
+
*
|
|
227
|
+
* Cancels the job if it is still running, then deletes the video, its artifacts and its archived capture.
|
|
228
|
+
*
|
|
229
|
+
* `DELETE /v1/render/videos/{video_id}` · scope `render:write` · served by the node
|
|
230
|
+
*/
|
|
231
|
+
deleteVideo(videoId, options) {
|
|
232
|
+
return this._client._call(deleteVideoOp, { path: [videoId] }, options);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Get a video
|
|
236
|
+
*
|
|
237
|
+
* Returns the video job; once it succeeded, `result.artifacts` lists its files with fresh signed URLs.
|
|
238
|
+
*
|
|
239
|
+
* `GET /v1/render/videos/{video_id}` · scope `render:read` · served by the node
|
|
240
|
+
*/
|
|
241
|
+
getVideo(videoId, options) {
|
|
242
|
+
return this._client._call(getVideoOp, { path: [videoId] }, options);
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Cancel a video
|
|
246
|
+
*
|
|
247
|
+
* Stops the job. Artifacts already produced are kept; seconds already encoded are billed.
|
|
248
|
+
*
|
|
249
|
+
* `POST /v1/render/videos/{video_id}/cancel` · scope `render:run` · served by the node
|
|
250
|
+
*/
|
|
251
|
+
cancelVideo(videoId, options) {
|
|
252
|
+
return this._client._call(cancelVideoOp, { path: [videoId] }, options);
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Stream a video's events
|
|
256
|
+
*
|
|
257
|
+
* Server-sent events for the video job: lifecycle events, `video.phase` as the job moves through voice, plan,
|
|
258
|
+
* capture, compose, encode and upload, and `video.artifact` as each file becomes available. Ends after the
|
|
259
|
+
* terminal event; reconnect with `Last-Event-ID` to resume.
|
|
260
|
+
*
|
|
261
|
+
* `GET /v1/render/videos/{video_id}/events` · scope `render:read` · served by the node
|
|
262
|
+
*/
|
|
263
|
+
videoEvents(videoId, options) {
|
|
264
|
+
return this._client._stream(videoEventsOp, { path: [videoId] }, options, {
|
|
265
|
+
terminal: isTerminalJobEvent,
|
|
266
|
+
reconnectOnEnd: true,
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Restyle a video
|
|
271
|
+
*
|
|
272
|
+
* Starts a job that re-composes the source video's archived raw capture with a new style, captions, output
|
|
273
|
+
* size or formats. No browser runs and narration is reused, so it takes seconds. Camera moves are not
|
|
274
|
+
* changed. The result is a new video (`restyled_from` names the source). The raw capture is kept as long as
|
|
275
|
+
* the source video (7 days).
|
|
276
|
+
*
|
|
277
|
+
* `POST /v1/render/videos/{video_id}/restyle` · scope `render:run` · served by the node
|
|
278
|
+
*/
|
|
279
|
+
restyleVideo(videoId, body, options) {
|
|
280
|
+
return this._client._job(restyleVideoOp, { path: [videoId], body }, options);
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Get a video's timeline
|
|
284
|
+
*
|
|
285
|
+
* Returns the compiled timeline of a video that has finished planning: beats, narration with word timings,
|
|
286
|
+
* the timed action list the recorder replayed, cursor path, camera keyframes, captions and style
|
|
287
|
+
* (`timeline.schema.json`). `frames=1` adds the per-frame compositor state (large; for debugging).
|
|
288
|
+
*
|
|
289
|
+
* `GET /v1/render/videos/{video_id}/timeline` · scope `render:read` · served by the node
|
|
290
|
+
*/
|
|
291
|
+
getVideoTimeline(videoId, params, options) {
|
|
292
|
+
return this._client._call(getVideoTimelineOp, { path: [videoId], query: params }, options);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../../../src/generated/ns/render.ts"],"names":[],"mappings":"AAAA,4GAA4G;AAG5G,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAMpD,MAAM,aAAa,GAAO;IACxB,EAAE,EAAE,mBAAmB;IACvB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,oCAAoC;IAC1C,MAAM,EAAE,CAAC,aAAa,CAAC;IACvB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,aAAa;CACrB,CAAC;AACF,MAAM,aAAa,GAAO;IACxB,EAAE,EAAE,mBAAmB;IACvB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,oBAAoB;IAC1B,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,aAAa;CACrB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|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { RequestOptions } from "../../core/client.ts";
|
|
2
|
+
import { Namespace } from "../../core/namespace.ts";
|
|
3
|
+
import type { Op } from "../../core/op.ts";
|
|
4
|
+
import type { APIPromise, ListPromise } from "../../core/promise.ts";
|
|
5
|
+
import type * as T from "../types.ts";
|
|
6
|
+
/** Descriptors of every requests operation, keyed by method name (for tooling and custom clients). */
|
|
7
|
+
export declare const requestsOps: {
|
|
8
|
+
readonly listRequests: Op;
|
|
9
|
+
readonly getRequest: Op;
|
|
10
|
+
};
|
|
11
|
+
/** The node's request log with full phase timing (`/v1/requests`). */
|
|
12
|
+
export declare class RequestsAPI extends Namespace {
|
|
13
|
+
/**
|
|
14
|
+
* List requests
|
|
15
|
+
*
|
|
16
|
+
* Lists the requests the node served for your project in the last 7 days, newest first, over every connection
|
|
17
|
+
* kind, filterable by product, operation, status, key, connection kind and sandbox. Requests the edge answered
|
|
18
|
+
* without forwarding them (edge-served operations, or requests refused before forwarding) are not listed; get
|
|
19
|
+
* those by ID. The edge forwards this operation and merges its `edge_*` phases into each record.
|
|
20
|
+
*
|
|
21
|
+
* `GET /v1/requests` · scope `platform:read` · served by the node
|
|
22
|
+
*/
|
|
23
|
+
listRequests(params?: T.PlatformListRequestsParams, options?: RequestOptions): ListPromise<T.RequestRecordList, T.RequestRecord>;
|
|
24
|
+
/**
|
|
25
|
+
* Get a request
|
|
26
|
+
*
|
|
27
|
+
* Returns one request with its full phase breakdown: the node's phases (its `Server-Timing` phases, or the final
|
|
28
|
+
* phases of a stream) and the edge's `edge_auth` and `edge_upstream`, which the edge merges in under the same
|
|
29
|
+
* request ID. Use the `x-request-id` of any response, or a problem's `instance`. For a request the edge answered
|
|
30
|
+
* itself (an edge-served operation, or one refused before forwarding), the edge returns its own record: `node`
|
|
31
|
+
* is `null` and only edge phases are listed.
|
|
32
|
+
*
|
|
33
|
+
* `GET /v1/requests/{request_id}` · scope `platform:read` · served by the node
|
|
34
|
+
*/
|
|
35
|
+
getRequest(requestId: string, options?: RequestOptions): APIPromise<T.RequestRecord>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Generated by packages/sdk/scripts/generate.mjs from packages/spec/dist. Do not edit; run `pnpm generate`.
|
|
2
|
+
import { Namespace } from "../../core/namespace.js";
|
|
3
|
+
const listRequestsOp = {
|
|
4
|
+
id: "platformListRequests",
|
|
5
|
+
method: "GET",
|
|
6
|
+
path: "/v1/requests",
|
|
7
|
+
timeoutMs: 15000,
|
|
8
|
+
scope: "platform:read",
|
|
9
|
+
};
|
|
10
|
+
const getRequestOp = {
|
|
11
|
+
id: "platformGetRequest",
|
|
12
|
+
method: "GET",
|
|
13
|
+
path: "/v1/requests/{request_id}",
|
|
14
|
+
params: ["request_id"],
|
|
15
|
+
timeoutMs: 10000,
|
|
16
|
+
scope: "platform:read",
|
|
17
|
+
};
|
|
18
|
+
/** Descriptors of every requests operation, keyed by method name (for tooling and custom clients). */
|
|
19
|
+
export const requestsOps = { listRequests: listRequestsOp, getRequest: getRequestOp };
|
|
20
|
+
/** The node's request log with full phase timing (`/v1/requests`). */
|
|
21
|
+
export class RequestsAPI extends Namespace {
|
|
22
|
+
/**
|
|
23
|
+
* List requests
|
|
24
|
+
*
|
|
25
|
+
* Lists the requests the node served for your project in the last 7 days, newest first, over every connection
|
|
26
|
+
* kind, filterable by product, operation, status, key, connection kind and sandbox. Requests the edge answered
|
|
27
|
+
* without forwarding them (edge-served operations, or requests refused before forwarding) are not listed; get
|
|
28
|
+
* those by ID. The edge forwards this operation and merges its `edge_*` phases into each record.
|
|
29
|
+
*
|
|
30
|
+
* `GET /v1/requests` · scope `platform:read` · served by the node
|
|
31
|
+
*/
|
|
32
|
+
listRequests(params, options) {
|
|
33
|
+
return this._client._list(listRequestsOp, { query: params }, options);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get a request
|
|
37
|
+
*
|
|
38
|
+
* Returns one request with its full phase breakdown: the node's phases (its `Server-Timing` phases, or the final
|
|
39
|
+
* phases of a stream) and the edge's `edge_auth` and `edge_upstream`, which the edge merges in under the same
|
|
40
|
+
* request ID. Use the `x-request-id` of any response, or a problem's `instance`. For a request the edge answered
|
|
41
|
+
* itself (an edge-served operation, or one refused before forwarding), the edge returns its own record: `node`
|
|
42
|
+
* is `null` and only edge phases are listed.
|
|
43
|
+
*
|
|
44
|
+
* `GET /v1/requests/{request_id}` · scope `platform:read` · served by the node
|
|
45
|
+
*/
|
|
46
|
+
getRequest(requestId, options) {
|
|
47
|
+
return this._client._call(getRequestOp, { path: [requestId] }, options);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=requests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requests.js","sourceRoot":"","sources":["../../../../src/generated/ns/requests.ts"],"names":[],"mappings":"AAAA,4GAA4G;AAG5G,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAKpD,MAAM,cAAc,GAAO;IACzB,EAAE,EAAE,sBAAsB;IAC1B,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,cAAc;IACpB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,eAAe;CACvB,CAAC;AACF,MAAM,YAAY,GAAO;IACvB,EAAE,EAAE,oBAAoB;IACxB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,2BAA2B;IACjC,MAAM,EAAE,CAAC,YAAY,CAAC;IACtB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,eAAe;CACvB,CAAC;AAEF,sGAAsG;AACtG,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAW,CAAC;AAE/F,sEAAsE;AACtE,MAAM,OAAO,WAAY,SAAQ,SAAS;IACxC;;;;;;;;;OASG;IACH,YAAY,CACV,MAAqC,EACrC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAuC,cAAc,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9G,CAAC;IAED;;;;;;;;;;OAUG;IACH,UAAU,CAAC,SAAiB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAkB,YAAY,EAAE,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAC3F,CAAC;CACF"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import type { RequestOptions, StreamOptions } from "../../core/client.ts";
|
|
2
|
+
import { Namespace } from "../../core/namespace.ts";
|
|
3
|
+
import type { Op } from "../../core/op.ts";
|
|
4
|
+
import type { APIPromise, JobPromise, ListPromise } from "../../core/promise.ts";
|
|
5
|
+
import type { EventStream } from "../../core/sse.ts";
|
|
6
|
+
import type * as T from "../types.ts";
|
|
7
|
+
/** Descriptors of every routines operation, keyed by method name (for tooling and custom clients). */
|
|
8
|
+
export declare const routinesOps: {
|
|
9
|
+
readonly listRoutines: Op;
|
|
10
|
+
readonly createRoutine: Op;
|
|
11
|
+
readonly importRoutine: Op;
|
|
12
|
+
readonly getRun: Op;
|
|
13
|
+
readonly cancelRun: Op;
|
|
14
|
+
readonly runEvents: Op;
|
|
15
|
+
readonly signalRun: Op;
|
|
16
|
+
readonly listRunSteps: Op;
|
|
17
|
+
readonly validateRoutine: Op;
|
|
18
|
+
readonly deleteRoutine: Op;
|
|
19
|
+
readonly getRoutine: Op;
|
|
20
|
+
readonly updateRoutine: Op;
|
|
21
|
+
readonly publishRoutine: Op;
|
|
22
|
+
readonly rotateHookSecret: Op;
|
|
23
|
+
readonly rollbackRoutine: Op;
|
|
24
|
+
readonly listRuns: Op;
|
|
25
|
+
readonly createRun: Op;
|
|
26
|
+
readonly listVersions: Op;
|
|
27
|
+
readonly getVersion: Op;
|
|
28
|
+
};
|
|
29
|
+
/** Durable workflows: definitions, versions, runs and their events (`/v1/routines`). */
|
|
30
|
+
export declare class RoutinesAPI extends Namespace {
|
|
31
|
+
/**
|
|
32
|
+
* List routines
|
|
33
|
+
*
|
|
34
|
+
* Lists routines in this project, most recently updated first.
|
|
35
|
+
*
|
|
36
|
+
* `GET /v1/routines` · scope `routines:read` · served by the node
|
|
37
|
+
*/
|
|
38
|
+
listRoutines(params?: T.RoutinesListRoutinesParams, options?: RequestOptions): ListPromise<T.RoutineList, T.Routine>;
|
|
39
|
+
/**
|
|
40
|
+
* Create a routine
|
|
41
|
+
*
|
|
42
|
+
* Compiles and publishes a new routine as version 1. The body is the routine definition, as JSON or as YAML
|
|
43
|
+
* (`Content-Type: application/yaml`). Fails with `routine_invalid` (pointers into the definition) when it does
|
|
44
|
+
* not compile, and with `routine_name_taken` when the name exists; `PUT /v1/routines/{routine}` creates or
|
|
45
|
+
* updates by name instead. Webhook triggers verified with the `b3os` scheme get a signing secret that is
|
|
46
|
+
* returned in this response only.
|
|
47
|
+
*
|
|
48
|
+
* `POST /v1/routines` · scope `routines:write` · served by the node
|
|
49
|
+
*/
|
|
50
|
+
createRoutine(body: T.RoutineDefinition | string, options?: RequestOptions): APIPromise<T.Routine>;
|
|
51
|
+
/**
|
|
52
|
+
* Convert a B3OS workflow
|
|
53
|
+
*
|
|
54
|
+
* Converts a workflow from the original B3OS JSON node tree into a routine definition and returns it with
|
|
55
|
+
* diagnostics for anything that did not map (unsupported nodes, actions without a pack, connectors to bind).
|
|
56
|
+
* Nothing is created; publish the result with `PUT /v1/routines/{routine}`.
|
|
57
|
+
*
|
|
58
|
+
* `POST /v1/routines/import` · scope `routines:write` · served by the node
|
|
59
|
+
*/
|
|
60
|
+
importRoutine(body: T.RoutineImportRequest, options?: RequestOptions): APIPromise<T.RoutineImport>;
|
|
61
|
+
/**
|
|
62
|
+
* Get a run
|
|
63
|
+
*
|
|
64
|
+
* Returns the run with its status, input, result and the state of every top-level step (map items are summarized; list them with `…/steps`).
|
|
65
|
+
*
|
|
66
|
+
* `GET /v1/routines/runs/{run_id}` · scope `routines:read` · served by the node
|
|
67
|
+
*/
|
|
68
|
+
getRun(runId: string, options?: RequestOptions): APIPromise<T.RoutineRun>;
|
|
69
|
+
/**
|
|
70
|
+
* Cancel a run
|
|
71
|
+
*
|
|
72
|
+
* Cancels the run. In-flight steps are told to stop; steps that already had effects are not undone. The run ends `canceled` with `job_canceled`.
|
|
73
|
+
*
|
|
74
|
+
* `POST /v1/routines/runs/{run_id}/cancel` · scope `routines:run` · served by the node
|
|
75
|
+
*/
|
|
76
|
+
cancelRun(runId: string, options?: RequestOptions): APIPromise<T.RoutineRun>;
|
|
77
|
+
/**
|
|
78
|
+
* Stream a run's events
|
|
79
|
+
*
|
|
80
|
+
* Server-sent events for the run: lifecycle events, `step.*` events as steps start, retry, wait and finish,
|
|
81
|
+
* and `run.log` from `core/log` steps. Ends after the terminal event; reconnect with `Last-Event-ID` to resume
|
|
82
|
+
* (events are kept with the run history).
|
|
83
|
+
*
|
|
84
|
+
* `GET /v1/routines/runs/{run_id}/events` · scope `routines:read` · served by the node
|
|
85
|
+
*/
|
|
86
|
+
runEvents(runId: string, options?: StreamOptions): EventStream<T.RunEvent>;
|
|
87
|
+
/**
|
|
88
|
+
* Send a signal to a run
|
|
89
|
+
*
|
|
90
|
+
* Delivers a named signal to the run. A `wait` step waiting for it completes with `payload` as its outputs; a
|
|
91
|
+
* signal sent before its step starts waiting is buffered (up to 16 per name) and consumed in order. Fails with
|
|
92
|
+
* `run_not_waiting` when the run already finished or the buffer for this name is full.
|
|
93
|
+
*
|
|
94
|
+
* `POST /v1/routines/runs/{run_id}/signal` · scope `routines:run` · served by the node
|
|
95
|
+
*/
|
|
96
|
+
signalRun(runId: string, body: T.SignalRequest, options?: RequestOptions): APIPromise<T.RoutineRun>;
|
|
97
|
+
/**
|
|
98
|
+
* List a run's steps
|
|
99
|
+
*
|
|
100
|
+
* Lists every step execution of the run in start order, including each map item (`item_index`) and retries (`attempt`), with outputs and errors.
|
|
101
|
+
*
|
|
102
|
+
* `GET /v1/routines/runs/{run_id}/steps` · scope `routines:read` · served by the node
|
|
103
|
+
*/
|
|
104
|
+
listRunSteps(runId: string, params?: T.RoutinesListRunStepsParams, options?: RequestOptions): ListPromise<T.StepRunList, T.StepRun>;
|
|
105
|
+
/**
|
|
106
|
+
* Validate a definition
|
|
107
|
+
*
|
|
108
|
+
* Compiles a definition without publishing it and returns every diagnostic with a JSON pointer: schema errors,
|
|
109
|
+
* unknown callables and step references, dependency cycles, CEL type errors and input mismatches against the
|
|
110
|
+
* callables' schemas. Always answers 200; check `valid`. Use it while an agent writes a routine.
|
|
111
|
+
*
|
|
112
|
+
* `POST /v1/routines/validate` · scope `routines:write` · served by the node
|
|
113
|
+
*/
|
|
114
|
+
validateRoutine(body: T.RoutineDefinition, options?: RequestOptions): APIPromise<T.RoutineValidation>;
|
|
115
|
+
/**
|
|
116
|
+
* Delete a routine
|
|
117
|
+
*
|
|
118
|
+
* Deletes the routine, removes its triggers, hooks and trigger subscriptions, and cancels its active runs. Run
|
|
119
|
+
* history stays readable for 30 days.
|
|
120
|
+
*
|
|
121
|
+
* `DELETE /v1/routines/{routine}` · scope `routines:write` · served by the node
|
|
122
|
+
*/
|
|
123
|
+
deleteRoutine(routine: string, options?: RequestOptions): APIPromise<T.Deleted>;
|
|
124
|
+
/**
|
|
125
|
+
* Get a routine
|
|
126
|
+
*
|
|
127
|
+
* Returns the routine by ID or name, with its active version, triggers and the identity its runs use.
|
|
128
|
+
*
|
|
129
|
+
* `GET /v1/routines/{routine}` · scope `routines:read` · served by the node
|
|
130
|
+
*/
|
|
131
|
+
getRoutine(routine: string, options?: RequestOptions): APIPromise<T.Routine>;
|
|
132
|
+
/**
|
|
133
|
+
* Pause, resume or label a routine
|
|
134
|
+
*
|
|
135
|
+
* `paused: true` stops every trigger of the routine (API runs still work); `false` resumes them. Resuming a
|
|
136
|
+
* routine paused because its publishing key was revoked fails until a new version is published with a valid
|
|
137
|
+
* key. Also replaces `metadata`.
|
|
138
|
+
*
|
|
139
|
+
* `PATCH /v1/routines/{routine}` · scope `routines:write` · served by the node
|
|
140
|
+
*/
|
|
141
|
+
updateRoutine(routine: string, body: T.RoutineUpdateRequest, options?: RequestOptions): APIPromise<T.Routine>;
|
|
142
|
+
/**
|
|
143
|
+
* Publish a routine version
|
|
144
|
+
*
|
|
145
|
+
* Compiles the definition and publishes it as a new immutable version that becomes active at once: triggers
|
|
146
|
+
* switch atomically, runs already in progress keep the version they started with. `{routine}` is an ID or a
|
|
147
|
+
* name; a name that does not exist creates the routine (`201`), which makes `b3os routine deploy` idempotent.
|
|
148
|
+
* The definition's `name` must match a name in the path. The publishing key becomes the routine's `run_as`
|
|
149
|
+
* identity and its scopes are snapshotted. Hook IDs stay the same across versions for the same trigger ID.
|
|
150
|
+
* Pack triggers (`type: action`) are subscriptions: publishing creates or updates one trigger subscription
|
|
151
|
+
* (`tsub_`, read-only at `GET /v1/actions/subscriptions`) per action trigger, and removes the subscriptions of
|
|
152
|
+
* action triggers the new version no longer has.
|
|
153
|
+
*
|
|
154
|
+
* `PUT /v1/routines/{routine}` · scope `routines:write` · served by the node
|
|
155
|
+
*/
|
|
156
|
+
publishRoutine(routine: string, body: T.RoutineDefinition | string, options?: RequestOptions): APIPromise<T.Routine>;
|
|
157
|
+
/**
|
|
158
|
+
* Rotate a hook's signing secret
|
|
159
|
+
*
|
|
160
|
+
* Issues a new signing secret for a webhook trigger verified with the `b3os` scheme and returns it once. The
|
|
161
|
+
* previous secret keeps verifying deliveries for `grace_s` seconds (default one day) so senders can switch.
|
|
162
|
+
*
|
|
163
|
+
* `POST /v1/routines/{routine}/hooks/{hook_id}/rotate` · scope `routines:write` · served by the node
|
|
164
|
+
*/
|
|
165
|
+
rotateHookSecret(routine: string, hookId: string, body?: T.HookRotateRequest, options?: RequestOptions): APIPromise<T.HookSecret>;
|
|
166
|
+
/**
|
|
167
|
+
* Roll back to a version
|
|
168
|
+
*
|
|
169
|
+
* Makes an earlier version active again (triggers switch atomically). Running runs keep their version. The
|
|
170
|
+
* rollback is recorded as the routine's update; no new version is created. Trigger subscriptions follow the
|
|
171
|
+
* version: those of action triggers the earlier version does not have are removed, and the others are updated
|
|
172
|
+
* to its definition.
|
|
173
|
+
*
|
|
174
|
+
* `POST /v1/routines/{routine}/rollback` · scope `routines:write` · served by the node
|
|
175
|
+
*/
|
|
176
|
+
rollbackRoutine(routine: string, body: T.RollbackRequest, options?: RequestOptions): APIPromise<T.Routine>;
|
|
177
|
+
/**
|
|
178
|
+
* List a routine's runs
|
|
179
|
+
*
|
|
180
|
+
* Lists runs of the routine, newest first. Run history is kept for 30 days.
|
|
181
|
+
*
|
|
182
|
+
* `GET /v1/routines/{routine}/runs` · scope `routines:read` · served by the node
|
|
183
|
+
*/
|
|
184
|
+
listRuns(routine: string, params?: T.RoutinesListRunsParams, options?: RequestOptions): ListPromise<T.RoutineRunList, T.RoutineRun>;
|
|
185
|
+
/**
|
|
186
|
+
* Run a routine
|
|
187
|
+
*
|
|
188
|
+
* Starts a run of the active version (or `version`) with `input`, validated against the routine's `inputs`
|
|
189
|
+
* schema. Use `?wait=` for tool-call style use (an `ephemeral` run that finishes within the wait never touches
|
|
190
|
+
* the journal), `Accept: text/event-stream` to follow steps live, or `webhook`. Effect steps without a product
|
|
191
|
+
* meter of their own bill `routines.effect_step`; product steps bill their product's unit.
|
|
192
|
+
*
|
|
193
|
+
* `POST /v1/routines/{routine}/runs` · scope `routines:run` · served by the node
|
|
194
|
+
*/
|
|
195
|
+
createRun(routine: string, body?: T.RunCreateRequest, options?: RequestOptions): JobPromise<T.RoutineRun, T.RunEvent>;
|
|
196
|
+
/**
|
|
197
|
+
* List versions
|
|
198
|
+
*
|
|
199
|
+
* Lists the routine's versions, newest first, without their definitions.
|
|
200
|
+
*
|
|
201
|
+
* `GET /v1/routines/{routine}/versions` · scope `routines:read` · served by the node
|
|
202
|
+
*/
|
|
203
|
+
listVersions(routine: string, params?: T.RoutinesListVersionsParams, options?: RequestOptions): ListPromise<T.RoutineVersionList, T.RoutineVersion>;
|
|
204
|
+
/**
|
|
205
|
+
* Get a version
|
|
206
|
+
*
|
|
207
|
+
* Returns one version, by `ver_` ID or number, with its full definition.
|
|
208
|
+
*
|
|
209
|
+
* `GET /v1/routines/{routine}/versions/{version}` · scope `routines:read` · served by the node
|
|
210
|
+
*/
|
|
211
|
+
getVersion(routine: string, version: string, options?: RequestOptions): APIPromise<T.RoutineVersion>;
|
|
212
|
+
}
|