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.
- package/LICENSE.md +21 -0
- package/README.md +63 -0
- package/dist/_chunks/App-CSI6Err4.mjs +5081 -0
- package/dist/_chunks/App-ucyQ3wQ0.js +5062 -0
- package/dist/_chunks/api-DsC4NiMF.mjs +25 -0
- package/dist/_chunks/api-_NrpM6KB.js +24 -0
- package/dist/_chunks/en-BRmJb_fY.mjs +18 -0
- package/dist/_chunks/en-Blu7bBKM.js +18 -0
- package/dist/_chunks/index-BavxEoR2.js +109 -0
- package/dist/_chunks/index-C4tASYZr.js +164 -0
- package/dist/_chunks/index-D6wh_wve.mjs +110 -0
- package/dist/_chunks/index-DJDpecNi.mjs +164 -0
- package/dist/admin/index.js +3 -0
- package/dist/admin/index.mjs +4 -0
- package/dist/admin/src/components/DynamicTable/FirebaseTable.d.ts +12 -0
- package/dist/admin/src/components/DynamicTable/FirebaseTableRows/FirebaseTableRows.d.ts +13 -0
- package/dist/admin/src/components/DynamicTable/TableHeaders.d.ts +13 -0
- package/dist/admin/src/components/Initializer.d.ts +5 -0
- package/dist/admin/src/components/PluginIcon.d.ts +2 -0
- package/dist/admin/src/components/SearchURLQuery/SearchURLQuery.d.ts +18 -0
- package/dist/admin/src/components/UserManagement/DeleteAccount.d.ts +9 -0
- package/dist/admin/src/components/UserManagement/ResetPassword.d.ts +8 -0
- package/dist/admin/src/hooks/useQueryParams.d.ts +9 -0
- package/dist/admin/src/index.d.ts +13 -0
- package/dist/admin/src/pages/App.d.ts +3 -0
- package/dist/admin/src/pages/HomePage.d.ts +1 -0
- package/dist/admin/src/pages/ListView/PaginationFooter/index.d.ts +5 -0
- package/dist/admin/src/pages/ListView/index.d.ts +10 -0
- package/dist/admin/src/pages/Settings/DeleteJsonConfigurationDialogue.d.ts +7 -0
- package/dist/admin/src/pages/Settings/api.d.ts +4 -0
- package/dist/admin/src/pages/Settings/index.d.ts +2 -0
- package/dist/admin/src/pages/utils/api.d.ts +34 -0
- package/dist/admin/src/permissions.d.ts +6 -0
- package/dist/admin/src/pluginId.d.ts +2 -0
- package/dist/admin/src/services/index.d.ts +1 -0
- package/dist/admin/src/utils/getTranslation.d.ts +2 -0
- package/dist/admin/src/utils/prefixPluginTranslations.d.ts +2 -0
- package/dist/admin/src/utils/provider.d.ts +1 -0
- package/dist/model/Meta.d.ts +9 -0
- package/dist/model/Request.d.ts +5 -0
- package/dist/model/User.d.ts +44 -0
- package/dist/server/index.js +25959 -0
- package/dist/server/index.mjs +25946 -0
- package/dist/server/src/bootstrap.d.ts +5 -0
- package/dist/server/src/config/index.d.ts +20 -0
- package/dist/server/src/constants/errors.d.ts +3 -0
- package/dist/server/src/content-types/index.d.ts +30 -0
- package/dist/server/src/controllers/firebase-auth-configuration.d.ts +7 -0
- package/dist/server/src/controllers/firebaseController.d.ts +7 -0
- package/dist/server/src/controllers/index.d.ts +26 -0
- package/dist/server/src/controllers/settingsController.d.ts +9 -0
- package/dist/server/src/controllers/userController.d.ts +11 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/firebaseAuth/types.d.ts +4 -0
- package/dist/server/src/index.d.ts +176 -0
- package/dist/server/src/middlewares/index.d.ts +2 -0
- package/dist/server/src/policies/index.d.ts +2 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/routes/admin.d.ts +12 -0
- package/dist/server/src/routes/content-api.d.ts +12 -0
- package/dist/server/src/routes/content-internal-api.d.ts +11 -0
- package/dist/server/src/routes/firebase-auth-configuration.d.ts +5 -0
- package/dist/server/src/routes/index.d.ts +35 -0
- package/dist/server/src/routes/settingsRoutes.d.ts +9 -0
- package/dist/server/src/services/firebase-auth-configuration.d.ts +7 -0
- package/dist/server/src/services/firebaseService.d.ts +29 -0
- package/dist/server/src/services/index.d.ts +68 -0
- package/dist/server/src/services/settingsService.d.ts +15 -0
- package/dist/server/src/services/userService.d.ts +25 -0
- package/dist/server/src/utils/check-valid-json.d.ts +2 -0
- package/dist/server/src/utils/fetch-me.d.ts +10 -0
- package/dist/server/src/utils/get-user-by-id.d.ts +6 -0
- package/dist/server/src/utils/index.d.ts +8 -0
- package/dist/server/src/utils/paginate.d.ts +12 -0
- package/dist/server/src/utils/promiseHandler.d.ts +7 -0
- package/dist/server/src/utils/sanitize-user.d.ts +7 -0
- package/dist/server/src/utils/users.d.ts +2 -0
- 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;
|