@shotstack/schemas 1.4.2 → 1.4.4

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.
@@ -107,10 +107,10 @@ export const captionassetCaptionAssetSchema = z.object({
107
107
  });
108
108
  export const captionAssetSchema = captionassetCaptionAssetSchema;
109
109
  /**
110
- * Chroma key, commonly known as green screen, is a technique that replaces a specific color in a video with a different background image or video, enabling seamless integration of diverse environments.
110
+ * Chroma key is a technique that replaces a specific color in a video with a different background image or video, enabling seamless integration of diverse environments. Commonly used for green screen and blue screen effects.
111
111
  */
112
112
  export const chromakeyChromaKeySchema = z.object({
113
- color: z.optional(z.string()),
113
+ color: z.string().regex(/^#[0-9a-fA-F]{6}$/),
114
114
  threshold: z.optional(z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
115
115
  return undefined; if (Array.isArray(v))
116
116
  return v; if (typeof v === 'string')
@@ -720,7 +720,7 @@ export const googleCloudStorageDestinationOptionsSchema = googleCloudStorageDest
720
720
  * Send videos and assets to a [Google Cloud Storage](https://cloud.google.com/storage) bucket. Send files with your own prefix and filename. Google Cloud credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/google-cloud-storage), not in the request.
721
721
  */
722
722
  export const googleCloudStorageDestinationGoogleCloudStorageDestinationSchema = z.object({
723
- provider: z.string().default('google-cloud-storage'),
723
+ provider: z.literal('google-cloud-storage'),
724
724
  options: z.optional(googleCloudStorageDestinationOptionsGoogleCloudStorageDestinationOptionsSchema)
725
725
  });
726
726
  export const googleCloudStorageDestinationSchema = googleCloudStorageDestinationGoogleCloudStorageDestinationSchema;
@@ -736,7 +736,7 @@ export const googleDriveDestinationOptionsSchema = googleDriveDestinationOptions
736
736
  * Send rendered videos and assets to the [Google Drive](https://shotstack.io/docs/guide/serving-assets/destinations/google-drive/) cloud storage service. Google Drive uses OAuth and you must authenticate and link your Google account via [dashboard](https://dashboard.shotstack.io/integrations/google-drive), not in the request.
737
737
  */
738
738
  export const googleDriveDestinationGoogleDriveDestinationSchema = z.object({
739
- provider: z.string().default('google-drive'),
739
+ provider: z.literal('google-drive'),
740
740
  options: googleDriveDestinationOptionsGoogleDriveDestinationOptionsSchema
741
741
  });
742
742
  export const googleDriveDestinationSchema = googleDriveDestinationGoogleDriveDestinationSchema;
@@ -752,7 +752,7 @@ export const muxDestinationOptionsSchema = muxDestinationOptionsMuxDestinationOp
752
752
  * Send videos to the [Mux](https://shotstack.io/docs/guide/serving-assets/destinations/mux/) video hosting and streaming service. Mux credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/mux), not in the request.
753
753
  */
754
754
  export const muxDestinationMuxDestinationSchema = z.object({
755
- provider: z.string().default('mux'),
755
+ provider: z.literal('mux'),
756
756
  options: z.optional(muxDestinationOptionsMuxDestinationOptionsSchema)
757
757
  });
758
758
  export const muxDestinationSchema = muxDestinationMuxDestinationSchema;
@@ -771,7 +771,7 @@ export const s3DestinationOptionsSchema = s3DestinationOptionsS3DestinationOptio
771
771
  * Send videos and assets to an [Amazon S3](https://shotstack.io/docs/guide/serving-assets/destinations/s3/) bucket. Send files to any region with your own prefix and filename. AWS credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/s3), not in the request.
772
772
  */
773
773
  export const s3DestinationS3DestinationSchema = z.object({
774
- provider: z.string().default('s3'),
774
+ provider: z.literal('s3'),
775
775
  options: z.optional(s3DestinationOptionsS3DestinationOptionsSchema)
776
776
  });
777
777
  export const s3DestinationSchema = s3DestinationS3DestinationSchema;
@@ -779,7 +779,7 @@ export const s3DestinationSchema = s3DestinationS3DestinationSchema;
779
779
  * Send videos and assets to the [Shotstack hosting and CDN](https://shotstack.io/docs/guide/serving-assets/destinations/shotstack/) service. This destination is enabled by default.
780
780
  */
781
781
  export const shotstackDestinationShotstackDestinationSchema = z.object({
782
- provider: z.string().default('shotstack'),
782
+ provider: z.literal('shotstack'),
783
783
  exclude: z.optional(z.boolean())
784
784
  });
785
785
  export const shotstackDestinationSchema = shotstackDestinationShotstackDestinationSchema;
@@ -801,7 +801,7 @@ export const tiktokDestinationOptionsTiktokDestinationOptionsSchema = z.object({
801
801
  * Send videos to TikTok. TikTok credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/tiktok), not in the request.
802
802
  */
803
803
  export const tiktokDestinationTiktokDestinationSchema = z.object({
804
- provider: z.string().default('tiktok'),
804
+ provider: z.literal('tiktok'),
805
805
  options: z.optional(tiktokDestinationOptionsTiktokDestinationOptionsSchema)
806
806
  });
807
807
  /**
@@ -824,7 +824,9 @@ export const vimeoDestinationPrivacyOptionsVimeoDestinationPrivacyOptionsSchema
824
824
  'anybody',
825
825
  'nobody',
826
826
  'contacts'
827
- ]))
827
+ ])),
828
+ download: z.optional(z.boolean()),
829
+ add: z.optional(z.boolean())
828
830
  });
829
831
  export const vimeoDestinationPrivacyOptionsSchema = vimeoDestinationPrivacyOptionsVimeoDestinationPrivacyOptionsSchema;
830
832
  /**
@@ -841,7 +843,7 @@ export const vimeoDestinationOptionsSchema = vimeoDestinationOptionsVimeoDestina
841
843
  * Send videos to [Vimeo](https://shotstack.io/docs/guide/serving-assets/destinations/vimeo/) video hosting and streaming service. Vimeo credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/vimeo), not in the request.
842
844
  */
843
845
  export const vimeoDestinationVimeoDestinationSchema = z.object({
844
- provider: z.string().default('vimeo'),
846
+ provider: z.literal('vimeo'),
845
847
  options: z.optional(vimeoDestinationOptionsVimeoDestinationOptionsSchema)
846
848
  });
847
849
  export const vimeoDestinationSchema = vimeoDestinationVimeoDestinationSchema;
@@ -850,28 +852,14 @@ export const vimeoDestinationSchema = vimeoDestinationVimeoDestinationSchema;
850
852
  *
851
853
  * By default all ingested and generated assets are automatically sent to the [Shotstack hosting destination](https://shotstack.io/docs/guide/serving-assets/hosting/). You can [opt-out](https://shotstack.io/docs/guide/serving-assets/self-host/) from by setting the Shotstack destination **exclude** property to **true**.
852
854
  */
853
- export const destinationsDestinationsSchema = z.union([
854
- z.object({
855
- destinations: z.optional(z.literal('shotstackDestination_ShotstackDestination'))
856
- }).and(shotstackDestinationShotstackDestinationSchema),
857
- z.object({
858
- destinations: z.optional(z.literal('muxDestination_MuxDestination'))
859
- }).and(muxDestinationMuxDestinationSchema),
860
- z.object({
861
- destinations: z.optional(z.literal('s3Destination_S3Destination'))
862
- }).and(s3DestinationS3DestinationSchema),
863
- z.object({
864
- destinations: z.optional(z.literal('googleCloudStorageDestination_GoogleCloudStorageDestination'))
865
- }).and(googleCloudStorageDestinationGoogleCloudStorageDestinationSchema),
866
- z.object({
867
- destinations: z.optional(z.literal('googleDriveDestination_GoogleDriveDestination'))
868
- }).and(googleDriveDestinationGoogleDriveDestinationSchema),
869
- z.object({
870
- destinations: z.optional(z.literal('vimeoDestination_VimeoDestination'))
871
- }).and(vimeoDestinationVimeoDestinationSchema),
872
- z.object({
873
- destinations: z.optional(z.literal('tiktokDestination_TiktokDestination'))
874
- }).and(tiktokDestinationTiktokDestinationSchema)
855
+ export const destinationsDestinationsSchema = z.discriminatedUnion("provider", [
856
+ shotstackDestinationShotstackDestinationSchema,
857
+ muxDestinationMuxDestinationSchema,
858
+ s3DestinationS3DestinationSchema,
859
+ googleCloudStorageDestinationGoogleCloudStorageDestinationSchema,
860
+ googleDriveDestinationGoogleDriveDestinationSchema,
861
+ vimeoDestinationVimeoDestinationSchema,
862
+ tiktokDestinationTiktokDestinationSchema
875
863
  ]);
876
864
  export const destinationsSchema = destinationsDestinationsSchema;
877
865
  /**
@@ -2854,15 +2842,14 @@ export const clipClipSchema = z.object({
2854
2842
  return undefined; if (Array.isArray(v))
2855
2843
  return v; if (typeof v === 'string')
2856
2844
  return Number(v); return v; }), z.number()),
2857
- z.enum(['auto'])
2845
+ z.string().regex(/^(auto|alias:\/\/[A-Za-z0-9_-]+)$/)
2858
2846
  ]),
2859
2847
  length: z.union([
2860
2848
  z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2861
2849
  return undefined; if (Array.isArray(v))
2862
2850
  return v; if (typeof v === 'string')
2863
2851
  return Number(v); return v; }), z.number()),
2864
- z.literal('auto'),
2865
- z.literal('end')
2852
+ z.string().regex(/^(auto|end|alias:\/\/[A-Za-z0-9_-]+)$/)
2866
2853
  ]),
2867
2854
  fit: z.optional(z.enum([
2868
2855
  'cover',
@@ -97,10 +97,10 @@ export const captionassetCaptionAssetSchema = z.object({
97
97
  export const captionAssetSchema = captionassetCaptionAssetSchema;
98
98
 
99
99
  /**
100
- * Chroma key, commonly known as green screen, is a technique that replaces a specific color in a video with a different background image or video, enabling seamless integration of diverse environments.
100
+ * Chroma key is a technique that replaces a specific color in a video with a different background image or video, enabling seamless integration of diverse environments. Commonly used for green screen and blue screen effects.
101
101
  */
102
102
  export const chromakeyChromaKeySchema = z.object({
103
- color: z.optional(z.string()),
103
+ color: z.string().regex(/^#[0-9a-fA-F]{6}$/),
104
104
  threshold: z.optional(z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') return Number(v); return v; }), z.number().int().gte(0).lte(250))),
105
105
  halo: z.optional(z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') return Number(v); return v; }), z.number().int().gte(0).lte(250)))
106
106
  });
@@ -725,7 +725,7 @@ export const googleCloudStorageDestinationOptionsSchema = googleCloudStorageDest
725
725
  * Send videos and assets to a [Google Cloud Storage](https://cloud.google.com/storage) bucket. Send files with your own prefix and filename. Google Cloud credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/google-cloud-storage), not in the request.
726
726
  */
727
727
  export const googleCloudStorageDestinationGoogleCloudStorageDestinationSchema = z.object({
728
- provider: z.string().default('google-cloud-storage'),
728
+ provider: z.literal('google-cloud-storage'),
729
729
  options: z.optional(googleCloudStorageDestinationOptionsGoogleCloudStorageDestinationOptionsSchema)
730
730
  });
731
731
 
@@ -745,7 +745,7 @@ export const googleDriveDestinationOptionsSchema = googleDriveDestinationOptions
745
745
  * Send rendered videos and assets to the [Google Drive](https://shotstack.io/docs/guide/serving-assets/destinations/google-drive/) cloud storage service. Google Drive uses OAuth and you must authenticate and link your Google account via [dashboard](https://dashboard.shotstack.io/integrations/google-drive), not in the request.
746
746
  */
747
747
  export const googleDriveDestinationGoogleDriveDestinationSchema = z.object({
748
- provider: z.string().default('google-drive'),
748
+ provider: z.literal('google-drive'),
749
749
  options: googleDriveDestinationOptionsGoogleDriveDestinationOptionsSchema
750
750
  });
751
751
 
@@ -765,7 +765,7 @@ export const muxDestinationOptionsSchema = muxDestinationOptionsMuxDestinationOp
765
765
  * Send videos to the [Mux](https://shotstack.io/docs/guide/serving-assets/destinations/mux/) video hosting and streaming service. Mux credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/mux), not in the request.
766
766
  */
767
767
  export const muxDestinationMuxDestinationSchema = z.object({
768
- provider: z.string().default('mux'),
768
+ provider: z.literal('mux'),
769
769
  options: z.optional(muxDestinationOptionsMuxDestinationOptionsSchema)
770
770
  });
771
771
 
@@ -788,7 +788,7 @@ export const s3DestinationOptionsSchema = s3DestinationOptionsS3DestinationOptio
788
788
  * Send videos and assets to an [Amazon S3](https://shotstack.io/docs/guide/serving-assets/destinations/s3/) bucket. Send files to any region with your own prefix and filename. AWS credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/s3), not in the request.
789
789
  */
790
790
  export const s3DestinationS3DestinationSchema = z.object({
791
- provider: z.string().default('s3'),
791
+ provider: z.literal('s3'),
792
792
  options: z.optional(s3DestinationOptionsS3DestinationOptionsSchema)
793
793
  });
794
794
 
@@ -798,7 +798,7 @@ export const s3DestinationSchema = s3DestinationS3DestinationSchema;
798
798
  * Send videos and assets to the [Shotstack hosting and CDN](https://shotstack.io/docs/guide/serving-assets/destinations/shotstack/) service. This destination is enabled by default.
799
799
  */
800
800
  export const shotstackDestinationShotstackDestinationSchema = z.object({
801
- provider: z.string().default('shotstack'),
801
+ provider: z.literal('shotstack'),
802
802
  exclude: z.optional(z.boolean())
803
803
  });
804
804
 
@@ -823,7 +823,7 @@ export const tiktokDestinationOptionsTiktokDestinationOptionsSchema = z.object({
823
823
  * Send videos to TikTok. TikTok credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/tiktok), not in the request.
824
824
  */
825
825
  export const tiktokDestinationTiktokDestinationSchema = z.object({
826
- provider: z.string().default('tiktok'),
826
+ provider: z.literal('tiktok'),
827
827
  options: z.optional(tiktokDestinationOptionsTiktokDestinationOptionsSchema)
828
828
  });
829
829
 
@@ -847,7 +847,9 @@ export const vimeoDestinationPrivacyOptionsVimeoDestinationPrivacyOptionsSchema
847
847
  'anybody',
848
848
  'nobody',
849
849
  'contacts'
850
- ]))
850
+ ])),
851
+ download: z.optional(z.boolean()),
852
+ add: z.optional(z.boolean())
851
853
  });
852
854
 
853
855
  export const vimeoDestinationPrivacyOptionsSchema = vimeoDestinationPrivacyOptionsVimeoDestinationPrivacyOptionsSchema;
@@ -868,7 +870,7 @@ export const vimeoDestinationOptionsSchema = vimeoDestinationOptionsVimeoDestina
868
870
  * Send videos to [Vimeo](https://shotstack.io/docs/guide/serving-assets/destinations/vimeo/) video hosting and streaming service. Vimeo credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/vimeo), not in the request.
869
871
  */
870
872
  export const vimeoDestinationVimeoDestinationSchema = z.object({
871
- provider: z.string().default('vimeo'),
873
+ provider: z.literal('vimeo'),
872
874
  options: z.optional(vimeoDestinationOptionsVimeoDestinationOptionsSchema)
873
875
  });
874
876
 
@@ -879,28 +881,14 @@ export const vimeoDestinationSchema = vimeoDestinationVimeoDestinationSchema;
879
881
  *
880
882
  * By default all ingested and generated assets are automatically sent to the [Shotstack hosting destination](https://shotstack.io/docs/guide/serving-assets/hosting/). You can [opt-out](https://shotstack.io/docs/guide/serving-assets/self-host/) from by setting the Shotstack destination **exclude** property to **true**.
881
883
  */
882
- export const destinationsDestinationsSchema = z.union([
883
- z.object({
884
- destinations: z.optional(z.literal('shotstackDestination_ShotstackDestination'))
885
- }).and(shotstackDestinationShotstackDestinationSchema),
886
- z.object({
887
- destinations: z.optional(z.literal('muxDestination_MuxDestination'))
888
- }).and(muxDestinationMuxDestinationSchema),
889
- z.object({
890
- destinations: z.optional(z.literal('s3Destination_S3Destination'))
891
- }).and(s3DestinationS3DestinationSchema),
892
- z.object({
893
- destinations: z.optional(z.literal('googleCloudStorageDestination_GoogleCloudStorageDestination'))
894
- }).and(googleCloudStorageDestinationGoogleCloudStorageDestinationSchema),
895
- z.object({
896
- destinations: z.optional(z.literal('googleDriveDestination_GoogleDriveDestination'))
897
- }).and(googleDriveDestinationGoogleDriveDestinationSchema),
898
- z.object({
899
- destinations: z.optional(z.literal('vimeoDestination_VimeoDestination'))
900
- }).and(vimeoDestinationVimeoDestinationSchema),
901
- z.object({
902
- destinations: z.optional(z.literal('tiktokDestination_TiktokDestination'))
903
- }).and(tiktokDestinationTiktokDestinationSchema)
884
+ export const destinationsDestinationsSchema = z.discriminatedUnion("provider", [
885
+ shotstackDestinationShotstackDestinationSchema,
886
+ muxDestinationMuxDestinationSchema,
887
+ s3DestinationS3DestinationSchema,
888
+ googleCloudStorageDestinationGoogleCloudStorageDestinationSchema,
889
+ googleDriveDestinationGoogleDriveDestinationSchema,
890
+ vimeoDestinationVimeoDestinationSchema,
891
+ tiktokDestinationTiktokDestinationSchema
904
892
  ]);
905
893
 
906
894
  export const destinationsSchema = destinationsDestinationsSchema;
@@ -2689,12 +2677,11 @@ export const clipClipSchema = z.object({
2689
2677
  asset: assetAssetSchema,
2690
2678
  start: z.union([
2691
2679
  z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') return Number(v); return v; }), z.number()),
2692
- z.enum(['auto'])
2680
+ z.string().regex(/^(auto|alias:\/\/[A-Za-z0-9_-]+)$/)
2693
2681
  ]),
2694
2682
  length: z.union([
2695
2683
  z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') return Number(v); return v; }), z.number()),
2696
- z.literal('auto'),
2697
- z.literal('end')
2684
+ z.string().regex(/^(auto|end|alias:\/\/[A-Za-z0-9_-]+)$/)
2698
2685
  ]),
2699
2686
  fit: z.optional(z.enum([
2700
2687
  'cover',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shotstack/schemas",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "description": "Centralized OpenAPI schemas and TypeScript types for Shotstack API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",