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,25 @@
1
+ import { getFetchClient } from "@strapi/strapi/admin";
2
+ import { P as PLUGIN_ID } from "./index-D6wh_wve.mjs";
3
+ const saveFirebaseConfig = async (json) => {
4
+ const url = `/${PLUGIN_ID}/settings/firebase-config`;
5
+ const { post } = getFetchClient();
6
+ const { data } = await post(url, { firebaseConfigJson: json });
7
+ return data;
8
+ };
9
+ const getFirebaseConfig = async () => {
10
+ const url = `/${PLUGIN_ID}/settings/firebase-config`;
11
+ const { get } = getFetchClient();
12
+ const { data } = await get(url);
13
+ return data;
14
+ };
15
+ const delFirebaseConfig = async () => {
16
+ const url = `/${PLUGIN_ID}/settings/firebase-config`;
17
+ const { del } = getFetchClient();
18
+ const { data } = await del(url);
19
+ return data;
20
+ };
21
+ export {
22
+ delFirebaseConfig as d,
23
+ getFirebaseConfig as g,
24
+ saveFirebaseConfig as s
25
+ };
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ const admin = require("@strapi/strapi/admin");
3
+ const index = require("./index-BavxEoR2.js");
4
+ const saveFirebaseConfig = async (json) => {
5
+ const url = `/${index.PLUGIN_ID}/settings/firebase-config`;
6
+ const { post } = admin.getFetchClient();
7
+ const { data } = await post(url, { firebaseConfigJson: json });
8
+ return data;
9
+ };
10
+ const getFirebaseConfig = async () => {
11
+ const url = `/${index.PLUGIN_ID}/settings/firebase-config`;
12
+ const { get } = admin.getFetchClient();
13
+ const { data } = await get(url);
14
+ return data;
15
+ };
16
+ const delFirebaseConfig = async () => {
17
+ const url = `/${index.PLUGIN_ID}/settings/firebase-config`;
18
+ const { del } = admin.getFetchClient();
19
+ const { data } = await del(url);
20
+ return data;
21
+ };
22
+ exports.delFirebaseConfig = delFirebaseConfig;
23
+ exports.getFirebaseConfig = getFirebaseConfig;
24
+ exports.saveFirebaseConfig = saveFirebaseConfig;
@@ -0,0 +1,18 @@
1
+ const en = {
2
+ "app.name": "Gen Types",
3
+ "page.title": "Generated Types",
4
+ "page.subTitle": "Quickly view & copy the types generated for your Strapi collections",
5
+ "page.copy.notSupported.title": "Copy not supported",
6
+ "page.copy.notSupported.message": "Your browser does not support copying to clipboard",
7
+ "page.copy.success.title": "Copied to Clipboard",
8
+ "page.copy.success.message": "The value has been copied to the clipboard.",
9
+ "page.copy.error.title": "Failed to Copy",
10
+ "page.copy.error.message": "The value could not be copied to the clipboard.",
11
+ "page.tooltip.interfaceFor": "Interface for",
12
+ "page.tooltip.copyInterface": "Copy Interface",
13
+ "page.copy.copyAll": "Copy All",
14
+ "page.copy.copyAll.tooltip": "Click to copy all types"
15
+ };
16
+ export {
17
+ en as default
18
+ };
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const en = {
4
+ "app.name": "Gen Types",
5
+ "page.title": "Generated Types",
6
+ "page.subTitle": "Quickly view & copy the types generated for your Strapi collections",
7
+ "page.copy.notSupported.title": "Copy not supported",
8
+ "page.copy.notSupported.message": "Your browser does not support copying to clipboard",
9
+ "page.copy.success.title": "Copied to Clipboard",
10
+ "page.copy.success.message": "The value has been copied to the clipboard.",
11
+ "page.copy.error.title": "Failed to Copy",
12
+ "page.copy.error.message": "The value could not be copied to the clipboard.",
13
+ "page.tooltip.interfaceFor": "Interface for",
14
+ "page.tooltip.copyInterface": "Copy Interface",
15
+ "page.copy.copyAll": "Copy All",
16
+ "page.copy.copyAll.tooltip": "Click to copy all types"
17
+ };
18
+ exports.default = en;
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ const react = require("react");
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const icons = require("@strapi/icons");
5
+ const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
6
+ const v = glob[path];
7
+ if (v) {
8
+ return typeof v === "function" ? v() : Promise.resolve(v);
9
+ }
10
+ return new Promise((_, reject) => {
11
+ (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
12
+ reject.bind(
13
+ null,
14
+ new Error(
15
+ "Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
16
+ )
17
+ )
18
+ );
19
+ });
20
+ };
21
+ const PLUGIN_ID = "firebase-auth";
22
+ const Initializer = ({ setPlugin }) => {
23
+ const ref = react.useRef(setPlugin);
24
+ react.useEffect(() => {
25
+ ref.current(PLUGIN_ID);
26
+ }, []);
27
+ return null;
28
+ };
29
+ const PluginIcon = () => /* @__PURE__ */ jsxRuntime.jsx(icons.Plant, {});
30
+ const prefixPluginTranslations = (trad, pluginId) => {
31
+ return Object.keys(trad).reduce((acc, current) => {
32
+ acc[`${pluginId}.${current}`] = trad[current];
33
+ return acc;
34
+ }, {});
35
+ };
36
+ const PERMISSIONS = {
37
+ // This permission regards the main component (App) and is used to tell
38
+ // If the plugin link should be displayed in the menu
39
+ // And also if the plugin is accessible. This use case is found when a user types the url of the
40
+ // plugin directly in the browser
41
+ "menu-link": [{ action: "plugin::firebase-auth.menu-link", subject: null }]
42
+ };
43
+ const getTranslation = (id) => `${PLUGIN_ID}.${id}`;
44
+ const index = {
45
+ register(app) {
46
+ app.addMenuLink({
47
+ to: `plugins/${PLUGIN_ID}`,
48
+ icon: PluginIcon,
49
+ intlLabel: {
50
+ id: `${PLUGIN_ID}.page.title`,
51
+ defaultMessage: PLUGIN_ID
52
+ },
53
+ Component: () => Promise.resolve().then(() => require("./App-ucyQ3wQ0.js")).then((mod) => ({
54
+ default: mod.App
55
+ })),
56
+ permissions: PERMISSIONS["menu-link"]
57
+ });
58
+ app.createSettingSection(
59
+ {
60
+ id: PLUGIN_ID,
61
+ intlLabel: {
62
+ id: getTranslation("SettingsNav.section-label"),
63
+ defaultMessage: "Firebase-Auth Plugin"
64
+ }
65
+ },
66
+ [
67
+ {
68
+ intlLabel: {
69
+ id: getTranslation("Settings.firebase-auth.plugin.title"),
70
+ defaultMessage: "Settings"
71
+ },
72
+ id: "settings",
73
+ to: `/settings/${PLUGIN_ID}`,
74
+ async Component() {
75
+ const component = await Promise.resolve().then(() => require("./index-C4tASYZr.js"));
76
+ return component.default;
77
+ },
78
+ permissions: PERMISSIONS["menu-link"]
79
+ }
80
+ ]
81
+ );
82
+ app.registerPlugin({
83
+ id: PLUGIN_ID,
84
+ initializer: Initializer,
85
+ isReady: false,
86
+ name: PLUGIN_ID
87
+ });
88
+ },
89
+ async registerTrads({ locales }) {
90
+ const importedTrads = await Promise.all(
91
+ locales.map((locale) => {
92
+ return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-Blu7bBKM.js")) }), `./translations/${locale}.json`, 3).then(({ default: data }) => {
93
+ return {
94
+ data: prefixPluginTranslations(data, PLUGIN_ID),
95
+ locale
96
+ };
97
+ }).catch(() => {
98
+ return {
99
+ data: {},
100
+ locale
101
+ };
102
+ });
103
+ })
104
+ );
105
+ return Promise.resolve(importedTrads);
106
+ }
107
+ };
108
+ exports.PLUGIN_ID = PLUGIN_ID;
109
+ exports.index = index;