@firebase/auth 0.19.6 → 0.19.7-canary.4605d4bfa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/auth-public.d.ts +10 -0
  3. package/dist/auth.d.ts +10 -0
  4. package/dist/cordova/index.doc.d.ts +1 -1
  5. package/dist/cordova/index.js +2 -2
  6. package/dist/cordova/internal.js +2 -2
  7. package/dist/cordova/{popup_redirect-0a21dcc2.js → popup_redirect-b2636a35.js} +10 -13
  8. package/dist/cordova/popup_redirect-b2636a35.js.map +1 -0
  9. package/dist/cordova/src/mfa/mfa_info.d.ts +3 -3
  10. package/dist/cordova/src/model/public_types.d.ts +9 -0
  11. package/dist/cordova/src/model/user.d.ts +1 -0
  12. package/dist/esm2017/{index-bc414788.js → index-d97deb40.js} +6 -9
  13. package/dist/esm2017/index-d97deb40.js.map +1 -0
  14. package/dist/esm2017/index.doc.d.ts +1 -1
  15. package/dist/esm2017/index.js +1 -1
  16. package/dist/esm2017/internal.js +2 -2
  17. package/dist/esm2017/src/mfa/mfa_info.d.ts +3 -3
  18. package/dist/esm2017/src/model/public_types.d.ts +9 -0
  19. package/dist/esm2017/src/model/user.d.ts +1 -0
  20. package/dist/esm5/{index-fb0ec9ba.js → index-4d74b42c.js} +10 -13
  21. package/dist/esm5/index-4d74b42c.js.map +1 -0
  22. package/dist/esm5/index.doc.d.ts +1 -1
  23. package/dist/esm5/index.js +1 -1
  24. package/dist/esm5/internal.js +2 -2
  25. package/dist/esm5/src/mfa/mfa_info.d.ts +3 -3
  26. package/dist/esm5/src/model/public_types.d.ts +9 -0
  27. package/dist/esm5/src/model/user.d.ts +1 -0
  28. package/dist/index.doc.d.ts +1 -1
  29. package/dist/index.webworker.esm5.js +9 -12
  30. package/dist/index.webworker.esm5.js.map +1 -1
  31. package/dist/node/{index-45556172.js → index-3e647c7e.js} +10 -13
  32. package/dist/node/index-3e647c7e.js.map +1 -0
  33. package/dist/node/index.doc.d.ts +1 -1
  34. package/dist/node/index.js +1 -1
  35. package/dist/node/internal.js +1 -1
  36. package/dist/node/src/mfa/mfa_info.d.ts +3 -3
  37. package/dist/node/src/model/public_types.d.ts +9 -0
  38. package/dist/node/src/model/user.d.ts +1 -0
  39. package/dist/node-esm/{index-c4fe16cb.js → index-ed250c5c.js} +6 -9
  40. package/dist/node-esm/index-ed250c5c.js.map +1 -0
  41. package/dist/node-esm/index.doc.d.ts +1 -1
  42. package/dist/node-esm/index.js +1 -1
  43. package/dist/node-esm/internal.js +2 -2
  44. package/dist/node-esm/src/mfa/mfa_info.d.ts +3 -3
  45. package/dist/node-esm/src/model/public_types.d.ts +9 -0
  46. package/dist/node-esm/src/model/user.d.ts +1 -0
  47. package/dist/rn/index.doc.d.ts +1 -1
  48. package/dist/rn/index.js +51 -3
  49. package/dist/rn/index.js.map +1 -1
  50. package/dist/rn/internal.js +1 -1
  51. package/dist/rn/{phone-3071a546.js → phone-a153e858.js} +10 -13
  52. package/dist/rn/phone-a153e858.js.map +1 -0
  53. package/dist/rn/src/mfa/mfa_info.d.ts +3 -3
  54. package/dist/rn/src/model/public_types.d.ts +9 -0
  55. package/dist/rn/src/model/user.d.ts +1 -0
  56. package/dist/src/mfa/mfa_info.d.ts +3 -3
  57. package/dist/src/model/public_types.d.ts +9 -0
  58. package/dist/src/model/user.d.ts +1 -0
  59. package/package.json +7 -7
  60. package/dist/cordova/popup_redirect-0a21dcc2.js.map +0 -1
  61. package/dist/esm2017/index-bc414788.js.map +0 -1
  62. package/dist/esm5/index-fb0ec9ba.js.map +0 -1
  63. package/dist/node/index-45556172.js.map +0 -1
  64. package/dist/node-esm/index-c4fe16cb.js.map +0 -1
  65. package/dist/rn/phone-3071a546.js.map +0 -1
@@ -21,4 +21,4 @@
21
21
  */
22
22
  export * from './index';
23
23
  export { cordovaPopupRedirectResolver } from './index.cordova';
