@shotstack/schemas 1.9.10 → 1.9.11

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.
@@ -1144,7 +1144,22 @@ exports.richcaptionassetRichCaptionAssetSchema = zod_1.z.object({
1144
1144
  align: zod_1.z.optional(exports.richtextpropertiesRichTextAlignmentSchema),
1145
1145
  active: zod_1.z.optional(exports.richcaptionpropertiesRichCaptionActiveSchema),
1146
1146
  animation: zod_1.z.optional(exports.richcaptionpropertiesRichCaptionAnimationSchema)
1147
- }).strict();
1147
+ }).strict().superRefine((data, ctx) => {
1148
+ if (data.src) {
1149
+ try {
1150
+ const pathname = new URL(data.src).pathname.toLowerCase();
1151
+ const mediaExts = [".m4a", ".mp3", ".wav", ".aac", ".ogg", ".flac", ".wma", ".mp4", ".mov", ".avi", ".mkv", ".webm", ".wmv", ".flv", ".3gp"];
1152
+ if (mediaExts.some((ext) => pathname.endsWith(ext))) {
1153
+ ctx.addIssue({
1154
+ code: zod_1.z.ZodIssueCode.custom,
1155
+ message: "src must point to a subtitle file (SRT or VTT). Audio and video files are not supported as src. Use the words array to provide word timings directly.",
1156
+ path: ["src"],
1157
+ });
1158
+ }
1159
+ }
1160
+ catch { }
1161
+ }
1162
+ });
1148
1163
  exports.richCaptionAssetSchema = exports.richcaptionassetRichCaptionAssetSchema;
1149
1164
  /**
1150
1165
  * Font properties for rich text.