strapi-plugin-firebase-authentication 1.0.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 (78) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +63 -0
  3. package/dist/_chunks/App-CSI6Err4.mjs +5081 -0
  4. package/dist/_chunks/App-ucyQ3wQ0.js +5062 -0
  5. package/dist/_chunks/api-DsC4NiMF.mjs +25 -0
  6. package/dist/_chunks/api-_NrpM6KB.js +24 -0
  7. package/dist/_chunks/en-BRmJb_fY.mjs +18 -0
  8. package/dist/_chunks/en-Blu7bBKM.js +18 -0
  9. package/dist/_chunks/index-BavxEoR2.js +109 -0
  10. package/dist/_chunks/index-C4tASYZr.js +164 -0
  11. package/dist/_chunks/index-D6wh_wve.mjs +110 -0
  12. package/dist/_chunks/index-DJDpecNi.mjs +164 -0
  13. package/dist/admin/index.js +3 -0
  14. package/dist/admin/index.mjs +4 -0
  15. package/dist/admin/src/components/DynamicTable/FirebaseTable.d.ts +12 -0
  16. package/dist/admin/src/components/DynamicTable/FirebaseTableRows/FirebaseTableRows.d.ts +13 -0
  17. package/dist/admin/src/components/DynamicTable/TableHeaders.d.ts +13 -0
  18. package/dist/admin/src/components/Initializer.d.ts +5 -0
  19. package/dist/admin/src/components/PluginIcon.d.ts +2 -0
  20. package/dist/admin/src/components/SearchURLQuery/SearchURLQuery.d.ts +18 -0
  21. package/dist/admin/src/components/UserManagement/DeleteAccount.d.ts +9 -0
  22. package/dist/admin/src/components/UserManagement/ResetPassword.d.ts +8 -0
  23. package/dist/admin/src/hooks/useQueryParams.d.ts +9 -0
  24. package/dist/admin/src/index.d.ts +13 -0
  25. package/dist/admin/src/pages/App.d.ts +3 -0
  26. package/dist/admin/src/pages/HomePage.d.ts +1 -0
  27. package/dist/admin/src/pages/ListView/PaginationFooter/index.d.ts +5 -0
  28. package/dist/admin/src/pages/ListView/index.d.ts +10 -0
  29. package/dist/admin/src/pages/Settings/DeleteJsonConfigurationDialogue.d.ts +7 -0
  30. package/dist/admin/src/pages/Settings/api.d.ts +4 -0
  31. package/dist/admin/src/pages/Settings/index.d.ts +2 -0
  32. package/dist/admin/src/pages/utils/api.d.ts +34 -0
  33. package/dist/admin/src/permissions.d.ts +6 -0
  34. package/dist/admin/src/pluginId.d.ts +2 -0
  35. package/dist/admin/src/services/index.d.ts +1 -0
  36. package/dist/admin/src/utils/getTranslation.d.ts +2 -0
  37. package/dist/admin/src/utils/prefixPluginTranslations.d.ts +2 -0
  38. package/dist/admin/src/utils/provider.d.ts +1 -0
  39. package/dist/model/Meta.d.ts +9 -0
  40. package/dist/model/Request.d.ts +5 -0
  41. package/dist/model/User.d.ts +44 -0
  42. package/dist/server/index.js +25959 -0
  43. package/dist/server/index.mjs +25946 -0
  44. package/dist/server/src/bootstrap.d.ts +5 -0
  45. package/dist/server/src/config/index.d.ts +20 -0
  46. package/dist/server/src/constants/errors.d.ts +3 -0
  47. package/dist/server/src/content-types/index.d.ts +30 -0
  48. package/dist/server/src/controllers/firebase-auth-configuration.d.ts +7 -0
  49. package/dist/server/src/controllers/firebaseController.d.ts +7 -0
  50. package/dist/server/src/controllers/index.d.ts +26 -0
  51. package/dist/server/src/controllers/settingsController.d.ts +9 -0
  52. package/dist/server/src/controllers/userController.d.ts +11 -0
  53. package/dist/server/src/destroy.d.ts +5 -0
  54. package/dist/server/src/firebaseAuth/types.d.ts +4 -0
  55. package/dist/server/src/index.d.ts +176 -0
  56. package/dist/server/src/middlewares/index.d.ts +2 -0
  57. package/dist/server/src/policies/index.d.ts +2 -0
  58. package/dist/server/src/register.d.ts +5 -0
  59. package/dist/server/src/routes/admin.d.ts +12 -0
  60. package/dist/server/src/routes/content-api.d.ts +12 -0
  61. package/dist/server/src/routes/content-internal-api.d.ts +11 -0
  62. package/dist/server/src/routes/firebase-auth-configuration.d.ts +5 -0
  63. package/dist/server/src/routes/index.d.ts +35 -0
  64. package/dist/server/src/routes/settingsRoutes.d.ts +9 -0
  65. package/dist/server/src/services/firebase-auth-configuration.d.ts +7 -0
  66. package/dist/server/src/services/firebaseService.d.ts +29 -0
  67. package/dist/server/src/services/index.d.ts +68 -0
  68. package/dist/server/src/services/settingsService.d.ts +15 -0
  69. package/dist/server/src/services/userService.d.ts +25 -0
  70. package/dist/server/src/utils/check-valid-json.d.ts +2 -0
  71. package/dist/server/src/utils/fetch-me.d.ts +10 -0
  72. package/dist/server/src/utils/get-user-by-id.d.ts +6 -0
  73. package/dist/server/src/utils/index.d.ts +8 -0
  74. package/dist/server/src/utils/paginate.d.ts +12 -0
  75. package/dist/server/src/utils/promiseHandler.d.ts +7 -0
  76. package/dist/server/src/utils/sanitize-user.d.ts +7 -0
  77. package/dist/server/src/utils/users.d.ts +2 -0
  78. package/package.json +93 -0
