@shotstack/schemas 1.10.6 → 1.10.8

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.
@@ -912,7 +912,8 @@ export const richtextpropertiesRichTextBackgroundSchema = z.object({
912
912
  if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
913
913
  return v;
914
914
  return Number(v);
915
- } return v; }), z.number().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0)
915
+ } return v; }), z.number().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
916
+ wrap: z.optional(z.boolean()).default(false)
916
917
  }).strict();
917
918
  export const richTextBackgroundSchema = richtextpropertiesRichTextBackgroundSchema;
918
919
  /**
@@ -1110,8 +1111,9 @@ export const richcaptionpropertiesRichCaptionActiveSchema = z.object({
1110
1111
  export const richCaptionActiveSchema = richcaptionpropertiesRichCaptionActiveSchema;
1111
1112
  /**
1112
1113
  * The RichCaptionAsset provides word-level caption animations with rich-text styling. It supports
1113
- * karaoke-style highlighting, word-by-word animations, and advanced typography. Use with SRT/VTT
1114
- * files or auto-transcription via aliases.
1114
+ * karaoke-style highlighting, word-by-word animations, and advanced typography. Captions can be
1115
+ * sourced from SRT/VTT/TTML subtitle files, from audio/video media URLs (auto-transcribed), or
1116
+ * from alias references to other clips in the same timeline.
1115
1117
  *
1116
1118
  */
1117
1119
  export const richcaptionassetRichCaptionAssetSchema = z.object({
@@ -1136,22 +1138,7 @@ export const richcaptionassetRichCaptionAssetSchema = z.object({
1136
1138
  align: z.optional(richtextpropertiesRichTextAlignmentSchema),
1137
1139
  active: z.optional(richcaptionpropertiesRichCaptionActiveSchema),
1138
1140
  animation: z.optional(richcaptionpropertiesRichCaptionAnimationSchema)
1139
- }).strict().superRefine((data, ctx) => {
1140
- if (data.src) {
1141
- try {
1142
- const pathname = new URL(data.src).pathname.toLowerCase();
1143
- const mediaExts = [".m4a", ".mp3", ".wav", ".aac", ".ogg", ".flac", ".wma", ".mp4", ".mov", ".avi", ".mkv", ".webm", ".wmv", ".flv", ".3gp"];
1144
- if (mediaExts.some((ext) => pathname.endsWith(ext))) {
1145
- ctx.addIssue({
1146
- code: z.ZodIssueCode.custom,
1147
- message: "Caption src must be an SRT or VTT subtitle file. To generate captions from a media asset, use an alias reference (e.g. \"alias://my-clip\") instead of a direct URL. See: https://shotstack.io/docs/guide/architecting-an-application/rich-captions/",
1148
- path: ["src"],
1149
- });
1150
- }
1151
- }
1152
- catch { }
1153
- }
1154
- });
1141
+ }).strict();
1155
1142
  export const richCaptionAssetSchema = richcaptionassetRichCaptionAssetSchema;
1156
1143
  /**
1157
1144
  * Font properties for rich text.
@@ -851,7 +851,8 @@ export const richTextAnimationSchema = richtextpropertiesRichTextAnimationSchema
851
851
  export const richtextpropertiesRichTextBackgroundSchema = z.object({
852
852
  color: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
853
853
  opacity: 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(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
854
- borderRadius: 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)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0)
854
+ borderRadius: 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)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
855
+ wrap: z.optional(z.boolean()).default(false)
855
856
  }).strict();
856
857
 
857
858
  export const richTextBackgroundSchema = richtextpropertiesRichTextBackgroundSchema;
@@ -954,8 +955,9 @@ export const richCaptionActiveSchema = richcaptionpropertiesRichCaptionActiveSch
954
955
 
955
956
  /**
956
957
  * The RichCaptionAsset provides word-level caption animations with rich-text styling. It supports
957
- * karaoke-style highlighting, word-by-word animations, and advanced typography. Use with SRT/VTT
958
- * files or auto-transcription via aliases.
958
+ * karaoke-style highlighting, word-by-word animations, and advanced typography. Captions can be
959
+ * sourced from SRT/VTT/TTML subtitle files, from audio/video media URLs (auto-transcribed), or
960
+ * from alias references to other clips in the same timeline.
959
961
  *
960
962
  */
961
963
  export const richcaptionassetRichCaptionAssetSchema = z.object({
@@ -974,21 +976,7 @@ export const richcaptionassetRichCaptionAssetSchema = z.object({
974
976
  align: z.optional(richtextpropertiesRichTextAlignmentSchema),
975
977
  active: z.optional(richcaptionpropertiesRichCaptionActiveSchema),
976
978
  animation: z.optional(richcaptionpropertiesRichCaptionAnimationSchema)
977
- }).strict().superRefine((data, ctx) => {
978
- if (data.src) {
979
- try {
980
- const pathname = new URL(data.src).pathname.toLowerCase();
981
- const mediaExts = [".m4a",".mp3",".wav",".aac",".ogg",".flac",".wma",".mp4",".mov",".avi",".mkv",".webm",".wmv",".flv",".3gp"];
982
- if (mediaExts.some((ext) => pathname.endsWith(ext))) {
983
- ctx.addIssue({
984
- code: z.ZodIssueCode.custom,
985
- message: "Caption src must be an SRT or VTT subtitle file. To generate captions from a media asset, use an alias reference (e.g. \"alias://my-clip\") instead of a direct URL. See: https://shotstack.io/docs/guide/architecting-an-application/rich-captions/",
986
- path: ["src"],
987
- });
988
- }
989
- } catch {}
990
- }
991
- });
979
+ }).strict();
992
980
 
993
981
  export const richCaptionAssetSchema = richcaptionassetRichCaptionAssetSchema;
994
982
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shotstack/schemas",
3
- "version": "1.10.6",
3
+ "version": "1.10.8",
4
4
  "description": "Centralized OpenAPI schemas and TypeScript types for Shotstack API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",