From b2767e58757238df6c83e1dd227d428056c1ff09 Mon Sep 17 00:00:00 2001 From: sethk4783 Date: Mon, 17 Jun 2024 23:05:09 +0530 Subject: [PATCH] fix:Invalid picker when unformatted fromSources supplied --- .github/workflows/deploy_beta.yml | 2 +- src/schema/picker.schema.ts | 61 +++++++++++++++---------------- 2 files changed, 30 insertions(+), 33 deletions(-) diff --git a/.github/workflows/deploy_beta.yml b/.github/workflows/deploy_beta.yml index aff5a826..2e67f8aa 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: [ develop, hotfix/* ] jobs: build: runs-on: ubuntu-latest diff --git a/src/schema/picker.schema.ts b/src/schema/picker.schema.ts index e2b96bfa..34dd60bc 100644 --- a/src/schema/picker.schema.ts +++ b/src/schema/picker.schema.ts @@ -57,38 +57,35 @@ export const PickerParamsSchema = { }, fromSources: { type: 'array', - 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', - }, - ], - }, + 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', + ], + }, + ], }, container: { format: 'HTMLContainer',