@mux/ai 0.59.0 → 0.59.1-canary.91

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.
@@ -964,12 +964,16 @@ var MUX_AI_ERROR_CODES = {
964
964
  INVALID_SCOPE: "invalid_scope",
965
965
  /** Existing tracks block writing the output track under the chosen replacement policy. Facts: `reason` (`policy_fail`, `not_generated`, `name_collision`, `primary_audio`), `conflictingTracks` and the target track. */
966
966
  TRACK_REPLACEMENT_BLOCKED: "track_replacement_blocked",
967
+ /** An option's value can't be used. Facts: `parameter` (the caller's option name), `reason` (`too_many`, `empty`, `too_long`, `disallowed_characters`, `not_normalized`) and the values the reason names: `count` and `max`, `index` (0-based entry), `length` and `maxLength`, `characters`. */
968
+ INVALID_PARAMETER: "invalid_parameter",
967
969
  /** A numeric option is outside its allowed range. Facts: `parameter` (the caller's option name), `value`, `min`, `max`, and `integer` when it must be a whole number. */
968
970
  PARAMETER_OUT_OF_RANGE: "parameter_out_of_range",
969
971
  /** No ready caption track matches the requested track or language. Facts: `trackId` or `languageCode`, and what is available. */
970
972
  CAPTION_TRACK_NOT_FOUND: "caption_track_not_found",
971
973
  /** The asset has no public or signed playback ID (DRM-only assets included). */
972
974
  PLAYBACK_ID_NOT_FOUND: "playback_id_not_found",
975
+ /** Mux has no asset with the requested ID in this environment. Facts: `assetId`. */
976
+ ASSET_NOT_FOUND: "asset_not_found",
973
977
  /** The transcript has no usable content. */
974
978
  TRANSCRIPT_EMPTY: "transcript_empty",
975
979
  /** The asset has no valid duration, so work that depends on it can't run. Facts: `assetId`. */
@@ -1006,7 +1010,9 @@ var MUX_AI_ERROR_CATALOG = {
1006
1010
  // The caller's input.
1007
1011
  [MUX_AI_ERROR_CODES.INVALID_SCOPE]: { type: MUX_AI_ERROR_TYPES.VALIDATION_ERROR, source: MUX_AI_ERROR_SOURCES.REQUEST },
1008
1012
  [MUX_AI_ERROR_CODES.TRACK_REPLACEMENT_BLOCKED]: { type: MUX_AI_ERROR_TYPES.VALIDATION_ERROR, source: MUX_AI_ERROR_SOURCES.REQUEST },
1013
+ [MUX_AI_ERROR_CODES.INVALID_PARAMETER]: { type: MUX_AI_ERROR_TYPES.VALIDATION_ERROR, source: MUX_AI_ERROR_SOURCES.REQUEST },
1009
1014
  [MUX_AI_ERROR_CODES.PARAMETER_OUT_OF_RANGE]: { type: MUX_AI_ERROR_TYPES.VALIDATION_ERROR, source: MUX_AI_ERROR_SOURCES.REQUEST },
1015
+ [MUX_AI_ERROR_CODES.ASSET_NOT_FOUND]: { type: MUX_AI_ERROR_TYPES.VALIDATION_ERROR, source: MUX_AI_ERROR_SOURCES.REQUEST, dependency: MUX_AI_ERROR_DEPENDENCIES.MUX_VIDEO },
1010
1016
  // The asset's state.
1011
1017
  [MUX_AI_ERROR_CODES.CAPTION_TRACK_NOT_FOUND]: { type: MUX_AI_ERROR_TYPES.VALIDATION_ERROR, source: MUX_AI_ERROR_SOURCES.ASSET },
1012
1018
  [MUX_AI_ERROR_CODES.PLAYBACK_ID_NOT_FOUND]: { type: MUX_AI_ERROR_TYPES.VALIDATION_ERROR, source: MUX_AI_ERROR_SOURCES.ASSET },
@@ -2045,6 +2051,15 @@ function isUndeterminedLanguageCode(code) {
2045
2051
  return UNDETERMINED_LANGUAGE_CODES.has(code.toLowerCase().trim());
2046
2052
  }
2047
2053
 
2054
+ // src/lib/mux-video-errors.ts
2055
+ import { z as z2 } from "zod";
2056
+ var MuxTokenSchema = z2.string().regex(/^[\w.-]{1,64}$/);
2057
+ var MuxApiErrorSchema = z2.object({
2058
+ error: z2.object({
2059
+ error: z2.object({ type: MuxTokenSchema })
2060
+ })
2061
+ });
2062
+
2048
2063
  // src/lib/mux-assets.ts
2049
2064
  function isAudioOnlyAsset(asset) {
2050
2065
  const hasAudioTrack = asset.tracks?.some((track) => track.type === "audio") ?? false;