@shotstack/schemas 1.18.0 → 1.18.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.
@@ -77,6 +77,8 @@ export const captionpropertiesCaptionMarginSchema = z.object({
77
77
  export const captionMarginSchema = captionpropertiesCaptionMarginSchema;
78
78
 
79
79
  /**
80
+ * **Notice: The CaptionAsset is deprecated, use the [RichCaptionAsset](#tocs_richcaptionasset) instead.**
81
+ *
80
82
  * The CaptionAsset is used to add captions (subtitles) to a video. It uses a supplied SRT or VTT file which will
81
83
  * be read and burnt to the video.
82
84
  *
@@ -87,6 +89,8 @@ export const captionMarginSchema = captionpropertiesCaptionMarginSchema;
87
89
  * To sync captions with a video or audio file use a [Video](#tocs_videoasset) or [Audio](#tocs_audioasset) with
88
90
  * matching start and end time.
89
91
  *
92
+ *
93
+ * @deprecated
90
94
  */
91
95
  export const captionassetCaptionAssetSchema = z.object({
92
96
  type: z.enum(['caption']),
@@ -376,21 +380,25 @@ export const fontFontSchema = z.object({
376
380
  export const fontSchema = fontFontSchema;
377
381
 
378
382
  /**
379
- * What one generation costs, in credits. There is no formula to evaluate: multiply the rate by the number of units the generation consumes. Where a model charges differently per option value, `credits` is an object keyed by that value and `tieredBy` names the option that selects it.
383
+ * What one generation costs, in credits: the rate multiplied by the units consumed. `quantity` says how to count the units, and is absent when one generation is one unit. Where a model charges differently per option value, `credits` is an object keyed by that value and `tieredBy` names the option that selects it.
380
384
  */
381
385
  export const generationmodelpricingGenerationModelPricingSchema = z.object({
382
- unit: z.enum([
383
- 'render',
384
- 'second',
385
- 'minute',
386
- 'thousandCharacters'
387
- ]),
388
386
  credits: z.union([
389
387
  z.union([z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') { if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v)) return v; return Number(v); } return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
390
388
  z.record(z.string(), z.unknown())
391
389
  ]),
392
- tieredBy: z.optional(z.array(z.string())),
393
- minUnits: z.optional(z.union([z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') { if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v)) return v; return Number(v); } return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
390
+ tieredBy: z.optional(z.object({
391
+ option: z.string(),
392
+ default: z.string()
393
+ })),
394
+ quantity: z.optional(z.object({
395
+ measure: z.enum(['clipSeconds', 'promptCharacters']),
396
+ per: z.union([z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') { if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v)) return v; return Number(v); } return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
397
+ min: z.optional(z.union([z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') { if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v)) return v; return Number(v); } return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
398
+ max: z.optional(z.union([z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') { if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v)) return v; return Number(v); } return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
399
+ default: z.optional(z.union([z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') { if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v)) return v; return Number(v); } return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
400
+ round: z.optional(z.enum(['up']))
401
+ })),
394
402
  effectiveFrom: z.string()
395
403
  }).strict();
396
404
 
@@ -490,9 +498,10 @@ export const imageAssetSchema = imageassetImageAssetSchema;
490
498
 
491
499
  /**
492
500
  * **Notice: ImageToVideoAsset is deprecated. Use [VideoAsset](#tocs_videoasset)
493
- * with `prompt` and `inputSrc` instead.** This type continues to function and is
494
- * internally rewritten to VideoAsset; no behaviour change for existing
495
- * integrations.
501
+ * with `prompt`, a `model` that accepts a starting image, and that image in
502
+ * `options.inputSrc` — for example `shotstack-itv-mini`.** This type continues to
503
+ * function and is internally rewritten to VideoAsset; no behaviour change for
504
+ * existing integrations.
496
505
  *
497
506
  * The ImageToVideoAsset lets you create a video from an image and a text prompt.
498
507
  *
@@ -2051,8 +2060,9 @@ export const transformationSchema = transformationTransformationSchema;
2051
2060
  *
2052
2061
  * - **Source URL:** set `src` to the URL of an mp4 (or compatible) video file.
2053
2062
  * - **Generated:** set `prompt` to describe the motion. Choose a generator
2054
- * with `model` and configure it with model-specific `options` (including a
2055
- * starting image for image-to-video). The generated `src` is filled in
2063
+ * with `model` and configure it with model-specific `options`. Models that
2064
+ * animate a starting image take it as `options.inputSrc`; the default model
2065
+ * generates from the prompt alone. The generated `src` is filled in
2056
2066
  * automatically.
2057
2067
  * - **Both:** `src` acts as a preview placeholder while `prompt` drives
2058
2068
  * generation — the video is regenerated from the prompt at render time.
@@ -2263,6 +2273,7 @@ export const renderresponsedataRenderResponseDataSchema = z.object({
2263
2273
  'fetching',
2264
2274
  'preprocessing',
2265
2275
  'rendering',
2276
+ 'generating',
2266
2277
  'saving',
2267
2278
  'done',
2268
2279
  'failed'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shotstack/schemas",
3
- "version": "1.18.0",
3
+ "version": "1.18.2",
4
4
  "description": "Centralized OpenAPI schemas and TypeScript types for Shotstack API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",