UNPKG

strapi-plugin-firebase-authentication

Version:

Allows easy integration between clients utilizing Firebase for authentication and Strapi

108 lines (107 loc) 3.63 kB
/** * Constants for Firebase Authentication Plugin * This file centralizes all magic strings and configuration defaults */ export declare const PLUGIN_NAME = "firebase-authentication"; export declare const PLUGIN_UID = "plugin::firebase-authentication"; export declare const CONFIG_CONTENT_TYPE = "plugin::firebase-authentication.firebase-authentication-configuration"; export declare const USER_CONTENT_TYPE = "plugin::users-permissions.user"; export declare const USER_PERMISSIONS_PLUGIN = "users-permissions"; export declare const DEFAULT_PASSWORD_RESET_URL = "http://localhost:3000/reset-password"; export declare const DEFAULT_PASSWORD_REGEX = "^.{6,}$"; export declare const DEFAULT_PASSWORD_MESSAGE = "Password must be at least 6 characters long"; export declare const DEFAULT_EMAIL_PATTERN = "{randomString}@phone-user.firebase.local"; export declare const DEFAULT_RESET_EMAIL_SUBJECT = "Reset Your Password"; export declare const API_PREFIX = "/api/firebase-authentication"; export declare const FIREBASE_AUTH_URL = "https://identitytoolkit.googleapis.com/v1/accounts"; export declare const ERROR_MESSAGES: { FIREBASE_NOT_INITIALIZED: string; INVALID_JSON: string; MISSING_DATA: string; SOMETHING_WENT_WRONG: string; AUTHENTICATION_FAILED: string; TOKEN_MISSING: string; EMAIL_PASSWORD_REQUIRED: string; PASSWORD_REQUIRED: string; AUTHORIZATION_REQUIRED: string; INVALID_TOKEN: string; USER_NOT_FOUND: string; USER_NO_EMAIL: string; FIREBASE_LINK_FAILED: string; CONFIG_NOT_FOUND: string; INVALID_SERVICE_ACCOUNT: string; WEB_API_NOT_CONFIGURED: string; RESET_URL_NOT_CONFIGURED: string; RESET_URL_MUST_BE_HTTPS: string; RESET_URL_INVALID_FORMAT: string; USER_NOT_LINKED_FIREBASE: string; OVERRIDE_USER_ID_REQUIRED: string; EITHER_EMAIL_OR_PHONE_REQUIRED: string; DELETION_NO_CONFIG: string; }; export declare const SUCCESS_MESSAGES: { FIREBASE_INITIALIZED: string; FIREBASE_CONFIG_DELETED: string; PASSWORD_RESET_EMAIL_SENT: string; SERVER_RESTARTING: string; }; export declare const CONFIG_KEYS: { ENCRYPTION_KEY: string; }; export declare const FIELD_NAMES: { FIREBASE_CONFIG_JSON: string; FIREBASE_WEB_API_KEY: string; PASSWORD_REGEX: string; PASSWORD_MESSAGE: string; PASSWORD_RESET_URL: string; PASSWORD_RESET_EMAIL_SUBJECT: string; }; export declare const LOG_LEVELS: { DEBUG: string; INFO: string; WARN: string; ERROR: string; }; export declare const USER_ROLES: { DEFAULT_TYPE: string; }; export declare const TIME_CONSTANTS: { JWT_EXPIRY: string; EMAIL_TIMEOUT_MS: number; FIREBASE_TIMEOUT_MS: number; }; export declare const FIREBASE_ERROR_CODES: { EMAIL_NOT_FOUND: string; INVALID_PASSWORD: string; USER_DISABLED: string; INVALID_EMAIL: string; USER_NOT_FOUND: string; }; export declare const FIREBASE_USER_ERROR_MESSAGES: { EMAIL_NOT_FOUND: string; INVALID_PASSWORD: string; USER_DISABLED: string; INVALID_EMAIL: string; INVALID_LOGIN_CREDENTIALS: string; }; export declare const REQUIRED_FIELDS: { SERVICE_ACCOUNT: string[]; WEB_CONFIG: string[]; }; export declare const VALIDATION_MESSAGES: { INVALID_SERVICE_ACCOUNT: string; WRONG_JSON_TYPE: string; SERVICE_ACCOUNT_HELP: string; }; export declare const EMAIL_PATTERNS: { APPLE_RELAY: string; }; export declare const REGEX_PATTERNS: { PHONE_NUMBER: RegExp; STRAPI_ID: RegExp; PHONE_PREFIX: RegExp; }; export declare const MAX_RETRIES: { EMAIL_GENERATION: number; USERNAME_GENERATION: number; };