@omelhorsite/sdk 0.3.0 → 0.4.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 (92) hide show
  1. package/README.md +113 -131
  2. package/dist/index.js +1049 -1246
  3. package/dist/types/auth/device.d.ts +1 -1
  4. package/dist/types/auth/index.d.ts +2 -2
  5. package/dist/types/auth/tokens.d.ts +15 -15
  6. package/dist/types/client.d.ts +10 -10
  7. package/dist/types/errors.d.ts +12 -15
  8. package/dist/types/http.d.ts +74 -118
  9. package/dist/types/index.d.ts +2 -2
  10. package/dist/types/internal/attachments.d.ts +17 -0
  11. package/dist/types/internal/helpers.d.ts +9 -0
  12. package/dist/types/listing.d.ts +90 -0
  13. package/dist/types/local/qr.d.ts +1 -1
  14. package/dist/types/local/wordlist.d.ts +2 -3
  15. package/dist/types/resources/account.d.ts +19 -19
  16. package/dist/types/resources/admin/authorizedApplications.d.ts +133 -0
  17. package/dist/types/resources/admin/chests.d.ts +51 -0
  18. package/dist/types/resources/admin/eventAlerts.d.ts +60 -0
  19. package/dist/types/resources/admin/identities.d.ts +99 -0
  20. package/dist/types/resources/admin/index.d.ts +77 -0
  21. package/dist/types/resources/admin/jobs.d.ts +97 -0
  22. package/dist/types/resources/admin/myOauthApplications.d.ts +282 -0
  23. package/dist/types/resources/admin/notepads.d.ts +49 -0
  24. package/dist/types/resources/admin/oauthApplications.d.ts +309 -0
  25. package/dist/types/resources/admin/quotas.d.ts +114 -0
  26. package/dist/types/resources/admin/shortLinks.d.ts +201 -0
  27. package/dist/types/resources/admin/types.d.ts +222 -0
  28. package/dist/types/resources/admin/vocalSeparations.d.ts +98 -0
  29. package/dist/types/resources/admin.d.ts +17 -13
  30. package/dist/types/resources/auth/index.d.ts +1 -1
  31. package/dist/types/resources/auth/passkeys.d.ts +127 -163
  32. package/dist/types/resources/auth/sessions.d.ts +116 -161
  33. package/dist/types/resources/chests.d.ts +27 -31
  34. package/dist/types/resources/content/analysis.d.ts +62 -0
  35. package/dist/types/resources/content/blogs.d.ts +471 -0
  36. package/dist/types/resources/content/feedbacks.d.ts +263 -0
  37. package/dist/types/resources/content/index.d.ts +52 -0
  38. package/dist/types/resources/content/intel/articles.d.ts +230 -0
  39. package/dist/types/resources/content/intel/config.d.ts +135 -0
  40. package/dist/types/resources/content/intel/index.d.ts +53 -0
  41. package/dist/types/resources/content/intel/items.d.ts +91 -0
  42. package/dist/types/resources/content/intel/reports.d.ts +108 -0
  43. package/dist/types/resources/content/intel/scripts.d.ts +152 -0
  44. package/dist/types/resources/content/intel/sources.d.ts +236 -0
  45. package/dist/types/resources/content/intel/stats.d.ts +105 -0
  46. package/dist/types/resources/content/intel/types.d.ts +86 -0
  47. package/dist/types/resources/content/jokes.d.ts +93 -0
  48. package/dist/types/resources/content/notifications.d.ts +147 -0
  49. package/dist/types/resources/content/serviceUsages.d.ts +73 -0
  50. package/dist/types/resources/content/servicesStatus.d.ts +194 -0
  51. package/dist/types/resources/content/siteConfig.d.ts +43 -0
  52. package/dist/types/resources/content/spaceInvaders.d.ts +154 -0
  53. package/dist/types/resources/content.d.ts +41 -236
  54. package/dist/types/resources/dynamicQrs.d.ts +29 -45
  55. package/dist/types/resources/forms.d.ts +37 -58
  56. package/dist/types/resources/jobs.d.ts +35 -44
  57. package/dist/types/resources/library/annotations.d.ts +162 -0
  58. package/dist/types/resources/library/books.d.ts +534 -0
  59. package/dist/types/resources/library/chat.d.ts +259 -0
  60. package/dist/types/resources/library/index.d.ts +39 -0
  61. package/dist/types/resources/library/shelves.d.ts +237 -0
  62. package/dist/types/resources/library/types.d.ts +120 -0
  63. package/dist/types/resources/library.d.ts +20 -22
  64. package/dist/types/resources/media.d.ts +48 -61
  65. package/dist/types/resources/movies/addons.d.ts +388 -0
  66. package/dist/types/resources/movies/collections.d.ts +352 -0
  67. package/dist/types/resources/movies/index.d.ts +29 -0
  68. package/dist/types/resources/movies/types.d.ts +50 -0
  69. package/dist/types/resources/movies/watchProgress.d.ts +277 -0
  70. package/dist/types/resources/movies.d.ts +27 -53
  71. package/dist/types/resources/music/artists.d.ts +182 -246
  72. package/dist/types/resources/music/imports.d.ts +190 -218
  73. package/dist/types/resources/music/index.d.ts +8 -7
  74. package/dist/types/resources/music/playlists.d.ts +85 -117
  75. package/dist/types/resources/music/social.d.ts +153 -228
  76. package/dist/types/resources/music/songs.d.ts +165 -227
  77. package/dist/types/resources/realtime.d.ts +75 -88
  78. package/dist/types/resources/shortLinks.d.ts +38 -47
  79. package/dist/types/resources/social/groupChats.d.ts +458 -0
  80. package/dist/types/resources/social/index.d.ts +19 -0
  81. package/dist/types/resources/social/messages.d.ts +424 -0
  82. package/dist/types/resources/social/relationships.d.ts +322 -0
  83. package/dist/types/resources/social/types.d.ts +37 -0
  84. package/dist/types/resources/social.d.ts +21 -3
  85. package/dist/types/resources/storage/upload.d.ts +42 -56
  86. package/dist/types/resources/storage.d.ts +94 -109
  87. package/dist/types/resources/tickets.d.ts +19 -10
  88. package/dist/types/resources/tools/backgroundRemoval.d.ts +11 -13
  89. package/dist/types/resources/tools/captions.d.ts +107 -135
  90. package/dist/types/resources/tools/upscale.d.ts +12 -16
  91. package/dist/types/types.d.ts +29 -38
  92. package/package.json +1 -1
