@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.
Files changed (242) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +233 -2
  3. package/dist/cjs/core/client.d.ts +165 -0
  4. package/dist/cjs/core/client.js +825 -0
  5. package/dist/cjs/core/client.js.map +1 -0
  6. package/dist/cjs/core/errors.d.ts +101 -0
  7. package/dist/cjs/core/errors.js +249 -0
  8. package/dist/cjs/core/errors.js.map +1 -0
  9. package/dist/cjs/core/index.d.ts +12 -0
  10. package/dist/cjs/core/index.js +42 -0
  11. package/dist/cjs/core/index.js.map +1 -0
  12. package/dist/cjs/core/jobs.d.ts +31 -0
  13. package/dist/cjs/core/jobs.js +72 -0
  14. package/dist/cjs/core/jobs.js.map +1 -0
  15. package/dist/cjs/core/namespace.d.ts +7 -0
  16. package/dist/cjs/core/namespace.js +13 -0
  17. package/dist/cjs/core/namespace.js.map +1 -0
  18. package/dist/cjs/core/op.d.ts +47 -0
  19. package/dist/cjs/core/op.js +5 -0
  20. package/dist/cjs/core/op.js.map +1 -0
  21. package/dist/cjs/core/promise.d.ts +106 -0
  22. package/dist/cjs/core/promise.js +200 -0
  23. package/dist/cjs/core/promise.js.map +1 -0
  24. package/dist/cjs/core/response.d.ts +54 -0
  25. package/dist/cjs/core/response.js +92 -0
  26. package/dist/cjs/core/response.js.map +1 -0
  27. package/dist/cjs/core/sse.d.ts +79 -0
  28. package/dist/cjs/core/sse.js +291 -0
  29. package/dist/cjs/core/sse.js.map +1 -0
  30. package/dist/cjs/core/timing.d.ts +20 -0
  31. package/dist/cjs/core/timing.js +96 -0
  32. package/dist/cjs/core/timing.js.map +1 -0
  33. package/dist/cjs/core/transport.d.ts +80 -0
  34. package/dist/cjs/core/transport.js +472 -0
  35. package/dist/cjs/core/transport.js.map +1 -0
  36. package/dist/cjs/core/util.d.ts +25 -0
  37. package/dist/cjs/core/util.js +142 -0
  38. package/dist/cjs/core/util.js.map +1 -0
  39. package/dist/cjs/core/ws.d.ts +52 -0
  40. package/dist/cjs/core/ws.js +181 -0
  41. package/dist/cjs/core/ws.js.map +1 -0
  42. package/dist/cjs/generated/client.d.ts +62 -0
  43. package/dist/cjs/generated/client.js +130 -0
  44. package/dist/cjs/generated/client.js.map +1 -0
  45. package/dist/cjs/generated/errors.d.ts +4 -0
  46. package/dist/cjs/generated/errors.js +160 -0
  47. package/dist/cjs/generated/errors.js.map +1 -0
  48. package/dist/cjs/generated/ids.d.ts +114 -0
  49. package/dist/cjs/generated/ids.js +47 -0
  50. package/dist/cjs/generated/ids.js.map +1 -0
  51. package/dist/cjs/generated/jobs.d.ts +10 -0
  52. package/dist/cjs/generated/jobs.js +24 -0
  53. package/dist/cjs/generated/jobs.js.map +1 -0
  54. package/dist/cjs/generated/ns/actions.d.ts +161 -0
  55. package/dist/cjs/generated/ns/actions.js +304 -0
  56. package/dist/cjs/generated/ns/actions.js.map +1 -0
  57. package/dist/cjs/generated/ns/infer.d.ts +190 -0
  58. package/dist/cjs/generated/ns/infer.js +253 -0
  59. package/dist/cjs/generated/ns/infer.js.map +1 -0
  60. package/dist/cjs/generated/ns/keys.d.ts +76 -0
  61. package/dist/cjs/generated/ns/keys.js +144 -0
  62. package/dist/cjs/generated/ns/keys.js.map +1 -0
  63. package/dist/cjs/generated/ns/limits.d.ts +22 -0
  64. package/dist/cjs/generated/ns/limits.js +32 -0
  65. package/dist/cjs/generated/ns/limits.js.map +1 -0
  66. package/dist/cjs/generated/ns/orgs.d.ts +38 -0
  67. package/dist/cjs/generated/ns/orgs.js +68 -0
  68. package/dist/cjs/generated/ns/orgs.js.map +1 -0
  69. package/dist/cjs/generated/ns/projects.d.ts +57 -0
  70. package/dist/cjs/generated/ns/projects.js +115 -0
  71. package/dist/cjs/generated/ns/projects.js.map +1 -0
  72. package/dist/cjs/generated/ns/render.d.ts +159 -0
  73. package/dist/cjs/generated/ns/render.js +299 -0
  74. package/dist/cjs/generated/ns/render.js.map +1 -0
  75. package/dist/cjs/generated/ns/requests.d.ts +36 -0
  76. package/dist/cjs/generated/ns/requests.js +54 -0
  77. package/dist/cjs/generated/ns/requests.js.map +1 -0
  78. package/dist/cjs/generated/ns/routines.d.ts +212 -0
  79. package/dist/cjs/generated/ns/routines.js +419 -0
  80. package/dist/cjs/generated/ns/routines.js.map +1 -0
  81. package/dist/cjs/generated/ns/sandboxes.d.ts +318 -0
  82. package/dist/cjs/generated/ns/sandboxes.js +549 -0
  83. package/dist/cjs/generated/ns/sandboxes.js.map +1 -0
  84. package/dist/cjs/generated/ns/usage.d.ts +30 -0
  85. package/dist/cjs/generated/ns/usage.js +49 -0
  86. package/dist/cjs/generated/ns/usage.js.map +1 -0
  87. package/dist/cjs/generated/ns/vault.d.ts +69 -0
  88. package/dist/cjs/generated/ns/vault.js +122 -0
  89. package/dist/cjs/generated/ns/vault.js.map +1 -0
  90. package/dist/cjs/generated/ns/vision.d.ts +376 -0
  91. package/dist/cjs/generated/ns/vision.js +736 -0
  92. package/dist/cjs/generated/ns/vision.js.map +1 -0
  93. package/dist/cjs/generated/ns/webhooks.d.ts +50 -0
  94. package/dist/cjs/generated/ns/webhooks.js +91 -0
  95. package/dist/cjs/generated/ns/webhooks.js.map +1 -0
  96. package/dist/cjs/generated/types.d.ts +4613 -0
  97. package/dist/cjs/generated/types.js +4 -0
  98. package/dist/cjs/generated/types.js.map +1 -0
  99. package/dist/cjs/index.d.ts +22 -0
  100. package/dist/cjs/index.js +81 -0
  101. package/dist/cjs/index.js.map +1 -0
  102. package/dist/cjs/package.json +3 -0
  103. package/dist/cjs/webhooks.d.ts +19 -0
  104. package/dist/cjs/webhooks.js +85 -0
  105. package/dist/cjs/webhooks.js.map +1 -0
  106. package/dist/esm/core/client.d.ts +165 -0
  107. package/dist/esm/core/client.js +821 -0
  108. package/dist/esm/core/client.js.map +1 -0
  109. package/dist/esm/core/errors.d.ts +101 -0
  110. package/dist/esm/core/errors.js +239 -0
  111. package/dist/esm/core/errors.js.map +1 -0
  112. package/dist/esm/core/index.d.ts +12 -0
  113. package/dist/esm/core/index.js +15 -0
  114. package/dist/esm/core/index.js.map +1 -0
  115. package/dist/esm/core/jobs.d.ts +31 -0
  116. package/dist/esm/core/jobs.js +66 -0
  117. package/dist/esm/core/jobs.js.map +1 -0
  118. package/dist/esm/core/namespace.d.ts +7 -0
  119. package/dist/esm/core/namespace.js +9 -0
  120. package/dist/esm/core/namespace.js.map +1 -0
  121. package/dist/esm/core/op.d.ts +47 -0
  122. package/dist/esm/core/op.js +4 -0
  123. package/dist/esm/core/op.js.map +1 -0
  124. package/dist/esm/core/promise.d.ts +106 -0
  125. package/dist/esm/core/promise.js +193 -0
  126. package/dist/esm/core/promise.js.map +1 -0
  127. package/dist/esm/core/response.d.ts +54 -0
  128. package/dist/esm/core/response.js +86 -0
  129. package/dist/esm/core/response.js.map +1 -0
  130. package/dist/esm/core/sse.d.ts +79 -0
  131. package/dist/esm/core/sse.js +286 -0
  132. package/dist/esm/core/sse.js.map +1 -0
  133. package/dist/esm/core/timing.d.ts +20 -0
  134. package/dist/esm/core/timing.js +92 -0
  135. package/dist/esm/core/timing.js.map +1 -0
  136. package/dist/esm/core/transport.d.ts +80 -0
  137. package/dist/esm/core/transport.js +465 -0
  138. package/dist/esm/core/transport.js.map +1 -0
  139. package/dist/esm/core/util.d.ts +25 -0
  140. package/dist/esm/core/util.js +128 -0
  141. package/dist/esm/core/util.js.map +1 -0
  142. package/dist/esm/core/ws.d.ts +52 -0
  143. package/dist/esm/core/ws.js +175 -0
  144. package/dist/esm/core/ws.js.map +1 -0
  145. package/dist/esm/generated/client.d.ts +62 -0
  146. package/dist/esm/generated/client.js +126 -0
  147. package/dist/esm/generated/client.js.map +1 -0
  148. package/dist/esm/generated/errors.d.ts +4 -0
  149. package/dist/esm/generated/errors.js +157 -0
  150. package/dist/esm/generated/errors.js.map +1 -0
  151. package/dist/esm/generated/ids.d.ts +114 -0
  152. package/dist/esm/generated/ids.js +42 -0
  153. package/dist/esm/generated/ids.js.map +1 -0
  154. package/dist/esm/generated/jobs.d.ts +10 -0
  155. package/dist/esm/generated/jobs.js +21 -0
  156. package/dist/esm/generated/jobs.js.map +1 -0
  157. package/dist/esm/generated/ns/actions.d.ts +161 -0
  158. package/dist/esm/generated/ns/actions.js +300 -0
  159. package/dist/esm/generated/ns/actions.js.map +1 -0
  160. package/dist/esm/generated/ns/infer.d.ts +190 -0
  161. package/dist/esm/generated/ns/infer.js +249 -0
  162. package/dist/esm/generated/ns/infer.js.map +1 -0
  163. package/dist/esm/generated/ns/keys.d.ts +76 -0
  164. package/dist/esm/generated/ns/keys.js +140 -0
  165. package/dist/esm/generated/ns/keys.js.map +1 -0
  166. package/dist/esm/generated/ns/limits.d.ts +22 -0
  167. package/dist/esm/generated/ns/limits.js +28 -0
  168. package/dist/esm/generated/ns/limits.js.map +1 -0
  169. package/dist/esm/generated/ns/orgs.d.ts +38 -0
  170. package/dist/esm/generated/ns/orgs.js +64 -0
  171. package/dist/esm/generated/ns/orgs.js.map +1 -0
  172. package/dist/esm/generated/ns/projects.d.ts +57 -0
  173. package/dist/esm/generated/ns/projects.js +111 -0
  174. package/dist/esm/generated/ns/projects.js.map +1 -0
  175. package/dist/esm/generated/ns/render.d.ts +159 -0
  176. package/dist/esm/generated/ns/render.js +295 -0
  177. package/dist/esm/generated/ns/render.js.map +1 -0
  178. package/dist/esm/generated/ns/requests.d.ts +36 -0
  179. package/dist/esm/generated/ns/requests.js +50 -0
  180. package/dist/esm/generated/ns/requests.js.map +1 -0
  181. package/dist/esm/generated/ns/routines.d.ts +212 -0
  182. package/dist/esm/generated/ns/routines.js +415 -0
  183. package/dist/esm/generated/ns/routines.js.map +1 -0
  184. package/dist/esm/generated/ns/sandboxes.d.ts +318 -0
  185. package/dist/esm/generated/ns/sandboxes.js +545 -0
  186. package/dist/esm/generated/ns/sandboxes.js.map +1 -0
  187. package/dist/esm/generated/ns/usage.d.ts +30 -0
  188. package/dist/esm/generated/ns/usage.js +45 -0
  189. package/dist/esm/generated/ns/usage.js.map +1 -0
  190. package/dist/esm/generated/ns/vault.d.ts +69 -0
  191. package/dist/esm/generated/ns/vault.js +118 -0
  192. package/dist/esm/generated/ns/vault.js.map +1 -0
  193. package/dist/esm/generated/ns/vision.d.ts +376 -0
  194. package/dist/esm/generated/ns/vision.js +732 -0
  195. package/dist/esm/generated/ns/vision.js.map +1 -0
  196. package/dist/esm/generated/ns/webhooks.d.ts +50 -0
  197. package/dist/esm/generated/ns/webhooks.js +87 -0
  198. package/dist/esm/generated/ns/webhooks.js.map +1 -0
  199. package/dist/esm/generated/types.d.ts +4613 -0
  200. package/dist/esm/generated/types.js +3 -0
  201. package/dist/esm/generated/types.js.map +1 -0
  202. package/dist/esm/index.d.ts +22 -0
  203. package/dist/esm/index.js +28 -0
  204. package/dist/esm/index.js.map +1 -0
  205. package/dist/esm/webhooks.d.ts +19 -0
  206. package/dist/esm/webhooks.js +79 -0
  207. package/dist/esm/webhooks.js.map +1 -0
  208. package/package.json +98 -4
  209. package/src/core/client.ts +1022 -0
  210. package/src/core/errors.ts +296 -0
  211. package/src/core/index.ts +45 -0
  212. package/src/core/jobs.ts +94 -0
  213. package/src/core/namespace.ts +10 -0
  214. package/src/core/op.ts +53 -0
  215. package/src/core/promise.ts +268 -0
  216. package/src/core/response.ts +115 -0
  217. package/src/core/sse.ts +305 -0
  218. package/src/core/timing.ts +106 -0
  219. package/src/core/transport.ts +489 -0
  220. package/src/core/util.ts +138 -0
  221. package/src/core/ws.ts +215 -0
  222. package/src/generated/client.ts +143 -0
  223. package/src/generated/errors.ts +313 -0
  224. package/src/generated/ids.ts +47 -0
  225. package/src/generated/jobs.ts +25 -0
  226. package/src/generated/ns/actions.ts +353 -0
  227. package/src/generated/ns/infer.ts +332 -0
  228. package/src/generated/ns/keys.ts +152 -0
  229. package/src/generated/ns/limits.ts +35 -0
  230. package/src/generated/ns/orgs.ts +77 -0
  231. package/src/generated/ns/projects.ts +122 -0
  232. package/src/generated/ns/render.ts +348 -0
  233. package/src/generated/ns/requests.ts +61 -0
  234. package/src/generated/ns/routines.ts +474 -0
  235. package/src/generated/ns/sandboxes.ts +671 -0
  236. package/src/generated/ns/usage.ts +56 -0
  237. package/src/generated/ns/vault.ts +136 -0
  238. package/src/generated/ns/vision.ts +836 -0
  239. package/src/generated/ns/webhooks.ts +100 -0
  240. package/src/generated/types.ts +5131 -0
  241. package/src/index.ts +30 -0
  242. package/src/webhooks.ts +100 -0
