diff --git a/.flowconfig b/.flowconfig index bb1b4a96..ddb03cc7 100644 --- a/.flowconfig +++ b/.flowconfig @@ -4,6 +4,7 @@ # Ignore tests project .*/tests/.* +.*/packages/template/.* [include] packages/**/lib/*.js.flow @@ -42,4 +43,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError [version] -^0.93.0 +^0.96.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index fac25cbe..082483f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -179,6 +179,26 @@ await analytics().setUserId('12345678'); - [BREAKING] `enableDeveloperMode` has been removed, you can now use `setConfigSettings({ isDeveloperModeEnabled: boolean })` instead - [BREAKING] `setDefaults` now returns a Promise that resolves when completed +## Storage + + +> **Blog post announcement (NOT LIVE YET)**: [[Firebase Cloud Storage for React Native](https://invertase.io/blog?utm_source=github&utm_medium=changelog)] + +- [NEW] Added support for `put` (`Blob` | `ArrayBuffer` | `Uint8Array`) + - `contentType` mime type is automatically inferred from `Blob` +- [NEW] Added support for `putString` and all StringFormat's (raw, base64, base64url & data_url) + - `contentType` mime type is automatically inferred from `data_url` strings +- [NEW] Added support multiple buckets, e.g. `firebase.app().storage('gs://my-other-bucket')` +- [NEW] Added support `pause()`, `resume()` & `cancel()` for Upload & Download Storage tasks +- [NEW] Added an `error` property to TaskSnapshot's for `error` state events - this is an instance of `NativeFirebaseError` (with `code` & `message`) +- [BREAKING] Removed formerly deprecated `UploadTaskSnapshot.downloadUrl` property, use `StorageReference.getDownloadURL(): Promise` instead +- [BREAKING] `StorageReference.downloadFile()` is now deprecated and will be removed in a later release, please rename usages of this to `getFile()` - renamed to match Native SDKs +- [BREAKING] `firebase.storage.Native` is now deprecated and will be removed in a later release, please rename usages of this to `firebase.storage.Path` +- [BREAKING] `firebase.storage.Native.*` properties have been renamed and deprecated and will be removed in a later release, follow the in-app console warnings on how to migrate +- [BUGFIX][ANDROID] Update/set metadata now correctly supports removing metadata values by passing a null property value in `customMetadata` +- [BUGFIX][ANDROID] `contentType` mime type is now correctly determined in all scenarios, there was an edge case where it would just use the default value +- [INTERNAL][ANDROID] `downloadFile` no longer uses a `StreamDownloadTask`, replaced with the newer `FileDownloadTask` + ## Messaging - [NEW] Support `setAutoInitEnabled(enabled: boolean)` - this is useful for opt-in first flows diff --git a/docs/analytics/android.md b/docs/analytics/android.md index 67d0ab8b..9b187c50 100644 --- a/docs/analytics/android.md +++ b/docs/analytics/android.md @@ -5,7 +5,41 @@ description: Manually integrate Analytics into your Android application. # Android Setup -> The following steps are only required if your environment does not have access to React Native -auto-linking. +## Manual Android Integration -## TODO +> The following steps are only required if your environment does not have access to React Native +auto-linking. + +#### Add Analytics to Gradle Settings + +**`android/settings.gradle`**: +```groovy +include ':@react-native-firebase_analytics' +project(':@react-native-firebase_analytics').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/analytics/android') +``` + +#### Add Analytics to App Gradle Dependencies + +**`android/app/build.gradle`**: +```groovy{4} +// .. +dependencies { + // .. + implementation project(path: ":@react-native-firebase_analytics") +} +``` + +#### Add Analytics to Main Android Application: + +**`android/app/src/main/java/**/MainApplication.java`**: +```java{2,8} +// .. +import io.invertase.firebase.analytics.ReactNativeFirebaseAnalyticsPackage; + + // .. + protected List getPackages() { + return Arrays.asList( + new MainReactPackage(), + new ReactNativeFirebaseAnalyticsPackage(), + // .. +``` diff --git a/docs/analytics/ios.md b/docs/analytics/ios.md index ebbbc50f..0870ea56 100644 --- a/docs/analytics/ios.md +++ b/docs/analytics/ios.md @@ -5,17 +5,38 @@ description: Manually integrate Analytics into your iOS application. # iOS Setup +## Manual iOS Integration via CocoaPods + +> The following steps are only required if your environment does not have access to React Native +auto-linking. + +#### Add Analytics Pod + +**`ios/Podfile`**: +```ruby{4} +// .. +target 'app' do + // .. + pod 'RNFBAnalytics', :path => '../node_modules/@react-native-firebase/analytics/ios' +end +``` + +## Manual iOS Integration via Frameworks + +*TODO* + ## Device Identification If you would like to enable Firebase Analytics to generate automatic audience metrics for iOS (as it does by default in Android), you must link additional iOS libraries, [as documented by the Google Firebase team](https://support.google.com/firebase/answer/6318039). Specifically you need `libAdIdAccess.a` and `AdSupport.framework`. The way to do this using Cocoapods is to add this to your Podfile (though please use [the most current Pod version](https://cocoapods.org/pods/GoogleIDFASupport) supported by react-native-firebase): -```ruby +**`ios/Podfile`**: +```ruby{5} +// .. +target 'app' do + // .. + pod 'RNFBAnalytics', :path => '../node_modules/@react-native-firebase/analytics/ios' pod 'GoogleIDFASupport', '~> 3.14.0' +end ``` - -> The following steps are only required if your environment does not have access to React Native -auto-linking. - -## TODO diff --git a/docs/crashlytics/android.md b/docs/crashlytics/android.md index 29e090d9..5efdecfc 100644 --- a/docs/crashlytics/android.md +++ b/docs/crashlytics/android.md @@ -5,10 +5,76 @@ description: Manually integrate Crashlytics into your Android application. # Android Setup +> If you're migrating from Fabric ensure you remove the `fabric.properties` file from your android project - if you do not do this you will not receive crash reports on the Firebase console. + +## Additional Installation Steps + +### Add Fabric Gradle Tools + +These steps are required, if you do not add these your app will most likely crash at startup with the following Error: *"The Crashlytics build ID is missing. This occurs when Crashlytics tooling is absent from your app's build configuration. Please review Crashlytics onboarding instructions and ensure you have a valid Crashlytics account."* + +#### Add the Fabric Maven repository + +**`android/build.gradle`**: +```groovy{6-8} +// .. +buildscript { + // .. + repositories { + // .. + maven { + url 'https://maven.fabric.io/public' + } + } + // .. +} +``` + +#### Add the Fabric Tools Plugin dependency + +**`android/build.gradle`**: +```groovy{6} +// .. +buildscript { + // .. + dependencies { + // .. + classpath 'io.fabric.tools:gradle:1.28.1' + } + // .. +} +``` + +#### Apply the Fabric Tools Plugin to your app + + +**`android/app/build.gradle`**: +```groovy{2} +apply plugin: 'com.android.application' // apply after this line +apply plugin: 'io.fabric' +// .. +``` + +#### Enable Crashlytics NDK reporting + +> OPTIONAL + +Crashlytics NDK reporting allows you to capture Native Development Kit crashes, e.g. in React Native this will capture crashes originating from the Yoga layout engine. + +**`android/app/build.gradle`**: +```groovy{4-6} +// .. +apply plugin: 'io.fabric' +// .. +crashlytics { + enableNdk true +} +``` + +## Manual Linking + > The following steps are only required if your environment does not have access to React Native auto-linking. -> If you're migrating from Fabric ensure you remove the `fabric.properties` file from your android project - if you do not do this you will not receive crash reports on the Firebase console. - -## TODO +TODO diff --git a/docs/database/quick-start.md b/docs/database/quick-start.md index e94f9617..76f2295c 100644 --- a/docs/database/quick-start.md +++ b/docs/database/quick-start.md @@ -82,7 +82,7 @@ data changing, being added, being removed or moved to another location. ```jsx import React, { useState, useEffect } from 'react'; -import { Text, FlatList } from 'react-native'; +import { Text } from 'react-native'; import database from '@react-native-firebase/database'; function Role({ uid }) { @@ -128,7 +128,7 @@ a performant, scrollable list simple: ```jsx import React, { useState, useEffect } from 'react'; -import { Text } from 'react-native'; +import { Text, FlatList } from 'react-native'; import database from '@react-native-firebase/database'; function Games() { diff --git a/docs/sidebar.yaml b/docs/sidebar.yaml index 3d20d22e..b5d10e5e 100644 --- a/docs/sidebar.yaml +++ b/docs/sidebar.yaml @@ -185,8 +185,8 @@ to: "/android" - text: iOS Setup to: "/ios" - - text: Migrating to Dynamic Links - to: "/migrating-to-dynamic-links" + - text: Migrate to Dynamic Links + to: "/migrate-to-dynamic-links" - module: ml-kit group: ML Kit diff --git a/docs/storage/android.md b/docs/storage/android.md index 06e08d9f..955cdec3 100644 --- a/docs/storage/android.md +++ b/docs/storage/android.md @@ -31,7 +31,7 @@ dependencies { #### Add Cloud Storage to Main Android Application: -**`android/app/src/main/java/**/MainApplication.java`**: +**android/app/src/main/java/\*\*/MainApplication.java**: ```java{2,8} // .. import io.invertase.firebase.storage.ReactNativeFirebaseStoragePackage; diff --git a/docs/typedoc.json b/docs/typedoc.json index 2442307d..6c496464 100644 --- a/docs/typedoc.json +++ b/docs/typedoc.json @@ -23,14 +23,14 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 130, + "line": 232, "character": 30 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 512, + "id": 689, "typeArguments": [ { "type": "reference", @@ -56,7 +56,7 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 119, + "line": 222, "character": 31 } ], @@ -84,17 +84,12 @@ "isConst": true }, "comment": { - "tags": [ - { - "tag": "example", - "text": "\n```js\nimport { firebase } from '@react-native-firebase/analytics';\nfirebase.analytics().logEvent(...);\n```\n" - } - ] + "shortText": "```js\nimport { firebase } from '@react-native-firebase/analytics';\nfirebase.analytics().logEvent(...);\n```" }, "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 128, + "line": 230, "character": 23 } ], @@ -119,7 +114,7 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 116, + "line": 219, "character": 49 } ] @@ -217,9 +212,6 @@ "kind": 4096, "kindString": "Call signature", "flags": {}, - "comment": { - "shortText": "Analytics integrates across Firebase features and provides\nyou with unlimited reporting for up to 500 distinct events\nthat you can define using the Firebase SDK. Analytics reports\nhelp you understand clearly how your users behave, which enables\nyou to make informed decisions regarding app marketing and\nperformance optimizations." - }, "type": { "type": "reference", "name": "Module", @@ -230,7 +222,7 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 172, + "line": 252, "character": 13 } ] @@ -261,7 +253,7 @@ "sources": [ { "fileName": "auth/lib/index.d.ts", - "line": 83, + "line": 135, "character": 8 } ] @@ -292,7 +284,7 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 199, + "line": 395, "character": 10 } ] @@ -323,7 +315,7 @@ "sources": [ { "fileName": "crashlytics/lib/index.d.ts", - "line": 158, + "line": 276, "character": 15 } ] @@ -354,7 +346,7 @@ "sources": [ { "fileName": "fiam/lib/index.d.ts", - "line": 113, + "line": 181, "character": 8 } ] @@ -385,7 +377,7 @@ "sources": [ { "fileName": "firestore/lib/index.d.ts", - "line": 83, + "line": 135, "character": 13 } ] @@ -418,7 +410,7 @@ "isOptional": true }, "comment": { - "text": "The region you deployed your functions to. Defaults to 'us-central1'.\n" + "text": "The region you deployed your functions to. Defaults to 'us-central1'.\n" }, "type": { "type": "union", @@ -445,7 +437,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 226, + "line": 393, "character": 13 } ] @@ -477,7 +469,7 @@ "sources": [ { "fileName": "iid/lib/index.d.ts", - "line": 123, + "line": 187, "character": 7 } ] @@ -508,7 +500,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 244, + "line": 455, "character": 11 } ] @@ -539,7 +531,7 @@ "sources": [ { "fileName": "mlkit/lib/index.d.ts", - "line": 83, + "line": 127, "character": 9 } ] @@ -570,11 +562,65 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 265, + "line": 484, "character": 8 } ] }, + { + "id": 610, + "name": "storage", + "kind": 2048, + "kindString": "Method", + "flags": { + "isOptional": true + }, + "signatures": [ + { + "id": 611, + "name": "storage", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "parameters": [ + { + "id": 612, + "name": "bucket", + "kind": 32768, + "kindString": "Parameter", + "flags": { + "isOptional": true + }, + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "string" + } + ] + } + } + ], + "type": { + "type": "reference", + "name": "Module", + "id": 585 + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 955, + "character": 11 + } + ] + }, { "id": 56, "name": "utils", @@ -612,7 +658,7 @@ } }, { - "id": 445, + "id": 622, "name": "utils", "kind": 4096, "kindString": "Call signature", @@ -623,7 +669,7 @@ "type": { "type": "reference", "name": "Module", - "id": 438 + "id": 615 } } ], @@ -635,7 +681,7 @@ }, { "fileName": "utils/lib/index.d.ts", - "line": 90, + "line": 134, "character": 9 } ] @@ -657,6 +703,7 @@ 334, 345, 434, + 610, 56 ] } @@ -664,7 +711,7 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 163, + "line": 251, "character": 23 }, { @@ -674,57 +721,62 @@ }, { "fileName": "auth/lib/index.d.ts", - "line": 79, + "line": 131, "character": 23 }, { "fileName": "config/lib/index.d.ts", - "line": 193, + "line": 389, "character": 23 }, { "fileName": "crashlytics/lib/index.d.ts", - "line": 153, + "line": 271, "character": 23 }, { "fileName": "fiam/lib/index.d.ts", - "line": 107, + "line": 175, "character": 23 }, { "fileName": "firestore/lib/index.d.ts", - "line": 79, + "line": 131, "character": 23 }, { "fileName": "functions/lib/index.d.ts", - "line": 217, + "line": 384, "character": 23 }, { "fileName": "iid/lib/index.d.ts", - "line": 114, + "line": 178, "character": 23 }, { "fileName": "invites/lib/index.d.ts", - "line": 237, + "line": 448, "character": 23 }, { "fileName": "mlkit/lib/index.d.ts", - "line": 79, + "line": 123, "character": 23 }, { "fileName": "perf/lib/index.d.ts", - "line": 261, + "line": 480, + "character": 23 + }, + { + "fileName": "storage/lib/index.d.ts", + "line": 954, "character": 23 }, { "fileName": "utils/lib/index.d.ts", - "line": 86, + "line": 130, "character": 23 } ] @@ -742,20 +794,17 @@ "kind": 1024, "kindString": "Property", "flags": {}, - "comment": { - "shortText": "Analytics integrates across Firebase features and provides\nyou with unlimited reporting for up to 500 distinct events\nthat you can define using the Firebase SDK. Analytics reports\nhelp you understand clearly how your users behave, which enables\nyou to make informed decisions regarding app marketing and\nperformance optimizations." - }, "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 157, + "line": 245, "character": 13 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 512, + "id": 689, "typeArguments": [ { "type": "reference", @@ -782,14 +831,14 @@ "sources": [ { "fileName": "auth/lib/index.d.ts", - "line": 73, + "line": 125, "character": 8 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 512, + "id": 689, "typeArguments": [ { "type": "reference", @@ -816,14 +865,14 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 190, + "line": 386, "character": 10 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 512, + "id": 689, "typeArguments": [ { "type": "reference", @@ -850,14 +899,14 @@ "sources": [ { "fileName": "crashlytics/lib/index.d.ts", - "line": 150, + "line": 268, "character": 15 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 512, + "id": 689, "typeArguments": [ { "type": "reference", @@ -884,14 +933,14 @@ "sources": [ { "fileName": "fiam/lib/index.d.ts", - "line": 104, + "line": 172, "character": 8 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 512, + "id": 689, "typeArguments": [ { "type": "reference", @@ -918,14 +967,14 @@ "sources": [ { "fileName": "firestore/lib/index.d.ts", - "line": 73, + "line": 125, "character": 13 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 512, + "id": 689, "typeArguments": [ { "type": "reference", @@ -952,14 +1001,14 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 214, + "line": 381, "character": 13 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStaticsWithApp", - "id": 518, + "id": 695, "typeArguments": [ { "type": "reference", @@ -987,14 +1036,14 @@ "sources": [ { "fileName": "iid/lib/index.d.ts", - "line": 111, + "line": 175, "character": 7 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStaticsWithApp", - "id": 518, + "id": 695, "typeArguments": [ { "type": "reference", @@ -1021,14 +1070,14 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 234, + "line": 445, "character": 11 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 512, + "id": 689, "typeArguments": [ { "type": "reference", @@ -1055,14 +1104,14 @@ "sources": [ { "fileName": "mlkit/lib/index.d.ts", - "line": 73, + "line": 117, "character": 9 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 512, + "id": 689, "typeArguments": [ { "type": "reference", @@ -1089,14 +1138,14 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 258, + "line": 477, "character": 8 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 512, + "id": 689, "typeArguments": [ { "type": "reference", @@ -1111,6 +1160,37 @@ ] } }, + { + "id": 609, + "name": "storage", + "kind": 1024, + "kindString": "Property", + "flags": {}, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 951, + "character": 11 + } + ], + "type": { + "type": "reference", + "name": "ReactNativeFirebaseModuleAndStatics", + "id": 689, + "typeArguments": [ + { + "type": "reference", + "name": "Module", + "id": 585 + }, + { + "type": "reference", + "name": "Statics", + "id": 460 + } + ] + } + }, { "id": 52, "name": "utils", @@ -1130,24 +1210,24 @@ }, { "fileName": "utils/lib/index.d.ts", - "line": 80, + "line": 124, "character": 9 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 512, + "id": 689, "typeArguments": [ { "type": "reference", "name": "Module", - "id": 438 + "id": 615 }, { "type": "reference", "name": "Statics", - "id": 437 + "id": 614 } ] } @@ -1169,6 +1249,7 @@ 333, 344, 433, + 609, 52 ] } @@ -1176,7 +1257,7 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 148, + "line": 244, "character": 40 }, { @@ -1186,57 +1267,62 @@ }, { "fileName": "auth/lib/index.d.ts", - "line": 69, + "line": 121, "character": 40 }, { "fileName": "config/lib/index.d.ts", - "line": 184, + "line": 380, "character": 40 }, { "fileName": "crashlytics/lib/index.d.ts", - "line": 145, + "line": 263, "character": 40 }, { "fileName": "fiam/lib/index.d.ts", - "line": 98, + "line": 166, "character": 40 }, { "fileName": "firestore/lib/index.d.ts", - "line": 69, + "line": 121, "character": 40 }, { "fileName": "functions/lib/index.d.ts", - "line": 207, + "line": 374, "character": 40 }, { "fileName": "iid/lib/index.d.ts", - "line": 103, + "line": 167, "character": 40 }, { "fileName": "invites/lib/index.d.ts", - "line": 228, + "line": 439, "character": 40 }, { "fileName": "mlkit/lib/index.d.ts", - "line": 69, + "line": 113, "character": 40 }, { "fileName": "perf/lib/index.d.ts", - "line": 254, + "line": 473, + "character": 40 + }, + { + "fileName": "storage/lib/index.d.ts", + "line": 950, "character": 40 }, { "fileName": "utils/lib/index.d.ts", - "line": 74, + "line": 118, "character": 40 } ] @@ -1255,7 +1341,7 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 147, + "line": 243, "character": 49 }, { @@ -1265,57 +1351,62 @@ }, { "fileName": "auth/lib/index.d.ts", - "line": 68, + "line": 120, "character": 49 }, { "fileName": "config/lib/index.d.ts", - "line": 183, + "line": 379, "character": 49 }, { "fileName": "crashlytics/lib/index.d.ts", - "line": 144, + "line": 262, "character": 49 }, { "fileName": "fiam/lib/index.d.ts", - "line": 97, + "line": 165, "character": 49 }, { "fileName": "firestore/lib/index.d.ts", - "line": 68, + "line": 120, "character": 49 }, { "fileName": "functions/lib/index.d.ts", - "line": 206, + "line": 373, "character": 49 }, { "fileName": "iid/lib/index.d.ts", - "line": 102, + "line": 166, "character": 49 }, { "fileName": "invites/lib/index.d.ts", - "line": 227, + "line": 438, "character": 49 }, { "fileName": "mlkit/lib/index.d.ts", - "line": 68, + "line": 112, "character": 49 }, { "fileName": "perf/lib/index.d.ts", - "line": 253, + "line": 472, + "character": 49 + }, + { + "fileName": "storage/lib/index.d.ts", + "line": 949, "character": 49 }, { "fileName": "utils/lib/index.d.ts", - "line": 73, + "line": 117, "character": 49 } ] @@ -1339,14 +1430,14 @@ "sources": [ { "fileName": "auth/lib/index.d.ts", - "line": 51, + "line": 103, "character": 25 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 512, + "id": 689, "typeArguments": [ { "type": "reference", @@ -1372,7 +1463,7 @@ "sources": [ { "fileName": "auth/lib/index.d.ts", - "line": 40, + "line": 92, "character": 31 } ], @@ -1410,7 +1501,7 @@ "sources": [ { "fileName": "auth/lib/index.d.ts", - "line": 49, + "line": 101, "character": 23 } ], @@ -1435,7 +1526,7 @@ "sources": [ { "fileName": "auth/lib/index.d.ts", - "line": 37, + "line": 89, "character": 44 } ] @@ -1459,14 +1550,14 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 169, + "line": 365, "character": 27 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 512, + "id": 689, "typeArguments": [ { "type": "reference", @@ -1492,7 +1583,7 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 158, + "line": 354, "character": 31 } ], @@ -1530,7 +1621,7 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 167, + "line": 363, "character": 23 } ], @@ -1555,7 +1646,7 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 155, + "line": 351, "character": 46 } ] @@ -1579,14 +1670,14 @@ "sources": [ { "fileName": "crashlytics/lib/index.d.ts", - "line": 127, + "line": 245, "character": 32 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 512, + "id": 689, "typeArguments": [ { "type": "reference", @@ -1612,7 +1703,7 @@ "sources": [ { "fileName": "crashlytics/lib/index.d.ts", - "line": 116, + "line": 234, "character": 31 } ], @@ -1650,7 +1741,7 @@ "sources": [ { "fileName": "crashlytics/lib/index.d.ts", - "line": 125, + "line": 243, "character": 23 } ], @@ -1675,7 +1766,7 @@ "sources": [ { "fileName": "crashlytics/lib/index.d.ts", - "line": 113, + "line": 231, "character": 51 } ] @@ -1699,14 +1790,14 @@ "sources": [ { "fileName": "fiam/lib/index.d.ts", - "line": 83, + "line": 151, "character": 25 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 512, + "id": 689, "typeArguments": [ { "type": "reference", @@ -1732,7 +1823,7 @@ "sources": [ { "fileName": "fiam/lib/index.d.ts", - "line": 72, + "line": 140, "character": 31 } ], @@ -1770,7 +1861,7 @@ "sources": [ { "fileName": "fiam/lib/index.d.ts", - "line": 81, + "line": 149, "character": 23 } ], @@ -1795,7 +1886,7 @@ "sources": [ { "fileName": "fiam/lib/index.d.ts", - "line": 69, + "line": 137, "character": 44 } ] @@ -1818,7 +1909,7 @@ "sources": [ { "fileName": "firestore/lib/index.d.ts", - "line": 40, + "line": 92, "character": 31 } ], @@ -1848,14 +1939,14 @@ "sources": [ { "fileName": "firestore/lib/index.d.ts", - "line": 51, + "line": 103, "character": 30 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 512, + "id": 689, "typeArguments": [ { "type": "reference", @@ -1890,7 +1981,7 @@ "sources": [ { "fileName": "firestore/lib/index.d.ts", - "line": 49, + "line": 101, "character": 23 } ], @@ -1915,7 +2006,7 @@ "sources": [ { "fileName": "firestore/lib/index.d.ts", - "line": 37, + "line": 89, "character": 49 } ] @@ -1939,14 +2030,14 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 189, + "line": 356, "character": 30 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStaticsWithApp", - "id": 518, + "id": 695, "typeArguments": [ { "type": "reference", @@ -1973,7 +2064,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 178, + "line": 345, "character": 29 } ], @@ -2012,7 +2103,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 187, + "line": 354, "character": 23 } ], @@ -2045,7 +2136,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 174, + "line": 341, "character": 49 } ] @@ -2068,7 +2159,7 @@ "sources": [ { "fileName": "iid/lib/index.d.ts", - "line": 77, + "line": 141, "character": 31 } ], @@ -2098,14 +2189,14 @@ "sources": [ { "fileName": "iid/lib/index.d.ts", - "line": 88, + "line": 152, "character": 24 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStaticsWithApp", - "id": 518, + "id": 695, "typeArguments": [ { "type": "reference", @@ -2140,7 +2231,7 @@ "sources": [ { "fileName": "iid/lib/index.d.ts", - "line": 86, + "line": 150, "character": 23 } ], @@ -2165,7 +2256,7 @@ "sources": [ { "fileName": "iid/lib/index.d.ts", - "line": 71, + "line": 135, "character": 43 } ] @@ -2188,7 +2279,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 202, + "line": 413, "character": 31 } ], @@ -2218,14 +2309,14 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 213, + "line": 424, "character": 28 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 512, + "id": 689, "typeArguments": [ { "type": "reference", @@ -2260,7 +2351,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 211, + "line": 422, "character": 23 } ], @@ -2285,7 +2376,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 199, + "line": 410, "character": 47 } ] @@ -2308,7 +2399,7 @@ "sources": [ { "fileName": "mlkit/lib/index.d.ts", - "line": 40, + "line": 84, "character": 31 } ], @@ -2338,14 +2429,14 @@ "sources": [ { "fileName": "mlkit/lib/index.d.ts", - "line": 51, + "line": 95, "character": 26 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 512, + "id": 689, "typeArguments": [ { "type": "reference", @@ -2380,7 +2471,7 @@ "sources": [ { "fileName": "mlkit/lib/index.d.ts", - "line": 49, + "line": 93, "character": 23 } ], @@ -2405,7 +2496,7 @@ "sources": [ { "fileName": "mlkit/lib/index.d.ts", - "line": 37, + "line": 81, "character": 45 } ] @@ -2428,7 +2519,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 228, + "line": 447, "character": 31 } ], @@ -2458,14 +2549,14 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 239, + "line": 458, "character": 25 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 512, + "id": 689, "typeArguments": [ { "type": "reference", @@ -2500,7 +2591,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 237, + "line": 456, "character": 23 } ], @@ -2525,20 +2616,20 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 225, + "line": 444, "character": 44 } ] }, { - "id": 441, - "name": "\"@react-native-firebase/utils\"", + "id": 605, + "name": "\"@react-native-firebase/storage\"", "kind": 2, "kindString": "Module", "flags": {}, "children": [ { - "id": 442, + "id": 606, "name": "FirebaseNamespaceExport", "kind": 32, "kindString": "Variable", @@ -2547,8 +2638,8 @@ }, "sources": [ { - "fileName": "utils/lib/index.d.ts", - "line": 45, + "fileName": "storage/lib/index.d.ts", + "line": 937, "character": 31 } ], @@ -2567,7 +2658,119 @@ } }, { - "id": 444, + "id": 608, + "name": "StorageDefaultExport", + "kind": 32, + "kindString": "Variable", + "flags": { + "isExported": true, + "isConst": true + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 941, + "character": 28 + } + ], + "type": { + "type": "reference", + "name": "ReactNativeFirebaseModuleAndStatics", + "id": 689, + "typeArguments": [ + { + "type": "reference", + "name": "Module", + "id": 585 + }, + { + "type": "reference", + "name": "Statics", + "id": 460 + } + ] + } + }, + { + "id": 607, + "name": "firebase", + "kind": 32, + "kindString": "Variable", + "flags": { + "isExported": true, + "isConst": true + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 939, + "character": 23 + } + ], + "type": { + "type": "reference", + "name": "ReactNativeFirebaseNamespace" + }, + "defaultValue": " FirebaseNamespaceExport" + } + ], + "groups": [ + { + "title": "Variables", + "kind": 32, + "children": [ + 606, + 608, + 607 + ] + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 934, + "character": 47 + } + ] + }, + { + "id": 618, + "name": "\"@react-native-firebase/utils\"", + "kind": 2, + "kindString": "Module", + "flags": {}, + "children": [ + { + "id": 619, + "name": "FirebaseNamespaceExport", + "kind": 32, + "kindString": "Variable", + "flags": { + "isConst": true + }, + "sources": [ + { + "fileName": "utils/lib/index.d.ts", + "line": 89, + "character": 31 + } + ], + "type": { + "type": "intersection", + "types": [ + { + "type": "reference", + "name": "__type" + }, + { + "type": "reference", + "name": "ReactNativeFirebaseNamespace" + } + ] + } + }, + { + "id": 621, "name": "UtilsDefaultExport", "kind": 32, "kindString": "Variable", @@ -2578,30 +2781,30 @@ "sources": [ { "fileName": "utils/lib/index.d.ts", - "line": 56, + "line": 100, "character": 26 } ], "type": { "type": "reference", "name": "ReactNativeFirebaseModuleAndStatics", - "id": 512, + "id": 689, "typeArguments": [ { "type": "reference", "name": "Module", - "id": 438 + "id": 615 }, { "type": "reference", "name": "Statics", - "id": 437 + "id": 614 } ] } }, { - "id": 443, + "id": 620, "name": "firebase", "kind": 32, "kindString": "Variable", @@ -2620,7 +2823,7 @@ "sources": [ { "fileName": "utils/lib/index.d.ts", - "line": 54, + "line": 98, "character": 23 } ], @@ -2636,16 +2839,16 @@ "title": "Variables", "kind": 32, "children": [ - 442, - 444, - 443 + 619, + 621, + 620 ] } ], "sources": [ { "fileName": "utils/lib/index.d.ts", - "line": 42, + "line": 86, "character": 45 } ] @@ -2659,7 +2862,8 @@ "isExported": true }, "comment": { - "shortText": "Analytics integrates across Firebase features and provides\nyou with unlimited reporting for up to 500 distinct events\nthat you can define using the Firebase SDK. Analytics reports\nhelp you understand clearly how your users behave, which enables\nyou to make informed decisions regarding app marketing and\nperformance optimizations.", + "shortText": "Firebase Analytics package for React Native.", + "text": "#### Example 1\n\nAccess the firebase export from the `analytics` package:\n\n```js\nimport { firebase } from '@react-native-firebase/analytics';\n\n// firebase.analytics().X\n```\n\n#### Example 2\n\nUsing the default export from the `analytics` package:\n\n```js\nimport analytics from '@react-native-firebase/analytics';\n\n// analytics().X\n```\n\n#### Example 3\n\nUsing the default export from the `app` package:\n\n```js\nimport firebase from '@react-native-firebase/app';\nimport '@react-native-firebase/analytics';\n\n// firebase.analytics().X\n```\n", "tags": [ { "tag": "firebase", @@ -2671,11 +2875,15 @@ { "id": 3, "name": "Module", - "kind": 256, - "kindString": "Interface", + "kind": 128, + "kindString": "Class", "flags": { "isExported": true }, + "comment": { + "shortText": "The Firebase Analytics service interface.", + "text": "> This module is available for the default app only.\n\n#### Example\n\nGet the Analytics service for the default app:\n\n```js\nconst defaultAppAnalytics = firebase.analytics();\n```\n" + }, "children": [ { "id": 39, @@ -2718,6 +2926,7 @@ "flags": {}, "comment": { "shortText": "Log a custom event with optional params.", + "text": "#### Example\n\n```js\nawait firebase.analytics().logEvent('product_view', {\n id: '1234',\n});\n```\n", "tags": [ { "tag": "note", @@ -2786,7 +2995,7 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 46, + "line": 93, "character": 34 } ] @@ -2809,7 +3018,7 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 46, + "line": 93, "character": 12 } ] @@ -2830,7 +3039,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Clears all analytics data for this instance from the device and resets the app instance ID." + "shortText": "Clears all analytics data for this instance from the device and resets the app instance ID.", + "text": "#### Example\n\n```js\nawait firebase.analytics().resetAnalyticsData();\n```\n" }, "type": { "type": "reference", @@ -2847,7 +3057,7 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 112, + "line": 215, "character": 22 } ] @@ -2869,6 +3079,7 @@ "flags": {}, "comment": { "shortText": "If true, allows the device to collect analytical data and send it to Firebase.\nUseful for GDPR.", + "text": "#### Example\n\n```js\n// Disable collection\nawait firebase.analytics().setAnalyticsCollectionEnabled(false);\n```\n", "tags": [ { "tag": "note", @@ -2907,7 +3118,7 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 56, + "line": 110, "character": 33 } ] @@ -2929,6 +3140,7 @@ "flags": {}, "comment": { "shortText": "Sets the current screen name.", + "text": "#### Example\n\n```js\nawait firebase.analytics().setCurrentScreen('ProductScreen', 'ProductScreen');\n```\n", "tags": [ { "tag": "note", @@ -2992,7 +3204,7 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 69, + "line": 129, "character": 20 } ] @@ -3013,7 +3225,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Sets the minimum engagement time required before starting a session." + "shortText": "Sets the minimum engagement time required before starting a session.", + "text": "#### Example\n\n```js\n// 20 seconds\nawait firebase.analytics().setMinimumSessionDuration(20000);\n```\n" }, "parameters": [ { @@ -3046,7 +3259,7 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 76, + "line": 143, "character": 29 } ] @@ -3067,7 +3280,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Sets the duration of inactivity that terminates the current session." + "shortText": "Sets the duration of inactivity that terminates the current session.", + "text": "#### Example\n\n```js\n// 20 minutes\nawait firebase.analytics().setMinimumSessionDuration(900000);\n```\n" }, "parameters": [ { @@ -3100,7 +3314,7 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 83, + "line": 157, "character": 29 } ] @@ -3121,7 +3335,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Gives a user a unique identification." + "shortText": "Gives a user a unique identification.", + "text": "#### Example\n\n```js\n// Set User\nawait firebase.analytics().setUserId('123456789');\n// Remove User\nawait firebase.analytics().setUserId(null);\n```\n" }, "parameters": [ { @@ -3163,7 +3378,7 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 91, + "line": 173, "character": 13 } ] @@ -3185,6 +3400,7 @@ "flags": {}, "comment": { "shortText": "Sets multiple key/value pair of data on the current user.", + "text": "#### Example\n\n```js\nawait firebase.analytics().setUserProperties({\n account_type: 'gold',\n account_name: 'Gold Badge',\n});\n```\n", "tags": [ { "tag": "react-native-firebase", @@ -3248,7 +3464,7 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 107, + "line": 204, "character": 33 } ] @@ -3271,7 +3487,7 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 107, + "line": 204, "character": 21 } ] @@ -3292,7 +3508,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Sets a key/value pair of data on the current user." + "shortText": "Sets a key/value pair of data on the current user.", + "text": "#### Example\n\n```js\nawait firebase.analytics().setUserProperty('account_type', 'gold');\n```\n" }, "parameters": [ { @@ -3348,7 +3565,7 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 99, + "line": 187, "character": 19 } ] @@ -3381,8 +3598,8 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 37, - "character": 25 + "line": 76, + "character": 21 } ], "extendedTypes": [ @@ -3403,18 +3620,24 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 35, + "line": 61, "character": 26 } ] } ], "groups": [ + { + "title": "Classes", + "kind": 128, + "children": [ + 3 + ] + }, { "title": "Interfaces", "kind": 256, "children": [ - 3, 2 ] } @@ -3422,13 +3645,13 @@ "sources": [ { "fileName": "analytics/lib/index.d.ts", - "line": 34, + "line": 60, "character": 26 } ] }, { - "id": 493, + "id": 670, "name": "App", "kind": 2, "kindString": "Module", @@ -3445,7 +3668,7 @@ }, "children": [ { - "id": 494, + "id": 671, "name": "FirebaseApp", "kind": 256, "kindString": "Interface", @@ -3454,7 +3677,7 @@ }, "children": [ { - "id": 495, + "id": 672, "name": "name", "kind": 1024, "kindString": "Property", @@ -3477,7 +3700,7 @@ } }, { - "id": 496, + "id": 673, "name": "options", "kind": 1024, "kindString": "Property", @@ -3497,11 +3720,11 @@ "type": { "type": "reference", "name": "FirebaseOptions", - "id": 479 + "id": 656 } }, { - "id": 497, + "id": 674, "name": "delete", "kind": 2048, "kindString": "Method", @@ -3510,7 +3733,7 @@ }, "signatures": [ { - "id": 498, + "id": 675, "name": "delete", "kind": 4096, "kindString": "Call signature", @@ -3544,15 +3767,15 @@ "title": "Properties", "kind": 1024, "children": [ - 495, - 496 + 672, + 673 ] }, { "title": "Methods", "kind": 2048, "children": [ - 497 + 674 ] } ], @@ -3565,7 +3788,7 @@ ] }, { - "id": 499, + "id": 676, "name": "ReactNativeFirebaseNamespace", "kind": 256, "kindString": "Interface", @@ -3574,7 +3797,7 @@ }, "children": [ { - "id": 511, + "id": 688, "name": "SDK_VERSION", "kind": 1024, "kindString": "Property", @@ -3597,7 +3820,7 @@ } }, { - "id": 510, + "id": 687, "name": "apps", "kind": 1024, "kindString": "Property", @@ -3619,12 +3842,12 @@ "elementType": { "type": "reference", "name": "FirebaseApp", - "id": 494 + "id": 671 } } }, { - "id": 507, + "id": 684, "name": "app", "kind": 2048, "kindString": "Method", @@ -3633,7 +3856,7 @@ }, "signatures": [ { - "id": 508, + "id": 685, "name": "app", "kind": 4096, "kindString": "Call signature", @@ -3649,7 +3872,7 @@ }, "parameters": [ { - "id": 509, + "id": 686, "name": "name", "kind": 32768, "kindString": "Parameter", @@ -3677,7 +3900,7 @@ "type": { "type": "reference", "name": "FirebaseApp", - "id": 494 + "id": 671 } } ], @@ -3690,7 +3913,7 @@ ] }, { - "id": 500, + "id": 677, "name": "initializeApp", "kind": 2048, "kindString": "Method", @@ -3699,7 +3922,7 @@ }, "signatures": [ { - "id": 501, + "id": 678, "name": "initializeApp", "kind": 4096, "kindString": "Call signature", @@ -3709,7 +3932,7 @@ }, "parameters": [ { - "id": 502, + "id": 679, "name": "options", "kind": 32768, "kindString": "Parameter", @@ -3720,11 +3943,11 @@ "type": { "type": "reference", "name": "FirebaseOptions", - "id": 479 + "id": 656 } }, { - "id": 503, + "id": 680, "name": "config", "kind": 32768, "kindString": "Parameter", @@ -3737,18 +3960,18 @@ "type": { "type": "reference", "name": "FirebaseAppConfig", - "id": 455 + "id": 632 } } ], "type": { "type": "reference", "name": "FirebaseApp", - "id": 494 + "id": 671 } }, { - "id": 504, + "id": 681, "name": "initializeApp", "kind": 4096, "kindString": "Call signature", @@ -3758,7 +3981,7 @@ }, "parameters": [ { - "id": 505, + "id": 682, "name": "options", "kind": 32768, "kindString": "Parameter", @@ -3769,11 +3992,11 @@ "type": { "type": "reference", "name": "FirebaseOptions", - "id": 479 + "id": 656 } }, { - "id": 506, + "id": 683, "name": "name", "kind": 32768, "kindString": "Parameter", @@ -3801,7 +4024,7 @@ "type": { "type": "reference", "name": "FirebaseApp", - "id": 494 + "id": 671 } } ], @@ -3824,16 +4047,16 @@ "title": "Properties", "kind": 1024, "children": [ - 511, - 510 + 688, + 687 ] }, { "title": "Methods", "kind": 2048, "children": [ - 507, - 500 + 684, + 677 ] } ], @@ -3851,8 +4074,8 @@ "title": "Interfaces", "kind": 256, "children": [ - 494, - 499 + 671, + 676 ] } ], @@ -3873,7 +4096,8 @@ "isExported": true }, "comment": { - "shortText": "Auth", + "shortText": "Firebase Authentication package for React Native.", + "text": "#### Example 1\n\nAccess the firebase export from the `auth` package:\n\n```js\nimport { firebase } from '@react-native-firebase/auth';\n\n// firebase.auth().X\n```\n\n#### Example 2\n\nUsing the default export from the `auth` package:\n\n```js\nimport auth from '@react-native-firebase/auth';\n\n// auth().X\n```\n\n#### Example 3\n\nUsing the default export from the `app` package:\n\n```js\nimport firebase from '@react-native-firebase/app';\nimport '@react-native-firebase/auth';\n\n// firebase.auth().X\n```\n", "tags": [ { "tag": "firebase", @@ -3885,11 +4109,15 @@ { "id": 61, "name": "Module", - "kind": 256, - "kindString": "Interface", + "kind": 128, + "kindString": "Class", "flags": { "isExported": true }, + "comment": { + "shortText": "The Firebase Authentication service is available for the default app or a given app.", + "text": "#### Example 1\n\nGet the auth instance for the **default app**:\n\n```js\nconst authForDefaultApp = firebase.auth();\n```\n\n#### Example 2\n\nGet the auth instance for a **secondary app**:\n\n```js\nconst otherApp = firebase.app('otherApp');\nconst authForOtherApp = firebase.auth(otherApp);\n```\n\n" + }, "children": [ { "id": 62, @@ -3928,8 +4156,8 @@ "sources": [ { "fileName": "auth/lib/index.d.ts", - "line": 32, - "character": 25 + "line": 84, + "character": 21 } ], "extendedTypes": [ @@ -3950,18 +4178,24 @@ "sources": [ { "fileName": "auth/lib/index.d.ts", - "line": 30, + "line": 61, "character": 26 } ] } ], "groups": [ + { + "title": "Classes", + "kind": 128, + "children": [ + 61 + ] + }, { "title": "Interfaces", "kind": 256, "children": [ - 61, 60 ] } @@ -3969,7 +4203,7 @@ "sources": [ { "fileName": "auth/lib/index.d.ts", - "line": 29, + "line": 60, "character": 21 } ] @@ -3983,7 +4217,8 @@ "isExported": true }, "comment": { - "shortText": "Firebase Remote Config is a cloud service that lets you change the behavior and appearance of your\napp without requiring users to download an app update. When using Remote Config, you create in-app default\nvalues that control the behavior and appearance of your app.", + "shortText": "Firebase Remote Config package for React Native.", + "text": "#### Example 1\n\nAccess the firebase export from the `config` package:\n\n```js\nimport { firebase } from '@react-native-firebase/config';\n\n// firebase.config().X\n```\n\n#### Example 2\n\nUsing the default export from the `config` package:\n\n```js\nimport config from '@react-native-firebase/config';\n\n// config().X\n```\n\n#### Example 3\n\nUsing the default export from the `app` package:\n\n```js\nimport firebase from '@react-native-firebase/app';\nimport '@react-native-firebase/config';\n\n// firebase.config().X\n```\n", "tags": [ { "tag": "firebase", @@ -3992,390 +4227,18 @@ ] }, "children": [ - { - "id": 84, - "name": "ConfigDefaults", - "kind": 256, - "kindString": "Interface", - "flags": { - "isExported": true - }, - "comment": { - "shortText": "An Interface representing a Config Defaults object." - }, - "indexSignature": [ - { - "id": 85, - "name": "__index", - "kind": 8192, - "kindString": "Index signature", - "flags": {}, - "comment": { - "shortText": "An Interface representing a Config Defaults object." - }, - "parameters": [ - { - "id": 86, - "name": "key", - "kind": 32768, - "kindString": "Parameter", - "flags": {}, - "type": { - "type": "intrinsic", - "name": "string" - } - } - ], - "type": { - "type": "union", - "types": [ - { - "type": "intrinsic", - "name": "number" - }, - { - "type": "intrinsic", - "name": "string" - }, - { - "type": "intrinsic", - "name": "boolean" - } - ] - } - } - ], - "sources": [ - { - "fileName": "config/lib/index.d.ts", - "line": 75, - "character": 33 - } - ] - }, - { - "id": 80, - "name": "ConfigSettingsRead", - "kind": 256, - "kindString": "Interface", - "flags": { - "isExported": true - }, - "comment": { - "shortText": "An Interface representing readable config settings." - }, - "children": [ - { - "id": 82, - "name": "isDeveloperModeEnabled", - "kind": 1024, - "kindString": "Property", - "flags": { - "isExported": true - }, - "sources": [ - { - "fileName": "config/lib/index.d.ts", - "line": 68, - "character": 26 - } - ], - "type": { - "type": "intrinsic", - "name": "boolean" - } - }, - { - "id": 83, - "name": "lastFetchStatus", - "kind": 1024, - "kindString": "Property", - "flags": { - "isExported": true - }, - "sources": [ - { - "fileName": "config/lib/index.d.ts", - "line": 69, - "character": 19 - } - ], - "type": { - "type": "union", - "types": [ - { - "type": "stringLiteral", - "value": "success" - }, - { - "type": "stringLiteral", - "value": "failure" - }, - { - "type": "stringLiteral", - "value": "no_fetch_yet" - }, - { - "type": "stringLiteral", - "value": "throttled" - } - ] - } - }, - { - "id": 81, - "name": "lastFetchTime", - "kind": 1024, - "kindString": "Property", - "flags": { - "isExported": true - }, - "sources": [ - { - "fileName": "config/lib/index.d.ts", - "line": 67, - "character": 17 - } - ], - "type": { - "type": "intrinsic", - "name": "number" - } - } - ], - "groups": [ - { - "title": "Properties", - "kind": 1024, - "children": [ - 82, - 83, - 81 - ] - } - ], - "sources": [ - { - "fileName": "config/lib/index.d.ts", - "line": 66, - "character": 37 - } - ] - }, - { - "id": 78, - "name": "ConfigSettingsWrite", - "kind": 256, - "kindString": "Interface", - "flags": { - "isExported": true - }, - "comment": { - "shortText": "An Interface representing settable config settings." - }, - "children": [ - { - "id": 79, - "name": "isDeveloperModeEnabled", - "kind": 1024, - "kindString": "Property", - "flags": { - "isExported": true - }, - "sources": [ - { - "fileName": "config/lib/index.d.ts", - "line": 60, - "character": 26 - } - ], - "type": { - "type": "intrinsic", - "name": "boolean" - } - } - ], - "groups": [ - { - "title": "Properties", - "kind": 1024, - "children": [ - 79 - ] - } - ], - "sources": [ - { - "fileName": "config/lib/index.d.ts", - "line": 59, - "character": 38 - } - ] - }, - { - "id": 72, - "name": "ConfigValue", - "kind": 256, - "kindString": "Interface", - "flags": { - "isExported": true - }, - "comment": { - "shortText": "An Interface representing a Remote Config value" - }, - "children": [ - { - "id": 73, - "name": "source", - "kind": 1024, - "kindString": "Property", - "flags": { - "isExported": true - }, - "comment": { - "shortText": "Where the value was retrieved from" - }, - "sources": [ - { - "fileName": "config/lib/index.d.ts", - "line": 41, - "character": 10 - } - ], - "type": { - "type": "union", - "types": [ - { - "type": "stringLiteral", - "value": "remote" - }, - { - "type": "stringLiteral", - "value": "default" - }, - { - "type": "stringLiteral", - "value": "static" - } - ] - } - }, - { - "id": 74, - "name": "value", - "kind": 1024, - "kindString": "Property", - "flags": { - "isExported": true - }, - "comment": { - "shortText": "The value" - }, - "sources": [ - { - "fileName": "config/lib/index.d.ts", - "line": 46, - "character": 9 - } - ], - "type": { - "type": "union", - "types": [ - { - "type": "intrinsic", - "name": "undefined" - }, - { - "type": "intrinsic", - "name": "number" - }, - { - "type": "intrinsic", - "name": "boolean" - }, - { - "type": "intrinsic", - "name": "string" - } - ] - } - } - ], - "groups": [ - { - "title": "Properties", - "kind": 1024, - "children": [ - 73, - 74 - ] - } - ], - "sources": [ - { - "fileName": "config/lib/index.d.ts", - "line": 37, - "character": 30 - } - ] - }, - { - "id": 75, - "name": "ConfigValues", - "kind": 256, - "kindString": "Interface", - "flags": { - "isExported": true - }, - "comment": { - "shortText": "An Interface representing multiple Config Values" - }, - "indexSignature": [ - { - "id": 76, - "name": "__index", - "kind": 8192, - "kindString": "Index signature", - "flags": {}, - "comment": { - "shortText": "An Interface representing multiple Config Values" - }, - "parameters": [ - { - "id": 77, - "name": "key", - "kind": 32768, - "kindString": "Parameter", - "flags": {}, - "type": { - "type": "intrinsic", - "name": "string" - } - } - ], - "type": { - "type": "reference", - "name": "ConfigValue", - "id": 72 - } - } - ], - "sources": [ - { - "fileName": "config/lib/index.d.ts", - "line": 52, - "character": 31 - } - ] - }, { "id": 87, "name": "Module", - "kind": 256, - "kindString": "Interface", + "kind": 128, + "kindString": "Class", "flags": { "isExported": true }, + "comment": { + "shortText": "The Firebase Remote Config service interface.", + "text": "> This module is available for the default app only.\n\n#### Example\n\nGet the Remote Config service for the default app:\n\n```js\nconst defaultAppRemoteConfig = firebase.config();\n```\n" + }, "children": [ { "id": 116, @@ -4417,7 +4280,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Moves fetched data to the apps active config.\nResolves with a boolean value of whether the fetched config was moved successfully." + "shortText": "Moves fetched data to the apps active config.\nResolves with a boolean value of whether the fetched config was moved successfully.", + "text": "#### Example\n\n```js\n// Fetch values\nawait firebase.config().fetch();\nconst activated = await firebase.config().activateFetched();\n\nif (activated) {\n console.log('Fetched values successfully activated.');\n} else {\n console.log('Fetched values failed to activate.');\n}\n```\n" }, "type": { "type": "reference", @@ -4434,7 +4298,7 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 84, + "line": 210, "character": 19 } ] @@ -4455,7 +4319,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Fetches the remote config data from Firebase, as defined in the dashboard. If duration is defined (seconds), data will be locally cached for this duration." + "shortText": "Fetches the remote config data from Firebase, as defined in the dashboard. If duration is defined (seconds), data will be locally cached for this duration.", + "text": "#### Example\n\n```js\n// Fetch and cache for 5 minutes\nawait firebase.config().fetch(300);\n```\n" }, "parameters": [ { @@ -4499,7 +4364,7 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 91, + "line": 224, "character": 9 } ] @@ -4521,7 +4386,7 @@ "flags": {}, "comment": { "shortText": "Fetches the remote config data from Firebase, as defined in the dashboard. If duration is defined (seconds), data will be locally cached for this duration.", - "text": "Once fetching is complete this method immediately calls activateFetched and returns a boolean value of the activation status.\n" + "text": "Once fetching is complete this method immediately calls activateFetched and returns a boolean value of the activation status.\n\n#### Example\n\n```js\n// Fetch, cache for 5 minutes and activate\nconst activated = await firebase.config().fetchAndActivate(300);\n\nif (activated) {\n console.log('Fetched values successfully activated.');\n} else {\n console.log('Fetched values failed to activate.');\n}\n```\n" }, "parameters": [ { @@ -4565,7 +4430,7 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 100, + "line": 246, "character": 20 } ] @@ -4586,7 +4451,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Retrieve the configuration settings and status for Remote Config." + "shortText": "Retrieve the configuration settings and status for Remote Config.", + "text": "### Example\n\n```js\nconst settings = await firebase.config().getConfigSettings();\nconsole.log('Developer mode enabled: ', settings.isDeveloperModeEnabled);\n```\n" }, "type": { "type": "reference", @@ -4604,7 +4470,7 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 105, + "line": 258, "character": 21 } ] @@ -4625,7 +4491,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Returns all keys matching the prefix as an array. If no prefix is defined all keys are returned." + "shortText": "Returns all keys matching the prefix as an array. If no prefix is defined all keys are returned.", + "text": "#### Example\n\n```js\n const keys = await firebase.config().getKeysByPrefix('feature_');\n```\n" }, "parameters": [ { @@ -4672,7 +4539,7 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 112, + "line": 271, "character": 19 } ] @@ -4693,7 +4560,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Gets a ConfigValue by key." + "shortText": "Gets a ConfigValue by key.", + "text": "#### Example\n\n```js\nconst configValue = await firebase.config().getValue('experiment');\nconsole.log('Source: ', configValue.source);\nconsole.log('Value: ', configValue.value);\n```\n" }, "parameters": [ { @@ -4727,7 +4595,7 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 126, + "line": 304, "character": 12 } ] @@ -4748,7 +4616,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Returns all config values for the keys matching the prefix provided. In no prefix is provided all values are returned." + "shortText": "Returns all config values for the keys matching the prefix provided. In no prefix is provided all values are returned.", + "text": "#### Example\n\n```js\nconst values = await firebase.config().getValuesByKeysPrefix('feature_');\n\nvalues.forEach(($) => {\n console.log('Source: ', $.source);\n console.log('Value: ', $.value);\n});\n```\n" }, "parameters": [ { @@ -4793,7 +4662,7 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 119, + "line": 289, "character": 25 } ] @@ -4814,7 +4683,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Set the Remote Config settings, specifically the `isDeveloperModeEnabled` flag." + "shortText": "Set the Remote Config settings, specifically the `isDeveloperModeEnabled` flag.", + "text": "#### Example\n\n```js\nawait firebase.config().setConfigSettings({\n isDeveloperModeEnabled: __DEV__,\n});\n```\n" }, "parameters": [ { @@ -4849,7 +4719,7 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 133, + "line": 319, "character": 21 } ] @@ -4870,7 +4740,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Sets default values for the app to use when accessing values.\nAny data fetched and activated will override any default values. Any values in the defaults but not on Firebase will be untouched." + "shortText": "Sets default values for the app to use when accessing values.\nAny data fetched and activated will override any default values. Any values in the defaults but not on Firebase will be untouched.", + "text": "#### Example\n\n```js\nawait firebase.config().setDefaults({\n experiment_enabled: false,\n});\n```\n" }, "parameters": [ { @@ -4904,7 +4775,7 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 141, + "line": 335, "character": 15 } ] @@ -4926,12 +4797,7 @@ "flags": {}, "comment": { "shortText": "Sets the default values from a resource file.\nOn iOS this is a plist file and on Android this is an XML defaultsMap file.", - "tags": [ - { - "tag": "link", - "text": "/guides/todo\n" - } - ] + "text": "```js\n // TODO @ehesp\n```\n" }, "parameters": [ { @@ -4964,7 +4830,7 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 151, + "line": 347, "character": 27 } ] @@ -4998,8 +4864,8 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 79, - "character": 25 + "line": 191, + "character": 21 } ], "extendedTypes": [ @@ -5009,6 +4875,402 @@ } ] }, + { + "id": 84, + "name": "ConfigDefaults", + "kind": 256, + "kindString": "Interface", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "An Interface representing a Config Defaults object.", + "text": "#### Example\n\n```js\nawait firebase.config().setDefaults({\n experiment_enabled: false,\n});\n```\n" + }, + "indexSignature": [ + { + "id": 85, + "name": "__index", + "kind": 8192, + "kindString": "Index signature", + "flags": {}, + "comment": { + "shortText": "An Interface representing a Config Defaults object.", + "text": "#### Example\n\n```js\nawait firebase.config().setDefaults({\n experiment_enabled: false,\n});\n```\n" + }, + "parameters": [ + { + "id": 86, + "name": "key", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "number" + }, + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "boolean" + } + ] + } + } + ], + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 174, + "character": 33 + } + ] + }, + { + "id": 80, + "name": "ConfigSettingsRead", + "kind": 256, + "kindString": "Interface", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "An Interface representing readable config settings.", + "text": "#### Example\n\n```js\nconst settings = await firebase.config().getConfigSettings();\nconsole.log('Last fetched time: ', settings.lastFetchTime);\nconsole.log('Developer mode enabled': settings.isDeveloperModeEnabled);\nconsole.log('Last fetch status: ', settings.lastFetchStatus);\n```\n" + }, + "children": [ + { + "id": 82, + "name": "isDeveloperModeEnabled", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Whether developer mode is enabled. This is set manually via {@link config#setConfigSettings}" + }, + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 156, + "character": 26 + } + ], + "type": { + "type": "intrinsic", + "name": "boolean" + } + }, + { + "id": 83, + "name": "lastFetchStatus", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "The status of the latest Remote Config fetch action." + }, + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 160, + "character": 19 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "stringLiteral", + "value": "success" + }, + { + "type": "stringLiteral", + "value": "failure" + }, + { + "type": "stringLiteral", + "value": "no_fetch_yet" + }, + { + "type": "stringLiteral", + "value": "throttled" + } + ] + } + }, + { + "id": 81, + "name": "lastFetchTime", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "The number of milliseconds since the last Remote Config fetch was performed." + }, + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 152, + "character": 17 + } + ], + "type": { + "type": "intrinsic", + "name": "number" + } + } + ], + "groups": [ + { + "title": "Properties", + "kind": 1024, + "children": [ + 82, + 83, + 81 + ] + } + ], + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 148, + "character": 37 + } + ] + }, + { + "id": 78, + "name": "ConfigSettingsWrite", + "kind": 256, + "kindString": "Interface", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "An Interface representing settable config settings.", + "text": "#### Example\n\nThe example below makes use of the React Native `__DEV__` global JavaScript variable which\nis exposed.\n\n```js\nawait firebase.config().setConfigSettings({\n isDeveloperModeEnabled: __DEV__,\n});\n```\n" + }, + "children": [ + { + "id": 79, + "name": "isDeveloperModeEnabled", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "If enabled, default behaviour such as caching is disabled for a better debugging\nexperience." + }, + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 133, + "character": 26 + } + ], + "type": { + "type": "intrinsic", + "name": "boolean" + } + } + ], + "groups": [ + { + "title": "Properties", + "kind": 1024, + "children": [ + 79 + ] + } + ], + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 128, + "character": 38 + } + ] + }, + { + "id": 72, + "name": "ConfigValue", + "kind": 256, + "kindString": "Interface", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "An Interface representing a Remote Config value." + }, + "children": [ + { + "id": 73, + "name": "source", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Where the value was retrieved from.", + "text": "- `remote`: If the value was retrieved from the server.\n- `default`: If the value was set as a default value.\n- `static`: If no value was found and a static default value was returned instead.\n\n#### Example\n\n```js\nconst configValue = await firebase.config().getValue('beta_enabled');\nconsole.log('Value source: ', configValue.source);\n```\n" + }, + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 81, + "character": 10 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "stringLiteral", + "value": "remote" + }, + { + "type": "stringLiteral", + "value": "default" + }, + { + "type": "stringLiteral", + "value": "static" + } + ] + } + }, + { + "id": 74, + "name": "value", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "The returned value.", + "text": "#### Example\n\n```js\nconst configValue = await firebase.config().getValue('beta_enabled');\nconsole.log('Value: ', configValue.value);\n```\n" + }, + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 93, + "character": 9 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "number" + }, + { + "type": "intrinsic", + "name": "boolean" + }, + { + "type": "intrinsic", + "name": "string" + } + ] + } + } + ], + "groups": [ + { + "title": "Properties", + "kind": 1024, + "children": [ + 73, + 74 + ] + } + ], + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 66, + "character": 30 + } + ] + }, + { + "id": 75, + "name": "ConfigValues", + "kind": 256, + "kindString": "Interface", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "An Interface representing multiple Config Values.", + "text": "#### Example\n\n```js\nconst values = await firebase.config().getValuesByKeysPrefix('feature_');\n\nvalues.forEach(($) => {\n console.log('Source: ', $.source);\n console.log('Value: ', $.value);\n});\n```\n" + }, + "indexSignature": [ + { + "id": 76, + "name": "__index", + "kind": 8192, + "kindString": "Index signature", + "flags": {}, + "comment": { + "shortText": "An Interface representing multiple Config Values.", + "text": "#### Example\n\n```js\nconst values = await firebase.config().getValuesByKeysPrefix('feature_');\n\nvalues.forEach(($) => {\n console.log('Source: ', $.source);\n console.log('Value: ', $.value);\n});\n```\n" + }, + "parameters": [ + { + "id": 77, + "name": "key", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "type": { + "type": "reference", + "name": "ConfigValue", + "id": 72 + } + } + ], + "sources": [ + { + "fileName": "config/lib/index.d.ts", + "line": 110, + "character": 31 + } + ] + }, { "id": 71, "name": "Statics", @@ -5020,13 +5282,20 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 32, + "line": 61, "character": 26 } ] } ], "groups": [ + { + "title": "Classes", + "kind": 128, + "children": [ + 87 + ] + }, { "title": "Interfaces", "kind": 256, @@ -5036,7 +5305,6 @@ 78, 72, 75, - 87, 71 ] } @@ -5044,7 +5312,7 @@ "sources": [ { "fileName": "config/lib/index.d.ts", - "line": 31, + "line": 60, "character": 23 } ] @@ -5058,7 +5326,8 @@ "isExported": true }, "comment": { - "shortText": "Firebase Crashlytics helps you track, prioritize, and fix stability issues that erode app quality, in realtime.\nSpend less time triaging and troubleshooting crashes and more time building app features that delight users.", + "shortText": "Firebase Crashlytics package for React Native.", + "text": "#### Example 1\n\nAccess the firebase export from the `crashlytics` package:\n\n```js\nimport { firebase } from '@react-native-firebase/crashlytics';\n\n// firebase.crashlytics().X\n```\n\n#### Example 2\n\nUsing the default export from the `crashlytics` package:\n\n```js\nimport crashlytics from '@react-native-firebase/crashlytics';\n\n// crashlytics().X\n```\n\n#### Example 3\n\nUsing the default export from the `app` package:\n\n```js\nimport firebase from '@react-native-firebase/app';\nimport '@react-native-firebase/crashlytics';\n\n// firebase.crashlytics().X\n```\n", "tags": [ { "tag": "firebase", @@ -5070,11 +5339,15 @@ { "id": 126, "name": "Module", - "kind": 256, - "kindString": "Interface", + "kind": 128, + "kindString": "Class", "flags": { "isExported": true }, + "comment": { + "shortText": "The Firebase Crashlytics service interface.", + "text": "> This module is available for the default app only.\n\n#### Example\n\nGet the Crashlytics service for the default app:\n\n```js\nconst defaultAppCrashlytics = firebase.crashlytics();\n```\n" + }, "children": [ { "id": 158, @@ -5109,12 +5382,13 @@ "isExported": true }, "comment": { - "shortText": "Whether Crashlytics reporting is enabled." + "shortText": "Whether Crashlytics reporting is enabled.", + "text": "#### Example\n\n```js\nconst isEnabled = firebase.crashlytics().isCrashlyticsCollectionEnabled;\n```\n\n" }, "sources": [ { "fileName": "crashlytics/lib/index.d.ts", - "line": 37, + "line": 87, "character": 34 } ], @@ -5139,7 +5413,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Cause your app to crash for testing purposes." + "shortText": "Cause your app to crash for testing purposes.", + "text": "#### Example\n\n```js\nfirebase.crashlytics().crash();\n```\n\n" }, "type": { "type": "intrinsic", @@ -5150,7 +5425,7 @@ "sources": [ { "fileName": "crashlytics/lib/index.d.ts", - "line": 42, + "line": 99, "character": 9 } ] @@ -5171,7 +5446,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Log a message that will appear in any subsequent Crash or Non-fatal error reports." + "shortText": "Log a message that will appear in any subsequent Crash or Non-fatal error reports.", + "text": "#### Example\n\n```js\nfirebase.crashlytics().logEvent('Testing a crash');\nfirebase.crashlytics().crash();\n```\n" }, "parameters": [ { @@ -5198,7 +5474,7 @@ "sources": [ { "fileName": "crashlytics/lib/index.d.ts", - "line": 49, + "line": 113, "character": 7 } ] @@ -5220,7 +5496,7 @@ "flags": {}, "comment": { "shortText": "Record a JavaScript Error.", - "text": "The JavaScript stack trace is converted into a mock native iOS or Android exception before submission.\n" + "text": "The JavaScript stack trace is converted into a mock native iOS or Android exception before submission.\n\n#### Example\n\n```js\nfirebase.crashlytics().recordError(\n new Error('An error was caught')\n);\n```\n" }, "parameters": [ { @@ -5247,7 +5523,7 @@ "sources": [ { "fileName": "crashlytics/lib/index.d.ts", - "line": 58, + "line": 130, "character": 15 } ] @@ -5268,7 +5544,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Sets a string value to be associated with the given attribute name which will be visible in the Firebase Crashlytics console." + "shortText": "Sets a string value to be associated with the given attribute name which will be visible in the Firebase Crashlytics console.", + "text": "#### Example\n\n```js\nawait firebase.crashlytics().setAttribute('role', 'admin');\n```\n" }, "parameters": [ { @@ -5277,7 +5554,9 @@ "kind": 32768, "kindString": "Parameter", "flags": {}, - "comment": {}, + "comment": { + "text": "The name of the attribute to set." + }, "type": { "type": "intrinsic", "name": "string" @@ -5290,7 +5569,7 @@ "kindString": "Parameter", "flags": {}, "comment": { - "text": "\n" + "text": "A string value for the given attribute.\n" }, "type": { "type": "intrinsic", @@ -5313,7 +5592,7 @@ "sources": [ { "fileName": "crashlytics/lib/index.d.ts", - "line": 93, + "line": 195, "character": 16 } ] @@ -5334,7 +5613,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Like `setAttribute` but for multiple attributes." + "shortText": "Like `setAttribute` but for multiple attributes.", + "text": "#### Example\n\n```js\nawait firebase.crashlytics().setAttributes({\n role: 'admin',\n followers: '13',\n});\n```\n" }, "parameters": [ { @@ -5344,7 +5624,7 @@ "kindString": "Parameter", "flags": {}, "comment": { - "text": "\n" + "text": "An object of key/value attribute name and values.\n" }, "type": { "type": "reflection", @@ -5383,7 +5663,7 @@ "sources": [ { "fileName": "crashlytics/lib/index.d.ts", - "line": 100, + "line": 211, "character": 29 } ] @@ -5406,7 +5686,7 @@ "sources": [ { "fileName": "crashlytics/lib/index.d.ts", - "line": 100, + "line": 211, "character": 17 } ] @@ -5428,7 +5708,7 @@ "flags": {}, "comment": { "shortText": "Enable/disable Crashlytics reporting.", - "text": "Use this for opt-in first user data collection flows combined with `firebase.json` settings to disable auto collection.\n" + "text": "Use this for opt-in first user data collection flows combined with `firebase.json` settings to disable auto collection.\n\n#### Example\n\n```js\n// Disable crash reporting\nawait firebase.crashlytics().setCrashlyticsCollectionEnabled(false);\n```\n" }, "parameters": [ { @@ -5438,7 +5718,7 @@ "kindString": "Parameter", "flags": {}, "comment": { - "text": "\n" + "text": "A boolean value representing whether to enable Crashlytics error collection.\n" }, "type": { "type": "intrinsic", @@ -5461,7 +5741,7 @@ "sources": [ { "fileName": "crashlytics/lib/index.d.ts", - "line": 109, + "line": 227, "character": 35 } ] @@ -5483,7 +5763,7 @@ "flags": {}, "comment": { "shortText": "Optionally specify a user email which will be visible in the Firebase Crashlytics console.", - "text": "If you choose to collect contact information it is strongly recommend that you disclose this in your apps privacy policy.\n" + "text": "If you choose to collect contact information it is strongly recommend that you disclose this in your apps privacy policy.\n\n#### Example\n\n```js\nfirebase.crashlytics().setUserEmail('user@gmail.com');\n```\n" }, "parameters": [ { @@ -5493,7 +5773,7 @@ "kindString": "Parameter", "flags": {}, "comment": { - "text": "\n" + "text": "A users email address.\n" }, "type": { "type": "intrinsic", @@ -5516,7 +5796,7 @@ "sources": [ { "fileName": "crashlytics/lib/index.d.ts", - "line": 85, + "line": 181, "character": 16 } ] @@ -5538,7 +5818,7 @@ "flags": {}, "comment": { "shortText": "Specify a user identifier which will be visible in the Firebase Crashlytics console.", - "text": "It is recommended for privacy purposes that this value be a value that's meaningless to a third-party observer; such as an arbitrary string that ties an end-user to a record in your system e.g. a database record id.\n" + "text": "It is recommended for privacy purposes that this value be a value that's meaningless to a third-party\nobserver; such as an arbitrary string that ties an end-user to a record in your system e.g. a database record id.\n\n#### Example\n\n```js\n// Custom user id\nawait firebase.crashlytics().setUserId('123456789');\n// Firebase auth uid\nawait firebase.crashlytics().setUserId(\n firebase.auth().currentUser.uid\n);\n```\n" }, "parameters": [ { @@ -5571,7 +5851,7 @@ "sources": [ { "fileName": "crashlytics/lib/index.d.ts", - "line": 67, + "line": 151, "character": 13 } ] @@ -5593,7 +5873,7 @@ "flags": {}, "comment": { "shortText": "Optionally specify a user name which will be visible in the Firebase Crashlytics console.", - "text": "If you choose to collect contact information it is strongly recommend that you disclose this in your apps privacy policy.\n" + "text": "If you choose to collect contact information it is strongly recommend that you disclose this in your apps privacy policy.\n\n#### Example\n\n```js\nawait firebase.crashlytics().setUserName('Alias');\n```\n" }, "parameters": [ { @@ -5626,7 +5906,7 @@ "sources": [ { "fileName": "crashlytics/lib/index.d.ts", - "line": 76, + "line": 166, "character": 15 } ] @@ -5660,8 +5940,8 @@ "sources": [ { "fileName": "crashlytics/lib/index.d.ts", - "line": 33, - "character": 25 + "line": 76, + "character": 21 } ], "extendedTypes": [ @@ -5682,18 +5962,24 @@ "sources": [ { "fileName": "crashlytics/lib/index.d.ts", - "line": 31, + "line": 61, "character": 26 } ] } ], "groups": [ + { + "title": "Classes", + "kind": 128, + "children": [ + 126 + ] + }, { "title": "Interfaces", "kind": 256, "children": [ - 126, 125 ] } @@ -5701,7 +5987,7 @@ "sources": [ { "fileName": "crashlytics/lib/index.d.ts", - "line": 30, + "line": 60, "character": 28 } ] @@ -5715,7 +6001,8 @@ "isExported": true }, "comment": { - "shortText": "Firebase In-App Messaging helps you engage users who are actively using your app by sending\nthem targeted and contextual messages that nudge them to complete key in-app actions - like\nbeating a game level, buying an item, or subscribing to content.", + "shortText": "Firebase In-App Messaging package for React Native.", + "text": "#### Example 1\n\nAccess the firebase export from the `fiam` package:\n\n```js\nimport { firebase } from '@react-native-firebase/fiam';\n\n// firebase.fiam().X\n```\n\n#### Example 2\n\nUsing the default export from the `fiam` package:\n\n```js\nimport fiam from '@react-native-firebase/fiam';\n\n// fiam().X\n```\n\n#### Example 3\n\nUsing the default export from the `app` package:\n\n```js\nimport firebase from '@react-native-firebase/app';\nimport '@react-native-firebase/fiam';\n\n// firebase.fiam().X\n```\n", "tags": [ { "tag": "firebase", @@ -5727,11 +6014,15 @@ { "id": 168, "name": "Module", - "kind": 256, - "kindString": "Interface", + "kind": 128, + "kindString": "Class", "flags": { "isExported": true }, + "comment": { + "shortText": "The Firebase In-App Messaging service interface.", + "text": "> This module is available for the default app only.\n\n#### Example\n\nGet the In-App Messaging service for the default app:\n\n```js\nconst defaultAppFiam = firebase.fiam();\n```\n" + }, "children": [ { "id": 177, @@ -5766,12 +6057,13 @@ "isExported": true }, "comment": { - "shortText": "Determines whether automatic data collection is enabled or not." + "shortText": "Determines whether automatic data collection is enabled or not.", + "text": "#### Example\n\n```js\nconst isDataCollectionEnabled = firebase.fiam().isAutomaticDataCollectionEnabled;\n```\n" }, "sources": [ { "fileName": "fiam/lib/index.d.ts", - "line": 53, + "line": 114, "character": 36 } ], @@ -5789,12 +6081,13 @@ "isExported": true }, "comment": { - "shortText": "Determines whether messages are suppressed or not." + "shortText": "Determines whether messages are suppressed or not.", + "text": "#### Example\n\n```js\nconst isSuppressed = firebase.fiam().isMessagesDisplaySuppressed;\n```\n" }, "sources": [ { "fileName": "fiam/lib/index.d.ts", - "line": 38, + "line": 86, "character": 31 } ], @@ -5820,7 +6113,7 @@ "flags": {}, "comment": { "shortText": "Enable or disable automatic data collection for Firebase In-App Messaging.", - "text": "When enabled, generates a registration token on app startup if there is no valid one and generates a new token\nwhen it is deleted (which prevents deleteInstanceId() from stopping the periodic sending of data).\n\nThis setting is persisted across app restarts and overrides the setting specified in your manifest/plist file.\n" + "text": "When enabled, generates a registration token on app startup if there is no valid one and generates a new token\nwhen it is deleted (which prevents deleteInstanceId() from stopping the periodic sending of data).\n\nThis setting is persisted across app restarts and overrides the setting specified in your manifest/plist file.\n\n#### Example\n\n```js\n// Disable data collection\nfirebase.fiam().setAutomaticDataCollectionEnabled(false);\n```\n" }, "parameters": [ { @@ -5830,7 +6123,7 @@ "kindString": "Parameter", "flags": {}, "comment": { - "text": "Whether automatic data collection is enabled\n" + "text": "Whether automatic data collection is enabled.\n" }, "type": { "type": "intrinsic", @@ -5853,7 +6146,7 @@ "sources": [ { "fileName": "fiam/lib/index.d.ts", - "line": 65, + "line": 133, "character": 37 } ] @@ -5875,7 +6168,7 @@ "flags": {}, "comment": { "shortText": "Enable or disable suppression of Firebase In App Messaging messages.", - "text": "When enabled, no in app messages will be rendered until either you disable suppression, or the app restarts.\nThis state is not persisted between app restarts.\n" + "text": "When enabled, no in app messages will be rendered until either you disable suppression, or the app restarts.\nThis state is not persisted between app restarts.\n\n#### Example\n\n```js\n// Suppress messages\nawait firebase.fiam().setMessagesDisplaySuppressed(true);\n```\n" }, "parameters": [ { @@ -5885,7 +6178,7 @@ "kindString": "Parameter", "flags": {}, "comment": { - "text": "Whether messages should be suppressed\n" + "text": "Whether messages should be suppressed.\n" }, "type": { "type": "intrinsic", @@ -5908,7 +6201,7 @@ "sources": [ { "fileName": "fiam/lib/index.d.ts", - "line": 48, + "line": 103, "character": 32 } ] @@ -5936,8 +6229,8 @@ "sources": [ { "fileName": "fiam/lib/index.d.ts", - "line": 34, - "character": 25 + "line": 76, + "character": 21 } ], "extendedTypes": [ @@ -5958,18 +6251,24 @@ "sources": [ { "fileName": "fiam/lib/index.d.ts", - "line": 32, + "line": 61, "character": 26 } ] } ], "groups": [ + { + "title": "Classes", + "kind": 128, + "children": [ + 168 + ] + }, { "title": "Interfaces", "kind": 256, "children": [ - 168, 167 ] } @@ -5977,7 +6276,7 @@ "sources": [ { "fileName": "fiam/lib/index.d.ts", - "line": 31, + "line": 60, "character": 21 } ] @@ -5991,7 +6290,8 @@ "isExported": true }, "comment": { - "shortText": "Firestore", + "shortText": "Firebase Cloud Firestore package for React Native.", + "text": "#### Example 1\n\nAccess the firebase export from the `firestore` package:\n\n```js\nimport { firebase } from '@react-native-firebase/firestore';\n\n// firebase.firestore().X\n```\n\n#### Example 2\n\nUsing the default export from the `firestore` package:\n\n```js\nimport firestore from '@react-native-firebase/firestore';\n\n// firestore().X\n```\n\n#### Example 3\n\nUsing the default export from the `app` package:\n\n```js\nimport firebase from '@react-native-firebase/app';\nimport '@react-native-firebase/firestore';\n\n// firebase.firestore().X\n```\n", "tags": [ { "tag": "firebase", @@ -6003,11 +6303,15 @@ { "id": 187, "name": "Module", - "kind": 256, - "kindString": "Interface", + "kind": 128, + "kindString": "Class", "flags": { "isExported": true }, + "comment": { + "shortText": "The Firebase Cloud Firestore service is available for the default app or a given app.", + "text": "#### Example 1\n\nGet the firestore instance for the **default app**:\n\n```js\nconst firestoreForDefaultApp = firebase.firestore();\n```\n\n#### Example 2\n\nGet the firestore instance for a **secondary app**:\n\n```js\nconst otherApp = firebase.app('otherApp');\nconst firestoreForOtherApp = firebase.firestore(otherApp);\n```\n\n" + }, "children": [ { "id": 188, @@ -6046,8 +6350,8 @@ "sources": [ { "fileName": "firestore/lib/index.d.ts", - "line": 32, - "character": 25 + "line": 84, + "character": 21 } ], "extendedTypes": [ @@ -6068,18 +6372,24 @@ "sources": [ { "fileName": "firestore/lib/index.d.ts", - "line": 30, + "line": 61, "character": 26 } ] } ], "groups": [ + { + "title": "Classes", + "kind": 128, + "children": [ + 187 + ] + }, { "title": "Interfaces", "kind": 256, "children": [ - 187, 186 ] } @@ -6087,7 +6397,7 @@ "sources": [ { "fileName": "firestore/lib/index.d.ts", - "line": 29, + "line": 60, "character": 26 } ] @@ -6101,7 +6411,8 @@ "isExported": true }, "comment": { - "shortText": "The Cloud Functions for Firebase client SDKs let you call functions\ndirectly from a Firebase app. To call a function from your app in this way,\nwrite and deploy an HTTPS Callable function in Cloud Functions,\nand then add client logic to call the function from your app.", + "shortText": "Firebase Cloud Functions package for React Native.", + "text": "#### Example 1\n\nAccess the firebase export from the `functions` package:\n\n```js\nimport { firebase } from '@react-native-firebase/functions';\n\n// firebase.functions().X\n```\n\n#### Example 2\n\nUsing the default export from the `functions` package:\n\n```js\nimport functions from '@react-native-firebase/functions';\n\n// functions().X\n```\n\n#### Example 3\n\nUsing the default export from the `app` package:\n\n```js\nimport firebase from '@react-native-firebase/app';\nimport '@react-native-firebase/functions';\n\n// firebase.functions().X\n```\n", "tags": [ { "tag": "firebase", @@ -6110,6 +6421,175 @@ ] }, "children": [ + { + "id": 229, + "name": "Module", + "kind": 128, + "kindString": "Class", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "The Firebase Cloud Functions service is available for the default app, a given app or a specified region.", + "text": "> The default functions region for all apps is `us-central1`.\n\n#### Example 1\n\nGet the functions instance for the **default app**:\n\n```js\nconst functionsForDefaultApp = firebase.functions();\n```\n\n#### Example 2\n\nGet the functions instance for a **secondary app**:\n\n```js\nconst otherApp = firebase.app('otherApp');\nconst functionsForOtherApp = firebase.functions(otherApp);\n```\n\n#### Example 3\n\nGet the functions instance for a **specific functions region**:\n\n```js\nconst defaultApp = firebase.app();\nconst functionsForRegion = defaultApp.functions('europe-west1');\n\nconst otherApp = firebase.app('otherApp');\nconst functionsForOtherAppRegion = otherApp.functions('europe-west1');\n```\n\n" + }, + "children": [ + { + "id": 236, + "name": "app", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "sources": [ + { + "fileName": "analytics/node_modules/@react-native-firebase/app-types/index.d.ts", + "line": 179, + "character": 5 + } + ], + "type": { + "type": "reference", + "name": "FirebaseApp" + }, + "inheritedFrom": { + "type": "reference", + "name": "ReactNativeFirebaseModule.app" + } + }, + { + "id": 230, + "name": "httpsCallable", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 231, + "name": "httpsCallable", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "Gets an `HttpsCallable` instance that refers to the function with the given\nname.", + "text": "#### Example\n\n```js\nconst instance = firebase.functions().httpsCallable('order');\n\ntry {\n const response = await instance({\n id: '12345',\n });\n} catch (e) {\n console.error(e);\n}\n```\n", + "returns": "The `HttpsCallable` instance.\n" + }, + "parameters": [ + { + "id": 232, + "name": "name", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "comment": { + "text": "The name of the https callable function." + }, + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "type": { + "type": "reference", + "name": "HttpsCallable", + "id": 199 + } + } + ], + "sources": [ + { + "fileName": "functions/lib/index.d.ts", + "line": 318, + "character": 17 + } + ] + }, + { + "id": 233, + "name": "useFunctionsEmulator", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 234, + "name": "useFunctionsEmulator", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "Changes this instance to point to a Cloud Functions emulator running\nlocally.", + "text": "See https://firebase.google.com/docs/functions/local-emulator\n\n#### Example\n\n```js\nif (__DEV__) {\n firebase.functions().useFunctionsEmulator('http://10.0.0.8:1337');\n}\n```\n" + }, + "parameters": [ + { + "id": 235, + "name": "origin", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "comment": { + "text": "The origin string of the local emulator started via firebase tools\n\"http://10.0.0.8:1337\".\n" + }, + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "type": { + "type": "intrinsic", + "name": "void" + } + } + ], + "sources": [ + { + "fileName": "functions/lib/index.d.ts", + "line": 337, + "character": 24 + } + ] + } + ], + "groups": [ + { + "title": "Properties", + "kind": 1024, + "children": [ + 236 + ] + }, + { + "title": "Methods", + "kind": 2048, + "children": [ + 230, + 233 + ] + } + ], + "sources": [ + { + "fileName": "functions/lib/index.d.ts", + "line": 296, + "character": 21 + } + ], + "extendedTypes": [ + { + "type": "reference", + "name": "ReactNativeFirebaseModule" + } + ] + }, { "id": 199, "name": "HttpsCallable", @@ -6119,7 +6599,8 @@ "isExported": true }, "comment": { - "shortText": "An HttpsCallable is a reference to a \"callable\" http trigger in\nGoogle Cloud Functions." + "shortText": "An HttpsCallable is a reference to a \"callable\" http trigger in\nGoogle Cloud Functions.", + "text": "#### Example\n\n```js\n// Create a HttpsCallable instance\nconst instance = firebase.functions().httpsCallable('order');\n\ntry {\n const response = await instance({\n id: '12345',\n });\n} catch (e) {\n console.error(e);\n}\n```\n" }, "signatures": [ { @@ -6129,7 +6610,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "An HttpsCallable is a reference to a \"callable\" http trigger in\nGoogle Cloud Functions." + "shortText": "An HttpsCallable is a reference to a \"callable\" http trigger in\nGoogle Cloud Functions.", + "text": "#### Example\n\n```js\n// Create a HttpsCallable instance\nconst instance = firebase.functions().httpsCallable('order');\n\ntry {\n const response = await instance({\n id: '12345',\n });\n} catch (e) {\n console.error(e);\n}\n```\n" }, "parameters": [ { @@ -6162,7 +6644,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 102, + "line": 146, "character": 32 } ] @@ -6190,7 +6672,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 95, + "line": 124, "character": 17 } ], @@ -6212,7 +6694,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 94, + "line": 123, "character": 38 } ] @@ -6225,6 +6707,10 @@ "flags": { "isExported": true }, + "comment": { + "shortText": "An HttpsError wraps a single error from a function call.", + "text": "#### Example\n\n```js\ntry {\n await firebase.functions().httpsCallable('order')();\n} catch (httpsError) {\n console.log('Message', httpsError.message);\n\n // Check code\n if (httpsError.code === firebase.functions.HttpsErrorCode.NOT_FOUND) {\n console.error('Functions endpoint \"order\" not found');\n }\n}\n```\n" + }, "children": [ { "id": 208, @@ -6236,7 +6722,7 @@ }, "sources": [ { - "fileName": "D:/Code/react-native-firebase/node_modules/typescript/lib/lib.es5.d.ts", + "fileName": "/Volumes/Projects/Projects/@react-native-firebase/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts", "line": 974, "character": 19 } @@ -6255,12 +6741,13 @@ "isExported": true }, "comment": { - "shortText": "A standard error code that will be returned to the client. This also\ndetermines the HTTP status code of the response, as defined in code.proto." + "shortText": "A standard error code that will be returned to the client. This also\ndetermines the HTTP status code of the response, as defined in code.proto.", + "text": "#### Example\n\n```js\ntry {\n await firebase.functions().httpsCallable('order')();\n} catch (httpsError) {\n console.error(httpsError.code);\n}\n```\n" }, "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 111, + "line": 183, "character": 17 } ], @@ -6280,12 +6767,13 @@ "isOptional": true }, "comment": { - "shortText": "Extra data to be converted to JSON and included in the error response." + "shortText": "Extra data to be converted to JSON and included in the error response.", + "text": "```js\ntry {\n await firebase.functions().httpsCallable('order')();\n} catch (httpsError) {\n if (httpsError.details) {\n console.error(httpsError.details);\n }\n}\n```\n" }, "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 115, + "line": 197, "character": 20 } ], @@ -6304,7 +6792,7 @@ }, "sources": [ { - "fileName": "D:/Code/react-native-firebase/node_modules/typescript/lib/lib.es5.d.ts", + "fileName": "/Volumes/Projects/Projects/@react-native-firebase/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts", "line": 964, "character": 11 } @@ -6328,7 +6816,7 @@ }, "sources": [ { - "fileName": "D:/Code/react-native-firebase/node_modules/typescript/lib/lib.es5.d.ts", + "fileName": "/Volumes/Projects/Projects/@react-native-firebase/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts", "line": 963, "character": 8 } @@ -6353,7 +6841,7 @@ }, "sources": [ { - "fileName": "D:/Code/react-native-firebase/node_modules/typescript/lib/lib.es5.d.ts", + "fileName": "/Volumes/Projects/Projects/@react-native-firebase/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts", "line": 965, "character": 9 } @@ -6398,7 +6886,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 106, + "line": 168, "character": 29 } ], @@ -6417,6 +6905,10 @@ "flags": { "isExported": true }, + "comment": { + "shortText": "The HttpsErrorCode interface provides access to all FunctionsErrorCode\ntype aliases.", + "text": "#### Example\n\n```js\ntry {\n await firebase.functions().httpsCallable('order')();\n} catch (httpsError) {\n switch(httpsError.code) {\n case firebase.functions.HttpsErrorCode.NOT_FOUND:\n console.error('Functions endpoint not found');\n break;\n case firebase.functions.HttpsErrorCode.CANCELLED:\n console.error('The operation was cancelled');\n break;\n default:\n console.error('An error occurred');\n break;\n }\n}\n```\n" + }, "children": [ { "id": 221, @@ -6429,7 +6921,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 130, + "line": 236, "character": 11 } ], @@ -6449,7 +6941,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 125, + "line": 231, "character": 18 } ], @@ -6469,7 +6961,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 120, + "line": 226, "character": 13 } ], @@ -6489,7 +6981,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 135, + "line": 241, "character": 13 } ], @@ -6509,7 +7001,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 123, + "line": 229, "character": 21 } ], @@ -6529,7 +7021,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 129, + "line": 235, "character": 23 } ], @@ -6549,7 +7041,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 133, + "line": 239, "character": 12 } ], @@ -6569,7 +7061,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 122, + "line": 228, "character": 20 } ], @@ -6589,7 +7081,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 124, + "line": 230, "character": 13 } ], @@ -6609,7 +7101,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 119, + "line": 225, "character": 6 } ], @@ -6629,7 +7121,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 131, + "line": 237, "character": 16 } ], @@ -6649,7 +7141,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 126, + "line": 232, "character": 21 } ], @@ -6669,7 +7161,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 128, + "line": 234, "character": 22 } ], @@ -6689,7 +7181,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 127, + "line": 233, "character": 19 } ], @@ -6709,7 +7201,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 134, + "line": 240, "character": 15 } ], @@ -6729,7 +7221,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 132, + "line": 238, "character": 17 } ], @@ -6749,7 +7241,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 121, + "line": 227, "character": 11 } ], @@ -6787,178 +7279,11 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 118, + "line": 224, "character": 33 } ] }, - { - "id": 229, - "name": "Module", - "kind": 256, - "kindString": "Interface", - "flags": { - "isExported": true - }, - "comment": { - "shortText": "firebase.functions().X" - }, - "children": [ - { - "id": 236, - "name": "app", - "kind": 1024, - "kindString": "Property", - "flags": { - "isExported": true - }, - "sources": [ - { - "fileName": "analytics/node_modules/@react-native-firebase/app-types/index.d.ts", - "line": 179, - "character": 5 - } - ], - "type": { - "type": "reference", - "name": "FirebaseApp" - }, - "inheritedFrom": { - "type": "reference", - "name": "ReactNativeFirebaseModule.app" - } - }, - { - "id": 230, - "name": "httpsCallable", - "kind": 2048, - "kindString": "Method", - "flags": { - "isExported": true - }, - "signatures": [ - { - "id": 231, - "name": "httpsCallable", - "kind": 4096, - "kindString": "Call signature", - "flags": {}, - "comment": { - "shortText": "Gets an `HttpsCallable` instance that refers to the function with the given\nname.", - "returns": "The `HttpsCallable` instance.\n" - }, - "parameters": [ - { - "id": 232, - "name": "name", - "kind": 32768, - "kindString": "Parameter", - "flags": {}, - "comment": { - "text": "The name of the https callable function." - }, - "type": { - "type": "intrinsic", - "name": "string" - } - } - ], - "type": { - "type": "reference", - "name": "HttpsCallable", - "id": 199 - } - } - ], - "sources": [ - { - "fileName": "functions/lib/index.d.ts", - "line": 159, - "character": 17 - } - ] - }, - { - "id": 233, - "name": "useFunctionsEmulator", - "kind": 2048, - "kindString": "Method", - "flags": { - "isExported": true - }, - "signatures": [ - { - "id": 234, - "name": "useFunctionsEmulator", - "kind": 4096, - "kindString": "Call signature", - "flags": {}, - "comment": { - "shortText": "Changes this instance to point to a Cloud Functions emulator running\nlocally.", - "text": "See https://firebase.google.com/docs/functions/local-emulator\n" - }, - "parameters": [ - { - "id": 235, - "name": "origin", - "kind": 32768, - "kindString": "Parameter", - "flags": {}, - "comment": { - "text": "the origin string of the local emulator started via firebase tools\n\"http://10.0.0.8:1337\".\n" - }, - "type": { - "type": "intrinsic", - "name": "string" - } - } - ], - "type": { - "type": "intrinsic", - "name": "void" - } - } - ], - "sources": [ - { - "fileName": "functions/lib/index.d.ts", - "line": 170, - "character": 24 - } - ] - } - ], - "groups": [ - { - "title": "Properties", - "kind": 1024, - "children": [ - 236 - ] - }, - { - "title": "Methods", - "kind": 2048, - "children": [ - 230, - 233 - ] - } - ], - "sources": [ - { - "fileName": "functions/lib/index.d.ts", - "line": 151, - "character": 25 - } - ], - "extendedTypes": [ - { - "type": "reference", - "name": "ReactNativeFirebaseModule" - } - ] - }, { "id": 227, "name": "Statics", @@ -6980,28 +7305,20 @@ "isExported": true }, "comment": { - "shortText": "Uppercase + underscored variables of @Functions.FunctionsErrorCode" + "shortText": "Uppercase + underscored variables of {@link functions.FunctionsErrorCode}", + "text": "#### Example\n\n```js\nfirebase.functions.HttpsErrorCode.OK;\nfirebase.functions.HttpsErrorCode.NOT_FOUND;\n```\n" }, "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 145, + "line": 258, "character": 18 } ], "type": { - "type": "intersection", - "types": [ - { - "type": "reference", - "name": "__type" - }, - { - "type": "reference", - "name": "HttpsErrorCode", - "id": 209 - } - ] + "type": "reference", + "name": "HttpsErrorCode", + "id": 209 } } ], @@ -7017,7 +7334,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 141, + "line": 247, "character": 26 } ] @@ -7031,13 +7348,18 @@ "isExported": true }, "comment": { - "shortText": "The set of Firebase Functions status codes. The codes are the same at the\nones exposed by gRPC here:\nhttps://github.com/grpc/grpc/blob/master/doc/statuscodes.md", - "text": "Possible values:\n- 'cancelled': The operation was cancelled (typically by the caller).\n- 'unknown': Unknown error or an error from a different error domain.\n- 'invalid-argument': Client specified an invalid argument. Note that this\n differs from 'failed-precondition'. 'invalid-argument' indicates\n arguments that are problematic regardless of the state of the system\n (e.g. an invalid field name).\n- 'deadline-exceeded': Deadline expired before operation could complete.\n For operations that change the state of the system, this error may be\n returned even if the operation has completed successfully. For example,\n a successful response from a server could have been delayed long enough\n for the deadline to expire.\n- 'not-found': Some requested document was not found.\n- 'already-exists': Some document that we attempted to create already\n exists.\n- 'permission-denied': The caller does not have permission to execute the\n specified operation.\n- 'resource-exhausted': Some resource has been exhausted, perhaps a\n per-user quota, or perhaps the entire file system is out of space.\n- 'failed-precondition': Operation was rejected because the system is not\n in a state required for the operation's execution.\n- 'aborted': The operation was aborted, typically due to a concurrency\n issue like transaction aborts, etc.\n- 'out-of-range': Operation was attempted past the valid range.\n- 'unimplemented': Operation is not implemented or not supported/enabled.\n- 'internal': Internal errors. Means some invariants expected by\n underlying system has been broken. If you see one of these errors,\n something is very broken.\n- 'unavailable': The service is currently unavailable. This is most likely\n a transient condition and may be corrected by retrying with a backoff.\n- 'data-loss': Unrecoverable data loss or corruption.\n- 'unauthenticated': The request does not have valid authentication\n credentials for the operation.\n" + "shortText": "The set of Firebase Functions status codes.", + "tags": [ + { + "tag": "note", + "text": "\nThe codes are the same at the ones exposed by [gRPC](https://github.com/grpc/grpc/blob/master/doc/statuscodes.md).\n\nPossible values:\n- `cancelled`: The operation was cancelled (typically by the caller).\n- `unknown`: Unknown error or an error from a different error domain.\n- `invalid-argument`: Client specified an invalid argument. Note that this\n differs from `failed-precondition`. `invalid-argument` indicates\n arguments that are problematic regardless of the state of the system\n (e.g. an invalid field name).\n- `deadline-exceeded`: Deadline expired before operation could complete.\n For operations that change the state of the system, this error may be\n returned even if the operation has completed successfully. For example,\n a successful response from a server could have been delayed long enough\n for the deadline to expire.\n- `not-found`: Some requested document was not found.\n- `already-exists`: Some document that we attempted to create already\n exists.\n- `permission-denied`: The caller does not have permission to execute the\n specified operation.\n- `resource-exhausted`: Some resource has been exhausted, perhaps a\n per-user quota, or perhaps the entire file system is out of space.\n- `failed-precondition`: Operation was rejected because the system is not\n in a state required for the operation's execution.\n- `aborted`: The operation was aborted, typically due to a concurrency\n issue like transaction aborts, etc.\n- `out-of-range`: Operation was attempted past the valid range.\n- `unimplemented`: Operation is not implemented or not supported/enabled.\n- `internal`: Internal errors. Means some invariants expected by\n underlying system has been broken. If you see one of these errors,\n something is very broken.\n- `unavailable`: The service is currently unavailable. This is most likely\n a transient condition and may be corrected by retrying with a backoff.\n- `data-loss`: Unrecoverable data loss or corruption.\n- `unauthenticated`: The request does not have valid authentication\n credentials for the operation.\n" + } + ] }, "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 72, + "line": 101, "character": 32 } ], @@ -7117,6 +7439,13 @@ } ], "groups": [ + { + "title": "Classes", + "kind": 128, + "children": [ + 229 + ] + }, { "title": "Interfaces", "kind": 256, @@ -7125,7 +7454,6 @@ 197, 202, 209, - 229, 227 ] }, @@ -7140,7 +7468,7 @@ "sources": [ { "fileName": "functions/lib/index.d.ts", - "line": 32, + "line": 60, "character": 26 } ] @@ -7154,8 +7482,8 @@ "isExported": true }, "comment": { - "shortText": "Firebase Instance ID provides a unique identifier for each instance of your app and a mechanism to authenticate\nand authorize actions for it (for example: sending FCM messages).", - "text": "An Instance ID is long lived except when you call delete, the app is restored on a new device, the user\nuninstalls/reinstall the app or the user clears the app data (clearing data applies to Android only).\n", + "shortText": "Firebase Instance ID package for React Native.", + "text": "#### Example 1\n\nAccess the firebase export from the `iid` package:\n\n```js\nimport { firebase } from '@react-native-firebase/iid';\n\n// firebase.iid().X\n```\n\n#### Example 2\n\nUsing the default export from the `iid` package:\n\n```js\nimport iid from '@react-native-firebase/iid';\n\n// iid().X\n```\n\n#### Example 3\n\nUsing the default export from the `app` package:\n\n```js\nimport firebase from '@react-native-firebase/app';\nimport '@react-native-firebase/iid';\n\n// firebase.iid().X\n```\n", "tags": [ { "tag": "firebase", @@ -7167,11 +7495,15 @@ { "id": 248, "name": "Module", - "kind": 256, - "kindString": "Interface", + "kind": 128, + "kindString": "Class", "flags": { "isExported": true }, + "comment": { + "shortText": "The Firebase Instance ID service interface.", + "text": "> This module is available for the default app only.\n\n#### Example\n\nGet the Instance ID service for the default app:\n\n```js\nconst defaultAppIid = firebase.iid();\n```\n" + }, "children": [ { "id": 261, @@ -7214,7 +7546,7 @@ "flags": {}, "comment": { "shortText": "Delete the Instance ID and all data associated with it. This stops the periodic sending of data to the Firebase\nbackend that was started when the Instance ID was generated.", - "text": "A new Instance ID is asynchronously generated unless auto initialisation is turned off.\n" + "text": "A new Instance ID is asynchronously generated unless auto initialisation is turned off.\n\n#### Example\n\n```js\nawait firebase.iid().delete();\n```\n" }, "type": { "type": "reference", @@ -7231,7 +7563,7 @@ "sources": [ { "fileName": "iid/lib/index.d.ts", - "line": 51, + "line": 103, "character": 10 } ] @@ -7252,7 +7584,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Revokes access to a scope for an entity previously authorized by `getToken()`." + "shortText": "Revokes access to a scope for an entity previously authorized by `getToken()`.", + "text": "#### Example\n\n```js\nawait firebase.iid().deleteToken(firebase.app().options.storageBucket, '*');\n```\n" }, "parameters": [ { @@ -7321,7 +7654,7 @@ "sources": [ { "fileName": "iid/lib/index.d.ts", - "line": 67, + "line": 131, "character": 15 } ] @@ -7343,7 +7676,7 @@ "flags": {}, "comment": { "shortText": "Returns a identifier that uniquely identifies the app instance.", - "text": "Once an Instance ID is generated, Firebase periodically sends information about the application\nand the device it's running on to the Firebase backend. To stop this, see `delete()`.\n" + "text": "Once an Instance ID is generated, Firebase periodically sends information about the application\nand the device it's running on to the Firebase backend. To stop this, see `delete()`.\n\n#### Example\n\n```js\nconst id = firebase.iid().get();\n```\n" }, "type": { "type": "reference", @@ -7360,7 +7693,7 @@ "sources": [ { "fileName": "iid/lib/index.d.ts", - "line": 43, + "line": 89, "character": 7 } ] @@ -7381,7 +7714,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Returns a token that authorizes an Entity to perform an action on behalf of the application." + "shortText": "Returns a token that authorizes an Entity to perform an action on behalf of the application.", + "text": "#### Example\n\n```js\nconst token = await firebase.iid().getToken(firebase.app().options.storageBucket, '*');\n```\n" }, "parameters": [ { @@ -7450,7 +7784,7 @@ "sources": [ { "fileName": "iid/lib/index.d.ts", - "line": 59, + "line": 117, "character": 12 } ] @@ -7478,8 +7812,8 @@ "sources": [ { "fileName": "iid/lib/index.d.ts", - "line": 36, - "character": 25 + "line": 76, + "character": 21 } ], "extendedTypes": [ @@ -7500,18 +7834,24 @@ "sources": [ { "fileName": "iid/lib/index.d.ts", - "line": 34, + "line": 61, "character": 26 } ] } ], "groups": [ + { + "title": "Classes", + "kind": 128, + "children": [ + 248 + ] + }, { "title": "Interfaces", "kind": 256, "children": [ - 248, 247 ] } @@ -7519,7 +7859,7 @@ "sources": [ { "fileName": "iid/lib/index.d.ts", - "line": 33, + "line": 60, "character": 20 } ] @@ -7533,7 +7873,8 @@ "isExported": true }, "comment": { - "shortText": "Firebase Invites is deprecated. You can create cross-platform invitation links that survive app installation using Firebase Dynamic Links instead.\nFirebase Invites are an out-of-the-box solution for app referrals and sharing via email or SMS.\nTo customize the invitation user experience, or to generate links programmatically, use Firebase Dynamic Links.", + "shortText": "Firebase Invites package for React Native.", + "text": "#### Example 1\n\nAccess the firebase export from the `invites` package:\n\n```js\nimport { firebase } from '@react-native-firebase/invites';\n\n// firebase.invites().X\n```\n\n#### Example 2\n\nUsing the default export from the `invites` package:\n\n```js\nimport invites from '@react-native-firebase/invites';\n\n// invites().X\n```\n\n#### Example 3\n\nUsing the default export from the `app` package:\n\n```js\nimport firebase from '@react-native-firebase/app';\nimport '@react-native-firebase/invites';\n\n// firebase.invites().X\n```\n", "tags": [ { "tag": "firebase", @@ -7542,64 +7883,16 @@ ] }, "children": [ - { - "id": 272, - "name": "AdditionalReferralParameters", - "kind": 256, - "kindString": "Interface", - "flags": { - "isExported": true - }, - "comment": { - "shortText": "Additional referral parameters for AndroidInviteBuilder.setAdditionalReferralParameters\nTODO(ehesp) allow linking to named type above somehow?" - }, - "indexSignature": [ - { - "id": 273, - "name": "__index", - "kind": 8192, - "kindString": "Index signature", - "flags": {}, - "comment": { - "shortText": "Additional referral parameters for AndroidInviteBuilder.setAdditionalReferralParameters\nTODO(ehesp) allow linking to named type above somehow?" - }, - "parameters": [ - { - "id": 274, - "name": "key", - "kind": 32768, - "kindString": "Parameter", - "flags": {}, - "type": { - "type": "intrinsic", - "name": "string" - } - } - ], - "type": { - "type": "intrinsic", - "name": "string" - } - } - ], - "sources": [ - { - "fileName": "invites/lib/index.d.ts", - "line": 41, - "character": 47 - } - ] - }, { "id": 275, "name": "AndroidInviteBuilder", - "kind": 256, - "kindString": "Interface", + "kind": 128, + "kindString": "Class", "flags": { "isExported": true }, "comment": { - "shortText": "Android Invite representation" + "shortText": "Android Invite representation. Instance is returned from {@link links.InviteBuilder#android}." }, "children": [ { @@ -7618,7 +7911,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Adds query parameters to the play store referral URL when the app needs additional referral parameters for other\napplication component referrals. These parameters are added to the referral URL sent from the play store and are\navailable to be processed by other application components, for example Google Analytics. The parameters are set\nas name, value pairs that will be set as query parameter name and value on the referral URL." + "shortText": "Adds query parameters to the play store referral URL when the app needs additional referral parameters for other\napplication component referrals. These parameters are added to the referral URL sent from the play store and are\navailable to be processed by other application components, for example Google Analytics. The parameters are set\nas name, value pairs that will be set as query parameter name and value on the referral URL.", + "text": "#### Example\n\n```js\nconst invite = firebase.invites().createInvitation('Join my app', 'Join my app with me and share content!');\ninvite.android.setAdditionalReferralParameters({\n screen: 'Profile',\n});\n```\n" }, "parameters": [ { @@ -7647,7 +7941,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 57, + "line": 108, "character": 35 } ] @@ -7668,11 +7962,12 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Sets the HTML-formatted (UTF-8 encoded, no JavaScript) content for invites sent through email. If set, this will\nbe sent instead of the default email.\nemailHtmlContent must be valid HTML for standard email processing. The pattern %%APPINVITE_LINK_PLACEHOLDER%%\nshould be embedded in your htmlContent and will be replaced with the invitation URL.\nThis url is a link that will launch the app if already installed or take the user to the appropriate app store\nif not. In both cases the deep link will be available if provided using setDeepLink(Uri).", + "shortText": "Sets the HTML-formatted (UTF-8 encoded, no JavaScript) content for invites sent through email. If set, this will\nbe sent instead of the default email.", + "text": "emailHtmlContent must be valid HTML for standard email processing. The pattern `%%APPINVITE_LINK_PLACEHOLDER%%`\nshould be embedded in your htmlContent and will be replaced with the invitation URL.\nThis url is a link that will launch the app if already installed or take the user to the appropriate app store\nif not. In both cases the deep link will be available if provided using setDeepLink(Uri).\n", "tags": [ { "tag": "warning", - "text": "Cannot be used with InviteBuilder.setCallToActionText\n" + "text": "Cannot be used with {@link invites.InviteBuilder#setCallToActionText}\n\n#### Example\n\n```js\nconst invite = firebase.invites().createInvitation('Join my app', 'Join my app with me and share content!');\ninvite.android.setEmailHtmlContent('

Rich HTML content

');\n```\n" } ] }, @@ -7702,7 +7997,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 73, + "line": 132, "character": 23 } ] @@ -7723,7 +8018,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Sets the subject for invites sent by email." + "shortText": "Sets the subject for invites sent by email.", + "text": "#### Example\n\n```js\nconst invite = firebase.invites().createInvitation('Join my app', 'Join my app with me and share content!');\ninvite.android.emailSubject(`Hey ${user.name}, joint my app!`);\n```\n" }, "parameters": [ { @@ -7751,7 +8047,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 80, + "line": 146, "character": 19 } ] @@ -7772,7 +8068,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Sets the Google Analytics Tracking id. The tracking id should be created for the calling application under\nGoogle Analytics. See more about how to get a tracking id . The tracking id is recommended so that invitations\nsent from the calling application are available in Google Analytics." + "shortText": "Sets the Google Analytics Tracking id. The tracking id should be created for the calling application under\nGoogle Analytics. See more about how to get a tracking id . The tracking id is recommended so that invitations\nsent from the calling application are available in Google Analytics.", + "text": "#### Example\n\n```js\nconst invite = firebase.invites().createInvitation('Join my app', 'Join my app with me and share content!');\ninvite.android.setGoogleAnalyticsTrackingId('UA-1234-5');\n```\n" }, "parameters": [ { @@ -7800,7 +8097,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 89, + "line": 162, "character": 32 } ] @@ -7821,21 +8118,21 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 48, - "character": 39 + "line": 90, + "character": 35 } ] }, { "id": 288, "name": "InviteBuilder", - "kind": 256, - "kindString": "Interface", + "kind": 128, + "kindString": "Class", "flags": { "isExported": true }, "comment": { - "shortText": "Invite builder representation returned from `firebase.invite().createInvitation();`" + "shortText": "Invite builder representation returned from {@link invites#createInvitation}." }, "children": [ { @@ -7847,12 +8144,13 @@ "isExported": true }, "comment": { - "shortText": "Set Android specific Invite properties" + "shortText": "Set Android specific Invite properties", + "text": "#### Example\n\n```js\nconst invite = firebase.invites().createInvitation('Join my app', 'Join my app with me and share content!');\ninvite.android.setGoogleAnalyticsTrackingId('UA-1234-5');\n```\n" }, "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 99, + "line": 179, "character": 11 } ], @@ -7878,7 +8176,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Set the Android target client ID for the invitation." + "shortText": "Set the Android target client ID for the invitation.", + "text": "#### Example\n\n```js\nconst invite = firebase.invites().createInvitation('Join my app', 'Join my app with me and share content!');\ninvite.setAndroidClientId('xxxxxxxxxxxx');\n```\n" }, "parameters": [ { @@ -7906,7 +8205,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 106, + "line": 193, "character": 22 } ] @@ -7927,7 +8226,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Sets the minimum version of the android app installed on the receiving device. If this minimum version is not installed then the install flow will be triggered." + "shortText": "Sets the minimum version of the android app installed on the receiving device. If this minimum version is not installed then the install flow will be triggered.", + "text": "#### Example\n\n```js\nconst invite = firebase.invites().createInvitation('Join my app', 'Join my app with me and share content!');\ninvite.setAndroidMinimumVersionCode(18);\n```\n" }, "parameters": [ { @@ -7955,7 +8255,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 113, + "line": 207, "character": 32 } ] @@ -7980,7 +8280,7 @@ "tags": [ { "tag": "warning", - "text": "Cannot be used with AndroidInviteBuilder.setEmailHtmlContent.\n" + "text": "Cannot be used with {@link invites.AndroidInviteBuilder#setEmailHtmlContent}.\n\n#### Example\n\n```js\nconst invite = firebase.invites().createInvitation('Join my app', 'Join my app with me and share content!');\ninvite.setCallToActionText('Join the app!');\n```\n" } ] }, @@ -8010,7 +8310,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 122, + "line": 223, "character": 23 } ] @@ -8031,7 +8331,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Sets an image for invitations." + "shortText": "Sets an image for invitations.", + "text": "#### Example\n\n```js\nconst invite = firebase.invites().createInvitation('Join my app', 'Join my app with me and share content!');\ninvite.setCustomImage('https://my-cdn.com/assets/invites.png');\n```\n" }, "parameters": [ { @@ -8059,7 +8360,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 129, + "line": 237, "character": 18 } ] @@ -8080,7 +8381,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Sets the deep link that is made available to the app when opened from the invitation. This deep link is made\navailable both to a newly installed application and an already installed application. The deep link can be sent\nto Android and other platforms so should be formatted to support deep links across platforms." + "shortText": "Sets the deep link that is made available to the app when opened from the invitation. This deep link is made\navailable both to a newly installed application and an already installed application. The deep link can be sent\nto Android and other platforms so should be formatted to support deep links across platforms.", + "text": "#### Example\n\n```js\nconst invite = firebase.invites().createInvitation('Join my app', 'Join my app with me and share content!');\ninvite.deepLink('/invites');\n```\n" }, "parameters": [ { @@ -8108,7 +8410,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 138, + "line": 253, "character": 15 } ] @@ -8129,7 +8431,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Set the iOS target client ID for the invitation." + "shortText": "Set the iOS target client ID for the invitation.", + "text": "#### Example\n\n```js\nconst invite = firebase.invites().createInvitation('Join my app', 'Join my app with me and share content!');\ninvite.setIOSClientId('xxxxxxxxxxxx');\n```\n" }, "parameters": [ { @@ -8157,7 +8460,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 145, + "line": 267, "character": 18 } ] @@ -8187,19 +8490,23 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 95, - "character": 32 + "line": 168, + "character": 28 } ] }, { "id": 311, "name": "Module", - "kind": 256, - "kindString": "Interface", + "kind": 128, + "kindString": "Class", "flags": { "isExported": true }, + "comment": { + "shortText": "The Firebase Invites service interface.", + "text": "> This module is available for the default app only.\n\n#### Example\n\nGet the Invites service for the default app:\n\n```js\nconst defaultAppInvites = firebase.invites();\n```\n" + }, "children": [ { "id": 324, @@ -8241,7 +8548,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Create an invitation via an InvitationBuilder instance." + "shortText": "Create an invitation via an InvitationBuilder instance.", + "text": "#### Example\n\n```js\nconst invite = firebase.invites().createInvitation('Join my app', 'Join my app and share content');\n```\n" }, "parameters": [ { @@ -8250,7 +8558,9 @@ "kind": 32768, "kindString": "Parameter", "flags": {}, - "comment": {}, + "comment": { + "text": "The title displayed in the invitation." + }, "type": { "type": "intrinsic", "name": "string" @@ -8263,7 +8573,7 @@ "kindString": "Parameter", "flags": {}, "comment": { - "text": "\n" + "text": "The message displayed in the invitation.\n" }, "type": { "type": "intrinsic", @@ -8281,7 +8591,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 172, + "line": 351, "character": 20 } ] @@ -8302,7 +8612,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Returns the Invitation that the app has been launched from. If the app was not launched from an Invitation the\nreturn value will be null." + "shortText": "Returns the Invitation that the app has been launched from. If the app was not launched from an Invitation the\nreturn value will be null.", + "text": "#### Example\n\n```js\nconst invite = firebase.invites().getInitialInvitation();\n\nif (invite) {\n console.log('Deeplink: ', invite.deepLink);\n console.log('ID: ', invite.invitationId);\n}\n```\n" }, "type": { "type": "reference", @@ -8320,7 +8631,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 186, + "line": 390, "character": 24 } ] @@ -8341,7 +8652,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "When an invitation is opened whilst the app is open, the listener is invoked with the invitation.\nReturns a function that when called unsubscribes the listener from further events." + "shortText": "When an invitation is opened whilst the app is open, the listener is invoked with the invitation.\nReturns a function that when called unsubscribes the listener from further events.", + "text": "#### Example\n\n```js\nfunction handleInvitation({ deepLink, invitationId}) {\n console.log('Deeplink: ', deepLink);\n console.log('ID: ', invitationId);\n}\n\nconst subscriber = firebase.invites().onInvitation(handleInvitation);\n\n// Unsubscribe from invitation listener\nsubscriber();\n```\n" }, "parameters": [ { @@ -8351,7 +8663,7 @@ "kindString": "Parameter", "flags": {}, "comment": { - "text": "\n" + "text": "A function called when an invitation is opened.\n" }, "type": { "type": "reference", @@ -8369,7 +8681,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 180, + "line": 373, "character": 16 } ] @@ -8390,7 +8702,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Displays the invitation dialog which allows the user to select who received the invitation.\nReturns a promise that resolves with the created invitation IDs if the invitation is sent, otherwise it is\nrejected with an error." + "shortText": "Displays the invitation dialog which allows the user to select who received the invitation.\nReturns a promise that resolves with the created invitation IDs if the invitation is sent, otherwise it is\nrejected with an error.", + "text": "#### Example\n\n```js\nconst invite = firebase.invites().createInvitation('Join my app', 'Join my app and share content');\nconst ids = await firebase.invites().sendInvitation(invite);\n```\n" }, "parameters": [ { @@ -8427,7 +8740,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 195, + "line": 406, "character": 18 } ] @@ -8455,8 +8768,8 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 165, - "character": 25 + "line": 338, + "character": 21 } ], "extendedTypes": [ @@ -8466,6 +8779,56 @@ } ] }, + { + "id": 272, + "name": "AdditionalReferralParameters", + "kind": 256, + "kindString": "Interface", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Additional referral parameters for {@link invites.AndroidInviteBuilder#setAdditionalReferralParameters}.", + "text": "#### Example\n\n```js\nconst invite = firebase.invites().createInvitation('Join my app', 'Join my app with me and share content!');\ninvite.android.setAdditionalReferralParameters({\n screen: 'Profile',\n});\n```\n" + }, + "indexSignature": [ + { + "id": 273, + "name": "__index", + "kind": 8192, + "kindString": "Index signature", + "flags": {}, + "comment": { + "shortText": "Additional referral parameters for {@link invites.AndroidInviteBuilder#setAdditionalReferralParameters}.", + "text": "#### Example\n\n```js\nconst invite = firebase.invites().createInvitation('Join my app', 'Join my app with me and share content!');\ninvite.android.setAdditionalReferralParameters({\n screen: 'Profile',\n});\n```\n" + }, + "parameters": [ + { + "id": 274, + "name": "key", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "sources": [ + { + "fileName": "invites/lib/index.d.ts", + "line": 83, + "character": 47 + } + ] + }, { "id": 308, "name": "NativeInvite", @@ -8475,7 +8838,8 @@ "isExported": true }, "comment": { - "shortText": "A native invite representation returned from getInitialInvite and onInvite." + "shortText": "A native invite representation returned from getInitialInvite and onInvite.", + "text": "#### Example 1\n\nWhen an invitation has been opened from a closed/terminated app.\n\n```js\nconst invite = firebase.invites().getInitialInvitation();\n\nif (invite) {\n console.log('Deeplink: ', invite.deepLink);\n console.log('ID: ', invite.invitationId);\n}\n```\n\n#### Example 2\n\nWhen an invite has been opened and the app is running.\n\n```js\n function handleInvitation({ deepLink, invitationId}) {\n console.log('Deeplink: ', deepLink);\n console.log('ID: ', invitationId);\n }\n\n firebase.invites().onInvitation(handleInvitation);\n```\n" }, "children": [ { @@ -8492,7 +8856,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 155, + "line": 303, "character": 12 } ], @@ -8515,7 +8879,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 160, + "line": 308, "character": 16 } ], @@ -8538,7 +8902,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 151, + "line": 299, "character": 31 } ] @@ -8551,6 +8915,9 @@ "flags": { "isExported": true }, + "comment": { + "shortText": "firebase.invites.X" + }, "children": [ { "id": 271, @@ -8560,10 +8927,13 @@ "flags": { "isExported": true }, + "comment": { + "shortText": "Invitation returns an `InviteBuilder` instance used to send new invites." + }, "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 33, + "line": 68, "character": 14 } ], @@ -8586,7 +8956,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 32, + "line": 64, "character": 26 } ] @@ -8599,10 +8969,14 @@ "flags": { "isExported": true }, + "comment": { + "shortText": "A type alias for an invite listener used with {@link invites#onInvitation}", + "text": "#### Example\n\n```js\nfirebase.invites().onInvitation((invite) => {\n console.log('Deeplink: ', invite.deepLink);\n console.log('ID: ', invite.invitationId);\n});\n```\n" + }, "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 163, + "line": 323, "character": 28 } ], @@ -8644,7 +9018,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 163, + "line": 323, "character": 30 } ] @@ -8653,14 +9027,20 @@ } ], "groups": [ + { + "title": "Classes", + "kind": 128, + "children": [ + 275, + 288, + 311 + ] + }, { "title": "Interfaces", "kind": 256, "children": [ 272, - 275, - 288, - 311, 308, 270 ] @@ -8676,7 +9056,7 @@ "sources": [ { "fileName": "invites/lib/index.d.ts", - "line": 31, + "line": 60, "character": 24 } ] @@ -8690,7 +9070,8 @@ "isExported": true }, "comment": { - "shortText": "Mlkit", + "shortText": "Firebase ML Kit package for React Native.", + "text": "#### Example 1\n\nAccess the firebase export from the `mlkit` package:\n\n```js\nimport { firebase } from '@react-native-firebase/mlkit';\n\n// firebase.mlkit().X\n```\n\n#### Example 2\n\nUsing the default export from the `mlkit` package:\n\n```js\nimport mlkit from '@react-native-firebase/mlkit';\n\n// mlkit().X\n```\n\n#### Example 3\n\nUsing the default export from the `app` package:\n\n```js\nimport firebase from '@react-native-firebase/app';\nimport '@react-native-firebase/mlkit';\n\n// firebase.mlkit().X\n```\n", "tags": [ { "tag": "firebase", @@ -8702,11 +9083,15 @@ { "id": 338, "name": "Module", - "kind": 256, - "kindString": "Interface", + "kind": 128, + "kindString": "Class", "flags": { "isExported": true }, + "comment": { + "shortText": "The Firebase ML Kit service interface.", + "text": "> This module is available for the default app only.\n\n#### Example\n\nGet the ML Kit service for the default app:\n\n```js\nconst defaultAppMLKit = firebase.mlkit();\n```\n" + }, "children": [ { "id": 339, @@ -8745,8 +9130,8 @@ "sources": [ { "fileName": "mlkit/lib/index.d.ts", - "line": 32, - "character": 25 + "line": 76, + "character": 21 } ], "extendedTypes": [ @@ -8767,18 +9152,24 @@ "sources": [ { "fileName": "mlkit/lib/index.d.ts", - "line": 30, + "line": 61, "character": 26 } ] } ], "groups": [ + { + "title": "Classes", + "kind": 128, + "children": [ + 338 + ] + }, { "title": "Interfaces", "kind": 256, "children": [ - 338, 337 ] } @@ -8786,7 +9177,7 @@ "sources": [ { "fileName": "mlkit/lib/index.d.ts", - "line": 29, + "line": 60, "character": 22 } ] @@ -8800,7 +9191,8 @@ "isExported": true }, "comment": { - "shortText": "Get insights into how your app performs from your users’ point of view, with automatic and customized performance tracing.", + "shortText": "Firebase Performance Monitoring package for React Native.", + "text": "#### Example 1\n\nAccess the firebase export from the `perf` package:\n\n```js\nimport { firebase } from '@react-native-firebase/perf';\n\n// firebase.perf().X\n```\n\n#### Example 2\n\nUsing the default export from the `perf` package:\n\n```js\nimport perf from '@react-native-firebase/perf';\n\n// perf().X\n```\n\n#### Example 3\n\nUsing the default export from the `app` package:\n\n```js\nimport firebase from '@react-native-firebase/app';\nimport '@react-native-firebase/perf';\n\n// firebase.perf().X\n```\n", "tags": [ { "tag": "firebase", @@ -8812,8 +9204,8 @@ { "id": 379, "name": "HttpMetric", - "kind": 256, - "kindString": "Interface", + "kind": 128, + "kindString": "Class", "flags": { "isExported": true }, @@ -8837,7 +9229,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Returns the value of an attribute. Returns null if it does not exist." + "shortText": "Returns the value of an attribute. Returns null if it does not exist.", + "text": "#### Example\n\n```js\nconst attribute = metric.getAttribute('user_role');\n```\n" }, "parameters": [ { @@ -8873,7 +9266,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 121, + "line": 228, "character": 16 } ] @@ -8894,7 +9287,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Returns an object of all the currently added attributes." + "shortText": "Returns an object of all the currently added attributes.", + "text": "#### Example\n\n```js\nconst attributes = metric.getAttributes();\n\nattributes.forEach(($) => {\n console.log($);\n});\n```\n" }, "type": { "type": "reflection", @@ -8933,7 +9327,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 126, + "line": 243, "character": 20 } ] @@ -8944,7 +9338,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 126, + "line": 243, "character": 17 } ] @@ -8965,7 +9359,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Sets a String value for the specified attribute. Updates the value of the attribute if it already exists.\nThe maximum number of attributes that can be added is 5." + "shortText": "Sets a String value for the specified attribute. Updates the value of the attribute if it already exists.\nThe maximum number of attributes that can be added is 5.", + "text": "#### Example\n\n```js\nmetric.putAttribute('user_role', 'admin');\n```\n" }, "parameters": [ { @@ -9006,7 +9401,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 135, + "line": 258, "character": 16 } ] @@ -9027,7 +9422,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Removes an already added attribute. Does nothing if attribute does not exist." + "shortText": "Removes an already added attribute. Does nothing if attribute does not exist.", + "text": "#### Example\n\n```js\nmetric.removeAttribute('user_role');\n```\n" }, "parameters": [ { @@ -9054,7 +9450,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 142, + "line": 271, "character": 19 } ] @@ -9076,10 +9472,11 @@ "flags": {}, "comment": { "shortText": "Sets the httpResponse code of the request.", + "text": "#### Example\n\n```js\nconst response = await fetch(url);\nmetric.setHttpResponseCode(response.status);\n```", "tags": [ { "tag": "warning", - "text": "This is required for every request, if you do not provide this your metric will not be captured.\n" + "text": "This is required for every request, if you do not provide this your metric will not be captured.\n\n" } ] }, @@ -9117,7 +9514,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 151, + "line": 287, "character": 23 } ] @@ -9138,7 +9535,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Sets the size of the request payload" + "shortText": "Sets the size of the request payload.", + "text": "#### Example\n\n```js\nconst response = await fetch(url);\nmetric.setRequestPayloadSize(response.headers.get('Content-Type'));\n```\n" }, "parameters": [ { @@ -9174,7 +9572,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 158, + "line": 301, "character": 25 } ] @@ -9195,7 +9593,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Content type of the response e.g. `text/html` or `application/json`." + "shortText": "Content type of the response e.g. `text/html` or `application/json`.", + "text": "#### Example\n\n```js\nconst response = await fetch(url);\nmetric.setResponsePayloadSize(response.headers.get('Content-Type'));\n```\n" }, "parameters": [ { @@ -9231,7 +9630,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 172, + "line": 329, "character": 26 } ] @@ -9252,7 +9651,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Sets the size of the response payload" + "shortText": "Sets the size of the response payload.", + "text": "#### Example\n\n```js\nconst response = await fetch(url);\nmetric.setResponsePayloadSize(response.headers.get('Content-Length'));\n```\n" }, "parameters": [ { @@ -9288,7 +9688,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 165, + "line": 315, "character": 26 } ] @@ -9309,7 +9709,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Marks the start time of the request. Does nothing if already started." + "shortText": "Marks the start time of the request. Does nothing if already started.", + "text": "#### Example\n\n```js\nconst metric = firebase.perf().newHttpMetric('https://api.com/login', 'POST');\nawait metric.start();\n```\n" }, "type": { "type": "reference", @@ -9326,7 +9727,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 177, + "line": 341, "character": 9 } ] @@ -9347,7 +9748,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Marks the end time of the response and queues the network request metric on the device for transmission. Does nothing if already stopped." + "shortText": "Marks the end time of the response and queues the network request metric on the device for transmission. Does nothing if already stopped.", + "text": "#### Example\n\n```js\nconst metric = firebase.perf().newHttpMetric('https://api.com/login', 'POST');\nawait metric.start();\nmetric.putAttribute('user_role', 'admin');\nawait metric.stop();\n```\n" }, "type": { "type": "reference", @@ -9364,7 +9766,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 182, + "line": 355, "character": 8 } ] @@ -9391,19 +9793,23 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 115, - "character": 29 + "line": 216, + "character": 25 } ] }, { "id": 412, "name": "Module", - "kind": 256, - "kindString": "Interface", + "kind": 128, + "kindString": "Class", "flags": { "isExported": true }, + "comment": { + "shortText": "The Firebase Performance Monitoring service interface.", + "text": "> This module is available for the default app only.\n\n#### Example\n\nGet the Performance Monitoring service for the default app:\n\n```js\nconst defaultAppPerf = firebase.perf();\n```\n" + }, "children": [ { "id": 427, @@ -9438,12 +9844,13 @@ "isExported": true }, "comment": { - "shortText": "Determines whether performance monitoring is enabled or disabled." + "shortText": "Determines whether performance monitoring is enabled or disabled.", + "text": "#### Example\n\n```js\nconst isEnabled = firebase.perf().isPerformanceCollectionEnabled;\nconsole.log('Performance collection enabled: ', isEnabled);\n```\n" }, "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 191, + "line": 384, "character": 34 } ], @@ -9468,7 +9875,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Creates a HttpMetric instance for collecting network performance data for a single request/response" + "shortText": "Creates a HttpMetric instance for collecting network performance data for a single request/response", + "text": "#### Example\n\n```js\nconst metric = firebase.perf().newHttpMetric('https://api.com/user/1', 'GET');\nawait metric.start();\n```\n" }, "parameters": [ { @@ -9511,7 +9919,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 221, + "line": 440, "character": 17 } ] @@ -9532,7 +9940,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Creates a Trace instance with the given identifier." + "shortText": "Creates a Trace instance with the given identifier.", + "text": "#### Example\n\n```js\nconst trace = firebase.perf().newTrace('user_profile');\nawait trace.start();\n```\n" }, "parameters": [ { @@ -9560,7 +9969,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 205, + "line": 412, "character": 12 } ] @@ -9581,7 +9990,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Enables or disables performance monitoring." + "shortText": "Enables or disables performance monitoring.", + "text": "#### Example\n\n```js\n// Disable performance monitoring collection\nawait firebase.perf().setPerformanceCollectionEnabled(false);\n```\n" }, "parameters": [ { @@ -9614,7 +10024,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 198, + "line": 398, "character": 35 } ] @@ -9635,7 +10045,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Creates a Trace instance with the given identifier and immediately starts it." + "shortText": "Creates a Trace instance with the given identifier and immediately starts it.", + "text": "#### Example\n\n```js\nconst trace = await firebase.perf().startTrace('user_profile');\n```\n" }, "parameters": [ { @@ -9669,7 +10080,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 213, + "line": 425, "character": 14 } ] @@ -9698,8 +10109,8 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 187, - "character": 25 + "line": 373, + "character": 21 } ], "extendedTypes": [ @@ -9709,27 +10120,11 @@ } ] }, - { - "id": 411, - "name": "Statics", - "kind": 256, - "kindString": "Interface", - "flags": { - "isExported": true - }, - "sources": [ - { - "fileName": "perf/lib/index.d.ts", - "line": 185, - "character": 26 - } - ] - }, { "id": 348, "name": "Trace", - "kind": 256, - "kindString": "Interface", + "kind": 128, + "kindString": "Class", "flags": { "isExported": true }, @@ -9753,7 +10148,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Returns the value of an attribute. Returns null if it does not exist." + "shortText": "Returns the value of an attribute. Returns null if it does not exist.", + "text": "#### Example\n\n```js\nconst attribute = trace.getAttribute('userId');\n```\n" }, "parameters": [ { @@ -9763,7 +10159,7 @@ "kindString": "Parameter", "flags": {}, "comment": { - "text": "Name of the attribute to fetch the value of\n" + "text": "Name of the attribute to fetch the value of.\n" }, "type": { "type": "intrinsic", @@ -9789,7 +10185,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 50, + "line": 96, "character": 16 } ] @@ -9810,7 +10206,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Gets the value of the metric with the given name in the current trace. If the metric doesn't exist, it will not be created and a 0 is returned." + "shortText": "Gets the value of the metric with the given name in the current trace. If the metric\ndoesn't exist, it will not be created and a 0 is returned.", + "text": "#### Example\n\n```js\nconst metric = trace.getMetric('hits');\n```\n" }, "parameters": [ { @@ -9837,7 +10234,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 66, + "line": 125, "character": 13 } ] @@ -9858,7 +10255,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Returns an object of all the currently added metrics and their number values." + "shortText": "Returns an object of all the currently added metrics and their number values.", + "text": "#### Example\n\n```js\nconst metrics = trace.getMetrics();\n\nmetrics.forEach(($) => {\n console.log($);\n});\n```\n" }, "type": { "type": "reflection", @@ -9897,7 +10295,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 71, + "line": 140, "character": 17 } ] @@ -9908,7 +10306,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 71, + "line": 140, "character": 14 } ] @@ -9930,7 +10328,7 @@ "flags": {}, "comment": { "shortText": "Increments the named metric by the `incrementBy` value.", - "text": "If a metric with the given name doesn't exist, a new one will be created starting with the value of `incrementBy`.\n" + "text": "If a metric with the given name doesn't exist, a new one will be created starting with the value of `incrementBy`.\n\n```js\ntrace.incrementMetric('hits', 1);\n```\n" }, "parameters": [ { @@ -9971,7 +10369,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 92, + "line": 171, "character": 19 } ] @@ -9992,7 +10390,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Sets a String value for the specified attribute. Updates the value of the attribute if it already exists.\nThe maximum number of attributes that can be added is 5." + "shortText": "Sets a String value for the specified attribute. Updates the value of the attribute if it already exists.\nThe maximum number of attributes that can be added is 5.", + "text": "#### Example\n\n```js\ntrace.putAttribute('userId', '123456789');\n```\n" }, "parameters": [ { @@ -10033,7 +10432,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 59, + "line": 111, "character": 16 } ] @@ -10055,7 +10454,7 @@ "flags": {}, "comment": { "shortText": "Sets the value of the named metric with the provided number.", - "text": "If a metric with the given name exists it will be overwritten.\nIf a metric with the given name doesn't exist, a new one will be created.\n" + "text": "If a metric with the given name exists it will be overwritten.\nIf a metric with the given name doesn't exist, a new one will be created.\n\n#### Example\n\n```js\ntrace.putMetric('hits', 1);\n```\n" }, "parameters": [ { @@ -10096,7 +10495,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 82, + "line": 157, "character": 13 } ] @@ -10117,7 +10516,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Removes a metric by name if it exists." + "shortText": "Removes a metric by name if it exists.", + "text": "#### Example\n\n```js\ntrace.removeMetric('hits');\n```\n" }, "parameters": [ { @@ -10144,7 +10544,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 99, + "line": 184, "character": 16 } ] @@ -10165,7 +10565,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Marks the start time of the trace. Does nothing if already started." + "shortText": "Marks the start time of the trace. Does nothing if already started.", + "text": "#### Example\n\n```js\nconst trace = firebase.perf().newTrace('example');\nawait trace.start();\n```\n" }, "type": { "type": "reference", @@ -10182,7 +10583,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 104, + "line": 196, "character": 9 } ] @@ -10203,7 +10604,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Marks the end time of the trace and queues the metric on the device for transmission. Does nothing if already stopped." + "shortText": "Marks the end time of the trace and queues the metric on the device for transmission. Does nothing if already stopped.", + "text": "* #### Example\n\n```js\nconst trace = firebase.perf().newTrace('example');\nawait trace.start();\ntrace.putMetric('hits', 1);\nawait trace.stop();\n```\n" }, "type": { "type": "reference", @@ -10220,7 +10622,7 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 109, + "line": 210, "character": 8 } ] @@ -10246,8 +10648,24 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 44, - "character": 24 + "line": 84, + "character": 20 + } + ] + }, + { + "id": 411, + "name": "Statics", + "kind": 256, + "kindString": "Interface", + "flags": { + "isExported": true + }, + "sources": [ + { + "fileName": "perf/lib/index.d.ts", + "line": 358, + "character": 26 } ] }, @@ -10259,10 +10677,14 @@ "flags": { "isExported": true }, + "comment": { + "shortText": "Type alias describing the valid HTTP methods accepted when creating a new {@link perf.HttpMetric} instance.", + "text": "#### Example\n\n```js\nconst metric = perf().newHttpMetric('https://api.com/user', 'PATCH');\n```\n" + }, "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 30, + "line": 70, "character": 24 } ], @@ -10311,15 +10733,21 @@ ], "groups": [ { - "title": "Interfaces", - "kind": 256, + "title": "Classes", + "kind": 128, "children": [ 379, 412, - 411, 348 ] }, + { + "title": "Interfaces", + "kind": 256, + "children": [ + 411 + ] + }, { "title": "Type aliases", "kind": 4194304, @@ -10331,40 +10759,45 @@ "sources": [ { "fileName": "perf/lib/index.d.ts", - "line": 29, + "line": 60, "character": 21 } ] }, { "id": 436, - "name": "Utils", + "name": "Storage", "kind": 2, "kindString": "Module", "flags": { "isExported": true }, "comment": { - "shortText": "Utils", + "shortText": "Firebase Cloud Storage package for React Native.", + "text": "#### Example 1\n\nAccess the firebase export from the `storage` package:\n\n```js\nimport { firebase } from '@react-native-firebase/storage';\n\n// firebase.storage().X\n```\n\n#### Example 2\n\nUsing the default export from the `storage` package:\n\n```js\nimport storage from '@react-native-firebase/storage';\n\n// storage().X\n```\n\n#### Example 3\n\nUsing the default export from the `app` package:\n\n```js\nimport firebase from '@react-native-firebase/app';\nimport '@react-native-firebase/storage';\n\n// firebase.storage().X\n```\n", "tags": [ { "tag": "firebase", - "text": "utils\n" + "text": "storage\n" } ] }, "children": [ { - "id": 438, + "id": 585, "name": "Module", - "kind": 256, - "kindString": "Interface", + "kind": 128, + "kindString": "Class", "flags": { "isExported": true }, + "comment": { + "shortText": "The Cloud Storage service is available for the default app, a given app or a specific storage bucket.", + "text": "#### Example 1\n\nGet the storage instance for the **default app**:\n\n```js\nconst storageForDefaultApp = firebase.storage();\n```\n\n#### Example 2\n\nGet the storage instance for a **secondary app**:\n\n```js\nconst otherApp = firebase.app('otherApp');\nconst storageForOtherApp = firebase.storage(otherApp);\n```\n\n#### Example 3\n\nGet the storage instance for a **specific storage bucket**:\n\n```js\nconst defaultApp = firebase.app();\nconst storageForBucket = defaultApp.storage('gs://another-bucket-url');\n\nconst otherApp = firebase.app('otherApp');\nconst storageForOtherAppBucket = otherApp.storage('gs://another-bucket-url');\n```\n\n" + }, "children": [ { - "id": 440, + "id": 604, "name": "app", "kind": 1024, "kindString": "Property", @@ -10387,8 +10820,3730 @@ "name": "ReactNativeFirebaseModule.app" } }, + { + "id": 590, + "name": "maxDownloadRetryTime", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "TODO.", + "text": "#### Example\n\n```js\nconst downloadRetryTime = firebase.storage().maxUploadRetryTime;\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 865, + "character": 24 + } + ], + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "id": 594, + "name": "maxOperationRetryTime", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "TODO.", + "text": "#### Example\n\n```js\nconst maxOperationRetryTime = firebase.storage().maxOperationRetryTime;\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 889, + "character": 25 + } + ], + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "id": 586, + "name": "maxUploadRetryTime", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "TODO.", + "text": "#### Example\n\n```js\nconst uploadRetryTime = firebase.storage().maxUploadRetryTime;\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 841, + "character": 22 + } + ], + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "id": 598, + "name": "ref", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 599, + "name": "ref", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "Returns a new {@link storage.Reference} instance.", + "text": "#### Example\n\n```js\nconst maxOperationRetryTime = firebase.storage().maxOperationRetryTime;\n```\n" + }, + "parameters": [ + { + "id": 600, + "name": "path", + "kind": 32768, + "kindString": "Parameter", + "flags": { + "isOptional": true + }, + "comment": { + "text": "An optional string pointing to a location on the storage bucket. If no path\nis provided, the returned reference will be the bucket root path.\n" + }, + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "undefined" + }, + { + "type": "intrinsic", + "name": "string" + } + ] + } + } + ], + "type": { + "type": "reference", + "name": "Reference", + "id": 494 + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 916, + "character": 7 + } + ] + }, + { + "id": 601, + "name": "refFromURL", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 602, + "name": "refFromURL", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "Returns a new {@link storage.Reference} instance from a storage bucket URL.", + "text": "#### Example\n\n```js\nconst maxOperationRetryTime = firebase.storage().maxOperationRetryTime;\n```\n" + }, + "parameters": [ + { + "id": 603, + "name": "url", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "comment": { + "text": "A storage bucket URL pointing to a single file or location. Must start with `gs://`,\ne.g. `gs://assets/logo.png` or `gs://assets`.\n" + }, + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "type": { + "type": "reference", + "name": "Reference", + "id": 494 + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 930, + "character": 14 + } + ] + }, + { + "id": 591, + "name": "setMaxDownloadRetryTime", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 592, + "name": "setMaxDownloadRetryTime", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "TODO.", + "text": "#### Example\n\n```js\nawait firebase.storage().setMaxDownloadRetryTime(5000);\n```\n" + }, + "parameters": [ + { + "id": 593, + "name": "time", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "comment": { + "text": "Number of miliseconds.... TODO\n" + }, + "type": { + "type": "intrinsic", + "name": "number" + } + } + ], + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "intrinsic", + "name": "null" + } + ] + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 878, + "character": 27 + } + ] + }, + { + "id": 595, + "name": "setMaxOperationRetryTime", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 596, + "name": "setMaxOperationRetryTime", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "TODO.", + "text": "#### Example\n\n```js\nawait firebase.storage().setMaxOperationRetryTime(5000);\n```\n" + }, + "parameters": [ + { + "id": 597, + "name": "time", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "comment": { + "text": "Number of miliseconds.... TODO\n" + }, + "type": { + "type": "intrinsic", + "name": "number" + } + } + ], + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "intrinsic", + "name": "null" + } + ] + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 902, + "character": 28 + } + ] + }, + { + "id": 587, + "name": "setMaxUploadRetryTime", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 588, + "name": "setMaxUploadRetryTime", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "TODO.", + "text": "#### Example\n\n```js\nawait firebase.storage().setMaxUploadRetryTime(5000);\n```\n" + }, + "parameters": [ + { + "id": 589, + "name": "time", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "comment": { + "text": "Number of milliseconds.... TODO\n" + }, + "type": { + "type": "intrinsic", + "name": "number" + } + } + ], + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "intrinsic", + "name": "null" + } + ] + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 854, + "character": 25 + } + ] + } + ], + "groups": [ + { + "title": "Properties", + "kind": 1024, + "children": [ + 604, + 590, + 594, + 586 + ] + }, + { + "title": "Methods", + "kind": 2048, + "children": [ + 598, + 601, + 591, + 595, + 587 + ] + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 831, + "character": 21 + } + ], + "extendedTypes": [ + { + "type": "reference", + "name": "ReactNativeFirebaseModule" + } + ] + }, + { + "id": 475, + "name": "FullMetadata", + "kind": 256, + "kindString": "Interface", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "The full readable metadata returned by `TaskSnapshot.metadata` or `StorageReference.getMetadata()`." + }, + "children": [ + { + "id": 477, + "name": "bucket", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "The bucket this storage object is contained in.", + "text": "#### Example Value\n\n```\ngs://my-project-storage-bucket\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 484, + "character": 10 + } + ], + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 485, + "name": "cacheControl", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true, + "isOptional": true + }, + "comment": { + "shortText": "The 'Cache-Control' HTTP header that will be set on the storage object when it's requested.", + "text": "#### Example 1\n\nTo turn off caching, you can set the following cacheControl value.\n\n```js\n{\n cacheControl: 'no-store',\n}\n```\n\n#### Example 2\n\nTo aggressively cache an object, e.g. static assets, you can set the following cacheControl value.\n\n```js\n{\n cacheControl: 'public, max-age=31536000',\n}\n```\n\n[Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition)\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 399, + "character": 16 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "null" + } + ] + }, + "inheritedFrom": { + "type": "reference", + "name": "SettableMetadata.cacheControl", + "id": 466 + } + }, + { + "id": 486, + "name": "contentDisposition", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true, + "isOptional": true + }, + "comment": { + "shortText": "The 'Content-Disposition' HTTP header that will be set on the storage object when it's requested.", + "text": "[Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition)\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 406, + "character": 22 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "null" + } + ] + }, + "inheritedFrom": { + "type": "reference", + "name": "SettableMetadata.contentDisposition", + "id": 467 + } + }, + { + "id": 487, + "name": "contentEncoding", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true, + "isOptional": true + }, + "comment": { + "shortText": "The 'Content-Encoding' HTTP header that will be used on the storage object when it's requested.", + "text": "[Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding)\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 413, + "character": 19 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "null" + } + ] + }, + "inheritedFrom": { + "type": "reference", + "name": "SettableMetadata.contentEncoding", + "id": 468 + } + }, + { + "id": 488, + "name": "contentLanguage", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true, + "isOptional": true + }, + "comment": { + "shortText": "The 'Content-Language' HTTP header that will be set on the storage object when it's requested.", + "text": "[Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language)\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 420, + "character": 19 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "null" + } + ] + }, + "inheritedFrom": { + "type": "reference", + "name": "SettableMetadata.contentLanguage", + "id": 469 + } + }, + { + "id": 489, + "name": "contentType", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true, + "isOptional": true + }, + "comment": { + "shortText": "The 'Content-Type' HTTP header that will be set on the object when it's requested.", + "text": "This is used to indicate the media type (or MIME type) of the object. When uploading a file\nFirebase Cloud Storage for React Native will attempt to automatically detect this if `contentType`\nis not already set, if it fails to detect a media type it will default to `application/octet-stream`.\n\nFor `DATA_URL` string formats uploaded via `putString` this will also be automatically extracted if available.\n\n#### Example\n\nSetting the content type as JSON, e.g. for when uploading a JSON string via `putString`.\n\n```js\n{\n contentType: 'application/json',\n}\n```\n\n[Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type)\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 443, + "character": 15 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "null" + } + ] + }, + "inheritedFrom": { + "type": "reference", + "name": "SettableMetadata.contentType", + "id": 470 + } + }, + { + "id": 490, + "name": "customMetadata", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true, + "isOptional": true + }, + "comment": { + "shortText": "Additional user-defined custom metadata for this storage object.", + "text": "String values only are supported for custom metadata property values.\n\n#### Example\n\nAdding a user controlled NSFW meta data field.\n\n```js\n{\n customMetadata: {\n 'nsfw': 'true'\n },\n}\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 461, + "character": 18 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "reflection", + "declaration": { + "id": 491, + "name": "__type", + "kind": 65536, + "kindString": "Type literal", + "flags": {}, + "indexSignature": [ + { + "id": 492, + "name": "__index", + "kind": 8192, + "kindString": "Index signature", + "flags": {}, + "parameters": [ + { + "id": 493, + "name": "key", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 461, + "character": 20 + } + ] + } + }, + { + "type": "intrinsic", + "name": "null" + } + ] + }, + "inheritedFrom": { + "type": "reference", + "name": "SettableMetadata.customMetadata", + "id": 471 + } + }, + { + "id": 478, + "name": "fullPath", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "The full path to this storage object in its bucket.", + "text": "#### Example Value\n\n```\ninvertase/logo.png\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 495, + "character": 12 + } + ], + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 479, + "name": "generation", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Storage object generation values enable users to uniquely identify data resources, e.g. object versioning.", + "text": "Read more on generation on the [Google Cloud Storage documentation](https://cloud.google.com/storage/docs/generations-preconditions).\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 502, + "character": 14 + } + ], + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 476, + "name": "md5Hash", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "A Base64-encoded MD5 hash of the storage object being uploaded." + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 473, + "character": 11 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "null" + } + ] + } + }, + { + "id": 480, + "name": "metageneration", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Storage object metageneration values enable users to uniquely identify data resources, e.g. object versioning.", + "text": "Read more on metageneration on the [Google Cloud Storage documentation](https://cloud.google.com/storage/docs/generations-preconditions).\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 509, + "character": 18 + } + ], + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 481, + "name": "name", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "The short name of storage object in its bucket, e.g. it's file name.", + "text": "#### Example Value\n\n```\nlogo.png\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 520, + "character": 8 + } + ], + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 482, + "name": "size", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "The size of this storage object in bytes." + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 525, + "character": 8 + } + ], + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "id": 483, + "name": "timeCreated", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "A date string representing when this storage object was created.", + "text": "#### Example Value\n\n```\n2019-05-02T00:34:56.264Z\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 536, + "character": 15 + } + ], + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 484, + "name": "updated", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "A date string representing when this storage object was last updated.", + "text": "#### Example Value\n\n```\n2019-05-02T00:35:56.264Z\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 547, + "character": 11 + } + ], + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "groups": [ + { + "title": "Properties", + "kind": 1024, + "children": [ + 477, + 485, + 486, + 487, + 488, + 489, + 490, + 478, + 479, + 476, + 480, + 481, + 482, + 483, + 484 + ] + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 469, + "character": 31 + } + ], + "extendedTypes": [ + { + "type": "reference", + "name": "SettableMetadata", + "id": 465 + } + ] + }, + { + "id": 450, + "name": "Path", + "kind": 256, + "kindString": "Interface", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "A collection of native device file paths to aid in the usage of file path based storage methods.", + "text": "Concatenate a file path with your target file name when using `putFile` or `getFile`.\n\n```js\nfirebase.storage.Path;\n```\n" + }, + "children": [ + { + "id": 452, + "name": "CachesDirectory", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Returns an absolute path to the application specific cache directory on the filesystem.", + "text": "The system will automatically delete files in this directory when disk space is needed elsewhere on the device, starting with the oldest files first.\n\n```js\nfirebase.storage.Path.CachesDirectory;\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 229, + "character": 19 + } + ], + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 453, + "name": "DocumentDirectory", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Returns an absolute path to the users Documents directory.", + "text": "Use this directory to place documents that have been created by the user.\n\n```js\nfirebase.storage.Path.DocumentDirectory;\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 240, + "character": 21 + } + ], + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 456, + "name": "ExternalDirectory", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Returns an absolute path to the directory on the primary shared/external storage device.", + "text": "Here your application can place persistent files it owns. These files are internal to the application, and not typically visible to the user as media.\n\nReturns null if no external storage directory found, e.g. removable media has been ejected by the user.\n\n```js\nfirebase.storage.Path.ExternalDirectory;\n```\n", + "tags": [ + { + "tag": "android", + "text": "Android only - iOS returns null\n" + } + ] + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 277, + "character": 21 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "null" + } + ] + } + }, + { + "id": 457, + "name": "ExternalStorageDirectory", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Returns an absolute path to the primary shared/external storage directory.", + "text": "Traditionally this is an SD card, but it may also be implemented as built-in storage on a device.\n\nReturns null if no external storage directory found, e.g. removable media has been ejected by the user.\n\n```js\nfirebase.storage.Path.ExternalStorageDirectory;\n```\n", + "tags": [ + { + "tag": "android", + "text": "Android only - iOS returns null\n" + } + ] + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 292, + "character": 28 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "null" + } + ] + } + }, + { + "id": 455, + "name": "LibraryDirectory", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Returns an absolute path to the apps library/resources directory.", + "text": "E.g. this can be used for things like documentation, support files, and configuration files and generic resources.\n\n```js\nfirebase.storage.Path.LibraryDirectory;\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 262, + "character": 20 + } + ], + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 451, + "name": "MainBundle", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Returns an absolute path to the applications main bundle.", + "text": "```js\nfirebase.storage.Path.MainBundle;\n```\n", + "tags": [ + { + "tag": "ios", + "text": "iOS only\n" + } + ] + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 218, + "character": 14 + } + ], + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 459, + "name": "MoviesDirectory", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Returns an absolute path to a directory in which to place movies that are available to the user.", + "text": "```js\nfirebase.storage.Path.MoviesDirectory;\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 310, + "character": 19 + } + ], + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 458, + "name": "PicturesDirectory", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Returns an absolute path to a directory in which to place pictures that are available to the user.", + "text": "```js\nfirebase.storage.Path.PicturesDirectory;\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 301, + "character": 21 + } + ], + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 454, + "name": "TempDirectory", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Returns an absolute path to a temporary directory.", + "text": "Use this directory to create temporary files. The system will automatically delete files in this directory when disk space is needed elsewhere on the device, starting with the oldest files first.\n\n```js\nfirebase.storage.Path.TempDirectory;\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 251, + "character": 17 + } + ], + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "groups": [ + { + "title": "Properties", + "kind": 1024, + "children": [ + 452, + 453, + 456, + 457, + 455, + 451, + 459, + 458, + 454 + ] + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 208, + "character": 23 + } + ] + }, + { + "id": 494, + "name": "Reference", + "kind": 256, + "kindString": "Interface", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Represents a reference to a Google Cloud Storage object in React Native Firebase.", + "text": "A reference can be used to upload and download storage objects, get/set storage object metadata, retrieve storage object download urls and delete storage objects.\n\n#### Example 1\n\nGet a reference to a specific storage path.\n\n```js\nconst ref = firebase.storage().ref('invertase/logo.png');\n```\n\n#### Example 2\n\nGet a reference to a specific storage path on another bucket in the same firebase project.\n\n```js\nconst ref = firebase.storage().refFromURL('gs://other-bucket/invertase/logo.png');\n```\n" + }, + "children": [ + { + "id": 495, + "name": "bucket", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 574, + "character": 10 + } + ], + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 497, + "name": "fullPath", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 578, + "character": 12 + } + ], + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 498, + "name": "name", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 580, + "character": 8 + } + ], + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 496, + "name": "parent", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 576, + "character": 10 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "reference", + "name": "Reference", + "id": 494 + }, + { + "type": "intrinsic", + "name": "null" + } + ] + } + }, + { + "id": 499, + "name": "root", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 582, + "character": 8 + } + ], + "type": { + "type": "reference", + "name": "Reference", + "id": 494 + } + }, + { + "id": 500, + "name": "storage", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 584, + "character": 11 + } + ], + "type": { + "type": "reference", + "name": "Module", + "id": 585 + } + }, + { + "id": 503, + "name": "child", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 504, + "name": "child", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "parameters": [ + { + "id": 505, + "name": "path", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "type": { + "type": "reference", + "name": "Reference", + "id": 494 + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 588, + "character": 9 + } + ] + }, + { + "id": 506, + "name": "delete", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 507, + "name": "delete", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "intrinsic", + "name": "void" + } + ] + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 590, + "character": 10 + } + ] + }, + { + "id": 508, + "name": "getDownloadURL", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 509, + "name": "getDownloadURL", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "intrinsic", + "name": "string" + } + ] + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 592, + "character": 18 + } + ] + }, + { + "id": 510, + "name": "getMetadata", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 511, + "name": "getMetadata", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "reference", + "name": "FullMetadata", + "id": 475 + } + ] + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 594, + "character": 15 + } + ] + }, + { + "id": 516, + "name": "put", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 517, + "name": "put", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "parameters": [ + { + "id": 518, + "name": "data", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "union", + "types": [ + { + "type": "reference", + "name": "Blob" + }, + { + "type": "reference", + "name": "Uint8Array" + }, + { + "type": "reference", + "name": "ArrayBuffer" + } + ] + } + }, + { + "id": 519, + "name": "metadata", + "kind": 32768, + "kindString": "Parameter", + "flags": { + "isOptional": true + }, + "type": { + "type": "reference", + "name": "SettableMetadata", + "id": 465 + } + } + ], + "type": { + "type": "reference", + "name": "Task", + "id": 540 + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 598, + "character": 7 + } + ] + }, + { + "id": 512, + "name": "putFile", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 513, + "name": "putFile", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "parameters": [ + { + "id": 514, + "name": "localFilePath", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 515, + "name": "metadata", + "kind": 32768, + "kindString": "Parameter", + "flags": { + "isOptional": true + }, + "type": { + "type": "reference", + "name": "SettableMetadata", + "id": 465 + } + } + ], + "type": { + "type": "reference", + "name": "Task", + "id": 540 + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 596, + "character": 11 + } + ] + }, + { + "id": 520, + "name": "putString", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 521, + "name": "putString", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "parameters": [ + { + "id": 522, + "name": "data", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 523, + "name": "format", + "kind": 32768, + "kindString": "Parameter", + "flags": { + "isOptional": true + }, + "type": { + "type": "reference", + "name": "StringFormat", + "id": 437 + } + }, + { + "id": 524, + "name": "metadata", + "kind": 32768, + "kindString": "Parameter", + "flags": { + "isOptional": true + }, + "type": { + "type": "reference", + "name": "SettableMetadata", + "id": 465 + } + } + ], + "type": { + "type": "reference", + "name": "Task", + "id": 540 + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 600, + "character": 13 + } + ] + }, + { + "id": 501, + "name": "toString", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 502, + "name": "toString", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 586, + "character": 12 + } + ] + }, + { + "id": 525, + "name": "updateMetadata", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 526, + "name": "updateMetadata", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "parameters": [ + { + "id": 527, + "name": "metadata", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "reference", + "name": "SettableMetadata", + "id": 465 + } + } + ], + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "reference", + "name": "FullMetadata", + "id": 475 + } + ] + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 602, + "character": 18 + } + ] + } + ], + "groups": [ + { + "title": "Properties", + "kind": 1024, + "children": [ + 495, + 497, + 498, + 496, + 499, + 500 + ] + }, + { + "title": "Methods", + "kind": 2048, + "children": [ + 503, + 506, + 508, + 510, + 516, + 512, + 520, + 501, + 525 + ] + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 571, + "character": 28 + } + ] + }, + { + "id": 465, + "name": "SettableMetadata", + "kind": 256, + "kindString": "Interface", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "An interface representing all the metadata properties that can be set.", + "text": "This is used in updateMetadata, put, putString & putFile.\n" + }, + "children": [ + { + "id": 466, + "name": "cacheControl", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true, + "isOptional": true + }, + "comment": { + "shortText": "The 'Cache-Control' HTTP header that will be set on the storage object when it's requested.", + "text": "#### Example 1\n\nTo turn off caching, you can set the following cacheControl value.\n\n```js\n{\n cacheControl: 'no-store',\n}\n```\n\n#### Example 2\n\nTo aggressively cache an object, e.g. static assets, you can set the following cacheControl value.\n\n```js\n{\n cacheControl: 'public, max-age=31536000',\n}\n```\n\n[Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition)\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 399, + "character": 16 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "null" + } + ] + } + }, + { + "id": 467, + "name": "contentDisposition", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true, + "isOptional": true + }, + "comment": { + "shortText": "The 'Content-Disposition' HTTP header that will be set on the storage object when it's requested.", + "text": "[Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition)\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 406, + "character": 22 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "null" + } + ] + } + }, + { + "id": 468, + "name": "contentEncoding", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true, + "isOptional": true + }, + "comment": { + "shortText": "The 'Content-Encoding' HTTP header that will be used on the storage object when it's requested.", + "text": "[Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding)\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 413, + "character": 19 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "null" + } + ] + } + }, + { + "id": 469, + "name": "contentLanguage", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true, + "isOptional": true + }, + "comment": { + "shortText": "The 'Content-Language' HTTP header that will be set on the storage object when it's requested.", + "text": "[Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language)\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 420, + "character": 19 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "null" + } + ] + } + }, + { + "id": 470, + "name": "contentType", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true, + "isOptional": true + }, + "comment": { + "shortText": "The 'Content-Type' HTTP header that will be set on the object when it's requested.", + "text": "This is used to indicate the media type (or MIME type) of the object. When uploading a file\nFirebase Cloud Storage for React Native will attempt to automatically detect this if `contentType`\nis not already set, if it fails to detect a media type it will default to `application/octet-stream`.\n\nFor `DATA_URL` string formats uploaded via `putString` this will also be automatically extracted if available.\n\n#### Example\n\nSetting the content type as JSON, e.g. for when uploading a JSON string via `putString`.\n\n```js\n{\n contentType: 'application/json',\n}\n```\n\n[Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type)\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 443, + "character": 15 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "null" + } + ] + } + }, + { + "id": 471, + "name": "customMetadata", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true, + "isOptional": true + }, + "comment": { + "shortText": "Additional user-defined custom metadata for this storage object.", + "text": "String values only are supported for custom metadata property values.\n\n#### Example\n\nAdding a user controlled NSFW meta data field.\n\n```js\n{\n customMetadata: {\n 'nsfw': 'true'\n },\n}\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 461, + "character": 18 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "reflection", + "declaration": { + "id": 472, + "name": "__type", + "kind": 65536, + "kindString": "Type literal", + "flags": {}, + "indexSignature": [ + { + "id": 473, + "name": "__index", + "kind": 8192, + "kindString": "Index signature", + "flags": {}, + "parameters": [ + { + "id": 474, + "name": "key", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 461, + "character": 20 + } + ] + } + }, + { + "type": "intrinsic", + "name": "null" + } + ] + } + } + ], + "groups": [ + { + "title": "Properties", + "kind": 1024, + "children": [ + 466, + 467, + 468, + 469, + 470, + 471 + ] + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 373, + "character": 35 + } + ], + "extendedBy": [ + { + "type": "reference", + "name": "FullMetadata", + "id": 475 + } + ] + }, + { + "id": 460, + "name": "Statics", + "kind": 256, + "kindString": "Interface", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Cloud Storage statics.", + "text": "#### Example\n\n```js\nfirebase.storage;\n```\n" + }, + "children": [ + { + "id": 464, + "name": "Path", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "A collection of native device file paths to aid in the usage of file path based storage methods.", + "text": "#### Example\n\n```js\nfirebase.storage.Path;\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 365, + "character": 8 + } + ], + "type": { + "type": "reference", + "name": "Path", + "id": 450 + } + }, + { + "id": 461, + "name": "StringFormat", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Possible string formats used for uploading via `StorageReference.putString()`", + "text": "#### Example\n\n```js\nfirebase.storage.StringFormat;\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 332, + "character": 16 + } + ], + "type": { + "type": "reference", + "name": "StringFormat", + "id": 437 + } + }, + { + "id": 463, + "name": "TaskEvent", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "An event to subscribe to that is triggered on a Upload or Download task.", + "text": "#### Example\n\n```js\nfirebase.storage.TaskEvent;\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 354, + "character": 13 + } + ], + "type": { + "type": "reference", + "name": "TaskEvent", + "id": 442 + } + }, + { + "id": 462, + "name": "TaskState", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "A collection of properties that indicates the current tasks state.", + "text": "#### Example\n\n```js\nfirebase.storage.TaskState;\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 343, + "character": 13 + } + ], + "type": { + "type": "reference", + "name": "TaskState", + "id": 444 + } + } + ], + "groups": [ + { + "title": "Properties", + "kind": 1024, + "children": [ + 464, + 461, + 463, + 462 + ] + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 322, + "character": 26 + } + ] + }, + { + "id": 437, + "name": "StringFormat", + "kind": 256, + "kindString": "Interface", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Possible string formats used for uploading via `StorageReference.putString()`", + "text": "```js\nfirebase.storage.StringFormat;\n```\n" + }, + "children": [ { "id": 439, + "name": "BASE64", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Base64 string format.", + "text": "Learn more about Base64 [on the Mozilla Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding)\n\n#### Usage\n\n```js\nfirebase.storage.StringFormat.BASE64;\n```\n\n#### Example String Format\n\n```js\nconst sampleString = 'PEZvbyBCYXI+';\n```\n\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 105, + "character": 10 + } + ], + "type": { + "type": "stringLiteral", + "value": "base64" + } + }, + { + "id": 440, + "name": "BASE64URL", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Base64Url string format.", + "text": "#### Usage\n\n```js\nfirebase.storage.StringFormat.BASE64URL;\n```\n\n#### Example String Format\n\n```js\nconst sampleString = 'PEZvbyBCYXI-';\n```\n\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 123, + "character": 13 + } + ], + "type": { + "type": "stringLiteral", + "value": "base64url" + } + }, + { + "id": 441, + "name": "DATA_URL", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Data URL string format.", + "text": "#### Usage\n\n```js\nfirebase.storage.StringFormat.DATA_URL;\n```\n\n#### Example String Format\n\n```js\nconst sampleString = 'data:text/plain;base64,PEZvbyBCYXI+';\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 140, + "character": 12 + } + ], + "type": { + "type": "stringLiteral", + "value": "data_url" + } + }, + { + "id": 438, + "name": "RAW", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Raw string format.", + "text": "#### Usage\n\n```js\nfirebase.storage.StringFormat.RAW;\n```\n\n#### Example String Format\n\n```js\nconst sampleString = '';\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 85, + "character": 7 + } + ], + "type": { + "type": "stringLiteral", + "value": "raw" + } + } + ], + "groups": [ + { + "title": "Properties", + "kind": 1024, + "children": [ + 439, + 440, + 441, + 438 + ] + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 69, + "character": 31 + } + ] + }, + { + "id": 540, + "name": "Task", + "kind": 256, + "kindString": "Interface", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Storage Task used for Uploading or Downloading files.", + "text": "#### Example 1\n\nGet a Upload Storage task to upload a string:\n\n```js\nconst string = '{ \"foo\": 1 }';\nconst task = firebase\n .storage()\n .ref('/foo/bar.json')\n .putString(string);\n```\n\n#### Example 2\n\nGet a Download Storage task to download a file:\n\n```js\nconst string = '{ \"foo\": 1 }';\nconst downloadTo = `${firebase.storage.Path.DocumentDirectory}/bar.json`;\n\nconst task = firebase\n .storage()\n .ref('/foo/bar.json')\n .getFile(downloadTo);\n```\n" + }, + "children": [ + { + "id": 545, + "name": "cancel", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 546, + "name": "cancel", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "Cancel the current Download or Upload task.", + "text": "#### Example\n\nCancel a task inside a state changed listener:\n\n```js\ntask.on('state_changed', taskSnapshot => {\n console.log('Cancelling my task!');\n task.cancel();\n});\n```\n\n" + }, + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "intrinsic", + "name": "boolean" + } + ] + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 698, + "character": 10 + } + ] + }, + { + "id": 571, + "name": "catch", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 572, + "name": "catch", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "parameters": [ + { + "id": 573, + "name": "onRejected", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "reflection", + "declaration": { + "id": 574, + "name": "__type", + "kind": 65536, + "kindString": "Type literal", + "flags": {}, + "signatures": [ + { + "id": 575, + "name": "__call", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "parameters": [ + { + "id": 576, + "name": "a", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "reference", + "name": "Error" + } + } + ], + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 724, + "character": 21 + } + ] + } + } + } + ], + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "intrinsic", + "name": "any" + } + ] + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 724, + "character": 9 + } + ] + }, + { + "id": 547, + "name": "on", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 548, + "name": "on", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": {}, + "parameters": [ + { + "id": 549, + "name": "event", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "comment": {}, + "type": { + "type": "stringLiteral", + "value": "state_changed" + } + }, + { + "id": 550, + "name": "nextOrObserver", + "kind": 32768, + "kindString": "Parameter", + "flags": { + "isOptional": true + }, + "comment": {}, + "type": { + "type": "union", + "types": [ + { + "type": "reference", + "name": "TaskSnapshotObserver", + "id": 528 + }, + { + "type": "intrinsic", + "name": "null" + }, + { + "type": "reflection", + "declaration": { + "id": 551, + "name": "__type", + "kind": 65536, + "kindString": "Type literal", + "flags": {}, + "signatures": [ + { + "id": 552, + "name": "__call", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "parameters": [ + { + "id": 553, + "name": "a", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "reference", + "name": "TaskSnapshot", + "id": 577 + } + } + ], + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 709, + "character": 52 + } + ] + } + } + ] + } + }, + { + "id": 554, + "name": "error", + "kind": 32768, + "kindString": "Parameter", + "flags": { + "isOptional": true + }, + "comment": {}, + "type": { + "type": "union", + "types": [ + { + "type": "reflection", + "declaration": { + "id": 555, + "name": "__type", + "kind": 65536, + "kindString": "Type literal", + "flags": {}, + "signatures": [ + { + "id": 556, + "name": "__call", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "parameters": [ + { + "id": 557, + "name": "a", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "reference", + "name": "Error" + } + } + ], + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 710, + "character": 13 + } + ] + } + }, + { + "type": "intrinsic", + "name": "null" + } + ] + } + }, + { + "id": 558, + "name": "complete", + "kind": 32768, + "kindString": "Parameter", + "flags": { + "isOptional": true + }, + "comment": { + "text": "\n" + }, + "type": { + "type": "union", + "types": [ + { + "type": "reflection", + "declaration": { + "id": 559, + "name": "__type", + "kind": 65536, + "kindString": "Type literal", + "flags": {}, + "signatures": [ + { + "id": 560, + "name": "__call", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "type": { + "type": "intrinsic", + "name": "void" + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 711, + "character": 16 + } + ] + } + }, + { + "type": "intrinsic", + "name": "null" + } + ] + } + } + ], + "type": { + "type": "reference", + "name": "Function" + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 707, + "character": 6 + } + ] + }, + { + "id": 541, + "name": "pause", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 542, + "name": "pause", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "Pause the current Download or Upload task.", + "text": "#### Example\n\nPause a running task inside a state changed listener:\n\n```js\ntask.on('state_changed', taskSnapshot => {\n if (taskSnapshot.state === firebase.storage.TaskState.RUNNING) {\n console.log('Pausing my task!');\n task.pause();\n }\n});\n```\n\n" + }, + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "intrinsic", + "name": "boolean" + } + ] + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 660, + "character": 9 + } + ] + }, + { + "id": 543, + "name": "resume", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 544, + "name": "resume", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "comment": { + "shortText": "Resume the current Download or Upload task.", + "text": "#### Example\n\nResume a previously paused task inside a state changed listener:\n\n```js\ntask.on('state_changed', taskSnapshot => {\n // ... pause me ...\n if (taskSnapshot.state === firebase.storage.TaskState.PAUSED) {\n console.log('Resuming my task!');\n task.resume();\n }\n});\n```\n\n" + }, + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "intrinsic", + "name": "boolean" + } + ] + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 680, + "character": 10 + } + ] + }, + { + "id": 561, + "name": "then", + "kind": 2048, + "kindString": "Method", + "flags": { + "isExported": true + }, + "signatures": [ + { + "id": 562, + "name": "then", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "parameters": [ + { + "id": 563, + "name": "onFulfilled", + "kind": 32768, + "kindString": "Parameter", + "flags": { + "isOptional": true + }, + "type": { + "type": "union", + "types": [ + { + "type": "reflection", + "declaration": { + "id": 564, + "name": "__type", + "kind": 65536, + "kindString": "Type literal", + "flags": {}, + "signatures": [ + { + "id": 565, + "name": "__call", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "parameters": [ + { + "id": 566, + "name": "a", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "reference", + "name": "TaskSnapshot", + "id": 577 + } + } + ], + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 720, + "character": 19 + } + ] + } + }, + { + "type": "intrinsic", + "name": "null" + } + ] + } + }, + { + "id": 567, + "name": "onRejected", + "kind": 32768, + "kindString": "Parameter", + "flags": { + "isOptional": true + }, + "type": { + "type": "union", + "types": [ + { + "type": "reflection", + "declaration": { + "id": 568, + "name": "__type", + "kind": 65536, + "kindString": "Type literal", + "flags": {}, + "signatures": [ + { + "id": 569, + "name": "__call", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "parameters": [ + { + "id": 570, + "name": "a", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "reference", + "name": "Error" + } + } + ], + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 721, + "character": 18 + } + ] + } + }, + { + "type": "intrinsic", + "name": "null" + } + ] + } + } + ], + "type": { + "type": "reference", + "name": "Promise", + "typeArguments": [ + { + "type": "intrinsic", + "name": "any" + } + ] + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 719, + "character": 8 + } + ] + } + ], + "groups": [ + { + "title": "Methods", + "kind": 2048, + "children": [ + 545, + 571, + 547, + 541, + 543, + 561 + ] + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 642, + "character": 23 + } + ] + }, + { + "id": 442, + "name": "TaskEvent", + "kind": 256, + "kindString": "Interface", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "An event to subscribe to that is triggered on a Upload or Download task.", + "text": "Event subscription is created via `StorageTask.on()`.\n\n```js\nfirebase.storage.TaskEvent;\n```\n" + }, + "children": [ + { + "id": 443, + "name": "STATE_CHANGED", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "An event that indicates that the tasks state has changed.", + "text": "```js\nfirebase.storage.TaskEvent.STATE_CHANGED;\n```\n" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 160, + "character": 17 + } + ], + "type": { + "type": "stringLiteral", + "value": "state_changed" + } + } + ], + "groups": [ + { + "title": "Properties", + "kind": 1024, + "children": [ + 443 + ] + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 152, + "character": 28 + } + ] + }, + { + "id": 577, + "name": "TaskSnapshot", + "kind": 256, + "kindString": "Interface", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "A TaskSnapshot provides information about a storage tasks state.", + "text": "#### Example 1\n\n```\nfirebase\n .storage()\n .ref('/foo/bar.json')\n .putString(JSON.stringify({ foo: 'bar' }))\n .then((taskSnapshot) => {\n if (taskSnapshot.state === firebase.storage.TaskState.SUCCESS) {\n console.log('Total bytes uploaded: ', taskSnapshot.totalBytes);\n }\n });\n```\n\n#### Example 2\n\n```\nconst task = firebase\n .storage()\n .ref('/foo/bar.json')\n .putString(JSON.stringify({ foo: 'bar' }));\n\ntask.on('state_changed', taskSnapshot => {\n if (taskSnapshot.state === firebase.storage.TaskState.PAUSED) {\n console.log('Resuming my task!');\n task.resume();\n }\n});\n```\n" + }, + "children": [ + { + "id": 578, + "name": "bytesTransferred", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "The number of bytes currently transferred." + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 764, + "character": 20 + } + ], + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "id": 584, + "name": "error", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true, + "isOptional": true + }, + "comment": { + "shortText": "If the {@link storage.TaskSnapshot#state} is `error`, returns a JavaScript error of the\ncurrent task snapshot." + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 795, + "character": 9 + } + ], + "type": { + "type": "reference", + "name": "NativeFirebaseError", + "id": 623 + } + }, + { + "id": 579, + "name": "metadata", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "The metadata of the tasks via a {@link storage.FullMetadata} interface." + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 769, + "character": 12 + } + ], + "type": { + "type": "reference", + "name": "FullMetadata", + "id": 475 + } + }, + { + "id": 580, + "name": "ref", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "The {@link storage.Reference} of the task." + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 774, + "character": 7 + } + ], + "type": { + "type": "reference", + "name": "Reference", + "id": 494 + } + }, + { + "id": 581, + "name": "state", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "The current state of the task snapshot." + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 779, + "character": 9 + } + ], + "type": { + "type": "union", + "types": [ + { + "type": "stringLiteral", + "value": "cancelled" + }, + { + "type": "stringLiteral", + "value": "error" + }, + { + "type": "stringLiteral", + "value": "paused" + }, + { + "type": "stringLiteral", + "value": "running" + }, + { + "type": "stringLiteral", + "value": "success" + } + ] + } + }, + { + "id": 582, + "name": "task", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "The parent {@link storage.Task} of this snapshot." + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 784, + "character": 8 + } + ], + "type": { + "type": "reference", + "name": "Task", + "id": 540 + } + }, + { + "id": 583, + "name": "totalBytes", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "The total amount of bytes for this task." + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 789, + "character": 14 + } + ], + "type": { + "type": "intrinsic", + "name": "number" + } + } + ], + "groups": [ + { + "title": "Properties", + "kind": 1024, + "children": [ + 578, + 584, + 579, + 580, + 581, + 582, + 583 + ] + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 760, + "character": 31 + } + ] + }, + { + "id": 528, + "name": "TaskSnapshotObserver", + "kind": 256, + "kindString": "Interface", + "flags": { + "isExported": true + }, + "children": [ + { + "id": 537, + "name": "complete", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 610, + "character": 12 + } + ], + "type": { + "type": "reflection", + "declaration": { + "id": 538, + "name": "__type", + "kind": 65536, + "kindString": "Type literal", + "flags": {}, + "signatures": [ + { + "id": 539, + "name": "__call", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "type": { + "type": "intrinsic", + "name": "void" + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 610, + "character": 13 + } + ] + } + } + }, + { + "id": 533, + "name": "error", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 608, + "character": 9 + } + ], + "type": { + "type": "reflection", + "declaration": { + "id": 534, + "name": "__type", + "kind": 65536, + "kindString": "Type literal", + "flags": {}, + "signatures": [ + { + "id": 535, + "name": "__call", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "parameters": [ + { + "id": 536, + "name": "error", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "reference", + "name": "Error" + } + } + ], + "type": { + "type": "intrinsic", + "name": "void" + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 608, + "character": 10 + } + ] + } + } + }, + { + "id": 529, + "name": "next", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 606, + "character": 8 + } + ], + "type": { + "type": "reflection", + "declaration": { + "id": 530, + "name": "__type", + "kind": 65536, + "kindString": "Type literal", + "flags": {}, + "signatures": [ + { + "id": 531, + "name": "__call", + "kind": 4096, + "kindString": "Call signature", + "flags": {}, + "parameters": [ + { + "id": 532, + "name": "taskSnapshot", + "kind": 32768, + "kindString": "Parameter", + "flags": {}, + "type": { + "type": "reference", + "name": "TaskSnapshot", + "id": 577 + } + } + ], + "type": { + "type": "intrinsic", + "name": "void" + } + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 606, + "character": 9 + } + ] + } + } + } + ], + "groups": [ + { + "title": "Properties", + "kind": 1024, + "children": [ + 537, + 533, + 529 + ] + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 605, + "character": 39 + } + ] + }, + { + "id": 444, + "name": "TaskState", + "kind": 256, + "kindString": "Interface", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "A collection of properties that indicates the current tasks state.", + "text": "An event subscription is created via `StorageTask.on()`.\n\n```js\nfirebase.storage.TaskEvent;\n```\n" + }, + "children": [ + { + "id": 445, + "name": "CANCELLED", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Task has been cancelled by the user." + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 176, + "character": 13 + } + ], + "type": { + "type": "stringLiteral", + "value": "cancelled" + } + }, + { + "id": 446, + "name": "ERROR", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "An Error occurred, see TaskSnapshot.error for details." + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 181, + "character": 9 + } + ], + "type": { + "type": "stringLiteral", + "value": "error" + } + }, + { + "id": 447, + "name": "PAUSED", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Task has been paused. Resume the task via `StorageTask.resume()`." + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 186, + "character": 10 + } + ], + "type": { + "type": "stringLiteral", + "value": "paused" + } + }, + { + "id": 448, + "name": "RUNNING", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Task is running. Pause the task via `StorageTask.pause()`" + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 191, + "character": 11 + } + ], + "type": { + "type": "stringLiteral", + "value": "running" + } + }, + { + "id": 449, + "name": "SUCCESS", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "Task has completed successfully." + }, + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 196, + "character": 11 + } + ], + "type": { + "type": "stringLiteral", + "value": "success" + } + } + ], + "groups": [ + { + "title": "Properties", + "kind": 1024, + "children": [ + 445, + 446, + 447, + 448, + 449 + ] + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 172, + "character": 28 + } + ] + } + ], + "groups": [ + { + "title": "Classes", + "kind": 128, + "children": [ + 585 + ] + }, + { + "title": "Interfaces", + "kind": 256, + "children": [ + 475, + 450, + 494, + 465, + 460, + 437, + 540, + 442, + 577, + 528, + 444 + ] + } + ], + "sources": [ + { + "fileName": "storage/lib/index.d.ts", + "line": 61, + "character": 24 + } + ] + }, + { + "id": 613, + "name": "Utils", + "kind": 2, + "kindString": "Module", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "React Native Firebase Utilities package.", + "text": "#### Example 1\n\nAccess the firebase export from the `utils` package:\n\n```js\nimport { firebase } from '@react-native-firebase/utils';\n\n// firebase.utils().X\n```\n\n#### Example 2\n\nUsing the default export from the `utils` package:\n\n```js\nimport utils from '@react-native-firebase/utils';\n\n// utils().X\n```\n\n#### Example 3\n\nUsing the default export from the `app` package:\n\n```js\nimport firebase from '@react-native-firebase/app';\nimport '@react-native-firebase/utils';\n\n// firebase.utils().X\n```\n", + "tags": [ + { + "tag": "firebase", + "text": "utils\n" + } + ] + }, + "children": [ + { + "id": 615, + "name": "Module", + "kind": 128, + "kindString": "Class", + "flags": { + "isExported": true + }, + "comment": { + "shortText": "The React Native Firebase Utils service interface.", + "text": "> This module is available for the default app only.\n\n#### Example\n\nGet the Utils service for the default app:\n\n```js\nconst defaultAppUtils = firebase.utils();\n```\n" + }, + "children": [ + { + "id": 617, + "name": "app", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "sources": [ + { + "fileName": "analytics/node_modules/@react-native-firebase/app-types/index.d.ts", + "line": 179, + "character": 5 + } + ], + "type": { + "type": "reference", + "name": "FirebaseApp" + }, + "inheritedFrom": { + "type": "reference", + "name": "ReactNativeFirebaseModule.app" + } + }, + { + "id": 616, "name": "isRunningInTestLab", "kind": 1024, "kindString": "Property", @@ -10407,7 +14562,7 @@ "sources": [ { "fileName": "utils/lib/index.d.ts", - "line": 38, + "line": 82, "character": 22 } ], @@ -10422,16 +14577,16 @@ "title": "Properties", "kind": 1024, "children": [ - 440, - 439 + 617, + 616 ] } ], "sources": [ { "fileName": "utils/lib/index.d.ts", - "line": 32, - "character": 25 + "line": 76, + "character": 21 } ], "extendedTypes": [ @@ -10442,7 +14597,7 @@ ] }, { - "id": 437, + "id": 614, "name": "Statics", "kind": 256, "kindString": "Interface", @@ -10452,32 +14607,86 @@ "sources": [ { "fileName": "utils/lib/index.d.ts", - "line": 30, + "line": 61, "character": 26 } ] } ], "groups": [ + { + "title": "Classes", + "kind": 128, + "children": [ + 615 + ] + }, { "title": "Interfaces", "kind": 256, "children": [ - 438, - 437 + 614 ] } ], "sources": [ { "fileName": "utils/lib/index.d.ts", - "line": 29, + "line": 60, "character": 22 } ] }, { - "id": 459, + "id": 654, + "name": "ReactNativeFirebaseModule", + "kind": 128, + "kindString": "Class", + "flags": { + "isExported": true + }, + "children": [ + { + "id": 655, + "name": "app", + "kind": 1024, + "kindString": "Property", + "flags": { + "isExported": true + }, + "sources": [ + { + "fileName": "app-types/index.d.ts", + "line": 179, + "character": 5 + } + ], + "type": { + "type": "reference", + "name": "FirebaseApp", + "id": 636 + } + } + ], + "groups": [ + { + "title": "Properties", + "kind": 1024, + "children": [ + 655 + ] + } + ], + "sources": [ + { + "fileName": "app-types/index.d.ts", + "line": 178, + "character": 38 + } + ] + }, + { + "id": 636, "name": "FirebaseApp", "kind": 256, "kindString": "Interface", @@ -10486,7 +14695,7 @@ }, "children": [ { - "id": 460, + "id": 637, "name": "name", "kind": 1024, "kindString": "Property", @@ -10509,7 +14718,7 @@ } }, { - "id": 461, + "id": 638, "name": "options", "kind": 1024, "kindString": "Property", @@ -10529,11 +14738,11 @@ "type": { "type": "reference", "name": "FirebaseOptions", - "id": 479 + "id": 656 } }, { - "id": 462, + "id": 639, "name": "delete", "kind": 2048, "kindString": "Method", @@ -10542,7 +14751,7 @@ }, "signatures": [ { - "id": 463, + "id": 640, "name": "delete", "kind": 4096, "kindString": "Call signature", @@ -10576,15 +14785,15 @@ "title": "Properties", "kind": 1024, "children": [ - 460, - 461 + 637, + 638 ] }, { "title": "Methods", "kind": 2048, "children": [ - 462 + 639 ] } ], @@ -10597,7 +14806,7 @@ ] }, { - "id": 455, + "id": 632, "name": "FirebaseAppConfig", "kind": 256, "kindString": "Interface", @@ -10606,7 +14815,7 @@ }, "children": [ { - "id": 457, + "id": 634, "name": "automaticDataCollectionEnabled", "kind": 1024, "kindString": "Property", @@ -10641,7 +14850,7 @@ } }, { - "id": 458, + "id": 635, "name": "automaticResourceManagement", "kind": 1024, "kindString": "Property", @@ -10678,7 +14887,7 @@ } }, { - "id": 456, + "id": 633, "name": "name", "kind": 1024, "kindString": "Property", @@ -10716,9 +14925,9 @@ "title": "Properties", "kind": 1024, "children": [ - 457, - 458, - 456 + 634, + 635, + 633 ] } ], @@ -10731,7 +14940,7 @@ ] }, { - "id": 446, + "id": 623, "name": "NativeFirebaseError", "kind": 256, "kindString": "Interface", @@ -10740,7 +14949,7 @@ }, "children": [ { - "id": 454, + "id": 631, "name": "Error", "kind": 1024, "kindString": "Property", @@ -10749,7 +14958,7 @@ }, "sources": [ { - "fileName": "D:/Code/react-native-firebase/node_modules/typescript/lib/lib.es5.d.ts", + "fileName": "/Volumes/Projects/Projects/@react-native-firebase/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts", "line": 974, "character": 19 } @@ -10760,7 +14969,7 @@ } }, { - "id": 447, + "id": 624, "name": "code", "kind": 1024, "kindString": "Property", @@ -10783,7 +14992,7 @@ } }, { - "id": 448, + "id": 625, "name": "message", "kind": 1024, "kindString": "Property", @@ -10810,7 +15019,7 @@ } }, { - "id": 452, + "id": 629, "name": "name", "kind": 1024, "kindString": "Property", @@ -10819,7 +15028,7 @@ }, "sources": [ { - "fileName": "D:/Code/react-native-firebase/node_modules/typescript/lib/lib.es5.d.ts", + "fileName": "/Volumes/Projects/Projects/@react-native-firebase/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts", "line": 963, "character": 8 } @@ -10834,7 +15043,7 @@ } }, { - "id": 449, + "id": 626, "name": "namespace", "kind": 1024, "kindString": "Property", @@ -10857,7 +15066,7 @@ } }, { - "id": 450, + "id": 627, "name": "nativeErrorCode", "kind": 1024, "kindString": "Property", @@ -10889,7 +15098,7 @@ } }, { - "id": 451, + "id": 628, "name": "nativeErrorMessage", "kind": 1024, "kindString": "Property", @@ -10912,7 +15121,7 @@ } }, { - "id": 453, + "id": 630, "name": "stack", "kind": 1024, "kindString": "Property", @@ -10922,7 +15131,7 @@ }, "sources": [ { - "fileName": "D:/Code/react-native-firebase/node_modules/typescript/lib/lib.es5.d.ts", + "fileName": "/Volumes/Projects/Projects/@react-native-firebase/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts", "line": 965, "character": 9 } @@ -10955,14 +15164,14 @@ "title": "Properties", "kind": 1024, "children": [ - 454, - 447, - 448, - 452, - 449, - 450, - 451, - 453 + 631, + 624, + 625, + 629, + 626, + 627, + 628, + 630 ] } ], @@ -10981,55 +15190,7 @@ ] }, { - "id": 477, - "name": "ReactNativeFirebaseModule", - "kind": 256, - "kindString": "Interface", - "flags": { - "isExported": true - }, - "children": [ - { - "id": 478, - "name": "app", - "kind": 1024, - "kindString": "Property", - "flags": { - "isExported": true - }, - "sources": [ - { - "fileName": "app-types/index.d.ts", - "line": 179, - "character": 5 - } - ], - "type": { - "type": "reference", - "name": "FirebaseApp", - "id": 459 - } - } - ], - "groups": [ - { - "title": "Properties", - "kind": 1024, - "children": [ - 478 - ] - } - ], - "sources": [ - { - "fileName": "app-types/index.d.ts", - "line": 178, - "character": 42 - } - ] - }, - { - "id": 464, + "id": 641, "name": "ReactNativeFirebaseNamespace", "kind": 256, "kindString": "Interface", @@ -11038,7 +15199,7 @@ }, "children": [ { - "id": 476, + "id": 653, "name": "SDK_VERSION", "kind": 1024, "kindString": "Property", @@ -11061,7 +15222,7 @@ } }, { - "id": 475, + "id": 652, "name": "apps", "kind": 1024, "kindString": "Property", @@ -11083,12 +15244,12 @@ "elementType": { "type": "reference", "name": "FirebaseApp", - "id": 459 + "id": 636 } } }, { - "id": 472, + "id": 649, "name": "app", "kind": 2048, "kindString": "Method", @@ -11097,7 +15258,7 @@ }, "signatures": [ { - "id": 473, + "id": 650, "name": "app", "kind": 4096, "kindString": "Call signature", @@ -11113,7 +15274,7 @@ }, "parameters": [ { - "id": 474, + "id": 651, "name": "name", "kind": 32768, "kindString": "Parameter", @@ -11141,7 +15302,7 @@ "type": { "type": "reference", "name": "FirebaseApp", - "id": 459 + "id": 636 } } ], @@ -11154,7 +15315,7 @@ ] }, { - "id": 465, + "id": 642, "name": "initializeApp", "kind": 2048, "kindString": "Method", @@ -11163,7 +15324,7 @@ }, "signatures": [ { - "id": 466, + "id": 643, "name": "initializeApp", "kind": 4096, "kindString": "Call signature", @@ -11173,7 +15334,7 @@ }, "parameters": [ { - "id": 467, + "id": 644, "name": "options", "kind": 32768, "kindString": "Parameter", @@ -11184,11 +15345,11 @@ "type": { "type": "reference", "name": "FirebaseOptions", - "id": 479 + "id": 656 } }, { - "id": 468, + "id": 645, "name": "config", "kind": 32768, "kindString": "Parameter", @@ -11201,18 +15362,18 @@ "type": { "type": "reference", "name": "FirebaseAppConfig", - "id": 455 + "id": 632 } } ], "type": { "type": "reference", "name": "FirebaseApp", - "id": 459 + "id": 636 } }, { - "id": 469, + "id": 646, "name": "initializeApp", "kind": 4096, "kindString": "Call signature", @@ -11222,7 +15383,7 @@ }, "parameters": [ { - "id": 470, + "id": 647, "name": "options", "kind": 32768, "kindString": "Parameter", @@ -11233,11 +15394,11 @@ "type": { "type": "reference", "name": "FirebaseOptions", - "id": 479 + "id": 656 } }, { - "id": 471, + "id": 648, "name": "name", "kind": 32768, "kindString": "Parameter", @@ -11265,7 +15426,7 @@ "type": { "type": "reference", "name": "FirebaseApp", - "id": 459 + "id": 636 } } ], @@ -11288,16 +15449,16 @@ "title": "Properties", "kind": 1024, "children": [ - 476, - 475 + 653, + 652 ] }, { "title": "Methods", "kind": 2048, "children": [ - 472, - 465 + 649, + 642 ] } ], @@ -11310,7 +15471,7 @@ ] }, { - "id": 479, + "id": 656, "name": "FirebaseOptions", "kind": 4194304, "kindString": "Type alias", @@ -11327,21 +15488,21 @@ "type": { "type": "reflection", "declaration": { - "id": 480, + "id": 657, "name": "__type", "kind": 65536, "kindString": "Type literal", "flags": {}, "indexSignature": [ { - "id": 491, + "id": 668, "name": "__index", "kind": 8192, "kindString": "Index signature", "flags": {}, "parameters": [ { - "id": 492, + "id": 669, "name": "name", "kind": 32768, "kindString": "Parameter", @@ -11360,7 +15521,7 @@ ], "children": [ { - "id": 489, + "id": 666, "name": "androidClientId", "kind": 32, "kindString": "Variable", @@ -11392,7 +15553,7 @@ } }, { - "id": 482, + "id": 659, "name": "apiKey", "kind": 32, "kindString": "Variable", @@ -11424,7 +15585,7 @@ } }, { - "id": 481, + "id": 658, "name": "appId", "kind": 32, "kindString": "Variable", @@ -11445,7 +15606,7 @@ } }, { - "id": 488, + "id": 665, "name": "clientId", "kind": 32, "kindString": "Variable", @@ -11477,7 +15638,7 @@ } }, { - "id": 483, + "id": 660, "name": "databaseURL", "kind": 32, "kindString": "Variable", @@ -11509,7 +15670,7 @@ } }, { - "id": 490, + "id": 667, "name": "deepLinkURLScheme", "kind": 32, "kindString": "Variable", @@ -11541,7 +15702,7 @@ } }, { - "id": 485, + "id": 662, "name": "gaTrackingId", "kind": 32, "kindString": "Variable", @@ -11573,7 +15734,7 @@ } }, { - "id": 487, + "id": 664, "name": "messagingSenderId", "kind": 32, "kindString": "Variable", @@ -11605,7 +15766,7 @@ } }, { - "id": 484, + "id": 661, "name": "projectId", "kind": 32, "kindString": "Variable", @@ -11626,7 +15787,7 @@ } }, { - "id": 486, + "id": 663, "name": "storageBucket", "kind": 32, "kindString": "Variable", @@ -11663,16 +15824,16 @@ "title": "Variables", "kind": 32, "children": [ - 489, - 482, - 481, - 488, - 483, - 490, - 485, - 487, - 484, - 486 + 666, + 659, + 658, + 665, + 660, + 667, + 662, + 664, + 661, + 663 ] } ], @@ -11687,7 +15848,7 @@ } }, { - "id": 512, + "id": 689, "name": "ReactNativeFirebaseModuleAndStatics", "kind": 4194304, "kindString": "Type alias", @@ -11696,14 +15857,14 @@ }, "typeParameter": [ { - "id": 513, + "id": 690, "name": "M", "kind": 131072, "kindString": "Type parameter", "flags": {} }, { - "id": 514, + "id": 691, "name": "S", "kind": 131072, "kindString": "Type parameter", @@ -11723,14 +15884,14 @@ { "type": "reflection", "declaration": { - "id": 515, + "id": 692, "name": "__type", "kind": 65536, "kindString": "Type literal", "flags": {}, "signatures": [ { - "id": 516, + "id": 693, "name": "__call", "kind": 4096, "kindString": "Call signature", @@ -11743,7 +15904,7 @@ ], "children": [ { - "id": 517, + "id": 694, "name": "SDK_VERSION", "kind": 32, "kindString": "Variable", @@ -11769,7 +15930,7 @@ "title": "Variables", "kind": 32, "children": [ - 517 + 694 ] } ], @@ -11790,7 +15951,7 @@ } }, { - "id": 518, + "id": 695, "name": "ReactNativeFirebaseModuleAndStaticsWithApp", "kind": 4194304, "kindString": "Type alias", @@ -11799,14 +15960,14 @@ }, "typeParameter": [ { - "id": 519, + "id": 696, "name": "M", "kind": 131072, "kindString": "Type parameter", "flags": {} }, { - "id": 520, + "id": 697, "name": "S", "kind": 131072, "kindString": "Type parameter", @@ -11826,21 +15987,21 @@ { "type": "reflection", "declaration": { - "id": 521, + "id": 698, "name": "__type", "kind": 65536, "kindString": "Type literal", "flags": {}, "signatures": [ { - "id": 522, + "id": 699, "name": "__call", "kind": 4096, "kindString": "Call signature", "flags": {}, "parameters": [ { - "id": 523, + "id": 700, "name": "app", "kind": 32768, "kindString": "Parameter", @@ -11862,7 +16023,7 @@ ], "children": [ { - "id": 524, + "id": 701, "name": "SDK_VERSION", "kind": 32, "kindString": "Variable", @@ -11888,7 +16049,7 @@ "title": "Variables", "kind": 32, "children": [ - 524 + 701 ] } ], @@ -11927,9 +16088,10 @@ 329, 340, 429, - 441, + 605, + 618, 1, - 493, + 670, 59, 70, 124, @@ -11940,27 +16102,34 @@ 269, 336, 347, - 436 + 436, + 613 + ] + }, + { + "title": "Classes", + "kind": 128, + "children": [ + 654 ] }, { "title": "Interfaces", "kind": 256, "children": [ - 459, - 455, - 446, - 477, - 464 + 636, + 632, + 623, + 641 ] }, { "title": "Type aliases", "kind": 4194304, "children": [ - 479, - 512, - 518 + 656, + 689, + 695 ] } ] diff --git a/package.json b/package.json index 02c1198d..e8d5d147 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "validate:all:js": "eslint ./", "validate:all:ts": "tsc --project ./", "validate:all:flow": "flow", - "lerna:boostrap": "lerna bootstrap", + "lerna:bootstrap": "lerna bootstrap", "lerna:link": "lerna link && lerna exec -- yarn link", "gen:reference": "node scripts/generate-typedoc.js", "tests:packager:chrome": "cd tests && react-native start --platforms ios,android", @@ -42,33 +42,33 @@ }, "devDependencies": { "@babel/cli": "^7.2.3", - "@babel/core": "^7.2.2", - "@babel/plugin-transform-runtime": "^7.2.0", - "@babel/runtime": "^7.2.0", + "@babel/core": "^7.4.0", + "@babel/plugin-transform-runtime": "^7.4.0", + "@babel/runtime": "^7.4.2", "@invertase/babel-preset-react-native-syntax": "^0.1.3", "babel-eslint": "^10.0.1", - "codecov": "^3.1.0", - "eslint": "^5.12.1", + "codecov": "^3.2.0", + "eslint": "^5.16.0", "eslint-config-airbnb": "^17.1.0", - "eslint-config-prettier": "^3.6.0", - "eslint-plugin-flowtype": "^3.2.1", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-jsx-a11y": "^6.1.2", + "eslint-config-prettier": "^4.1.0", + "eslint-plugin-flowtype": "^3.4.2", + "eslint-plugin-import": "^2.16.0", + "eslint-plugin-jsx-a11y": "^6.2.1", "eslint-plugin-prettier": "^3.0.1", - "eslint-plugin-react": "^7.11.1", - "flow-bin": "^0.93.0", + "eslint-plugin-react": "^7.12.4", + "flow-bin": "^0.96.0", "genversion": "^2.1.1", - "husky": "^1.2.1", - "lerna": "^3.6.0", - "lint-staged": "^8.1.0", - "prettier": "^1.15.3", + "husky": "^1.3.1", + "lerna": "^3.13.1", + "lint-staged": "^8.1.5", + "prettier": "^1.16.4", "rimraf": "^2.6.3", - "tslint": "^5.12.1", + "tslint": "^5.15.0", "tslint-config-airbnb": "^5.11.1", - "tslint-config-prettier": "^1.17.0", + "tslint-config-prettier": "^1.18.0", "tslint-plugin-prettier": "^2.0.1", - "typedoc": "^0.14.1", - "typescript": "^3.2.4" + "typedoc": "^0.14.2", + "typescript": "^3.4.1" }, "lint-staged": { "packages/**/*.js": [ diff --git a/packages/analytics/android/build.gradle b/packages/analytics/android/build.gradle index d9b0af7c..4c05e5b3 100644 --- a/packages/analytics/android/build.gradle +++ b/packages/analytics/android/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.4.0' } } diff --git a/packages/analytics/ios/RNFBAnalytics.podspec b/packages/analytics/ios/RNFBAnalytics.podspec index 05508fc3..26c70c23 100644 --- a/packages/analytics/ios/RNFBAnalytics.podspec +++ b/packages/analytics/ios/RNFBAnalytics.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| s.platform = :ios, "10.0" s.source_files = 'RNFBAnalytics/**/*.{h,m}' s.dependency 'React' - s.dependency 'Firebase/Core', '~> 5.19.0' + s.dependency 'Firebase/Core', '~> 5.20.2' s.dependency 'RNFBApp' s.static_framework = true end diff --git a/packages/analytics/lib/index.d.ts b/packages/analytics/lib/index.d.ts index 73589838..183b3044 100644 --- a/packages/analytics/lib/index.d.ts +++ b/packages/analytics/lib/index.d.ts @@ -22,19 +22,58 @@ import { } from '@react-native-firebase/app-types'; /** - * Analytics integrates across Firebase features and provides - * you with unlimited reporting for up to 500 distinct events - * that you can define using the Firebase SDK. Analytics reports - * help you understand clearly how your users behave, which enables - * you to make informed decisions regarding app marketing and - * performance optimizations. + * Firebase Analytics package for React Native. + * + * #### Example 1 + * + * Access the firebase export from the `analytics` package: + * + * ```js + * import { firebase } from '@react-native-firebase/analytics'; + * + * // firebase.analytics().X + * ``` + * + * #### Example 2 + * + * Using the default export from the `analytics` package: + * + * ```js + * import analytics from '@react-native-firebase/analytics'; + * + * // analytics().X + * ``` + * + * #### Example 3 + * + * Using the default export from the `app` package: + * + * ```js + * import firebase from '@react-native-firebase/app'; + * import '@react-native-firebase/analytics'; + * + * // firebase.analytics().X + * ``` * * @firebase analytics */ export namespace Analytics { export interface Statics {} - export interface Module extends ReactNativeFirebaseModule { + /** + * The Firebase Analytics service interface. + * + * > This module is available for the default app only. + * + * #### Example + * + * Get the Analytics service for the default app: + * + * ```js + * const defaultAppAnalytics = firebase.analytics(); + * ``` + */ + export class Module extends ReactNativeFirebaseModule { /** * Log a custom event with optional params. * @@ -183,7 +222,6 @@ declare module '@react-native-firebase/analytics' { const FirebaseNamespaceExport: {} & ReactNativeFirebaseNamespace; /** - * @example * ```js * import { firebase } from '@react-native-firebase/analytics'; * firebase.analytics().logEvent(...); @@ -195,13 +233,7 @@ declare module '@react-native-firebase/analytics' { Analytics.Module, Analytics.Statics >; - /** - * @example - * ```js - * import analytics from '@react-native-firebase/analytics'; - * analytics().logEvent(...); - * ``` - */ + export default AnalyticsDefaultExport; } @@ -210,14 +242,6 @@ declare module '@react-native-firebase/analytics' { */ declare module '@react-native-firebase/app-types' { interface ReactNativeFirebaseNamespace { - /** - * Analytics integrates across Firebase features and provides - * you with unlimited reporting for up to 500 distinct events - * that you can define using the Firebase SDK. Analytics reports - * help you understand clearly how your users behave, which enables - * you to make informed decisions regarding app marketing and - * performance optimizations. - */ analytics: ReactNativeFirebaseModuleAndStatics< Analytics.Module, Analytics.Statics @@ -225,14 +249,6 @@ declare module '@react-native-firebase/app-types' { } interface FirebaseApp { - /** - * Analytics integrates across Firebase features and provides - * you with unlimited reporting for up to 500 distinct events - * that you can define using the Firebase SDK. Analytics reports - * help you understand clearly how your users behave, which enables - * you to make informed decisions regarding app marketing and - * performance optimizations. - */ analytics(): Analytics.Module; } } diff --git a/packages/app-types/index.d.ts b/packages/app-types/index.d.ts index 3872451a..2049fc94 100644 --- a/packages/app-types/index.d.ts +++ b/packages/app-types/index.d.ts @@ -175,7 +175,7 @@ export interface ReactNativeFirebaseNamespace { readonly SDK_VERSION: string; } -export interface ReactNativeFirebaseModule { +export class ReactNativeFirebaseModule { app: FirebaseApp; } diff --git a/packages/app/android/build.gradle b/packages/app/android/build.gradle index 3feb7a44..bfdf4514 100644 --- a/packages/app/android/build.gradle +++ b/packages/app/android/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.4.0' } } diff --git a/packages/app/android/gradle.properties b/packages/app/android/gradle.properties new file mode 100644 index 00000000..d015431a --- /dev/null +++ b/packages/app/android/gradle.properties @@ -0,0 +1,2 @@ +android.useAndroidX=true +android.enableJetifier=true \ No newline at end of file diff --git a/packages/app/android/src/main/java/io/invertase/firebase/common/ReactNativeFirebaseEventEmitter.java b/packages/app/android/src/main/java/io/invertase/firebase/common/ReactNativeFirebaseEventEmitter.java index ae0f37f8..5b1726b3 100644 --- a/packages/app/android/src/main/java/io/invertase/firebase/common/ReactNativeFirebaseEventEmitter.java +++ b/packages/app/android/src/main/java/io/invertase/firebase/common/ReactNativeFirebaseEventEmitter.java @@ -19,7 +19,8 @@ package io.invertase.firebase.common; import android.os.Handler; import android.os.Looper; -import android.support.annotation.MainThread; +import androidx.annotation.MainThread; +import android.util.Log; import com.facebook.react.bridge.Arguments; import com.facebook.react.bridge.ReactContext; @@ -46,33 +47,24 @@ public class ReactNativeFirebaseEventEmitter { } public void attachReactContext(final ReactContext reactContext) { - handler.post(new Runnable() { - @Override - public void run() { - ReactNativeFirebaseEventEmitter.this.reactContext = reactContext; - sendQueuedEvents(); - } + handler.post(() -> { + ReactNativeFirebaseEventEmitter.this.reactContext = reactContext; + sendQueuedEvents(); }); } public void notifyJsReady(Boolean ready) { - handler.post(new Runnable() { - @Override - public void run() { - jsReady = ready; - sendQueuedEvents(); - } + handler.post(() -> { + jsReady = ready; + sendQueuedEvents(); }); } public void sendEvent(final NativeEvent event) { - handler.post(new Runnable() { - @Override - public void run() { - synchronized (jsListeners) { - if (!jsListeners.containsKey(event.getEventName()) || !emit(event)) { - queuedEvents.add(event); - } + handler.post(() -> { + synchronized (jsListeners) { + if (!jsListeners.containsKey(event.getEventName()) || !emit(event)) { + queuedEvents.add(event); } } }); @@ -89,12 +81,7 @@ public class ReactNativeFirebaseEventEmitter { } } - handler.post(new Runnable() { - @Override - public void run() { - sendQueuedEvents(); - } - }); + handler.post(this::sendQueuedEvents); } public void removeListener(String eventName, Boolean all) { @@ -154,6 +141,7 @@ public class ReactNativeFirebaseEventEmitter { DeviceEventManagerModule.RCTDeviceEventEmitter.class ).emit("rnfb_" + event.getEventName(), event.getEventBody()); } catch (Exception e) { + Log.wtf("RNFB_EMITTER", "Error sending Event " + event.getEventName(), e); return false; } diff --git a/packages/app/android/src/main/java/io/invertase/firebase/common/ReactNativeFirebaseInitProvider.java b/packages/app/android/src/main/java/io/invertase/firebase/common/ReactNativeFirebaseInitProvider.java index fcf0c423..42fec16d 100644 --- a/packages/app/android/src/main/java/io/invertase/firebase/common/ReactNativeFirebaseInitProvider.java +++ b/packages/app/android/src/main/java/io/invertase/firebase/common/ReactNativeFirebaseInitProvider.java @@ -23,7 +23,7 @@ import android.content.Context; import android.content.pm.ProviderInfo; import android.database.Cursor; import android.net.Uri; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import javax.annotation.OverridingMethodsMustInvokeSuper; diff --git a/packages/app/android/src/main/java/io/invertase/firebase/common/ReactNativeFirebaseModule.java b/packages/app/android/src/main/java/io/invertase/firebase/common/ReactNativeFirebaseModule.java index b4dec5fa..4e1e1bc4 100644 --- a/packages/app/android/src/main/java/io/invertase/firebase/common/ReactNativeFirebaseModule.java +++ b/packages/app/android/src/main/java/io/invertase/firebase/common/ReactNativeFirebaseModule.java @@ -62,7 +62,7 @@ public class ReactNativeFirebaseModule extends ReactContextBaseJavaModule implem return getCurrentActivity(); } - public WritableMap getExceptionMap(Exception exception) { + static WritableMap getExceptionMap(Exception exception) { WritableMap exceptionMap = Arguments.createMap(); String code = "unknown"; String message = exception.getMessage(); @@ -73,11 +73,11 @@ public class ReactNativeFirebaseModule extends ReactContextBaseJavaModule implem return exceptionMap; } - public void rejectPromiseWithExceptionMap(Promise promise, Exception exception) { + public static void rejectPromiseWithExceptionMap(Promise promise, Exception exception) { promise.reject(exception, getExceptionMap(exception)); } - public void rejectPromiseWithCodeAndMessage(Promise promise, String code, String message) { + public static void rejectPromiseWithCodeAndMessage(Promise promise, String code, String message) { WritableMap userInfoMap = Arguments.createMap(); userInfoMap.putString("code", code); userInfoMap.putString("message", message); diff --git a/packages/app/e2e/events.e2e.js b/packages/app/e2e/events.e2e.js index faf6251c..338b0ba9 100644 --- a/packages/app/e2e/events.e2e.js +++ b/packages/app/e2e/events.e2e.js @@ -40,6 +40,7 @@ describe('Core -> EventEmitter', () => { return resolve(); }); + await eventsNotifyReady(false); await eventsPing(eventName, eventBody); await Utils.sleep(100); const nativeListenersBefore = await eventsGetListeners(); diff --git a/packages/app/ios/RNFBApp.podspec b/packages/app/ios/RNFBApp.podspec index ffcf82ff..b82a20e1 100644 --- a/packages/app/ios/RNFBApp.podspec +++ b/packages/app/ios/RNFBApp.podspec @@ -16,6 +16,6 @@ Pod::Spec.new do |s| s.platform = :ios, "10.0" s.source_files = 'RNFBApp/**/*.{h,m}' s.dependency 'React' - s.dependency 'Firebase/Core', '~> 5.19.0' + s.dependency 'Firebase/Core', '~> 5.20.2' s.static_framework = true end diff --git a/packages/app/ios/RNFBApp/RNFBSharedUtils.h b/packages/app/ios/RNFBApp/RNFBSharedUtils.h index 507a85a3..02df835c 100644 --- a/packages/app/ios/RNFBApp/RNFBSharedUtils.h +++ b/packages/app/ios/RNFBApp/RNFBSharedUtils.h @@ -41,6 +41,8 @@ extern NSString *const DEFAULT_APP_NAME; #pragma mark - #pragma mark Methods ++ (NSString *)getAppJavaScriptName:(NSString *)appDisplayName; + + (NSDictionary *)firAppToDictionary:(FIRApp *)firApp; + (void)rejectPromiseWithExceptionDict:(RCTPromiseRejectBlock)reject exception:(NSException *)exception; diff --git a/packages/app/ios/RNFBApp/RNFBSharedUtils.m b/packages/app/ios/RNFBApp/RNFBSharedUtils.m index 5ae74ee8..1d1753f1 100644 --- a/packages/app/ios/RNFBApp/RNFBSharedUtils.m +++ b/packages/app/ios/RNFBApp/RNFBSharedUtils.m @@ -23,12 +23,21 @@ NSString *const DEFAULT_APP_DISPLAY_NAME = @"[DEFAULT]"; NSString *const DEFAULT_APP_NAME = @"__FIRAPP_DEFAULT"; + @implementation RNFBSharedUtils static NSString *const RNFBErrorDomain = @"RNFBErrorDomain"; #pragma mark - #pragma mark Methods + + (NSString *)getAppJavaScriptName:(NSString *)appDisplayName { + if ([appDisplayName isEqualToString:DEFAULT_APP_NAME]) { + return DEFAULT_APP_DISPLAY_NAME; + } + return appDisplayName; + } + + + (NSDictionary *)firAppToDictionary:(FIRApp *)firApp { FIROptions *firOptions = [firApp options]; NSMutableDictionary *firAppDictionary = [NSMutableDictionary new]; @@ -79,4 +88,4 @@ NSString *const DEFAULT_APP_NAME = @"__FIRAPP_DEFAULT"; NSError *error = [NSError errorWithDomain:RNFBErrorDomain code:666 userInfo:userInfo]; reject(userInfo[@"code"], userInfo[@"message"], error); } -@end \ No newline at end of file +@end diff --git a/packages/app/lib/internal/FirebaseModule.js b/packages/app/lib/internal/FirebaseModule.js index 5c19e39a..c6b25cc3 100644 --- a/packages/app/lib/internal/FirebaseModule.js +++ b/packages/app/lib/internal/FirebaseModule.js @@ -34,6 +34,10 @@ export default class FirebaseModule { return SharedEventEmitter; } + eventNameForApp(...args) { + return `${this.app.name}-${args.join('-')}`; + } + get native() { if (this._nativeModule) return this._nativeModule; this._nativeModule = getNativeModule(this); diff --git a/packages/app/lib/internal/NativeFirebaseError.js b/packages/app/lib/internal/NativeFirebaseError.js index 0e66e6c8..9413188f 100644 --- a/packages/app/lib/internal/NativeFirebaseError.js +++ b/packages/app/lib/internal/NativeFirebaseError.js @@ -16,6 +16,10 @@ */ export default class NativeFirebaseError extends Error { + static fromEvent(errorEvent, namespace) { + return new NativeFirebaseError({ userInfo: errorEvent }, new Error().stack, namespace); + } + constructor(nativeError, jsStack, namespace) { super(); const { userInfo } = nativeError; diff --git a/packages/app/lib/internal/RNFBNativeEventEmitter.js b/packages/app/lib/internal/RNFBNativeEventEmitter.js index 757ed3e5..0f691a23 100644 --- a/packages/app/lib/internal/RNFBNativeEventEmitter.js +++ b/packages/app/lib/internal/RNFBNativeEventEmitter.js @@ -22,9 +22,14 @@ const { RNFBAppModule } = NativeModules; class RNFBNativeEventEmitter extends NativeEventEmitter { constructor() { super(RNFBAppModule); + this.ready = false; } addListener(eventType, listener, context) { + if (!this.ready) { + RNFBAppModule.eventsNotifyReady(true); + this.ready = true; + } RNFBAppModule.eventsAddListener(eventType); return super.addListener(`rnfb_${eventType}`, listener, context); } diff --git a/packages/app/lib/internal/index.js b/packages/app/lib/internal/index.js index 26f49350..c93787ca 100644 --- a/packages/app/lib/internal/index.js +++ b/packages/app/lib/internal/index.js @@ -19,6 +19,7 @@ export * from './constants'; export * from './registry/app'; export * from './registry/namespace'; export * from './registry/nativeModule'; -export { default as FirebaseModule } from './FirebaseModule'; export { default as FirebaseApp } from '../FirebaseApp'; +export { default as FirebaseModule } from './FirebaseModule'; export { default as SharedEventEmitter } from './SharedEventEmitter'; +export { default as NativeFirebaseError } from './NativeFirebaseError'; diff --git a/packages/app/lib/internal/registry/nativeModule.js b/packages/app/lib/internal/registry/nativeModule.js index 9e6e8f80..7830f6c0 100644 --- a/packages/app/lib/internal/registry/nativeModule.js +++ b/packages/app/lib/internal/registry/nativeModule.js @@ -91,6 +91,7 @@ function initialiseNativeModule(module) { nativeModuleName, hasMultiAppSupport, hasCustomUrlOrRegionSupport, + disablePrependCustomUrlOrRegion, } = config; const nativeModule = NativeModules[nativeModuleName]; @@ -104,7 +105,7 @@ function initialiseNativeModule(module) { argToPrepend.push(module.app.name); } - if (hasCustomUrlOrRegionSupport) { + if (hasCustomUrlOrRegionSupport && !disablePrependCustomUrlOrRegion) { argToPrepend.push(module._customUrlOrRegion); } diff --git a/packages/app/package.json b/packages/app/package.json index 8fc92287..e2594b94 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -49,8 +49,8 @@ "crashlytics" ], "peerDependencies": { - "react": ">= 16.6.3", - "react-native": ">= 0.58.1" + "react": "*", + "react-native": "*" }, "dependencies": { "@react-native-firebase/app-types": "6.0.0-alpha.9", diff --git a/packages/app/pod_config.rb b/packages/app/pod_config.rb index b2da16d5..2bc3256b 100644 --- a/packages/app/pod_config.rb +++ b/packages/app/pod_config.rb @@ -28,7 +28,7 @@ end def react_native_firebase!(config = {}) react_native_firebase_path = config.fetch(:react_native_firebase_path, '../node_modules/@react-native-firebase') - known_firebase_modules = %w(app analytics config crashlytics fiam functions firestore iid invites perf utils) + known_firebase_modules = %w(app analytics config crashlytics fiam functions firestore iid invites perf utils storage) # TODO(salakar): validate versions / set pod versions app_package = JSON.parse(File.read("#{react_native_firebase_path}/#{known_firebase_modules[0]}/package.json")) diff --git a/packages/auth/android/build.gradle b/packages/auth/android/build.gradle index 51e3f202..edab5ad9 100644 --- a/packages/auth/android/build.gradle +++ b/packages/auth/android/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.4.0' } } diff --git a/packages/auth/ios/RNFBAuth.podspec b/packages/auth/ios/RNFBAuth.podspec index b7c9b630..c4ed3908 100644 --- a/packages/auth/ios/RNFBAuth.podspec +++ b/packages/auth/ios/RNFBAuth.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| s.platform = :ios, "10.0" s.source_files = 'RNFBAuth/**/*.{h,m}' s.dependency 'React' - s.dependency 'Firebase/Core', '~> 5.19.0' + s.dependency 'Firebase/Core', '~> 5.20.2' s.dependency 'RNFBApp' s.static_framework = true end diff --git a/packages/auth/lib/index.d.ts b/packages/auth/lib/index.d.ts index 4fcb0cc3..d5080994 100644 --- a/packages/auth/lib/index.d.ts +++ b/packages/auth/lib/index.d.ts @@ -22,14 +22,66 @@ import { } from '@react-native-firebase/app-types'; /** - * Auth + * Firebase Authentication package for React Native. + * + * #### Example 1 + * + * Access the firebase export from the `auth` package: + * + * ```js + * import { firebase } from '@react-native-firebase/auth'; + * + * // firebase.auth().X + * ``` + * + * #### Example 2 + * + * Using the default export from the `auth` package: + * + * ```js + * import auth from '@react-native-firebase/auth'; + * + * // auth().X + * ``` + * + * #### Example 3 + * + * Using the default export from the `app` package: + * + * ```js + * import firebase from '@react-native-firebase/app'; + * import '@react-native-firebase/auth'; + * + * // firebase.auth().X + * ``` * * @firebase auth */ export namespace Auth { export interface Statics {} - export interface Module extends ReactNativeFirebaseModule { + /** + * The Firebase Authentication service is available for the default app or a given app. + * + * #### Example 1 + * + * Get the auth instance for the **default app**: + * + * ```js + * const authForDefaultApp = firebase.auth(); + * ``` + * + * #### Example 2 + * + * Get the auth instance for a **secondary app**: + * + * ```js + * const otherApp = firebase.app('otherApp'); + * const authForOtherApp = firebase.auth(otherApp); + * ``` + * + */ + export class Module extends ReactNativeFirebaseModule { } } diff --git a/packages/common/lib/Base64.js b/packages/common/lib/Base64.js new file mode 100644 index 00000000..5936ee28 --- /dev/null +++ b/packages/common/lib/Base64.js @@ -0,0 +1,121 @@ +/* eslint-disable */ +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import binaryToBase64 from 'react-native/Libraries/Utilities/binaryToBase64'; +import promiseDefer from './promiseDefer'; + +const CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + +/** + * window.btoa + */ +function btoa(input): string { + let map; + let i = 0; + let block = 0; + let output = ''; + + // eslint-disable-next-line + for ( + block = 0, i = 0, map = CHARS; + input.charAt(i | 0) || ((map = '='), i % 1); + output += map.charAt(63 & (block >> (8 - (i % 1) * 8))) + ) { + const charCode = input.charCodeAt((i += 3 / 4)); + + if (charCode > 0xff) { + throw new Error( + "'RNFirebase.Base64.btoa' failed: The string to be encoded contains characters outside of the Latin1 range.", + ); + } + + block = (block << 8) | charCode; + } + + return output; +} + +/** + * window.atob + */ +function atob(input): string { + let i = 0; + let bc = 0; + let bs = 0; + let buffer; + let output = ''; + + const str = input.replace(/=+$/, ''); + + if (str.length % 4 === 1) { + throw new Error( + "'RNFirebase.Base64.atob' failed: The string to be decoded is not correctly encoded.", + ); + } + + // eslint-disable-next-line + for ( + bc = 0, bs = 0, i = 0; + (buffer = str.charAt(i++)); + ~buffer && ((bs = bc % 4 ? bs * 64 + buffer : buffer), bc++ % 4) + ? (output += String.fromCharCode(255 & (bs >> ((-2 * bc) & 6)))) + : 0 + ) { + buffer = CHARS.indexOf(buffer); + } + + return output; +} + +/** + * Converts a Blob, ArrayBuffer or Uint8Array to a base64 string. + */ +function fromData(data) { + if (data instanceof Blob) { + const fileReader = new FileReader(); + const { resolve, reject, promise } = promiseDefer(); + + fileReader.readAsDataURL(data); + + fileReader.onloadend = function onloadend() { + resolve({ string: fileReader.result, format: 'data_url' }); + }; + + fileReader.onerror = function onerror(event) { + fileReader.abort(); + reject(event); + }; + + return promise; + } + + if (data instanceof ArrayBuffer || data instanceof Uint8Array) { + return Promise.resolve({ + string: binaryToBase64(data), + format: 'base64', + }); + } + + throw new Error("'RNFirebase.Base64.fromData' failed: Unknown data type."); +} + +export default { + btoa, + atob, + fromData, +}; diff --git a/packages/common/lib/ReferenceBase.js b/packages/common/lib/ReferenceBase.js new file mode 100644 index 00000000..0d32170d --- /dev/null +++ b/packages/common/lib/ReferenceBase.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +export default class ReferenceBase { + constructor(_path) { + let path = _path; + + if (path) { + path = path.length > 1 && path.endsWith('/') ? path.substring(0, path.length - 1) : path; + if (path.startsWith('/') && path.length > 1) path = path.substring(1, path.length); + } else { + path = '/'; + } + + this.path = path; + } + + /** + * The last part of a Reference's path (after the last '/') + * The key of a root Reference is null. + * @type {String} + * {@link https://firebase.google.com/docs/reference/js/firebase.database.Reference#key} + */ + get key() { + return this.path === '/' ? null : this.path.substring(this.path.lastIndexOf('/') + 1); + } +} diff --git a/packages/common/lib/index.js b/packages/common/lib/index.js index 711760e9..83ab5e9a 100644 --- a/packages/common/lib/index.js +++ b/packages/common/lib/index.js @@ -15,21 +15,23 @@ * */ import { Platform } from 'react-native'; +import { isString } from './validate'; +import Base64 from './Base64'; +export * from './path'; export * from './validate'; +export Base64 from './Base64'; +export promiseDefer from './promiseDefer'; +export ReferenceBase from './ReferenceBase'; -export function promiseDefer() { - const deferred = { - resolve: null, - reject: null, - }; - - deferred.promise = new Promise((resolve, reject) => { - deferred.resolve = resolve; - deferred.reject = reject; - }); - - return deferred; +export function getDataUrlParts(dataUrlString) { + const isBase64 = dataUrlString.includes(`;base64`); + let [mediaType, base64String] = dataUrlString.split(','); + if (!mediaType || !base64String) return { base64String: undefined, mediaType: undefined }; + mediaType = mediaType.replace('data:', '').replace(';base64', ''); + if (base64String && base64String.includes('%')) base64String = decodeURIComponent(base64String); + if (!isBase64) base64String = Base64.btoa(base64String); + return { base64String, mediaType }; } export function once(fn, context) { @@ -58,6 +60,17 @@ export function hasOwnProperty(target, property) { return Object.hasOwnProperty.call(target, property); } +/** + * Remove a trailing forward slash from a string if it exists + * + * @param string + * @returns {*} + */ +export function stripTrailingSlash(string) { + if (!isString(string)) return string; + return string.endsWith('/') ? string.slice(0, -1) : string; +} + export const isIOS = Platform.OS === 'ios'; export const isAndroid = Platform.OS === 'android'; diff --git a/packages/common/lib/path.js b/packages/common/lib/path.js new file mode 100644 index 00000000..e7d2a36f --- /dev/null +++ b/packages/common/lib/path.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/** + * Returns the next parent of the path e.g. /foo/bar/car -> /foo/bar + */ +export function pathParent(path) { + if (path.length === 0) { + return null; + } + + const index = path.lastIndexOf('/'); + if (index <= 0) { + return null; + } + + return path.slice(0, index); +} + +/** + * Joins a parent and a child path + */ +export function pathChild(path, childPath) { + const canonicalChildPath = childPath + .split('/') + .filter($ => $.length > 0) + .join('/'); + + if (path.length === 0) { + return canonicalChildPath; + } + + return `${path}/${canonicalChildPath}`; +} + +/** + * Returns the last component of a path, e.g /foo/bar.jpeg -> bar.jpeg + */ +export function pathLastComponent(path) { + const index = path.lastIndexOf('/', path.length - 2); + if (index === -1) { + return path; + } + + return path.slice(index + 1); +} diff --git a/packages/common/lib/promiseDefer.js b/packages/common/lib/promiseDefer.js new file mode 100644 index 00000000..52878423 --- /dev/null +++ b/packages/common/lib/promiseDefer.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +export default function promiseDefer() { + const deferred = { + resolve: null, + reject: null, + }; + + deferred.promise = new Promise((resolve, reject) => { + deferred.resolve = resolve; + deferred.reject = reject; + }); + + return deferred; +} diff --git a/packages/config/android/build.gradle b/packages/config/android/build.gradle index f30beb60..98877c22 100644 --- a/packages/config/android/build.gradle +++ b/packages/config/android/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.4.0' } } @@ -29,7 +29,7 @@ project.ext { ], firebase : [ - config: "16.4.1" + config: "16.5.0" ], ], ]) diff --git a/packages/config/ios/RNFBConfig.podspec b/packages/config/ios/RNFBConfig.podspec index 81e28fe3..0a47baa9 100644 --- a/packages/config/ios/RNFBConfig.podspec +++ b/packages/config/ios/RNFBConfig.podspec @@ -16,8 +16,8 @@ Pod::Spec.new do |s| s.platform = :ios, "10.0" s.source_files = 'RNFBConfig/**/*.{h,m}' s.dependency 'React' - s.dependency 'Firebase/Core', '~> 5.19.0' - s.dependency 'Firebase/RemoteConfig', '~> 5.19.0' + s.dependency 'Firebase/Core', '~> 5.20.2' + s.dependency 'Firebase/RemoteConfig', '~> 5.20.2' s.dependency 'RNFBApp' s.static_framework = true end diff --git a/packages/config/ios/RNFBConfig/RNFBConfigModule.m b/packages/config/ios/RNFBConfig/RNFBConfigModule.m index 23684f22..9d890f84 100644 --- a/packages/config/ios/RNFBConfig/RNFBConfigModule.m +++ b/packages/config/ios/RNFBConfig/RNFBConfigModule.m @@ -22,218 +22,211 @@ #import "RNFBConfigModule.h" #import "RNFBSharedUtils.h" - @implementation RNFBConfigModule #pragma mark - # pragma mark Converters - NSString *convertFIRRemoteConfigFetchStatusToNSString(FIRRemoteConfigFetchStatus value) { - switch (value) { - case FIRRemoteConfigFetchStatusNoFetchYet: - return @"no_fetch_yet"; - case FIRRemoteConfigFetchStatusSuccess: - return @"success"; - case FIRRemoteConfigFetchStatusThrottled: - return @"throttled"; - case FIRRemoteConfigFetchStatusFailure: - return @"failure"; - default: - return @"unknown"; - } +NSString *convertFIRRemoteConfigFetchStatusToNSString(FIRRemoteConfigFetchStatus value) { + switch (value) { + case FIRRemoteConfigFetchStatusNoFetchYet:return @"no_fetch_yet"; + case FIRRemoteConfigFetchStatusSuccess:return @"success"; + case FIRRemoteConfigFetchStatusThrottled:return @"throttled"; + case FIRRemoteConfigFetchStatusFailure:return @"failure"; + default:return @"unknown"; } +} - NSString *convertFIRRemoteConfigFetchStatusToNSStringDescription(FIRRemoteConfigFetchStatus value) { - switch (value) { - case FIRRemoteConfigFetchStatusThrottled: - return @"fetch() operation cannot be completed successfully, due to throttling."; - case FIRRemoteConfigFetchStatusNoFetchYet: - default: - return @"fetch() operation cannot be completed successfully."; - } +NSString *convertFIRRemoteConfigFetchStatusToNSStringDescription(FIRRemoteConfigFetchStatus value) { + switch (value) { + case FIRRemoteConfigFetchStatusThrottled:return @"fetch() operation cannot be completed successfully, due to throttling."; + case FIRRemoteConfigFetchStatusNoFetchYet: + default:return @"fetch() operation cannot be completed successfully."; } +} - NSString *convertFIRRemoteConfigSourceToNSString(FIRRemoteConfigSource value) { - switch (value) { - case FIRRemoteConfigSourceDefault: - return @"default"; - case FIRRemoteConfigSourceRemote: - return @"remote"; - case FIRRemoteConfigSourceStatic: - return @"static"; - default: - return @"unknown"; - } +NSString *convertFIRRemoteConfigSourceToNSString(FIRRemoteConfigSource value) { + switch (value) { + case FIRRemoteConfigSourceDefault:return @"default"; + case FIRRemoteConfigSourceRemote:return @"remote"; + case FIRRemoteConfigSourceStatic:return @"static"; + default:return @"unknown"; } +} - NSDictionary *convertFIRRemoteConfigValueToNSDictionary(FIRRemoteConfigValue *value) { - return @{@"stringValue": (id) value.stringValue ?: [NSNull null], @"numberValue": (id) value.numberValue ?: [NSNull null], @"boolValue": @(value.boolValue), @"source": convertFIRRemoteConfigSourceToNSString(value.source)}; - } +NSDictionary *convertFIRRemoteConfigValueToNSDictionary(FIRRemoteConfigValue *value) { + return @{@"stringValue": (id) value.stringValue ?: [NSNull null], + @"numberValue": (id) value.numberValue ?: [NSNull null], @"boolValue": @(value.boolValue), + @"source": convertFIRRemoteConfigSourceToNSString(value.source)}; +} #pragma mark - #pragma mark Module Setup - RCT_EXPORT_MODULE(); +RCT_EXPORT_MODULE(); - - (dispatch_queue_t)methodQueue { - return dispatch_get_main_queue(); - } +- (dispatch_queue_t)methodQueue { + return dispatch_get_main_queue(); +} - + (BOOL)requiresMainQueueSetup { - return NO; - } ++ (BOOL)requiresMainQueueSetup { + return NO; +} #pragma mark - #pragma mark Firebase Config Methods - RCT_EXPORT_METHOD(fetch: - (nonnull - NSNumber *)expirationDuration - activate: (BOOL) activate - resolver:(RCTPromiseResolveBlock)resolve - rejecter:(RCTPromiseRejectBlock)reject) { - FIRRemoteConfigFetchCompletion completionHandler = ^(FIRRemoteConfigFetchStatus status, NSError *__nullable error) { - if (error) { - [RNFBSharedUtils rejectPromiseWithUserInfo:reject userInfo:[@{@"code": convertFIRRemoteConfigFetchStatusToNSString(status), @"message": convertFIRRemoteConfigFetchStatusToNSStringDescription(status)} mutableCopy]]; +RCT_EXPORT_METHOD(fetch: + (nonnull + NSNumber *)expirationDuration + activate: (BOOL) activate + resolver:(RCTPromiseResolveBlock)resolve + rejecter:(RCTPromiseRejectBlock)reject) { + FIRRemoteConfigFetchCompletion completionHandler = ^(FIRRemoteConfigFetchStatus status, NSError *__nullable error) { + if (error) { + [RNFBSharedUtils rejectPromiseWithUserInfo:reject userInfo:[@{ + @"code": convertFIRRemoteConfigFetchStatusToNSString(status), + @"message": convertFIRRemoteConfigFetchStatusToNSStringDescription(status)} mutableCopy]]; + } else { + if (activate) { + resolve(@([[FIRRemoteConfig remoteConfig] activateFetched])); } else { - if (activate) { - resolve(@([[FIRRemoteConfig remoteConfig] activateFetched])); - } else { - resolve([NSNull null]); - } + resolve([NSNull null]); } - }; - - if (expirationDuration == @(-1)) { - [[FIRRemoteConfig remoteConfig] fetchWithExpirationDuration:expirationDuration.doubleValue completionHandler:completionHandler]; - } else { - [[FIRRemoteConfig remoteConfig] fetchWithCompletionHandler:completionHandler]; } - } + }; - RCT_EXPORT_METHOD(activateFetched: - (RCTPromiseResolveBlock) resolve - rejecter: - (RCTPromiseRejectBlock) reject) { - BOOL status = [[FIRRemoteConfig remoteConfig] activateFetched]; - resolve(@(status)); + if (expirationDuration == @(-1)) { + [[FIRRemoteConfig remoteConfig] fetchWithExpirationDuration:expirationDuration.doubleValue completionHandler:completionHandler]; + } else { + [[FIRRemoteConfig remoteConfig] fetchWithCompletionHandler:completionHandler]; } +} - RCT_EXPORT_METHOD(getConfigSettings: - (RCTPromiseResolveBlock) resolve - rejecter: - (RCTPromiseRejectBlock) reject) { - resolve([self getConfigSettings]); - } +RCT_EXPORT_METHOD(activateFetched: + (RCTPromiseResolveBlock) resolve + rejecter: + (RCTPromiseRejectBlock) reject) { + BOOL status = [[FIRRemoteConfig remoteConfig] activateFetched]; + resolve(@(status)); +} - RCT_EXPORT_METHOD(getValue: - (NSString *) key - resolver: - (RCTPromiseResolveBlock) resolve - rejecter: - (RCTPromiseRejectBlock) reject) { +RCT_EXPORT_METHOD(getConfigSettings: + (RCTPromiseResolveBlock) resolve + rejecter: + (RCTPromiseRejectBlock) reject) { + resolve([self getConfigSettings]); +} + +RCT_EXPORT_METHOD(getValue: + (NSString *) key + resolver: + (RCTPromiseResolveBlock) resolve + rejecter: + (RCTPromiseRejectBlock) reject) { + FIRRemoteConfigValue *value = [[FIRRemoteConfig remoteConfig] configValueForKey:key]; + resolve(convertFIRRemoteConfigValueToNSDictionary(value)); +} + +RCT_EXPORT_METHOD(getValues: + (NSArray *) keys + resolver: + (RCTPromiseResolveBlock) resolve + rejecter: + (RCTPromiseRejectBlock) reject) { + NSMutableArray *valuesArray = [[NSMutableArray alloc] init]; + + for (NSString *key in keys) { FIRRemoteConfigValue *value = [[FIRRemoteConfig remoteConfig] configValueForKey:key]; - resolve(convertFIRRemoteConfigValueToNSDictionary(value)); + [valuesArray addObject:convertFIRRemoteConfigValueToNSDictionary(value)]; } - RCT_EXPORT_METHOD(getValues: - (NSArray *) keys - resolver: - (RCTPromiseResolveBlock) resolve - rejecter: - (RCTPromiseRejectBlock) reject) { - NSMutableArray *valuesArray = [[NSMutableArray alloc] init]; + resolve(valuesArray); +} - for (NSString *key in keys) { - FIRRemoteConfigValue *value = [[FIRRemoteConfig remoteConfig] configValueForKey:key]; - [valuesArray addObject:convertFIRRemoteConfigValueToNSDictionary(value)]; - } +RCT_EXPORT_METHOD(setConfigSettings: + (NSDictionary *) configSettings + resolver: + (RCTPromiseResolveBlock) resolve + rejecter: + (RCTPromiseRejectBlock) reject) { + FIRRemoteConfigSettings *remoteConfigSettings = + [[FIRRemoteConfigSettings alloc] initWithDeveloperModeEnabled:[configSettings[@"isDeveloperModeEnabled"] boolValue]]; + [FIRRemoteConfig remoteConfig].configSettings = remoteConfigSettings; + resolve([self getConfigSettings]); +} - resolve(valuesArray); +RCT_EXPORT_METHOD(getKeysByPrefix: + (NSString *) prefix + resolver: + (RCTPromiseResolveBlock) resolve + rejecter: + (RCTPromiseRejectBlock) reject) { + NSSet *keys = [[FIRRemoteConfig remoteConfig] keysWithPrefix:prefix]; + + NSMutableArray *keysArray = [[NSMutableArray alloc] init]; + for (NSString *key in keys) { + [keysArray addObject:key]; } - RCT_EXPORT_METHOD(setConfigSettings: - (NSDictionary *) configSettings - resolver: - (RCTPromiseResolveBlock) resolve - rejecter: - (RCTPromiseRejectBlock) reject) { - FIRRemoteConfigSettings *remoteConfigSettings = [[FIRRemoteConfigSettings alloc] initWithDeveloperModeEnabled:[configSettings[@"isDeveloperModeEnabled"] boolValue]]; - [FIRRemoteConfig remoteConfig].configSettings = remoteConfigSettings; - resolve([self getConfigSettings]); + resolve(keysArray); +} + +RCT_EXPORT_METHOD(getValuesByKeysPrefix: + (NSString *) prefix + resolver: + (RCTPromiseResolveBlock) resolve + rejecter: + (RCTPromiseRejectBlock) reject) { + NSSet *keys = [[FIRRemoteConfig remoteConfig] keysWithPrefix:prefix]; + NSMutableDictionary *mutableDictionary = [NSMutableDictionary dictionary]; + + for (NSString *key in keys) { + FIRRemoteConfigValue *value = [[FIRRemoteConfig remoteConfig] configValueForKey:key]; + mutableDictionary[key] = convertFIRRemoteConfigValueToNSDictionary(value); } - RCT_EXPORT_METHOD(getKeysByPrefix: - (NSString *) prefix - resolver: - (RCTPromiseResolveBlock) resolve - rejecter: - (RCTPromiseRejectBlock) reject) { - NSSet *keys = [[FIRRemoteConfig remoteConfig] keysWithPrefix:prefix]; + resolve(mutableDictionary); +} - NSMutableArray *keysArray = [[NSMutableArray alloc] init]; - for (NSString *key in keys) { - [keysArray addObject:key]; - } +RCT_EXPORT_METHOD(setDefaults: + (NSDictionary *) defaults + resolver: + (RCTPromiseResolveBlock) resolve + rejecter: + (RCTPromiseRejectBlock) reject +) { + [[FIRRemoteConfig remoteConfig] setDefaults:defaults]; + resolve([NSNull null]); +} - resolve(keysArray); - } - - RCT_EXPORT_METHOD(getValuesByKeysPrefix: - (NSString *) prefix - resolver: - (RCTPromiseResolveBlock) resolve - rejecter: - (RCTPromiseRejectBlock) reject) { - NSSet *keys = [[FIRRemoteConfig remoteConfig] keysWithPrefix:prefix]; - NSMutableDictionary *mutableDictionary = [NSMutableDictionary dictionary]; - - for (NSString *key in keys) { - FIRRemoteConfigValue *value = [[FIRRemoteConfig remoteConfig] configValueForKey:key]; - mutableDictionary[key] = convertFIRRemoteConfigValueToNSDictionary(value); - } - - resolve(mutableDictionary); - } - - RCT_EXPORT_METHOD(setDefaults: - (NSDictionary *) defaults - resolver: - (RCTPromiseResolveBlock) resolve - rejecter: - (RCTPromiseRejectBlock) reject - ) { - [[FIRRemoteConfig remoteConfig] setDefaults:defaults]; +RCT_EXPORT_METHOD(setDefaultsFromResource: + (NSString *) fileName + resolver: + (RCTPromiseResolveBlock) resolve + rejecter: + (RCTPromiseRejectBlock) reject) { + if ([[NSBundle mainBundle] pathForResource:fileName ofType:@"plist"] != nil) { + [[FIRRemoteConfig remoteConfig] setDefaultsFromPlistFileName:fileName]; resolve([NSNull null]); + } else { + [RNFBSharedUtils rejectPromiseWithUserInfo:reject userInfo:[@{@"code": @"resource_not_found", + @"message": @"The specified resource name was not found."} mutableCopy]]; } - - RCT_EXPORT_METHOD(setDefaultsFromResource: - (NSString *) fileName - resolver: - (RCTPromiseResolveBlock) resolve - rejecter: - (RCTPromiseRejectBlock) reject) { - if ([[NSBundle mainBundle] pathForResource:fileName ofType:@"plist"] != nil) { - [[FIRRemoteConfig remoteConfig] setDefaultsFromPlistFileName:fileName]; - resolve([NSNull null]); - } else { - [RNFBSharedUtils rejectPromiseWithUserInfo:reject userInfo:[@{@"code": @"resource_not_found", @"message": @"The specified resource name was not found."} mutableCopy]]; - } - } +} #pragma mark - #pragma mark Internal Helper Methods - - - (NSDictionary *)getConfigSettings { - FIRRemoteConfig *remoteConfig = [FIRRemoteConfig remoteConfig]; - BOOL isDeveloperModeEnabled = [RCTConvert BOOL:@([remoteConfig configSettings].isDeveloperModeEnabled)]; - NSString *lastFetchStatus = convertFIRRemoteConfigFetchStatusToNSString(remoteConfig.lastFetchStatus); - NSDate *lastFetchTime = remoteConfig.lastFetchTime; - return @{ - @"isDeveloperModeEnabled": @(isDeveloperModeEnabled), - @"lastFetchTime": @(round([lastFetchTime timeIntervalSince1970])), - @"lastFetchStatus": lastFetchStatus - }; - } +- (NSDictionary *)getConfigSettings { + FIRRemoteConfig *remoteConfig = [FIRRemoteConfig remoteConfig]; + BOOL isDeveloperModeEnabled = [RCTConvert BOOL:@([remoteConfig configSettings].isDeveloperModeEnabled)]; + NSString *lastFetchStatus = convertFIRRemoteConfigFetchStatusToNSString(remoteConfig.lastFetchStatus); + NSDate *lastFetchTime = remoteConfig.lastFetchTime; + return @{ + @"isDeveloperModeEnabled": @(isDeveloperModeEnabled), + @"lastFetchTime": @(round([lastFetchTime timeIntervalSince1970] * 1000.0)), + @"lastFetchStatus": lastFetchStatus + }; +} @end diff --git a/packages/config/lib/index.d.ts b/packages/config/lib/index.d.ts index f26a9416..302eac3c 100644 --- a/packages/config/lib/index.d.ts +++ b/packages/config/lib/index.d.ts @@ -22,9 +22,38 @@ import { } from '@react-native-firebase/app-types'; /** - * Firebase Remote Config is a cloud service that lets you change the behavior and appearance of your - * app without requiring users to download an app update. When using Remote Config, you create in-app default - * values that control the behavior and appearance of your app. + * Firebase Remote Config package for React Native. + * + * #### Example 1 + * + * Access the firebase export from the `config` package: + * + * ```js + * import { firebase } from '@react-native-firebase/config'; + * + * // firebase.config().X + * ``` + * + * #### Example 2 + * + * Using the default export from the `config` package: + * + * ```js + * import config from '@react-native-firebase/config'; + * + * // config().X + * ``` + * + * #### Example 3 + * + * Using the default export from the `app` package: + * + * ```js + * import firebase from '@react-native-firebase/app'; + * import '@react-native-firebase/config'; + * + * // firebase.config().X + * ``` * * @firebase config */ @@ -146,7 +175,20 @@ export namespace Config { [key: string]: number | string | boolean; } - export interface Module extends ReactNativeFirebaseModule { + /** + * The Firebase Remote Config service interface. + * + * > This module is available for the default app only. + * + * #### Example + * + * Get the Remote Config service for the default app: + * + * ```js + * const defaultAppRemoteConfig = firebase.config(); + * ``` + */ + export class Module extends ReactNativeFirebaseModule { /** * Moves fetched data to the apps active config. * Resolves with a boolean value of whether the fetched config was moved successfully. diff --git a/packages/crashlytics/android/build.gradle b/packages/crashlytics/android/build.gradle index a253d37d..9b389ba3 100644 --- a/packages/crashlytics/android/build.gradle +++ b/packages/crashlytics/android/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.4.0' } } diff --git a/packages/crashlytics/android/src/main/java/io/invertase/firebase/crashlytics/ReactNativeFirebaseCrashlyticsInitProvider.java b/packages/crashlytics/android/src/main/java/io/invertase/firebase/crashlytics/ReactNativeFirebaseCrashlyticsInitProvider.java index 44589070..d679201d 100644 --- a/packages/crashlytics/android/src/main/java/io/invertase/firebase/crashlytics/ReactNativeFirebaseCrashlyticsInitProvider.java +++ b/packages/crashlytics/android/src/main/java/io/invertase/firebase/crashlytics/ReactNativeFirebaseCrashlyticsInitProvider.java @@ -34,7 +34,6 @@ import static io.invertase.firebase.crashlytics.Constants.KEY_CRASHLYTICS_AUTO_C import static io.invertase.firebase.crashlytics.Constants.KEY_CRASHLYTICS_DEBUG_ENABLED; import static io.invertase.firebase.crashlytics.Constants.KEY_CRASHLYTICS_NDK_ENABLED; -@SuppressWarnings("NullableProblems") public class ReactNativeFirebaseCrashlyticsInitProvider extends ReactNativeFirebaseInitProvider { private static final String TAG = "RNFBCrashlyticsInit"; @@ -72,14 +71,14 @@ public class ReactNativeFirebaseCrashlyticsInitProvider extends ReactNativeFireb try { Fabric.Builder builder = new Fabric.Builder(getContext()); - CrashlyticsCore crashlyticsCore = new CrashlyticsCore.Builder() - .disabled(false) + Crashlytics crashlyticsCore = new Crashlytics.Builder() + .core(new CrashlyticsCore.Builder().disabled(!debug && BuildConfig.DEBUG).build()) .build(); if (useNdk) { - builder.kits(new Crashlytics.Builder().core(crashlyticsCore).build(), new CrashlyticsNdk()); + builder.kits(crashlyticsCore, new CrashlyticsNdk()); } else { - builder.kits(new Crashlytics.Builder().core(crashlyticsCore).build()); + builder.kits(crashlyticsCore); } builder.debuggable(debug); diff --git a/packages/crashlytics/ios/RNFBCrashlytics.podspec b/packages/crashlytics/ios/RNFBCrashlytics.podspec index 40f723da..7c45fdb8 100644 --- a/packages/crashlytics/ios/RNFBCrashlytics.podspec +++ b/packages/crashlytics/ios/RNFBCrashlytics.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| s.platform = :ios, "10.0" s.source_files = 'RNFBCrashlytics/**/*.{h,m}' s.dependency 'React' - s.dependency 'Firebase/Core', '~> 5.19.0' + s.dependency 'Firebase/Core', '~> 5.20.2' s.dependency 'Fabric', '~> 1.9.0' s.dependency 'Crashlytics', '~> 3.12.0' s.dependency 'RNFBApp' diff --git a/packages/crashlytics/lib/index.d.ts b/packages/crashlytics/lib/index.d.ts index 7417206b..04f77dc7 100644 --- a/packages/crashlytics/lib/index.d.ts +++ b/packages/crashlytics/lib/index.d.ts @@ -22,15 +22,58 @@ import { } from '@react-native-firebase/app-types'; /** - * Firebase Crashlytics helps you track, prioritize, and fix stability issues that erode app quality, in realtime. - * Spend less time triaging and troubleshooting crashes and more time building app features that delight users. + * Firebase Crashlytics package for React Native. + * + * #### Example 1 + * + * Access the firebase export from the `crashlytics` package: + * + * ```js + * import { firebase } from '@react-native-firebase/crashlytics'; + * + * // firebase.crashlytics().X + * ``` + * + * #### Example 2 + * + * Using the default export from the `crashlytics` package: + * + * ```js + * import crashlytics from '@react-native-firebase/crashlytics'; + * + * // crashlytics().X + * ``` + * + * #### Example 3 + * + * Using the default export from the `app` package: + * + * ```js + * import firebase from '@react-native-firebase/app'; + * import '@react-native-firebase/crashlytics'; + * + * // firebase.crashlytics().X + * ``` * * @firebase crashlytics */ export namespace Crashlytics { export interface Statics {} - export interface Module extends ReactNativeFirebaseModule { + /** + * The Firebase Crashlytics service interface. + * + * > This module is available for the default app only. + * + * #### Example + * + * Get the Crashlytics service for the default app: + * + * ```js + * const defaultAppCrashlytics = firebase.crashlytics(); + * ``` + */ + export class Module extends ReactNativeFirebaseModule { /** * Whether Crashlytics reporting is enabled. * diff --git a/packages/fiam/android/build.gradle b/packages/fiam/android/build.gradle index 31f44af4..a9aac64d 100644 --- a/packages/fiam/android/build.gradle +++ b/packages/fiam/android/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.4.0' } } diff --git a/packages/fiam/ios/RNFBFiam.podspec b/packages/fiam/ios/RNFBFiam.podspec index 34bf5aae..714ca437 100644 --- a/packages/fiam/ios/RNFBFiam.podspec +++ b/packages/fiam/ios/RNFBFiam.podspec @@ -16,8 +16,8 @@ Pod::Spec.new do |s| s.platform = :ios, "10.0" s.source_files = 'RNFBFiam/**/*.{h,m}' s.dependency 'React' - s.dependency 'Firebase/Core', '~> 5.19.0' - s.dependency 'Firebase/InAppMessagingDisplay', '~> 5.19.0' + s.dependency 'Firebase/Core', '~> 5.20.2' + s.dependency 'Firebase/InAppMessagingDisplay', '~> 5.20.2' s.dependency 'RNFBApp' s.static_framework = true end diff --git a/packages/fiam/lib/index.d.ts b/packages/fiam/lib/index.d.ts index 84d3f99c..f208c738 100644 --- a/packages/fiam/lib/index.d.ts +++ b/packages/fiam/lib/index.d.ts @@ -22,16 +22,58 @@ import { } from '@react-native-firebase/app-types'; /** - * Firebase In-App Messaging helps you engage users who are actively using your app by sending - * them targeted and contextual messages that nudge them to complete key in-app actions - like - * beating a game level, buying an item, or subscribing to content. + * Firebase In-App Messaging package for React Native. + * + * #### Example 1 + * + * Access the firebase export from the `fiam` package: + * + * ```js + * import { firebase } from '@react-native-firebase/fiam'; + * + * // firebase.fiam().X + * ``` + * + * #### Example 2 + * + * Using the default export from the `fiam` package: + * + * ```js + * import fiam from '@react-native-firebase/fiam'; + * + * // fiam().X + * ``` + * + * #### Example 3 + * + * Using the default export from the `app` package: + * + * ```js + * import firebase from '@react-native-firebase/app'; + * import '@react-native-firebase/fiam'; + * + * // firebase.fiam().X + * ``` * * @firebase fiam */ export namespace Fiam { export interface Statics {} - export interface Module extends ReactNativeFirebaseModule { + /** + * The Firebase In-App Messaging service interface. + * + * > This module is available for the default app only. + * + * #### Example + * + * Get the In-App Messaging service for the default app: + * + * ```js + * const defaultAppFiam = firebase.fiam(); + * ``` + */ + export class Module extends ReactNativeFirebaseModule { /** * Determines whether messages are suppressed or not. * diff --git a/packages/fiam/package.json b/packages/fiam/package.json index eac4c739..454b9640 100644 --- a/packages/fiam/package.json +++ b/packages/fiam/package.json @@ -27,7 +27,7 @@ "fiam" ], "peerDependencies": { - "@react-native-firebase/app": "6.0.0-alpha.4" + "@react-native-firebase/app": "6.0.0-alpha.9" }, "dependencies": { "@react-native-firebase/app-types": "6.0.0-alpha.9", diff --git a/packages/firestore/android/build.gradle b/packages/firestore/android/build.gradle index 77181a8c..4b104af1 100644 --- a/packages/firestore/android/build.gradle +++ b/packages/firestore/android/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.4.0' } } diff --git a/packages/firestore/ios/RNFBFirestore.podspec b/packages/firestore/ios/RNFBFirestore.podspec index 8b2a476d..718da705 100644 --- a/packages/firestore/ios/RNFBFirestore.podspec +++ b/packages/firestore/ios/RNFBFirestore.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| s.platform = :ios, "10.0" s.source_files = 'RNFBFirestore/**/*.{h,m}' s.dependency 'React' - s.dependency 'Firebase/Core', '~> 5.19.0' + s.dependency 'Firebase/Core', '~> 5.20.2' s.dependency 'RNFBApp' s.static_framework = true end diff --git a/packages/firestore/lib/index.d.ts b/packages/firestore/lib/index.d.ts index 2a1e5a22..759651db 100644 --- a/packages/firestore/lib/index.d.ts +++ b/packages/firestore/lib/index.d.ts @@ -22,14 +22,66 @@ import { } from '@react-native-firebase/app-types'; /** - * Firestore + * Firebase Cloud Firestore package for React Native. + * + * #### Example 1 + * + * Access the firebase export from the `firestore` package: + * + * ```js + * import { firebase } from '@react-native-firebase/firestore'; + * + * // firebase.firestore().X + * ``` + * + * #### Example 2 + * + * Using the default export from the `firestore` package: + * + * ```js + * import firestore from '@react-native-firebase/firestore'; + * + * // firestore().X + * ``` + * + * #### Example 3 + * + * Using the default export from the `app` package: + * + * ```js + * import firebase from '@react-native-firebase/app'; + * import '@react-native-firebase/firestore'; + * + * // firebase.firestore().X + * ``` * * @firebase firestore */ export namespace Firestore { export interface Statics {} - export interface Module extends ReactNativeFirebaseModule { + /** + * The Firebase Cloud Firestore service is available for the default app or a given app. + * + * #### Example 1 + * + * Get the firestore instance for the **default app**: + * + * ```js + * const firestoreForDefaultApp = firebase.firestore(); + * ``` + * + * #### Example 2 + * + * Get the firestore instance for a **secondary app**: + * + * ```js + * const otherApp = firebase.app('otherApp'); + * const firestoreForOtherApp = firebase.firestore(otherApp); + * ``` + * + */ + export class Module extends ReactNativeFirebaseModule { } } diff --git a/packages/functions/android/build.gradle b/packages/functions/android/build.gradle index 871d5360..34b29666 100644 --- a/packages/functions/android/build.gradle +++ b/packages/functions/android/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.4.0' } } diff --git a/packages/functions/ios/RNFBFunctions.podspec b/packages/functions/ios/RNFBFunctions.podspec index 209eb404..f7e7f108 100644 --- a/packages/functions/ios/RNFBFunctions.podspec +++ b/packages/functions/ios/RNFBFunctions.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| s.platform = :ios, "10.0" s.source_files = 'RNFBFunctions/**/*.{h,m}' s.dependency 'React' - s.dependency 'Firebase/Functions', '~> 5.19.0' + s.dependency 'Firebase/Functions', '~> 5.20.2' s.dependency 'RNFBApp' s.static_framework = true end diff --git a/packages/functions/lib/index.d.ts b/packages/functions/lib/index.d.ts index 9b2a76d0..f014fdf3 100644 --- a/packages/functions/lib/index.d.ts +++ b/packages/functions/lib/index.d.ts @@ -22,10 +22,38 @@ import { } from '@react-native-firebase/app-types'; /** - * The Cloud Functions for Firebase client SDKs let you call functions - * directly from a Firebase app. To call a function from your app in this way, - * write and deploy an HTTPS Callable function in Cloud Functions, - * and then add client logic to call the function from your app. + * Firebase Cloud Functions package for React Native. + * + * #### Example 1 + * + * Access the firebase export from the `functions` package: + * + * ```js + * import { firebase } from '@react-native-firebase/functions'; + * + * // firebase.functions().X + * ``` + * + * #### Example 2 + * + * Using the default export from the `functions` package: + * + * ```js + * import functions from '@react-native-firebase/functions'; + * + * // functions().X + * ``` + * + * #### Example 3 + * + * Using the default export from the `app` package: + * + * ```js + * import firebase from '@react-native-firebase/app'; + * import '@react-native-firebase/functions'; + * + * // firebase.functions().X + * ``` * * @firebase functions */ @@ -218,7 +246,7 @@ export namespace Functions { */ export interface Statics { /** - * Uppercase + underscored variables of @Functions.FunctionsErrorCode + * Uppercase + underscored variables of {@link functions.FunctionsErrorCode} * * #### Example * @@ -227,13 +255,45 @@ export namespace Functions { * firebase.functions.HttpsErrorCode.NOT_FOUND; * ``` */ - HttpsErrorCode: {} & HttpsErrorCode; + HttpsErrorCode: HttpsErrorCode; } /** - * firebase.functions().X + * The Firebase Cloud Functions service is available for the default app, a given app or a specified region. + * + * > The default functions region for all apps is `us-central1`. + * + * #### Example 1 + * + * Get the functions instance for the **default app**: + * + * ```js + * const functionsForDefaultApp = firebase.functions(); + * ``` + * + * #### Example 2 + * + * Get the functions instance for a **secondary app**: + * + * ```js + * const otherApp = firebase.app('otherApp'); + * const functionsForOtherApp = firebase.functions(otherApp); + * ``` + * + * #### Example 3 + * + * Get the functions instance for a **specific functions region**: + * + * ```js + * const defaultApp = firebase.app(); + * const functionsForRegion = defaultApp.functions('europe-west1'); + * + * const otherApp = firebase.app('otherApp'); + * const functionsForOtherAppRegion = otherApp.functions('europe-west1'); + * ``` + * */ - export interface Module extends ReactNativeFirebaseModule { + export class Module extends ReactNativeFirebaseModule { /** * Gets an `HttpsCallable` instance that refers to the function with the given * name. diff --git a/packages/iid/android/build.gradle b/packages/iid/android/build.gradle index d84d204a..0395c98c 100644 --- a/packages/iid/android/build.gradle +++ b/packages/iid/android/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.4.0' } } @@ -29,7 +29,7 @@ project.ext { ], firebase : [ - iid: "17.1.1" + iid: "17.1.2" ], ], ]) diff --git a/packages/iid/ios/RNFBIid.podspec b/packages/iid/ios/RNFBIid.podspec index ae5449d9..75a5087c 100644 --- a/packages/iid/ios/RNFBIid.podspec +++ b/packages/iid/ios/RNFBIid.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| s.platform = :ios, "10.0" s.source_files = 'RNFBIid/**/*.{h,m}' s.dependency 'React' - s.dependency 'Firebase/Core', '~> 5.19.0' + s.dependency 'Firebase/Core', '~> 5.20.2' s.dependency 'RNFBApp' s.static_framework = true end diff --git a/packages/iid/lib/index.d.ts b/packages/iid/lib/index.d.ts index a63b172b..509dd27f 100644 --- a/packages/iid/lib/index.d.ts +++ b/packages/iid/lib/index.d.ts @@ -22,18 +22,58 @@ import { } from '@react-native-firebase/app-types'; /** - * Firebase Instance ID provides a unique identifier for each instance of your app and a mechanism to authenticate - * and authorize actions for it (for example: sending FCM messages). + * Firebase Instance ID package for React Native. * - * An Instance ID is long lived except when you call delete, the app is restored on a new device, the user - * uninstalls/reinstall the app or the user clears the app data (clearing data applies to Android only). + * #### Example 1 + * + * Access the firebase export from the `iid` package: + * + * ```js + * import { firebase } from '@react-native-firebase/iid'; + * + * // firebase.iid().X + * ``` + * + * #### Example 2 + * + * Using the default export from the `iid` package: + * + * ```js + * import iid from '@react-native-firebase/iid'; + * + * // iid().X + * ``` + * + * #### Example 3 + * + * Using the default export from the `app` package: + * + * ```js + * import firebase from '@react-native-firebase/app'; + * import '@react-native-firebase/iid'; + * + * // firebase.iid().X + * ``` * * @firebase iid */ export namespace Iid { export interface Statics {} - export interface Module extends ReactNativeFirebaseModule { + /** + * The Firebase Instance ID service interface. + * + * > This module is available for the default app only. + * + * #### Example + * + * Get the Instance ID service for the default app: + * + * ```js + * const defaultAppIid = firebase.iid(); + * ``` + */ + export class Module extends ReactNativeFirebaseModule { /** * Returns a identifier that uniquely identifies the app instance. * diff --git a/packages/invites/android/build.gradle b/packages/invites/android/build.gradle index 79f9354e..4be14a1b 100644 --- a/packages/invites/android/build.gradle +++ b/packages/invites/android/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.4.0' } } diff --git a/packages/invites/ios/RNFBInvites.podspec b/packages/invites/ios/RNFBInvites.podspec index 00dddbbe..b291ca20 100644 --- a/packages/invites/ios/RNFBInvites.podspec +++ b/packages/invites/ios/RNFBInvites.podspec @@ -16,8 +16,8 @@ Pod::Spec.new do |s| s.platform = :ios, "10.0" s.source_files = 'RNFBInvites/**/*.{h,m}' s.dependency 'React' - s.dependency 'Firebase/Core', '~> 5.19.0' - s.dependency 'Firebase/Invites', '~> 5.19.0' + s.dependency 'Firebase/Core', '~> 5.20.2' + s.dependency 'Firebase/Invites', '~> 5.20.2' s.dependency 'RNFBApp' s.static_framework = true end diff --git a/packages/invites/lib/index.d.ts b/packages/invites/lib/index.d.ts index b67a1ddd..585cff57 100644 --- a/packages/invites/lib/index.d.ts +++ b/packages/invites/lib/index.d.ts @@ -22,9 +22,38 @@ import { } from '@react-native-firebase/app-types'; /** - * Firebase Invites is deprecated. You can create cross-platform invitation links that survive app installation using Firebase Dynamic Links instead. - * Firebase Invites are an out-of-the-box solution for app referrals and sharing via email or SMS. - * To customize the invitation user experience, or to generate links programmatically, use Firebase Dynamic Links. + * Firebase Invites package for React Native. + * + * #### Example 1 + * + * Access the firebase export from the `invites` package: + * + * ```js + * import { firebase } from '@react-native-firebase/invites'; + * + * // firebase.invites().X + * ``` + * + * #### Example 2 + * + * Using the default export from the `invites` package: + * + * ```js + * import invites from '@react-native-firebase/invites'; + * + * // invites().X + * ``` + * + * #### Example 3 + * + * Using the default export from the `app` package: + * + * ```js + * import firebase from '@react-native-firebase/app'; + * import '@react-native-firebase/invites'; + * + * // firebase.invites().X + * ``` * * @firebase invites */ @@ -58,7 +87,7 @@ export namespace Invites { /** * Android Invite representation. Instance is returned from {@link links.InviteBuilder#android}. */ - export interface AndroidInviteBuilder { + export class AndroidInviteBuilder { /** * Adds query parameters to the play store referral URL when the app needs additional referral parameters for other * application component referrals. These parameters are added to the referral URL sent from the play store and are @@ -136,7 +165,7 @@ export namespace Invites { /** * Invite builder representation returned from {@link invites#createInvitation}. */ - export interface InviteBuilder { + export class InviteBuilder { /** * Set Android specific Invite properties * @@ -293,7 +322,20 @@ export namespace Invites { */ export type InviteListener = (nativeInvite: NativeInvite) => void; - export interface Module extends ReactNativeFirebaseModule { + /** + * The Firebase Invites service interface. + * + * > This module is available for the default app only. + * + * #### Example + * + * Get the Invites service for the default app: + * + * ```js + * const defaultAppInvites = firebase.invites(); + * ``` + */ + export class Module extends ReactNativeFirebaseModule { /** * Create an invitation via an InvitationBuilder instance. * diff --git a/packages/invites/package.json b/packages/invites/package.json index 2e4ba6fb..9b0319fc 100644 --- a/packages/invites/package.json +++ b/packages/invites/package.json @@ -24,7 +24,7 @@ "invites" ], "peerDependencies": { - "@react-native-firebase/app": "6.0.0-alpha.6" + "@react-native-firebase/app": "6.0.0-alpha.9" }, "dependencies": { "@react-native-firebase/app-types": "6.0.0-alpha.9", diff --git a/packages/mlkit/android/build.gradle b/packages/mlkit/android/build.gradle index 430d8df0..b4e3c1b3 100644 --- a/packages/mlkit/android/build.gradle +++ b/packages/mlkit/android/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.4.0' } } diff --git a/packages/mlkit/ios/RNFBMlkit.podspec b/packages/mlkit/ios/RNFBMlkit.podspec index 1a5cc0c0..cbd93999 100644 --- a/packages/mlkit/ios/RNFBMlkit.podspec +++ b/packages/mlkit/ios/RNFBMlkit.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| s.platform = :ios, "10.0" s.source_files = 'RNFBMlkit/**/*.{h,m}' s.dependency 'React' - s.dependency 'Firebase/Core', '~> 5.19.0' + s.dependency 'Firebase/Core', '~> 5.20.2' s.dependency 'RNFBApp' s.static_framework = true end diff --git a/packages/mlkit/lib/index.d.ts b/packages/mlkit/lib/index.d.ts index 9b0a0e88..cde0a030 100644 --- a/packages/mlkit/lib/index.d.ts +++ b/packages/mlkit/lib/index.d.ts @@ -22,14 +22,58 @@ import { } from '@react-native-firebase/app-types'; /** - * Mlkit + * Firebase ML Kit package for React Native. + * + * #### Example 1 + * + * Access the firebase export from the `mlkit` package: + * + * ```js + * import { firebase } from '@react-native-firebase/mlkit'; + * + * // firebase.mlkit().X + * ``` + * + * #### Example 2 + * + * Using the default export from the `mlkit` package: + * + * ```js + * import mlkit from '@react-native-firebase/mlkit'; + * + * // mlkit().X + * ``` + * + * #### Example 3 + * + * Using the default export from the `app` package: + * + * ```js + * import firebase from '@react-native-firebase/app'; + * import '@react-native-firebase/mlkit'; + * + * // firebase.mlkit().X + * ``` * * @firebase mlkit */ export namespace Mlkit { export interface Statics {} - export interface Module extends ReactNativeFirebaseModule { + /** + * The Firebase ML Kit service interface. + * + * > This module is available for the default app only. + * + * #### Example + * + * Get the ML Kit service for the default app: + * + * ```js + * const defaultAppMLKit = firebase.mlkit(); + * ``` + */ + export class Module extends ReactNativeFirebaseModule { } } diff --git a/packages/perf/android/build.gradle b/packages/perf/android/build.gradle index 72571e7b..0c3a1384 100644 --- a/packages/perf/android/build.gradle +++ b/packages/perf/android/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.4.0' } } @@ -29,7 +29,7 @@ project.ext { ], firebase : [ - perf: "16.2.4" + perf: "16.2.5" ], ], ]) diff --git a/packages/perf/ios/RNFBPerf.podspec b/packages/perf/ios/RNFBPerf.podspec index 3b7ef094..b91db4ae 100644 --- a/packages/perf/ios/RNFBPerf.podspec +++ b/packages/perf/ios/RNFBPerf.podspec @@ -16,8 +16,8 @@ Pod::Spec.new do |s| s.platform = :ios, "10.0" s.source_files = 'RNFBPerf/**/*.{h,m}' s.dependency 'React' - s.dependency 'Firebase/Core', '~> 5.19.0' - s.dependency 'Firebase/Performance', '~> 5.19.0' + s.dependency 'Firebase/Core', '~> 5.20.2' + s.dependency 'Firebase/Performance', '~> 5.20.2' s.dependency 'RNFBApp' s.static_framework = true end diff --git a/packages/perf/lib/index.d.ts b/packages/perf/lib/index.d.ts index 749ab5c1..f83f0277 100644 --- a/packages/perf/lib/index.d.ts +++ b/packages/perf/lib/index.d.ts @@ -22,7 +22,38 @@ import { } from '@react-native-firebase/app-types'; /** - * Get insights into how your app performs from your users’ point of view, with automatic and customized performance tracing. + * Firebase Performance Monitoring package for React Native. + * + * #### Example 1 + * + * Access the firebase export from the `perf` package: + * + * ```js + * import { firebase } from '@react-native-firebase/perf'; + * + * // firebase.perf().X + * ``` + * + * #### Example 2 + * + * Using the default export from the `perf` package: + * + * ```js + * import perf from '@react-native-firebase/perf'; + * + * // perf().X + * ``` + * + * #### Example 3 + * + * Using the default export from the `app` package: + * + * ```js + * import firebase from '@react-native-firebase/app'; + * import '@react-native-firebase/perf'; + * + * // firebase.perf().X + * ``` * * @firebase perf */ @@ -50,7 +81,7 @@ export namespace Perf { /** * Trace allows you to time the beginning to end of a certain action in your app with additional metric values and attributes. */ - export interface Trace { + export class Trace { /** * Returns the value of an attribute. Returns null if it does not exist. * @@ -182,7 +213,7 @@ export namespace Perf { /** * Metric used to collect data for network requests/responses. A new instance must be used for every request/response. */ - export interface HttpMetric { + export class HttpMetric { /** * Returns the value of an attribute. Returns null if it does not exist. * @@ -326,7 +357,20 @@ export namespace Perf { export interface Statics {} - export interface Module extends ReactNativeFirebaseModule { + /** + * The Firebase Performance Monitoring service interface. + * + * > This module is available for the default app only. + * + * #### Example + * + * Get the Performance Monitoring service for the default app: + * + * ```js + * const defaultAppPerf = firebase.perf(); + * ``` + */ + export class Module extends ReactNativeFirebaseModule { /** * Determines whether performance monitoring is enabled or disabled. * diff --git a/packages/perf/lib/index.js.flow b/packages/perf/lib/index.js.flow index 7fd0c10b..421e402e 100644 --- a/packages/perf/lib/index.js.flow +++ b/packages/perf/lib/index.js.flow @@ -70,7 +70,7 @@ export interface Trace { * @param attribute Name of the attribute. Max length is 40 chars. * @param value Value of the attribute. Max length is 100 chars. */ - putAttribute(attribute: string, value: string); + putAttribute(attribute: string, value: string): void; /** * Gets the value of the metric with the given name in the current trace. If the metric @@ -116,7 +116,7 @@ export interface Trace { * @param metricName Name of the metric to set. Must not have a leading or trailing whitespace, no leading underscore '_' character and have a max length of 32 characters. * @param value The value the metric should be set to. */ - putMetric(metricName: string, value: number); + putMetric(metricName: string, value: number): void; /** * Increments the named metric by the `incrementBy` value. @@ -130,7 +130,7 @@ export interface Trace { * @param metricName Name of the metric to increment. Must not have a leading or trailing whitespace, no leading underscore '_' character and have a max length of 32 characters. * @param incrementBy The value the metric should be incremented by. */ - incrementMetric(metricName: string, incrementBy: number); + incrementMetric(metricName: string, incrementBy: number): void; /** * Removes a metric by name if it exists. @@ -143,7 +143,7 @@ export interface Trace { * * @param metricName Name of the metric to remove. */ - removeMetric(metricName: string); + removeMetric(metricName: string): void; /** * Marks the start time of the trace. Does nothing if already started. @@ -217,7 +217,7 @@ export interface HttpMetric { * @param attribute Name of the attribute. Max length is 40 chars. * @param value Value of the attribute. Max length is 100 chars. */ - putAttribute(attribute: string, value: string); + putAttribute(attribute: string, value: string): void; /** * Removes an already added attribute. Does nothing if attribute does not exist. @@ -230,7 +230,7 @@ export interface HttpMetric { * * @param attribute Name of the attribute to be removed. */ - removeAttribute(attribute: string); + removeAttribute(attribute: string): void; /** * Sets the httpResponse code of the request. @@ -245,7 +245,7 @@ export interface HttpMetric { * * @param code Value must be greater than 0. Set to null to remove. Invalid usage will be logged natively. */ - setHttpResponseCode(code: number | null); + setHttpResponseCode(code: number | null): void; /** * Sets the size of the request payload. @@ -259,7 +259,7 @@ export interface HttpMetric { * * @param bytes Value must be greater than 0. Set to null to remove. Invalid usage will be logged natively. */ - setRequestPayloadSize(bytes: number | null); + setRequestPayloadSize(bytes: number | null): void; /** * Sets the size of the response payload. @@ -273,7 +273,7 @@ export interface HttpMetric { * * @param bytes Value must be greater than 0. Set to null to remove. Invalid usage will be logged natively. */ - setResponsePayloadSize(bytes: number | null); + setResponsePayloadSize(bytes: number | null): void; /** * Content type of the response e.g. `text/html` or `application/json`. @@ -287,7 +287,7 @@ export interface HttpMetric { * * @param contentType Valid string of MIME type. Set to null to remove. Invalid usage will be logged natively. */ - setResponseContentType(contentType: string | null); + setResponseContentType(contentType: string | null): void; /** * Marks the start time of the request. Does nothing if already started. diff --git a/packages/storage/.npmignore b/packages/storage/.npmignore new file mode 100644 index 00000000..d9fa30e5 --- /dev/null +++ b/packages/storage/.npmignore @@ -0,0 +1,65 @@ +# Built application files +android/*/build/ + +# Crashlytics configuations +android/com_crashlytics_export_strings.xml + +# Local configuration file (sdk path, etc) +android/local.properties + +# Gradle generated files +android/.gradle/ + +# Signing files +android/.signing/ + +# User-specific configurations +android/.idea/gradle.xml +android/.idea/libraries/ +android/.idea/workspace.xml +android/.idea/tasks.xml +android/.idea/.name +android/.idea/compiler.xml +android/.idea/copyright/profiles_settings.xml +android/.idea/encodings.xml +android/.idea/misc.xml +android/.idea/modules.xml +android/.idea/scopes/scope_settings.xml +android/.idea/vcs.xml +android/*.iml + +# Xcode +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 +*.xcuserstate +ios/Pods +ios/build +*project.xcworkspace* +*xcuserdata* + +# OS-specific files +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.dbandroid/gradle +android/gradlew +android/build +android/gradlew.bat +android/gradle/ + +.idea +coverage +yarn.lock +e2e/ +.github +.vscode +.nyc_output +android/.settings +*.coverage.json +.circleci +.eslintignore diff --git a/packages/storage/LICENSE b/packages/storage/LICENSE new file mode 100644 index 00000000..ef3ed44f --- /dev/null +++ b/packages/storage/LICENSE @@ -0,0 +1,32 @@ +Apache-2.0 License +------------------ + +Copyright (c) 2016-present Invertase Limited & Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this library except in compliance with the License. + +You may obtain a copy of the Apache-2.0 License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + + +Creative Commons Attribution 3.0 License +---------------------------------------- + +Copyright (c) 2016-present Invertase Limited & Contributors + +Documentation and other instructional materials provided for this project +(including on a separate documentation repository or it's documentation website) are +licensed under the Creative Commons Attribution 3.0 License. Code samples/blocks +contained therein are licensed under the Apache License, Version 2.0 (the "License"), as above. + +You may obtain a copy of the Creative Commons Attribution 3.0 License at + + https://creativecommons.org/licenses/by/3.0/ diff --git a/packages/storage/README.md b/packages/storage/README.md new file mode 100644 index 00000000..6bade033 --- /dev/null +++ b/packages/storage/README.md @@ -0,0 +1,52 @@ +

+ +
+
+

React Native Firebase - Cloud Storage

+

+ +

+ Coverage + NPM downloads + NPM version + License + Backers on Open Collective + Sponsors on Open Collective + Chat + Follow on Twitter +

+ +---- + +> This is for the upcoming v6.0.0 release of React Native Firebase, please use the [react-native-firebase](https://www.npmjs.com/package/react-native-firebase) package instead, unless you're early adopting/testing the new packages - in which case please use the latest alpha/beta/next tag release on npm and not the `latest` tagged release for this package. + +Cloud Storage for Firebase is a powerful, simple, and cost-effective object storage service built for Google scale. The Firebase SDKs for Cloud Storage add Google security to file uploads and downloads for your Firebase apps, regardless of network quality. You can use our SDKs to store images, audio, video, or other user-generated content. On the server, you can use [Google Cloud Storage](https://cloud.google.com/storage), to access the same files. + +[> Learn More](https://firebase.google.com/products/storage/) + +## Installation + +Requires `@react-native-firebase/app` to be installed. + +```bash +yarn add @react-native-firebase/storage +react-native link @react-native-firebase/storage +``` + +## Documentation + + - [Guides](#TODO) + - [Installation](#TODO) + - [Reference](#TODO) + +## License + +- See [LICENSE](/LICENSE) + +---- + +Built and maintained with 💛 by [Invertase](https://invertase.io). + +- [💼 Hire Us](https://invertase.io/hire-us) +- [☕️ Sponsor Us](https://opencollective.com/react-native-firebase) +- [👩‍💻 Work With Us](https://invertase.io/jobs) diff --git a/packages/storage/android/build.gradle b/packages/storage/android/build.gradle new file mode 100644 index 00000000..7f247f7d --- /dev/null +++ b/packages/storage/android/build.gradle @@ -0,0 +1,66 @@ +buildscript { + repositories { + google() + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:3.4.0' + } +} + +plugins { + id "io.invertase.gradle.build" version "1.3" +} + +project.ext { + set('react-native', [ + versions: [ + android : [ + minSdk : 16, + targetSdk : 28, + compileSdk: 28, + // optional as gradle.buildTools comes with one by default + // overriding here though to match the version RN uses + buildTools: "28.0.3" + ], + + googlePlayServices: [ + base: "16.1.0", + ], + + firebase : [ + storage: "16.1.0" + ], + ], + ]) +} + +android { + defaultConfig { + multiDexEnabled true + } + lintOptions { + disable 'GradleCompatible' + abortOnError false + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +repositories { + google() + jcenter() +} + +dependencies { + api project(':@react-native-firebase_app') + implementation "com.google.firebase:firebase-storage:${ReactNative.ext.getVersion("firebase", "storage")}" + implementation "com.google.android.gms:play-services-base:${ReactNative.ext.getVersion("googlePlayServices", "base")}" +} + +ReactNative.shared.applyPackageVersion() +ReactNative.shared.applyDefaultExcludes() +ReactNative.module.applyAndroidVersions() +ReactNative.module.applyReactNativeDependency("api") diff --git a/packages/storage/android/gradle.properties b/packages/storage/android/gradle.properties new file mode 100644 index 00000000..2d8d1e4d --- /dev/null +++ b/packages/storage/android/gradle.properties @@ -0,0 +1 @@ +android.useAndroidX=true \ No newline at end of file diff --git a/packages/storage/android/gradle/wrapper/gradle-wrapper.properties b/packages/storage/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..5c8a6d6f --- /dev/null +++ b/packages/storage/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue Oct 09 01:55:27 BST 2018 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/packages/storage/android/gradlew b/packages/storage/android/gradlew new file mode 100644 index 00000000..9d82f789 --- /dev/null +++ b/packages/storage/android/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/packages/storage/android/gradlew.bat b/packages/storage/android/gradlew.bat new file mode 100644 index 00000000..8a0b282a --- /dev/null +++ b/packages/storage/android/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/storage/android/lint.xml b/packages/storage/android/lint.xml new file mode 100644 index 00000000..c3dd72ac --- /dev/null +++ b/packages/storage/android/lint.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/storage/android/settings.gradle b/packages/storage/android/settings.gradle new file mode 100644 index 00000000..27b1deeb --- /dev/null +++ b/packages/storage/android/settings.gradle @@ -0,0 +1 @@ +rootProject.name = '@react-native-firebase_storage' diff --git a/packages/storage/android/src/main/AndroidManifest.xml b/packages/storage/android/src/main/AndroidManifest.xml new file mode 100644 index 00000000..e2309117 --- /dev/null +++ b/packages/storage/android/src/main/AndroidManifest.xml @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStorageCommon.java b/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStorageCommon.java new file mode 100644 index 00000000..d988c85e --- /dev/null +++ b/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStorageCommon.java @@ -0,0 +1,291 @@ +package io.invertase.firebase.storage; + +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import android.content.ContentResolver; +import android.content.Context; +import android.net.Uri; +import android.os.Environment; +import android.util.Log; +import android.webkit.MimeTypeMap; + +import com.facebook.react.bridge.Arguments; +import com.facebook.react.bridge.Promise; +import com.facebook.react.bridge.ReadableMap; +import com.facebook.react.bridge.WritableMap; +import com.google.firebase.storage.StorageException; +import com.google.firebase.storage.StorageMetadata; +import com.google.firebase.storage.StorageTask; + +import java.util.Map; +import java.util.Objects; + +import javax.annotation.Nullable; + +import io.invertase.firebase.app.ReactNativeFirebaseApp; +import io.invertase.firebase.common.SharedUtils; + +import static io.invertase.firebase.common.ReactNativeFirebaseModule.rejectPromiseWithCodeAndMessage; + +class ReactNativeFirebaseStorageCommon { + static final String STATUS_CANCELLED = "cancelled"; + static final String STATUS_ERROR = "error"; + private static final String KEY_CUSTOM_META = "customMetadata"; + private static final String KEY_CACHE_CONTROL = "cacheControl"; + private static final String KEY_CONTENT_ENCODING = "contentEncoding"; + private static final String KEY_CONTENT_LANG = "contentLanguage"; + private static final String KEY_CONTENT_DISPOSITION = "contentDisposition"; + private static final String KEY_CONTENT_TYPE = "contentType"; + private static final String KEY_BUCKET = "bucket"; + private static final String KEY_GENERATION = "generation"; + private static final String KEY_META_GENERATION = "metageneration"; + private static final String KEY_FULL_PATH = "fullPath"; + private static final String KEY_NAME = "name"; + private static final String KEY_SIZE = "size"; + private static final String KEY_TIME_CREATED = "timeCreated"; + private static final String KEY_UPDATED = "updated"; + private static final String KEY_MD5_HASH = "md5Hash"; + private static final String STATUS_UNKNOWN = "unknown"; + private static final String STATUS_RUNNING = "running"; + private static final String STATUS_PAUSED = "paused"; + private static final String STATUS_SUCCESS = "success"; + private static final String CODE_OBJECT_NOT_FOUND = "object-not-found"; + private static final String CODE_FILE_NOT_FOUND = "file-not-found"; + private static final String CODE_BUCKET_NOT_FOUND = "bucket-not-found"; + private static final String CODE_PROJECT_NOT_FOUND = "project-not-found"; + private static final String CODE_QUOTA_EXCEEDED = "quota-exceeded"; + private static final String CODE_UNAUTHENTICATED = "unauthenticated"; + private static final String CODE_UNAUTHORIZED = "unauthorized"; + private static final String CODE_RETRY_LIMIT_EXCEEDED = "retry-limit-exceeded"; + private static final String CODE_NON_MATCHING_CHECKSUM = "non-matching-checksum"; + static final String CODE_CANCELLED = "cancelled"; + + /** + * Returns the task status as string + */ + static String getTaskStatus(@Nullable StorageTask task) { + if (task == null) return STATUS_UNKNOWN; + if (task.isInProgress()) { + return STATUS_RUNNING; + } else if (task.isPaused()) { + return STATUS_PAUSED; + } else if (task.isSuccessful() || task.isComplete()) { + return STATUS_SUCCESS; + } else if (task.isCanceled()) { + return STATUS_CANCELLED; + } else if (task.getException() != null) { + return STATUS_ERROR; + } else { + return STATUS_UNKNOWN; + } + } + + /** + * Converts a RN ReadableMap into a StorageMetadata instance + */ + static StorageMetadata buildMetadataFromMap(ReadableMap metadataMap, @Nullable Uri file) { + StorageMetadata.Builder metadataBuilder = new StorageMetadata.Builder(); + + if (metadataMap != null) { + if (metadataMap.hasKey(KEY_CUSTOM_META)) { + ReadableMap customerMetaMap = Objects.requireNonNull(metadataMap.getMap(KEY_CUSTOM_META)); + Map customMeta = customerMetaMap.toHashMap(); + for (Map.Entry entry : customMeta.entrySet()) { + metadataBuilder.setCustomMetadata(entry.getKey(), (String) entry.getValue()); + } + } + + if (metadataMap.hasKey(KEY_CACHE_CONTROL)) { + metadataBuilder.setCacheControl(metadataMap.getString(KEY_CACHE_CONTROL)); + } + + if (metadataMap.hasKey(KEY_CONTENT_ENCODING)) { + metadataBuilder.setContentEncoding(metadataMap.getString(KEY_CONTENT_ENCODING)); + } + + if (metadataMap.hasKey(KEY_CONTENT_LANG)) { + metadataBuilder.setContentLanguage(metadataMap.getString(KEY_CONTENT_LANG)); + } + + if (metadataMap.hasKey(KEY_CONTENT_DISPOSITION)) { + metadataBuilder.setContentDisposition(metadataMap.getString(KEY_CONTENT_DISPOSITION)); + } + } + + if (metadataMap != null && metadataMap.hasKey(KEY_CONTENT_TYPE)) { + metadataBuilder.setContentType(metadataMap.getString(KEY_CONTENT_TYPE)); + } else if (file != null) { + String mimeType = null; + String fileScheme = file.getScheme(); + + if (fileScheme != null && fileScheme.equals(ContentResolver.SCHEME_CONTENT)) { + Context context = ReactNativeFirebaseApp.getApplicationContext(); + mimeType = context.getContentResolver().getType(file); + } + + if (mimeType == null) { + String fileExt = MimeTypeMap.getFileExtensionFromUrl(file.toString()); + mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(fileExt.toLowerCase()); + } + + if (mimeType != null) { + metadataBuilder.setContentType(mimeType); + } + } + + return metadataBuilder.build(); + } + + static WritableMap getMetadataAsMap(@Nullable StorageMetadata storageMetadata) { + if (storageMetadata == null) return null; + + WritableMap metadata = Arguments.createMap(); + metadata.putString(KEY_BUCKET, storageMetadata.getBucket()); + metadata.putString(KEY_GENERATION, storageMetadata.getGeneration()); + metadata.putString(KEY_META_GENERATION, storageMetadata.getMetadataGeneration()); + metadata.putString(KEY_FULL_PATH, storageMetadata.getPath()); + metadata.putString(KEY_NAME, storageMetadata.getName()); + metadata.putDouble(KEY_SIZE, storageMetadata.getSizeBytes()); + metadata.putString(KEY_TIME_CREATED, SharedUtils.timestampToUTC(storageMetadata.getCreationTimeMillis() / 1000)); + metadata.putString(KEY_UPDATED, SharedUtils.timestampToUTC(storageMetadata.getUpdatedTimeMillis() / 1000)); + metadata.putString(KEY_MD5_HASH, storageMetadata.getMd5Hash()); + + if (storageMetadata.getCacheControl() != null && storageMetadata.getCacheControl().length() > 0) { + metadata.putString(KEY_CACHE_CONTROL, storageMetadata.getCacheControl()); + } else { + metadata.putNull(KEY_CACHE_CONTROL); + } + + if (storageMetadata.getContentLanguage() != null && storageMetadata.getContentLanguage().length() > 0) { + metadata.putString(KEY_CONTENT_LANG, storageMetadata.getContentLanguage()); + } else { + metadata.putNull(KEY_CONTENT_LANG); + } + + metadata.putString(KEY_CONTENT_DISPOSITION, storageMetadata.getContentDisposition()); + metadata.putString(KEY_CONTENT_ENCODING, storageMetadata.getContentEncoding()); + metadata.putString(KEY_CONTENT_TYPE, storageMetadata.getContentType()); + + if (storageMetadata.getCustomMetadataKeys().size() > 0) { + WritableMap customMetadata = Arguments.createMap(); + for (String key : storageMetadata.getCustomMetadataKeys()) { + customMetadata.putString(key, storageMetadata.getCustomMetadata(key)); + } + metadata.putMap(KEY_CUSTOM_META, customMetadata); + } else { + metadata.putNull(KEY_CUSTOM_META); + } + + return metadata; + } + + static String[] getExceptionCodeAndMessage(@Nullable Exception exception) { + String code = STATUS_UNKNOWN; + String message = "An unknown error has occurred."; + + if (exception != null) { + message = exception.getMessage(); + if (exception instanceof StorageException) { + StorageException storageException = (StorageException) exception; + Throwable throwable = storageException.getCause(); + switch (storageException.getErrorCode()) { + case StorageException.ERROR_OBJECT_NOT_FOUND: + code = CODE_OBJECT_NOT_FOUND; + message = "No object exists at the desired reference."; + break; + case StorageException.ERROR_BUCKET_NOT_FOUND: + code = CODE_BUCKET_NOT_FOUND; + message = "No bucket is configured for Firebase Storage."; + break; + case StorageException.ERROR_PROJECT_NOT_FOUND: + code = CODE_PROJECT_NOT_FOUND; + message = "No project is configured for Firebase Storage."; + break; + case StorageException.ERROR_QUOTA_EXCEEDED: + code = CODE_QUOTA_EXCEEDED; + message = "Quota on your Firebase Storage bucket has been exceeded."; + break; + case StorageException.ERROR_NOT_AUTHENTICATED: + code = CODE_UNAUTHENTICATED; + message = "User is unauthenticated. Authenticate and try again."; + break; + case StorageException.ERROR_NOT_AUTHORIZED: + code = CODE_UNAUTHORIZED; + message = "User is not authorized to perform the desired action."; + break; + case StorageException.ERROR_RETRY_LIMIT_EXCEEDED: + code = CODE_RETRY_LIMIT_EXCEEDED; + message = "The maximum time limit on an operation (upload, download, delete, etc.) has been exceeded."; + break; + case StorageException.ERROR_INVALID_CHECKSUM: + code = CODE_NON_MATCHING_CHECKSUM; + message = "File on the client does not match the checksum of the file received by the server."; + break; + case StorageException.ERROR_CANCELED: + code = CODE_CANCELLED; + message = "User cancelled the operation."; + break; + } + + if (code.equals(STATUS_UNKNOWN) && throwable != null) { + if (throwable.getMessage().contains("No such file or directory")) { + code = CODE_FILE_NOT_FOUND; + message = "The local file specified does not exist on the device."; + } else if (throwable.getMessage().contains("Not Found. Could not get object")) { + code = CODE_OBJECT_NOT_FOUND; + message = "No object exists at the desired reference."; + } else { + message = throwable.getMessage(); + } + } + } + } + + return new String[]{code, message}; + } + + static void promiseRejectStorageException(Promise promise, @Nullable Exception exception) { + String[] codeAndMessage = getExceptionCodeAndMessage(exception); + rejectPromiseWithCodeAndMessage(promise, codeAndMessage[0], codeAndMessage[1]); + } + + /** + * Check if we can write to storage, usually false if no permission set on manifest + */ + static boolean isExternalStorageWritable() { + boolean mExternalStorageAvailable; + boolean mExternalStorageWritable; + String state = Environment.getExternalStorageState(); + + if (Environment.MEDIA_MOUNTED.equals(state)) { + // we can read and write to the media + mExternalStorageAvailable = mExternalStorageWritable = true; + } else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) { + // we can only read the media + mExternalStorageAvailable = true; + mExternalStorageWritable = false; + } else { + // something else is wrong. It may be one of many other states, but all we need + // to know is we can neither read nor write + mExternalStorageAvailable = mExternalStorageWritable = false; + } + + return mExternalStorageAvailable && mExternalStorageWritable; + } + +} diff --git a/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStorageDownloadTask.java b/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStorageDownloadTask.java new file mode 100644 index 00000000..7266786c --- /dev/null +++ b/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStorageDownloadTask.java @@ -0,0 +1,210 @@ +package io.invertase.firebase.storage; + +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import android.util.Log; + +import com.facebook.react.bridge.Arguments; +import com.facebook.react.bridge.Promise; +import com.facebook.react.bridge.WritableMap; +import com.google.firebase.storage.FileDownloadTask; +import com.google.firebase.storage.StorageReference; + +import java.io.File; + +import javax.annotation.Nullable; + +import io.invertase.firebase.common.ReactNativeFirebaseEventEmitter; + +import static io.invertase.firebase.common.ReactNativeFirebaseModule.rejectPromiseWithCodeAndMessage; +import static io.invertase.firebase.storage.ReactNativeFirebaseStorageCommon.getTaskStatus; +import static io.invertase.firebase.storage.ReactNativeFirebaseStorageCommon.promiseRejectStorageException; + +class ReactNativeFirebaseStorageDownloadTask extends ReactNativeFirebaseStorageTask { + private static final String TAG = "RNFBStorageDownload"; + private FileDownloadTask fileDownloadTask; + + ReactNativeFirebaseStorageDownloadTask( + int taskId, + StorageReference storageReference, + String appName + ) { + super(taskId, storageReference, appName); + } + + private static WritableMap buildDownloadSnapshotMap(@Nullable FileDownloadTask.TaskSnapshot snapshot) { + WritableMap map = Arguments.createMap(); + + if (snapshot != null) { + map.putDouble(KEY_TOTAL_BYTES, snapshot.getTotalByteCount()); + map.putDouble(KEY_BYTES_TRANSFERRED, snapshot.getBytesTransferred()); + map.putString(KEY_STATE, getTaskStatus(snapshot.getTask())); + } else { + map.putDouble(KEY_TOTAL_BYTES, 0); + map.putDouble(KEY_BYTES_TRANSFERRED, 0); + map.putString(KEY_STATE, getTaskStatus(null)); + } + + return map; + } + + private String getPath(String localFilePath) { + int indexOfLastSlash = localFilePath.lastIndexOf("/"); + return indexOfLastSlash > 0 ? localFilePath.substring(0, indexOfLastSlash) + "/" : "/"; + } + + private String getFileName(String localFilePath) { + int indexOfLastSlash = localFilePath.lastIndexOf("/"); + return indexOfLastSlash > 0 ? localFilePath.substring(indexOfLastSlash + 1) : localFilePath; + } + + void addOnCompleteListener(Promise promise) { + if (fileDownloadTask == null) { + // TODO(salakar) send failure event + rejectPromiseWithCodeAndMessage( + promise, + "error-creating-directory", + "Unable to create the directory specified as the download path for your file." + ); + + return; + } + + fileDownloadTask.addOnCompleteListener(task -> { + destroyTask(); + + if (task.isSuccessful()) { + Log.d(TAG, "onComplete:success " + storageReference.toString()); + WritableMap taskSnapshot = buildDownloadSnapshotMap(task.getResult()); + ReactNativeFirebaseEventEmitter emitter = ReactNativeFirebaseEventEmitter.getSharedInstance(); + + emitter.sendEvent(new ReactNativeFirebaseStorageEvent( + taskSnapshot, + ReactNativeFirebaseStorageEvent.EVENT_STATE_CHANGED, + appName, + taskId + )); + + taskSnapshot = buildDownloadSnapshotMap(task.getResult()); + + emitter.sendEvent(new ReactNativeFirebaseStorageEvent( + taskSnapshot, + ReactNativeFirebaseStorageEvent.EVENT_DOWNLOAD_SUCCESS, + appName, + taskId + )); + + // re-creating WritableMap as they can only be consumed once, so another one is required + taskSnapshot = buildDownloadSnapshotMap(task.getResult()); + + promise.resolve(taskSnapshot); + } else { + Log.d(TAG, "onComplete:failure " + storageReference.toString()); + ReactNativeFirebaseEventEmitter emitter = ReactNativeFirebaseEventEmitter.getSharedInstance(); + + WritableMap errorSnapshot = buildErrorSnapshotMap( + task.getException(), + buildDownloadSnapshotMap(fileDownloadTask.getSnapshot()), + true + ); + + // we force it to be null if Error code is 'cancelled' to match ios & web sdk behaviour + // we only send a 'cancelled' state changed event and ignore the 'error' state_changed event + if (errorSnapshot != null) { + emitter.sendEvent(new ReactNativeFirebaseStorageEvent( + errorSnapshot, + ReactNativeFirebaseStorageEvent.EVENT_STATE_CHANGED, + appName, + taskId + )); + } + + emitter.sendEvent(new ReactNativeFirebaseStorageEvent( + buildErrorSnapshotMap( + task.getException(), + buildDownloadSnapshotMap(fileDownloadTask.getSnapshot()), + false + ), + ReactNativeFirebaseStorageEvent.EVENT_DOWNLOAD_FAILURE, + appName, + taskId + )); + + promiseRejectStorageException(promise, task.getException()); + } + }); + } + + private void addEventListeners() { + fileDownloadTask.addOnProgressListener(taskSnapshotRaw -> { + Log.d(TAG, "onProgress " + storageReference.toString()); + WritableMap taskSnapshot = buildDownloadSnapshotMap(taskSnapshotRaw); + ReactNativeFirebaseEventEmitter + .getSharedInstance() + .sendEvent(new ReactNativeFirebaseStorageEvent( + taskSnapshot, + ReactNativeFirebaseStorageEvent.EVENT_STATE_CHANGED, + appName, + taskId + )); + }); + + fileDownloadTask.addOnCanceledListener(() -> { + Log.d(TAG, "onCancelled " + storageReference.toString()); + ReactNativeFirebaseEventEmitter + .getSharedInstance() + .sendEvent(new ReactNativeFirebaseStorageEvent( + buildCancelledSnapshotMap(buildDownloadSnapshotMap(fileDownloadTask.getSnapshot())), + ReactNativeFirebaseStorageEvent.EVENT_STATE_CHANGED, + appName, + taskId + )); + }); + + fileDownloadTask.addOnPausedListener(taskSnapshotRaw -> { + Log.d(TAG, "onPaused " + storageReference.toString()); + WritableMap taskSnapshot = buildDownloadSnapshotMap(taskSnapshotRaw); + ReactNativeFirebaseEventEmitter + .getSharedInstance() + .sendEvent(new ReactNativeFirebaseStorageEvent( + taskSnapshot, + ReactNativeFirebaseStorageEvent.EVENT_STATE_CHANGED, + appName, + taskId + )); + }); + } + + void begin(String localFilePath) { + String pathWithoutFile = getPath(localFilePath); + File downloadDirectory = new File(pathWithoutFile); + + boolean directoriesCreated = true; + + if (!downloadDirectory.exists()) { + directoriesCreated = downloadDirectory.mkdirs(); + } + + if (directoriesCreated) { + File fileWithFullPath = new File(pathWithoutFile, getFileName(localFilePath)); + fileDownloadTask = storageReference.getFile(fileWithFullPath); + addEventListeners(); + setStorageTask(fileDownloadTask); + } + } +} diff --git a/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStorageEvent.java b/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStorageEvent.java new file mode 100644 index 00000000..b6948581 --- /dev/null +++ b/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStorageEvent.java @@ -0,0 +1,70 @@ +package io.invertase.firebase.storage; + +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import com.facebook.react.bridge.Arguments; +import com.facebook.react.bridge.WritableMap; + +import io.invertase.firebase.interfaces.NativeEvent; + +public class ReactNativeFirebaseStorageEvent implements NativeEvent { + static final String EVENT_STATE_CHANGED = "state_changed"; + static final String EVENT_UPLOAD_SUCCESS = "upload_success"; + static final String EVENT_UPLOAD_FAILURE = "upload_failure"; + static final String EVENT_DOWNLOAD_SUCCESS = "download_success"; + static final String EVENT_DOWNLOAD_FAILURE = "download_failure"; + private static final String EVENT_DEFAULT = "storage_event"; + private static final String KEY_ID = "taskId"; + private static final String KEY_BODY = "body"; + private static final String KEY_APP_NAME = "appName"; + private static final String KEY_EVENT_NAME = "eventName"; + + private int taskId; + private String appName; + private WritableMap eventBody; + private String internalEventName; + + ReactNativeFirebaseStorageEvent( + WritableMap eventBody, + String internalEventName, + String appName, + int taskId + ) { + this.eventBody = eventBody; + this.internalEventName = internalEventName; + this.appName = appName; + this.taskId = taskId; + } + + public String getEventName() { + return EVENT_DEFAULT; + } + + public WritableMap getEventBody() { + WritableMap event = Arguments.createMap(); + event.putInt(KEY_ID, taskId); + event.putMap(KEY_BODY, eventBody); + event.putString(KEY_APP_NAME, appName); + event.putString(KEY_EVENT_NAME, internalEventName); + return event; + } + + public String getFirebaseAppName() { + return appName; + } +} \ No newline at end of file diff --git a/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStorageModule.java b/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStorageModule.java new file mode 100644 index 00000000..2c61af50 --- /dev/null +++ b/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStorageModule.java @@ -0,0 +1,327 @@ +package io.invertase.firebase.storage; + +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import android.content.Context; +import android.net.Uri; +import android.os.Build; +import android.os.Environment; + +import com.facebook.react.bridge.Promise; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.bridge.ReactMethod; +import com.facebook.react.bridge.ReadableMap; +import com.google.android.gms.tasks.Task; +import com.google.firebase.FirebaseApp; +import com.google.firebase.storage.FirebaseStorage; +import com.google.firebase.storage.StorageMetadata; +import com.google.firebase.storage.StorageReference; + +import java.io.File; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +import io.invertase.firebase.common.ReactNativeFirebaseModule; + +import static io.invertase.firebase.storage.ReactNativeFirebaseStorageCommon.buildMetadataFromMap; +import static io.invertase.firebase.storage.ReactNativeFirebaseStorageCommon.getMetadataAsMap; +import static io.invertase.firebase.storage.ReactNativeFirebaseStorageCommon.isExternalStorageWritable; +import static io.invertase.firebase.storage.ReactNativeFirebaseStorageCommon.promiseRejectStorageException; + +public class ReactNativeFirebaseStorageModule extends ReactNativeFirebaseModule { + private static final String TAG = "Storage"; + private static final String KEY_MAIN_BUNDLE = "MainBundle"; + private static final String KEY_DOCUMENT_DIRECTORY = "DocumentDirectory"; + private static final String KEY_LIBRARY_DIRECTORY = "LibraryDirectory"; + private static final String KEY_EXTERNAL_DIRECTORY = "ExternalDirectory"; + private static final String KEY_EXT_STORAGE_DIRECTORY = "ExternalStorageDirectory"; + private static final String KEY_PICS_DIRECTORY = "PicturesDirectory"; + private static final String KEY_MOVIES_DIRECTORY = "MoviesDirectory"; + private static final String KEY_TEMP_DIRECTORY = "TempDirectory"; + private static final String KEY_CACHE_DIRECTORY = "CachesDirectory"; + + ReactNativeFirebaseStorageModule(ReactApplicationContext reactContext) { + super(reactContext, TAG); + } + + @Override + public void onCatalystInstanceDestroy() { + ReactNativeFirebaseStorageTask.destroyAllTasks(); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#delete + */ + @ReactMethod + public void delete(String appName, String url, final Promise promise) { + StorageReference reference = getReferenceFromUrl(url, appName); + reference.delete().addOnCompleteListener(task -> { + if (task.isSuccessful()) { + promise.resolve(null); + } else { + promiseRejectStorageException(promise, Objects.requireNonNull(task.getException())); + } + }); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#getDownloadURL + */ + @ReactMethod + public void getDownloadURL(String appName, final String url, final Promise promise) { + StorageReference reference = getReferenceFromUrl(url, appName); + Task downloadTask = reference.getDownloadUrl(); + + downloadTask.addOnCompleteListener(task -> { + if (task.isSuccessful()) { + promise.resolve(task.getResult() != null ? task.getResult().toString() : null); + } else { + promiseRejectStorageException(promise, task.getException()); + } + }); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#getMetadata + */ + @ReactMethod + public void getMetadata(String appName, String url, Promise promise) { + StorageReference reference = getReferenceFromUrl(url, appName); + reference.getMetadata().addOnCompleteListener(task -> { + if (task.isSuccessful()) { + promise.resolve(getMetadataAsMap(task.getResult())); + } else { + promiseRejectStorageException(promise, task.getException()); + } + }); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#updateMetadata + */ + @ReactMethod + public void updateMetadata( + String appName, + String url, + ReadableMap metadataMap, + final Promise promise + ) { + StorageReference reference = getReferenceFromUrl(url, appName); + StorageMetadata metadata = buildMetadataFromMap(metadataMap, null); + + reference.updateMetadata(metadata).addOnCompleteListener(task -> { + if (task.isSuccessful()) { + promise.resolve(getMetadataAsMap(task.getResult())); + } else { + promiseRejectStorageException(promise, task.getException()); + } + }); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Storage#setMaxDownloadRetryTime + */ + @ReactMethod + public void setMaxDownloadRetryTime(String appName, double milliseconds, Promise promise) { + FirebaseApp firebaseApp = FirebaseApp.getInstance(appName); + FirebaseStorage firebaseStorage = FirebaseStorage.getInstance(firebaseApp); + firebaseStorage.setMaxDownloadRetryTimeMillis((long) milliseconds); + promise.resolve(null); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Storage#setMaxOperationRetryTime + */ + @ReactMethod + public void setMaxOperationRetryTime(String appName, double milliseconds, Promise promise) { + FirebaseApp firebaseApp = FirebaseApp.getInstance(appName); + FirebaseStorage firebaseStorage = FirebaseStorage.getInstance(firebaseApp); + firebaseStorage.setMaxOperationRetryTimeMillis((long) milliseconds); + promise.resolve(null); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Storage#setMaxUploadRetryTime + */ + @ReactMethod + public void setMaxUploadRetryTime(String appName, double milliseconds, Promise promise) { + FirebaseApp firebaseApp = FirebaseApp.getInstance(appName); + FirebaseStorage firebaseStorage = FirebaseStorage.getInstance(firebaseApp); + firebaseStorage.setMaxUploadRetryTimeMillis((long) milliseconds); + promise.resolve(null); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#getFile + */ + @ReactMethod + public void getFile( + String appName, + String url, + String localFilePath, + int taskId, + Promise promise + ) { + // TODO(salakar) only need to check this if using external storage? + if (!isExternalStorageWritable()) { + // TODO(salakar) send failure event + rejectPromiseWithCodeAndMessage( + promise, + "invalid-device-file-path", + "The specified device file path is invalid or is restricted." + ); + return; + } + + StorageReference reference = getReferenceFromUrl(url, appName); + ReactNativeFirebaseStorageDownloadTask storageTask = new ReactNativeFirebaseStorageDownloadTask( + taskId, + reference, + appName + ); + storageTask.begin(localFilePath); + storageTask.addOnCompleteListener(promise); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#putString + */ + @ReactMethod + public void putString( + String appName, + String url, + String string, + String format, + ReadableMap metadataMap, + int taskId, + Promise promise + ) { + StorageReference reference = getReferenceFromUrl(url, appName); + ReactNativeFirebaseStorageUploadTask storageTask = new ReactNativeFirebaseStorageUploadTask( + taskId, + reference, + appName + ); + storageTask.begin(string, format, metadataMap); + storageTask.addOnCompleteListener(promise); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#putFile + */ + @ReactMethod + public void putFile( + String appName, + String url, + String localFilePath, + ReadableMap metadata, + int taskId, + Promise promise + ) { + StorageReference reference = getReferenceFromUrl(url, appName); + ReactNativeFirebaseStorageUploadTask storageTask = new ReactNativeFirebaseStorageUploadTask( + taskId, + reference, + appName + ); + storageTask.begin(localFilePath, metadata); + storageTask.addOnCompleteListener(promise); + } + + @ReactMethod + public void setTaskStatus(String appName, int taskId, int status, Promise promise) { + switch (status) { + case 0: + promise.resolve(ReactNativeFirebaseStorageTask.pauseTaskById(taskId)); + break; + case 1: + promise.resolve(ReactNativeFirebaseStorageTask.resumeTaskById(taskId)); + break; + case 2: + promise.resolve(ReactNativeFirebaseStorageTask.cancelTaskById(taskId)); + break; + } + } + + private String getBucketFromUrl(String url) { + String pathWithBucketName = url.substring(5); + return url.substring(0, pathWithBucketName.indexOf("/") + 5); + } + + private StorageReference getReferenceFromUrl(String url, String appName) { + FirebaseApp firebaseApp = FirebaseApp.getInstance(appName); + FirebaseStorage firebaseStorage = FirebaseStorage.getInstance( + firebaseApp, + getBucketFromUrl(url) + ); + return firebaseStorage.getReferenceFromUrl(url); + } + + @Override + public Map getConstants() { + Map constants = new HashMap<>(); + + Context context = getReactApplicationContext(); + constants.put(KEY_MAIN_BUNDLE, ""); + constants.put(KEY_LIBRARY_DIRECTORY, context.getFilesDir().getAbsolutePath()); + constants.put(KEY_TEMP_DIRECTORY, context.getCacheDir().getAbsolutePath()); + constants.put(KEY_CACHE_DIRECTORY, context.getCacheDir().getAbsolutePath()); + + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + File folder = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS); + constants.put(KEY_DOCUMENT_DIRECTORY, folder.getAbsolutePath()); + } else { + constants.put(KEY_DOCUMENT_DIRECTORY, context.getFilesDir().getAbsolutePath()); + } + + constants.put(KEY_PICS_DIRECTORY, Environment + .getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + .getAbsolutePath()); + + constants.put(KEY_MOVIES_DIRECTORY, Environment + .getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES) + .getAbsolutePath()); + + File externalStorageDirectory = Environment.getExternalStorageDirectory(); + if (externalStorageDirectory != null) { + constants.put(KEY_EXT_STORAGE_DIRECTORY, externalStorageDirectory.getAbsolutePath()); + } + + File externalDirectory = context.getExternalFilesDir(null); + if (externalDirectory != null) { + constants.put(KEY_EXTERNAL_DIRECTORY, externalDirectory.getAbsolutePath()); + } + + // a 'safe' way of checking if any apps have been initialized + List apps = FirebaseApp.getApps(context); + if (apps.size() > 0) { + FirebaseStorage defaultStorageInstance = FirebaseStorage.getInstance(); + constants.put("maxDownloadRetryTime", defaultStorageInstance.getMaxDownloadRetryTimeMillis()); + constants.put( + "maxOperationRetryTime", + defaultStorageInstance.getMaxOperationRetryTimeMillis() + ); + constants.put("maxUploadRetryTime", defaultStorageInstance.getMaxUploadRetryTimeMillis()); + } + + return constants; + } +} diff --git a/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStoragePackage.java b/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStoragePackage.java new file mode 100644 index 00000000..40f9d808 --- /dev/null +++ b/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStoragePackage.java @@ -0,0 +1,46 @@ +package io.invertase.firebase.storage; + +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import com.facebook.react.ReactPackage; +import com.facebook.react.bridge.NativeModule; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.uimanager.ViewManager; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import javax.annotation.Nonnull; + +@SuppressWarnings("unused") +public class ReactNativeFirebaseStoragePackage implements ReactPackage { + @Nonnull + @Override + public List createNativeModules(@Nonnull ReactApplicationContext reactContext) { + List modules = new ArrayList<>(); + modules.add(new ReactNativeFirebaseStorageModule(reactContext)); + return modules; + } + + @Nonnull + @Override + public List createViewManagers(@Nonnull ReactApplicationContext reactContext) { + return Collections.emptyList(); + } +} diff --git a/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStorageTask.java b/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStorageTask.java new file mode 100644 index 00000000..144853ab --- /dev/null +++ b/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStorageTask.java @@ -0,0 +1,150 @@ +package io.invertase.firebase.storage; + +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import android.util.Log; +import android.util.SparseArray; + +import com.facebook.react.bridge.Arguments; +import com.facebook.react.bridge.WritableMap; +import com.google.firebase.storage.StorageReference; +import com.google.firebase.storage.StorageTask; + +import javax.annotation.Nullable; + +import static io.invertase.firebase.storage.ReactNativeFirebaseStorageCommon.CODE_CANCELLED; +import static io.invertase.firebase.storage.ReactNativeFirebaseStorageCommon.STATUS_CANCELLED; +import static io.invertase.firebase.storage.ReactNativeFirebaseStorageCommon.STATUS_ERROR; +import static io.invertase.firebase.storage.ReactNativeFirebaseStorageCommon.getExceptionCodeAndMessage; + +class ReactNativeFirebaseStorageTask { + static final String KEY_STATE = "state"; + static final String KEY_META_DATA = "metadata"; + static final String KEY_TOTAL_BYTES = "totalBytes"; + static final String KEY_BYTES_TRANSFERRED = "bytesTransferred"; + private static final String KEY_ERROR = "error"; + private static final String KEY_CODE = "code"; + private static final String KEY_MESSAGE = "message"; + private static final String KEY_NATIVE_ERROR_MESSAGE = "nativeErrorMessage"; + private static final SparseArray PENDING_TASKS = new SparseArray<>(); + private static final String TAG = "RNFBStorageTask"; + int taskId; + String appName; + StorageReference storageReference; + private StorageTask storageTask; + + ReactNativeFirebaseStorageTask(int taskId, StorageReference storageReference, String appName) { + this.taskId = taskId; + this.storageReference = storageReference; + this.appName = appName; + PENDING_TASKS.put(taskId, this); + } + + static boolean pauseTaskById(int taskId) { + ReactNativeFirebaseStorageTask reactNativeFirebaseStorageTask = PENDING_TASKS.get(taskId); + if (reactNativeFirebaseStorageTask != null) { + return reactNativeFirebaseStorageTask.pause(); + } + + return false; + } + + static boolean resumeTaskById(int taskId) { + ReactNativeFirebaseStorageTask reactNativeFirebaseStorageTask = PENDING_TASKS.get(taskId); + if (reactNativeFirebaseStorageTask != null) { + return reactNativeFirebaseStorageTask.resume(); + } + + return false; + } + + static boolean cancelTaskById(int taskId) { + ReactNativeFirebaseStorageTask reactNativeFirebaseStorageTask = PENDING_TASKS.get(taskId); + if (reactNativeFirebaseStorageTask != null) { + return reactNativeFirebaseStorageTask.cancel(); + } + + return false; + } + + static void destroyAllTasks() { + for (int i = 0, size = PENDING_TASKS.size(); i < size; i++) { + ReactNativeFirebaseStorageTask reactNativeFirebaseStorageTask = PENDING_TASKS.get(i); + reactNativeFirebaseStorageTask.cancel(); + } + PENDING_TASKS.clear(); + } + + static WritableMap buildCancelledSnapshotMap(WritableMap snapshot) { + snapshot.putString(KEY_STATE, STATUS_CANCELLED); + return snapshot; + } + + static WritableMap buildErrorSnapshotMap(@Nullable Exception exception, WritableMap taskMap, boolean skipCancelled) { + WritableMap errorMap = Arguments.createMap(); + String[] exceptionCodeAndMessage = getExceptionCodeAndMessage(exception); + if (skipCancelled && exceptionCodeAndMessage[0].equals(CODE_CANCELLED)) return null; + errorMap.putString(KEY_CODE, exceptionCodeAndMessage[0]); + errorMap.putString(KEY_MESSAGE, exceptionCodeAndMessage[1]); + if (exception != null) errorMap.putString(KEY_NATIVE_ERROR_MESSAGE, exception.getMessage()); + taskMap.putMap(KEY_ERROR, errorMap); + taskMap.putString(KEY_STATE, STATUS_ERROR); + return taskMap; + } + + private boolean pause() { + Log.d(TAG, "pausing task for " + storageReference.toString()); + + if (!storageTask.isPaused() && storageTask.isInProgress()) { + return storageTask.pause(); + } + + return false; + } + + private boolean resume() { + Log.d(TAG, "resuming task for " + storageReference.toString()); + + if (storageTask.isPaused()) { + return storageTask.resume(); + } + + return false; + } + + private boolean cancel() { + Log.d(TAG, "cancelling task for " + storageReference.toString()); + + if (!storageTask.isCanceled() && storageTask.isInProgress()) { + destroyTask(); + return storageTask.cancel(); + } + + return false; + } + + void destroyTask() { + PENDING_TASKS.remove(taskId); + + Log.d(TAG, "destroyed completed task for " + storageReference.toString()); + } + + void setStorageTask(StorageTask storageTask) { + this.storageTask = storageTask; + } +} diff --git a/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStorageUploadTask.java b/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStorageUploadTask.java new file mode 100644 index 00000000..1f71d0e0 --- /dev/null +++ b/packages/storage/android/src/main/java/io/invertase/firebase/storage/ReactNativeFirebaseStorageUploadTask.java @@ -0,0 +1,221 @@ +package io.invertase.firebase.storage; + +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import android.net.Uri; +import android.util.Base64; +import android.util.Log; + +import com.facebook.react.bridge.Arguments; +import com.facebook.react.bridge.Promise; +import com.facebook.react.bridge.ReadableMap; +import com.facebook.react.bridge.WritableMap; +import com.google.firebase.storage.StorageMetadata; +import com.google.firebase.storage.StorageReference; +import com.google.firebase.storage.UploadTask; + +import java.io.File; + +import javax.annotation.Nullable; + +import io.invertase.firebase.common.ReactNativeFirebaseEventEmitter; + +import static io.invertase.firebase.storage.ReactNativeFirebaseStorageCommon.buildMetadataFromMap; +import static io.invertase.firebase.storage.ReactNativeFirebaseStorageCommon.getMetadataAsMap; +import static io.invertase.firebase.storage.ReactNativeFirebaseStorageCommon.getTaskStatus; +import static io.invertase.firebase.storage.ReactNativeFirebaseStorageCommon.promiseRejectStorageException; + +class ReactNativeFirebaseStorageUploadTask extends ReactNativeFirebaseStorageTask { + private static final String TAG = "RNFBStorageUpload"; + private UploadTask uploadTask; + + ReactNativeFirebaseStorageUploadTask( + int taskId, + StorageReference storageReference, + String appName + ) { + super(taskId, storageReference, appName); + } + + private static WritableMap buildUploadSnapshotMap(@Nullable UploadTask.TaskSnapshot snapshot) { + WritableMap map = Arguments.createMap(); + + if (snapshot != null) { + map.putDouble(KEY_TOTAL_BYTES, snapshot.getTotalByteCount()); + map.putDouble(KEY_BYTES_TRANSFERRED, snapshot.getBytesTransferred()); + map.putString(KEY_STATE, getTaskStatus(snapshot.getTask())); + map.putMap(KEY_META_DATA, getMetadataAsMap(snapshot.getMetadata())); + } else { + map.putDouble(KEY_TOTAL_BYTES, 0); + map.putDouble(KEY_BYTES_TRANSFERRED, 0); + map.putString(KEY_STATE, getTaskStatus(null)); + map.putMap(KEY_META_DATA, Arguments.createMap()); + } + + return map; + } + + /** + * Create a Uri from the path, defaulting to file when there is no supplied scheme + */ + private static Uri getUri(String uri) { + Uri parsed = Uri.parse(uri); + + if (parsed.getScheme() == null || parsed.getScheme().isEmpty()) { + return Uri.fromFile(new File(uri)); + } + + return parsed; + } + + private byte[] uploadStringToByteArray(String string, String format) { + byte[] bytes = null; + switch (format) { + case "base64": + bytes = Base64.decode(string, Base64.DEFAULT); + break; + case "base64url": + bytes = Base64.decode(string, Base64.URL_SAFE); + break; + } + + return bytes; + } + + private void addEventListeners() { + uploadTask.addOnProgressListener(taskSnapshotRaw -> { + Log.d(TAG, "onProgress " + storageReference.toString()); + WritableMap taskSnapshot = buildUploadSnapshotMap(taskSnapshotRaw); + ReactNativeFirebaseEventEmitter + .getSharedInstance() + .sendEvent(new ReactNativeFirebaseStorageEvent( + taskSnapshot, + ReactNativeFirebaseStorageEvent.EVENT_STATE_CHANGED, + appName, + taskId + )); + }); + + uploadTask.addOnCanceledListener(() -> { + Log.d(TAG, "onCancelled " + storageReference.toString()); + ReactNativeFirebaseEventEmitter + .getSharedInstance() + .sendEvent(new ReactNativeFirebaseStorageEvent( + buildCancelledSnapshotMap(buildUploadSnapshotMap(uploadTask.getSnapshot())), + ReactNativeFirebaseStorageEvent.EVENT_STATE_CHANGED, + appName, + taskId + )); + }); + + uploadTask.addOnPausedListener(taskSnapshotRaw -> { + Log.d(TAG, "onPaused " + storageReference.toString()); + WritableMap taskSnapshot = buildUploadSnapshotMap(taskSnapshotRaw); + ReactNativeFirebaseEventEmitter + .getSharedInstance() + .sendEvent(new ReactNativeFirebaseStorageEvent( + taskSnapshot, + ReactNativeFirebaseStorageEvent.EVENT_STATE_CHANGED, + appName, + taskId + )); + }); + } + + void addOnCompleteListener(Promise promise) { + uploadTask.addOnCompleteListener(task -> { + destroyTask(); + + if (task.isSuccessful()) { + ReactNativeFirebaseEventEmitter emitter = ReactNativeFirebaseEventEmitter.getSharedInstance(); + WritableMap taskSnapshotMap = buildUploadSnapshotMap(task.getResult()); + + emitter.sendEvent(new ReactNativeFirebaseStorageEvent( + taskSnapshotMap, + ReactNativeFirebaseStorageEvent.EVENT_STATE_CHANGED, + appName, + taskId + )); + + // re-creating WritableMap as they can only be consumed once, so another one is required + taskSnapshotMap = buildUploadSnapshotMap(task.getResult()); + emitter.sendEvent(new ReactNativeFirebaseStorageEvent( + taskSnapshotMap, + ReactNativeFirebaseStorageEvent.EVENT_UPLOAD_SUCCESS, + appName, + taskId + )); + + taskSnapshotMap = buildUploadSnapshotMap(task.getResult()); + promise.resolve(taskSnapshotMap); + } else { + ReactNativeFirebaseEventEmitter emitter = ReactNativeFirebaseEventEmitter.getSharedInstance(); + WritableMap errorSnapshot = buildErrorSnapshotMap( + task.getException(), + buildUploadSnapshotMap(uploadTask.getSnapshot()), + true + ); + + // we force it to be null if Error code is 'cancelled' to match ios & web sdk behaviour + // we only send a 'cancelled' state changed event and ignore the 'error' state_changed event + if (errorSnapshot != null) { + emitter.sendEvent(new ReactNativeFirebaseStorageEvent( + errorSnapshot, + ReactNativeFirebaseStorageEvent.EVENT_STATE_CHANGED, + appName, + taskId + )); + } + + emitter.sendEvent(new ReactNativeFirebaseStorageEvent( + buildErrorSnapshotMap( + task.getException(), + buildUploadSnapshotMap(uploadTask.getSnapshot()), + false + ), + ReactNativeFirebaseStorageEvent.EVENT_UPLOAD_FAILURE, + appName, + taskId + )); + + promiseRejectStorageException(promise, task.getException()); + } + }); + } + + /** + * Put String or Data from JavaScript + */ + void begin(String string, String format, ReadableMap metadataMap) { + StorageMetadata metadata = buildMetadataFromMap(metadataMap, null); + uploadTask = storageReference.putBytes(uploadStringToByteArray(string, format), metadata); + setStorageTask(uploadTask); + addEventListeners(); + } + + /** + * Put File from JavaScript + */ + void begin(String localFilePath, ReadableMap metadataMap) { + Uri fileUri = getUri(localFilePath); + StorageMetadata metadata = buildMetadataFromMap(metadataMap, fileUri); + uploadTask = storageReference.putFile(fileUri, metadata); + setStorageTask(uploadTask); + addEventListeners(); + } +} diff --git a/packages/storage/e2e/StorageReference.e2e.js b/packages/storage/e2e/StorageReference.e2e.js new file mode 100644 index 00000000..c42f4acc --- /dev/null +++ b/packages/storage/e2e/StorageReference.e2e.js @@ -0,0 +1,429 @@ +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +describe('storage() -> StorageReference', () => { + describe('toString()', () => { + it('returns the correct bucket path to the file', () => { + const app = firebase.app(); + firebase + .storage() + .ref('/uploadNope.jpeg') + .toString() + .should.equal(`gs://${app.options.storageBucket}/uploadNope.jpeg`); + }); + }); + + describe('properties', () => { + describe('fullPath', () => { + it('returns the full path as a string', () => { + firebase + .storage() + .ref('/foo/uploadNope.jpeg') + .fullPath.should.equal(`foo/uploadNope.jpeg`); + firebase + .storage() + .ref('foo/uploadNope.jpeg') + .fullPath.should.equal(`foo/uploadNope.jpeg`); + }); + }); + + describe('storage', () => { + it('returns the instance of storage', () => { + firebase + .storage() + .ref('/foo/uploadNope.jpeg') + .storage.ref.should.be.a.Function(); + }); + }); + + describe('bucket', () => { + it('returns the storage bucket as a string', () => { + const app = firebase.app(); + firebase + .storage() + .ref('/foo/uploadNope.jpeg') + .bucket.should.equal(app.options.storageBucket); + }); + }); + + describe('name', () => { + it('returns the file name as a string', () => { + const ref = firebase.storage().ref('/foo/uploadNope.jpeg'); + ref.name.should.equal('uploadNope.jpeg'); + }); + }); + + describe('parent', () => { + it('returns the parent directory as a reference', () => { + firebase + .storage() + .ref('/foo/uploadNope.jpeg') + .parent.fullPath.should.equal('foo'); + }); + + it('returns null if already at root', () => { + const ref = firebase.storage().ref('/'); + should.equal(ref.parent, null); + }); + }); + + describe('root', () => { + it('returns a reference to the root of the bucket', () => { + firebase + .storage() + .ref('/foo/uploadNope.jpeg') + .root.fullPath.should.equal('/'); + }); + }); + }); + + describe('child()', () => { + it('returns a reference to a child path', () => { + const parentRef = firebase.storage().ref('/foo'); + const childRef = parentRef.child('someFile.json'); + childRef.fullPath.should.equal('foo/someFile.json'); + }); + }); + + describe('delete()', () => { + before(async () => { + await firebase + .storage() + .ref('/ok.jpeg') + .getFile(`${firebase.storage.Path.DocumentDirectory}/deleteMe.jpeg`); + await firebase + .storage() + .ref('/deleteMe.jpeg') + .putFile(`${firebase.storage.Path.DocumentDirectory}/deleteMe.jpeg`); + }); + + it('should delete a file', async () => { + const storageReference = firebase.storage().ref('/deleteMe.jpeg'); + await storageReference.delete(); + + try { + await storageReference.getMetadata(); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.code.should.equal('storage/object-not-found'); + error.message.should.equal( + '[storage/object-not-found] No object exists at the desired reference.', + ); + return Promise.resolve(); + } + }); + + it('throws error if file does not exist', async () => { + const storageReference = firebase.storage().ref('/iDoNotExist.jpeg'); + + try { + await storageReference.delete(); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.code.should.equal('storage/object-not-found'); + error.message.should.equal( + '[storage/object-not-found] No object exists at the desired reference.', + ); + return Promise.resolve(); + } + }); + + it('throws error if no write permission', async () => { + const storageReference = firebase.storage().ref('/uploadNope.jpeg'); + + try { + await storageReference.delete(); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.code.should.equal('storage/unauthorized'); + error.message.should.equal( + '[storage/unauthorized] User is not authorized to perform the desired action.', + ); + return Promise.resolve(); + } + }); + }); + + describe('getDownloadURL', () => { + it('should return a download url for a file', async () => { + const storageReference = firebase.storage().ref('/ok.jpeg'); + const downloadUrl = await storageReference.getDownloadURL(); + downloadUrl.should.be.a.String(); + downloadUrl.should.containEql('/ok.jpeg'); + downloadUrl.should.containEql(firebase.app().options.projectId); + }); + + it('throws error if file does not exist', async () => { + const storageReference = firebase.storage().ref('/iDoNotExist.jpeg'); + + try { + await storageReference.getDownloadURL(); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.code.should.equal('storage/object-not-found'); + error.message.should.equal( + '[storage/object-not-found] No object exists at the desired reference.', + ); + return Promise.resolve(); + } + }); + + it('throws error if no write permission', async () => { + const storageReference = firebase.storage().ref('/writeOnly.jpeg'); + + try { + await storageReference.getDownloadURL(); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.code.should.equal('storage/unauthorized'); + error.message.should.equal( + '[storage/unauthorized] User is not authorized to perform the desired action.', + ); + return Promise.resolve(); + } + }); + }); + + describe('getMetadata', () => { + it('should return a metadata for a file', async () => { + const storageReference = firebase.storage().ref('/ok.jpeg'); + const metadata = await storageReference.getMetadata(); + metadata.generation.should.be.a.String(); + metadata.fullPath.should.equal('ok.jpeg'); + metadata.name.should.equal('ok.jpeg'); + metadata.size.should.be.a.Number(); + should.equal(metadata.size > 0, true); + metadata.updated.should.be.a.String(); + metadata.timeCreated.should.be.a.String(); + metadata.contentEncoding.should.be.a.String(); + metadata.contentDisposition.should.be.a.String(); + metadata.contentType.should.equal('image/jpeg'); + metadata.bucket.should.equal(`${firebase.app().options.projectId}.appspot.com`); + metadata.metageneration.should.be.a.String(); + metadata.md5Hash.should.be.a.String(); + should.equal(metadata.cacheControl, null); + should.equal(metadata.contentLanguage, null); + should.equal(metadata.customMetadata, null); + }); + }); + + describe('updateMetadata', () => { + it('should return the updated metadata for a file', async () => { + const storageReference = firebase.storage().ref('/writeOnly.jpeg'); + const metadata = await storageReference.updateMetadata({ + contentType: 'image/jpeg', + customMetadata: { + hello: 'world', + }, + }); + + metadata.customMetadata.hello.should.equal('world'); + metadata.generation.should.be.a.String(); + metadata.fullPath.should.equal('writeOnly.jpeg'); + metadata.name.should.equal('writeOnly.jpeg'); + metadata.size.should.be.a.Number(); + should.equal(metadata.size > 0, true); + metadata.updated.should.be.a.String(); + metadata.timeCreated.should.be.a.String(); + metadata.contentEncoding.should.be.a.String(); + metadata.contentDisposition.should.be.a.String(); + metadata.contentType.should.equal('image/jpeg'); + metadata.bucket.should.equal(`${firebase.app().options.projectId}.appspot.com`); + metadata.metageneration.should.be.a.String(); + metadata.md5Hash.should.be.a.String(); + should.equal(metadata.cacheControl, null); + should.equal(metadata.contentLanguage, null); + metadata.customMetadata.should.be.an.Object(); + }); + + it('should remove customMetadata properties by setting the value to null', async () => { + const storageReference = firebase.storage().ref('/writeOnly.jpeg'); + const metadata = await storageReference.updateMetadata({ + contentType: 'image/jpeg', + customMetadata: { + removeMe: 'please', + }, + }); + + metadata.customMetadata.removeMe.should.equal('please'); + + const metadataAfterRemove = await storageReference.updateMetadata({ + contentType: 'image/jpeg', + customMetadata: { + removeMe: null, + }, + }); + + should.equal(metadataAfterRemove.customMetadata.removeMe, undefined); + }); + }); + + describe('putFile', () => { + it('errors if file path is not a string', async () => { + const storageReference = firebase.storage().ref('/ok.jpeg'); + try { + storageReference.putFile(1337); + return Promise.reject(new Error('Did not error!')); + } catch (error) { + error.message.should.containEql('expects a string value'); + return Promise.resolve(); + } + }); + + it('errors if metadata is not an object', async () => { + const storageReference = firebase.storage().ref('/ok.jpeg'); + try { + storageReference.putFile('foo', 123); + return Promise.reject(new Error('Did not error!')); + } catch (error) { + error.message.should.containEql('must be an object value'); + return Promise.resolve(); + } + }); + + it('errors if metadata contains an unsupported property', async () => { + const storageReference = firebase.storage().ref('/ok.jpeg'); + try { + storageReference.putFile('foo', { foo: true }); + return Promise.reject(new Error('Did not error!')); + } catch (error) { + error.message.should.containEql(`unknown property 'foo'`); + return Promise.resolve(); + } + }); + + it('errors if metadata property value is not a string or null value', async () => { + const storageReference = firebase.storage().ref('/ok.jpeg'); + try { + storageReference.putFile('foo', { contentType: true }); + return Promise.reject(new Error('Did not error!')); + } catch (error) { + error.message.should.containEql(`should be a string or null value`); + return Promise.resolve(); + } + }); + + it('errors if metadata.customMetadata is not an object', async () => { + const storageReference = firebase.storage().ref('/ok.jpeg'); + try { + storageReference.putFile('foo', { customMetadata: true }); + return Promise.reject(new Error('Did not error!')); + } catch (error) { + error.message.should.containEql( + `customMetadata must be an object of keys and string values`, + ); + return Promise.resolve(); + } + }); + }); + + describe('putString', () => { + it('errors if metadata is not an object', async () => { + const storageReference = firebase.storage().ref('/ok.jpeg'); + try { + storageReference.putString('foo', 'raw', 123); + return Promise.reject(new Error('Did not error!')); + } catch (error) { + error.message.should.containEql('must be an object value'); + return Promise.resolve(); + } + }); + + it('errors if metadata contains an unsupported property', async () => { + const storageReference = firebase.storage().ref('/ok.jpeg'); + try { + storageReference.putString('foo', 'raw', { foo: true }); + return Promise.reject(new Error('Did not error!')); + } catch (error) { + error.message.should.containEql(`unknown property 'foo'`); + return Promise.resolve(); + } + }); + + it('errors if metadata property value is not a string or null value', async () => { + const storageReference = firebase.storage().ref('/ok.jpeg'); + try { + storageReference.putString('foo', 'raw', { contentType: true }); + return Promise.reject(new Error('Did not error!')); + } catch (error) { + error.message.should.containEql(`should be a string or null value`); + return Promise.resolve(); + } + }); + + it('errors if metadata.customMetadata is not an object', async () => { + const storageReference = firebase.storage().ref('/ok.jpeg'); + try { + storageReference.putString('foo', 'raw', { customMetadata: true }); + return Promise.reject(new Error('Did not error!')); + } catch (error) { + error.message.should.containEql( + `customMetadata must be an object of keys and string values`, + ); + return Promise.resolve(); + } + }); + }); + + describe('put', () => { + it('errors if metadata is not an object', async () => { + const storageReference = firebase.storage().ref('/ok.jpeg'); + try { + storageReference.put(new jet.context.window.ArrayBuffer(), 123); + return Promise.reject(new Error('Did not error!')); + } catch (error) { + error.message.should.containEql('must be an object value'); + return Promise.resolve(); + } + }); + + it('errors if metadata contains an unsupported property', async () => { + const storageReference = firebase.storage().ref('/ok.jpeg'); + try { + storageReference.put(new jet.context.window.ArrayBuffer(), { foo: true }); + return Promise.reject(new Error('Did not error!')); + } catch (error) { + error.message.should.containEql(`unknown property 'foo'`); + return Promise.resolve(); + } + }); + + it('errors if metadata property value is not a string or null value', async () => { + const storageReference = firebase.storage().ref('/ok.jpeg'); + try { + storageReference.put(new jet.context.window.ArrayBuffer(), { contentType: true }); + return Promise.reject(new Error('Did not error!')); + } catch (error) { + error.message.should.containEql(`should be a string or null value`); + return Promise.resolve(); + } + }); + + it('errors if metadata.customMetadata is not an object', async () => { + const storageReference = firebase.storage().ref('/ok.jpeg'); + try { + storageReference.put(new jet.context.window.ArrayBuffer(), { customMetadata: true }); + return Promise.reject(new Error('Did not error!')); + } catch (error) { + error.message.should.containEql( + `customMetadata must be an object of keys and string values`, + ); + return Promise.resolve(); + } + }); + }); +}); diff --git a/packages/storage/e2e/StorageStatics.e2e.js b/packages/storage/e2e/StorageStatics.e2e.js new file mode 100644 index 00000000..97c3aed6 --- /dev/null +++ b/packages/storage/e2e/StorageStatics.e2e.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +describe('storage()', () => { + describe('statics', () => { + it('provides native path strings', () => { + firebase.storage.Path.should.be.an.Object(); + if (device.getPlatform() === 'ios') { + firebase.storage.Path.MainBundle.should.be.a.String(); + } else { + should.equal(firebase.storage.Path.MainBundle, null); + } + + firebase.storage.Path.CachesDirectory.should.be.a.String(); + firebase.storage.Path.DocumentDirectory.should.be.a.String(); + + if (device.getPlatform() === 'android') { + firebase.storage.Path.ExternalDirectory.should.be.a.String(); + firebase.storage.Path.ExternalStorageDirectory.should.be.a.String(); + } else { + should.equal(firebase.storage.Path.ExternalDirectory, null); + should.equal(firebase.storage.Path.ExternalStorageDirectory, null); + } + + firebase.storage.Path.TempDirectory.should.be.a.String(); + firebase.storage.Path.LibraryDirectory.should.be.a.String(); + firebase.storage.Path.PicturesDirectory.should.be.a.String(); + firebase.storage.Path.MoviesDirectory.should.be.a.String(); + }); + + // TODO(salakar) remove in 6.1.0 + it('provides deprecated Native path strings', () => { + firebase.storage.Native.should.be.an.Object(); + if (device.getPlatform() === 'ios') { + firebase.storage.Native.MAIN_BUNDLE_PATH.should.be.a.String(); + } else { + should.equal(firebase.storage.Native.MAIN_BUNDLE_PATH, null); + } + firebase.storage.Native.CACHES_DIRECTORY_PATH.should.be.a.String(); + firebase.storage.Native.DOCUMENT_DIRECTORY_PATH.should.be.a.String(); + + if (device.getPlatform() === 'android') { + firebase.storage.Native.EXTERNAL_DIRECTORY_PATH.should.be.a.String(); + firebase.storage.Native.EXTERNAL_STORAGE_DIRECTORY_PATH.should.be.a.String(); + } else { + should.equal(firebase.storage.Native.EXTERNAL_DIRECTORY_PATH, null); + should.equal(firebase.storage.Native.EXTERNAL_STORAGE_DIRECTORY_PATH, null); + } + + firebase.storage.Native.TEMP_DIRECTORY_PATH.should.be.a.String(); + firebase.storage.Native.LIBRARY_DIRECTORY_PATH.should.be.a.String(); + }); + }); +}); diff --git a/packages/storage/e2e/StorageTask.e2e.js b/packages/storage/e2e/StorageTask.e2e.js new file mode 100644 index 00000000..987221e4 --- /dev/null +++ b/packages/storage/e2e/StorageTask.e2e.js @@ -0,0 +1,804 @@ +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +describe('storage() -> StorageTask', () => { + describe('getFile()', () => { + it('errors if permission denied', async () => { + try { + await firebase + .storage() + .ref('/not.jpg') + .getFile(`${firebase.storage.Path.DocumentDirectory}/not.jpg`); + return Promise.reject(new Error('No permission denied error')); + } catch (error) { + error.code.should.equal('storage/unauthorized'); + error.message.includes('not authorized').should.be.true(); + return Promise.resolve(); + } + }); + + it('downloads a file', async () => { + const meta = await firebase + .storage() + .ref('/ok.jpeg') + .getFile(`${firebase.storage.Path.DocumentDirectory}/ok.jpeg`); + + meta.state.should.eql(firebase.storage.TaskState.SUCCESS); + meta.bytesTransferred.should.eql(meta.totalBytes); + }); + + it('downloads a file using deprecated downloadFile method', async () => { + const meta = await firebase + .storage() + .ref('/ok.jpeg') + .downloadFile(`${firebase.storage.Path.DocumentDirectory}/ok.jpeg`); + + meta.state.should.eql(firebase.storage.TaskState.SUCCESS); + meta.bytesTransferred.should.eql(meta.totalBytes); + }); + }); + + describe('putString()', () => { + it('uploads a raw string', async () => { + const jsonDerulo = JSON.stringify({ foo: 'bar' }); + + const uploadTaskSnapshot = await firebase + .storage() + .ref('/putString.json') + .putString(jsonDerulo, firebase.storage.StringFormat.RAW, { + contentType: 'application/json', + }); + + uploadTaskSnapshot.state.should.eql(firebase.storage.TaskState.SUCCESS); + uploadTaskSnapshot.bytesTransferred.should.eql(uploadTaskSnapshot.totalBytes); + uploadTaskSnapshot.metadata.should.be.an.Object(); + }); + + it('uploads a data_url formatted string', async () => { + const dataUrl = `data:application/json;base64,eyJmb28iOiJiYXNlNjQifQ==`; + const uploadTaskSnapshot = await firebase + .storage() + .ref('/putStringDataURL.json') + .putString(dataUrl, firebase.storage.StringFormat.DATA_URL); + + uploadTaskSnapshot.state.should.eql(firebase.storage.TaskState.SUCCESS); + uploadTaskSnapshot.bytesTransferred.should.eql(uploadTaskSnapshot.totalBytes); + uploadTaskSnapshot.metadata.should.be.an.Object(); + }); + + it('uploads a url encoded data_url formatted string', async () => { + const dataUrl = `data:text/html,%3Ch1%3EHello%2C%20World!%3C%2Fh1%3E`; + const uploadTaskSnapshot = await firebase + .storage() + .ref('/helloWorld.html') + .putString(dataUrl, firebase.storage.StringFormat.DATA_URL); + + uploadTaskSnapshot.state.should.eql(firebase.storage.TaskState.SUCCESS); + uploadTaskSnapshot.bytesTransferred.should.eql(uploadTaskSnapshot.totalBytes); + uploadTaskSnapshot.metadata.should.be.an.Object(); + }); + + it('when using data_url it still sets the content type if metadata is provided', async () => { + const dataUrl = `data:text/html,%3Ch1%3EHello%2C%20World!%3C%2Fh1%3E`; + + const uploadTaskSnapshot = await firebase + .storage() + .ref('/helloWorld.html') + .putString(dataUrl, firebase.storage.StringFormat.DATA_URL, { + // TODO(salakar) automate test metadata is preserved when auto setting mediatype + customMetadata: { + hello: 'world', + }, + }); + + uploadTaskSnapshot.state.should.eql(firebase.storage.TaskState.SUCCESS); + uploadTaskSnapshot.bytesTransferred.should.eql(uploadTaskSnapshot.totalBytes); + uploadTaskSnapshot.metadata.should.be.an.Object(); + }); + + it('uploads a base64 string', async () => { + const base64String = 'eyJmb28iOiJiYXNlNjQifQ=='; + + const uploadTaskSnapshot = await firebase + .storage() + .ref('/putStringBase64.json') + .putString(base64String, firebase.storage.StringFormat.BASE64, { + contentType: 'application/json', + }); + + uploadTaskSnapshot.state.should.eql(firebase.storage.TaskState.SUCCESS); + uploadTaskSnapshot.bytesTransferred.should.eql(uploadTaskSnapshot.totalBytes); + uploadTaskSnapshot.metadata.should.be.an.Object(); + }); + + it('uploads a base64url string', async () => { + const base64UrlString = 'eyJmb28iOiJiYXNlNjQifQ'; + + const uploadTaskSnapshot = await firebase + .storage() + .ref('/putStringBase64Url.json') + .putString(base64UrlString, firebase.storage.StringFormat.BASE64URL, { + contentType: 'application/json', + }); + + uploadTaskSnapshot.state.should.eql(firebase.storage.TaskState.SUCCESS); + uploadTaskSnapshot.bytesTransferred.should.eql(uploadTaskSnapshot.totalBytes); + uploadTaskSnapshot.metadata.should.be.an.Object(); + }); + + it('throws an error on invalid data_url', async () => { + const dataUrl = ``; + try { + await firebase + .storage() + .ref('/a.b') + .putString(dataUrl, firebase.storage.StringFormat.DATA_URL); + return Promise.reject(new Error('Did not throw!')); + } catch (error) { + error.message.should.containEql('invalid data_url string provided'); + return Promise.resolve(); + } + }); + + it('throws if string arg is not a valid string', async () => { + try { + await firebase + .storage() + .ref('/a.b') + .putString(1, 'base64'); + return Promise.reject(new Error('Did not throw!')); + } catch (error) { + error.message.should.containEql(`'string' expects a string value`); + return Promise.resolve(); + } + }); + + it('throws an error on invalid string format', async () => { + try { + await firebase + .storage() + .ref('/a.b') + .putString('fooby', 'abc'); + return Promise.reject(new Error('Did not throw!')); + } catch (error) { + error.message.should.containEql(`'format' provided is invalid, must be one of`); + return Promise.resolve(); + } + }); + + it('throws an error if metadata is not an object', async () => { + try { + await firebase + .storage() + .ref('/a.b') + .putString('fooby', 'raw', 1234); + return Promise.reject(new Error('Did not throw!')); + } catch (error) { + error.message.should.containEql(`must be an object value if provided`); + return Promise.resolve(); + } + }); + }); + + describe('put()', () => { + it('uploads a Blob', async () => { + const jsonDerulo = JSON.stringify({ foo: 'bar' }); + + const bob = new jet.context.Blob([jsonDerulo], { + type: 'application/json', + }); + + const uploadTaskSnapshot = await firebase + .storage() + .ref('/putStringBlob.json') + .put(bob); + + uploadTaskSnapshot.state.should.eql(firebase.storage.TaskState.SUCCESS); + uploadTaskSnapshot.bytesTransferred.should.eql(uploadTaskSnapshot.totalBytes); + uploadTaskSnapshot.metadata.should.be.an.Object(); + }); + + it('uploads an ArrayBuffer', async () => { + const jsonDerulo = JSON.stringify({ foo: 'bar' }); + + const arrayBuffer = new jet.context.window.ArrayBuffer(jsonDerulo.length); + const arrayBufferView = new jet.context.window.Uint8Array(arrayBuffer); + + for (let i = 0, strLen = jsonDerulo.length; i < strLen; i++) { + arrayBufferView[i] = jsonDerulo.charCodeAt(i); + } + + const uploadTaskSnapshot = await firebase + .storage() + .ref('/putStringArrayBuffer.json') + .put(arrayBuffer, { + contentType: 'application/json', + }); + + uploadTaskSnapshot.state.should.eql(firebase.storage.TaskState.SUCCESS); + uploadTaskSnapshot.bytesTransferred.should.eql(uploadTaskSnapshot.totalBytes); + uploadTaskSnapshot.metadata.should.be.an.Object(); + }); + + it('uploads an Uint8Array', async () => { + const jsonDerulo = JSON.stringify({ foo: 'bar' }); + + const arrayBuffer = new jet.context.window.ArrayBuffer(jsonDerulo.length); + const unit8Array = new jet.context.window.Uint8Array(arrayBuffer); + + for (let i = 0, strLen = jsonDerulo.length; i < strLen; i++) { + unit8Array[i] = jsonDerulo.charCodeAt(i); + } + + const uploadTaskSnapshot = await firebase + .storage() + .ref('/putStringUint8Array.json') + .put(unit8Array, { + contentType: 'application/json', + }); + + uploadTaskSnapshot.state.should.eql(firebase.storage.TaskState.SUCCESS); + uploadTaskSnapshot.bytesTransferred.should.eql(uploadTaskSnapshot.totalBytes); + uploadTaskSnapshot.metadata.should.be.an.Object(); + }); + }); + + describe('putFile()', () => { + before(async () => { + await firebase + .storage() + .ref('/ok.jpeg') + .getFile(`${firebase.storage.Path.DocumentDirectory}/ok.jpeg`); + await firebase + .storage() + .ref('/cat.gif') + .getFile(`${firebase.storage.Path.DocumentDirectory}/cat.gif`); + await firebase + .storage() + .ref('/hei.heic') + .getFile(`${firebase.storage.Path.DocumentDirectory}/hei.heic`); + }); + + it('errors if permission denied', async () => { + try { + await firebase + .storage() + .ref('/uploadNope.jpeg') + .putFile(`${firebase.storage.Path.DocumentDirectory}/ok.jpeg`); + return Promise.reject(new Error('No permission denied error')); + } catch (error) { + error.code.should.equal('storage/unauthorized'); + error.message.includes('not authorized').should.be.true(); + return Promise.resolve(); + } + }); + + it('supports thenable .catch()', async () => { + const out = await firebase + .storage() + .ref('/uploadNope.jpeg') + .putFile(`${firebase.storage.Path.DocumentDirectory}/ok.jpeg`) + .catch(error => { + error.code.should.equal('storage/unauthorized'); + error.message.includes('not authorized').should.be.true(); + return 1; + }); + should.equal(out, 1); + }); + + it('uploads a file', async () => { + let uploadTaskSnapshot = await firebase + .storage() + .ref('/uploadOk.jpeg') + .putFile(`${firebase.storage.Path.DocumentDirectory}/ok.jpeg`); + + uploadTaskSnapshot.state.should.eql(firebase.storage.TaskState.SUCCESS); + uploadTaskSnapshot.bytesTransferred.should.eql(uploadTaskSnapshot.totalBytes); + uploadTaskSnapshot.metadata.should.be.an.Object(); + uploadTaskSnapshot.metadata.contentType.should.equal('image/jpeg'); + + uploadTaskSnapshot = await firebase + .storage() + .ref('/uploadCat.gif') + // uri decode test + .putFile(`${firebase.storage.Path.DocumentDirectory}%2Fcat.gif`); + + uploadTaskSnapshot.metadata.should.be.an.Object(); + uploadTaskSnapshot.metadata.contentType.should.equal('image/gif'); + + if (device.getPlatform() === 'ios') { + uploadTaskSnapshot = await firebase + .storage() + .ref('/uploadHei.heic') + .putFile(`${firebase.storage.Path.DocumentDirectory}/hei.heic`); + + uploadTaskSnapshot.metadata.should.be.an.Object(); + uploadTaskSnapshot.metadata.contentType.should.equal('image/heic'); + } + }); + + it('uploads a file without read permission', async () => { + const uploadTaskSnapshot = await firebase + .storage() + .ref('/writeOnly.jpeg') + .putFile(`${firebase.storage.Path.DocumentDirectory}/ok.jpeg`); + + uploadTaskSnapshot.state.should.eql(firebase.storage.TaskState.SUCCESS); + uploadTaskSnapshot.bytesTransferred.should.eql(uploadTaskSnapshot.totalBytes); + uploadTaskSnapshot.metadata.should.be.an.Object(); + }); + }); + + describe('on()', () => { + before(async () => { + await firebase + .storage() + .ref('/ok.jpeg') + .getFile(`${firebase.storage.Path.DocumentDirectory}/ok.jpeg`); + }); + + it('throws an Error if event is invalid', async () => { + const storageReference = firebase.storage().ref('/ok.jpeg'); + try { + const task = storageReference.putFile('abc'); + task.on('foo'); + return Promise.reject(new Error('Did not error!')); + } catch (error) { + error.message.should.containEql( + `event argument must be a string with a value of 'state_changed'`, + ); + return Promise.resolve(); + } + }); + + it('throws an Error if nextOrObserver is invalid', async () => { + const storageReference = firebase.storage().ref('/ok.jpeg'); + try { + const task = storageReference.putFile('abc'); + task.on('state_changed', 'not a fn'); + return Promise.reject(new Error('Did not error!')); + } catch (error) { + error.message.should.containEql(`'nextOrObserver' must be a Function, an Object or Null`); + return Promise.resolve(); + } + }); + + it('observer calls error callback', async () => { + const ref = firebase.storage().ref('/uploadOk.jpeg'); + const { resolve, promise } = Promise.defer(); + const path = `${firebase.storage.Path.DocumentDirectory}/notFoundFooFile.bar`; + const task = ref.putFile(path); + + task.on('state_changed', { + error: error => { + error.code.should.equal('storage/file-not-found'); + resolve(); + }, + }); + + try { + await task; + } catch (error) { + error.code.should.equal('storage/file-not-found'); + } + + await promise; + }); + + it('observer: calls next callback', async () => { + const ref = firebase.storage().ref('/ok.jpeg'); + const { resolve, promise } = Promise.defer(); + const path = `${firebase.storage.Path.DocumentDirectory}/onDownload.jpeg`; + const task = ref.getFile(path); + + task.on('state_changed', { + next: snapshot => { + if (snapshot.state === firebase.storage.TaskState.SUCCESS) { + resolve(); + } + }, + }); + + await task; + await promise; + }); + + it('observer: calls completion callback', async () => { + const ref = firebase.storage().ref('/ok.jpeg'); + const { resolve, promise } = Promise.defer(); + const path = `${firebase.storage.Path.DocumentDirectory}/onDownload.jpeg`; + const task = ref.getFile(path); + + task.on('state_changed', { + complete: snapshot => { + snapshot.state.should.equal(firebase.storage.TaskState.SUCCESS); + resolve(); + }, + }); + + await task; + await promise; + }); + + it('calls error callback', async () => { + const ref = firebase.storage().ref('/uploadOk.jpeg'); + const { resolve, promise } = Promise.defer(); + const path = `${firebase.storage.Path.DocumentDirectory}/notFoundFooFile.bar`; + const task = ref.putFile(path); + + task.on( + 'state_changed', + null, + error => { + error.code.should.equal('storage/file-not-found'); + resolve(); + }, + null, + ); + + try { + await task; + } catch (error) { + error.code.should.equal('storage/file-not-found'); + } + + await promise; + }); + + it('calls next callback', async () => { + const ref = firebase.storage().ref('/ok.jpeg'); + const { resolve, promise } = Promise.defer(); + const path = `${firebase.storage.Path.DocumentDirectory}/onDownload.jpeg`; + const task = ref.getFile(path); + + task.on('state_changed', snapshot => { + if (snapshot.state === firebase.storage.TaskState.SUCCESS) { + resolve(); + } + }); + + await task; + await promise; + }); + + it('calls completion callback', async () => { + const ref = firebase.storage().ref('/ok.jpeg'); + const { resolve, promise } = Promise.defer(); + const path = `${firebase.storage.Path.DocumentDirectory}/onDownload.jpeg`; + const task = ref.getFile(path); + + task.on('state_changed', null, null, snapshot => { + snapshot.state.should.equal(firebase.storage.TaskState.SUCCESS); + resolve(); + }); + + await task; + await promise; + }); + + it('returns a subscribe fn', async () => { + const ref = firebase.storage().ref('/ok.jpeg'); + const { resolve, promise } = Promise.defer(); + const path = `${firebase.storage.Path.DocumentDirectory}/onDownload.jpeg`; + const task = ref.getFile(path); + + const subscribe = task.on('state_changed'); + + subscribe(null, null, snapshot => { + if (snapshot.state === firebase.storage.TaskState.SUCCESS) { + resolve(); + } + }); + + await task; + await promise; + }); + + it('returns a subscribe fn supporting observer usage syntax', async () => { + const ref = firebase.storage().ref('/ok.jpeg'); + const { resolve, promise } = Promise.defer(); + const path = `${firebase.storage.Path.DocumentDirectory}/onDownload.jpeg`; + const task = ref.getFile(path); + + const subscribe = task.on('state_changed'); + + subscribe({ + complete: snapshot => { + if (snapshot.state === firebase.storage.TaskState.SUCCESS) { + resolve(); + } + }, + }); + + await task; + await promise; + }); + + it('listens to download state', function testRunner() { + this.timeout(25000); + + const ref = firebase.storage().ref('/cat.gif'); + const { resolve, reject, promise } = Promise.defer(); + const path = `${firebase.storage.Path.DocumentDirectory}/onDownload.gif`; + + const unsubscribe = ref.getFile(path).on( + 'state_changed', + snapshot => { + if (snapshot.state === firebase.storage.TaskState.SUCCESS) { + resolve(); + } + }, + error => { + unsubscribe(); + reject(error); + }, + ); + + return promise; + }); + + it('listens to upload state', function testRunner() { + this.timeout(25000); + + const { resolve, reject, promise } = Promise.defer(); + const path = `${firebase.storage.Path.DocumentDirectory}/ok.jpeg`; + const ref = firebase.storage().ref('/uploadOk.jpeg'); + + const unsubscribe = ref.putFile(path).on( + 'state_changed', + snapshot => { + if (snapshot.state === firebase.storage.TaskState.SUCCESS) { + resolve(); + } + }, + error => { + unsubscribe(); + reject(error); + }, + ); + + return promise; + }); + }); + + describe('pause() resume()', () => { + it('successfully pauses and resumes an upload', async function testRunner() { + this.timeout(25000); + + await firebase + .storage() + .ref(device.getPlatform() === 'ios' ? '/1mbTestFile.gif' : '/cat.gif') + .getFile(`${firebase.storage.Path.DocumentDirectory}/pauseUpload.gif`); + + const ref = firebase.storage().ref('/uploadCat.gif'); + const { resolve, reject, promise } = Promise.defer(); + const path = `${firebase.storage.Path.DocumentDirectory}/pauseUpload.gif`; + const uploadTask = ref.putFile(path); + + let hadRunningStatus = false; + let hadPausedStatus = false; + let hadResumedStatus = false; + + uploadTask.on( + 'state_changed', + snapshot => { + // 1) pause when we receive first running event + if (snapshot.state === firebase.storage.TaskState.RUNNING && !hadRunningStatus) { + hadRunningStatus = true; + if (device.getPlatform() === 'android') { + uploadTask.pause(); + } else { + // TODO (salakar) submit bug report to Firebase iOS SDK repo (pausing immediately after the first progress event will fail the upload with an unknown error) + setTimeout(() => { + uploadTask.pause(); + }, 750); + } + } + + // 2) resume when we receive first paused event + if (snapshot.state === firebase.storage.TaskState.PAUSED) { + hadPausedStatus = true; + uploadTask.resume(); + } + + // 3) track that we resumed on 2nd running status whilst paused + if ( + snapshot.state === firebase.storage.TaskState.RUNNING && + hadRunningStatus && + hadPausedStatus && + !hadResumedStatus + ) { + hadResumedStatus = true; + } + + // 4) finally confirm we received all statuses + if (snapshot.state === firebase.storage.TaskState.SUCCESS) { + should.equal(hadRunningStatus, true); + should.equal(hadPausedStatus, true); + should.equal(hadResumedStatus, true); + resolve(); + } + }, + error => { + reject(error); + }, + ); + + await promise; + }); + + it('successfully pauses and resumes a download', function testRunner() { + this.timeout(25000); + + const ref = firebase + .storage() + .ref(device.getPlatform() === 'ios' ? '/1mbTestFile.gif' : '/cat.gif'); + + const { resolve, reject, promise } = Promise.defer(); + + // random file name as Android does not allow overriding if file already exists + const path = `${firebase.storage.Path.DocumentDirectory}/invertase/pauseDownload${Math.round( + Math.random() * 1000, + )}.gif`; + const downloadTask = ref.getFile(path); + + let hadRunningStatus = false; + let hadPausedStatus = false; + let hadResumedStatus = false; + + downloadTask.on( + 'state_changed', + snapshot => { + // TODO(salakar) validate snapshot props + // 1) pause when we receive first running event + if (snapshot.state === firebase.storage.TaskState.RUNNING && !hadRunningStatus) { + hadRunningStatus = true; + downloadTask.pause(); + } + + // 2) resume when we receive first paused event + if (snapshot.state === firebase.storage.TaskState.PAUSED) { + hadPausedStatus = true; + downloadTask.resume(); + } + + // 3) track that we resumed on 2nd running status whilst paused + if ( + snapshot.state === firebase.storage.TaskState.RUNNING && + hadRunningStatus && + hadPausedStatus && + !hadResumedStatus + ) { + hadResumedStatus = true; + } + + // 4) finally confirm we received all statuses + if (snapshot.state === firebase.storage.TaskState.SUCCESS) { + should.equal(hadRunningStatus, true); + should.equal(hadPausedStatus, true); + should.equal(hadResumedStatus, true); + resolve(); + } + }, + error => { + reject(error); + }, + ); + + return promise; + }); + }); + + describe('cancel()', () => { + before(async () => { + await firebase + .storage() + .ref('/1mbTestFile.gif') + .getFile(`${firebase.storage.Path.DocumentDirectory}/pauseUpload.gif`); + }); + + it('successfully cancels an upload', () => { + const ref = firebase.storage().ref('/uploadCat.gif'); + const { resolve, reject, promise } = Promise.defer(); + const path = `${firebase.storage.Path.DocumentDirectory}/pauseUpload.gif`; + const uploadTask = ref.putFile(path); + + let hadRunningStatus = false; + let hadCancelledStatus = false; + + uploadTask.on( + 'state_changed', + snapshot => { + // TODO(salakar) validate snapshot props + // 1) cancel it when we receive first running event + if (snapshot.state === firebase.storage.TaskState.RUNNING && !hadRunningStatus) { + hadRunningStatus = true; + uploadTask.cancel(); + } + + // 2) confirm cancellation + if (snapshot.state === firebase.storage.TaskState.CANCELLED) { + should.equal(hadRunningStatus, true); + hadCancelledStatus = true; + } + + if (snapshot.state === firebase.storage.TaskState.ERROR) { + throw new Error('Should not error if cancelled?'); + } + + if (snapshot.state === firebase.storage.TaskState.SUCCESS) { + reject(new Error('UploadTask did not cancel!')); + } + }, + error => { + should.equal(hadRunningStatus, true); + should.equal(hadCancelledStatus, true); + error.code.should.equal('storage/cancelled'); + error.message.should.containEql('User cancelled the operation.'); + resolve(); + }, + ); + + return promise; + }); + + it('successfully cancels a download', () => { + const ref = firebase.storage().ref('/cat.gif'); + const { resolve, reject, promise } = Promise.defer(); + const path = `${firebase.storage.Path.DocumentDirectory}/cancelDownload.gif`; + const downloadTask = ref.getFile(path); + + let hadRunningStatus = false; + let hadCancelledStatus = false; + + downloadTask.on( + 'state_changed', + snapshot => { + // TODO(salakar) validate snapshot props + // 1) cancel it when we receive first running event + if (snapshot.state === firebase.storage.TaskState.RUNNING && !hadRunningStatus) { + hadRunningStatus = true; + downloadTask.cancel(); + } + + // 2) confirm cancellation + if (snapshot.state === firebase.storage.TaskState.CANCELLED) { + should.equal(hadRunningStatus, true); + hadCancelledStatus = true; + } + + if (snapshot.state === firebase.storage.TaskState.ERROR) { + throw new Error('Should not error if cancelled?'); + } + + if (snapshot.state === firebase.storage.TaskState.SUCCESS) { + reject(new Error('DownloadTask did not cancel!')); + } + }, + error => { + should.equal(hadRunningStatus, true); + should.equal(hadCancelledStatus, true); + error.code.should.equal('storage/cancelled'); + error.message.should.containEql('User cancelled the operation.'); + resolve(); + }, + ); + + return promise; + }); + }); +}); diff --git a/packages/storage/e2e/storage.e2e.js b/packages/storage/e2e/storage.e2e.js new file mode 100644 index 00000000..47ddd0c6 --- /dev/null +++ b/packages/storage/e2e/storage.e2e.js @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +describe('storage()', () => { + describe('namespace', () => { + it('accessible from firebase.app()', () => { + const app = firebase.app(); + should.exist(app.storage); + app.storage().app.should.equal(app); + }); + + it('supports multiple apps', async () => { + firebase.storage().app.name.should.equal('[DEFAULT]'); + + firebase + .storage(firebase.app('secondaryFromNative')) + .app.name.should.equal('secondaryFromNative'); + + firebase + .app('secondaryFromNative') + .storage() + .app.name.should.equal('secondaryFromNative'); + }); + + it('supports specifying a bucket', async () => { + const bucket = 'gs://react-native-firebase-testing'; + const defaultInstance = firebase.storage(); + defaultInstance.app.name.should.equal('[DEFAULT]'); + should.equal( + defaultInstance._customUrlOrRegion, + 'gs://react-native-firebase-testing.appspot.com', + ); + firebase.storage().app.name.should.equal('[DEFAULT]'); + const instanceForBucket = firebase.app().storage(bucket); + instanceForBucket._customUrlOrRegion.should.equal(bucket); + }); + + it('throws an error if an invalid bucket url is provided', async () => { + const bucket = 'invalid://react-native-firebase-testing'; + try { + firebase.app().storage(bucket); + return Promise.reject(new Error('Did not throw.')); + } catch (error) { + error.message.should.containEql(`bucket url must be a string and begin with 'gs://'`); + return Promise.resolve(); + } + }); + + it('uploads to a custom bucket when specified', async () => { + const jsonDerulo = JSON.stringify({ foo: 'bar' }); + const bucket = 'gs://react-native-firebase-testing'; + + const uploadTaskSnapshot = await firebase + .app() + .storage(bucket) + .ref('/putStringCustomBucket.json') + .putString(jsonDerulo, firebase.storage.StringFormat.RAW, { + contentType: 'application/json', + }); + + uploadTaskSnapshot.state.should.eql(firebase.storage.TaskState.SUCCESS); + uploadTaskSnapshot.bytesTransferred.should.eql(uploadTaskSnapshot.totalBytes); + uploadTaskSnapshot.metadata.should.be.an.Object(); + }); + }); + + describe('ref', () => { + it('uses default path if none provided', async () => { + const ref = firebase.storage().ref(); + ref.fullPath.should.equal('/'); + }); + + it('accepts a custom path', async () => { + const ref = firebase.storage().ref('foo/bar/baz.png'); + ref.fullPath.should.equal('foo/bar/baz.png'); + }); + + it('strips leading / from custom path', async () => { + const ref = firebase.storage().ref('/foo/bar/baz.png'); + ref.fullPath.should.equal('foo/bar/baz.png'); + }); + + it('throws an error if custom path not a string', async () => { + try { + firebase.storage().ref({ derp: true }); + return Promise.reject(new Error('Did not throw an Error.')); + } catch (error) { + error.message.should.containEql(`'path' must be a string value`); + return Promise.resolve(); + } + }); + }); + + describe('refFromURL', () => { + it('accepts a custom url', async () => { + const url = 'gs://foo/bar/baz.png'; + const ref = firebase.storage().refFromURL(url); + ref.toString().should.equal(url); + }); + + it('accepts a custom url without a fullPath', async () => { + const url = 'gs://some-bucket'; + const ref = firebase.storage().refFromURL(url); + ref.toString().should.equal(url); + }); + + it('throws an error if url is not a string', async () => { + try { + firebase.storage().refFromURL({ derp: true }); + return Promise.reject(new Error('Did not throw an Error.')); + } catch (error) { + error.message.should.containEql(`'url' must be a string value`); + return Promise.resolve(); + } + }); + + it('throws an error if url does not start with gs://', async () => { + try { + firebase.storage().refFromURL('bs://foo/bar/cat.gif'); + return Promise.reject(new Error('Did not throw an Error.')); + } catch (error) { + error.message.should.containEql(`begin with 'gs://'`); + return Promise.resolve(); + } + }); + }); + + describe('setMaxOperationRetryTime', () => { + it('should set', async () => { + firebase.storage().maxOperationRetryTime.should.equal(120000); + await firebase.storage().setMaxOperationRetryTime(100000); + firebase.storage().maxOperationRetryTime.should.equal(100000); + }); + + it('throws if time is not a number value', async () => { + try { + await firebase.storage().setMaxOperationRetryTime('im a teapot'); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.message.should.containEql(`'time' must be a number value`); + return Promise.resolve(); + } + }); + }); + + describe('setMaxUploadRetryTime', () => { + it('should set', async () => { + firebase.storage().maxUploadRetryTime.should.equal(600000); + await firebase.storage().setMaxUploadRetryTime(120000); + firebase.storage().maxUploadRetryTime.should.equal(120000); + }); + + it('throws if time is not a number value', async () => { + try { + await firebase.storage().setMaxUploadRetryTime('im a teapot'); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.message.should.containEql(`'time' must be a number value`); + return Promise.resolve(); + } + }); + }); + + describe('setMaxDownloadRetryTime', () => { + it('should set', async () => { + firebase.storage().maxDownloadRetryTime.should.equal(600000); + await firebase.storage().setMaxDownloadRetryTime(120000); + firebase.storage().maxDownloadRetryTime.should.equal(120000); + }); + + it('throws if time is not a number value', async () => { + try { + await firebase.storage().setMaxDownloadRetryTime('im a teapot'); + return Promise.reject(new Error('Did not throw')); + } catch (error) { + error.message.should.containEql(`'time' must be a number value`); + return Promise.resolve(); + } + }); + }); +}); diff --git a/packages/storage/ios/RNFBStorage.podspec b/packages/storage/ios/RNFBStorage.podspec new file mode 100644 index 00000000..f008ae96 --- /dev/null +++ b/packages/storage/ios/RNFBStorage.podspec @@ -0,0 +1,23 @@ +require 'json' +package = JSON.parse(File.read('../package.json')) + +Pod::Spec.new do |s| + s.name = "RNFBStorage" + s.version = package["version"] + s.description = package["description"] + s.summary = <<-DESC + A well tested feature rich Firebase implementation for React Native, supporting iOS & Android. + DESC + s.homepage = "http://invertase.io/oss/react-native-firebase" + s.license = package['license'] + s.authors = "Invertase Limited" + s.source = { :git => "https://github.com/invertase/react-native-firebase.git", :tag => "v#{s.version}" } + s.social_media_url = 'http://twitter.com/invertaseio' + s.platform = :ios, "10.0" + s.source_files = 'RNFBStorage/**/*.{h,m}' + s.dependency 'React' + s.dependency 'Firebase/Core', '~> 5.20.2' + s.dependency 'Firebase/Storage', '~> 5.20.2' + s.dependency 'RNFBApp' + s.static_framework = true +end diff --git a/packages/storage/ios/RNFBStorage.xcodeproj/project.pbxproj b/packages/storage/ios/RNFBStorage.xcodeproj/project.pbxproj new file mode 100644 index 00000000..582784b0 --- /dev/null +++ b/packages/storage/ios/RNFBStorage.xcodeproj/project.pbxproj @@ -0,0 +1,371 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + 2744B98621F45429004F8E3F /* RNFBStorageModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 2744B98521F45429004F8E3F /* RNFBStorageModule.m */; }; + 27A35B622268E0AB005BE5A8 /* RNFBStorageTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 27A35B612268E0AB005BE5A8 /* RNFBStorageTask.m */; }; + 27A35B652268E118005BE5A8 /* RNFBStorageDownloadTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 27A35B642268E118005BE5A8 /* RNFBStorageDownloadTask.m */; }; + 27A35B682268E138005BE5A8 /* RNFBStorageUploadTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 27A35B672268E138005BE5A8 /* RNFBStorageUploadTask.m */; }; + 27A35B6B2268E1BE005BE5A8 /* RNFBStorageCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 27A35B6A2268E1BE005BE5A8 /* RNFBStorageCommon.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 2744B98021F45429004F8E3F /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 2744B98221F45429004F8E3F /* libRNFBStorage.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNFBStorage.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 2744B98421F45429004F8E3F /* RNFBStorageModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNFBStorageModule.h; path = RNFBStorage/RNFBStorageModule.h; sourceTree = SOURCE_ROOT; }; + 2744B98521F45429004F8E3F /* RNFBStorageModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RNFBStorageModule.m; path = RNFBStorage/RNFBStorageModule.m; sourceTree = SOURCE_ROOT; }; + 27A35B612268E0AB005BE5A8 /* RNFBStorageTask.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBStorageTask.m; sourceTree = ""; }; + 27A35B632268E0CD005BE5A8 /* RNFBStorageTask.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNFBStorageTask.h; sourceTree = ""; }; + 27A35B642268E118005BE5A8 /* RNFBStorageDownloadTask.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBStorageDownloadTask.m; sourceTree = ""; }; + 27A35B662268E123005BE5A8 /* RNFBStorageDownloadTask.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNFBStorageDownloadTask.h; sourceTree = ""; }; + 27A35B672268E138005BE5A8 /* RNFBStorageUploadTask.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBStorageUploadTask.m; sourceTree = ""; }; + 27A35B692268E143005BE5A8 /* RNFBStorageUploadTask.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNFBStorageUploadTask.h; sourceTree = ""; }; + 27A35B6A2268E1BE005BE5A8 /* RNFBStorageCommon.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBStorageCommon.m; sourceTree = ""; }; + 27A35B6C2268E1C8005BE5A8 /* RNFBStorageCommon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNFBStorageCommon.h; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2744B97F21F45429004F8E3F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2744B97521F452B8004F8E3F /* Products */ = { + isa = PBXGroup; + children = ( + 2744B98221F45429004F8E3F /* libRNFBStorage.a */, + ); + name = Products; + sourceTree = ""; + }; + 2744B98321F45429004F8E3F /* RNFBStorage */ = { + isa = PBXGroup; + children = ( + 2744B98421F45429004F8E3F /* RNFBStorageModule.h */, + 2744B98521F45429004F8E3F /* RNFBStorageModule.m */, + 27A35B612268E0AB005BE5A8 /* RNFBStorageTask.m */, + 27A35B632268E0CD005BE5A8 /* RNFBStorageTask.h */, + 27A35B642268E118005BE5A8 /* RNFBStorageDownloadTask.m */, + 27A35B662268E123005BE5A8 /* RNFBStorageDownloadTask.h */, + 27A35B672268E138005BE5A8 /* RNFBStorageUploadTask.m */, + 27A35B692268E143005BE5A8 /* RNFBStorageUploadTask.h */, + 27A35B6A2268E1BE005BE5A8 /* RNFBStorageCommon.m */, + 27A35B6C2268E1C8005BE5A8 /* RNFBStorageCommon.h */, + ); + path = RNFBStorage; + sourceTree = ""; + }; + 3323F52AAFE26B7384BE4DE3 = { + isa = PBXGroup; + children = ( + 2744B98321F45429004F8E3F /* RNFBStorage */, + 2744B97521F452B8004F8E3F /* Products */, + ); + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 2744B98121F45429004F8E3F /* RNFBStorage */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2744B98821F45429004F8E3F /* Build configuration list for PBXNativeTarget "RNFBStorage" */; + buildPhases = ( + 2744B97E21F45429004F8E3F /* Sources */, + 2744B97F21F45429004F8E3F /* Frameworks */, + 2744B98021F45429004F8E3F /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = RNFBStorage; + productName = RNFBStorage; + productReference = 2744B98221F45429004F8E3F /* libRNFBStorage.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 3323F95273A95DB34F55C6D7 /* Project object */ = { + isa = PBXProject; + attributes = { + CLASSPREFIX = RNFBStorage; + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = Invertase; + TargetAttributes = { + 2744B98121F45429004F8E3F = { + CreatedOnToolsVersion = 10.1; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 3323F1C5716BA966BBBB95A4 /* Build configuration list for PBXProject "RNFBStorage" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 3323F52AAFE26B7384BE4DE3; + productRefGroup = 2744B97521F452B8004F8E3F /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2744B98121F45429004F8E3F /* RNFBStorage */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 2744B97E21F45429004F8E3F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 27A35B622268E0AB005BE5A8 /* RNFBStorageTask.m in Sources */, + 27A35B6B2268E1BE005BE5A8 /* RNFBStorageCommon.m in Sources */, + 2744B98621F45429004F8E3F /* RNFBStorageModule.m in Sources */, + 27A35B652268E118005BE5A8 /* RNFBStorageDownloadTask.m in Sources */, + 27A35B682268E138005BE5A8 /* RNFBStorageUploadTask.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 2744B98921F45429004F8E3F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 2744B98A21F45429004F8E3F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 3323F77D701E1896E6D239CF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "${BUILT_PRODUCTS_DIR}/**", + "${SRCROOT}/../../../ios/Firebase/**", + "$(FIREBASE_SEARCH_PATH)/Firebase/**", + "$(SRCROOT)/../../../ios/Pods/FirebaseStorage/Frameworks", + "$(SRCROOT)/../../../tests/ios/Pods/FirebaseStorage/Frameworks", + ); + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(REACT_SEARCH_PATH)/React/**", + "$(SRCROOT)/../../react-native/React/**", + "$(SRCROOT)/../../react-native-firebase/ios/**", + "$(FIREBASE_SEARCH_PATH)/Firebase/**", + "${SRCROOT}/../../../ios/Firebase/**", + "${SRCROOT}/../../../ios/Pods/Headers/Public/**", + "${SRCROOT}/../../../tests/ios/Pods/Headers/Public/**", + "$(SRCROOT)/../../../node_modules/react-native/React/**", + "$(SRCROOT)/../../../node_modules/react-native-firebase/ios/**", + "$(SRCROOT)/../../../packages/app/ios/**", + ); + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LIBRARY_SEARCH_PATHS = "$(inherited)"; + MACH_O_TYPE = staticlib; + OTHER_LDFLAGS = "$(inherited)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 3323F7E33E1559A2B9826720 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "${BUILT_PRODUCTS_DIR}/**", + "${SRCROOT}/../../../ios/Firebase/**", + "$(FIREBASE_SEARCH_PATH)/Firebase/**", + "$(SRCROOT)/../../../ios/Pods/FirebaseStorage/Frameworks", + ); + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(REACT_SEARCH_PATH)/React/**", + "$(SRCROOT)/../../react-native/React/**", + "$(SRCROOT)/../../react-native-firebase/ios/**", + "$(FIREBASE_SEARCH_PATH)/Firebase/**", + "${SRCROOT}/../../../ios/Firebase/**", + "${SRCROOT}/../../../ios/Pods/Headers/Public/**", + "${SRCROOT}/../../../tests/ios/Pods/Headers/Public/**", + "$(SRCROOT)/../../../node_modules/react-native/React/**", + "$(SRCROOT)/../../../node_modules/react-native-firebase/ios/**", + "$(SRCROOT)/../../../packages/app/ios/**", + ); + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LIBRARY_SEARCH_PATHS = "$(inherited)"; + MACH_O_TYPE = staticlib; + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = "$(inherited)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2744B98821F45429004F8E3F /* Build configuration list for PBXNativeTarget "RNFBStorage" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2744B98921F45429004F8E3F /* Debug */, + 2744B98A21F45429004F8E3F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3323F1C5716BA966BBBB95A4 /* Build configuration list for PBXProject "RNFBStorage" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3323F7E33E1559A2B9826720 /* Debug */, + 3323F77D701E1896E6D239CF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 3323F95273A95DB34F55C6D7 /* Project object */; +} diff --git a/packages/storage/ios/RNFBStorage.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/storage/ios/RNFBStorage.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/packages/storage/ios/RNFBStorage.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/packages/storage/ios/RNFBStorage.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/storage/ios/RNFBStorage.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/packages/storage/ios/RNFBStorage.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/storage/ios/RNFBStorage.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/storage/ios/RNFBStorage.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..0c67376e --- /dev/null +++ b/packages/storage/ios/RNFBStorage.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/storage/ios/RNFBStorage.xcodeproj/xcshareddata/IDETemplateMacros.plist b/packages/storage/ios/RNFBStorage.xcodeproj/xcshareddata/IDETemplateMacros.plist new file mode 100644 index 00000000..63f0a6e5 --- /dev/null +++ b/packages/storage/ios/RNFBStorage.xcodeproj/xcshareddata/IDETemplateMacros.plist @@ -0,0 +1,24 @@ + + + + + FILEHEADER + +/** + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + + diff --git a/packages/storage/ios/RNFBStorage/RNFBStorageCommon.h b/packages/storage/ios/RNFBStorage/RNFBStorageCommon.h new file mode 100644 index 00000000..1c38a4a3 --- /dev/null +++ b/packages/storage/ios/RNFBStorage/RNFBStorageCommon.h @@ -0,0 +1,66 @@ +// +/** + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#import + +@interface RNFBStorageCommon : NSObject + ++ (BOOL)isRemoteAsset:(NSString *)localFilePath; + ++ (BOOL)unused_isHeic:(NSString *)localFilePath; + ++ (NSDictionary *)metadataToDict:(FIRStorageMetadata *)metadata; + ++ (PHAsset *)fetchAssetForPath:(NSString *)localFilePath; + ++ (NSString *)utiToMimeType:(NSString *)dataUTI; + ++ (NSURL *)createTempFileUrl; + ++ (NSString *)mimeTypeForPath:(NSString *)localFilePath; + ++ (NSData *)NSDataFromUploadString:(NSString *)string format:(NSString *)format; + ++ (void)NSURLForLocalFilePath:(NSString *)localFilePath completion:(void (^)( + NSArray *errorCodeMessageArray, + NSURL *temporaryFileUrl, + NSString *contentType +))completion; + ++ (void)downloadAsset:(PHAsset *)asset toURL:(NSURL *)url completion:(void (^)( + NSArray *errorCodeMessageArray, + NSString *contentType +))completion; + ++ (NSDictionary *)getStorageEventDictionary:(NSDictionary *)eventBody internalEventName:(NSString *)internalEventName appName:(NSString *)appName taskId:(NSNumber *)taskId; + ++ (NSDictionary *)buildErrorSnapshotDict:(NSError *)error taskSnapshotDict:(NSMutableDictionary *)taskSnapshotDict; + ++ (NSDictionary *)buildErrorSnapshotDictFromCodeAndMessage:(NSArray *)codeAndMessage taskSnapshotDict:(NSMutableDictionary *)taskSnapshotDict; + ++ (NSMutableDictionary *)getUploadTaskAsDictionary:(FIRStorageTaskSnapshot *)task; + ++ (NSMutableDictionary *)getDownloadTaskAsDictionary:(FIRStorageTaskSnapshot *)task; + ++ (NSString *)getTaskStatus:(FIRStorageTaskStatus)status; + ++ (FIRStorageMetadata *)buildMetadataFromMap:(NSDictionary *)metadata; + ++ (NSArray *)getErrorCodeMessage:(NSError *)error; + +@end + diff --git a/packages/storage/ios/RNFBStorage/RNFBStorageCommon.m b/packages/storage/ios/RNFBStorage/RNFBStorageCommon.m new file mode 100644 index 00000000..25f98202 --- /dev/null +++ b/packages/storage/ios/RNFBStorage/RNFBStorageCommon.m @@ -0,0 +1,426 @@ +// +/** + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import +#import + +#import "RNFBStorageCommon.h" +#import "RNFBSharedUtils.h" + +@implementation RNFBStorageCommon + ++ (BOOL)isRemoteAsset:(NSString *)localFilePath { + return [localFilePath hasPrefix:@"assets-library://"] || [localFilePath hasPrefix:@"ph://"]; +} + ++ (BOOL)unused_isHeic:(NSString *)localFilePath { + return [[localFilePath pathExtension] caseInsensitiveCompare:@"heic"] == NSOrderedSame; +} + ++ (PHAsset *)fetchAssetForPath:(NSString *)localFilePath { + PHAsset *asset; + + if ([localFilePath hasPrefix:@"assets-library://"]) { + NSURL *localFile = [[NSURL alloc] initWithString:localFilePath]; + asset = [[PHAsset fetchAssetsWithALAssetURLs:@[localFile] options:nil] firstObject]; + } else { + NSURLComponents *components = [NSURLComponents componentsWithString:localFilePath]; + NSArray *queryItems = components.queryItems; + NSString *assetId = [self valueForKey:@"id" fromQueryItems:queryItems]; + asset = [[PHAsset fetchAssetsWithLocalIdentifiers:@[assetId] options:nil] firstObject]; + } + + return asset; +} + ++ (NSData *)NSDataFromUploadString:(NSString *)string format:(NSString *)format { + if ([format isEqualToString:@"base64"]) { + return [[NSData alloc] initWithBase64EncodedString:string options:0]; + } + + // convert to base64 + if ([format isEqualToString:@"base64url"]) { + NSString *base64Encoded = string; + + base64Encoded = [base64Encoded stringByReplacingOccurrencesOfString:@"-" withString:@"+"]; + base64Encoded = [base64Encoded stringByReplacingOccurrencesOfString:@"_" withString:@"/"]; + + // add mandatory base64 encoding padding + while (base64Encoded.length % 4 != 0) { + base64Encoded = [base64Encoded stringByAppendingString:@"="]; + } + + return [[NSData alloc] initWithBase64EncodedString:base64Encoded options:0]; + } + + return nil; +} + ++ (NSString *)valueForKey:(NSString *)key fromQueryItems:(NSArray *)queryItems { + NSPredicate *predicate = [NSPredicate predicateWithFormat:@"name=%@", key]; + NSURLQueryItem *queryItem = [[queryItems filteredArrayUsingPredicate:predicate] firstObject]; + return queryItem.value; +} + ++ (NSString *)utiToMimeType:(NSString *)dataUTI { + return (__bridge_transfer NSString *) UTTypeCopyPreferredTagWithClass((__bridge CFStringRef) dataUTI, + kUTTagClassMIMEType); +} + ++ (NSURL *)createTempFileUrl { + NSString *filename = [NSString stringWithFormat:@"%@.tmp", [[NSProcessInfo processInfo] globallyUniqueString]]; + return [[NSURL fileURLWithPath:NSTemporaryDirectory()] URLByAppendingPathComponent:filename]; +} + ++ (NSString *)mimeTypeForPath:(NSString *)localFilePath { + CFStringRef UTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, + (__bridge CFStringRef) [localFilePath pathExtension], + NULL); + CFStringRef mimeType = UTTypeCopyPreferredTagWithClass(UTI, kUTTagClassMIMEType); + CFRelease(UTI); + + if (!mimeType) { + return @"application/octet-stream"; + } + + return (__bridge_transfer NSString *) mimeType; +} + ++ (void)NSURLForLocalFilePath:(NSString *)localFilePath completion:(void (^)( + NSArray *errorCodeMessageArray, + NSURL *temporaryFileUrl, + NSString *contentType +))completion { + if ([RNFBStorageCommon isRemoteAsset:localFilePath]) { + PHAsset *asset = [RNFBStorageCommon fetchAssetForPath:localFilePath]; + NSURL *temporaryFileUrl = [RNFBStorageCommon createTempFileUrl]; + [RNFBStorageCommon downloadAsset:asset toURL:temporaryFileUrl completion:^( + NSArray *errorCodeMessageArray, + NSString *contentType + ) { + completion(errorCodeMessageArray, temporaryFileUrl, contentType); + }]; + } else { + if (![[NSFileManager defaultManager] fileExistsAtPath:localFilePath]) { + completion(@[@"file-not-found", @"The local file specified does not exist on the device."], nil, nil); + } else { + completion(nil, [NSURL fileURLWithPath:localFilePath], [RNFBStorageCommon mimeTypeForPath:localFilePath]); + } + } +} + ++ (void)downloadAsset:(PHAsset *)asset toURL:(NSURL *)url completion:(void (^)( + NSArray *errorCodeMessageArray, + NSString *contentType +))completion { + if (asset.mediaType == PHAssetMediaTypeImage && (asset.mediaSubtypes & PHAssetMediaSubtypePhotoLive)) { + PHLivePhotoRequestOptions *options = [PHLivePhotoRequestOptions new]; + options.networkAccessAllowed = YES; + [[PHImageManager defaultManager] requestLivePhotoForAsset:asset targetSize:CGSizeZero contentMode:PHImageContentModeAspectFill options:options resultHandler:^( + PHLivePhoto *_Nullable livePhoto, + NSDictionary *_Nullable info + ) { + if (info[PHImageErrorKey] != nil) { + completion(@[@"ios-asset-failure", @"Live photo request failed."], nil); + return; + } + + NSData *livePhotoData = [NSKeyedArchiver archivedDataWithRootObject:livePhoto]; + if ([[NSFileManager defaultManager] createFileAtPath:url.path contents:livePhotoData attributes:nil]) { + // TODO(salakar) figure out how to get the content type? + completion(nil, nil); + } else { + completion(@[@"ios-asset-failure", @"Failed to create temporary live photo file."], nil); + } + }]; + } else if (asset.mediaType == PHAssetMediaTypeImage) { + PHImageRequestOptions *options = [PHImageRequestOptions new]; + options.networkAccessAllowed = YES; + + [[PHImageManager defaultManager] requestImageDataForAsset:asset options:options resultHandler:^( + NSData *_Nullable imageData, + NSString *_Nullable dataUTI, + UIImageOrientation orientation, + NSDictionary *_Nullable info + ) { + if (info[PHImageErrorKey] != nil) { + completion(@[@"ios-asset-failure", @"Image request failed."], nil); + return; + } + + NSString *contentType = nil; + NSData *finalData = nil; + + // TODO(salakar) handle ALL image types in UTCoreTypes, e.g. kUTTypeTIFF & kUTTypeBMP missing + // TODO(salakar) so their original types are preserved to match Android behaviour + if ( + UTTypeConformsTo((__bridge CFStringRef) dataUTI, kUTTypeJPEG) || + UTTypeConformsTo((__bridge CFStringRef) dataUTI, kUTTypePNG) || + UTTypeConformsTo((__bridge CFStringRef) dataUTI, kUTTypeGIF) + ) { + contentType = [self utiToMimeType:dataUTI]; + finalData = imageData; + } else { + // all other types are converted to JPEG, e.g. HEIC + CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef) imageData, NULL); + NSDictionary *imageInfo = (__bridge NSDictionary *) CGImageSourceCopyPropertiesAtIndex(source, 0, NULL); + NSDictionary *imageMetadata = [imageInfo copy]; + NSMutableData *imageDataJPEG = [NSMutableData data]; + CGImageDestinationRef destination = + CGImageDestinationCreateWithData((__bridge CFMutableDataRef) imageDataJPEG, kUTTypeJPEG, 1, NULL); + CGImageDestinationAddImageFromSource(destination, source, 0, (__bridge CFDictionaryRef) imageMetadata); + CGImageDestinationFinalize(destination); + contentType = @"image/jpeg"; + finalData = imageDataJPEG; + } + + if ([[NSFileManager defaultManager] createFileAtPath:url.path contents:finalData attributes:nil]) { + completion(nil, contentType); + } else { + completion(@[@"ios-asset-failure", @"Failed to create image file."], nil); + } + }]; + } else if (asset.mediaType == PHAssetMediaTypeVideo) { + PHVideoRequestOptions *options = [PHVideoRequestOptions new]; + options.networkAccessAllowed = YES; + [[PHImageManager defaultManager] requestExportSessionForVideo:asset options:options exportPreset:AVAssetExportPresetMediumQuality resultHandler:^( + AVAssetExportSession *_Nullable exportSession, + NSDictionary *_Nullable info + ) { + if (info[PHImageErrorKey] != nil) { + completion(@[@"ios-asset-failure", @"Video export request failed."], nil); + return; + } + + exportSession.outputURL = url; + + NSArray *resources = [PHAssetResource assetResourcesForAsset:asset]; + for (PHAssetResource *resource in resources) { + exportSession.outputFileType = resource.uniformTypeIdentifier; + if (exportSession.outputFileType != nil) + break; + } + + [exportSession exportAsynchronouslyWithCompletionHandler:^{ + if (exportSession.status == AVAssetExportSessionStatusCompleted) { + completion(nil, [self utiToMimeType:exportSession.outputFileType]); + } else { + completion(@[@"ios-asset-failure", @"Video export request session failed."], nil); + } + }]; + }]; + } else { + completion(@[@"ios-asset-failure", @"Unknown or unsupported asset media type."], nil); + } +} + ++ (NSDictionary *)getStorageEventDictionary:(NSDictionary *)eventBody internalEventName:(NSString *)internalEventName appName:(NSString *)appName taskId:(NSNumber *)taskId { + return @{ + @"taskId": @([taskId doubleValue]), + @"body": eventBody, + @"appName": [RNFBSharedUtils getAppJavaScriptName:appName], + @"eventName": internalEventName, + }; +} + ++ (NSDictionary *)buildErrorSnapshotDict:(NSError *)error taskSnapshotDict:(NSMutableDictionary *)taskSnapshotDict { + NSArray *codeAndMessage = [self getErrorCodeMessage:error]; + taskSnapshotDict[@"error"] = @{ + @"code": (NSString *) codeAndMessage[0], + @"message": (NSString *) codeAndMessage[1], + @"nativeErrorMessage": [error localizedDescription] + }; + return taskSnapshotDict; +} + ++ (NSDictionary *)buildErrorSnapshotDictFromCodeAndMessage:(NSArray *)codeAndMessage taskSnapshotDict:(NSMutableDictionary *)taskSnapshotDict { + taskSnapshotDict[@"error"] = @{ + @"code": (NSString *) codeAndMessage[0], + @"message": (NSString *) codeAndMessage[1], + }; + return taskSnapshotDict; +} + ++ (NSDictionary *)metadataToDict:(FIRStorageMetadata *)metadata { + NSMutableDictionary *storageMetadata = [[metadata dictionaryRepresentation] mutableCopy]; + if (storageMetadata == nil) { + return nil; + } + + storageMetadata[@"fullPath"] = metadata.path; + + if (metadata.cacheControl == nil) { + storageMetadata[@"cacheControl"] = [NSNull null]; + } + + if (metadata.contentLanguage == nil) { + storageMetadata[@"contentLanguage"] = [NSNull null]; + } + + if (metadata.contentEncoding == nil) { + storageMetadata[@"contentEncoding"] = [NSNull null]; + } + + if (metadata.contentDisposition == nil) { + storageMetadata[@"contentDisposition"] = [NSNull null]; + } + + if (metadata.contentType == nil) { + storageMetadata[@"contentType"] = [NSNull null]; + } + + if (metadata.md5Hash == nil) { + storageMetadata[@"md5Hash"] = [NSNull null]; + } + + if (metadata.customMetadata == nil) { + storageMetadata[@"customMetadata"] = [NSNull null]; + } else { + // name comes through as 'metadata' + storageMetadata[@"customMetadata"] = metadata.customMetadata; + [storageMetadata removeObjectForKey:@"metadata"]; + } + + return storageMetadata; +} + ++ (NSMutableDictionary *)getUploadTaskAsDictionary:(FIRStorageTaskSnapshot *)task { + if (task == nil) { + return [@{ + @"metadata": [NSNull null], + @"bytesTransferred": @(0), + @"state": @"error", + @"totalBytes": @(0) + } mutableCopy]; + } + + NSDictionary *storageMetadata = [self metadataToDict:task.metadata]; + + NSString* state = [self getTaskStatus:task.status]; + if (task.error != nil && task.error.code == FIRStorageErrorCodeCancelled) { + state = @"cancelled"; + } + + return [@{ + @"bytesTransferred": @(task.progress.completedUnitCount), + @"metadata": storageMetadata, + @"state": state, + @"totalBytes": @(task.progress.totalUnitCount) + } mutableCopy]; +} + ++ (NSMutableDictionary *)getDownloadTaskAsDictionary:(FIRStorageTaskSnapshot *)task { + if (task != nil) { + NSString* state = [self getTaskStatus:task.status]; + if (task.error != nil && task.error.code == FIRStorageErrorCodeCancelled) { + state = @"cancelled"; + } + return [@{ + @"bytesTransferred": @(task.progress.completedUnitCount), + @"state": state, + @"totalBytes": @(task.progress.totalUnitCount) + } mutableCopy]; + } else { + return [@{ + @"bytesTransferred": @(0), + @"state": [self getTaskStatus:nil], + @"totalBytes": @(0) + } mutableCopy]; + } +} + ++ (NSString *)getTaskStatus:(FIRStorageTaskStatus)status { + if (status == nil) + return @"unknown"; + if (status == FIRStorageTaskStatusResume || status == FIRStorageTaskStatusProgress) { + return @"running"; + } else if (status == FIRStorageTaskStatusPause) { + return @"paused"; + } else if (status == FIRStorageTaskStatusSuccess) { + return @"success"; + } else if (status == FIRStorageTaskStatusFailure) { + return @"error"; + } else { + return @"unknown"; + } +} + ++ (FIRStorageMetadata *)buildMetadataFromMap:(NSDictionary *)metadata { + FIRStorageMetadata *storageMetadata = [[FIRStorageMetadata alloc] initWithDictionary:metadata]; + storageMetadata.customMetadata = [metadata[@"customMetadata"] mutableCopy]; + return storageMetadata; +} + ++ (NSArray *)getErrorCodeMessage:(NSError *)error { + NSString *code = @"unknown"; + + if (error == nil) { + return @[code, @"An unknown error has occurred."]; + } + + NSString *message = [error localizedDescription]; + NSDictionary *userInfo = [error userInfo]; + NSError *underlyingError = userInfo[NSUnderlyingErrorKey]; + NSString *underlyingErrorDescription = [underlyingError localizedDescription]; + + switch (error.code) { + case FIRStorageErrorCodeUnknown: + if ([underlyingErrorDescription isEqualToString:@"The operation couldn’t be completed. Permission denied"]) { + code = @"invalid-device-file-path"; + message = @"The specified device file path is invalid or is restricted."; + } else { + message = @"An unknown error has occurred."; + } + break; + case FIRStorageErrorCodeObjectNotFound:code = @"object-not-found"; + message = @"No object exists at the desired reference."; + break; + case FIRStorageErrorCodeBucketNotFound:code = @"bucket-not-found"; + message = @"No bucket is configured for Firebase Storage."; + break; + case FIRStorageErrorCodeProjectNotFound:code = @"project-not-found"; + message = @"No project is configured for Firebase Storage."; + break; + case FIRStorageErrorCodeQuotaExceeded:code = @"quota-exceeded"; + message = @"Quota on your Firebase Storage bucket has been exceeded."; + break; + case FIRStorageErrorCodeUnauthenticated:code = @"unauthenticated"; + message = @"User is unauthenticated. Authenticate and try again."; + break; + case FIRStorageErrorCodeUnauthorized:code = @"unauthorized"; + message = @"User is not authorized to perform the desired action."; + break; + case FIRStorageErrorCodeRetryLimitExceeded:code = @"retry-limit-exceeded"; + message = @"The maximum time limit on an operation (upload, download, delete, etc.) has been exceeded."; + break; + case FIRStorageErrorCodeNonMatchingChecksum:code = @"non-matching-checksum"; + message = @"File on the client does not match the checksum of the file received by the server."; + break; + case FIRStorageErrorCodeDownloadSizeExceeded:code = @"download-size-exceeded"; + message = @"Size of the downloaded file exceeds the amount of memory allocated for the download."; + break; + case FIRStorageErrorCodeCancelled:code = @"cancelled"; + message = @"User cancelled the operation."; + break; + default:break; + } + + return @[code, message]; +} + +@end diff --git a/packages/storage/ios/RNFBStorage/RNFBStorageModule.h b/packages/storage/ios/RNFBStorage/RNFBStorageModule.h new file mode 100644 index 00000000..e260846f --- /dev/null +++ b/packages/storage/ios/RNFBStorage/RNFBStorageModule.h @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import + +#import + +@interface RNFBStorageModule : NSObject +@end diff --git a/packages/storage/ios/RNFBStorage/RNFBStorageModule.m b/packages/storage/ios/RNFBStorage/RNFBStorageModule.m new file mode 100644 index 00000000..b285dfc6 --- /dev/null +++ b/packages/storage/ios/RNFBStorage/RNFBStorageModule.m @@ -0,0 +1,501 @@ +/** + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import +#import + +#import "RNFBStorageModule.h" +#import "RNFBRCTEventEmitter.h" +#import "RNFBStorageCommon.h" +#import "RNFBSharedUtils.h" + +static NSString *const RNFB_STORAGE_EVENT = @"storage_event"; +static NSString *const RNFB_STORAGE_STATE_CHANGED = @"state_changed"; +static NSString *const RNFB_STORAGE_UPLOAD_SUCCESS = @"upload_success"; +static NSString *const RNFB_STORAGE_UPLOAD_FAILURE = @"upload_failure"; +static NSString *const RNFB_STORAGE_DOWNLOAD_SUCCESS = @"download_success"; +static NSString *const RNFB_STORAGE_DOWNLOAD_FAILURE = @"download_failure"; + +static NSMutableDictionary *PENDING_TASKS; + +@implementation RNFBStorageModule +#pragma mark - +#pragma mark Module Setup +RCT_EXPORT_MODULE(); + ++ (BOOL)requiresMainQueueSetup { + return YES; +} + +- (id)init { + self = [super init]; + + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + PENDING_TASKS = [[NSMutableDictionary alloc] init]; + }); + + return self; +} + +- (void)dealloc { + for (NSString *key in PENDING_TASKS) { + [PENDING_TASKS removeObjectForKey:key]; + } +} + +- (void)invalidate { + for (NSString *key in PENDING_TASKS) { + [PENDING_TASKS removeObjectForKey:key]; + } +} + +#pragma mark - +#pragma mark Firebase Storage Methods + +/** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#delete + */ +RCT_EXPORT_METHOD(delete: + (FIRApp *) firebaseApp + : (NSString *) url + : (RCTPromiseResolveBlock) resolve + : (RCTPromiseRejectBlock) reject +) { + FIRStorageReference *storageReference = [self getReferenceFromUrl:url app:firebaseApp]; + + [storageReference deleteWithCompletion:^(NSError *_Nullable error) { + if (error != nil) { + [self promiseRejectStorageException:reject error:error]; + } else { + resolve([NSNull null]); + } + }]; +} + +/** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#getDownloadURL + */ +RCT_EXPORT_METHOD(getDownloadURL: + (FIRApp *) firebaseApp + : (NSString *) url + : (RCTPromiseResolveBlock) resolve + : (RCTPromiseRejectBlock) reject +) { + FIRStorageReference *storageReference = [self getReferenceFromUrl:url app:firebaseApp]; + + [storageReference downloadURLWithCompletion:^(NSURL *_Nullable URL, NSError *_Nullable error) { + if (error != nil) { + [self promiseRejectStorageException:reject error:error]; + } else { + resolve([URL absoluteString]); + } + }]; +} + +/** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#getMetadata + */ +RCT_EXPORT_METHOD(getMetadata: + (FIRApp *) firebaseApp + : (NSString *) url + : (RCTPromiseResolveBlock) resolve + : (RCTPromiseRejectBlock) reject +) { + FIRStorageReference *storageReference = [self getReferenceFromUrl:url app:firebaseApp]; + + [storageReference metadataWithCompletion:^(FIRStorageMetadata *_Nullable metadata, NSError *_Nullable error) { + if (error != nil) { + [self promiseRejectStorageException:reject error:error]; + } else { + resolve([RNFBStorageCommon metadataToDict:metadata]); + } + }]; +} + +/** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#updateMetadata + */ +RCT_EXPORT_METHOD(updateMetadata: + (FIRApp *) firebaseApp + : (NSString *) url + : (NSDictionary *) metadata + : (RCTPromiseResolveBlock) resolve + : (RCTPromiseRejectBlock) reject +) { + FIRStorageReference *storageReference = [self getReferenceFromUrl:url app:firebaseApp]; + FIRStorageMetadata *storageMetadata = [RNFBStorageCommon buildMetadataFromMap:metadata]; + + [storageReference updateMetadata:storageMetadata completion:^( + FIRStorageMetadata *_Nullable metadata, + NSError *_Nullable error + ) { + if (error != nil) { + [self promiseRejectStorageException:reject error:error]; + } else { + resolve([RNFBStorageCommon metadataToDict:metadata]); + } + }]; +} + +/** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Storage#setMaxDownloadRetryTime + */ +RCT_EXPORT_METHOD(setMaxDownloadRetryTime: + (FIRApp *) firebaseApp + : (nonnull NSNumber *) milliseconds + : (RCTPromiseResolveBlock) resolve + : (RCTPromiseRejectBlock) reject +) { + [[FIRStorage storageForApp:firebaseApp] setMaxDownloadRetryTime:[milliseconds doubleValue] / 1000]; + resolve([NSNull null]); +} + + +/** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Storage#setMaxOperationRetryTime + */ +RCT_EXPORT_METHOD(setMaxOperationRetryTime: + (FIRApp *) firebaseApp + : (nonnull NSNumber *) milliseconds + : (RCTPromiseResolveBlock) resolve + : (RCTPromiseRejectBlock) reject +) { + [[FIRStorage storageForApp:firebaseApp] setMaxOperationRetryTime:[milliseconds doubleValue] / 1000]; + resolve([NSNull null]); +} + +/** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Storage#setMaxUploadRetryTime + */ +RCT_EXPORT_METHOD(setMaxUploadRetryTime: + (FIRApp *) firebaseApp + : (nonnull NSNumber *) milliseconds + : (RCTPromiseResolveBlock) resolve + : (RCTPromiseRejectBlock) reject +) { + [[FIRStorage storageForApp:firebaseApp] setMaxUploadRetryTime:[milliseconds doubleValue] / 1000]; + resolve([NSNull null]); +} + +/** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#downloadFile + */ +RCT_EXPORT_METHOD(getFile: + (FIRApp *) firebaseApp + : (NSString *) url + : (NSString *) localFilePath + : (nonnull NSNumber *) taskId + : (RCTPromiseResolveBlock) resolve + : (RCTPromiseRejectBlock) reject +) { + FIRStorageReference *storageReference = [self getReferenceFromUrl:url app:firebaseApp]; + NSURL *localFile = [NSURL fileURLWithPath:localFilePath]; + + __block FIRStorageDownloadTask *downloadTask; + RCTUnsafeExecuteOnMainQueueSync(^{ + downloadTask = [storageReference writeToFile:localFile]; + }); + + PENDING_TASKS[taskId] = downloadTask; + + // download started or resumed + [downloadTask observeStatus:FIRStorageTaskStatusResume handler:^(FIRStorageTaskSnapshot *snapshot) { + NSDictionary *eventBody = [RNFBStorageCommon getDownloadTaskAsDictionary:snapshot]; + NSDictionary *event = + [RNFBStorageCommon getStorageEventDictionary:eventBody internalEventName:RNFB_STORAGE_STATE_CHANGED appName:firebaseApp.name taskId:taskId]; + [[RNFBRCTEventEmitter shared] sendEventWithName:RNFB_STORAGE_EVENT body:event]; + }]; + + // download paused + [downloadTask observeStatus:FIRStorageTaskStatusPause handler:^(FIRStorageTaskSnapshot *snapshot) { + NSDictionary *eventBody = [RNFBStorageCommon getDownloadTaskAsDictionary:snapshot]; + NSDictionary *event = + [RNFBStorageCommon getStorageEventDictionary:eventBody internalEventName:RNFB_STORAGE_STATE_CHANGED appName:firebaseApp.name taskId:taskId]; + [[RNFBRCTEventEmitter shared] sendEventWithName:RNFB_STORAGE_EVENT body:event]; + }]; + + // download reported progress + [downloadTask observeStatus:FIRStorageTaskStatusProgress handler:^(FIRStorageTaskSnapshot *snapshot) { + NSDictionary *eventBody = [RNFBStorageCommon getDownloadTaskAsDictionary:snapshot]; + NSDictionary *event = + [RNFBStorageCommon getStorageEventDictionary:eventBody internalEventName:RNFB_STORAGE_STATE_CHANGED appName:firebaseApp.name taskId:taskId]; + [[RNFBRCTEventEmitter shared] sendEventWithName:RNFB_STORAGE_EVENT body:event]; + }]; + + // download completed successfully + [downloadTask observeStatus:FIRStorageTaskStatusSuccess handler:^(FIRStorageTaskSnapshot *snapshot) { + [PENDING_TASKS removeObjectForKey:taskId]; + + // state_changed + NSDictionary *stateChangedEventBody = [RNFBStorageCommon getDownloadTaskAsDictionary:snapshot]; + NSDictionary *stateChangedEvent = + [RNFBStorageCommon getStorageEventDictionary:stateChangedEventBody internalEventName:RNFB_STORAGE_STATE_CHANGED appName:firebaseApp.name taskId:taskId]; + [[RNFBRCTEventEmitter shared] sendEventWithName:RNFB_STORAGE_EVENT body:stateChangedEvent]; + + // download_success + NSDictionary *eventBody = [RNFBStorageCommon getDownloadTaskAsDictionary:snapshot]; + NSDictionary *event = + [RNFBStorageCommon getStorageEventDictionary:eventBody internalEventName:RNFB_STORAGE_DOWNLOAD_SUCCESS appName:firebaseApp.name taskId:taskId]; + [[RNFBRCTEventEmitter shared] sendEventWithName:RNFB_STORAGE_EVENT body:event]; + resolve(eventBody); + }]; + + // download task failed + [downloadTask observeStatus:FIRStorageTaskStatusFailure handler:^(FIRStorageTaskSnapshot *snapshot) { + [PENDING_TASKS removeObjectForKey:taskId]; + + // state_changed + NSDictionary *stateChangedEventBody = [RNFBStorageCommon getDownloadTaskAsDictionary:snapshot]; + NSDictionary *stateChangedEvent = + [RNFBStorageCommon getStorageEventDictionary:stateChangedEventBody internalEventName:RNFB_STORAGE_STATE_CHANGED appName:firebaseApp.name taskId:taskId]; + [[RNFBRCTEventEmitter shared] sendEventWithName:RNFB_STORAGE_EVENT body:stateChangedEvent]; + + // download_failed + NSMutableDictionary *taskSnapshotDict = [RNFBStorageCommon getDownloadTaskAsDictionary:snapshot]; + NSDictionary + *eventBody = [RNFBStorageCommon buildErrorSnapshotDict:snapshot.error taskSnapshotDict:taskSnapshotDict]; + NSDictionary *event = + [RNFBStorageCommon getStorageEventDictionary:eventBody internalEventName:RNFB_STORAGE_DOWNLOAD_FAILURE appName:firebaseApp.name taskId:taskId]; + [[RNFBRCTEventEmitter shared] sendEventWithName:RNFB_STORAGE_EVENT body:event]; + + [self promiseRejectStorageException:reject error:snapshot.error]; + }]; +} + + +/** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#putFile + */ +RCT_EXPORT_METHOD(putFile: + (FIRApp *) firebaseApp + : (NSString *) url + : (NSString *) localFilePath + : (NSDictionary *) metadata + : (nonnull NSNumber *) taskId + : (RCTPromiseResolveBlock) resolve + : (RCTPromiseRejectBlock) reject +) { + FIRStorageMetadata *storageMetadata = [RNFBStorageCommon buildMetadataFromMap:metadata]; + FIRStorageReference *storageReference = [self getReferenceFromUrl:url app:firebaseApp]; + + [RNFBStorageCommon NSURLForLocalFilePath:localFilePath completion:^( + NSArray *errorCodeMessageArray, + NSURL *temporaryFileUrl, + NSString *contentType + ) { + if (errorCodeMessageArray != nil) { + // state_changed + NSMutableDictionary *taskSnapshotDict = [RNFBStorageCommon getUploadTaskAsDictionary:nil]; + NSDictionary *eventBody = + [RNFBStorageCommon buildErrorSnapshotDictFromCodeAndMessage:errorCodeMessageArray taskSnapshotDict:taskSnapshotDict]; + NSDictionary *stateChangedEvent = + [RNFBStorageCommon getStorageEventDictionary:eventBody internalEventName:RNFB_STORAGE_STATE_CHANGED appName:[[[storageReference storage] app] name] taskId:taskId]; + [[RNFBRCTEventEmitter shared] sendEventWithName:RNFB_STORAGE_EVENT body:stateChangedEvent]; + + // upload_failed + NSDictionary *event = + [RNFBStorageCommon getStorageEventDictionary:eventBody internalEventName:RNFB_STORAGE_UPLOAD_FAILURE appName:[[[storageReference storage] app] name] taskId:taskId]; + [[RNFBRCTEventEmitter shared] sendEventWithName:RNFB_STORAGE_EVENT body:event]; + + [RNFBSharedUtils rejectPromiseWithUserInfo:reject userInfo:(NSMutableDictionary *) @{ + @"code": errorCodeMessageArray[0], + @"message": errorCodeMessageArray[1], + }]; + return; + } + + storageMetadata.contentType = contentType; + + if ([storageMetadata valueForKey:@"contentType"] == nil) { + storageMetadata.contentType = [RNFBStorageCommon mimeTypeForPath:localFilePath]; + } + + __block FIRStorageUploadTask *uploadTask; + RCTUnsafeExecuteOnMainQueueSync(^{ + uploadTask = [storageReference putFile:temporaryFileUrl metadata:storageMetadata]; + }); + + [self addUploadTaskObservers:uploadTask appDisplayName:[[[storageReference storage] app] name] taskId:taskId resolver:resolve rejecter:reject]; + }]; +} + +/** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#putFile + */ +RCT_EXPORT_METHOD(putString: + (FIRApp *) firebaseApp + : (NSString *) url + : (NSString *) string + : (NSString *) format + : (NSDictionary *) metadata + : (nonnull NSNumber *) taskId + : (RCTPromiseResolveBlock) resolve + : (RCTPromiseRejectBlock) reject +) { + FIRStorageMetadata *storageMetadata = [RNFBStorageCommon buildMetadataFromMap:metadata]; + FIRStorageReference *storageReference = [self getReferenceFromUrl:url app:firebaseApp]; + + __block FIRStorageUploadTask *uploadTask; + RCTUnsafeExecuteOnMainQueueSync(^{ + uploadTask = + [storageReference putData:[RNFBStorageCommon NSDataFromUploadString:string format:format] metadata:storageMetadata]; + }); + + [self addUploadTaskObservers:uploadTask appDisplayName:[[[storageReference storage] app] name] taskId:taskId resolver:resolve rejecter:reject]; +} + +/** + * @url N/A - RNFB Specific + */ +RCT_EXPORT_METHOD(setTaskStatus: + (FIRApp *) firebaseApp + : (nonnull NSNumber *) taskId + : (nonnull NSNumber *) status + : (RCTPromiseResolveBlock) resolve + : (RCTPromiseRejectBlock) reject +) { + + id task = PENDING_TASKS[taskId]; + if (task == nil) { + resolve(@(NO)); + return; + } + + switch ([status integerValue]) { + case 0:[task pause]; + break; + case 1:[task resume]; + break; + case 2:[task cancel]; + break; + default:break; + } +} + +#pragma mark - +#pragma mark Firebase Storage Internals + +- (void)addUploadTaskObservers:(FIRStorageUploadTask *)uploadTask appDisplayName:(NSString *)appDisplayName taskId:(NSNumber *)taskId resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject { + PENDING_TASKS[taskId] = uploadTask; + + // upload started or resumed + [uploadTask observeStatus:FIRStorageTaskStatusResume handler:^(FIRStorageTaskSnapshot *snapshot) { + NSDictionary *eventBody = [RNFBStorageCommon getUploadTaskAsDictionary:snapshot]; + NSDictionary *event = + [RNFBStorageCommon getStorageEventDictionary:eventBody internalEventName:RNFB_STORAGE_STATE_CHANGED appName:appDisplayName taskId:taskId]; + [[RNFBRCTEventEmitter shared] sendEventWithName:RNFB_STORAGE_EVENT body:event]; + }]; + + // upload paused + [uploadTask observeStatus:FIRStorageTaskStatusPause handler:^(FIRStorageTaskSnapshot *snapshot) { + NSDictionary *eventBody = [RNFBStorageCommon getUploadTaskAsDictionary:snapshot]; + NSDictionary *event = + [RNFBStorageCommon getStorageEventDictionary:eventBody internalEventName:RNFB_STORAGE_STATE_CHANGED appName:appDisplayName taskId:taskId]; + [[RNFBRCTEventEmitter shared] sendEventWithName:RNFB_STORAGE_EVENT body:event]; + + }]; + + // upload reported progress + [uploadTask observeStatus:FIRStorageTaskStatusProgress handler:^(FIRStorageTaskSnapshot *snapshot) { + NSDictionary *eventBody = [RNFBStorageCommon getUploadTaskAsDictionary:snapshot]; + NSDictionary *event = + [RNFBStorageCommon getStorageEventDictionary:eventBody internalEventName:RNFB_STORAGE_STATE_CHANGED appName:appDisplayName taskId:taskId]; + [[RNFBRCTEventEmitter shared] sendEventWithName:RNFB_STORAGE_EVENT body:event]; + }]; + + // upload completed successfully + [uploadTask observeStatus:FIRStorageTaskStatusSuccess handler:^(FIRStorageTaskSnapshot *snapshot) { + [PENDING_TASKS removeObjectForKey:taskId]; + + NSDictionary *eventBody = [RNFBStorageCommon getUploadTaskAsDictionary:snapshot]; + + // state_changed + NSDictionary *stateChangeEvent = + [RNFBStorageCommon getStorageEventDictionary:eventBody internalEventName:RNFB_STORAGE_STATE_CHANGED appName:appDisplayName taskId:taskId]; + [[RNFBRCTEventEmitter shared] sendEventWithName:RNFB_STORAGE_EVENT body:stateChangeEvent]; + + // upload_success + NSDictionary *uploadSuccessEvent = + [RNFBStorageCommon getStorageEventDictionary:eventBody internalEventName:RNFB_STORAGE_UPLOAD_SUCCESS appName:appDisplayName taskId:taskId]; + [[RNFBRCTEventEmitter shared] sendEventWithName:RNFB_STORAGE_EVENT body:uploadSuccessEvent]; + resolve(eventBody); + }]; + + [uploadTask observeStatus:FIRStorageTaskStatusFailure handler:^(FIRStorageTaskSnapshot *snapshot) { + [PENDING_TASKS removeObjectForKey:taskId]; + + // state_changed + NSMutableDictionary *taskSnapshotDict = [RNFBStorageCommon getUploadTaskAsDictionary:snapshot]; + NSDictionary *stateChangedEvtBody = + [RNFBStorageCommon buildErrorSnapshotDict:snapshot.error taskSnapshotDict:taskSnapshotDict]; + NSDictionary *stateChangedEvent = + [RNFBStorageCommon getStorageEventDictionary:stateChangedEvtBody internalEventName:RNFB_STORAGE_STATE_CHANGED appName:appDisplayName taskId:taskId]; + [[RNFBRCTEventEmitter shared] sendEventWithName:RNFB_STORAGE_EVENT body:stateChangedEvent]; + + // upload_failed + NSDictionary + *eventBody = [RNFBStorageCommon buildErrorSnapshotDict:snapshot.error taskSnapshotDict:taskSnapshotDict]; + NSDictionary *event = + [RNFBStorageCommon getStorageEventDictionary:eventBody internalEventName:RNFB_STORAGE_UPLOAD_FAILURE appName:appDisplayName taskId:taskId]; + [[RNFBRCTEventEmitter shared] sendEventWithName:RNFB_STORAGE_EVENT body:event]; + + [self promiseRejectStorageException:reject error:snapshot.error]; + }]; +} + +- (FIRStorageReference *)getReferenceFromUrl:(NSString *)url app:(FIRApp *)firebaseApp { + NSString *pathWithBucketName = [url substringWithRange:NSMakeRange(5, [url length] - 5)]; + NSString *bucket = [url substringWithRange:NSMakeRange(0, [pathWithBucketName rangeOfString:@"/"].location + 5)]; + return [[FIRStorage storageForApp:firebaseApp URL:bucket] referenceForURL:url]; +} + +- (void)promiseRejectStorageException:(RCTPromiseRejectBlock)reject error:(NSError *)error { + NSArray *codeAndMessage = [RNFBStorageCommon getErrorCodeMessage:error]; + [RNFBSharedUtils rejectPromiseWithUserInfo:reject userInfo:(NSMutableDictionary *) @{ + @"code": (NSString *) codeAndMessage[0], + @"message": (NSString *) codeAndMessage[1], + }]; +} + +- (NSString *)getPathForDirectory:(int)directory { + NSArray *paths = NSSearchPathForDirectoriesInDomains((NSSearchPathDirectory) directory, NSUserDomainMask, YES); + return [paths firstObject]; +} + +- (NSDictionary *)constantsToExport { + NSMutableDictionary *constants = [@{ + @"MainBundle": [[NSBundle mainBundle] bundlePath], + @"CachesDirectory": [self getPathForDirectory:NSCachesDirectory], + @"DocumentDirectory": [self getPathForDirectory:NSDocumentDirectory], + @"PicturesDirectory": [self getPathForDirectory:NSPicturesDirectory], + @"MoviesDirectory": [self getPathForDirectory:NSMoviesDirectory], + @"TempDirectory": NSTemporaryDirectory(), + @"LibraryDirectory": [self getPathForDirectory:NSLibraryDirectory], + } mutableCopy]; + + if ([[[FIRApp allApps] allKeys] count] > 0) { + FIRStorage *storageInstance = [FIRStorage storage]; + constants[@"maxDownloadRetryTime"] = @((NSInteger) [storageInstance maxDownloadRetryTime] * 1000); + constants[@"maxOperationRetryTime"] = @((NSInteger) [storageInstance maxOperationRetryTime] * 1000); + constants[@"maxUploadRetryTime"] = @((NSInteger) [storageInstance maxUploadRetryTime] * 1000); + } + + return constants; +} + +@end diff --git a/packages/storage/lib/StorageDownloadTask.js b/packages/storage/lib/StorageDownloadTask.js new file mode 100644 index 00000000..0d6809e5 --- /dev/null +++ b/packages/storage/lib/StorageDownloadTask.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import StorageTask from './StorageTask'; + +const DOWNLOAD_TASK = 'download'; + +export default class StorageDownloadTask extends StorageTask { + constructor(storageRef, beginTaskFn) { + super(DOWNLOAD_TASK, storageRef, beginTaskFn); + } +} diff --git a/packages/storage/lib/StorageReference.js b/packages/storage/lib/StorageReference.js new file mode 100644 index 00000000..d2e22fcd --- /dev/null +++ b/packages/storage/lib/StorageReference.js @@ -0,0 +1,240 @@ +/* eslint-disable no-console */ +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import { + Base64, + isString, + pathChild, + pathParent, + isUndefined, + getDataUrlParts, + pathLastComponent, + ReferenceBase, +} from '@react-native-firebase/common'; +import { validateMetadata } from './utils'; +import StorageStatics from './StorageStatics'; +import StorageUploadTask from './StorageUploadTask'; +import StorageDownloadTask from './StorageDownloadTask'; + +export default class StorageReference extends ReferenceBase { + constructor(storage, path) { + super(path); + this._storage = storage; + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#bucket + */ + get bucket() { + return this._storage._customUrlOrRegion.replace('gs://', ''); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#fullPath + */ + get fullPath() { + return this.path; + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#name + */ + get name() { + return pathLastComponent(this.path); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#parent + */ + get parent() { + const parentPath = pathParent(this.path); + if (parentPath === null) return parentPath; + return new StorageReference(this._storage, parentPath); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#root + */ + get root() { + return new StorageReference(this._storage, '/'); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#storage + */ + get storage() { + return this._storage; + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#child + */ + child(path) { + const childPath = pathChild(this.path, path); + return new StorageReference(this._storage, childPath); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#delete + */ + delete() { + return this._storage.native.delete(this.toString()); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#getDownloadURL + */ + getDownloadURL() { + return this._storage.native.getDownloadURL(this.toString()); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#getMetadata + */ + getMetadata() { + return this._storage.native.getMetadata(this.toString()); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#put + */ + put(data, metadata) { + if (!isUndefined(metadata)) { + validateMetadata(metadata); + } + + return Base64.fromData(data).then(({ string, format }) => + this.putString(string, format, metadata), + ); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#putString + */ + putString(string, format = StorageStatics.StringFormat.RAW, metadata) { + if (!isString(string)) { + throw new Error( + `firebase.storage.StorageReference.putString(*, _, _) 'string' expects a string value.`, + ); + } + + if (!Object.values(StorageStatics.StringFormat).includes(format)) { + throw new Error( + `firebase.storage.StorageReference.putString(_, *, _) 'format' provided is invalid, must be one of ${Object.values( + StorageStatics.StringFormat, + ).join(',')}.`, + ); + } + + if (!isUndefined(metadata)) { + validateMetadata(metadata); + } + + let _string = string; + let _format = format; + let _metadata = metadata; + + if (format === StorageStatics.StringFormat.RAW) { + _string = Base64.btoa(_string); + _format = StorageStatics.StringFormat.BASE64; + } else if (format === StorageStatics.StringFormat.DATA_URL) { + const { mediaType, base64String } = getDataUrlParts(_string); + if (isUndefined(base64String)) { + throw new Error( + `firebase.storage.StorageReference.putString(*, _, _) invalid data_url string provided.`, + ); + } + + if (isUndefined(metadata) || isUndefined(metadata.contentType)) { + if (isUndefined(metadata)) _metadata = {}; + _metadata.contentType = mediaType; + _string = base64String; + _format = StorageStatics.StringFormat.BASE64; + } + } + + return new StorageUploadTask(this, task => + this._storage.native.putString(this.toString(), _string, _format, _metadata, task._id), + ); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#fullPath + */ + toString() { + if (this.path.length <= 1) { + return this._storage._customUrlOrRegion; + } + + return `${this._storage._customUrlOrRegion}/${this.path}`; + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#updateMetadata + */ + updateMetadata(metadata) { + validateMetadata(metadata); + return this._storage.native.updateMetadata(this.toString(), metadata); + } + + /* ---------------------------------------- + * EXTRA APIS (DO NOT ON EXIST WEB SDK) + * ---------------------------------------- */ + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference + */ + getFile(filePath) { + // TODO(salakar) validate arg? + return new StorageDownloadTask(this, task => + this._storage.native.getFile(this.toString(), filePath, task._id), + ); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference + */ + // TODO(deprecation) remove in 6.2. + downloadFile(filePath) { + console.warn( + "firebase.storage.Reference.downloadFile() is deprecated, please rename usages to 'getFile()'", + ); + return this.getFile(filePath); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference + */ + putFile(filePath, metadata) { + if (!isUndefined(metadata)) { + validateMetadata(metadata); + } + + if (!isString(filePath)) { + throw new Error( + `firebase.storage.StorageReference.putFile(*, _) 'filePath' expects a string value.`, + ); + } + + let _filePath = filePath.replace('file://', ''); + if (_filePath.includes('%')) _filePath = decodeURIComponent(_filePath); + return new StorageUploadTask(this, task => + this._storage.native.putFile(this.toString(), _filePath, metadata, task._id), + ); + } +} diff --git a/packages/storage/lib/StorageStatics.js b/packages/storage/lib/StorageStatics.js new file mode 100644 index 00000000..c2102a8e --- /dev/null +++ b/packages/storage/lib/StorageStatics.js @@ -0,0 +1,103 @@ +/* eslint-disable no-console */ +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import { NativeModules } from 'react-native'; +import { stripTrailingSlash } from '@react-native-firebase/common'; + +// TODO(salakar) refactor once deprecations have been removed + +const PATH_NAMES = { + MainBundle: 'MAIN_BUNDLE_PATH', + CachesDirectory: 'CACHES_DIRECTORY_PATH', + DocumentDirectory: 'DOCUMENT_DIRECTORY_PATH', + ExternalDirectory: 'EXTERNAL_DIRECTORY_PATH', + ExternalStorageDirectory: 'EXTERNAL_STORAGE_DIRECTORY_PATH', + TempDirectory: 'TEMP_DIRECTORY_PATH', + LibraryDirectory: 'LIBRARY_DIRECTORY_PATH', + PicturesDirectory: false, + MoviesDirectory: false, +}; + +const PATH_FILE_TYPES = ['FILE_TYPE_REGULAR', 'FILE_TYPE_DIRECTORY']; + +const path = {}; +let processedPathConstants = false; + +function processPathConstants(nativeModule) { + if (processedPathConstants || !nativeModule) return path; + processedPathConstants = true; + + const entries = Object.entries(PATH_NAMES); + for (let i = 0; i < entries.length; i++) { + const [newName, oldName] = entries[i]; + path[newName] = nativeModule[newName] ? stripTrailingSlash(nativeModule[newName]) : null; + + // TODO(salakar) deprecated remove in 6.1.0: + if (oldName) { + Object.defineProperty(path, `${oldName}`, { + // eslint-disable-next-line no-loop-func + get() { + console.warn( + `'firebase.storage.Native.${oldName}' is deprecated and will be removed in 6.1.0 please use 'firebase.storage.Path.${newName}' instead`, + ); + + return path[newName]; + }, + }); + } + } + + for (let i = 0; i < PATH_FILE_TYPES.length; i++) { + const pathFileType = PATH_FILE_TYPES[i]; + path[pathFileType] = stripTrailingSlash(nativeModule[pathFileType]); + + // TODO(salakar) deprecated remove in 6.1.0: + const deprecatedFileTypeName = pathFileType.replace('_', ''); + path[deprecatedFileTypeName] = path[pathFileType]; + } + + Object.freeze(path); + + return path; +} + +export default { + StringFormat: { + RAW: 'raw', + BASE64: 'base64', + BASE64URL: 'base64url', + DATA_URL: 'data_url', + }, + TaskEvent: { + STATE_CHANGED: 'state_changed', + }, + TaskState: { + RUNNING: 'running', + PAUSED: 'paused', + SUCCESS: 'success', + CANCELLED: 'cancelled', + ERROR: 'error', + }, + get Path() { + return processPathConstants(NativeModules.RNFBStorageModule); + }, + // TODO(salakar) deprecated remove in 6.1.0: + get Native() { + return processPathConstants(NativeModules.RNFBStorageModule); + }, +}; diff --git a/packages/storage/lib/StorageTask.js b/packages/storage/lib/StorageTask.js new file mode 100644 index 00000000..2bffa64d --- /dev/null +++ b/packages/storage/lib/StorageTask.js @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import { isFunction, isObject, isNull } from '@react-native-firebase/common'; +import StorageStatics from './StorageStatics'; + +let TASK_ID = 0; + +function wrapErrorEventListener(listenerFn, unsubscribe) { + return event => { + if (unsubscribe) setTimeout(() => unsubscribe(), 0); // 1 frame = 16ms, pushing to next frame + if (isFunction(listenerFn)) { + listenerFn(event.error); + } + }; +} + +function wrapSnapshotEventListener(task, listenerFn, unsubscribe) { + if (!isFunction(listenerFn)) return null; + return event => { + if (unsubscribe) setTimeout(() => unsubscribe(), 0); // 1 frame = 16ms, pushing to next frame + if (isFunction(listenerFn)) { + const snapshot = Object.assign({}, event); + snapshot.task = task; + snapshot.ref = task._ref; + + if (snapshot.metadata) { + if (!snapshot.metadata.generation) snapshot.metadata.generation = ''; + if (!snapshot.metadata.bucket) snapshot.metadata.bucket = task._ref.bucket; + if (!snapshot.metadata.metageneration) snapshot.metadata.metageneration = ''; + // // TODO(salakar): these are always here, cannot repro without, remove in 6.1.0 if no issues: + // if (!snapshot.metadata.name) snapshot.metadata.name = task._ref.name; + // if (!snapshot.metadata.fullPath) snapshot.metadata.fullPath = task._ref.fullPath; + } + + Object.freeze(snapshot); + + listenerFn(snapshot); + } + }; +} + +function addTaskEventListener(task, eventName, listener) { + let _eventName = eventName; + if (_eventName !== StorageStatics.TaskEvent.STATE_CHANGED) { + _eventName = `${task._type}_${eventName}`; + } + + return task._storage.emitter.addListener( + task._storage.eventNameForApp(task._id, _eventName), + listener, + ); +} + +function subscribeToEvents(task, nextOrObserver, error, complete) { + let _error; + let _errorSubscription; + + let _next; + let _nextSubscription; + + let _complete; + let _completeSubscription; + + const unsubscribe = () => { + if (_nextSubscription) _nextSubscription.remove(); + if (_errorSubscription) _errorSubscription.remove(); + if (_completeSubscription) _completeSubscription.remove(); + }; + + if (isFunction(nextOrObserver)) { + _error = wrapErrorEventListener(error, unsubscribe); + _next = wrapSnapshotEventListener(task, nextOrObserver); + _complete = wrapSnapshotEventListener(task, complete, unsubscribe); + } else if (isObject(nextOrObserver)) { + _error = wrapErrorEventListener(nextOrObserver.error, unsubscribe); + _next = wrapSnapshotEventListener(task, nextOrObserver.next); + _complete = wrapSnapshotEventListener(task, nextOrObserver.complete, unsubscribe); + } else if (isNull(nextOrObserver)) { + _error = wrapErrorEventListener(error, unsubscribe); + _complete = wrapSnapshotEventListener(task, complete, unsubscribe); + } else { + throw new Error( + `firebase.storage.StorageTask.on(*, _) 'nextOrObserver' must be a Function, an Object or Null.`, + ); + } + + if (_next) { + _nextSubscription = addTaskEventListener(task, StorageStatics.TaskEvent.STATE_CHANGED, _next); + } + + if (_error) { + _errorSubscription = addTaskEventListener(task, 'failure', _error); + } + + if (_complete) { + _completeSubscription = addTaskEventListener(task, 'success', _complete); + } + + return unsubscribe; +} + +export default class StorageTask { + constructor(type, storageRef, beginTaskFn) { + this._type = type; + this._id = TASK_ID++; + this._promise = null; + this._ref = storageRef; + this._beginTask = beginTaskFn; + this._storage = storageRef._storage; + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.UploadTask#then + */ + get then() { + if (!this._promise) this._promise = this._beginTask(this); + return this._promise.then.bind(this._promise); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.UploadTask#catch + */ + get catch() { + if (!this._promise) this._promise = this._beginTask(this); + return this._promise.catch.bind(this._promise); + } + + // // NOT on Web SDK + // /** + // * @url https://firebase.google.com/docs/reference/js/firebase.storage.UploadTask#finally + // */ + // get finally() { + // if (!this._promise) this._promise = this._beginTask(this); + // return this._promise.finally.bind(this._promise); + // } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.UploadTask#on + */ + on(event, nextOrObserver, error, complete) { + if (event !== StorageStatics.TaskEvent.STATE_CHANGED) { + throw new Error( + `firebase.storage.StorageTask.on event argument must be a string with a value of '${ + StorageStatics.TaskEvent.STATE_CHANGED + }'`, + ); + } + + if (!this._promise) this._promise = this._beginTask(this); + + // if only event provided return the subscriber function + if (!nextOrObserver && !error && !complete) { + return subscribeToEvents.bind(null, this); + } + + return subscribeToEvents(this, nextOrObserver, error, complete); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.UploadTask#pause + */ + pause() { + return this._storage.native.setTaskStatus(this._id, 0); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.UploadTask#resume + */ + resume() { + return this._storage.native.setTaskStatus(this._id, 1); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.UploadTask#cancel + */ + cancel() { + return this._storage.native.setTaskStatus(this._id, 2); + } +} diff --git a/packages/storage/lib/StorageUploadTask.js b/packages/storage/lib/StorageUploadTask.js new file mode 100644 index 00000000..b9fed927 --- /dev/null +++ b/packages/storage/lib/StorageUploadTask.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import StorageTask from './StorageTask'; + +const UPLOAD_TASK = 'upload'; + +export default class StorageUploadTask extends StorageTask { + constructor(storageRef, beginTaskFn) { + super(UPLOAD_TASK, storageRef, beginTaskFn); + } +} diff --git a/packages/storage/lib/index.d.ts b/packages/storage/lib/index.d.ts new file mode 100644 index 00000000..bf51b762 --- /dev/null +++ b/packages/storage/lib/index.d.ts @@ -0,0 +1,957 @@ +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import { + NativeFirebaseError, + ReactNativeFirebaseModule, + ReactNativeFirebaseModuleAndStatics, + ReactNativeFirebaseNamespace, +} from '@react-native-firebase/app-types'; + +/** + * Firebase Cloud Storage package for React Native. + * + * #### Example 1 + * + * Access the firebase export from the `storage` package: + * + * ```js + * import { firebase } from '@react-native-firebase/storage'; + * + * // firebase.storage().X + * ``` + * + * #### Example 2 + * + * Using the default export from the `storage` package: + * + * ```js + * import storage from '@react-native-firebase/storage'; + * + * // storage().X + * ``` + * + * #### Example 3 + * + * Using the default export from the `app` package: + * + * ```js + * import firebase from '@react-native-firebase/app'; + * import '@react-native-firebase/storage'; + * + * // firebase.storage().X + * ``` + * + * @firebase storage + */ +export namespace Storage { + /** + * Possible string formats used for uploading via `StorageReference.putString()` + * + * ```js + * firebase.storage.StringFormat; + * ``` + */ + export interface StringFormat { + /** + * Raw string format. + * + * #### Usage + * + * ```js + * firebase.storage.StringFormat.RAW; + * ``` + * + * #### Example String Format + * + * ```js + * const sampleString = ''; + * ``` + */ + RAW: 'raw'; + + /** + * Base64 string format. + * + * Learn more about Base64 [on the Mozilla Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding) + * + * #### Usage + * + * ```js + * firebase.storage.StringFormat.BASE64; + * ``` + * + * #### Example String Format + * + * ```js + * const sampleString = 'PEZvbyBCYXI+'; + * ``` + * + */ + BASE64: 'base64'; + + /** + * Base64Url string format. + * + * #### Usage + * + * ```js + * firebase.storage.StringFormat.BASE64URL; + * ``` + * + * #### Example String Format + * + * ```js + * const sampleString = 'PEZvbyBCYXI-'; + * ``` + * + */ + BASE64URL: 'base64url'; + + /** + * Data URL string format. + * + * #### Usage + * + * ```js + * firebase.storage.StringFormat.DATA_URL; + * ``` + * + * #### Example String Format + * + * ```js + * const sampleString = 'data:text/plain;base64,PEZvbyBCYXI+'; + * ``` + */ + DATA_URL: 'data_url'; + } + + /** + * An event to subscribe to that is triggered on a Upload or Download task. + * + * Event subscription is created via `StorageTask.on()`. + * + * ```js + * firebase.storage.TaskEvent; + * ``` + */ + export interface TaskEvent { + /** + * An event that indicates that the tasks state has changed. + * + * ```js + * firebase.storage.TaskEvent.STATE_CHANGED; + * ``` + */ + STATE_CHANGED: 'state_changed'; + } + + /** + * A collection of properties that indicates the current tasks state. + * + * An event subscription is created via `StorageTask.on()`. + * + * ```js + * firebase.storage.TaskEvent; + * ``` + */ + export interface TaskState { + /** + * Task has been cancelled by the user. + */ + CANCELLED: 'cancelled'; + + /** + * An Error occurred, see TaskSnapshot.error for details. + */ + ERROR: 'error'; + + /** + * Task has been paused. Resume the task via `StorageTask.resume()`. + */ + PAUSED: 'paused'; + + /** + * Task is running. Pause the task via `StorageTask.pause()` + */ + RUNNING: 'running'; + + /** + * Task has completed successfully. + */ + SUCCESS: 'success'; + } + + /** + * A collection of native device file paths to aid in the usage of file path based storage methods. + * + * Concatenate a file path with your target file name when using `putFile` or `getFile`. + * + * ```js + * firebase.storage.Path; + * ``` + */ + export interface Path { + /** + * Returns an absolute path to the applications main bundle. + * + * ```js + * firebase.storage.Path.MainBundle; + * ``` + * + * @ios iOS only + */ + MainBundle: string; + + /** + * Returns an absolute path to the application specific cache directory on the filesystem. + * + * The system will automatically delete files in this directory when disk space is needed elsewhere on the device, starting with the oldest files first. + * + * ```js + * firebase.storage.Path.CachesDirectory; + * ``` + */ + CachesDirectory: string; + + /** + * Returns an absolute path to the users Documents directory. + * + * Use this directory to place documents that have been created by the user. + * + * ```js + * firebase.storage.Path.DocumentDirectory; + * ``` + */ + DocumentDirectory: string; + + /** + * Returns an absolute path to a temporary directory. + * + * Use this directory to create temporary files. The system will automatically delete files in this directory when disk space is needed elsewhere on the device, starting with the oldest files first. + * + * ```js + * firebase.storage.Path.TempDirectory; + * ``` + */ + TempDirectory: string; + + /** + * Returns an absolute path to the apps library/resources directory. + * + * E.g. this can be used for things like documentation, support files, and configuration files and generic resources. + * + * ```js + * firebase.storage.Path.LibraryDirectory; + * ``` + */ + LibraryDirectory: string; + + /** + * Returns an absolute path to the directory on the primary shared/external storage device. + * + * Here your application can place persistent files it owns. These files are internal to the application, and not typically visible to the user as media. + * + * Returns null if no external storage directory found, e.g. removable media has been ejected by the user. + * + * ```js + * firebase.storage.Path.ExternalDirectory; + * ``` + * + * @android Android only - iOS returns null + */ + ExternalDirectory: string | null; + + /** + * Returns an absolute path to the primary shared/external storage directory. + * + * Traditionally this is an SD card, but it may also be implemented as built-in storage on a device. + * + * Returns null if no external storage directory found, e.g. removable media has been ejected by the user. + * + * ```js + * firebase.storage.Path.ExternalStorageDirectory; + * ``` + * + * @android Android only - iOS returns null + */ + ExternalStorageDirectory: string | null; + + /** + * Returns an absolute path to a directory in which to place pictures that are available to the user. + * + * ```js + * firebase.storage.Path.PicturesDirectory; + * ``` + */ + PicturesDirectory: string; + + /** + * Returns an absolute path to a directory in which to place movies that are available to the user. + * + * ```js + * firebase.storage.Path.MoviesDirectory; + * ``` + */ + MoviesDirectory: string; + } + + /** + * Cloud Storage statics. + * + * #### Example + * + * ```js + * firebase.storage; + * ``` + */ + export interface Statics { + /** + * Possible string formats used for uploading via `StorageReference.putString()` + * + * #### Example + * + * ```js + * firebase.storage.StringFormat; + * ``` + */ + StringFormat: StringFormat; + + /** + * A collection of properties that indicates the current tasks state. + * + * #### Example + * + * ```js + * firebase.storage.TaskState; + * ``` + */ + TaskState: TaskState; + + /** + * An event to subscribe to that is triggered on a Upload or Download task. + * + * #### Example + * + * ```js + * firebase.storage.TaskEvent; + * ``` + */ + TaskEvent: TaskEvent; + + /** + * A collection of native device file paths to aid in the usage of file path based storage methods. + * + * #### Example + * + * ```js + * firebase.storage.Path; + * ``` + */ + Path: Path; + } + + /** + * An interface representing all the metadata properties that can be set. + * + * This is used in updateMetadata, put, putString & putFile. + */ + export interface SettableMetadata { + /** + * The 'Cache-Control' HTTP header that will be set on the storage object when it's requested. + * + * #### Example 1 + * + * To turn off caching, you can set the following cacheControl value. + * + * ```js + * { + * cacheControl: 'no-store', + * } + * ``` + * + * #### Example 2 + * + * To aggressively cache an object, e.g. static assets, you can set the following cacheControl value. + * + * ```js + * { + * cacheControl: 'public, max-age=31536000', + * } + * ``` + * + * [Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) + */ + cacheControl?: string | null; + + /** + * The 'Content-Disposition' HTTP header that will be set on the storage object when it's requested. + * + * [Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) + */ + contentDisposition?: string | null; + + /** + * The 'Content-Encoding' HTTP header that will be used on the storage object when it's requested. + * + * [Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding) + */ + contentEncoding?: string | null; + + /** + * The 'Content-Language' HTTP header that will be set on the storage object when it's requested. + * + * [Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language) + */ + contentLanguage?: string | null; + + /** + * The 'Content-Type' HTTP header that will be set on the object when it's requested. + * + * This is used to indicate the media type (or MIME type) of the object. When uploading a file + * Firebase Cloud Storage for React Native will attempt to automatically detect this if `contentType` + * is not already set, if it fails to detect a media type it will default to `application/octet-stream`. + * + * For `DATA_URL` string formats uploaded via `putString` this will also be automatically extracted if available. + * + * #### Example + * + * Setting the content type as JSON, e.g. for when uploading a JSON string via `putString`. + * + * ```js + * { + * contentType: 'application/json', + * } + * ``` + * + * [Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type) + */ + contentType?: string | null; + + /** + * Additional user-defined custom metadata for this storage object. + * + * String values only are supported for custom metadata property values. + * + * #### Example + * + * Adding a user controlled NSFW meta data field. + * + * ```js + * { + * customMetadata: { + * 'nsfw': 'true' + * }, + * } + */ + customMetadata?: { + [key: string]: string; + } | null; + } + + /** + * The full readable metadata returned by `TaskSnapshot.metadata` or `StorageReference.getMetadata()`. + */ + export interface FullMetadata extends SettableMetadata { + /** + * A Base64-encoded MD5 hash of the storage object being uploaded. + */ + md5Hash: string | null; + + /** + * The bucket this storage object is contained in. + * + * #### Example Value + * + * ``` + * gs://my-project-storage-bucket + * ``` + */ + bucket: string; + + /** + * The full path to this storage object in its bucket. + * + * #### Example Value + * + * ``` + * invertase/logo.png + * ``` + */ + fullPath: string; + + /** + * Storage object generation values enable users to uniquely identify data resources, e.g. object versioning. + * + * Read more on generation on the [Google Cloud Storage documentation](https://cloud.google.com/storage/docs/generations-preconditions). + */ + generation: string; + + /** + * Storage object metageneration values enable users to uniquely identify data resources, e.g. object versioning. + * + * Read more on metageneration on the [Google Cloud Storage documentation](https://cloud.google.com/storage/docs/generations-preconditions). + */ + metageneration: string; + + /** + * The short name of storage object in its bucket, e.g. it's file name. + * + * #### Example Value + * + * ``` + * logo.png + * ``` + */ + name: string; + + /** + * The size of this storage object in bytes. + */ + size: number; + + /** + * A date string representing when this storage object was created. + * + * #### Example Value + * + * ``` + * 2019-05-02T00:34:56.264Z + * ``` + */ + timeCreated: string; + + /** + * A date string representing when this storage object was last updated. + * + * #### Example Value + * + * ``` + * 2019-05-02T00:35:56.264Z + * ``` + */ + updated: string; + } + + /** + * Represents a reference to a Google Cloud Storage object in React Native Firebase. + * + * A reference can be used to upload and download storage objects, get/set storage object metadata, retrieve storage object download urls and delete storage objects. + * + * #### Example 1 + * + * Get a reference to a specific storage path. + * + * ```js + * const ref = firebase.storage().ref('invertase/logo.png'); + * ``` + * + * #### Example 2 + * + * Get a reference to a specific storage path on another bucket in the same firebase project. + * + * ```js + * const ref = firebase.storage().refFromURL('gs://other-bucket/invertase/logo.png'); + * ``` + */ + export interface Reference { + // TODO(salakar) -----\/ + + bucket: string; + + parent: Reference | null; + + fullPath: string; + + name: string; + + root: Reference; + + storage: Module; + + toString(): string; + + child(path: string): Reference; + + delete(): Promise; + + getDownloadURL(): Promise; + + getMetadata(): Promise; + + putFile(localFilePath: string, metadata?: SettableMetadata): Task; + + put(data: Blob | Uint8Array | ArrayBuffer, metadata?: SettableMetadata): Task; + + putString(data: string, format?: StringFormat, metadata?: SettableMetadata): Task; + + updateMetadata(metadata: SettableMetadata): Promise; + } + + export interface TaskSnapshotObserver { + next: (taskSnapshot: TaskSnapshot) => void; + + error: (error: Error) => void; + + complete: () => void; + } + + /** + * Storage Task used for Uploading or Downloading files. + * + * #### Example 1 + * + * Get a Upload Storage task to upload a string: + * + * ```js + * const string = '{ "foo": 1 }'; + * const task = firebase + * .storage() + * .ref('/foo/bar.json') + * .putString(string); + * ``` + * + * #### Example 2 + * + * Get a Download Storage task to download a file: + * + * ```js + * const string = '{ "foo": 1 }'; + * const downloadTo = `${firebase.storage.Path.DocumentDirectory}/bar.json`; + * + * const task = firebase + * .storage() + * .ref('/foo/bar.json') + * .getFile(downloadTo); + * ``` + */ + export interface Task { + /** + * Pause the current Download or Upload task. + * + * #### Example + * + * Pause a running task inside a state changed listener: + * + * ```js + * task.on('state_changed', taskSnapshot => { + * if (taskSnapshot.state === firebase.storage.TaskState.RUNNING) { + * console.log('Pausing my task!'); + * task.pause(); + * } + * }); + * ``` + * + */ + pause(): Promise; + + /** + * Resume the current Download or Upload task. + * + * #### Example + * + * Resume a previously paused task inside a state changed listener: + * + * ```js + * task.on('state_changed', taskSnapshot => { + * // ... pause me ... + * if (taskSnapshot.state === firebase.storage.TaskState.PAUSED) { + * console.log('Resuming my task!'); + * task.resume(); + * } + * }); + * ``` + * + */ + resume(): Promise; + + /** + * Cancel the current Download or Upload task. + * + * + * #### Example + * + * Cancel a task inside a state changed listener: + * + * ```js + * task.on('state_changed', taskSnapshot => { + * console.log('Cancelling my task!'); + * task.cancel(); + * }); + * ``` + * + */ + cancel(): Promise; + + /** + * + * @param event + * @param nextOrObserver + * @param error + * @param complete + */ + on( + event: 'state_changed', + nextOrObserver?: TaskSnapshotObserver | null | ((a: TaskSnapshot) => any), + error?: ((a: Error) => any) | null, + complete?: (() => void) | null, + ): Function; + + // /** + // * @ignore May not exist in RN JS Environment yet so we'll hide from docs. + // */ + // finally(onFinally?: (() => void) | undefined | null): Promise; + + then( + onFulfilled?: ((a: TaskSnapshot) => any) | null, + onRejected?: ((a: Error) => any) | null, + ): Promise; + + catch(onRejected: (a: Error) => any): Promise; + } + + /** + * A TaskSnapshot provides information about a storage tasks state. + * + * #### Example 1 + * + * ``` + * firebase + * .storage() + * .ref('/foo/bar.json') + * .putString(JSON.stringify({ foo: 'bar' })) + * .then((taskSnapshot) => { + * if (taskSnapshot.state === firebase.storage.TaskState.SUCCESS) { + * console.log('Total bytes uploaded: ', taskSnapshot.totalBytes); + * } + * }); + * ``` + * + * #### Example 2 + * + * ``` + * const task = firebase + * .storage() + * .ref('/foo/bar.json') + * .putString(JSON.stringify({ foo: 'bar' })); + * + * task.on('state_changed', taskSnapshot => { + * if (taskSnapshot.state === firebase.storage.TaskState.PAUSED) { + * console.log('Resuming my task!'); + * task.resume(); + * } + * }); + * ``` + */ + export interface TaskSnapshot { + /** + * The number of bytes currently transferred. + */ + bytesTransferred: number; + + /** + * The metadata of the tasks via a {@link storage.FullMetadata} interface. + */ + metadata: FullMetadata; + + /** + * The {@link storage.Reference} of the task. + */ + ref: Reference; + + /** + * The current state of the task snapshot. + */ + state: 'cancelled' | 'error' | 'paused' | 'running' | 'success'; + + /** + * The parent {@link storage.Task} of this snapshot. + */ + task: Task; + + /** + * The total amount of bytes for this task. + */ + totalBytes: number; + + /** + * If the {@link storage.TaskSnapshot#state} is `error`, returns a JavaScript error of the + * current task snapshot. + */ + error?: NativeFirebaseError; + } + + /** + * The Cloud Storage service is available for the default app, a given app or a specific storage bucket. + * + * #### Example 1 + * + * Get the storage instance for the **default app**: + * + * ```js + * const storageForDefaultApp = firebase.storage(); + * ``` + * + * #### Example 2 + * + * Get the storage instance for a **secondary app**: + * + * ```js + * const otherApp = firebase.app('otherApp'); + * const storageForOtherApp = firebase.storage(otherApp); + * ``` + * + * #### Example 3 + * + * Get the storage instance for a **specific storage bucket**: + * + * ```js + * const defaultApp = firebase.app(); + * const storageForBucket = defaultApp.storage('gs://another-bucket-url'); + * + * const otherApp = firebase.app('otherApp'); + * const storageForOtherAppBucket = otherApp.storage('gs://another-bucket-url'); + * ``` + * + */ + export class Module extends ReactNativeFirebaseModule { + /** + * TODO. + * + * #### Example + * + * ```js + * const uploadRetryTime = firebase.storage().maxUploadRetryTime; + * ``` + */ + maxUploadRetryTime: number; + + /** + * TODO. + * + * #### Example + * + * ```js + * await firebase.storage().setMaxUploadRetryTime(5000); + * ``` + * + * @param time Number of milliseconds.... TODO + */ + setMaxUploadRetryTime(time: number): Promise; + + /** + * TODO. + * + * #### Example + * + * ```js + * const downloadRetryTime = firebase.storage().maxUploadRetryTime; + * ``` + */ + maxDownloadRetryTime: number; + + /** + * TODO. + * + * #### Example + * + * ```js + * await firebase.storage().setMaxDownloadRetryTime(5000); + * ``` + * + * @param time Number of miliseconds.... TODO + */ + setMaxDownloadRetryTime(time: number): Promise; + + /** + * TODO. + * + * #### Example + * + * ```js + * const maxOperationRetryTime = firebase.storage().maxOperationRetryTime; + * ``` + */ + maxOperationRetryTime: number; + + /** + * TODO. + * + * #### Example + * + * ```js + * await firebase.storage().setMaxOperationRetryTime(5000); + * ``` + * + * @param time Number of miliseconds.... TODO + */ + setMaxOperationRetryTime(time: number): Promise; + + /** + * Returns a new {@link storage.Reference} instance. + * + * #### Example + * + * ```js + * const maxOperationRetryTime = firebase.storage().maxOperationRetryTime; + * ``` + * + * @param path An optional string pointing to a location on the storage bucket. If no path + * is provided, the returned reference will be the bucket root path. + */ + ref(path?: string): Reference; + + /** + * Returns a new {@link storage.Reference} instance from a storage bucket URL. + * + * #### Example + * + * ```js + * const maxOperationRetryTime = firebase.storage().maxOperationRetryTime; + * ``` + * + * @param url A storage bucket URL pointing to a single file or location. Must start with `gs://`, + * e.g. `gs://assets/logo.png` or `gs://assets`. + */ + refFromURL(url: string): Reference; + } +} + +declare module '@react-native-firebase/storage' { + import { ReactNativeFirebaseNamespace } from '@react-native-firebase/app-types'; + + const FirebaseNamespaceExport: {} & ReactNativeFirebaseNamespace; + + export const firebase = FirebaseNamespaceExport; + + const StorageDefaultExport: ReactNativeFirebaseModuleAndStatics; + + export default StorageDefaultExport; +} + +/** + * Attach namespace to `firebase.` and `FirebaseApp.`. + */ +declare module '@react-native-firebase/app-types' { + interface ReactNativeFirebaseNamespace { + storage: ReactNativeFirebaseModuleAndStatics; + } + + interface FirebaseApp { + storage?(bucket?: string): Storage.Module; + } +} diff --git a/packages/storage/lib/index.js b/packages/storage/lib/index.js new file mode 100644 index 00000000..edd37c2b --- /dev/null +++ b/packages/storage/lib/index.js @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import { + FirebaseModule, + getFirebaseRoot, + createModuleNamespace, +} from '@react-native-firebase/app/lib/internal'; +import { isNumber, isString } from '@react-native-firebase/common'; + +import version from './version'; +import StorageStatics from './StorageStatics'; +import StorageReference from './StorageReference'; +import { getUrlParts, handleStorageEvent } from './utils'; + +const namespace = 'storage'; +const nativeEvents = ['storage_event']; +const nativeModuleName = 'RNFBStorageModule'; + +class FirebaseStorageModule extends FirebaseModule { + constructor(app, config, bucketUrl) { + super(app, config, bucketUrl); + if (bucketUrl === undefined) this._customUrlOrRegion = `gs://${app.options.storageBucket}`; + else if (!isString(bucketUrl) || !bucketUrl.startsWith('gs://')) { + throw new Error( + `firebase.app().storage(*) bucket url must be a string and begin with 'gs://'`, + ); + } + + this.emitter.addListener( + this.eventNameForApp(nativeEvents[0]), + handleStorageEvent.bind(null, this), + ); + + this._maxUploadRetryTime = this.native.maxUploadRetryTime || 0; + this._maxDownloadRetryTime = this.native.maxDownloadRetryTime || 0; + this._maxOperationRetryTime = this.native.maxOperationRetryTime || 0; + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Storage#setmaxuploadretrytime + */ + get maxUploadRetryTime() { + return this._maxUploadRetryTime; + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Storage#setmaxdownloadretrytime + */ + get maxDownloadRetryTime() { + return this._maxDownloadRetryTime; + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Storage#maxoperationretrytime + */ + get maxOperationRetryTime() { + return this._maxOperationRetryTime; + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Storage#ref + */ + ref(path = '/') { + if (!isString(path)) { + throw new Error(`firebase.storage().ref(*) 'path' must be a string value.`); + } + + return new StorageReference(this, path); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Storage#refFromURL + */ + refFromURL(url) { + if (!isString(url) || !url.startsWith('gs://')) { + throw new Error( + `firebase.storage().refFromURL(*) 'url' must be a string value and begin with 'gs://'.`, + ); + } + + const { bucket, path } = getUrlParts(url); + const storageInstance = this.app.storage(bucket); + return new StorageReference(storageInstance, path); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Storage#setMaxOperationRetryTime + */ + setMaxOperationRetryTime(time) { + if (!isNumber(time)) { + throw new Error( + `firebase.storage().setMaxOperationRetryTime(*) 'time' must be a number value.`, + ); + } + + this._maxOperationRetryTime = time; + return this.native.setMaxOperationRetryTime(time); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Storage#setMaxUploadRetryTime + */ + setMaxUploadRetryTime(time) { + if (!isNumber(time)) { + throw new Error(`firebase.storage().setMaxUploadRetryTime(*) 'time' must be a number value.`); + } + + this._maxUploadRetryTime = time; + return this.native.setMaxUploadRetryTime(time); + } + + /** + * @url https://firebase.google.com/docs/reference/js/firebase.storage.Storage#setMaxDownloadRetryTime + */ + setMaxDownloadRetryTime(time) { + if (!isNumber(time)) { + throw new Error( + `firebase.storage().setMaxDownloadRetryTime(*) 'time' must be a number value.`, + ); + } + + this._maxDownloadRetryTime = time; + return this.native.setMaxDownloadRetryTime(time); + } +} + +// import { SDK_VERSION } from '@react-native-firebase/storage'; +export const SDK_VERSION = version; + +// import { STATICS } from '@react-native-firebase/storage'; +export const STATICS = StorageStatics; + +// import storage from '@react-native-firebase/storage'; +// storage().X(...); +export default createModuleNamespace({ + statics: StorageStatics, + version, + namespace, + nativeEvents, + nativeModuleName, + hasMultiAppSupport: true, + hasCustomUrlOrRegionSupport: true, + disablePrependCustomUrlOrRegion: true, + ModuleClass: FirebaseStorageModule, +}); + +// import storage, { firebase } from '@react-native-firebase/storage'; +// storage().X(...); +// firebase.storage().X(...); +export const firebase = getFirebaseRoot(); diff --git a/packages/storage/lib/index.js.flow b/packages/storage/lib/index.js.flow new file mode 100644 index 00000000..8143f659 --- /dev/null +++ b/packages/storage/lib/index.js.flow @@ -0,0 +1,914 @@ +/* eslint-disable import/no-duplicates */ +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import type { ReactNativeFirebaseModule } from '@react-native-firebase/app-types/index.js.flow'; +import { NativeFirebaseError } from '@react-native-firebase/app-types'; + +/** + * Possible string formats used for uploading via `StorageReference.putString()` + * + * ```js + * firebase.storage.StringFormat; + * ``` + */ +export interface StringFormat { + /** + * Raw string format. + * + * #### Usage + * + * ```js + * firebase.storage.StringFormat.RAW; + * ``` + * + * #### Example String Format + * + * ```js + * const sampleString = ''; + * ``` + */ + RAW: 'raw'; + + /** + * Base64 string format. + * + * Learn more about Base64 [on the Mozilla Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding) + * + * #### Usage + * + * ```js + * firebase.storage.StringFormat.BASE64; + * ``` + * + * #### Example String Format + * + * ```js + * const sampleString = 'PEZvbyBCYXI+'; + * ``` + * + */ + BASE64: 'base64'; + + /** + * Base64Url string format. + * + * #### Usage + * + * ```js + * firebase.storage.StringFormat.BASE64URL; + * ``` + * + * #### Example String Format + * + * ```js + * const sampleString = 'PEZvbyBCYXI-'; + * ``` + * + */ + BASE64URL: 'base64url'; + + /** + * Data URL string format. + * + * #### Usage + * + * ```js + * firebase.storage.StringFormat.DATA_URL; + * ``` + * + * #### Example String Format + * + * ```js + * const sampleString = 'data:text/plain;base64,PEZvbyBCYXI+'; + * ``` + */ + DATA_URL: 'data_url'; +} + +/** + * An event to subscribe to that is triggered on a Upload or Download task. + * + * Event subscription is created via `StorageTask.on()`. + * + * ```js + * firebase.storage.TaskEvent; + * ``` + */ +export interface TaskEvent { + /** + * An event that indicates that the tasks state has changed. + * + * ```js + * firebase.storage.TaskEvent.STATE_CHANGED; + * ``` + */ + STATE_CHANGED: 'state_changed'; +} + +/** + * A collection of properties that indicates the current tasks state. + * + * An event subscription is created via `StorageTask.on()`. + * + * ```js + * firebase.storage.TaskEvent; + * ``` + */ +export interface TaskState { + /** + * Task has been cancelled by the user. + */ + CANCELLED: 'cancelled'; + + /** + * An Error occurred, see TaskSnapshot.error for details. + */ + ERROR: 'error'; + + /** + * Task has been paused. Resume the task via `StorageTask.resume()`. + */ + PAUSED: 'paused'; + + /** + * Task is running. Pause the task via `StorageTask.pause()` + */ + RUNNING: 'running'; + + /** + * Task has completed successfully. + */ + SUCCESS: 'success'; +} + +/** + * A collection of native device file paths to aid in the usage of file path based storage methods. + * + * Concatenate a file path with your target file name when using `putFile` or `getFile`. + * + * ```js + * firebase.storage.Path; + * ``` + */ +export interface Path { + /** + * Returns an absolute path to the applications main bundle. + * + * ```js + * firebase.storage.Path.MainBundle; + * ``` + * + * @ios iOS only + */ + MainBundle: string; + + /** + * Returns an absolute path to the application specific cache directory on the filesystem. + * + * The system will automatically delete files in this directory when disk space is needed elsewhere on the device, starting with the oldest files first. + * + * ```js + * firebase.storage.Path.CachesDirectory; + * ``` + */ + CachesDirectory: string; + + /** + * Returns an absolute path to the users Documents directory. + * + * Use this directory to place documents that have been created by the user. + * + * ```js + * firebase.storage.Path.DocumentDirectory; + * ``` + */ + DocumentDirectory: string; + + /** + * Returns an absolute path to a temporary directory. + * + * Use this directory to create temporary files. The system will automatically delete files in this directory when disk space is needed elsewhere on the device, starting with the oldest files first. + * + * ```js + * firebase.storage.Path.TempDirectory; + * ``` + */ + TempDirectory: string; + + /** + * Returns an absolute path to the apps library/resources directory. + * + * E.g. this can be used for things like documentation, support files, and configuration files and generic resources. + * + * ```js + * firebase.storage.Path.LibraryDirectory; + * ``` + */ + LibraryDirectory: string; + + /** + * Returns an absolute path to the directory on the primary shared/external storage device. + * + * Here your application can place persistent files it owns. These files are internal to the application, and not typically visible to the user as media. + * + * Returns null if no external storage directory found, e.g. removable media has been ejected by the user. + * + * ```js + * firebase.storage.Path.ExternalDirectory; + * ``` + * + * @android Android only - iOS returns null + */ + ExternalDirectory: string | null; + + /** + * Returns an absolute path to the primary shared/external storage directory. + * + * Traditionally this is an SD card, but it may also be implemented as built-in storage on a device. + * + * Returns null if no external storage directory found, e.g. removable media has been ejected by the user. + * + * ```js + * firebase.storage.Path.ExternalStorageDirectory; + * ``` + * + * @android Android only - iOS returns null + */ + ExternalStorageDirectory: string | null; + + /** + * Returns an absolute path to a directory in which to place pictures that are available to the user. + * + * ```js + * firebase.storage.Path.PicturesDirectory; + * ``` + */ + PicturesDirectory: string; + + /** + * Returns an absolute path to a directory in which to place movies that are available to the user. + * + * ```js + * firebase.storage.Path.MoviesDirectory; + * ``` + */ + MoviesDirectory: string; +} + +/** + * Cloud Storage statics. + * + * #### Example + * + * ```js + * firebase.storage; + * ``` + */ +export interface Statics { + /** + * Possible string formats used for uploading via `StorageReference.putString()` + * + * #### Example + * + * ```js + * firebase.storage.StringFormat; + * ``` + */ + StringFormat: StringFormat; + + /** + * A collection of properties that indicates the current tasks state. + * + * #### Example + * + * ```js + * firebase.storage.TaskState; + * ``` + */ + TaskState: TaskState; + + /** + * An event to subscribe to that is triggered on a Upload or Download task. + * + * #### Example + * + * ```js + * firebase.storage.TaskEvent; + * ``` + */ + TaskEvent: TaskEvent; + + /** + * A collection of native device file paths to aid in the usage of file path based storage methods. + * + * #### Example + * + * ```js + * firebase.storage.Path; + * ``` + */ + Path: Path; +} + +/** + * An interface representing all the metadata properties that can be set. + * + * This is used in updateMetadata, put, putString & putFile. + */ +export interface SettableMetadata { + /** + * The 'Cache-Control' HTTP header that will be set on the storage object when it's requested. + * + * #### Example 1 + * + * To turn off caching, you can set the following cacheControl value. + * + * ```js + * { + * cacheControl: 'no-store', + * } + * ``` + * + * #### Example 2 + * + * To aggressively cache an object, e.g. static assets, you can set the following cacheControl value. + * + * ```js + * { + * cacheControl: 'public, max-age=31536000', + * } + * ``` + * + * [Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) + */ + cacheControl?: string | null; + + /** + * The 'Content-Disposition' HTTP header that will be set on the storage object when it's requested. + * + * [Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) + */ + contentDisposition?: string | null; + + /** + * The 'Content-Encoding' HTTP header that will be used on the storage object when it's requested. + * + * [Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding) + */ + contentEncoding?: string | null; + + /** + * The 'Content-Language' HTTP header that will be set on the storage object when it's requested. + * + * [Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language) + */ + contentLanguage?: string | null; + + /** + * The 'Content-Type' HTTP header that will be set on the object when it's requested. + * + * This is used to indicate the media type (or MIME type) of the object. When uploading a file + * Firebase Cloud Storage for React Native will attempt to automatically detect this if `contentType` + * is not already set, if it fails to detect a media type it will default to `application/octet-stream`. + * + * For `DATA_URL` string formats uploaded via `putString` this will also be automatically extracted if available. + * + * #### Example + * + * Setting the content type as JSON, e.g. for when uploading a JSON string via `putString`. + * + * ```js + * { + * contentType: 'application/json', + * } + * ``` + * + * [Learn more about this header on Mozilla.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type) + */ + contentType?: string | null; + + /** + * Additional user-defined custom metadata for this storage object. + * + * String values only are supported for custom metadata property values. + * + * #### Example + * + * Adding a user controlled NSFW meta data field. + * + * ```js + * { + * customMetadata: { + * 'nsfw': 'true' + * }, + * } + */ + customMetadata?: { + [key: string]: string, + } | null; +} + +/** + * The full readable metadata returned by `TaskSnapshot.metadata` or `StorageReference.getMetadata()`. + */ +export interface FullMetadata extends SettableMetadata { + /** + * A Base64-encoded MD5 hash of the storage object being uploaded. + */ + md5Hash: string | null; + + /** + * The bucket this storage object is contained in. + * + * #### Example Value + * + * ``` + * gs://my-project-storage-bucket + * ``` + */ + bucket: string; + + /** + * The full path to this storage object in its bucket. + * + * #### Example Value + * + * ``` + * invertase/logo.png + * ``` + */ + fullPath: string; + + /** + * Storage object generation values enable users to uniquely identify data resources, e.g. object versioning. + * + * Read more on generation on the [Google Cloud Storage documentation](https://cloud.google.com/storage/docs/generations-preconditions). + */ + generation: string; + + /** + * Storage object metageneration values enable users to uniquely identify data resources, e.g. object versioning. + * + * Read more on metageneration on the [Google Cloud Storage documentation](https://cloud.google.com/storage/docs/generations-preconditions). + */ + metageneration: string; + + /** + * The short name of storage object in its bucket, e.g. it's file name. + * + * #### Example Value + * + * ``` + * logo.png + * ``` + */ + name: string; + + /** + * The size of this storage object in bytes. + */ + size: number; + + /** + * A date string representing when this storage object was created. + * + * #### Example Value + * + * ``` + * 2019-05-02T00:34:56.264Z + * ``` + */ + timeCreated: string; + + /** + * A date string representing when this storage object was last updated. + * + * #### Example Value + * + * ``` + * 2019-05-02T00:35:56.264Z + * ``` + */ + updated: string; +} + +// TODO(salakar) -----\/ +export interface Reference { + bucket: string; + + parent: Reference | null; + + fullPath: string; + + name: string; + + root: Reference; + + storage: Module; + + toString(): string; + + child(path: string): Reference; + + delete(): Promise; + + getDownloadURL(): Promise; + + getMetadata(): Promise; + + putFile(localFilePath: string, metadata?: SettableMetadata): Task; + + put(data: Blob | Uint8Array | ArrayBuffer, metadata?: SettableMetadata): Task; + + putString(data: string, format?: StringFormat, metadata?: SettableMetadata): Task; + + updateMetadata(metadata: SettableMetadata): Promise; +} + +export interface TaskSnapshotObserver { + next: (taskSnapshot: TaskSnapshot) => void; + + error: (error: Error) => void; + + complete: () => void; +} + +/** + * Storage Task used for Uploading or Downloading files. + * + * #### Example 1 + * + * Get a Upload Storage task to upload a string: + * + * ```js + * const string = '{ "foo": 1 }'; + * const task = firebase + * .storage() + * .ref('/foo/bar.json') + * .putString(string); + * ``` + * + * #### Example 2 + * + * Get a Download Storage task to download a file: + * + * ```js + * const string = '{ "foo": 1 }'; + * const downloadTo = `${firebase.storage.Path.DocumentDirectory}/bar.json`; + * + * const task = firebase + * .storage() + * .ref('/foo/bar.json') + * .getFile(downloadTo); + * ``` + */ +export interface Task { + /** + * Pause the current Download or Upload task. + * + * #### Example + * + * Pause a running task inside a state changed listener: + * + * ```js + * task.on('state_changed', taskSnapshot => { + * if (taskSnapshot.state === firebase.storage.TaskState.RUNNING) { + * console.log('Pausing my task!'); + * task.pause(); + * } + * }); + * ``` + * + */ + pause(): Promise; + + /** + * Resume the current Download or Upload task. + * + * #### Example + * + * Resume a previously paused task inside a state changed listener: + * + * ```js + * task.on('state_changed', taskSnapshot => { + * // ... pause me ... + * if (taskSnapshot.state === firebase.storage.TaskState.PAUSED) { + * console.log('Resuming my task!'); + * task.resume(); + * } + * }); + * ``` + * + */ + resume(): Promise; + + /** + * Cancel the current Download or Upload task. + * + * + * #### Example + * + * Cancel a task inside a state changed listener: + * + * ```js + * task.on('state_changed', taskSnapshot => { + * console.log('Cancelling my task!'); + * task.cancel(); + * }); + * ``` + * + */ + cancel(): Promise; + + /** + * + * @param event + * @param nextOrObserver + * @param error + * @param complete + */ + on( + event: 'state_changed', + nextOrObserver?: TaskSnapshotObserver | null | ((a: TaskSnapshot) => any), + error?: ((a: Error) => any) | null, + complete?: (() => void) | null, + ): Function; + + // /** + // * @ignore May not exist in RN JS Environment yet so we'll hide from docs. + // */ + // finally(onFinally?: (() => void) | undefined | null): Promise; + + then( + onFulfilled?: ((a: TaskSnapshot) => any) | null, + onRejected?: ((a: Error) => any) | null, + ): Promise; + + catch(onRejected: (a: Error) => any): Promise; +} + +/** + * A TaskSnapshot provides information about a storage tasks state. + * + * #### Example 1 + * + * ``` + * firebase + * .storage() + * .ref('/foo/bar.json') + * .putString(JSON.stringify({ foo: 'bar' })) + * .then((taskSnapshot) => { + * if (taskSnapshot.state === firebase.storage.TaskState.SUCCESS) { + * console.log('Total bytes uploaded: ', taskSnapshot.totalBytes); + * } + * }); + * ``` + * + * #### Example 2 + * + * ``` + * const task = firebase + * .storage() + * .ref('/foo/bar.json') + * .putString(JSON.stringify({ foo: 'bar' })); + * + * task.on('state_changed', taskSnapshot => { + * if (taskSnapshot.state === firebase.storage.TaskState.PAUSED) { + * console.log('Resuming my task!'); + * task.resume(); + * } + * }); + * ``` + */ +export interface TaskSnapshot { + /** + * The number of bytes currently transferred. + */ + bytesTransferred: number; + + /** + * The metadata of the tasks via a {@link storage.FullMetadata} interface. + */ + metadata: FullMetadata; + + /** + * The {@link storage.Reference} of the task. + */ + ref: Reference; + + /** + * The current state of the task snapshot. + */ + state: 'cancelled' | 'error' | 'paused' | 'running' | 'success'; + + /** + * The parent {@link storage.Task} of this snapshot. + */ + task: Task; + + /** + * The total amount of bytes for this task. + */ + totalBytes: number; + + /** + * If the {@link storage.TaskSnapshot#state} is `error`, returns a JavaScript error of the + * current task snapshot. + */ + error?: NativeFirebaseError; +} + +/** + * The Cloud Storage service is available for the default app, a given app or a specific storage bucket. + * + * #### Example 1 + * + * Get the storage instance for the **default app**: + * + * ```js + * const storageForDefaultApp = firebase.storage(); + * ``` + * + * #### Example 2 + * + * Get the storage instance for a **secondary app**: + * + * ```js + * const otherApp = firebase.app('otherApp'); + * const storageForOtherApp = firebase.storage(otherApp); + * ``` + * + * #### Example 3 + * + * Get the storage instance for a **specific storage bucket**: + * + * ```js + * const defaultApp = firebase.app(); + * const storageForBucket = defaultApp.storage('gs://another-bucket-url'); + * + * const otherApp = firebase.app('otherApp'); + * const storageForOtherAppBucket = otherApp.storage('gs://another-bucket-url'); + * ``` + * + */ +export interface Module extends ReactNativeFirebaseModule { + /** + * TODO. + * + * #### Example + * + * ```js + * const uploadRetryTime = firebase.storage().maxUploadRetryTime; + * ``` + */ + maxUploadRetryTime: number; + + /** + * TODO. + * + * #### Example + * + * ```js + * await firebase.storage().setMaxUploadRetryTime(5000); + * ``` + * + * @param time Number of milliseconds.... TODO + */ + setMaxUploadRetryTime(time: number): Promise; + + /** + * TODO. + * + * #### Example + * + * ```js + * const downloadRetryTime = firebase.storage().maxUploadRetryTime; + * ``` + */ + maxDownloadRetryTime: number; + + /** + * TODO. + * + * #### Example + * + * ```js + * await firebase.storage().setMaxDownloadRetryTime(5000); + * ``` + * + * @param time Number of miliseconds.... TODO + */ + setMaxDownloadRetryTime(time: number): Promise; + + /** + * TODO. + * + * #### Example + * + * ```js + * const maxOperationRetryTime = firebase.storage().maxOperationRetryTime; + * ``` + */ + maxOperationRetryTime: number; + + /** + * TODO. + * + * #### Example + * + * ```js + * await firebase.storage().setMaxOperationRetryTime(5000); + * ``` + * + * @param time Number of miliseconds.... TODO + */ + setMaxOperationRetryTime(time: number): Promise; + + /** + * Returns a new {@link storage.Reference} instance. + * + * #### Example + * + * ```js + * const maxOperationRetryTime = firebase.storage().maxOperationRetryTime; + * ``` + * + * @param path An optional string pointing to a location on the storage bucket. If no path + * is provided, the returned reference will be the bucket root path. + */ + ref(path?: string): Reference; + + /** + * Returns a new {@link storage.Reference} instance from a storage bucket URL. + * + * #### Example + * + * ```js + * const maxOperationRetryTime = firebase.storage().maxOperationRetryTime; + * ``` + * + * @param url A storage bucket URL pointing to a single file or location. Must start with `gs://`, + * e.g. `gs://assets/logo.png` or `gs://assets`. + */ + refFromURL(url: string): Reference; +} + +declare module '@react-native-firebase/storage' { + import type { + ReactNativeFirebaseNamespace, + ReactNativeFirebaseModuleAndStatics, + } from '@react-native-firebase/app-types/index.js.flow'; + /** + * @example + * ```js + * import { firebase } from '@react-native-firebase/storage'; + * firebase.storage().X(...); + * ``` + */ + declare export var firebase: {} & ReactNativeFirebaseNamespace; + + /** + * @example + * ```js + * import storage from '@react-native-firebase/storage'; + * storage().X(...); + * ``` + */ + declare export default ReactNativeFirebaseModuleAndStatics; +} + +/** + * Attach namespace to `firebase.` and `FirebaseApp.`. + */ +declare module '@react-native-firebase/app-types' { + import type { ReactNativeFirebaseModuleAndStatics } from '@react-native-firebase/app-types/index.js.flow'; + + declare interface ReactNativeFirebaseNamespace { + /** + * Storage + */ + storage: ReactNativeFirebaseModuleAndStatics; + } + + declare interface FirebaseApp { + /** + * Storage + */ + storage(): Module; + } +} diff --git a/packages/storage/lib/utils.js b/packages/storage/lib/utils.js new file mode 100644 index 00000000..163c48c6 --- /dev/null +++ b/packages/storage/lib/utils.js @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import { NativeFirebaseError } from '@react-native-firebase/app/lib/internal'; +import { isNull, isString, isObject } from '@react-native-firebase/common'; + +const SETTABLE_FIELDS = [ + 'cacheControl', + 'contentDisposition', + 'contentEncoding', + 'contentLanguage', + 'contentType', + 'customMetadata', +]; + +export function handleStorageEvent(storageInstance, event) { + const { taskId, eventName } = event; + const body = event.body || {}; + + if (body.error) { + body.error = NativeFirebaseError.fromEvent(body.error, storageInstance._config.namespace); + } + + storageInstance.emitter.emit(storageInstance.eventNameForApp(taskId, eventName), body); +} + +export function getUrlParts(url) { + const bucket = url.substring(0, url.indexOf('/', 5)) || url; + const path = + (url.indexOf('/', 5) > -1 ? url.substring(url.indexOf('/', 5) + 1, url.length) : '/') || '/'; + + return { bucket, path }; +} + +export function validateMetadata(metadata) { + if (!isObject(metadata)) { + throw new Error(`firebase.storage.SettableMetadata must be an object value if provided.`); + } + + const metadataEntries = Object.entries(metadata); + + for (let i = 0; i < metadataEntries.length; i++) { + const [key, value] = metadataEntries[i]; + // validate keys + if (!SETTABLE_FIELDS.includes(key)) { + throw new Error( + `firebase.storage.SettableMetadata unknown property '${key}' provided for metadata.`, + ); + } + + // validate values + if (key !== 'customMetadata') { + if (!isString(value) && !isNull(value)) { + throw new Error( + `firebase.storage.SettableMetadata invalid property '${key}' should be a string or null value.`, + ); + } + } else if (!isObject(value)) { + throw new Error( + `firebase.storage.SettableMetadata.customMetadata must be an object of keys and string values.`, + ); + } + } + + return metadata; +} diff --git a/packages/storage/package.json b/packages/storage/package.json new file mode 100644 index 00000000..5da178cc --- /dev/null +++ b/packages/storage/package.json @@ -0,0 +1,49 @@ +{ + "name": "@react-native-firebase/storage", + "version": "6.0.0-alpha.9", + "author": "Invertase (http://invertase.io)", + "description": "React Native Firebase - Cloud Storage for Firebase is a powerful, simple, and cost-effective object storage service built for Google scale.", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "scripts": { + "build": "genversion --semi lib/version.js", + "build:clean": "rimraf android/build && rimraf ios/build", + "prepare": "yarn run build" + }, + "repository": { + "type": "git", + "url": "https://github.com/invertase/react-native-firebase/tree/master/packages/storage" + }, + "license": "Apache-2.0", + "keywords": [ + "react", + "react-native", + "firebase", + "images", + "audio", + "video", + "json", + "cloud storage", + "storage", + "upload", + "download" + ], + "peerDependencies": { + "@react-native-firebase/app": "6.0.0-alpha.9" + }, + "dependencies": { + "@react-native-firebase/app-types": "6.0.0-alpha.9", + "@react-native-firebase/common": "6.0.0-alpha.9" + }, + "rnpm": { + "android": { + "buildPatch": "implementation project(':@react-native-firebase_storage')", + "packageImportPath": "import io.invertase.firebase.storage.ReactNativeFirebaseStoragePackage;", + "packageInstance": "new ReactNativeFirebaseStoragePackage()" + } + }, + "gitHead": "2787d4413eb70c61a687c4d6913add6a6a01f582", + "publishConfig": { + "access": "public" + } +} diff --git a/packages/utils/android/build.gradle b/packages/utils/android/build.gradle index f7dfc985..82ed241b 100644 --- a/packages/utils/android/build.gradle +++ b/packages/utils/android/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.4.0' } } diff --git a/packages/utils/ios/RNFBUtils.podspec b/packages/utils/ios/RNFBUtils.podspec index 0f5920ef..792b94cb 100644 --- a/packages/utils/ios/RNFBUtils.podspec +++ b/packages/utils/ios/RNFBUtils.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| s.platform = :ios, "10.0" s.source_files = 'RNFBUtils/**/*.{h,m}' s.dependency 'React' - s.dependency 'Firebase/Core', '~> 5.19.0' + s.dependency 'Firebase/Core', '~> 5.20.2' s.dependency 'RNFBApp' s.static_framework = true end diff --git a/packages/utils/lib/index.d.ts b/packages/utils/lib/index.d.ts index 4fa9d944..9cc9c892 100644 --- a/packages/utils/lib/index.d.ts +++ b/packages/utils/lib/index.d.ts @@ -22,14 +22,58 @@ import { } from '@react-native-firebase/app-types'; /** - * Utils + * React Native Firebase Utilities package. + * + * #### Example 1 + * + * Access the firebase export from the `utils` package: + * + * ```js + * import { firebase } from '@react-native-firebase/utils'; + * + * // firebase.utils().X + * ``` + * + * #### Example 2 + * + * Using the default export from the `utils` package: + * + * ```js + * import utils from '@react-native-firebase/utils'; + * + * // utils().X + * ``` + * + * #### Example 3 + * + * Using the default export from the `app` package: + * + * ```js + * import firebase from '@react-native-firebase/app'; + * import '@react-native-firebase/utils'; + * + * // firebase.utils().X + * ``` * * @firebase utils */ export namespace Utils { export interface Statics {} - export interface Module extends ReactNativeFirebaseModule { + /** + * The React Native Firebase Utils service interface. + * + * > This module is available for the default app only. + * + * #### Example + * + * Get the Utils service for the default app: + * + * ```js + * const defaultAppUtils = firebase.utils(); + * ``` + */ + export class Module extends ReactNativeFirebaseModule { /** * Returns true if this app is running inside a Firebase Test Lab environment. Always returns false on iOS. * diff --git a/scripts/_TEMPLATE_/android/build.gradle b/scripts/_TEMPLATE_/android/build.gradle index db1cf71e..f0465617 100644 --- a/scripts/_TEMPLATE_/android/build.gradle +++ b/scripts/_TEMPLATE_/android/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.4.0' } } diff --git a/scripts/_TEMPLATE_/ios/RNFB_Template_.podspec b/scripts/_TEMPLATE_/ios/RNFB_Template_.podspec index 65d55f2d..bf137a26 100644 --- a/scripts/_TEMPLATE_/ios/RNFB_Template_.podspec +++ b/scripts/_TEMPLATE_/ios/RNFB_Template_.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| s.platform = :ios, "10.0" s.source_files = 'RNFB_Template_/**/*.{h,m}' s.dependency 'React' - s.dependency 'Firebase/Core', '~> 5.19.0' + s.dependency 'Firebase/Core', '~> 5.20.2' s.dependency 'RNFBApp' s.static_framework = true end diff --git a/scripts/_TEMPLATE_/lib/index.d.ts b/scripts/_TEMPLATE_/lib/index.d.ts index d9ad3bd2..0b2bb833 100644 --- a/scripts/_TEMPLATE_/lib/index.d.ts +++ b/scripts/_TEMPLATE_/lib/index.d.ts @@ -22,64 +22,105 @@ import { } from '@react-native-firebase/app-types'; /** - * _Template_ + * Firebase _Template_ package for React Native. + * + * #### Example 1 + * + * Access the firebase export from the `_template_` package: + * + * ```js + * import { firebase } from '@react-native-firebase/_template_'; + * + * // firebase._template_().X + * ``` + * + * #### Example 2 + * + * Using the default export from the `_template_` package: + * + * ```js + * import _template_ from '@react-native-firebase/_template_'; + * + * // _template_().X + * ``` + * + * #### Example 3 + * + * Using the default export from the `app` package: + * + * ```js + * import firebase from '@react-native-firebase/app'; + * import '@react-native-firebase/_template_'; + * + * // firebase._template_().X + * ``` * * @firebase _template_ */ export namespace _Template_ { - export interface Statics {} + export interface Statics { + // firebase._template_.* static props go here + } + /** + * // TODO CHOOSE THIS --------------------------------------- + * + * The Firebase _Template_ service interface. + * + * > This module is available for the default app only. + * + * #### Example + * + * Get the _Template_ service for the default app: + * + * ```js + * const defaultApp_Template_ = firebase._template_(); + * ``` + * + * // TODO OR THIS ------------------------------------------- + * + * The Firebase _Template_ service is available for the default app or a given app. + * + * #### Example 1 + * + * Get the _template_ instance for the **default app**: + * + * ```js + * const _template_ForDefaultApp = firebase._template_(); + * ``` + * + * #### Example 2 + * + * Get the _template_ instance for a **secondary app**: + * + * ```js + * const otherApp = firebase.app('otherApp'); + * const _template_ForOtherApp = firebase._template_(otherApp); + * ``` + * + */ export interface Module extends ReactNativeFirebaseModule { - + // firebase._template_().* methods & props go here } } declare module '@react-native-firebase/_template_' { import { ReactNativeFirebaseNamespace } from '@react-native-firebase/app-types'; - const FirebaseNamespaceExport: {} & ReactNativeFirebaseNamespace; - - /** - * @example - * ```js - * import { firebase } from '@react-native-firebase/_template_'; - * firebase._template_().X(...); - * ``` - */ export const firebase = FirebaseNamespaceExport; - const _Template_DefaultExport: ReactNativeFirebaseModuleAndStatics< _Template_.Module, _Template_.Statics >; - /** - * @example - * ```js - * import _template_ from '@react-native-firebase/_template_'; - * _template_().X(...); - * ``` - */ export default _Template_DefaultExport; } -/** - * Attach namespace to `firebase.` and `FirebaseApp.`. - */ declare module '@react-native-firebase/app-types' { interface ReactNativeFirebaseNamespace { - /** - * _Template_ - */ - _template_: ReactNativeFirebaseModuleAndStatics< - _Template_.Module, - _Template_.Statics - >; + _template_: ReactNativeFirebaseModuleAndStatics<_Template_.Module, _Template_.Statics>; } interface FirebaseApp { - /** - * _Template_ - */ _template_(): _Template_.Module; } } diff --git a/tests/android/app/build.gradle b/tests/android/app/build.gradle index 1f39c7f1..f5b7903d 100755 --- a/tests/android/app/build.gradle +++ b/tests/android/app/build.gradle @@ -1,6 +1,6 @@ -apply plugin: "com.android.application" -apply plugin: "com.google.firebase.firebase-perf" +apply plugin: 'com.android.application' apply plugin: 'io.fabric' +apply plugin: "com.google.firebase.firebase-perf" crashlytics { enableNdk true @@ -26,6 +26,7 @@ def firebasePackages = [ 'iid', 'invites', 'mlkit', + 'storage', 'perf', 'utils' ] @@ -44,8 +45,7 @@ android { } testBuildType System.getProperty('testBuildType', 'debug') - missingDimensionStrategy "minReactNative", "minReactNative46" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' multiDexEnabled true } splits { @@ -56,6 +56,7 @@ android { include "armeabi-v7a", "x86" } } + signingConfigs { release { storeFile file("keystore.jks") @@ -64,10 +65,12 @@ android { keyPassword "12345678" } } + buildTypes { release { - minifyEnabled false + minifyEnabled true proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" + proguardFile "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro" signingConfig signingConfigs.release matchingFallbacks = ['release'] } @@ -103,14 +106,21 @@ android { exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' + pickFirst '**/armeabi-v7a/libc++_shared.so' + pickFirst '**/x86/libc++_shared.so' + pickFirst '**/arm64-v8a/libc++_shared.so' + pickFirst '**/x86_64/libc++_shared.so' + pickFirst '**/x86/libjsc.so' + pickFirst '**/armeabi-v7a/libjsc.so' } } dependencies { + implementation fileTree(dir: "libs", include: ["*.jar"]) //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" - implementation fileTree(dir: "libs", include: ["*.jar"]) - + //noinspection GradleDynamicVersion + implementation 'org.webkit:android-jsc:+' /* ---------------------------- * REACT NATIVE FIREBASE * ---------------------------- */ @@ -126,10 +136,8 @@ dependencies { transitive = false } - androidTestImplementation project(path: ":detox") + androidTestImplementation('com.wix:detox:+') { transitive = true } androidTestImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test:rules:1.0.2' } // Run this once to be able to run the application with BUCK diff --git a/tests/android/app/src/androidTest/java/com/invertase/testing/DetoxTest.java b/tests/android/app/src/androidTest/java/com/invertase/testing/DetoxTest.java index c859d1c9..fafd71a1 100755 --- a/tests/android/app/src/androidTest/java/com/invertase/testing/DetoxTest.java +++ b/tests/android/app/src/androidTest/java/com/invertase/testing/DetoxTest.java @@ -1,15 +1,15 @@ package com.invertase.testing; -import android.support.test.filters.LargeTest; -import android.support.test.rule.ActivityTestRule; -import android.support.test.runner.AndroidJUnit4; - import com.wix.detox.Detox; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.filters.LargeTest; +import androidx.test.rule.ActivityTestRule; + @RunWith(AndroidJUnit4.class) @LargeTest public class DetoxTest { @@ -18,7 +18,7 @@ public class DetoxTest { public ActivityTestRule mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false); @Test - public void runDetoxTests() throws InterruptedException { + public void runDetoxTests() { Detox.runTests(mActivityRule); } } diff --git a/tests/android/app/src/main/AndroidManifest.xml b/tests/android/app/src/main/AndroidManifest.xml index 92e5c981..f61ed717 100755 --- a/tests/android/app/src/main/AndroidManifest.xml +++ b/tests/android/app/src/main/AndroidManifest.xml @@ -7,10 +7,7 @@ - - - include ':jet' project(':jet').projectDir = new File(rootProject.projectDir, './../node_modules/jet/android') -include ':detox' -project(':detox').projectDir = new File(rootProject.projectDir, './../node_modules/detox/android/detox') - include ':app' diff --git a/tests/app.js b/tests/app.js index 6f2be917..6037b170 100755 --- a/tests/app.js +++ b/tests/app.js @@ -29,6 +29,7 @@ import '@react-native-firebase/crashlytics'; import '@react-native-firebase/fiam'; import '@react-native-firebase/functions'; import '@react-native-firebase/mlkit'; +import '@react-native-firebase/storage'; import '@react-native-firebase/iid'; import '@react-native-firebase/invites'; import '@react-native-firebase/perf'; @@ -50,6 +51,7 @@ class Root extends Component { render() { const { currentTest } = this.state; + if (!currentTest) { return ( diff --git a/tests/app.playground.js b/tests/app.playground.js new file mode 100755 index 00000000..af45610f --- /dev/null +++ b/tests/app.playground.js @@ -0,0 +1,136 @@ +/* eslint-disable import/extensions,import/no-unresolved,import/first,import/no-extraneous-dependencies,no-console */ +/* + * Copyright (c) 2016-present Invertase Limited & Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this library except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import React, { Component } from 'react'; +import { AppRegistry, Image, StyleSheet, View } from 'react-native'; + +import '@react-native-firebase/analytics'; +import '@react-native-firebase/config'; +import '@react-native-firebase/utils'; +import '@react-native-firebase/crashlytics'; +import '@react-native-firebase/fiam'; +import '@react-native-firebase/functions'; +import '@react-native-firebase/mlkit'; +import '@react-native-firebase/storage'; +import '@react-native-firebase/iid'; +import '@react-native-firebase/invites'; +import '@react-native-firebase/perf'; +import firebase from '@react-native-firebase/app'; + +class Root extends Component { + constructor(props) { + super(props); + this.runSingleTest(); + } + + async runSingleTest() { + await firebase + .storage() + .ref('/cat.gif') + .getFile(`${firebase.storage.Path.DocumentDirectory}/pauseUpload.gif`); + + const ref = firebase.storage().ref('/uploadCat.gif'); + const path = `${firebase.storage.Path.DocumentDirectory}/pauseUpload.gif`; + const uploadTask = ref.putFile(path); + + let hadRunningStatus = false; + let hadPausedStatus = false; + let hadResumedStatus = false; + + uploadTask.on( + 'state_changed', + snapshot => { + console.log('----> ', snapshot.state); + console.dir(snapshot.error); + // 1) pause when we receive first running event + if (snapshot.state === firebase.storage.TaskState.RUNNING && !hadRunningStatus) { + console.log('--> Pausing'); + hadRunningStatus = true; + setTimeout(() => { + uploadTask.pause(); + }, 1000); + } + + // 2) resume when we receive first paused event + if (snapshot.state === firebase.storage.TaskState.PAUSED) { + hadPausedStatus = true; + setTimeout(() => { + console.log('--> Resuming'); + uploadTask.resume(); + }, 1000); + } + + // 3) track that we resumed on 2nd running status whilst paused + if ( + snapshot.state === firebase.storage.TaskState.RUNNING && + hadRunningStatus && + hadPausedStatus && + !hadResumedStatus + ) { + console.log('--> Resumed'); + hadResumedStatus = true; + } + + // 4) finally confirm we received all statuses + if (snapshot.state === firebase.storage.TaskState.SUCCESS) { + console.log('--> Success'); + console.log('FINISH'); + } + }, + error => { + console.log('ERROR', error); + }, + ); + + return Promise.resolve(); + } + + render() { + return ( + + + + ); + } +} + +const styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: 'center', + }, + horizontal: { + flexDirection: 'column', + justifyContent: 'center', + alignItems: 'center', + padding: 10, + }, + logo: { + height: 120, + marginBottom: 16, + width: 135, + }, +}); + +AppRegistry.registerComponent('testing', () => Root); diff --git a/tests/e2e/init.js b/tests/e2e/init.js index dca4e039..58f9ee66 100755 --- a/tests/e2e/init.js +++ b/tests/e2e/init.js @@ -35,20 +35,19 @@ const PACKAGES = [ 'config', 'crashlytics', 'utils', - 'mlkit', + // 'mlkit', 'invites', 'fiam', // 'auth', // 'firestore', // 'links', // 'messaging', - // 'storage', + 'storage', ]; for (let i = 0; i < PACKAGES.length; i++) { requirePackageTests(PACKAGES[i]); } - before(async () => { await detox.init(config); await jet.init(); diff --git a/tests/e2e/mocha.opts b/tests/e2e/mocha.opts index 94930d7a..e9431659 100755 --- a/tests/e2e/mocha.opts +++ b/tests/e2e/mocha.opts @@ -1,8 +1,8 @@ --recursive --timeout 260000 --reporter spec ---slow 1000 ---retries 1 +--slow 2000 +--retries 2 --bail --exit ---require jet/platform/node +--require node_modules/jet/platform/node diff --git a/tests/index.js b/tests/index.js index eaa176c1..ed8f98ab 100755 --- a/tests/index.js +++ b/tests/index.js @@ -16,3 +16,4 @@ */ require('./app'); +// require('./app.playground'); diff --git a/tests/ios/Podfile.lock b/tests/ios/Podfile.lock index 2ab0b5ec..3a773cad 100644 --- a/tests/ios/Podfile.lock +++ b/tests/ios/Podfile.lock @@ -4,33 +4,36 @@ PODS: - Fabric (~> 1.9.0) - DoubleConversion (1.1.6) - Fabric (1.9.0) - - Firebase/Core (5.19.0): + - Firebase/Core (5.20.2): - Firebase/CoreOnly - - FirebaseAnalytics (= 5.8.0) - - Firebase/CoreOnly (5.19.0): - - FirebaseCore (= 5.4.0) - - Firebase/Functions (5.19.0): + - FirebaseAnalytics (= 5.8.1) + - Firebase/CoreOnly (5.20.2): + - FirebaseCore (= 5.4.1) + - Firebase/Functions (5.20.2): - Firebase/CoreOnly - FirebaseFunctions (= 2.4.0) - - Firebase/InAppMessagingDisplay (5.19.0): + - Firebase/InAppMessagingDisplay (5.20.2): - Firebase/CoreOnly - FirebaseInAppMessagingDisplay (= 0.13.1) - - Firebase/Invites (5.19.0): + - Firebase/Invites (5.20.2): - Firebase/CoreOnly - FirebaseInvites (= 3.0.1) - - Firebase/Performance (5.19.0): + - Firebase/Performance (5.20.2): - Firebase/Core - FirebasePerformance (= 2.2.4) - - Firebase/RemoteConfig (5.19.0): + - Firebase/RemoteConfig (5.20.2): - Firebase/Core - FirebaseRemoteConfig (= 3.1.0) + - Firebase/Storage (5.20.2): + - Firebase/CoreOnly + - FirebaseStorage (= 3.1.1) - FirebaseABTesting (2.0.0): - FirebaseCore (~> 5.0) - Protobuf (~> 3.5) - - FirebaseAnalytics (5.8.0): + - FirebaseAnalytics (5.8.1): - FirebaseCore (~> 5.4) - FirebaseInstanceID (~> 3.8) - - GoogleAppMeasurement (= 5.8.0) + - GoogleAppMeasurement (= 5.8.1) - GoogleUtilities/AppDelegateSwizzler (~> 5.2) - GoogleUtilities/MethodSwizzler (~> 5.2) - GoogleUtilities/Network (~> 5.2) @@ -38,7 +41,7 @@ PODS: - nanopb (~> 0.3) - FirebaseAnalyticsInterop (1.2.0) - FirebaseAuthInterop (1.0.0) - - FirebaseCore (5.4.0): + - FirebaseCore (5.4.1): - GoogleUtilities/Environment (~> 5.2) - GoogleUtilities/Logger (~> 5.2) - FirebaseDynamicLinks (3.4.3): @@ -93,6 +96,10 @@ PODS: - GoogleUtilities/Environment (~> 5.2) - "GoogleUtilities/NSData+zlib (~> 5.2)" - Protobuf (~> 3.5) + - FirebaseStorage (3.1.1): + - FirebaseAuthInterop (~> 1.0) + - FirebaseCore (~> 5.2) + - GTMSessionFetcher/Core (~> 1.1) - Folly (2018.10.22.00): - boost-for-react-native - DoubleConversion @@ -103,7 +110,7 @@ PODS: - GTMSessionFetcher (>= 1.1.7) - GoogleAPIClientForREST/Core (1.3.8): - GTMSessionFetcher (>= 1.1.7) - - GoogleAppMeasurement (5.8.0): + - GoogleAppMeasurement (5.8.1): - GoogleUtilities/AppDelegateSwizzler (~> 5.2) - GoogleUtilities/MethodSwizzler (~> 5.2) - GoogleUtilities/Network (~> 5.2) @@ -168,99 +175,104 @@ PODS: - nanopb/decode (0.3.901) - nanopb/encode (0.3.901) - Protobuf (3.7.0) - - React (0.59.0): - - React/Core (= 0.59.0) - - React/Core (0.59.0): - - yoga (= 0.59.0.React) - - React/CxxBridge (0.59.0): + - React (0.59.5): + - React/Core (= 0.59.5) + - React/Core (0.59.5): + - yoga (= 0.59.5.React) + - React/CxxBridge (0.59.5): - Folly (= 2018.10.22.00) - React/Core - React/cxxreact - React/jsiexecutor - - React/cxxreact (0.59.0): + - React/cxxreact (0.59.5): - boost-for-react-native (= 1.63.0) - DoubleConversion - Folly (= 2018.10.22.00) - glog - React/jsinspector - - React/DevSupport (0.59.0): + - React/DevSupport (0.59.5): - React/Core - React/RCTWebSocket - - React/fishhook (0.59.0) - - React/jsi (0.59.0): + - React/fishhook (0.59.5) + - React/jsi (0.59.5): - DoubleConversion - Folly (= 2018.10.22.00) - glog - - React/jsiexecutor (0.59.0): + - React/jsiexecutor (0.59.5): - DoubleConversion - Folly (= 2018.10.22.00) - glog - React/cxxreact - React/jsi - - React/jsinspector (0.59.0) - - React/RCTBlob (0.59.0): + - React/jsinspector (0.59.5) + - React/RCTBlob (0.59.5): - React/Core - - React/RCTImage (0.59.0): + - React/RCTImage (0.59.5): - React/Core - React/RCTNetwork - - React/RCTNetwork (0.59.0): + - React/RCTNetwork (0.59.5): - React/Core - - React/RCTText (0.59.0): + - React/RCTText (0.59.5): - React/Core - - React/RCTWebSocket (0.59.0): + - React/RCTWebSocket (0.59.5): - React/Core - React/fishhook - React/RCTBlob - RNFBAnalytics (6.0.0-alpha.9): - - Firebase/Core (~> 5.19.0) + - Firebase/Core (~> 5.20.2) - React - RNFBApp - RNFBApp (6.0.0-alpha.9): - - Firebase/Core (~> 5.19.0) + - Firebase/Core (~> 5.20.2) - React - RNFBConfig (6.0.0-alpha.9): - - Firebase/Core (~> 5.19.0) - - Firebase/RemoteConfig (~> 5.19.0) + - Firebase/Core (~> 5.20.2) + - Firebase/RemoteConfig (~> 5.20.2) - React - RNFBApp - RNFBCrashlytics (6.0.0-alpha.9): - Crashlytics (~> 3.12.0) - Fabric (~> 1.9.0) - - Firebase/Core (~> 5.19.0) + - Firebase/Core (~> 5.20.2) - React - RNFBApp - RNFBFiam (6.0.0-alpha.9): - - Firebase/Core (~> 5.19.0) - - Firebase/InAppMessagingDisplay (~> 5.19.0) + - Firebase/Core (~> 5.20.2) + - Firebase/InAppMessagingDisplay (~> 5.20.2) - React - RNFBApp - RNFBFirestore (6.0.0-alpha.9): - - Firebase/Core (~> 5.19.0) + - Firebase/Core (~> 5.20.2) - React - RNFBApp - RNFBFunctions (6.0.0-alpha.9): - - Firebase/Functions (~> 5.19.0) + - Firebase/Functions (~> 5.20.2) - React - RNFBApp - RNFBIid (6.0.0-alpha.9): - - Firebase/Core (~> 5.19.0) + - Firebase/Core (~> 5.20.2) - React - RNFBApp - RNFBInvites (6.0.0-alpha.9): - - Firebase/Core (~> 5.19.0) - - Firebase/Invites (~> 5.19.0) + - Firebase/Core (~> 5.20.2) + - Firebase/Invites (~> 5.20.2) - React - RNFBApp - RNFBPerf (6.0.0-alpha.9): - - Firebase/Core (~> 5.19.0) - - Firebase/Performance (~> 5.19.0) + - Firebase/Core (~> 5.20.2) + - Firebase/Performance (~> 5.20.2) + - React + - RNFBApp + - RNFBStorage (6.0.0-alpha.9): + - Firebase/Core (~> 5.20.2) + - Firebase/Storage (~> 5.20.2) - React - RNFBApp - RNFBUtils (6.0.0-alpha.9): - - Firebase/Core (~> 5.19.0) + - Firebase/Core (~> 5.20.2) - React - RNFBApp - - yoga (0.59.0.React) + - yoga (0.59.5.React) DEPENDENCIES: - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) @@ -284,6 +296,7 @@ DEPENDENCIES: - "RNFBIid (from `../node_modules/@react-native-firebase/iid/ios`)" - "RNFBInvites (from `../node_modules/@react-native-firebase/invites/ios`)" - "RNFBPerf (from `../node_modules/@react-native-firebase/perf/ios`)" + - "RNFBStorage (from `../node_modules/@react-native-firebase/storage/ios`)" - "RNFBUtils (from `../node_modules/@react-native-firebase/utils/ios`)" - yoga (from `../node_modules/react-native/ReactCommon/yoga`) @@ -306,6 +319,7 @@ SPEC REPOS: - FirebaseInvites - FirebasePerformance - FirebaseRemoteConfig + - FirebaseStorage - GoogleAPIClientForREST - GoogleAppMeasurement - GoogleSignIn @@ -347,6 +361,8 @@ EXTERNAL SOURCES: :path: "../node_modules/@react-native-firebase/invites/ios" RNFBPerf: :path: "../node_modules/@react-native-firebase/perf/ios" + RNFBStorage: + :path: "../node_modules/@react-native-firebase/storage/ios" RNFBUtils: :path: "../node_modules/@react-native-firebase/utils/ios" yoga: @@ -357,12 +373,12 @@ SPEC CHECKSUMS: Crashlytics: 07fb167b1694128c1c9a5a5cc319b0e9c3ca0933 DoubleConversion: bb338842f62ab1d708ceb63ec3d999f0f3d98ecd Fabric: f988e33c97f08930a413e08123064d2e5f68d655 - Firebase: c60d49e9c2630875a96207d15e2affb8364996d1 + Firebase: 0c8cf33f266410c61ab3e2265cfa412200351d9c FirebaseABTesting: 1f50b8d50f5e3469eea54e7463a7b7fe221d1f5e - FirebaseAnalytics: fd72a26bf8dac84cefba2f0864366f718555a5b0 + FirebaseAnalytics: ece1aa57a4f43c64d53a648b5a5e05151aae947b FirebaseAnalyticsInterop: efbe45c8385ec626e29f9525e5ebd38520dfb6c1 FirebaseAuthInterop: 0ffa57668be100582bb7643d4fcb7615496c41fc - FirebaseCore: 22a79a961c3951ef2f77b67bfbc99e454247b319 + FirebaseCore: f1a9a8be1aee4bf71a2fc0f4096df6788bdfda61 FirebaseDynamicLinks: f7a8717e2c7ea652923882a2d60b0045d6fd99d5 FirebaseFunctions: 35b530c69ef8c322c414104280d36a06347a5d49 FirebaseInAppMessaging: 25e8c4408829928b6727fb461e0aef6a43111467 @@ -371,10 +387,11 @@ SPEC CHECKSUMS: FirebaseInvites: f13ed69fae140e705baec1a59ff127334b841a8a FirebasePerformance: 25ecee2a260bcf398d7f32d6f4804438df953100 FirebaseRemoteConfig: 7e11c65f0769c09bff6947997c209515058c5318 + FirebaseStorage: 6162ef4322502b818d9de0ec552f5226d283de43 Folly: de497beb10f102453a1afa9edbf8cf8a251890de glog: aefd1eb5dda2ab95ba0938556f34b98e2da3a60d GoogleAPIClientForREST: 5447a194eae517986cafe6421a5330b80b820591 - GoogleAppMeasurement: 1624046ab1bcc5e170061a56ef5679000b079c8e + GoogleAppMeasurement: ffe513e90551844a739e7bcbb1d2aca1c28a4338 GoogleSignIn: 7ff245e1a7b26d379099d3243a562f5747e23d39 GoogleToolboxForMac: ff31605b7d66400dcec09bed5861689aebadda4d GoogleUtilities: 273e67030e0de313e7304f6dcfa96fc5214f6c23 @@ -384,17 +401,18 @@ SPEC CHECKSUMS: nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48 Protobuf: 7a877b7f3e5964e3fce995e2eb323dbc6831bb5a React: 1d605e098d69bdf08960787f3446f0a9dc2e2ccf - RNFBAnalytics: 427c228f6de4078837b410700557bbff7ed1e622 - RNFBApp: 8f977f8800a1d06b06635252c4b11b5732554194 - RNFBConfig: c87c29a3d75a8a9d958545206caaba1225e5d9f9 - RNFBCrashlytics: 7ac6609db91633a9bbe64002789460965030e304 - RNFBFiam: 9cadb221d08fa29487a88534b33ab3d6944028a6 - RNFBFirestore: 92af951a2df1921da24acf2e1e37186c018d0687 - RNFBFunctions: d086740b977264112682aa3b9a6706f2af82ed05 - RNFBIid: f33b201871663a164e895a80bfd3960ad4a4c626 - RNFBInvites: 223640218297ed246b2a94df79fa883e848286f1 - RNFBPerf: 83e4ff822d1686818c622c8870b6283e938f5124 - RNFBUtils: 6bf201d3807462ce45e0f1e6b64bb6d0d1536493 + RNFBAnalytics: be645d8f36d6e10a896a12def49cc8c50928eb0e + RNFBApp: 984fdd6860f51673f457c2f6b46d6e358342f037 + RNFBConfig: 97f64346c7f2b7d6edddc1dd3dd40a863725b7d9 + RNFBCrashlytics: 7d35ecf98c4f8bb860ac743fb0d2c388f2e6b9d4 + RNFBFiam: 62de473923df3986f0dca93cddd856671fcdb5e5 + RNFBFirestore: ea6acc367a2908df7db8ca8f9f1f662d1a04b206 + RNFBFunctions: c5fcb577f64adb7b44a386d89798c125eacb103d + RNFBIid: 71ee72f27c7c9003fac4a9d7e8cebd27d91ebe7b + RNFBInvites: 283a94ed89ae0210a1ce08ad687b54427a910841 + RNFBPerf: 4b4bbb4c75f0ba8ae0a98c7a450dd5a957bc8846 + RNFBStorage: c6bf6f33461b37147fe363d9e37c3d659f8aa421 + RNFBUtils: 22defc76007a822b3367a2ed4aec6582842e9109 yoga: 128daf064cacaede0c3bb27424b6b4c71052e6cd PODFILE CHECKSUM: b8a7635ae6af2f71c8e50dd738a0a5a2bb05f65f diff --git a/tests/package.json b/tests/package.json index f1cc8849..5a977138 100755 --- a/tests/package.json +++ b/tests/package.json @@ -21,25 +21,26 @@ "@react-native-firebase/mlkit": "6.0.0-alpha.9", "@react-native-firebase/perf": "6.0.0-alpha.9", "@react-native-firebase/utils": "6.0.0-alpha.9", - "detox": "10.0.13", - "jet": "^0.3.0", - "mocha": "^5.2.0", - "prop-types": "^15.6.1", - "react": "16.8.3", - "react-dom": "16.8.3", - "react-native": "0.59.0", - "react-native-camera": "^1.10.1", - "require-all": "3.0.0", - "should": "^13.2.3", - "should-sinon": "0.0.6", - "sinon": "^6.2.0" + "@react-native-firebase/storage": "6.0.0-alpha.9", + "prop-types": "^15.7.2", + "react": "16.8.1", + "react-dom": "16.8.1", + "react-native": "0.59.5", + "react-native-camera": "^2.2.0" }, "devDependencies": { - "@react-native-firebase/private-tests-helpers": "^0.0.8", + "jet": "^0.3.0", + "mocha": "^6.0.2", + "detox": "12.5.0", + "sinon": "^7.3.1", + "should-sinon": "0.0.6", + "should": "^13.2.3", + "require-all": "3.0.0", + "@react-native-firebase/private-tests-helpers": "^0.0.9", "a2a": "^0.2.0", "babel-plugin-istanbul": "^5.1.1", - "nyc": "^13.1.0", - "patch-package": "^5.1.2" + "nyc": "^13.3.0", + "patch-package": "^6.1.0" }, "nyc": { "check-coverage": false, @@ -52,6 +53,7 @@ ], "exclude": [ "node_modules", + "packages/**/node_modules/**", "**/common/lib/**", "**/internal/registry/**", "**/lib/handlers.js" @@ -85,7 +87,7 @@ }, "ios.sim.release": { "binaryPath": "ios/build/Build/Products/Release-iphonesimulator/testing.app", - "build": "export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/testing.xcworkspace -scheme testing -configuration Release -sdk iphonesimulator -derivedDataPath ios/build -quiet", + "build": "export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/testing.xcworkspace -scheme testing -configuration Release -sdk iphonesimulator -derivedDataPath ios/build -UseModernBuildSystem=YES -quiet | xcpretty -k", "type": "ios.simulator", "name": "iPhone X" }, diff --git a/tests/patches/.gitkeep b/tests/patches/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/tests/patches/detox+10.0.13.patch b/tests/patches/detox+10.0.13.patch deleted file mode 100644 index 05e5ca83..00000000 --- a/tests/patches/detox+10.0.13.patch +++ /dev/null @@ -1,32 +0,0 @@ -patch-package ---- a/node_modules/detox/android/detox/build.gradle -+++ b/node_modules/detox/android/detox/build.gradle -@@ -22,10 +22,6 @@ - - productFlavors { - flavorDimensions "minReactNative" -- minReactNative44 { -- dimension "minReactNative" -- -- } - minReactNative46 { - dimension "minReactNative" - } -@@ -69,8 +65,6 @@ - dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$_kotlinVersion" - -- minReactNative44Implementation 'com.squareup.okhttp3:okhttp:3.4.1' -- minReactNative44Implementation 'com.squareup.okhttp3:okhttp-ws:3.4.1' - - minReactNative46Implementation 'com.squareup.okhttp3:okhttp:3.6.0' - minReactNative46Implementation 'com.squareup.okio:okio:1.13.0' -@@ -82,7 +76,7 @@ - implementation 'com.android.support.test:rules:1.0.2' - - // noinspection GradleDynamicVersion -- compileOnly "com.facebook.react:react-native:+" -+ api "com.facebook.react:react-native:+" - - implementation 'org.apache.commons:commons-lang3:3.4' - implementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3' diff --git a/tests/type-test.ts b/tests/type-test.ts index 29af8921..95967627 100644 --- a/tests/type-test.ts +++ b/tests/type-test.ts @@ -1,17 +1,38 @@ -import '@react-native-firebase/config'; +import '@react-native-firebase/storage'; +import '@react-native-firebase/perf'; import '@react-native-firebase/functions'; -import '@react-native-firebase/invites'; + import { firebase } from '@react-native-firebase/analytics'; const foo = async () => { - await firebase.config().activateFetched(); - await firebase.config().fetch(0); - await firebase.config().fetch(); - const settings = await firebase.config().getConfigSettings(); - console.log(settings.isDeveloperModeEnabled); - console.log(settings.lastFetchStatus); - console.log(settings.lastFetchTime); - await firebase.config().setConfigSettings({ isDeveloperModeEnabled: false }); + const task = firebase + .app() + .storage('gs://foo') + .ref('foo') + .putFile(''); + + task.finally + + task.on(firebase.storage.TaskEvent.STATE_CHANGED, taskSnapshot => { + if (taskSnapshot.state === firebase.storage.TaskState.) { + console.log('cancelling task!'); + taskSnapshot.task.cancel(); + } + }); + + task.catch(e => { + return 'bar'; + }); + + task.then(snapshot => { + snapshot.metadata.bucket; + return 'foo'; + }); + + firebase.storage.TaskState.CANCELLED; + firebase.storage.TaskEvent.STATE_CHANGED; + firebase.perf().newHttpMetric('', 'GET'); + // firebase.functions.HttpsErrorCode.ABORTED; }; foo(); diff --git a/yarn.lock b/yarn.lock index 8fe5003f..ea342d5e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -26,7 +26,7 @@ dependencies: "@babel/highlight" "^7.0.0" -"@babel/core@^7.0.0", "@babel/core@^7.2.2": +"@babel/core@^7.0.0": version "7.2.2" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.2.2.tgz#07adba6dde27bb5ad8d8672f15fde3e08184a687" integrity sha512-59vB0RWt09cAct5EIe58+NzGP4TFSD3Bz//2/ELy3ZeTeKF6VTD1AXlH8BGGbCX0PuobZBsIzO7IAI9PH67eKw== @@ -46,6 +46,26 @@ semver "^5.4.1" source-map "^0.5.0" +"@babel/core@^7.4.0": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.4.0.tgz#248fd6874b7d755010bfe61f557461d4f446d9e9" + integrity sha512-Dzl7U0/T69DFOTwqz/FJdnOSWS57NpjNfCwMKHABr589Lg8uX1RrlBIJ7L5Dubt/xkLsx0xH5EBFzlBVes1ayA== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.4.0" + "@babel/helpers" "^7.4.0" + "@babel/parser" "^7.4.0" + "@babel/template" "^7.4.0" + "@babel/traverse" "^7.4.0" + "@babel/types" "^7.4.0" + convert-source-map "^1.1.0" + debug "^4.1.0" + json5 "^2.1.0" + lodash "^4.17.11" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + "@babel/generator@^7.0.0", "@babel/generator@^7.2.2": version "7.3.0" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.3.0.tgz#f663838cd7b542366de3aa608a657b8ccb2a99eb" @@ -57,6 +77,17 @@ source-map "^0.5.0" trim-right "^1.0.1" +"@babel/generator@^7.4.0": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.4.0.tgz#c230e79589ae7a729fd4631b9ded4dc220418196" + integrity sha512-/v5I+a1jhGSKLgZDcmAUZ4K/VePi43eRkUs3yePW1HB1iANOD5tqJXwGSG4BZhSksP8J9ejSlwGeTiiOFZOrXQ== + dependencies: + "@babel/types" "^7.4.0" + jsesc "^2.5.1" + lodash "^4.17.11" + source-map "^0.5.0" + trim-right "^1.0.1" + "@babel/helper-annotate-as-pure@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32" @@ -221,6 +252,13 @@ dependencies: "@babel/types" "^7.0.0" +"@babel/helper-split-export-declaration@^7.4.0": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.0.tgz#571bfd52701f492920d63b7f735030e9a3e10b55" + integrity sha512-7Cuc6JZiYShaZnybDmfwhY4UYHzI6rlqhWjaIqbsJGsIqPimEYy5uh3akSRLMg65LSdSEnJ8a8/bWQN6u2oMGw== + dependencies: + "@babel/types" "^7.4.0" + "@babel/helper-wrap-function@^7.1.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz#c4e0012445769e2815b55296ead43a958549f6fa" @@ -240,6 +278,15 @@ "@babel/traverse" "^7.1.5" "@babel/types" "^7.3.0" +"@babel/helpers@^7.4.0": + version "7.4.2" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.4.2.tgz#3bdfa46a552ca77ef5a0f8551be5f0845ae989be" + integrity sha512-gQR1eQeroDzFBikhrCccm5Gs2xBjZ57DNjGbqTaHo911IpmSxflOQWMAHPw/TXk8L3isv7s9lYzUkexOeTQUYg== + dependencies: + "@babel/template" "^7.4.0" + "@babel/traverse" "^7.4.0" + "@babel/types" "^7.4.0" + "@babel/highlight@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" @@ -254,6 +301,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.3.1.tgz#8f4ffd45f779e6132780835ffa7a215fa0b2d181" integrity sha512-ATz6yX/L8LEnC3dtLQnIx4ydcPxhLcoy9Vl6re00zb2w5lG6itY6Vhnr1KFRPq/FHNsgl/gh2mjNN20f9iJTTA== +"@babel/parser@^7.4.0": + version "7.4.2" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.4.2.tgz#b4521a400cb5a871eab3890787b4bc1326d38d91" + integrity sha512-9fJTDipQFvlfSVdD/JBtkiY0br9BtfvW2R8wo6CX/Ej2eMuV0gWPk1M67Mt3eggQvBqYW1FCEk8BN7WvGm/g5g== + "@babel/plugin-external-helpers@^7.0.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-external-helpers/-/plugin-external-helpers-7.2.0.tgz#7f4cb7dee651cd380d2034847d914288467a6be4" @@ -569,7 +621,7 @@ dependencies: regenerator-transform "^0.13.3" -"@babel/plugin-transform-runtime@^7.0.0", "@babel/plugin-transform-runtime@^7.2.0": +"@babel/plugin-transform-runtime@^7.0.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.2.0.tgz#566bc43f7d0aedc880eaddbd29168d0f248966ea" integrity sha512-jIgkljDdq4RYDnJyQsiWbdvGeei/0MOTtSHKO/rfbd/mXBxNpdlulMx49L0HQ4pug1fXannxoqCI+fYSle9eSw== @@ -579,6 +631,16 @@ resolve "^1.8.1" semver "^5.5.1" +"@babel/plugin-transform-runtime@^7.4.0": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.4.0.tgz#b4d8c925ed957471bc57e0b9da53408ebb1ed457" + integrity sha512-1uv2h9wnRj98XX3g0l4q+O3jFM6HfayKup7aIu4pnnlzGz0H+cYckGBC74FZIWJXJSXAmeJ9Yu5Gg2RQpS4hWg== + dependencies: + "@babel/helper-module-imports" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + resolve "^1.8.1" + semver "^5.5.1" + "@babel/plugin-transform-shorthand-properties@^7.0.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz#6333aee2f8d6ee7e28615457298934a3b46198f0" @@ -639,13 +701,27 @@ pirates "^4.0.0" source-map-support "^0.5.9" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.2.0": +"@babel/runtime@7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.0.0.tgz#adeb78fedfc855aa05bc041640f3f6f98e85424c" + integrity sha512-7hGhzlcmg01CvH1EHdSPVXYX1aJ8KCEyz6I9xYIi/asDtzBPMyMhVibhM/K6g/5qnKBwjZtp10bNZIEFTRW1MA== + dependencies: + regenerator-runtime "^0.12.0" + +"@babel/runtime@^7.0.0": version "7.3.1" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.3.1.tgz#574b03e8e8a9898eaf4a872a92ea20b7846f6f2a" integrity sha512-7jGW8ppV0ant637pIqAcFfQDDH1orEPGJb8aXfUozuCU3QqX7rX4DA8iwrbPrR1hcH0FTTHz47yQnk+bl5xHQA== dependencies: regenerator-runtime "^0.12.0" +"@babel/runtime@^7.4.2": + version "7.4.2" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.2.tgz#f5ab6897320f16decd855eed70b705908a313fe8" + integrity sha512-7Bl2rALb7HpvXFL7TETNzKSAeBVCPHELzc0C//9FCxN8nsiueWSJBqaF+2oIJScyILStASR/Cx5WMkXGYTiJFA== + dependencies: + regenerator-runtime "^0.13.2" + "@babel/template@^7.0.0", "@babel/template@^7.1.0", "@babel/template@^7.1.2", "@babel/template@^7.2.2": version "7.2.2" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.2.2.tgz#005b3fdf0ed96e88041330379e0da9a708eb2907" @@ -655,6 +731,15 @@ "@babel/parser" "^7.2.2" "@babel/types" "^7.2.2" +"@babel/template@^7.4.0": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.0.tgz#12474e9c077bae585c5d835a95c0b0b790c25c8b" + integrity sha512-SOWwxxClTTh5NdbbYZ0BmaBVzxzTh2tO/TeLTbF6MO6EzVhHTnff8CdBXx3mEtazFBoysmEM6GU/wF+SuSx4Fw== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.4.0" + "@babel/types" "^7.4.0" + "@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.1.5", "@babel/traverse@^7.2.2", "@babel/traverse@^7.2.3": version "7.2.3" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.2.3.tgz#7ff50cefa9c7c0bd2d81231fdac122f3957748d8" @@ -670,6 +755,21 @@ globals "^11.1.0" lodash "^4.17.10" +"@babel/traverse@^7.4.0": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.4.0.tgz#14006967dd1d2b3494cdd650c686db9daf0ddada" + integrity sha512-/DtIHKfyg2bBKnIN+BItaIlEg5pjAnzHOIQe5w+rHAw/rg9g0V7T4rqPX8BJPfW11kt3koyjAnTNwCzb28Y1PA== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.4.0" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.4.0" + "@babel/parser" "^7.4.0" + "@babel/types" "^7.4.0" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.11" + "@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.2.2", "@babel/types@^7.3.0": version "7.3.0" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.3.0.tgz#61dc0b336a93badc02bf5f69c4cd8e1353f2ffc0" @@ -679,6 +779,15 @@ lodash "^4.17.10" to-fast-properties "^2.0.0" +"@babel/types@^7.4.0": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.4.0.tgz#670724f77d24cce6cc7d8cf64599d511d164894c" + integrity sha512-aPvkXyU2SPOnztlgo8n9cEiXW755mgyvueUPcpStqdzoSPm0fjO0vQBjLkt3JKJW7ufikfcnMTTPsN1xaTsBPA== + dependencies: + esutils "^2.0.2" + lodash "^4.17.11" + to-fast-properties "^2.0.0" + "@fimbul/bifrost@^0.17.0": version "0.17.0" resolved "https://registry.yarnpkg.com/@fimbul/bifrost/-/bifrost-0.17.0.tgz#f0383ba7e40992e3193dc87e2ddfde2ad62a9cf4" @@ -698,20 +807,6 @@ reflect-metadata "^0.1.12" tslib "^1.8.1" -"@iamstarkov/listr-update-renderer@0.4.1": - version "0.4.1" - resolved "https://registry.yarnpkg.com/@iamstarkov/listr-update-renderer/-/listr-update-renderer-0.4.1.tgz#d7c48092a2dcf90fd672b6c8b458649cb350c77e" - integrity sha512-IJyxQWsYDEkf8C8QthBn5N8tIUR9V9je6j3sMIpAkonaadjbvxmRC6RAhpa3RKxndhNnU2M6iNbtJwd7usQYIA== - dependencies: - chalk "^1.1.3" - cli-truncate "^0.2.1" - elegant-spinner "^1.0.1" - figures "^1.7.0" - indent-string "^3.0.0" - log-symbols "^1.0.2" - log-update "^2.3.0" - strip-ansi "^3.0.1" - "@invertase/babel-preset-react-native-syntax@^0.1.3": version "0.1.3" resolved "https://registry.yarnpkg.com/@invertase/babel-preset-react-native-syntax/-/babel-preset-react-native-syntax-0.1.3.tgz#23e6f2d5feef0decaf9ff76c8c83f9a06d79441b" @@ -729,52 +824,54 @@ "@babel/plugin-transform-flow-comments" "^7.0.0" "@babel/plugin-transform-flow-strip-types" "^7.0.0" -"@lerna/add@3.10.6": - version "3.10.6" - resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.10.6.tgz#6f2c6b26eb905c40fef4180f3ffa34ad9dbb860b" - integrity sha512-FxQ5Bmyb5fF+3BQiNffM6cTeGCrl4uaAuGvxFIWF6Pgz6U14tUc1e16xgKDvVb1CurzJgIV5sLOT5xmCOqv1kA== +"@lerna/add@3.13.1": + version "3.13.1" + resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.13.1.tgz#2cd7838857edb3b43ed73e3c21f69a20beb9b702" + integrity sha512-cXk42YbuhzEnADCK8Qte5laC9Qo03eJLVnr0qKY85jQUM/T4URe3IIUemqpg0CpVATrB+Vz+iNdeqw9ng1iALw== dependencies: - "@lerna/bootstrap" "3.10.6" - "@lerna/command" "3.10.6" - "@lerna/filter-options" "3.10.6" - "@lerna/npm-conf" "3.7.0" - "@lerna/validation-error" "3.6.0" + "@lerna/bootstrap" "3.13.1" + "@lerna/command" "3.13.1" + "@lerna/filter-options" "3.13.0" + "@lerna/npm-conf" "3.13.0" + "@lerna/validation-error" "3.13.0" dedent "^0.7.0" - libnpm "^2.0.1" + npm-package-arg "^6.1.0" p-map "^1.2.0" + pacote "^9.5.0" semver "^5.5.0" -"@lerna/batch-packages@3.10.6": - version "3.10.6" - resolved "https://registry.yarnpkg.com/@lerna/batch-packages/-/batch-packages-3.10.6.tgz#2d6dfc9be13ea4da49244dd84bfcd46c3d62f4d0" - integrity sha512-sInr3ZQJFMh9Zq+ZUoVjX8R67j9ViRkVy0uEMsOfG+jZlXj1lRPRMPRiRgU0jXSYEwCdwuAB5pTd9tTx0VCJUw== +"@lerna/batch-packages@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/batch-packages/-/batch-packages-3.13.0.tgz#697fde5be28822af9d9dca2f750250b90a89a000" + integrity sha512-TgLBTZ7ZlqilGnzJ3xh1KdAHcySfHytgNRTdG9YomfriTU6kVfp1HrXxKJYVGs7ClPUNt2CTFEOkw0tMBronjw== dependencies: - "@lerna/package-graph" "3.10.6" - "@lerna/validation-error" "3.6.0" - libnpm "^2.0.1" + "@lerna/package-graph" "3.13.0" + "@lerna/validation-error" "3.13.0" + npmlog "^4.1.2" -"@lerna/bootstrap@3.10.6": - version "3.10.6" - resolved "https://registry.yarnpkg.com/@lerna/bootstrap/-/bootstrap-3.10.6.tgz#d250baa9cfe9026c4f78e6cf7c9761a90b24e363" - integrity sha512-qbGjAxRpV/eiI9CboUIpsPPGpSogs8mN2/iDaAUBTaWVFVz/YyU64nui84Gll0kbdaHOyPput+kk2S8NCSCCdg== +"@lerna/bootstrap@3.13.1": + version "3.13.1" + resolved "https://registry.yarnpkg.com/@lerna/bootstrap/-/bootstrap-3.13.1.tgz#f2edd7c8093c8b139e78b0ca5f845f23efd01f08" + integrity sha512-mKdi5Ds5f82PZwEFyB9/W60I3iELobi1i87sTeVrbJh/um7GvqpSPy7kG/JPxyOdMpB2njX6LiJgw+7b6BEPWw== dependencies: - "@lerna/batch-packages" "3.10.6" - "@lerna/command" "3.10.6" - "@lerna/filter-options" "3.10.6" - "@lerna/has-npm-version" "3.10.0" - "@lerna/npm-install" "3.10.0" - "@lerna/package-graph" "3.10.6" - "@lerna/pulse-till-done" "3.7.1" - "@lerna/rimraf-dir" "3.10.0" - "@lerna/run-lifecycle" "3.10.5" - "@lerna/run-parallel-batches" "3.0.0" - "@lerna/symlink-binary" "3.10.0" - "@lerna/symlink-dependencies" "3.10.0" - "@lerna/validation-error" "3.6.0" + "@lerna/batch-packages" "3.13.0" + "@lerna/command" "3.13.1" + "@lerna/filter-options" "3.13.0" + "@lerna/has-npm-version" "3.13.0" + "@lerna/npm-install" "3.13.0" + "@lerna/package-graph" "3.13.0" + "@lerna/pulse-till-done" "3.13.0" + "@lerna/rimraf-dir" "3.13.0" + "@lerna/run-lifecycle" "3.13.0" + "@lerna/run-parallel-batches" "3.13.0" + "@lerna/symlink-binary" "3.13.0" + "@lerna/symlink-dependencies" "3.13.0" + "@lerna/validation-error" "3.13.0" dedent "^0.7.0" get-port "^3.2.0" - libnpm "^2.0.1" multimatch "^2.1.0" + npm-package-arg "^6.1.0" + npmlog "^4.1.2" p-finally "^1.0.0" p-map "^1.2.0" p-map-series "^1.0.0" @@ -782,124 +879,127 @@ read-package-tree "^5.1.6" semver "^5.5.0" -"@lerna/changed@3.10.6": - version "3.10.6" - resolved "https://registry.yarnpkg.com/@lerna/changed/-/changed-3.10.6.tgz#48fed2e6c890b39a71f1dac29e42a6f853956d71" - integrity sha512-nZDVq/sKdhgoAg1BVnpqjqUUz5+zedG+AnU+6mjEN2f23YVtRCsW55N4I9eEdW2pxXUaCY85Hj/HPSA74BYaFg== +"@lerna/changed@3.13.1": + version "3.13.1" + resolved "https://registry.yarnpkg.com/@lerna/changed/-/changed-3.13.1.tgz#dc92476aad43c932fe741969bbd0bcf6146a4c52" + integrity sha512-BRXitEJGOkoudbxEewW7WhjkLxFD+tTk4PrYpHLyCBk63pNTWtQLRE6dc1hqwh4emwyGncoyW6RgXfLgMZgryw== dependencies: - "@lerna/collect-updates" "3.10.1" - "@lerna/command" "3.10.6" - "@lerna/listable" "3.10.6" - "@lerna/output" "3.6.0" - "@lerna/version" "3.10.6" + "@lerna/collect-updates" "3.13.0" + "@lerna/command" "3.13.1" + "@lerna/listable" "3.13.0" + "@lerna/output" "3.13.0" + "@lerna/version" "3.13.1" -"@lerna/check-working-tree@3.10.0": - version "3.10.0" - resolved "https://registry.yarnpkg.com/@lerna/check-working-tree/-/check-working-tree-3.10.0.tgz#5ed9f2c5c942bee92afcd8cb5361be44ed0251e3" - integrity sha512-NdIPhDgEtGHfeGjB9F0oAoPLywgMpjnJhLLwTNQkelDHo2xNAVpG8kV+A2UJ+cU5UXCZA4RZFxKNmw86rO+Drw== +"@lerna/check-working-tree@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/check-working-tree/-/check-working-tree-3.13.0.tgz#1ddcd4d9b1aceb65efaaa4cd1333a66706d67c9c" + integrity sha512-dsdO15NXX5To+Q53SYeCrBEpiqv4m5VkaPZxbGQZNwoRen1MloXuqxSymJANQn+ZLEqarv5V56gydebeROPH5A== dependencies: - "@lerna/describe-ref" "3.10.0" - "@lerna/validation-error" "3.6.0" + "@lerna/describe-ref" "3.13.0" + "@lerna/validation-error" "3.13.0" -"@lerna/child-process@3.3.0": - version "3.3.0" - resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-3.3.0.tgz#71184a763105b6c8ece27f43f166498d90fe680f" - integrity sha512-q2d/OPlNX/cBXB6Iz1932RFzOmOHq6ZzPjqebkINNaTojHWuuRpvJJY4Uz3NGpJ3kEtPDvBemkZqUBTSO5wb1g== +"@lerna/child-process@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-3.13.0.tgz#84e35adf3217a6983edd28080657b9596a052674" + integrity sha512-0iDS8y2jiEucD4fJHEzKoc8aQJgm7s+hG+0RmDNtfT0MM3n17pZnf5JOMtS1FJp+SEXOjMKQndyyaDIPFsnp6A== dependencies: chalk "^2.3.1" execa "^1.0.0" strong-log-transformer "^2.0.0" -"@lerna/clean@3.10.6": - version "3.10.6" - resolved "https://registry.yarnpkg.com/@lerna/clean/-/clean-3.10.6.tgz#31e4a12a722e57ca7adc0c9bc30ba70d55572bb8" - integrity sha512-MuL8HOwnyvVtr6GOiAN/Ofjbx+BJdCrtjrM1Uuh8FFnbnZTPVf+0MPxL2jVzPMo0PmoIrX3fvlwvzKNk/lH0Ug== +"@lerna/clean@3.13.1": + version "3.13.1" + resolved "https://registry.yarnpkg.com/@lerna/clean/-/clean-3.13.1.tgz#9a7432efceccd720a51da5c76f849fc59c5a14ce" + integrity sha512-myGIaXv7RUO2qCFZXvx8SJeI+eN6y9SUD5zZ4/LvNogbOiEIlujC5lUAqK65rAHayQ9ltSa/yK6Xv510xhZXZQ== dependencies: - "@lerna/command" "3.10.6" - "@lerna/filter-options" "3.10.6" - "@lerna/prompt" "3.6.0" - "@lerna/pulse-till-done" "3.7.1" - "@lerna/rimraf-dir" "3.10.0" + "@lerna/command" "3.13.1" + "@lerna/filter-options" "3.13.0" + "@lerna/prompt" "3.13.0" + "@lerna/pulse-till-done" "3.13.0" + "@lerna/rimraf-dir" "3.13.0" p-map "^1.2.0" p-map-series "^1.0.0" p-waterfall "^1.0.0" -"@lerna/cli@3.10.7": - version "3.10.7" - resolved "https://registry.yarnpkg.com/@lerna/cli/-/cli-3.10.7.tgz#2f88ae4a3c53fa4d3a4f61b5f447bbbcc69546e2" - integrity sha512-yuoz/24mIfYit3neKqoE5NVs42Rj9A6A6SlkNPDfsy3v/Vh7SgYkU3cwiGyvwBGzIdhqL4/SWYo8H7YJLs0C+g== +"@lerna/cli@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/cli/-/cli-3.13.0.tgz#3d7b357fdd7818423e9681a7b7f2abd106c8a266" + integrity sha512-HgFGlyCZbYaYrjOr3w/EsY18PdvtsTmDfpUQe8HwDjXlPeCCUgliZjXLOVBxSjiOvPeOSwvopwIHKWQmYbwywg== dependencies: - "@lerna/global-options" "3.10.6" + "@lerna/global-options" "3.13.0" dedent "^0.7.0" - libnpm "^2.0.1" + npmlog "^4.1.2" yargs "^12.0.1" -"@lerna/collect-updates@3.10.1": - version "3.10.1" - resolved "https://registry.yarnpkg.com/@lerna/collect-updates/-/collect-updates-3.10.1.tgz#3ad60aa31826c0c0cfdf8bf41e58e6c5c86aeb3a" - integrity sha512-vb0wEJ8k63G+2CR/ud1WeVHNJ21Fs6Ew6lbdGZXnF4ZvaFWxWJZpoHeWwzjhMdJ75QdTzUaIhTG1hnH9faQNMw== +"@lerna/collect-updates@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/collect-updates/-/collect-updates-3.13.0.tgz#f0828d84ff959ff153d006765659ffc4d68cdefc" + integrity sha512-uR3u6uTzrS1p46tHQ/mlHog/nRJGBqskTHYYJbgirujxm6FqNh7Do+I1Q/7zSee407G4lzsNxZdm8IL927HemQ== dependencies: - "@lerna/child-process" "3.3.0" - "@lerna/describe-ref" "3.10.0" - libnpm "^2.0.1" + "@lerna/child-process" "3.13.0" + "@lerna/describe-ref" "3.13.0" minimatch "^3.0.4" + npmlog "^4.1.2" slash "^1.0.0" -"@lerna/command@3.10.6": - version "3.10.6" - resolved "https://registry.yarnpkg.com/@lerna/command/-/command-3.10.6.tgz#709bd1c66220da67f65dbe1fc88bb7ba5bb85446" - integrity sha512-jPZswMZXOpAaIuSF5hrz+eaWQzbDrvwbrkCoRJKfiAHx7URAkE6MQe9DeAnqrTKMqwfg0RciSrZLc8kWYfrzCQ== +"@lerna/command@3.13.1": + version "3.13.1" + resolved "https://registry.yarnpkg.com/@lerna/command/-/command-3.13.1.tgz#b60dda2c0d9ffbb6030d61ddf7cceedc1e8f7e6e" + integrity sha512-SYWezxX+iheWvzRoHCrbs8v5zHPaxAx3kWvZhqi70vuGsdOVAWmaG4IvHLn11ztS+Vpd5PM+ztBWSbnykpLFKQ== dependencies: - "@lerna/child-process" "3.3.0" - "@lerna/package-graph" "3.10.6" - "@lerna/project" "3.10.0" - "@lerna/validation-error" "3.6.0" - "@lerna/write-log-file" "3.6.0" + "@lerna/child-process" "3.13.0" + "@lerna/package-graph" "3.13.0" + "@lerna/project" "3.13.1" + "@lerna/validation-error" "3.13.0" + "@lerna/write-log-file" "3.13.0" dedent "^0.7.0" execa "^1.0.0" is-ci "^1.0.10" - libnpm "^2.0.1" lodash "^4.17.5" + npmlog "^4.1.2" -"@lerna/conventional-commits@3.10.0": - version "3.10.0" - resolved "https://registry.yarnpkg.com/@lerna/conventional-commits/-/conventional-commits-3.10.0.tgz#284cc16bd3c387f841ff6bec42bcadaa2d13d8e4" - integrity sha512-8FvO0eR8g/tEgkb6eRVYaD39TsqMKsOXp17EV48jciciEqcrF/d1Ypu6ilK1GDp6R/1m2mbjt/b52a/qrO+xaw== +"@lerna/conventional-commits@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/conventional-commits/-/conventional-commits-3.13.0.tgz#877aa225ca34cca61c31ea02a5a6296af74e1144" + integrity sha512-BeAgcNXuocmLhPxnmKU2Vy8YkPd/Uo+vu2i/p3JGsUldzrPC8iF3IDxH7fuXpEFN2Nfogu7KHachd4tchtOppA== dependencies: - "@lerna/validation-error" "3.6.0" - conventional-changelog-angular "^5.0.2" - conventional-changelog-core "^3.1.5" + "@lerna/validation-error" "3.13.0" + conventional-changelog-angular "^5.0.3" + conventional-changelog-core "^3.1.6" conventional-recommended-bump "^4.0.4" fs-extra "^7.0.0" get-stream "^4.0.0" - libnpm "^2.0.1" + npm-package-arg "^6.1.0" + npmlog "^4.1.2" + pify "^3.0.0" semver "^5.5.0" -"@lerna/create-symlink@3.6.0": - version "3.6.0" - resolved "https://registry.yarnpkg.com/@lerna/create-symlink/-/create-symlink-3.6.0.tgz#f1815cde2fc9d8d2315dfea44ee880f2f1bc65f1" - integrity sha512-YG3lTb6zylvmGqKU+QYA3ylSnoLn+FyLH5XZmUsD0i85R884+EyJJeHx/zUk+yrL2ZwHS4RBUgJfC24fqzgPoA== +"@lerna/create-symlink@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/create-symlink/-/create-symlink-3.13.0.tgz#e01133082fe040779712c960683cb3a272b67809" + integrity sha512-PTvg3jAAJSAtLFoZDsuTMv1wTOC3XYIdtg54k7uxIHsP8Ztpt+vlilY/Cni0THAqEMHvfiToel76Xdta4TU21Q== dependencies: cmd-shim "^2.0.2" fs-extra "^7.0.0" - libnpm "^2.0.1" + npmlog "^4.1.2" -"@lerna/create@3.10.6": - version "3.10.6" - resolved "https://registry.yarnpkg.com/@lerna/create/-/create-3.10.6.tgz#85c7398cad912516c0ac6054a5c0c4145ab6cadb" - integrity sha512-OddQtGBHM2/eJONggLWoTE6275XGbnJ6dIVF+fLsKS93o4GC6g+qcc6Y7lUWHm5bfpeOwNOVKwj0tvqBZ6MgoA== +"@lerna/create@3.13.1": + version "3.13.1" + resolved "https://registry.yarnpkg.com/@lerna/create/-/create-3.13.1.tgz#2c1284cfdc59f0d2b88286d78bc797f4ab330f79" + integrity sha512-pLENMXgTkQuvKxAopjKeoLOv9fVUCnpTUD7aLrY5d95/1xqSZlnsOcQfUYcpMf3GpOvHc8ILmI5OXkPqjAf54g== dependencies: - "@lerna/child-process" "3.3.0" - "@lerna/command" "3.10.6" - "@lerna/npm-conf" "3.7.0" - "@lerna/validation-error" "3.6.0" - camelcase "^4.1.0" + "@lerna/child-process" "3.13.0" + "@lerna/command" "3.13.1" + "@lerna/npm-conf" "3.13.0" + "@lerna/validation-error" "3.13.0" + camelcase "^5.0.0" dedent "^0.7.0" fs-extra "^7.0.0" globby "^8.0.1" init-package-json "^1.10.3" - libnpm "^2.0.1" + npm-package-arg "^6.1.0" p-reduce "^1.0.0" + pacote "^9.5.0" pify "^3.0.0" semver "^5.5.0" slash "^1.0.0" @@ -907,404 +1007,427 @@ validate-npm-package-name "^3.0.0" whatwg-url "^7.0.0" -"@lerna/describe-ref@3.10.0": - version "3.10.0" - resolved "https://registry.yarnpkg.com/@lerna/describe-ref/-/describe-ref-3.10.0.tgz#266380feece6013ab9674f52bd35bf0be5b0460d" - integrity sha512-fouh3FQS07QxJJp/mW8LkGnH0xMRAzpBlejtZaiRwfDkW2kd6EuHaj8I/2/p21Wsprcvuu4dqmyia2YS1xFb/w== +"@lerna/describe-ref@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/describe-ref/-/describe-ref-3.13.0.tgz#fb4c3863fd6bcccad67ce7b183887a5fc1942bb6" + integrity sha512-UJefF5mLxLae9I2Sbz5RLYGbqbikRuMqdgTam0MS5OhXnyuuKYBUpwBshCURNb1dPBXTQhSwc7+oUhORx8ojCg== dependencies: - "@lerna/child-process" "3.3.0" - libnpm "^2.0.1" + "@lerna/child-process" "3.13.0" + npmlog "^4.1.2" -"@lerna/diff@3.10.6": - version "3.10.6" - resolved "https://registry.yarnpkg.com/@lerna/diff/-/diff-3.10.6.tgz#b4c5a50d8c7e79619376e2c913ec1c627dfd0cdf" - integrity sha512-0MqFhosjrqsIdXiKIu7t3CiJELqiU9mkjFBhYPB7JruAzpPwjMXJnC6/Ur5/7LXJYYVpqGQwZI9ZaZlOYJhhrw== +"@lerna/diff@3.13.1": + version "3.13.1" + resolved "https://registry.yarnpkg.com/@lerna/diff/-/diff-3.13.1.tgz#5c734321b0f6c46a3c87f55c99afef3b01d46520" + integrity sha512-cKqmpONO57mdvxtp8e+l5+tjtmF04+7E+O0QEcLcNUAjC6UR2OSM77nwRCXDukou/1h72JtWs0jjcdYLwAmApg== dependencies: - "@lerna/child-process" "3.3.0" - "@lerna/command" "3.10.6" - "@lerna/validation-error" "3.6.0" - libnpm "^2.0.1" + "@lerna/child-process" "3.13.0" + "@lerna/command" "3.13.1" + "@lerna/validation-error" "3.13.0" + npmlog "^4.1.2" -"@lerna/exec@3.10.6": - version "3.10.6" - resolved "https://registry.yarnpkg.com/@lerna/exec/-/exec-3.10.6.tgz#5564b614b7e39c1f034f5e0736c9e020945f2f12" - integrity sha512-cdHqaRBMYceJu8rZLO8b4ZeR27O+xKPHgzi13OOOfBJQjrTuacjMWyHgmpy8jWc/0f7QnTl4VsHks7VJ3UK+vw== +"@lerna/exec@3.13.1": + version "3.13.1" + resolved "https://registry.yarnpkg.com/@lerna/exec/-/exec-3.13.1.tgz#4439e90fb0877ec38a6ef933c86580d43eeaf81b" + integrity sha512-I34wEP9lrAqqM7tTXLDxv/6454WFzrnXDWpNDbiKQiZs6SIrOOjmm6I4FiQsx+rU3o9d+HkC6tcUJRN5mlJUgA== dependencies: - "@lerna/batch-packages" "3.10.6" - "@lerna/child-process" "3.3.0" - "@lerna/command" "3.10.6" - "@lerna/filter-options" "3.10.6" - "@lerna/run-parallel-batches" "3.0.0" - "@lerna/validation-error" "3.6.0" + "@lerna/batch-packages" "3.13.0" + "@lerna/child-process" "3.13.0" + "@lerna/command" "3.13.1" + "@lerna/filter-options" "3.13.0" + "@lerna/run-parallel-batches" "3.13.0" + "@lerna/validation-error" "3.13.0" -"@lerna/filter-options@3.10.6": - version "3.10.6" - resolved "https://registry.yarnpkg.com/@lerna/filter-options/-/filter-options-3.10.6.tgz#e05a8b8de6efc16c47c83f0ac58291008efba4b8" - integrity sha512-r/dQbqN+RGFKZNn+DyWehswFmAkny/fkdMB2sRM2YVe7zRTtSl95YxD9DtdYnpJTG/jbOVICS/L5QJakrI6SSw== +"@lerna/filter-options@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/filter-options/-/filter-options-3.13.0.tgz#976e3d8b9fcd47001ab981d276565c1e9f767868" + integrity sha512-SRp7DCo9zrf+7NkQxZMkeyO1GRN6GICoB9UcBAbXhLbWisT37Cx5/6+jh49gYB63d/0/WYHSEPMlheUrpv1Srw== dependencies: - "@lerna/collect-updates" "3.10.1" - "@lerna/filter-packages" "3.10.0" + "@lerna/collect-updates" "3.13.0" + "@lerna/filter-packages" "3.13.0" dedent "^0.7.0" -"@lerna/filter-packages@3.10.0": - version "3.10.0" - resolved "https://registry.yarnpkg.com/@lerna/filter-packages/-/filter-packages-3.10.0.tgz#75f9a08184fc4046da2057e0218253cd6f493f05" - integrity sha512-3Acdj+jbany6LnQSuImU4ttcK5ULHSVug8Gh/EvwTewKCDpHAuoI3eyuzZOnSBdMvDOjE03uIESQK0dNNsn6Ow== +"@lerna/filter-packages@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/filter-packages/-/filter-packages-3.13.0.tgz#f5371249e7e1a15928e5e88c544a242e0162c21c" + integrity sha512-RWiZWyGy3Mp7GRVBn//CacSnE3Kw82PxE4+H6bQ3pDUw/9atXn7NRX+gkBVQIYeKamh7HyumJtyOKq3Pp9BADQ== dependencies: - "@lerna/validation-error" "3.6.0" - libnpm "^2.0.1" + "@lerna/validation-error" "3.13.0" multimatch "^2.1.0" + npmlog "^4.1.2" -"@lerna/get-npm-exec-opts@3.6.0": - version "3.6.0" - resolved "https://registry.yarnpkg.com/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-3.6.0.tgz#ea595eb28d1f34ba61a92ee8391f374282b4b76e" - integrity sha512-ruH6KuLlt75aCObXfUIdVJqmfVq7sgWGq5mXa05vc1MEqxTIiU23YiJdWzofQOOUOACaZkzZ4K4Nu7wXEg4Xgg== +"@lerna/get-npm-exec-opts@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-3.13.0.tgz#d1b552cb0088199fc3e7e126f914e39a08df9ea5" + integrity sha512-Y0xWL0rg3boVyJk6An/vurKzubyJKtrxYv2sj4bB8Mc5zZ3tqtv0ccbOkmkXKqbzvNNF7VeUt1OJ3DRgtC/QZw== dependencies: - libnpm "^2.0.1" + npmlog "^4.1.2" -"@lerna/get-packed@3.7.0": - version "3.7.0" - resolved "https://registry.yarnpkg.com/@lerna/get-packed/-/get-packed-3.7.0.tgz#549c7738f7be5e3b1433e82ed9cda9123bcd1ed5" - integrity sha512-yuFtjsUZIHjeIvIYQ/QuytC+FQcHwo3peB+yGBST2uWCLUCR5rx6knoQcPzbxdFDCuUb5IFccFGd3B1fHFg3RQ== +"@lerna/get-packed@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/get-packed/-/get-packed-3.13.0.tgz#335e40d77f3c1855aa248587d3e0b2d8f4b06e16" + integrity sha512-EgSim24sjIjqQDC57bgXD9l22/HCS93uQBbGpkzEOzxAVzEgpZVm7Fm1t8BVlRcT2P2zwGnRadIvxTbpQuDPTg== dependencies: fs-extra "^7.0.0" ssri "^6.0.1" tar "^4.4.8" -"@lerna/global-options@3.10.6": - version "3.10.6" - resolved "https://registry.yarnpkg.com/@lerna/global-options/-/global-options-3.10.6.tgz#c491a64b0be47eca4ffc875011958a5ee70a9a3e" - integrity sha512-k5Xkq1M/uREFC2R9uwN5gcvIgjj4iOXo0YyeEXCMWBiW3j2GL9xN4d1MmAIcrYlAzVYh6kLlWaFWl/rNIneHIw== - -"@lerna/has-npm-version@3.10.0": - version "3.10.0" - resolved "https://registry.yarnpkg.com/@lerna/has-npm-version/-/has-npm-version-3.10.0.tgz#d3a73c0fedd2f2e9c6fbe166c41809131dc939d2" - integrity sha512-N4RRYxGeivuaKgPDzrhkQOQs1Sg4tOnxnEe3akfqu1wDA4Ng5V6Y2uW3DbkAjFL3aNJhWF5Vbf7sBsGtfgDQ8w== +"@lerna/github-client@3.13.1": + version "3.13.1" + resolved "https://registry.yarnpkg.com/@lerna/github-client/-/github-client-3.13.1.tgz#cb9bf9f01685a0cee0fac63f287f6c3673e45aa3" + integrity sha512-iPLUp8FFoAKGURksYEYZzfuo9TRA+NepVlseRXFaWlmy36dCQN20AciINpoXiXGoHcEUHXUKHQvY3ARFdMlf3w== dependencies: - "@lerna/child-process" "3.3.0" + "@lerna/child-process" "3.13.0" + "@octokit/plugin-enterprise-rest" "^2.1.1" + "@octokit/rest" "^16.16.0" + git-url-parse "^11.1.2" + npmlog "^4.1.2" + +"@lerna/global-options@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/global-options/-/global-options-3.13.0.tgz#217662290db06ad9cf2c49d8e3100ee28eaebae1" + integrity sha512-SlZvh1gVRRzYLVluz9fryY1nJpZ0FHDGB66U9tFfvnnxmueckRQxLopn3tXj3NU1kc3QANT2I5BsQkOqZ4TEFQ== + +"@lerna/has-npm-version@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/has-npm-version/-/has-npm-version-3.13.0.tgz#6e1f7e9336cce3e029066f0175f06dd9d51ad09f" + integrity sha512-Oqu7DGLnrMENPm+bPFGOHnqxK8lCnuYr6bk3g/CoNn8/U0qgFvHcq6Iv8/Z04TsvleX+3/RgauSD2kMfRmbypg== + dependencies: + "@lerna/child-process" "3.13.0" semver "^5.5.0" -"@lerna/import@3.10.6": - version "3.10.6" - resolved "https://registry.yarnpkg.com/@lerna/import/-/import-3.10.6.tgz#36b65854857e8ab5dfd98a1caea4d365ecc06578" - integrity sha512-LlGxhfDhovoNoBJLF3PYd3j/G2GFTnfLh0V38+hBQ6lomMNJbjkACfiLVomQxPWWpYLk0GTlpWYR8YGv6L7Ifw== +"@lerna/import@3.13.1": + version "3.13.1" + resolved "https://registry.yarnpkg.com/@lerna/import/-/import-3.13.1.tgz#69d641341a38b79bd379129da1c717d51dd728c7" + integrity sha512-A1Vk1siYx1XkRl6w+zkaA0iptV5TIynVlHPR9S7NY0XAfhykjztYVvwtxarlh6+VcNrO9We6if0+FXCrfDEoIg== dependencies: - "@lerna/child-process" "3.3.0" - "@lerna/command" "3.10.6" - "@lerna/prompt" "3.6.0" - "@lerna/pulse-till-done" "3.7.1" - "@lerna/validation-error" "3.6.0" + "@lerna/child-process" "3.13.0" + "@lerna/command" "3.13.1" + "@lerna/prompt" "3.13.0" + "@lerna/pulse-till-done" "3.13.0" + "@lerna/validation-error" "3.13.0" dedent "^0.7.0" fs-extra "^7.0.0" p-map-series "^1.0.0" -"@lerna/init@3.10.6": - version "3.10.6" - resolved "https://registry.yarnpkg.com/@lerna/init/-/init-3.10.6.tgz#b5c5166b2ddf00ea0f2742a1f53f59221478cf9a" - integrity sha512-RIlEx+ofWLYRNjxCkkV3G0XQPM+/KA5RXRDb5wKQLYO1f+tZAaHoUh8fHDIvxGf/ohY/OIjYYGSsU+ysimfwiQ== +"@lerna/init@3.13.1": + version "3.13.1" + resolved "https://registry.yarnpkg.com/@lerna/init/-/init-3.13.1.tgz#0392c822abb3d63a75be4916c5e761cfa7b34dda" + integrity sha512-M59WACqim8WkH5FQEGOCEZ89NDxCKBfFTx4ZD5ig3LkGyJ8RdcJq5KEfpW/aESuRE9JrZLzVr0IjKbZSxzwEMA== dependencies: - "@lerna/child-process" "3.3.0" - "@lerna/command" "3.10.6" + "@lerna/child-process" "3.13.0" + "@lerna/command" "3.13.1" fs-extra "^7.0.0" p-map "^1.2.0" write-json-file "^2.3.0" -"@lerna/link@3.10.6": - version "3.10.6" - resolved "https://registry.yarnpkg.com/@lerna/link/-/link-3.10.6.tgz#4201cabbfc27bebaf1a400f8cfbd238f285dd3c7" - integrity sha512-dwD6qftRWitgLDYbqtDrgO7c8uF5C0fHVew5M6gU5m9tBJidqd7cDwHv/bXboLEI63U7tt5y6LY+wEpYUFsBRw== +"@lerna/link@3.13.1": + version "3.13.1" + resolved "https://registry.yarnpkg.com/@lerna/link/-/link-3.13.1.tgz#7d8ed4774bfa198d1780f790a14abb8722a3aad1" + integrity sha512-N3h3Fj1dcea+1RaAoAdy4g2m3fvU7m89HoUn5X/Zcw5n2kPoK8kTO+NfhNAatfRV8VtMXst8vbNrWQQtfm0FFw== dependencies: - "@lerna/command" "3.10.6" - "@lerna/package-graph" "3.10.6" - "@lerna/symlink-dependencies" "3.10.0" + "@lerna/command" "3.13.1" + "@lerna/package-graph" "3.13.0" + "@lerna/symlink-dependencies" "3.13.0" p-map "^1.2.0" slash "^1.0.0" -"@lerna/list@3.10.6": - version "3.10.6" - resolved "https://registry.yarnpkg.com/@lerna/list/-/list-3.10.6.tgz#7c43c09301ea01528f4dab3b22666f021e8ba9a5" - integrity sha512-3ElQBj2dOB4uUkpsjC1bxdeZwEzRBuV1pBBs5E1LncwsZf7D9D99Z32fuZsDaCHpEMgHAD4/j8juI3/7m5dkaQ== +"@lerna/list@3.13.1": + version "3.13.1" + resolved "https://registry.yarnpkg.com/@lerna/list/-/list-3.13.1.tgz#f9513ed143e52156c10ada4070f903c5847dcd10" + integrity sha512-635iRbdgd9gNvYLLIbYdQCQLr+HioM5FGJLFS0g3DPGygr6iDR8KS47hzCRGH91LU9NcM1mD1RoT/AChF+QbiA== dependencies: - "@lerna/command" "3.10.6" - "@lerna/filter-options" "3.10.6" - "@lerna/listable" "3.10.6" - "@lerna/output" "3.6.0" + "@lerna/command" "3.13.1" + "@lerna/filter-options" "3.13.0" + "@lerna/listable" "3.13.0" + "@lerna/output" "3.13.0" -"@lerna/listable@3.10.6": - version "3.10.6" - resolved "https://registry.yarnpkg.com/@lerna/listable/-/listable-3.10.6.tgz#cea92de89d9f293c6d63e00be662bed03f85c496" - integrity sha512-F7ZuvesSgeuMiJf99eOum5p1MQGQStykcmHH1ek+LQRMiGGF1o3PkBxPvHTZBADGOFarek8bFA5TVmRAMX7NIw== +"@lerna/listable@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/listable/-/listable-3.13.0.tgz#babc18442c590b549cf0966d20d75fea066598d4" + integrity sha512-liYJ/WBUYP4N4MnSVZuLUgfa/jy3BZ02/1Om7xUY09xGVSuNVNEeB8uZUMSC+nHqFHIsMPZ8QK9HnmZb1E/eTA== dependencies: - "@lerna/batch-packages" "3.10.6" + "@lerna/batch-packages" "3.13.0" chalk "^2.3.1" columnify "^1.5.4" -"@lerna/log-packed@3.6.0": - version "3.6.0" - resolved "https://registry.yarnpkg.com/@lerna/log-packed/-/log-packed-3.6.0.tgz#bed96c2bdd47f076d9957d0c6069b2edc1518145" - integrity sha512-T/J41zMkzpWB5nbiTRS5PmYTFn74mJXe6RQA2qhkdLi0UqnTp97Pux1loz3jsJf2yJtiQUnyMM7KuKIAge0Vlw== +"@lerna/log-packed@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/log-packed/-/log-packed-3.13.0.tgz#497b5f692a8d0e3f669125da97b0dadfd9e480f3" + integrity sha512-Rmjrcz+6aM6AEcEVWmurbo8+AnHOvYtDpoeMMJh9IZ9SmZr2ClXzmD7wSvjTQc8BwOaiWjjC/ukcT0UYA2m7wg== dependencies: byte-size "^4.0.3" columnify "^1.5.4" has-unicode "^2.0.1" - libnpm "^2.0.1" + npmlog "^4.1.2" -"@lerna/npm-conf@3.7.0": - version "3.7.0" - resolved "https://registry.yarnpkg.com/@lerna/npm-conf/-/npm-conf-3.7.0.tgz#f101d4fdf07cefcf1161bcfaf3c0f105b420a450" - integrity sha512-+WSMDfPKcKzMfqq283ydz9RRpOU6p9wfx0wy4hVSUY/6YUpsyuk8SShjcRtY8zTM5AOrxvFBuuV90H4YpZ5+Ng== +"@lerna/npm-conf@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/npm-conf/-/npm-conf-3.13.0.tgz#6b434ed75ff757e8c14381b9bbfe5d5ddec134a7" + integrity sha512-Jg2kANsGnhg+fbPEzE0X9nX5oviEAvWj0nYyOkcE+cgWuT7W0zpnPXC4hA4C5IPQGhwhhh0IxhWNNHtjTuw53g== dependencies: config-chain "^1.1.11" pify "^3.0.0" -"@lerna/npm-dist-tag@3.8.5": - version "3.8.5" - resolved "https://registry.yarnpkg.com/@lerna/npm-dist-tag/-/npm-dist-tag-3.8.5.tgz#5ce22a72576badc8cb6baf85550043d63e66ea44" - integrity sha512-VO57yKTB4NC2LZuTd4w0LmlRpoFm/gejQ1gqqLGzSJuSZaBXmieElFovzl21S07cqiy7FNVdz75x7/a6WCZ6XA== +"@lerna/npm-dist-tag@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/npm-dist-tag/-/npm-dist-tag-3.13.0.tgz#49ecbe0e82cbe4ad4a8ea6de112982bf6c4e6cd4" + integrity sha512-mcuhw34JhSRFrbPn0vedbvgBTvveG52bR2lVE3M3tfE8gmR/cKS/EJFO4AUhfRKGCTFn9rjaSEzlFGYV87pemQ== dependencies: figgy-pudding "^3.5.1" - libnpm "^2.0.1" + npm-package-arg "^6.1.0" + npm-registry-fetch "^3.9.0" + npmlog "^4.1.2" -"@lerna/npm-install@3.10.0": - version "3.10.0" - resolved "https://registry.yarnpkg.com/@lerna/npm-install/-/npm-install-3.10.0.tgz#fcd6688a3a2cd0e702a03c54c22eb7ae8b3dacb0" - integrity sha512-/6/XyLY9/4jaMPBOVYUr4wZxQURIfwoELY0qCQ8gZ5zv4cOiFiiCUxZ0i4fxqFtD7nJ084zq1DsZW0aH0CIWYw== +"@lerna/npm-install@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/npm-install/-/npm-install-3.13.0.tgz#88f4cc39f4f737c8a8721256b915ea1bcc6a7227" + integrity sha512-qNyfts//isYQxore6fsPorNYJmPVKZ6tOThSH97tP0aV91zGMtrYRqlAoUnDwDdAjHPYEM16hNujg2wRmsqqIw== dependencies: - "@lerna/child-process" "3.3.0" - "@lerna/get-npm-exec-opts" "3.6.0" + "@lerna/child-process" "3.13.0" + "@lerna/get-npm-exec-opts" "3.13.0" fs-extra "^7.0.0" - libnpm "^2.0.1" + npm-package-arg "^6.1.0" + npmlog "^4.1.2" signal-exit "^3.0.2" write-pkg "^3.1.0" -"@lerna/npm-publish@3.10.7": - version "3.10.7" - resolved "https://registry.yarnpkg.com/@lerna/npm-publish/-/npm-publish-3.10.7.tgz#9326b747b905a7f0e69d4be3f557859c3e359649" - integrity sha512-oU3/Q+eHC1fRjh7bk6Nn4tRD1OLR6XZVs3v+UWMWMrF4hVSV61pxcP5tpeI1n4gDQjSgh7seI4EzKVJe/WfraA== +"@lerna/npm-publish@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/npm-publish/-/npm-publish-3.13.0.tgz#5c74808376e778865ffdc5885fe83935e15e60c3" + integrity sha512-y4WO0XTaf9gNRkI7as6P2ItVDOxmYHwYto357fjybcnfXgMqEA94c3GJ++jU41j0A9vnmYC6/XxpTd9sVmH9tA== dependencies: - "@lerna/run-lifecycle" "3.10.5" + "@lerna/run-lifecycle" "3.13.0" figgy-pudding "^3.5.1" fs-extra "^7.0.0" - libnpm "^2.0.1" + libnpmpublish "^1.1.1" + npmlog "^4.1.2" + pify "^3.0.0" + read-package-json "^2.0.13" -"@lerna/npm-run-script@3.10.0": - version "3.10.0" - resolved "https://registry.yarnpkg.com/@lerna/npm-run-script/-/npm-run-script-3.10.0.tgz#49a9204eddea136da15a8d8d9eba2c3175b77ddd" - integrity sha512-c21tBXLF1Wje4tx/Td9jKIMrlZo/8QQiyyadjdKpwyyo7orSMsVNXGyJwvZ4JVVDcwC3GPU6HQvkt63v7rcyaw== +"@lerna/npm-run-script@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/npm-run-script/-/npm-run-script-3.13.0.tgz#e5997f045402b9948bdc066033ebb36bf94fc9e4" + integrity sha512-hiL3/VeVp+NFatBjkGN8mUdX24EfZx9rQlSie0CMgtjc7iZrtd0jCguLomSCRHYjJuvqgbp+LLYo7nHVykfkaQ== dependencies: - "@lerna/child-process" "3.3.0" - "@lerna/get-npm-exec-opts" "3.6.0" - libnpm "^2.0.1" + "@lerna/child-process" "3.13.0" + "@lerna/get-npm-exec-opts" "3.13.0" + npmlog "^4.1.2" -"@lerna/output@3.6.0": - version "3.6.0" - resolved "https://registry.yarnpkg.com/@lerna/output/-/output-3.6.0.tgz#a69384bc685cf3b21aa1bfc697eb2b9db3333d0b" - integrity sha512-9sjQouf6p7VQtVCRnzoTGlZyURd48i3ha3WBHC/UBJnHZFuXMqWVPKNuvnMf2kRXDyoQD+2mNywpmEJg5jOnRg== +"@lerna/output@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/output/-/output-3.13.0.tgz#3ded7cc908b27a9872228a630d950aedae7a4989" + integrity sha512-7ZnQ9nvUDu/WD+bNsypmPG5MwZBwu86iRoiW6C1WBuXXDxM5cnIAC1m2WxHeFnjyMrYlRXM9PzOQ9VDD+C15Rg== dependencies: - libnpm "^2.0.1" + npmlog "^4.1.2" -"@lerna/pack-directory@3.10.5": - version "3.10.5" - resolved "https://registry.yarnpkg.com/@lerna/pack-directory/-/pack-directory-3.10.5.tgz#9bdabceacb74e1f54e47bae925e193978f2aae51" - integrity sha512-Ulj24L9XdgjJIxBr6ZjRJEoBULVH3c10lqunUdW41bswXhzhirRtQIxv0+5shngNjDwgMmJfOBcuCVKPSez4tg== +"@lerna/pack-directory@3.13.1": + version "3.13.1" + resolved "https://registry.yarnpkg.com/@lerna/pack-directory/-/pack-directory-3.13.1.tgz#5ad4d0945f86a648f565e24d53c1e01bb3a912d1" + integrity sha512-kXnyqrkQbCIZOf1054N88+8h0ItC7tUN5v9ca/aWpx298gsURpxUx/1TIKqijL5TOnHMyIkj0YJmnH/PyBVLKA== dependencies: - "@lerna/get-packed" "3.7.0" - "@lerna/package" "3.7.2" - "@lerna/run-lifecycle" "3.10.5" + "@lerna/get-packed" "3.13.0" + "@lerna/package" "3.13.0" + "@lerna/run-lifecycle" "3.13.0" figgy-pudding "^3.5.1" - libnpm "^2.0.1" - npm-packlist "^1.1.12" + npm-packlist "^1.4.1" + npmlog "^4.1.2" tar "^4.4.8" temp-write "^3.4.0" -"@lerna/package-graph@3.10.6": - version "3.10.6" - resolved "https://registry.yarnpkg.com/@lerna/package-graph/-/package-graph-3.10.6.tgz#8940d1ed7003100117cb1b618f7690585c00db81" - integrity sha512-mpIOJbhi+xLqT9BcUrLVD4We8WUdousQf/QndbEWl8DWAW1ethtRHVsCm9ufdBB3F9nj4PH/hqnDWWwqE+rS4w== +"@lerna/package-graph@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/package-graph/-/package-graph-3.13.0.tgz#607062f8d2ce22b15f8d4a0623f384736e67f760" + integrity sha512-3mRF1zuqFE1HEFmMMAIggXy+f+9cvHhW/jzaPEVyrPNLKsyfJQtpTNzeI04nfRvbAh+Gd2aNksvaW/w3xGJnnw== dependencies: - "@lerna/validation-error" "3.6.0" - libnpm "^2.0.1" + "@lerna/validation-error" "3.13.0" + npm-package-arg "^6.1.0" semver "^5.5.0" -"@lerna/package@3.7.2": - version "3.7.2" - resolved "https://registry.yarnpkg.com/@lerna/package/-/package-3.7.2.tgz#03c69fd7fb965c372c8c969165a2f7d6dfe2dfcb" - integrity sha512-8A5hN2CekM1a0Ix4VUO/g+REo+MsnXb8lnQ0bGjr1YGWzSL5NxYJ0Z9+0pwTfDpvRDYlFYO0rMVwBUW44b4dUw== +"@lerna/package@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/package/-/package-3.13.0.tgz#4baeebc49a57fc9b31062cc59f5ee38384429fc8" + integrity sha512-kSKO0RJQy093BufCQnkhf1jB4kZnBvL7kK5Ewolhk5gwejN+Jofjd8DGRVUDUJfQ0CkW1o6GbUeZvs8w8VIZDg== dependencies: - libnpm "^2.0.1" load-json-file "^4.0.0" + npm-package-arg "^6.1.0" write-pkg "^3.1.0" -"@lerna/project@3.10.0": - version "3.10.0" - resolved "https://registry.yarnpkg.com/@lerna/project/-/project-3.10.0.tgz#98272bf2eb93e9b21850edae568d696bf7fdebda" - integrity sha512-9QRl8aGHuyU4zVEELQmNPnJTlS7XHqX7w9I9isCXdnilKc2R0MyvUs21lj6Yyt6xTuQnqD158TR9tbS4QufYQQ== +"@lerna/project@3.13.1": + version "3.13.1" + resolved "https://registry.yarnpkg.com/@lerna/project/-/project-3.13.1.tgz#bce890f60187bd950bcf36c04b5260642e295e79" + integrity sha512-/GoCrpsCCTyb9sizk1+pMBrIYchtb+F1uCOn3cjn9yenyG/MfYEnlfrbV5k/UDud0Ei75YBLbmwCbigHkAKazQ== dependencies: - "@lerna/package" "3.7.2" - "@lerna/validation-error" "3.6.0" - cosmiconfig "^5.0.2" + "@lerna/package" "3.13.0" + "@lerna/validation-error" "3.13.0" + cosmiconfig "^5.1.0" dedent "^0.7.0" dot-prop "^4.2.0" glob-parent "^3.1.0" globby "^8.0.1" - libnpm "^2.0.1" load-json-file "^4.0.0" + npmlog "^4.1.2" p-map "^1.2.0" resolve-from "^4.0.0" write-json-file "^2.3.0" -"@lerna/prompt@3.6.0": - version "3.6.0" - resolved "https://registry.yarnpkg.com/@lerna/prompt/-/prompt-3.6.0.tgz#b17cc464dec9d830619723e879dc747367378217" - integrity sha512-nyAjPMolJ/ZRAAVcXrUH89C4n1SiWvLh4xWNvWYKLcf3PI5yges35sDFP/HYrM4+cEbkNFuJCRq6CxaET4PRsg== +"@lerna/prompt@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/prompt/-/prompt-3.13.0.tgz#53571462bb3f5399cc1ca6d335a411fe093426a5" + integrity sha512-P+lWSFokdyvYpkwC3it9cE0IF2U5yy2mOUbGvvE4iDb9K7TyXGE+7lwtx2thtPvBAfIb7O13POMkv7df03HJeA== dependencies: inquirer "^6.2.0" - libnpm "^2.0.1" + npmlog "^4.1.2" -"@lerna/publish@3.10.7": - version "3.10.7" - resolved "https://registry.yarnpkg.com/@lerna/publish/-/publish-3.10.7.tgz#8c5a3268398152e1f7993ff7bb6722a0363797af" - integrity sha512-Qd8pml2l9s6GIvNX1pTnia+Ddjsm9LF3pRRoOQeugAdv2IJNf45c/83AAEyE9M2ShG5VjgxEITNW4Lg49zipjQ== +"@lerna/publish@3.13.1": + version "3.13.1" + resolved "https://registry.yarnpkg.com/@lerna/publish/-/publish-3.13.1.tgz#217e401dcb5824cdd6d36555a36303fb7520c514" + integrity sha512-KhCJ9UDx76HWCF03i5TD7z5lX+2yklHh5SyO8eDaLptgdLDQ0Z78lfGj3JhewHU2l46FztmqxL/ss0IkWHDL+g== dependencies: - "@lerna/batch-packages" "3.10.6" - "@lerna/check-working-tree" "3.10.0" - "@lerna/child-process" "3.3.0" - "@lerna/collect-updates" "3.10.1" - "@lerna/command" "3.10.6" - "@lerna/describe-ref" "3.10.0" - "@lerna/log-packed" "3.6.0" - "@lerna/npm-conf" "3.7.0" - "@lerna/npm-dist-tag" "3.8.5" - "@lerna/npm-publish" "3.10.7" - "@lerna/output" "3.6.0" - "@lerna/pack-directory" "3.10.5" - "@lerna/prompt" "3.6.0" - "@lerna/pulse-till-done" "3.7.1" - "@lerna/run-lifecycle" "3.10.5" - "@lerna/run-parallel-batches" "3.0.0" - "@lerna/validation-error" "3.6.0" - "@lerna/version" "3.10.6" + "@lerna/batch-packages" "3.13.0" + "@lerna/check-working-tree" "3.13.0" + "@lerna/child-process" "3.13.0" + "@lerna/collect-updates" "3.13.0" + "@lerna/command" "3.13.1" + "@lerna/describe-ref" "3.13.0" + "@lerna/log-packed" "3.13.0" + "@lerna/npm-conf" "3.13.0" + "@lerna/npm-dist-tag" "3.13.0" + "@lerna/npm-publish" "3.13.0" + "@lerna/output" "3.13.0" + "@lerna/pack-directory" "3.13.1" + "@lerna/prompt" "3.13.0" + "@lerna/pulse-till-done" "3.13.0" + "@lerna/run-lifecycle" "3.13.0" + "@lerna/run-parallel-batches" "3.13.0" + "@lerna/validation-error" "3.13.0" + "@lerna/version" "3.13.1" figgy-pudding "^3.5.1" fs-extra "^7.0.0" - libnpm "^2.0.1" + libnpmaccess "^3.0.1" + npm-package-arg "^6.1.0" + npm-registry-fetch "^3.9.0" + npmlog "^4.1.2" p-finally "^1.0.0" p-map "^1.2.0" p-pipe "^1.2.0" p-reduce "^1.0.0" + pacote "^9.5.0" semver "^5.5.0" -"@lerna/pulse-till-done@3.7.1": - version "3.7.1" - resolved "https://registry.yarnpkg.com/@lerna/pulse-till-done/-/pulse-till-done-3.7.1.tgz#a9e55380fa18f6896a3e5b23621a4227adfb8f85" - integrity sha512-MzpesZeW3Mc+CiAq4zUt9qTXI9uEBBKrubYHE36voQTSkHvu/Rox6YOvfUr+U7P6k8frFPeCgGpfMDTLhiqe6w== +"@lerna/pulse-till-done@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/pulse-till-done/-/pulse-till-done-3.13.0.tgz#c8e9ce5bafaf10d930a67d7ed0ccb5d958fe0110" + integrity sha512-1SOHpy7ZNTPulzIbargrgaJX387csN7cF1cLOGZiJQA6VqnS5eWs2CIrG8i8wmaUavj2QlQ5oEbRMVVXSsGrzA== dependencies: - libnpm "^2.0.1" + npmlog "^4.1.2" -"@lerna/resolve-symlink@3.6.0": - version "3.6.0" - resolved "https://registry.yarnpkg.com/@lerna/resolve-symlink/-/resolve-symlink-3.6.0.tgz#985344796b704ff32afa923901e795e80741b86e" - integrity sha512-TVOAEqHJSQVhNDMFCwEUZPaOETqHDQV1TQWQfC8ZlOqyaUQ7veZUbg0yfG7RPNzlSpvF0ZaGFeR0YhYDAW03GA== +"@lerna/resolve-symlink@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/resolve-symlink/-/resolve-symlink-3.13.0.tgz#3e6809ef53b63fe914814bfa071cd68012e22fbb" + integrity sha512-Lc0USSFxwDxUs5JvIisS8JegjA6SHSAWJCMvi2osZx6wVRkEDlWG2B1JAfXUzCMNfHoZX0/XX9iYZ+4JIpjAtg== dependencies: fs-extra "^7.0.0" - libnpm "^2.0.1" + npmlog "^4.1.2" read-cmd-shim "^1.0.1" -"@lerna/rimraf-dir@3.10.0": - version "3.10.0" - resolved "https://registry.yarnpkg.com/@lerna/rimraf-dir/-/rimraf-dir-3.10.0.tgz#2d9435054ab7bbc5519db0a2654c5d8cacd27f98" - integrity sha512-RSKSfxPURc58ERCD/PuzorR86lWEvIWNclXYGvIYM76yNGrWiDF44pGHQvB4J+Lxa5M+52ZtZC/eOC7A7YCH4g== +"@lerna/rimraf-dir@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/rimraf-dir/-/rimraf-dir-3.13.0.tgz#bb1006104b4aabcb6985624273254648f872b278" + integrity sha512-kte+pMemulre8cmPqljxIYjCmdLByz8DgHBHXB49kz2EiPf8JJ+hJFt0PzEubEyJZ2YE2EVAx5Tv5+NfGNUQyQ== dependencies: - "@lerna/child-process" "3.3.0" - libnpm "^2.0.1" + "@lerna/child-process" "3.13.0" + npmlog "^4.1.2" path-exists "^3.0.0" rimraf "^2.6.2" -"@lerna/run-lifecycle@3.10.5": - version "3.10.5" - resolved "https://registry.yarnpkg.com/@lerna/run-lifecycle/-/run-lifecycle-3.10.5.tgz#ea4422bb70c0f8d4382ecb2a626c8ba0ca88550b" - integrity sha512-YPmXviaxVlhcKM6IkDTIpTq24mxOuMCilo+MTr1RLoafgB9ZTmP2AHRiFt/sy14wOsq2Zqr0wJyj8KFlDYLTkA== +"@lerna/run-lifecycle@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/run-lifecycle/-/run-lifecycle-3.13.0.tgz#d8835ee83425edee40f687a55f81b502354d3261" + integrity sha512-oyiaL1biZdjpmjh6X/5C4w07wNFyiwXSSHH5GQB4Ay4BPwgq9oNhCcxRoi0UVZlZ1YwzSW8sTwLgj8emkIo3Yg== dependencies: - "@lerna/npm-conf" "3.7.0" + "@lerna/npm-conf" "3.13.0" figgy-pudding "^3.5.1" - libnpm "^2.0.1" + npm-lifecycle "^2.1.0" + npmlog "^4.1.2" -"@lerna/run-parallel-batches@3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@lerna/run-parallel-batches/-/run-parallel-batches-3.0.0.tgz#468704934084c74991d3124d80607857d4dfa840" - integrity sha512-Mj1ravlXF7AkkewKd9YFq9BtVrsStNrvVLedD/b2wIVbNqcxp8lS68vehXVOzoL/VWNEDotvqCQtyDBilCodGw== +"@lerna/run-parallel-batches@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/run-parallel-batches/-/run-parallel-batches-3.13.0.tgz#0276bb4e7cd0995297db82d134ca2bd08d63e311" + integrity sha512-bICFBR+cYVF1FFW+Tlm0EhWDioTUTM6dOiVziDEGE1UZha1dFkMYqzqdSf4bQzfLS31UW/KBd/2z8jy2OIjEjg== dependencies: p-map "^1.2.0" p-map-series "^1.0.0" -"@lerna/run@3.10.6": - version "3.10.6" - resolved "https://registry.yarnpkg.com/@lerna/run/-/run-3.10.6.tgz#4c159a719b0ec010409dfe8f9535c9a3c3f3e06a" - integrity sha512-KS2lWbu/8WUUscQPi9U8sPO6yYpzf/0GmODjpruR1nRi1u/tuncdjTiG+hjGAeFC1BD7YktT9Za6imIpE8RXmA== +"@lerna/run@3.13.1": + version "3.13.1" + resolved "https://registry.yarnpkg.com/@lerna/run/-/run-3.13.1.tgz#87e174c1d271894ddd29adc315c068fb7b1b0117" + integrity sha512-nv1oj7bsqppWm1M4ifN+/IIbVu9F4RixrbQD2okqDGYne4RQPAXyb5cEZuAzY/wyGTWWiVaZ1zpj5ogPWvH0bw== dependencies: - "@lerna/batch-packages" "3.10.6" - "@lerna/command" "3.10.6" - "@lerna/filter-options" "3.10.6" - "@lerna/npm-run-script" "3.10.0" - "@lerna/output" "3.6.0" - "@lerna/run-parallel-batches" "3.0.0" - "@lerna/timer" "3.5.0" - "@lerna/validation-error" "3.6.0" + "@lerna/batch-packages" "3.13.0" + "@lerna/command" "3.13.1" + "@lerna/filter-options" "3.13.0" + "@lerna/npm-run-script" "3.13.0" + "@lerna/output" "3.13.0" + "@lerna/run-parallel-batches" "3.13.0" + "@lerna/timer" "3.13.0" + "@lerna/validation-error" "3.13.0" p-map "^1.2.0" -"@lerna/symlink-binary@3.10.0": - version "3.10.0" - resolved "https://registry.yarnpkg.com/@lerna/symlink-binary/-/symlink-binary-3.10.0.tgz#5acdde86dfd50c9270d7d2a93bade203cff41b3d" - integrity sha512-6mQsG+iVjBo8cD8s24O+YgFrwDyUGfUQbK4ryalAXFHI817Zd4xlI3tjg3W99whCt6rt6D0s1fpf8eslMN6dSw== +"@lerna/symlink-binary@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/symlink-binary/-/symlink-binary-3.13.0.tgz#36a9415d468afcb8105750296902f6f000a9680d" + integrity sha512-obc4Y6jxywkdaCe+DB0uTxYqP0IQ8mFWvN+k/YMbwH4G2h7M7lCBWgPy8e7xw/50+1II9tT2sxgx+jMus1sTJg== dependencies: - "@lerna/create-symlink" "3.6.0" - "@lerna/package" "3.7.2" + "@lerna/create-symlink" "3.13.0" + "@lerna/package" "3.13.0" fs-extra "^7.0.0" p-map "^1.2.0" -"@lerna/symlink-dependencies@3.10.0": - version "3.10.0" - resolved "https://registry.yarnpkg.com/@lerna/symlink-dependencies/-/symlink-dependencies-3.10.0.tgz#a20226e8e97af6a6bc4b416bfc28c0c5e3ba9ddd" - integrity sha512-vGpg5ydwGgQCuWNX5y7CRL38mGpuLhf1GRq9wMm7IGwnctEsdSNqvvE+LDgqtwEZASu5+vffYUkL0VlFXl8uWA== +"@lerna/symlink-dependencies@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/symlink-dependencies/-/symlink-dependencies-3.13.0.tgz#76c23ecabda7824db98a0561364f122b457509cf" + integrity sha512-7CyN5WYEPkbPLbqHBIQg/YiimBzb5cIGQB0E9IkLs3+racq2vmUNQZn38LOaazQacAA83seB+zWSxlI6H+eXSg== dependencies: - "@lerna/create-symlink" "3.6.0" - "@lerna/resolve-symlink" "3.6.0" - "@lerna/symlink-binary" "3.10.0" + "@lerna/create-symlink" "3.13.0" + "@lerna/resolve-symlink" "3.13.0" + "@lerna/symlink-binary" "3.13.0" fs-extra "^7.0.0" p-finally "^1.0.0" p-map "^1.2.0" p-map-series "^1.0.0" -"@lerna/timer@3.5.0": - version "3.5.0" - resolved "https://registry.yarnpkg.com/@lerna/timer/-/timer-3.5.0.tgz#8dee6acf002c55de64678c66ef37ca52143f1b9b" - integrity sha512-TAb99hqQN6E3JBGtG9iyZNPq1/DbmqgBOeNrKtdJsGvIeX/NGLgUDWMrj2h04V4O+jpBFmSf6HIld6triKmxCA== +"@lerna/timer@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/timer/-/timer-3.13.0.tgz#bcd0904551db16e08364d6c18e5e2160fc870781" + integrity sha512-RHWrDl8U4XNPqY5MQHkToWS9jHPnkLZEt5VD+uunCKTfzlxGnRCr3/zVr8VGy/uENMYpVP3wJa4RKGY6M0vkRw== -"@lerna/validation-error@3.6.0": - version "3.6.0" - resolved "https://registry.yarnpkg.com/@lerna/validation-error/-/validation-error-3.6.0.tgz#550cf66bb2ef88edc02e36017b575a7a9100d5d8" - integrity sha512-MWltncGO5VgMS0QedTlZCjFUMF/evRjDMMHrtVorkIB2Cp5xy0rkKa8iDBG43qpUWeG1giwi58yUlETBcWfILw== +"@lerna/validation-error@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/validation-error/-/validation-error-3.13.0.tgz#c86b8f07c5ab9539f775bd8a54976e926f3759c3" + integrity sha512-SiJP75nwB8GhgwLKQfdkSnDufAaCbkZWJqEDlKOUPUvVOplRGnfL+BPQZH5nvq2BYSRXsksXWZ4UHVnQZI/HYA== dependencies: - libnpm "^2.0.1" + npmlog "^4.1.2" -"@lerna/version@3.10.6": - version "3.10.6" - resolved "https://registry.yarnpkg.com/@lerna/version/-/version-3.10.6.tgz#c31c2bb1aabbdc851407534155567b5cdf48e0fb" - integrity sha512-77peW2ROlHHl1e/tHBUmhpb8tsO6CIdlx34XapZhUuIVykrkOuqVFFxqMecrGG8SJe0e3l1G+Fah7bJTQcG0kw== +"@lerna/version@3.13.1": + version "3.13.1" + resolved "https://registry.yarnpkg.com/@lerna/version/-/version-3.13.1.tgz#5e919d13abb13a663dcc7922bb40931f12fb137b" + integrity sha512-WpfKc5jZBBOJ6bFS4atPJEbHSiywQ/Gcd+vrwaEGyQHWHQZnPTvhqLuq3q9fIb9sbuhH5pSY6eehhuBrKqTnjg== dependencies: - "@lerna/batch-packages" "3.10.6" - "@lerna/check-working-tree" "3.10.0" - "@lerna/child-process" "3.3.0" - "@lerna/collect-updates" "3.10.1" - "@lerna/command" "3.10.6" - "@lerna/conventional-commits" "3.10.0" - "@lerna/output" "3.6.0" - "@lerna/prompt" "3.6.0" - "@lerna/run-lifecycle" "3.10.5" - "@lerna/validation-error" "3.6.0" + "@lerna/batch-packages" "3.13.0" + "@lerna/check-working-tree" "3.13.0" + "@lerna/child-process" "3.13.0" + "@lerna/collect-updates" "3.13.0" + "@lerna/command" "3.13.1" + "@lerna/conventional-commits" "3.13.0" + "@lerna/github-client" "3.13.1" + "@lerna/output" "3.13.0" + "@lerna/prompt" "3.13.0" + "@lerna/run-lifecycle" "3.13.0" + "@lerna/validation-error" "3.13.0" chalk "^2.3.1" dedent "^0.7.0" - libnpm "^2.0.1" minimatch "^3.0.4" + npmlog "^4.1.2" p-map "^1.2.0" p-pipe "^1.2.0" p-reduce "^1.0.0" @@ -1313,12 +1436,12 @@ slash "^1.0.0" temp-write "^3.4.0" -"@lerna/write-log-file@3.6.0": - version "3.6.0" - resolved "https://registry.yarnpkg.com/@lerna/write-log-file/-/write-log-file-3.6.0.tgz#b8d5a7efc84fa93cbd67d724d11120343b2a849a" - integrity sha512-OkLK99V6sYXsJsYg+O9wtiFS3z6eUPaiz2e6cXJt80mfIIdI1t2dnmyua0Ib5cZWExQvx2z6Y32Wlf0MnsoNsA== +"@lerna/write-log-file@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@lerna/write-log-file/-/write-log-file-3.13.0.tgz#b78d9e4cfc1349a8be64d91324c4c8199e822a26" + integrity sha512-RibeMnDPvlL8bFYW5C8cs4mbI3AHfQef73tnJCQ/SgrXZHehmHnsyWUiE7qDQCAo+B1RfTapvSyFF69iPj326A== dependencies: - libnpm "^2.0.1" + npmlog "^4.1.2" write-file-atomic "^2.3.0" "@mrmlnc/readdir-enhanced@^2.2.1": @@ -1334,6 +1457,51 @@ resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== +"@octokit/endpoint@^3.2.0": + version "3.2.3" + resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-3.2.3.tgz#bd9aea60cd94ce336656b57a5c9cb7f10be8f4f3" + integrity sha512-yUPCt4vMIOclox13CUxzuKiPJIFo46b/6GhUnUTw5QySczN1L0DtSxgmIZrZV4SAb9EyAqrceoyrWoYVnfF2AA== + dependencies: + deepmerge "3.2.0" + is-plain-object "^2.0.4" + universal-user-agent "^2.0.1" + url-template "^2.0.8" + +"@octokit/plugin-enterprise-rest@^2.1.1": + version "2.2.2" + resolved "https://registry.yarnpkg.com/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-2.2.2.tgz#c0e22067a043e19f96ff9c7832e2a3019f9be75c" + integrity sha512-CTZr64jZYhGWNTDGlSJ2mvIlFsm9OEO3LqWn9I/gmoHI4jRBp4kpHoFYNemG4oA75zUAcmbuWblb7jjP877YZw== + +"@octokit/request@2.4.2": + version "2.4.2" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-2.4.2.tgz#87c36e820dd1e43b1629f4f35c95b00cd456320b" + integrity sha512-lxVlYYvwGbKSHXfbPk5vxEA8w4zHOH1wobado4a9EfsyD3Cbhuhus1w0Ye9Ro0eMubGO8kNy5d+xNFisM3Tvaw== + dependencies: + "@octokit/endpoint" "^3.2.0" + deprecation "^1.0.1" + is-plain-object "^2.0.4" + node-fetch "^2.3.0" + once "^1.4.0" + universal-user-agent "^2.0.1" + +"@octokit/rest@^16.16.0": + version "16.23.1" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-16.23.1.tgz#cbc0bbd78f3990580a64be29309eb3f709d3c762" + integrity sha512-Kwjt6Ue6lgRcc6enQ2O6QLkDtK1yTDJgfjrfyGar5R+fsESVomOTl1D9iq9NNSQMPaDctcpUD8C/HudjYAeoWw== + dependencies: + "@octokit/request" "2.4.2" + atob-lite "^2.0.0" + before-after-hook "^1.4.0" + btoa-lite "^1.0.0" + deprecation "^1.0.1" + lodash.get "^4.4.2" + lodash.set "^4.3.2" + lodash.uniq "^4.5.0" + octokit-pagination-methods "^1.1.0" + once "^1.4.0" + universal-user-agent "^2.0.0" + url-template "^2.0.8" + "@react-native-community/cli@^1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@react-native-community/cli/-/cli-1.2.1.tgz#990b0b0e199e4a75357dfb445eaae13100f60a1b" @@ -1378,11 +1546,12 @@ resolved "https://registry.yarnpkg.com/@react-native-firebase/private-tests-firebase-functions/-/private-tests-firebase-functions-0.0.1.tgz#bbee243641e92a3d50925cb95e95dbcd28f7fc27" integrity sha512-hfz3J6tQlXG7PNfuJLbh486ulN8Q8o8tdiL5TJSXpnEdGZYTqYhka0DFOinU2sr4quxK5O4e6Rsh8tRRcUPrjA== -"@react-native-firebase/private-tests-helpers@^0.0.8": - version "0.0.8" - resolved "https://registry.yarnpkg.com/@react-native-firebase/private-tests-helpers/-/private-tests-helpers-0.0.8.tgz#8bab47fccc3baffee24dad49be2cbabe5a1e289f" - integrity sha512-Xa5dEdCIyK8faHai/wRvSPDso76VIfJiWyJZi+7WhcrLlfLZiCktMe10GvACyXp+h56e8s2boCehodM0s+jK5Q== +"@react-native-firebase/private-tests-helpers@^0.0.9": + version "0.0.9" + resolved "https://registry.yarnpkg.com/@react-native-firebase/private-tests-helpers/-/private-tests-helpers-0.0.9.tgz#d9670b03a5590ef3a05019b2e25d29951d51e7a7" + integrity sha512-XxiM8szJEWBUfmyZXIAd6YaiZtzloEYFEGcE7bUaGU//ocAEbxZGsORaU8oyCswLKMP1HZMF9DZvV4ODVXjtzQ== dependencies: + axios "^0.18.0" execa "^1.0.0" shelljs "^0.8.3" @@ -1393,6 +1562,13 @@ dependencies: any-observable "^0.3.0" +"@sinonjs/commons@^1", "@sinonjs/commons@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.4.0.tgz#7b3ec2d96af481d7a0321252e7b1c94724ec5a78" + integrity sha512-9jHK3YF/8HtJ9wCAbG+j8cD0i0+ATS9A7gXFqS36TblLPNy6rEEc+SB0imo91eCboGaBYGV/MT1/br/J+EE7Tw== + dependencies: + type-detect "4.0.8" + "@sinonjs/commons@^1.0.2": version "1.3.0" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.3.0.tgz#50a2754016b6f30a994ceda6d9a0a8c36adda849" @@ -1407,6 +1583,14 @@ dependencies: "@sinonjs/samsam" "^2 || ^3" +"@sinonjs/formatio@^3.2.1": + version "3.2.1" + resolved "https://registry.yarnpkg.com/@sinonjs/formatio/-/formatio-3.2.1.tgz#52310f2f9bcbc67bdac18c94ad4901b95fde267e" + integrity sha512-tsHvOB24rvyvV2+zKMmPkZ7dXX6LSLKZ7aOtXY6Edklp0uRcgGpOsQTTGTcWViFyx4uhWc6GV8QdnALbIbIdeQ== + dependencies: + "@sinonjs/commons" "^1" + "@sinonjs/samsam" "^3.1.0" + "@sinonjs/samsam@^2 || ^3": version "3.0.2" resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-3.0.2.tgz#304fb33bd5585a0b2df8a4c801fcb47fa84d8e43" @@ -1421,6 +1605,20 @@ resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-2.1.3.tgz#62cf2a9b624edc795134135fe37fc2ae8ea36be3" integrity sha512-8zNeBkSKhU9a5cRNbpCKau2WWPfan+Q2zDlcXvXyhn9EsMqgYs4qzo0XHNVlXC6ABQL8fT6nV+zzo5RTHJzyXw== +"@sinonjs/samsam@^3.1.0", "@sinonjs/samsam@^3.3.1": + version "3.3.1" + resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-3.3.1.tgz#e88c53fbd9d91ad9f0f2b0140c16c7c107fe0d07" + integrity sha512-wRSfmyd81swH0hA1bxJZJ57xr22kC07a1N4zuIL47yTS04bDk6AoCkczcqHEjcRPmJ+FruGJ9WBQiJwMtIElFw== + dependencies: + "@sinonjs/commons" "^1.0.2" + array-from "^2.1.1" + lodash "^4.17.11" + +"@sinonjs/text-encoding@^0.7.1": + version "0.7.1" + resolved "https://registry.yarnpkg.com/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz#8da5c6530915653f3a1f38fd5f101d8c3f8079c5" + integrity sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ== + "@types/events@*": version "1.2.0" resolved "https://registry.yarnpkg.com/@types/events/-/events-1.2.0.tgz#81a6731ce4df43619e5c8c945383b3e62a89ea86" @@ -1480,6 +1678,11 @@ "@types/glob" "*" "@types/node" "*" +"@yarnpkg/lockfile@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" + integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== + JSONStream@^1.0.4, JSONStream@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" @@ -1516,10 +1719,10 @@ acorn-jsx@^5.0.0: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== -acorn@^6.0.2: - version "6.0.5" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.0.5.tgz#81730c0815f3f3b34d8efa95cb7430965f4d887a" - integrity sha512-i33Zgp3XWtmZBMNvCr4azvOFeWVw1Rk6p3hfi3LUDvIFraOMywb1kAtrbi+med14m4Xfpqm3zRZMT+c0FNE7kg== +acorn@^6.0.7: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" + integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA== agent-base@4, agent-base@^4.1.0, agent-base@~4.2.0: version "4.2.1" @@ -1535,7 +1738,7 @@ agentkeepalive@^3.4.1: dependencies: humanize-ms "^1.2.1" -ajv@^6.5.3, ajv@^6.5.5, ajv@^6.6.1: +ajv@^6.5.5: version "6.7.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.7.0.tgz#e3ce7bb372d6577bb1839f1dfdfcbf5ad2948d96" integrity sha512-RZXPviBTtfmtka9n9sy1N5M5b82CbxWIR6HIis4s3WQTXDJamc/0gpCWNGz6EWdWp4DOfjzJfhz/AS9zVPjjWg== @@ -1545,6 +1748,16 @@ ajv@^6.5.3, ajv@^6.5.5, ajv@^6.6.1: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ajv@^6.9.1: + version "6.10.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" + integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + ansi-align@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f" @@ -1552,6 +1765,11 @@ ansi-align@^2.0.0: dependencies: string-width "^2.0.0" +ansi-colors@3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" + integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== + ansi-colors@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-1.1.0.tgz#6374b4dd5d4718ff3ce27a671a3b1cad077132a9" @@ -1605,6 +1823,11 @@ ansi-regex@^4.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.0.0.tgz#70de791edf021404c3fd615aa89118ae0432e5a9" integrity sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w== +ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -1647,12 +1870,12 @@ append-transform@^1.0.0: dependencies: default-require-extensions "^2.0.0" -aproba@^1.0.3, aproba@^1.1.1, aproba@^1.1.2: +aproba@^1.0.3, aproba@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== -"aproba@^1.1.2 || 2", aproba@^2.0.0: +aproba@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== @@ -1859,6 +2082,11 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= +atob-lite@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/atob-lite/-/atob-lite-2.0.0.tgz#0fef5ad46f1bd7a8502c65727f0367d5ee43d696" + integrity sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY= + atob@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" @@ -1882,7 +2110,7 @@ axios@^0.18.0: follow-redirects "^1.3.0" is-buffer "^1.1.5" -axobject-query@^2.0.1: +axobject-query@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.0.2.tgz#ea187abe5b9002b377f925d8bf7d1c561adf38f9" integrity sha512-MCeek8ZH7hKyO1rWUbKNQBbl4l2eY0ntk7OGi+q0RlafrCnfPxC06WZA+uebCfmYp4mNU9jRBP1AhGyf8+W3ww== @@ -1994,22 +2222,16 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" +before-after-hook@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-1.4.0.tgz#2b6bf23dca4f32e628fd2747c10a37c74a4b484d" + integrity sha512-l5r9ir56nda3qu14nAXIlyq1MmUSs0meCIaFAh8HwkFwP1F8eToOuS3ah2VAHHcY04jaYD7FpJC5JTXHYRbkzg== + big-integer@^1.6.7: version "1.6.41" resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.41.tgz#6fb0e51bc8661129ef3832d46c939170b81ca794" integrity sha512-d5AT9lMTYJ/ZE/4gzxb+5ttPcRWljVsvv7lF1w9KzkPhVUhBtHrjDo1J8swfZKepfLsliDhYa31zRYwcD0Yg9w== -bin-links@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/bin-links/-/bin-links-1.1.2.tgz#fb74bd54bae6b7befc6c6221f25322ac830d9757" - integrity sha512-8eEHVgYP03nILphilltWjeIjMbKyJo3wvp9K816pHbhP301ismzw15mxAAEVQ/USUwcP++1uNrbERbp8lOA6Fg== - dependencies: - bluebird "^3.5.0" - cmd-shim "^2.0.2" - gentle-fs "^2.0.0" - graceful-fs "^4.1.11" - write-file-atomic "^2.3.0" - binary-extensions@^1.0.0: version "1.12.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.12.0.tgz#c2d780f53d45bba8317a8902d4ceeaf3a6385b14" @@ -2022,7 +2244,7 @@ block-stream@*: dependencies: inherits "~2.0.0" -bluebird@3.5.x, bluebird@^3.5.0, bluebird@^3.5.1, bluebird@^3.5.3: +bluebird@3.5.x, bluebird@^3.5.1, bluebird@^3.5.3: version "3.5.3" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.3.tgz#7d01c6f9616c9a51ab0f8c549a79dfe6ec33efa7" integrity sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw== @@ -2099,6 +2321,11 @@ bser@^2.0.0: dependencies: node-int64 "^0.4.0" +btoa-lite@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/btoa-lite/-/btoa-lite-1.0.0.tgz#337766da15801210fdd956c22e9c6891ab9d0337" + integrity sha1-M3dm2hWAEhD92VbCLpxokaudAzc= + buffer-crc32@^0.2.13: version "0.2.13" resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" @@ -2187,15 +2414,15 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" -caching-transform@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-2.0.0.tgz#e1292bd92d35b6e8b1ed7075726724b3bd64eea0" - integrity sha512-tTfemGmFWe7KZ3KN6VsSgQZbd9Bgo7A40wlp4PTsJJvFu4YAnEC5YnfdiKq6Vh2i9XJLnA9n8OXD46orVpnPMw== +caching-transform@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-3.0.2.tgz#601d46b91eca87687a281e71cef99791b0efca70" + integrity sha512-Mtgcv3lh3U0zRii/6qVgQODdPA4G3zhG+jtbCWj39RXuUFTMzH0vcdMtaJS1jPowd+It2Pqr6y3NJMQqOqCE2w== dependencies: - make-dir "^1.0.0" - md5-hex "^2.0.0" - package-hash "^2.0.0" - write-file-atomic "^2.0.0" + hasha "^3.0.0" + make-dir "^2.0.0" + package-hash "^3.0.0" + write-file-atomic "^2.4.2" call-me-maybe@^1.0.1: version "1.0.1" @@ -2349,11 +2576,6 @@ ci-info@^2.0.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== -circular-json@^0.3.1: - version "0.3.3" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" - integrity sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A== - class-utils@^0.3.5: version "0.3.6" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" @@ -2425,15 +2647,15 @@ code-point-at@^1.0.0: resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= -codecov@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/codecov/-/codecov-3.1.0.tgz#340bd968d361f256976b5af782dd8ba9f82bc849" - integrity sha512-aWQc/rtHbcWEQLka6WmBAOpV58J2TwyXqlpAQGhQaSiEUoigTTUk6lLd2vB3kXkhnDyzyH74RXfmV4dq2txmdA== +codecov@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/codecov/-/codecov-3.2.0.tgz#4465ee19884528092d8c313e1f9e4bdc7d3065cd" + integrity sha512-3NJvNARXxilqnqVfgzDHyVrF4oeVgaYW1c1O6Oi5mn93exE7HTSSFNiYdwojWW6IwrCZABJ8crpNbKoo9aUHQw== dependencies: argv "^0.0.2" ignore-walk "^3.0.1" js-yaml "^3.12.0" - request "^2.87.0" + teeny-request "^3.7.0" urlgrey "^0.4.4" collection-visit@^1.0.0: @@ -2594,20 +2816,20 @@ contains-path@^0.1.0: resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= -conventional-changelog-angular@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-5.0.2.tgz#39d945635e03b6d0c9d4078b1df74e06163dc66a" - integrity sha512-yx7m7lVrXmt4nKWQgWZqxSALEiAKZhOAcbxdUaU9575mB0CzXVbgrgpfSnSP7OqWDUTYGD0YVJ0MSRdyOPgAwA== +conventional-changelog-angular@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-5.0.3.tgz#299fdd43df5a1f095283ac16aeedfb0a682ecab0" + integrity sha512-YD1xzH7r9yXQte/HF9JBuEDfvjxxwDGGwZU1+ndanbY0oFgA+Po1T9JDSpPLdP0pZT6MhCAsdvFKC4TJ4MTJTA== dependencies: compare-func "^1.3.1" q "^1.5.1" -conventional-changelog-core@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-3.1.5.tgz#c2edf928539308b54fe1b90a2fc731abc021852c" - integrity sha512-iwqAotS4zk0wA4S84YY1JCUG7X3LxaRjJxuUo6GI4dZuIy243j5nOg/Ora35ExT4DOiw5dQbMMQvw2SUjh6moQ== +conventional-changelog-core@^3.1.6: + version "3.1.6" + resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-3.1.6.tgz#ac1731a461c50d150d29c1ad4f33143293bcd32f" + integrity sha512-5teTAZOtJ4HLR6384h50nPAaKdDr+IaU0rnD2Gg2C3MS7hKsEPH8pZxrDNqam9eOSPQg9tET6uZY79zzgSz+ig== dependencies: - conventional-changelog-writer "^4.0.2" + conventional-changelog-writer "^4.0.3" conventional-commits-parser "^3.0.1" dateformat "^3.0.0" get-pkg-repo "^1.0.0" @@ -2626,15 +2848,15 @@ conventional-changelog-preset-loader@^2.0.2: resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.0.2.tgz#81d1a07523913f3d17da3a49f0091f967ad345b0" integrity sha512-pBY+qnUoJPXAXXqVGwQaVmcye05xi6z231QM98wHWamGAmu/ghkBprQAwmF5bdmyobdVxiLhPY3PrCfSeUNzRQ== -conventional-changelog-writer@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.2.tgz#eb493ed84269e7a663da36e49af51c54639c9a67" - integrity sha512-d8/FQY/fix2xXEBUhOo8u3DCbyEw3UOQgYHxLsPDw+wHUDma/GQGAGsGtoH876WyNs32fViHmTOUrgRKVLvBug== +conventional-changelog-writer@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.3.tgz#916a2b302d0bb5ef18efd236a034c13fb273cde1" + integrity sha512-bIlpSiQtQZ1+nDVHEEh798Erj2jhN/wEjyw9sfxY9es6h7pREE5BNJjfv0hXGH/FTrAsEpHUq4xzK99eePpwuA== dependencies: compare-func "^1.3.1" conventional-commits-filter "^2.0.1" dateformat "^3.0.0" - handlebars "^4.0.2" + handlebars "^4.1.0" json-stringify-safe "^5.0.1" lodash "^4.2.1" meow "^4.0.0" @@ -2716,15 +2938,6 @@ core-util-is@1.0.2, core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= -cosmiconfig@5.0.6: - version "5.0.6" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.0.6.tgz#dca6cf680a0bd03589aff684700858c81abeeb39" - integrity sha512-6DWfizHriCrFWURP1/qyhsiFvYdlJzbCzmtFWh744+KyWsJo5+kPzUZZaMRSSItoYc0pxFX7gEO7ZC1/gN/7AQ== - dependencies: - is-directory "^0.3.1" - js-yaml "^3.9.0" - parse-json "^4.0.0" - cosmiconfig@^5.0.2, cosmiconfig@^5.0.5, cosmiconfig@^5.0.7: version "5.0.7" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.0.7.tgz#39826b292ee0d78eda137dfa3173bd1c21a43b04" @@ -2735,6 +2948,16 @@ cosmiconfig@^5.0.2, cosmiconfig@^5.0.5, cosmiconfig@^5.0.7: js-yaml "^3.9.0" parse-json "^4.0.0" +cosmiconfig@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.0.tgz#45038e4d28a7fe787203aede9c25bca4a08b12c8" + integrity sha512-nxt+Nfc3JAqf4WIWd0jXLjTJZmsPLrA9DDc4nRw2KFJQJK7DNooqSXrNI7tzLG50CF8axczly5UV929tBmh/7g== + dependencies: + import-fresh "^2.0.0" + is-directory "^0.3.1" + js-yaml "^3.13.0" + parse-json "^4.0.0" + create-error-class@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" @@ -2825,11 +3048,6 @@ dateformat@^3.0.0: resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== -debug-log@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" - integrity sha1-IwdjLUwEOCuN+KMvcLiVBG1SdF8= - debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -2844,14 +3062,14 @@ debug@3.1.0, debug@=3.1.0: dependencies: ms "2.0.0" -debug@^3.1.0: +debug@3.2.6, debug@^3.1.0: version "3.2.6" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== dependencies: ms "^2.1.1" -debug@^4.0.1, debug@^4.1.0: +debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== @@ -2896,6 +3114,11 @@ deep-is@~0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= +deepmerge@3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-3.2.0.tgz#58ef463a57c08d376547f8869fdc5bcee957f44e" + integrity sha512-6+LuZGU7QCNUnAJyX8cIrlzoEgggTM6B7mm+znKOX4t5ltluT9KLjN6g61ECMS0LTsLW7yDpNoxhix5FZcrIow== + default-require-extensions@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-2.0.0.tgz#f5f8fbb18a7d6d50b21f641f649ebb522cfe24f7" @@ -2971,11 +3194,21 @@ depd@~1.1.2: resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= +deprecation@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-1.0.1.tgz#2df79b79005752180816b7b6e079cbd80490d711" + integrity sha512-ccVHpE72+tcIKaGMql33x5MAjKQIZrk+3x2GbJ7TeraUCZWHoT+KSZpoC+JQFsUBlSTXUrBaGiF0j6zVTepPLg== + destroy@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= +detect-file@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" + integrity sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc= + detect-indent@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" @@ -2986,15 +3219,15 @@ detect-libc@^1.0.2: resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= -detox@10.0.13: - version "10.0.13" - resolved "https://registry.yarnpkg.com/detox/-/detox-10.0.13.tgz#1b5030c8e7b16437cf472a5cf74eff6dea5e89f8" - integrity sha512-kVNSppMUnOeJcPqMwE+7k5wuYgAbFQLFwxiLGBCEWtkbenlAFBe7NkkwCgJVJxkdj74ujtzLuZDEVmYLxn4Qsw== +detox@12.5.0: + version "12.5.0" + resolved "https://registry.yarnpkg.com/detox/-/detox-12.5.0.tgz#eed11a2cfd701874534a3e6378e1195ebcb37ac0" + integrity sha512-QIEUj/l3GQDqzVRmRk/iiSvSey/Qam/nyV19Xc3zH23CCqWSEtdsJRmg6812uxA2ohxr4pwER7x6hb2KUYl6lA== dependencies: bunyan "^1.8.12" bunyan-debug-stream "^1.1.0" + chalk "^2.4.2" child-process-promise "^2.2.0" - commander "^2.15.1" fs-extra "^4.0.2" get-port "^2.1.0" ini "^1.3.4" @@ -3003,10 +3236,12 @@ detox@10.0.13: proper-lockfile "^3.0.2" sanitize-filename "^1.6.1" shell-utils "^1.0.9" - tail "^1.2.3" + tail "^2.0.0" telnet-client "0.15.3" tempfile "^2.0.0" ws "^1.1.1" + yargs "^13.0.0" + yargs-parser "^13.0.0" detox@^9.0.1: version "9.1.2" @@ -3074,6 +3309,13 @@ doctrine@^2.1.0: dependencies: esutils "^2.0.2" +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + dom-walk@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018" @@ -3138,10 +3380,10 @@ elegant-spinner@^1.0.1: resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" integrity sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4= -emoji-regex@^6.5.1: - version "6.5.1" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.5.1.tgz#9baea929b155565c11ea41c6626eaa65cef992c2" - integrity sha512-PAHp6TxrCy7MGMFidro8uikr+zlJJKJ/Q6mm2ExZ7HwkyR9lSVFfE3kt36qcwa24BQL7y0G9axycGjK1A/0uNQ== +emoji-regex@^7.0.1, emoji-regex@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== encodeurl@~1.0.1, encodeurl@~1.0.2: version "1.0.2" @@ -3194,7 +3436,7 @@ errorhandler@^1.5.0: accepts "~1.3.3" escape-html "~1.0.3" -es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.7.0: +es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.5.1, es-abstract@^1.7.0: version "1.13.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== @@ -3260,10 +3502,10 @@ eslint-config-airbnb@^17.1.0: object.assign "^4.1.0" object.entries "^1.0.4" -eslint-config-prettier@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-3.6.0.tgz#8ca3ffac4bd6eeef623a0651f9d754900e3ec217" - integrity sha512-ixJ4U3uTLXwJts4rmSVW/lMXjlGwCijhBJHk8iVqKKSifeI0qgFEfWl8L63isfc8Od7EiBALF6BX3jKLluf/jQ== +eslint-config-prettier@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-4.1.0.tgz#181364895899fff9fd3605fecb5c4f20e7d5f395" + integrity sha512-zILwX9/Ocz4SV2vX7ox85AsrAgXV3f2o2gpIicdMIOra48WYqgUnWNH/cR/iHtmD2Vb3dLSC3LiEJnS05Gkw7w== dependencies: get-stdin "^6.0.0" @@ -3283,17 +3525,17 @@ eslint-module-utils@^2.3.0: debug "^2.6.8" pkg-dir "^2.0.0" -eslint-plugin-flowtype@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.2.1.tgz#45e032aee54e695dfc41a891e92b7afedfc62c77" - integrity sha512-1lymqM8Cawxu5xsS8TaCrLWJYUmUdoG4hCfa7yWOhCf0qZn/CvI8FxqkhdOP6bAosBn5zeYxKe3Q/4rfKN8a+A== +eslint-plugin-flowtype@^3.4.2: + version "3.4.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.4.2.tgz#55475e10b05fd714d60bceebbbed596cb8706b16" + integrity sha512-sv6O6fiN3dIwhU4qRxfcyIpbKGVvsxwIQ6vgBLudpQKjH1rEyEFEOjGzGEUBTQP9J8LdTZm37OjiqZ0ZeFOa6g== dependencies: - lodash "^4.17.10" + lodash "^4.17.11" -eslint-plugin-import@^2.14.0: - version "2.15.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.15.0.tgz#d8f3c28b8988ccde5df964706faa7c1e52f0602a" - integrity sha512-LEHqgR+RcnpGqYW7h9WMkPb/tP+ekKxWdQDztfTtZeV43IHF+X8lXU+1HOCcR4oXD24qRgEwNSxIweD5uNKGVg== +eslint-plugin-import@^2.16.0: + version "2.16.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.16.0.tgz#97ac3e75d0791c4fac0e15ef388510217be7f66f" + integrity sha512-z6oqWlf1x5GkHIFgrSvtmudnqM6Q60KM4KvpWi5ubonMjycLjndvd5+8VAZIsTlHC03djdgJuyKG6XO577px6A== dependencies: contains-path "^0.1.0" debug "^2.6.9" @@ -3306,17 +3548,17 @@ eslint-plugin-import@^2.14.0: read-pkg-up "^2.0.0" resolve "^1.9.0" -eslint-plugin-jsx-a11y@^6.1.2: - version "6.1.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.1.2.tgz#69bca4890b36dcf0fe16dd2129d2d88b98f33f88" - integrity sha512-7gSSmwb3A+fQwtw0arguwMdOdzmKUgnUcbSNlo+GjKLAQFuC2EZxWqG9XHRI8VscBJD5a8raz3RuxQNFW+XJbw== +eslint-plugin-jsx-a11y@^6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.2.1.tgz#4ebba9f339b600ff415ae4166e3e2e008831cf0c" + integrity sha512-cjN2ObWrRz0TTw7vEcGQrx+YltMvZoOEx4hWU8eEERDnBIU00OTq7Vr+jA7DFKxiwLNv4tTh5Pq2GUNEa8b6+w== dependencies: aria-query "^3.0.0" array-includes "^3.0.3" ast-types-flow "^0.0.7" - axobject-query "^2.0.1" + axobject-query "^2.0.2" damerau-levenshtein "^1.0.4" - emoji-regex "^6.5.1" + emoji-regex "^7.0.2" has "^1.0.3" jsx-ast-utils "^2.0.1" @@ -3335,7 +3577,7 @@ eslint-plugin-prettier@^3.0.1: dependencies: prettier-linter-helpers "^1.0.0" -eslint-plugin-react@^7.11.1: +eslint-plugin-react@^7.12.4: version "7.12.4" resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.12.4.tgz#b1ecf26479d61aee650da612e425c53a99f48c8c" integrity sha512-1puHJkXJY+oS1t467MjbqjvX53uQ05HXwjqDgdbGBqf5j9eeydI54G3KwiJmWciQ0HTBacIKw2jgwSBSH3yfgQ== @@ -3361,10 +3603,10 @@ eslint-scope@3.7.1: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-scope@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.0.tgz#50bf3071e9338bcdc43331794a0cb533f0136172" - integrity sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA== +eslint-scope@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" + integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== dependencies: esrecurse "^4.1.0" estraverse "^4.1.1" @@ -3379,55 +3621,54 @@ eslint-visitor-keys@^1.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== -eslint@^5.12.1: - version "5.12.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.12.1.tgz#5ca9931fb9029d04e7be92b03ce3b58edfac7e3b" - integrity sha512-54NV+JkTpTu0d8+UYSA8mMKAG4XAsaOrozA9rCW7tgneg1mevcL7wIotPC+fZ0SkWwdhNqoXoxnQCTBp7UvTsg== +eslint@^5.16.0: + version "5.16.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" + integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== dependencies: "@babel/code-frame" "^7.0.0" - ajv "^6.5.3" + ajv "^6.9.1" chalk "^2.1.0" cross-spawn "^6.0.5" debug "^4.0.1" - doctrine "^2.1.0" - eslint-scope "^4.0.0" + doctrine "^3.0.0" + eslint-scope "^4.0.3" eslint-utils "^1.3.1" eslint-visitor-keys "^1.0.0" - espree "^5.0.0" + espree "^5.0.1" esquery "^1.0.1" esutils "^2.0.2" - file-entry-cache "^2.0.0" + file-entry-cache "^5.0.1" functional-red-black-tree "^1.0.1" glob "^7.1.2" globals "^11.7.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^6.1.0" - js-yaml "^3.12.0" + inquirer "^6.2.2" + js-yaml "^3.13.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.3.0" - lodash "^4.17.5" + lodash "^4.17.11" minimatch "^3.0.4" mkdirp "^0.5.1" natural-compare "^1.4.0" optionator "^0.8.2" path-is-inside "^1.0.2" - pluralize "^7.0.0" progress "^2.0.0" regexpp "^2.0.1" semver "^5.5.1" strip-ansi "^4.0.0" strip-json-comments "^2.0.1" - table "^5.0.2" + table "^5.2.3" text-table "^0.2.0" -espree@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.0.tgz#fc7f984b62b36a0f543b13fb9cd7b9f4a7f5b65c" - integrity sha512-1MpUfwsdS9MMoN7ZXqAr9e9UKdVHDcvrJpyx7mm1WuQlx/ygErEQBzgi5Nh5qBHIoYweprhtMkTCb9GhcAIcsA== +espree@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" + integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== dependencies: - acorn "^6.0.2" + acorn "^6.0.7" acorn-jsx "^5.0.0" eslint-visitor-keys "^1.0.0" @@ -3494,6 +3735,19 @@ exec-sh@^0.2.0: dependencies: merge "^1.2.0" +execa@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.10.0.tgz#ff456a8f53f90f8eccc71a96d11bdfc7f082cb50" + integrity sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw== + dependencies: + cross-spawn "^6.0.0" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + execa@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" @@ -3547,6 +3801,13 @@ expand-range@^1.8.1: dependencies: fill-range "^2.1.0" +expand-tilde@^2.0.0, expand-tilde@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502" + integrity sha1-l+gBqgUt8CRU3kawK/YhZCzchQI= + dependencies: + homedir-polyfill "^1.0.1" + extend-shallow@^1.1.2: version "1.1.4" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-1.1.4.tgz#19d6bf94dfc09d76ba711f39b872d21ff4dd9071" @@ -3740,13 +4001,12 @@ figures@^2.0.0: dependencies: escape-string-regexp "^1.0.5" -file-entry-cache@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" - integrity sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E= +file-entry-cache@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" + integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== dependencies: - flat-cache "^1.2.1" - object-assign "^4.0.1" + flat-cache "^2.0.1" filename-regex@^2.0.0: version "2.0.1" @@ -3805,11 +4065,6 @@ find-cache-dir@^2.0.0: make-dir "^1.0.0" pkg-dir "^3.0.0" -find-npm-prefix@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/find-npm-prefix/-/find-npm-prefix-1.0.2.tgz#8d8ce2c78b3b4b9e66c8acc6a37c231eb841cfdf" - integrity sha512-KEftzJ+H90x6pcKtdXZEPsQse8/y/UnvzRKrOSQFprnrGaFuJ62fVkP34Iu2IYuMvyauCyoLTNkJZgrrGA2wkA== - find-package@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/find-package/-/find-package-1.0.0.tgz#d7738da67e3c5f055c24d3e19aa1aeed063c3e83" @@ -3844,25 +4099,54 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" +find-yarn-workspace-root@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-1.2.1.tgz#40eb8e6e7c2502ddfaa2577c176f221422f860db" + integrity sha512-dVtfb0WuQG+8Ag2uWkbG79hOUzEsRrhBzgfn86g2sJPkzmcpGdghbNTfUKGTxymFrY/tLIodDzLoW9nOJ4FY8Q== + dependencies: + fs-extra "^4.0.3" + micromatch "^3.1.4" + +findup-sync@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-2.0.0.tgz#9326b1488c22d1a6088650a86901b2d9a90a2cbc" + integrity sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw= + dependencies: + detect-file "^1.0.0" + is-glob "^3.1.0" + micromatch "^3.0.4" + resolve-dir "^1.0.1" + firstline@^1.2.1: version "1.3.1" resolved "https://registry.yarnpkg.com/firstline/-/firstline-1.3.1.tgz#59e84af0fd858fbc6dac0a0ff97fd22a47e58084" integrity sha512-ycwgqtoxujz1dm0kjkBFOPQMESxB9uKc/PlD951dQDIG+tBXRpYZC2UmJb0gDxopQ1ZX6oyRQN3goRczYu7Deg== -flat-cache@^1.2.1: - version "1.3.4" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.4.tgz#2c2ef77525cc2929007dfffa1dd314aa9c9dee6f" - integrity sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg== +flat-cache@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" + integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== dependencies: - circular-json "^0.3.1" - graceful-fs "^4.1.2" - rimraf "~2.6.2" - write "^0.2.1" + flatted "^2.0.0" + rimraf "2.6.3" + write "1.0.3" -flow-bin@^0.93.0: - version "0.93.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.93.0.tgz#9192a08d88db2a8da0ff55e42420f44539791430" - integrity sha512-p8yq4ocOlpyJgOEBEj0v0GzCP25c9WP0ilFQ8hXSbrTR7RPKuR+Whr+OitlVyp8ocdX0j1MrIwQ8x28dacy1pg== +flat@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.0.tgz#090bec8b05e39cba309747f1d588f04dbaf98db2" + integrity sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw== + dependencies: + is-buffer "~2.0.3" + +flatted@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" + integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== + +flow-bin@^0.96.0: + version "0.96.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.96.0.tgz#3b0379d97304dc1879ae6db627cd2d6819998661" + integrity sha512-OSxERs0EdhVxEVCst/HmlT/RcnXsQQIRqcfK9J9wC8/93JQj+xQz4RtlsmYe1PSRYaozuDLyPS5pIA81Zwzaww== flush-write-stream@^1.0.0: version "1.0.3" @@ -3872,6 +4156,11 @@ flush-write-stream@^1.0.0: inherits "^2.0.1" readable-stream "^2.0.4" +fn-name@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fn-name/-/fn-name-2.0.1.tgz#5214d7537a4d06a4a301c0cc262feb84188002e7" + integrity sha1-UhTXU3pNBqSjAcDMJi/rhBiAAuc= + follow-redirects@^1.3.0: version "1.6.1" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.6.1.tgz#514973c44b5757368bad8bddfe52f81f015c94cb" @@ -3942,7 +4231,7 @@ fs-extra@^1.0.0: jsonfile "^2.1.0" klaw "^1.0.0" -fs-extra@^4.0.1, fs-extra@^4.0.2: +fs-extra@^4.0.2, fs-extra@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg== @@ -3951,7 +4240,7 @@ fs-extra@^4.0.1, fs-extra@^4.0.2: jsonfile "^4.0.0" universalify "^0.1.0" -fs-extra@^7.0.0: +fs-extra@^7.0.0, fs-extra@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== @@ -3972,15 +4261,6 @@ fs-readdir-recursive@^1.1.0: resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" integrity sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA== -fs-vacuum@^1.2.10: - version "1.2.10" - resolved "https://registry.yarnpkg.com/fs-vacuum/-/fs-vacuum-1.2.10.tgz#b7629bec07a4031a2548fdf99f5ecf1cc8b31e36" - integrity sha1-t2Kb7AekAxolSP35n17PHMizHjY= - dependencies: - graceful-fs "^4.1.2" - path-is-inside "^1.0.1" - rimraf "^2.5.2" - fs-write-stream-atomic@^1.0.8: version "1.0.10" resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" @@ -4063,20 +4343,6 @@ genfun@^5.0.0: resolved "https://registry.yarnpkg.com/genfun/-/genfun-5.0.0.tgz#9dd9710a06900a5c4a5bf57aca5da4e52fe76537" integrity sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA== -gentle-fs@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/gentle-fs/-/gentle-fs-2.0.1.tgz#585cfd612bfc5cd52471fdb42537f016a5ce3687" - integrity sha512-cEng5+3fuARewXktTEGbwsktcldA+YsnUEaXZwcK/3pjSE1X9ObnTs+/8rYf8s+RnIcQm2D5x3rwpN7Zom8Bew== - dependencies: - aproba "^1.1.2" - fs-vacuum "^1.2.10" - graceful-fs "^4.1.11" - iferr "^0.1.5" - mkdirp "^0.5.1" - path-is-inside "^1.0.2" - read-cmd-shim "^1.0.1" - slide "^1.1.6" - genversion@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/genversion/-/genversion-2.1.1.tgz#ab2e782148893e258273a01579ed3ac443012ce0" @@ -4097,6 +4363,11 @@ get-caller-file@^2.0.0: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.1.tgz#25835260d3a2b9665fcdbb08cb039a7bbf7011c0" integrity sha512-SpOZHfz845AH0wJYVuZk2jWDqFmu7Xubsx+ldIpwzy5pDUpu7OJHK7QYNSA2NPlDSKQwM1GFaAkciOWjjW92Sg== +get-caller-file@^2.0.1: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + get-own-enumerable-property-symbols@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.0.tgz#b877b49a5c16aefac3655f2ed2ea5b684df8d203" @@ -4186,6 +4457,21 @@ git-semver-tags@^2.0.2: meow "^4.0.0" semver "^5.5.0" +git-up@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/git-up/-/git-up-4.0.1.tgz#cb2ef086653640e721d2042fe3104857d89007c0" + integrity sha512-LFTZZrBlrCrGCG07/dm1aCjjpL1z9L3+5aEeI9SBhAqSc+kiA9Or1bgZhQFNppJX6h/f5McrvJt1mQXTFm6Qrw== + dependencies: + is-ssh "^1.3.0" + parse-url "^5.0.0" + +git-url-parse@^11.1.2: + version "11.1.2" + resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-11.1.2.tgz#aff1a897c36cc93699270587bea3dbcbbb95de67" + integrity sha512-gZeLVGY8QVKMIkckncX+iCq2/L8PlwncvDFKiWkBn9EtCfYDbliRTTp6qzyQ1VMdITUfq7293zDzfpjdiGASSQ== + dependencies: + git-up "^4.0.0" + gitconfiglocal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz#41d045f3851a5ea88f03f24ca1c6178114464b9b" @@ -4233,18 +4519,7 @@ glob@7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^6.0.1: - version "6.0.4" - resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" - integrity sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI= - dependencies: - inflight "^1.0.4" - inherits "2" - minimatch "2 || 3" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.0.0, glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: +glob@7.1.3, glob@^7.0.0, glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== @@ -4256,6 +4531,17 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^6.0.1: + version "6.0.4" + resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" + integrity sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI= + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "2 || 3" + once "^1.3.0" + path-is-absolute "^1.0.0" + global-dirs@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" @@ -4263,6 +4549,26 @@ global-dirs@^0.1.0: dependencies: ini "^1.3.4" +global-modules@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" + integrity sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg== + dependencies: + global-prefix "^1.0.1" + is-windows "^1.0.1" + resolve-dir "^1.0.0" + +global-prefix@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-1.0.2.tgz#dbf743c6c14992593c655568cb66ed32c0122ebe" + integrity sha1-2/dDxsFJklk8ZVVoy2btMsASLr4= + dependencies: + expand-tilde "^2.0.2" + homedir-polyfill "^1.0.1" + ini "^1.3.4" + is-windows "^1.0.1" + which "^1.2.14" + global@^4.3.0: version "4.3.2" resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f" @@ -4332,7 +4638,7 @@ growly@^1.3.0: resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= -handlebars@^4.0.11, handlebars@^4.0.2, handlebars@^4.0.6: +handlebars@^4.0.6: version "4.0.12" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.12.tgz#2c15c8a96d46da5e266700518ba8cb8d919d5bc5" integrity sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA== @@ -4343,6 +4649,17 @@ handlebars@^4.0.11, handlebars@^4.0.2, handlebars@^4.0.6: optionalDependencies: uglify-js "^3.1.4" +handlebars@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.1.tgz#6e4e41c18ebe7719ae4d38e5aca3d32fa3dd23d3" + integrity sha512-3Zhi6C0euYZL5sM0Zcy7lInLXKQ+YLcF/olbN010mzGQ4XVm50JeyBnMqofHh696GrciGruC7kCcApPDJvVgwA== + dependencies: + neo-async "^2.6.0" + optimist "^0.6.1" + source-map "^0.6.1" + optionalDependencies: + uglify-js "^3.1.4" + har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" @@ -4416,11 +4733,23 @@ has@^1.0.1, has@^1.0.3: dependencies: function-bind "^1.1.1" +hasha@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/hasha/-/hasha-3.0.0.tgz#52a32fab8569d41ca69a61ff1a214f8eb7c8bd39" + integrity sha1-UqMvq4Vp1BymmmH/GiFPjrfIvTk= + dependencies: + is-stream "^1.0.1" + he@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= +he@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + highlight.js@^9.13.1: version "9.13.1" resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.13.1.tgz#054586d53a6863311168488a0f58d6c505ce641e" @@ -4431,6 +4760,13 @@ home-or-tmp@^3.0.0: resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-3.0.0.tgz#57a8fe24cf33cdd524860a15821ddc25c86671fb" integrity sha1-V6j+JM8zzdUkhgoVgh3cJchmcfs= +homedir-polyfill@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8" + integrity sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA== + dependencies: + parse-passwd "^1.0.0" + hosted-git-info@^2.1.4, hosted-git-info@^2.6.0: version "2.7.1" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" @@ -4483,7 +4819,7 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" -husky@^1.2.1: +husky@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/husky/-/husky-1.3.1.tgz#26823e399300388ca2afff11cfa8a86b0033fae0" integrity sha512-86U6sVVVf4b5NYSZ0yvv88dRgBSSXXmHaiq5pP4KDj5JVzdwKgBjEtUPOm8hcoytezFwbU+7gotXNhpHdystlg== @@ -4592,7 +4928,7 @@ inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, i resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= -ini@^1.3.2, ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: +ini@^1.3.2, ini@^1.3.4, ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== @@ -4631,7 +4967,7 @@ inquirer@^3.0.6: strip-ansi "^4.0.0" through "^2.3.6" -inquirer@^6.1.0, inquirer@^6.2.0: +inquirer@^6.2.0: version "6.2.1" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.1.tgz#9943fc4882161bdb0b0c9276769c75b32dbfcd52" integrity sha512-088kl3DRT2dLU5riVMKKr1DlImd6X7smDhpXUCkJDCKvTEJeRiXh0G132HG9u5a+6Ylw9plFRY7RuTnwohYSpg== @@ -4732,6 +5068,11 @@ is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== +is-buffer@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725" + integrity sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw== + is-builtin-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" @@ -4986,6 +5327,13 @@ is-retry-allowed@^1.0.0: resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" integrity sha1-EaBgVotnM5REAz0BJaYaINVk+zQ= +is-ssh@^1.3.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/is-ssh/-/is-ssh-1.3.1.tgz#f349a8cadd24e65298037a522cf7520f2e81a0f3" + integrity sha512-0eRIASHZt1E68/ixClI8bp2YK2wmBPVWEismTs6M+M099jKgrzl/3E976zIbImSIob48N2/XGe9y7ZiYdImSlg== + dependencies: + protocols "^1.1.0" + is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -5020,7 +5368,7 @@ is-utf8@^0.2.0: resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= -is-windows@^1.0.2: +is-windows@^1.0.1, is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== @@ -5075,10 +5423,15 @@ istanbul-lib-coverage@^2.0.1: resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#2aee0e073ad8c5f6a0b00e0dfbf52b4667472eda" integrity sha512-nPvSZsVlbG9aLhZYaC3Oi1gT/tpyo3Yt5fNyf6NmcKIayz4VV/txxJFFKAK/gU4dcNn8ehsanBbVHVl0+amOLA== -istanbul-lib-hook@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-2.0.1.tgz#918a57b75a0f951d552a08487ca1fa5336433d72" - integrity sha512-ufiZoiJ8CxY577JJWEeFuxXZoMqiKpq/RqZtOAYuQLvlkbJWscq9n3gc4xrCGH9n4pW0qnTxOz1oyMmVtk8E1w== +istanbul-lib-coverage@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#0b891e5ad42312c2b9488554f603795f9a2211ba" + integrity sha512-dKWuzRGCs4G+67VfW9pBFFz2Jpi4vSp/k7zBcJ888ofV5Mi1g5CUML5GvMvV6u9Cjybftu+E8Cgp+k0dI1E5lw== + +istanbul-lib-hook@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-2.0.3.tgz#e0e581e461c611be5d0e5ef31c5f0109759916fb" + integrity sha512-CLmEqwEhuCYtGcpNVJjLV1DQyVnIqavMLFHV/DP+np/g3qvdxu3gsPqYoJMXm15sN84xOlckFB3VNvRbf5yEgA== dependencies: append-transform "^1.0.0" @@ -5095,43 +5448,51 @@ istanbul-lib-instrument@^3.0.0: istanbul-lib-coverage "^2.0.1" semver "^5.5.0" -istanbul-lib-report@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.2.tgz#430a2598519113e1da7af274ba861bd42dd97535" - integrity sha512-rJ8uR3peeIrwAxoDEbK4dJ7cqqtxBisZKCuwkMtMv0xYzaAnsAi3AHrHPAAtNXzG/bcCgZZ3OJVqm1DTi9ap2Q== +istanbul-lib-instrument@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.1.0.tgz#a2b5484a7d445f1f311e93190813fa56dfb62971" + integrity sha512-ooVllVGT38HIk8MxDj/OIHXSYvH+1tq/Vb38s8ixt9GoJadXska4WkGY+0wkmtYCZNYtaARniH/DixUGGLZ0uA== dependencies: - istanbul-lib-coverage "^2.0.1" - make-dir "^1.3.0" - supports-color "^5.4.0" + "@babel/generator" "^7.0.0" + "@babel/parser" "^7.0.0" + "@babel/template" "^7.0.0" + "@babel/traverse" "^7.0.0" + "@babel/types" "^7.0.0" + istanbul-lib-coverage "^2.0.3" + semver "^5.5.0" -istanbul-lib-source-maps@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-2.0.1.tgz#ce8b45131d8293fdeaa732f4faf1852d13d0a97e" - integrity sha512-30l40ySg+gvBLcxTrLzR4Z2XTRj3HgRCA/p2rnbs/3OiTaoj054gAbuP5DcLOtwqmy4XW8qXBHzrmP2/bQ9i3A== +istanbul-lib-report@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.4.tgz#bfd324ee0c04f59119cb4f07dab157d09f24d7e4" + integrity sha512-sOiLZLAWpA0+3b5w5/dq0cjm2rrNdAfHWaGhmn7XEFW6X++IV9Ohn+pnELAl9K3rfpaeBfbmH9JU5sejacdLeA== dependencies: - debug "^3.1.0" - istanbul-lib-coverage "^2.0.1" + istanbul-lib-coverage "^2.0.3" + make-dir "^1.3.0" + supports-color "^6.0.0" + +istanbul-lib-source-maps@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.2.tgz#f1e817229a9146e8424a28e5d69ba220fda34156" + integrity sha512-JX4v0CiKTGp9fZPmoxpu9YEkPbEqCqBbO3403VabKjH+NRXo72HafD5UgnjTEqHL2SAjaZK1XDuDOkn6I5QVfQ== + dependencies: + debug "^4.1.1" + istanbul-lib-coverage "^2.0.3" make-dir "^1.3.0" rimraf "^2.6.2" source-map "^0.6.1" -istanbul-reports@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.0.1.tgz#fb8d6ea850701a3984350b977a969e9a556116a7" - integrity sha512-CT0QgMBJqs6NJLF678ZHcquUAZIoBIUNzdJrRJfpkI9OnzG6MkUfHxbJC3ln981dMswC7/B1mfX3LNkhgJxsuw== +istanbul-reports@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.1.1.tgz#72ef16b4ecb9a4a7bd0e2001e00f95d1eec8afa9" + integrity sha512-FzNahnidyEPBCI0HcufJoSEoKykesRlFcSzQqjH9x0+LC8tnnE/p/90PBLu8iZTxr8yYZNyTtiAujUqyN+CIxw== dependencies: - handlebars "^4.0.11" + handlebars "^4.1.0" jest-docblock@^21.0.0: version "21.2.0" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414" integrity sha512-5IZ7sY9dBAYSV+YjQ0Ovb540Ku7AO9Z5o2Cg789xj167iQuZ2cG+z0f3Uct6WeYLbU6aQiM2pCs7sZ+4dotydw== -jest-get-type@^22.1.0: - version "22.4.3" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.4.3.tgz#e3a8504d8479342dd4420236b322869f18900ce4" - integrity sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w== - jest-haste-map@24.0.0-alpha.6: version "24.0.0-alpha.6" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.0.0-alpha.6.tgz#fb2c785080f391b923db51846b86840d0d773076" @@ -5155,16 +5516,6 @@ jest-serializer@^24.0.0-alpha.6: resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.0.0-alpha.12.tgz#44478e6256f9e2b76a24cd56ba49923e33fe5522" integrity sha512-7Cfomo8PLwRcbFmOEXPAokb0+lCkmFUKOjP+XUvRz31JoLhrR+Ty5+CHjwZmtHBssdbAuK28lwMWX/XId9HhNw== -jest-validate@^23.5.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.6.0.tgz#36761f99d1ed33fcd425b4e4c5595d62b6597474" - integrity sha512-OFKapYxe72yz7agrDAWi8v2WL8GIfVqcbKRCLbRG9PAxtzF9b1SEDdTpytNDN12z2fJynoBwpMpvj2R39plI2A== - dependencies: - chalk "^2.0.1" - jest-get-type "^22.1.0" - leven "^2.1.0" - pretty-format "^23.6.0" - jest-worker@24.0.0-alpha.6: version "24.0.0-alpha.6" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.0.0-alpha.6.tgz#463681b92c117c57107135c14b9b9d6cd51d80ce" @@ -5208,7 +5559,15 @@ js-tokens@^3.0.2: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= -js-yaml@^3.12.0, js-yaml@^3.7.0, js-yaml@^3.9.0: +js-yaml@3.12.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" + integrity sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +js-yaml@^3.12.0, js-yaml@^3.9.0: version "3.12.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.1.tgz#295c8632a18a23e054cf5c9d3cecafe678167600" integrity sha512-um46hB9wNOKlwkHgiuyEVAybXBjwFUV0Z/RaHJblRd9DXltue9FTYvzCr9ErQrK9Adz5MU4gHWVaNUfdmrC8qA== @@ -5216,6 +5575,14 @@ js-yaml@^3.12.0, js-yaml@^3.7.0, js-yaml@^3.9.0: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^3.13.0: + version "3.13.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.0.tgz#38ee7178ac0eea2c97ff6d96fff4b18c7d8cf98e" + integrity sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" @@ -5345,6 +5712,13 @@ kind-of@^6.0.0, kind-of@^6.0.2: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== +klaw-sync@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c" + integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ== + dependencies: + graceful-fs "^4.1.11" + klaw@^1.0.0: version "1.3.1" resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" @@ -5373,33 +5747,28 @@ lcid@^2.0.0: dependencies: invert-kv "^2.0.0" -lerna@^3.6.0: - version "3.10.7" - resolved "https://registry.yarnpkg.com/lerna/-/lerna-3.10.7.tgz#9d308b1fee1697f89fe90e6bc37e51c03b531557" - integrity sha512-ha/dehl/L3Nw0pbdir5z6Hrv2oYBg5ym2fTcuk8HCLe7Zdb/ylIHdrgW8CU9eTVZkwr4et8RdVtxFA/+xa65/Q== +lerna@^3.13.1: + version "3.13.1" + resolved "https://registry.yarnpkg.com/lerna/-/lerna-3.13.1.tgz#feaff562176f304bd82329ca29ce46ab6c033463" + integrity sha512-7kSz8LLozVsoUNTJzJzy+b8TnV9YdviR2Ee2PwGZSlVw3T1Rn7kOAPZjEi+3IWnOPC96zMPHVmjCmzQ4uubalw== dependencies: - "@lerna/add" "3.10.6" - "@lerna/bootstrap" "3.10.6" - "@lerna/changed" "3.10.6" - "@lerna/clean" "3.10.6" - "@lerna/cli" "3.10.7" - "@lerna/create" "3.10.6" - "@lerna/diff" "3.10.6" - "@lerna/exec" "3.10.6" - "@lerna/import" "3.10.6" - "@lerna/init" "3.10.6" - "@lerna/link" "3.10.6" - "@lerna/list" "3.10.6" - "@lerna/publish" "3.10.7" - "@lerna/run" "3.10.6" - "@lerna/version" "3.10.6" + "@lerna/add" "3.13.1" + "@lerna/bootstrap" "3.13.1" + "@lerna/changed" "3.13.1" + "@lerna/clean" "3.13.1" + "@lerna/cli" "3.13.0" + "@lerna/create" "3.13.1" + "@lerna/diff" "3.13.1" + "@lerna/exec" "3.13.1" + "@lerna/import" "3.13.1" + "@lerna/init" "3.13.1" + "@lerna/link" "3.13.1" + "@lerna/list" "3.13.1" + "@lerna/publish" "3.13.1" + "@lerna/run" "3.13.1" + "@lerna/version" "3.13.1" import-local "^1.0.0" - libnpm "^2.0.1" - -leven@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" - integrity sha1-wuep93IJTe6dNCAq6KzORoeHVYA= + npmlog "^4.1.2" levn@^0.3.0, levn@~0.3.0: version "0.3.0" @@ -5409,32 +5778,6 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -libnpm@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/libnpm/-/libnpm-2.0.1.tgz#a48fcdee3c25e13c77eb7c60a0efe561d7fb0d8f" - integrity sha512-qTKoxyJvpBxHZQB6k0AhSLajyXq9ZE/lUsZzuHAplr2Bpv9G+k4YuYlExYdUCeVRRGqcJt8hvkPh4tBwKoV98w== - dependencies: - bin-links "^1.1.2" - bluebird "^3.5.3" - find-npm-prefix "^1.0.2" - libnpmaccess "^3.0.1" - libnpmconfig "^1.2.1" - libnpmhook "^5.0.2" - libnpmorg "^1.0.0" - libnpmpublish "^1.1.0" - libnpmsearch "^2.0.0" - libnpmteam "^1.0.1" - lock-verify "^2.0.2" - npm-lifecycle "^2.1.0" - npm-logical-tree "^1.2.1" - npm-package-arg "^6.1.0" - npm-profile "^4.0.1" - npm-registry-fetch "^3.8.0" - npmlog "^4.1.2" - pacote "^9.2.3" - read-package-json "^2.0.13" - stringify-package "^1.0.0" - libnpmaccess@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/libnpmaccess/-/libnpmaccess-3.0.1.tgz#5b3a9de621f293d425191aa2e779102f84167fa8" @@ -5445,36 +5788,7 @@ libnpmaccess@^3.0.1: npm-package-arg "^6.1.0" npm-registry-fetch "^3.8.0" -libnpmconfig@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/libnpmconfig/-/libnpmconfig-1.2.1.tgz#c0c2f793a74e67d4825e5039e7a02a0044dfcbc0" - integrity sha512-9esX8rTQAHqarx6qeZqmGQKBNZR5OIbl/Ayr0qQDy3oXja2iFVQQI81R6GZ2a02bSNZ9p3YOGX1O6HHCb1X7kA== - dependencies: - figgy-pudding "^3.5.1" - find-up "^3.0.0" - ini "^1.3.5" - -libnpmhook@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/libnpmhook/-/libnpmhook-5.0.2.tgz#d12817b0fb893f36f1d5be20017f2aea25825d94" - integrity sha512-vLenmdFWhRfnnZiNFPNMog6CK7Ujofy2TWiM2CrpZUjBRIhHkJeDaAbJdYCT6W4lcHtyrJR8yXW8KFyq6UAp1g== - dependencies: - aproba "^2.0.0" - figgy-pudding "^3.4.1" - get-stream "^4.0.0" - npm-registry-fetch "^3.8.0" - -libnpmorg@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/libnpmorg/-/libnpmorg-1.0.0.tgz#979b868c48ba28c5820e3bb9d9e73c883c16a232" - integrity sha512-o+4eVJBoDGMgRwh2lJY0a8pRV2c/tQM/SxlqXezjcAg26Qe9jigYVs+Xk0vvlYDWCDhP0g74J8UwWeAgsB7gGw== - dependencies: - aproba "^2.0.0" - figgy-pudding "^3.4.1" - get-stream "^4.0.0" - npm-registry-fetch "^3.8.0" - -libnpmpublish@^1.1.0: +libnpmpublish@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/libnpmpublish/-/libnpmpublish-1.1.1.tgz#ff0c6bb0b4ad2bda2ad1f5fba6760a4af37125f0" integrity sha512-nefbvJd/wY38zdt+b9SHL6171vqBrMtZ56Gsgfd0duEKb/pB8rDT4/ObUQLrHz1tOfht1flt2zM+UGaemzAG5g== @@ -5489,39 +5803,19 @@ libnpmpublish@^1.1.0: semver "^5.5.1" ssri "^6.0.1" -libnpmsearch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/libnpmsearch/-/libnpmsearch-2.0.0.tgz#de05af47ada81554a5f64276a69599070d4a5685" - integrity sha512-vd+JWbTGzOSfiOc+72MU6y7WqmBXn49egCCrIXp27iE/88bX8EpG64ST1blWQI1bSMUr9l1AKPMVsqa2tS5KWA== - dependencies: - figgy-pudding "^3.5.1" - get-stream "^4.0.0" - npm-registry-fetch "^3.8.0" - -libnpmteam@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/libnpmteam/-/libnpmteam-1.0.1.tgz#ff704b1b6c06ea674b3b1101ac3e305f5114f213" - integrity sha512-gDdrflKFCX7TNwOMX1snWojCoDE5LoRWcfOC0C/fqF7mBq8Uz9zWAX4B2RllYETNO7pBupBaSyBDkTAC15cAMg== - dependencies: - aproba "^2.0.0" - figgy-pudding "^3.4.1" - get-stream "^4.0.0" - npm-registry-fetch "^3.8.0" - lines-and-columns@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= -lint-staged@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-8.1.0.tgz#dbc3ae2565366d8f20efb9f9799d076da64863f2" - integrity sha512-yfSkyJy7EuVsaoxtUSEhrD81spdJOe/gMTGea3XaV7HyoRhTb9Gdlp6/JppRZERvKSEYXP9bjcmq6CA5oL2lYQ== +lint-staged@^8.1.5: + version "8.1.5" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-8.1.5.tgz#372476fe1a58b8834eb562ed4c99126bd60bdd79" + integrity sha512-e5ZavfnSLcBJE1BTzRTqw6ly8OkqVyO3GL2M6teSmTBYQ/2BuueD5GIt2RPsP31u/vjKdexUyDCxSyK75q4BDA== dependencies: - "@iamstarkov/listr-update-renderer" "0.4.1" chalk "^2.3.1" commander "^2.14.1" - cosmiconfig "5.0.6" + cosmiconfig "^5.0.2" debug "^3.1.0" dedent "^0.7.0" del "^3.0.0" @@ -5530,9 +5824,9 @@ lint-staged@^8.1.0: g-status "^2.0.2" is-glob "^4.0.0" is-windows "^1.0.2" - jest-validate "^23.5.0" listr "^0.14.2" - lodash "^4.17.5" + listr-update-renderer "^0.5.0" + lodash "^4.17.11" log-symbols "^2.2.0" micromatch "^3.1.8" npm-which "^3.0.1" @@ -5543,6 +5837,7 @@ lint-staged@^8.1.0: staged-git-files "1.1.2" string-argv "^0.0.2" stringify-object "^3.2.2" + yup "^0.26.10" listr-silent-renderer@^1.1.1: version "1.1.1" @@ -5635,14 +5930,6 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" -lock-verify@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/lock-verify/-/lock-verify-2.0.2.tgz#148e4f85974915c9e3c34d694b7de9ecb18ee7a8" - integrity sha512-QNVwK0EGZBS4R3YQ7F1Ox8p41Po9VGl2QG/2GsuvTbkJZYSsPeWHKMbbH6iZMCHWSMww5nrJroZYnGzI4cePuw== - dependencies: - npm-package-arg "^5.1.2 || 6" - semver "^5.4.1" - lodash._reinterpolate@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" @@ -5683,6 +5970,11 @@ lodash.padstart@^4.1.0: resolved "https://registry.yarnpkg.com/lodash.padstart/-/lodash.padstart-4.6.1.tgz#d2e3eebff0d9d39ad50f5cbd1b52a7bce6bb611b" integrity sha1-0uPuv/DZ05rVD1y9G1KnvOa7YRs= +lodash.set@^4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/lodash.set/-/lodash.set-4.3.2.tgz#d8757b1da807dde24816b0d6a84bea1a76230b23" + integrity sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM= + lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" @@ -5708,11 +6000,23 @@ lodash.throttle@^4.1.1: resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4" integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ= +lodash.uniq@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" + integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= + lodash@4.x.x, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.6.1: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== +log-symbols@2.2.0, log-symbols@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" + integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== + dependencies: + chalk "^2.0.1" + log-symbols@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" @@ -5720,13 +6024,6 @@ log-symbols@^1.0.2: dependencies: chalk "^1.0.0" -log-symbols@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" - integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== - dependencies: - chalk "^2.0.1" - log-update@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/log-update/-/log-update-2.3.0.tgz#88328fd7d1ce7938b29283746f0b1bc126b24708" @@ -5741,7 +6038,12 @@ lolex@^2.3.2, lolex@^2.7.5: resolved "https://registry.yarnpkg.com/lolex/-/lolex-2.7.5.tgz#113001d56bfc7e02d56e36291cc5c413d1aa0733" integrity sha512-l9x0+1offnKKIzYVjyXU2SiwhXDLekRzKyhnbyldPHvC7BvLPVpdNUNR2KeMAiCN2D/kLNttZgQD5WjSxuBx3Q== -loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: +lolex@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/lolex/-/lolex-3.1.0.tgz#1a7feb2fefd75b3e3a7f79f0e110d9476e294434" + integrity sha512-zFo5MgCJ0rZ7gQg69S4pqBsLURbFw11X68C18OcJjJQbqaXm2NoTrGl1IMM3TIz0/BnN1tIs2tzmmqvCsOMMjw== + +loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== @@ -5776,6 +6078,11 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" +macos-release@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-2.2.0.tgz#ab58d55dd4714f0a05ad4b0e90f4370fef5cdea8" + integrity sha512-iV2IDxZaX8dIcM7fG6cI46uNmHUxHE4yN+Z8tKHAW1TBPMZDIKHf/3L+YnOuj/FK9il14UaVdHmiQ1tsi90ltA== + make-dir@^1.0.0, make-dir@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" @@ -5783,6 +6090,14 @@ make-dir@^1.0.0, make-dir@^1.3.0: dependencies: pify "^3.0.0" +make-dir@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" + integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== + dependencies: + pify "^4.0.1" + semver "^5.6.0" + make-fetch-happen@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-4.0.1.tgz#141497cb878f243ba93136c83d8aba12c216c083" @@ -5853,18 +6168,6 @@ math-random@^1.0.1: resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c" integrity sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A== -md5-hex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-2.0.0.tgz#d0588e9f1c74954492ecd24ac0ac6ce997d92e33" - integrity sha1-0FiOnxx0lUSS7NJKwKxs6ZfZLjM= - dependencies: - md5-o-matic "^0.1.1" - -md5-o-matic@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/md5-o-matic/-/md5-o-matic-0.1.1.tgz#822bccd65e117c514fab176b25945d54100a03c3" - integrity sha1-givM1l4RfFFPqxdrJZRdVBAKA8M= - mem@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" @@ -6217,7 +6520,7 @@ micromatch@^2.3.11: parse-glob "^3.0.4" regex-cache "^0.4.2" -micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: +micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== @@ -6375,6 +6678,35 @@ mocha@^5.2.0: mkdirp "0.5.1" supports-color "5.4.0" +mocha@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-6.0.2.tgz#cdc1a6fdf66472c079b5605bac59d29807702d2c" + integrity sha512-RtTJsmmToGyeTznSOMoM6TPEk1A84FQaHIciKrRqARZx+B5ccJ5tXlmJzEKGBxZdqk9UjpRsesZTUkZmR5YnuQ== + dependencies: + ansi-colors "3.2.3" + browser-stdout "1.3.1" + debug "3.2.6" + diff "3.5.0" + escape-string-regexp "1.0.5" + findup-sync "2.0.0" + glob "7.1.3" + growl "1.10.5" + he "1.2.0" + js-yaml "3.12.0" + log-symbols "2.2.0" + minimatch "3.0.4" + mkdirp "0.5.1" + ms "2.1.1" + node-environment-flags "1.0.4" + object.assign "4.1.0" + strip-json-comments "2.0.1" + supports-color "6.0.0" + which "1.3.1" + wide-align "1.1.3" + yargs "12.0.5" + yargs-parser "11.1.1" + yargs-unparser "1.5.0" + modify-values@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" @@ -6413,7 +6745,7 @@ ms@2.0.0: resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= -ms@^2.0.0, ms@^2.1.1: +ms@2.1.1, ms@^2.0.0, ms@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== @@ -6493,11 +6825,27 @@ negotiator@0.6.1: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk= +neo-async@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.0.tgz#b9d15e4d71c6762908654b5183ed38b753340835" + integrity sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA== + nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== +nise@^1.4.10: + version "1.4.10" + resolved "https://registry.yarnpkg.com/nise/-/nise-1.4.10.tgz#ae46a09a26436fae91a38a60919356ae6db143b6" + integrity sha512-sa0RRbj53dovjc7wombHmVli9ZihXbXCQ2uH3TNm03DyvOSIQbxg+pbqDKrk2oxMK1rtLGVlKxcB9rrc6X5YjA== + dependencies: + "@sinonjs/formatio" "^3.1.0" + "@sinonjs/text-encoding" "^0.7.1" + just-extend "^4.0.2" + lolex "^2.3.2" + path-to-regexp "^1.7.0" + nise@^1.4.5: version "1.4.8" resolved "https://registry.yarnpkg.com/nise/-/nise-1.4.8.tgz#ce91c31e86cf9b2c4cac49d7fcd7f56779bfd6b0" @@ -6509,6 +6857,13 @@ nise@^1.4.5: path-to-regexp "^1.7.0" text-encoding "^0.6.4" +node-environment-flags@1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.4.tgz#0b784a6551426bfc16d3b2208424dcbc2b2ff038" + integrity sha512-M9rwCnWVLW7PX+NUWe3ejEdiLYinRpsEre9hMkU/6NS4h+EEulYaDH1gCEZ2gyXsmw+RXYDaV2JkkTNcsPDJ0Q== + dependencies: + object.getownpropertydescriptors "^2.0.3" + node-fetch-npm@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz#7258c9046182dca345b4208eda918daf33697ff7" @@ -6526,7 +6881,7 @@ node-fetch@^1.0.1: encoding "^0.1.11" is-stream "^1.0.1" -node-fetch@^2.2.0: +node-fetch@^2.2.0, node-fetch@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.3.0.tgz#1a1d940bbfb916a1d3e0219f037e89e71f8c5fa5" integrity sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA== @@ -6622,6 +6977,11 @@ normalize-path@^2.0.1, normalize-path@^2.1.1: dependencies: remove-trailing-separator "^1.0.1" +normalize-url@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559" + integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg== + npm-bundled@^1.0.1: version "1.0.5" resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" @@ -6641,12 +7001,7 @@ npm-lifecycle@^2.1.0: umask "^1.1.0" which "^1.3.1" -npm-logical-tree@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/npm-logical-tree/-/npm-logical-tree-1.2.1.tgz#44610141ca24664cad35d1e607176193fd8f5b88" - integrity sha512-AJI/qxDB2PWI4LG1CYN579AY1vCiNyWfkiquCsJWqntRu/WwimVrC8yXeILBFHDwxfOejxewlmnvW9XXjMlYIg== - -"npm-package-arg@^4.0.0 || ^5.0.0 || ^6.0.0", "npm-package-arg@^5.1.2 || 6", npm-package-arg@^6.0.0, npm-package-arg@^6.1.0: +"npm-package-arg@^4.0.0 || ^5.0.0 || ^6.0.0", npm-package-arg@^6.0.0, npm-package-arg@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-6.1.0.tgz#15ae1e2758a5027efb4c250554b85a737db7fcc1" integrity sha512-zYbhP2k9DbJhA0Z3HKUePUgdB1x7MfIfKssC+WLPFMKTBZKpZh5m13PgexJjCq6KW7j17r0jHWcCpxEqnnncSA== @@ -6664,6 +7019,14 @@ npm-packlist@^1.1.12, npm-packlist@^1.1.6: ignore-walk "^3.0.1" npm-bundled "^1.0.1" +npm-packlist@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.1.tgz#19064cdf988da80ea3cee45533879d90192bbfbc" + integrity sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw== + dependencies: + ignore-walk "^3.0.1" + npm-bundled "^1.0.1" + npm-path@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/npm-path/-/npm-path-2.0.4.tgz#c641347a5ff9d6a09e4d9bce5580c4f505278e64" @@ -6680,15 +7043,6 @@ npm-pick-manifest@^2.2.3: npm-package-arg "^6.0.0" semver "^5.4.1" -npm-profile@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/npm-profile/-/npm-profile-4.0.1.tgz#d350f7a5e6b60691c7168fbb8392c3603583f5aa" - integrity sha512-NQ1I/1Q7YRtHZXkcuU1/IyHeLy6pd+ScKg4+DQHdfsm769TGq6HPrkbuNJVJS4zwE+0mvvmeULzQdWn2L2EsVA== - dependencies: - aproba "^1.1.2 || 2" - figgy-pudding "^3.4.1" - npm-registry-fetch "^3.8.0" - npm-registry-fetch@^3.8.0: version "3.8.0" resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-3.8.0.tgz#aa7d9a7c92aff94f48dba0984bdef4bd131c88cc" @@ -6701,6 +7055,18 @@ npm-registry-fetch@^3.8.0: make-fetch-happen "^4.0.1" npm-package-arg "^6.1.0" +npm-registry-fetch@^3.9.0: + version "3.9.0" + resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-3.9.0.tgz#44d841780e2833f06accb34488f8c7450d1a6856" + integrity sha512-srwmt8YhNajAoSAaDWndmZgx89lJwIZ1GWxOuckH4Coek4uHv5S+o/l9FLQe/awA+JwTnj4FJHldxhlXdZEBmw== + dependencies: + JSONStream "^1.3.4" + bluebird "^3.5.1" + figgy-pudding "^3.4.1" + lru-cache "^4.1.3" + make-fetch-happen "^4.0.1" + npm-package-arg "^6.1.0" + npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" @@ -6746,36 +7112,35 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= -nyc@^13.1.0: - version "13.1.0" - resolved "https://registry.yarnpkg.com/nyc/-/nyc-13.1.0.tgz#463665c7ff6b5798e322624a5eb449a678db90e3" - integrity sha512-3GyY6TpQ58z9Frpv4GMExE1SV2tAgYqC7HSy2omEhNiCT3mhT9NyiOvIE8zkbuJVFzmvvNTnE4h/7/wQae7xLg== +nyc@^13.3.0: + version "13.3.0" + resolved "https://registry.yarnpkg.com/nyc/-/nyc-13.3.0.tgz#da4dbe91a9c8b9ead3f4f3344c76f353e3c78c75" + integrity sha512-P+FwIuro2aFG6B0Esd9ZDWUd51uZrAEoGutqZxzrVmYl3qSfkLgcQpBPBjtDFsUQLFY1dvTQJPOyeqr8S9GF8w== dependencies: archy "^1.0.0" arrify "^1.0.1" - caching-transform "^2.0.0" + caching-transform "^3.0.1" convert-source-map "^1.6.0" - debug-log "^1.0.1" find-cache-dir "^2.0.0" find-up "^3.0.0" foreground-child "^1.5.6" glob "^7.1.3" - istanbul-lib-coverage "^2.0.1" - istanbul-lib-hook "^2.0.1" - istanbul-lib-instrument "^3.0.0" - istanbul-lib-report "^2.0.2" - istanbul-lib-source-maps "^2.0.1" - istanbul-reports "^2.0.1" + istanbul-lib-coverage "^2.0.3" + istanbul-lib-hook "^2.0.3" + istanbul-lib-instrument "^3.1.0" + istanbul-lib-report "^2.0.4" + istanbul-lib-source-maps "^3.0.2" + istanbul-reports "^2.1.1" make-dir "^1.3.0" merge-source-map "^1.1.0" resolve-from "^4.0.0" - rimraf "^2.6.2" + rimraf "^2.6.3" signal-exit "^3.0.2" spawn-wrap "^1.4.2" - test-exclude "^5.0.0" + test-exclude "^5.1.0" uuid "^3.3.2" - yargs "11.1.0" - yargs-parser "^9.0.2" + yargs "^12.0.5" + yargs-parser "^11.1.1" oauth-sign@~0.9.0: version "0.9.0" @@ -6808,7 +7173,7 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.assign@^4.1.0: +object.assign@4.1.0, object.assign@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== @@ -6838,6 +7203,14 @@ object.fromentries@^2.0.0: function-bind "^1.1.1" has "^1.0.1" +object.getownpropertydescriptors@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" + integrity sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY= + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.1" + object.omit@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" @@ -6853,6 +7226,11 @@ object.pick@^1.3.0: dependencies: isobject "^3.0.1" +octokit-pagination-methods@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz#cf472edc9d551055f9ef73f6e42b4dbb4c80bea4" + integrity sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ== + on-finished@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" @@ -6930,7 +7308,7 @@ os-locale@^2.0.0: lcid "^1.0.0" mem "^1.1.0" -os-locale@^3.0.0: +os-locale@^3.0.0, os-locale@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== @@ -6939,7 +7317,15 @@ os-locale@^3.0.0: lcid "^2.0.0" mem "^4.0.0" -os-tmpdir@^1.0.0, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: +os-name@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/os-name/-/os-name-3.0.0.tgz#e1434dbfddb8e74b44c98b56797d951b7648a5d9" + integrity sha512-7c74tib2FsdFbQ3W+qj8Tyd1R3Z6tuVRNNxXjJcZ4NgjIEQU9N/prVMqcW29XZPXGACqaXN3jq58/6hoaoXH6g== + dependencies: + macos-release "^2.0.0" + windows-release "^3.1.0" + +os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= @@ -7048,14 +7434,14 @@ p-waterfall@^1.0.0: dependencies: p-reduce "^1.0.0" -package-hash@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/package-hash/-/package-hash-2.0.0.tgz#78ae326c89e05a4d813b68601977af05c00d2a0d" - integrity sha1-eK4ybIngWk2BO2hgGXevBcANKg0= +package-hash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/package-hash/-/package-hash-3.0.0.tgz#50183f2d36c9e3e528ea0a8605dff57ce976f88e" + integrity sha512-lOtmukMDVvtkL84rJHI7dpTYq+0rli8N2wlnqUcBuDWCfVhRUfOmnR9SsoHFMLpACvEV60dX7rd0rFaYDZI+FA== dependencies: - graceful-fs "^4.1.11" + graceful-fs "^4.1.15" + hasha "^3.0.0" lodash.flattendeep "^4.4.0" - md5-hex "^2.0.0" release-zalgo "^1.0.0" package-json@^4.0.0: @@ -7068,10 +7454,10 @@ package-json@^4.0.0: registry-url "^3.0.3" semver "^5.1.0" -pacote@^9.2.3: - version "9.4.0" - resolved "https://registry.yarnpkg.com/pacote/-/pacote-9.4.0.tgz#af979abdeb175cd347c3e33be3241af1ed254807" - integrity sha512-WQ1KL/phGMkedYEQx9ODsjj7xvwLSpdFJJdEXrLyw5SILMxcTNt5DTxT2Z93fXuLFYJBlZJdnwdalrQdB/rX5w== +pacote@^9.5.0: + version "9.5.0" + resolved "https://registry.yarnpkg.com/pacote/-/pacote-9.5.0.tgz#85f3013a3f6dd51c108b0ccabd3de8102ddfaeda" + integrity sha512-aUplXozRbzhaJO48FaaeClmN+2Mwt741MC6M3bevIGZwdCaP7frXzbUOfOWa91FPHoLITzG0hYaKY363lxO3bg== dependencies: bluebird "^3.5.3" cacache "^11.3.2" @@ -7159,6 +7545,29 @@ parse-node-version@^1.0.0: resolved "https://registry.yarnpkg.com/parse-node-version/-/parse-node-version-1.0.0.tgz#33d9aa8920dcc3c0d33658ec18ce237009a56d53" integrity sha512-02GTVHD1u0nWc20n2G7WX/PgdhNFG04j5fi1OkaJzPWLTcf6vh6229Lta1wTmXG/7Dg42tCssgkccVt7qvd8Kg== +parse-passwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" + integrity sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY= + +parse-path@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/parse-path/-/parse-path-4.0.1.tgz#0ec769704949778cb3b8eda5e994c32073a1adff" + integrity sha512-d7yhga0Oc+PwNXDvQ0Jv1BuWkLVPXcAoQ/WREgd6vNNoKYaW52KI+RdOFjI63wjkmps9yUE8VS4veP+AgpQ/hA== + dependencies: + is-ssh "^1.3.0" + protocols "^1.4.0" + +parse-url@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-5.0.1.tgz#99c4084fc11be14141efa41b3d117a96fcb9527f" + integrity sha512-flNUPP27r3vJpROi0/R3/2efgKkyXqnXwyP1KQ2U0SfFRgdizOdWfvrrvJg1LuOoxs7GQhmxJlq23IpQ/BkByg== + dependencies: + is-ssh "^1.3.0" + normalize-url "^3.3.0" + parse-path "^4.0.0" + protocols "^1.4.0" + parseurl@~1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" @@ -7169,19 +7578,24 @@ pascalcase@^0.1.1: resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= -patch-package@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-5.1.2.tgz#01753261026dbf6fb223cc0bbd2931a29da9dfc2" - integrity sha512-6NA7/hcAG/eZ6TcugOIkmRMA9wg/CVm+gyJpWJwc7Z8E0dkMeQwnVw5oDvhG+bEHBhsQLn+rF7PAx7p2QWnfNA== +patch-package@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-6.1.0.tgz#80985dc5c2042c42bcf34c8c35622ce95e5c16dc" + integrity sha512-YbnG+p2d96E5A/WJ7kNJRWegpxyN7L0BWZ7FnYwC3ighfD2nr3vZYvl33oJmL9ZrFEP1bhQvJPV6iKHdRIro7A== dependencies: - chalk "^1.1.3" - cross-spawn "^5.1.0" - fs-extra "^4.0.1" + "@yarnpkg/lockfile" "^1.1.0" + chalk "^2.4.2" + cross-spawn "^6.0.5" + find-yarn-workspace-root "^1.2.1" + fs-extra "^7.0.1" + is-ci "^2.0.0" + klaw-sync "^6.0.0" minimist "^1.2.0" - rimraf "^2.6.1" - slash "^1.0.0" - tmp "^0.0.31" - update-notifier "^2.2.0" + rimraf "^2.6.3" + semver "^5.6.0" + slash "^2.0.0" + tmp "^0.0.33" + update-notifier "^2.5.0" path-dirname@^1.0.0: version "1.0.2" @@ -7270,6 +7684,11 @@ pify@^3.0.0: resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= +pify@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== + pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" @@ -7330,11 +7749,6 @@ plugin-error@^0.1.2: arr-union "^2.0.1" extend-shallow "^1.1.2" -pluralize@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" - integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== - posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -7362,10 +7776,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^1.15.3: - version "1.16.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.16.1.tgz#534c2c9d7853f8845e5e078384e71973bd74089f" - integrity sha512-XXUITwIkGb3CPJ2hforHah/zTINRyie5006Jd2HKy2qz7snEJXl0KLfsJZW/wst9g6R2rFvqba3VpNYdu1hDcA== +prettier@^1.16.4: + version "1.16.4" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.16.4.tgz#73e37e73e018ad2db9c76742e2647e21790c9717" + integrity sha512-ZzWuos7TI5CKUeQAtFd6Zhm2s6EpAD/ZLApIhsF9pRvRtM1RFo61dM/4MSRUA0SuLugA/zgrZD8m0BaY46Og7g== pretty-format@24.0.0-alpha.6: version "24.0.0-alpha.6" @@ -7375,14 +7789,6 @@ pretty-format@24.0.0-alpha.6: ansi-regex "^4.0.0" ansi-styles "^3.2.0" -pretty-format@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.6.0.tgz#5eaac8eeb6b33b987b7fe6097ea6a8a146ab5760" - integrity sha512-zf9NV1NSlDLDjycnwm6hpFATCGl/K1lt0R/GdkAK2O5LN/rwJoB+Mh93gGJjut4YbmecbfgLWVGSTCr0Ewvvbw== - dependencies: - ansi-regex "^3.0.0" - ansi-styles "^3.2.0" - private@^0.1.6: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" @@ -7435,7 +7841,7 @@ promzard@^0.3.0: dependencies: read "1" -prop-types@^15.5.8, prop-types@^15.6.1, prop-types@^15.6.2: +prop-types@^15.5.8, prop-types@^15.6.2: version "15.6.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102" integrity sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ== @@ -7443,6 +7849,15 @@ prop-types@^15.5.8, prop-types@^15.6.1, prop-types@^15.6.2: loose-envify "^1.3.1" object-assign "^4.1.1" +prop-types@^15.7.2: + version "15.7.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" + integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.8.1" + proper-lockfile@^3.0.2: version "3.2.0" resolved "https://registry.yarnpkg.com/proper-lockfile/-/proper-lockfile-3.2.0.tgz#89ca420eea1d55d38ca552578851460067bcda66" @@ -7452,11 +7867,21 @@ proper-lockfile@^3.0.2: retry "^0.12.0" signal-exit "^3.0.2" +property-expr@^1.5.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/property-expr/-/property-expr-1.5.1.tgz#22e8706894a0c8e28d58735804f6ba3a3673314f" + integrity sha512-CGuc0VUTGthpJXL36ydB6jnbyOf/rAHFvmVrJlH+Rg0DqqLFQGAP6hIaxD/G0OAmBJPhXDHuEJigrp0e0wFV6g== + proto-list@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" integrity sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk= +protocols@^1.1.0, protocols@^1.4.0: + version "1.4.7" + resolved "https://registry.yarnpkg.com/protocols/-/protocols-1.4.7.tgz#95f788a4f0e979b291ffefcf5636ad113d037d32" + integrity sha512-Fx65lf9/YDn3hUX08XUc0J8rSux36rEsyiv21ZGUC1mOyeM3lTRpZLcrm8aAolzS4itwVfm7TAPyxC2E5zd6xg== + protoduck@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/protoduck/-/protoduck-5.0.1.tgz#03c3659ca18007b69a50fd82a7ebcc516261151f" @@ -7566,27 +7991,32 @@ react-devtools-core@^3.6.0: shell-quote "^1.6.1" ws "^3.3.1" -react-dom@16.8.3: - version "16.8.3" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.3.tgz#ae236029e66210783ac81999d3015dfc475b9c32" - integrity sha512-ttMem9yJL4/lpItZAQ2NTFAbV7frotHk5DZEHXUOws2rMmrsvh1Na7ThGT0dTzUIl6pqTOi5tYREfL8AEna3lA== +react-dom@16.8.1: + version "16.8.1" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.1.tgz#ec860f98853d09d39bafd3a6f1e12389d283dbb4" + integrity sha512-N74IZUrPt6UiDjXaO7UbDDFXeUXnVhZzeRLy/6iqqN1ipfjrhR60Bp5NuBK+rv3GMdqdIuwIl22u1SYwf330bg== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" prop-types "^15.6.2" - scheduler "^0.13.3" + scheduler "^0.13.1" -react-native-camera@^1.10.1: - version "1.10.1" - resolved "https://registry.yarnpkg.com/react-native-camera/-/react-native-camera-1.10.1.tgz#6a2e86e8b1e7d5872832d6bd154a2628c9599567" - integrity sha512-sIHeG2dfBlOEkE093QSfXzFvjWdPCEz+ffkonvvLm7kRKPtiS+4gZM2zuH2SP4g3MJyKt8ifB/VIAxfnvtZ6sQ== +react-is@^16.8.1: + version "16.8.6" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" + integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== + +react-native-camera@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/react-native-camera/-/react-native-camera-2.2.0.tgz#0eabf962ecf569c852a64a4e07f69848c78f3af4" + integrity sha512-0naDVFHRpQsrjxOYKTececcN7tVbWUkcLuuZRddVM7H3hncZ4IXEn/RcZttmoxSEsGMfLc83gnbjzM/RY6hMMA== dependencies: prop-types "^15.6.2" -react-native@0.59.0: - version "0.59.0" - resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.59.0.tgz#7d0ad297da3fd2e18f387f0ef5581270aaabac42" - integrity sha512-7DTOCFfmo9e2P0gXAaCH8DDUqW154Y6UFyKE74X08k1QW9FU5O9dQ+GQ7ryJYS0sxMLNQGDhMSADhnn72QQT4g== +react-native@0.59.5: + version "0.59.5" + resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.59.5.tgz#79500d2885a3dc83216715e1fc6effa878ad6ea9" + integrity sha512-8Q/9cS6IMsGNiFhJgzmncbUeuacXQMe5EJl0c63fW30DvjEjeTVCvhM08eGzSpsNlOvL2XDRa4YOiCrwI7S1TA== dependencies: "@babel/runtime" "^7.0.0" "@react-native-community/cli" "^1.2.1" @@ -7655,15 +8085,15 @@ react-transform-hmr@^1.0.4: global "^4.3.0" react-proxy "^1.1.7" -react@16.8.3: - version "16.8.3" - resolved "https://registry.yarnpkg.com/react/-/react-16.8.3.tgz#c6f988a2ce895375de216edcfaedd6b9a76451d9" - integrity sha512-3UoSIsEq8yTJuSu0luO1QQWYbgGEILm+eJl2QN/VLDi7hL+EN18M3q3oVZwmVzzBJ3DkM7RMdRwBmZZ+b4IzSA== +react@16.8.1: + version "16.8.1" + resolved "https://registry.yarnpkg.com/react/-/react-16.8.1.tgz#ae11831f6cb2a05d58603a976afc8a558e852c4a" + integrity sha512-wLw5CFGPdo7p/AgteFz7GblI2JPOos0+biSoxf1FPsGxWQZdN/pj6oToJs1crn61DL3Ln7mN86uZ4j74p31ELQ== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" prop-types "^15.6.2" - scheduler "^0.13.3" + scheduler "^0.13.1" read-cmd-shim@^1.0.1: version "1.0.1" @@ -7852,6 +8282,11 @@ regenerator-runtime@^0.12.0: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz#fa1a71544764c036f8c49b13a08b2594c9f8a0de" integrity sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg== +regenerator-runtime@^0.13.2: + version "0.13.2" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz#32e59c9a6fb9b1a4aff09b4930ca2d4477343447" + integrity sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA== + regenerator-transform@^0.13.3: version "0.13.3" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.13.3.tgz#264bd9ff38a8ce24b06e0636496b2c856b57bcbb" @@ -7988,6 +8423,11 @@ require-main-filename@^1.0.1: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + resolve-cwd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" @@ -7995,6 +8435,14 @@ resolve-cwd@^2.0.0: dependencies: resolve-from "^3.0.0" +resolve-dir@^1.0.0, resolve-dir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-1.0.1.tgz#79a40644c362be82f26effe739c9bb5382046f43" + integrity sha1-eaQGRMNivoLybv/nOcm7U4IEb0M= + dependencies: + expand-tilde "^2.0.0" + global-modules "^1.0.0" + resolve-from@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" @@ -8040,7 +8488,7 @@ retry@^0.12.0: resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs= -rimraf@2, rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3, rimraf@~2.6.2: +rimraf@2, rimraf@2.6.3, rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== @@ -8165,10 +8613,10 @@ sax@~1.1.1: resolved "https://registry.yarnpkg.com/sax/-/sax-1.1.6.tgz#5d616be8a5e607d54e114afae55b7eaf2fcc3240" integrity sha1-XWFr6KXmB9VOEUr65Vt+ry/MMkA= -scheduler@^0.13.3: - version "0.13.4" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.4.tgz#8fef05e7a3580c76c0364d2df5e550e4c9140298" - integrity sha512-cvSOlRPxOHs5dAhP9yiS/6IDmVAVxmk33f0CtTJRkmUWcb1Us+t7b1wqdzoC0REw2muC9V5f1L/w5R5uKGaepA== +scheduler@^0.13.1: + version "0.13.6" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.6.tgz#466a4ec332467b31a91b9bf74e5347072e4cd889" + integrity sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -8377,7 +8825,7 @@ simple-plist@^1.0.0: bplist-parser "0.1.1" plist "^3.0.1" -sinon@^6.1.4, sinon@^6.2.0: +sinon@^6.1.4: version "6.3.5" resolved "https://registry.yarnpkg.com/sinon/-/sinon-6.3.5.tgz#0f6d6a5b4ebaad1f6e8e019395542d1d02c144a0" integrity sha512-xgoZ2gKjyVRcF08RrIQc+srnSyY1JDJtxu3Nsz07j1ffjgXoY6uPLf/qja6nDBZgzYYEovVkFryw2+KiZz11xQ== @@ -8392,6 +8840,19 @@ sinon@^6.1.4, sinon@^6.2.0: supports-color "^5.5.0" type-detect "^4.0.8" +sinon@^7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/sinon/-/sinon-7.3.1.tgz#e8276522104e6c08d1cb52a907270b0e316655c4" + integrity sha512-eQKMaeWovtOtYe2xThEvaHmmxf870Di+bim10c3ZPrL5bZhLGtu8cz+rOBTFz0CwBV4Q/7dYwZiqZbGVLZ+vjQ== + dependencies: + "@sinonjs/commons" "^1.4.0" + "@sinonjs/formatio" "^3.2.1" + "@sinonjs/samsam" "^3.3.1" + diff "^3.5.0" + lolex "^3.1.0" + nise "^1.4.10" + supports-color "^5.5.0" + slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" @@ -8407,10 +8868,10 @@ slice-ansi@0.0.4: resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" integrity sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU= -slice-ansi@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.0.0.tgz#5373bdb8559b45676e8541c66916cdd6251612e7" - integrity sha512-4j2WTWjp3GsZ+AOagyzVbzp4vWGtZ0hEZ/gDY/uTvm6MTxUfTUIsnMIFb1bn8o0RuXiqUw15H1bue8f22Vw2oQ== +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== dependencies: ansi-styles "^3.2.0" astral-regex "^1.0.0" @@ -8711,6 +9172,15 @@ string-width@^1.0.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string-width@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" @@ -8727,11 +9197,6 @@ stringify-object@^3.2.2: is-obj "^1.0.1" is-regexp "^1.0.0" -stringify-package@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/stringify-package/-/stringify-package-1.0.0.tgz#e02828089333d7d45cd8c287c30aa9a13375081b" - integrity sha512-JIQqiWmLiEozOC0b0BtxZ/AOUtdUZHCBPgqIZ2kSJJqGwgb9neo44XdTHUC4HZSGqi03hOeB7W/E8rAlKnGe9g== - strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -8753,6 +9218,13 @@ strip-ansi@^5.0.0: dependencies: ansi-regex "^4.0.0" +strip-ansi@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" @@ -8782,7 +9254,7 @@ strip-indent@^2.0.0: resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" integrity sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g= -strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: +strip-json-comments@2.0.1, strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= @@ -8803,38 +9275,62 @@ supports-color@5.4.0: dependencies: has-flag "^3.0.0" +supports-color@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a" + integrity sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg== + dependencies: + has-flag "^3.0.0" + supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= -supports-color@^5.3.0, supports-color@^5.4.0, supports-color@^5.5.0: +supports-color@^5.3.0, supports-color@^5.5.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== dependencies: has-flag "^3.0.0" +supports-color@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" + integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== + dependencies: + has-flag "^3.0.0" + symbol-observable@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== -table@^5.0.2: - version "5.2.1" - resolved "https://registry.yarnpkg.com/table/-/table-5.2.1.tgz#e78463702b1be9f7131c39860bcfb1b81114c2a1" - integrity sha512-qmhNs2GEHNqY5fd2Mo+8N1r2sw/rvTAAvBZTaTx+Y7PHLypqyrxr1MdIu0pLw6Xvl/Gi4ONu/sdceP8vvUjkyA== +synchronous-promise@^2.0.5: + version "2.0.7" + resolved "https://registry.yarnpkg.com/synchronous-promise/-/synchronous-promise-2.0.7.tgz#3574b3d2fae86b145356a4b89103e1577f646fe3" + integrity sha512-16GbgwTmFMYFyQMLvtQjvNWh30dsFe1cAW5Fg1wm5+dg84L9Pe36mftsIRU95/W2YsISxsz/xq4VB23sqpgb/A== + +table@^5.2.3: + version "5.2.3" + resolved "https://registry.yarnpkg.com/table/-/table-5.2.3.tgz#cde0cc6eb06751c009efab27e8c820ca5b67b7f2" + integrity sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ== dependencies: - ajv "^6.6.1" + ajv "^6.9.1" lodash "^4.17.11" - slice-ansi "2.0.0" - string-width "^2.1.1" + slice-ansi "^2.1.0" + string-width "^3.0.0" tail@^1.2.3: version "1.4.0" resolved "https://registry.yarnpkg.com/tail/-/tail-1.4.0.tgz#884b216220b90804bfe87a4c8174c2efed0e2661" integrity sha512-wjwfZw6wcMFTB1Po7NFUf4TdCDwX8duZjdTMhnHBEC677Q6mFRcVZE7f/nZDhG2Fpf/wEEKOJP9L7/b11/vlHQ== +tail@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/tail/-/tail-2.0.2.tgz#86073f3a9a568807b7fd886897a7350314275b5f" + integrity sha512-raFipiKWdGKEzxbvZwnhUGqjvsv0gpa/1A479rL//NOxnNwYZDN4MPk6xJJdUFs8P2Xrff3nbH5fcyYRLU4UHQ== + tar@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" @@ -8857,6 +9353,15 @@ tar@^4, tar@^4.4.8: safe-buffer "^5.1.2" yallist "^3.0.2" +teeny-request@^3.7.0: + version "3.11.3" + resolved "https://registry.yarnpkg.com/teeny-request/-/teeny-request-3.11.3.tgz#335c629f7645e5d6599362df2f3230c4cbc23a55" + integrity sha512-CKncqSF7sH6p4rzCgkb/z/Pcos5efl0DmolzvlqRQUNcpRIruOhY9+T1FsIlyEbfWd7MsFpodROOwHYh2BaXzw== + dependencies: + https-proxy-agent "^2.2.1" + node-fetch "^2.2.0" + uuid "^3.3.2" + telnet-client@0.15.3: version "0.15.3" resolved "https://registry.yarnpkg.com/telnet-client/-/telnet-client-0.15.3.tgz#99ec754e4acf6fa51dc69898f574df3c2550712e" @@ -8914,6 +9419,16 @@ test-exclude@^5.0.0: read-pkg-up "^4.0.0" require-main-filename "^1.0.1" +test-exclude@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.1.0.tgz#6ba6b25179d2d38724824661323b73e03c0c1de1" + integrity sha512-gwf0S2fFsANC55fSeSqpb8BYk6w3FDvwZxfNjeF6FRgvFa43r+7wRiA/Q0IxoRU37wB/LE8IQ4221BsNucTaCA== + dependencies: + arrify "^1.0.1" + minimatch "^3.0.4" + read-pkg-up "^4.0.0" + require-main-filename "^1.0.1" + text-encoding@^0.6.4: version "0.6.4" resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.6.4.tgz#e399a982257a276dae428bb92845cb71bdc26d19" @@ -8962,13 +9477,6 @@ tinyqueue@^1.2.3: resolved "https://registry.yarnpkg.com/tinyqueue/-/tinyqueue-1.2.3.tgz#b6a61de23060584da29f82362e45df1ec7353f3d" integrity sha512-Qz9RgWuO9l8lT+Y9xvbzhPT2efIUIFd69N7eF7tJ9lnQl0iLj1M7peK7IoUGZL9DJHw9XftqLreccfxcQgYLxA== -tmp@^0.0.31: - version "0.0.31" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.31.tgz#8f38ab9438e17315e5dbd8b3657e8bfb277ae4a7" - integrity sha1-jzirlDjhcxXl29izZX6L+yd65Kc= - dependencies: - os-tmpdir "~1.0.1" - tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" @@ -9011,6 +9519,11 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" +toposort@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/toposort/-/toposort-2.0.2.tgz#ae21768175d1559d48bef35420b2f4962f09c330" + integrity sha1-riF2gXXRVZ1IvvNUILL0li8JwzA= + tough-cookie@~2.4.3: version "2.4.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" @@ -9072,10 +9585,10 @@ tslint-config-airbnb@^5.11.1: tslint-eslint-rules "^5.4.0" tslint-microsoft-contrib "~5.2.1" -tslint-config-prettier@^1.17.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/tslint-config-prettier/-/tslint-config-prettier-1.17.0.tgz#946ed6117f98f3659a65848279156d87628c33dc" - integrity sha512-NKWNkThwqE4Snn4Cm6SZB7lV5RMDDFsBwz6fWUkTxOKGjMx8ycOHnjIbhn7dZd5XmssW3CwqUjlANR6EhP9YQw== +tslint-config-prettier@^1.18.0: + version "1.18.0" + resolved "https://registry.yarnpkg.com/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz#75f140bde947d35d8f0d238e0ebf809d64592c37" + integrity sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg== tslint-consistent-codestyle@^1.14.1: version "1.15.0" @@ -9111,10 +9624,10 @@ tslint-plugin-prettier@^2.0.1: lines-and-columns "^1.1.6" tslib "^1.7.1" -tslint@^5.12.1: - version "5.12.1" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.12.1.tgz#8cec9d454cf8a1de9b0a26d7bdbad6de362e52c1" - integrity sha512-sfodBHOucFg6egff8d1BvuofoOQ/nOeYNfbp7LDlKBcLNrL3lmS5zoiDGyOMdT7YsEXAwWpTdAHwOGOc8eRZAw== +tslint@^5.15.0: + version "5.15.0" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.15.0.tgz#6ffb180986d63afa1e531feb2a134dbf961e27d3" + integrity sha512-6bIEujKR21/3nyeoX2uBnE8s+tMXCQXhqMmaIPJpHmXJoBJPTLcI7/VHRtUwMhnLVdwLqqY3zmd8Dxqa5CVdJA== dependencies: babel-code-frame "^6.22.0" builtin-modules "^1.1.1" @@ -9122,19 +9635,13 @@ tslint@^5.12.1: commander "^2.12.1" diff "^3.2.0" glob "^7.1.1" - js-yaml "^3.7.0" + js-yaml "^3.13.0" minimatch "^3.0.4" + mkdirp "^0.5.1" resolve "^1.3.2" semver "^5.3.0" tslib "^1.8.0" - tsutils "^2.27.2" - -tsutils@^2.27.2, tsutils@^2.29.0: - version "2.29.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" - integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== - dependencies: - tslib "^1.8.1" + tsutils "^2.29.0" "tsutils@^2.27.2 <2.29.0": version "2.28.0" @@ -9143,6 +9650,13 @@ tsutils@^2.27.2, tsutils@^2.29.0: dependencies: tslib "^1.8.1" +tsutils@^2.29.0: + version "2.29.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" + integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== + dependencies: + tslib "^1.8.1" + tsutils@^3.0.0, tsutils@^3.5.0: version "3.7.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.7.0.tgz#f97bdd2f109070bd1865467183e015b25734b477" @@ -9184,7 +9698,7 @@ typedoc-default-themes@^0.5.0: resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.5.0.tgz#6dc2433e78ed8bea8e887a3acde2f31785bd6227" integrity sha1-bcJDPnjti+qOiHo6zeLzF4W9Yic= -typedoc@^0.14.1: +typedoc@^0.14.2: version "0.14.2" resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.14.2.tgz#769f457f4f9e4bdb8b5f3b177c86b6a31d8c3dc3" integrity sha512-aEbgJXV8/KqaVhcedT7xG6d2r+mOvB5ep3eIz1KuB5sc4fDYXcepEEMdU7XSqLFO5hVPu0nllHi1QxX2h/QlpQ== @@ -9207,11 +9721,16 @@ typedoc@^0.14.1: typedoc-default-themes "^0.5.0" typescript "3.2.x" -typescript@3.2.x, typescript@^3.2.4: +typescript@3.2.x: version "3.2.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.4.tgz#c585cb952912263d915b462726ce244ba510ef3d" integrity sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg== +typescript@^3.4.1: + version "3.4.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.1.tgz#b6691be11a881ffa9a05765a205cb7383f3b63c6" + integrity sha512-3NSMb2VzDQm8oBTLH6Nj55VVtUEpe/rgkIzMir0qVoLyjDZlnMBva0U6vDiV3IH+sl/Yu6oP5QwsAQtHPmDd2Q== + ua-parser-js@^0.7.18: version "0.7.19" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.19.tgz#94151be4c0a7fb1d001af7022fdaca4642659e4b" @@ -9307,6 +9826,13 @@ unique-string@^1.0.0: dependencies: crypto-random-string "^1.0.0" +universal-user-agent@^2.0.0, universal-user-agent@^2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-2.0.3.tgz#9f6f09f9cc33de867bb720d84c08069b14937c6c" + integrity sha512-eRHEHhChCBHrZsA4WEhdgiOKgdvgrMIHwnwnqD0r5C6AO8kwKcG7qSku3iXdhvHL3YvsS9ZkSGN8h/hIpoFC8g== + dependencies: + os-name "^3.0.0" + universalify@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" @@ -9335,7 +9861,7 @@ upath@^1.0.5: resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" integrity sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw== -update-notifier@^2.2.0: +update-notifier@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.5.0.tgz#d0744593e13f161e406acb1d9408b72cad08aff6" integrity sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw== @@ -9370,6 +9896,11 @@ url-parse-lax@^1.0.0: dependencies: prepend-http "^1.0.1" +url-template@^2.0.8: + version "2.0.8" + resolved "https://registry.yarnpkg.com/url-template/-/url-template-2.0.8.tgz#fc565a3cccbff7730c775f5641f9555791439f21" + integrity sha1-/FZaPMy/93MMd19WQflVV5FDnyE= + urlgrey@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/urlgrey/-/urlgrey-0.4.4.tgz#892fe95960805e85519f1cd4389f2cb4cbb7652f" @@ -9475,14 +10006,14 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which@1, which@^1.2.10, which@^1.2.9, which@^1.3.0, which@^1.3.1: +which@1, which@1.3.1, which@^1.2.10, which@^1.2.14, which@^1.2.9, which@^1.3.0, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== dependencies: isexe "^2.0.0" -wide-align@^1.1.0: +wide-align@1.1.3, wide-align@^1.1.0: version "1.1.3" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== @@ -9496,6 +10027,13 @@ widest-line@^2.0.0: dependencies: string-width "^2.1.1" +windows-release@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/windows-release/-/windows-release-3.1.0.tgz#8d4a7e266cbf5a233f6c717dac19ce00af36e12e" + integrity sha512-hBb7m7acFgQPQc222uEQTmdcGLeBmQLNLFIh0rDk3CwFOBrfjefLzEfEfmpMq8Af/n/GnFf3eYf203FY1PmudA== + dependencies: + execa "^0.10.0" + wordwrap@^1.0.0, wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" @@ -9536,7 +10074,7 @@ write-file-atomic@^1.2.0: imurmurhash "^0.1.4" slide "^1.1.5" -write-file-atomic@^2.0.0, write-file-atomic@^2.3.0: +write-file-atomic@^2.0.0, write-file-atomic@^2.3.0, write-file-atomic@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.2.tgz#a7181706dfba17855d221140a9c06e15fcdd87b9" integrity sha512-s0b6vB3xIVRLWywa6X9TOMA7k9zio0TMOsl9ZnDkliA/cfJlpHXAscj0gbHVJiTdIuAYpIyqS5GW91fqm6gG5g== @@ -9565,10 +10103,10 @@ write-pkg@^3.1.0: sort-keys "^2.0.0" write-json-file "^2.2.0" -write@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" - integrity sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c= +write@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" + integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== dependencies: mkdirp "^0.5.1" @@ -9656,7 +10194,7 @@ yallist@^3.0.0, yallist@^3.0.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== -yargs-parser@^11.1.1: +yargs-parser@11.1.1, yargs-parser@^11.1.1: version "11.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4" integrity sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ== @@ -9664,6 +10202,14 @@ yargs-parser@^11.1.1: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^13.0.0: + version "13.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.0.0.tgz#3fc44f3e76a8bdb1cc3602e860108602e5ccde8b" + integrity sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + yargs-parser@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" @@ -9671,32 +10217,16 @@ yargs-parser@^7.0.0: dependencies: camelcase "^4.1.0" -yargs-parser@^9.0.2: - version "9.0.2" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" - integrity sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc= +yargs-unparser@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.5.0.tgz#f2bb2a7e83cbc87bb95c8e572828a06c9add6e0d" + integrity sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw== dependencies: - camelcase "^4.1.0" + flat "^4.1.0" + lodash "^4.17.11" + yargs "^12.0.5" -yargs@11.1.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" - integrity sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A== - dependencies: - cliui "^4.0.0" - decamelize "^1.1.1" - find-up "^2.1.0" - get-caller-file "^1.0.1" - os-locale "^2.0.0" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^2.0.0" - which-module "^2.0.0" - y18n "^3.2.1" - yargs-parser "^9.0.2" - -yargs@^12.0.1: +yargs@12.0.5, yargs@^12.0.1, yargs@^12.0.5: version "12.0.5" resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== @@ -9714,6 +10244,23 @@ yargs@^12.0.1: y18n "^3.2.1 || ^4.0.0" yargs-parser "^11.1.1" +yargs@^13.0.0: + version "13.2.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.2.2.tgz#0c101f580ae95cea7f39d927e7770e3fdc97f993" + integrity sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA== + dependencies: + cliui "^4.0.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + os-locale "^3.1.0" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^3.0.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^13.0.0" + yargs@^9.0.0: version "9.0.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-9.0.1.tgz#52acc23feecac34042078ee78c0c007f5085db4c" @@ -9732,3 +10279,15 @@ yargs@^9.0.0: which-module "^2.0.0" y18n "^3.2.1" yargs-parser "^7.0.0" + +yup@^0.26.10: + version "0.26.10" + resolved "https://registry.yarnpkg.com/yup/-/yup-0.26.10.tgz#3545839663289038faf25facfc07e11fd67c0cb1" + integrity sha512-keuNEbNSnsOTOuGCt3UJW69jDE3O4P+UHAakO7vSeFMnjaitcmlbij/a3oNb9g1Y1KvSKH/7O1R2PQ4m4TRylw== + dependencies: + "@babel/runtime" "7.0.0" + fn-name "~2.0.1" + lodash "^4.17.10" + property-expr "^1.5.0" + synchronous-promise "^2.0.5" + toposort "^2.0.2"