From ac4497d69e81c66d59aab30ce318633b493a9d5a Mon Sep 17 00:00:00 2001 From: Egor Didenko Date: Wed, 28 Aug 2024 14:58:43 -0400 Subject: [PATCH] feat(entry-file): added file upload source --- abstract/UploaderPublicApi.js | 1 + abstract/uploadEntrySchema.js | 1 + blocks/FileItem/FileItem.js | 1 + 3 files changed, 3 insertions(+) diff --git a/abstract/UploaderPublicApi.js b/abstract/UploaderPublicApi.js index 8de0c7d55..38f345ccc 100644 --- a/abstract/UploaderPublicApi.js +++ b/abstract/UploaderPublicApi.js @@ -240,6 +240,7 @@ export class UploaderPublicApi { isRemoved: status === 'removed', errors: /** @type {import('../types/exported.js').OutputFileEntry['errors']} */ (uploadEntryData.errors), status, + source: uploadEntryData?.source, }; return /** @type {import('../types/exported.js').OutputFileEntry} */ (outputItem); diff --git a/abstract/uploadEntrySchema.js b/abstract/uploadEntrySchema.js index 797384472..e43325abd 100644 --- a/abstract/uploadEntrySchema.js +++ b/abstract/uploadEntrySchema.js @@ -27,6 +27,7 @@ import { UploadcareFile } from '@uploadcare/upload-client'; * @property {string | null} fullPath * @property {import('@uploadcare/upload-client').Metadata | null} metadata * @property {boolean} isRemoved + * @property {String} source */ /** diff --git a/blocks/FileItem/FileItem.js b/blocks/FileItem/FileItem.js index a293ee2b4..114a6c3a0 100644 --- a/blocks/FileItem/FileItem.js +++ b/blocks/FileItem/FileItem.js @@ -392,6 +392,7 @@ export class FileItem extends UploaderBlock { cdnUrl: entry.getValue('cdnUrl') ?? fileInfo.cdnUrl, cdnUrlModifiers: entry.getValue('cdnUrlModifiers') ?? '', uploadProgress: 100, + source: entry.getValue('source'), }); if (entry === this._entry) {