@@ -0,0 +1,5 @@
1
+ import type { Core } from "@strapi/strapi";
2
+ declare const bootstrap: ({ strapi }: {
3
+ strapi: Core.Strapi;
4
+ }) => Promise<void>;
5
+ export default bootstrap;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Config for Gen Types Plugin
3
+ */
4
+ export type FirebaseAuthConfig = {
5
+ /**
6
+ * Any key to encrypt the firebase json file
7
+ *
8
+ * @default 'your-key-here'
9
+ */
10
+ firebaseJsonEncryptionKey: string;
11
+ };
12
+ declare const _default: {
13
+ default: ({ env }: {
14
+ env: any;
15
+ }) => {
16
+ firebaseJsonEncryptionKey: any;
17
+ };
18
+ validator(config: FirebaseAuthConfig): void;
19
+ };
20
+ export default _default;
@@ -0,0 +1,3 @@
1
+ export declare const USER_NOT_AUTHORIZED = "User not authorized!";
2
+ export declare const NO_DESTINATION_ID = "No destination User ID";
3
+ export declare const USER_NOT_FOUND = "No User with ID";
@@ -0,0 +1,30 @@
1
+ declare const _default: {
2
+ "firebase-auth-configuration": {
3
+ schema: {
4
+ kind: string;
5
+ collectionName: string;
6
+ info: {
7
+ singularName: string;
8
+ pluralName: string;
9
+ displayName: string;
10
+ };
11
+ options: {
12
+ draftAndPublish: boolean;
13
+ };
14
+ pluginOptions: {
15
+ "content-manager": {
16
+ visible: boolean;
17
+ };
18
+ "content-type-builder": {
19
+ visible: boolean;
20
+ };
21
+ };
22
+ attributes: {
23
+ firebase_config_json: {
24
+ type: string;
25
+ };
26
+ };
27
+ };
28
+ };
29
+ };
30
+ export default _default;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * controller
3
+ */
4
+ declare const _default: ({ strapi, }: {
5
+ strapi: import("@strapi/types/dist/core").Strapi;
6
+ }) => Partial<import("@strapi/types/dist/core/core-api/controller").Base> & import("@strapi/types/dist/core/core-api/controller").Generic & import("@strapi/types/dist/core/core-api/controller").Base;
7
+ export default _default;
@@ -0,0 +1,7 @@
1
+ declare const firebaseController: {
2
+ validateToken(ctx: any): Promise<void>;
3
+ createAlias(ctx: any): Promise<void>;
4
+ deleteByEmail(email: any): Promise<any>;
5
+ overrideAccess(ctx: any): Promise<void>;
6
+ };
7
+ export default firebaseController;
@@ -0,0 +1,26 @@
1
+ /// <reference types="koa" />
2
+ declare const _default: {
3
+ firebaseController: {
4
+ validateToken(ctx: any): Promise<void>;
5
+ createAlias(ctx: any): Promise<void>;
6
+ deleteByEmail(email: any): Promise<any>;
7
+ overrideAccess(ctx: any): Promise<void>;
8
+ };
9
+ userController: {
10
+ list: (ctx: import("koa").DefaultContext | import("koa").Context) => Promise<void>;
11
+ create: (ctx: any) => Promise<void>;
12
+ get: (ctx: any) => Promise<void>;
13
+ update: (ctx: any) => Promise<void>;
14
+ delete: (ctx: import("koa").DefaultContext | import("koa").Context) => Promise<void>;
15
+ deleteMany: (ctx: any) => Promise<void>;
16
+ resetPassword: (ctx: any) => Promise<void>;
17
+ };
18
+ 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>;
24
+ };
25
+ };
26
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { Context, DefaultContext } from "koa";
2
+ declare const _default: {
3
+ setToken: (ctx: DefaultContext | Context) => Promise<void>;
4
+ setFirebaseConfigJson: (ctx: DefaultContext | Context) => Promise<void>;
5
+ getFirebaseConfigJson: (ctx: DefaultContext | Context) => Promise<any>;
6
+ delFirebaseConfigJson(ctx: DefaultContext | Context): Promise<void>;
7
+ restart(ctx: DefaultContext | Context): Promise<any>;
8
+ };
9
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { Context, DefaultContext } from "koa";
2
+ declare const _default: {
3
+ list: (ctx: DefaultContext | Context) => Promise<void>;
4
+ create: (ctx: any) => Promise<void>;
5
+ get: (ctx: any) => Promise<void>;
6
+ update: (ctx: any) => Promise<void>;
7
+ delete: (ctx: DefaultContext | Context) => Promise<void>;
8
+ deleteMany: (ctx: any) => Promise<void>;
9
+ resetPassword: (ctx: any) => Promise<void>;
10
+ };
11
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import type { Core } from "@strapi/strapi";
2
+ declare const destroy: ({ strapi }: {
3
+ strapi: Core.Strapi;
4
+ }) => void;
5
+ export default destroy;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * The name of the plugin
3
+ */
4
+ export declare const pluginName = "firebase-auth";
@@ -0,0 +1,176 @@
1
+ /// <reference types="koa" />
2
+ declare const _default: {
3
+ register: ({ strapi }: {
4
+ strapi: import("@strapi/types/dist/core").Strapi;
5
+ }) => void;
6
+ bootstrap: ({ strapi }: {
7
+ strapi: import("@strapi/types/dist/core").Strapi;
8
+ }) => Promise<void>;
9
+ destroy: ({ strapi }: {
10
+ strapi: import("@strapi/types/dist/core").Strapi;
11
+ }) => void;
12
+ config: {
13
+ default: ({ env }: {
14
+ env: any;
15
+ }) => {
16
+ firebaseJsonEncryptionKey: any;
17
+ };
18
+ validator(config: import("./config").FirebaseAuthConfig): void;
19
+ };
20
+ controllers: {
21
+ firebaseController: {
22
+ validateToken(ctx: any): Promise<void>;
23
+ createAlias(ctx: any): Promise<void>;
24
+ deleteByEmail(email: any): Promise<any>;
25
+ overrideAccess(ctx: any): Promise<void>;
26
+ };
27
+ userController: {
28
+ list: (ctx: import("koa").DefaultContext | import("koa").Context) => Promise<void>;
29
+ create: (ctx: any) => Promise<void>;
30
+ get: (ctx: any) => Promise<void>;
31
+ update: (ctx: any) => Promise<void>;
32
+ delete: (ctx: import("koa").DefaultContext | import("koa").Context) => Promise<void>;
33
+ deleteMany: (ctx: any) => Promise<void>;
34
+ resetPassword: (ctx: any) => Promise<void>;
35
+ };
36
+ 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>;
42
+ };
43
+ };
44
+ routes: {
45
+ admin: {
46
+ type: string;
47
+ routes: {
48
+ method: string;
49
+ path: string;
50
+ handler: string;
51
+ config: {
52
+ policies: any[];
53
+ };
54
+ }[];
55
+ };
56
+ "content-api": {
57
+ type: string;
58
+ routes: {
59
+ method: string;
60
+ path: string;
61
+ handler: string;
62
+ config: {
63
+ policies: any[];
64
+ };
65
+ }[];
66
+ };
67
+ "content-internal-api": {
68
+ routes: {
69
+ method: string;
70
+ path: string;
71
+ handler: string;
72
+ config: {
73
+ policies: any[];
74
+ };
75
+ }[];
76
+ };
77
+ };
78
+ services: {
79
+ settingsService: ({ strapi }: {
80
+ strapi: any;
81
+ }) => {
82
+ init(): Promise<void>;
83
+ getFirebaseConfigJson(): Promise<{
84
+ firebaseConfigJson: any;
85
+ }>;
86
+ setFirebaseConfigJson(ctx: import("koa").DefaultContext | import("koa").Context): Promise<any>;
87
+ delFirebaseConfigJson: () => Promise<any>;
88
+ encryptJson(key: string, json: string): Promise<any>;
89
+ decryptJson(key: string, hash: string): Promise<any>;
90
+ restart(): Promise<void>;
91
+ };
92
+ userService: ({ strapi }: {
93
+ strapi: any;
94
+ }) => {
95
+ get: (entityId: string) => Promise<any>;
96
+ create: (payload: any) => Promise<any>;
97
+ register: (userID: any, payload: any) => Promise<void>;
98
+ list: (pagination: any, nextPageToken: any) => Promise<{
99
+ data: any;
100
+ pageToken: any;
101
+ meta: {
102
+ pagination: any;
103
+ };
104
+ }>;
105
+ updateFirebaseUser: (entityId: any, payload: any) => Promise<any>;
106
+ update: (entityId: any, payload: any) => Promise<[PromiseSettledResult<any>]>;
107
+ resetPasswordFirebaseUser: (entityId: any, payload: any) => Promise<any>;
108
+ resetPasswordStrapiUser: (entityId: any, payload: any) => Promise<any>;
109
+ resetPassword: (entityId: any, payload: any) => Promise<[PromiseSettledResult<any>, PromiseSettledResult<any>]>;
110
+ delete: (entityId: any) => Promise<[PromiseSettledResult<any>, PromiseSettledResult<any>]>;
111
+ deleteFirebaseUser: (entityId: any) => Promise<any>;
112
+ deleteStrapiUser: (entityId: any) => Promise<any>;
113
+ deleteMany: (entityIDs: any) => Promise<any>;
114
+ setSocialMetaData(): Promise<void>;
115
+ };
116
+ firebaseService: ({ strapi }: any) => {
117
+ getUserAttributes(): Promise<any>;
118
+ delete: (entityId: any) => Promise<{
119
+ success: boolean;
120
+ }>;
121
+ validateExchangeTokenPayload: (requestPayload: any) => Promise<any>;
122
+ decodeIDToken: (idToken: any) => Promise<any>;
123
+ overrideFirebaseAccess: (ctx: any) => Promise<any>;
124
+ checkIfUserExists(decodedToken: any): Promise<any>;
125
+ fetchUser: (decodedToken: any) => Promise<any>;
126
+ generateJWTForCurrentUser: (user: any) => Promise<any>;
127
+ createStrapiUser(decodedToken: any, idToken: any, profileMetaData: any): Promise<any>;
128
+ updateUserIDToken: (user: any, idToken: any, decodedToken: any) => Promise<any>;
129
+ validateFirebaseToken: (ctx: any) => Promise<{
130
+ error: any;
131
+ user?: undefined;
132
+ jwt?: undefined;
133
+ } | {
134
+ user: {
135
+ id: import("@strapi/types/dist/data").ID;
136
+ } & {
137
+ [key: string]: any;
138
+ };
139
+ jwt: any;
140
+ error?: undefined;
141
+ }>;
142
+ };
143
+ };
144
+ contentTypes: {
145
+ "firebase-auth-configuration": {
146
+ schema: {
147
+ kind: string;
148
+ collectionName: string;
149
+ info: {
150
+ singularName: string;
151
+ pluralName: string;
152
+ displayName: string;
153
+ };
154
+ options: {
155
+ draftAndPublish: boolean;
156
+ };
157
+ pluginOptions: {
158
+ "content-manager": {
159
+ visible: boolean;
160
+ };
161
+ "content-type-builder": {
162
+ visible: boolean;
163
+ };
164
+ };
165
+ attributes: {
166
+ firebase_config_json: {
167
+ type: string;
168
+ };
169
+ };
170
+ };
171
+ };
172
+ };
173
+ policies: {};
174
+ middlewares: {};
175
+ };
176
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: {};
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: {};
2
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import type { Core } from "@strapi/strapi";
2
+ declare const register: ({ strapi }: {
3
+ strapi: Core.Strapi;
4
+ }) => void;
5
+ export default register;
@@ -0,0 +1,12 @@
1
+ declare const _default: {
2
+ type: string;
3
+ routes: {
4
+ method: string;
5
+ path: string;
6
+ handler: string;
7
+ config: {
8
+ policies: any[];
9
+ };
10
+ }[];
11
+ };
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ declare const _default: {
2
+ type: string;
3
+ routes: {
4
+ method: string;
5
+ path: string;
6
+ handler: string;
7
+ config: {
8
+ policies: any[];
9
+ };
10
+ }[];
11
+ };
12
+ export default _default;
@@ -0,0 +1,11 @@
1
+ declare const _default: {
2
+ routes: {
3
+ method: string;
4
+ path: string;
5
+ handler: string;
6
+ config: {
7
+ policies: any[];
8
+ };
9
+ }[];
10
+ };
11
+ export default _default;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * router
3
+ */
4
+ declare const _default: import("@strapi/types/dist/core/core-api/router").Router;
5
+ export default _default;
@@ -0,0 +1,35 @@
1
+ declare const _default: {
2
+ admin: {
3
+ type: string;
4
+ routes: {
5
+ method: string;
6
+ path: string;
7
+ handler: string;
8
+ config: {
9
+ policies: any[];
10
+ };
11
+ }[];
12
+ };
13
+ "content-api": {
14
+ type: string;
15
+ routes: {
16
+ method: string;
17
+ path: string;
18
+ handler: string;
19
+ config: {
20
+ policies: any[];
21
+ };
22
+ }[];
23
+ };
24
+ "content-internal-api": {
25
+ routes: {
26
+ method: string;
27
+ path: string;
28
+ handler: string;
29
+ config: {
30
+ policies: any[];
31
+ };
32
+ }[];
33
+ };
34
+ };
35
+ export default _default;
@@ -0,0 +1,9 @@
1
+ declare const _default: {
2
+ method: string;
3
+ path: string;
4
+ handler: string;
5
+ config: {
6
+ policies: any[];
7
+ };
8
+ }[];
9
+ export default _default;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * service
3
+ */
4
+ declare const _default: ({ strapi, }: {
5
+ strapi: import("@strapi/types/dist/core").Strapi;
6
+ }) => Partial<import("@strapi/types/dist/core/core-api/service").Base> & import("@strapi/types/dist/core/core-api/service").Generic & import("@strapi/types/dist/core/core-api/service").Base;
7
+ export default _default;
@@ -0,0 +1,29 @@
1
+ import type { Core } from "@strapi/strapi";
2
+ declare const _default: ({ strapi }: Core.Strapi | any) => {
3
+ getUserAttributes(): Promise<any>;
4
+ delete: (entityId: any) => Promise<{
5
+ success: boolean;
6
+ }>;
7
+ validateExchangeTokenPayload: (requestPayload: any) => Promise<any>;
8
+ decodeIDToken: (idToken: any) => Promise<any>;
9
+ overrideFirebaseAccess: (ctx: any) => Promise<any>;
10
+ checkIfUserExists(decodedToken: any): Promise<any>;
11
+ fetchUser: (decodedToken: any) => Promise<any>;
12
+ generateJWTForCurrentUser: (user: any) => Promise<any>;
13
+ createStrapiUser(decodedToken: any, idToken: any, profileMetaData: any): Promise<any>;
14
+ updateUserIDToken: (user: any, idToken: any, decodedToken: any) => Promise<any>;
15
+ validateFirebaseToken: (ctx: any) => Promise<{
16
+ error: any;
17
+ user?: undefined;
18
+ jwt?: undefined;
19
+ } | {
20
+ user: {
21
+ id: import("@strapi/types/dist/data").ID;
22
+ } & {
23
+ [key: string]: any;
24
+ };
25
+ jwt: any;
26
+ error?: undefined;
27
+ }>;
28
+ };
29
+ export default _default;
@@ -0,0 +1,68 @@
1
+ /// <reference types="koa" />
2
+ declare const _default: {
3
+ settingsService: ({ strapi }: {
4
+ strapi: any;
5
+ }) => {
6
+ init(): Promise<void>;
7
+ getFirebaseConfigJson(): Promise<{
8
+ firebaseConfigJson: any;
9
+ }>;
10
+ setFirebaseConfigJson(ctx: import("koa").DefaultContext | import("koa").Context): Promise<any>;
11
+ delFirebaseConfigJson: () => Promise<any>;
12
+ encryptJson(key: string, json: string): Promise<any>;
13
+ decryptJson(key: string, hash: string): Promise<any>;
14
+ restart(): Promise<void>;
15
+ };
16
+ userService: ({ strapi }: {
17
+ strapi: any;
18
+ }) => {
19
+ get: (entityId: string) => Promise<any>;
20
+ create: (payload: any) => Promise<any>;
21
+ register: (userID: any, payload: any) => Promise<void>;
22
+ list: (pagination: any, nextPageToken: any) => Promise<{
23
+ data: any;
24
+ pageToken: any;
25
+ meta: {
26
+ pagination: any;
27
+ };
28
+ }>;
29
+ updateFirebaseUser: (entityId: any, payload: any) => Promise<any>;
30
+ update: (entityId: any, payload: any) => Promise<[PromiseSettledResult<any>]>;
31
+ resetPasswordFirebaseUser: (entityId: any, payload: any) => Promise<any>;
32
+ resetPasswordStrapiUser: (entityId: any, payload: any) => Promise<any>;
33
+ resetPassword: (entityId: any, payload: any) => Promise<[PromiseSettledResult<any>, PromiseSettledResult<any>]>;
34
+ delete: (entityId: any) => Promise<[PromiseSettledResult<any>, PromiseSettledResult<any>]>;
35
+ deleteFirebaseUser: (entityId: any) => Promise<any>;
36
+ deleteStrapiUser: (entityId: any) => Promise<any>;
37
+ deleteMany: (entityIDs: any) => Promise<any>;
38
+ setSocialMetaData(): Promise<void>;
39
+ };
40
+ firebaseService: ({ strapi }: any) => {
41
+ getUserAttributes(): Promise<any>;
42
+ delete: (entityId: any) => Promise<{
43
+ success: boolean;
44
+ }>;
45
+ validateExchangeTokenPayload: (requestPayload: any) => Promise<any>;
46
+ decodeIDToken: (idToken: any) => Promise<any>;
47
+ overrideFirebaseAccess: (ctx: any) => Promise<any>;
48
+ checkIfUserExists(decodedToken: any): Promise<any>;
49
+ fetchUser: (decodedToken: any) => Promise<any>;
50
+ generateJWTForCurrentUser: (user: any) => Promise<any>;
51
+ createStrapiUser(decodedToken: any, idToken: any, profileMetaData: any): Promise<any>;
52
+ updateUserIDToken: (user: any, idToken: any, decodedToken: any) => Promise<any>;
53
+ validateFirebaseToken: (ctx: any) => Promise<{
54
+ error: any;
55
+ user?: undefined;
56
+ jwt?: undefined;
57
+ } | {
58
+ user: {
59
+ id: import("@strapi/types/dist/data").ID;
60
+ } & {
61
+ [key: string]: any;
62
+ };
63
+ jwt: any;
64
+ error?: undefined;
65
+ }>;
66
+ };
67
+ };
68
+ export default _default;
@@ -0,0 +1,15 @@
1
+ import { Context, DefaultContext } from "koa";
2
+ declare const _default: ({ strapi }: {
3
+ strapi: any;
4
+ }) => {
5
+ init(): Promise<void>;
6
+ getFirebaseConfigJson(): Promise<{
7
+ firebaseConfigJson: any;
8
+ }>;
9
+ setFirebaseConfigJson(ctx: DefaultContext | Context): Promise<any>;
10
+ delFirebaseConfigJson: () => Promise<any>;
11
+ encryptJson(key: string, json: string): Promise<any>;
12
+ decryptJson(key: string, hash: string): Promise<any>;
13
+ restart(): Promise<void>;
14
+ };
15
+ export default _default;
@@ -0,0 +1,25 @@
1
+ declare const _default: ({ strapi }: {
2
+ strapi: any;
3
+ }) => {
4
+ get: (entityId: string) => Promise<any>;
5
+ create: (payload: any) => Promise<any>;
6
+ register: (userID: any, payload: any) => Promise<void>;
7
+ list: (pagination: any, nextPageToken: any) => Promise<{
8
+ data: any;
9
+ pageToken: any;
10
+ meta: {
11
+ pagination: any;
12
+ };
13
+ }>;
14
+ updateFirebaseUser: (entityId: any, payload: any) => Promise<any>;
15
+ update: (entityId: any, payload: any) => Promise<[PromiseSettledResult<any>]>;
16
+ resetPasswordFirebaseUser: (entityId: any, payload: any) => Promise<any>;
17
+ resetPasswordStrapiUser: (entityId: any, payload: any) => Promise<any>;
18
+ resetPassword: (entityId: any, payload: any) => Promise<[PromiseSettledResult<any>, PromiseSettledResult<any>]>;
19
+ delete: (entityId: any) => Promise<[PromiseSettledResult<any>, PromiseSettledResult<any>]>;
20
+ deleteFirebaseUser: (entityId: any) => Promise<any>;
21
+ deleteStrapiUser: (entityId: any) => Promise<any>;
22
+ deleteMany: (entityIDs: any) => Promise<any>;
23
+ setSocialMetaData(): Promise<void>;
24
+ };
25
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: (jsonString: string) => boolean | object;
2
+ export default _default;
@@ -0,0 +1,10 @@
1
+ export declare const fetchUser: (currentUser: any, populate?: string[]) => Promise<{
2
+ id: import("@strapi/types/dist/data").ID;
3
+ } & {
4
+ [key: string]: any;
5
+ }>;
6
+ export declare const processMeData: (currentUser: any, populate?: string[]) => Promise<{
7
+ id: import("@strapi/types/dist/data").ID;
8
+ } & {
9
+ [key: string]: any;
10
+ }>;
@@ -0,0 +1,6 @@
1
+ declare const _default: (userID: any) => Promise<{
2
+ id: import("@strapi/types/dist/data").ID;
3
+ } & {
4
+ [key: string]: any;
5
+ }>;
6
+ export default _default;
@@ -0,0 +1,8 @@
1
+ export declare const sanitizeOutput: (user: any, ctx: any) => Promise<import("@strapi/utils/dist/types").Data>;
2
+ export declare const getService: (name: any) => import("@strapi/types/dist/core").Service;
3
+ /**
4
+ * @description Generate referralCode for users
5
+ * @param {Number} length
6
+ * @returns referralCode
7
+ */
8
+ export declare const generateReferralCode: (length: any) => string;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @description Perform pagination on array of data
3
+ * @param {Array} data
4
+ * @param {Object} pagination
5
+ * @returns array after performing pagination on it and meta object
6
+ */
7
+ declare const _default: (data: any, totalUserscount: any, pagination: any) => {
8
+ meta: {
9
+ pagination: any;
10
+ };
11
+ };
12
+ export default _default;
@@ -0,0 +1,7 @@
1
+ export declare function promiseHandler(promise: Promise<any>): Promise<{
2
+ error: any;
3
+ data?: undefined;
4
+ } | {
5
+ data: any;
6
+ error?: undefined;
7
+ }>;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @description Manual sanitize user object
3
+ * @param {Object} user
4
+ * @returns {Object} sanitizedUser
5
+ */
6
+ declare const _default: (user: any) => any;
7
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import { StrapiUser } from "../../../model/User";
2
+ export declare const formatUserData: (result: any, strapiUsersData: StrapiUser[]) => any;