strapi-plugin-firebase-authentication 1.0.13 → 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 +6564 -931
  41. package/dist/server/index.mjs +6518 -902
  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,5 +1,25 @@
1
1
  /**
2
- * Config for Gen Types Plugin
2
+ * Config for Firebase Authentication Plugin
3
+ *
4
+ * Available email pattern tokens for phone-only users:
5
+ *
6
+ * {randomString} - Generates 8-character random alphanumeric string (lowercase)
7
+ * Example: "a1b2c3d4"
8
+ *
9
+ * {phoneNumber} - Extracts digits from phone number
10
+ * Example: "+1-234-567-8900" → "12345678900"
11
+ *
12
+ * {timestamp} - Current Unix timestamp in milliseconds
13
+ * Example: "1704067200000"
14
+ *
15
+ * Pattern Examples:
16
+ * - "{randomString}@phone-user.firebase.local" → "a1b2c3d4@phone-user.firebase.local"
17
+ * - "phone_{phoneNumber}@myapp.local" → "phone_12345678900@myapp.local"
18
+ * - "user_{timestamp}@temp.local" → "user_1704067200000@temp.local"
19
+ * - "{phoneNumber}_{randomString}@app.com" → "12345678900_a1b2c3d4@app.com"
20
+ *
21
+ * IMPORTANT: Pattern must include at least one of {randomString} or {timestamp}
22
+ * to ensure uniqueness across multiple users.
3
23
  */
4
24
  export type FirebaseAuthConfig = {
5
25
  /**
@@ -8,12 +28,27 @@ export type FirebaseAuthConfig = {
8
28
  * @default 'your-key-here'
9
29
  */
10
30
  firebaseJsonEncryptionKey: string;
31
+ /**
32
+ * Whether to generate dummy emails for phone-only users
33
+ *
34
+ * @default true
35
+ */
36
+ emailRequired?: boolean;
37
+ /**
38
+ * Template pattern for generating dummy emails
39
+ * Must include {randomString} or {timestamp} for uniqueness
40
+ *
41
+ * @default '{randomString}@phone-user.firebase.local'
42
+ */
43
+ emailPattern?: string;
11
44
  };