@@ -0,0 +1,299 @@
1
+ "use strict";
2
+ // Generated by packages/sdk/scripts/generate.mjs from packages/spec/dist. Do not edit; run `pnpm generate`.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.RenderAPI = exports.renderOps = void 0;
5
+ const jobs_ts_1 = require("../../core/jobs.js");
6
+ const namespace_ts_1 = require("../../core/namespace.js");
7
+ const getArtifactOp = {
8
+ id: "renderGetArtifact",
9
+ method: "GET",
10
+ path: "/v1/render/artifacts/{artifact_id}",
11
+ params: ["artifact_id"],
12
+ timeoutMs: 10000,
13
+ scope: "render:read",
14
+ };
15
+ const listPresetsOp = {
16
+ id: "renderListPresets",
17
+ method: "GET",
18
+ path: "/v1/render/presets",
19
+ timeoutMs: 10000,
20
+ scope: "render:read",
21
+ };
22
+ const listScreenshotsOp = {
23
+ id: "renderListScreenshots",
24
+ method: "GET",
25
+ path: "/v1/render/screenshots",
26
+ timeoutMs: 10000,
27
+ scope: "render:read",
28
+ };
29
+ const createScreenshotOp = {
30
+ id: "renderCreateScreenshot",
31
+ method: "POST",
32
+ path: "/v1/render/screenshots",
33
+ body: "json",
34
+ idem: true,
35
+ timeoutMs: 65000,
36
+ scope: "render:run",
37
+ };
38
+ const deleteScreenshotOp = {
39
+ id: "renderDeleteScreenshot",
40
+ method: "DELETE",
41
+ path: "/v1/render/screenshots/{screenshot_id}",
42
+ params: ["screenshot_id"],
43
+ timeoutMs: 10000,
44
+ scope: "render:write",
45
+ };
46
+ const getScreenshotOp = {
47
+ id: "renderGetScreenshot",
48
+ method: "GET",
49
+ path: "/v1/render/screenshots/{screenshot_id}",
50
+ params: ["screenshot_id"],
51
+ timeoutMs: 10000,
52
+ scope: "render:read",
53
+ };
54
+ const listVideosOp = {
55
+ id: "renderListVideos",
56
+ method: "GET",
57
+ path: "/v1/render/videos",
58
+ timeoutMs: 10000,
59
+ scope: "render:read",
60
+ };
61
+ const deleteVideoOp = {
62
+ id: "renderDeleteVideo",
63
+ method: "DELETE",
64
+ path: "/v1/render/videos/{video_id}",
65
+ params: ["video_id"],
66
+ timeoutMs: 10000,
67
+ scope: "render:write",
68
+ };
69
+ const getVideoOp = {
70
+ id: "renderGetVideo",
71
+ method: "GET",
72
+ path: "/v1/render/videos/{video_id}",
73
+ params: ["video_id"],
74
+ timeoutMs: 10000,
75
+ scope: "render:read",
76
+ };
77
+ const cancelVideoOp = {
78
+ id: "renderCancelVideo",
79
+ method: "POST",
80
+ path: "/v1/render/videos/{video_id}/cancel",
81
+ params: ["video_id"],
82
+ timeoutMs: 10000,
83
+ scope: "render:run",
84
+ };
85
+ const videoEventsOp = {
86
+ id: "renderVideoEvents",
87
+ method: "GET",
88
+ path: "/v1/render/videos/{video_id}/events",
89
+ params: ["video_id"],
90
+ stream: "sse",
91
+ timeoutMs: 3600000,
92
+ scope: "render:read",
93
+ };
94
+ const getVideoTimelineOp = {
95
+ id: "renderGetVideoTimeline",
96
+ method: "GET",
97
+ path: "/v1/render/videos/{video_id}/timeline",
98
+ params: ["video_id"],
99
+ timeoutMs: 15000,
100
+ scope: "render:read",
101
+ };
102
+ const createVideoOp = {
103
+ id: "renderCreateVideo",
104
+ method: "POST",
105
+ path: "/v1/render/videos",
106
+ body: "json",
107
+ idem: true,
108
+ stream: "sse",
109
+ timeoutMs: 3600000,
110
+ scope: "render:run",
111
+ job: { get: getVideoOp, events: videoEventsOp, cancel: cancelVideoOp },
112
+ };
113
+ const restyleVideoOp = {
114
+ id: "renderRestyleVideo",
115
+ method: "POST",
116
+ path: "/v1/render/videos/{video_id}/restyle",
117
+ params: ["video_id"],
118
+ body: "json",
119
+ idem: true,
120
+ stream: "sse",
121
+ timeoutMs: 3600000,
122
+ scope: "render:run",
123
+ job: { get: getVideoOp, events: videoEventsOp, cancel: cancelVideoOp },
124
+ };
125
+ /** Descriptors of every render operation, keyed by method name (for tooling and custom clients). */
126
+ exports.renderOps = {
127
+ getArtifact: getArtifactOp,
128
+ listPresets: listPresetsOp,
129
+ listScreenshots: listScreenshotsOp,
130
+ createScreenshot: createScreenshotOp,
131
+ deleteScreenshot: deleteScreenshotOp,
132
+ getScreenshot: getScreenshotOp,
133
+ listVideos: listVideosOp,
134
+ createVideo: createVideoOp,
135
+ deleteVideo: deleteVideoOp,
136
+ getVideo: getVideoOp,
137
+ cancelVideo: cancelVideoOp,
138
+ videoEvents: videoEventsOp,
139
+ restyleVideo: restyleVideoOp,
140
+ getVideoTimeline: getVideoTimelineOp,
141
+ };
142
+ /** Styled screenshots and product videos (`/v1/render`). */
143
+ class RenderAPI extends namespace_ts_1.Namespace {
144
+ /**
145
+ * Get an artifact
146
+ *
147
+ * Returns an artifact's metadata with a fresh signed URL (valid for 24 hours). The URL needs no credentials and
148
+ * is safe to embed: it works for anyone who has it until `url_expires_at`, and the bytes are always served with
149
+ * `Content-Security-Policy: sandbox` (URL format: `renderGetArtifactContent`).
150
+ *
151
+ * `GET /v1/render/artifacts/{artifact_id}` · scope `render:read` · served by the node
152
+ */
153
+ getArtifact(artifactId, options) {
154
+ return this._client._call(getArtifactOp, { path: [artifactId] }, options);
155
+ }
156
+ /**
157
+ * List style presets
158
+ *
159
+ * Lists the style presets `style` can name (backgrounds, window frames, cursors, caption styles, click effects), with a preview image for each.
160
+ *
161
+ * `GET /v1/render/presets` · scope `render:read` · served by the node
162
+ */
163
+ listPresets(params, options) {
164
+ return this._client._call(listPresetsOp, { query: params }, options);
165
+ }
166
+ /**
167
+ * List screenshots
168
+ *
169
+ * Lists screenshots in this project, newest first. Screenshots are kept for 7 days.
170
+ *
171
+ * `GET /v1/render/screenshots` · scope `render:read` · served by the node
172
+ */
173
+ listScreenshots(params, options) {
174
+ return this._client._list(listScreenshotsOp, { query: params }, options);
175
+ }
176
+ createScreenshot(body, options = {}) {
177
+ const { accept, ...rest } = options;
178
+ if (accept && accept !== "application/json") {
179
+ return this._client._call(createScreenshotOp, { body }, rest, accept, "bytes");
180
+ }
181
+ return this._client._call(createScreenshotOp, { body }, rest);
182
+ }
183
+ /**
184
+ * Delete a screenshot
185
+ *
186
+ * Deletes the screenshot and its artifacts. Signed URLs stop working within a minute.
187
+ *
188
+ * `DELETE /v1/render/screenshots/{screenshot_id}` · scope `render:write` · served by the node
189
+ */
190
+ deleteScreenshot(screenshotId, options) {
191
+ return this._client._call(deleteScreenshotOp, { path: [screenshotId] }, options);
192
+ }
193
+ /**
194
+ * Get a screenshot
195
+ *
196
+ * Returns the screenshot with fresh signed URLs for its artifacts.
197
+ *
198
+ * `GET /v1/render/screenshots/{screenshot_id}` · scope `render:read` · served by the node
199
+ */
200
+ getScreenshot(screenshotId, options) {
201
+ return this._client._call(getScreenshotOp, { path: [screenshotId] }, options);
202
+ }
203
+ /**
204
+ * List videos
205
+ *
206
+ * Lists videos in this project, newest first. Videos and their artifacts are kept for 7 days.
207
+ *
208
+ * `GET /v1/render/videos` · scope `render:read` · served by the node
209
+ */
210
+ listVideos(params, options) {
211
+ return this._client._list(listVideosOp, { query: params }, options);
212
+ }
213
+ /**
214
+ * Record a video
215
+ *
216
+ * Starts a job that records a scripted demo of `source.url`. Narration (`say`) is synthesized first with
217
+ * `/v1/infer/audio/speech`; the director then places each beat's steps on its narration, plans cursor and
218
+ * camera, records segments in parallel on a virtual clock, composes at the output frame rate and encodes MP4
219
+ * (H.264, BT.709), GIF, poster and captions. Artifacts appear as they finish (`video.artifact` events, poster
220
+ * first). Bills `render.video_s` per second of output.
221
+ *
222
+ * `POST /v1/render/videos` · scope `render:run` · served by the node
223
+ */
224
+ createVideo(body, options) {
225
+ return this._client._job(createVideoOp, { body }, options);
226
+ }
227
+ /**
228
+ * Delete a video
229
+ *
230
+ * Cancels the job if it is still running, then deletes the video, its artifacts and its archived capture.
231
+ *
232
+ * `DELETE /v1/render/videos/{video_id}` · scope `render:write` · served by the node
233
+ */
234
+ deleteVideo(videoId, options) {
235
+ return this._client._call(deleteVideoOp, { path: [videoId] }, options);
236
+ }
237
+ /**
238
+ * Get a video
239
+ *
240
+ * Returns the video job; once it succeeded, `result.artifacts` lists its files with fresh signed URLs.
241
+ *
242
+ * `GET /v1/render/videos/{video_id}` · scope `render:read` · served by the node
243
+ */
244
+ getVideo(videoId, options) {
245
+ return this._client._call(getVideoOp, { path: [videoId] }, options);
246
+ }
247
+ /**
248
+ * Cancel a video
249
+ *
250
+ * Stops the job. Artifacts already produced are kept; seconds already encoded are billed.
251
+ *
252
+ * `POST /v1/render/videos/{video_id}/cancel` · scope `render:run` · served by the node
253
+ */
254
+ cancelVideo(videoId, options) {
255
+ return this._client._call(cancelVideoOp, { path: [videoId] }, options);
256
+ }
257
+ /**
258
+ * Stream a video's events
259
+ *
260
+ * Server-sent events for the video job: lifecycle events, `video.phase` as the job moves through voice, plan,
261
+ * capture, compose, encode and upload, and `video.artifact` as each file becomes available. Ends after the
262
+ * terminal event; reconnect with `Last-Event-ID` to resume.
263
+ *
264
+ * `GET /v1/render/videos/{video_id}/events` · scope `render:read` · served by the node
265
+ */
266
+ videoEvents(videoId, options) {
267
+ return this._client._stream(videoEventsOp, { path: [videoId] }, options, {
268
+ terminal: jobs_ts_1.isTerminalJobEvent,
269
+ reconnectOnEnd: true,
270
+ });
271
+ }
272
+ /**
273
+ * Restyle a video
274
+ *
275
+ * Starts a job that re-composes the source video's archived raw capture with a new style, captions, output
276
+ * size or formats. No browser runs and narration is reused, so it takes seconds. Camera moves are not
277
+ * changed. The result is a new video (`restyled_from` names the source). The raw capture is kept as long as
278
+ * the source video (7 days).
279
+ *
280
+ * `POST /v1/render/videos/{video_id}/restyle` · scope `render:run` · served by the node
281
+ */
282
+ restyleVideo(videoId, body, options) {
283
+ return this._client._job(restyleVideoOp, { path: [videoId], body }, options);
284
+ }
285
+ /**
286
+ * Get a video's timeline
287
+ *
288
+ * Returns the compiled timeline of a video that has finished planning: beats, narration with word timings,
289
+ * the timed action list the recorder replayed, cursor path, camera keyframes, captions and style
290
+ * (`timeline.schema.json`). `frames=1` adds the per-frame compositor state (large; for debugging).
291
+ *
292
+ * `GET /v1/render/videos/{video_id}/timeline` · scope `render:read` · served by the node
293
+ */
294
+ getVideoTimeline(videoId, params, options) {
295
+ return this._client._call(getVideoTimelineOp, { path: [videoId], query: params }, options);
296
+ }
297
+ }
298
+ exports.RenderAPI = RenderAPI;
299
+ //# 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,gDAAwD;AACxD,0DAAoD;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,CAAC;AACF,MAAM,iBAAiB,GAAO;IAC5B,EAAE,EAAE,uBAAuB;IAC3B,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,wBAAwB;IAC9B,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,aAAa;CACrB,CAAC;AACF,MAAM,kBAAkB,GAAO;IAC7B,EAAE,EAAE,wBAAwB;IAC5B,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,wBAAwB;IAC9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AAC,CAAC;IAC/E,CAAC;IAED;;;;;;OAMG;IACH,WAAW,CAAC,OAAe,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAU,aAAa,EAAE,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAClF,CAAC;IAED;;;;;;;;OAQG;IACH,WAAW,CAAC,OAAe,EAAE,OAAuB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAe,aAAa,EAAE,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE;YACrF,QAAQ,EAAE,4BAAkB;YAC5B,cAAc,EAAE,IAAI;SACrB,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,YAAY,CACV,OAAe,EACf,IAA2B,EAC3B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAwB,cAAc,EAAE,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IACtG,CAAC;IAED;;;;;;;;OAQG;IACH,gBAAgB,CACd,OAAe,EACf,MAAuC,EACvC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAmB,kBAAkB,EAAE,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/G,CAAC;CACF;AAvMD,8BAuMC"}
@@ -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,54 @@
1
+ "use strict";
2
+ // Generated by packages/sdk/scripts/generate.mjs from packages/spec/dist. Do not edit; run `pnpm generate`.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.RequestsAPI = exports.requestsOps = void 0;
5
+ const namespace_ts_1 = require("../../core/namespace.js");
6
+ const listRequestsOp = {
7
+ id: "platformListRequests",
8
+ method: "GET",
9
+ path: "/v1/requests",
10
+ timeoutMs: 15000,
11
+ scope: "platform:read",
12
+ };
13
+ const getRequestOp = {
14
+ id: "platformGetRequest",
15
+ method: "GET",
16
+ path: "/v1/requests/{request_id}",
17
+ params: ["request_id"],
18
+ timeoutMs: 10000,
19
+ scope: "platform:read",
20
+ };
21
+ /** Descriptors of every requests operation, keyed by method name (for tooling and custom clients). */
22
+ exports.requestsOps = { listRequests: listRequestsOp, getRequest: getRequestOp };
23
+ /** The node's request log with full phase timing (`/v1/requests`). */
24
+ class RequestsAPI extends namespace_ts_1.Namespace {
25
+ /**
26
+ * List requests
27
+ *
28
+ * Lists the requests the node served for your project in the last 7 days, newest first, over every connection
29
+ * kind, filterable by product, operation, status, key, connection kind and sandbox. Requests the edge answered
30
+ * without forwarding them (edge-served operations, or requests refused before forwarding) are not listed; get
31
+ * those by ID. The edge forwards this operation and merges its `edge_*` phases into each record.
32
+ *
33
+ * `GET /v1/requests` · scope `platform:read` · served by the node
34
+ */
35
+ listRequests(params, options) {
36
+ return this._client._list(listRequestsOp, { query: params }, options);
37
+ }
38
+ /**
39
+ * Get a request
40
+ *
41
+ * Returns one request with its full phase breakdown: the node's phases (its `Server-Timing` phases, or the final
42
+ * phases of a stream) and the edge's `edge_auth` and `edge_upstream`, which the edge merges in under the same
43
+ * request ID. Use the `x-request-id` of any response, or a problem's `instance`. For a request the edge answered
44
+ * itself (an edge-served operation, or one refused before forwarding), the edge returns its own record: `node`
45
+ * is `null` and only edge phases are listed.
46
+ *
47
+ * `GET /v1/requests/{request_id}` · scope `platform:read` · served by the node
48
+ */
49
+ getRequest(requestId, options) {
50
+ return this._client._call(getRequestOp, { path: [requestId] }, options);
51
+ }
52
+ }
53
+ exports.RequestsAPI = RequestsAPI;
54
+ //# 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,0DAAoD;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;AACzF,QAAA,WAAW,GAAG,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAW,CAAC;AAE/F,sEAAsE;AACtE,MAAa,WAAY,SAAQ,wBAAS;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;AAhCD,kCAgCC"}
@@ -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
+ }