24
- export { reactNativeLocalPersistence } from './index.rn';
24
+ export { reactNativeLocalPersistence, getReactNativePersistence } from './index.rn';
@@ -1,4 +1,4 @@
1
- export { A as ActionCodeOperation, ac as ActionCodeURL, G as AuthCredential, C as AuthErrorCodes, H as EmailAuthCredential, L as EmailAuthProvider, M as FacebookAuthProvider, F as FactorId, Q as GithubAuthProvider, N as GoogleAuthProvider, I as OAuthCredential, T as OAuthProvider, O as OperationType, J as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, U as SAMLAuthProvider, S as SignInMethod, V as TwitterAuthProvider, a1 as applyActionCode, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a2 as checkActionCode, a0 as confirmPasswordReset, E as connectAuthEmulator, a4 as createUserWithEmailAndPassword, z as debugErrorMap, y as deleteUser, a9 as fetchSignInMethodsForEmail, ak as getAdditionalUserInfo, n as getAuth, ah as getIdToken, ai as getIdTokenResult, am as getMultiFactorResolver, j as getRedirectResult, K as inMemoryPersistence, i as indexedDBLocalPersistence, D as initializeAuth, a7 as isSignInWithEmailLink, Y as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, an as multiFactor, t as onAuthStateChanged, q as onIdTokenChanged, ad as parseActionCodeURL, B as prodErrorMap, Z as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, al as reload, aa as sendEmailVerification, $ as sendPasswordResetEmail, a6 as sendSignInLinkToEmail, p as setPersistence, W as signInAnonymously, X as signInWithCredential, _ as signInWithCustomToken, a5 as signInWithEmailAndPassword, a8 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, x as signOut, aj as unlink, w as updateCurrentUser, af as updateEmail, ag as updatePassword, u as updatePhoneNumber, ae as updateProfile, v as useDeviceLanguage, ab as verifyBeforeUpdateEmail, a3 as verifyPasswordResetCode } from './index-c4fe16cb.js';
1
+ export { A as ActionCodeOperation, ac as ActionCodeURL, G as AuthCredential, C as AuthErrorCodes, H as EmailAuthCredential, L as EmailAuthProvider, M as FacebookAuthProvider, F as FactorId, Q as GithubAuthProvider, N as GoogleAuthProvider, I as OAuthCredential, T as OAuthProvider, O as OperationType, J as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, U as SAMLAuthProvider, S as SignInMethod, V as TwitterAuthProvider, a1 as applyActionCode, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a2 as checkActionCode, a0 as confirmPasswordReset, E as connectAuthEmulator, a4 as createUserWithEmailAndPassword, z as debugErrorMap, y as deleteUser, a9 as fetchSignInMethodsForEmail, ak as getAdditionalUserInfo, n as getAuth, ah as getIdToken, ai as getIdTokenResult, am as getMultiFactorResolver, j as getRedirectResult, K as inMemoryPersistence, i as indexedDBLocalPersistence, D as initializeAuth, a7 as isSignInWithEmailLink, Y as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, an as multiFactor, t as onAuthStateChanged, q as onIdTokenChanged, ad as parseActionCodeURL, B as prodErrorMap, Z as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, al as reload, aa as sendEmailVerification, $ as sendPasswordResetEmail, a6 as sendSignInLinkToEmail, p as setPersistence, W as signInAnonymously, X as signInWithCredential, _ as signInWithCustomToken, a5 as signInWithEmailAndPassword, a8 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, x as signOut, aj as unlink, w as updateCurrentUser, af as updateEmail, ag as updatePassword, u as updatePhoneNumber, ae as updateProfile, v as useDeviceLanguage, ab as verifyBeforeUpdateEmail, a3 as verifyPasswordResetCode } from './index-ed250c5c.js';
2
2
  import '@firebase/util';
3
3
  import '@firebase/app';
4
4
  import 'tslib';