12
45
  declare const _default: {
13
46
  default: ({ env }: {
14
47
  env: any;
15
48
  }) => {
16
49
  firebaseJsonEncryptionKey: any;
50
+ emailRequired: boolean;
51
+ emailPattern: string;
17
52
  };
18
53
  validator(config: FirebaseAuthConfig): void;
19
54
  };
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Constants for Firebase Authentication Plugin
3
+ * This file centralizes all magic strings and configuration defaults
4
+ */
5
+ export declare const PLUGIN_NAME = "firebase-authentication";
6
+ export declare const PLUGIN_UID = "plugin::firebase-authentication";
7
+ export declare const CONFIG_CONTENT_TYPE = "plugin::firebase-authentication.firebase-authentication-configuration";
8
+ export declare const USER_CONTENT_TYPE = "plugin::users-permissions.user";
9
+ export declare const USER_PERMISSIONS_PLUGIN = "users-permissions";
10
+ export declare const DEFAULT_PASSWORD_RESET_URL = "http://localhost:3000/reset-password";
11
+ export declare const DEFAULT_PASSWORD_REGEX = "^.{6,}$";
12
+ export declare const DEFAULT_PASSWORD_MESSAGE = "Password must be at least 6 characters long";
13
+ export declare const DEFAULT_EMAIL_PATTERN = "{randomString}@phone-user.firebase.local";
14
+ export declare const DEFAULT_RESET_EMAIL_SUBJECT = "Reset Your Password";
15
+ export declare const API_PREFIX = "/api/firebase-authentication";
16
+ export declare const FIREBASE_AUTH_URL = "https://identitytoolkit.googleapis.com/v1/accounts";
17
+ export declare const ERROR_MESSAGES: {
18
+ FIREBASE_NOT_INITIALIZED: string;
19
+ INVALID_JSON: string;
20
+ MISSING_DATA: string;
21
+ SOMETHING_WENT_WRONG: string;
22
+ AUTHENTICATION_FAILED: string;
23
+ TOKEN_MISSING: string;
24
+ EMAIL_PASSWORD_REQUIRED: string;
25
+ PASSWORD_REQUIRED: string;
26
+ AUTHORIZATION_REQUIRED: string;
27
+ INVALID_TOKEN: string;
28
+ USER_NOT_FOUND: string;
29
+ USER_NO_EMAIL: string;
30
+ FIREBASE_LINK_FAILED: string;
31
+ CONFIG_NOT_FOUND: string;
32
+ INVALID_SERVICE_ACCOUNT: string;
33
+ WEB_API_NOT_CONFIGURED: string;
34
+ RESET_URL_NOT_CONFIGURED: string;
35
+ RESET_URL_MUST_BE_HTTPS: string;
36
+ RESET_URL_INVALID_FORMAT: string;
37
+ USER_NOT_LINKED_FIREBASE: string;
38
+ OVERRIDE_USER_ID_REQUIRED: string;
39
+ EITHER_EMAIL_OR_PHONE_REQUIRED: string;
40
+ DELETION_NO_CONFIG: string;
41
+ };
42
+ export declare const SUCCESS_MESSAGES: {
43
+ FIREBASE_INITIALIZED: string;
44
+ FIREBASE_CONFIG_DELETED: string;
45
+ PASSWORD_RESET_EMAIL_SENT: string;
46
+ SERVER_RESTARTING: string;
47
+ };
48
+ export declare const CONFIG_KEYS: {
49
+ ENCRYPTION_KEY: string;
50
+ };
51
+ export declare const FIELD_NAMES: {
52
+ FIREBASE_CONFIG_JSON: string;
53
+ FIREBASE_WEB_API_KEY: string;
54
+ PASSWORD_REGEX: string;
55
+ PASSWORD_MESSAGE: string;
56
+ PASSWORD_RESET_URL: string;
57
+ PASSWORD_RESET_EMAIL_SUBJECT: string;
58
+ };
59
+ export declare const LOG_LEVELS: {
60
+ DEBUG: string;
61
+ INFO: string;
62
+ WARN: string;
63
+ ERROR: string;
64
+ };
65
+ export declare const USER_ROLES: {
66
+ DEFAULT_TYPE: string;
67
+ };
68
+ export declare const TIME_CONSTANTS: {
69
+ JWT_EXPIRY: string;
70
+ EMAIL_TIMEOUT_MS: number;
71
+ FIREBASE_TIMEOUT_MS: number;
72
+ };
73
+ export declare const FIREBASE_ERROR_CODES: {
74
+ EMAIL_NOT_FOUND: string;
75
+ INVALID_PASSWORD: string;
76
+ USER_DISABLED: string;
77
+ INVALID_EMAIL: string;
78
+ USER_NOT_FOUND: string;
79
+ };
80
+ export declare const FIREBASE_USER_ERROR_MESSAGES: {
81
+ EMAIL_NOT_FOUND: string;
82
+ INVALID_PASSWORD: string;
83
+ USER_DISABLED: string;
84
+ INVALID_EMAIL: string;
85
+ INVALID_LOGIN_CREDENTIALS: string;
86
+ };
87
+ export declare const REQUIRED_FIELDS: {
88
+ SERVICE_ACCOUNT: string[];
89
+ WEB_CONFIG: string[];
90
+ };
91
+ export declare const VALIDATION_MESSAGES: {
92
+ INVALID_SERVICE_ACCOUNT: string;
93
+ WRONG_JSON_TYPE: string;
94
+ SERVICE_ACCOUNT_HELP: string;
95
+ };
96
+ export declare const EMAIL_PATTERNS: {
97
+ APPLE_RELAY: string;
98
+ };
99
+ export declare const REGEX_PATTERNS: {
100
+ PHONE_NUMBER: RegExp;
101
+ STRAPI_ID: RegExp;
102
+ PHONE_PREFIX: RegExp;
103
+ };
104
+ export declare const MAX_RETRIES: {
105
+ EMAIL_GENERATION: number;
106
+ USERNAME_GENERATION: number;
107
+ };
@@ -23,6 +23,88 @@ declare const _default: {
23
23
  firebase_config_json: {
24
24
  type: string;
25
25
  };
26
+ firebase_web_api_key: {
27
+ type: string;
28
+ required: boolean;
29
+ configurable: boolean;
30
+ description: string;
31
+ };
32
+ passwordRequirementsRegex: {
33
+ type: string;
34
+ default: string;
35
+ };
36
+ passwordRequirementsMessage: {
37
+ type: string;
38
+ default: string;
39
+ };
40
+ passwordResetUrl: {
41
+ type: string;
42
+ default: string;
43
+ };
44
+ passwordResetEmailSubject: {
45
+ type: string;
46
+ default: string;
47
+ };
48
+ enableMagicLink: {
49
+ type: string;
50
+ default: boolean;
51
+ description: string;
52
+ };
53
+ magicLinkUrl: {
54
+ type: string;
55
+ default: string;
56
+ description: string;
57
+ };
58
+ magicLinkEmailSubject: {
59
+ type: string;
60
+ default: string;
61
+ };
62
+ magicLinkExpiryHours: {
63
+ type: string;
64
+ default: number;
65
+ minimum: number;
66
+ maximum: number;
67
+ description: string;
68
+ };
69
+ };
70
+ };
71
+ };
72
+ "firebase-user-data": {
73
+ schema: {
74
+ kind: string;
75
+ collectionName: string;
76
+ info: {
77
+ singularName: string;
78
+ pluralName: string;
79
+ displayName: string;
80
+ description: string;
81
+ };
82
+ options: {
83
+ draftAndPublish: boolean;
84
+ };
85
+ pluginOptions: {
86
+ "content-manager": {
87
+ visible: boolean;
88
+ };
89
+ "content-type-builder": {
90
+ visible: boolean;
91
+ };
92
+ };
93
+ attributes: {
94
+ user: {
95
+ type: string;
96
+ relation: string;
97
+ target: string;
98
+ };
99
+ firebaseUserID: {
100
+ type: string;
101
+ unique: boolean;
102
+ required: boolean;
103
+ };
104
+ appleEmail: {
105
+ type: string;
106
+ private: boolean;
107
+ };
26
108
  };
27
109
  };
28
110
  };
