From f2e66596fdf72e9847cac1cf0f02b54274d7b201 Mon Sep 17 00:00:00 2001 From: nooras Date: Wed, 9 Oct 2024 19:57:51 +0530 Subject: [PATCH 1/2] Update transformation types for Cloudinary Video Player #202 --- packages/types/package.json | 5 +- .../src/types/cloudinary-video-player.ts | 343 ++++++++++++++++++ 2 files changed, 347 insertions(+), 1 deletion(-) diff --git a/packages/types/package.json b/packages/types/package.json index 6210712..e56136b 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -30,5 +30,8 @@ "bugs": { "url": "https://github.com/cloudinary-community/cloudinary-util/issues" }, - "homepage": "https://github.com/cloudinary-community/cloudinary-util" + "homepage": "https://github.com/cloudinary-community/cloudinary-util", + "dependencies": { + "@cloudinary/url-gen": "1.15.0" + } } diff --git a/packages/types/src/types/cloudinary-video-player.ts b/packages/types/src/types/cloudinary-video-player.ts index d9f13bb..3e6117e 100644 --- a/packages/types/src/types/cloudinary-video-player.ts +++ b/packages/types/src/types/cloudinary-video-player.ts @@ -1,3 +1,7 @@ +import { + type Transformation, +} from "@cloudinary/url-gen"; + export interface CloudinaryVideoPlayerPlaylistOptions { /** * Whether to auto-advance to the next video and the delay between them. @@ -483,3 +487,342 @@ export interface CloudinaryVideoPlayerOptionPosterOptions { */ posterColor?: string; } + +export type AudioCodecType = string | "none" | "aac" | "vorbis" | "mp3"; + +export type AudioFrequency = +string +| number +| 8000 +| 11025 +| 16000 +| 22050 +| 32000 +| 37800 +| 44056 +| 44100 +| 47250 +| 48000 +| 88200 +| 96000 +| 176400 +| 192000; + +export type ColorSpaceType = +string +| "srgb" +| "cmyk" +|"no_cmyk" +| "keep_cmyk" +| "tinysrgb" +| "srgb:truecolor"; + +export type CropMode = +string +| "scale" +| "fit" +| "limit" +| "mfit" +| "fill" +| "lfill" +| "pad" +| "lpad" +| "mpad" +| "crop" +| "thumb" +| "imagga_crop" +| "imagga_scale"; + +export type Gravity = +string +| "north_west" +| "north" +| "north_east" +| "west" +| "center" +| "east" +| "south_west" +| "south" +| "south_east" +| "xy_center" +| "face" +| "face:center" +| "face:auto" +| "faces" +| "faces:center" +| "faces:auto" +| "body" +| "body:face" +| "adv_face" +| "adv_faces" +| "adv_eyes" +| "custom" +| "custom:face" +| "custom:faces" +| "custom:adv_face" +| "custom:adv_faces" +| "auto" +| "auto:adv_face" +| "auto:adv_faces" +| "auto:adv_eyes" +| "auto:body" +| "auto:face" +| "auto:faces" +| "auto:custom_no_override" +| "auto:none" +| "liquid" +| "ocr_text"; + +export type ImageEffect = +string +| "hue" +| "red" +| "green" +| "blue" +| "negate" +| "brightness" +| "auto_brightness" +| "brightness_hsb" +| "sepia" +| "grayscale" +| "blackwhite" +| "saturation" +| "colorize" +| "replace_color" +| "simulate_colorblind" +| "assist_colorblind" +| "recolor" +| "tint" +| "contrast" +| "auto_contrast" +| "auto_color" +| "vibrance" +| "noise" +| "ordered_dither" +| "pixelate_faces" +| "pixelate_region" +| "pixelate" +| "unsharp_mask" +| "sharpen" +| "blur_faces" +| "blur_region" +| "blur" +| "tilt_shift" +| "gradient_fade" +| "vignette" +| "anti_removal" +| "overlay" +| "mask" +| "multiply" +| "displace" +| "shear" +| "distort" +| "trim" +| "make_transparent" +| "shadow" +| "viesus_correct" +| "fill_light" +| "gamma" +| "improve"; + +export type ImageFlags = +string +| Array +| "any_format" +| "attachment" +| "apng" +| "awebp" +| "clip" +| "clip_evenodd" +| "cutter" +| "force_strip" +| "force_icc" +| "getinfo" +| "ignore_aspect_ratio" +| "immutable_cache" +| "keep_attribution" +| "keep_iptc" +| "layer_apply" +| "lossy" +| "preserve_transparency" +| "png8" +| "png24" +| "png32" +| "progressive" +| "rasterize" +| "region_relative" +| "relative" +| "replace_image" +| "sanitize" +| "strip_profile" +| "text_no_trim" +| "no_overflow" +| "text_disallow_overflow" +| "tiff8_lzw" +| "tiled"; + +export type ImageFormatType = +string | +'usdz'| +'jp2'| +'ai'| +'auto'| +'bmp'| +'eps'| +'flif'| +'gif'| +'heic'| +'ico'| +'jpc'| +'jpg'| +'pdf'| +'png'| +'psd'| +'svg'| +'tiff'| +'wdp'| +'webp'| +'arw'| +'aac'| +'aiff'| +'amr'| +'flac'| +'m4a'| +'mp3'| +'ogg'| +'opus'| +'wav'| +'avif'| +'cr2'| +'djvu'| +'eps3'| +'ept'| +'fxb'| +'gltf'| +'hdp'| +'heif'| +'indd'| +'jpe'| +'jpeg'| +'jxr'| +'ps'| +'spd'| +'tga'| +'tif'| +'3g2'| +'3gp'| +'avi'| +'flv'| +'m2ts'| +'m3u8'| +'mkv'| +'mov'| +'mp4'| +'mpd'| +'mpeg'| +'mts'| +'mxf'| +'ogv'| +'ts'| +'webm'| +'wmv'| +'glb'; + +export type RotationModeType = +stringOrNumber +| Array +| "auto_right" +| "auto_left" +| "ignore" +| "vflip" +| "hflip"; + +export type StreamingProfileTypes = +string +| "4k" +| "full_hd" +| "hd" +| "sd" +| "full_hd_wifi" +| "full_hd_lean" +| "hd_lean"; + +export type stringOrNumber = number | string; + +export interface LegacyITransforamtionOptions { + transformation?: LegacyITransforamtionOptions | string | Transformation; + raw_transformation?: string; + crop?: CropMode; + width?: stringOrNumber; + height?: stringOrNumber; + size?: string; + aspect_ratio?: stringOrNumber; + gravity?: Gravity; + x?: stringOrNumber; + y?: stringOrNumber; + zoom?: stringOrNumber; + background?: string; + angle?: RotationModeType; + radius?: stringOrNumber | stringOrNumber[]; + overlay?: string | Record; + custom_function?: string | { function_type?: string | "wasm" | "remote", source?: string } + variables?: Array>; + if?: string; + else?: string; + end_if?: string; + dpr?: stringOrNumber; + quality?: stringOrNumber; + delay?: stringOrNumber; + // eslint-disable-next-line @typescript-eslint/ban-types + underlay?: string | Object; + color?: string; + color_space?: ColorSpaceType; + opacity?: stringOrNumber; + border?: { + width?: stringOrNumber; + color?: string; + } | string; + default_image?: string; + density?: stringOrNumber; + format?: ImageFormatType; + fetch_format?: ImageFormatType; + effect?: string | Array | ImageEffect; + page?: stringOrNumber; + flags?: ImageFlags | [] | string; + audio_codec?: AudioCodecType; + audio_frequency?: AudioFrequency; + // eslint-disable-next-line @typescript-eslint/ban-types + video_codec?: string | Object; + bit_rate?: stringOrNumber; + fps?: string | Array; + keyframe_interval?: string; + offset?: string, + start_offset?: stringOrNumber; + end_offset?: stringOrNumber; + duration?: stringOrNumber; + streaming_profile?: StreamingProfileTypes + video_sampling?: stringOrNumber; + cloud_name?: string; + api_key?: string; + api_secret?: string; + private_cdn?: boolean; + secure_distribution?: string; + force_version?: boolean; + ssl_detected?: boolean; + secure?: boolean; + cdn_subdomain?: boolean; + secure_cdn_subdomain?: boolean; + cname?: string; + shorten?: boolean; + sign_url?: boolean; + long_url_signature?: boolean; + use_root_path?: boolean; + // eslint-disable-next-line @typescript-eslint/ban-types + auth_token?: object; + account_id?: string; + provisioning_api_key?: string; + provisioning_api_secret?: string; + version?: stringOrNumber; + url_suffix?: string; + [futureKey: string]: any; +} From ba8f7d1a85aa45acaf94e0bba3bfe0304b6e04b0 Mon Sep 17 00:00:00 2001 From: nooras Date: Wed, 9 Oct 2024 20:22:03 +0530 Subject: [PATCH 2/2] Lock file added --- pnpm-lock.yaml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1bc4a7f..3496d91 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -127,7 +127,11 @@ importers: specifier: ^5.3.3 version: 5.3.3 - packages/types: {} + packages/types: + dependencies: + '@cloudinary/url-gen': + specifier: 1.15.0 + version: 1.15.0 packages/url-loader: dependencies: @@ -7958,8 +7962,8 @@ snapshots: '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.5.2) eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.2))(eslint@8.57.0))(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.2))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) eslint-plugin-jsx-a11y: 6.9.0(eslint@8.57.0) eslint-plugin-react: 7.34.3(eslint@8.57.0) eslint-plugin-react-hooks: 4.6.2(eslint@8.57.0) @@ -7983,13 +7987,13 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.57.0): + eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.2))(eslint@8.57.0))(eslint@8.57.0): dependencies: debug: 4.3.6 enhanced-resolve: 5.17.0 eslint: 8.57.0 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.2))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.2))(eslint@8.57.0) fast-glob: 3.3.2 get-tsconfig: 4.7.5 is-core-module: 2.13.1 @@ -8010,14 +8014,14 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.2))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.5.2) eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.57.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.2))(eslint@8.57.0))(eslint@8.57.0) transitivePeerDependencies: - supports-color @@ -8048,7 +8052,7 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): + eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.2))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): dependencies: array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 @@ -8058,7 +8062,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.2))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) hasown: 2.0.0 is-core-module: 2.13.1 is-glob: 4.0.3