@@ -1,5 +1,5 @@
1
- import { ao as _getInstance, ap as _assert, aq as _signInWithCredential, ar as _reauthenticate, as as _link$1, G as AuthCredential, at as signInWithIdp, au as _fail, av as debugAssert, aw as _persistenceKeyName, ax as _castAuth, ay as FederatedAuthProvider, az as BaseOAuthProvider, aA as _emulatorUrl, aB as _performApiRequest, aC as _isIOS7Or8, aD as _isIOS, aE as _isAndroid, aF as _createError, aG as _isSafari, aH as _isIframe, aI as _isMobileBrowser, aJ as _isIE10 } from './index-c4fe16cb.js';
2
- export { A as ActionCodeOperation, ac as ActionCodeURL, G as AuthCredential, C as AuthErrorCodes, aL as AuthImpl, H as EmailAuthCredential, L as EmailAuthProvider, M as FacebookAuthProvider, F as FactorId, aN as FetchProvider, Q as GithubAuthProvider, N as GoogleAuthProvider, I as OAuthCredential, T as OAuthProvider, O as OperationType, J as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, aO as SAMLAuthCredential, U as SAMLAuthProvider, S as SignInMethod, V as TwitterAuthProvider, aK as UserImpl, ap as _assert, ax as _castAuth, au as _fail, aM as _getClientVersion, ao as _getInstance, aw as _persistenceKeyName, a1 as applyActionCode, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a2 as checkActionCode, a0 as confirmPasswordReset, E as connectAuthEmulator, a4 as createUserWithEmailAndPassword, z as debugErrorMap, y as deleteUser, a9 as fetchSignInMethodsForEmail, ak as getAdditionalUserInfo, n as getAuth, ah as getIdToken, ai as getIdTokenResult, am as getMultiFactorResolver, j as getRedirectResult, K as inMemoryPersistence, i as indexedDBLocalPersistence, D as initializeAuth, a7 as isSignInWithEmailLink, Y as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, an as multiFactor, t as onAuthStateChanged, q as onIdTokenChanged, ad as parseActionCodeURL, B as prodErrorMap, Z as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, al as reload, aa as sendEmailVerification, $ as sendPasswordResetEmail, a6 as sendSignInLinkToEmail, p as setPersistence, W as signInAnonymously, X as signInWithCredential, _ as signInWithCustomToken, a5 as signInWithEmailAndPassword, a8 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, x as signOut, aj as unlink, w as updateCurrentUser, af as updateEmail, ag as updatePassword, u as updatePhoneNumber, ae as updateProfile, v as useDeviceLanguage, ab as verifyBeforeUpdateEmail, a3 as verifyPasswordResetCode } from './index-c4fe16cb.js';
1
+ import { ao as _getInstance, ap as _assert, aq as _signInWithCredential, ar as _reauthenticate, as as _link$1, G as AuthCredential, at as signInWithIdp, au as _fail, av as debugAssert, aw as _persistenceKeyName, ax as _castAuth, ay as FederatedAuthProvider, az as BaseOAuthProvider, aA as _emulatorUrl, aB as _performApiRequest, aC as _isIOS7Or8, aD as _isIOS, aE as _isAndroid, aF as _createError, aG as _isSafari, aH as _isIframe, aI as _isMobileBrowser, aJ as _isIE10 } from './index-ed250c5c.js';
2
+ export { A as ActionCodeOperation, ac as ActionCodeURL, G as AuthCredential, C as AuthErrorCodes, aL as AuthImpl, H as EmailAuthCredential, L as EmailAuthProvider, M as FacebookAuthProvider, F as FactorId, aN as FetchProvider, Q as GithubAuthProvider, N as GoogleAuthProvider, I as OAuthCredential, T as OAuthProvider, O as OperationType, J as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, aO as SAMLAuthCredential, U as SAMLAuthProvider, S as SignInMethod, V as TwitterAuthProvider, aK as UserImpl, ap as _assert, ax as _castAuth, au as _fail, aM as _getClientVersion, ao as _getInstance, aw as _persistenceKeyName, a1 as applyActionCode, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a2 as checkActionCode, a0 as confirmPasswordReset, E as connectAuthEmulator, a4 as createUserWithEmailAndPassword, z as debugErrorMap, y as deleteUser, a9 as fetchSignInMethodsForEmail, ak as getAdditionalUserInfo, n as getAuth, ah as getIdToken, ai as getIdTokenResult, am as getMultiFactorResolver, j as getRedirectResult, K as inMemoryPersistence, i as indexedDBLocalPersistence, D as initializeAuth, a7 as isSignInWithEmailLink, Y as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, an as multiFactor, t as onAuthStateChanged, q as onIdTokenChanged, ad as parseActionCodeURL, B as prodErrorMap, Z as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, al as reload, aa as sendEmailVerification, $ as sendPasswordResetEmail, a6 as sendSignInLinkToEmail, p as setPersistence, W as signInAnonymously, X as signInWithCredential, _ as signInWithCustomToken, a5 as signInWithEmailAndPassword, a8 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, x as signOut, aj as unlink, w as updateCurrentUser, af as updateEmail, ag as updatePassword, u as updatePhoneNumber, ae as updateProfile, v as useDeviceLanguage, ab as verifyBeforeUpdateEmail, a3 as verifyPasswordResetCode } from './index-ed250c5c.js';
3
3
  import { querystring, isEmpty, getUA, querystringDecode } from '@firebase/util';
4
4
  import 'tslib';
5
5
  import { SDK_VERSION } from '@firebase/app';
@@ -14,7 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { FactorId, MultiFactorInfo } from '../model/public_types';
17
+ import { FactorId, MultiFactorInfo, PhoneMultiFactorInfo } from '../model/public_types';
18
18
  import { MfaEnrollment } from '../api/account_management/mfa';
19
19
  import { AuthInternal } from '../model/auth';