@@ -1,7 +1,37 @@
1
+ import { Context } from "koa";
1
2
  declare const firebaseController: {
2
- validateToken(ctx: any): Promise<void>;
3
+ validateToken(ctx: any): Promise<any>;
3
4
  createAlias(ctx: any): Promise<void>;
4
5
  deleteByEmail(email: any): Promise<any>;
5
- overrideAccess(ctx: any): Promise<void>;
6
+ overrideAccess(ctx: any): Promise<any>;
7
+ /**
8
+ * Controller method for email/password authentication
9
+ * Handles the `/api/firebase-authentication/emailLogin` endpoint
10
+ *
11
+ * @param ctx - Koa context object
12
+ * @returns Promise that sets ctx.body with user data and JWT or error message
13
+ *
14
+ * @remarks
15
+ * This controller acts as a proxy to Firebase's Identity Toolkit API,
16
+ * allowing users to authenticate with email/password and receive a Strapi JWT.
17
+ *
18
+ * HTTP Status Codes:
19
+ * - `400`: Validation errors (missing credentials, invalid email/password)
20
+ * - `500`: Server errors (missing configuration, Firebase API issues)
21
+ */
22
+ emailLogin(ctx: any): Promise<void>;
23
+ /**
24
+ * Forgot password - sends reset email
25
+ * POST /api/firebase-authentication/forgotPassword
26
+ * Public endpoint - no authentication required
27
+ */
28
+ forgotPassword(ctx: any): Promise<void>;
29
+ /**
30
+ * Reset password - authenticated with 1hr JWT
31
+ * POST /api/firebase-authentication/resetPassword
32
+ * Public endpoint - uses JWT from Authorization header
33
+ */
34
+ resetPassword(ctx: any): Promise<void>;
35
+ requestMagicLink(ctx: Context): Promise<void>;
6
36
  };
7
37
  export default firebaseController;
