strapi-plugin-firebase-authentication 1.0.9 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +415 -191
  2. package/dist/_chunks/App-Bl6D4TFu.mjs +6197 -0
  3. package/dist/_chunks/App-HfsY_18f.js +6181 -0
  4. package/dist/_chunks/{api-4hcml0jk.mjs → api-B01IAVEC.mjs} +14 -3
  5. package/dist/_chunks/{api-DPtT1Bpu.js → api-BSejy8nn.js} +14 -3
  6. package/dist/_chunks/index-4hUrKd7Y.mjs +815 -0
  7. package/dist/_chunks/index-BbVqBI3M.js +859 -0
  8. package/dist/_chunks/index-BqF9RRVF.mjs +859 -0
  9. package/dist/_chunks/index-DgfRCyyQ.js +814 -0
  10. package/dist/admin/index.js +6 -1
  11. package/dist/admin/index.mjs +7 -2
  12. package/dist/admin/src/components/PasswordResetButton/PasswordResetButton.d.ts +11 -0
  13. package/dist/admin/src/components/PasswordResetButton/index.d.ts +1 -0
  14. package/dist/admin/src/components/common/Header/Header.d.ts +12 -0
  15. package/dist/admin/src/components/common/index.d.ts +3 -0
  16. package/dist/admin/src/components/forms/CreateUserForm/CreateUserForm.d.ts +2 -0
  17. package/dist/admin/src/components/forms/EditUserForm/EditUserForm.d.ts +6 -0
  18. package/dist/admin/src/components/forms/index.d.ts +4 -0
  19. package/dist/admin/src/components/forms/shared/UserFormFields/UserFormFields.d.ts +17 -0
  20. package/dist/admin/src/components/forms/shared/UserFormLayout/UserFormLayout.d.ts +7 -0
  21. package/dist/admin/src/components/index.d.ts +5 -0
  22. package/dist/admin/src/components/search/SearchURLQuery/SearchURLQuery.d.ts +6 -0
  23. package/dist/admin/src/components/search/index.d.ts +1 -0
  24. package/dist/admin/src/components/{DynamicTable → table/FirebaseTable}/FirebaseTable.d.ts +3 -2
  25. package/dist/admin/src/components/{DynamicTable → table}/FirebaseTableRows/FirebaseTableRows.d.ts +2 -2
  26. package/dist/admin/src/components/table/index.d.ts +3 -0
  27. package/dist/admin/src/components/user-management/ResetPassword/ResetPassword.d.ts +12 -0
  28. package/dist/admin/src/components/user-management/index.d.ts +2 -0
  29. package/dist/admin/src/hooks/useBulkSelection.d.ts +14 -0
  30. package/dist/admin/src/hooks/useUserForm.d.ts +18 -0
  31. package/dist/admin/src/pages/CreateView.d.ts +1 -0
  32. package/dist/admin/src/pages/EditView.d.ts +1 -0
  33. package/dist/admin/src/pages/ListView/index.d.ts +3 -5
  34. package/dist/admin/src/pages/Settings/api.d.ts +20 -1
  35. package/dist/admin/src/pages/utils/api.d.ts +4 -1
  36. package/dist/admin/src/utils/hasPasswordProvider.d.ts +15 -0
  37. package/dist/admin/src/utils/validation.d.ts +16 -0
  38. package/dist/model/Request.d.ts +2 -0
  39. package/dist/model/User.d.ts +6 -0
  40. package/dist/server/index.js +8466 -2851
  41. package/dist/server/index.mjs +8465 -2867
  42. package/dist/server/src/config/index.d.ts +36 -1
  43. package/dist/server/src/constants/index.d.ts +107 -0
  44. package/dist/server/src/content-types/index.d.ts +82 -0
  45. package/dist/server/src/controllers/firebaseController.d.ts +32 -2
  46. package/dist/server/src/controllers/index.d.ts +16 -10
  47. package/dist/server/src/controllers/settingsController.d.ts +2 -0
  48. package/dist/server/src/controllers/userController.d.ts +1 -0
  49. package/dist/server/src/index.d.ts +194 -27
  50. package/dist/server/src/migrations/migrate-firebase-user-data.d.ts +30 -0
  51. package/dist/server/src/routes/admin.d.ts +1 -1
  52. package/dist/server/src/routes/content-api.d.ts +1 -0
  53. package/dist/server/src/routes/content-internal-api.d.ts +1 -1
  54. package/dist/server/src/routes/index.d.ts +3 -2
  55. package/dist/server/src/routes/settingsRoutes.d.ts +1 -1
  56. package/dist/server/src/services/autoLinkService.d.ts +29 -0
  57. package/dist/server/src/services/emailService.d.ts +32 -0
  58. package/dist/server/src/services/firebaseService.d.ts +87 -13
  59. package/dist/server/src/services/firebaseStrapiLinkService.d.ts +34 -0
  60. package/dist/server/src/services/firebaseUserDataService.d.ts +26 -0
  61. package/dist/server/src/services/index.d.ts +91 -16
  62. package/dist/server/src/services/settingsService.d.ts +55 -0
  63. package/dist/server/src/services/templateService.d.ts +21 -0
  64. package/dist/server/src/services/userService.d.ts +2 -1
  65. package/dist/server/src/templates/defaults/index.d.ts +2 -0
  66. package/dist/server/src/templates/defaults/magic-link.d.ts +2 -0
  67. package/dist/server/src/templates/defaults/password-reset.d.ts +2 -0
  68. package/dist/server/src/templates/types.d.ts +30 -0
  69. package/dist/server/src/utils/fetch-me.d.ts +2 -10
  70. package/dist/server/src/utils/get-user-by-id.d.ts +1 -5
  71. package/dist/server/src/utils/users.d.ts +14 -0
  72. package/package.json +32 -22
  73. package/dist/_chunks/App-B2LtHk9g.js +0 -5062
  74. package/dist/_chunks/App-B3HcVa5j.mjs +0 -5081
  75. package/dist/_chunks/index-CALp4X47.mjs +0 -110
  76. package/dist/_chunks/index-CrGRt-Ya.mjs +0 -191
  77. package/dist/_chunks/index-DMBPEFUy.js +0 -109
  78. package/dist/_chunks/index-DmTKNKJB.js +0 -191
  79. package/dist/admin/src/components/SearchURLQuery/SearchURLQuery.d.ts +0 -18
  80. package/dist/admin/src/components/UserManagement/ResetPassword.d.ts +0 -8
  81. /package/dist/admin/src/components/{Initializer.d.ts → common/Initializer/Initializer.d.ts} +0 -0
  82. /package/dist/admin/src/components/{PluginIcon.d.ts → common/PluginIcon/PluginIcon.d.ts} +0 -0
  83. /package/dist/admin/src/components/{DynamicTable → table/FirebaseTable}/TableHeaders.d.ts +0 -0
  84. /package/dist/admin/src/components/{UserManagement → user-management/DeleteAccount}/DeleteAccount.d.ts +0 -0
