@b3os/sdk 0.2.1 → 0.2.2
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/cjs/core/util.d.ts +1 -1
- package/dist/cjs/core/util.js +1 -1
- package/dist/cjs/generated/client.d.ts +13 -0
- package/dist/cjs/generated/client.js +25 -0
- package/dist/cjs/generated/client.js.map +1 -1
- package/dist/cjs/generated/errors.d.ts +1 -1
- package/dist/cjs/generated/errors.js +75 -0
- package/dist/cjs/generated/errors.js.map +1 -1
- package/dist/cjs/generated/ids.d.ts +61 -0
- package/dist/cjs/generated/ids.js +15 -0
- package/dist/cjs/generated/ids.js.map +1 -1
- package/dist/cjs/generated/jobs.js +4 -0
- package/dist/cjs/generated/jobs.js.map +1 -1
- package/dist/cjs/generated/ns/actions.d.ts +267 -33
- package/dist/cjs/generated/ns/actions.js +375 -33
- package/dist/cjs/generated/ns/actions.js.map +1 -1
- package/dist/cjs/generated/ns/agents.d.ts +229 -0
- package/dist/cjs/generated/ns/agents.js +402 -0
- package/dist/cjs/generated/ns/agents.js.map +1 -0
- package/dist/cjs/generated/ns/images.d.ts +81 -0
- package/dist/cjs/generated/ns/images.js +122 -0
- package/dist/cjs/generated/ns/images.js.map +1 -0
- package/dist/cjs/generated/ns/infer.d.ts +71 -3
- package/dist/cjs/generated/ns/infer.js +98 -3
- package/dist/cjs/generated/ns/infer.js.map +1 -1
- package/dist/cjs/generated/ns/keys.d.ts +3 -1
- package/dist/cjs/generated/ns/keys.js +3 -1
- package/dist/cjs/generated/ns/keys.js.map +1 -1
- package/dist/cjs/generated/ns/listeners.d.ts +159 -0
- package/dist/cjs/generated/ns/listeners.js +264 -0
- package/dist/cjs/generated/ns/listeners.js.map +1 -0
- package/dist/cjs/generated/ns/orgs.d.ts +10 -0
- package/dist/cjs/generated/ns/orgs.js +26 -1
- package/dist/cjs/generated/ns/orgs.js.map +1 -1
- package/dist/cjs/generated/ns/projects.d.ts +32 -0
- package/dist/cjs/generated/ns/projects.js +66 -0
- package/dist/cjs/generated/ns/projects.js.map +1 -1
- package/dist/cjs/generated/ns/render.d.ts +192 -21
- package/dist/cjs/generated/ns/render.js +267 -24
- package/dist/cjs/generated/ns/render.js.map +1 -1
- package/dist/cjs/generated/ns/requests.d.ts +3 -1
- package/dist/cjs/generated/ns/requests.js +3 -1
- package/dist/cjs/generated/ns/requests.js.map +1 -1
- package/dist/cjs/generated/ns/routines.d.ts +11 -4
- package/dist/cjs/generated/ns/routines.js +11 -4
- package/dist/cjs/generated/ns/routines.js.map +1 -1
- package/dist/cjs/generated/ns/sandboxes.d.ts +292 -7
- package/dist/cjs/generated/ns/sandboxes.js +444 -6
- package/dist/cjs/generated/ns/sandboxes.js.map +1 -1
- package/dist/cjs/generated/ns/usage.d.ts +1 -1
- package/dist/cjs/generated/ns/usage.js +1 -1
- package/dist/cjs/generated/ns/vision.d.ts +59 -17
- package/dist/cjs/generated/ns/vision.js +59 -21
- package/dist/cjs/generated/ns/vision.js.map +1 -1
- package/dist/cjs/generated/types.d.ts +2564 -68
- package/dist/cjs/helpers/sandboxes.d.ts +20 -1
- package/dist/cjs/helpers/sandboxes.js +13 -1
- package/dist/cjs/helpers/sandboxes.js.map +1 -1
- package/dist/esm/core/util.d.ts +1 -1
- package/dist/esm/core/util.js +1 -1
- package/dist/esm/generated/client.d.ts +13 -0
- package/dist/esm/generated/client.js +25 -0
- package/dist/esm/generated/client.js.map +1 -1
- package/dist/esm/generated/errors.d.ts +1 -1
- package/dist/esm/generated/errors.js +75 -0
- package/dist/esm/generated/errors.js.map +1 -1
- package/dist/esm/generated/ids.d.ts +61 -0
- package/dist/esm/generated/ids.js +15 -0
- package/dist/esm/generated/ids.js.map +1 -1
- package/dist/esm/generated/jobs.js +4 -0
- package/dist/esm/generated/jobs.js.map +1 -1
- package/dist/esm/generated/ns/actions.d.ts +267 -33
- package/dist/esm/generated/ns/actions.js +375 -33
- package/dist/esm/generated/ns/actions.js.map +1 -1
- package/dist/esm/generated/ns/agents.d.ts +229 -0
- package/dist/esm/generated/ns/agents.js +398 -0
- package/dist/esm/generated/ns/agents.js.map +1 -0
- package/dist/esm/generated/ns/images.d.ts +81 -0
- package/dist/esm/generated/ns/images.js +118 -0
- package/dist/esm/generated/ns/images.js.map +1 -0
- package/dist/esm/generated/ns/infer.d.ts +71 -3
- package/dist/esm/generated/ns/infer.js +98 -3
- package/dist/esm/generated/ns/infer.js.map +1 -1
- package/dist/esm/generated/ns/keys.d.ts +3 -1
- package/dist/esm/generated/ns/keys.js +3 -1
- package/dist/esm/generated/ns/keys.js.map +1 -1
- package/dist/esm/generated/ns/listeners.d.ts +159 -0
- package/dist/esm/generated/ns/listeners.js +260 -0
- package/dist/esm/generated/ns/listeners.js.map +1 -0
- package/dist/esm/generated/ns/orgs.d.ts +10 -0
- package/dist/esm/generated/ns/orgs.js +26 -1
- package/dist/esm/generated/ns/orgs.js.map +1 -1
- package/dist/esm/generated/ns/projects.d.ts +32 -0
- package/dist/esm/generated/ns/projects.js +66 -0
- package/dist/esm/generated/ns/projects.js.map +1 -1
- package/dist/esm/generated/ns/render.d.ts +192 -21
- package/dist/esm/generated/ns/render.js +267 -24
- package/dist/esm/generated/ns/render.js.map +1 -1
- package/dist/esm/generated/ns/requests.d.ts +3 -1
- package/dist/esm/generated/ns/requests.js +3 -1
- package/dist/esm/generated/ns/requests.js.map +1 -1
- package/dist/esm/generated/ns/routines.d.ts +11 -4
- package/dist/esm/generated/ns/routines.js +11 -4
- package/dist/esm/generated/ns/routines.js.map +1 -1
- package/dist/esm/generated/ns/sandboxes.d.ts +292 -7
- package/dist/esm/generated/ns/sandboxes.js +444 -6
- package/dist/esm/generated/ns/sandboxes.js.map +1 -1
- package/dist/esm/generated/ns/usage.d.ts +1 -1
- package/dist/esm/generated/ns/usage.js +1 -1
- package/dist/esm/generated/ns/vision.d.ts +59 -17
- package/dist/esm/generated/ns/vision.js +59 -21
- package/dist/esm/generated/ns/vision.js.map +1 -1
- package/dist/esm/generated/types.d.ts +2564 -68
- package/dist/esm/helpers/sandboxes.d.ts +20 -1
- package/dist/esm/helpers/sandboxes.js +13 -1
- package/dist/esm/helpers/sandboxes.js.map +1 -1
- package/package.json +1 -1
- package/src/core/util.ts +1 -1
- package/src/generated/client.ts +28 -0
- package/src/generated/errors.ts +150 -0
- package/src/generated/ids.ts +15 -0
- package/src/generated/jobs.ts +4 -0
- package/src/generated/ns/actions.ts +403 -33
- package/src/generated/ns/agents.ts +461 -0
- package/src/generated/ns/images.ts +128 -0
- package/src/generated/ns/infer.ts +100 -3
- package/src/generated/ns/keys.ts +3 -1
- package/src/generated/ns/listeners.ts +296 -0
- package/src/generated/ns/orgs.ts +27 -1
- package/src/generated/ns/projects.ts +74 -0
- package/src/generated/ns/render.ts +277 -24
- package/src/generated/ns/requests.ts +3 -1
- package/src/generated/ns/routines.ts +11 -4
- package/src/generated/ns/sandboxes.ts +492 -7
- package/src/generated/ns/usage.ts +1 -1
- package/src/generated/ns/vision.ts +59 -21
- package/src/generated/types.ts +2907 -192
- package/src/helpers/sandboxes.ts +31 -2
|
@@ -7,9 +7,16 @@ import { type ArtifactBytes } from "../../helpers/render.ts";
|
|
|
7
7
|
import type * as T from "../types.ts";
|
|
8
8
|
/** Descriptors of every render operation, keyed by method name (for tooling and custom clients). */
|
|
9
9
|
export declare const renderOps: {
|
|
10
|
+
readonly listAliases: Op;
|
|
11
|
+
readonly deleteAlias: Op;
|
|
12
|
+
readonly getAlias: Op;
|
|
13
|
+
readonly putAlias: Op;
|
|
14
|
+
readonly unshareAlias: Op;
|
|
15
|
+
readonly shareAlias: Op;
|
|
10
16
|
readonly getArtifact: Op;
|
|
11
17
|
readonly listBackgrounds: Op;
|
|
12
18
|
readonly listBackgroundPacks: Op;
|
|
19
|
+
readonly createInspection: Op;
|
|
13
20
|
readonly listPresets: Op;
|
|
14
21
|
readonly listScreenshots: Op;
|
|
15
22
|
readonly createScreenshot: Op;
|
|
@@ -28,6 +35,73 @@ export declare const renderOps: {
|
|
|
28
35
|
};
|
|
29
36
|
/** Styled screenshots and product videos (`/v1/render`). */
|
|
30
37
|
export declare class RenderAPI extends Namespace {
|
|
38
|
+
/**
|
|
39
|
+
* List aliases
|
|
40
|
+
*
|
|
41
|
+
* Lists the project's aliases, by name. An alias names a recording (`onboarding`, `billing-tour`): it points at
|
|
42
|
+
* the newest succeeded video tagged with it, so a share of the alias always plays the latest re-record with no
|
|
43
|
+
* change to the embed.
|
|
44
|
+
*
|
|
45
|
+
* `GET /v1/render/aliases` · scope `render:read` · served by the node
|
|
46
|
+
*/
|
|
47
|
+
listAliases(params?: T.RenderListAliasesParams, options?: RequestOptions): ListPromise<T.VideoAliasList, T.VideoAlias>;
|
|
48
|
+
/**
|
|
49
|
+
* Delete an alias
|
|
50
|
+
*
|
|
51
|
+
* Stops the alias's share (as `DELETE /v1/render/aliases/{alias}/share` does: 503 and nothing changed when
|
|
52
|
+
* storage cannot be reached), releases the video it pointed at to the normal retention (it expires 24 hours
|
|
53
|
+
* from now, or at its own expiry when that is later) and removes the alias. The tagged videos stay.
|
|
54
|
+
*
|
|
55
|
+
* `DELETE /v1/render/aliases/{alias}` · scope `render:write` · served by the node
|
|
56
|
+
*/
|
|
57
|
+
deleteAlias(alias: string, options?: RequestOptions): APIPromise<T.Deleted>;
|
|
58
|
+
/**
|
|
59
|
+
* Get an alias
|
|
60
|
+
*
|
|
61
|
+
* The alias, the video it points at, its newest 20 tagged videos and its share.
|
|
62
|
+
*
|
|
63
|
+
* `GET /v1/render/aliases/{alias}` · scope `render:read` · served by the node
|
|
64
|
+
*/
|
|
65
|
+
getAlias(alias: string, options?: RequestOptions): APIPromise<T.VideoAlias>;
|
|
66
|
+
/**
|
|
67
|
+
* Point or pin an alias
|
|
68
|
+
*
|
|
69
|
+
* Makes the alias (201) or changes it (200). `video_id` points it at a video tagged with it that has not
|
|
70
|
+
* expired, and pins it there (`follow: false`): re-records no longer move it, which is how to roll an embed
|
|
71
|
+
* back. `follow: true` makes it follow again and moves it to the newest succeeded tagged video at once (while
|
|
72
|
+
* the alias has a share, not to one recorded with `source.profile`: only `video_id` puts that on a share). A
|
|
73
|
+
* video not tagged with the alias is refused with 409 `conflict`: restyle it with `alias: <name>` to add it
|
|
74
|
+
* (its files then go to the alias's storage). The video an alias points at is kept past the 7-day retention;
|
|
75
|
+
* the one it leaves is kept 24 hours more, and its versioned file URLs keep working for an hour.
|
|
76
|
+
*
|
|
77
|
+
* `PUT /v1/render/aliases/{alias}` · scope `render:write` · served by the node
|
|
78
|
+
*/
|
|
79
|
+
putAlias(alias: string, body: T.VideoAliasPutRequest, options?: RequestOptions): APIPromise<T.VideoAlias>;
|
|
80
|
+
/**
|
|
81
|
+
* Stop sharing an alias
|
|
82
|
+
*
|
|
83
|
+
* Stops the alias's share, the same way as stopping a video's share: the answer comes once storage confirmed
|
|
84
|
+
* it, the next request to the page, its files or its oEmbed answer answers 404, caches keep a copy for at most
|
|
85
|
+
* 60 seconds, and 503 `product_unavailable` leaves it live. Stopping a share that does not exist succeeds.
|
|
86
|
+
*
|
|
87
|
+
* `DELETE /v1/render/aliases/{alias}/share` · scope `render:write` · served by the node
|
|
88
|
+
*/
|
|
89
|
+
unshareAlias(alias: string, options?: RequestOptions): APIPromise<T.Deleted>;
|
|
90
|
+
/**
|
|
91
|
+
* Share an alias
|
|
92
|
+
*
|
|
93
|
+
* Makes a public share of the alias: the same page, files and oEmbed answer as a video's share, but they play
|
|
94
|
+
* the video the alias points at, so an embed shows the newest re-record with no change to its HTML. Its stable
|
|
95
|
+
* URLs (`url`, `media`) change bytes when the alias moves; the page names the files of one version, so a
|
|
96
|
+
* player that loaded it before the move keeps playing that video. The share lasts while the alias exists
|
|
97
|
+
* (`expires_at: null`). Sharing again returns the live share (200). Answers 409 `conflict` while the alias
|
|
98
|
+
* points at no video or its video's MP4 does not reach storage (files are served from storage only; while a
|
|
99
|
+
* re-record's files upload, the page plays the video the alias left), 403 `share_blocked` when B3 took its
|
|
100
|
+
* share down, and 503 `product_unavailable` without object storage.
|
|
101
|
+
*
|
|
102
|
+
* `POST /v1/render/aliases/{alias}/share` · scope `render:write` · served by the node
|
|
103
|
+
*/
|
|
104
|
+
shareAlias(alias: string, body?: T.VideoShareRequest, options?: RequestOptions): APIPromise<T.VideoShare>;
|
|
31
105
|
/**
|
|
32
106
|
* Get an artifact
|
|
33
107
|
*
|
|
@@ -72,6 +146,40 @@ export declare class RenderAPI extends Namespace {
|
|
|
72
146
|
* `GET /v1/render/backgrounds/packs` · scope `public` · served by the node
|
|
73
147
|
*/
|
|
74
148
|
listBackgroundPacks(options?: RequestOptions): APIPromise<T.RenderBackgroundPackList>;
|
|
149
|
+
/**
|
|
150
|
+
* Inspect a page or a video
|
|
151
|
+
*
|
|
152
|
+
* Records a short window frame by frame and reports what changed from each frame to the next. With `url`, it
|
|
153
|
+
* loads the page in a browser at device scale 1, runs `steps` on a virtual clock and takes every frame of
|
|
154
|
+
* `duration_ms` at `fps` (at most 300 frames). With `video_id`, it reads the same window from a finished video
|
|
155
|
+
* of this project. It answers in one call: up to 8 `summary` lines, the change `report` (changed regions,
|
|
156
|
+
* layout shifts, flashes, cuts, scroll stalls), a `trace` of each `watch` target's box over time, and one
|
|
157
|
+
* contact sheet (`sheet`, WebP, at most 1568x1176 px) with up to 12 timestamped frames and before/after crops
|
|
158
|
+
* of the two main changes. Nothing is drawn over the page's pixels except outlines of the changed regions.
|
|
159
|
+
*
|
|
160
|
+
* Positions are CSS px for a page and video px for a video (`window.units`); times are ms from the start of
|
|
161
|
+
* the page's clock, or of the video. Page time is virtual: it holds while code, data, style and font requests
|
|
162
|
+
* are in flight, so network waits never show as page time (`report.network` says how long it held). Web
|
|
163
|
+
* workers and other wall-clock work run in real time against it. Unlike a video's capture, banners are left
|
|
164
|
+
* in place, lazy content is not loaded ahead and client-side routes are not run ahead of the clock. The window
|
|
165
|
+
* starts after the page's `load` event, its images, a short network quiet and 1 s of page time, so how the page
|
|
166
|
+
* loaded is not in it: to see a change, make it with `steps` (a click, or a `navigate`).
|
|
167
|
+
*
|
|
168
|
+
* The browser, the page's load and the capture must fit in about a minute: a load or a step that waits past
|
|
169
|
+
* that answers 504 `job_timed_out`.
|
|
170
|
+
*
|
|
171
|
+
* A video source drops shifts and flashes while the video's camera moves, reports the camera's planned cuts
|
|
172
|
+
* as `camera_cut`, and leaves the caption rows out (`report.masked`). `steps`, `watch`, `viewport` and `theme`
|
|
173
|
+
* are for `url` only.
|
|
174
|
+
*
|
|
175
|
+
* The sheet is an artifact kept for 24 hours; the inspection itself is not stored (there is no GET for it).
|
|
176
|
+
* `sheet.tokens` is what the sheet costs a vision model that reads 28 px patches: ceil(width / 28) x
|
|
177
|
+
* ceil(height / 28), at most 2352. Bills `render.inspection_s`, one per second of window rounded up, once the
|
|
178
|
+
* sheet is saved; an error bills nothing.
|
|
179
|
+
*
|
|
180
|
+
* `POST /v1/render/inspections` · scope `render:run` · served by the node
|
|
181
|
+
*/
|
|
182
|
+
createInspection(body: T.InspectionCreateRequest, options?: RequestOptions): APIPromise<T.Inspection>;
|
|
75
183
|
/**
|
|
76
184
|
* List style presets
|
|
77
185
|
*
|
|
@@ -172,13 +280,36 @@ export declare class RenderAPI extends Namespace {
|
|
|
172
280
|
* nothing is billed. A recording made with a
|
|
173
281
|
* profile is reused (`recording.reuse`) only by videos with the same revision of the same profile.
|
|
174
282
|
*
|
|
283
|
+
* `goal` instead of `beats` says what the video should show and lets the node plan the steps: the job's first
|
|
284
|
+
* phase, `draft`, reads the start page with a vision scrape (as the caller), asks the node's chat model for
|
|
285
|
+
* beats whose steps can only click, hover or type into controls that page listed, runs those steps once in a
|
|
286
|
+
* second scrape to check them, and asks once more for the rest of the goal when they revealed new controls. At most 2 vision pages, 2 model answers and 6 beats, within the
|
|
287
|
+
* `render.goal.plan_s` limit (90 s). The drafted beats are the video's script from then on (`goal.beats`, the
|
|
288
|
+
* `video.drafted` event); send them back as `beats` to record the same steps again. Planning needs `vision:run`
|
|
289
|
+
* and `infer:run` in the key's scopes (403 `forbidden` before the job exists otherwise). When it fails, the job
|
|
290
|
+
* fails with `goal_unplanned` and its `reason`, and no `render.video_s` is billed; the vision pages and model
|
|
291
|
+
* tokens planning used are billed by those operations (`vision.page`, `infer.input_tokens`,
|
|
292
|
+
* `infer.output_tokens`), whether or not it succeeds. A goal is planned on public pages only: with
|
|
293
|
+
* `source.profile` it is refused with 422 `script_invalid` at `/source/profile` before the job exists, since the
|
|
294
|
+
* check runs the drafted steps on the page before anyone sees them; send `beats` for a signed-in page.
|
|
295
|
+
*
|
|
296
|
+
* `alias` tags the video with a name of the project, such as `onboarding`, and makes the alias if it does not
|
|
297
|
+
* exist: when the video succeeds the alias points at it (it never moves back to an older video), and a share
|
|
298
|
+
* of the alias (`POST /v1/render/aliases/{alias}/share`) plays it. While an alias points at a video, the video
|
|
299
|
+
* is kept past the 7-day retention (`expires_at: null`, `kept_by_alias`). A tag can change what a live share
|
|
300
|
+
* plays, so `alias` needs `render:write` besides `render:run` (403 `forbidden`, reason `scope`, otherwise). A
|
|
301
|
+
* video recorded with `source.profile` never moves an alias that has a share: the alias stays where it is,
|
|
302
|
+
* `result.warnings` says `alias_signed_in`, and `PUT /v1/render/aliases/{alias}` with `video_id` moves it.
|
|
303
|
+
*
|
|
175
304
|
* `POST /v1/render/videos` · scope `render:run` · served by the node
|
|
176
305
|
*/
|
|
177
306
|
createVideo(body: T.VideoCreateRequest, options?: RequestOptions): JobPromise<T.Video, T.VideoEvent>;
|
|
178
307
|
/**
|
|
179
308
|
* Delete a video
|
|
180
309
|
*
|
|
181
|
-
* Cancels the job if it is still running, then deletes the video, its artifacts, its share
|
|
310
|
+
* Cancels the job if it is still running, then deletes the video, its artifacts, its share and its archived
|
|
311
|
+
* capture. When an alias points at the video, the alias moves to the newest other succeeded video tagged with
|
|
312
|
+
* it that has not expired, or to none (its share page then answers 404 until a new video succeeds).
|
|
182
313
|
*
|
|
183
314
|
* `DELETE /v1/render/videos/{video_id}` · scope `render:write` · served by the node
|
|
184
315
|
*/
|
|
@@ -188,14 +319,24 @@ export declare class RenderAPI extends Namespace {
|
|
|
188
319
|
*
|
|
189
320
|
* Returns the video job; once it succeeded, `result.artifacts` lists its files with fresh signed URLs.
|
|
190
321
|
*
|
|
191
|
-
* `
|
|
322
|
+
* Needs `render:read`, or `render:run` when the caller created the video (node release 1119): the creating
|
|
323
|
+
* sandbox for a video a sandbox made, the creating key for one a key made, so a service that may only record
|
|
324
|
+
* videos can wait for its own. A fork is a new sandbox, so it reads the videos its parent made only with
|
|
325
|
+
* `render:read`. A `render:run` caller that did not create the video gets the `404 video_not_found` an unknown
|
|
326
|
+
* id gets; a credential with neither scope gets `403 forbidden` (`reason: scope`, `required_scope:
|
|
327
|
+
* render:read`). A video created before the release, or by a credential with neither a sandbox nor a key (a
|
|
328
|
+
* dashboard session), has no recorded creator: only `render:read` reads it.
|
|
329
|
+
*
|
|
330
|
+
* `GET /v1/render/videos/{video_id}` · scope `authenticated` · served by the node
|
|
192
331
|
*/
|
|
193
332
|
getVideo(videoId: string, options?: RequestOptions): APIPromise<T.Video>;
|
|
194
333
|
/**
|
|
195
334
|
* Cancel a video
|
|
196
335
|
*
|
|
197
336
|
* Stops the job and marks the video canceled. A canceled video bills nothing: `render.video_s` is billed only
|
|
198
|
-
* when a video succeeds. A video that already finished answers 409.
|
|
337
|
+
* when a video succeeds. A video that already finished answers 409. Since node release 1119 the caller must
|
|
338
|
+
* be able to read the video: its creator, or a credential with `render:read`; anyone else gets the
|
|
339
|
+
* `404 video_not_found` an unknown id gets.
|
|
199
340
|
*
|
|
200
341
|
* `POST /v1/render/videos/{video_id}/cancel` · scope `render:run` · served by the node
|
|
201
342
|
*/
|
|
@@ -203,9 +344,10 @@ export declare class RenderAPI extends Namespace {
|
|
|
203
344
|
/**
|
|
204
345
|
* Stream a video's events
|
|
205
346
|
*
|
|
206
|
-
* Server-sent events for the video job: lifecycle events, `video.phase` as the job moves through
|
|
207
|
-
* capture, compose, encode and upload,
|
|
208
|
-
*
|
|
347
|
+
* Server-sent events for the video job: lifecycle events, `video.phase` as the job moves through draft (a
|
|
348
|
+
* video made from a `goal`), voice, plan, capture, compose, encode and upload, `video.drafted` once a goal's
|
|
349
|
+
* beats are planned, and `video.artifact` as each file becomes available. Ends after the terminal event;
|
|
350
|
+
* reconnect with `Last-Event-ID` to resume.
|
|
209
351
|
*
|
|
210
352
|
* `GET /v1/render/videos/{video_id}/events` · scope `render:read` · served by the node
|
|
211
353
|
*/
|
|
@@ -216,7 +358,20 @@ export declare class RenderAPI extends Namespace {
|
|
|
216
358
|
* Starts a job that re-composes the source video's archived raw capture with a new style, captions, output
|
|
217
359
|
* size or formats. No browser runs and narration is reused, so it takes seconds. Camera moves are not
|
|
218
360
|
* changed. The result is a new video (`restyled_from` names the source). The raw capture is kept as long as
|
|
219
|
-
* the source video (7 days).
|
|
361
|
+
* the source video (7 days, or while an alias keeps it).
|
|
362
|
+
*
|
|
363
|
+
* A restyle does not inherit its source's alias, so trying styles never moves a live embed. Give `alias` to
|
|
364
|
+
* tag the new video with one: when it succeeds the alias points at it, in seconds and without a browser. That
|
|
365
|
+
* is also how a video made without an alias joins one. `alias` needs `render:write` besides `render:run` (403
|
|
366
|
+
* `forbidden`, reason `scope`, otherwise). A restyle of a video recorded with `source.profile` keeps its
|
|
367
|
+
* `source.profile`, and so never moves an alias that has a share (`alias_signed_in`).
|
|
368
|
+
*
|
|
369
|
+
* Since node release 1119 the caller must be able to read the source: its creator, or a credential with
|
|
370
|
+
* `render:read`; anyone else gets the `404 video_not_found` an unknown id gets. The new video's creator is the
|
|
371
|
+
* caller, who reads it with `render:run`.
|
|
372
|
+
*
|
|
373
|
+
* A video B3 took down is not restyled while the takedown stands (403 `share_blocked`): the node asks B3OS's
|
|
374
|
+
* storage first, and answers 503 `product_unavailable` with `Retry-After` when it cannot.
|
|
220
375
|
*
|
|
221
376
|
* `POST /v1/render/videos/{video_id}/restyle` · scope `render:run` · served by the node
|
|
222
377
|
*/
|
|
@@ -224,9 +379,11 @@ export declare class RenderAPI extends Namespace {
|
|
|
224
379
|
/**
|
|
225
380
|
* Stop sharing a video
|
|
226
381
|
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
382
|
+
* Stops the video's share. The answer comes once B3OS's storage confirmed the share is gone: from then on its
|
|
383
|
+
* page, its files and its oEmbed answer answer 404 at once, and a browser or shared cache keeps a copy for at
|
|
384
|
+
* most 60 seconds. When storage cannot be reached the share stays live and the call answers 503
|
|
385
|
+
* `product_unavailable` with `Retry-After`; call it again. The video stays. Stopping a share that does not
|
|
386
|
+
* exist succeeds.
|
|
230
387
|
*
|
|
231
388
|
* `DELETE /v1/render/videos/{video_id}/share` · scope `render:write` · served by the node
|
|
232
389
|
*/
|
|
@@ -234,17 +391,31 @@ export declare class RenderAPI extends Namespace {
|
|
|
234
391
|
/**
|
|
235
392
|
* Share a video
|
|
236
393
|
*
|
|
237
|
-
* Makes a share
|
|
238
|
-
* poster, captions and chapters, carries Open Graph tags
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
394
|
+
* Makes a public share of a finished video: a page at `https://usercontent.b3os.org/s/<share id>` that plays
|
|
395
|
+
* the MP4 with its poster, captions and chapters, carries Open Graph tags and a JSON-LD `VideoObject` for link
|
|
396
|
+
* previews, is its own iframe embed (`embed_html`), and answers oEmbed (`oembed_url`). `media` gives stable
|
|
397
|
+
* URLs of the files for a README image or a `<video>` written by hand (`…/video.gif`, `…/poster.jpg`,
|
|
398
|
+
* `…/video.mp4`). The share ID is 128 random bits: the URL is the only key, and the page is `noindex`. No
|
|
399
|
+
* script runs on the page (`Content-Security-Policy: sandbox`, which allows only popups, so its footer links
|
|
400
|
+
* open).
|
|
401
|
+
*
|
|
402
|
+
* A video's share lasts as long as the video (7 days by default); to keep a demo past that, share an alias
|
|
403
|
+
* instead (`POST /v1/render/aliases/{alias}/share`). Sharing again returns the live share (200); a new one
|
|
404
|
+
* answers 201. Videos are never public until shared: a video recorded with a profile shows signed-in pages,
|
|
405
|
+
* so share it only if those pages may be public.
|
|
406
|
+
*
|
|
407
|
+
* Stopping the share (`DELETE`) or deleting the video takes the page, its files and its oEmbed answer down for
|
|
408
|
+
* every viewer: the next request answers 404, and a browser or shared cache keeps a copy for at most 60
|
|
409
|
+
* seconds. Bytes a player already downloaded, and copies other services made of public URLs (link previews,
|
|
410
|
+
* an image proxy for a README), are out of reach. Answers 503 `product_unavailable` when the node has no
|
|
411
|
+
* object storage to publish to (`[render.upload] kind = "none"`), and 403 `share_blocked` when B3 took the
|
|
412
|
+
* video's share down.
|
|
413
|
+
*
|
|
414
|
+
* A share's files come from B3OS's storage only, never from the node that recorded the video. A file that is
|
|
415
|
+
* still uploading (seconds after the video succeeded) answers 404 at its share URLs until it lands; a file
|
|
416
|
+
* that will never reach storage (larger than the node uploads: 100 MiB, or what its upload pace sends in 60
|
|
417
|
+
* seconds, 75 MB by default; or its upload was given up) is left out of the share. A video whose MP4 is such a
|
|
418
|
+
* file is refused with 409 `conflict`, whose `detail` says why.
|
|
248
419
|
*
|
|
249
420
|
* `POST /v1/render/videos/{video_id}/share` · scope `render:write` · served by the node
|
|
250
421
|
*/
|