From 0b00262f6150cf8b1bb1addd00510cf3417b4b56 Mon Sep 17 00:00:00 2001 From: Stanislav K Date: Fri, 19 Apr 2024 21:38:49 +0300 Subject: [PATCH 01/16] FS-8673 Add alt text to images (#550) * FS-8673 Add alt text to images * updated the branch name * Fix failing spec * Switch picker version to beta * update build branch * add log * update picker version * update version to beta * add log * add alt to response interface * cleanup and final commit * clean up * Add useNewTransformer * Update README.md --------- Co-authored-by: Stanislav Kolotinskiy Co-authored-by: hemanth-3 <98961835+hemanth-3@users.noreply.github.com> Co-authored-by: gary-singh-filestack --- .github/workflows/deploy_beta.yml | 2 +- README.md | 1 - src/config.ts | 3 +-- src/lib/api/upload/file.ts | 2 ++ src/lib/api/upload/types.ts | 2 ++ src/lib/api/upload/upload.ts | 7 ++++++- src/lib/api/upload/uploaders/s3.ts | 3 ++- src/lib/client.spec.ts | 27 +++++++++++++++++++++++++-- src/lib/client.ts | 2 +- src/lib/picker.ts | 8 ++++++++ src/schema/picker.schema.ts | 3 +++ src/schema/upload.schema.ts | 4 ++++ 12 files changed, 55 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy_beta.yml b/.github/workflows/deploy_beta.yml index aff5a826..f53053ed 100644 --- a/.github/workflows/deploy_beta.yml +++ b/.github/workflows/deploy_beta.yml @@ -1,7 +1,7 @@ name: filestack-js-beta on: push: - branches: [ develop ] + branches: [ sc-add-alt-text ] jobs: build: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 015f7dd9..7d7cd45c 100644 --- a/README.md +++ b/README.md @@ -239,7 +239,6 @@ If you're using [Sentry](https://sentry.io/welcome/) to monitor your application ## Versioning We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags](https://github.com/filestack/filestack-js/tags) on this repository. - ## Contributing We follow the [conventional commits](https://conventionalcommits.org/) specification to ensure consistent commit messages and changelog formatting. diff --git a/src/config.ts b/src/config.ts index 4fb1bdd8..4570b941 100644 --- a/src/config.ts +++ b/src/config.ts @@ -18,8 +18,7 @@ /** * @private */ -const PICKER_VERSION = '1.26.2'; - +const PICKER_VERSION = 'beta'; /** * @private */ diff --git a/src/lib/api/upload/file.ts b/src/lib/api/upload/file.ts index 2e2360d6..7abd6645 100644 --- a/src/lib/api/upload/file.ts +++ b/src/lib/api/upload/file.ts @@ -79,6 +79,8 @@ export class File { public uploadTags: UploadTags; + public alt: string; + constructor(private readonly _file: FileInstance, private readonly _sanitizeOptions?: SanitizeOptions) { this._file.name = sanitizeName(this._file.name, this._sanitizeOptions); } diff --git a/src/lib/api/upload/types.ts b/src/lib/api/upload/types.ts index 1c927303..9414a3d6 100644 --- a/src/lib/api/upload/types.ts +++ b/src/lib/api/upload/types.ts @@ -81,6 +81,8 @@ export interface UploadOptions { * @memberof UploadOptions */ tags?: UploadTags; + + altText?: string; } export type StoreUploadOptions = StoreBaseParams & { diff --git a/src/lib/api/upload/upload.ts b/src/lib/api/upload/upload.ts index 6ae39da9..a91b2cd8 100644 --- a/src/lib/api/upload/upload.ts +++ b/src/lib/api/upload/upload.ts @@ -199,13 +199,18 @@ export class Upload extends EventEmitter { * Upload single file * * @param {(InputFile)} file + * @param {(string)} altText * @returns {Promise} * @memberof Upload */ - async upload(input: InputFile): Promise { + async upload(input: InputFile, altText?: string): Promise { const f = await getFile(input, this.sanitizerOptions); f.customName = this.overrideFileName; + if (altText) { + f.alt = altText; + } + this.uploader.addFile(f); this.startProgressInterval(); diff --git a/src/lib/api/upload/uploaders/s3.ts b/src/lib/api/upload/uploaders/s3.ts index 24c05669..b7a49195 100644 --- a/src/lib/api/upload/uploaders/s3.ts +++ b/src/lib/api/upload/uploaders/s3.ts @@ -212,6 +212,7 @@ export class S3Uploader extends UploaderAbstract { location_url: payload.location_url, upload_id: payload.upload_id, region: payload.region, + alt: payload.file.alt, }; if (this.uploadMode === UploadMode.INTELLIGENT || (this.uploadMode === UploadMode.FALLBACK && fiiFallback)) { @@ -687,7 +688,7 @@ export class S3Uploader extends UploaderAbstract { return FsRequest.post( `${this.getUploadUrl(id)}/multipart/complete`, { - ...this.getDefaultFields(id, ['apikey', 'policy', 'signature', 'uri', 'region', 'upload_id', 'fii'], true), + ...this.getDefaultFields(id, ['apikey', 'policy', 'signature', 'uri', 'region', 'upload_id', 'fii', 'alt'], true), // method specific keys filename: payload.file.name, mimetype: payload.file.type, diff --git a/src/lib/client.spec.ts b/src/lib/client.spec.ts index a85f2125..1ce54591 100644 --- a/src/lib/client.spec.ts +++ b/src/lib/client.spec.ts @@ -210,7 +210,30 @@ describe('client', () => { expect(Upload.prototype.setToken).toHaveBeenCalledWith(token); expect(Upload.prototype.setSecurity).toHaveBeenCalledWith(defaultSecurity); - expect(Upload.prototype.upload).toHaveBeenCalledWith(file); + expect(Upload.prototype.upload).toHaveBeenCalledWith(file, undefined); + }); + + it('should be able to upload file with alt text', async () => { + const client = new Client(defaultApikey); + const file = 'anyFile'; + const uploadOptions = { + altText: 'alt', + }; + const storeOptions = {}; + const token = {}; + + jest.spyOn(Upload.prototype, 'upload').mockImplementation(() => Promise.resolve()); + + await client.upload(file, uploadOptions, storeOptions, token, defaultSecurity); + + expect(Upload.prototype.setSession).toHaveBeenCalledWith({ + apikey: defaultApikey, + urls: sessionURls, + }); + + expect(Upload.prototype.setToken).toHaveBeenCalledWith(token); + expect(Upload.prototype.setSecurity).toHaveBeenCalledWith(defaultSecurity); + expect(Upload.prototype.upload).toHaveBeenCalledWith(file, uploadOptions.altText); }); it('should be able to upload file without token and security', async () => { @@ -228,7 +251,7 @@ describe('client', () => { urls: sessionURls, }); - expect(Upload.prototype.upload).toHaveBeenCalledWith(file); + expect(Upload.prototype.upload).toHaveBeenCalledWith(file, undefined); }); it('should emit error', async () => { diff --git a/src/lib/client.ts b/src/lib/client.ts index d0ae40da..5e3869f6 100644 --- a/src/lib/client.ts +++ b/src/lib/client.ts @@ -475,7 +475,7 @@ export class Client extends EventEmitter { this.emit('upload.error', e); }); - return upload.upload(file); + return upload.upload(file, options.altText); } /** diff --git a/src/lib/picker.ts b/src/lib/picker.ts index 30a87d72..1c2bd962 100644 --- a/src/lib/picker.ts +++ b/src/lib/picker.ts @@ -155,6 +155,10 @@ export interface PickerFileMetadata { * The Filestack CDN URL for the uploaded file. */ url: string; + /** + * Alt text for images + */ + alt: string; } export interface CustomAuthTextOptions { @@ -683,6 +687,10 @@ export interface PickerOptions { * Specify options for images passed to the crop UI. */ transformations?: PickerTransformationOptions; + /** + * Whether to use the new transformations UI. Defaults to `false`. + */ + useNewTransformer?: boolean; /** * Options for local file uploads. */ diff --git a/src/schema/picker.schema.ts b/src/schema/picker.schema.ts index 34dd60bc..1eeb7daa 100644 --- a/src/schema/picker.schema.ts +++ b/src/schema/picker.schema.ts @@ -439,6 +439,9 @@ export const PickerParamsSchema = { useSentryBreadcrumbs: { type: 'boolean', }, + useNewTransformer: { + type: 'boolean', + }, pasteMode: { type: 'object', additionalProperties: false, diff --git a/src/schema/upload.schema.ts b/src/schema/upload.schema.ts index fc964ded..8620fb54 100644 --- a/src/schema/upload.schema.ts +++ b/src/schema/upload.schema.ts @@ -81,5 +81,9 @@ export const UploadParamsSchema = { maxlength: 256, }, }, + altText: { + type: ['string', 'null'], + maxLength: 60, + }, }, }; From ab33dea96c59ac7a380c52f204ee332401794f2e Mon Sep 17 00:00:00 2001 From: Seth <87805180+sethk4783@users.noreply.github.com> Date: Tue, 30 Apr 2024 02:10:45 +0530 Subject: [PATCH 02/16] [FS-9995] Changing the sequence in fromSource fixed (#561) * Error fixes for declaring the custom source at first place in fromSources array (FS-9995) Co-authored-by: Arif Hussain --- src/schema/picker.schema.ts | 61 +++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/src/schema/picker.schema.ts b/src/schema/picker.schema.ts index 1eeb7daa..d7a1a44e 100644 --- a/src/schema/picker.schema.ts +++ b/src/schema/picker.schema.ts @@ -57,35 +57,38 @@ export const PickerParamsSchema = { }, fromSources: { type: 'array', - items: [ - { - type: ['string', 'object'], - additionalProperties: false, - enum: [ - 'local_file_system', - 'url', - 'imagesearch', - 'facebook', - 'instagram', - 'googledrive', - 'unsplash', - 'dropbox', - 'webcam', - 'video', - 'audio', - 'box', - 'github', - 'gmail', - 'googlephotos', - 'onedrive', - 'onedriveforbusiness', - 'clouddrive', - 'googlephotos', - 'customsource', - 'tint', - ], - }, - ], + items: { + anyOf: [ + { + type: 'string', + enum: [ + 'local_file_system', + 'url', + 'imagesearch', + 'facebook', + 'instagram', + 'googledrive', + 'unsplash', + 'dropbox', + 'webcam', + 'video', + 'audio', + 'box', + 'github', + 'gmail', + 'googlephotos', + 'onedrive', + 'onedriveforbusiness', + 'clouddrive', + 'customsource', + 'tint', + ], + }, + { + type: 'object', + }, + ], + }, }, container: { format: 'HTMLContainer', From cf939db69944dc0fcc9319a3926c7560086fb72d Mon Sep 17 00:00:00 2001 From: gary-singh-filestack Date: Thu, 23 May 2024 14:33:27 +0530 Subject: [PATCH 03/16] fix:(FS-11598: handle support for vsdx accept option) --- src/lib/utils/extensions.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/utils/extensions.ts b/src/lib/utils/extensions.ts index b3e02d32..60c06155 100644 --- a/src/lib/utils/extensions.ts +++ b/src/lib/utils/extensions.ts @@ -640,6 +640,7 @@ export const ExtensionsMap = { 'application/vnd.uoml+xml': ['uoml'], 'application/vnd.vcx': ['vcx'], 'application/vnd.visio': ['vsd', 'vst', 'vss', 'vsw'], + 'application/vnd.ms-visio.drawing.main+xml': ['vsdx'], 'application/vnd.visionary': ['vis'], 'application/vnd.vsf': ['vsf'], 'application/vnd.wap.wbxml': ['wbxml'], From adc3d4529f2b829d3e01841aeb36886929174d05 Mon Sep 17 00:00:00 2001 From: hemanth-3 Date: Tue, 28 May 2024 16:17:30 +0530 Subject: [PATCH 04/16] modified the branch name in the workflow --- .github/workflows/deploy_beta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_beta.yml b/.github/workflows/deploy_beta.yml index f53053ed..aff5a826 100644 --- a/.github/workflows/deploy_beta.yml +++ b/.github/workflows/deploy_beta.yml @@ -1,7 +1,7 @@ name: filestack-js-beta on: push: - branches: [ sc-add-alt-text ] + branches: [ develop ] jobs: build: runs-on: ubuntu-latest From acb13398b361fa47a86deeaab99ae333d1bb1cef Mon Sep 17 00:00:00 2001 From: sethk4783 Date: Thu, 30 May 2024 14:51:54 +0530 Subject: [PATCH 05/16] chore:Updated picker version --- src/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.ts b/src/config.ts index db07d930..fa734e78 100644 --- a/src/config.ts +++ b/src/config.ts @@ -18,7 +18,7 @@ /** * @private */ -const PICKER_VERSION = 'stage'; +const PICKER_VERSION = 'beta'; /** * @private From f338707b639077564ab434fa5e08b6655c043cb6 Mon Sep 17 00:00:00 2001 From: Stanislav K Date: Fri, 19 Apr 2024 21:38:49 +0300 Subject: [PATCH 06/16] FS-8673 Add alt text to images (#550) * FS-8673 Add alt text to images * updated the branch name * Fix failing spec * Switch picker version to beta * update build branch * add log * update picker version * update version to beta * add log * add alt to response interface * cleanup and final commit * clean up * Add useNewTransformer * Update README.md --------- Co-authored-by: Stanislav Kolotinskiy Co-authored-by: hemanth-3 <98961835+hemanth-3@users.noreply.github.com> Co-authored-by: gary-singh-filestack --- .github/workflows/deploy_beta.yml | 2 +- README.md | 1 - src/config.ts | 2 +- src/lib/api/upload/file.ts | 2 ++ src/lib/api/upload/types.ts | 2 ++ src/lib/api/upload/upload.ts | 7 ++++++- src/lib/api/upload/uploaders/s3.ts | 3 ++- src/lib/client.spec.ts | 27 +++++++++++++++++++++++++-- src/lib/client.ts | 2 +- src/lib/picker.ts | 8 ++++++++ src/schema/picker.schema.ts | 3 +++ src/schema/upload.schema.ts | 4 ++++ 12 files changed, 55 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy_beta.yml b/.github/workflows/deploy_beta.yml index aff5a826..f53053ed 100644 --- a/.github/workflows/deploy_beta.yml +++ b/.github/workflows/deploy_beta.yml @@ -1,7 +1,7 @@ name: filestack-js-beta on: push: - branches: [ develop ] + branches: [ sc-add-alt-text ] jobs: build: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 015f7dd9..7d7cd45c 100644 --- a/README.md +++ b/README.md @@ -239,7 +239,6 @@ If you're using [Sentry](https://sentry.io/welcome/) to monitor your application ## Versioning We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags](https://github.com/filestack/filestack-js/tags) on this repository. - ## Contributing We follow the [conventional commits](https://conventionalcommits.org/) specification to ensure consistent commit messages and changelog formatting. diff --git a/src/config.ts b/src/config.ts index e63c70fe..fa734e78 100644 --- a/src/config.ts +++ b/src/config.ts @@ -18,7 +18,7 @@ /** * @private */ -const PICKER_VERSION = '1.27.1'; +const PICKER_VERSION = 'beta'; /** * @private diff --git a/src/lib/api/upload/file.ts b/src/lib/api/upload/file.ts index 2e2360d6..7abd6645 100644 --- a/src/lib/api/upload/file.ts +++ b/src/lib/api/upload/file.ts @@ -79,6 +79,8 @@ export class File { public uploadTags: UploadTags; + public alt: string; + constructor(private readonly _file: FileInstance, private readonly _sanitizeOptions?: SanitizeOptions) { this._file.name = sanitizeName(this._file.name, this._sanitizeOptions); } diff --git a/src/lib/api/upload/types.ts b/src/lib/api/upload/types.ts index 1c927303..9414a3d6 100644 --- a/src/lib/api/upload/types.ts +++ b/src/lib/api/upload/types.ts @@ -81,6 +81,8 @@ export interface UploadOptions { * @memberof UploadOptions */ tags?: UploadTags; + + altText?: string; } export type StoreUploadOptions = StoreBaseParams & { diff --git a/src/lib/api/upload/upload.ts b/src/lib/api/upload/upload.ts index 6ae39da9..a91b2cd8 100644 --- a/src/lib/api/upload/upload.ts +++ b/src/lib/api/upload/upload.ts @@ -199,13 +199,18 @@ export class Upload extends EventEmitter { * Upload single file * * @param {(InputFile)} file + * @param {(string)} altText * @returns {Promise} * @memberof Upload */ - async upload(input: InputFile): Promise { + async upload(input: InputFile, altText?: string): Promise { const f = await getFile(input, this.sanitizerOptions); f.customName = this.overrideFileName; + if (altText) { + f.alt = altText; + } + this.uploader.addFile(f); this.startProgressInterval(); diff --git a/src/lib/api/upload/uploaders/s3.ts b/src/lib/api/upload/uploaders/s3.ts index 24c05669..b7a49195 100644 --- a/src/lib/api/upload/uploaders/s3.ts +++ b/src/lib/api/upload/uploaders/s3.ts @@ -212,6 +212,7 @@ export class S3Uploader extends UploaderAbstract { location_url: payload.location_url, upload_id: payload.upload_id, region: payload.region, + alt: payload.file.alt, }; if (this.uploadMode === UploadMode.INTELLIGENT || (this.uploadMode === UploadMode.FALLBACK && fiiFallback)) { @@ -687,7 +688,7 @@ export class S3Uploader extends UploaderAbstract { return FsRequest.post( `${this.getUploadUrl(id)}/multipart/complete`, { - ...this.getDefaultFields(id, ['apikey', 'policy', 'signature', 'uri', 'region', 'upload_id', 'fii'], true), + ...this.getDefaultFields(id, ['apikey', 'policy', 'signature', 'uri', 'region', 'upload_id', 'fii', 'alt'], true), // method specific keys filename: payload.file.name, mimetype: payload.file.type, diff --git a/src/lib/client.spec.ts b/src/lib/client.spec.ts index a85f2125..1ce54591 100644 --- a/src/lib/client.spec.ts +++ b/src/lib/client.spec.ts @@ -210,7 +210,30 @@ describe('client', () => { expect(Upload.prototype.setToken).toHaveBeenCalledWith(token); expect(Upload.prototype.setSecurity).toHaveBeenCalledWith(defaultSecurity); - expect(Upload.prototype.upload).toHaveBeenCalledWith(file); + expect(Upload.prototype.upload).toHaveBeenCalledWith(file, undefined); + }); + + it('should be able to upload file with alt text', async () => { + const client = new Client(defaultApikey); + const file = 'anyFile'; + const uploadOptions = { + altText: 'alt', + }; + const storeOptions = {}; + const token = {}; + + jest.spyOn(Upload.prototype, 'upload').mockImplementation(() => Promise.resolve()); + + await client.upload(file, uploadOptions, storeOptions, token, defaultSecurity); + + expect(Upload.prototype.setSession).toHaveBeenCalledWith({ + apikey: defaultApikey, + urls: sessionURls, + }); + + expect(Upload.prototype.setToken).toHaveBeenCalledWith(token); + expect(Upload.prototype.setSecurity).toHaveBeenCalledWith(defaultSecurity); + expect(Upload.prototype.upload).toHaveBeenCalledWith(file, uploadOptions.altText); }); it('should be able to upload file without token and security', async () => { @@ -228,7 +251,7 @@ describe('client', () => { urls: sessionURls, }); - expect(Upload.prototype.upload).toHaveBeenCalledWith(file); + expect(Upload.prototype.upload).toHaveBeenCalledWith(file, undefined); }); it('should emit error', async () => { diff --git a/src/lib/client.ts b/src/lib/client.ts index d0ae40da..5e3869f6 100644 --- a/src/lib/client.ts +++ b/src/lib/client.ts @@ -475,7 +475,7 @@ export class Client extends EventEmitter { this.emit('upload.error', e); }); - return upload.upload(file); + return upload.upload(file, options.altText); } /** diff --git a/src/lib/picker.ts b/src/lib/picker.ts index 30a87d72..1c2bd962 100644 --- a/src/lib/picker.ts +++ b/src/lib/picker.ts @@ -155,6 +155,10 @@ export interface PickerFileMetadata { * The Filestack CDN URL for the uploaded file. */ url: string; + /** + * Alt text for images + */ + alt: string; } export interface CustomAuthTextOptions { @@ -683,6 +687,10 @@ export interface PickerOptions { * Specify options for images passed to the crop UI. */ transformations?: PickerTransformationOptions; + /** + * Whether to use the new transformations UI. Defaults to `false`. + */ + useNewTransformer?: boolean; /** * Options for local file uploads. */ diff --git a/src/schema/picker.schema.ts b/src/schema/picker.schema.ts index 34dd60bc..1eeb7daa 100644 --- a/src/schema/picker.schema.ts +++ b/src/schema/picker.schema.ts @@ -439,6 +439,9 @@ export const PickerParamsSchema = { useSentryBreadcrumbs: { type: 'boolean', }, + useNewTransformer: { + type: 'boolean', + }, pasteMode: { type: 'object', additionalProperties: false, diff --git a/src/schema/upload.schema.ts b/src/schema/upload.schema.ts index fc964ded..8620fb54 100644 --- a/src/schema/upload.schema.ts +++ b/src/schema/upload.schema.ts @@ -81,5 +81,9 @@ export const UploadParamsSchema = { maxlength: 256, }, }, + altText: { + type: ['string', 'null'], + maxLength: 60, + }, }, }; From 93587c730b418ebe46fa2125cc4454ec25e2e8aa Mon Sep 17 00:00:00 2001 From: Seth <87805180+sethk4783@users.noreply.github.com> Date: Tue, 30 Apr 2024 02:10:45 +0530 Subject: [PATCH 07/16] [FS-9995] Changing the sequence in fromSource fixed (#561) * Error fixes for declaring the custom source at first place in fromSources array (FS-9995) Co-authored-by: Arif Hussain --- src/schema/picker.schema.ts | 61 +++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/src/schema/picker.schema.ts b/src/schema/picker.schema.ts index 1eeb7daa..d7a1a44e 100644 --- a/src/schema/picker.schema.ts +++ b/src/schema/picker.schema.ts @@ -57,35 +57,38 @@ export const PickerParamsSchema = { }, fromSources: { type: 'array', - items: [ - { - type: ['string', 'object'], - additionalProperties: false, - enum: [ - 'local_file_system', - 'url', - 'imagesearch', - 'facebook', - 'instagram', - 'googledrive', - 'unsplash', - 'dropbox', - 'webcam', - 'video', - 'audio', - 'box', - 'github', - 'gmail', - 'googlephotos', - 'onedrive', - 'onedriveforbusiness', - 'clouddrive', - 'googlephotos', - 'customsource', - 'tint', - ], - }, - ], + items: { + anyOf: [ + { + type: 'string', + enum: [ + 'local_file_system', + 'url', + 'imagesearch', + 'facebook', + 'instagram', + 'googledrive', + 'unsplash', + 'dropbox', + 'webcam', + 'video', + 'audio', + 'box', + 'github', + 'gmail', + 'googlephotos', + 'onedrive', + 'onedriveforbusiness', + 'clouddrive', + 'customsource', + 'tint', + ], + }, + { + type: 'object', + }, + ], + }, }, container: { format: 'HTMLContainer', From 36c81e8ca0cf7523d97a068afeded68a24ccf00c Mon Sep 17 00:00:00 2001 From: hemanth-3 Date: Tue, 28 May 2024 16:17:30 +0530 Subject: [PATCH 08/16] modified the branch name in the workflow --- .github/workflows/deploy_beta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_beta.yml b/.github/workflows/deploy_beta.yml index f53053ed..aff5a826 100644 --- a/.github/workflows/deploy_beta.yml +++ b/.github/workflows/deploy_beta.yml @@ -1,7 +1,7 @@ name: filestack-js-beta on: push: - branches: [ sc-add-alt-text ] + branches: [ develop ] jobs: build: runs-on: ubuntu-latest From 859ae705c2c887b7b62c6c6cea84ff6752066728 Mon Sep 17 00:00:00 2001 From: sethk4783 Date: Thu, 13 Jun 2024 16:18:48 +0530 Subject: [PATCH 09/16] fix:Updated mimetype and extension --- src/lib/utils/extensions.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/utils/extensions.ts b/src/lib/utils/extensions.ts index 60c06155..1e7cb119 100644 --- a/src/lib/utils/extensions.ts +++ b/src/lib/utils/extensions.ts @@ -219,6 +219,7 @@ export const ExtensionsMap = { 'image/jls': ['jls'], 'image/jp2': ['jp2', 'jpg2'], 'image/jpeg': ['jpeg', 'jpg', 'jpe'], + 'image/jpg': ['jpeg', 'jpg', 'jpe'], 'image/jpm': ['jpm'], 'image/jpx': ['jpx', 'jpf'], 'image/jxr': ['jxr'], @@ -930,6 +931,8 @@ export const ExtensionsMap = { 'video/x-ms-wmx': ['wmx'], 'video/x-ms-wvx': ['wvx'], 'video/vnd.avi': ['avi'], + 'video/x-msvideo': ['avi'], + 'video/avi': ['avi'], 'video/x-sgi-movie': ['movie'], 'video/x-smv': ['smv'], 'x-conference/x-cooltalk': ['ice'], From b8d28a191ee7ed737a516d582b8cbdc3e32e5e29 Mon Sep 17 00:00:00 2001 From: sethk4783 Date: Thu, 30 May 2024 17:30:32 +0530 Subject: [PATCH 10/16] chore:Updated changelog and version --- CHANGELOG.md | 3 +++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86c2a671..90d168f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [3.32.1](https://github.com/filestack/filestack-js/compare/v3.32.0...v3.32.1) (2024-05-30) + * **miemtypes:** Fixed support for vsdx file using through accept params + ## [3.32.0](https://github.com/filestack/filestack-js/compare/v3.31.0...v3.32.0) (2024-04-03) ### Updgrade diff --git a/package-lock.json b/package-lock.json index 8bcf4b9b..449fd1c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "filestack-js", - "version": "3.32.0", + "version": "3.32.1", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 5e4bfc5c..ab1c5d59 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "filestack-js", - "version": "3.32.0", + "version": "3.32.1", "description": "Official JavaScript library for Filestack", "main": "build/main/index.js", "module": "build/module/index.js", From 25ad7d4e5334f948441c1df2b7dd8b39ddfc8593 Mon Sep 17 00:00:00 2001 From: sethk4783 Date: Fri, 14 Jun 2024 19:21:41 +0530 Subject: [PATCH 11/16] chore:Updated changelog and version --- CHANGELOG.md | 4 ++++ package-lock.json | 2 +- package.json | 2 +- src/config.ts | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90d168f9..509f5a57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [3.32.2](https://github.com/filestack/filestack-js/compare/v3.32.1...v3.32.2) (2024-06-14) + * **picker:** Upgraded picker to v1.27.3. + * **fromSources:** Fixed declaring the custom source at first place in fromSources array + ## [3.32.1](https://github.com/filestack/filestack-js/compare/v3.32.0...v3.32.1) (2024-05-30) * **miemtypes:** Fixed support for vsdx file using through accept params diff --git a/package-lock.json b/package-lock.json index 449fd1c2..5ab78606 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "filestack-js", - "version": "3.32.1", + "version": "3.32.2", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index ab1c5d59..cc253a38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "filestack-js", - "version": "3.32.1", + "version": "3.32.2", "description": "Official JavaScript library for Filestack", "main": "build/main/index.js", "module": "build/module/index.js", diff --git a/src/config.ts b/src/config.ts index fa734e78..cf7231af 100644 --- a/src/config.ts +++ b/src/config.ts @@ -18,7 +18,7 @@ /** * @private */ -const PICKER_VERSION = 'beta'; +const PICKER_VERSION = '1.27.3'; /** * @private From 98ae87b89998a3825dddce5da72b461119f2d643 Mon Sep 17 00:00:00 2001 From: Stanislav K Date: Fri, 19 Apr 2024 21:38:49 +0300 Subject: [PATCH 12/16] FS-8673 Add alt text to images (#550) * FS-8673 Add alt text to images * updated the branch name * Fix failing spec * Switch picker version to beta * update build branch * add log * update picker version * update version to beta * add log * add alt to response interface * cleanup and final commit * clean up * Add useNewTransformer * Update README.md --------- Co-authored-by: Stanislav Kolotinskiy Co-authored-by: hemanth-3 <98961835+hemanth-3@users.noreply.github.com> Co-authored-by: gary-singh-filestack --- .github/workflows/deploy_beta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_beta.yml b/.github/workflows/deploy_beta.yml index aff5a826..f53053ed 100644 --- a/.github/workflows/deploy_beta.yml +++ b/.github/workflows/deploy_beta.yml @@ -1,7 +1,7 @@ name: filestack-js-beta on: push: - branches: [ develop ] + branches: [ sc-add-alt-text ] jobs: build: runs-on: ubuntu-latest From fcbdf737c7b1f8f7d2a6ce7993f1cc5ecaf3504f Mon Sep 17 00:00:00 2001 From: hemanth-3 Date: Tue, 28 May 2024 16:17:30 +0530 Subject: [PATCH 13/16] modified the branch name in the workflow --- .github/workflows/deploy_beta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_beta.yml b/.github/workflows/deploy_beta.yml index f53053ed..aff5a826 100644 --- a/.github/workflows/deploy_beta.yml +++ b/.github/workflows/deploy_beta.yml @@ -1,7 +1,7 @@ name: filestack-js-beta on: push: - branches: [ sc-add-alt-text ] + branches: [ develop ] jobs: build: runs-on: ubuntu-latest From 0444f8889f3a808198dd7c774ac673911e36f30f Mon Sep 17 00:00:00 2001 From: GR Date: Wed, 3 Jul 2024 12:13:49 +0200 Subject: [PATCH 14/16] Added back picasa as a potential source (#567) * Added back picasa as a potential source * Invalid values in fromSources only trigger a warning if they are not valid instead of an error --- src/lib/picker.ts | 12 +++++++++++- src/schema/picker.schema.ts | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/lib/picker.ts b/src/lib/picker.ts index 1c2bd962..a0afd1bb 100644 --- a/src/lib/picker.ts +++ b/src/lib/picker.ts @@ -787,7 +787,17 @@ class PickerLoader { const validateRes = getValidator(PickerParamsSchema)(options); if (validateRes.errors.length) { - throw new FilestackError(`Invalid picker params`, validateRes.errors, FilestackErrorType.VALIDATION); + validateRes.errors.forEach(error => { + if (error.path.includes('fromSources')) { + console.warn(`Warning: Invalid source \"${error.instance}\" found and removed!`); + options.fromSources = options.fromSources.filter(source => source !== error.instance); + } else { + throw new FilestackError(`Invalid picker params`, validateRes.errors, FilestackErrorType.VALIDATION); + } + }); + if (!options.fromSources.length) { + delete options.fromSources; + } } this._initialized = this.loadModule(client, options); diff --git a/src/schema/picker.schema.ts b/src/schema/picker.schema.ts index d7a1a44e..6b8355cc 100644 --- a/src/schema/picker.schema.ts +++ b/src/schema/picker.schema.ts @@ -68,6 +68,7 @@ export const PickerParamsSchema = { 'facebook', 'instagram', 'googledrive', + 'picasa', 'unsplash', 'dropbox', 'webcam', From 6c0471d33cf51a07f38dbfdb7f3869aa1100e7fb Mon Sep 17 00:00:00 2001 From: Seth K Date: Thu, 25 Jul 2024 03:44:45 +0530 Subject: [PATCH 15/16] chore: Updated PICKER_VERSION for dev env --- src/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.ts b/src/config.ts index cf7231af..fa734e78 100644 --- a/src/config.ts +++ b/src/config.ts @@ -18,7 +18,7 @@ /** * @private */ -const PICKER_VERSION = '1.27.3'; +const PICKER_VERSION = 'beta'; /** * @private From d2e3fb1b8d2842aa1ad1a04125d35e255785bf61 Mon Sep 17 00:00:00 2001 From: Vambalappa K Date: Mon, 12 Aug 2024 15:40:42 +0530 Subject: [PATCH 16/16] Removed polyfill.io URL reference --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 7d7cd45c..d690dbdf 100644 --- a/README.md +++ b/README.md @@ -184,8 +184,6 @@ Polyfills we recommend:** Module (for bundling): * https://babeljs.io/docs/en/babel-polyfill -Script (for script tag): -* https://polyfill.io/v3/polyfill.min.js?features=Promise%2CSymbol%2CSymbol.iterator%2CArray.from%2CObject.assign%2CNumber.isFinite%2CString.prototype.includes ## Development