@shotstack/schemas 1.19.0 → 1.20.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.
@@ -431,7 +431,13 @@ export const generationmodelpricingGenerationModelPricingSchema = z.object({
431
431
  return v;
432
432
  return Number(v);
433
433
  } return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
434
- z.record(z.string(), z.unknown())
434
+ z.record(z.string(), z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
435
+ return undefined; if (Array.isArray(v))
436
+ return v; if (typeof v === 'string') {
437
+ if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
438
+ return v;
439
+ return Number(v);
440
+ } return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))
435
441
  ]),
436
442
  tieredBy: z.optional(z.object({
437
443
  option: z.string(),
@@ -471,6 +477,7 @@ export const generationmodelpricingGenerationModelPricingSchema = z.object({
471
477
  })),
472
478
  effectiveFrom: z.string()
473
479
  }).strict();
480
+ export const generationModelPricingSchema = generationmodelpricingGenerationModelPricingSchema;
474
481
  /**
475
482
  * A generation model available to `prompt`-bearing image, video and audio assets, with the options it accepts and what it costs. Render a model picker and its option fields from this rather than hard coding a model list, so a newly launched model is available without a client release.
476
483
  */
@@ -492,6 +499,7 @@ export const generationmodelGenerationModelSchema = z.object({
492
499
  'AiAccessUnavailable'
493
500
  ]))
494
501
  }).strict();
502
+ export const generationModelSchema = generationmodelGenerationModelSchema;
495
503
  /**
496
504
  * The Html5Asset renders full HTML5/CSS3/JS.
497
505
  *
@@ -831,12 +839,38 @@ export const assetresponseAssetResponseSchema = z.object({
831
839
  data: assetresponsedataAssetResponseDataSchema
832
840
  }).strict();
833
841
  export const assetResponseSchema = assetresponseAssetResponseSchema;
842
+ /**
843
+ * Why a generation request was not accepted or a job could not be found.
844
+ */
845
+ export const generationerrorresponseGenerationErrorResponseSchema = z.object({
846
+ error: z.string(),
847
+ code: z.optional(z.string()),
848
+ available: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
849
+ return undefined; if (Array.isArray(v))
850
+ return v; if (typeof v === 'string') {
851
+ if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
852
+ return v;
853
+ return Number(v);
854
+ } return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))
855
+ }).strict();
856
+ export const generationErrorResponseSchema = generationerrorresponseGenerationErrorResponseSchema;
857
+ /**
858
+ * Why a generation model could not be returned.
859
+ */
860
+ export const generationmodelerrorresponseGenerationModelErrorResponseSchema = z.object({
861
+ error: z.object({
862
+ name: z.enum(['UnknownGenerationModel', 'WithdrawnGenerationModel']),
863
+ message: z.string()
864
+ })
865
+ }).strict();
866
+ export const generationModelErrorResponseSchema = generationmodelerrorresponseGenerationModelErrorResponseSchema;
834
867
  /**
835
868
  * The generation models available to this account.
836
869
  */
837
870
  export const generationmodellistresponseGenerationModelListResponseSchema = z.object({
838
871
  models: z.array(generationmodelGenerationModelSchema)
839
872
  }).strict();
873
+ export const generationModelListResponseSchema = generationmodellistresponseGenerationModelListResponseSchema;
840
874
  /**
841
875
  * The status of an on-demand asset generation job. Completed jobs include the public URL of the generated asset.
842
876
  */
@@ -851,6 +885,7 @@ export const generationresponseGenerationResponseSchema = z.object({
851
885
  url: z.optional(z.string()),
852
886
  error: z.optional(z.string())
853
887
  }).strict();
888
+ export const generationResponseSchema = generationresponseGenerationResponseSchema;
854
889
  /**
855
890
  * The response received after a [probe request](#inspect-media) is submitted. The probe requests returns data from FFprobe formatted as JSON.
856
891
  */
@@ -2565,13 +2600,16 @@ export const videoassetVideoAssetSchema = z.object({
2565
2600
  'fadeOut',
2566
2601
  'fadeInFadeOut'
2567
2602
  ])),
2568
- speed: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2569
- return undefined; if (Array.isArray(v))
2570
- return v; if (typeof v === 'string') {
2571
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2572
- return v;
2573
- return Number(v);
2574
- } return v; }), z.number().gte(0).lte(10)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
2603
+ speed: z.optional(z.union([
2604
+ z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2605
+ return undefined; if (Array.isArray(v))
2606
+ return v; if (typeof v === 'string') {
2607
+ if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2608
+ return v;
2609
+ return Number(v);
2610
+ } return v; }), z.number().gte(0).lte(10)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2611
+ z.array(tweenTweenSchema)
2612
+ ])),
2575
2613
  crop: z.optional(cropCropSchema),
2576
2614
  chromaKey: z.optional(chromakeyChromaKeySchema)
2577
2615
  }).strict().superRefine((data, ctx) => {
@@ -2950,13 +2988,23 @@ export const postGenerateRequest = z.object({
2950
2988
  imageassetImageAssetSchema,
2951
2989
  videoassetVideoAssetSchema,
2952
2990
  audioassetAudioAssetSchema
2953
- ])
2991
+ ]),
2992
+ length: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2993
+ return undefined; if (Array.isArray(v))
2994
+ return v; if (typeof v === 'string') {
2995
+ if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2996
+ return v;
2997
+ return Number(v);
2998
+ } return v; }), z.number().gt(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))
2954
2999
  })),
2955
3000
  path: z.optional(z.never()),
2956
- query: z.optional(z.never())
3001
+ query: z.optional(z.never()),
3002
+ headers: z.optional(z.object({
3003
+ 'Idempotency-Key': z.optional(z.string())
3004
+ }))
2957
3005
  }).strict();