20
20
  export declare abstract class MultiFactorInfoImpl implements MultiFactorInfo {
@@ -25,8 +25,8 @@ export declare abstract class MultiFactorInfoImpl implements MultiFactorInfo {
25
25
  protected constructor(factorId: FactorId, response: MfaEnrollment);
26
26
  static _fromServerResponse(auth: AuthInternal, enrollment: MfaEnrollment): MultiFactorInfoImpl;
27
27
  }
28
- export declare class PhoneMultiFactorInfo extends MultiFactorInfoImpl {
28
+ export declare class PhoneMultiFactorInfoImpl extends MultiFactorInfoImpl implements PhoneMultiFactorInfo {
29
29
  readonly phoneNumber: string;
30
30
  private constructor();
31
- static _fromServerResponse(_auth: AuthInternal, enrollment: MfaEnrollment): PhoneMultiFactorInfo;
31
+ static _fromServerResponse(_auth: AuthInternal, enrollment: MfaEnrollment): PhoneMultiFactorInfoImpl;
32
32
  }
@@ -585,6 +585,15 @@ export interface MultiFactorInfo {
585
585
  /** The identifier of the second factor. */
586
586
  readonly factorId: typeof FactorIdMap[keyof typeof FactorIdMap];
587
587
  }
588
+ /**
589
+ * The subclass of the {@link MultiFactorInfo} interface for phone number
590
+ * second factors. The factorId of this second factor is {@link FactorId.PHONE}.
591
+ * @public
592
+ */
593
+ export interface PhoneMultiFactorInfo extends MultiFactorInfo {
594
+ /** The phone number associated with the current second factor. */
595
+ readonly phoneNumber: string;
596
+ }
588
597
  /**
589
598
  * The class used to facilitate recovery from {@link MultiFactorError} when a user needs to
590
599
  * provide a second factor to sign in.
@@ -38,6 +38,7 @@ export interface UserParameters {
38
38
  isAnonymous?: boolean | null;
39
39
  emailVerified?: boolean | null;
40
40
  tenantId?: string | null;
41
+ providerData?: MutableUserInfo[] | null;
41
42
  createdAt?: string | null;
42
43
  lastLoginAt?: string | null;
43
44
  }
@@ -21,4 +21,4 @@
21
21
  */
22
22
  export * from './index';
23
23
  export { cordovaPopupRedirectResolver } from './index.cordova';
24
- export { reactNativeLocalPersistence } from './index.rn';
24
+ export { reactNativeLocalPersistence, getReactNativePersistence } from './index.rn';
package/dist/rn/index.js CHANGED
@@ -2,14 +2,34 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var reactNative = require('react-native');
5
+ var ReactNative = require('react-native');
6
6
  var app = require('@firebase/app');
7
- var phone = require('./phone-3071a546.js');
7
+ var phone = require('./phone-a153e858.js');
8
8
  var tslib = require('tslib');
9
9
  require('@firebase/util');
10
10
  require('@firebase/component');
11
11
  require('@firebase/logger');
12
12
 
13
+ function _interopNamespace(e) {
14
+ if (e && e.__esModule) return e;
15
+ var n = Object.create(null);
16
+ if (e) {
17
+ Object.keys(e).forEach(function (k) {
18
+ if (k !== 'default') {
19
+ var d = Object.getOwnPropertyDescriptor(e, k);
20
+ Object.defineProperty(n, k, d.get ? d : {
21
+ enumerable: true,
22
+ get: function () { return e[k]; }
23
+ });
24
+ }
25
+ });
26
+ }
27
+ n["default"] = e;
28
+ return Object.freeze(n);
29
+ }
30
+
31
+ var ReactNative__namespace = /*#__PURE__*/_interopNamespace(ReactNative);
32
+
13
33
  /**
14
34
  * @license
15
35
  * Copyright 2019 Google LLC
@@ -124,7 +144,35 @@ function getReactNativePersistence(storage) {
124
144
  *
125
145
  * @public
126
146
  */
127
- var reactNativeLocalPersistence = getReactNativePersistence(reactNative.AsyncStorage);
147
+ var reactNativeLocalPersistence = getReactNativePersistence({
148
+ getItem: function () {
149
+ var _a;
150
+ var args = [];
151
+ for (var _i = 0; _i < arguments.length; _i++) {
152
+ args[_i] = arguments[_i];
153
+ }
154
+ // Called inline to avoid deprecation warnings on startup.
155
+ return (_a = ReactNative__namespace.AsyncStorage).getItem.apply(_a, args);
156
+ },
157
+ setItem: function () {
158
+ var _a;
159
+ var args = [];
160
+ for (var _i = 0; _i < arguments.length; _i++) {
161
+ args[_i] = arguments[_i];
162
+ }
163
+ // Called inline to avoid deprecation warnings on startup.
164
+ return (_a = ReactNative__namespace.AsyncStorage).setItem.apply(_a, args);
165
+ },
166
+ removeItem: function () {
167
+ var _a;
168
+ var args = [];
169
+ for (var _i = 0; _i < arguments.length; _i++) {
170
+ args[_i] = arguments[_i];
171
+ }
172
+ // Called inline to avoid deprecation warnings on startup.
173
+ return (_a = ReactNative__namespace.AsyncStorage).removeItem.apply(_a, args);
174
+ },
175
+ });
128
176
  function getAuth(app$1) {
129
177
  if (app$1 === void 0) { app$1 = app.getApp(); }
130
178
  var provider = app._getProvider(app$1, 'auth');
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/platform_react_native/persistence/react_native.ts","../../index.rn.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Persistence, ReactNativeAsyncStorage } from '../../model/public_types';\n\nimport {\n PersistenceInternal,\n PersistenceType,\n PersistenceValue,\n STORAGE_AVAILABLE_KEY,\n StorageEventListener\n} from '../../core/persistence';\n\n/**\n * Returns a persistence object that wraps AsyncStorage imported from\n * `react-native` or `@react-native-community/async-storage`, and can\n * be used in the persistence dependency field in {@link initializeAuth}.\n * \n * @public\n */\nexport function getReactNativePersistence(\n storage: ReactNativeAsyncStorage\n): Persistence {\n // In the _getInstance() implementation (see src/core/persistence/index.ts),\n // we expect each \"externs.Persistence\" object passed to us by the user to\n // be able to be instantiated (as a class) using \"new\". That function also\n // expects the constructor to be empty. Since ReactNativeStorage requires the\n // underlying storage layer, we need to be able to create subclasses\n // (closures, esentially) that have the storage layer but empty constructor.\n return class implements PersistenceInternal {\n static type: 'LOCAL' = 'LOCAL';\n readonly type: PersistenceType = PersistenceType.LOCAL;\n\n async _isAvailable(): Promise<boolean> {\n try {\n if (!storage) {\n return false;\n }\n await storage.setItem(STORAGE_AVAILABLE_KEY, '1');\n await storage.removeItem(STORAGE_AVAILABLE_KEY);\n return true;\n } catch {\n return false;\n }\n }\n\n _set(key: string, value: PersistenceValue): Promise<void> {\n return storage.setItem(key, JSON.stringify(value));\n }\n\n async _get<T extends PersistenceValue>(key: string): Promise<T | null> {\n const json = await storage.getItem(key);\n return json ? JSON.parse(json) : null;\n }\n\n _remove(key: string): Promise<void> {\n return storage.removeItem(key);\n }\n\n _addListener(_key: string, _listener: StorageEventListener): void {\n // Listeners are not supported for React Native storage.\n return;\n }\n\n _removeListener(_key: string, _listener: StorageEventListener): void {\n // Listeners are not supported for React Native storage.\n return;\n }\n };\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * This is the file that people using React Native will actually import. You\n * should only include this file if you have something specific about your\n * implementation that mandates having a separate entrypoint. Otherwise you can\n * just use index.ts\n */\n\nimport { AsyncStorage } from 'react-native';\n\nimport { FirebaseApp, getApp, _getProvider } from '@firebase/app';\nimport { Auth, Persistence } from './src/model/public_types';\n\nimport { initializeAuth } from './src';\nimport { registerAuth } from './src/core/auth/register';\nimport { ClientPlatform } from './src/core/util/version';\nimport { getReactNativePersistence } from './src/platform_react_native/persistence/react_native';\n\n// Core functionality shared by all clients\nexport * from './index.shared';\n\n// Export some Phone symbols\n// providers\nexport { PhoneAuthProvider } from './src/platform_browser/providers/phone';\n\n// strategies\nexport {\n signInWithPhoneNumber,\n linkWithPhoneNumber,\n reauthenticateWithPhoneNumber,\n updatePhoneNumber\n} from './src/platform_browser/strategies/phone';\n\n// MFA\nexport { PhoneMultiFactorGenerator } from './src/platform_browser/mfa/assertions/phone';\n\n/**\n * An implementation of {@link Persistence} of type 'LOCAL' for use in React\n * Native environments.\n *\n * @public\n */\nexport const reactNativeLocalPersistence: Persistence =\n getReactNativePersistence(AsyncStorage);\n\nexport {getReactNativePersistence};\n\nexport function getAuth(app: FirebaseApp = getApp()): Auth {\n const provider = _getProvider(app, 'auth');\n\n if (provider.isInitialized()) {\n return provider.getImmediate();\n }\n\n return initializeAuth(app, {\n persistence: reactNativeLocalPersistence\n });\n}\n\nregisterAuth(ClientPlatform.REACT_NATIVE);\n"],"names":["STORAGE_AVAILABLE_KEY","AsyncStorage","app","getApp","_getProvider","initializeAuth","registerAuth"],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;AA2BA;;;;;;;SAOgB,yBAAyB,CACvC,OAAgC;;;;;;;;IAQhC;YAAO;gBAEI,SAAI,uBAA0C;aAqCxD;YAnCO,8BAAY,GAAlB;;;;;;gCAEI,IAAI,CAAC,OAAO,EAAE;oCACZ,sBAAO,KAAK,EAAC;iCACd;gCACD,qBAAM,OAAO,CAAC,OAAO,CAACA,2BAAqB,EAAE,GAAG,CAAC,EAAA;;gCAAjD,SAAiD,CAAC;gCAClD,qBAAM,OAAO,CAAC,UAAU,CAACA,2BAAqB,CAAC,EAAA;;gCAA/C,SAA+C,CAAC;gCAChD,sBAAO,IAAI,EAAC;;;gCAEZ,sBAAO,KAAK,EAAC;;;;;aAEhB;YAED,sBAAI,GAAJ,UAAK,GAAW,EAAE,KAAuB;gBACvC,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;aACpD;YAEK,sBAAI,GAAV,UAAuC,GAAW;;;;;oCACnC,qBAAM,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAA;;gCAAjC,IAAI,GAAG,SAA0B;gCACvC,sBAAO,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,EAAC;;;;aACvC;YAED,yBAAO,GAAP,UAAQ,GAAW;gBACjB,OAAO,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;aAChC;YAED,8BAAY,GAAZ,UAAa,IAAY,EAAE,SAA+B;;gBAExD,OAAO;aACR;YAED,iCAAe,GAAf,UAAgB,IAAY,EAAE,SAA+B;;gBAE3D,OAAO;aACR;YACH,cAAC;SAAA;QAtCQ,OAAI,GAAY,OAAQ;WAsC/B;AACJ;;ACnFA;;;;;;;;;;;;;;;;AAoDA;;;;;;IAMa,2BAA2B,GACtC,yBAAyB,CAACC,wBAAY,EAAE;SAI1B,OAAO,CAACC,KAA2B;IAA3B,sBAAA,EAAAA,QAAmBC,UAAM,EAAE;IACjD,IAAM,QAAQ,GAAGC,gBAAY,CAACF,KAAG,EAAE,MAAM,CAAC,CAAC;IAE3C,IAAI,QAAQ,CAAC,aAAa,EAAE,EAAE;QAC5B,OAAO,QAAQ,CAAC,YAAY,EAAE,CAAC;KAChC;IAED,OAAOG,oBAAc,CAACH,KAAG,EAAE;QACzB,WAAW,EAAE,2BAA2B;KACzC,CAAC,CAAC;AACL,CAAC;AAEDI,kBAAY,kCAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/platform_react_native/persistence/react_native.ts","../../index.rn.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Persistence, ReactNativeAsyncStorage } from '../../model/public_types';\n\nimport {\n PersistenceInternal,\n PersistenceType,\n PersistenceValue,\n STORAGE_AVAILABLE_KEY,\n StorageEventListener\n} from '../../core/persistence';\n\n/**\n * Returns a persistence object that wraps AsyncStorage imported from\n * `react-native` or `@react-native-community/async-storage`, and can\n * be used in the persistence dependency field in {@link initializeAuth}.\n * \n * @public\n */\nexport function getReactNativePersistence(\n storage: ReactNativeAsyncStorage\n): Persistence {\n // In the _getInstance() implementation (see src/core/persistence/index.ts),\n // we expect each \"externs.Persistence\" object passed to us by the user to\n // be able to be instantiated (as a class) using \"new\". That function also\n // expects the constructor to be empty. Since ReactNativeStorage requires the\n // underlying storage layer, we need to be able to create subclasses\n // (closures, esentially) that have the storage layer but empty constructor.\n return class implements PersistenceInternal {\n static type: 'LOCAL' = 'LOCAL';\n readonly type: PersistenceType = PersistenceType.LOCAL;\n\n async _isAvailable(): Promise<boolean> {\n try {\n if (!storage) {\n return false;\n }\n await storage.setItem(STORAGE_AVAILABLE_KEY, '1');\n await storage.removeItem(STORAGE_AVAILABLE_KEY);\n return true;\n } catch {\n return false;\n }\n }\n\n _set(key: string, value: PersistenceValue): Promise<void> {\n return storage.setItem(key, JSON.stringify(value));\n }\n\n async _get<T extends PersistenceValue>(key: string): Promise<T | null> {\n const json = await storage.getItem(key);\n return json ? JSON.parse(json) : null;\n }\n\n _remove(key: string): Promise<void> {\n return storage.removeItem(key);\n }\n\n _addListener(_key: string, _listener: StorageEventListener): void {\n // Listeners are not supported for React Native storage.\n return;\n }\n\n _removeListener(_key: string, _listener: StorageEventListener): void {\n // Listeners are not supported for React Native storage.\n return;\n }\n };\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * This is the file that people using React Native will actually import. You\n * should only include this file if you have something specific about your\n * implementation that mandates having a separate entrypoint. Otherwise you can\n * just use index.ts\n */\n\nimport * as ReactNative from 'react-native';\n\nimport { FirebaseApp, getApp, _getProvider } from '@firebase/app';\nimport { Auth, Persistence } from './src/model/public_types';\n\nimport { initializeAuth } from './src';\nimport { registerAuth } from './src/core/auth/register';\nimport { ClientPlatform } from './src/core/util/version';\nimport { getReactNativePersistence } from './src/platform_react_native/persistence/react_native';\n\n// Core functionality shared by all clients\nexport * from './index.shared';\n\n// Export some Phone symbols\n// providers\nexport { PhoneAuthProvider } from './src/platform_browser/providers/phone';\n\n// strategies\nexport {\n signInWithPhoneNumber,\n linkWithPhoneNumber,\n reauthenticateWithPhoneNumber,\n updatePhoneNumber\n} from './src/platform_browser/strategies/phone';\n\n// MFA\nexport { PhoneMultiFactorGenerator } from './src/platform_browser/mfa/assertions/phone';\n\n/**\n * An implementation of {@link Persistence} of type 'LOCAL' for use in React\n * Native environments.\n *\n * @public\n */\nexport const reactNativeLocalPersistence: Persistence =\n getReactNativePersistence({\n getItem(...args) {\n // Called inline to avoid deprecation warnings on startup.\n return ReactNative.AsyncStorage.getItem(...args);\n },\n setItem(...args) {\n // Called inline to avoid deprecation warnings on startup.\n return ReactNative.AsyncStorage.setItem(...args);\n },\n removeItem(...args) {\n // Called inline to avoid deprecation warnings on startup.\n return ReactNative.AsyncStorage.removeItem(...args);\n },\n });\n\nexport {getReactNativePersistence};\n\nexport function getAuth(app: FirebaseApp = getApp()): Auth {\n const provider = _getProvider(app, 'auth');\n\n if (provider.isInitialized()) {\n return provider.getImmediate();\n }\n\n return initializeAuth(app, {\n persistence: reactNativeLocalPersistence\n });\n}\n\nregisterAuth(ClientPlatform.REACT_NATIVE);\n"],"names":["STORAGE_AVAILABLE_KEY","ReactNative","app","getApp","_getProvider","initializeAuth","registerAuth"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;AA2BA;;;;;;;SAOgB,yBAAyB,CACvC,OAAgC;;;;;;;;IAQhC;YAAO;gBAEI,SAAI,uBAA0C;aAqCxD;YAnCO,8BAAY,GAAlB;;;;;;gCAEI,IAAI,CAAC,OAAO,EAAE;oCACZ,sBAAO,KAAK,EAAC;iCACd;gCACD,qBAAM,OAAO,CAAC,OAAO,CAACA,2BAAqB,EAAE,GAAG,CAAC,EAAA;;gCAAjD,SAAiD,CAAC;gCAClD,qBAAM,OAAO,CAAC,UAAU,CAACA,2BAAqB,CAAC,EAAA;;gCAA/C,SAA+C,CAAC;gCAChD,sBAAO,IAAI,EAAC;;;gCAEZ,sBAAO,KAAK,EAAC;;;;;aAEhB;YAED,sBAAI,GAAJ,UAAK,GAAW,EAAE,KAAuB;gBACvC,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;aACpD;YAEK,sBAAI,GAAV,UAAuC,GAAW;;;;;oCACnC,qBAAM,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAA;;gCAAjC,IAAI,GAAG,SAA0B;gCACvC,sBAAO,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,EAAC;;;;aACvC;YAED,yBAAO,GAAP,UAAQ,GAAW;gBACjB,OAAO,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;aAChC;YAED,8BAAY,GAAZ,UAAa,IAAY,EAAE,SAA+B;;gBAExD,OAAO;aACR;YAED,iCAAe,GAAf,UAAgB,IAAY,EAAE,SAA+B;;gBAE3D,OAAO;aACR;YACH,cAAC;SAAA;QAtCQ,OAAI,GAAY,OAAQ;WAsC/B;AACJ;;ACnFA;;;;;;;;;;;;;;;;AAoDA;;;;;;IAMa,2BAA2B,GACtC,yBAAyB,CAAC;IACxB,OAAO;;QAAC,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;;QAEb,OAAO,CAAA,KAAAC,sBAAW,CAAC,YAAY,EAAC,OAAO,WAAI,IAAI,EAAE;KAClD;IACD,OAAO;;QAAC,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;;QAEb,OAAO,CAAA,KAAAA,sBAAW,CAAC,YAAY,EAAC,OAAO,WAAI,IAAI,EAAE;KAClD;IACD,UAAU;;QAAC,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;;QAEhB,OAAO,CAAA,KAAAA,sBAAW,CAAC,YAAY,EAAC,UAAU,WAAI,IAAI,EAAE;KACrD;CACF,EAAE;SAIW,OAAO,CAACC,KAA2B;IAA3B,sBAAA,EAAAA,QAAmBC,UAAM,EAAE;IACjD,IAAM,QAAQ,GAAGC,gBAAY,CAACF,KAAG,EAAE,MAAM,CAAC,CAAC;IAE3C,IAAI,QAAQ,CAAC,aAAa,EAAE,EAAE;QAC5B,OAAO,QAAQ,CAAC,YAAY,EAAE,CAAC;KAChC;IAED,OAAOG,oBAAc,CAACH,KAAG,EAAE;QACzB,WAAW,EAAE,2BAA2B;KACzC,CAAC,CAAC;AACL,CAAC;AAEDI,kBAAY,kCAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var phone = require('./phone-3071a546.js');
5
+ var phone = require('./phone-a153e858.js');
6
6
  var tslib = require('tslib');
7
7
  var util = require('@firebase/util');
8
8
  var app = require('@firebase/app');
@@ -1701,10 +1701,6 @@ var UserImpl = /** @class */ (function () {
1701
1701
  var uid = _a.uid, auth = _a.auth, stsTokenManager = _a.stsTokenManager, opt = tslib.__rest(_a, ["uid", "auth", "stsTokenManager"]);
1702
1702
  // For the user object, provider is always Firebase.
1703
1703
  this.providerId = "firebase" /* FIREBASE */;
1704
- this.emailVerified = false;
1705
- this.isAnonymous = false;
1706
- this.tenantId = null;
1707
- this.providerData = [];
1708
1704
  this.proactiveRefresh = new ProactiveRefresh(this);
1709
1705
  this.reloadUserInfo = null;
1710
1706
  this.reloadListener = null;
@@ -1719,6 +1715,7 @@ var UserImpl = /** @class */ (function () {
1719
1715
  this.photoURL = opt.photoURL || null;
1720
1716
  this.isAnonymous = opt.isAnonymous || false;
1721
1717
  this.tenantId = opt.tenantId || null;
1718
+ this.providerData = opt.providerData ? tslib.__spreadArray([], opt.providerData) : [];
1722
1719
  this.metadata = new UserMetadata(opt.createdAt || undefined, opt.lastLoginAt || undefined);
1723
1720
  }
1724
1721
  UserImpl.prototype.getIdToken = function (forceRefresh) {
@@ -5431,23 +5428,23 @@ var MultiFactorInfoImpl = /** @class */ (function () {
5431
5428
  }
5432
5429
  MultiFactorInfoImpl._fromServerResponse = function (auth, enrollment) {
5433
5430
  if ('phoneInfo' in enrollment) {
5434
- return PhoneMultiFactorInfo._fromServerResponse(auth, enrollment);
5431
+ return PhoneMultiFactorInfoImpl._fromServerResponse(auth, enrollment);
5435
5432
  }
5436
5433
  return _fail(auth, "internal-error" /* INTERNAL_ERROR */);
5437
5434
  };
5438
5435
  return MultiFactorInfoImpl;
5439
5436
  }());
5440
- var PhoneMultiFactorInfo = /** @class */ (function (_super) {
5441
- tslib.__extends(PhoneMultiFactorInfo, _super);
5442
- function PhoneMultiFactorInfo(response) {
5437
+ var PhoneMultiFactorInfoImpl = /** @class */ (function (_super) {
5438
+ tslib.__extends(PhoneMultiFactorInfoImpl, _super);
5439
+ function PhoneMultiFactorInfoImpl(response) {
5443
5440
  var _this = _super.call(this, "phone" /* PHONE */, response) || this;
5444
5441
  _this.phoneNumber = response.phoneInfo;
5445
5442
  return _this;
5446
5443
  }
5447
- PhoneMultiFactorInfo._fromServerResponse = function (_auth, enrollment) {
5448
- return new PhoneMultiFactorInfo(enrollment);
5444
+ PhoneMultiFactorInfoImpl._fromServerResponse = function (_auth, enrollment) {
5445
+ return new PhoneMultiFactorInfoImpl(enrollment);
5449
5446
  };
5450
- return PhoneMultiFactorInfo;
5447
+ return PhoneMultiFactorInfoImpl;
5451
5448
  }(MultiFactorInfoImpl));
5452
5449
 
5453
5450
  /**
@@ -6789,7 +6786,7 @@ function multiFactor(user) {
6789
6786
  }
6790
6787
 
6791
6788
  var name = "@firebase/auth";
6792
- var version = "0.19.6";
6789
+ var version = "0.19.7-canary.4605d4bfa";
6793
6790
 
6794
6791
  /**
6795
6792
  * @license
@@ -8312,4 +8309,4 @@ exports.updateProfile = updateProfile;
8312
8309
  exports.useDeviceLanguage = useDeviceLanguage;
8313
8310
  exports.verifyBeforeUpdateEmail = verifyBeforeUpdateEmail;
8314
8311
  exports.verifyPasswordResetCode = verifyPasswordResetCode;
8315
- //# sourceMappingURL=phone-3071a546.js.map
8312
+ //# sourceMappingURL=phone-a153e858.js.map