@@ -1,26 +1,32 @@
1
- /// <reference types="koa" />
2
1
  declare const _default: {
3
2
  firebaseController: {
4
- validateToken(ctx: any): Promise<void>;
3
+ validateToken(ctx: any): Promise<any>;
5
4
  createAlias(ctx: any): Promise<void>;
6
5
  deleteByEmail(email: any): Promise<any>;
7
- overrideAccess(ctx: any): Promise<void>;
6
+ overrideAccess(ctx: any): Promise<any>;
7
+ emailLogin(ctx: any): Promise<void>;
8
+ forgotPassword(ctx: any): Promise<void>;
9
+ resetPassword(ctx: any): Promise<void>;
10
+ requestMagicLink(ctx: import("koa").Context): Promise<void>;
8
11
  };
9
12
  userController: {
10
- list: (ctx: import("koa").DefaultContext | import("koa").Context) => Promise<void>;
13
+ list: (ctx: import("koa").Context | import("koa").DefaultContext) => Promise<void>;
11
14
  create: (ctx: any) => Promise<void>;
12
15
  get: (ctx: any) => Promise<void>;
13
16
  update: (ctx: any) => Promise<void>;
14
- delete: (ctx: import("koa").DefaultContext | import("koa").Context) => Promise<void>;
17
+ delete: (ctx: import("koa").Context | import("koa").DefaultContext) => Promise<void>;
15
18
  deleteMany: (ctx: any) => Promise<void>;
16
19
  resetPassword: (ctx: any) => Promise<void>;
20
+ sendResetEmail: (ctx: any) => Promise<void>;
17
21
  };
18
22
  settingsController: {
19
- setToken: (ctx: import("koa").DefaultContext | import("koa").Context) => Promise<void>;
20
- setFirebaseConfigJson: (ctx: import("koa").DefaultContext | import("koa").Context) => Promise<void>;
21
- getFirebaseConfigJson: (ctx: import("koa").DefaultContext | import("koa").Context) => Promise<any>;
22
- delFirebaseConfigJson(ctx: import("koa").DefaultContext | import("koa").Context): Promise<void>;
23
- restart(ctx: import("koa").DefaultContext | import("koa").Context): Promise<any>;
23
+ setToken: (ctx: import("koa").Context | import("koa").DefaultContext) => Promise<void>;
24
+ setFirebaseConfigJson: (ctx: import("koa").Context | import("koa").DefaultContext) => Promise<void>;
25
+ getFirebaseConfigJson: (ctx: import("koa").Context | import("koa").DefaultContext) => Promise<any>;
26
+ delFirebaseConfigJson(ctx: import("koa").Context | import("koa").DefaultContext): Promise<void>;
27
+ restart(ctx: import("koa").Context | import("koa").DefaultContext): Promise<any>;
28
+ getPublicConfig(ctx: import("koa").Context | import("koa").DefaultContext): Promise<any>;
29
+ savePasswordConfig(ctx: import("koa").Context | import("koa").DefaultContext): Promise<void>;
24
30
  };
25
31
  };
26
32
  export default _default;
@@ -5,5 +5,7 @@ declare const _default: {
5
5
  getFirebaseConfigJson: (ctx: DefaultContext | Context) => Promise<any>;
6
6
  delFirebaseConfigJson(ctx: DefaultContext | Context): Promise<void>;
7
7
  restart(ctx: DefaultContext | Context): Promise<any>;
8
+ getPublicConfig(ctx: DefaultContext | Context): Promise<any>;
9
+ savePasswordConfig(ctx: DefaultContext | Context): Promise<void>;
8
10
  };
9
11
  export default _default;
@@ -7,5 +7,6 @@ declare const _default: {
7
7
  delete: (ctx: DefaultContext | Context) => Promise<void>;
8
8
  deleteMany: (ctx: any) => Promise<void>;
9
9
  resetPassword: (ctx: any) => Promise<void>;
10
+ sendResetEmail: (ctx: any) => Promise<void>;
10
11
  };
11
12
  export default _default;