2958
3006
  /**
2959
- * The generated asset was already cached and is immediately available.
3007
+ * The asset was generated before: `done` with its URL, or `failed` with the error that ended it.
2960
3008
  */
2961
3009
  export const postGenerateResponse = generationresponseGenerationResponseSchema;
2962
3010
  export const getGenerateRequest = z.object({
@@ -385,7 +385,7 @@ export const fontSchema = fontFontSchema;
385
385
  export const generationmodelpricingGenerationModelPricingSchema = z.object({
386
386
  credits: z.union([
387
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*\}\}$/)]),
388
- z.record(z.string(), z.unknown())
388
+ z.record(z.string(), 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*\}\}$/)]))
389
389
  ]),
390
390
  tieredBy: z.optional(z.object({
391
391
  option: z.string(),
@@ -402,6 +402,8 @@ export const generationmodelpricingGenerationModelPricingSchema = z.object({
402
402
  effectiveFrom: z.string()
403
403
  }).strict();
404
404
 
405
+ export const generationModelPricingSchema = generationmodelpricingGenerationModelPricingSchema;
406
+
405
407
  /**
406
408
  * A generation model available to `prompt`-bearing image, video and audio assets, with the options it accepts and what it costs. Render a model picker and its option fields from this rather than hard coding a model list, so a newly launched model is available without a client release.
407
409
  */
@@ -424,6 +426,8 @@ export const generationmodelGenerationModelSchema = z.object({
424
426
  ]))
425
427
  }).strict();
426
428
 
429
+ export const generationModelSchema = generationmodelGenerationModelSchema;
430
+
427
431
  /**
428
432
  * The Html5Asset renders full HTML5/CSS3/JS.
429
433
  *
@@ -765,6 +769,29 @@ export const assetresponseAssetResponseSchema = z.object({
765
769
 
766
770
  export const assetResponseSchema = assetresponseAssetResponseSchema;
767
771
 
772
+ /**
773
+ * Why a generation request was not accepted or a job could not be found.
774
+ */
775
+ export const generationerrorresponseGenerationErrorResponseSchema = z.object({
776
+ error: z.string(),
777
+ code: z.optional(z.string()),
778
+ available: 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*\}\}$/)]))
779
+ }).strict();
780
+
781
+ export const generationErrorResponseSchema = generationerrorresponseGenerationErrorResponseSchema;
782
+
783
+ /**
784
+ * Why a generation model could not be returned.
785
+ */
786
+ export const generationmodelerrorresponseGenerationModelErrorResponseSchema = z.object({
787
+ error: z.object({
788
+ name: z.enum(['UnknownGenerationModel', 'WithdrawnGenerationModel']),
789
+ message: z.string()
790
+ })
791
+ }).strict();
792
+
793
+ export const generationModelErrorResponseSchema = generationmodelerrorresponseGenerationModelErrorResponseSchema;
794
+
768
795
  /**
769
796
  * The generation models available to this account.
770
797
  */
@@ -772,6 +799,8 @@ export const generationmodellistresponseGenerationModelListResponseSchema = z.ob
772
799
  models: z.array(generationmodelGenerationModelSchema)
773
800
  }).strict();
774
801
 
802
+ export const generationModelListResponseSchema = generationmodellistresponseGenerationModelListResponseSchema;
803
+
775
804
  /**
776
805
  * The status of an on-demand asset generation job. Completed jobs include the public URL of the generated asset.
777
806
  */
@@ -787,6 +816,8 @@ export const generationresponseGenerationResponseSchema = z.object({
787
816
  error: z.optional(z.string())
788
817
  }).strict();
789
818
 
819
+ export const generationResponseSchema = generationresponseGenerationResponseSchema;
820
+
790
821
  /**
791
822
  * The response received after a [probe request](#inspect-media) is submitted. The probe requests returns data from FFprobe formatted as JSON.
792
823
  */
@@ -2095,7 +2126,10 @@ export const videoassetVideoAssetSchema = z.object({
2095
2126
  'fadeOut',
2096
2127
  'fadeInFadeOut'
2097
2128
  ])),
2098
- speed: 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().gte(0).lte(10)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
2129
+ speed: z.optional(z.union([
2130
+ 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().gte(0).lte(10)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2131
+ z.array(tweenTweenSchema)
2132
+ ])),
2099
2133
  crop: z.optional(cropCropSchema),
2100
2134
  chromaKey: z.optional(chromakeyChromaKeySchema)
2101
2135
  }).strict().superRefine((data, ctx) => {
@@ -2467,14 +2501,18 @@ export const postGenerateRequest = z.object({
2467
2501
  imageassetImageAssetSchema,
2468
2502
  videoassetVideoAssetSchema,
2469
2503
  audioassetAudioAssetSchema
2470
- ])
2504
+ ]),
2505
+ length: 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().gt(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))
2471
2506
  })),
2472
2507
  path: z.optional(z.never()),
2473
- query: z.optional(z.never())
2508
+ query: z.optional(z.never()),
2509
+ headers: z.optional(z.object({
2510
+ 'Idempotency-Key': z.optional(z.string())
2511
+ }))
2474
2512
  }).strict();
2475
2513
 
2476
2514
  /**
2477
- * The generated asset was already cached and is immediately available.
2515
+ * The asset was generated before: `done` with its URL, or `failed` with the error that ended it.
2478
2516
  */
2479
2517
  export const postGenerateResponse = generationresponseGenerationResponseSchema;
2480
2518
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shotstack/schemas",
3
- "version": "1.19.0",
3
+ "version": "1.20.1",
4
4
  "description": "Centralized OpenAPI schemas and TypeScript types for Shotstack API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",