@@ -16,7 +16,7 @@
16
16
  * handing back a busy row would just guarantee the caller's next call is the
17
17
  * 409. Use {@link CaptionsNamespace.get} to poll a job somebody else started.
18
18
  *
19
- * Limits, all enforced by the backend:
19
+ * Limits, all enforced server-side:
20
20
  *
21
21
  * | | |
22
22
  * |---|---|
@@ -39,8 +39,8 @@
39
39
  * window that would cross the ceiling rather than truncating it.
40
40
  *
41
41
  * **The 250 MiB ceiling is not reachable through {@link CaptionsNamespace.create}.**
42
- * Cloudflare rejects any request body over 100 MB with a 413 of its own before
43
- * Rails ever sees it, so the backend also exposes a three-call chunked upload -
42
+ * Any single request body over roughly 100 MB is answered 413 before the API
43
+ * sees it, so the API also exposes a three-call chunked upload -
44
44
  * `POST /caption_jobs/uploads` opens a session and returns a signed
45
45
  * `upload_token` plus a `part_size` (32 MiB), `POST /caption_jobs/uploads/parts?offset=`
46
46
  * streams each raw part under an `X-Upload-Token` header, and
@@ -53,12 +53,9 @@
53
53
  * be small, and for the three methods under `upload` only to drive the parts
54
54
  * yourself.
55
55
  *
56
- * One caveat that is the backend's and not the SDK's: the three chunked routes
57
- * carry no `oauth_scope` declaration, and scopes there are default-deny, so an
58
- * OAuth access token gets `403 insufficient_scope` on all three (and on
59
- * `fonts`). A session or a first-party bearer token reaches them; a token
60
- * minted through the OIDC provider does not, and for one of those only
61
- * `create` is open.
56
+ * One caveat: an OAuth access token gets `403 insufficient_scope` on the three
57
+ * chunked routes and on `fonts`; of the upload paths, only `create` is open to
58
+ * one. A session token reaches them all.
62
59
  */
63
60
  import { Resource } from "../../http";
64
61
  import type { FileInput, Id, OperationOptions, Progress, RequestOptions } from "../../types";