@@ -1,4 +1,4 @@
1
- /// <reference types="koa" />
1
+ /// <reference types="lodash" />
2
2
  declare const _default: {
3
3
  register: ({ strapi }: {
4
4
  strapi: import("@strapi/types/dist/core").Strapi;
@@ -14,31 +14,40 @@ declare const _default: {
14
14
  env: any;
15
15
  }) => {
16
16
  firebaseJsonEncryptionKey: any;
17
+ emailRequired: boolean;
18
+ emailPattern: string;
17
19
  };
18
20
  validator(config: import("./config").FirebaseAuthConfig): void;
19
21
  };
20
22
  controllers: {
21
23
  firebaseController: {
22
- validateToken(ctx: any): Promise<void>;
24
+ validateToken(ctx: any): Promise<any>;
23
25
  createAlias(ctx: any): Promise<void>;
24
26
  deleteByEmail(email: any): Promise<any>;
25
- overrideAccess(ctx: any): Promise<void>;
27
+ overrideAccess(ctx: any): Promise<any>;
28
+ emailLogin(ctx: any): Promise<void>;
29
+ forgotPassword(ctx: any): Promise<void>;
30
+ resetPassword(ctx: any): Promise<void>;
31
+ requestMagicLink(ctx: import("koa").Context): Promise<void>;
26
32
  };
27
33
  userController: {
28
- list: (ctx: import("koa").DefaultContext | import("koa").Context) => Promise<void>;
34
+ list: (ctx: import("koa").Context | import("koa").DefaultContext) => Promise<void>;
29
35
  create: (ctx: any) => Promise<void>;
30
36
  get: (ctx: any) => Promise<void>;
31
37
  update: (ctx: any) => Promise<void>;
32
- delete: (ctx: import("koa").DefaultContext | import("koa").Context) => Promise<void>;
38
+ delete: (ctx: import("koa").Context | import("koa").DefaultContext) => Promise<void>;
33
39
  deleteMany: (ctx: any) => Promise<void>;
34
40
  resetPassword: (ctx: any) => Promise<void>;
41
+ sendResetEmail: (ctx: any) => Promise<void>;
35
42
  };
36
43
  settingsController: {
37
- setToken: (ctx: import("koa").DefaultContext | import("koa").Context) => Promise<void>;
38
- setFirebaseConfigJson: (ctx: import("koa").DefaultContext | import("koa").Context) => Promise<void>;
39
- getFirebaseConfigJson: (ctx: import("koa").DefaultContext | import("koa").Context) => Promise<any>;
40
- delFirebaseConfigJson(ctx: import("koa").DefaultContext | import("koa").Context): Promise<void>;
41
- restart(ctx: import("koa").DefaultContext | import("koa").Context): Promise<any>;
44
+ setToken: (ctx: import("koa").Context | import("koa").DefaultContext) => Promise<void>;
45
+ setFirebaseConfigJson: (ctx: import("koa").Context | import("koa").DefaultContext) => Promise<void>;
46
+ getFirebaseConfigJson: (ctx: import("koa").Context | import("koa").DefaultContext) => Promise<any>;
47
+ delFirebaseConfigJson(ctx: import("koa").Context | import("koa").DefaultContext): Promise<void>;
48
+ restart(ctx: import("koa").Context | import("koa").DefaultContext): Promise<any>;
49
+ getPublicConfig(ctx: import("koa").Context | import("koa").DefaultContext): Promise<any>;
50
+ savePasswordConfig(ctx: import("koa").Context | import("koa").DefaultContext): Promise<void>;
42
51
  };
43
52
  };
44
53
  routes: {
@@ -49,7 +58,7 @@ declare const _default: {
49
58
  path: string;
50
59
  handler: string;
51
60
  config: {
52
- policies: any[];
61
+ policies: string[];
53
62
  };
54
63
  }[];
55
64
  };
@@ -60,6 +69,7 @@ declare const _default: {
60
69
  path: string;
61
70
  handler: string;
62
71
  config: {
72
+ auth: boolean;
63
73
  policies: any[];
64
74
  };
65
75
  }[];
@@ -70,7 +80,7 @@ declare const _default: {
70
80
  path: string;
71
81
  handler: string;
72
82
  config: {
73
- policies: any[];
83
+ policies: string[];
74
84
  };
75
85
  }[];
76
86
  };