@@ -1,3 +1,8 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-DMBPEFUy.js");
2
+ const index = require("../_chunks/index-DgfRCyyQ.js");
3
+ require("react/jsx-runtime");
4
+ require("@strapi/strapi/admin");
5
+ require("@strapi/design-system");
6
+ require("@strapi/icons");
7
+ require("react-router-dom");
3
8
  module.exports = index.index;
@@ -1,4 +1,9 @@
1
- import { i } from "../_chunks/index-CALp4X47.mjs";
1
+ import { p } from "../_chunks/index-4hUrKd7Y.mjs";
2
+ import "react/jsx-runtime";
3
+ import "@strapi/strapi/admin";
4
+ import "@strapi/design-system";
5
+ import "@strapi/icons";
6
+ import "react-router-dom";
2
7
  export {
3
- i as default
8
+ p as default
4
9
  };
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { User } from "../../../../model/User";
3
+ interface PasswordResetButtonProps {
4
+ user: User | null;
5
+ onClick?: () => void;
6
+ fullWidth?: boolean;
7
+ variant?: "default" | "secondary" | "tertiary" | "success" | "danger" | "success-light" | "danger-light";
8
+ size?: "S" | "M" | "L";
9
+ }
10
+ export declare const PasswordResetButton: React.FC<PasswordResetButtonProps>;
11
+ export default PasswordResetButton;
@@ -0,0 +1 @@
1
+ export { PasswordResetButton, default } from "./PasswordResetButton";
@@ -0,0 +1,12 @@
1
+ import { User } from "../../../../../model/User";
2
+ interface HeaderProps {
3
+ title: string;
4
+ onSave: () => void;
5
+ initialData: Partial<User> | null;
6
+ modifiedData: Partial<User> | null;
7
+ isCreatingEntry?: boolean;
8
+ isLoading?: boolean;
9
+ isSubmitButtonDisabled?: boolean;
10
+ }
11
+ export declare const Header: ({ title, onSave, initialData, modifiedData, isCreatingEntry, isLoading, isSubmitButtonDisabled, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,3 @@
1
+ export { Header } from "./Header/Header";
2
+ export { Initializer } from "./Initializer/Initializer";
3
+ export { PluginIcon } from "./PluginIcon/PluginIcon";
@@ -0,0 +1,2 @@
1
+ declare const CreateUserForm: () => import("react/jsx-runtime").JSX.Element;
2
+ export default CreateUserForm;
@@ -0,0 +1,6 @@
1
+ import { User } from "../../../../../model/User";
2
+ interface EditFormProps {
3
+ data: User;
4
+ }
5
+ declare const EditUserForm: ({ data }: EditFormProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default EditUserForm;
@@ -0,0 +1,4 @@
1
+ export { default as CreateUserForm } from "./CreateUserForm/CreateUserForm";
2
+ export { default as EditUserForm } from "./EditUserForm/EditUserForm";
3
+ export { UserFormFields } from "./shared/UserFormFields/UserFormFields";
4
+ export { UserFormLayout } from "./shared/UserFormLayout/UserFormLayout";
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import "react-phone-input-2/lib/style.css";
3
+ import { User } from "../../../../../../model/User";
4
+ interface UserFormFieldsProps {
5
+ userData: Partial<User>;
6
+ onTextInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
7
+ onPhoneChange: (value: string | undefined) => void;
8
+ onToggleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
9
+ onEmailBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
10
+ emailError: string | null;
11
+ phoneError: string | null;
12
+ showPasswordHint?: boolean;
13
+ isPasswordRequired?: boolean;
14
+ hasBeenTouched?: boolean;
15
+ }
16
+ export declare const UserFormFields: ({ userData, onTextInputChange, onPhoneChange, onToggleInputChange, onEmailBlur, emailError, phoneError, showPasswordHint, isPasswordRequired, hasBeenTouched, }: UserFormFieldsProps) => import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ interface UserFormLayoutProps {
3
+ children: React.ReactNode;
4
+ sidebar?: React.ReactNode;
5
+ }
6
+ export declare const UserFormLayout: ({ children, sidebar }: UserFormLayoutProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,5 @@
1
+ export * from "./common";
2
+ export * from "./forms";
3
+ export * from "./table";
4
+ export * from "./user-management";
5
+ export * from "./search";
@@ -0,0 +1,6 @@
1
+ interface SearchURLQuery {
2
+ label: string;
3
+ placeholder?: string;
4
+ }
5
+ declare const SearchURLQuery: ({ label, placeholder }: SearchURLQuery) => import("react/jsx-runtime").JSX.Element;
6
+ export { SearchURLQuery };
@@ -0,0 +1 @@
1
+ export { SearchURLQuery } from "./SearchURLQuery/SearchURLQuery";
@@ -1,12 +1,13 @@
1
1
  import React from "react";
2
- import { User } from "../../../../model/User";
2
+ import { User } from "../../../../../model/User";
3
3
  interface FirebaseTableProps {
4
4
  action: React.ReactNode;
5
+ createAction?: React.ReactNode;
5
6
  isLoading: boolean;
6
7
  rows: User[];
7
8
  onConfirmDeleteAll: (idsToDelete: Array<string | number>) => Promise<void>;
8
9
  onResetPasswordClick: (data: User) => void;
9
10
  onDeleteAccountClick: (data: User) => void;
10
11
  }
11
- export declare const FirebaseTable: ({ action, isLoading, rows, onConfirmDeleteAll, onResetPasswordClick, onDeleteAccountClick, }: FirebaseTableProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const FirebaseTable: ({ action, createAction, rows, onConfirmDeleteAll, onResetPasswordClick, onDeleteAccountClick, }: FirebaseTableProps) => import("react/jsx-runtime").JSX.Element;
12
13
  export {};
@@ -1,8 +1,8 @@
1
1
  import { User } from "../../../../../model/User";
2
2
  interface FirebaseTableRowsProps {
3
3
  rows: User[];
4
- entriesToDelete?: string[];
5
- onSelectRow?: ({ name, value }: {
4
+ entriesToDelete: string[];
5
+ onSelectRow: ({ name, value }: {
6
6
  name: string;
7
7
  value: boolean;
8
8
  }) => void;
@@ -0,0 +1,3 @@
1
+ export { FirebaseTable } from "./FirebaseTable/FirebaseTable";
2
+ export { tableHeaders } from "./FirebaseTable/TableHeaders";
3
+ export { FirebaseTableRows } from "./FirebaseTableRows/FirebaseTableRows";
@@ -0,0 +1,12 @@
1
+ interface ResetPasswordProps {
2
+ isOpen: boolean;
3
+ email: string;
4
+ userId: string;
5
+ onClose: () => void;
6
+ onDirectReset: (password: string) => Promise<void>;
7
+ onSendResetEmail: () => Promise<void>;
8
+ passwordRegex?: string;
9
+ passwordMessage?: string;
10
+ }
11
+ export declare const ResetPassword: ({ isOpen, email, userId, onClose, onDirectReset, onSendResetEmail, passwordRegex, passwordMessage, }: ResetPasswordProps) => import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,2 @@
1
+ export { DeleteAccount } from "./DeleteAccount/DeleteAccount";
2
+ export { ResetPassword } from "./ResetPassword/ResetPassword";
@@ -0,0 +1,14 @@
1
+ export interface UseBulkSelectionReturn {
2
+ selectedIds: Set<string>;
3
+ toggleSelectAll: () => void;
4
+ toggleSelectItem: (id: string) => void;
5
+ clearSelection: () => void;
6
+ isAllSelected: boolean;
7
+ isIndeterminate: boolean;
8
+ hasSelection: boolean;
9
+ selectedCount: number;
10
+ selectedArray: string[];
11
+ }
12
+ export declare const useBulkSelection: (items: Array<{
13
+ id: string;
14
+ }>) => UseBulkSelectionReturn;
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { User } from "../../../model/User";
3
+ interface UseUserFormReturn {
4
+ userData: Partial<User>;
5
+ setUserData: React.Dispatch<React.SetStateAction<Partial<User>>>;
6
+ emailError: string | null;
7
+ phoneError: string | null;
8
+ hasBeenTouched: boolean;
9
+ handlers: {
10
+ onTextInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
11
+ onEmailBlur: (e: React.FocusEvent<HTMLInputElement>) => void;
12
+ onPhoneChange: (value: string | undefined) => void;
13
+ onToggleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
14
+ };
15
+ isSubmitDisabled: boolean;
16
+ }
17
+ export declare const useUserForm: (initialData?: Partial<User>) => UseUserFormReturn;
18
+ export {};
@@ -0,0 +1 @@
1
+ export declare const CreateView: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const EditView: () => import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,8 @@
1
- import React from "react";
2
1
  import { User } from "../../../../model/User";
3
2
  import { ResponseMeta } from "../../../../model/Meta";
4
3
  interface ListViewProps {
5
- data: User[];
6
- meta: ResponseMeta;
4
+ data?: User[];
5
+ meta?: ResponseMeta;
7
6
  }
8
7
  declare function ListView({ data, meta }: ListViewProps): import("react/jsx-runtime").JSX.Element;
9
- declare const _default: React.MemoExoticComponent<typeof ListView>;
10
- export default _default;
8
+ export default ListView;
@@ -1,4 +1,23 @@
1
1
  export declare const restartServer: () => Promise<void>;
2
- export declare const saveFirebaseConfig: (json: string) => Promise<any>;
2
+ export declare const saveFirebaseConfig: (json: string, firebaseWebApiKey?: string, passwordConfig?: {
3
+ passwordRequirementsRegex?: string;
4
+ passwordRequirementsMessage?: string;
5
+ passwordResetUrl?: string;
6
+ passwordResetEmailSubject?: string;
7
+ enableMagicLink?: boolean;
8
+ magicLinkUrl?: string;
9
+ magicLinkEmailSubject?: string;
10
+ magicLinkExpiryHours?: number;
11
+ }) => Promise<any>;
3
12
  export declare const getFirebaseConfig: () => Promise<any>;
4
13
  export declare const delFirebaseConfig: () => Promise<any>;
14
+ export declare const savePasswordSettings: (passwordConfig: {
15
+ passwordRequirementsRegex?: string;
16
+ passwordRequirementsMessage?: string;
17
+ passwordResetUrl?: string;
18
+ passwordResetEmailSubject?: string;
19
+ enableMagicLink?: boolean;
20
+ magicLinkUrl?: string;
21
+ magicLinkEmailSubject?: string;
22
+ magicLinkExpiryHours?: number;
23
+ }) => Promise<any>;
@@ -31,4 +31,7 @@ declare const updateUser: (idToUpdate: string, payload: User) => Promise<any>;
31
31
  declare const resetUserPassword: (idToUpdate: string, payload: {
32
32
  password: string;
33
33
  }) => Promise<any>;
34
- export { fetchUsers, fetchUserByID, deleteUser, updateUser, createUser, fetchStrapiUsers, fetchStrapiUserById, resetUserPassword, };
34
+ declare const sendResetEmail: (userId: string) => Promise<any>;
35
+ declare const getFirebaseConfig: () => Promise<any>;
36
+ declare const sendPasswordResetEmail: (userId: string) => Promise<any>;
37
+ export { fetchUsers, fetchUserByID, deleteUser, updateUser, createUser, fetchStrapiUsers, fetchStrapiUserById, resetUserPassword, sendResetEmail, getFirebaseConfig, sendPasswordResetEmail, };
@@ -0,0 +1,15 @@
1
+ import { User } from "../../../model/User";
2
+ /**
3
+ * Checks if a Firebase user has password authentication enabled
4
+ *
5
+ * @param user - Firebase user object or null
6
+ * @returns true if user has password provider, false otherwise
7
+ */
8
+ export declare const hasPasswordProvider: (user: User | null) => boolean;
9
+ /**
10
+ * Gets tooltip text explaining why password reset is disabled
11
+ *
12
+ * @param user - Firebase user object or null
13
+ * @returns Tooltip text explaining the disabled state
14
+ */
15
+ export declare const getPasswordResetTooltip: (user: User | null) => string;
@@ -0,0 +1,16 @@
1
+ export declare function validateEmail(email: string | null | undefined): {
2
+ isValid: boolean;
3
+ error: string | null;
4
+ };
5
+ export declare function validatePhoneNumber(phone: string | null | undefined): {
6
+ isValid: boolean;
7
+ error: string | null;
8
+ };
9
+ export declare function validateUserForm(email?: string, phoneNumber?: string): {
10
+ isValid: boolean;
11
+ errors: {
12
+ email?: string;
13
+ phoneNumber?: string;
14
+ general?: string;
15
+ };
16
+ };
@@ -2,4 +2,6 @@ export interface Query {
2
2
  page?: number;
3
3
  pageSize?: number;
4
4
  nextPageToken?: string;
5
+ sort?: string;
6
+ search?: string;
5
7
  }
@@ -25,7 +25,9 @@ export interface FirebaseUser {
25
25
  }
26
26
  export interface StrapiUser {
27
27
  strapiId: string;
28
+ strapiDocumentId?: string;
28
29
  id: string;
30
+ documentId?: string;
29
31
  username: string;
30
32
  email: string;
31
33
  password: string | null;
@@ -40,5 +42,9 @@ export interface StrapiUser {
40
42
  appleEmail: string | null;
41
43
  createdAt: string;
42
44
  firebaseUserID: string;
45
+ phoneNumber?: string;
46
+ displayName?: string;
47
+ firstName?: string;
48
+ lastName?: string;
43
49
  }
44
50
  export type User = FirebaseUser & StrapiUser;