From 7eb826a56e74292f61ece3ed841ba9403717d04a Mon Sep 17 00:00:00 2001 From: JustRaus43574887 Date: Tue, 3 Feb 2026 15:08:42 +0300 Subject: [PATCH] CCS-110446 feature: echo_file/files media quality --- package.json | 2 +- src/lib/client/file.ts | 9 +++++++++ src/types/events.ts | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index d184a8c..20e6c07 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@expressms/smartapp-sdk", - "version": "1.13.0-alpha.12", + "version": "1.14.0-alpha.1", "description": "Smartapp SDK", "main": "build/main/index.js", "typings": "build/main/index.d.ts", diff --git a/src/lib/client/file.ts b/src/lib/client/file.ts index 65ce3fc..5b97dd9 100644 --- a/src/lib/client/file.ts +++ b/src/lib/client/file.ts @@ -2,6 +2,7 @@ import bridge from '@expressms/smartapp-bridge' import { ERROR_CODES, File, + FILE_MEDIA_QUALITY, METHODS, StatusResponse, UploadFilesTypeResponse, @@ -31,14 +32,17 @@ const openFile = async (file: File): Promise => { * Upload single file with client * @param mimeType Mime type of allowed files * @param maxSize Max file size in bytes + * @param mediaQuality File media quality (For example: low mediaQuality - high compression ratio on client) * @returns Promise that'll be fullfilled with file metadata on success, otherwise rejected with reason */ const uploadFile = async ({ mimeType, maxSize, + mediaQuality, }: { mimeType: string maxSize?: number + mediaQuality?: FILE_MEDIA_QUALITY | null }): Promise => { if (!bridge) return Promise.reject(ERROR_CODES.NO_BRIDGE) @@ -47,6 +51,7 @@ const uploadFile = async ({ params: { type: mimeType, maxSize, + mediaQuality, }, timeout: FILE_LOAD_TIMEOUT, }) @@ -59,16 +64,19 @@ const uploadFile = async ({ * @param mimeType Mime type of allowed files * @param maxSize Max file size in bytes * @param totalSize Total files size in bytes + * @param mediaQuality File media quality (For example: low mediaQuality - high compression ratio on client) * @returns Promise that'll be fullfilled with files metadata on success, otherwise rejected with reason */ const uploadFiles = async ({ mimeType, maxSize, totalSize, + mediaQuality, }: { mimeType: string maxSize?: number, totalSize?: number, + mediaQuality?: FILE_MEDIA_QUALITY | null }): Promise => { if (!bridge) return Promise.reject(ERROR_CODES.NO_BRIDGE) @@ -78,6 +86,7 @@ const uploadFiles = async ({ type: mimeType, maxSize, totalSize, + mediaQuality, }, timeout: FILE_LOAD_TIMEOUT, }) diff --git a/src/types/events.ts b/src/types/events.ts index 9f93aa4..558274c 100644 --- a/src/types/events.ts +++ b/src/types/events.ts @@ -13,3 +13,9 @@ export type SubscriptionPayload = { type: SubscriptionPayloadType id: string } + +export enum FILE_MEDIA_QUALITY { + LOW = 'low', + MEDIUM = 'medium', + HIGH = 'high', +}