From 8eff962cab608341a6f2fedc640a0e32d96f26e2 Mon Sep 17 00:00:00 2001 From: altaf-creator Date: Sun, 9 Nov 2025 11:15:19 +0800 Subject: pain --- .../auth/dist/node-esm/index.cordova.d.ts | 32 + .../@firebase/auth/dist/node-esm/index.d.ts | 38 + .../@firebase/auth/dist/node-esm/index.doc.d.ts | 24 + .../@firebase/auth/dist/node-esm/index.js | 6 + .../@firebase/auth/dist/node-esm/index.js.map | 1 + .../@firebase/auth/dist/node-esm/index.node.d.ts | 17 + .../@firebase/auth/dist/node-esm/index.rn.d.ts | 40 + .../@firebase/auth/dist/node-esm/index.shared.d.ts | 19 + .../auth/dist/node-esm/index.web-extension.d.ts | 31 + .../auth/dist/node-esm/index.webworker.d.ts | 21 + .../@firebase/auth/dist/node-esm/internal.js | 1440 ++++ .../@firebase/auth/dist/node-esm/internal.js.map | 1 + .../auth/dist/node-esm/internal/index.d.ts | 42 + .../@firebase/auth/dist/node-esm/package.json | 1 + .../auth/dist/node-esm/scripts/run_node_tests.d.ts | 17 + .../src/api/account_management/account.d.ts | 59 + .../api/account_management/email_and_password.d.ts | 49 + .../node-esm/src/api/account_management/mfa.d.ts | 107 + .../src/api/account_management/profile.d.ts | 29 + .../src/api/authentication/create_auth_uri.d.ts | 26 + .../src/api/authentication/custom_token.d.ts | 26 + .../src/api/authentication/email_and_password.d.ts | 86 + .../src/api/authentication/email_link.d.ts | 32 + .../dist/node-esm/src/api/authentication/idp.d.ts | 40 + .../dist/node-esm/src/api/authentication/mfa.d.ts | 73 + .../node-esm/src/api/authentication/recaptcha.d.ts | 34 + .../node-esm/src/api/authentication/sign_up.d.ts | 34 + .../dist/node-esm/src/api/authentication/sms.d.ts | 54 + .../node-esm/src/api/authentication/token.d.ts | 37 + .../auth/dist/node-esm/src/api/errors.d.ts | 129 + .../auth/dist/node-esm/src/api/index.d.ts | 101 + .../api/password_policy/get_password_policy.d.ts | 48 + .../src/api/project_config/get_project_config.d.ts | 25 + .../dist/node-esm/src/core/action_code_url.d.ts | 73 + .../node-esm/src/core/auth/auth_event_manager.d.ts | 34 + .../dist/node-esm/src/core/auth/auth_impl.d.ts | 133 + .../auth/dist/node-esm/src/core/auth/emulator.d.ts | 42 + .../node-esm/src/core/auth/firebase_internal.d.ts | 35 + .../dist/node-esm/src/core/auth/initialize.d.ts | 46 + .../dist/node-esm/src/core/auth/middleware.d.ts | 25 + .../src/core/auth/password_policy_impl.d.ts | 59 + .../auth/dist/node-esm/src/core/auth/register.d.ts | 23 + .../src/core/credentials/auth_credential.d.ts | 75 + .../dist/node-esm/src/core/credentials/email.d.ts | 60 + .../dist/node-esm/src/core/credentials/index.d.ts | 23 + .../dist/node-esm/src/core/credentials/oauth.d.ts | 81 + .../dist/node-esm/src/core/credentials/phone.d.ts | 52 + .../dist/node-esm/src/core/credentials/saml.d.ts | 52 + .../auth/dist/node-esm/src/core/errors.d.ts | 328 + .../auth/dist/node-esm/src/core/index.d.ts | 230 + .../node-esm/src/core/persistence/in_memory.d.ts | 35 + .../dist/node-esm/src/core/persistence/index.d.ts | 42 + .../core/persistence/persistence_user_manager.d.ts | 45 + .../dist/node-esm/src/core/providers/email.d.ts | 83 + .../dist/node-esm/src/core/providers/facebook.d.ts | 93 + .../node-esm/src/core/providers/federated.d.ts | 64 + .../dist/node-esm/src/core/providers/github.d.ts | 89 + .../dist/node-esm/src/core/providers/google.d.ts | 96 + .../dist/node-esm/src/core/providers/oauth.d.ts | 151 + .../dist/node-esm/src/core/providers/saml.d.ts | 62 + .../dist/node-esm/src/core/providers/twitter.d.ts | 103 + .../abstract_popup_redirect_operation.d.ts | 44 + .../src/core/strategies/action_code_settings.d.ts | 19 + .../node-esm/src/core/strategies/anonymous.d.ts | 32 + .../node-esm/src/core/strategies/credential.d.ts | 64 + .../node-esm/src/core/strategies/custom_token.d.ts | 37 + .../dist/node-esm/src/core/strategies/email.d.ts | 104 + .../src/core/strategies/email_and_password.d.ts | 139 + .../node-esm/src/core/strategies/email_link.d.ts | 107 + .../dist/node-esm/src/core/strategies/idp.d.ts | 32 + .../node-esm/src/core/strategies/redirect.d.ts | 36 + .../dist/node-esm/src/core/user/account_info.d.ts | 68 + .../src/core/user/additional_user_info.d.ts | 31 + .../node-esm/src/core/user/id_token_result.d.ts | 48 + .../dist/node-esm/src/core/user/invalidation.d.ts | 18 + .../dist/node-esm/src/core/user/link_unlink.d.ts | 30 + .../node-esm/src/core/user/proactive_refresh.d.ts | 34 + .../node-esm/src/core/user/reauthenticate.d.ts | 20 + .../auth/dist/node-esm/src/core/user/reload.d.ts | 29 + .../dist/node-esm/src/core/user/token_manager.d.ts | 50 + .../src/core/user/user_credential_impl.d.ts | 37 + .../dist/node-esm/src/core/user/user_impl.d.ts | 74 + .../dist/node-esm/src/core/user/user_metadata.d.ts | 27 + .../auth/dist/node-esm/src/core/util/assert.d.ts | 94 + .../auth/dist/node-esm/src/core/util/browser.d.ts | 50 + .../auth/dist/node-esm/src/core/util/delay.d.ts | 31 + .../auth/dist/node-esm/src/core/util/emulator.d.ts | 18 + .../auth/dist/node-esm/src/core/util/event_id.d.ts | 17 + .../node-esm/src/core/util/fetch_provider.d.ts | 25 + .../auth/dist/node-esm/src/core/util/handler.d.ts | 20 + .../dist/node-esm/src/core/util/instantiator.d.ts | 28 + .../auth/dist/node-esm/src/core/util/location.d.ts | 19 + .../auth/dist/node-esm/src/core/util/log.d.ts | 23 + .../dist/node-esm/src/core/util/navigator.d.ts | 21 + .../dist/node-esm/src/core/util/providers.d.ts | 23 + .../auth/dist/node-esm/src/core/util/resolver.d.ts | 25 + .../auth/dist/node-esm/src/core/util/time.d.ts | 17 + .../node-esm/src/core/util/validate_origin.d.ts | 18 + .../auth/dist/node-esm/src/core/util/version.d.ts | 31 + .../@firebase/auth/dist/node-esm/src/index.d.ts | 18 + .../dist/node-esm/src/mfa/assertions/totp.d.ts | 124 + .../auth/dist/node-esm/src/mfa/index.d.ts | 18 + .../auth/dist/node-esm/src/mfa/mfa_assertion.d.ts | 27 + .../auth/dist/node-esm/src/mfa/mfa_error.d.ts | 35 + .../auth/dist/node-esm/src/mfa/mfa_info.d.ts | 36 + .../auth/dist/node-esm/src/mfa/mfa_resolver.d.ts | 41 + .../auth/dist/node-esm/src/mfa/mfa_session.d.ts | 39 + .../auth/dist/node-esm/src/mfa/mfa_user.d.ts | 38 + .../node-esm/src/model/application_verifier.d.ts | 23 + .../auth/dist/node-esm/src/model/auth.d.ts | 90 + .../auth/dist/node-esm/src/model/enum_maps.d.ts | 98 + .../auth/dist/node-esm/src/model/enums.d.ts | 74 + .../auth/dist/node-esm/src/model/id_token.d.ts | 87 + .../dist/node-esm/src/model/password_policy.d.ts | 111 + .../dist/node-esm/src/model/popup_redirect.d.ts | 94 + .../auth/dist/node-esm/src/model/public_types.d.ts | 1291 ++++ .../auth/dist/node-esm/src/model/user.d.ts | 83 + .../node-esm/src/platform_browser/auth_window.d.ts | 37 + .../node-esm/src/platform_browser/iframe/gapi.d.ts | 19 + .../src/platform_browser/iframe/gapi.iframes.d.ts | 47 + .../src/platform_browser/iframe/iframe.d.ts | 18 + .../dist/node-esm/src/platform_browser/index.d.ts | 27 + .../node-esm/src/platform_browser/load_js.d.ts | 29 + .../src/platform_browser/messagechannel/index.d.ts | 87 + .../platform_browser/messagechannel/promise.d.ts | 33 + .../platform_browser/messagechannel/receiver.d.ts | 63 + .../platform_browser/messagechannel/sender.d.ts | 46 + .../src/platform_browser/mfa/assertions/phone.d.ts | 59 + .../src/platform_browser/persistence/browser.d.ts | 27 + .../persistence/cookie_storage.d.ts | 40 + .../platform_browser/persistence/indexed_db.d.ts | 33 + .../persistence/local_storage.d.ts | 25 + .../persistence/session_storage.d.ts | 24 + .../src/platform_browser/popup_redirect.d.ts | 27 + .../src/platform_browser/providers/phone.d.ts | 154 + .../src/platform_browser/recaptcha/recaptcha.d.ts | 78 + .../recaptcha/recaptcha_enterprise_verifier.d.ts | 45 + .../recaptcha/recaptcha_loader.d.ts | 49 + .../platform_browser/recaptcha/recaptcha_mock.d.ts | 66 + .../recaptcha/recaptcha_verifier.d.ts | 92 + .../src/platform_browser/strategies/phone.d.ts | 116 + .../src/platform_browser/strategies/popup.d.ts | 109 + .../src/platform_browser/strategies/redirect.d.ts | 176 + .../node-esm/src/platform_browser/util/popup.d.ts | 24 + .../node-esm/src/platform_browser/util/worker.d.ts | 20 + .../node-esm/src/platform_cordova/plugins.d.ts | 42 + .../platform_cordova/popup_redirect/events.d.ts | 39 + .../popup_redirect/popup_redirect.d.ts | 24 + .../src/platform_cordova/popup_redirect/utils.d.ts | 47 + .../src/platform_cordova/strategies/redirect.d.ts | 20 + .../dist/node-esm/src/platform_node/index.d.ts | 51 + .../persistence/react_native.d.ts | 25 + .../dist/node-esm/test/helpers/api/helper.d.ts | 22 + .../auth/dist/node-esm/test/helpers/delay.d.ts | 20 + .../helpers/erroring_unavailable_persistence.d.ts | 36 + .../node-esm/test/helpers/fake_service_worker.d.ts | 22 + .../node-esm/test/helpers/id_token_response.d.ts | 18 + .../dist/node-esm/test/helpers/iframe_event.d.ts | 19 + .../helpers/integration/emulator_rest_helpers.d.ts | 35 + .../node-esm/test/helpers/integration/helpers.d.ts | 32 + .../test/helpers/integration/settings.d.ts | 23 + .../auth/dist/node-esm/test/helpers/jwt.d.ts | 17 + .../auth/dist/node-esm/test/helpers/mock_auth.d.ts | 47 + .../test/helpers/mock_auth_credential.d.ts | 31 + .../dist/node-esm/test/helpers/mock_fetch.d.ts | 31 + .../test/helpers/mock_popup_redirect_resolver.d.ts | 24 + .../test/helpers/redirect_persistence.d.ts | 24 + .../dist/node-esm/test/helpers/timeout_stub.d.ts | 34 + .../flows/middleware_test_generator.d.ts | 18 + .../integration/webdriver/util/auth_driver.d.ts | 46 + .../test/integration/webdriver/util/functions.d.ts | 81 + .../test/integration/webdriver/util/idp_page.d.ts | 31 + .../webdriver/util/js_load_condition.d.ts | 25 + .../integration/webdriver/util/test_runner.d.ts | 19 + .../integration/webdriver/util/test_server.d.ts | 27 + .../test/integration/webdriver/util/ui_page.d.ts | 33 + .../@firebase/auth/dist/node-esm/totp-c8d207b9.js | 7581 ++++++++++++++++++++ .../auth/dist/node-esm/totp-c8d207b9.js.map | 1 + 178 files changed, 18935 insertions(+) create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/index.cordova.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/index.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/index.doc.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/index.js create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/index.js.map create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/index.node.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/index.rn.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/index.shared.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/index.web-extension.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/index.webworker.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/internal.js create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/internal.js.map create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/internal/index.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/package.json create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/scripts/run_node_tests.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/account_management/account.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/account_management/email_and_password.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/account_management/mfa.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/account_management/profile.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/create_auth_uri.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/custom_token.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/email_and_password.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/email_link.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/idp.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/mfa.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/recaptcha.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/sign_up.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/sms.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/token.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/errors.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/index.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/password_policy/get_password_policy.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/project_config/get_project_config.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/action_code_url.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/auth_event_manager.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/auth_impl.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/emulator.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/firebase_internal.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/initialize.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/middleware.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/password_policy_impl.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/register.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/auth_credential.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/email.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/index.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/oauth.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/phone.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/saml.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/errors.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/index.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/persistence/in_memory.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/persistence/index.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/persistence/persistence_user_manager.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/email.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/facebook.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/federated.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/github.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/google.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/oauth.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/saml.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/twitter.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/abstract_popup_redirect_operation.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/action_code_settings.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/anonymous.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/credential.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/custom_token.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/email.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/email_and_password.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/email_link.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/idp.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/redirect.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/account_info.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/additional_user_info.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/id_token_result.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/invalidation.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/link_unlink.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/proactive_refresh.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/reauthenticate.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/reload.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/token_manager.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/user_credential_impl.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/user_impl.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/user_metadata.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/assert.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/browser.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/delay.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/emulator.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/event_id.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/fetch_provider.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/handler.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/instantiator.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/location.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/log.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/navigator.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/providers.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/resolver.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/time.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/validate_origin.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/version.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/index.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/assertions/totp.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/index.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_assertion.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_error.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_info.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_resolver.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_session.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_user.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/application_verifier.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/auth.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/enum_maps.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/enums.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/id_token.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/password_policy.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/popup_redirect.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/public_types.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/user.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/auth_window.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/iframe/gapi.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/iframe/gapi.iframes.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/iframe/iframe.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/index.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/load_js.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/messagechannel/index.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/messagechannel/promise.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/messagechannel/receiver.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/messagechannel/sender.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/mfa/assertions/phone.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/persistence/browser.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/persistence/cookie_storage.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/persistence/indexed_db.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/persistence/local_storage.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/persistence/session_storage.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/popup_redirect.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/providers/phone.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/recaptcha/recaptcha.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/recaptcha/recaptcha_loader.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/recaptcha/recaptcha_mock.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/recaptcha/recaptcha_verifier.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/strategies/phone.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/strategies/popup.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/strategies/redirect.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/util/popup.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/util/worker.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_cordova/plugins.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_cordova/popup_redirect/events.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_cordova/popup_redirect/popup_redirect.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_cordova/popup_redirect/utils.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_cordova/strategies/redirect.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_node/index.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_react_native/persistence/react_native.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/helpers/api/helper.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/helpers/delay.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/helpers/erroring_unavailable_persistence.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/helpers/fake_service_worker.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/helpers/id_token_response.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/helpers/iframe_event.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/helpers/integration/emulator_rest_helpers.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/helpers/integration/helpers.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/helpers/integration/settings.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/helpers/jwt.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/helpers/mock_auth.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/helpers/mock_auth_credential.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/helpers/mock_fetch.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/helpers/mock_popup_redirect_resolver.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/helpers/redirect_persistence.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/helpers/timeout_stub.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/integration/flows/middleware_test_generator.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/integration/webdriver/util/auth_driver.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/integration/webdriver/util/functions.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/integration/webdriver/util/idp_page.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/integration/webdriver/util/js_load_condition.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/integration/webdriver/util/test_runner.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/integration/webdriver/util/test_server.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/test/integration/webdriver/util/ui_page.d.ts create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/totp-c8d207b9.js create mode 100644 frontend-old/node_modules/@firebase/auth/dist/node-esm/totp-c8d207b9.js.map (limited to 'frontend-old/node_modules/@firebase/auth/dist/node-esm') diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.cordova.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.cordova.d.ts new file mode 100644 index 0000000..b2d5130 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.cordova.d.ts @@ -0,0 +1,32 @@ +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +/** + * This is the file that people using Cordova will actually import. You + * should only include this file if you have something specific about your + * implementation that mandates having a separate entrypoint. Otherwise you can + * just use index.ts + */ +import { FirebaseApp } from '@firebase/app'; +import { Auth } from './src/model/public_types'; +export * from './index.shared'; +export { indexedDBLocalPersistence } from './src/platform_browser/persistence/indexed_db'; +export { browserLocalPersistence } from './src/platform_browser/persistence/local_storage'; +export { browserSessionPersistence } from './src/platform_browser/persistence/session_storage'; +export { getRedirectResult } from './src/platform_browser/strategies/redirect'; +export { cordovaPopupRedirectResolver } from './src/platform_cordova/popup_redirect/popup_redirect'; +export { signInWithRedirect, reauthenticateWithRedirect, linkWithRedirect } from './src/platform_cordova/strategies/redirect'; +export declare function getAuth(app?: FirebaseApp): Auth; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.d.ts new file mode 100644 index 0000000..2a03211 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.d.ts @@ -0,0 +1,38 @@ +/** + * Firebase Authentication + * + * @packageDocumentation + */ +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 * from './src/model/public_types'; +export { FactorId, ProviderId, SignInMethod, OperationType, ActionCodeOperation } from './src/model/enum_maps'; +export * from './src'; +import { browserLocalPersistence } from './src/platform_browser/persistence/local_storage'; +import { browserCookiePersistence } from './src/platform_browser/persistence/cookie_storage'; +import { browserSessionPersistence } from './src/platform_browser/persistence/session_storage'; +import { indexedDBLocalPersistence } from './src/platform_browser/persistence/indexed_db'; +import { PhoneAuthProvider } from './src/platform_browser/providers/phone'; +import { signInWithPhoneNumber, linkWithPhoneNumber, reauthenticateWithPhoneNumber, updatePhoneNumber } from './src/platform_browser/strategies/phone'; +import { signInWithPopup, linkWithPopup, reauthenticateWithPopup } from './src/platform_browser/strategies/popup'; +import { signInWithRedirect, linkWithRedirect, reauthenticateWithRedirect, getRedirectResult } from './src/platform_browser/strategies/redirect'; +import { RecaptchaVerifier } from './src/platform_browser/recaptcha/recaptcha_verifier'; +import { browserPopupRedirectResolver } from './src/platform_browser/popup_redirect'; +import { PhoneMultiFactorGenerator } from './src/platform_browser/mfa/assertions/phone'; +import { TotpMultiFactorGenerator, TotpSecret } from './src/mfa/assertions/totp'; +import { getAuth } from './src/platform_browser'; +export { browserLocalPersistence, browserCookiePersistence, browserSessionPersistence, indexedDBLocalPersistence, PhoneAuthProvider, signInWithPhoneNumber, linkWithPhoneNumber, reauthenticateWithPhoneNumber, updatePhoneNumber, signInWithPopup, linkWithPopup, reauthenticateWithPopup, signInWithRedirect, linkWithRedirect, reauthenticateWithRedirect, getRedirectResult, RecaptchaVerifier, browserPopupRedirectResolver, PhoneMultiFactorGenerator, TotpMultiFactorGenerator, TotpSecret, getAuth }; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.doc.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.doc.d.ts new file mode 100644 index 0000000..893ac2c --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.doc.d.ts @@ -0,0 +1,24 @@ +/** + * Firebase Authentication + * + * @packageDocumentation + */ +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 * from './index'; +export { cordovaPopupRedirectResolver } from './index.cordova'; +export { getReactNativePersistence } from './index.rn'; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.js b/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.js new file mode 100644 index 0000000..de310a2 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.js @@ -0,0 +1,6 @@ +export { A as ActionCodeOperation, aj as ActionCodeURL, M as AuthCredential, J as AuthErrorCodes, N as EmailAuthCredential, W as EmailAuthProvider, X as FacebookAuthProvider, F as FactorId, Z as GithubAuthProvider, Y as GoogleAuthProvider, Q as OAuthCredential, _ as OAuthProvider, O as OperationType, U as PhoneAuthCredential, P as PhoneAuthProvider, n as PhoneMultiFactorGenerator, q as ProviderId, R as RecaptchaVerifier, $ as SAMLAuthProvider, S as SignInMethod, T as TotpMultiFactorGenerator, o as TotpSecret, a0 as TwitterAuthProvider, a8 as applyActionCode, y as beforeAuthStateChanged, a as browserCookiePersistence, b as browserLocalPersistence, m as browserPopupRedirectResolver, c as browserSessionPersistence, a9 as checkActionCode, a7 as confirmPasswordReset, L as connectAuthEmulator, ab as createUserWithEmailAndPassword, H as debugErrorMap, G as deleteUser, ag as fetchSignInMethodsForEmail, ar as getAdditionalUserInfo, p as getAuth, ao as getIdToken, ap as getIdTokenResult, at as getMultiFactorResolver, k as getRedirectResult, V as inMemoryPersistence, i as indexedDBLocalPersistence, K as initializeAuth, v as initializeRecaptchaConfig, ae as isSignInWithEmailLink, a3 as linkWithCredential, l as linkWithPhoneNumber, e as linkWithPopup, h as linkWithRedirect, au as multiFactor, z as onAuthStateChanged, x as onIdTokenChanged, ak as parseActionCodeURL, I as prodErrorMap, a4 as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, f as reauthenticateWithPopup, j as reauthenticateWithRedirect, as as reload, E as revokeAccessToken, ah as sendEmailVerification, a6 as sendPasswordResetEmail, ad as sendSignInLinkToEmail, t as setPersistence, a1 as signInAnonymously, a2 as signInWithCredential, a5 as signInWithCustomToken, ac as signInWithEmailAndPassword, af as signInWithEmailLink, s as signInWithPhoneNumber, d as signInWithPopup, g as signInWithRedirect, D as signOut, aq as unlink, C as updateCurrentUser, am as updateEmail, an as updatePassword, u as updatePhoneNumber, al as updateProfile, B as useDeviceLanguage, w as validatePassword, ai as verifyBeforeUpdateEmail, aa as verifyPasswordResetCode } from './totp-c8d207b9.js'; +import '@firebase/app'; +import '@firebase/util'; +import '@firebase/component'; +import '@firebase/logger'; +//# sourceMappingURL=index.js.map diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.js.map b/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.js.map new file mode 100644 index 0000000..7f6f626 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"} \ No newline at end of file diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.node.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.node.d.ts new file mode 100644 index 0000000..71e82e0 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.node.d.ts @@ -0,0 +1,17 @@ +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 * from './index'; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.rn.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.rn.d.ts new file mode 100644 index 0000000..a970ebf --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.rn.d.ts @@ -0,0 +1,40 @@ +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +/** + * This is the file that people using React Native will actually import. You + * should only include this file if you have something specific about your + * implementation that mandates having a separate entrypoint. Otherwise you can + * just use index.ts + */ +import { FirebaseApp } from '@firebase/app'; +import { Auth, Dependencies } from './src/model/public_types'; +export * from './index.shared'; +export { PhoneAuthProvider } from './src/platform_browser/providers/phone'; +export { signInWithPhoneNumber, linkWithPhoneNumber, reauthenticateWithPhoneNumber, updatePhoneNumber } from './src/platform_browser/strategies/phone'; +export { PhoneMultiFactorGenerator } from './src/platform_browser/mfa/assertions/phone'; +export { TotpMultiFactorGenerator, TotpSecret } from './src/mfa/assertions/totp'; +export { getReactNativePersistence } from './src/platform_react_native/persistence/react_native'; +export declare function getAuth(app?: FirebaseApp): Auth; +/** + * Wrapper around base `initializeAuth()` for RN users only, which + * shows the warning message if no persistence is provided. + * Double-checked potential collision with `export * from './index.shared'` + * as `./index.shared` also exports `initializeAuth()`, and the final + * bundle does correctly export only this `initializeAuth()` function + * and not the one from index.shared. + */ +export declare function initializeAuth(app: FirebaseApp, deps?: Dependencies): Auth; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.shared.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.shared.d.ts new file mode 100644 index 0000000..6a0f743 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.shared.d.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 * from './src/model/public_types'; +export { FactorId, ProviderId, SignInMethod, OperationType, ActionCodeOperation } from './src/model/enum_maps'; +export * from './src'; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.web-extension.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.web-extension.d.ts new file mode 100644 index 0000000..baf92ed --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.web-extension.d.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 * from './src'; +import { indexedDBLocalPersistence } from './src/platform_browser/persistence/indexed_db'; +import { TotpMultiFactorGenerator, TotpSecret } from './src/mfa/assertions/totp'; +import { FirebaseApp } from '@firebase/app'; +import { Auth } from './index.shared'; +/** + * Returns the Auth instance associated with the provided {@link @firebase/app#FirebaseApp}. + * If no instance exists, initializes an Auth instance with platform-specific default dependencies. + * + * @param app - The Firebase App. + * + * @public + */ +declare function getAuth(app?: FirebaseApp): Auth; +export { indexedDBLocalPersistence, TotpMultiFactorGenerator, TotpSecret, getAuth }; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.webworker.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.webworker.d.ts new file mode 100644 index 0000000..278d8e5 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/index.webworker.d.ts @@ -0,0 +1,21 @@ +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { FirebaseApp } from '@firebase/app'; +import { Auth } from './src/model/public_types'; +export * from './index.shared'; +export { indexedDBLocalPersistence } from './src/platform_browser/persistence/indexed_db'; +export declare function getAuth(app?: FirebaseApp): Auth; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/internal.js b/frontend-old/node_modules/@firebase/auth/dist/node-esm/internal.js new file mode 100644 index 0000000..0ee27c3 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/internal.js @@ -0,0 +1,1440 @@ +import { av as _getInstance, aw as _assert, ax as _signInWithCredential, ay as _reauthenticate, az as _link$1, M as AuthCredential, aA as signInWithIdp, aB as _fail, aC as debugAssert, aD as _persistenceKeyName, aE as _serverAppCurrentUserOperationNotSupportedError, aF as _castAuth, aG as FederatedAuthProvider, aH as BaseOAuthProvider, aI as _emulatorUrl, aJ as _performApiRequest, aK as _isIOS, aL as _isAndroid, aM as _isIOS7Or8, aN as _createError, aO as _isMobileBrowser, aP as _isIE10 } from './totp-c8d207b9.js'; +export { A as ActionCodeOperation, aj as ActionCodeURL, M as AuthCredential, J as AuthErrorCodes, aR as AuthImpl, N as EmailAuthCredential, W as EmailAuthProvider, X as FacebookAuthProvider, F as FactorId, aT as FetchProvider, Z as GithubAuthProvider, Y as GoogleAuthProvider, Q as OAuthCredential, _ as OAuthProvider, O as OperationType, U as PhoneAuthCredential, P as PhoneAuthProvider, n as PhoneMultiFactorGenerator, q as ProviderId, R as RecaptchaVerifier, aU as SAMLAuthCredential, $ as SAMLAuthProvider, S as SignInMethod, T as TotpMultiFactorGenerator, o as TotpSecret, a0 as TwitterAuthProvider, aQ as UserImpl, aw as _assert, aF as _castAuth, aB as _fail, aS as _getClientVersion, av as _getInstance, aD as _persistenceKeyName, a8 as applyActionCode, y as beforeAuthStateChanged, a as browserCookiePersistence, b as browserLocalPersistence, m as browserPopupRedirectResolver, c as browserSessionPersistence, a9 as checkActionCode, a7 as confirmPasswordReset, L as connectAuthEmulator, ab as createUserWithEmailAndPassword, H as debugErrorMap, G as deleteUser, ag as fetchSignInMethodsForEmail, ar as getAdditionalUserInfo, p as getAuth, ao as getIdToken, ap as getIdTokenResult, at as getMultiFactorResolver, k as getRedirectResult, V as inMemoryPersistence, i as indexedDBLocalPersistence, K as initializeAuth, v as initializeRecaptchaConfig, ae as isSignInWithEmailLink, a3 as linkWithCredential, l as linkWithPhoneNumber, e as linkWithPopup, h as linkWithRedirect, au as multiFactor, z as onAuthStateChanged, x as onIdTokenChanged, ak as parseActionCodeURL, I as prodErrorMap, a4 as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, f as reauthenticateWithPopup, j as reauthenticateWithRedirect, as as reload, E as revokeAccessToken, ah as sendEmailVerification, a6 as sendPasswordResetEmail, ad as sendSignInLinkToEmail, t as setPersistence, a1 as signInAnonymously, a2 as signInWithCredential, a5 as signInWithCustomToken, ac as signInWithEmailAndPassword, af as signInWithEmailLink, s as signInWithPhoneNumber, d as signInWithPopup, g as signInWithRedirect, D as signOut, aq as unlink, C as updateCurrentUser, am as updateEmail, an as updatePassword, u as updatePhoneNumber, al as updateProfile, B as useDeviceLanguage, w as validatePassword, ai as verifyBeforeUpdateEmail, aa as verifyPasswordResetCode } from './totp-c8d207b9.js'; +import { isEmpty, querystring, querystringDecode } from '@firebase/util'; +import { _isFirebaseServerApp, SDK_VERSION } from '@firebase/app'; +import '@firebase/component'; +import '@firebase/logger'; + +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +function _generateEventId(prefix = '', digits = 10) { + let random = ''; + for (let i = 0; i < digits; i++) { + random += Math.floor(Math.random() * 10); + } + return prefix + random; +} + +/** + * @license + * Copyright 2020 Google LLC. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +class AuthPopup { + constructor(window) { + this.window = window; + this.associatedEvent = null; + } + close() { + if (this.window) { + try { + this.window.close(); + } + catch (e) { } + } + } +} + +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +/** + * Chooses a popup/redirect resolver to use. This prefers the override (which + * is directly passed in), and falls back to the property set on the auth + * object. If neither are available, this function errors w/ an argument error. + */ +function _withDefaultResolver(auth, resolverOverride) { + if (resolverOverride) { + return _getInstance(resolverOverride); + } + _assert(auth._popupRedirectResolver, auth, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */); + return auth._popupRedirectResolver; +} + +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +class IdpCredential extends AuthCredential { + constructor(params) { + super("custom" /* ProviderId.CUSTOM */, "custom" /* ProviderId.CUSTOM */); + this.params = params; + } + _getIdTokenResponse(auth) { + return signInWithIdp(auth, this._buildIdpRequest()); + } + _linkToIdToken(auth, idToken) { + return signInWithIdp(auth, this._buildIdpRequest(idToken)); + } + _getReauthenticationResolver(auth) { + return signInWithIdp(auth, this._buildIdpRequest()); + } + _buildIdpRequest(idToken) { + const request = { + requestUri: this.params.requestUri, + sessionId: this.params.sessionId, + postBody: this.params.postBody, + tenantId: this.params.tenantId, + pendingToken: this.params.pendingToken, + returnSecureToken: true, + returnIdpCredential: true + }; + if (idToken) { + request.idToken = idToken; + } + return request; + } +} +function _signIn(params) { + return _signInWithCredential(params.auth, new IdpCredential(params), params.bypassAuthState); +} +function _reauth(params) { + const { auth, user } = params; + _assert(user, auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */); + return _reauthenticate(user, new IdpCredential(params), params.bypassAuthState); +} +async function _link(params) { + const { auth, user } = params; + _assert(user, auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */); + return _link$1(user, new IdpCredential(params), params.bypassAuthState); +} + +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +/** + * Popup event manager. Handles the popup's entire lifecycle; listens to auth + * events + */ +class AbstractPopupRedirectOperation { + constructor(auth, filter, resolver, user, bypassAuthState = false) { + this.auth = auth; + this.resolver = resolver; + this.user = user; + this.bypassAuthState = bypassAuthState; + this.pendingPromise = null; + this.eventManager = null; + this.filter = Array.isArray(filter) ? filter : [filter]; + } + execute() { + return new Promise(async (resolve, reject) => { + this.pendingPromise = { resolve, reject }; + try { + this.eventManager = await this.resolver._initialize(this.auth); + await this.onExecution(); + this.eventManager.registerConsumer(this); + } + catch (e) { + this.reject(e); + } + }); + } + async onAuthEvent(event) { + const { urlResponse, sessionId, postBody, tenantId, error, type } = event; + if (error) { + this.reject(error); + return; + } + const params = { + auth: this.auth, + requestUri: urlResponse, + sessionId: sessionId, + tenantId: tenantId || undefined, + postBody: postBody || undefined, + user: this.user, + bypassAuthState: this.bypassAuthState + }; + try { + this.resolve(await this.getIdpTask(type)(params)); + } + catch (e) { + this.reject(e); + } + } + onError(error) { + this.reject(error); + } + getIdpTask(type) { + switch (type) { + case "signInViaPopup" /* AuthEventType.SIGN_IN_VIA_POPUP */: + case "signInViaRedirect" /* AuthEventType.SIGN_IN_VIA_REDIRECT */: + return _signIn; + case "linkViaPopup" /* AuthEventType.LINK_VIA_POPUP */: + case "linkViaRedirect" /* AuthEventType.LINK_VIA_REDIRECT */: + return _link; + case "reauthViaPopup" /* AuthEventType.REAUTH_VIA_POPUP */: + case "reauthViaRedirect" /* AuthEventType.REAUTH_VIA_REDIRECT */: + return _reauth; + default: + _fail(this.auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */); + } + } + resolve(cred) { + debugAssert(this.pendingPromise, 'Pending promise was never set'); + this.pendingPromise.resolve(cred); + this.unregisterAndCleanUp(); + } + reject(error) { + debugAssert(this.pendingPromise, 'Pending promise was never set'); + this.pendingPromise.reject(error); + this.unregisterAndCleanUp(); + } + unregisterAndCleanUp() { + if (this.eventManager) { + this.eventManager.unregisterConsumer(this); + } + this.pendingPromise = null; + this.cleanUp(); + } +} + +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +const PENDING_REDIRECT_KEY = 'pendingRedirect'; +// We only get one redirect outcome for any one auth, so just store it +// in here. +const redirectOutcomeMap = new Map(); +class RedirectAction extends AbstractPopupRedirectOperation { + constructor(auth, resolver, bypassAuthState = false) { + super(auth, [ + "signInViaRedirect" /* AuthEventType.SIGN_IN_VIA_REDIRECT */, + "linkViaRedirect" /* AuthEventType.LINK_VIA_REDIRECT */, + "reauthViaRedirect" /* AuthEventType.REAUTH_VIA_REDIRECT */, + "unknown" /* AuthEventType.UNKNOWN */ + ], resolver, undefined, bypassAuthState); + this.eventId = null; + } + /** + * Override the execute function; if we already have a redirect result, then + * just return it. + */ + async execute() { + let readyOutcome = redirectOutcomeMap.get(this.auth._key()); + if (!readyOutcome) { + try { + const hasPendingRedirect = await _getAndClearPendingRedirectStatus(this.resolver, this.auth); + const result = hasPendingRedirect ? await super.execute() : null; + readyOutcome = () => Promise.resolve(result); + } + catch (e) { + readyOutcome = () => Promise.reject(e); + } + redirectOutcomeMap.set(this.auth._key(), readyOutcome); + } + // If we're not bypassing auth state, the ready outcome should be set to + // null. + if (!this.bypassAuthState) { + redirectOutcomeMap.set(this.auth._key(), () => Promise.resolve(null)); + } + return readyOutcome(); + } + async onAuthEvent(event) { + if (event.type === "signInViaRedirect" /* AuthEventType.SIGN_IN_VIA_REDIRECT */) { + return super.onAuthEvent(event); + } + else if (event.type === "unknown" /* AuthEventType.UNKNOWN */) { + // This is a sentinel value indicating there's no pending redirect + this.resolve(null); + return; + } + if (event.eventId) { + const user = await this.auth._redirectUserForId(event.eventId); + if (user) { + this.user = user; + return super.onAuthEvent(event); + } + else { + this.resolve(null); + } + } + } + async onExecution() { } + cleanUp() { } +} +async function _getAndClearPendingRedirectStatus(resolver, auth) { + const key = pendingRedirectKey(auth); + const persistence = resolverPersistence(resolver); + if (!(await persistence._isAvailable())) { + return false; + } + const hasPendingRedirect = (await persistence._get(key)) === 'true'; + await persistence._remove(key); + return hasPendingRedirect; +} +function _clearRedirectOutcomes() { + redirectOutcomeMap.clear(); +} +function _overrideRedirectResult(auth, result) { + redirectOutcomeMap.set(auth._key(), result); +} +function resolverPersistence(resolver) { + return _getInstance(resolver._redirectPersistence); +} +function pendingRedirectKey(auth) { + return _persistenceKeyName(PENDING_REDIRECT_KEY, auth.config.apiKey, auth.name); +} + +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +async function _getRedirectResult(auth, resolverExtern, bypassAuthState = false) { + if (_isFirebaseServerApp(auth.app)) { + return Promise.reject(_serverAppCurrentUserOperationNotSupportedError(auth)); + } + const authInternal = _castAuth(auth); + const resolver = _withDefaultResolver(authInternal, resolverExtern); + const action = new RedirectAction(authInternal, resolver, bypassAuthState); + const result = await action.execute(); + if (result && !bypassAuthState) { + delete result.user._redirectEventId; + await authInternal._persistUserIfCurrent(result.user); + await authInternal._setRedirectUser(null, resolverExtern); + } + return result; +} + +const STORAGE_AVAILABLE_KEY = '__sak'; + +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +// There are two different browser persistence types: local and session. +// Both have the same implementation but use a different underlying storage +// object. +class BrowserPersistenceClass { + constructor(storageRetriever, type) { + this.storageRetriever = storageRetriever; + this.type = type; + } + _isAvailable() { + try { + if (!this.storage) { + return Promise.resolve(false); + } + this.storage.setItem(STORAGE_AVAILABLE_KEY, '1'); + this.storage.removeItem(STORAGE_AVAILABLE_KEY); + return Promise.resolve(true); + } + catch { + return Promise.resolve(false); + } + } + _set(key, value) { + this.storage.setItem(key, JSON.stringify(value)); + return Promise.resolve(); + } + _get(key) { + const json = this.storage.getItem(key); + return Promise.resolve(json ? JSON.parse(json) : null); + } + _remove(key) { + this.storage.removeItem(key); + return Promise.resolve(); + } + get storage() { + return this.storageRetriever(); + } +} + +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +class BrowserSessionPersistence extends BrowserPersistenceClass { + constructor() { + super(() => window.sessionStorage, "SESSION" /* PersistenceType.SESSION */); + } + _addListener(_key, _listener) { + // Listeners are not supported for session storage since it cannot be shared across windows + return; + } + _removeListener(_key, _listener) { + // Listeners are not supported for session storage since it cannot be shared across windows + return; + } +} +BrowserSessionPersistence.type = 'SESSION'; +/** + * An implementation of {@link Persistence} of `SESSION` using `sessionStorage` + * for the underlying storage. + * + * @public + */ +const browserSessionPersistence = BrowserSessionPersistence; + +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +/** + * URL for Authentication widget which will initiate the OAuth handshake + * + * @internal + */ +const WIDGET_PATH = '__/auth/handler'; +/** + * URL for emulated environment + * + * @internal + */ +const EMULATOR_WIDGET_PATH = 'emulator/auth/handler'; +/** + * Fragment name for the App Check token that gets passed to the widget + * + * @internal + */ +const FIREBASE_APP_CHECK_FRAGMENT_ID = encodeURIComponent('fac'); +async function _getRedirectUrl(auth, provider, authType, redirectUrl, eventId, additionalParams) { + _assert(auth.config.authDomain, auth, "auth-domain-config-required" /* AuthErrorCode.MISSING_AUTH_DOMAIN */); + _assert(auth.config.apiKey, auth, "invalid-api-key" /* AuthErrorCode.INVALID_API_KEY */); + const params = { + apiKey: auth.config.apiKey, + appName: auth.name, + authType, + redirectUrl, + v: SDK_VERSION, + eventId + }; + if (provider instanceof FederatedAuthProvider) { + provider.setDefaultLanguage(auth.languageCode); + params.providerId = provider.providerId || ''; + if (!isEmpty(provider.getCustomParameters())) { + params.customParameters = JSON.stringify(provider.getCustomParameters()); + } + // TODO set additionalParams from the provider as well? + for (const [key, value] of Object.entries(additionalParams || {})) { + params[key] = value; + } + } + if (provider instanceof BaseOAuthProvider) { + const scopes = provider.getScopes().filter(scope => scope !== ''); + if (scopes.length > 0) { + params.scopes = scopes.join(','); + } + } + if (auth.tenantId) { + params.tid = auth.tenantId; + } + // TODO: maybe set eid as endpointId + // TODO: maybe set fw as Frameworks.join(",") + const paramsDict = params; + for (const key of Object.keys(paramsDict)) { + if (paramsDict[key] === undefined) { + delete paramsDict[key]; + } + } + // Sets the App Check token to pass to the widget + const appCheckToken = await auth._getAppCheckToken(); + const appCheckTokenFragment = appCheckToken + ? `#${FIREBASE_APP_CHECK_FRAGMENT_ID}=${encodeURIComponent(appCheckToken)}` + : ''; + // Start at index 1 to skip the leading '&' in the query string + return `${getHandlerBase(auth)}?${querystring(paramsDict).slice(1)}${appCheckTokenFragment}`; +} +function getHandlerBase({ config }) { + if (!config.emulator) { + return `https://${config.authDomain}/${WIDGET_PATH}`; + } + return _emulatorUrl(config, EMULATOR_WIDGET_PATH); +} + +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +function _cordovaWindow() { + return window; +} + +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +async function _getProjectConfig(auth, request = {}) { + return _performApiRequest(auth, "GET" /* HttpMethod.GET */, "/v1/projects" /* Endpoint.GET_PROJECT_CONFIG */, request); +} + +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +/** + * How long to wait after the app comes back into focus before concluding that + * the user closed the sign in tab. + */ +const REDIRECT_TIMEOUT_MS = 2000; +/** + * Generates the URL for the OAuth handler. + */ +async function _generateHandlerUrl(auth, event, provider) { + // Get the cordova plugins + const { BuildInfo } = _cordovaWindow(); + debugAssert(event.sessionId, 'AuthEvent did not contain a session ID'); + const sessionDigest = await computeSha256(event.sessionId); + const additionalParams = {}; + if (_isIOS()) { + // iOS app identifier + additionalParams['ibi'] = BuildInfo.packageName; + } + else if (_isAndroid()) { + // Android app identifier + additionalParams['apn'] = BuildInfo.packageName; + } + else { + _fail(auth, "operation-not-supported-in-this-environment" /* AuthErrorCode.OPERATION_NOT_SUPPORTED */); + } + // Add the display name if available + if (BuildInfo.displayName) { + additionalParams['appDisplayName'] = BuildInfo.displayName; + } + // Attached the hashed session ID + additionalParams['sessionId'] = sessionDigest; + return _getRedirectUrl(auth, provider, event.type, undefined, event.eventId ?? undefined, additionalParams); +} +/** + * Validates that this app is valid for this project configuration + */ +async function _validateOrigin(auth) { + const { BuildInfo } = _cordovaWindow(); + const request = {}; + if (_isIOS()) { + request.iosBundleId = BuildInfo.packageName; + } + else if (_isAndroid()) { + request.androidPackageName = BuildInfo.packageName; + } + else { + _fail(auth, "operation-not-supported-in-this-environment" /* AuthErrorCode.OPERATION_NOT_SUPPORTED */); + } + // Will fail automatically if package name is not authorized + await _getProjectConfig(auth, request); +} +function _performRedirect(handlerUrl) { + // Get the cordova plugins + const { cordova } = _cordovaWindow(); + return new Promise(resolve => { + cordova.plugins.browsertab.isAvailable(browserTabIsAvailable => { + let iabRef = null; + if (browserTabIsAvailable) { + cordova.plugins.browsertab.openUrl(handlerUrl); + } + else { + // TODO: Return the inappbrowser ref that's returned from the open call + iabRef = cordova.InAppBrowser.open(handlerUrl, _isIOS7Or8() ? '_blank' : '_system', 'location=yes'); + } + resolve(iabRef); + }); + }); +} +/** + * This function waits for app activity to be seen before resolving. It does + * this by attaching listeners to various dom events. Once the app is determined + * to be visible, this promise resolves. AFTER that resolution, the listeners + * are detached and any browser tabs left open will be closed. + */ +async function _waitForAppResume(auth, eventListener, iabRef) { + // Get the cordova plugins + const { cordova } = _cordovaWindow(); + let cleanup = () => { }; + try { + await new Promise((resolve, reject) => { + let onCloseTimer = null; + // DEFINE ALL THE CALLBACKS ===== + function authEventSeen() { + // Auth event was detected. Resolve this promise and close the extra + // window if it's still open. + resolve(); + const closeBrowserTab = cordova.plugins.browsertab?.close; + if (typeof closeBrowserTab === 'function') { + closeBrowserTab(); + } + // Close inappbrowser embedded webview in iOS7 and 8 case if still + // open. + if (typeof iabRef?.close === 'function') { + iabRef.close(); + } + } + function resumed() { + if (onCloseTimer) { + // This code already ran; do not rerun. + return; + } + onCloseTimer = window.setTimeout(() => { + // Wait two seconds after resume then reject. + reject(_createError(auth, "redirect-cancelled-by-user" /* AuthErrorCode.REDIRECT_CANCELLED_BY_USER */)); + }, REDIRECT_TIMEOUT_MS); + } + function visibilityChanged() { + if (document?.visibilityState === 'visible') { + resumed(); + } + } + // ATTACH ALL THE LISTENERS ===== + // Listen for the auth event + eventListener.addPassiveListener(authEventSeen); + // Listen for resume and visibility events + document.addEventListener('resume', resumed, false); + if (_isAndroid()) { + document.addEventListener('visibilitychange', visibilityChanged, false); + } + // SETUP THE CLEANUP FUNCTION ===== + cleanup = () => { + eventListener.removePassiveListener(authEventSeen); + document.removeEventListener('resume', resumed, false); + document.removeEventListener('visibilitychange', visibilityChanged, false); + if (onCloseTimer) { + window.clearTimeout(onCloseTimer); + } + }; + }); + } + finally { + cleanup(); + } +} +/** + * Checks the configuration of the Cordova environment. This has no side effect + * if the configuration is correct; otherwise it throws an error with the + * missing plugin. + */ +function _checkCordovaConfiguration(auth) { + const win = _cordovaWindow(); + // Check all dependencies installed. + // https://github.com/nordnet/cordova-universal-links-plugin + // Note that cordova-universal-links-plugin has been abandoned. + // A fork with latest fixes is available at: + // https://www.npmjs.com/package/cordova-universal-links-plugin-fix + _assert(typeof win?.universalLinks?.subscribe === 'function', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, { + missingPlugin: 'cordova-universal-links-plugin-fix' + }); + // https://www.npmjs.com/package/cordova-plugin-buildinfo + _assert(typeof win?.BuildInfo?.packageName !== 'undefined', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, { + missingPlugin: 'cordova-plugin-buildInfo' + }); + // https://github.com/google/cordova-plugin-browsertab + _assert(typeof win?.cordova?.plugins?.browsertab?.openUrl === 'function', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, { + missingPlugin: 'cordova-plugin-browsertab' + }); + _assert(typeof win?.cordova?.plugins?.browsertab?.isAvailable === 'function', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, { + missingPlugin: 'cordova-plugin-browsertab' + }); + // https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-inappbrowser/ + _assert(typeof win?.cordova?.InAppBrowser?.open === 'function', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, { + missingPlugin: 'cordova-plugin-inappbrowser' + }); +} +/** + * Computes the SHA-256 of a session ID. The SubtleCrypto interface is only + * available in "secure" contexts, which covers Cordova (which is served on a file + * protocol). + */ +async function computeSha256(sessionId) { + const bytes = stringToArrayBuffer(sessionId); + // TODO: For IE11 crypto has a different name and this operation comes back + // as an object, not a promise. This is the old proposed standard that + // is used by IE11: + // https://www.w3.org/TR/2013/WD-WebCryptoAPI-20130108/#cryptooperation-interface + const buf = await crypto.subtle.digest('SHA-256', bytes); + const arr = Array.from(new Uint8Array(buf)); + return arr.map(num => num.toString(16).padStart(2, '0')).join(''); +} +function stringToArrayBuffer(str) { + // This function is only meant to deal with an ASCII charset and makes + // certain simplifying assumptions. + debugAssert(/[0-9a-zA-Z]+/.test(str), 'Can only convert alpha-numeric strings'); + if (typeof TextEncoder !== 'undefined') { + return new TextEncoder().encode(str); + } + const buff = new ArrayBuffer(str.length); + const view = new Uint8Array(buff); + for (let i = 0; i < str.length; i++) { + view[i] = str.charCodeAt(i); + } + return view; +} + +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +// The amount of time to store the UIDs of seen events; this is +// set to 10 min by default +const EVENT_DUPLICATION_CACHE_DURATION_MS = 10 * 60 * 1000; +class AuthEventManager { + constructor(auth) { + this.auth = auth; + this.cachedEventUids = new Set(); + this.consumers = new Set(); + this.queuedRedirectEvent = null; + this.hasHandledPotentialRedirect = false; + this.lastProcessedEventTime = Date.now(); + } + registerConsumer(authEventConsumer) { + this.consumers.add(authEventConsumer); + if (this.queuedRedirectEvent && + this.isEventForConsumer(this.queuedRedirectEvent, authEventConsumer)) { + this.sendToConsumer(this.queuedRedirectEvent, authEventConsumer); + this.saveEventToCache(this.queuedRedirectEvent); + this.queuedRedirectEvent = null; + } + } + unregisterConsumer(authEventConsumer) { + this.consumers.delete(authEventConsumer); + } + onEvent(event) { + // Check if the event has already been handled + if (this.hasEventBeenHandled(event)) { + return false; + } + let handled = false; + this.consumers.forEach(consumer => { + if (this.isEventForConsumer(event, consumer)) { + handled = true; + this.sendToConsumer(event, consumer); + this.saveEventToCache(event); + } + }); + if (this.hasHandledPotentialRedirect || !isRedirectEvent(event)) { + // If we've already seen a redirect before, or this is a popup event, + // bail now + return handled; + } + this.hasHandledPotentialRedirect = true; + // If the redirect wasn't handled, hang on to it + if (!handled) { + this.queuedRedirectEvent = event; + handled = true; + } + return handled; + } + sendToConsumer(event, consumer) { + if (event.error && !isNullRedirectEvent(event)) { + const code = event.error.code?.split('auth/')[1] || + "internal-error" /* AuthErrorCode.INTERNAL_ERROR */; + consumer.onError(_createError(this.auth, code)); + } + else { + consumer.onAuthEvent(event); + } + } + isEventForConsumer(event, consumer) { + const eventIdMatches = consumer.eventId === null || + (!!event.eventId && event.eventId === consumer.eventId); + return consumer.filter.includes(event.type) && eventIdMatches; + } + hasEventBeenHandled(event) { + if (Date.now() - this.lastProcessedEventTime >= + EVENT_DUPLICATION_CACHE_DURATION_MS) { + this.cachedEventUids.clear(); + } + return this.cachedEventUids.has(eventUid(event)); + } + saveEventToCache(event) { + this.cachedEventUids.add(eventUid(event)); + this.lastProcessedEventTime = Date.now(); + } +} +function eventUid(e) { + return [e.type, e.eventId, e.sessionId, e.tenantId].filter(v => v).join('-'); +} +function isNullRedirectEvent({ type, error }) { + return (type === "unknown" /* AuthEventType.UNKNOWN */ && + error?.code === `auth/${"no-auth-event" /* AuthErrorCode.NO_AUTH_EVENT */}`); +} +function isRedirectEvent(event) { + switch (event.type) { + case "signInViaRedirect" /* AuthEventType.SIGN_IN_VIA_REDIRECT */: + case "linkViaRedirect" /* AuthEventType.LINK_VIA_REDIRECT */: + case "reauthViaRedirect" /* AuthEventType.REAUTH_VIA_REDIRECT */: + return true; + case "unknown" /* AuthEventType.UNKNOWN */: + return isNullRedirectEvent(event); + default: + return false; + } +} + +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +// The polling period in case events are not supported +const _POLLING_INTERVAL_MS = 1000; +// The IE 10 localStorage cross tab synchronization delay in milliseconds +const IE10_LOCAL_STORAGE_SYNC_DELAY = 10; +class BrowserLocalPersistence extends BrowserPersistenceClass { + constructor() { + super(() => window.localStorage, "LOCAL" /* PersistenceType.LOCAL */); + this.boundEventHandler = (event, poll) => this.onStorageEvent(event, poll); + this.listeners = {}; + this.localCache = {}; + // setTimeout return value is platform specific + // eslint-disable-next-line @typescript-eslint/no-explicit-any + this.pollTimer = null; + // Whether to use polling instead of depending on window events + this.fallbackToPolling = _isMobileBrowser(); + this._shouldAllowMigration = true; + } + forAllChangedKeys(cb) { + // Check all keys with listeners on them. + for (const key of Object.keys(this.listeners)) { + // Get value from localStorage. + const newValue = this.storage.getItem(key); + const oldValue = this.localCache[key]; + // If local map value does not match, trigger listener with storage event. + // Differentiate this simulated event from the real storage event. + if (newValue !== oldValue) { + cb(key, oldValue, newValue); + } + } + } + onStorageEvent(event, poll = false) { + // Key would be null in some situations, like when localStorage is cleared + if (!event.key) { + this.forAllChangedKeys((key, _oldValue, newValue) => { + this.notifyListeners(key, newValue); + }); + return; + } + const key = event.key; + // Check the mechanism how this event was detected. + // The first event will dictate the mechanism to be used. + if (poll) { + // Environment detects storage changes via polling. + // Remove storage event listener to prevent possible event duplication. + this.detachListener(); + } + else { + // Environment detects storage changes via storage event listener. + // Remove polling listener to prevent possible event duplication. + this.stopPolling(); + } + const triggerListeners = () => { + // Keep local map up to date in case storage event is triggered before + // poll. + const storedValue = this.storage.getItem(key); + if (!poll && this.localCache[key] === storedValue) { + // Real storage event which has already been detected, do nothing. + // This seems to trigger in some IE browsers for some reason. + return; + } + this.notifyListeners(key, storedValue); + }; + const storedValue = this.storage.getItem(key); + if (_isIE10() && + storedValue !== event.newValue && + event.newValue !== event.oldValue) { + // IE 10 has this weird bug where a storage event would trigger with the + // correct key, oldValue and newValue but localStorage.getItem(key) does + // not yield the updated value until a few milliseconds. This ensures + // this recovers from that situation. + setTimeout(triggerListeners, IE10_LOCAL_STORAGE_SYNC_DELAY); + } + else { + triggerListeners(); + } + } + notifyListeners(key, value) { + this.localCache[key] = value; + const listeners = this.listeners[key]; + if (listeners) { + for (const listener of Array.from(listeners)) { + listener(value ? JSON.parse(value) : value); + } + } + } + startPolling() { + this.stopPolling(); + this.pollTimer = setInterval(() => { + this.forAllChangedKeys((key, oldValue, newValue) => { + this.onStorageEvent(new StorageEvent('storage', { + key, + oldValue, + newValue + }), + /* poll */ true); + }); + }, _POLLING_INTERVAL_MS); + } + stopPolling() { + if (this.pollTimer) { + clearInterval(this.pollTimer); + this.pollTimer = null; + } + } + attachListener() { + window.addEventListener('storage', this.boundEventHandler); + } + detachListener() { + window.removeEventListener('storage', this.boundEventHandler); + } + _addListener(key, listener) { + if (Object.keys(this.listeners).length === 0) { + // Whether browser can detect storage event when it had already been pushed to the background. + // This may happen in some mobile browsers. A localStorage change in the foreground window + // will not be detected in the background window via the storage event. + // This was detected in iOS 7.x mobile browsers + if (this.fallbackToPolling) { + this.startPolling(); + } + else { + this.attachListener(); + } + } + if (!this.listeners[key]) { + this.listeners[key] = new Set(); + // Populate the cache to avoid spuriously triggering on first poll. + this.localCache[key] = this.storage.getItem(key); + } + this.listeners[key].add(listener); + } + _removeListener(key, listener) { + if (this.listeners[key]) { + this.listeners[key].delete(listener); + if (this.listeners[key].size === 0) { + delete this.listeners[key]; + } + } + if (Object.keys(this.listeners).length === 0) { + this.detachListener(); + this.stopPolling(); + } + } + // Update local cache on base operations: + async _set(key, value) { + await super._set(key, value); + this.localCache[key] = JSON.stringify(value); + } + async _get(key) { + const value = await super._get(key); + this.localCache[key] = JSON.stringify(value); + return value; + } + async _remove(key) { + await super._remove(key); + delete this.localCache[key]; + } +} +BrowserLocalPersistence.type = 'LOCAL'; +/** + * An implementation of {@link Persistence} of type `LOCAL` using `localStorage` + * for the underlying storage. + * + * @public + */ +const browserLocalPersistence = BrowserLocalPersistence; + +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +const SESSION_ID_LENGTH = 20; +/** Custom AuthEventManager that adds passive listeners to events */ +class CordovaAuthEventManager extends AuthEventManager { + constructor() { + super(...arguments); + this.passiveListeners = new Set(); + this.initPromise = new Promise(resolve => { + this.resolveInitialized = resolve; + }); + } + addPassiveListener(cb) { + this.passiveListeners.add(cb); + } + removePassiveListener(cb) { + this.passiveListeners.delete(cb); + } + // In a Cordova environment, this manager can live through multiple redirect + // operations + resetRedirect() { + this.queuedRedirectEvent = null; + this.hasHandledPotentialRedirect = false; + } + /** Override the onEvent method */ + onEvent(event) { + this.resolveInitialized(); + this.passiveListeners.forEach(cb => cb(event)); + return super.onEvent(event); + } + async initialized() { + await this.initPromise; + } +} +/** + * Generates a (partial) {@link AuthEvent}. + */ +function _generateNewEvent(auth, type, eventId = null) { + return { + type, + eventId, + urlResponse: null, + sessionId: generateSessionId(), + postBody: null, + tenantId: auth.tenantId, + error: _createError(auth, "no-auth-event" /* AuthErrorCode.NO_AUTH_EVENT */) + }; +} +function _savePartialEvent(auth, event) { + return storage()._set(persistenceKey(auth), event); +} +async function _getAndRemoveEvent(auth) { + const event = (await storage()._get(persistenceKey(auth))); + if (event) { + await storage()._remove(persistenceKey(auth)); + } + return event; +} +function _eventFromPartialAndUrl(partialEvent, url) { + // Parse the deep link within the dynamic link URL. + const callbackUrl = _getDeepLinkFromCallback(url); + // Confirm it is actually a callback URL. + // Currently the universal link will be of this format: + // https:///__/auth/callback + // This is a fake URL but is not intended to take the user anywhere + // and just redirect to the app. + if (callbackUrl.includes('/__/auth/callback')) { + // Check if there is an error in the URL. + // This mechanism is also used to pass errors back to the app: + // https:///__/auth/callback?firebaseError= + const params = searchParamsOrEmpty(callbackUrl); + // Get the error object corresponding to the stringified error if found. + const errorObject = params['firebaseError'] + ? parseJsonOrNull(decodeURIComponent(params['firebaseError'])) + : null; + const code = errorObject?.['code']?.split('auth/')?.[1]; + const error = code ? _createError(code) : null; + if (error) { + return { + type: partialEvent.type, + eventId: partialEvent.eventId, + tenantId: partialEvent.tenantId, + error, + urlResponse: null, + sessionId: null, + postBody: null + }; + } + else { + return { + type: partialEvent.type, + eventId: partialEvent.eventId, + tenantId: partialEvent.tenantId, + sessionId: partialEvent.sessionId, + urlResponse: callbackUrl, + postBody: null + }; + } + } + return null; +} +function generateSessionId() { + const chars = []; + const allowedChars = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + for (let i = 0; i < SESSION_ID_LENGTH; i++) { + const idx = Math.floor(Math.random() * allowedChars.length); + chars.push(allowedChars.charAt(idx)); + } + return chars.join(''); +} +function storage() { + return _getInstance(browserLocalPersistence); +} +function persistenceKey(auth) { + return _persistenceKeyName("authEvent" /* KeyName.AUTH_EVENT */, auth.config.apiKey, auth.name); +} +function parseJsonOrNull(json) { + try { + return JSON.parse(json); + } + catch (e) { + return null; + } +} +// Exported for testing +function _getDeepLinkFromCallback(url) { + const params = searchParamsOrEmpty(url); + const link = params['link'] ? decodeURIComponent(params['link']) : undefined; + // Double link case (automatic redirect) + const doubleDeepLink = searchParamsOrEmpty(link)['link']; + // iOS custom scheme links. + const iOSDeepLink = params['deep_link_id'] + ? decodeURIComponent(params['deep_link_id']) + : undefined; + const iOSDoubleDeepLink = searchParamsOrEmpty(iOSDeepLink)['link']; + return iOSDoubleDeepLink || iOSDeepLink || doubleDeepLink || link || url; +} +/** + * Optimistically tries to get search params from a string, or else returns an + * empty search params object. + */ +function searchParamsOrEmpty(url) { + if (!url?.includes('?')) { + return {}; + } + const [_, ...rest] = url.split('?'); + return querystringDecode(rest.join('?')); +} + +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +/** + * How long to wait for the initial auth event before concluding no + * redirect pending + */ +const INITIAL_EVENT_TIMEOUT_MS = 500; +class CordovaPopupRedirectResolver { + constructor() { + this._redirectPersistence = browserSessionPersistence; + this._shouldInitProactively = true; // This is lightweight for Cordova + this.eventManagers = new Map(); + this.originValidationPromises = {}; + this._completeRedirectFn = _getRedirectResult; + this._overrideRedirectResult = _overrideRedirectResult; + } + async _initialize(auth) { + const key = auth._key(); + let manager = this.eventManagers.get(key); + if (!manager) { + manager = new CordovaAuthEventManager(auth); + this.eventManagers.set(key, manager); + this.attachCallbackListeners(auth, manager); + } + return manager; + } + _openPopup(auth) { + _fail(auth, "operation-not-supported-in-this-environment" /* AuthErrorCode.OPERATION_NOT_SUPPORTED */); + } + async _openRedirect(auth, provider, authType, eventId) { + _checkCordovaConfiguration(auth); + const manager = await this._initialize(auth); + await manager.initialized(); + // Reset the persisted redirect states. This does not matter on Web where + // the redirect always blows away application state entirely. On Cordova, + // the app maintains control flow through the redirect. + manager.resetRedirect(); + _clearRedirectOutcomes(); + await this._originValidation(auth); + const event = _generateNewEvent(auth, authType, eventId); + await _savePartialEvent(auth, event); + const url = await _generateHandlerUrl(auth, event, provider); + const iabRef = await _performRedirect(url); + return _waitForAppResume(auth, manager, iabRef); + } + _isIframeWebStorageSupported(_auth, _cb) { + throw new Error('Method not implemented.'); + } + _originValidation(auth) { + const key = auth._key(); + if (!this.originValidationPromises[key]) { + this.originValidationPromises[key] = _validateOrigin(auth); + } + return this.originValidationPromises[key]; + } + attachCallbackListeners(auth, manager) { + // Get the global plugins + const { universalLinks, handleOpenURL, BuildInfo } = _cordovaWindow(); + const noEventTimeout = setTimeout(async () => { + // We didn't see that initial event. Clear any pending object and + // dispatch no event + await _getAndRemoveEvent(auth); + manager.onEvent(generateNoEvent()); + }, INITIAL_EVENT_TIMEOUT_MS); + const universalLinksCb = async (eventData) => { + // We have an event so we can clear the no event timeout + clearTimeout(noEventTimeout); + const partialEvent = await _getAndRemoveEvent(auth); + let finalEvent = null; + if (partialEvent && eventData?.['url']) { + finalEvent = _eventFromPartialAndUrl(partialEvent, eventData['url']); + } + // If finalEvent is never filled, trigger with no event + manager.onEvent(finalEvent || generateNoEvent()); + }; + // Universal links subscriber doesn't exist for iOS, so we need to check + if (typeof universalLinks !== 'undefined' && + typeof universalLinks.subscribe === 'function') { + universalLinks.subscribe(null, universalLinksCb); + } + // iOS 7 or 8 custom URL schemes. + // This is also the current default behavior for iOS 9+. + // For this to work, cordova-plugin-customurlscheme needs to be installed. + // https://github.com/EddyVerbruggen/Custom-URL-scheme + // Do not overwrite the existing developer's URL handler. + const existingHandleOpenURL = handleOpenURL; + const packagePrefix = `${BuildInfo.packageName.toLowerCase()}://`; + _cordovaWindow().handleOpenURL = async (url) => { + if (url.toLowerCase().startsWith(packagePrefix)) { + // We want this intentionally to float + // eslint-disable-next-line @typescript-eslint/no-floating-promises + universalLinksCb({ url }); + } + // Call the developer's handler if it is present. + if (typeof existingHandleOpenURL === 'function') { + try { + existingHandleOpenURL(url); + } + catch (e) { + // This is a developer error. Don't stop the flow of the SDK. + console.error(e); + } + } + }; + } +} +/** + * An implementation of {@link PopupRedirectResolver} suitable for Cordova + * based applications. + * + * @public + */ +const cordovaPopupRedirectResolver = CordovaPopupRedirectResolver; +function generateNoEvent() { + return { + type: "unknown" /* AuthEventType.UNKNOWN */, + eventId: null, + sessionId: null, + urlResponse: null, + postBody: null, + tenantId: null, + error: _createError("no-auth-event" /* AuthErrorCode.NO_AUTH_EVENT */) + }; +} + +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +// This function should only be called by frameworks (e.g. FirebaseUI-web) to log their usage. +// It is not intended for direct use by developer apps. NO jsdoc here to intentionally leave it out +// of autogenerated documentation pages to reduce accidental misuse. +function addFrameworkForLogging(auth, framework) { + _castAuth(auth)._logFramework(framework); +} + +export { AuthPopup, _generateEventId, _getRedirectResult, _overrideRedirectResult, addFrameworkForLogging, cordovaPopupRedirectResolver }; +//# sourceMappingURL=internal.js.map diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/internal.js.map b/frontend-old/node_modules/@firebase/auth/dist/node-esm/internal.js.map new file mode 100644 index 0000000..4daec61 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/internal.js.map @@ -0,0 +1 @@ +{"version":3,"file":"internal.js","sources":["../../src/core/util/event_id.ts","../../src/platform_browser/util/popup.ts","../../src/core/util/resolver.ts","../../src/core/strategies/idp.ts","../../src/core/strategies/abstract_popup_redirect_operation.ts","../../src/core/strategies/redirect.ts","../../src/platform_browser/strategies/redirect.ts","../../src/core/persistence/index.ts","../../src/platform_browser/persistence/browser.ts","../../src/platform_browser/persistence/session_storage.ts","../../src/core/util/handler.ts","../../src/platform_cordova/plugins.ts","../../src/api/project_config/get_project_config.ts","../../src/platform_cordova/popup_redirect/utils.ts","../../src/core/auth/auth_event_manager.ts","../../src/platform_browser/persistence/local_storage.ts","../../src/platform_cordova/popup_redirect/events.ts","../../src/platform_cordova/popup_redirect/popup_redirect.ts","../../internal/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 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\nexport function _generateEventId(prefix = '', digits = 10): string {\n let random = '';\n for (let i = 0; i < digits; i++) {\n random += Math.floor(Math.random() * 10);\n }\n return prefix + random;\n}\n","/**\n * @license\n * Copyright 2020 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 { getUA } from '@firebase/util';\n\nimport { AuthErrorCode } from '../../core/errors';\nimport { _assert } from '../../core/util/assert';\nimport {\n _isChromeIOS,\n _isFirefox,\n _isIOSStandalone\n} from '../../core/util/browser';\nimport { AuthInternal } from '../../model/auth';\n\nconst BASE_POPUP_OPTIONS = {\n location: 'yes',\n resizable: 'yes',\n statusbar: 'yes',\n toolbar: 'no'\n};\n\nconst DEFAULT_WIDTH = 500;\nconst DEFAULT_HEIGHT = 600;\nconst TARGET_BLANK = '_blank';\n\nconst FIREFOX_EMPTY_URL = 'http://localhost';\n\nexport class AuthPopup {\n associatedEvent: string | null = null;\n\n constructor(readonly window: Window | null) {}\n\n close(): void {\n if (this.window) {\n try {\n this.window.close();\n } catch (e) {}\n }\n }\n}\n\nexport function _open(\n auth: AuthInternal,\n url?: string,\n name?: string,\n width = DEFAULT_WIDTH,\n height = DEFAULT_HEIGHT\n): AuthPopup {\n const top = Math.max((window.screen.availHeight - height) / 2, 0).toString();\n const left = Math.max((window.screen.availWidth - width) / 2, 0).toString();\n let target = '';\n\n const options: { [key: string]: string } = {\n ...BASE_POPUP_OPTIONS,\n width: width.toString(),\n height: height.toString(),\n top,\n left\n };\n\n // Chrome iOS 7 and 8 is returning an undefined popup win when target is\n // specified, even though the popup is not necessarily blocked.\n const ua = getUA().toLowerCase();\n\n if (name) {\n target = _isChromeIOS(ua) ? TARGET_BLANK : name;\n }\n\n if (_isFirefox(ua)) {\n // Firefox complains when invalid URLs are popped out. Hacky way to bypass.\n url = url || FIREFOX_EMPTY_URL;\n // Firefox disables by default scrolling on popup windows, which can create\n // issues when the user has many Google accounts, for instance.\n options.scrollbars = 'yes';\n }\n\n const optionsString = Object.entries(options).reduce(\n (accum, [key, value]) => `${accum}${key}=${value},`,\n ''\n );\n\n if (_isIOSStandalone(ua) && target !== '_self') {\n openAsNewWindowIOS(url || '', target);\n return new AuthPopup(null);\n }\n\n // about:blank getting sanitized causing browsers like IE/Edge to display\n // brief error message before redirecting to handler.\n const newWin = window.open(url || '', target, optionsString);\n _assert(newWin, auth, AuthErrorCode.POPUP_BLOCKED);\n\n // Flaky on IE edge, encapsulate with a try and catch.\n try {\n newWin.focus();\n } catch (e) {}\n\n return new AuthPopup(newWin);\n}\n\nfunction openAsNewWindowIOS(url: string, target: string): void {\n const el = document.createElement('a');\n el.href = url;\n el.target = target;\n const click = document.createEvent('MouseEvent');\n click.initMouseEvent(\n 'click',\n true,\n true,\n window,\n 1,\n 0,\n 0,\n 0,\n 0,\n false,\n false,\n false,\n false,\n 1,\n null\n );\n el.dispatchEvent(click);\n}\n","/**\n * @license\n * Copyright 2021 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 { PopupRedirectResolver } from '../../model/public_types';\nimport { AuthInternal } from '../../model/auth';\nimport { PopupRedirectResolverInternal } from '../../model/popup_redirect';\nimport { AuthErrorCode } from '../errors';\nimport { _assert } from './assert';\nimport { _getInstance } from './instantiator';\n\n/**\n * Chooses a popup/redirect resolver to use. This prefers the override (which\n * is directly passed in), and falls back to the property set on the auth\n * object. If neither are available, this function errors w/ an argument error.\n */\nexport function _withDefaultResolver(\n auth: AuthInternal,\n resolverOverride: PopupRedirectResolver | undefined\n): PopupRedirectResolverInternal {\n if (resolverOverride) {\n return _getInstance(resolverOverride);\n }\n\n _assert(auth._popupRedirectResolver, auth, AuthErrorCode.ARGUMENT_ERROR);\n\n return auth._popupRedirectResolver;\n}\n","/**\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 {\n signInWithIdp,\n SignInWithIdpRequest\n} from '../../api/authentication/idp';\nimport { PhoneOrOauthTokenResponse } from '../../api/authentication/mfa';\nimport { AuthInternal } from '../../model/auth';\nimport { IdTokenResponse } from '../../model/id_token';\nimport { UserInternal, UserCredentialInternal } from '../../model/user';\nimport { AuthCredential } from '../credentials';\nimport { _link as _linkUser } from '../user/link_unlink';\nimport { _reauthenticate } from '../user/reauthenticate';\nimport { _assert } from '../util/assert';\nimport { _signInWithCredential } from './credential';\nimport { AuthErrorCode } from '../errors';\nimport { ProviderId } from '../../model/enums';\n\nexport interface IdpTaskParams {\n auth: AuthInternal;\n requestUri: string;\n sessionId?: string;\n tenantId?: string;\n postBody?: string;\n pendingToken?: string;\n user?: UserInternal;\n bypassAuthState?: boolean;\n}\n\nexport type IdpTask = (\n params: IdpTaskParams\n) => Promise;\n\nclass IdpCredential extends AuthCredential {\n constructor(readonly params: IdpTaskParams) {\n super(ProviderId.CUSTOM, ProviderId.CUSTOM);\n }\n\n _getIdTokenResponse(auth: AuthInternal): Promise {\n return signInWithIdp(auth, this._buildIdpRequest());\n }\n\n _linkToIdToken(\n auth: AuthInternal,\n idToken: string\n ): Promise {\n return signInWithIdp(auth, this._buildIdpRequest(idToken));\n }\n\n _getReauthenticationResolver(auth: AuthInternal): Promise {\n return signInWithIdp(auth, this._buildIdpRequest());\n }\n\n private _buildIdpRequest(idToken?: string): SignInWithIdpRequest {\n const request: SignInWithIdpRequest = {\n requestUri: this.params.requestUri,\n sessionId: this.params.sessionId,\n postBody: this.params.postBody,\n tenantId: this.params.tenantId,\n pendingToken: this.params.pendingToken,\n returnSecureToken: true,\n returnIdpCredential: true\n };\n\n if (idToken) {\n request.idToken = idToken;\n }\n\n return request;\n }\n}\n\nexport function _signIn(\n params: IdpTaskParams\n): Promise {\n return _signInWithCredential(\n params.auth,\n new IdpCredential(params),\n params.bypassAuthState\n ) as Promise;\n}\n\nexport function _reauth(\n params: IdpTaskParams\n): Promise {\n const { auth, user } = params;\n _assert(user, auth, AuthErrorCode.INTERNAL_ERROR);\n return _reauthenticate(\n user,\n new IdpCredential(params),\n params.bypassAuthState\n );\n}\n\nexport async function _link(\n params: IdpTaskParams\n): Promise {\n const { auth, user } = params;\n _assert(user, auth, AuthErrorCode.INTERNAL_ERROR);\n return _linkUser(user, new IdpCredential(params), params.bypassAuthState);\n}\n","/**\n * @license\n * Copyright 2020 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 { FirebaseError } from '@firebase/util';\n\nimport {\n AuthEvent,\n AuthEventConsumer,\n AuthEventType,\n EventManager,\n PopupRedirectResolverInternal\n} from '../../model/popup_redirect';\nimport { UserInternal, UserCredentialInternal } from '../../model/user';\nimport { AuthErrorCode } from '../errors';\nimport { debugAssert, _fail } from '../util/assert';\nimport {\n _link,\n _reauth,\n _signIn,\n IdpTask,\n IdpTaskParams\n} from '../strategies/idp';\nimport { AuthInternal } from '../../model/auth';\n\ninterface PendingPromise {\n resolve: (cred: UserCredentialInternal | null) => void;\n reject: (error: Error) => void;\n}\n\n/**\n * Popup event manager. Handles the popup's entire lifecycle; listens to auth\n * events\n */\nexport abstract class AbstractPopupRedirectOperation\n implements AuthEventConsumer\n{\n private pendingPromise: PendingPromise | null = null;\n private eventManager: EventManager | null = null;\n readonly filter: AuthEventType[];\n\n abstract eventId: string | null;\n\n constructor(\n protected readonly auth: AuthInternal,\n filter: AuthEventType | AuthEventType[],\n protected readonly resolver: PopupRedirectResolverInternal,\n protected user?: UserInternal,\n protected readonly bypassAuthState = false\n ) {\n this.filter = Array.isArray(filter) ? filter : [filter];\n }\n\n abstract onExecution(): Promise;\n\n execute(): Promise {\n return new Promise(\n async (resolve, reject) => {\n this.pendingPromise = { resolve, reject };\n\n try {\n this.eventManager = await this.resolver._initialize(this.auth);\n await this.onExecution();\n this.eventManager.registerConsumer(this);\n } catch (e) {\n this.reject(e as Error);\n }\n }\n );\n }\n\n async onAuthEvent(event: AuthEvent): Promise {\n const { urlResponse, sessionId, postBody, tenantId, error, type } = event;\n if (error) {\n this.reject(error);\n return;\n }\n\n const params: IdpTaskParams = {\n auth: this.auth,\n requestUri: urlResponse!,\n sessionId: sessionId!,\n tenantId: tenantId || undefined,\n postBody: postBody || undefined,\n user: this.user,\n bypassAuthState: this.bypassAuthState\n };\n\n try {\n this.resolve(await this.getIdpTask(type)(params));\n } catch (e) {\n this.reject(e as Error);\n }\n }\n\n onError(error: FirebaseError): void {\n this.reject(error);\n }\n\n private getIdpTask(type: AuthEventType): IdpTask {\n switch (type) {\n case AuthEventType.SIGN_IN_VIA_POPUP:\n case AuthEventType.SIGN_IN_VIA_REDIRECT:\n return _signIn;\n case AuthEventType.LINK_VIA_POPUP:\n case AuthEventType.LINK_VIA_REDIRECT:\n return _link;\n case AuthEventType.REAUTH_VIA_POPUP:\n case AuthEventType.REAUTH_VIA_REDIRECT:\n return _reauth;\n default:\n _fail(this.auth, AuthErrorCode.INTERNAL_ERROR);\n }\n }\n\n protected resolve(cred: UserCredentialInternal | null): void {\n debugAssert(this.pendingPromise, 'Pending promise was never set');\n this.pendingPromise.resolve(cred);\n this.unregisterAndCleanUp();\n }\n\n protected reject(error: Error): void {\n debugAssert(this.pendingPromise, 'Pending promise was never set');\n this.pendingPromise.reject(error);\n this.unregisterAndCleanUp();\n }\n\n private unregisterAndCleanUp(): void {\n if (this.eventManager) {\n this.eventManager.unregisterConsumer(this);\n }\n\n this.pendingPromise = null;\n this.cleanUp();\n }\n\n abstract cleanUp(): void;\n}\n","/**\n * @license\n * Copyright 2020 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 { AuthInternal } from '../../model/auth';\nimport {\n AuthEvent,\n AuthEventType,\n PopupRedirectResolverInternal\n} from '../../model/popup_redirect';\nimport { UserCredentialInternal } from '../../model/user';\nimport { PersistenceInternal } from '../persistence';\nimport { _persistenceKeyName } from '../persistence/persistence_user_manager';\nimport { _getInstance } from '../util/instantiator';\nimport { AbstractPopupRedirectOperation } from './abstract_popup_redirect_operation';\n\nconst PENDING_REDIRECT_KEY = 'pendingRedirect';\n\n// We only get one redirect outcome for any one auth, so just store it\n// in here.\nconst redirectOutcomeMap: Map<\n string,\n () => Promise\n> = new Map();\n\nexport class RedirectAction extends AbstractPopupRedirectOperation {\n eventId = null;\n\n constructor(\n auth: AuthInternal,\n resolver: PopupRedirectResolverInternal,\n bypassAuthState = false\n ) {\n super(\n auth,\n [\n AuthEventType.SIGN_IN_VIA_REDIRECT,\n AuthEventType.LINK_VIA_REDIRECT,\n AuthEventType.REAUTH_VIA_REDIRECT,\n AuthEventType.UNKNOWN\n ],\n resolver,\n undefined,\n bypassAuthState\n );\n }\n\n /**\n * Override the execute function; if we already have a redirect result, then\n * just return it.\n */\n async execute(): Promise {\n let readyOutcome = redirectOutcomeMap.get(this.auth._key());\n if (!readyOutcome) {\n try {\n const hasPendingRedirect = await _getAndClearPendingRedirectStatus(\n this.resolver,\n this.auth\n );\n const result = hasPendingRedirect ? await super.execute() : null;\n readyOutcome = () => Promise.resolve(result);\n } catch (e) {\n readyOutcome = () => Promise.reject(e);\n }\n\n redirectOutcomeMap.set(this.auth._key(), readyOutcome);\n }\n\n // If we're not bypassing auth state, the ready outcome should be set to\n // null.\n if (!this.bypassAuthState) {\n redirectOutcomeMap.set(this.auth._key(), () => Promise.resolve(null));\n }\n\n return readyOutcome();\n }\n\n async onAuthEvent(event: AuthEvent): Promise {\n if (event.type === AuthEventType.SIGN_IN_VIA_REDIRECT) {\n return super.onAuthEvent(event);\n } else if (event.type === AuthEventType.UNKNOWN) {\n // This is a sentinel value indicating there's no pending redirect\n this.resolve(null);\n return;\n }\n\n if (event.eventId) {\n const user = await this.auth._redirectUserForId(event.eventId);\n if (user) {\n this.user = user;\n return super.onAuthEvent(event);\n } else {\n this.resolve(null);\n }\n }\n }\n\n async onExecution(): Promise {}\n\n cleanUp(): void {}\n}\n\nexport async function _getAndClearPendingRedirectStatus(\n resolver: PopupRedirectResolverInternal,\n auth: AuthInternal\n): Promise {\n const key = pendingRedirectKey(auth);\n const persistence = resolverPersistence(resolver);\n if (!(await persistence._isAvailable())) {\n return false;\n }\n const hasPendingRedirect = (await persistence._get(key)) === 'true';\n await persistence._remove(key);\n return hasPendingRedirect;\n}\n\nexport async function _setPendingRedirectStatus(\n resolver: PopupRedirectResolverInternal,\n auth: AuthInternal\n): Promise {\n return resolverPersistence(resolver)._set(pendingRedirectKey(auth), 'true');\n}\n\nexport function _clearRedirectOutcomes(): void {\n redirectOutcomeMap.clear();\n}\n\nexport function _overrideRedirectResult(\n auth: AuthInternal,\n result: () => Promise\n): void {\n redirectOutcomeMap.set(auth._key(), result);\n}\n\nfunction resolverPersistence(\n resolver: PopupRedirectResolverInternal\n): PersistenceInternal {\n return _getInstance(resolver._redirectPersistence);\n}\n\nfunction pendingRedirectKey(auth: AuthInternal): string {\n return _persistenceKeyName(\n PENDING_REDIRECT_KEY,\n auth.config.apiKey,\n auth.name\n );\n}\n","/**\n * @license\n * Copyright 2020 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 {\n Auth,\n AuthProvider,\n PopupRedirectResolver,\n User,\n UserCredential\n} from '../../model/public_types';\n\nimport { _castAuth } from '../../core/auth/auth_impl';\nimport { _assertLinkedStatus } from '../../core/user/link_unlink';\nimport {\n _assertInstanceOf,\n _serverAppCurrentUserOperationNotSupportedError\n} from '../../core/util/assert';\nimport { _generateEventId } from '../../core/util/event_id';\nimport { AuthEventType } from '../../model/popup_redirect';\nimport { UserInternal } from '../../model/user';\nimport { _withDefaultResolver } from '../../core/util/resolver';\nimport {\n RedirectAction,\n _setPendingRedirectStatus\n} from '../../core/strategies/redirect';\nimport { FederatedAuthProvider } from '../../core/providers/federated';\nimport { getModularInstance } from '@firebase/util';\nimport { _isFirebaseServerApp } from '@firebase/app';\n\n/**\n * Authenticates a Firebase client using a full-page redirect flow.\n *\n * @remarks\n * To handle the results and errors for this operation, refer to {@link getRedirectResult}.\n * Follow the {@link https://firebase.google.com/docs/auth/web/redirect-best-practices\n * | best practices} when using {@link signInWithRedirect}.\n *\n * This method does not work in a Node.js environment or with {@link Auth} instances created with a\n * {@link @firebase/app#FirebaseServerApp}.\n *\n * @example\n * ```javascript\n * // Sign in using a redirect.\n * const provider = new FacebookAuthProvider();\n * // You can add additional scopes to the provider:\n * provider.addScope('user_birthday');\n * // Start a sign in process for an unauthenticated user.\n * await signInWithRedirect(auth, provider);\n * // This will trigger a full page redirect away from your app\n *\n * // After returning from the redirect when your app initializes you can obtain the result\n * const result = await getRedirectResult(auth);\n * if (result) {\n * // This is the signed-in user\n * const user = result.user;\n * // This gives you a Facebook Access Token.\n * const credential = provider.credentialFromResult(auth, result);\n * const token = credential.accessToken;\n * }\n * // As this API can be used for sign-in, linking and reauthentication,\n * // check the operationType to determine what triggered this redirect\n * // operation.\n * const operationType = result.operationType;\n * ```\n *\n * @param auth - The {@link Auth} instance.\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\n *\n * @public\n */\nexport function signInWithRedirect(\n auth: Auth,\n provider: AuthProvider,\n resolver?: PopupRedirectResolver\n): Promise {\n return _signInWithRedirect(auth, provider, resolver) as Promise;\n}\n\nexport async function _signInWithRedirect(\n auth: Auth,\n provider: AuthProvider,\n resolver?: PopupRedirectResolver\n): Promise {\n if (_isFirebaseServerApp(auth.app)) {\n return Promise.reject(\n _serverAppCurrentUserOperationNotSupportedError(auth)\n );\n }\n const authInternal = _castAuth(auth);\n _assertInstanceOf(auth, provider, FederatedAuthProvider);\n // Wait for auth initialization to complete, this will process pending redirects and clear the\n // PENDING_REDIRECT_KEY in persistence. This should be completed before starting a new\n // redirect and creating a PENDING_REDIRECT_KEY entry.\n await authInternal._initializationPromise;\n const resolverInternal = _withDefaultResolver(authInternal, resolver);\n await _setPendingRedirectStatus(resolverInternal, authInternal);\n\n return resolverInternal._openRedirect(\n authInternal,\n provider,\n AuthEventType.SIGN_IN_VIA_REDIRECT\n );\n}\n\n/**\n * Reauthenticates the current user with the specified {@link OAuthProvider} using a full-page redirect flow.\n * @remarks\n * To handle the results and errors for this operation, refer to {@link getRedirectResult}.\n * Follow the {@link https://firebase.google.com/docs/auth/web/redirect-best-practices\n * | best practices} when using {@link reauthenticateWithRedirect}.\n *\n * This method does not work in a Node.js environment or with {@link Auth} instances\n * created with a {@link @firebase/app#FirebaseServerApp}.\n *\n * @example\n * ```javascript\n * // Sign in using a redirect.\n * const provider = new FacebookAuthProvider();\n * const result = await signInWithRedirect(auth, provider);\n * // This will trigger a full page redirect away from your app\n *\n * // After returning from the redirect when your app initializes you can obtain the result\n * const result = await getRedirectResult(auth);\n * // Reauthenticate using a redirect.\n * await reauthenticateWithRedirect(result.user, provider);\n * // This will again trigger a full page redirect away from your app\n *\n * // After returning from the redirect when your app initializes you can obtain the result\n * const result = await getRedirectResult(auth);\n * ```\n *\n * @param user - The user.\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\n *\n * @public\n */\nexport function reauthenticateWithRedirect(\n user: User,\n provider: AuthProvider,\n resolver?: PopupRedirectResolver\n): Promise {\n return _reauthenticateWithRedirect(\n user,\n provider,\n resolver\n ) as Promise;\n}\nexport async function _reauthenticateWithRedirect(\n user: User,\n provider: AuthProvider,\n resolver?: PopupRedirectResolver\n): Promise {\n const userInternal = getModularInstance(user) as UserInternal;\n _assertInstanceOf(userInternal.auth, provider, FederatedAuthProvider);\n if (_isFirebaseServerApp(userInternal.auth.app)) {\n return Promise.reject(\n _serverAppCurrentUserOperationNotSupportedError(userInternal.auth)\n );\n }\n // Wait for auth initialization to complete, this will process pending redirects and clear the\n // PENDING_REDIRECT_KEY in persistence. This should be completed before starting a new\n // redirect and creating a PENDING_REDIRECT_KEY entry.\n await userInternal.auth._initializationPromise;\n // Allow the resolver to error before persisting the redirect user\n const resolverInternal = _withDefaultResolver(userInternal.auth, resolver);\n await _setPendingRedirectStatus(resolverInternal, userInternal.auth);\n\n const eventId = await prepareUserForRedirect(userInternal);\n return resolverInternal._openRedirect(\n userInternal.auth,\n provider,\n AuthEventType.REAUTH_VIA_REDIRECT,\n eventId\n );\n}\n\n/**\n * Links the {@link OAuthProvider} to the user account using a full-page redirect flow.\n * @remarks\n * To handle the results and errors for this operation, refer to {@link getRedirectResult}.\n * Follow the {@link https://firebase.google.com/docs/auth/web/redirect-best-practices\n * | best practices} when using {@link linkWithRedirect}.\n *\n * This method does not work in a Node.js environment or with {@link Auth} instances\n * created with a {@link @firebase/app#FirebaseServerApp}.\n *\n * @example\n * ```javascript\n * // Sign in using some other provider.\n * const result = await signInWithEmailAndPassword(auth, email, password);\n * // Link using a redirect.\n * const provider = new FacebookAuthProvider();\n * await linkWithRedirect(result.user, provider);\n * // This will trigger a full page redirect away from your app\n *\n * // After returning from the redirect when your app initializes you can obtain the result\n * const result = await getRedirectResult(auth);\n * ```\n *\n * @param user - The user.\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\n *\n * @public\n */\nexport function linkWithRedirect(\n user: User,\n provider: AuthProvider,\n resolver?: PopupRedirectResolver\n): Promise {\n return _linkWithRedirect(user, provider, resolver) as Promise;\n}\nexport async function _linkWithRedirect(\n user: User,\n provider: AuthProvider,\n resolver?: PopupRedirectResolver\n): Promise {\n const userInternal = getModularInstance(user) as UserInternal;\n _assertInstanceOf(userInternal.auth, provider, FederatedAuthProvider);\n // Wait for auth initialization to complete, this will process pending redirects and clear the\n // PENDING_REDIRECT_KEY in persistence. This should be completed before starting a new\n // redirect and creating a PENDING_REDIRECT_KEY entry.\n await userInternal.auth._initializationPromise;\n // Allow the resolver to error before persisting the redirect user\n const resolverInternal = _withDefaultResolver(userInternal.auth, resolver);\n await _assertLinkedStatus(false, userInternal, provider.providerId);\n await _setPendingRedirectStatus(resolverInternal, userInternal.auth);\n\n const eventId = await prepareUserForRedirect(userInternal);\n return resolverInternal._openRedirect(\n userInternal.auth,\n provider,\n AuthEventType.LINK_VIA_REDIRECT,\n eventId\n );\n}\n\n/**\n * Returns a {@link UserCredential} from the redirect-based sign-in flow.\n *\n * @remarks\n * If sign-in succeeded, returns the signed in user. If sign-in was unsuccessful, fails with an\n * error. If no redirect operation was called, returns `null`.\n *\n * This method does not work in a Node.js environment or with {@link Auth} instances created with a\n * {@link @firebase/app#FirebaseServerApp}.\n *\n * @example\n * ```javascript\n * // Sign in using a redirect.\n * const provider = new FacebookAuthProvider();\n * // You can add additional scopes to the provider:\n * provider.addScope('user_birthday');\n * // Start a sign in process for an unauthenticated user.\n * await signInWithRedirect(auth, provider);\n * // This will trigger a full page redirect away from your app\n *\n * // After returning from the redirect when your app initializes you can obtain the result\n * const result = await getRedirectResult(auth);\n * if (result) {\n * // This is the signed-in user\n * const user = result.user;\n * // This gives you a Facebook Access Token.\n * const credential = provider.credentialFromResult(auth, result);\n * const token = credential.accessToken;\n * }\n * // As this API can be used for sign-in, linking and reauthentication,\n * // check the operationType to determine what triggered this redirect\n * // operation.\n * const operationType = result.operationType;\n * ```\n *\n * @param auth - The {@link Auth} instance.\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\n *\n * @public\n */\nexport async function getRedirectResult(\n auth: Auth,\n resolver?: PopupRedirectResolver\n): Promise {\n await _castAuth(auth)._initializationPromise;\n return _getRedirectResult(auth, resolver, false);\n}\n\nexport async function _getRedirectResult(\n auth: Auth,\n resolverExtern?: PopupRedirectResolver,\n bypassAuthState = false\n): Promise {\n if (_isFirebaseServerApp(auth.app)) {\n return Promise.reject(\n _serverAppCurrentUserOperationNotSupportedError(auth)\n );\n }\n const authInternal = _castAuth(auth);\n const resolver = _withDefaultResolver(authInternal, resolverExtern);\n const action = new RedirectAction(authInternal, resolver, bypassAuthState);\n const result = await action.execute();\n\n if (result && !bypassAuthState) {\n delete result.user._redirectEventId;\n await authInternal._persistUserIfCurrent(result.user as UserInternal);\n await authInternal._setRedirectUser(null, resolverExtern);\n }\n\n return result;\n}\n\nasync function prepareUserForRedirect(user: UserInternal): Promise {\n const eventId = _generateEventId(`${user.uid}:::`);\n user._redirectEventId = eventId;\n await user.auth._setRedirectUser(user);\n await user.auth._persistUserIfCurrent(user);\n return eventId;\n}\n","/**\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 */\nimport { Persistence } from '../../model/public_types';\n\nexport const enum PersistenceType {\n SESSION = 'SESSION',\n LOCAL = 'LOCAL',\n NONE = 'NONE',\n COOKIE = 'COOKIE'\n}\n\nexport type PersistedBlob = Record;\n\nexport interface Instantiator {\n (blob: PersistedBlob): T;\n}\n\nexport type PersistenceValue = PersistedBlob | string;\n\nexport const STORAGE_AVAILABLE_KEY = '__sak';\n\nexport interface StorageEventListener {\n (value: PersistenceValue | null): void;\n}\n\nexport interface PersistenceInternal extends Persistence {\n type: PersistenceType;\n _isAvailable(): Promise;\n _set(key: string, value: PersistenceValue): Promise;\n _get(key: string): Promise;\n _remove(key: string): Promise;\n _addListener(key: string, listener: StorageEventListener): void;\n _removeListener(key: string, listener: StorageEventListener): void;\n // Should this persistence allow migration up the chosen hierarchy?\n _shouldAllowMigration?: boolean;\n}\n","/**\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 {\n PersistenceValue,\n STORAGE_AVAILABLE_KEY,\n PersistenceType\n} from '../../core/persistence';\n\n// There are two different browser persistence types: local and session.\n// Both have the same implementation but use a different underlying storage\n// object.\n\nexport abstract class BrowserPersistenceClass {\n protected constructor(\n protected readonly storageRetriever: () => Storage,\n readonly type: PersistenceType\n ) {}\n\n _isAvailable(): Promise {\n try {\n if (!this.storage) {\n return Promise.resolve(false);\n }\n this.storage.setItem(STORAGE_AVAILABLE_KEY, '1');\n this.storage.removeItem(STORAGE_AVAILABLE_KEY);\n return Promise.resolve(true);\n } catch {\n return Promise.resolve(false);\n }\n }\n\n _set(key: string, value: PersistenceValue): Promise {\n this.storage.setItem(key, JSON.stringify(value));\n return Promise.resolve();\n }\n\n _get(key: string): Promise {\n const json = this.storage.getItem(key);\n return Promise.resolve(json ? JSON.parse(json) : null);\n }\n\n _remove(key: string): Promise {\n this.storage.removeItem(key);\n return Promise.resolve();\n }\n\n protected get storage(): Storage {\n return this.storageRetriever();\n }\n}\n","/**\n * @license\n * Copyright 2020 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 } from '../../model/public_types';\n\nimport {\n PersistenceInternal as InternalPersistence,\n PersistenceType,\n StorageEventListener\n} from '../../core/persistence';\nimport { BrowserPersistenceClass } from './browser';\n\nclass BrowserSessionPersistence\n extends BrowserPersistenceClass\n implements InternalPersistence\n{\n static type: 'SESSION' = 'SESSION';\n\n constructor() {\n super(() => window.sessionStorage, PersistenceType.SESSION);\n }\n\n _addListener(_key: string, _listener: StorageEventListener): void {\n // Listeners are not supported for session storage since it cannot be shared across windows\n return;\n }\n\n _removeListener(_key: string, _listener: StorageEventListener): void {\n // Listeners are not supported for session storage since it cannot be shared across windows\n return;\n }\n}\n\n/**\n * An implementation of {@link Persistence} of `SESSION` using `sessionStorage`\n * for the underlying storage.\n *\n * @public\n */\nexport const browserSessionPersistence: Persistence = BrowserSessionPersistence;\n","/**\n * @license\n * Copyright 2021 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 { SDK_VERSION } from '@firebase/app';\nimport { AuthProvider } from '../../model/public_types';\nimport { ApiKey, AppName, AuthInternal } from '../../model/auth';\nimport { AuthEventType } from '../../model/popup_redirect';\nimport { AuthErrorCode } from '../errors';\nimport { _assert } from './assert';\nimport { isEmpty, querystring } from '@firebase/util';\nimport { _emulatorUrl } from './emulator';\nimport { FederatedAuthProvider } from '../providers/federated';\nimport { BaseOAuthProvider } from '../providers/oauth';\n\n/**\n * URL for Authentication widget which will initiate the OAuth handshake\n *\n * @internal\n */\nconst WIDGET_PATH = '__/auth/handler';\n\n/**\n * URL for emulated environment\n *\n * @internal\n */\nconst EMULATOR_WIDGET_PATH = 'emulator/auth/handler';\n\n/**\n * Fragment name for the App Check token that gets passed to the widget\n *\n * @internal\n */\nconst FIREBASE_APP_CHECK_FRAGMENT_ID = encodeURIComponent('fac');\n\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\ntype WidgetParams = {\n apiKey: ApiKey;\n appName: AppName;\n authType: AuthEventType;\n redirectUrl?: string;\n v: string;\n providerId?: string;\n scopes?: string;\n customParameters?: string;\n eventId?: string;\n tid?: string;\n} & { [key: string]: string | undefined };\n\nexport async function _getRedirectUrl(\n auth: AuthInternal,\n provider: AuthProvider,\n authType: AuthEventType,\n redirectUrl?: string,\n eventId?: string,\n additionalParams?: Record\n): Promise {\n _assert(auth.config.authDomain, auth, AuthErrorCode.MISSING_AUTH_DOMAIN);\n _assert(auth.config.apiKey, auth, AuthErrorCode.INVALID_API_KEY);\n\n const params: WidgetParams = {\n apiKey: auth.config.apiKey,\n appName: auth.name,\n authType,\n redirectUrl,\n v: SDK_VERSION,\n eventId\n };\n\n if (provider instanceof FederatedAuthProvider) {\n provider.setDefaultLanguage(auth.languageCode);\n params.providerId = provider.providerId || '';\n if (!isEmpty(provider.getCustomParameters())) {\n params.customParameters = JSON.stringify(provider.getCustomParameters());\n }\n\n // TODO set additionalParams from the provider as well?\n for (const [key, value] of Object.entries(additionalParams || {})) {\n params[key] = value;\n }\n }\n\n if (provider instanceof BaseOAuthProvider) {\n const scopes = provider.getScopes().filter(scope => scope !== '');\n if (scopes.length > 0) {\n params.scopes = scopes.join(',');\n }\n }\n\n if (auth.tenantId) {\n params.tid = auth.tenantId;\n }\n\n // TODO: maybe set eid as endpointId\n // TODO: maybe set fw as Frameworks.join(\",\")\n\n const paramsDict = params as Record;\n for (const key of Object.keys(paramsDict)) {\n if (paramsDict[key] === undefined) {\n delete paramsDict[key];\n }\n }\n\n // Sets the App Check token to pass to the widget\n const appCheckToken = await auth._getAppCheckToken();\n const appCheckTokenFragment = appCheckToken\n ? `#${FIREBASE_APP_CHECK_FRAGMENT_ID}=${encodeURIComponent(appCheckToken)}`\n : '';\n\n // Start at index 1 to skip the leading '&' in the query string\n return `${getHandlerBase(auth)}?${querystring(paramsDict).slice(\n 1\n )}${appCheckTokenFragment}`;\n}\n\nfunction getHandlerBase({ config }: AuthInternal): string {\n if (!config.emulator) {\n return `https://${config.authDomain}/${WIDGET_PATH}`;\n }\n\n return _emulatorUrl(config, EMULATOR_WIDGET_PATH);\n}\n","/**\n * @license\n * Copyright 2021 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\nexport interface CordovaWindow extends Window {\n cordova: {\n plugins: {\n browsertab: {\n isAvailable(cb: (available: boolean) => void): void;\n openUrl(url: string): void;\n close(): void;\n };\n };\n\n InAppBrowser: {\n open(url: string, target: string, options: string): InAppBrowserRef;\n };\n };\n\n universalLinks: {\n subscribe(\n n: null,\n cb: (event: Record | null) => void\n ): void;\n };\n\n BuildInfo: {\n readonly packageName: string;\n readonly displayName: string;\n };\n\n handleOpenURL(url: string): void;\n}\n\nexport interface InAppBrowserRef {\n close?: () => void;\n}\n\nexport function _cordovaWindow(): CordovaWindow {\n return window as unknown as CordovaWindow;\n}\n","/**\n * @license\n * Copyright 2020 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 { _performApiRequest, Endpoint, HttpMethod } from '../index';\nimport { Auth } from '../../model/public_types';\n\nexport interface GetProjectConfigRequest {\n androidPackageName?: string;\n iosBundleId?: string;\n}\n\nexport interface GetProjectConfigResponse {\n authorizedDomains: string[];\n}\n\nexport async function _getProjectConfig(\n auth: Auth,\n request: GetProjectConfigRequest = {}\n): Promise {\n return _performApiRequest(\n auth,\n HttpMethod.GET,\n Endpoint.GET_PROJECT_CONFIG,\n request\n );\n}\n","/**\n * @license\n * Copyright 2020 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 { AuthProvider } from '../../model/public_types';\nimport { AuthErrorCode } from '../../core/errors';\nimport {\n debugAssert,\n _assert,\n _createError,\n _fail\n} from '../../core/util/assert';\nimport { _isAndroid, _isIOS, _isIOS7Or8 } from '../../core/util/browser';\nimport { _getRedirectUrl } from '../../core/util/handler';\nimport { AuthInternal } from '../../model/auth';\nimport { AuthEvent } from '../../model/popup_redirect';\nimport { InAppBrowserRef, _cordovaWindow } from '../plugins';\nimport {\n GetProjectConfigRequest,\n _getProjectConfig\n} from '../../api/project_config/get_project_config';\n\n/**\n * How long to wait after the app comes back into focus before concluding that\n * the user closed the sign in tab.\n */\nconst REDIRECT_TIMEOUT_MS = 2000;\n\n/**\n * Generates the URL for the OAuth handler.\n */\nexport async function _generateHandlerUrl(\n auth: AuthInternal,\n event: AuthEvent,\n provider: AuthProvider\n): Promise {\n // Get the cordova plugins\n const { BuildInfo } = _cordovaWindow();\n debugAssert(event.sessionId, 'AuthEvent did not contain a session ID');\n const sessionDigest = await computeSha256(event.sessionId);\n\n const additionalParams: Record = {};\n if (_isIOS()) {\n // iOS app identifier\n additionalParams['ibi'] = BuildInfo.packageName;\n } else if (_isAndroid()) {\n // Android app identifier\n additionalParams['apn'] = BuildInfo.packageName;\n } else {\n _fail(auth, AuthErrorCode.OPERATION_NOT_SUPPORTED);\n }\n\n // Add the display name if available\n if (BuildInfo.displayName) {\n additionalParams['appDisplayName'] = BuildInfo.displayName;\n }\n\n // Attached the hashed session ID\n additionalParams['sessionId'] = sessionDigest;\n return _getRedirectUrl(\n auth,\n provider,\n event.type,\n undefined,\n event.eventId ?? undefined,\n additionalParams\n );\n}\n\n/**\n * Validates that this app is valid for this project configuration\n */\nexport async function _validateOrigin(auth: AuthInternal): Promise {\n const { BuildInfo } = _cordovaWindow();\n const request: GetProjectConfigRequest = {};\n if (_isIOS()) {\n request.iosBundleId = BuildInfo.packageName;\n } else if (_isAndroid()) {\n request.androidPackageName = BuildInfo.packageName;\n } else {\n _fail(auth, AuthErrorCode.OPERATION_NOT_SUPPORTED);\n }\n\n // Will fail automatically if package name is not authorized\n await _getProjectConfig(auth, request);\n}\n\nexport function _performRedirect(\n handlerUrl: string\n): Promise {\n // Get the cordova plugins\n const { cordova } = _cordovaWindow();\n\n return new Promise(resolve => {\n cordova.plugins.browsertab.isAvailable(browserTabIsAvailable => {\n let iabRef: InAppBrowserRef | null = null;\n if (browserTabIsAvailable) {\n cordova.plugins.browsertab.openUrl(handlerUrl);\n } else {\n // TODO: Return the inappbrowser ref that's returned from the open call\n iabRef = cordova.InAppBrowser.open(\n handlerUrl,\n _isIOS7Or8() ? '_blank' : '_system',\n 'location=yes'\n );\n }\n resolve(iabRef);\n });\n });\n}\n\n// Thin interface wrapper to avoid circular dependency with ./events module\ninterface PassiveAuthEventListener {\n addPassiveListener(cb: () => void): void;\n removePassiveListener(cb: () => void): void;\n}\n\n/**\n * This function waits for app activity to be seen before resolving. It does\n * this by attaching listeners to various dom events. Once the app is determined\n * to be visible, this promise resolves. AFTER that resolution, the listeners\n * are detached and any browser tabs left open will be closed.\n */\nexport async function _waitForAppResume(\n auth: AuthInternal,\n eventListener: PassiveAuthEventListener,\n iabRef: InAppBrowserRef | null\n): Promise {\n // Get the cordova plugins\n const { cordova } = _cordovaWindow();\n\n let cleanup = (): void => {};\n try {\n await new Promise((resolve, reject) => {\n let onCloseTimer: number | null = null;\n\n // DEFINE ALL THE CALLBACKS =====\n function authEventSeen(): void {\n // Auth event was detected. Resolve this promise and close the extra\n // window if it's still open.\n resolve();\n const closeBrowserTab = cordova.plugins.browsertab?.close;\n if (typeof closeBrowserTab === 'function') {\n closeBrowserTab();\n }\n // Close inappbrowser embedded webview in iOS7 and 8 case if still\n // open.\n if (typeof iabRef?.close === 'function') {\n iabRef.close();\n }\n }\n\n function resumed(): void {\n if (onCloseTimer) {\n // This code already ran; do not rerun.\n return;\n }\n\n onCloseTimer = window.setTimeout(() => {\n // Wait two seconds after resume then reject.\n reject(_createError(auth, AuthErrorCode.REDIRECT_CANCELLED_BY_USER));\n }, REDIRECT_TIMEOUT_MS);\n }\n\n function visibilityChanged(): void {\n if (document?.visibilityState === 'visible') {\n resumed();\n }\n }\n\n // ATTACH ALL THE LISTENERS =====\n // Listen for the auth event\n eventListener.addPassiveListener(authEventSeen);\n\n // Listen for resume and visibility events\n document.addEventListener('resume', resumed, false);\n if (_isAndroid()) {\n document.addEventListener('visibilitychange', visibilityChanged, false);\n }\n\n // SETUP THE CLEANUP FUNCTION =====\n cleanup = () => {\n eventListener.removePassiveListener(authEventSeen);\n document.removeEventListener('resume', resumed, false);\n document.removeEventListener(\n 'visibilitychange',\n visibilityChanged,\n false\n );\n if (onCloseTimer) {\n window.clearTimeout(onCloseTimer);\n }\n };\n });\n } finally {\n cleanup();\n }\n}\n\n/**\n * Checks the configuration of the Cordova environment. This has no side effect\n * if the configuration is correct; otherwise it throws an error with the\n * missing plugin.\n */\nexport function _checkCordovaConfiguration(auth: AuthInternal): void {\n const win = _cordovaWindow();\n // Check all dependencies installed.\n // https://github.com/nordnet/cordova-universal-links-plugin\n // Note that cordova-universal-links-plugin has been abandoned.\n // A fork with latest fixes is available at:\n // https://www.npmjs.com/package/cordova-universal-links-plugin-fix\n _assert(\n typeof win?.universalLinks?.subscribe === 'function',\n auth,\n AuthErrorCode.INVALID_CORDOVA_CONFIGURATION,\n {\n missingPlugin: 'cordova-universal-links-plugin-fix'\n }\n );\n\n // https://www.npmjs.com/package/cordova-plugin-buildinfo\n _assert(\n typeof win?.BuildInfo?.packageName !== 'undefined',\n auth,\n AuthErrorCode.INVALID_CORDOVA_CONFIGURATION,\n {\n missingPlugin: 'cordova-plugin-buildInfo'\n }\n );\n\n // https://github.com/google/cordova-plugin-browsertab\n _assert(\n typeof win?.cordova?.plugins?.browsertab?.openUrl === 'function',\n auth,\n AuthErrorCode.INVALID_CORDOVA_CONFIGURATION,\n {\n missingPlugin: 'cordova-plugin-browsertab'\n }\n );\n _assert(\n typeof win?.cordova?.plugins?.browsertab?.isAvailable === 'function',\n auth,\n AuthErrorCode.INVALID_CORDOVA_CONFIGURATION,\n {\n missingPlugin: 'cordova-plugin-browsertab'\n }\n );\n\n // https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-inappbrowser/\n _assert(\n typeof win?.cordova?.InAppBrowser?.open === 'function',\n auth,\n AuthErrorCode.INVALID_CORDOVA_CONFIGURATION,\n {\n missingPlugin: 'cordova-plugin-inappbrowser'\n }\n );\n}\n\n/**\n * Computes the SHA-256 of a session ID. The SubtleCrypto interface is only\n * available in \"secure\" contexts, which covers Cordova (which is served on a file\n * protocol).\n */\nasync function computeSha256(sessionId: string): Promise {\n const bytes = stringToArrayBuffer(sessionId);\n\n // TODO: For IE11 crypto has a different name and this operation comes back\n // as an object, not a promise. This is the old proposed standard that\n // is used by IE11:\n // https://www.w3.org/TR/2013/WD-WebCryptoAPI-20130108/#cryptooperation-interface\n const buf = await crypto.subtle.digest('SHA-256', bytes);\n const arr = Array.from(new Uint8Array(buf));\n return arr.map(num => num.toString(16).padStart(2, '0')).join('');\n}\n\nfunction stringToArrayBuffer(str: string): Uint8Array {\n // This function is only meant to deal with an ASCII charset and makes\n // certain simplifying assumptions.\n debugAssert(\n /[0-9a-zA-Z]+/.test(str),\n 'Can only convert alpha-numeric strings'\n );\n if (typeof TextEncoder !== 'undefined') {\n return new TextEncoder().encode(str);\n }\n\n const buff = new ArrayBuffer(str.length);\n const view = new Uint8Array(buff);\n for (let i = 0; i < str.length; i++) {\n view[i] = str.charCodeAt(i);\n }\n return view;\n}\n","/**\n * @license\n * Copyright 2020 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 {\n AuthEvent,\n AuthEventConsumer,\n AuthEventType,\n EventManager\n} from '../../model/popup_redirect';\nimport { AuthErrorCode } from '../errors';\nimport { AuthInternal } from '../../model/auth';\nimport { _createError } from '../util/assert';\n\n// The amount of time to store the UIDs of seen events; this is\n// set to 10 min by default\nconst EVENT_DUPLICATION_CACHE_DURATION_MS = 10 * 60 * 1000;\n\nexport class AuthEventManager implements EventManager {\n private readonly cachedEventUids: Set = new Set();\n private readonly consumers: Set = new Set();\n protected queuedRedirectEvent: AuthEvent | null = null;\n protected hasHandledPotentialRedirect = false;\n private lastProcessedEventTime = Date.now();\n\n constructor(private readonly auth: AuthInternal) {}\n\n registerConsumer(authEventConsumer: AuthEventConsumer): void {\n this.consumers.add(authEventConsumer);\n\n if (\n this.queuedRedirectEvent &&\n this.isEventForConsumer(this.queuedRedirectEvent, authEventConsumer)\n ) {\n this.sendToConsumer(this.queuedRedirectEvent, authEventConsumer);\n this.saveEventToCache(this.queuedRedirectEvent);\n this.queuedRedirectEvent = null;\n }\n }\n\n unregisterConsumer(authEventConsumer: AuthEventConsumer): void {\n this.consumers.delete(authEventConsumer);\n }\n\n onEvent(event: AuthEvent): boolean {\n // Check if the event has already been handled\n if (this.hasEventBeenHandled(event)) {\n return false;\n }\n\n let handled = false;\n this.consumers.forEach(consumer => {\n if (this.isEventForConsumer(event, consumer)) {\n handled = true;\n this.sendToConsumer(event, consumer);\n this.saveEventToCache(event);\n }\n });\n\n if (this.hasHandledPotentialRedirect || !isRedirectEvent(event)) {\n // If we've already seen a redirect before, or this is a popup event,\n // bail now\n return handled;\n }\n\n this.hasHandledPotentialRedirect = true;\n\n // If the redirect wasn't handled, hang on to it\n if (!handled) {\n this.queuedRedirectEvent = event;\n handled = true;\n }\n\n return handled;\n }\n\n private sendToConsumer(event: AuthEvent, consumer: AuthEventConsumer): void {\n if (event.error && !isNullRedirectEvent(event)) {\n const code =\n (event.error.code?.split('auth/')[1] as AuthErrorCode) ||\n AuthErrorCode.INTERNAL_ERROR;\n consumer.onError(_createError(this.auth, code));\n } else {\n consumer.onAuthEvent(event);\n }\n }\n\n private isEventForConsumer(\n event: AuthEvent,\n consumer: AuthEventConsumer\n ): boolean {\n const eventIdMatches =\n consumer.eventId === null ||\n (!!event.eventId && event.eventId === consumer.eventId);\n return consumer.filter.includes(event.type) && eventIdMatches;\n }\n\n private hasEventBeenHandled(event: AuthEvent): boolean {\n if (\n Date.now() - this.lastProcessedEventTime >=\n EVENT_DUPLICATION_CACHE_DURATION_MS\n ) {\n this.cachedEventUids.clear();\n }\n\n return this.cachedEventUids.has(eventUid(event));\n }\n\n private saveEventToCache(event: AuthEvent): void {\n this.cachedEventUids.add(eventUid(event));\n this.lastProcessedEventTime = Date.now();\n }\n}\n\nfunction eventUid(e: AuthEvent): string {\n return [e.type, e.eventId, e.sessionId, e.tenantId].filter(v => v).join('-');\n}\n\nfunction isNullRedirectEvent({ type, error }: AuthEvent): boolean {\n return (\n type === AuthEventType.UNKNOWN &&\n error?.code === `auth/${AuthErrorCode.NO_AUTH_EVENT}`\n );\n}\n\nfunction isRedirectEvent(event: AuthEvent): boolean {\n switch (event.type) {\n case AuthEventType.SIGN_IN_VIA_REDIRECT:\n case AuthEventType.LINK_VIA_REDIRECT:\n case AuthEventType.REAUTH_VIA_REDIRECT:\n return true;\n case AuthEventType.UNKNOWN:\n return isNullRedirectEvent(event);\n default:\n return false;\n }\n}\n","/**\n * @license\n * Copyright 2020 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 } from '../../model/public_types';\n\nimport { _isMobileBrowser, _isIE10 } from '../../core/util/browser';\nimport {\n PersistenceInternal as InternalPersistence,\n PersistenceType,\n PersistenceValue,\n StorageEventListener\n} from '../../core/persistence';\nimport { BrowserPersistenceClass } from './browser';\n\n// The polling period in case events are not supported\nexport const _POLLING_INTERVAL_MS = 1000;\n\n// The IE 10 localStorage cross tab synchronization delay in milliseconds\nconst IE10_LOCAL_STORAGE_SYNC_DELAY = 10;\n\nclass BrowserLocalPersistence\n extends BrowserPersistenceClass\n implements InternalPersistence\n{\n static type: 'LOCAL' = 'LOCAL';\n\n constructor() {\n super(() => window.localStorage, PersistenceType.LOCAL);\n }\n\n private readonly boundEventHandler = (\n event: StorageEvent,\n poll?: boolean\n ): void => this.onStorageEvent(event, poll);\n private readonly listeners: Record> = {};\n private readonly localCache: Record = {};\n // setTimeout return value is platform specific\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private pollTimer: any | null = null;\n\n // Whether to use polling instead of depending on window events\n private readonly fallbackToPolling = _isMobileBrowser();\n readonly _shouldAllowMigration = true;\n\n private forAllChangedKeys(\n cb: (key: string, oldValue: string | null, newValue: string | null) => void\n ): void {\n // Check all keys with listeners on them.\n for (const key of Object.keys(this.listeners)) {\n // Get value from localStorage.\n const newValue = this.storage.getItem(key);\n const oldValue = this.localCache[key];\n // If local map value does not match, trigger listener with storage event.\n // Differentiate this simulated event from the real storage event.\n if (newValue !== oldValue) {\n cb(key, oldValue, newValue);\n }\n }\n }\n\n private onStorageEvent(event: StorageEvent, poll = false): void {\n // Key would be null in some situations, like when localStorage is cleared\n if (!event.key) {\n this.forAllChangedKeys(\n (key: string, _oldValue: string | null, newValue: string | null) => {\n this.notifyListeners(key, newValue);\n }\n );\n return;\n }\n\n const key = event.key;\n\n // Check the mechanism how this event was detected.\n // The first event will dictate the mechanism to be used.\n if (poll) {\n // Environment detects storage changes via polling.\n // Remove storage event listener to prevent possible event duplication.\n this.detachListener();\n } else {\n // Environment detects storage changes via storage event listener.\n // Remove polling listener to prevent possible event duplication.\n this.stopPolling();\n }\n\n const triggerListeners = (): void => {\n // Keep local map up to date in case storage event is triggered before\n // poll.\n const storedValue = this.storage.getItem(key);\n if (!poll && this.localCache[key] === storedValue) {\n // Real storage event which has already been detected, do nothing.\n // This seems to trigger in some IE browsers for some reason.\n return;\n }\n this.notifyListeners(key, storedValue);\n };\n\n const storedValue = this.storage.getItem(key);\n if (\n _isIE10() &&\n storedValue !== event.newValue &&\n event.newValue !== event.oldValue\n ) {\n // IE 10 has this weird bug where a storage event would trigger with the\n // correct key, oldValue and newValue but localStorage.getItem(key) does\n // not yield the updated value until a few milliseconds. This ensures\n // this recovers from that situation.\n setTimeout(triggerListeners, IE10_LOCAL_STORAGE_SYNC_DELAY);\n } else {\n triggerListeners();\n }\n }\n\n private notifyListeners(key: string, value: string | null): void {\n this.localCache[key] = value;\n const listeners = this.listeners[key];\n if (listeners) {\n for (const listener of Array.from(listeners)) {\n listener(value ? JSON.parse(value) : value);\n }\n }\n }\n\n private startPolling(): void {\n this.stopPolling();\n\n this.pollTimer = setInterval(() => {\n this.forAllChangedKeys(\n (key: string, oldValue: string | null, newValue: string | null) => {\n this.onStorageEvent(\n new StorageEvent('storage', {\n key,\n oldValue,\n newValue\n }),\n /* poll */ true\n );\n }\n );\n }, _POLLING_INTERVAL_MS);\n }\n\n private stopPolling(): void {\n if (this.pollTimer) {\n clearInterval(this.pollTimer);\n this.pollTimer = null;\n }\n }\n\n private attachListener(): void {\n window.addEventListener('storage', this.boundEventHandler);\n }\n\n private detachListener(): void {\n window.removeEventListener('storage', this.boundEventHandler);\n }\n\n _addListener(key: string, listener: StorageEventListener): void {\n if (Object.keys(this.listeners).length === 0) {\n // Whether browser can detect storage event when it had already been pushed to the background.\n // This may happen in some mobile browsers. A localStorage change in the foreground window\n // will not be detected in the background window via the storage event.\n // This was detected in iOS 7.x mobile browsers\n if (this.fallbackToPolling) {\n this.startPolling();\n } else {\n this.attachListener();\n }\n }\n if (!this.listeners[key]) {\n this.listeners[key] = new Set();\n // Populate the cache to avoid spuriously triggering on first poll.\n this.localCache[key] = this.storage.getItem(key);\n }\n this.listeners[key].add(listener);\n }\n\n _removeListener(key: string, listener: StorageEventListener): void {\n if (this.listeners[key]) {\n this.listeners[key].delete(listener);\n\n if (this.listeners[key].size === 0) {\n delete this.listeners[key];\n }\n }\n\n if (Object.keys(this.listeners).length === 0) {\n this.detachListener();\n this.stopPolling();\n }\n }\n\n // Update local cache on base operations:\n\n async _set(key: string, value: PersistenceValue): Promise {\n await super._set(key, value);\n this.localCache[key] = JSON.stringify(value);\n }\n\n async _get(key: string): Promise {\n const value = await super._get(key);\n this.localCache[key] = JSON.stringify(value);\n return value;\n }\n\n async _remove(key: string): Promise {\n await super._remove(key);\n delete this.localCache[key];\n }\n}\n\n/**\n * An implementation of {@link Persistence} of type `LOCAL` using `localStorage`\n * for the underlying storage.\n *\n * @public\n */\nexport const browserLocalPersistence: Persistence = BrowserLocalPersistence;\n","/**\n * @license\n * Copyright 2020 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 { querystringDecode } from '@firebase/util';\nimport { AuthEventManager } from '../../core/auth/auth_event_manager';\nimport { AuthErrorCode } from '../../core/errors';\nimport { PersistedBlob, PersistenceInternal } from '../../core/persistence';\nimport {\n KeyName,\n _persistenceKeyName\n} from '../../core/persistence/persistence_user_manager';\nimport { _createError } from '../../core/util/assert';\nimport { _getInstance } from '../../core/util/instantiator';\nimport { AuthInternal } from '../../model/auth';\nimport { AuthEvent, AuthEventType } from '../../model/popup_redirect';\nimport { browserLocalPersistence } from '../../platform_browser/persistence/local_storage';\n\nconst SESSION_ID_LENGTH = 20;\n\n/** Custom AuthEventManager that adds passive listeners to events */\nexport class CordovaAuthEventManager extends AuthEventManager {\n private readonly passiveListeners = new Set<(e: AuthEvent) => void>();\n private resolveInitialized!: () => void;\n private initPromise = new Promise(resolve => {\n this.resolveInitialized = resolve;\n });\n\n addPassiveListener(cb: (e: AuthEvent) => void): void {\n this.passiveListeners.add(cb);\n }\n\n removePassiveListener(cb: (e: AuthEvent) => void): void {\n this.passiveListeners.delete(cb);\n }\n\n // In a Cordova environment, this manager can live through multiple redirect\n // operations\n resetRedirect(): void {\n this.queuedRedirectEvent = null;\n this.hasHandledPotentialRedirect = false;\n }\n\n /** Override the onEvent method */\n onEvent(event: AuthEvent): boolean {\n this.resolveInitialized();\n this.passiveListeners.forEach(cb => cb(event));\n return super.onEvent(event);\n }\n\n async initialized(): Promise {\n await this.initPromise;\n }\n}\n\n/**\n * Generates a (partial) {@link AuthEvent}.\n */\nexport function _generateNewEvent(\n auth: AuthInternal,\n type: AuthEventType,\n eventId: string | null = null\n): AuthEvent {\n return {\n type,\n eventId,\n urlResponse: null,\n sessionId: generateSessionId(),\n postBody: null,\n tenantId: auth.tenantId,\n error: _createError(auth, AuthErrorCode.NO_AUTH_EVENT)\n };\n}\n\nexport function _savePartialEvent(\n auth: AuthInternal,\n event: AuthEvent\n): Promise {\n return storage()._set(persistenceKey(auth), event as object as PersistedBlob);\n}\n\nexport async function _getAndRemoveEvent(\n auth: AuthInternal\n): Promise {\n const event = (await storage()._get(\n persistenceKey(auth)\n )) as AuthEvent | null;\n if (event) {\n await storage()._remove(persistenceKey(auth));\n }\n return event;\n}\n\nexport function _eventFromPartialAndUrl(\n partialEvent: AuthEvent,\n url: string\n): AuthEvent | null {\n // Parse the deep link within the dynamic link URL.\n const callbackUrl = _getDeepLinkFromCallback(url);\n // Confirm it is actually a callback URL.\n // Currently the universal link will be of this format:\n // https:///__/auth/callback\n // This is a fake URL but is not intended to take the user anywhere\n // and just redirect to the app.\n if (callbackUrl.includes('/__/auth/callback')) {\n // Check if there is an error in the URL.\n // This mechanism is also used to pass errors back to the app:\n // https:///__/auth/callback?firebaseError=\n const params = searchParamsOrEmpty(callbackUrl);\n // Get the error object corresponding to the stringified error if found.\n const errorObject = params['firebaseError']\n ? parseJsonOrNull(decodeURIComponent(params['firebaseError']))\n : null;\n const code = errorObject?.['code']?.split('auth/')?.[1];\n const error = code ? _createError(code) : null;\n if (error) {\n return {\n type: partialEvent.type,\n eventId: partialEvent.eventId,\n tenantId: partialEvent.tenantId,\n error,\n urlResponse: null,\n sessionId: null,\n postBody: null\n };\n } else {\n return {\n type: partialEvent.type,\n eventId: partialEvent.eventId,\n tenantId: partialEvent.tenantId,\n sessionId: partialEvent.sessionId,\n urlResponse: callbackUrl,\n postBody: null\n };\n }\n }\n\n return null;\n}\n\nfunction generateSessionId(): string {\n const chars = [];\n const allowedChars =\n '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n for (let i = 0; i < SESSION_ID_LENGTH; i++) {\n const idx = Math.floor(Math.random() * allowedChars.length);\n chars.push(allowedChars.charAt(idx));\n }\n return chars.join('');\n}\n\nfunction storage(): PersistenceInternal {\n return _getInstance(browserLocalPersistence);\n}\n\nfunction persistenceKey(auth: AuthInternal): string {\n return _persistenceKeyName(KeyName.AUTH_EVENT, auth.config.apiKey, auth.name);\n}\n\nfunction parseJsonOrNull(json: string): ReturnType | null {\n try {\n return JSON.parse(json);\n } catch (e) {\n return null;\n }\n}\n\n// Exported for testing\nexport function _getDeepLinkFromCallback(url: string): string {\n const params = searchParamsOrEmpty(url);\n const link = params['link'] ? decodeURIComponent(params['link']) : undefined;\n // Double link case (automatic redirect)\n const doubleDeepLink = searchParamsOrEmpty(link)['link'];\n // iOS custom scheme links.\n const iOSDeepLink = params['deep_link_id']\n ? decodeURIComponent(params['deep_link_id'])\n : undefined;\n const iOSDoubleDeepLink = searchParamsOrEmpty(iOSDeepLink)['link'];\n return iOSDoubleDeepLink || iOSDeepLink || doubleDeepLink || link || url;\n}\n\n/**\n * Optimistically tries to get search params from a string, or else returns an\n * empty search params object.\n */\nfunction searchParamsOrEmpty(url: string | undefined): Record {\n if (!url?.includes('?')) {\n return {};\n }\n\n const [_, ...rest] = url.split('?');\n return querystringDecode(rest.join('?')) as Record;\n}\n","/**\n * @license\n * Copyright 2021 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 { AuthProvider, PopupRedirectResolver } from '../../model/public_types';\nimport { browserSessionPersistence } from '../../platform_browser/persistence/session_storage';\nimport { AuthInternal } from '../../model/auth';\nimport {\n AuthEvent,\n AuthEventType,\n PopupRedirectResolverInternal\n} from '../../model/popup_redirect';\nimport { AuthPopup } from '../../platform_browser/util/popup';\nimport { _createError, _fail } from '../../core/util/assert';\nimport { AuthErrorCode } from '../../core/errors';\nimport {\n _checkCordovaConfiguration,\n _generateHandlerUrl,\n _performRedirect,\n _validateOrigin,\n _waitForAppResume\n} from './utils';\nimport {\n CordovaAuthEventManager,\n _eventFromPartialAndUrl,\n _generateNewEvent,\n _getAndRemoveEvent,\n _savePartialEvent\n} from './events';\nimport { AuthEventManager } from '../../core/auth/auth_event_manager';\nimport { _getRedirectResult } from '../../platform_browser/strategies/redirect';\nimport {\n _clearRedirectOutcomes,\n _overrideRedirectResult\n} from '../../core/strategies/redirect';\nimport { _cordovaWindow } from '../plugins';\n\n/**\n * How long to wait for the initial auth event before concluding no\n * redirect pending\n */\nconst INITIAL_EVENT_TIMEOUT_MS = 500;\n\nclass CordovaPopupRedirectResolver implements PopupRedirectResolverInternal {\n readonly _redirectPersistence = browserSessionPersistence;\n readonly _shouldInitProactively = true; // This is lightweight for Cordova\n private readonly eventManagers = new Map();\n private readonly originValidationPromises: Record> = {};\n\n _completeRedirectFn = _getRedirectResult;\n _overrideRedirectResult = _overrideRedirectResult;\n\n async _initialize(auth: AuthInternal): Promise {\n const key = auth._key();\n let manager = this.eventManagers.get(key);\n if (!manager) {\n manager = new CordovaAuthEventManager(auth);\n this.eventManagers.set(key, manager);\n this.attachCallbackListeners(auth, manager);\n }\n return manager;\n }\n\n _openPopup(auth: AuthInternal): Promise {\n _fail(auth, AuthErrorCode.OPERATION_NOT_SUPPORTED);\n }\n\n async _openRedirect(\n auth: AuthInternal,\n provider: AuthProvider,\n authType: AuthEventType,\n eventId?: string\n ): Promise {\n _checkCordovaConfiguration(auth);\n const manager = await this._initialize(auth);\n await manager.initialized();\n\n // Reset the persisted redirect states. This does not matter on Web where\n // the redirect always blows away application state entirely. On Cordova,\n // the app maintains control flow through the redirect.\n manager.resetRedirect();\n _clearRedirectOutcomes();\n\n await this._originValidation(auth);\n\n const event = _generateNewEvent(auth, authType, eventId);\n await _savePartialEvent(auth, event);\n const url = await _generateHandlerUrl(auth, event, provider);\n const iabRef = await _performRedirect(url);\n return _waitForAppResume(auth, manager, iabRef);\n }\n\n _isIframeWebStorageSupported(\n _auth: AuthInternal,\n _cb: (support: boolean) => unknown\n ): void {\n throw new Error('Method not implemented.');\n }\n\n _originValidation(auth: AuthInternal): Promise {\n const key = auth._key();\n if (!this.originValidationPromises[key]) {\n this.originValidationPromises[key] = _validateOrigin(auth);\n }\n\n return this.originValidationPromises[key];\n }\n\n private attachCallbackListeners(\n auth: AuthInternal,\n manager: AuthEventManager\n ): void {\n // Get the global plugins\n const { universalLinks, handleOpenURL, BuildInfo } = _cordovaWindow();\n\n const noEventTimeout = setTimeout(async () => {\n // We didn't see that initial event. Clear any pending object and\n // dispatch no event\n await _getAndRemoveEvent(auth);\n manager.onEvent(generateNoEvent());\n }, INITIAL_EVENT_TIMEOUT_MS);\n\n const universalLinksCb = async (\n eventData: Record | null\n ): Promise => {\n // We have an event so we can clear the no event timeout\n clearTimeout(noEventTimeout);\n\n const partialEvent = await _getAndRemoveEvent(auth);\n let finalEvent: AuthEvent | null = null;\n if (partialEvent && eventData?.['url']) {\n finalEvent = _eventFromPartialAndUrl(partialEvent, eventData['url']);\n }\n\n // If finalEvent is never filled, trigger with no event\n manager.onEvent(finalEvent || generateNoEvent());\n };\n\n // Universal links subscriber doesn't exist for iOS, so we need to check\n if (\n typeof universalLinks !== 'undefined' &&\n typeof universalLinks.subscribe === 'function'\n ) {\n universalLinks.subscribe(null, universalLinksCb);\n }\n\n // iOS 7 or 8 custom URL schemes.\n // This is also the current default behavior for iOS 9+.\n // For this to work, cordova-plugin-customurlscheme needs to be installed.\n // https://github.com/EddyVerbruggen/Custom-URL-scheme\n // Do not overwrite the existing developer's URL handler.\n const existingHandleOpenURL = handleOpenURL;\n const packagePrefix = `${BuildInfo.packageName.toLowerCase()}://`;\n _cordovaWindow().handleOpenURL = async url => {\n if (url.toLowerCase().startsWith(packagePrefix)) {\n // We want this intentionally to float\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n universalLinksCb({ url });\n }\n // Call the developer's handler if it is present.\n if (typeof existingHandleOpenURL === 'function') {\n try {\n existingHandleOpenURL(url);\n } catch (e) {\n // This is a developer error. Don't stop the flow of the SDK.\n console.error(e);\n }\n }\n };\n }\n}\n\n/**\n * An implementation of {@link PopupRedirectResolver} suitable for Cordova\n * based applications.\n *\n * @public\n */\nexport const cordovaPopupRedirectResolver: PopupRedirectResolver =\n CordovaPopupRedirectResolver;\n\nfunction generateNoEvent(): AuthEvent {\n return {\n type: AuthEventType.UNKNOWN,\n eventId: null,\n sessionId: null,\n urlResponse: null,\n postBody: null,\n tenantId: null,\n error: _createError(AuthErrorCode.NO_AUTH_EVENT)\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\nimport { _castAuth } from '../src/core/auth/auth_impl';\nimport { Auth } from '../src/model/public_types';\n\n/**\n * This interface is intended only for use by @firebase/auth-compat, do not use directly\n */\nexport * from '../index';\n\nexport { SignInWithIdpResponse } from '../src/api/authentication/idp';\nexport { AuthErrorCode } from '../src/core/errors';\nexport { PersistenceInternal } from '../src/core/persistence';\nexport { _persistenceKeyName } from '../src/core/persistence/persistence_user_manager';\nexport { UserImpl } from '../src/core/user/user_impl';\nexport { _getInstance } from '../src/core/util/instantiator';\nexport {\n PopupRedirectResolverInternal,\n EventManager,\n AuthEventType\n} from '../src/model/popup_redirect';\nexport { UserCredentialInternal, UserParameters } from '../src/model/user';\nexport { AuthInternal, ConfigInternal } from '../src/model/auth';\nexport { DefaultConfig, AuthImpl, _castAuth } from '../src/core/auth/auth_impl';\n\nexport { ClientPlatform, _getClientVersion } from '../src/core/util/version';\n\nexport { _generateEventId } from '../src/core/util/event_id';\nexport { TaggedWithTokenResponse } from '../src/model/id_token';\nexport { _fail, _assert } from '../src/core/util/assert';\nexport { AuthPopup } from '../src/platform_browser/util/popup';\nexport { _getRedirectResult } from '../src/platform_browser/strategies/redirect';\nexport { _overrideRedirectResult } from '../src/core/strategies/redirect';\nexport { cordovaPopupRedirectResolver } from '../src/platform_cordova/popup_redirect/popup_redirect';\nexport { FetchProvider } from '../src/core/util/fetch_provider';\nexport { SAMLAuthCredential } from '../src/core/credentials/saml';\n\n// This function should only be called by frameworks (e.g. FirebaseUI-web) to log their usage.\n// It is not intended for direct use by developer apps. NO jsdoc here to intentionally leave it out\n// of autogenerated documentation pages to reduce accidental misuse.\nexport function addFrameworkForLogging(auth: Auth, framework: string): void {\n _castAuth(auth)._logFramework(framework);\n}\n"],"names":["_linkUser"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;AAEG,SAAU,gBAAgB,CAAC,MAAM,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAA;IACvD,IAAI,MAAM,GAAG,EAAE,CAAC;AAChB,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AAC/B,QAAA,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;KAC1C;IACD,OAAO,MAAM,GAAG,MAAM,CAAC;AACzB;;ACvBA;;;;;;;;;;;;;;;AAeG;MA0BU,SAAS,CAAA;AAGpB,IAAA,WAAA,CAAqB,MAAqB,EAAA;QA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AAE;;AAEV,oBAAA,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;iBAClB;aACF;AACH,SAAC,CAAC;KACH;AACF,CAAA;AAED;;;;;AAKG;AACI,MAAM,4BAA4B,GACvC,6BAA6B;AAE/B,SAAS,eAAe,GAAA;IACtB,OAAO;AACL,QAAA,IAAI,EAAuB,SAAA;AAC3B,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,SAAS,EAAE,IAAI;AACf,QAAA,WAAW,EAAE,IAAI;AACjB,QAAA,QAAQ,EAAE,IAAI;AACd,QAAA,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,YAAY,CAA6B,eAAA,mCAAA;KACjD,CAAC;AACJ;;AC5MA;;;;;;;;;;;;;;;AAeG;AAqCH;AACA;AACA;AACgB,SAAA,sBAAsB,CAAC,IAAU,EAAE,SAAiB,EAAA;IAClE,SAAS,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;AAC3C;;;;"} \ No newline at end of file diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/internal/index.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/internal/index.d.ts new file mode 100644 index 0000000..b683c49 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/internal/index.d.ts @@ -0,0 +1,42 @@ +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { Auth } from '../src/model/public_types'; +/** + * This interface is intended only for use by @firebase/auth-compat, do not use directly + */ +export * from '../index'; +export { SignInWithIdpResponse } from '../src/api/authentication/idp'; +export { AuthErrorCode } from '../src/core/errors'; +export { PersistenceInternal } from '../src/core/persistence'; +export { _persistenceKeyName } from '../src/core/persistence/persistence_user_manager'; +export { UserImpl } from '../src/core/user/user_impl'; +export { _getInstance } from '../src/core/util/instantiator'; +export { PopupRedirectResolverInternal, EventManager, AuthEventType } from '../src/model/popup_redirect'; +export { UserCredentialInternal, UserParameters } from '../src/model/user'; +export { AuthInternal, ConfigInternal } from '../src/model/auth'; +export { DefaultConfig, AuthImpl, _castAuth } from '../src/core/auth/auth_impl'; +export { ClientPlatform, _getClientVersion } from '../src/core/util/version'; +export { _generateEventId } from '../src/core/util/event_id'; +export { TaggedWithTokenResponse } from '../src/model/id_token'; +export { _fail, _assert } from '../src/core/util/assert'; +export { AuthPopup } from '../src/platform_browser/util/popup'; +export { _getRedirectResult } from '../src/platform_browser/strategies/redirect'; +export { _overrideRedirectResult } from '../src/core/strategies/redirect'; +export { cordovaPopupRedirectResolver } from '../src/platform_cordova/popup_redirect/popup_redirect'; +export { FetchProvider } from '../src/core/util/fetch_provider'; +export { SAMLAuthCredential } from '../src/core/credentials/saml'; +export declare function addFrameworkForLogging(auth: Auth, framework: string): void; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/package.json b/frontend-old/node_modules/@firebase/auth/dist/node-esm/package.json new file mode 100644 index 0000000..7c34deb --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/package.json @@ -0,0 +1 @@ +{"type":"module"} \ No newline at end of file diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/scripts/run_node_tests.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/scripts/run_node_tests.d.ts new file mode 100644 index 0000000..731d2d9 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/scripts/run_node_tests.d.ts @@ -0,0 +1,17 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 {}; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/account_management/account.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/account_management/account.d.ts new file mode 100644 index 0000000..f106e93 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/account_management/account.d.ts @@ -0,0 +1,59 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { MfaEnrollment } from './mfa'; +import { Auth } from '../../model/public_types'; +export interface DeleteAccountRequest { + idToken: string; +} +export declare function deleteAccount(auth: Auth, request: DeleteAccountRequest): Promise; +export interface ProviderUserInfo { + providerId: string; + rawId?: string; + email?: string; + displayName?: string; + photoUrl?: string; + phoneNumber?: string; +} +export interface DeleteLinkedAccountsRequest { + idToken: string; + deleteProvider: string[]; +} +export interface DeleteLinkedAccountsResponse { + providerUserInfo: ProviderUserInfo[]; +} +export declare function deleteLinkedAccounts(auth: Auth, request: DeleteLinkedAccountsRequest): Promise; +export interface APIUserInfo { + localId?: string; + displayName?: string; + photoUrl?: string; + email?: string; + emailVerified?: boolean; + phoneNumber?: string; + lastLoginAt?: number; + createdAt?: number; + tenantId?: string; + passwordHash?: string; + providerUserInfo?: ProviderUserInfo[]; + mfaInfo?: MfaEnrollment[]; +} +export interface GetAccountInfoRequest { + idToken: string; +} +export interface GetAccountInfoResponse { + users: APIUserInfo[]; +} +export declare function getAccountInfo(auth: Auth, request: GetAccountInfoRequest): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/account_management/email_and_password.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/account_management/email_and_password.d.ts new file mode 100644 index 0000000..5a3bb06 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/account_management/email_and_password.d.ts @@ -0,0 +1,49 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { ActionCodeOperation, Auth } from '../../model/public_types'; +import { IdTokenResponse } from '../../model/id_token'; +import { MfaEnrollment } from './mfa'; +import { SignUpRequest, SignUpResponse } from '../authentication/sign_up'; +export interface ResetPasswordRequest { + oobCode: string; + newPassword?: string; + tenantId?: string; +} +export interface ResetPasswordResponse { + email: string; + newEmail?: string; + requestType?: ActionCodeOperation; + mfaInfo?: MfaEnrollment; +} +export declare function resetPassword(auth: Auth, request: ResetPasswordRequest): Promise; +export interface UpdateEmailPasswordRequest { + idToken: string; + returnSecureToken?: boolean; + email?: string; + password?: string; +} +export interface UpdateEmailPasswordResponse extends IdTokenResponse { +} +export declare function updateEmailPassword(auth: Auth, request: UpdateEmailPasswordRequest): Promise; +export declare function linkEmailPassword(auth: Auth, request: SignUpRequest): Promise; +export interface ApplyActionCodeRequest { + oobCode: string; + tenantId?: string; +} +export interface ApplyActionCodeResponse { +} +export declare function applyActionCode(auth: Auth, request: ApplyActionCodeRequest): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/account_management/mfa.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/account_management/mfa.d.ts new file mode 100644 index 0000000..8db0c0d --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/account_management/mfa.d.ts @@ -0,0 +1,107 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { RecaptchaClientType, RecaptchaVersion } from '../index'; +import { SignInWithPhoneNumberRequest } from '../authentication/sms'; +import { FinalizeMfaResponse } from '../authentication/mfa'; +import { AuthInternal } from '../../model/auth'; +/** + * MFA Info as returned by the API. + */ +interface BaseMfaEnrollment { + mfaEnrollmentId: string; + enrolledAt: number; + displayName?: string; +} +/** + * An MFA provided by SMS verification. + */ +export interface PhoneMfaEnrollment extends BaseMfaEnrollment { + phoneInfo: string; +} +/** + * An MFA provided by TOTP (Time-based One Time Password). + */ +export interface TotpMfaEnrollment extends BaseMfaEnrollment { +} +/** + * MfaEnrollment can be any subtype of BaseMfaEnrollment, currently only PhoneMfaEnrollment and TotpMfaEnrollment are supported. + */ +export type MfaEnrollment = PhoneMfaEnrollment | TotpMfaEnrollment; +export interface StartPhoneMfaEnrollmentRequest { + idToken: string; + phoneEnrollmentInfo: { + phoneNumber: string; + recaptchaToken?: string; + captchaResponse?: string; + clientType?: RecaptchaClientType; + recaptchaVersion?: RecaptchaVersion; + }; + tenantId?: string; +} +export interface StartPhoneMfaEnrollmentResponse { + phoneSessionInfo: { + sessionInfo: string; + }; +} +export declare function startEnrollPhoneMfa(auth: AuthInternal, request: StartPhoneMfaEnrollmentRequest): Promise; +export interface FinalizePhoneMfaEnrollmentRequest { + idToken: string; + phoneVerificationInfo: SignInWithPhoneNumberRequest; + displayName?: string | null; + tenantId?: string; +} +export interface FinalizePhoneMfaEnrollmentResponse extends FinalizeMfaResponse { +} +export declare function finalizeEnrollPhoneMfa(auth: AuthInternal, request: FinalizePhoneMfaEnrollmentRequest): Promise; +export interface StartTotpMfaEnrollmentRequest { + idToken: string; + totpEnrollmentInfo: {}; + tenantId?: string; +} +export interface StartTotpMfaEnrollmentResponse { + totpSessionInfo: { + sharedSecretKey: string; + verificationCodeLength: number; + hashingAlgorithm: string; + periodSec: number; + sessionInfo: string; + finalizeEnrollmentTime: number; + }; +} +export declare function startEnrollTotpMfa(auth: AuthInternal, request: StartTotpMfaEnrollmentRequest): Promise; +export interface TotpVerificationInfo { + sessionInfo: string; + verificationCode: string; +} +export interface FinalizeTotpMfaEnrollmentRequest { + idToken: string; + totpVerificationInfo: TotpVerificationInfo; + displayName?: string | null; + tenantId?: string; +} +export interface FinalizeTotpMfaEnrollmentResponse extends FinalizeMfaResponse { +} +export declare function finalizeEnrollTotpMfa(auth: AuthInternal, request: FinalizeTotpMfaEnrollmentRequest): Promise; +export interface WithdrawMfaRequest { + idToken: string; + mfaEnrollmentId: string; + tenantId?: string; +} +export interface WithdrawMfaResponse extends FinalizeMfaResponse { +} +export declare function withdrawMfa(auth: AuthInternal, request: WithdrawMfaRequest): Promise; +export {}; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/account_management/profile.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/account_management/profile.d.ts new file mode 100644 index 0000000..9b1d591 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/account_management/profile.d.ts @@ -0,0 +1,29 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { IdTokenResponse } from '../../model/id_token'; +import { Auth } from '../../model/public_types'; +export interface UpdateProfileRequest { + idToken: string; + displayName?: string | null; + photoUrl?: string | null; + returnSecureToken: boolean; +} +export interface UpdateProfileResponse extends IdTokenResponse { + displayName?: string | null; + photoUrl?: string | null; +} +export declare function updateProfile(auth: Auth, request: UpdateProfileRequest): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/create_auth_uri.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/create_auth_uri.d.ts new file mode 100644 index 0000000..8c2db00 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/create_auth_uri.d.ts @@ -0,0 +1,26 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { Auth } from '../../model/public_types'; +export interface CreateAuthUriRequest { + identifier: string; + continueUri: string; + tenantId?: string; +} +export interface CreateAuthUriResponse { + signinMethods: string[]; +} +export declare function createAuthUri(auth: Auth, request: CreateAuthUriRequest): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/custom_token.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/custom_token.d.ts new file mode 100644 index 0000000..ad776c7 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/custom_token.d.ts @@ -0,0 +1,26 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { IdTokenResponse } from '../../model/id_token'; +import { Auth } from '../../model/public_types'; +export interface SignInWithCustomTokenRequest { + token: string; + returnSecureToken: boolean; + tenantId?: string; +} +export interface SignInWithCustomTokenResponse extends IdTokenResponse { +} +export declare function signInWithCustomToken(auth: Auth, request: SignInWithCustomTokenRequest): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/email_and_password.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/email_and_password.d.ts new file mode 100644 index 0000000..90028bd --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/email_and_password.d.ts @@ -0,0 +1,86 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { ActionCodeOperation, Auth } from '../../model/public_types'; +import { RecaptchaClientType, RecaptchaVersion } from '../index'; +import { IdToken, IdTokenResponse } from '../../model/id_token'; +export interface SignInWithPasswordRequest { + returnSecureToken?: boolean; + email: string; + password: string; + tenantId?: string; + captchaResponse?: string; + clientType?: RecaptchaClientType; + recaptchaVersion?: RecaptchaVersion; +} +export interface SignInWithPasswordResponse extends IdTokenResponse { + email: string; + displayName: string; +} +export declare function signInWithPassword(auth: Auth, request: SignInWithPasswordRequest): Promise; +export interface GetOobCodeRequest { + email?: string; + continueUrl?: string; + iOSBundleId?: string; + iosAppStoreId?: string; + androidPackageName?: string; + androidInstallApp?: boolean; + androidMinimumVersionCode?: string; + canHandleCodeInApp?: boolean; + dynamicLinkDomain?: string; + tenantId?: string; + targetProjectid?: string; + linkDomain?: string; +} +export interface VerifyEmailRequest extends GetOobCodeRequest { + requestType: ActionCodeOperation.VERIFY_EMAIL; + idToken: IdToken; +} +export interface PasswordResetRequest extends GetOobCodeRequest { + requestType: ActionCodeOperation.PASSWORD_RESET; + email: string; + captchaResp?: string; + clientType?: RecaptchaClientType; + recaptchaVersion?: RecaptchaVersion; +} +export interface EmailSignInRequest extends GetOobCodeRequest { + requestType: ActionCodeOperation.EMAIL_SIGNIN; + email: string; + captchaResp?: string; + clientType?: RecaptchaClientType; + recaptchaVersion?: RecaptchaVersion; +} +export interface VerifyAndChangeEmailRequest extends GetOobCodeRequest { + requestType: ActionCodeOperation.VERIFY_AND_CHANGE_EMAIL; + idToken: IdToken; + newEmail: string; +} +interface GetOobCodeResponse { + email: string; +} +export interface VerifyEmailResponse extends GetOobCodeResponse { +} +export interface PasswordResetResponse extends GetOobCodeResponse { +} +export interface EmailSignInResponse extends GetOobCodeResponse { +} +export interface VerifyAndChangeEmailResponse extends GetOobCodeRequest { +} +export declare function sendEmailVerification(auth: Auth, request: VerifyEmailRequest): Promise; +export declare function sendPasswordResetEmail(auth: Auth, request: PasswordResetRequest): Promise; +export declare function sendSignInLinkToEmail(auth: Auth, request: EmailSignInRequest): Promise; +export declare function verifyAndChangeEmail(auth: Auth, request: VerifyAndChangeEmailRequest): Promise; +export {}; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/email_link.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/email_link.d.ts new file mode 100644 index 0000000..eef24a5 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/email_link.d.ts @@ -0,0 +1,32 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { IdTokenResponse } from '../../model/id_token'; +import { Auth } from '../../model/public_types'; +export interface SignInWithEmailLinkRequest { + email: string; + oobCode: string; + tenantId?: string; +} +export interface SignInWithEmailLinkResponse extends IdTokenResponse { + email: string; + isNewUser: boolean; +} +export declare function signInWithEmailLink(auth: Auth, request: SignInWithEmailLinkRequest): Promise; +export interface SignInWithEmailLinkForLinkingRequest extends SignInWithEmailLinkRequest { + idToken: string; +} +export declare function signInWithEmailLinkForLinking(auth: Auth, request: SignInWithEmailLinkForLinkingRequest): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/idp.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/idp.d.ts new file mode 100644 index 0000000..dd75832 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/idp.d.ts @@ -0,0 +1,40 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { IdToken, IdTokenResponse } from '../../model/id_token'; +import { Auth } from '../../model/public_types'; +export interface SignInWithIdpRequest { + requestUri: string; + postBody?: string; + sessionId?: string; + tenantId?: string; + returnSecureToken: boolean; + returnIdpCredential?: boolean; + idToken?: IdToken; + autoCreate?: boolean; + pendingToken?: string; +} +/** + * @internal + */ +export interface SignInWithIdpResponse extends IdTokenResponse { + oauthAccessToken?: string; + oauthTokenSecret?: string; + nonce?: string; + oauthIdToken?: string; + pendingToken?: string; +} +export declare function signInWithIdp(auth: Auth, request: SignInWithIdpRequest): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/mfa.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/mfa.d.ts new file mode 100644 index 0000000..0d2abed --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/mfa.d.ts @@ -0,0 +1,73 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { RecaptchaClientType, RecaptchaVersion } from '../index'; +import { Auth } from '../../model/public_types'; +import { IdTokenResponse } from '../../model/id_token'; +import { MfaEnrollment } from '../account_management/mfa'; +import { SignInWithIdpResponse } from './idp'; +import { SignInWithPhoneNumberRequest, SignInWithPhoneNumberResponse } from './sms'; +export interface FinalizeMfaResponse { + idToken: string; + refreshToken: string; +} +/** + * @internal + */ +export interface IdTokenMfaResponse extends IdTokenResponse { + mfaPendingCredential?: string; + mfaInfo?: MfaEnrollment[]; +} +export interface StartPhoneMfaSignInRequest { + mfaPendingCredential: string; + mfaEnrollmentId: string; + phoneSignInInfo: { + recaptchaToken?: string; + captchaResponse?: string; + clientType?: RecaptchaClientType; + recaptchaVersion?: RecaptchaVersion; + }; + tenantId?: string; +} +export interface StartPhoneMfaSignInResponse { + phoneResponseInfo: { + sessionInfo: string; + }; +} +export declare function startSignInPhoneMfa(auth: Auth, request: StartPhoneMfaSignInRequest): Promise; +export interface FinalizePhoneMfaSignInRequest { + mfaPendingCredential: string; + phoneVerificationInfo: SignInWithPhoneNumberRequest; + tenantId?: string; +} +export interface FinalizeTotpMfaSignInRequest { + mfaPendingCredential: string; + totpVerificationInfo: { + verificationCode: string; + }; + tenantId?: string; + mfaEnrollmentId: string; +} +export interface FinalizePhoneMfaSignInResponse extends FinalizeMfaResponse { +} +export interface FinalizeTotpMfaSignInResponse extends FinalizeMfaResponse { +} +export declare function finalizeSignInPhoneMfa(auth: Auth, request: FinalizePhoneMfaSignInRequest): Promise; +export declare function finalizeSignInTotpMfa(auth: Auth, request: FinalizeTotpMfaSignInRequest): Promise; +/** + * @internal + */ +export type PhoneOrOauthTokenResponse = SignInWithPhoneNumberResponse | SignInWithIdpResponse | IdTokenResponse; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/recaptcha.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/recaptcha.d.ts new file mode 100644 index 0000000..e324d6d --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/recaptcha.d.ts @@ -0,0 +1,34 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { RecaptchaClientType, RecaptchaVersion } from '../index'; +import { Auth } from '../../model/public_types'; +export declare function getRecaptchaParams(auth: Auth): Promise; +interface GetRecaptchaConfigRequest { + tenantId?: string; + clientType?: RecaptchaClientType; + version?: RecaptchaVersion; +} +export interface RecaptchaEnforcementProviderState { + provider: string; + enforcementState: string; +} +export interface GetRecaptchaConfigResponse { + recaptchaKey: string; + recaptchaEnforcementState: RecaptchaEnforcementProviderState[]; +} +export declare function getRecaptchaConfig(auth: Auth, request: GetRecaptchaConfigRequest): Promise; +export {}; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/sign_up.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/sign_up.d.ts new file mode 100644 index 0000000..78f0838 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/sign_up.d.ts @@ -0,0 +1,34 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { RecaptchaClientType, RecaptchaVersion } from '../index'; +import { IdTokenResponse } from '../../model/id_token'; +import { Auth } from '../../model/public_types'; +export interface SignUpRequest { + idToken?: string; + returnSecureToken?: boolean; + email?: string; + password?: string; + tenantId?: string; + captchaResponse?: string; + clientType?: RecaptchaClientType; + recaptchaVersion?: RecaptchaVersion; +} +export interface SignUpResponse extends IdTokenResponse { + displayName?: string; + email?: string; +} +export declare function signUp(auth: Auth, request: SignUpRequest): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/sms.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/sms.d.ts new file mode 100644 index 0000000..617aa64 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/sms.d.ts @@ -0,0 +1,54 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { RecaptchaClientType, RecaptchaVersion } from '../index'; +import { IdTokenResponse } from '../../model/id_token'; +import { Auth } from '../../model/public_types'; +export interface SendPhoneVerificationCodeRequest { + phoneNumber: string; + recaptchaToken?: string; + tenantId?: string; + captchaResponse?: string; + clientType?: RecaptchaClientType; + recaptchaVersion?: RecaptchaVersion; +} +export interface SendPhoneVerificationCodeResponse { + sessionInfo: string; +} +export declare function sendPhoneVerificationCode(auth: Auth, request: SendPhoneVerificationCodeRequest): Promise; +/** + * @internal + */ +export interface SignInWithPhoneNumberRequest { + temporaryProof?: string; + phoneNumber?: string; + sessionInfo?: string; + code?: string; + tenantId?: string; +} +export interface LinkWithPhoneNumberRequest extends SignInWithPhoneNumberRequest { + idToken: string; +} +/** + * @internal + */ +export interface SignInWithPhoneNumberResponse extends IdTokenResponse { + temporaryProof?: string; + phoneNumber?: string; +} +export declare function signInWithPhoneNumber(auth: Auth, request: SignInWithPhoneNumberRequest): Promise; +export declare function linkWithPhoneNumber(auth: Auth, request: LinkWithPhoneNumberRequest): Promise; +export declare function verifyPhoneNumberForExisting(auth: Auth, request: SignInWithPhoneNumberRequest): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/token.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/token.d.ts new file mode 100644 index 0000000..1433eae --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/authentication/token.d.ts @@ -0,0 +1,37 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { Auth } from '../../model/public_types'; +export declare const enum TokenType { + REFRESH_TOKEN = "REFRESH_TOKEN", + ACCESS_TOKEN = "ACCESS_TOKEN" +} +export interface RequestStsTokenResponse { + accessToken: string; + expiresIn: string; + refreshToken: string; +} +export interface RevokeTokenRequest { + providerId: string; + tokenType: TokenType; + token: string; + idToken: string; + tenantId?: string; +} +export interface RevokeTokenResponse { +} +export declare function requestStsToken(auth: Auth, refreshToken: string): Promise; +export declare function revokeToken(auth: Auth, request: RevokeTokenRequest): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/errors.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/errors.d.ts new file mode 100644 index 0000000..208e19d --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/errors.d.ts @@ -0,0 +1,129 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { AuthErrorCode } from '../core/errors'; +/** + * Errors that can be returned by the backend + */ +export declare const enum ServerError { + ADMIN_ONLY_OPERATION = "ADMIN_ONLY_OPERATION", + BLOCKING_FUNCTION_ERROR_RESPONSE = "BLOCKING_FUNCTION_ERROR_RESPONSE", + CAPTCHA_CHECK_FAILED = "CAPTCHA_CHECK_FAILED", + CORS_UNSUPPORTED = "CORS_UNSUPPORTED", + CREDENTIAL_MISMATCH = "CREDENTIAL_MISMATCH", + CREDENTIAL_TOO_OLD_LOGIN_AGAIN = "CREDENTIAL_TOO_OLD_LOGIN_AGAIN", + DYNAMIC_LINK_NOT_ACTIVATED = "DYNAMIC_LINK_NOT_ACTIVATED", + EMAIL_CHANGE_NEEDS_VERIFICATION = "EMAIL_CHANGE_NEEDS_VERIFICATION", + EMAIL_EXISTS = "EMAIL_EXISTS", + EMAIL_NOT_FOUND = "EMAIL_NOT_FOUND", + EXPIRED_OOB_CODE = "EXPIRED_OOB_CODE", + FEDERATED_USER_ID_ALREADY_LINKED = "FEDERATED_USER_ID_ALREADY_LINKED", + INVALID_APP_CREDENTIAL = "INVALID_APP_CREDENTIAL", + INVALID_APP_ID = "INVALID_APP_ID", + INVALID_CERT_HASH = "INVALID_CERT_HASH", + INVALID_CODE = "INVALID_CODE", + INVALID_CONTINUE_URI = "INVALID_CONTINUE_URI", + INVALID_CUSTOM_TOKEN = "INVALID_CUSTOM_TOKEN", + INVALID_DYNAMIC_LINK_DOMAIN = "INVALID_DYNAMIC_LINK_DOMAIN", + INVALID_EMAIL = "INVALID_EMAIL", + INVALID_ID_TOKEN = "INVALID_ID_TOKEN", + INVALID_IDP_RESPONSE = "INVALID_IDP_RESPONSE", + INVALID_IDENTIFIER = "INVALID_IDENTIFIER", + INVALID_LOGIN_CREDENTIALS = "INVALID_LOGIN_CREDENTIALS", + INVALID_MESSAGE_PAYLOAD = "INVALID_MESSAGE_PAYLOAD", + INVALID_MFA_PENDING_CREDENTIAL = "INVALID_MFA_PENDING_CREDENTIAL", + INVALID_OAUTH_CLIENT_ID = "INVALID_OAUTH_CLIENT_ID", + INVALID_OOB_CODE = "INVALID_OOB_CODE", + INVALID_PASSWORD = "INVALID_PASSWORD", + INVALID_PENDING_TOKEN = "INVALID_PENDING_TOKEN", + INVALID_PHONE_NUMBER = "INVALID_PHONE_NUMBER", + INVALID_PROVIDER_ID = "INVALID_PROVIDER_ID", + INVALID_RECIPIENT_EMAIL = "INVALID_RECIPIENT_EMAIL", + INVALID_SENDER = "INVALID_SENDER", + INVALID_SESSION_INFO = "INVALID_SESSION_INFO", + INVALID_TEMPORARY_PROOF = "INVALID_TEMPORARY_PROOF", + INVALID_TENANT_ID = "INVALID_TENANT_ID", + MFA_ENROLLMENT_NOT_FOUND = "MFA_ENROLLMENT_NOT_FOUND", + MISSING_ANDROID_PACKAGE_NAME = "MISSING_ANDROID_PACKAGE_NAME", + MISSING_APP_CREDENTIAL = "MISSING_APP_CREDENTIAL", + MISSING_CODE = "MISSING_CODE", + MISSING_CONTINUE_URI = "MISSING_CONTINUE_URI", + MISSING_CUSTOM_TOKEN = "MISSING_CUSTOM_TOKEN", + MISSING_IOS_BUNDLE_ID = "MISSING_IOS_BUNDLE_ID", + MISSING_MFA_ENROLLMENT_ID = "MISSING_MFA_ENROLLMENT_ID", + MISSING_MFA_PENDING_CREDENTIAL = "MISSING_MFA_PENDING_CREDENTIAL", + MISSING_OOB_CODE = "MISSING_OOB_CODE", + MISSING_OR_INVALID_NONCE = "MISSING_OR_INVALID_NONCE", + MISSING_PASSWORD = "MISSING_PASSWORD", + MISSING_REQ_TYPE = "MISSING_REQ_TYPE", + MISSING_PHONE_NUMBER = "MISSING_PHONE_NUMBER", + MISSING_SESSION_INFO = "MISSING_SESSION_INFO", + OPERATION_NOT_ALLOWED = "OPERATION_NOT_ALLOWED", + PASSWORD_LOGIN_DISABLED = "PASSWORD_LOGIN_DISABLED", + QUOTA_EXCEEDED = "QUOTA_EXCEEDED", + RESET_PASSWORD_EXCEED_LIMIT = "RESET_PASSWORD_EXCEED_LIMIT", + REJECTED_CREDENTIAL = "REJECTED_CREDENTIAL", + SECOND_FACTOR_EXISTS = "SECOND_FACTOR_EXISTS", + SECOND_FACTOR_LIMIT_EXCEEDED = "SECOND_FACTOR_LIMIT_EXCEEDED", + SESSION_EXPIRED = "SESSION_EXPIRED", + TENANT_ID_MISMATCH = "TENANT_ID_MISMATCH", + TOKEN_EXPIRED = "TOKEN_EXPIRED", + TOO_MANY_ATTEMPTS_TRY_LATER = "TOO_MANY_ATTEMPTS_TRY_LATER", + UNSUPPORTED_FIRST_FACTOR = "UNSUPPORTED_FIRST_FACTOR", + UNSUPPORTED_TENANT_OPERATION = "UNSUPPORTED_TENANT_OPERATION", + UNAUTHORIZED_DOMAIN = "UNAUTHORIZED_DOMAIN", + UNVERIFIED_EMAIL = "UNVERIFIED_EMAIL", + USER_CANCELLED = "USER_CANCELLED", + USER_DISABLED = "USER_DISABLED", + USER_NOT_FOUND = "USER_NOT_FOUND", + WEAK_PASSWORD = "WEAK_PASSWORD", + RECAPTCHA_NOT_ENABLED = "RECAPTCHA_NOT_ENABLED", + MISSING_RECAPTCHA_TOKEN = "MISSING_RECAPTCHA_TOKEN", + INVALID_RECAPTCHA_TOKEN = "INVALID_RECAPTCHA_TOKEN", + INVALID_RECAPTCHA_ACTION = "INVALID_RECAPTCHA_ACTION", + MISSING_CLIENT_TYPE = "MISSING_CLIENT_TYPE", + MISSING_RECAPTCHA_VERSION = "MISSING_RECAPTCHA_VERSION", + INVALID_RECAPTCHA_VERSION = "INVALID_RECAPTCHA_VERSION", + INVALID_REQ_TYPE = "INVALID_REQ_TYPE", + PASSWORD_DOES_NOT_MEET_REQUIREMENTS = "PASSWORD_DOES_NOT_MEET_REQUIREMENTS", + INVALID_HOSTING_LINK_DOMAIN = "INVALID_HOSTING_LINK_DOMAIN" +} +/** + * API Response in the event of an error + */ +export interface JsonError { + error: { + code: number; + message: string; + errors?: [ + { + message: ServerError; + domain: string; + reason: string; + } + ]; + }; +} +/** + * Type definition for a map from server errors to developer visible errors + */ +export declare type ServerErrorMap = { + readonly [K in ApiError]: AuthErrorCode; +}; +/** + * Map from errors returned by the server to errors to developer visible errors + */ +export declare const SERVER_ERROR_MAP: Partial>; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/index.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/index.d.ts new file mode 100644 index 0000000..1df9f79 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/index.d.ts @@ -0,0 +1,101 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { FirebaseError } from '@firebase/util'; +import { AuthErrorCode } from '../core/errors'; +import { Delay } from '../core/util/delay'; +import { Auth } from '../model/public_types'; +import { IdTokenResponse } from '../model/id_token'; +import { ServerError, ServerErrorMap } from './errors'; +export declare const enum HttpMethod { + POST = "POST", + GET = "GET" +} +export declare const enum HttpHeader { + CONTENT_TYPE = "Content-Type", + X_FIREBASE_LOCALE = "X-Firebase-Locale", + X_CLIENT_VERSION = "X-Client-Version", + X_FIREBASE_GMPID = "X-Firebase-gmpid", + X_FIREBASE_CLIENT = "X-Firebase-Client", + X_FIREBASE_APP_CHECK = "X-Firebase-AppCheck" +} +export declare const enum Endpoint { + CREATE_AUTH_URI = "/v1/accounts:createAuthUri", + DELETE_ACCOUNT = "/v1/accounts:delete", + RESET_PASSWORD = "/v1/accounts:resetPassword", + SIGN_UP = "/v1/accounts:signUp", + SIGN_IN_WITH_CUSTOM_TOKEN = "/v1/accounts:signInWithCustomToken", + SIGN_IN_WITH_EMAIL_LINK = "/v1/accounts:signInWithEmailLink", + SIGN_IN_WITH_IDP = "/v1/accounts:signInWithIdp", + SIGN_IN_WITH_PASSWORD = "/v1/accounts:signInWithPassword", + SIGN_IN_WITH_PHONE_NUMBER = "/v1/accounts:signInWithPhoneNumber", + SEND_VERIFICATION_CODE = "/v1/accounts:sendVerificationCode", + SEND_OOB_CODE = "/v1/accounts:sendOobCode", + SET_ACCOUNT_INFO = "/v1/accounts:update", + GET_ACCOUNT_INFO = "/v1/accounts:lookup", + GET_RECAPTCHA_PARAM = "/v1/recaptchaParams", + START_MFA_ENROLLMENT = "/v2/accounts/mfaEnrollment:start", + FINALIZE_MFA_ENROLLMENT = "/v2/accounts/mfaEnrollment:finalize", + START_MFA_SIGN_IN = "/v2/accounts/mfaSignIn:start", + FINALIZE_MFA_SIGN_IN = "/v2/accounts/mfaSignIn:finalize", + WITHDRAW_MFA = "/v2/accounts/mfaEnrollment:withdraw", + GET_PROJECT_CONFIG = "/v1/projects", + GET_RECAPTCHA_CONFIG = "/v2/recaptchaConfig", + GET_PASSWORD_POLICY = "/v2/passwordPolicy", + TOKEN = "/v1/token", + REVOKE_TOKEN = "/v2/accounts:revokeToken" +} +export declare const enum RecaptchaClientType { + WEB = "CLIENT_TYPE_WEB", + ANDROID = "CLIENT_TYPE_ANDROID", + IOS = "CLIENT_TYPE_IOS" +} +export declare const enum RecaptchaVersion { + ENTERPRISE = "RECAPTCHA_ENTERPRISE" +} +export declare const enum RecaptchaActionName { + SIGN_IN_WITH_PASSWORD = "signInWithPassword", + GET_OOB_CODE = "getOobCode", + SIGN_UP_PASSWORD = "signUpPassword", + SEND_VERIFICATION_CODE = "sendVerificationCode", + MFA_SMS_ENROLLMENT = "mfaSmsEnrollment", + MFA_SMS_SIGNIN = "mfaSmsSignIn" +} +export declare const enum EnforcementState { + ENFORCE = "ENFORCE", + AUDIT = "AUDIT", + OFF = "OFF", + ENFORCEMENT_STATE_UNSPECIFIED = "ENFORCEMENT_STATE_UNSPECIFIED" +} +export declare const enum RecaptchaAuthProvider { + EMAIL_PASSWORD_PROVIDER = "EMAIL_PASSWORD_PROVIDER", + PHONE_PROVIDER = "PHONE_PROVIDER" +} +export declare const DEFAULT_API_TIMEOUT_MS: Delay; +export declare function _addTidIfNecessary(auth: Auth, request: T): T; +export declare function _performApiRequest(auth: Auth, method: HttpMethod, path: Endpoint, request?: T, customErrorMap?: Partial>): Promise; +export declare function _performFetchWithErrorHandling(auth: Auth, customErrorMap: Partial>, fetchFn: () => Promise): Promise; +export declare function _performSignInRequest(auth: Auth, method: HttpMethod, path: Endpoint, request?: T, customErrorMap?: Partial>): Promise; +export declare function _getFinalTarget(auth: Auth, host: string, path: string, query: string): Promise; +export declare function _parseEnforcementState(enforcementStateStr: string): EnforcementState; +interface PotentialResponse extends IdTokenResponse { + email?: string; + phoneNumber?: string; +} +export declare function _makeTaggedError(auth: Auth, code: AuthErrorCode, response: PotentialResponse): FirebaseError; +export {}; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/password_policy/get_password_policy.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/password_policy/get_password_policy.d.ts new file mode 100644 index 0000000..f8a90e9 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/password_policy/get_password_policy.d.ts @@ -0,0 +1,48 @@ +/** + * @license + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { Auth } from '../../model/public_types'; +/** + * Request object for fetching the password policy. + */ +export interface GetPasswordPolicyRequest { + tenantId?: string; +} +/** + * Response object for fetching the password policy. + */ +export interface GetPasswordPolicyResponse { + customStrengthOptions: { + minPasswordLength?: number; + maxPasswordLength?: number; + containsLowercaseCharacter?: boolean; + containsUppercaseCharacter?: boolean; + containsNumericCharacter?: boolean; + containsNonAlphanumericCharacter?: boolean; + }; + allowedNonAlphanumericCharacters?: string[]; + enforcementState: string; + forceUpgradeOnSignin?: boolean; + schemaVersion: number; +} +/** + * Fetches the password policy for the currently set tenant or the project if no tenant is set. + * + * @param auth Auth object. + * @param request Password policy request. + * @returns Password policy response. + */ +export declare function _getPasswordPolicy(auth: Auth, request?: GetPasswordPolicyRequest): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/project_config/get_project_config.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/project_config/get_project_config.d.ts new file mode 100644 index 0000000..c7a881a --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/api/project_config/get_project_config.d.ts @@ -0,0 +1,25 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { Auth } from '../../model/public_types'; +export interface GetProjectConfigRequest { + androidPackageName?: string; + iosBundleId?: string; +} +export interface GetProjectConfigResponse { + authorizedDomains: string[]; +} +export declare function _getProjectConfig(auth: Auth, request?: GetProjectConfigRequest): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/action_code_url.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/action_code_url.d.ts new file mode 100644 index 0000000..39f14b6 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/action_code_url.d.ts @@ -0,0 +1,73 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +/** + * A utility class to parse email action URLs such as password reset, email verification, + * email link sign in, etc. + * + * @public + */ +export declare class ActionCodeURL { + /** + * The API key of the email action link. + */ + readonly apiKey: string; + /** + * The action code of the email action link. + */ + readonly code: string; + /** + * The continue URL of the email action link. Null if not provided. + */ + readonly continueUrl: string | null; + /** + * The language code of the email action link. Null if not provided. + */ + readonly languageCode: string | null; + /** + * The action performed by the email action link. It returns from one of the types from + * {@link ActionCodeInfo} + */ + readonly operation: string; + /** + * The tenant ID of the email action link. Null if the email action is from the parent project. + */ + readonly tenantId: string | null; + /** + * @param actionLink - The link from which to extract the URL. + * @returns The {@link ActionCodeURL} object, or null if the link is invalid. + * + * @internal + */ + constructor(actionLink: string); + /** + * Parses the email action link string and returns an {@link ActionCodeURL} if the link is valid, + * otherwise returns null. + * + * @param link - The email action link string. + * @returns The {@link ActionCodeURL} object, or null if the link is invalid. + * + * @public + */ + static parseLink(link: string): ActionCodeURL | null; +} +/** + * Parses the email action link string and returns an {@link ActionCodeURL} if + * the link is valid, otherwise returns null. + * + * @public + */ +export declare function parseActionCodeURL(link: string): ActionCodeURL | null; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/auth_event_manager.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/auth_event_manager.d.ts new file mode 100644 index 0000000..42edbc6 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/auth_event_manager.d.ts @@ -0,0 +1,34 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { AuthEvent, AuthEventConsumer, EventManager } from '../../model/popup_redirect'; +import { AuthInternal } from '../../model/auth'; +export declare class AuthEventManager implements EventManager { + private readonly auth; + private readonly cachedEventUids; + private readonly consumers; + protected queuedRedirectEvent: AuthEvent | null; + protected hasHandledPotentialRedirect: boolean; + private lastProcessedEventTime; + constructor(auth: AuthInternal); + registerConsumer(authEventConsumer: AuthEventConsumer): void; + unregisterConsumer(authEventConsumer: AuthEventConsumer): void; + onEvent(event: AuthEvent): boolean; + private sendToConsumer; + private isEventForConsumer; + private hasEventBeenHandled; + private saveEventToCache; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/auth_impl.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/auth_impl.d.ts new file mode 100644 index 0000000..87aab60 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/auth_impl.d.ts @@ -0,0 +1,133 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { _FirebaseService, FirebaseApp } from '@firebase/app'; +import { Provider } from '@firebase/component'; +import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; +import { Auth, AuthErrorMap, AuthSettings, EmulatorConfig, NextOrObserver, Persistence, PopupRedirectResolver, User, CompleteFn, ErrorFn, Unsubscribe, PasswordValidationStatus } from '../../model/public_types'; +import { ErrorFactory } from '@firebase/util'; +import { AuthInternal, ConfigInternal } from '../../model/auth'; +import { PopupRedirectResolverInternal } from '../../model/popup_redirect'; +import { UserInternal } from '../../model/user'; +import { AuthErrorCode, AuthErrorParams } from '../errors'; +import { PersistenceInternal } from '../persistence'; +import { RecaptchaConfig } from '../../platform_browser/recaptcha/recaptcha'; +import { PasswordPolicyInternal } from '../../model/password_policy'; +export declare const enum DefaultConfig { + TOKEN_API_HOST = "securetoken.googleapis.com", + API_HOST = "identitytoolkit.googleapis.com", + API_SCHEME = "https" +} +export declare class AuthImpl implements AuthInternal, _FirebaseService { + readonly app: FirebaseApp; + private readonly heartbeatServiceProvider; + private readonly appCheckServiceProvider; + readonly config: ConfigInternal; + currentUser: User | null; + emulatorConfig: EmulatorConfig | null; + private operations; + private persistenceManager?; + private redirectPersistenceManager?; + private authStateSubscription; + private idTokenSubscription; + private readonly beforeStateQueue; + private redirectUser; + private isProactiveRefreshEnabled; + private readonly EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION; + _canInitEmulator: boolean; + _isInitialized: boolean; + _deleted: boolean; + _initializationPromise: Promise | null; + _popupRedirectResolver: PopupRedirectResolverInternal | null; + _errorFactory: ErrorFactory; + _agentRecaptchaConfig: RecaptchaConfig | null; + _tenantRecaptchaConfigs: Record; + _projectPasswordPolicy: PasswordPolicyInternal | null; + _tenantPasswordPolicies: Record; + _resolvePersistenceManagerAvailable: ((value: void | PromiseLike) => void) | undefined; + _persistenceManagerAvailable: Promise; + readonly name: string; + private lastNotifiedUid; + languageCode: string | null; + tenantId: string | null; + settings: AuthSettings; + constructor(app: FirebaseApp, heartbeatServiceProvider: Provider<'heartbeat'>, appCheckServiceProvider: Provider, config: ConfigInternal); + _initializeWithPersistence(persistenceHierarchy: PersistenceInternal[], popupRedirectResolver?: PopupRedirectResolver): Promise; + /** + * If the persistence is changed in another window, the user manager will let us know + */ + _onStorageEvent(): Promise; + private initializeCurrentUserFromIdToken; + private initializeCurrentUser; + private tryRedirectSignIn; + private reloadAndSetCurrentUserOrClear; + useDeviceLanguage(): void; + _delete(): Promise; + updateCurrentUser(userExtern: User | null): Promise; + _updateCurrentUser(user: User | null, skipBeforeStateCallbacks?: boolean): Promise; + signOut(): Promise; + setPersistence(persistence: Persistence): Promise; + _getRecaptchaConfig(): RecaptchaConfig | null; + validatePassword(password: string): Promise; + _getPasswordPolicyInternal(): PasswordPolicyInternal | null; + _updatePasswordPolicy(): Promise; + _getPersistenceType(): string; + _getPersistence(): PersistenceInternal; + _updateErrorMap(errorMap: AuthErrorMap): void; + onAuthStateChanged(nextOrObserver: NextOrObserver, error?: ErrorFn, completed?: CompleteFn): Unsubscribe; + beforeAuthStateChanged(callback: (user: User | null) => void | Promise, onAbort?: () => void): Unsubscribe; + onIdTokenChanged(nextOrObserver: NextOrObserver, error?: ErrorFn, completed?: CompleteFn): Unsubscribe; + authStateReady(): Promise; + /** + * Revokes the given access token. Currently only supports Apple OAuth access tokens. + */ + revokeAccessToken(token: string): Promise; + toJSON(): object; + _setRedirectUser(user: UserInternal | null, popupRedirectResolver?: PopupRedirectResolver): Promise; + private getOrInitRedirectPersistenceManager; + _redirectUserForId(id: string): Promise; + _persistUserIfCurrent(user: UserInternal): Promise; + /** Notifies listeners only if the user is current */ + _notifyListenersIfCurrent(user: UserInternal): void; + _key(): string; + _startProactiveRefresh(): void; + _stopProactiveRefresh(): void; + /** Returns the current user cast as the internal type */ + get _currentUser(): UserInternal; + private notifyAuthListeners; + private registerStateListener; + /** + * Unprotected (from race conditions) method to set the current user. This + * should only be called from within a queued callback. This is necessary + * because the queue shouldn't rely on another queued callback. + */ + private directlySetCurrentUser; + private queue; + private get assertedPersistence(); + private frameworks; + private clientVersion; + _logFramework(framework: string): void; + _getFrameworks(): readonly string[]; + _getAdditionalHeaders(): Promise>; + _getAppCheckToken(): Promise; +} +/** + * Method to be used to cast down to our private implementation of Auth. + * It will also handle unwrapping from the compat type if necessary + * + * @param auth Auth object passed in from developer + */ +export declare function _castAuth(auth: Auth): AuthInternal; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/emulator.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/emulator.d.ts new file mode 100644 index 0000000..56dd81c --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/emulator.d.ts @@ -0,0 +1,42 @@ +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { Auth } from '../../model/public_types'; +/** + * Changes the {@link Auth} instance to communicate with the Firebase Auth Emulator, instead of production + * Firebase Auth services. + * + * @remarks + * This must be called synchronously immediately following the first call to + * {@link initializeAuth}. Do not use with production credentials as emulator + * traffic is not encrypted. + * + * + * @example + * ```javascript + * connectAuthEmulator(auth, 'http://127.0.0.1:9099', { disableWarnings: true }); + * ``` + * + * @param auth - The {@link Auth} instance. + * @param url - The URL at which the emulator is running (eg, 'http://localhost:9099'). + * @param options - Optional. `options.disableWarnings` defaults to `false`. Set it to + * `true` to disable the warning banner attached to the DOM. + * + * @public + */ +export declare function connectAuthEmulator(auth: Auth, url: string, options?: { + disableWarnings: boolean; +}): void; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/firebase_internal.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/firebase_internal.d.ts new file mode 100644 index 0000000..9a68c98 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/firebase_internal.d.ts @@ -0,0 +1,35 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { FirebaseAuthInternal } from '@firebase/auth-interop-types'; +import { AuthInternal } from '../../model/auth'; +interface TokenListener { + (tok: string | null): unknown; +} +export declare class AuthInterop implements FirebaseAuthInternal { + private readonly auth; + private readonly internalListeners; + constructor(auth: AuthInternal); + getUid(): string | null; + getToken(forceRefresh?: boolean): Promise<{ + accessToken: string; + } | null>; + addAuthTokenListener(listener: TokenListener): void; + removeAuthTokenListener(listener: TokenListener): void; + private assertAuthConfigured; + private updateProactiveRefresh; +} +export {}; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/initialize.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/initialize.d.ts new file mode 100644 index 0000000..3dd0e1e --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/initialize.d.ts @@ -0,0 +1,46 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { FirebaseApp } from '@firebase/app'; +import { Auth, Dependencies } from '../../model/public_types'; +import { AuthImpl } from './auth_impl'; +/** + * Initializes an {@link Auth} instance with fine-grained control over + * {@link Dependencies}. + * + * @remarks + * + * This function allows more control over the {@link Auth} instance than + * {@link getAuth}. `getAuth` uses platform-specific defaults to supply + * the {@link Dependencies}. In general, `getAuth` is the easiest way to + * initialize Auth and works for most use cases. Use `initializeAuth` if you + * need control over which persistence layer is used, or to minimize bundle + * size if you're not using either `signInWithPopup` or `signInWithRedirect`. + * + * For example, if your app only uses anonymous accounts and you only want + * accounts saved for the current session, initialize `Auth` with: + * + * ```js + * const auth = initializeAuth(app, { + * persistence: browserSessionPersistence, + * popupRedirectResolver: undefined, + * }); + * ``` + * + * @public + */ +export declare function initializeAuth(app: FirebaseApp, deps?: Dependencies): Auth; +export declare function _initializeAuthInstance(auth: AuthImpl, deps?: Dependencies): void; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/middleware.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/middleware.d.ts new file mode 100644 index 0000000..74c4183 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/middleware.d.ts @@ -0,0 +1,25 @@ +/** + * @license + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { AuthInternal } from '../../model/auth'; +import { Unsubscribe, User } from '../../model/public_types'; +export declare class AuthMiddlewareQueue { + private readonly auth; + private readonly queue; + constructor(auth: AuthInternal); + pushCallback(callback: (user: User | null) => void | Promise, onAbort?: () => void): Unsubscribe; + runMiddleware(nextUser: User | null): Promise; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/password_policy_impl.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/password_policy_impl.d.ts new file mode 100644 index 0000000..45a8127 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/password_policy_impl.d.ts @@ -0,0 +1,59 @@ +/** + * @license + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { GetPasswordPolicyResponse } from '../../api/password_policy/get_password_policy'; +import { PasswordPolicyCustomStrengthOptions, PasswordPolicyInternal } from '../../model/password_policy'; +import { PasswordValidationStatus } from '../../model/public_types'; +/** + * Stores password policy requirements and provides password validation against the policy. + * + * @internal + */ +export declare class PasswordPolicyImpl implements PasswordPolicyInternal { + readonly customStrengthOptions: PasswordPolicyCustomStrengthOptions; + readonly allowedNonAlphanumericCharacters: string; + readonly enforcementState: string; + readonly forceUpgradeOnSignin: boolean; + readonly schemaVersion: number; + constructor(response: GetPasswordPolicyResponse); + validatePassword(password: string): PasswordValidationStatus; + /** + * Validates that the password meets the length options for the policy. + * + * @param password Password to validate. + * @param status Validation status. + */ + private validatePasswordLengthOptions; + /** + * Validates that the password meets the character options for the policy. + * + * @param password Password to validate. + * @param status Validation status. + */ + private validatePasswordCharacterOptions; + /** + * Updates the running validation status with the statuses for the character options. + * Expected to be called each time a character is processed to update each option status + * based on the current character. + * + * @param status Validation status. + * @param containsLowercaseCharacter Whether the character is a lowercase letter. + * @param containsUppercaseCharacter Whether the character is an uppercase letter. + * @param containsNumericCharacter Whether the character is a numeric character. + * @param containsNonAlphanumericCharacter Whether the character is a non-alphanumeric character. + */ + private updatePasswordCharacterOptionsStatuses; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/register.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/register.d.ts new file mode 100644 index 0000000..260c739 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/auth/register.d.ts @@ -0,0 +1,23 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { ClientPlatform } from '../util/version'; +export declare const enum _ComponentName { + AUTH = "auth", + AUTH_INTERNAL = "auth-internal" +} +/** @internal */ +export declare function registerAuth(clientPlatform: ClientPlatform): void; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/auth_credential.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/auth_credential.d.ts new file mode 100644 index 0000000..1287582 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/auth_credential.d.ts @@ -0,0 +1,75 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { PhoneOrOauthTokenResponse } from '../../api/authentication/mfa'; +import { AuthInternal } from '../../model/auth'; +import { IdTokenResponse } from '../../model/id_token'; +/** + * Interface that represents the credentials returned by an {@link AuthProvider}. + * + * @remarks + * Implementations specify the details about each auth provider's credential requirements. + * + * @public + */ +export declare class AuthCredential { + /** + * The authentication provider ID for the credential. + * + * @remarks + * For example, 'facebook.com', or 'google.com'. + */ + readonly providerId: string; + /** + * The authentication sign in method for the credential. + * + * @remarks + * For example, {@link SignInMethod}.EMAIL_PASSWORD, or + * {@link SignInMethod}.EMAIL_LINK. This corresponds to the sign-in method + * identifier as returned in {@link fetchSignInMethodsForEmail}. + */ + readonly signInMethod: string; + /** @internal */ + protected constructor( + /** + * The authentication provider ID for the credential. + * + * @remarks + * For example, 'facebook.com', or 'google.com'. + */ + providerId: string, + /** + * The authentication sign in method for the credential. + * + * @remarks + * For example, {@link SignInMethod}.EMAIL_PASSWORD, or + * {@link SignInMethod}.EMAIL_LINK. This corresponds to the sign-in method + * identifier as returned in {@link fetchSignInMethodsForEmail}. + */ + signInMethod: string); + /** + * Returns a JSON-serializable representation of this object. + * + * @returns a JSON-serializable representation of this object. + */ + toJSON(): object; + /** @internal */ + _getIdTokenResponse(_auth: AuthInternal): Promise; + /** @internal */ + _linkToIdToken(_auth: AuthInternal, _idToken: string): Promise; + /** @internal */ + _getReauthenticationResolver(_auth: AuthInternal): Promise; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/email.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/email.d.ts new file mode 100644 index 0000000..0f44811 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/email.d.ts @@ -0,0 +1,60 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { AuthInternal } from '../../model/auth'; +import { IdTokenResponse } from '../../model/id_token'; +import { AuthCredential } from './auth_credential'; +/** + * Interface that represents the credentials returned by {@link EmailAuthProvider} for + * {@link ProviderId}.PASSWORD + * + * @remarks + * Covers both {@link SignInMethod}.EMAIL_PASSWORD and + * {@link SignInMethod}.EMAIL_LINK. + * + * @public + */ +export declare class EmailAuthCredential extends AuthCredential { + /** @internal */ + readonly _email: string; + /** @internal */ + readonly _password: string; + /** @internal */ + readonly _tenantId: string | null; + /** @internal */ + private constructor(); + /** @internal */ + static _fromEmailAndPassword(email: string, password: string): EmailAuthCredential; + /** @internal */ + static _fromEmailAndCode(email: string, oobCode: string, tenantId?: string | null): EmailAuthCredential; + /** {@inheritdoc AuthCredential.toJSON} */ + toJSON(): object; + /** + * Static method to deserialize a JSON representation of an object into an {@link AuthCredential}. + * + * @param json - Either `object` or the stringified representation of the object. When string is + * provided, `JSON.parse` would be called first. + * + * @returns If the JSON input does not represent an {@link AuthCredential}, null is returned. + */ + static fromJSON(json: object | string): EmailAuthCredential | null; + /** @internal */ + _getIdTokenResponse(auth: AuthInternal): Promise; + /** @internal */ + _linkToIdToken(auth: AuthInternal, idToken: string): Promise; + /** @internal */ + _getReauthenticationResolver(auth: AuthInternal): Promise; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/index.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/index.d.ts new file mode 100644 index 0000000..475dee6 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/index.d.ts @@ -0,0 +1,23 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +/** + * This file is required due to the circular dependency from the parent class to its children + */ +export { AuthCredential } from './auth_credential'; +export { EmailAuthCredential } from './email'; +export { OAuthCredential } from './oauth'; +export { PhoneAuthCredential as PhoneAuthCredential } from './phone'; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/oauth.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/oauth.d.ts new file mode 100644 index 0000000..96a1928 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/oauth.d.ts @@ -0,0 +1,81 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { AuthInternal } from '../../model/auth'; +import { IdTokenResponse } from '../../model/id_token'; +import { AuthCredential } from './auth_credential'; +export interface OAuthCredentialParams { + idToken?: string | null; + accessToken?: string | null; + oauthToken?: string; + secret?: string; + oauthTokenSecret?: string; + nonce?: string; + pendingToken?: string; + providerId: string; + signInMethod: string; +} +/** + * Represents the OAuth credentials returned by an {@link OAuthProvider}. + * + * @remarks + * Implementations specify the details about each auth provider's credential requirements. + * + * @public + */ +export declare class OAuthCredential extends AuthCredential { + /** + * The OAuth ID token associated with the credential if it belongs to an OIDC provider, + * such as `google.com`. + * @readonly + */ + idToken?: string; + /** + * The OAuth access token associated with the credential if it belongs to an + * {@link OAuthProvider}, such as `facebook.com`, `twitter.com`, etc. + * @readonly + */ + accessToken?: string; + /** + * The OAuth access token secret associated with the credential if it belongs to an OAuth 1.0 + * provider, such as `twitter.com`. + * @readonly + */ + secret?: string; + private nonce?; + private pendingToken; + /** @internal */ + static _fromParams(params: OAuthCredentialParams): OAuthCredential; + /** {@inheritdoc AuthCredential.toJSON} */ + toJSON(): object; + /** + * Static method to deserialize a JSON representation of an object into an + * {@link AuthCredential}. + * + * @param json - Input can be either Object or the stringified representation of the object. + * When string is provided, JSON.parse would be called first. + * + * @returns If the JSON input does not represent an {@link AuthCredential}, null is returned. + */ + static fromJSON(json: string | object): OAuthCredential | null; + /** @internal */ + _getIdTokenResponse(auth: AuthInternal): Promise; + /** @internal */ + _linkToIdToken(auth: AuthInternal, idToken: string): Promise; + /** @internal */ + _getReauthenticationResolver(auth: AuthInternal): Promise; + private buildRequest; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/phone.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/phone.d.ts new file mode 100644 index 0000000..1924744 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/phone.d.ts @@ -0,0 +1,52 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { PhoneOrOauthTokenResponse } from '../../api/authentication/mfa'; +import { SignInWithPhoneNumberRequest } from '../../api/authentication/sms'; +import { AuthInternal } from '../../model/auth'; +import { IdTokenResponse } from '../../model/id_token'; +import { AuthCredential } from './auth_credential'; +export interface PhoneAuthCredentialParameters { + verificationId?: string; + verificationCode?: string; + phoneNumber?: string; + temporaryProof?: string; +} +/** + * Represents the credentials returned by {@link PhoneAuthProvider}. + * + * @public + */ +export declare class PhoneAuthCredential extends AuthCredential { + private readonly params; + private constructor(); + /** @internal */ + static _fromVerification(verificationId: string, verificationCode: string): PhoneAuthCredential; + /** @internal */ + static _fromTokenResponse(phoneNumber: string, temporaryProof: string): PhoneAuthCredential; + /** @internal */ + _getIdTokenResponse(auth: AuthInternal): Promise; + /** @internal */ + _linkToIdToken(auth: AuthInternal, idToken: string): Promise; + /** @internal */ + _getReauthenticationResolver(auth: AuthInternal): Promise; + /** @internal */ + _makeVerificationRequest(): SignInWithPhoneNumberRequest; + /** {@inheritdoc AuthCredential.toJSON} */ + toJSON(): object; + /** Generates a phone credential based on a plain object or a JSON string. */ + static fromJSON(json: object | string): PhoneAuthCredential | null; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/saml.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/saml.d.ts new file mode 100644 index 0000000..54fea84 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/credentials/saml.d.ts @@ -0,0 +1,52 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { AuthInternal } from '../../model/auth'; +import { IdTokenResponse } from '../../model/id_token'; +import { AuthCredential } from './auth_credential'; +/** + * @public + */ +export declare class SAMLAuthCredential extends AuthCredential { + private readonly pendingToken; + /** @internal */ + private constructor(); + /** @internal */ + _getIdTokenResponse(auth: AuthInternal): Promise; + /** @internal */ + _linkToIdToken(auth: AuthInternal, idToken: string): Promise; + /** @internal */ + _getReauthenticationResolver(auth: AuthInternal): Promise; + /** {@inheritdoc AuthCredential.toJSON} */ + toJSON(): object; + /** + * Static method to deserialize a JSON representation of an object into an + * {@link AuthCredential}. + * + * @param json - Input can be either Object or the stringified representation of the object. + * When string is provided, JSON.parse would be called first. + * + * @returns If the JSON input does not represent an {@link AuthCredential}, null is returned. + */ + static fromJSON(json: string | object): SAMLAuthCredential | null; + /** + * Helper static method to avoid exposing the constructor to end users. + * + * @internal + */ + static _create(providerId: string, pendingToken: string): SAMLAuthCredential; + private buildRequest; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/errors.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/errors.d.ts new file mode 100644 index 0000000..3d81b3a --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/errors.d.ts @@ -0,0 +1,328 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { AuthErrorMap, User } from '../model/public_types'; +import { ErrorFactory, ErrorMap } from '@firebase/util'; +import { IdTokenMfaResponse } from '../api/authentication/mfa'; +import { AppName } from '../model/auth'; +import { AuthCredential } from './credentials'; +/** + * Enumeration of Firebase Auth error codes. + * + * @internal + */ +export declare const enum AuthErrorCode { + ADMIN_ONLY_OPERATION = "admin-restricted-operation", + ARGUMENT_ERROR = "argument-error", + APP_NOT_AUTHORIZED = "app-not-authorized", + APP_NOT_INSTALLED = "app-not-installed", + CAPTCHA_CHECK_FAILED = "captcha-check-failed", + CODE_EXPIRED = "code-expired", + CORDOVA_NOT_READY = "cordova-not-ready", + CORS_UNSUPPORTED = "cors-unsupported", + CREDENTIAL_ALREADY_IN_USE = "credential-already-in-use", + CREDENTIAL_MISMATCH = "custom-token-mismatch", + CREDENTIAL_TOO_OLD_LOGIN_AGAIN = "requires-recent-login", + DEPENDENT_SDK_INIT_BEFORE_AUTH = "dependent-sdk-initialized-before-auth", + DYNAMIC_LINK_NOT_ACTIVATED = "dynamic-link-not-activated", + EMAIL_CHANGE_NEEDS_VERIFICATION = "email-change-needs-verification", + EMAIL_EXISTS = "email-already-in-use", + EMULATOR_CONFIG_FAILED = "emulator-config-failed", + EXPIRED_OOB_CODE = "expired-action-code", + EXPIRED_POPUP_REQUEST = "cancelled-popup-request", + INTERNAL_ERROR = "internal-error", + INVALID_API_KEY = "invalid-api-key", + INVALID_APP_CREDENTIAL = "invalid-app-credential", + INVALID_APP_ID = "invalid-app-id", + INVALID_AUTH = "invalid-user-token", + INVALID_AUTH_EVENT = "invalid-auth-event", + INVALID_CERT_HASH = "invalid-cert-hash", + INVALID_CODE = "invalid-verification-code", + INVALID_CONTINUE_URI = "invalid-continue-uri", + INVALID_CORDOVA_CONFIGURATION = "invalid-cordova-configuration", + INVALID_CUSTOM_TOKEN = "invalid-custom-token", + INVALID_DYNAMIC_LINK_DOMAIN = "invalid-dynamic-link-domain", + INVALID_EMAIL = "invalid-email", + INVALID_EMULATOR_SCHEME = "invalid-emulator-scheme", + INVALID_CREDENTIAL = "invalid-credential", + INVALID_MESSAGE_PAYLOAD = "invalid-message-payload", + INVALID_MFA_SESSION = "invalid-multi-factor-session", + INVALID_OAUTH_CLIENT_ID = "invalid-oauth-client-id", + INVALID_OAUTH_PROVIDER = "invalid-oauth-provider", + INVALID_OOB_CODE = "invalid-action-code", + INVALID_ORIGIN = "unauthorized-domain", + INVALID_PASSWORD = "wrong-password", + INVALID_PERSISTENCE = "invalid-persistence-type", + INVALID_PHONE_NUMBER = "invalid-phone-number", + INVALID_PROVIDER_ID = "invalid-provider-id", + INVALID_RECIPIENT_EMAIL = "invalid-recipient-email", + INVALID_SENDER = "invalid-sender", + INVALID_SESSION_INFO = "invalid-verification-id", + INVALID_TENANT_ID = "invalid-tenant-id", + LOGIN_BLOCKED = "login-blocked", + MFA_INFO_NOT_FOUND = "multi-factor-info-not-found", + MFA_REQUIRED = "multi-factor-auth-required", + MISSING_ANDROID_PACKAGE_NAME = "missing-android-pkg-name", + MISSING_APP_CREDENTIAL = "missing-app-credential", + MISSING_AUTH_DOMAIN = "auth-domain-config-required", + MISSING_CODE = "missing-verification-code", + MISSING_CONTINUE_URI = "missing-continue-uri", + MISSING_IFRAME_START = "missing-iframe-start", + MISSING_IOS_BUNDLE_ID = "missing-ios-bundle-id", + MISSING_OR_INVALID_NONCE = "missing-or-invalid-nonce", + MISSING_MFA_INFO = "missing-multi-factor-info", + MISSING_MFA_SESSION = "missing-multi-factor-session", + MISSING_PHONE_NUMBER = "missing-phone-number", + MISSING_PASSWORD = "missing-password", + MISSING_SESSION_INFO = "missing-verification-id", + MODULE_DESTROYED = "app-deleted", + NEED_CONFIRMATION = "account-exists-with-different-credential", + NETWORK_REQUEST_FAILED = "network-request-failed", + NULL_USER = "null-user", + NO_AUTH_EVENT = "no-auth-event", + NO_SUCH_PROVIDER = "no-such-provider", + OPERATION_NOT_ALLOWED = "operation-not-allowed", + OPERATION_NOT_SUPPORTED = "operation-not-supported-in-this-environment", + POPUP_BLOCKED = "popup-blocked", + POPUP_CLOSED_BY_USER = "popup-closed-by-user", + PROVIDER_ALREADY_LINKED = "provider-already-linked", + QUOTA_EXCEEDED = "quota-exceeded", + REDIRECT_CANCELLED_BY_USER = "redirect-cancelled-by-user", + REDIRECT_OPERATION_PENDING = "redirect-operation-pending", + REJECTED_CREDENTIAL = "rejected-credential", + SECOND_FACTOR_ALREADY_ENROLLED = "second-factor-already-in-use", + SECOND_FACTOR_LIMIT_EXCEEDED = "maximum-second-factor-count-exceeded", + TENANT_ID_MISMATCH = "tenant-id-mismatch", + TIMEOUT = "timeout", + TOKEN_EXPIRED = "user-token-expired", + TOO_MANY_ATTEMPTS_TRY_LATER = "too-many-requests", + UNAUTHORIZED_DOMAIN = "unauthorized-continue-uri", + UNSUPPORTED_FIRST_FACTOR = "unsupported-first-factor", + UNSUPPORTED_PERSISTENCE = "unsupported-persistence-type", + UNSUPPORTED_TENANT_OPERATION = "unsupported-tenant-operation", + UNVERIFIED_EMAIL = "unverified-email", + USER_CANCELLED = "user-cancelled", + USER_DELETED = "user-not-found", + USER_DISABLED = "user-disabled", + USER_MISMATCH = "user-mismatch", + USER_SIGNED_OUT = "user-signed-out", + WEAK_PASSWORD = "weak-password", + WEB_STORAGE_UNSUPPORTED = "web-storage-unsupported", + ALREADY_INITIALIZED = "already-initialized", + RECAPTCHA_NOT_ENABLED = "recaptcha-not-enabled", + MISSING_RECAPTCHA_TOKEN = "missing-recaptcha-token", + INVALID_RECAPTCHA_TOKEN = "invalid-recaptcha-token", + INVALID_RECAPTCHA_ACTION = "invalid-recaptcha-action", + MISSING_CLIENT_TYPE = "missing-client-type", + MISSING_RECAPTCHA_VERSION = "missing-recaptcha-version", + INVALID_RECAPTCHA_VERSION = "invalid-recaptcha-version", + INVALID_REQ_TYPE = "invalid-req-type", + UNSUPPORTED_PASSWORD_POLICY_SCHEMA_VERSION = "unsupported-password-policy-schema-version", + PASSWORD_DOES_NOT_MEET_REQUIREMENTS = "password-does-not-meet-requirements", + INVALID_HOSTING_LINK_DOMAIN = "invalid-hosting-link-domain" +} +export interface ErrorMapRetriever extends AuthErrorMap { + (): ErrorMap; +} +/** + * A verbose error map with detailed descriptions for most error codes. + * + * See discussion at {@link AuthErrorMap} + * + * @public + */ +export declare const debugErrorMap: AuthErrorMap; +/** + * A minimal error map with all verbose error messages stripped. + * + * See discussion at {@link AuthErrorMap} + * + * @public + */ +export declare const prodErrorMap: AuthErrorMap; +export interface NamedErrorParams { + appName: AppName; + credential?: AuthCredential; + email?: string; + phoneNumber?: string; + tenantId?: string; + user?: User; + _serverResponse?: object; +} +/** + * @internal + */ +type GenericAuthErrorParams = { + [key in Exclude]: { + appName?: AppName; + email?: string; + phoneNumber?: string; + message?: string; + }; +}; +/** + * @internal + */ +export interface AuthErrorParams extends GenericAuthErrorParams { + [AuthErrorCode.ARGUMENT_ERROR]: { + appName?: AppName; + }; + [AuthErrorCode.DEPENDENT_SDK_INIT_BEFORE_AUTH]: { + appName?: AppName; + }; + [AuthErrorCode.INTERNAL_ERROR]: { + appName?: AppName; + }; + [AuthErrorCode.LOGIN_BLOCKED]: { + appName?: AppName; + originalMessage?: string; + }; + [AuthErrorCode.OPERATION_NOT_SUPPORTED]: { + appName?: AppName; + }; + [AuthErrorCode.NO_AUTH_EVENT]: { + appName?: AppName; + }; + [AuthErrorCode.MFA_REQUIRED]: { + appName: AppName; + _serverResponse: IdTokenMfaResponse; + }; + [AuthErrorCode.INVALID_CORDOVA_CONFIGURATION]: { + appName: AppName; + missingPlugin?: string; + }; +} +export declare const _DEFAULT_AUTH_ERROR_FACTORY: ErrorFactory; +/** + * A map of potential `Auth` error codes, for easier comparison with errors + * thrown by the SDK. + * + * @remarks + * Note that you can't tree-shake individual keys + * in the map, so by using the map you might substantially increase your + * bundle size. + * + * @public + */ +export declare const AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY: { + readonly ADMIN_ONLY_OPERATION: "auth/admin-restricted-operation"; + readonly ARGUMENT_ERROR: "auth/argument-error"; + readonly APP_NOT_AUTHORIZED: "auth/app-not-authorized"; + readonly APP_NOT_INSTALLED: "auth/app-not-installed"; + readonly CAPTCHA_CHECK_FAILED: "auth/captcha-check-failed"; + readonly CODE_EXPIRED: "auth/code-expired"; + readonly CORDOVA_NOT_READY: "auth/cordova-not-ready"; + readonly CORS_UNSUPPORTED: "auth/cors-unsupported"; + readonly CREDENTIAL_ALREADY_IN_USE: "auth/credential-already-in-use"; + readonly CREDENTIAL_MISMATCH: "auth/custom-token-mismatch"; + readonly CREDENTIAL_TOO_OLD_LOGIN_AGAIN: "auth/requires-recent-login"; + readonly DEPENDENT_SDK_INIT_BEFORE_AUTH: "auth/dependent-sdk-initialized-before-auth"; + readonly DYNAMIC_LINK_NOT_ACTIVATED: "auth/dynamic-link-not-activated"; + readonly EMAIL_CHANGE_NEEDS_VERIFICATION: "auth/email-change-needs-verification"; + readonly EMAIL_EXISTS: "auth/email-already-in-use"; + readonly EMULATOR_CONFIG_FAILED: "auth/emulator-config-failed"; + readonly EXPIRED_OOB_CODE: "auth/expired-action-code"; + readonly EXPIRED_POPUP_REQUEST: "auth/cancelled-popup-request"; + readonly INTERNAL_ERROR: "auth/internal-error"; + readonly INVALID_API_KEY: "auth/invalid-api-key"; + readonly INVALID_APP_CREDENTIAL: "auth/invalid-app-credential"; + readonly INVALID_APP_ID: "auth/invalid-app-id"; + readonly INVALID_AUTH: "auth/invalid-user-token"; + readonly INVALID_AUTH_EVENT: "auth/invalid-auth-event"; + readonly INVALID_CERT_HASH: "auth/invalid-cert-hash"; + readonly INVALID_CODE: "auth/invalid-verification-code"; + readonly INVALID_CONTINUE_URI: "auth/invalid-continue-uri"; + readonly INVALID_CORDOVA_CONFIGURATION: "auth/invalid-cordova-configuration"; + readonly INVALID_CUSTOM_TOKEN: "auth/invalid-custom-token"; + readonly INVALID_DYNAMIC_LINK_DOMAIN: "auth/invalid-dynamic-link-domain"; + readonly INVALID_EMAIL: "auth/invalid-email"; + readonly INVALID_EMULATOR_SCHEME: "auth/invalid-emulator-scheme"; + readonly INVALID_IDP_RESPONSE: "auth/invalid-credential"; + readonly INVALID_LOGIN_CREDENTIALS: "auth/invalid-credential"; + readonly INVALID_MESSAGE_PAYLOAD: "auth/invalid-message-payload"; + readonly INVALID_MFA_SESSION: "auth/invalid-multi-factor-session"; + readonly INVALID_OAUTH_CLIENT_ID: "auth/invalid-oauth-client-id"; + readonly INVALID_OAUTH_PROVIDER: "auth/invalid-oauth-provider"; + readonly INVALID_OOB_CODE: "auth/invalid-action-code"; + readonly INVALID_ORIGIN: "auth/unauthorized-domain"; + readonly INVALID_PASSWORD: "auth/wrong-password"; + readonly INVALID_PERSISTENCE: "auth/invalid-persistence-type"; + readonly INVALID_PHONE_NUMBER: "auth/invalid-phone-number"; + readonly INVALID_PROVIDER_ID: "auth/invalid-provider-id"; + readonly INVALID_RECIPIENT_EMAIL: "auth/invalid-recipient-email"; + readonly INVALID_SENDER: "auth/invalid-sender"; + readonly INVALID_SESSION_INFO: "auth/invalid-verification-id"; + readonly INVALID_TENANT_ID: "auth/invalid-tenant-id"; + readonly MFA_INFO_NOT_FOUND: "auth/multi-factor-info-not-found"; + readonly MFA_REQUIRED: "auth/multi-factor-auth-required"; + readonly MISSING_ANDROID_PACKAGE_NAME: "auth/missing-android-pkg-name"; + readonly MISSING_APP_CREDENTIAL: "auth/missing-app-credential"; + readonly MISSING_AUTH_DOMAIN: "auth/auth-domain-config-required"; + readonly MISSING_CODE: "auth/missing-verification-code"; + readonly MISSING_CONTINUE_URI: "auth/missing-continue-uri"; + readonly MISSING_IFRAME_START: "auth/missing-iframe-start"; + readonly MISSING_IOS_BUNDLE_ID: "auth/missing-ios-bundle-id"; + readonly MISSING_OR_INVALID_NONCE: "auth/missing-or-invalid-nonce"; + readonly MISSING_MFA_INFO: "auth/missing-multi-factor-info"; + readonly MISSING_MFA_SESSION: "auth/missing-multi-factor-session"; + readonly MISSING_PHONE_NUMBER: "auth/missing-phone-number"; + readonly MISSING_PASSWORD: "auth/missing-password"; + readonly MISSING_SESSION_INFO: "auth/missing-verification-id"; + readonly MODULE_DESTROYED: "auth/app-deleted"; + readonly NEED_CONFIRMATION: "auth/account-exists-with-different-credential"; + readonly NETWORK_REQUEST_FAILED: "auth/network-request-failed"; + readonly NULL_USER: "auth/null-user"; + readonly NO_AUTH_EVENT: "auth/no-auth-event"; + readonly NO_SUCH_PROVIDER: "auth/no-such-provider"; + readonly OPERATION_NOT_ALLOWED: "auth/operation-not-allowed"; + readonly OPERATION_NOT_SUPPORTED: "auth/operation-not-supported-in-this-environment"; + readonly POPUP_BLOCKED: "auth/popup-blocked"; + readonly POPUP_CLOSED_BY_USER: "auth/popup-closed-by-user"; + readonly PROVIDER_ALREADY_LINKED: "auth/provider-already-linked"; + readonly QUOTA_EXCEEDED: "auth/quota-exceeded"; + readonly REDIRECT_CANCELLED_BY_USER: "auth/redirect-cancelled-by-user"; + readonly REDIRECT_OPERATION_PENDING: "auth/redirect-operation-pending"; + readonly REJECTED_CREDENTIAL: "auth/rejected-credential"; + readonly SECOND_FACTOR_ALREADY_ENROLLED: "auth/second-factor-already-in-use"; + readonly SECOND_FACTOR_LIMIT_EXCEEDED: "auth/maximum-second-factor-count-exceeded"; + readonly TENANT_ID_MISMATCH: "auth/tenant-id-mismatch"; + readonly TIMEOUT: "auth/timeout"; + readonly TOKEN_EXPIRED: "auth/user-token-expired"; + readonly TOO_MANY_ATTEMPTS_TRY_LATER: "auth/too-many-requests"; + readonly UNAUTHORIZED_DOMAIN: "auth/unauthorized-continue-uri"; + readonly UNSUPPORTED_FIRST_FACTOR: "auth/unsupported-first-factor"; + readonly UNSUPPORTED_PERSISTENCE: "auth/unsupported-persistence-type"; + readonly UNSUPPORTED_TENANT_OPERATION: "auth/unsupported-tenant-operation"; + readonly UNVERIFIED_EMAIL: "auth/unverified-email"; + readonly USER_CANCELLED: "auth/user-cancelled"; + readonly USER_DELETED: "auth/user-not-found"; + readonly USER_DISABLED: "auth/user-disabled"; + readonly USER_MISMATCH: "auth/user-mismatch"; + readonly USER_SIGNED_OUT: "auth/user-signed-out"; + readonly WEAK_PASSWORD: "auth/weak-password"; + readonly WEB_STORAGE_UNSUPPORTED: "auth/web-storage-unsupported"; + readonly ALREADY_INITIALIZED: "auth/already-initialized"; + readonly RECAPTCHA_NOT_ENABLED: "auth/recaptcha-not-enabled"; + readonly MISSING_RECAPTCHA_TOKEN: "auth/missing-recaptcha-token"; + readonly INVALID_RECAPTCHA_TOKEN: "auth/invalid-recaptcha-token"; + readonly INVALID_RECAPTCHA_ACTION: "auth/invalid-recaptcha-action"; + readonly MISSING_CLIENT_TYPE: "auth/missing-client-type"; + readonly MISSING_RECAPTCHA_VERSION: "auth/missing-recaptcha-version"; + readonly INVALID_RECAPTCHA_VERSION: "auth/invalid-recaptcha-version"; + readonly INVALID_REQ_TYPE: "auth/invalid-req-type"; + readonly INVALID_HOSTING_LINK_DOMAIN: "auth/invalid-hosting-link-domain"; +}; +export {}; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/index.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/index.d.ts new file mode 100644 index 0000000..8829292 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/index.d.ts @@ -0,0 +1,230 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { Auth, NextOrObserver, Persistence, User, CompleteFn, ErrorFn, Unsubscribe, PasswordValidationStatus } from '../model/public_types'; +export { debugErrorMap, prodErrorMap, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as AuthErrorCodes } from './errors'; +/** + * Changes the type of persistence on the {@link Auth} instance for the currently saved + * `Auth` session and applies this type of persistence for future sign-in requests, including + * sign-in with redirect requests. + * + * @remarks + * This makes it easy for a user signing in to specify whether their session should be + * remembered or not. It also makes it easier to never persist the `Auth` state for applications + * that are shared by other users or have sensitive data. + * + * This method does not work in a Node.js environment or with {@link Auth} instances created with a + * {@link @firebase/app#FirebaseServerApp}. + * + * @example + * ```javascript + * setPersistence(auth, browserSessionPersistence); + * ``` + * + * @param auth - The {@link Auth} instance. + * @param persistence - The {@link Persistence} to use. + * @returns A `Promise` that resolves once the persistence change has completed + * + * @public + */ +export declare function setPersistence(auth: Auth, persistence: Persistence): Promise; +/** + * Loads the reCAPTCHA configuration into the `Auth` instance. + * + * @remarks + * This will load the reCAPTCHA config, which indicates whether the reCAPTCHA + * verification flow should be triggered for each auth provider, into the + * current Auth session. + * + * If initializeRecaptchaConfig() is not invoked, the auth flow will always start + * without reCAPTCHA verification. If the provider is configured to require reCAPTCHA + * verification, the SDK will transparently load the reCAPTCHA config and restart the + * auth flows. + * + * Thus, by calling this optional method, you will reduce the latency of future auth flows. + * Loading the reCAPTCHA config early will also enhance the signal collected by reCAPTCHA. + * + * This method does not work in a Node.js environment. + * + * @example + * ```javascript + * initializeRecaptchaConfig(auth); + * ``` + * + * @param auth - The {@link Auth} instance. + * + * @public + */ +export declare function initializeRecaptchaConfig(auth: Auth): Promise; +/** + * Validates the password against the password policy configured for the project or tenant. + * + * @remarks + * If no tenant ID is set on the `Auth` instance, then this method will use the password + * policy configured for the project. Otherwise, this method will use the policy configured + * for the tenant. If a password policy has not been configured, then the default policy + * configured for all projects will be used. + * + * If an auth flow fails because a submitted password does not meet the password policy + * requirements and this method has previously been called, then this method will use the + * most recent policy available when called again. + * + * @example + * ```javascript + * validatePassword(auth, 'some-password'); + * ``` + * + * @param auth The {@link Auth} instance. + * @param password The password to validate. + * + * @public + */ +export declare function validatePassword(auth: Auth, password: string): Promise; +/** + * Adds an observer for changes to the signed-in user's ID token. + * + * @remarks + * This includes sign-in, sign-out, and token refresh events. + * This will not be triggered automatically upon ID token expiration. Use {@link User.getIdToken} to refresh the ID token. + * + * @param auth - The {@link Auth} instance. + * @param nextOrObserver - callback triggered on change. + * @param error - Deprecated. This callback is never triggered. Errors + * on signing in/out can be caught in promises returned from + * sign-in/sign-out functions. + * @param completed - Deprecated. This callback is never triggered. + * + * @public + */ +export declare function onIdTokenChanged(auth: Auth, nextOrObserver: NextOrObserver, error?: ErrorFn, completed?: CompleteFn): Unsubscribe; +/** + * Adds a blocking callback that runs before an auth state change + * sets a new user. + * + * @param auth - The {@link Auth} instance. + * @param callback - callback triggered before new user value is set. + * If this throws, it blocks the user from being set. + * @param onAbort - callback triggered if a later `beforeAuthStateChanged()` + * callback throws, allowing you to undo any side effects. + */ +export declare function beforeAuthStateChanged(auth: Auth, callback: (user: User | null) => void | Promise, onAbort?: () => void): Unsubscribe; +/** + * Adds an observer for changes to the user's sign-in state. + * + * @remarks + * To keep the old behavior, see {@link onIdTokenChanged}. + * + * @param auth - The {@link Auth} instance. + * @param nextOrObserver - callback triggered on change. + * @param error - Deprecated. This callback is never triggered. Errors + * on signing in/out can be caught in promises returned from + * sign-in/sign-out functions. + * @param completed - Deprecated. This callback is never triggered. + * + * @public + */ +export declare function onAuthStateChanged(auth: Auth, nextOrObserver: NextOrObserver, error?: ErrorFn, completed?: CompleteFn): Unsubscribe; +/** + * Sets the current language to the default device/browser preference. + * + * @param auth - The {@link Auth} instance. + * + * @public + */ +export declare function useDeviceLanguage(auth: Auth): void; +/** + * Asynchronously sets the provided user as {@link Auth.currentUser} on the + * {@link Auth} instance. + * + * @remarks + * A new instance copy of the user provided will be made and set as currentUser. + * + * This will trigger {@link onAuthStateChanged} and {@link onIdTokenChanged} listeners + * like other sign in methods. + * + * The operation fails with an error if the user to be updated belongs to a different Firebase + * project. + * + * This method is not supported by {@link Auth} instances created with a + * {@link @firebase/app#FirebaseServerApp}. + * + * @param auth - The {@link Auth} instance. + * @param user - The new {@link User}. + * + * @public + */ +export declare function updateCurrentUser(auth: Auth, user: User | null): Promise; +/** + * Signs out the current user. + * + * @remarks + * This method is not supported by {@link Auth} instances created with a + * {@link @firebase/app#FirebaseServerApp}. + * + * @param auth - The {@link Auth} instance. + * + * @public + */ +export declare function signOut(auth: Auth): Promise; +/** + * Revokes the given access token. Currently only supports Apple OAuth access tokens. + * + * @param auth - The {@link Auth} instance. + * @param token - The Apple OAuth access token. + * + * @public + */ +export declare function revokeAccessToken(auth: Auth, token: string): Promise; +export { initializeAuth } from './auth/initialize'; +export { connectAuthEmulator } from './auth/emulator'; +export { AuthCredential } from './credentials'; +export { EmailAuthCredential } from './credentials/email'; +export { OAuthCredential } from './credentials/oauth'; +export { PhoneAuthCredential } from './credentials/phone'; +export { inMemoryPersistence } from './persistence/in_memory'; +export { EmailAuthProvider } from './providers/email'; +export { FacebookAuthProvider } from './providers/facebook'; +export { CustomParameters } from './providers/federated'; +export { GoogleAuthProvider } from './providers/google'; +export { GithubAuthProvider } from './providers/github'; +export { OAuthProvider, OAuthCredentialOptions } from './providers/oauth'; +export { SAMLAuthProvider } from './providers/saml'; +export { TwitterAuthProvider } from './providers/twitter'; +export { signInAnonymously } from './strategies/anonymous'; +export { signInWithCredential, linkWithCredential, reauthenticateWithCredential } from './strategies/credential'; +export { signInWithCustomToken } from './strategies/custom_token'; +export { sendPasswordResetEmail, confirmPasswordReset, applyActionCode, checkActionCode, verifyPasswordResetCode, createUserWithEmailAndPassword, signInWithEmailAndPassword } from './strategies/email_and_password'; +export { sendSignInLinkToEmail, isSignInWithEmailLink, signInWithEmailLink } from './strategies/email_link'; +export { fetchSignInMethodsForEmail, sendEmailVerification, verifyBeforeUpdateEmail } from './strategies/email'; +export { ActionCodeURL, parseActionCodeURL } from './action_code_url'; +export { updateProfile, updateEmail, updatePassword } from './user/account_info'; +export { getIdToken, getIdTokenResult } from './user/id_token_result'; +export { unlink } from './user/link_unlink'; +export { getAdditionalUserInfo } from './user/additional_user_info'; +export { reload } from './user/reload'; +/** + * Deletes and signs out the user. + * + * @remarks + * Important: this is a security-sensitive operation that requires the user to have recently + * signed in. If this requirement isn't met, ask the user to authenticate again and then call + * {@link reauthenticateWithCredential}. + * + * @param user - The user. + * + * @public + */ +export declare function deleteUser(user: User): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/persistence/in_memory.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/persistence/in_memory.d.ts new file mode 100644 index 0000000..60278cd --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/persistence/in_memory.d.ts @@ -0,0 +1,35 @@ +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { Persistence } from '../../model/public_types'; +import { PersistenceInternal, PersistenceType, PersistenceValue, StorageEventListener } from '../persistence'; +export declare class InMemoryPersistence implements PersistenceInternal { + static type: 'NONE'; + readonly type = PersistenceType.NONE; + storage: Record; + _isAvailable(): Promise; + _set(key: string, value: PersistenceValue): Promise; + _get(key: string): Promise; + _remove(key: string): Promise; + _addListener(_key: string, _listener: StorageEventListener): void; + _removeListener(_key: string, _listener: StorageEventListener): void; +} +/** + * An implementation of {@link Persistence} of type 'NONE'. + * + * @public + */ +export declare const inMemoryPersistence: Persistence; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/persistence/index.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/persistence/index.d.ts new file mode 100644 index 0000000..4460f02 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/persistence/index.d.ts @@ -0,0 +1,42 @@ +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { Persistence } from '../../model/public_types'; +export declare const enum PersistenceType { + SESSION = "SESSION", + LOCAL = "LOCAL", + NONE = "NONE", + COOKIE = "COOKIE" +} +export type PersistedBlob = Record; +export interface Instantiator { + (blob: PersistedBlob): T; +} +export type PersistenceValue = PersistedBlob | string; +export declare const STORAGE_AVAILABLE_KEY = "__sak"; +export interface StorageEventListener { + (value: PersistenceValue | null): void; +} +export interface PersistenceInternal extends Persistence { + type: PersistenceType; + _isAvailable(): Promise; + _set(key: string, value: PersistenceValue): Promise; + _get(key: string): Promise; + _remove(key: string): Promise; + _addListener(key: string, listener: StorageEventListener): void; + _removeListener(key: string, listener: StorageEventListener): void; + _shouldAllowMigration?: boolean; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/persistence/persistence_user_manager.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/persistence/persistence_user_manager.d.ts new file mode 100644 index 0000000..7aca0d8 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/persistence/persistence_user_manager.d.ts @@ -0,0 +1,45 @@ +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { ApiKey, AppName, AuthInternal } from '../../model/auth'; +import { UserInternal } from '../../model/user'; +import { PersistenceInternal } from '../persistence'; +export declare const enum KeyName { + AUTH_USER = "authUser", + AUTH_EVENT = "authEvent", + REDIRECT_USER = "redirectUser", + PERSISTENCE_USER = "persistence" +} +export declare const enum Namespace { + PERSISTENCE = "firebase" +} +export declare function _persistenceKeyName(key: string, apiKey: ApiKey, appName: AppName): string; +export declare class PersistenceUserManager { + persistence: PersistenceInternal; + private readonly auth; + private readonly userKey; + private readonly fullUserKey; + private readonly fullPersistenceKey; + private readonly boundEventHandler; + private constructor(); + setCurrentUser(user: UserInternal): Promise; + getCurrentUser(): Promise; + removeCurrentUser(): Promise; + savePersistenceForRedirect(): Promise; + setPersistence(newPersistence: PersistenceInternal): Promise; + delete(): void; + static create(auth: AuthInternal, persistenceHierarchy: PersistenceInternal[], userKey?: KeyName): Promise; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/email.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/email.d.ts new file mode 100644 index 0000000..be276ad --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/email.d.ts @@ -0,0 +1,83 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { AuthProvider } from '../../model/public_types'; +import { EmailAuthCredential } from '../credentials/email'; +/** + * Provider for generating {@link EmailAuthCredential}. + * + * @public + */ +export declare class EmailAuthProvider implements AuthProvider { + /** + * Always set to {@link ProviderId}.PASSWORD, even for email link. + */ + static readonly PROVIDER_ID: 'password'; + /** + * Always set to {@link SignInMethod}.EMAIL_PASSWORD. + */ + static readonly EMAIL_PASSWORD_SIGN_IN_METHOD: 'password'; + /** + * Always set to {@link SignInMethod}.EMAIL_LINK. + */ + static readonly EMAIL_LINK_SIGN_IN_METHOD: 'emailLink'; + /** + * Always set to {@link ProviderId}.PASSWORD, even for email link. + */ + readonly providerId: "password"; + /** + * Initialize an {@link AuthCredential} using an email and password. + * + * @example + * ```javascript + * const authCredential = EmailAuthProvider.credential(email, password); + * const userCredential = await signInWithCredential(auth, authCredential); + * ``` + * + * @example + * ```javascript + * const userCredential = await signInWithEmailAndPassword(auth, email, password); + * ``` + * + * @param email - Email address. + * @param password - User account password. + * @returns The auth provider credential. + */ + static credential(email: string, password: string): EmailAuthCredential; + /** + * Initialize an {@link AuthCredential} using an email and an email link after a sign in with + * email link operation. + * + * @example + * ```javascript + * const authCredential = EmailAuthProvider.credentialWithLink(auth, email, emailLink); + * const userCredential = await signInWithCredential(auth, authCredential); + * ``` + * + * @example + * ```javascript + * await sendSignInLinkToEmail(auth, email); + * // Obtain emailLink from user. + * const userCredential = await signInWithEmailLink(auth, email, emailLink); + * ``` + * + * @param auth - The {@link Auth} instance used to verify the link. + * @param email - Email address. + * @param emailLink - Sign-in email link. + * @returns - The auth provider credential. + */ + static credentialWithLink(email: string, emailLink: string): EmailAuthCredential; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/facebook.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/facebook.d.ts new file mode 100644 index 0000000..cd8feca --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/facebook.d.ts @@ -0,0 +1,93 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { UserCredential } from '../../model/public_types'; +import { FirebaseError } from '@firebase/util'; +import { OAuthCredential } from '../credentials/oauth'; +import { BaseOAuthProvider } from './oauth'; +/** + * Provider for generating an {@link OAuthCredential} for {@link ProviderId}.FACEBOOK. + * + * @example + * ```javascript + * // Sign in using a redirect. + * const provider = new FacebookAuthProvider(); + * // Start a sign in process for an unauthenticated user. + * provider.addScope('user_birthday'); + * await signInWithRedirect(auth, provider); + * // This will trigger a full page redirect away from your app + * + * // After returning from the redirect when your app initializes you can obtain the result + * const result = await getRedirectResult(auth); + * if (result) { + * // This is the signed-in user + * const user = result.user; + * // This gives you a Facebook Access Token. + * const credential = FacebookAuthProvider.credentialFromResult(result); + * const token = credential.accessToken; + * } + * ``` + * + * @example + * ```javascript + * // Sign in using a popup. + * const provider = new FacebookAuthProvider(); + * provider.addScope('user_birthday'); + * const result = await signInWithPopup(auth, provider); + * + * // The signed-in user info. + * const user = result.user; + * // This gives you a Facebook Access Token. + * const credential = FacebookAuthProvider.credentialFromResult(result); + * const token = credential.accessToken; + * ``` + * + * @public + */ +export declare class FacebookAuthProvider extends BaseOAuthProvider { + /** Always set to {@link SignInMethod}.FACEBOOK. */ + static readonly FACEBOOK_SIGN_IN_METHOD: 'facebook.com'; + /** Always set to {@link ProviderId}.FACEBOOK. */ + static readonly PROVIDER_ID: 'facebook.com'; + constructor(); + /** + * Creates a credential for Facebook. + * + * @example + * ```javascript + * // `event` from the Facebook auth.authResponseChange callback. + * const credential = FacebookAuthProvider.credential(event.authResponse.accessToken); + * const result = await signInWithCredential(credential); + * ``` + * + * @param accessToken - Facebook access token. + */ + static credential(accessToken: string): OAuthCredential; + /** + * Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}. + * + * @param userCredential - The user credential. + */ + static credentialFromResult(userCredential: UserCredential): OAuthCredential | null; + /** + * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was + * thrown during a sign-in, link, or reauthenticate operation. + * + * @param userCredential - The user credential. + */ + static credentialFromError(error: FirebaseError): OAuthCredential | null; + private static credentialFromTaggedObject; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/federated.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/federated.d.ts new file mode 100644 index 0000000..91d38b1 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/federated.d.ts @@ -0,0 +1,64 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { AuthProvider } from '../../model/public_types'; +/** + * Map of OAuth Custom Parameters. + * + * @public + */ +export type CustomParameters = Record; +/** + * The base class for all Federated providers (OAuth (including OIDC), SAML). + * + * This class is not meant to be instantiated directly. + * + * @public + */ +export declare abstract class FederatedAuthProvider implements AuthProvider { + readonly providerId: string; + /** @internal */ + defaultLanguageCode: string | null; + /** @internal */ + private customParameters; + /** + * Constructor for generic OAuth providers. + * + * @param providerId - Provider for which credentials should be generated. + */ + constructor(providerId: string); + /** + * Set the language gode. + * + * @param languageCode - language code + */ + setDefaultLanguage(languageCode: string | null): void; + /** + * Sets the OAuth custom parameters to pass in an OAuth request for popup and redirect sign-in + * operations. + * + * @remarks + * For a detailed list, check the reserved required OAuth 2.0 parameters such as `client_id`, + * `redirect_uri`, `scope`, `response_type`, and `state` are not allowed and will be ignored. + * + * @param customOAuthParameters - The custom OAuth parameters to pass in the OAuth request. + */ + setCustomParameters(customOAuthParameters: CustomParameters): AuthProvider; + /** + * Retrieve the current list of {@link CustomParameters}. + */ + getCustomParameters(): CustomParameters; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/github.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/github.d.ts new file mode 100644 index 0000000..b8b3ee9 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/github.d.ts @@ -0,0 +1,89 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { UserCredential } from '../../model/public_types'; +import { FirebaseError } from '@firebase/util'; +import { OAuthCredential } from '../credentials/oauth'; +import { BaseOAuthProvider } from './oauth'; +/** + * Provider for generating an {@link OAuthCredential} for {@link ProviderId}.GITHUB. + * + * @remarks + * GitHub requires an OAuth 2.0 redirect, so you can either handle the redirect directly, or use + * the {@link signInWithPopup} handler: + * + * @example + * ```javascript + * // Sign in using a redirect. + * const provider = new GithubAuthProvider(); + * // Start a sign in process for an unauthenticated user. + * provider.addScope('repo'); + * await signInWithRedirect(auth, provider); + * // This will trigger a full page redirect away from your app + * + * // After returning from the redirect when your app initializes you can obtain the result + * const result = await getRedirectResult(auth); + * if (result) { + * // This is the signed-in user + * const user = result.user; + * // This gives you a GitHub Access Token. + * const credential = GithubAuthProvider.credentialFromResult(result); + * const token = credential.accessToken; + * } + * ``` + * + * @example + * ```javascript + * // Sign in using a popup. + * const provider = new GithubAuthProvider(); + * provider.addScope('repo'); + * const result = await signInWithPopup(auth, provider); + * + * // The signed-in user info. + * const user = result.user; + * // This gives you a GitHub Access Token. + * const credential = GithubAuthProvider.credentialFromResult(result); + * const token = credential.accessToken; + * ``` + * @public + */ +export declare class GithubAuthProvider extends BaseOAuthProvider { + /** Always set to {@link SignInMethod}.GITHUB. */ + static readonly GITHUB_SIGN_IN_METHOD: 'github.com'; + /** Always set to {@link ProviderId}.GITHUB. */ + static readonly PROVIDER_ID: 'github.com'; + constructor(); + /** + * Creates a credential for GitHub. + * + * @param accessToken - GitHub access token. + */ + static credential(accessToken: string): OAuthCredential; + /** + * Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}. + * + * @param userCredential - The user credential. + */ + static credentialFromResult(userCredential: UserCredential): OAuthCredential | null; + /** + * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was + * thrown during a sign-in, link, or reauthenticate operation. + * + * @param userCredential - The user credential. + */ + static credentialFromError(error: FirebaseError): OAuthCredential | null; + private static credentialFromTaggedObject; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/google.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/google.d.ts new file mode 100644 index 0000000..25d74c8 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/google.d.ts @@ -0,0 +1,96 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { UserCredential } from '../../model/public_types'; +import { FirebaseError } from '@firebase/util'; +import { OAuthCredential } from '../credentials/oauth'; +import { BaseOAuthProvider } from './oauth'; +/** + * Provider for generating an {@link OAuthCredential} for {@link ProviderId}.GOOGLE. + * + * @example + * ```javascript + * // Sign in using a redirect. + * const provider = new GoogleAuthProvider(); + * // Start a sign in process for an unauthenticated user. + * provider.addScope('profile'); + * provider.addScope('email'); + * await signInWithRedirect(auth, provider); + * // This will trigger a full page redirect away from your app + * + * // After returning from the redirect when your app initializes you can obtain the result + * const result = await getRedirectResult(auth); + * if (result) { + * // This is the signed-in user + * const user = result.user; + * // This gives you a Google Access Token. + * const credential = GoogleAuthProvider.credentialFromResult(result); + * const token = credential.accessToken; + * } + * ``` + * + * @example + * ```javascript + * // Sign in using a popup. + * const provider = new GoogleAuthProvider(); + * provider.addScope('profile'); + * provider.addScope('email'); + * const result = await signInWithPopup(auth, provider); + * + * // The signed-in user info. + * const user = result.user; + * // This gives you a Google Access Token. + * const credential = GoogleAuthProvider.credentialFromResult(result); + * const token = credential.accessToken; + * ``` + * + * @public + */ +export declare class GoogleAuthProvider extends BaseOAuthProvider { + /** Always set to {@link SignInMethod}.GOOGLE. */ + static readonly GOOGLE_SIGN_IN_METHOD: 'google.com'; + /** Always set to {@link ProviderId}.GOOGLE. */ + static readonly PROVIDER_ID: 'google.com'; + constructor(); + /** + * Creates a credential for Google. At least one of ID token and access token is required. + * + * @example + * ```javascript + * // \`googleUser\` from the onsuccess Google Sign In callback. + * const credential = GoogleAuthProvider.credential(googleUser.getAuthResponse().id_token); + * const result = await signInWithCredential(credential); + * ``` + * + * @param idToken - Google ID token. + * @param accessToken - Google access token. + */ + static credential(idToken?: string | null, accessToken?: string | null): OAuthCredential; + /** + * Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}. + * + * @param userCredential - The user credential. + */ + static credentialFromResult(userCredential: UserCredential): OAuthCredential | null; + /** + * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was + * thrown during a sign-in, link, or reauthenticate operation. + * + * @param userCredential - The user credential. + */ + static credentialFromError(error: FirebaseError): OAuthCredential | null; + private static credentialFromTaggedObject; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/oauth.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/oauth.d.ts new file mode 100644 index 0000000..3e8e664 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/oauth.d.ts @@ -0,0 +1,151 @@ +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { AuthProvider, UserCredential } from '../../model/public_types'; +import { OAuthCredential } from '../credentials/oauth'; +import { FirebaseError } from '@firebase/util'; +import { FederatedAuthProvider } from './federated'; +/** + * Defines the options for initializing an {@link OAuthCredential}. + * + * @remarks + * For ID tokens with nonce claim, the raw nonce has to also be provided. + * + * @public + */ +export interface OAuthCredentialOptions { + /** + * The OAuth ID token used to initialize the {@link OAuthCredential}. + */ + idToken?: string; + /** + * The OAuth access token used to initialize the {@link OAuthCredential}. + */ + accessToken?: string; + /** + * The raw nonce associated with the ID token. + * + * @remarks + * It is required when an ID token with a nonce field is provided. The SHA-256 hash of the + * raw nonce must match the nonce field in the ID token. + */ + rawNonce?: string; +} +/** + * Common code to all OAuth providers. This is separate from the + * {@link OAuthProvider} so that child providers (like + * {@link GoogleAuthProvider}) don't inherit the `credential` instance method. + * Instead, they rely on a static `credential` method. + */ +export declare abstract class BaseOAuthProvider extends FederatedAuthProvider implements AuthProvider { + /** @internal */ + private scopes; + /** + * Add an OAuth scope to the credential. + * + * @param scope - Provider OAuth scope to add. + */ + addScope(scope: string): AuthProvider; + /** + * Retrieve the current list of OAuth scopes. + */ + getScopes(): string[]; +} +/** + * Provider for generating generic {@link OAuthCredential}. + * + * @example + * ```javascript + * // Sign in using a redirect. + * const provider = new OAuthProvider('google.com'); + * // Start a sign in process for an unauthenticated user. + * provider.addScope('profile'); + * provider.addScope('email'); + * await signInWithRedirect(auth, provider); + * // This will trigger a full page redirect away from your app + * + * // After returning from the redirect when your app initializes you can obtain the result + * const result = await getRedirectResult(auth); + * if (result) { + * // This is the signed-in user + * const user = result.user; + * // This gives you a OAuth Access Token for the provider. + * const credential = provider.credentialFromResult(auth, result); + * const token = credential.accessToken; + * } + * ``` + * + * @example + * ```javascript + * // Sign in using a popup. + * const provider = new OAuthProvider('google.com'); + * provider.addScope('profile'); + * provider.addScope('email'); + * const result = await signInWithPopup(auth, provider); + * + * // The signed-in user info. + * const user = result.user; + * // This gives you a OAuth Access Token for the provider. + * const credential = provider.credentialFromResult(auth, result); + * const token = credential.accessToken; + * ``` + * @public + */ +export declare class OAuthProvider extends BaseOAuthProvider { + /** + * Creates an {@link OAuthCredential} from a JSON string or a plain object. + * @param json - A plain object or a JSON string + */ + static credentialFromJSON(json: object | string): OAuthCredential; + /** + * Creates a {@link OAuthCredential} from a generic OAuth provider's access token or ID token. + * + * @remarks + * The raw nonce is required when an ID token with a nonce field is provided. The SHA-256 hash of + * the raw nonce must match the nonce field in the ID token. + * + * @example + * ```javascript + * // `googleUser` from the onsuccess Google Sign In callback. + * // Initialize a generate OAuth provider with a `google.com` providerId. + * const provider = new OAuthProvider('google.com'); + * const credential = provider.credential({ + * idToken: googleUser.getAuthResponse().id_token, + * }); + * const result = await signInWithCredential(credential); + * ``` + * + * @param params - Either the options object containing the ID token, access token and raw nonce + * or the ID token string. + */ + credential(params: OAuthCredentialOptions): OAuthCredential; + /** An internal credential method that accepts more permissive options */ + private _credential; + /** + * Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}. + * + * @param userCredential - The user credential. + */ + static credentialFromResult(userCredential: UserCredential): OAuthCredential | null; + /** + * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was + * thrown during a sign-in, link, or reauthenticate operation. + * + * @param userCredential - The user credential. + */ + static credentialFromError(error: FirebaseError): OAuthCredential | null; + private static oauthCredentialFromTaggedObject; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/saml.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/saml.d.ts new file mode 100644 index 0000000..6017bfe --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/saml.d.ts @@ -0,0 +1,62 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { FirebaseError } from '@firebase/util'; +import { UserCredential } from '../../model/public_types'; +import { AuthCredential } from '../credentials'; +import { FederatedAuthProvider } from './federated'; +/** + * An {@link AuthProvider} for SAML. + * + * @public + */ +export declare class SAMLAuthProvider extends FederatedAuthProvider { + /** + * Constructor. The providerId must start with "saml." + * @param providerId - SAML provider ID. + */ + constructor(providerId: string); + /** + * Generates an {@link AuthCredential} from a {@link UserCredential} after a + * successful SAML flow completes. + * + * @remarks + * + * For example, to get an {@link AuthCredential}, you could write the + * following code: + * + * ```js + * const userCredential = await signInWithPopup(auth, samlProvider); + * const credential = SAMLAuthProvider.credentialFromResult(userCredential); + * ``` + * + * @param userCredential - The user credential. + */ + static credentialFromResult(userCredential: UserCredential): AuthCredential | null; + /** + * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was + * thrown during a sign-in, link, or reauthenticate operation. + * + * @param userCredential - The user credential. + */ + static credentialFromError(error: FirebaseError): AuthCredential | null; + /** + * Creates an {@link AuthCredential} from a JSON string or a plain object. + * @param json - A plain object or a JSON string + */ + static credentialFromJSON(json: string | object): AuthCredential; + private static samlCredentialFromTaggedObject; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/twitter.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/twitter.d.ts new file mode 100644 index 0000000..612913d --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/providers/twitter.d.ts @@ -0,0 +1,103 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +/** + * @license + * Copyright 2020 Twitter LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { UserCredential } from '../../model/public_types'; +import { FirebaseError } from '@firebase/util'; +import { OAuthCredential } from '../credentials/oauth'; +import { BaseOAuthProvider } from './oauth'; +/** + * Provider for generating an {@link OAuthCredential} for {@link ProviderId}.TWITTER. + * + * @example + * ```javascript + * // Sign in using a redirect. + * const provider = new TwitterAuthProvider(); + * // Start a sign in process for an unauthenticated user. + * await signInWithRedirect(auth, provider); + * // This will trigger a full page redirect away from your app + * + * // After returning from the redirect when your app initializes you can obtain the result + * const result = await getRedirectResult(auth); + * if (result) { + * // This is the signed-in user + * const user = result.user; + * // This gives you a Twitter Access Token and Secret. + * const credential = TwitterAuthProvider.credentialFromResult(result); + * const token = credential.accessToken; + * const secret = credential.secret; + * } + * ``` + * + * @example + * ```javascript + * // Sign in using a popup. + * const provider = new TwitterAuthProvider(); + * const result = await signInWithPopup(auth, provider); + * + * // The signed-in user info. + * const user = result.user; + * // This gives you a Twitter Access Token and Secret. + * const credential = TwitterAuthProvider.credentialFromResult(result); + * const token = credential.accessToken; + * const secret = credential.secret; + * ``` + * + * @public + */ +export declare class TwitterAuthProvider extends BaseOAuthProvider { + /** Always set to {@link SignInMethod}.TWITTER. */ + static readonly TWITTER_SIGN_IN_METHOD: 'twitter.com'; + /** Always set to {@link ProviderId}.TWITTER. */ + static readonly PROVIDER_ID: 'twitter.com'; + constructor(); + /** + * Creates a credential for Twitter. + * + * @param token - Twitter access token. + * @param secret - Twitter secret. + */ + static credential(token: string, secret: string): OAuthCredential; + /** + * Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}. + * + * @param userCredential - The user credential. + */ + static credentialFromResult(userCredential: UserCredential): OAuthCredential | null; + /** + * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was + * thrown during a sign-in, link, or reauthenticate operation. + * + * @param userCredential - The user credential. + */ + static credentialFromError(error: FirebaseError): OAuthCredential | null; + private static credentialFromTaggedObject; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/abstract_popup_redirect_operation.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/abstract_popup_redirect_operation.d.ts new file mode 100644 index 0000000..6f5e076 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/abstract_popup_redirect_operation.d.ts @@ -0,0 +1,44 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { FirebaseError } from '@firebase/util'; +import { AuthEvent, AuthEventConsumer, AuthEventType, PopupRedirectResolverInternal } from '../../model/popup_redirect'; +import { UserInternal, UserCredentialInternal } from '../../model/user'; +import { AuthInternal } from '../../model/auth'; +/** + * Popup event manager. Handles the popup's entire lifecycle; listens to auth + * events + */ +export declare abstract class AbstractPopupRedirectOperation implements AuthEventConsumer { + protected readonly auth: AuthInternal; + protected readonly resolver: PopupRedirectResolverInternal; + protected user?: UserInternal | undefined; + protected readonly bypassAuthState: boolean; + private pendingPromise; + private eventManager; + readonly filter: AuthEventType[]; + abstract eventId: string | null; + constructor(auth: AuthInternal, filter: AuthEventType | AuthEventType[], resolver: PopupRedirectResolverInternal, user?: UserInternal | undefined, bypassAuthState?: boolean); + abstract onExecution(): Promise; + execute(): Promise; + onAuthEvent(event: AuthEvent): Promise; + onError(error: FirebaseError): void; + private getIdpTask; + protected resolve(cred: UserCredentialInternal | null): void; + protected reject(error: Error): void; + private unregisterAndCleanUp; + abstract cleanUp(): void; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/action_code_settings.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/action_code_settings.d.ts new file mode 100644 index 0000000..23fa039 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/action_code_settings.d.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { ActionCodeSettings, Auth } from '../../model/public_types'; +import { GetOobCodeRequest } from '../../api/authentication/email_and_password'; +export declare function _setActionCodeSettingsOnRequest(auth: Auth, request: GetOobCodeRequest, actionCodeSettings: ActionCodeSettings): void; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/anonymous.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/anonymous.d.ts new file mode 100644 index 0000000..687a797 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/anonymous.d.ts @@ -0,0 +1,32 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { Auth, UserCredential } from '../../model/public_types'; +/** + * Asynchronously signs in as an anonymous user. + * + * @remarks + * If there is already an anonymous user signed in, that user will be returned; otherwise, a + * new anonymous user identity will be created and returned. + * + * This method is not supported by {@link Auth} instances created with a + * {@link @firebase/app#FirebaseServerApp}. + * + * @param auth - The {@link Auth} instance. + * + * @public + */ +export declare function signInAnonymously(auth: Auth): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/credential.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/credential.d.ts new file mode 100644 index 0000000..392d663 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/credential.d.ts @@ -0,0 +1,64 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { UserCredential, Auth, User } from '../../model/public_types'; +import { AuthInternal } from '../../model/auth'; +import { AuthCredential } from '../credentials'; +export declare function _signInWithCredential(auth: AuthInternal, credential: AuthCredential, bypassAuthState?: boolean): Promise; +/** + * Asynchronously signs in with the given credentials. + * + * @remarks + * An {@link AuthProvider} can be used to generate the credential. + * + * This method is not supported by {@link Auth} instances created with a + * {@link @firebase/app#FirebaseServerApp}. + * + * @param auth - The {@link Auth} instance. + * @param credential - The auth credential. + * + * @public + */ +export declare function signInWithCredential(auth: Auth, credential: AuthCredential): Promise; +/** + * Links the user account with the given credentials. + * + * @remarks + * An {@link AuthProvider} can be used to generate the credential. + * + * @param user - The user. + * @param credential - The auth credential. + * + * @public + */ +export declare function linkWithCredential(user: User, credential: AuthCredential): Promise; +/** + * Re-authenticates a user using a fresh credential. + * + * @remarks + * Use before operations such as {@link updatePassword} that require tokens from recent sign-in + * attempts. This method can be used to recover from a `CREDENTIAL_TOO_OLD_LOGIN_AGAIN` error + * or a `TOKEN_EXPIRED` error. + * + * This method is not supported on any {@link User} signed in by {@link Auth} instances + * created with a {@link @firebase/app#FirebaseServerApp}. + * + * @param user - The user. + * @param credential - The auth credential. + * + * @public + */ +export declare function reauthenticateWithCredential(user: User, credential: AuthCredential): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/custom_token.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/custom_token.d.ts new file mode 100644 index 0000000..e95cc38 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/custom_token.d.ts @@ -0,0 +1,37 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { Auth, UserCredential } from '../../model/public_types'; +/** + * Asynchronously signs in using a custom token. + * + * @remarks + * Custom tokens are used to integrate Firebase Auth with existing auth systems, and must + * be generated by an auth backend using the + * {@link https://firebase.google.com/docs/reference/admin/node/admin.auth.Auth#createcustomtoken | createCustomToken} + * method in the {@link https://firebase.google.com/docs/auth/admin | Admin SDK} . + * + * Fails with an error if the token is invalid, expired, or not accepted by the Firebase Auth service. + * + * This method is not supported by {@link Auth} instances created with a + * {@link @firebase/app#FirebaseServerApp}. + * + * @param auth - The {@link Auth} instance. + * @param customToken - The custom token to sign in with. + * + * @public + */ +export declare function signInWithCustomToken(auth: Auth, customToken: string): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/email.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/email.d.ts new file mode 100644 index 0000000..3505c34 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/email.d.ts @@ -0,0 +1,104 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { ActionCodeSettings, Auth, User } from '../../model/public_types'; +/** + * Gets the list of possible sign in methods for the given email address. This method returns an + * empty list when + * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection} + * is enabled, irrespective of the number of authentication methods available for the given email. + * + * @remarks + * This is useful to differentiate methods of sign-in for the same provider, eg. + * {@link EmailAuthProvider} which has 2 methods of sign-in, + * {@link SignInMethod}.EMAIL_PASSWORD and + * {@link SignInMethod}.EMAIL_LINK. + * + * @param auth - The {@link Auth} instance. + * @param email - The user's email address. + * + * Deprecated. Migrating off of this method is recommended as a security best-practice. + * Learn more in the Identity Platform documentation for + * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}. + * @public + */ +export declare function fetchSignInMethodsForEmail(auth: Auth, email: string): Promise; +/** + * Sends a verification email to a user. + * + * @remarks + * The verification process is completed by calling {@link applyActionCode}. + * + * @example + * ```javascript + * const actionCodeSettings = { + * url: 'https://www.example.com/?email=user@example.com', + * iOS: { + * bundleId: 'com.example.ios' + * }, + * android: { + * packageName: 'com.example.android', + * installApp: true, + * minimumVersion: '12' + * }, + * handleCodeInApp: true + * }; + * await sendEmailVerification(user, actionCodeSettings); + * // Obtain code from the user. + * await applyActionCode(auth, code); + * ``` + * + * @param user - The user. + * @param actionCodeSettings - The {@link ActionCodeSettings}. + * + * @public + */ +export declare function sendEmailVerification(user: User, actionCodeSettings?: ActionCodeSettings | null): Promise; +/** + * Sends a verification email to a new email address. + * + * @remarks + * The user's email will be updated to the new one after being verified. + * + * If you have a custom email action handler, you can complete the verification process by calling + * {@link applyActionCode}. + * + * @example + * ```javascript + * const actionCodeSettings = { + * url: 'https://www.example.com/?email=user@example.com', + * iOS: { + * bundleId: 'com.example.ios' + * }, + * android: { + * packageName: 'com.example.android', + * installApp: true, + * minimumVersion: '12' + * }, + * handleCodeInApp: true + * }; + * await verifyBeforeUpdateEmail(user, 'newemail@example.com', actionCodeSettings); + * // Obtain code from the user. + * await applyActionCode(auth, code); + * ``` + * + * @param user - The user. + * @param newEmail - The new email address to be verified before update. + * @param actionCodeSettings - The {@link ActionCodeSettings}. + * + * @public + */ +export declare function verifyBeforeUpdateEmail(user: User, newEmail: string, actionCodeSettings?: ActionCodeSettings | null): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/email_and_password.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/email_and_password.d.ts new file mode 100644 index 0000000..205f33a --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/email_and_password.d.ts @@ -0,0 +1,139 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { ActionCodeInfo, ActionCodeSettings, Auth, UserCredential } from '../../model/public_types'; +/** + * Sends a password reset email to the given email address. This method does not throw an error when + * there's no user account with the given email address and + * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection} + * is enabled. + * + * @remarks + * To complete the password reset, call {@link confirmPasswordReset} with the code supplied in + * the email sent to the user, along with the new password specified by the user. + * + * @example + * ```javascript + * const actionCodeSettings = { + * url: 'https://www.example.com/?email=user@example.com', + * iOS: { + * bundleId: 'com.example.ios' + * }, + * android: { + * packageName: 'com.example.android', + * installApp: true, + * minimumVersion: '12' + * }, + * handleCodeInApp: true + * }; + * await sendPasswordResetEmail(auth, 'user@example.com', actionCodeSettings); + * // Obtain code from user. + * await confirmPasswordReset('user@example.com', code); + * ``` + * + * @param auth - The {@link Auth} instance. + * @param email - The user's email address. + * @param actionCodeSettings - The {@link ActionCodeSettings}. + * + * @public + */ +export declare function sendPasswordResetEmail(auth: Auth, email: string, actionCodeSettings?: ActionCodeSettings): Promise; +/** + * Completes the password reset process, given a confirmation code and new password. + * + * @param auth - The {@link Auth} instance. + * @param oobCode - A confirmation code sent to the user. + * @param newPassword - The new password. + * + * @public + */ +export declare function confirmPasswordReset(auth: Auth, oobCode: string, newPassword: string): Promise; +/** + * Applies a verification code sent to the user by email or other out-of-band mechanism. + * + * @param auth - The {@link Auth} instance. + * @param oobCode - A verification code sent to the user. + * + * @public + */ +export declare function applyActionCode(auth: Auth, oobCode: string): Promise; +/** + * Checks a verification code sent to the user by email or other out-of-band mechanism. + * + * @returns metadata about the code. + * + * @param auth - The {@link Auth} instance. + * @param oobCode - A verification code sent to the user. + * + * @public + */ +export declare function checkActionCode(auth: Auth, oobCode: string): Promise; +/** + * Checks a password reset code sent to the user by email or other out-of-band mechanism. + * + * @returns the user's email address if valid. + * + * @param auth - The {@link Auth} instance. + * @param code - A verification code sent to the user. + * + * @public + */ +export declare function verifyPasswordResetCode(auth: Auth, code: string): Promise; +/** + * Creates a new user account associated with the specified email address and password. + * + * @remarks + * On successful creation of the user account, this user will also be signed in to your application. + * + * User account creation can fail if the account already exists or the password is invalid. + * + * This method is not supported on {@link Auth} instances created with a + * {@link @firebase/app#FirebaseServerApp}. + * + * Note: The email address acts as a unique identifier for the user and enables an email-based + * password reset. This function will create a new user account and set the initial user password. + * + * @param auth - The {@link Auth} instance. + * @param email - The user's email address. + * @param password - The user's chosen password. + * + * @public + */ +export declare function createUserWithEmailAndPassword(auth: Auth, email: string, password: string): Promise; +/** + * Asynchronously signs in using an email and password. + * + * @remarks + * Fails with an error if the email address and password do not match. When + * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection} + * is enabled, this method fails with "auth/invalid-credential" in case of an invalid + * email/password. + * + * This method is not supported on {@link Auth} instances created with a + * {@link @firebase/app#FirebaseServerApp}. + * + * Note: The user's password is NOT the password used to access the user's email account. The + * email address serves as a unique identifier for the user, and the password is used to access + * the user's account in your Firebase project. See also: {@link createUserWithEmailAndPassword}. + * + * + * @param auth - The {@link Auth} instance. + * @param email - The users email address. + * @param password - The users password. + * + * @public + */ +export declare function signInWithEmailAndPassword(auth: Auth, email: string, password: string): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/email_link.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/email_link.d.ts new file mode 100644 index 0000000..8d01e8a --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/email_link.d.ts @@ -0,0 +1,107 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { ActionCodeSettings, Auth, UserCredential } from '../../model/public_types'; +/** + * Sends a sign-in email link to the user with the specified email. + * + * @remarks + * The sign-in operation has to always be completed in the app unlike other out of band email + * actions (password reset and email verifications). This is because, at the end of the flow, + * the user is expected to be signed in and their Auth state persisted within the app. + * + * To complete sign in with the email link, call {@link signInWithEmailLink} with the email + * address and the email link supplied in the email sent to the user. + * + * @example + * ```javascript + * const actionCodeSettings = { + * url: 'https://www.example.com/?email=user@example.com', + * iOS: { + * bundleId: 'com.example.ios' + * }, + * android: { + * packageName: 'com.example.android', + * installApp: true, + * minimumVersion: '12' + * }, + * handleCodeInApp: true + * }; + * await sendSignInLinkToEmail(auth, 'user@example.com', actionCodeSettings); + * // Obtain emailLink from the user. + * if(isSignInWithEmailLink(auth, emailLink)) { + * await signInWithEmailLink(auth, 'user@example.com', emailLink); + * } + * ``` + * + * @param authInternal - The {@link Auth} instance. + * @param email - The user's email address. + * @param actionCodeSettings - The {@link ActionCodeSettings}. + * + * @public + */ +export declare function sendSignInLinkToEmail(auth: Auth, email: string, actionCodeSettings: ActionCodeSettings): Promise; +/** + * Checks if an incoming link is a sign-in with email link suitable for {@link signInWithEmailLink}. + * + * @param auth - The {@link Auth} instance. + * @param emailLink - The link sent to the user's email address. + * + * @public + */ +export declare function isSignInWithEmailLink(auth: Auth, emailLink: string): boolean; +/** + * Asynchronously signs in using an email and sign-in email link. + * + * @remarks + * If no link is passed, the link is inferred from the current URL. + * + * Fails with an error if the email address is invalid or OTP in email link expires. + * + * This method is not supported by {@link Auth} instances created with a + * {@link @firebase/app#FirebaseServerApp}. + * + * Note: Confirm the link is a sign-in email link before calling this method firebase.auth.Auth.isSignInWithEmailLink. + * + * @example + * ```javascript + * const actionCodeSettings = { + * url: 'https://www.example.com/?email=user@example.com', + * iOS: { + * bundleId: 'com.example.ios' + * }, + * android: { + * packageName: 'com.example.android', + * installApp: true, + * minimumVersion: '12' + * }, + * handleCodeInApp: true + * }; + * await sendSignInLinkToEmail(auth, 'user@example.com', actionCodeSettings); + * // Obtain emailLink from the user. + * if(isSignInWithEmailLink(auth, emailLink)) { + * await signInWithEmailLink(auth, 'user@example.com', emailLink); + * } + * ``` + * + * + * @param auth - The {@link Auth} instance. + * @param email - The user's email address. + * @param emailLink - The link sent to the user's email address. + * + * @public + */ +export declare function signInWithEmailLink(auth: Auth, email: string, emailLink?: string): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/idp.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/idp.d.ts new file mode 100644 index 0000000..179d4f7 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/idp.d.ts @@ -0,0 +1,32 @@ +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { AuthInternal } from '../../model/auth'; +import { UserInternal, UserCredentialInternal } from '../../model/user'; +export interface IdpTaskParams { + auth: AuthInternal; + requestUri: string; + sessionId?: string; + tenantId?: string; + postBody?: string; + pendingToken?: string; + user?: UserInternal; + bypassAuthState?: boolean; +} +export type IdpTask = (params: IdpTaskParams) => Promise; +export declare function _signIn(params: IdpTaskParams): Promise; +export declare function _reauth(params: IdpTaskParams): Promise; +export declare function _link(params: IdpTaskParams): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/redirect.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/redirect.d.ts new file mode 100644 index 0000000..10178ef --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/strategies/redirect.d.ts @@ -0,0 +1,36 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { AuthInternal } from '../../model/auth'; +import { AuthEvent, PopupRedirectResolverInternal } from '../../model/popup_redirect'; +import { UserCredentialInternal } from '../../model/user'; +import { AbstractPopupRedirectOperation } from './abstract_popup_redirect_operation'; +export declare class RedirectAction extends AbstractPopupRedirectOperation { + eventId: null; + constructor(auth: AuthInternal, resolver: PopupRedirectResolverInternal, bypassAuthState?: boolean); + /** + * Override the execute function; if we already have a redirect result, then + * just return it. + */ + execute(): Promise; + onAuthEvent(event: AuthEvent): Promise; + onExecution(): Promise; + cleanUp(): void; +} +export declare function _getAndClearPendingRedirectStatus(resolver: PopupRedirectResolverInternal, auth: AuthInternal): Promise; +export declare function _setPendingRedirectStatus(resolver: PopupRedirectResolverInternal, auth: AuthInternal): Promise; +export declare function _clearRedirectOutcomes(): void; +export declare function _overrideRedirectResult(auth: AuthInternal, result: () => Promise): void; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/account_info.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/account_info.d.ts new file mode 100644 index 0000000..312e23c --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/account_info.d.ts @@ -0,0 +1,68 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { User } from '../../model/public_types'; +/** + * Updates a user's profile data. + * + * @param user - The user. + * @param profile - The profile's `displayName` and `photoURL` to update. + * + * @public + */ +export declare function updateProfile(user: User, { displayName, photoURL: photoUrl }: { + displayName?: string | null; + photoURL?: string | null; +}): Promise; +/** + * Updates the user's email address. + * + * @remarks + * An email will be sent to the original email address (if it was set) that allows to revoke the + * email address change, in order to protect them from account hijacking. + * + * This method is not supported on any {@link User} signed in by {@link Auth} instances + * created with a {@link @firebase/app#FirebaseServerApp}. + * + * Important: this is a security sensitive operation that requires the user to have recently signed + * in. If this requirement isn't met, ask the user to authenticate again and then call + * {@link reauthenticateWithCredential}. + * + * @param user - The user. + * @param newEmail - The new email address. + * + * Throws "auth/operation-not-allowed" error when + * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection} + * is enabled. + * Deprecated - Use {@link verifyBeforeUpdateEmail} instead. + * + * @public + */ +export declare function updateEmail(user: User, newEmail: string): Promise; +/** + * Updates the user's password. + * + * @remarks + * Important: this is a security sensitive operation that requires the user to have recently signed + * in. If this requirement isn't met, ask the user to authenticate again and then call + * {@link reauthenticateWithCredential}. + * + * @param user - The user. + * @param newPassword - The new password. + * + * @public + */ +export declare function updatePassword(user: User, newPassword: string): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/additional_user_info.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/additional_user_info.d.ts new file mode 100644 index 0000000..d5fd65b --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/additional_user_info.d.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { AdditionalUserInfo, UserCredential } from '../../model/public_types'; +import { IdTokenResponse } from '../../model/id_token'; +/** + * Parse the `AdditionalUserInfo` from the ID token response. + * + */ +export declare function _fromIdTokenResponse(idTokenResponse?: IdTokenResponse): AdditionalUserInfo | null; +/** + * Extracts provider specific {@link AdditionalUserInfo} for the given credential. + * + * @param userCredential - The user credential. + * + * @public + */ +export declare function getAdditionalUserInfo(userCredential: UserCredential): AdditionalUserInfo | null; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/id_token_result.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/id_token_result.d.ts new file mode 100644 index 0000000..c1b2032 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/id_token_result.d.ts @@ -0,0 +1,48 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { IdTokenResult, ParsedToken, User } from '../../model/public_types'; +/** + * Returns a JSON Web Token (JWT) used to identify the user to a Firebase service. + * + * @remarks + * Returns the current token if it has not expired or if it will not expire in the next five + * minutes. Otherwise, this will refresh the token and return a new one. + * + * @param user - The user. + * @param forceRefresh - Force refresh regardless of token expiration. + * + * @public + */ +export declare function getIdToken(user: User, forceRefresh?: boolean): Promise; +/** + * Returns a deserialized JSON Web Token (JWT) used to identify the user to a Firebase service. + * + * @remarks + * Returns the current token if it has not expired or if it will not expire in the next five + * minutes. Otherwise, this will refresh the token and return a new one. + * + * @param user - The user. + * @param forceRefresh - Force refresh regardless of token expiration. + * + * @public + */ +export declare function getIdTokenResult(user: User, forceRefresh?: boolean): Promise; +export declare function _parseToken(token: string): ParsedToken | null; +/** + * Extract expiresIn TTL from a token by subtracting the expiration from the issuance. + */ +export declare function _tokenExpiresIn(token: string): number; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/invalidation.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/invalidation.d.ts new file mode 100644 index 0000000..81446ea --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/invalidation.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { UserInternal } from '../../model/user'; +export declare function _logoutIfInvalidated(user: UserInternal, promise: Promise, bypassAuthState?: boolean): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/link_unlink.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/link_unlink.d.ts new file mode 100644 index 0000000..9408524 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/link_unlink.d.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { User } from '../../model/public_types'; +import { UserInternal, UserCredentialInternal } from '../../model/user'; +import { AuthCredential } from '../credentials'; +/** + * Unlinks a provider from a user account. + * + * @param user - The user. + * @param providerId - The provider to unlink. + * + * @public + */ +export declare function unlink(user: User, providerId: string): Promise; +export declare function _link(user: UserInternal, credential: AuthCredential, bypassAuthState?: boolean): Promise; +export declare function _assertLinkedStatus(expected: boolean, user: UserInternal, provider: string): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/proactive_refresh.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/proactive_refresh.d.ts new file mode 100644 index 0000000..ff52286 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/proactive_refresh.d.ts @@ -0,0 +1,34 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { UserInternal } from '../../model/user'; +export declare const enum Duration { + OFFSET = 300000, + RETRY_BACKOFF_MIN = 30000, + RETRY_BACKOFF_MAX = 960000 +} +export declare class ProactiveRefresh { + private readonly user; + private isRunning; + private timerId; + private errorBackoff; + constructor(user: UserInternal); + _start(): void; + _stop(): void; + private getInterval; + private schedule; + private iteration; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/reauthenticate.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/reauthenticate.d.ts new file mode 100644 index 0000000..1855132 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/reauthenticate.d.ts @@ -0,0 +1,20 @@ +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { UserInternal } from '../../model/user'; +import { AuthCredential } from '../credentials'; +import { UserCredentialImpl } from './user_credential_impl'; +export declare function _reauthenticate(user: UserInternal, credential: AuthCredential, bypassAuthState?: boolean): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/reload.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/reload.d.ts new file mode 100644 index 0000000..f2690fa --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/reload.d.ts @@ -0,0 +1,29 @@ +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { User, UserInfo } from '../../model/public_types'; +import { ProviderUserInfo } from '../../api/account_management/account'; +import { UserInternal } from '../../model/user'; +export declare function _reloadWithoutSaving(user: UserInternal): Promise; +/** + * Reloads user account data, if signed in. + * + * @param user - The user. + * + * @public + */ +export declare function reload(user: User): Promise; +export declare function extractProviderData(providers: ProviderUserInfo[]): UserInfo[]; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/token_manager.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/token_manager.d.ts new file mode 100644 index 0000000..790e283 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/token_manager.d.ts @@ -0,0 +1,50 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { FinalizeMfaResponse } from '../../api/authentication/mfa'; +import { AuthInternal } from '../../model/auth'; +import { IdTokenResponse } from '../../model/id_token'; +import { PersistedBlob } from '../persistence'; +/** + * The number of milliseconds before the official expiration time of a token + * to refresh that token, to provide a buffer for RPCs to complete. + */ +export declare const enum Buffer { + TOKEN_REFRESH = 30000 +} +/** + * We need to mark this class as internal explicitly to exclude it in the public typings, because + * it references AuthInternal which has a circular dependency with UserInternal. + * + * @internal + */ +export declare class StsTokenManager { + refreshToken: string | null; + accessToken: string | null; + expirationTime: number | null; + get isExpired(): boolean; + updateFromServerResponse(response: IdTokenResponse | FinalizeMfaResponse): void; + updateFromIdToken(idToken: string): void; + getToken(auth: AuthInternal, forceRefresh?: boolean): Promise; + clearRefreshToken(): void; + private refresh; + private updateTokensAndExpiration; + static fromJSON(appName: string, object: PersistedBlob): StsTokenManager; + toJSON(): object; + _assign(stsTokenManager: StsTokenManager): void; + _clone(): StsTokenManager; + _performRefresh(): never; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/user_credential_impl.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/user_credential_impl.d.ts new file mode 100644 index 0000000..44ece34 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/user_credential_impl.d.ts @@ -0,0 +1,37 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { PhoneOrOauthTokenResponse } from '../../api/authentication/mfa'; +import { IdTokenResponse } from '../../model/id_token'; +import { UserInternal, UserCredentialInternal } from '../../model/user'; +import { AuthInternal } from '../../model/auth'; +import { OperationType, ProviderId } from '../../model/enums'; +interface UserCredentialParams { + readonly user: UserInternal; + readonly providerId: ProviderId | string | null; + readonly _tokenResponse?: PhoneOrOauthTokenResponse; + readonly operationType: OperationType; +} +export declare class UserCredentialImpl implements UserCredentialInternal, UserCredentialParams { + readonly user: UserInternal; + readonly providerId: ProviderId | string | null; + readonly _tokenResponse: PhoneOrOauthTokenResponse | undefined; + readonly operationType: OperationType; + constructor(params: UserCredentialParams); + static _fromIdTokenResponse(auth: AuthInternal, operationType: OperationType, idTokenResponse: IdTokenResponse, isAnonymous?: boolean): Promise; + static _forOperation(user: UserInternal, operationType: OperationType, response: PhoneOrOauthTokenResponse): Promise; +} +export {}; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/user_impl.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/user_impl.d.ts new file mode 100644 index 0000000..f795111 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/user_impl.d.ts @@ -0,0 +1,74 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { IdTokenResult } from '../../model/public_types'; +import { NextFn } from '@firebase/util'; +import { APIUserInfo, GetAccountInfoResponse } from '../../api/account_management/account'; +import { FinalizeMfaResponse } from '../../api/authentication/mfa'; +import { AuthInternal } from '../../model/auth'; +import { IdTokenResponse } from '../../model/id_token'; +import { MutableUserInfo, UserInternal, UserParameters } from '../../model/user'; +import { PersistedBlob } from '../persistence'; +import { StsTokenManager } from './token_manager'; +import { UserMetadata } from './user_metadata'; +import { ProviderId } from '../../model/enums'; +export declare class UserImpl implements UserInternal { + readonly providerId = ProviderId.FIREBASE; + stsTokenManager: StsTokenManager; + private accessToken; + uid: string; + auth: AuthInternal; + emailVerified: boolean; + isAnonymous: boolean; + tenantId: string | null; + readonly metadata: UserMetadata; + providerData: MutableUserInfo[]; + displayName: string | null; + email: string | null; + phoneNumber: string | null; + photoURL: string | null; + _redirectEventId?: string; + private readonly proactiveRefresh; + constructor({ uid, auth, stsTokenManager, ...opt }: UserParameters); + getIdToken(forceRefresh?: boolean): Promise; + getIdTokenResult(forceRefresh?: boolean): Promise; + reload(): Promise; + private reloadUserInfo; + private reloadListener; + _assign(user: UserInternal): void; + _clone(auth: AuthInternal): UserInternal; + _onReload(callback: NextFn): void; + _notifyReloadListener(userInfo: APIUserInfo): void; + _startProactiveRefresh(): void; + _stopProactiveRefresh(): void; + _updateTokensIfNecessary(response: IdTokenResponse | FinalizeMfaResponse, reload?: boolean): Promise; + delete(): Promise; + toJSON(): PersistedBlob; + get refreshToken(): string; + static _fromJSON(auth: AuthInternal, object: PersistedBlob): UserInternal; + /** + * Initialize a User from an idToken server response + * @param auth + * @param idTokenResponse + */ + static _fromIdTokenResponse(auth: AuthInternal, idTokenResponse: IdTokenResponse, isAnonymous?: boolean): Promise; + /** + * Initialize a User from an idToken server response + * @param auth + * @param idTokenResponse + */ + static _fromGetAccountInfoResponse(auth: AuthInternal, response: GetAccountInfoResponse, idToken: string): Promise; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/user_metadata.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/user_metadata.d.ts new file mode 100644 index 0000000..c732ce3 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/user/user_metadata.d.ts @@ -0,0 +1,27 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { UserMetadata as UserMetadataType } from '../../model/public_types'; +export declare class UserMetadata implements UserMetadataType { + private createdAt?; + private lastLoginAt?; + creationTime?: string; + lastSignInTime?: string; + constructor(createdAt?: (string | number) | undefined, lastLoginAt?: (string | number) | undefined); + private _initializeTime; + _copy(metadata: UserMetadata): void; + toJSON(): object; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/assert.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/assert.d.ts new file mode 100644 index 0000000..b877b42 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/assert.d.ts @@ -0,0 +1,94 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { Auth } from '../../model/public_types'; +import { FirebaseError } from '@firebase/util'; +import { AuthErrorCode, AuthErrorParams } from '../errors'; +type LessAppName = Omit; +/** + * Unconditionally fails, throwing a developer facing INTERNAL_ERROR + * + * @example + * ```javascript + * fail(auth, AuthErrorCode.MFA_REQUIRED); // Error: the MFA_REQUIRED error needs more params than appName + * fail(auth, AuthErrorCode.MFA_REQUIRED, {serverResponse}); // Compiles + * fail(AuthErrorCode.INTERNAL_ERROR); // Compiles; internal error does not need appName + * fail(AuthErrorCode.USER_DELETED); // Error: USER_DELETED requires app name + * fail(auth, AuthErrorCode.USER_DELETED); // Compiles; USER_DELETED _only_ needs app name + * ``` + * + * @param appName App name for tagging the error + * @throws FirebaseError + */ +export declare function _fail(code: K, ...data: {} extends AuthErrorParams[K] ? [AuthErrorParams[K]?] : [AuthErrorParams[K]]): never; +export declare function _fail(auth: Auth, code: K, ...data: {} extends LessAppName ? [LessAppName?] : [LessAppName]): never; +export declare function _createError(code: K, ...data: {} extends AuthErrorParams[K] ? [AuthErrorParams[K]?] : [AuthErrorParams[K]]): FirebaseError; +export declare function _createError(auth: Auth, code: K, ...data: {} extends LessAppName ? [LessAppName?] : [LessAppName]): FirebaseError; +export declare function _errorWithCustomMessage(auth: Auth, code: AuthErrorCode, message: string): FirebaseError; +export declare function _serverAppCurrentUserOperationNotSupportedError(auth: Auth): FirebaseError; +export declare function _assertInstanceOf(auth: Auth, object: object, instance: unknown): void; +export declare function _assert(assertion: unknown, code: K, ...data: {} extends AuthErrorParams[K] ? [AuthErrorParams[K]?] : [AuthErrorParams[K]]): asserts assertion; +export declare function _assert(assertion: unknown, auth: Auth, code: K, ...data: {} extends LessAppName ? [LessAppName?] : [LessAppName]): asserts assertion; +type TypeExpectation = Function | string | MapType; +interface MapType extends Record { +} +declare class Optional { + readonly type: TypeExpectation; + constructor(type: TypeExpectation); +} +export declare function opt(type: TypeExpectation): Optional; +/** + * Asserts the runtime types of arguments. The 'expected' field can be one of + * a class, a string (representing a "typeof" call), or a record map of name + * to type. Furthermore, the opt() function can be used to mark a field as + * optional. For example: + * + * function foo(auth: Auth, profile: {displayName?: string}, update = false) { + * assertTypes(arguments, [AuthImpl, {displayName: opt('string')}, opt('boolean')]); + * } + * + * opt() can be used for any type: + * function foo(auth?: Auth) { + * assertTypes(arguments, [opt(AuthImpl)]); + * } + * + * The string types can be or'd together, and you can use "null" as well (note + * that typeof null === 'object'; this is an edge case). For example: + * + * function foo(profile: {displayName?: string | null}) { + * assertTypes(arguments, [{displayName: opt('string|null')}]); + * } + * + * @param args + * @param expected + */ +export declare function assertTypes(args: Omit, ...expected: Array): void; +/** + * Unconditionally fails, throwing an internal error with the given message. + * + * @param failure type of failure encountered + * @throws Error + */ +export declare function debugFail(failure: string): never; +/** + * Fails if the given assertion condition is false, throwing an Error with the + * given message if it did. + * + * @param assertion + * @param message + */ +export declare function debugAssert(assertion: unknown, message: string): asserts assertion; +export {}; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/browser.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/browser.d.ts new file mode 100644 index 0000000..f2abeb6 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/browser.d.ts @@ -0,0 +1,50 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +/** + * Enums for Browser name. + */ +export declare const enum BrowserName { + ANDROID = "Android", + BLACKBERRY = "Blackberry", + EDGE = "Edge", + FIREFOX = "Firefox", + IE = "IE", + IEMOBILE = "IEMobile", + OPERA = "Opera", + OTHER = "Other", + CHROME = "Chrome", + SAFARI = "Safari", + SILK = "Silk", + WEBOS = "Webos" +} +/** + * Determine the browser for the purposes of reporting usage to the API + */ +export declare function _getBrowserName(userAgent: string): BrowserName | string; +export declare function _isFirefox(ua?: string): boolean; +export declare function _isSafari(userAgent?: string): boolean; +export declare function _isChromeIOS(ua?: string): boolean; +export declare function _isIEMobile(ua?: string): boolean; +export declare function _isAndroid(ua?: string): boolean; +export declare function _isBlackBerry(ua?: string): boolean; +export declare function _isWebOS(ua?: string): boolean; +export declare function _isIOS(ua?: string): boolean; +export declare function _isIOS7Or8(ua?: string): boolean; +export declare function _isIOSStandalone(ua?: string): boolean; +export declare function _isIE10(): boolean; +export declare function _isMobileBrowser(ua?: string): boolean; +export declare function _isIframe(): boolean; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/delay.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/delay.d.ts new file mode 100644 index 0000000..6358c7e --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/delay.d.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 declare const enum DelayMin { + OFFLINE = 5000 +} +/** + * A structure to help pick between a range of long and short delay durations + * depending on the current environment. In general, the long delay is used for + * mobile environments whereas short delays are used for desktop environments. + */ +export declare class Delay { + private readonly shortDelay; + private readonly longDelay; + private readonly isMobile; + constructor(shortDelay: number, longDelay: number); + get(): number; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/emulator.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/emulator.d.ts new file mode 100644 index 0000000..068c50a --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/emulator.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { ConfigInternal } from '../../model/auth'; +export declare function _emulatorUrl(config: ConfigInternal, path?: string): string; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/event_id.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/event_id.d.ts new file mode 100644 index 0000000..a235857 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/event_id.d.ts @@ -0,0 +1,17 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 declare function _generateEventId(prefix?: string, digits?: number): string; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/fetch_provider.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/fetch_provider.d.ts new file mode 100644 index 0000000..b30fc05 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/fetch_provider.d.ts @@ -0,0 +1,25 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 declare class FetchProvider { + private static fetchImpl; + private static headersImpl; + private static responseImpl; + static initialize(fetchImpl: typeof fetch, headersImpl?: typeof Headers, responseImpl?: typeof Response): void; + static fetch(): typeof fetch; + static headers(): typeof Headers; + static response(): typeof Response; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/handler.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/handler.d.ts new file mode 100644 index 0000000..d5ff063 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/handler.d.ts @@ -0,0 +1,20 @@ +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { AuthProvider } from '../../model/public_types'; +import { AuthInternal } from '../../model/auth'; +import { AuthEventType } from '../../model/popup_redirect'; +export declare function _getRedirectUrl(auth: AuthInternal, provider: AuthProvider, authType: AuthEventType, redirectUrl?: string, eventId?: string, additionalParams?: Record): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/instantiator.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/instantiator.d.ts new file mode 100644 index 0000000..33e7c95 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/instantiator.d.ts @@ -0,0 +1,28 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +/** + * Our API has a lot of one-off constants that are used to do things. + * Unfortunately we can't export these as classes instantiated directly since + * the constructor may side effect and therefore can't be proven to be safely + * culled. Instead, we export these classes themselves as a lowerCamelCase + * constant, and instantiate them under the hood. + */ +export interface SingletonInstantiator { + new (): T; +} +export declare function _getInstance(cls: unknown): T; +export declare function _clearInstanceMap(): void; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/location.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/location.d.ts new file mode 100644 index 0000000..c79ac38 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/location.d.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 declare function _getCurrentUrl(): string; +export declare function _isHttpOrHttps(): boolean; +export declare function _getCurrentScheme(): string | null; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/log.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/log.d.ts new file mode 100644 index 0000000..b65ea5c --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/log.d.ts @@ -0,0 +1,23 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { LogLevel } from '@firebase/logger'; +export { LogLevel }; +export declare function _getLogLevel(): LogLevel; +export declare function _setLogLevel(newLevel: LogLevel): void; +export declare function _logDebug(msg: string, ...args: string[]): void; +export declare function _logWarn(msg: string, ...args: string[]): void; +export declare function _logError(msg: string, ...args: string[]): void; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/navigator.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/navigator.d.ts new file mode 100644 index 0000000..ac91633 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/navigator.d.ts @@ -0,0 +1,21 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +/** + * Determine whether the browser is working online + */ +export declare function _isOnline(): boolean; +export declare function _getUserLanguage(): string | null; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/providers.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/providers.d.ts new file mode 100644 index 0000000..c2ffdb3 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/providers.d.ts @@ -0,0 +1,23 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 interface ProviderAssociatedObject { + providerId?: string; +} +/** + * Takes a set of UserInfo provider data and converts it to a set of names + */ +export declare function providerDataAsNames(providerData: T[]): Set; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/resolver.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/resolver.d.ts new file mode 100644 index 0000000..e7c2c7c --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/resolver.d.ts @@ -0,0 +1,25 @@ +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { PopupRedirectResolver } from '../../model/public_types'; +import { AuthInternal } from '../../model/auth'; +import { PopupRedirectResolverInternal } from '../../model/popup_redirect'; +/** + * Chooses a popup/redirect resolver to use. This prefers the override (which + * is directly passed in), and falls back to the property set on the auth + * object. If neither are available, this function errors w/ an argument error. + */ +export declare function _withDefaultResolver(auth: AuthInternal, resolverOverride: PopupRedirectResolver | undefined): PopupRedirectResolverInternal; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/time.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/time.d.ts new file mode 100644 index 0000000..d82976e --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/time.d.ts @@ -0,0 +1,17 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 declare function utcTimestampToDateString(utcTimestamp?: string | number): string | undefined; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/validate_origin.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/validate_origin.d.ts new file mode 100644 index 0000000..dde89b0 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/validate_origin.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { AuthInternal } from '../../model/auth'; +export declare function _validateOrigin(auth: AuthInternal): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/version.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/version.d.ts new file mode 100644 index 0000000..342ceb5 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/core/util/version.d.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 declare const enum ClientImplementation { + CORE = "JsCore" +} +/** + * @internal + */ +export declare const enum ClientPlatform { + BROWSER = "Browser", + NODE = "Node", + REACT_NATIVE = "ReactNative", + CORDOVA = "Cordova", + WORKER = "Worker", + WEB_EXTENSION = "WebExtension" +} +export declare function _getClientVersion(clientPlatform: ClientPlatform, frameworks?: readonly string[]): string; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/index.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/index.d.ts new file mode 100644 index 0000000..4b71927 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/index.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 * from './core'; +export * from './mfa'; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/assertions/totp.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/assertions/totp.d.ts new file mode 100644 index 0000000..6b6df19 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/assertions/totp.d.ts @@ -0,0 +1,124 @@ +/** + * @license + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { TotpMultiFactorAssertion, MultiFactorSession } from '../../model/public_types'; +import { AuthInternal } from '../../model/auth'; +import { StartTotpMfaEnrollmentResponse, TotpVerificationInfo } from '../../api/account_management/mfa'; +import { FinalizeMfaResponse } from '../../api/authentication/mfa'; +import { MultiFactorAssertionImpl } from '../../mfa/mfa_assertion'; +/** + * Provider for generating a {@link TotpMultiFactorAssertion}. + * + * @public + */ +export declare class TotpMultiFactorGenerator { + /** + * Provides a {@link TotpMultiFactorAssertion} to confirm ownership of + * the TOTP (time-based one-time password) second factor. + * This assertion is used to complete enrollment in TOTP second factor. + * + * @param secret A {@link TotpSecret} containing the shared secret key and other TOTP parameters. + * @param oneTimePassword One-time password from TOTP App. + * @returns A {@link TotpMultiFactorAssertion} which can be used with + * {@link MultiFactorUser.enroll}. + */ + static assertionForEnrollment(secret: TotpSecret, oneTimePassword: string): TotpMultiFactorAssertion; + /** + * Provides a {@link TotpMultiFactorAssertion} to confirm ownership of the TOTP second factor. + * This assertion is used to complete signIn with TOTP as the second factor. + * + * @param enrollmentId identifies the enrolled TOTP second factor. + * @param oneTimePassword One-time password from TOTP App. + * @returns A {@link TotpMultiFactorAssertion} which can be used with + * {@link MultiFactorResolver.resolveSignIn}. + */ + static assertionForSignIn(enrollmentId: string, oneTimePassword: string): TotpMultiFactorAssertion; + /** + * Returns a promise to {@link TotpSecret} which contains the TOTP shared secret key and other parameters. + * Creates a TOTP secret as part of enrolling a TOTP second factor. + * Used for generating a QR code URL or inputting into a TOTP app. + * This method uses the auth instance corresponding to the user in the multiFactorSession. + * + * @param session The {@link MultiFactorSession} that the user is part of. + * @returns A promise to {@link TotpSecret}. + */ + static generateSecret(session: MultiFactorSession): Promise; + /** + * The identifier of the TOTP second factor: `totp`. + */ + static FACTOR_ID: 'totp'; +} +export declare class TotpMultiFactorAssertionImpl extends MultiFactorAssertionImpl implements TotpMultiFactorAssertion { + readonly otp: string; + readonly enrollmentId?: string | undefined; + readonly secret?: TotpSecret | undefined; + constructor(otp: string, enrollmentId?: string | undefined, secret?: TotpSecret | undefined); + /** @internal */ + static _fromSecret(secret: TotpSecret, otp: string): TotpMultiFactorAssertionImpl; + /** @internal */ + static _fromEnrollmentId(enrollmentId: string, otp: string): TotpMultiFactorAssertionImpl; + /** @internal */ + _finalizeEnroll(auth: AuthInternal, idToken: string, displayName?: string | null): Promise; + /** @internal */ + _finalizeSignIn(auth: AuthInternal, mfaPendingCredential: string): Promise; +} +/** + * Provider for generating a {@link TotpMultiFactorAssertion}. + * + * Stores the shared secret key and other parameters to generate time-based OTPs. + * Implements methods to retrieve the shared secret key and generate a QR code URL. + * @public + */ +export declare class TotpSecret { + private readonly sessionInfo; + private readonly auth; + /** + * Shared secret key/seed used for enrolling in TOTP MFA and generating OTPs. + */ + readonly secretKey: string; + /** + * Hashing algorithm used. + */ + readonly hashingAlgorithm: string; + /** + * Length of the one-time passwords to be generated. + */ + readonly codeLength: number; + /** + * The interval (in seconds) when the OTP codes should change. + */ + readonly codeIntervalSeconds: number; + /** + * The timestamp (UTC string) by which TOTP enrollment should be completed. + */ + readonly enrollmentCompletionDeadline: string; + private constructor(); + /** @internal */ + static _fromStartTotpMfaEnrollmentResponse(response: StartTotpMfaEnrollmentResponse, auth: AuthInternal): TotpSecret; + /** @internal */ + _makeTotpVerificationInfo(otp: string): TotpVerificationInfo; + /** + * Returns a QR code URL as described in + * https://github.com/google/google-authenticator/wiki/Key-Uri-Format + * This can be displayed to the user as a QR code to be scanned into a TOTP app like Google Authenticator. + * If the optional parameters are unspecified, an accountName of and issuer of are used. + * + * @param accountName the name of the account/app along with a user identifier. + * @param issuer issuer of the TOTP (likely the app name). + * @returns A QR code URL string. + */ + generateQrCodeUrl(accountName?: string, issuer?: string): string; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/index.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/index.d.ts new file mode 100644 index 0000000..c976896 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/index.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { getMultiFactorResolver } from './mfa_resolver'; +export { multiFactor } from './mfa_user'; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_assertion.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_assertion.d.ts new file mode 100644 index 0000000..ab9d4fb --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_assertion.d.ts @@ -0,0 +1,27 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { FactorId, MultiFactorAssertion } from '../model/public_types'; +import { MultiFactorSessionImpl } from './mfa_session'; +import { FinalizeMfaResponse } from '../api/authentication/mfa'; +import { AuthInternal } from '../model/auth'; +export declare abstract class MultiFactorAssertionImpl implements MultiFactorAssertion { + readonly factorId: FactorId; + protected constructor(factorId: FactorId); + _process(auth: AuthInternal, session: MultiFactorSessionImpl, displayName?: string | null): Promise; + abstract _finalizeEnroll(auth: AuthInternal, idToken: string, displayName?: string | null): Promise; + abstract _finalizeSignIn(auth: AuthInternal, mfaPendingCredential: string): Promise; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_error.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_error.d.ts new file mode 100644 index 0000000..d6b719c --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_error.d.ts @@ -0,0 +1,35 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { MultiFactorError as MultiFactorErrorPublic } from '../model/public_types'; +import { FirebaseError } from '@firebase/util'; +import { AuthInternal } from '../model/auth'; +import { IdTokenResponse } from '../model/id_token'; +import { UserInternal } from '../model/user'; +import { AuthCredential } from '../core/credentials'; +import { IdTokenMfaResponse } from '../api/authentication/mfa'; +import { OperationType } from '../model/enums'; +export type MultiFactorErrorData = MultiFactorErrorPublic['customData'] & { + _serverResponse: IdTokenMfaResponse; +}; +export declare class MultiFactorError extends FirebaseError implements MultiFactorErrorPublic { + readonly operationType: OperationType; + readonly user?: UserInternal | undefined; + readonly customData: MultiFactorErrorData; + private constructor(); + static _fromErrorAndOperation(auth: AuthInternal, error: FirebaseError, operationType: OperationType, user?: UserInternal): MultiFactorError; +} +export declare function _processCredentialSavingMfaContextIfNecessary(auth: AuthInternal, operationType: OperationType, credential: AuthCredential, user?: UserInternal): Promise; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_info.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_info.d.ts new file mode 100644 index 0000000..49888fd --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_info.d.ts @@ -0,0 +1,36 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { FactorId, MultiFactorInfo, PhoneMultiFactorInfo, TotpMultiFactorInfo } from '../model/public_types'; +import { MfaEnrollment } from '../api/account_management/mfa'; +import { AuthInternal } from '../model/auth'; +export declare abstract class MultiFactorInfoImpl implements MultiFactorInfo { + readonly factorId: FactorId; + readonly uid: string; + readonly displayName?: string | null; + readonly enrollmentTime: string; + protected constructor(factorId: FactorId, response: MfaEnrollment); + static _fromServerResponse(auth: AuthInternal, enrollment: MfaEnrollment): MultiFactorInfoImpl; +} +export declare class PhoneMultiFactorInfoImpl extends MultiFactorInfoImpl implements PhoneMultiFactorInfo { + readonly phoneNumber: string; + private constructor(); + static _fromServerResponse(_auth: AuthInternal, enrollment: MfaEnrollment): PhoneMultiFactorInfoImpl; +} +export declare class TotpMultiFactorInfoImpl extends MultiFactorInfoImpl implements TotpMultiFactorInfo { + private constructor(); + static _fromServerResponse(_auth: AuthInternal, enrollment: MfaEnrollment): TotpMultiFactorInfoImpl; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_resolver.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_resolver.d.ts new file mode 100644 index 0000000..edf54ed --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_resolver.d.ts @@ -0,0 +1,41 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { Auth, MultiFactorResolver, UserCredential, MultiFactorError } from '../model/public_types'; +import { MultiFactorAssertionImpl } from './mfa_assertion'; +import { MultiFactorError as MultiFactorErrorInternal } from './mfa_error'; +import { MultiFactorInfoImpl } from './mfa_info'; +import { MultiFactorSessionImpl } from './mfa_session'; +export declare class MultiFactorResolverImpl implements MultiFactorResolver { + readonly session: MultiFactorSessionImpl; + readonly hints: MultiFactorInfoImpl[]; + private readonly signInResolver; + private constructor(); + /** @internal */ + static _fromError(authExtern: Auth, error: MultiFactorErrorInternal): MultiFactorResolverImpl; + resolveSignIn(assertionExtern: MultiFactorAssertionImpl): Promise; +} +/** + * Provides a {@link MultiFactorResolver} suitable for completion of a + * multi-factor flow. + * + * @param auth - The {@link Auth} instance. + * @param error - The {@link MultiFactorError} raised during a sign-in, or + * reauthentication operation. + * + * @public + */ +export declare function getMultiFactorResolver(auth: Auth, error: MultiFactorError): MultiFactorResolver; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_session.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_session.d.ts new file mode 100644 index 0000000..a144670 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_session.d.ts @@ -0,0 +1,39 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { UserInternal } from '../model/user'; +import { MultiFactorSession } from '../model/public_types'; +export declare const enum MultiFactorSessionType { + ENROLL = "enroll", + SIGN_IN = "signin" +} +interface SerializedMultiFactorSession { + multiFactorSession: { + idToken?: string; + pendingCredential?: string; + }; +} +export declare class MultiFactorSessionImpl implements MultiFactorSession { + readonly type: MultiFactorSessionType; + readonly credential: string; + readonly user?: UserInternal | undefined; + private constructor(); + static _fromIdtoken(idToken: string, user?: UserInternal): MultiFactorSessionImpl; + static _fromMfaPendingCredential(mfaPendingCredential: string): MultiFactorSessionImpl; + toJSON(): SerializedMultiFactorSession; + static fromJSON(obj: Partial): MultiFactorSessionImpl | null; +} +export {}; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_user.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_user.d.ts new file mode 100644 index 0000000..4850e26 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/mfa/mfa_user.d.ts @@ -0,0 +1,38 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { MultiFactorAssertion, MultiFactorInfo, MultiFactorSession, MultiFactorUser, User } from '../model/public_types'; +import { UserInternal } from '../model/user'; +export declare class MultiFactorUserImpl implements MultiFactorUser { + readonly user: UserInternal; + enrolledFactors: MultiFactorInfo[]; + private constructor(); + static _fromUser(user: UserInternal): MultiFactorUserImpl; + getSession(): Promise; + enroll(assertionExtern: MultiFactorAssertion, displayName?: string | null): Promise; + unenroll(infoOrUid: MultiFactorInfo | string): Promise; +} +/** + * The {@link MultiFactorUser} corresponding to the user. + * + * @remarks + * This is used to access all multi-factor properties and operations related to the user. + * + * @param user - The user. + * + * @public + */ +export declare function multiFactor(user: User): MultiFactorUser; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/application_verifier.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/application_verifier.d.ts new file mode 100644 index 0000000..fc6dca5 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/application_verifier.d.ts @@ -0,0 +1,23 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { ApplicationVerifier } from './public_types'; +export interface ApplicationVerifierInternal extends ApplicationVerifier { + /** + * @internal + */ + _reset(): void; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/auth.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/auth.d.ts new file mode 100644 index 0000000..986054b --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/auth.d.ts @@ -0,0 +1,90 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { Auth, AuthSettings, Config, EmulatorConfig, PasswordPolicy, PasswordValidationStatus, PopupRedirectResolver, User } from './public_types'; +import { ErrorFactory } from '@firebase/util'; +import { AuthErrorCode, AuthErrorParams } from '../core/errors'; +import { PopupRedirectResolverInternal } from './popup_redirect'; +import { UserInternal } from './user'; +import { ClientPlatform } from '../core/util/version'; +import { RecaptchaConfig } from '../platform_browser/recaptcha/recaptcha'; +import { PasswordPolicyInternal } from './password_policy'; +import { PersistenceInternal } from '../core/persistence'; +export type AppName = string; +export type ApiKey = string; +export type AuthDomain = string; +/** + * @internal + */ +export interface ConfigInternal extends Config { + /** + * @readonly + */ + emulator?: { + url: string; + }; + /** + * @readonly + */ + clientPlatform: ClientPlatform; +} +/** + * UserInternal and AuthInternal reference each other, so both of them are included in the public typings. + * In order to exclude them, we mark them as internal explicitly. + * + * @internal + */ +export interface AuthInternal extends Auth { + currentUser: User | null; + emulatorConfig: EmulatorConfig | null; + _agentRecaptchaConfig: RecaptchaConfig | null; + _tenantRecaptchaConfigs: Record; + _projectPasswordPolicy: PasswordPolicy | null; + _tenantPasswordPolicies: Record; + _canInitEmulator: boolean; + _isInitialized: boolean; + _initializationPromise: Promise | null; + _persistenceManagerAvailable: Promise; + _updateCurrentUser(user: UserInternal | null): Promise; + _onStorageEvent(): void; + _notifyListenersIfCurrent(user: UserInternal): void; + _persistUserIfCurrent(user: UserInternal): Promise; + _setRedirectUser(user: UserInternal | null, popupRedirectResolver?: PopupRedirectResolver): Promise; + _redirectUserForId(id: string): Promise; + _popupRedirectResolver: PopupRedirectResolverInternal | null; + _key(): string; + _startProactiveRefresh(): void; + _stopProactiveRefresh(): void; + _getPersistenceType(): string; + _getPersistence(): PersistenceInternal; + _getRecaptchaConfig(): RecaptchaConfig | null; + _getPasswordPolicyInternal(): PasswordPolicyInternal | null; + _updatePasswordPolicy(): Promise; + _logFramework(framework: string): void; + _getFrameworks(): readonly string[]; + _getAdditionalHeaders(): Promise>; + _getAppCheckToken(): Promise; + readonly name: AppName; + readonly config: ConfigInternal; + languageCode: string | null; + tenantId: string | null; + readonly settings: AuthSettings; + _errorFactory: ErrorFactory; + useDeviceLanguage(): void; + signOut(): Promise; + validatePassword(password: string): Promise; + revokeAccessToken(token: string): Promise; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/enum_maps.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/enum_maps.d.ts new file mode 100644 index 0000000..60095b5 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/enum_maps.d.ts @@ -0,0 +1,98 @@ +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +/** + * An enum of factors that may be used for multifactor authentication. + * + * @public + */ +export declare const FactorId: { + /** Phone as second factor */ + readonly PHONE: "phone"; + readonly TOTP: "totp"; +}; +/** + * Enumeration of supported providers. + * + * @public + */ +export declare const ProviderId: { + /** Facebook provider ID */ + readonly FACEBOOK: "facebook.com"; + /** GitHub provider ID */ + readonly GITHUB: "github.com"; + /** Google provider ID */ + readonly GOOGLE: "google.com"; + /** Password provider */ + readonly PASSWORD: "password"; + /** Phone provider */ + readonly PHONE: "phone"; + /** Twitter provider ID */ + readonly TWITTER: "twitter.com"; +}; +/** + * Enumeration of supported sign-in methods. + * + * @public + */ +export declare const SignInMethod: { + /** Email link sign in method */ + readonly EMAIL_LINK: "emailLink"; + /** Email/password sign in method */ + readonly EMAIL_PASSWORD: "password"; + /** Facebook sign in method */ + readonly FACEBOOK: "facebook.com"; + /** GitHub sign in method */ + readonly GITHUB: "github.com"; + /** Google sign in method */ + readonly GOOGLE: "google.com"; + /** Phone sign in method */ + readonly PHONE: "phone"; + /** Twitter sign in method */ + readonly TWITTER: "twitter.com"; +}; +/** + * Enumeration of supported operation types. + * + * @public + */ +export declare const OperationType: { + /** Operation involving linking an additional provider to an already signed-in user. */ + readonly LINK: "link"; + /** Operation involving using a provider to reauthenticate an already signed-in user. */ + readonly REAUTHENTICATE: "reauthenticate"; + /** Operation involving signing in a user. */ + readonly SIGN_IN: "signIn"; +}; +/** + * An enumeration of the possible email action types. + * + * @public + */ +export declare const ActionCodeOperation: { + /** The email link sign-in action. */ + readonly EMAIL_SIGNIN: "EMAIL_SIGNIN"; + /** The password reset action. */ + readonly PASSWORD_RESET: "PASSWORD_RESET"; + /** The email revocation action. */ + readonly RECOVER_EMAIL: "RECOVER_EMAIL"; + /** The revert second factor addition email action. */ + readonly REVERT_SECOND_FACTOR_ADDITION: "REVERT_SECOND_FACTOR_ADDITION"; + /** The revert second factor addition email action. */ + readonly VERIFY_AND_CHANGE_EMAIL: "VERIFY_AND_CHANGE_EMAIL"; + /** The email verification action. */ + readonly VERIFY_EMAIL: "VERIFY_EMAIL"; +}; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/enums.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/enums.d.ts new file mode 100644 index 0000000..a917e14 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/enums.d.ts @@ -0,0 +1,74 @@ +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +/** + * Enumeration of supported providers. + * @internal + */ +export declare const enum ProviderId { + /** @internal */ + ANONYMOUS = "anonymous", + /** @internal */ + CUSTOM = "custom", + /** Facebook provider ID */ + FACEBOOK = "facebook.com", + /** @internal */ + FIREBASE = "firebase", + /** GitHub provider ID */ + GITHUB = "github.com", + /** Google provider ID */ + GOOGLE = "google.com", + /** Password provider */ + PASSWORD = "password", + /** Phone provider */ + PHONE = "phone", + /** Twitter provider ID */ + TWITTER = "twitter.com" +} +/** + * Enumeration of supported sign-in methods. + * @internal + */ +export declare const enum SignInMethod { + /** @internal */ + ANONYMOUS = "anonymous", + /** Email link sign in method */ + EMAIL_LINK = "emailLink", + /** Email/password sign in method */ + EMAIL_PASSWORD = "password", + /** Facebook sign in method */ + FACEBOOK = "facebook.com", + /** GitHub sign in method */ + GITHUB = "github.com", + /** Google sign in method */ + GOOGLE = "google.com", + /** Phone sign in method */ + PHONE = "phone", + /** Twitter sign in method */ + TWITTER = "twitter.com" +} +/** + * Enumeration of supported operation types. + * @internal + */ +export declare const enum OperationType { + /** Operation involving linking an additional provider to an already signed-in user. */ + LINK = "link", + /** Operation involving using a provider to reauthenticate an already signed-in user. */ + REAUTHENTICATE = "reauthenticate", + /** Operation involving signing in a user. */ + SIGN_IN = "signIn" +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/id_token.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/id_token.d.ts new file mode 100644 index 0000000..b288dcf --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/id_token.d.ts @@ -0,0 +1,87 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { PhoneOrOauthTokenResponse } from '../api/authentication/mfa'; +/** + * Raw encoded JWT + * + */ +export type IdToken = string; +/** + * Raw parsed JWT + * + */ +export interface ParsedIdToken { + iss: string; + aud: string; + exp: number; + sub: string; + iat: number; + email?: string; + verified: boolean; + providerId?: string; + tenantId?: string; + anonymous: boolean; + federatedId?: string; + displayName?: string; + photoURL?: string; + toString(): string; +} +/** + * IdToken as returned by the API + * + * @internal + */ +export interface IdTokenResponse { + localId: string; + idToken?: IdToken; + refreshToken?: string; + expiresIn?: string; + providerId?: string; + displayName?: string | null; + isNewUser?: boolean; + kind?: IdTokenResponseKind; + photoUrl?: string | null; + rawUserInfo?: string; + screenName?: string | null; +} +/** + * The possible types of the `IdTokenResponse` + * + * @internal + */ +export declare const enum IdTokenResponseKind { + CreateAuthUri = "identitytoolkit#CreateAuthUriResponse", + DeleteAccount = "identitytoolkit#DeleteAccountResponse", + DownloadAccount = "identitytoolkit#DownloadAccountResponse", + EmailLinkSignin = "identitytoolkit#EmailLinkSigninResponse", + GetAccountInfo = "identitytoolkit#GetAccountInfoResponse", + GetOobConfirmationCode = "identitytoolkit#GetOobConfirmationCodeResponse", + GetRecaptchaParam = "identitytoolkit#GetRecaptchaParamResponse", + ResetPassword = "identitytoolkit#ResetPasswordResponse", + SetAccountInfo = "identitytoolkit#SetAccountInfoResponse", + SignupNewUser = "identitytoolkit#SignupNewUserResponse", + UploadAccount = "identitytoolkit#UploadAccountResponse", + VerifyAssertion = "identitytoolkit#VerifyAssertionResponse", + VerifyCustomToken = "identitytoolkit#VerifyCustomTokenResponse", + VerifyPassword = "identitytoolkit#VerifyPasswordResponse" +} +/** + * @internal + */ +export interface TaggedWithTokenResponse { + _tokenResponse?: PhoneOrOauthTokenResponse; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/password_policy.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/password_policy.d.ts new file mode 100644 index 0000000..0a438d2 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/password_policy.d.ts @@ -0,0 +1,111 @@ +/** + * @license + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { PasswordPolicy, PasswordValidationStatus } from './public_types'; +/** + * Internal typing of password policy that includes the schema version and methods for + * validating that a password meets the policy. The developer does not need access to + * these properties and methods, so they are excluded from the public typing. + * + * @internal + */ +export interface PasswordPolicyInternal extends PasswordPolicy { + /** + * Requirements enforced by the password policy. + */ + readonly customStrengthOptions: PasswordPolicyCustomStrengthOptions; + /** + * Schema version of the password policy. + */ + readonly schemaVersion: number; + /** + * Validates the password against the policy. + * @param password Password to validate. + */ + validatePassword(password: string): PasswordValidationStatus; +} +/** + * Internal typing of the password policy custom strength options that is modifiable. This + * allows us to construct the strength options before storing them in the policy. + * + * @internal + */ +export interface PasswordPolicyCustomStrengthOptions { + /** + * Minimum password length. + */ + minPasswordLength?: number; + /** + * Maximum password length. + */ + maxPasswordLength?: number; + /** + * Whether the password should contain a lowercase letter. + */ + containsLowercaseLetter?: boolean; + /** + * Whether the password should contain an uppercase letter. + */ + containsUppercaseLetter?: boolean; + /** + * Whether the password should contain a numeric character. + */ + containsNumericCharacter?: boolean; + /** + * Whether the password should contain a non-alphanumeric character. + */ + containsNonAlphanumericCharacter?: boolean; +} +/** + * Internal typing of password validation status that is modifiable. This allows us to + * construct the validation status before returning it. + * + * @internal + */ +export interface PasswordValidationStatusInternal extends PasswordValidationStatus { + /** + * Whether the password meets all requirements. + */ + isValid: boolean; + /** + * Whether the password meets the minimum password length. + */ + meetsMinPasswordLength?: boolean; + /** + * Whether the password meets the maximum password length. + */ + meetsMaxPasswordLength?: boolean; + /** + * Whether the password contains a lowercase letter, if required. + */ + containsLowercaseLetter?: boolean; + /** + * Whether the password contains an uppercase letter, if required. + */ + containsUppercaseLetter?: boolean; + /** + * Whether the password contains a numeric character, if required. + */ + containsNumericCharacter?: boolean; + /** + * Whether the password contains a non-alphanumeric character, if required. + */ + containsNonAlphanumericCharacter?: boolean; + /** + * The policy used to validate the password. + */ + passwordPolicy: PasswordPolicy; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/popup_redirect.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/popup_redirect.d.ts new file mode 100644 index 0000000..1ed2872 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/popup_redirect.d.ts @@ -0,0 +1,94 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { Auth, AuthProvider, Persistence, PopupRedirectResolver, UserCredential } from './public_types'; +import { FirebaseError } from '@firebase/util'; +import { AuthPopup } from '../platform_browser/util/popup'; +import { AuthInternal } from './auth'; +import { UserCredentialInternal } from './user'; +export declare const enum EventFilter { + POPUP = 0, + REDIRECT = 1 +} +export declare const enum GapiOutcome { + ACK = "ACK", + ERROR = "ERROR" +} +export interface GapiAuthEvent extends gapi.iframes.Message { + authEvent: AuthEvent; +} +/** + * @internal + */ +export declare const enum AuthEventType { + LINK_VIA_POPUP = "linkViaPopup", + LINK_VIA_REDIRECT = "linkViaRedirect", + REAUTH_VIA_POPUP = "reauthViaPopup", + REAUTH_VIA_REDIRECT = "reauthViaRedirect", + SIGN_IN_VIA_POPUP = "signInViaPopup", + SIGN_IN_VIA_REDIRECT = "signInViaRedirect", + UNKNOWN = "unknown", + VERIFY_APP = "verifyApp" +} +export interface AuthEventError extends Error { + code: string; + message: string; +} +/** + * @internal + */ +export interface AuthEvent { + type: AuthEventType; + eventId: string | null; + urlResponse: string | null; + sessionId: string | null; + postBody: string | null; + tenantId: string | null; + error?: AuthEventError; +} +/** + * @internal + */ +export interface AuthEventConsumer { + readonly filter: AuthEventType[]; + eventId: string | null; + onAuthEvent(event: AuthEvent): unknown; + onError(error: FirebaseError): unknown; +} +/** + * @internal + */ +export interface EventManager { + registerConsumer(authEventConsumer: AuthEventConsumer): void; + unregisterConsumer(authEventConsumer: AuthEventConsumer): void; +} +/** + * We need to mark this interface as internal explicitly to exclude it in the public typings, because + * it references AuthInternal which has a circular dependency with UserInternal. + * + * @internal + */ +export interface PopupRedirectResolverInternal extends PopupRedirectResolver { + _shouldInitProactively: boolean; + _initialize(auth: AuthInternal): Promise; + _openPopup(auth: AuthInternal, provider: AuthProvider, authType: AuthEventType, eventId?: string): Promise; + _openRedirect(auth: AuthInternal, provider: AuthProvider, authType: AuthEventType, eventId?: string): Promise; + _isIframeWebStorageSupported(auth: AuthInternal, cb: (support: boolean) => unknown): void; + _redirectPersistence: Persistence; + _originValidation(auth: Auth): Promise; + _completeRedirectFn: (auth: Auth, resolver: PopupRedirectResolver, bypassAuthState: boolean) => Promise; + _overrideRedirectResult: (auth: AuthInternal, resultGetter: () => Promise) => void; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/public_types.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/public_types.d.ts new file mode 100644 index 0000000..d1600ce --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/public_types.d.ts @@ -0,0 +1,1291 @@ +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { FirebaseApp } from '@firebase/app'; +import { CompleteFn, ErrorFn, FirebaseError, NextFn, Observer, Unsubscribe } from '@firebase/util'; +import { FactorId as FactorIdMap, OperationType as OperationTypeMap, ActionCodeOperation as ActionCodeOperationMap } from './enum_maps'; +export { CompleteFn, ErrorFn, NextFn, Unsubscribe }; +/** + * Interface representing the `Auth` config. + * + * @public + */ +export interface Config { + /** + * The API Key used to communicate with the Firebase Auth backend. + */ + apiKey: string; + /** + * The host at which the Firebase Auth backend is running. + */ + apiHost: string; + /** + * The scheme used to communicate with the Firebase Auth backend. + */ + apiScheme: string; + /** + * The host at which the Secure Token API is running. + */ + tokenApiHost: string; + /** + * The SDK Client Version. + */ + sdkClientVersion: string; + /** + * The domain at which the web widgets are hosted (provided via Firebase Config). + */ + authDomain?: string; +} +/** + * Interface representing reCAPTCHA parameters. + * + * See the {@link https://developers.google.com/recaptcha/docs/display#render_param | reCAPTCHA docs} + * for the list of accepted parameters. All parameters are accepted except for `sitekey`: Firebase Auth + * provisions a reCAPTCHA for each project and will configure the site key upon rendering. + * + * For an invisible reCAPTCHA, set the `size` key to `invisible`. + * + * @public + */ +export interface RecaptchaParameters { + [key: string]: any; +} +/** + * Interface representing a parsed ID token. + * + * @privateRemarks TODO(avolkovi): consolidate with parsed_token in implementation. + * + * @public + */ +export interface ParsedToken { + /** Expiration time of the token. */ + 'exp'?: string; + /** UID of the user. */ + 'sub'?: string; + /** Time at which authentication was performed. */ + 'auth_time'?: string; + /** Issuance time of the token. */ + 'iat'?: string; + /** Firebase specific claims, containing the provider(s) used to authenticate the user. */ + 'firebase'?: { + 'sign_in_provider'?: string; + 'sign_in_second_factor'?: string; + 'identities'?: Record; + }; + /** Map of any additional custom claims. */ + [key: string]: unknown; +} +/** + * Type definition for an event callback. + * + * @privateRemarks TODO(avolkovi): should we consolidate with Subscribe since we're changing the API anyway? + * + * @public + */ +export type NextOrObserver = NextFn | Observer; +/** + * Interface for an `Auth` error. + * + * @public + */ +export interface AuthError extends FirebaseError { + /** Details about the Firebase Auth error. */ + readonly customData: { + /** The name of the Firebase App which triggered this error. */ + readonly appName: string; + /** The email address of the user's account, used for sign-in and linking. */ + readonly email?: string; + /** The phone number of the user's account, used for sign-in and linking. */ + readonly phoneNumber?: string; + /** + * The tenant ID being used for sign-in and linking. + * + * @remarks + * If you use {@link signInWithRedirect} to sign in, + * you have to set the tenant ID on the {@link Auth} instance again as the tenant ID is not persisted + * after redirection. + */ + readonly tenantId?: string; + }; +} +/** + * Interface representing an {@link Auth} instance's settings. + * + * @remarks Currently used for enabling/disabling app verification for phone Auth testing. + * + * @public + */ +export interface AuthSettings { + /** + * When set, this property disables app verification for the purpose of testing phone + * authentication. For this property to take effect, it needs to be set before rendering a + * reCAPTCHA app verifier. When this is disabled, a mock reCAPTCHA is rendered instead. This is + * useful for manual testing during development or for automated integration tests. + * + * In order to use this feature, you will need to + * {@link https://firebase.google.com/docs/auth/web/phone-auth#test-with-whitelisted-phone-numbers | whitelist your phone number} + * via the Firebase Console. + * + * The default value is false (app verification is enabled). + */ + appVerificationDisabledForTesting: boolean; +} +/** + * Interface representing Firebase Auth service. + * + * @remarks + * See {@link https://firebase.google.com/docs/auth/ | Firebase Authentication} for a full guide + * on how to use the Firebase Auth service. + * + * @public + */ +export interface Auth { + /** The {@link @firebase/app#FirebaseApp} associated with the `Auth` service instance. */ + readonly app: FirebaseApp; + /** The name of the app associated with the `Auth` service instance. */ + readonly name: string; + /** The {@link Config} used to initialize this instance. */ + readonly config: Config; + /** + * Changes the type of persistence on the `Auth` instance. + * + * @remarks + * This will affect the currently saved Auth session and applies this type of persistence for + * future sign-in requests, including sign-in with redirect requests. + * + * This makes it easy for a user signing in to specify whether their session should be + * remembered or not. It also makes it easier to never persist the Auth state for applications + * that are shared by other users or have sensitive data. + * + * This method does not work in a Node.js environment. + * + * @example + * ```javascript + * auth.setPersistence(browserSessionPersistence); + * ``` + * + * @param persistence - The {@link Persistence} to use. + */ + setPersistence(persistence: Persistence): Promise; + /** + * The {@link Auth} instance's language code. + * + * @remarks + * This is a readable/writable property. When set to null, the default Firebase Console language + * setting is applied. The language code will propagate to email action templates (password + * reset, email verification and email change revocation), SMS templates for phone authentication, + * reCAPTCHA verifier and OAuth popup/redirect operations provided the specified providers support + * localization with the language code specified. + */ + languageCode: string | null; + /** + * The {@link Auth} instance's tenant ID. + * + * @remarks + * This is a readable/writable property. When you set the tenant ID of an {@link Auth} instance, all + * future sign-in/sign-up operations will pass this tenant ID and sign in or sign up users to + * the specified tenant project. When set to null, users are signed in to the parent project. + * + * @example + * ```javascript + * // Set the tenant ID on Auth instance. + * auth.tenantId = 'TENANT_PROJECT_ID'; + * + * // All future sign-in request now include tenant ID. + * const result = await signInWithEmailAndPassword(auth, email, password); + * // result.user.tenantId should be 'TENANT_PROJECT_ID'. + * ``` + * + * @defaultValue null + */ + tenantId: string | null; + /** + * The {@link Auth} instance's settings. + * + * @remarks + * This is used to edit/read configuration related options such as app verification mode for + * phone authentication. + */ + readonly settings: AuthSettings; + /** + * Adds an observer for changes to the user's sign-in state. + * + * @remarks + * To keep the old behavior, see {@link Auth.onIdTokenChanged}. + * + * @param nextOrObserver - callback triggered on change. + * @param error - Deprecated. This callback is never triggered. Errors + * on signing in/out can be caught in promises returned from + * sign-in/sign-out functions. + * @param completed - Deprecated. This callback is never triggered. + */ + onAuthStateChanged(nextOrObserver: NextOrObserver, error?: ErrorFn, completed?: CompleteFn): Unsubscribe; + /** + * Adds a blocking callback that runs before an auth state change + * sets a new user. + * + * @param callback - callback triggered before new user value is set. + * If this throws, it blocks the user from being set. + * @param onAbort - callback triggered if a later `beforeAuthStateChanged()` + * callback throws, allowing you to undo any side effects. + */ + beforeAuthStateChanged(callback: (user: User | null) => void | Promise, onAbort?: () => void): Unsubscribe; + /** + * Adds an observer for changes to the signed-in user's ID token. + * + * @remarks + * This includes sign-in, sign-out, and token refresh events. + * + * @param nextOrObserver - callback triggered on change. + * @param error - Deprecated. This callback is never triggered. Errors + * on signing in/out can be caught in promises returned from + * sign-in/sign-out functions. + * @param completed - Deprecated. This callback is never triggered. + */ + onIdTokenChanged(nextOrObserver: NextOrObserver, error?: ErrorFn, completed?: CompleteFn): Unsubscribe; + /** + * returns a promise that resolves immediately when the initial + * auth state is settled. When the promise resolves, the current user might be a valid user + * or `null` if the user signed out. + */ + authStateReady(): Promise; + /** The currently signed-in user (or null). */ + readonly currentUser: User | null; + /** The current emulator configuration (or null). */ + readonly emulatorConfig: EmulatorConfig | null; + /** + * Asynchronously sets the provided user as {@link Auth.currentUser} on the {@link Auth} instance. + * + * @remarks + * A new instance copy of the user provided will be made and set as currentUser. + * + * This will trigger {@link Auth.onAuthStateChanged} and {@link Auth.onIdTokenChanged} listeners + * like other sign in methods. + * + * The operation fails with an error if the user to be updated belongs to a different Firebase + * project. + * + * @param user - The new {@link User}. + */ + updateCurrentUser(user: User | null): Promise; + /** + * Sets the current language to the default device/browser preference. + */ + useDeviceLanguage(): void; + /** + * Signs out the current user. This does not automatically revoke the user's ID token. + * + * @remarks + * This method is not supported by {@link Auth} instances created with a + * {@link @firebase/app#FirebaseServerApp}. + */ + signOut(): Promise; +} +/** + * An interface covering the possible persistence mechanism types. + * + * @public + */ +export interface Persistence { + /** + * Type of Persistence. + * - 'SESSION' is used for temporary persistence such as `sessionStorage`. + * - 'LOCAL' is used for long term persistence such as `localStorage` or `IndexedDB`. + * - 'NONE' is used for in-memory, or no persistence. + * - 'COOKIE' is used for cookie persistence, useful for server-side rendering. + */ + readonly type: 'SESSION' | 'LOCAL' | 'NONE' | 'COOKIE'; +} +/** + * Interface representing ID token result obtained from {@link User.getIdTokenResult}. + * + * @remarks + * `IdTokenResult` contains the ID token JWT string and other helper properties for getting different data + * associated with the token as well as all the decoded payload claims. + * + * Note that these claims are not to be trusted as they are parsed client side. Only server side + * verification can guarantee the integrity of the token claims. + * + * @public + */ +export interface IdTokenResult { + /** + * The authentication time formatted as a UTC string. + * + * @remarks + * This is the time the user authenticated (signed in) and not the time the token was refreshed. + */ + authTime: string; + /** The ID token expiration time formatted as a UTC string. */ + expirationTime: string; + /** The ID token issuance time formatted as a UTC string. */ + issuedAtTime: string; + /** + * The sign-in provider through which the ID token was obtained (anonymous, custom, phone, + * password, etc). + * + * @remarks + * Note, this does not map to provider IDs. + */ + signInProvider: string | null; + /** + * The type of second factor associated with this session, provided the user was multi-factor + * authenticated (eg. phone, etc). + */ + signInSecondFactor: string | null; + /** The Firebase Auth ID token JWT string. */ + token: string; + /** + * The entire payload claims of the ID token including the standard reserved claims as well as + * the custom claims. + */ + claims: ParsedToken; +} +/** + * A response from {@link checkActionCode}. + * + * @public + */ +export interface ActionCodeInfo { + /** + * The data associated with the action code. + * + * @remarks + * For the {@link ActionCodeOperation}.PASSWORD_RESET, {@link ActionCodeOperation}.VERIFY_EMAIL, and + * {@link ActionCodeOperation}.RECOVER_EMAIL actions, this object contains an email field with the address + * the email was sent to. + * + * For the {@link ActionCodeOperation}.RECOVER_EMAIL action, which allows a user to undo an email address + * change, this object also contains a `previousEmail` field with the user account's current + * email address. After the action completes, the user's email address will revert to the value + * in the `email` field from the value in `previousEmail` field. + * + * For the {@link ActionCodeOperation}.VERIFY_AND_CHANGE_EMAIL action, which allows a user to verify the + * email before updating it, this object contains a `previousEmail` field with the user account's + * email address before updating. After the action completes, the user's email address will be + * updated to the value in the `email` field from the value in `previousEmail` field. + * + * For the {@link ActionCodeOperation}.REVERT_SECOND_FACTOR_ADDITION action, which allows a user to + * unenroll a newly added second factor, this object contains a `multiFactorInfo` field with + * the information about the second factor. For phone second factor, the `multiFactorInfo` + * is a {@link MultiFactorInfo} object, which contains the phone number. + */ + data: { + email?: string | null; + multiFactorInfo?: MultiFactorInfo | null; + previousEmail?: string | null; + }; + /** + * The type of operation that generated the action code. + */ + operation: (typeof ActionCodeOperationMap)[keyof typeof ActionCodeOperationMap]; +} +/** + * An enumeration of the possible email action types. + * + * @internal + */ +export declare const enum ActionCodeOperation { + /** The email link sign-in action. */ + EMAIL_SIGNIN = "EMAIL_SIGNIN", + /** The password reset action. */ + PASSWORD_RESET = "PASSWORD_RESET", + /** The email revocation action. */ + RECOVER_EMAIL = "RECOVER_EMAIL", + /** The revert second factor addition email action. */ + REVERT_SECOND_FACTOR_ADDITION = "REVERT_SECOND_FACTOR_ADDITION", + /** The revert second factor addition email action. */ + VERIFY_AND_CHANGE_EMAIL = "VERIFY_AND_CHANGE_EMAIL", + /** The email verification action. */ + VERIFY_EMAIL = "VERIFY_EMAIL" +} +/** + * An interface that defines the required continue/state URL with optional Android and iOS + * bundle identifiers. + * + * @public + */ +export interface ActionCodeSettings { + /** + * Sets the Android package name. + * + * @remarks + * This will try to open the link in an Android app if it is installed. + */ + android?: { + installApp?: boolean; + minimumVersion?: string; + packageName: string; + }; + /** + * When set to true, the action code link will be be sent as a Universal Link or Android App + * Link and will be opened by the app if installed. + * + * @remarks + * In the false case, the code will be sent to the web widget first and then on continue will + * redirect to the app if installed. + * + * @defaultValue false + */ + handleCodeInApp?: boolean; + /** + * Sets the iOS bundle ID. + * + * @remarks + * This will try to open the link in an iOS app if it is installed. + */ + iOS?: { + bundleId: string; + }; + /** + * Sets the link continue/state URL. + * + * @remarks + * This has different meanings in different contexts: + * - When the link is handled in the web action widgets, this is the deep link in the + * `continueUrl` query parameter. + * - When the link is handled in the app directly, this is the `continueUrl` query parameter in + * the deep link of the Dynamic Link or Hosting link. + */ + url: string; + /** + * When multiple custom dynamic link domains are defined for a project, specify which one to use + * when the link is to be opened via a specified mobile app (for example, `example.page.link`). + * + * + * @defaultValue The first domain is automatically selected. + * + * @deprecated Firebase Dynamic Links is deprecated and will be shut down as early as August + * 2025. Instead, use {@link ActionCodeSettings.linkDomain} to set a custom domain for mobile + * links. Learn more in the {@link https://firebase.google.com/support/dynamic-links-faq | Dynamic Links deprecation FAQ}. + */ + dynamicLinkDomain?: string; + /** + * The optional custom Firebase Hosting domain to use when the link is to be opened via + * a specified mobile app. The domain must be configured in Firebase Hosting and owned + * by the project. This cannot be a default Hosting domain (`web.app` or `firebaseapp.com`). + * + * @defaultValue The default Hosting domain will be used (for example, `example.firebaseapp.com`). + */ + linkDomain?: string; +} +/** + * A verifier for domain verification and abuse prevention. + * + * @remarks + * Currently, the only implementation is {@link RecaptchaVerifier}. + * + * @public + */ +export interface ApplicationVerifier { + /** + * Identifies the type of application verifier (e.g. "recaptcha"). + */ + readonly type: string; + /** + * Executes the verification process. + * + * @returns A Promise for a token that can be used to assert the validity of a request. + */ + verify(): Promise; +} +/** + * Interface that represents an auth provider, used to facilitate creating {@link AuthCredential}. + * + * @public + */ +export interface AuthProvider { + /** + * Provider for which credentials can be constructed. + */ + readonly providerId: string; +} +/** + * An enum of factors that may be used for multifactor authentication. + * + * Internally we use an enum type for FactorId, ActionCodeOperation, but there is a copy in https://github.com/firebase/firebase-js-sdk/blob/48a2096aec53a7eaa9ffcc2625016ecb9f90d113/packages/auth/src/model/enum_maps.ts#L23 that uses maps. + * const enums are better for tree-shaking, however can cause runtime errors if exposed in public APIs, example - https://github.com/microsoft/rushstack/issues/3058 + * So, we expose enum maps publicly, but use const enums internally to get some tree-shaking benefit. + * @internal + */ +export declare const enum FactorId { + /** Phone as second factor */ + PHONE = "phone", + TOTP = "totp" +} +/** + * A result from a phone number sign-in, link, or reauthenticate call. + * + * @public + */ +export interface ConfirmationResult { + /** + * The phone number authentication operation's verification ID. + * + * @remarks + * This can be used along with the verification code to initialize a + * {@link PhoneAuthCredential}. + */ + readonly verificationId: string; + /** + * Finishes a phone number sign-in, link, or reauthentication. + * + * @example + * ```javascript + * const confirmationResult = await signInWithPhoneNumber(auth, phoneNumber, applicationVerifier); + * // Obtain verificationCode from the user. + * const userCredential = await confirmationResult.confirm(verificationCode); + * ``` + * + * @param verificationCode - The code that was sent to the user's mobile device. + */ + confirm(verificationCode: string): Promise; +} +/** + * The base class for asserting ownership of a second factor. + * + * @remarks + * This is used to facilitate enrollment of a second factor on an existing user or sign-in of a + * user who already verified the first factor. + * + * @public + */ +export interface MultiFactorAssertion { + /** The identifier of the second factor. */ + readonly factorId: (typeof FactorIdMap)[keyof typeof FactorIdMap]; +} +/** + * The error thrown when the user needs to provide a second factor to sign in successfully. + * + * @remarks + * The error code for this error is `auth/multi-factor-auth-required`. + * + * @example + * ```javascript + * let resolver; + * let multiFactorHints; + * + * signInWithEmailAndPassword(auth, email, password) + * .then((result) => { + * // User signed in. No 2nd factor challenge is needed. + * }) + * .catch((error) => { + * if (error.code == 'auth/multi-factor-auth-required') { + * resolver = getMultiFactorResolver(auth, error); + * multiFactorHints = resolver.hints; + * } else { + * // Handle other errors. + * } + * }); + * + * // Obtain a multiFactorAssertion by verifying the second factor. + * + * const userCredential = await resolver.resolveSignIn(multiFactorAssertion); + * ``` + * + * @public + */ +export interface MultiFactorError extends AuthError { + /** Details about the MultiFactorError. */ + readonly customData: AuthError['customData'] & { + /** + * The type of operation (sign-in, linking, or re-authentication) that raised the error. + */ + readonly operationType: (typeof OperationTypeMap)[keyof typeof OperationTypeMap]; + }; +} +/** + * A structure containing the information of a second factor entity. + * + * @public + */ +export interface MultiFactorInfo { + /** The multi-factor enrollment ID. */ + readonly uid: string; + /** The user friendly name of the current second factor. */ + readonly displayName?: string | null; + /** The enrollment date of the second factor formatted as a UTC string. */ + readonly enrollmentTime: string; + /** The identifier of the second factor. */ + readonly factorId: (typeof FactorIdMap)[keyof typeof FactorIdMap]; +} +/** + * The subclass of the {@link MultiFactorInfo} interface for phone number + * second factors. The `factorId` of this second factor is {@link FactorId}.PHONE. + * @public + */ +export interface PhoneMultiFactorInfo extends MultiFactorInfo { + /** The phone number associated with the current second factor. */ + readonly phoneNumber: string; +} +/** + * The subclass of the {@link MultiFactorInfo} interface for TOTP + * second factors. The `factorId` of this second factor is {@link FactorId}.TOTP. + * @public + */ +export interface TotpMultiFactorInfo extends MultiFactorInfo { +} +/** + * The class used to facilitate recovery from {@link MultiFactorError} when a user needs to + * provide a second factor to sign in. + * + * @example + * ```javascript + * let resolver; + * let multiFactorHints; + * + * signInWithEmailAndPassword(auth, email, password) + * .then((result) => { + * // User signed in. No 2nd factor challenge is needed. + * }) + * .catch((error) => { + * if (error.code == 'auth/multi-factor-auth-required') { + * resolver = getMultiFactorResolver(auth, error); + * // Show UI to let user select second factor. + * multiFactorHints = resolver.hints; + * } else { + * // Handle other errors. + * } + * }); + * + * // The enrolled second factors that can be used to complete + * // sign-in are returned in the `MultiFactorResolver.hints` list. + * // UI needs to be presented to allow the user to select a second factor + * // from that list. + * + * const selectedHint = // ; selected from multiFactorHints + * const phoneAuthProvider = new PhoneAuthProvider(auth); + * const phoneInfoOptions = { + * multiFactorHint: selectedHint, + * session: resolver.session + * }; + * const verificationId = phoneAuthProvider.verifyPhoneNumber(phoneInfoOptions, appVerifier); + * // Store `verificationId` and show UI to let user enter verification code. + * + * // UI to enter verification code and continue. + * // Continue button click handler + * const phoneAuthCredential = PhoneAuthProvider.credential(verificationId, verificationCode); + * const multiFactorAssertion = PhoneMultiFactorGenerator.assertion(phoneAuthCredential); + * const userCredential = await resolver.resolveSignIn(multiFactorAssertion); + * ``` + * + * @public + */ +export interface MultiFactorResolver { + /** + * The list of hints for the second factors needed to complete the sign-in for the current + * session. + */ + readonly hints: MultiFactorInfo[]; + /** + * The session identifier for the current sign-in flow, which can be used to complete the second + * factor sign-in. + */ + readonly session: MultiFactorSession; + /** + * A helper function to help users complete sign in with a second factor using an + * {@link MultiFactorAssertion} confirming the user successfully completed the second factor + * challenge. + * + * @example + * ```javascript + * const phoneAuthCredential = PhoneAuthProvider.credential(verificationId, verificationCode); + * const multiFactorAssertion = PhoneMultiFactorGenerator.assertion(phoneAuthCredential); + * const userCredential = await resolver.resolveSignIn(multiFactorAssertion); + * ``` + * + * @param assertion - The multi-factor assertion to resolve sign-in with. + * @returns The promise that resolves with the user credential object. + */ + resolveSignIn(assertion: MultiFactorAssertion): Promise; +} +/** + * An interface defining the multi-factor session object used for enrolling a second factor on a + * user or helping sign in an enrolled user with a second factor. + * + * @public + */ +export interface MultiFactorSession { +} +/** + * An interface that defines the multi-factor related properties and operations pertaining + * to a {@link User}. + * + * @public + */ +export interface MultiFactorUser { + /** Returns a list of the user's enrolled second factors. */ + readonly enrolledFactors: MultiFactorInfo[]; + /** + * Returns the session identifier for a second factor enrollment operation. This is used to + * identify the user trying to enroll a second factor. + * + * @example + * ```javascript + * const multiFactorUser = multiFactor(auth.currentUser); + * const multiFactorSession = await multiFactorUser.getSession(); + * + * // Send verification code. + * const phoneAuthProvider = new PhoneAuthProvider(auth); + * const phoneInfoOptions = { + * phoneNumber: phoneNumber, + * session: multiFactorSession + * }; + * const verificationId = await phoneAuthProvider.verifyPhoneNumber(phoneInfoOptions, appVerifier); + * + * // Obtain verification code from user. + * const phoneAuthCredential = PhoneAuthProvider.credential(verificationId, verificationCode); + * const multiFactorAssertion = PhoneMultiFactorGenerator.assertion(phoneAuthCredential); + * await multiFactorUser.enroll(multiFactorAssertion); + * ``` + * + * @returns The promise that resolves with the {@link MultiFactorSession}. + */ + getSession(): Promise; + /** + * + * Enrolls a second factor as identified by the {@link MultiFactorAssertion} for the + * user. + * + * @remarks + * On resolution, the user tokens are updated to reflect the change in the JWT payload. + * Accepts an additional display name parameter used to identify the second factor to the end + * user. Recent re-authentication is required for this operation to succeed. On successful + * enrollment, existing Firebase sessions (refresh tokens) are revoked. When a new factor is + * enrolled, an email notification is sent to the user’s email. + * + * @example + * ```javascript + * const multiFactorUser = multiFactor(auth.currentUser); + * const multiFactorSession = await multiFactorUser.getSession(); + * + * // Send verification code. + * const phoneAuthProvider = new PhoneAuthProvider(auth); + * const phoneInfoOptions = { + * phoneNumber: phoneNumber, + * session: multiFactorSession + * }; + * const verificationId = await phoneAuthProvider.verifyPhoneNumber(phoneInfoOptions, appVerifier); + * + * // Obtain verification code from user. + * const phoneAuthCredential = PhoneAuthProvider.credential(verificationId, verificationCode); + * const multiFactorAssertion = PhoneMultiFactorGenerator.assertion(phoneAuthCredential); + * await multiFactorUser.enroll(multiFactorAssertion); + * // Second factor enrolled. + * ``` + * + * @param assertion - The multi-factor assertion to enroll with. + * @param displayName - The display name of the second factor. + */ + enroll(assertion: MultiFactorAssertion, displayName?: string | null): Promise; + /** + * Unenrolls the specified second factor. + * + * @remarks + * To specify the factor to remove, pass a {@link MultiFactorInfo} object (retrieved from + * {@link MultiFactorUser.enrolledFactors}) or the + * factor's UID string. Sessions are not revoked when the account is unenrolled. An email + * notification is likely to be sent to the user notifying them of the change. Recent + * re-authentication is required for this operation to succeed. When an existing factor is + * unenrolled, an email notification is sent to the user’s email. + * + * @example + * ```javascript + * const multiFactorUser = multiFactor(auth.currentUser); + * // Present user the option to choose which factor to unenroll. + * await multiFactorUser.unenroll(multiFactorUser.enrolledFactors[i]) + * ``` + * + * @param option - The multi-factor option to unenroll. + * @returns - A `Promise` which resolves when the unenroll operation is complete. + */ + unenroll(option: MultiFactorInfo | string): Promise; +} +/** + * The class for asserting ownership of a phone second factor. Provided by + * {@link PhoneMultiFactorGenerator.assertion}. + * + * @public + */ +export interface PhoneMultiFactorAssertion extends MultiFactorAssertion { +} +/** + * The information required to verify the ownership of a phone number. + * + * @remarks + * The information that's required depends on whether you are doing single-factor sign-in, + * multi-factor enrollment or multi-factor sign-in. + * + * @public + */ +export type PhoneInfoOptions = PhoneSingleFactorInfoOptions | PhoneMultiFactorEnrollInfoOptions | PhoneMultiFactorSignInInfoOptions; +/** + * Options used for single-factor sign-in. + * + * @public + */ +export interface PhoneSingleFactorInfoOptions { + /** Phone number to send a verification code to. */ + phoneNumber: string; +} +/** + * Options used for enrolling a second factor. + * + * @public + */ +export interface PhoneMultiFactorEnrollInfoOptions { + /** Phone number to send a verification code to. */ + phoneNumber: string; + /** The {@link MultiFactorSession} obtained via {@link MultiFactorUser.getSession}. */ + session: MultiFactorSession; +} +/** + * Options used for signing in with a second factor. + * + * @public + */ +export interface PhoneMultiFactorSignInInfoOptions { + /** + * The {@link MultiFactorInfo} obtained via {@link MultiFactorResolver.hints}. + * + * One of `multiFactorHint` or `multiFactorUid` is required. + */ + multiFactorHint?: MultiFactorInfo; + /** + * The uid of the second factor. + * + * One of `multiFactorHint` or `multiFactorUid` is required. + */ + multiFactorUid?: string; + /** The {@link MultiFactorSession} obtained via {@link MultiFactorResolver.session}. */ + session: MultiFactorSession; +} +/** + * Interface for a supplied `AsyncStorage`. + * + * @public + */ +export interface ReactNativeAsyncStorage { + /** + * Persist an item in storage. + * + * @param key - storage key. + * @param value - storage value. + */ + setItem(key: string, value: string): Promise; + /** + * Retrieve an item from storage. + * + * @param key - storage key. + */ + getItem(key: string): Promise; + /** + * Remove an item from storage. + * + * @param key - storage key. + */ + removeItem(key: string): Promise; +} +/** + * A user account. + * + * @public + */ +export interface User extends UserInfo { + /** + * Whether the email has been verified with {@link sendEmailVerification} and + * {@link applyActionCode}. + */ + readonly emailVerified: boolean; + /** + * Whether the user is authenticated using the {@link ProviderId}.ANONYMOUS provider. + */ + readonly isAnonymous: boolean; + /** + * Additional metadata around user creation and sign-in times. + */ + readonly metadata: UserMetadata; + /** + * Additional per provider such as displayName and profile information. + */ + readonly providerData: UserInfo[]; + /** + * Refresh token used to reauthenticate the user. Avoid using this directly and prefer + * {@link User.getIdToken} to refresh the ID token instead. + */ + readonly refreshToken: string; + /** + * The user's tenant ID. + * + * @remarks + * This is a read-only property, which indicates the tenant ID + * used to sign in the user. This is null if the user is signed in from the parent + * project. + * + * @example + * ```javascript + * // Set the tenant ID on Auth instance. + * auth.tenantId = 'TENANT_PROJECT_ID'; + * + * // All future sign-in request now include tenant ID. + * const result = await signInWithEmailAndPassword(auth, email, password); + * // result.user.tenantId should be 'TENANT_PROJECT_ID'. + * ``` + */ + readonly tenantId: string | null; + /** + * Deletes and signs out the user. + * + * @remarks + * Important: this is a security-sensitive operation that requires the user to have recently + * signed in. If this requirement isn't met, ask the user to authenticate again and then call + * one of the reauthentication methods like {@link reauthenticateWithCredential}. + * + * This method is not supported on any {@link User} signed in by {@link Auth} instances + * created with a {@link @firebase/app#FirebaseServerApp}. + */ + delete(): Promise; + /** + * Returns a JSON Web Token (JWT) used to identify the user to a Firebase service. + * + * @remarks + * Returns the current token if it has not expired or if it will not expire in the next five + * minutes. Otherwise, this will refresh the token and return a new one. + * + * @param forceRefresh - Force refresh regardless of token expiration. + */ + getIdToken(forceRefresh?: boolean): Promise; + /** + * Returns a deserialized JSON Web Token (JWT) used to identify the user to a Firebase service. + * + * @remarks + * Returns the current token if it has not expired or if it will not expire in the next five + * minutes. Otherwise, this will refresh the token and return a new one. + * + * @param forceRefresh - Force refresh regardless of token expiration. + */ + getIdTokenResult(forceRefresh?: boolean): Promise; + /** + * Refreshes the user, if signed in. + */ + reload(): Promise; + /** + * Returns a JSON-serializable representation of this object. + * + * @returns A JSON-serializable representation of this object. + */ + toJSON(): object; +} +/** + * A structure containing a {@link User}, the {@link OperationType}, and the provider ID. + * + * @remarks + * `operationType` could be {@link OperationType}.SIGN_IN for a sign-in operation, + * {@link OperationType}.LINK for a linking operation and {@link OperationType}.REAUTHENTICATE for + * a reauthentication operation. + * + * @public + */ +export interface UserCredential { + /** + * The user authenticated by this credential. + */ + user: User; + /** + * The provider which was used to authenticate the user. + */ + providerId: string | null; + /** + * The type of operation which was used to authenticate the user (such as sign-in or link). + */ + operationType: (typeof OperationTypeMap)[keyof typeof OperationTypeMap]; +} +/** + * User profile information, visible only to the Firebase project's apps. + * + * @public + */ +export interface UserInfo { + /** + * The display name of the user. + */ + readonly displayName: string | null; + /** + * The email of the user. + */ + readonly email: string | null; + /** + * The phone number normalized based on the E.164 standard (e.g. +16505550101) for the + * user. + * + * @remarks + * This is null if the user has no phone credential linked to the account. + */ + readonly phoneNumber: string | null; + /** + * The profile photo URL of the user. + */ + readonly photoURL: string | null; + /** + * The provider used to authenticate the user. + */ + readonly providerId: string; + /** + * The user's unique ID, scoped to the project. + */ + readonly uid: string; +} +/** + * Interface representing a user's metadata. + * + * @public + */ +export interface UserMetadata { + /** Time the user was created. */ + readonly creationTime?: string; + /** Time the user last signed in. */ + readonly lastSignInTime?: string; +} +/** + * A structure containing additional user information from a federated identity provider. + * + * @public + */ +export interface AdditionalUserInfo { + /** + * Whether the user is new (created via sign-up) or existing (authenticated using sign-in). + */ + readonly isNewUser: boolean; + /** + * Map containing IDP-specific user data. + */ + readonly profile: Record | null; + /** + * Identifier for the provider used to authenticate this user. + */ + readonly providerId: string | null; + /** + * The username if the provider is GitHub or Twitter. + */ + readonly username?: string | null; +} +/** + * User profile used in {@link AdditionalUserInfo}. + * + * @public + */ +export type UserProfile = Record; +/** + * A resolver used for handling DOM specific operations like {@link signInWithPopup} + * or {@link signInWithRedirect}. + * + * @public + */ +export interface PopupRedirectResolver { +} +declare module '@firebase/component' { + interface NameServiceMapping { + 'auth': Auth; + } +} +/** + * Configuration of Firebase Authentication Emulator. + * @public + */ +export interface EmulatorConfig { + /** + * The protocol used to communicate with the emulator ("http"/"https"). + */ + readonly protocol: string; + /** + * The hostname of the emulator, which may be a domain ("localhost"), IPv4 address ("127.0.0.1") + * or quoted IPv6 address ("[::1]"). + */ + readonly host: string; + /** + * The port of the emulator, or null if port isn't specified (i.e. protocol default). + */ + readonly port: number | null; + /** + * The emulator-specific options. + */ + readonly options: { + /** + * Whether the warning banner attached to the DOM was disabled. + */ + readonly disableWarnings: boolean; + }; +} +/** + * A mapping of error codes to error messages. + * + * @remarks + * + * While error messages are useful for debugging (providing verbose textual + * context around what went wrong), these strings take up a lot of space in the + * compiled code. When deploying code in production, using {@link prodErrorMap} + * will save you roughly 10k compressed/gzipped over {@link debugErrorMap}. You + * can select the error map during initialization: + * + * ```javascript + * initializeAuth(app, {errorMap: debugErrorMap}) + * ``` + * + * When initializing Auth, {@link prodErrorMap} is default. + * + * @public + */ +export interface AuthErrorMap { +} +/** + * The dependencies that can be used to initialize an {@link Auth} instance. + * + * @remarks + * + * The modular SDK enables tree shaking by allowing explicit declarations of + * dependencies. For example, a web app does not need to include code that + * enables Cordova redirect sign in. That functionality is therefore split into + * {@link browserPopupRedirectResolver} and + * {@link cordovaPopupRedirectResolver}. The dependencies object is how Auth is + * configured to reduce bundle sizes. + * + * There are two ways to initialize an {@link Auth} instance: {@link getAuth} and + * {@link initializeAuth}. `getAuth` initializes everything using + * platform-specific configurations, while `initializeAuth` takes a + * `Dependencies` object directly, giving you more control over what is used. + * + * @public + */ +export interface Dependencies { + /** + * Which {@link Persistence} to use. If this is an array, the first + * `Persistence` that the device supports is used. The SDK searches for an + * existing account in order and, if one is found in a secondary + * `Persistence`, the account is moved to the primary `Persistence`. + * + * If no persistence is provided, the SDK falls back on + * {@link inMemoryPersistence}. + */ + persistence?: Persistence | Persistence[]; + /** + * The {@link PopupRedirectResolver} to use. This value depends on the + * platform. Options are {@link browserPopupRedirectResolver} and + * {@link cordovaPopupRedirectResolver}. This field is optional if neither + * {@link signInWithPopup} or {@link signInWithRedirect} are being used. + */ + popupRedirectResolver?: PopupRedirectResolver; + /** + * Which {@link AuthErrorMap} to use. + */ + errorMap?: AuthErrorMap; +} +/** + * The class for asserting ownership of a TOTP second factor. Provided by + * {@link TotpMultiFactorGenerator.assertionForEnrollment} and + * {@link TotpMultiFactorGenerator.assertionForSignIn}. + * + * @public + */ +export interface TotpMultiFactorAssertion extends MultiFactorAssertion { +} +/** + * A structure specifying password policy requirements. + * + * @public + */ +export interface PasswordPolicy { + /** + * Requirements enforced by this password policy. + */ + readonly customStrengthOptions: { + /** + * Minimum password length, or undefined if not configured. + */ + readonly minPasswordLength?: number; + /** + * Maximum password length, or undefined if not configured. + */ + readonly maxPasswordLength?: number; + /** + * Whether the password should contain a lowercase letter, or undefined if not configured. + */ + readonly containsLowercaseLetter?: boolean; + /** + * Whether the password should contain an uppercase letter, or undefined if not configured. + */ + readonly containsUppercaseLetter?: boolean; + /** + * Whether the password should contain a numeric character, or undefined if not configured. + */ + readonly containsNumericCharacter?: boolean; + /** + * Whether the password should contain a non-alphanumeric character, or undefined if not configured. + */ + readonly containsNonAlphanumericCharacter?: boolean; + }; + /** + * List of characters that are considered non-alphanumeric during validation. + */ + readonly allowedNonAlphanumericCharacters: string; + /** + * The enforcement state of the policy. Can be 'OFF' or 'ENFORCE'. + */ + readonly enforcementState: string; + /** + * Whether existing passwords must meet the policy. + */ + readonly forceUpgradeOnSignin: boolean; +} +/** + * A structure indicating which password policy requirements were met or violated and what the + * requirements are. + * + * @public + */ +export interface PasswordValidationStatus { + /** + * Whether the password meets all requirements. + */ + readonly isValid: boolean; + /** + * Whether the password meets the minimum password length, or undefined if not required. + */ + readonly meetsMinPasswordLength?: boolean; + /** + * Whether the password meets the maximum password length, or undefined if not required. + */ + readonly meetsMaxPasswordLength?: boolean; + /** + * Whether the password contains a lowercase letter, or undefined if not required. + */ + readonly containsLowercaseLetter?: boolean; + /** + * Whether the password contains an uppercase letter, or undefined if not required. + */ + readonly containsUppercaseLetter?: boolean; + /** + * Whether the password contains a numeric character, or undefined if not required. + */ + readonly containsNumericCharacter?: boolean; + /** + * Whether the password contains a non-alphanumeric character, or undefined if not required. + */ + readonly containsNonAlphanumericCharacter?: boolean; + /** + * The policy used to validate the password. + */ + readonly passwordPolicy: PasswordPolicy; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/user.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/user.d.ts new file mode 100644 index 0000000..7e40566 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/model/user.d.ts @@ -0,0 +1,83 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { IdTokenResult, User, UserCredential, UserInfo } from './public_types'; +import { NextFn } from '@firebase/util'; +import { APIUserInfo } from '../api/account_management/account'; +import { FinalizeMfaResponse } from '../api/authentication/mfa'; +import { PersistedBlob } from '../core/persistence'; +import { StsTokenManager } from '../core/user/token_manager'; +import { UserMetadata } from '../core/user/user_metadata'; +import { AuthInternal } from './auth'; +import { IdTokenResponse, TaggedWithTokenResponse } from './id_token'; +import { ProviderId } from './enums'; +export type MutableUserInfo = { + -readonly [K in keyof UserInfo]: UserInfo[K]; +}; +export interface UserParameters { + uid: string; + auth: AuthInternal; + stsTokenManager: StsTokenManager; + displayName?: string | null; + email?: string | null; + phoneNumber?: string | null; + photoURL?: string | null; + isAnonymous?: boolean | null; + emailVerified?: boolean | null; + tenantId?: string | null; + providerData?: MutableUserInfo[] | null; + createdAt?: string | null; + lastLoginAt?: string | null; +} +/** + * UserInternal and AuthInternal reference each other, so both of them are included in the public typings. + * In order to exclude them, we mark them as internal explicitly. + * + * @internal + */ +export interface UserInternal extends User { + displayName: string | null; + email: string | null; + phoneNumber: string | null; + photoURL: string | null; + auth: AuthInternal; + providerId: ProviderId.FIREBASE; + refreshToken: string; + emailVerified: boolean; + tenantId: string | null; + providerData: MutableUserInfo[]; + metadata: UserMetadata; + stsTokenManager: StsTokenManager; + _redirectEventId?: string; + _updateTokensIfNecessary(response: IdTokenResponse | FinalizeMfaResponse, reload?: boolean): Promise; + _assign(user: UserInternal): void; + _clone(auth: AuthInternal): UserInternal; + _onReload: (cb: NextFn) => void; + _notifyReloadListener: NextFn; + _startProactiveRefresh: () => void; + _stopProactiveRefresh: () => void; + getIdToken(forceRefresh?: boolean): Promise; + getIdTokenResult(forceRefresh?: boolean): Promise; + reload(): Promise; + delete(): Promise; + toJSON(): PersistedBlob; +} +/** + * @internal + */ +export interface UserCredentialInternal extends UserCredential, TaggedWithTokenResponse { + user: UserInternal; +} diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/auth_window.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/auth_window.d.ts new file mode 100644 index 0000000..b3087c7 --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/auth_window.d.ts @@ -0,0 +1,37 @@ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { Recaptcha, GreCAPTCHATopLevel } from './recaptcha/recaptcha'; +/** + * A specialized window type that melds the normal window type plus the + * various bits we need. The three different blocks that are &'d together + * cant be defined in the same block together. + */ +export type AuthWindow = { + [T in keyof Window]: Window[T]; +} & { + grecaptcha?: Recaptcha | GreCAPTCHATopLevel; + ___jsl?: Record; + gapi?: typeof gapi; +} & { + [callback: string]: (...args: unknown[]) => void; +}; +/** + * Lazy accessor for window, since the compat layer won't tree shake this out, + * we need to make sure not to mess with window unless we have to + */ +export declare function _window(): AuthWindow; +export declare function _setWindowLocation(url: string): void; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/iframe/gapi.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/iframe/gapi.d.ts new file mode 100644 index 0000000..c2a65cd --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/iframe/gapi.d.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright 2020 Google LLC. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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 { AuthInternal } from '../../model/auth'; +export declare function _loadGapi(auth: AuthInternal): Promise; +export declare function _resetLoader(): void; diff --git a/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/iframe/gapi.iframes.d.ts b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/iframe/gapi.iframes.d.ts new file mode 100644 index 0000000..9b5f24b --- /dev/null +++ b/frontend-old/node_modules/@firebase/auth/dist/node-esm/src/platform_browser/iframe/gapi.iframes.d.ts @@ -0,0 +1,47 @@ +/** + * @license + * Copyright 2020 Google LLC. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file 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. + */ +declare namespace gapi { + type LoadCallback = () => void; + interface LoadConfig { + } + interface LoadOptions { + callback?: LoadCallback; + timeout?: number; + ontimeout?: LoadCallback; + } + function load(features: 'gapi.iframes', options?: LoadOptions | LoadCallback): void; +} +declare namespace gapi.iframes { + interface Message { + type: string; + } + type IframesFilter = (iframe: Iframe) => boolean; + type MessageHandler = (message: T) => unknown | Promise; + type SendCallback = () => void; + type Callback = (iframe: Iframe) => void; + class Context { + open(options: Record, callback?: Callback): Promise