@@ -82,9 +92,24 @@ declare const _default: {
82
92
  init(): Promise<void>;
83
93
  getFirebaseConfigJson(): Promise<{
84
94
  firebaseConfigJson: any;
95
+ firebaseWebApiKey: any;
96
+ passwordRequirementsRegex: any;
97
+ passwordRequirementsMessage: any;
98
+ passwordResetUrl: any;
99
+ passwordResetEmailSubject: any;
100
+ enableMagicLink: any;
101
+ magicLinkUrl: any;
102
+ magicLinkEmailSubject: any;
103
+ magicLinkExpiryHours: any;
85
104
  }>;
86
- setFirebaseConfigJson(ctx: import("koa").DefaultContext | import("koa").Context): Promise<any>;
105
+ setFirebaseConfigJson(ctx: import("koa").Context | import("koa").DefaultContext): Promise<any>;
87
106
  delFirebaseConfigJson: () => Promise<any>;
107
+ updateMagicLinkSettings(settings: any): Promise<{
108
+ enableMagicLink: any;
109
+ magicLinkUrl: any;
110
+ magicLinkEmailSubject: any;
111
+ magicLinkExpiryHours: any;
112
+ }>;
88
113
  encryptJson(key: string, json: string): Promise<any>;
89
114
  decryptJson(key: string, hash: string): Promise<any>;
90
115
  restart(): Promise<void>;
@@ -95,7 +120,7 @@ declare const _default: {
95
120
  get: (entityId: string) => Promise<any>;
96
121
  create: (payload: any) => Promise<any>;
97
122
  register: (userID: any, payload: any) => Promise<void>;
98
- list: (pagination: any, nextPageToken: any) => Promise<{
123
+ list: (pagination: any, nextPageToken: any, sort: any, searchQuery: any) => Promise<{
99
124
  data: any;
100
125
  pageToken: any;
101
126
  meta: {
@@ -112,6 +137,7 @@ declare const _default: {
112
137
  deleteStrapiUser: (entityId: any) => Promise<any>;
113
138
  deleteMany: (entityIDs: any) => Promise<any>;
114
139
  setSocialMetaData(): Promise<void>;
140
+ sendPasswordResetEmail: (entityId: any) => Promise<any>;
115
141
  };
116
142
  firebaseService: ({ strapi }: {
117
143
  strapi: any;
@@ -122,26 +148,85 @@ declare const _default: {
122
148
  }>;
123
149
  validateExchangeTokenPayload: (requestPayload: any) => Promise<any>;
124
150
  decodeIDToken: (idToken: any) => Promise<any>;
125
- overrideFirebaseAccess: (ctx: any) => Promise<any>;
151
+ overrideFirebaseAccess: (overrideUserId: string, populate?: string[]) => Promise<{
152
+ user: any;
153
+ jwt: any;
154
+ }>;
126
155
  checkIfUserExists(decodedToken: any): Promise<any>;
127
156
  fetchUser: (decodedToken: any) => Promise<any>;
128
157
  generateJWTForCurrentUser: (user: any) => Promise<any>;
129
158
  createStrapiUser(decodedToken: any, idToken: any, profileMetaData: any): Promise<any>;
130
- updateUserIDToken: (user: any, idToken: any, decodedToken: any) => Promise<any>;
131
- validateFirebaseToken: (ctx: any) => Promise<{
132
- error: any;
133
- user?: undefined;
134
- jwt?: undefined;
135
- } | {
136
- user: {
137
- id: import("@strapi/types/dist/data").ID;
138
- } & {
139
- [key: string]: any;
140
- };
159
+ validateFirebaseToken: (idToken: string, profileMetaData?: any, populate?: string[]) => Promise<{
160
+ user: any;
161
+ jwt: any;
162
+ }>;
163
+ emailLogin: (email: string, password: string, populate?: string[]) => Promise<{
164
+ user: any;
141
165
  jwt: any;
142
- error?: undefined;
166
+ }>;
167
+ forgotPassword: (ctx: any) => Promise<{
168
+ message: string;
169
+ }>;
170
+ resetPassword: (ctx: any) => Promise<{
171
+ user: any;
172
+ jwt: any;
173
+ }>;
174
+ requestMagicLink(ctx: any): Promise<{
175
+ debug: {
176
+ linkSent: any;
177
+ email: string;
178
+ message: any;
179
+ };
180
+ success: boolean;
181
+ message: string;
182
+ requiresFrontend: boolean;
183
+ verificationUrl: any;
184
+ } | {
185
+ success: boolean;
186
+ message: string;
187
+ requiresFrontend: boolean;
188
+ verificationUrl: any;
143
189
  }>;
144
190
  };
191
+ templateService: ({ strapi }: {
192
+ strapi: any;
193
+ }) => {
194
+ getTemplate(templateType: import("./templates/types").TemplateType): Promise<import("./templates/types").EmailTemplate>;
195
+ compileTemplate(templateString: string): import("lodash").TemplateExecutor;
196
+ validateVariables(variables: Partial<import("./templates/types").TemplateVariables>, required: string[]): void;
197
+ };
198
+ emailService: ({ strapi }: {
199
+ strapi: any;
200
+ }) => {
201
+ sendTemplatedEmail(to: string, templateType: import("./templates/types").TemplateType, variables: Partial<import("./templates/types").TemplateVariables>): Promise<void>;
202
+ sendPasswordResetEmail(user: any, resetLink: string): Promise<{
203
+ success: boolean;
204
+ message: string;
205
+ }>;
206
+ sendMagicLinkEmail(email: string, magicLink: string, config: any): Promise<{
207
+ success: boolean;
208
+ message: string;
209
+ }>;
210
+ };
211
+ firebaseUserDataService: ({ strapi }: {
212
+ strapi: any;
213
+ }) => {
214
+ findOrCreateForUser(userId: string): Promise<any>;
215
+ getByFirebaseUID(firebaseUID: string): Promise<any>;
216
+ updateForUser(userId: string, data: {
217
+ firebaseUserID?: string;
218
+ appleEmail?: string;
219
+ }): Promise<any>;
220
+ };
221
+ autoLinkService: {
222
+ linkAllUsers(strapi: import("@strapi/types/dist/core").Strapi): Promise<import("./services/autoLinkService").LinkResult>;
223
+ };
224
+ firebaseStrapiLinkService: ({ strapi }: {
225
+ strapi: any;
226
+ }) => {
227
+ buildUserMap(): Promise<Map<any, any>>;
228
+ linkFirebaseUsers(firebaseUsers: any[], uidToUserMap: Map<string, any>, allStrapiUsers: any[]): any[];
229
+ };
145
230
  };
146
231
  contentTypes: {
147
232
  "firebase-authentication-configuration": {
@@ -168,6 +253,88 @@ declare const _default: {
168
253
  firebase_config_json: {
169
254
  type: string;
170
255
  };
256
+ firebase_web_api_key: {
257
+ type: string;
258
+ required: boolean;
259
+ configurable: boolean;
260
+ description: string;
261
+ };
262
+ passwordRequirementsRegex: {
263
+ type: string;
264
+ default: string;
265
+ };
266
+ passwordRequirementsMessage: {
267
+ type: string;
268
+ default: string;
269
+ };
270
+ passwordResetUrl: {
271
+ type: string;
272
+ default: string;
273
+ };
274
+ passwordResetEmailSubject: {
275
+ type: string;
276
+ default: string;
277
+ };
278
+ enableMagicLink: {
279
+ type: string;
280
+ default: boolean;
281
+ description: string;
282
+ };
283
+ magicLinkUrl: {
284
+ type: string;
285
+ default: string;
286
+ description: string;
287
+ };
288
+ magicLinkEmailSubject: {
289
+ type: string;
290
+ default: string;
291
+ };
292
+ magicLinkExpiryHours: {
293
+ type: string;
294
+ default: number;
295
+ minimum: number;
296
+ maximum: number;
297
+ description: string;
298
+ };
299
+ };
300
+ };
301
+ };
302
+ "firebase-user-data": {
303
+ schema: {
304
+ kind: string;
305
+ collectionName: string;
306
+ info: {
307
+ singularName: string;
308
+ pluralName: string;
309
+ displayName: string;
310
+ description: string;
311
+ };
312
+ options: {
313
+ draftAndPublish: boolean;
314
+ };
315
+ pluginOptions: {
316
+ "content-manager": {
317
+ visible: boolean;
318
+ };
319
+ "content-type-builder": {
320
+ visible: boolean;
321
+ };
322
+ };
323
+ attributes: {
324
+ user: {
325
+ type: string;
326
+ relation: string;
327
+ target: string;
328
+ };
329
+ firebaseUserID: {
330
+ type: string;
331
+ unique: boolean;
332
+ required: boolean;
333
+ };
334
+ appleEmail: {
335
+ type: string;
336
+ private: boolean;
337
+ };
171
338
  };
172
339
  };
173
340
  };