@@ -69,7 +66,7 @@ import { type SecondsQuota, type ToolCaptcha, type ToolRecord, type ToolRunOptio
69
66
  */
70
67
  export type CaptionStatus = "uploaded" | "transcribing" | "transcribed" | "rendering" | "complete" | "failed";
71
68
  /**
72
- * The two statuses with a sidecar call in flight.
69
+ * The two statuses with work in flight.
73
70
  *
74
71
  * A job in one of these refuses new work with a 409. Note this is NOT the
75
72
  * complement of "terminal": `"uploaded"` and `"transcribed"` are idle but not
@@ -82,12 +79,12 @@ export declare function isCaptionBusy(status: string): boolean;
82
79
  * One timed word of the transcript.
83
80
  *
84
81
  * `text`, `t0`, `t1` - NOT `word`, `start`, `end`. These are the keys the
85
- * render endpoint permits and the keys the transcriber writes onto the row, so
82
+ * render endpoint permits and the keys a transcription writes onto the row, so
86
83
  * a word object built any other way is silently dropped server-side and the
87
84
  * render fails with "No words to render".
88
85
  *
89
86
  * Timings are seconds from the START OF THE VIDEO, not from the start of the
90
- * transcribed window: the backend shifts them onto the video clock before
87
+ * transcribed window: the server shifts them onto the video clock before
91
88
  * saving, so an edited list can be sent straight back.
92
89
  */
93
90
  export interface CaptionWord {
@@ -101,8 +98,8 @@ export interface CaptionWord {
101
98
  /**
102
99
  * An RGB triple, each channel clamped to `[0, 255]` server-side.
103
100
  *
104
- * The controller reads the key only when the array has EXACTLY three entries;
105
- * two or four is dropped in silence, which costs a whole render to discover.
101
+ * The server reads the key only when the array has EXACTLY three entries; two
102
+ * or four is dropped in silence, which costs a whole render to discover.
106
103
  */
107
104
  export type CaptionRgb = readonly [number, number, number] | readonly number[];
108
105
  /**
@@ -110,19 +107,19 @@ export type CaptionRgb = readonly [number, number, number] | readonly number[];
110
107
  *
111
108
  * Open bag, because the renderer gains options without an SDK release and
112
109
  * unknown keys are dropped server-side rather than rejected. The named keys are
113
- * the ones the controller's allow-list actually permits today; anything else -
114
- * a font name, a hex colour - is accepted by the request and then thrown away,
115
- * which is worth knowing before spending a render on it.
110
+ * the ones the server permits today; anything else - a font name, a hex
111
+ * colour - is accepted by the request and then thrown away, which is worth
112
+ * knowing before spending a render on it.
116
113
  *
117
114
  * Every numeric key is CLAMPED, not validated: a value outside the range comes
118
115
  * back as the nearest end of it rather than as a 400.
119
116
  */
120
117
  export interface CaptionStyle {
121
118
  /**
122
- * A font KEY from {@link CaptionsNamespace.fonts}, never a path: the sidecar
123
- * resolves the key against the faces installed in its image, so a caller
124
- * cannot point the renderer at a file. Must match `/\A[a-z0-9_-]{1,40}\z/`;
125
- * anything else is dropped and the renderer uses its own default.
119
+ * A font KEY from {@link CaptionsNamespace.fonts}, never a path: the
120
+ * renderer resolves the key against its installed faces, so a caller cannot
121
+ * point it at a file. Must match `/\A[a-z0-9_-]{1,40}\z/`; anything else is
122
+ * dropped and the renderer uses its own default.
126
123
  */
127
124
  readonly font?: string;
128
125
  /** Font size as a fraction of the video height. Clamped to `[0.03, 0.09]`. */
@@ -130,8 +127,8 @@ export interface CaptionStyle {
130
127
  /**
131
128
  * Outline thickness as a fraction of the font size. Clamped to `[0, 0.3]`,
132
129
  * and `0` is a legitimate choice meaning no outline at all - which is why
133
- * the controller reads this key whenever it is PRESENT rather than when it
134
- * is truthy, unlike every other numeric key here.
130
+ * the server reads this key whenever it is PRESENT rather than when it is
131
+ * truthy, unlike every other numeric key here.
135
132
  */
136
133
  readonly stroke_factor?: number;
137
134
  /** Vertical placement, `0` top to `1` bottom. Clamped to `[0.3, 0.9]`. */
@@ -160,25 +157,22 @@ export interface CaptionStyle {
160
157
  * A caption job.
161
158
  *
162
159
  * Every route that answers with one - create, the chunked upload's finish
163
- * call, show, transcribe and render - renders the `:extended` view, so every
164
- * key below is present on every response.
160
+ * call, show, transcribe and render - answers the same shape, so every key
161
+ * below is present on every response.
165
162
  *
166
- * Five of the columns are `NOT NULL` with a numeric default, so `width`,
167
- * `height`, `fps`, `duration` and `transcribed_seconds` are always real
168
- * numbers. On a row whose upload has only just been probed they are the probed
169
- * values; the sidecar's precise metadata overwrites them a moment later.
163
+ * `width`, `height`, `fps`, `duration` and `transcribed_seconds` are always
164
+ * real numbers: `0` until the probe fills them in.
170
165
  */
171
166
  export interface CaptionJob extends ToolRecord {
172
167
  readonly status: CaptionStatus;
173
- /** Original upload name. The controller substitutes `"video.mp4"` for a
174
- * blank one, so this is never empty in practice. */
168
+ /** Original upload name. The server substitutes `"video.mp4"` for a blank
169
+ * one, so this is never empty in practice. */
175
170
  readonly filename: string;
176
- /** Pixels. `NOT NULL DEFAULT 0`, so `0` means "not probed yet", not unknown. */
171
+ /** Pixels. `0` means "not probed yet", not unknown. */
177
172
  readonly width: number;
178
173
  readonly height: number;
179
- /** `NOT NULL DEFAULT 0.0`. */
180
174
  readonly fps: number;
181
- /** Seconds of video, probed at upload. `NOT NULL DEFAULT 0.0`. */
175
+ /** Seconds of video, probed at upload. */
182
176
  readonly duration: number;
183
177
  /** Language of the last transcribe call, `"auto"` included. `null` before the first. */
184
178
  readonly language: string | null;
@@ -187,27 +181,25 @@ export interface CaptionJob extends ToolRecord {
187
181
  readonly window_end: number | null;
188
182
  /**
189
183
  * Seconds charged against the quota so far, accumulated across every window
190
- * transcribed on this job. `NOT NULL DEFAULT 0`.
184
+ * transcribed on this job.
191
185
  */
192
186
  readonly transcribed_seconds: number;
193
187
  /**
194
188
  * Timed words, from `"transcribed"` onwards.
195
189
  *
196
- * `null` and not `[]` when there are none: the column is `NOT NULL DEFAULT
197
- * '[]'`, but the blueprint renders `words.presence`, and `[].presence` is
198
- * `nil` in Ruby. So an empty list arrives as `null`, and the key is present
199
- * either way.
190
+ * `null` and not `[]` when there are none, and the key is present either
191
+ * way.
200
192
  */
201
193
  readonly words: CaptionWord[] | null;
202
- /** What the renderer is doing right now, read live off the sidecar. `null`
203
- * unless the status is `"rendering"`. */
194
+ /** What the renderer is doing right now, read live. `null` unless the
195
+ * status is `"rendering"`. */
204
196
  readonly render_stage: string | null;
205
197
  /** Signed URL of the finished video once complete and attached, `null` otherwise. */
206
198
  readonly output_url: string | null;
207
199
  }
208
200
  /** Arguments for uploading a video. */
209
201
  export interface CreateCaptionJobInput extends ToolCaptcha {
210
- /** The video. Sent as the `video` form field. Backend caps: 250 MiB, 20 minutes. */
202
+ /** The video. Sent as the `video` form field. Caps: 250 MiB, 20 minutes. */
211
203
  readonly video: FileInput;
212
204
  }
213
205
  /** Arguments for transcribing a window. */
@@ -223,7 +215,7 @@ export interface TranscribeCaptionInput {
223
215
  export interface RenderCaptionInput {
224
216
  /**
225
217
  * Words to burn in. Omit to use the words already on the row; pass an edited
226
- * array to fix what the model misheard. Backend cap: 3000 words, 80
218
+ * array to fix what the transcription misheard. Cap: 3000 words, 80
227
219
  * characters each.
228
220
  *
229
221
  * Omitting costs one extra `GET`: the render endpoint has no fallback of its
@@ -237,59 +229,55 @@ export interface RenderCaptionInput {
237
229
  * Renders a caption job as a {@link Progress}, render stage included.
238
230
  *
239
231
  * Same liberty as the vocal separator takes with the queue position: the
240
- * sidecar's stage is folded into `status` - `"rendering (encoding)"` - because
232
+ * render stage is folded into `status` - `"rendering (encoding)"` - because
241
233
  * `status` is the only part of a {@link Progress} a host renders as text, and a
242
234
  * whole-file re-encode is long enough that "rendering" alone tells a person
243
235
  * nothing.
244
236
  */
245
237
  export declare function captionProgress(record: CaptionJob): Progress;
246
238
  /**
247
- * Largest file the backend will accept, chunked or not: 250 MiB exactly.
239
+ * Largest file the server will accept, chunked or not: 250 MiB exactly.
248
240
  *
249
- * Mirrors `CaptionJobsController::MAX_FILE_SIZE`. Not checked client-side on
250
- * purpose - the server owns the number, and the chunked path finds out in one
251
- * cheap round trip because {@link CaptionsNamespace.startUpload} is given the
252
- * size before a single byte moves.
241
+ * Not checked client-side on purpose - the server owns the number, and the
242
+ * chunked path finds out in one cheap round trip because
243
+ * {@link CaptionsNamespace.startUpload} is given the size before a single byte
244
+ * moves.
253
245
  */
254
246
  export declare const CAPTION_MAX_UPLOAD_BYTES: number;
255
247
  /**
256
248
  * Where {@link CaptionsNamespace.upload} stops using one `POST` and starts
257
249
  * using the three-call path: 64 MiB.
258
250
  *
259
- * This is a CLIENT-SIDE choice, not a protocol constant, and it is the same
260
- * one the web tool makes (`frontend/services/CaptionsService.ts`). Cloudflare's
261
- * ceiling is on the whole request, and a `multipart/form-data` envelope rides
262
- * on top of the file's own bytes, so the switch sits well under the cap rather
263
- * than at it. Below it a single request is one round trip and one probe; above
264
- * it a single request is a 413 that says nothing useful.
251
+ * This is a CLIENT-SIDE choice, not a protocol constant. The ~100 MB ceiling
252
+ * is on the whole request, and a `multipart/form-data` envelope rides on top
253
+ * of the file's own bytes, so the switch sits well under the cap rather than
254
+ * at it. Below it a single request is one round trip and one probe; above it
255
+ * a single request is a 413 that says nothing useful.
265
256
  *
266
257
  * Override it per call with {@link UploadCaptionVideoInput.chunkedThreshold} -
267
258
  * for instance `0`, to exercise the chunked path on a small file.
268
259
  */
269
260
  export declare const CAPTION_CHUNKED_THRESHOLD: number;
270
261
  /**
271
- * Part size, 32 MiB. The same number as the storage tier's, and by coincidence
272
- * rather than by sharing: `CaptionJobsController::PART_SIZE` copied it.
262
+ * Part size, 32 MiB. The same number as the storage tier's, by coincidence
263
+ * rather than by sharing.
273
264
  *
274
265
  * It is BOTH the size the server reports in the session and the ceiling the
275
- * server validates each part against, and the controller validates against its
276
- * own constant rather than against the session it minted. See
277
- * {@link resolveCaptionPartSize} for what that means when the two disagree.
266
+ * server validates each part against. See {@link resolveCaptionPartSize} for
267
+ * what that means when the two disagree.
278
268
  */
279
269
  export declare const CAPTION_PART_SIZE: number;
280
270
  /**
281
271
  * Parts in flight at once by default.
282
272
  *
283
- * Three, as the web tool uses. A single sequential stream leaves a home
284
- * connection idle between round trips; three fills it without holding an unfair
285
- * number of the API's threads, and every part in flight parks one Rails thread
286
- * for as long as it takes to arrive - these bytes pass THROUGH Rails on their
287
- * way to the sidecar, unlike a storage upload.
273
+ * Three. A single sequential stream leaves a home connection idle between
274
+ * round trips; three fills it without holding an unfair share of the API,
275
+ * since these bytes pass THROUGH the API on their way to storage, unlike a
276
+ * storage upload.
288
277
  */
289
278
  export declare const CAPTION_UPLOAD_CONCURRENCY = 3;
290
279
  /**
291
- * How long an upload session stays usable: six hours, from
292
- * `CaptionJobsController::UPLOAD_TOKEN_TTL`.
280
+ * How long an upload session stays usable: six hours.
293
281
  *
294
282
  * The window for a resume. Past it the token verifies as expired and every
295
283
  * call answers 400 "Invalid or expired upload session", parts already sent
@@ -322,7 +310,7 @@ export interface StartCaptionUploadInput extends ToolCaptcha {
322
310
  * Not an estimate and not a ceiling: the number is sealed into the token and
323
311
  * every part is checked against it, so a declared size below the real one
324
312
  * makes the last part fail with 400 "Part exceeds declared size", and a
325
- * declared size above it leaves the sidecar waiting for bytes that never
313
+ * declared size above it leaves the server waiting for bytes that never
326
314
  * come and `finish` probing a truncated file.
327
315
  */
328
316
  readonly size: number;
@@ -364,7 +352,7 @@ export interface CaptionUploadResume {
364
352
  * Keep the whole session where you can. A bare token has no `part_size`, so
365
353
  * the driver slices with {@link CAPTION_PART_SIZE} instead - which is the
366
354
  * server's own number today, and therefore the same offsets, but it stops
367
- * being true the day the backend changes it.
355
+ * being true the day the server changes it.
368
356
  */
369
357
  readonly session: CaptionUploadSession | string;
370
358
  /**
@@ -413,18 +401,16 @@ export declare function captionUploadSize(video: FileInput): number | undefined;
413
401
  * Follows the storage driver's rule - slice with the number the SERVER named,
414
402
  * never with the SDK's copy of it - but with a ceiling the storage tier does
415
403
  * not need, because the two ends of this protocol read the number from
416
- * different places. `start_upload` reports `PART_SIZE` from the session it is
417
- * minting, while `upload_part` validates `length <= PART_SIZE` against the
418
- * CONTROLLER CONSTANT. They are the same constant today and can only disagree
419
- * mid-deploy, and the disagreement is one-sided: honouring a larger reported
420
- * size would make every part a 400 "Invalid part", while capping at the size
421
- * this SDK knows the validator uses only sends smaller parts, which is always
422
- * legal. So the reported number wins downwards and loses upwards.
404
+ * different places: the session reports a `part_size`, while each part is
405
+ * validated against the server's own constant. They are the same today and
406
+ * can only disagree mid-deploy, and the disagreement is one-sided: honouring
407
+ * a larger reported size would make every part a 400 "Invalid part", while
408
+ * capping at the size this SDK knows the validator uses only sends smaller
409
+ * parts, which is always legal. So the reported number wins downwards and
410
+ * loses upwards.
423
411
  *
424
412
  * A missing, zero or nonsense `part_size` falls back to
425
- * {@link CAPTION_PART_SIZE}. Note the web tool falls back to its 64 MiB
426
- * threshold instead, which is above the validator's ceiling - a fallback that
427
- * would reject every part if it ever fired.
413
+ * {@link CAPTION_PART_SIZE}.
428
414
  */
429
415
  export declare function resolveCaptionPartSize(reported: number | undefined): number;
430
416
  /** The `captions` tool, reachable as `oms.tools.captions`. */
@@ -448,15 +434,15 @@ export declare class CaptionsNamespace extends Resource {
448
434
  * {@link CaptionStyle.font}.
449
435
  *
450
436
  * Plain strings, not objects and not display names: they are the keys the
451
- * sidecar resolves against the faces installed in its image, which is the
452
- * whole reason a caller cannot pass a path.
437
+ * renderer resolves against its installed faces, which is the whole reason
438
+ * a caller cannot pass a path.
453
439
  *
454
- * The controller answers `{ fonts: [...] }`; this unwraps it. It also
455
- * NEVER fails: a sidecar that is down or slow is caught and answered as an
456
- * empty list with a 200, so `[]` means "could not ask right now" just as
457
- * much as it means "no fonts", and the two are not distinguishable. Do not
458
- * treat an empty answer as a reason to refuse a render - omitting `font`
459
- * lets the renderer use its own default.
440
+ * The endpoint answers `{ fonts: [...] }`; this unwraps it. It also NEVER
441
+ * fails: a renderer that is down or slow is answered as an empty list with
442
+ * a 200, so `[]` means "could not ask right now" just as much as it means
443
+ * "no fonts", and the two are not distinguishable. Do not treat an empty
444
+ * answer as a reason to refuse a render - omitting `font` lets the renderer
445
+ * use its own default.
460
446
  *
461
447
  * Cached server-side for ten minutes, so polling it buys nothing.
462
448
  */
@@ -464,11 +450,6 @@ export declare class CaptionsNamespace extends Resource {
464
450
  /**
465
451
  * `POST /caption_jobs` - step 1. Uploads the video and probes it.
466
452
  *
467
- * The bytes go to the captions sidecar, which keeps the file; Rails stores
468
- * only the row and, at the end, the rendered output. That is also why a
469
- * caption job cannot be resumed after the sidecar's volume is wiped: the row
470
- * survives and the video does not, and step 2 then fails.
471
- *
472
453
  * Answers with the row in `"uploaded"`, carrying the probed `width`,
473
454
  * `height`, `fps` and `duration`. Nothing is running yet, so this call does
474
455
  * not wait.
@@ -477,8 +458,8 @@ export declare class CaptionsNamespace extends Resource {
477
458
  * 250 MiB and leaves an orphan job behind. Pass `retry: {}` to opt back in.
478
459
  *
479
460
  * @throws {OmsApiError} 413 over 250 MiB, 400 over 20 minutes or when the
480
- * file cannot be read, 503 when the captions sidecar is down - in which
481
- * case the row is destroyed rather than left dangling.
461
+ * file cannot be read, 503 when the captions service is unavailable - in
462
+ * which case no job is left behind.
482
463
  * @throws {OmsQuotaError} 429 from the expensive-tools throttle. The upload
483
464
  * itself spends no daily quota.
484
465
  * @throws {OmsAuthError} 401 when anonymous and the captcha is missing or bad.
@@ -508,8 +489,8 @@ export declare class CaptionsNamespace extends Resource {
508
489
  * new window's words and ADDS its seconds to `transcribed_seconds`, so
509
490
  * re-transcribing costs quota every time and does not give you both windows.
510
491
  *
511
- * `language` defaults to `"auto"` server-side. Whisper detects well enough
512
- * that a hint is worth passing only when it has already got it wrong.
492
+ * `language` defaults to `"auto"` server-side. Detection is good enough that
493
+ * a hint is worth passing only when it has already got it wrong.
513
494
  *
514
495
  * Resolves with a `"failed"` row rather than throwing when the transcription
515
496
  * itself failed - including the common case of a window with no speech in
@@ -526,9 +507,7 @@ export declare class CaptionsNamespace extends Resource {
526
507
  */
527
508
  transcribe(id: Id, input: TranscribeCaptionInput, options?: ToolRunOptions): Promise<CaptionJob>;
528
509
  /**
529
- * `POST /caption_jobs/:id/render` - step 3. Named `render` here even though
530
- * the route is `start_render`, because `render` clashes with Rails' own
531
- * method and that is the backend's problem, not the SDK's.
510
+ * `POST /caption_jobs/:id/render` - step 3.
532
511
  *
533
512
  * WAITS, like {@link transcribe}, and for the same reason.
534
513
  *
@@ -554,11 +533,10 @@ export declare class CaptionsNamespace extends Resource {
554
533
  */
555
534
  render(id: Id, input?: RenderCaptionInput, options?: ToolRunOptions): Promise<CaptionJob>;
556
535
  /**
557
- * `DELETE /caption_jobs/:id` - drops the row and the sidecar's copy.
536
+ * `DELETE /caption_jobs/:id` - drops the job and its uploaded video.
558
537
  *
559
- * Best effort on the sidecar's side: the row goes either way. Worth calling
560
- * on a job you have finished with, because the uploaded video sits on the
561
- * sidecar's disk until the 24-hour sweep otherwise.
538
+ * Worth calling on a job you have finished with; otherwise the video is
539
+ * kept until the 24-hour sweep.
562
540
  *
563
541
  * @throws {OmsApiError} 404 when it is already gone.
564
542
  * @throws {OmsAuthError} 401 when the job belongs to someone else.
@@ -592,8 +570,8 @@ export declare class CaptionsNamespace extends Resource {
592
570
  * Under {@link CAPTION_CHUNKED_THRESHOLD} it is exactly {@link create}: one
593
571
  * `POST`, one probe, one round trip. At or above it, it is
594
572
  * {@link createChunked}. The answer is the same `"uploaded"` row either way,
595
- * because `finish` and `create` render the same `:extended` view - so the
596
- * caller's step 2 does not need to know which path ran.
573
+ * because `finish` and `create` answer the same shape - so the caller's
574
+ * step 2 does not need to know which path ran.
597
575
  *
598
576
  * The size comes from {@link captionUploadSize}, which cannot always find
599
577
  * one: a `ReadableStream` and some React Native picks have no length until
@@ -621,20 +599,19 @@ export declare class CaptionsNamespace extends Resource {
621
599
  * the assembled file and creates the row, so this resolves with the same
622
600
  * `"uploaded"` row {@link create} would have answered.
623
601
  *
624
- * Nothing is cleaned up on failure and nothing needs to be: the controller
625
- * deletes the sidecar's copy itself when `finish` rejects the file, and a run
626
- * abandoned before `finish` leaves only a partial file on the sidecar's disk
627
- * with no row pointing at it. There is no client-visible way to abort a
628
- * session - the backend has `CaptionsClient.abort_upload` but no route onto
629
- * it - so an abandoned upload is simply abandoned.
602
+ * Nothing is cleaned up on failure and nothing needs to be: the server
603
+ * discards the parts itself when `finish` rejects the file, and a run
604
+ * abandoned before `finish` leaves no job behind. There is no way to abort
605
+ * a session, so an abandoned upload is simply abandoned.
630
606
  *
631
607
  * **React Native cannot take this path.** The bytes have to be sliced, and a
632
608
  * picked `{ uri, name, type }` is a handle into the device that only a native
633
609
  * module can open - so this throws for one rather than uploading an empty
634
610
  * file with a 200 on it. What works on a phone is {@link create} (the
635
611
  * transport hands the descriptor to RN's own `FormData` verbatim and the
636
- * platform streams it off disk), which caps out at Cloudflare's ~100 MB. Past
637
- * that the only ways through are reading the file into a `Uint8Array` first -
612
+ * platform streams it off disk), which caps out at the ~100 MB request
613
+ * limit. Past that the only ways through are reading the file into a
614
+ * `Uint8Array` first -
638
615
  * Expo's `new File(uri).bytes()`, which means the whole video in the JS heap,
639
616
  * so it is not a plan for 250 MiB - or shrinking the video on the device.
640
617
  *
@@ -665,20 +642,19 @@ export declare class CaptionsNamespace extends Resource {
665
642
  *
666
643
  * Three things happen here and nowhere else in the flow: the captcha is
667
644
  * verified, the 250 MiB ceiling is checked against the DECLARED size, and the
668
- * job id is minted - early, because the sidecar needs an id to write parts
669
- * under and the row cannot exist until the file is whole. So a session is not
670
- * a job: nothing is in the database yet, and {@link get} has nothing to find
671
- * until {@link finishUpload} returns.
645
+ * job id is minted - early, but the job itself does not exist until the file
646
+ * is whole. So a session is not a job: {@link get} has nothing to find until
647
+ * {@link finishUpload} returns.
672
648
  *
673
- * NOT retried by default. A replay opens a SECOND sidecar upload under a
674
- * second job id and hands back a second token, and the first is then orphaned
675
- * on the sidecar's disk with no route to abort it.
649
+ * NOT retried by default. A replay opens a SECOND session under a second job
650
+ * id and hands back a second token, and the first is then orphaned with no
651
+ * way to abort it.
676
652
  *
677
653
  * Rate limit: 20 a minute, shared with every other expensive tool - the same
678
654
  * bucket `POST /caption_jobs` counts against, since this is its twin.
679
655
  *
680
656
  * @throws {OmsApiError} 413 when `size` is over 250 MiB, 400 when it is not
681
- * positive, 503 when the captions sidecar is down.
657
+ * positive, 503 when the captions service is unavailable.
682
658
  * @throws {OmsAuthError} 401 when anonymous and the captcha is missing or bad.
683
659
  * @throws {OmsQuotaError} 429 from the expensive-tools throttle. No daily
684
660
  * quota is spent by an upload - only a transcribed window is metered.
@@ -688,10 +664,7 @@ export declare class CaptionsNamespace extends Resource {
688
664
  * `POST /caption_jobs/uploads/parts?offset=` - one part, as raw bytes.
689
665
  *
690
666
  * The body is the part itself, `application/octet-stream`, with no envelope:
691
- * not a form field, not base64, not JSON. Rails never reads it into a string
692
- * - it streams the request body straight through to the sidecar - so a 32 MiB
693
- * part costs 32 MiB of socket rather than 32 MiB of Ruby heap, and that is
694
- * why the endpoint takes bytes rather than a multipart part.
667
+ * not a form field, not base64, not JSON.
695
668
  *
696
669
  * RETRIED BY DEFAULT, which no other writing method in this SDK is. The
697
670
  * server writes the part at the offset the query names, so a replay is the
@@ -707,24 +680,23 @@ export declare class CaptionsNamespace extends Resource {
707
680
  *
708
681
  * @param session The session from {@link startUpload}, or its token.
709
682
  * @param offset Byte offset of this part in the whole file, from `0`.
710
- * @returns The byte count the sidecar acknowledged, from `{ received }`.
683
+ * @returns The byte count the server acknowledged, from `{ received }`.
711
684
  * @throws {OmsApiError} 400 for an over-long part, an offset past the
712
685
  * declared size, or a token that has expired (six hours); 503 when the
713
- * sidecar is down.
686
+ * captions service is unavailable.
714
687
  */
715
688
  uploadPart(session: CaptionUploadSession | string, offset: number, part: Blob | Uint8Array, options?: RequestOptions): Promise<number>;
716
689
  /**
717
690
  * `POST /caption_jobs/uploads/finish` - assembles, probes and creates the row.
718
691
  *
719
- * This is where a chunked upload becomes a job: the sidecar joins the parts,
720
- * ffprobe reads the result, and only then is a `CaptionJob` written, with the
721
- * id that was sealed into the token at the start. The answer is the same
722
- * `:extended` view {@link create} returns, in `"uploaded"`.
692
+ * This is where a chunked upload becomes a job: the parts are joined and
693
+ * probed, and only then is a `CaptionJob` created, with the id that was
694
+ * sealed into the token at the start. The answer is the same shape
695
+ * {@link create} returns, in `"uploaded"`.
723
696
  *
724
697
  * It is also where a bad upload is caught. A file that does not decode, or
725
- * one over 20 minutes, is a 400 - and the controller deletes the sidecar's
726
- * copy before answering, so there is nothing to clean up and nothing to
727
- * retry: the parts are gone with it.
698
+ * one over 20 minutes, is a 400 - and the server discards the parts before
699
+ * answering, so there is nothing to clean up and nothing to retry.
728
700
  *
729
701
  * NOT retried by default. The row is created with a fixed id, so a replay
730
702
  * that lands after a lost answer fails on the id already existing and reports
@@ -732,7 +704,7 @@ export declare class CaptionsNamespace extends Resource {
732
704
  *
733
705
  * @throws {OmsApiError} 400 when the assembled file cannot be read or runs
734
706
  * past 20 minutes, 400 "Invalid or expired upload session" for a token that
735
- * is over six hours old, 503 when the sidecar is down.
707
+ * is over six hours old, 503 when the captions service is unavailable.
736
708
  */
737
709
  finishUpload(session: CaptionUploadSession | string, options?: RequestOptions): Promise<CaptionJob>;
738
710
  /**
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * Upscaling: enlarges an image without turning it to mush.
3
3
  *
4
- * Same shape as background removal: `POST /upscales` enqueues a proxy job and
4
+ * Same shape as background removal: `POST /upscales` enqueues a job and
5
5
  * answers with a row plus a `job_id` and, when anonymous, a `watch_token`.
6
6
  *
7
- * Backend limits: 20 MiB, and the scale must be one the upscaler advertises.
7
+ * Limits: 20 MiB, and the scale must be one of `"2"`, `"3"`, `"4"`.
8
8
  *
9
- * Like background removal, this tool is not metered by the `Quotas` catalogue,
10
- * so there is no `quota()` to call first.
9
+ * Like background removal, this tool has no daily quota, so there is no
10
+ * `quota()` to call first.
11
11
  */
12
12
  import { Resource } from "../../http";
13
13
  import type { FileInput, Id, RequestOptions } from "../../types";
@@ -15,7 +15,7 @@ import { type ToolCaptcha, type ToolJobHandle, type ToolRecord, type ToolRunOpti
15
15
  /**
16
16
  * Enlargement factor, as the string the API expects.
17
17
  *
18
- * A string and not a number because the backend compares it against an
18
+ * A string and not a number because the server compares it against an
19
19
  * allow-list of strings; `4` and `"4"` are not the same request.
20
20
  */
21
21
  export type UpscaleScale = "2" | "3" | "4";
@@ -23,19 +23,15 @@ export type UpscaleScale = "2" | "3" | "4";
23
23
  * An upscale run.
24
24
  *
25
25
  * Both routes that answer with one - `POST /upscales` and `GET /upscales/:id` -
26
- * render the `:extended` view, so `result_url` is always PRESENT and simply
27
- * `null` until the run completes. There is no default-view variant of this
28
- * record reachable through the API.
26
+ * answer the same shape, so `result_url` is always PRESENT and simply `null`
27
+ * until the run completes.
29
28
  *
30
29
  * `progress_percent`, inherited from {@link ToolRecord}, is never sent for this
31
- * tool: `UpscaleBlueprint` has no such field. Progress for an upscale lives on
32
- * the {@link Job} row that {@link UpscaleCreated.job_id} names.
30
+ * tool. Progress for an upscale lives on the {@link Job} row that
31
+ * {@link UpscaleCreated.job_id} names.
33
32
  */
34
33
  export interface Upscale extends ToolRecord {
35
- /**
36
- * One of `"2"`, `"3"`, `"4"` - a string, because the column is a string and
37
- * the allow-list is `%w[2 3 4]`. Never `null`: `NOT NULL DEFAULT '4'`.
38
- */
34
+ /** One of `"2"`, `"3"`, `"4"` - a string. Never `null`; defaults to `"4"`. */
39
35
  readonly scale: string;
40
36
  /**
41
37
  * Signed URL of the enlarged PNG, or `null`. `null` covers three different
@@ -49,9 +45,9 @@ export interface Upscale extends ToolRecord {
49
45
  export type UpscaleCreated = Upscale & ToolJobHandle;
50
46
  /** Arguments for starting a run. */
51
47
  export interface CreateUpscaleInput extends ToolCaptcha {
52
- /** The image. Backend cap: 20 MiB. */
48
+ /** The image. Cap: 20 MiB. */
53
49
  readonly file: FileInput;
54
- /** Defaults to `"4"`, which is what the backend picks when none is sent. */
50
+ /** Defaults to `"4"`, which is what the server picks when none is sent. */
55
51
  readonly scale?: UpscaleScale;
56
52
  }
57
53
  /** The `upscale` tool, reachable as `oms.tools.upscale`. */