From ae1c31f3f2b7d563760fef31beba7d6d4af38ee3 Mon Sep 17 00:00:00 2001 From: Triyambaka Mishra <55938092+triyam@users.noreply.github.com> Date: Wed, 6 Dec 2023 21:28:07 +0000 Subject: [PATCH 1/2] UpoadFileOptions -> UploadFileOptionsWithMetadata --- package-lock.json | 20 ++++++++++---------- packages/storage/rollup.config.js | 3 ++- packages/storage/src/definitions.ts | 16 +++++++++++++++- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6d99d86d..6dd66b65 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15394,7 +15394,7 @@ }, "packages/analytics": { "name": "@capacitor-firebase/analytics", - "version": "5.2.0", + "version": "5.3.0", "funding": [ { "type": "github", @@ -15447,7 +15447,7 @@ }, "packages/app": { "name": "@capacitor-firebase/app", - "version": "5.2.0", + "version": "5.3.0", "funding": [ { "type": "github", @@ -15488,7 +15488,7 @@ }, "packages/app-check": { "name": "@capacitor-firebase/app-check", - "version": "5.2.0", + "version": "5.3.0", "funding": [ { "type": "github", @@ -15553,7 +15553,7 @@ }, "packages/authentication": { "name": "@capacitor-firebase/authentication", - "version": "5.2.0", + "version": "5.3.0", "funding": [ { "type": "github", @@ -15606,7 +15606,7 @@ }, "packages/crashlytics": { "name": "@capacitor-firebase/crashlytics", - "version": "5.2.0", + "version": "5.3.0", "funding": [ { "type": "github", @@ -15658,7 +15658,7 @@ }, "packages/firestore": { "name": "@capacitor-firebase/firestore", - "version": "5.2.0", + "version": "5.3.0", "funding": [ { "type": "github", @@ -15711,7 +15711,7 @@ }, "packages/messaging": { "name": "@capacitor-firebase/messaging", - "version": "5.2.0", + "version": "5.3.0", "funding": [ { "type": "github", @@ -15764,7 +15764,7 @@ }, "packages/performance": { "name": "@capacitor-firebase/performance", - "version": "5.2.0", + "version": "5.3.0", "funding": [ { "type": "github", @@ -15817,7 +15817,7 @@ }, "packages/remote-config": { "name": "@capacitor-firebase/remote-config", - "version": "5.2.0", + "version": "5.3.0", "funding": [ { "type": "github", @@ -15870,7 +15870,7 @@ }, "packages/storage": { "name": "@capacitor-firebase/storage", - "version": "5.2.0", + "version": "5.3.0", "funding": [ { "type": "github", diff --git a/packages/storage/rollup.config.js b/packages/storage/rollup.config.js index 89646be0..3c84cec0 100644 --- a/packages/storage/rollup.config.js +++ b/packages/storage/rollup.config.js @@ -7,6 +7,7 @@ export default { name: 'capacitorFirebaseStorage', globals: { '@capacitor/core': 'capacitorExports', + 'firebase/storage': 'firebaseStorage', }, sourcemap: true, inlineDynamicImports: true, @@ -18,5 +19,5 @@ export default { inlineDynamicImports: true, }, ], - external: ['@capacitor/core'], + external: ['@capacitor/core', 'firebase/storage'], }; diff --git a/packages/storage/src/definitions.ts b/packages/storage/src/definitions.ts index 7b615a0c..18a1ee38 100644 --- a/packages/storage/src/definitions.ts +++ b/packages/storage/src/definitions.ts @@ -35,7 +35,9 @@ export interface FirebaseStoragePlugin { * @since 5.3.0 */ uploadFile( - options: UploadFileOptions, + // [-] Original: options: UploadFileOptions + // [+] Issue #506: UploadFileOptionsWithMetadata added in options + options: UploadFileOptionsWithMetadata, callback: UploadFileCallback, ): Promise; } @@ -323,6 +325,18 @@ export interface UploadFileOptions { uri?: string; } +// [+] Issue: #506, Adding interface for UploadFileOptions with metadata: UploadFileOptionsWithMetadata +export interface UploadFileOptionsWithMetadata extends UploadFileOptions { + metadata?: { + cacheControl?: string | undefined; + contentDisposition?: string | undefined; + contentEncoding?: string | undefined; + contentLanguage?: string | undefined; + contentType?: string | undefined; + customMetadata?: { [key: string]: string } | undefined; + }; +} + /** * @since 5.3.0 */ From 71d44e46826bac07b981a40904dd48394bb0c473 Mon Sep 17 00:00:00 2001 From: Triyambaka Mishra <55938092+triyam@users.noreply.github.com> Date: Wed, 6 Dec 2023 21:46:17 +0000 Subject: [PATCH 2/2] Rolling back some unnecssary changes --- packages/storage/rollup.config.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/storage/rollup.config.js b/packages/storage/rollup.config.js index 3c84cec0..89646be0 100644 --- a/packages/storage/rollup.config.js +++ b/packages/storage/rollup.config.js @@ -7,7 +7,6 @@ export default { name: 'capacitorFirebaseStorage', globals: { '@capacitor/core': 'capacitorExports', - 'firebase/storage': 'firebaseStorage', }, sourcemap: true, inlineDynamicImports: true, @@ -19,5 +18,5 @@ export default { inlineDynamicImports: true, }, ], - external: ['@capacitor/core', 'firebase/storage'], + external: ['@capacitor/core'], };