@strapi/plugin-documentation 4.0.0-next.6 → 4.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/admin/src/components/FieldActionWrapper/index.js +14 -0
- package/admin/src/components/PluginIcon/index.js +12 -0
- package/admin/src/index.js +27 -12
- package/admin/src/pages/PluginPage/index.js +199 -0
- package/admin/src/pages/PluginPage/tests/index.test.js +873 -0
- package/admin/src/pages/PluginPage/tests/server.js +23 -0
- package/admin/src/pages/SettingsPage/index.js +181 -0
- package/admin/src/pages/SettingsPage/tests/index.test.js +612 -0
- package/admin/src/pages/SettingsPage/tests/server.js +18 -0
- package/admin/src/pages/{HomePage/utils → utils}/api.js +5 -4
- package/admin/src/pages/{HomePage/utils → utils}/schema.js +0 -0
- package/admin/src/pages/utils/useReactQuery.js +46 -0
- package/admin/src/permissions.js +7 -7
- package/admin/src/translations/ar.json +0 -3
- package/admin/src/translations/cs.json +0 -3
- package/admin/src/translations/de.json +0 -3
- package/admin/src/translations/en.json +14 -3
- package/admin/src/translations/es.json +0 -3
- package/admin/src/translations/fr.json +0 -3
- package/admin/src/translations/id.json +0 -3
- package/admin/src/translations/it.json +0 -3
- package/admin/src/translations/ko.json +0 -3
- package/admin/src/translations/ms.json +0 -3
- package/admin/src/translations/nl.json +0 -3
- package/admin/src/translations/pl.json +0 -3
- package/admin/src/translations/pt-BR.json +0 -3
- package/admin/src/translations/pt.json +0 -3
- package/admin/src/translations/ru.json +0 -3
- package/admin/src/translations/sk.json +0 -3
- package/admin/src/translations/th.json +0 -3
- package/admin/src/translations/tr.json +0 -3
- package/admin/src/translations/uk.json +0 -3
- package/admin/src/translations/vi.json +0 -3
- package/admin/src/translations/zh-Hans.json +3 -6
- package/admin/src/translations/zh.json +0 -3
- package/package.json +32 -45
- package/server/bootstrap.js +56 -0
- package/server/config/default-config.js +45 -0
- package/server/config/index.js +16 -0
- package/server/controllers/documentation.js +240 -0
- package/server/controllers/index.js +7 -0
- package/server/index.js +17 -0
- package/server/middlewares/documentation.js +30 -0
- package/server/middlewares/index.js +7 -0
- package/server/middlewares/restrict-access.js +24 -0
- package/{public → server/public}/index.html +0 -0
- package/{public → server/public}/login.html +0 -0
- package/server/register.js +11 -0
- package/server/routes/index.js +83 -0
- package/server/services/documentation.js +155 -0
- package/server/services/index.js +7 -0
- package/{services → server/services}/utils/components.json +0 -0
- package/{services → server/services}/utils/parametersOptions.json +0 -0
- package/{services → server/services}/utils/unknownComponent.json +0 -0
- package/server/utils/builders/build-api-endpoint-path.js +174 -0
- package/server/utils/builders/build-api-requests.js +41 -0
- package/server/utils/builders/build-api-responses.js +108 -0
- package/server/utils/builders/index.js +11 -0
- package/server/utils/clean-schema-attributes.js +205 -0
- package/server/utils/error-response.js +22 -0
- package/server/utils/get-schema-data.js +32 -0
- package/server/utils/query-params.js +84 -0
- package/strapi-admin.js +3 -0
- package/strapi-server.js +3 -0
- package/admin/src/assets/images/logo.svg +0 -1
- package/admin/src/components/Block/components.js +0 -26
- package/admin/src/components/Block/index.js +0 -39
- package/admin/src/components/Copy/index.js +0 -36
- package/admin/src/components/Header/index.js +0 -72
- package/admin/src/components/Row/ButtonContainer.js +0 -67
- package/admin/src/components/Row/components.js +0 -83
- package/admin/src/components/Row/index.js +0 -51
- package/admin/src/pages/App/index.js +0 -21
- package/admin/src/pages/HomePage/components.js +0 -59
- package/admin/src/pages/HomePage/index.js +0 -168
- package/admin/src/pages/HomePage/useHomePage.js +0 -56
- package/config/functions/bootstrap.js +0 -142
- package/config/policies/index.js +0 -33
- package/config/routes.json +0 -74
- package/config/settings.json +0 -46
- package/controllers/Documentation.js +0 -302
- package/middlewares/documentation/defaults.json +0 -5
- package/middlewares/documentation/index.js +0 -59
- package/services/Documentation.js +0 -1863
- package/services/utils/forms.json +0 -29
package/admin/src/permissions.js
CHANGED
|
@@ -4,16 +4,16 @@ const pluginPermissions = {
|
|
|
4
4
|
// And also if the plugin is accessible. This use case is found when a user types the url of the
|
|
5
5
|
// plugin directly in the browser
|
|
6
6
|
main: [
|
|
7
|
-
{ action: '
|
|
8
|
-
{ action: '
|
|
9
|
-
{ action: '
|
|
7
|
+
{ action: 'plugin::documentation.read', subject: null },
|
|
8
|
+
{ action: 'plugin::documentation.settings.regenerate', subject: null },
|
|
9
|
+
{ action: 'plugin::documentation.settings.update', subject: null },
|
|
10
10
|
],
|
|
11
11
|
open: [
|
|
12
|
-
{ action: '
|
|
13
|
-
{ action: '
|
|
12
|
+
{ action: 'plugin::documentation.read', subject: null },
|
|
13
|
+
{ action: 'plugin::documentation.settings.regenerate', subject: null },
|
|
14
14
|
],
|
|
15
|
-
regenerate: [{ action: '
|
|
16
|
-
update: [{ action: '
|
|
15
|
+
regenerate: [{ action: 'plugin::documentation.settings.regenerate', subject: null }],
|
|
16
|
+
update: [{ action: 'plugin::documentation.settings.update', subject: null }],
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export default pluginPermissions;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "Last generation",
|
|
3
2
|
"components.Row.open": "Open",
|
|
4
3
|
"components.Row.regenerate": "Regenerate",
|
|
5
4
|
"containers.HomePage.Block.title": "Versions",
|
|
6
|
-
"containers.HomePage.Button.open": "Open the documentation",
|
|
7
5
|
"containers.HomePage.Button.update": "Update",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "Configure the documentation plugin",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "Documentation - Settings",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "I understand",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "Are you sure you want to delete this version?",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "Poslední vygenerování",
|
|
3
2
|
"components.Row.open": "Otevřený",
|
|
4
3
|
"components.Row.regenerate": "Znovu vygenerovat",
|
|
5
4
|
"containers.HomePage.Block.title": "Verze",
|
|
6
|
-
"containers.HomePage.Button.open": "Otevřít dokumentaci",
|
|
7
5
|
"containers.HomePage.Button.update": "Uložit",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "Nastavit zásuvný modul dokumentace",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "Dokumentace - Nastavení",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "Rozumím",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "Jste si jisti, že chcete odstranit tuto verzi?",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "Letztes Mal generiert",
|
|
3
2
|
"components.Row.open": "Öffnen",
|
|
4
3
|
"components.Row.regenerate": "Neu generieren",
|
|
5
4
|
"containers.HomePage.Block.title": "Versionen",
|
|
6
|
-
"containers.HomePage.Button.open": "Dokumentation öffnen",
|
|
7
5
|
"containers.HomePage.Button.update": "Aktualisieren",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "Einstellungen des Dokumentation-Plugins ändern",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "Dokumentation - Einstellungen",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "Ich verstehe",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "Sind Sie sich sicher, dass Sie diese Version löschen wollen?",
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
2
|
+
"coming-soon": "This content is currently under construction and will be back in a few weeks!",
|
|
3
3
|
"components.Row.open": "Open",
|
|
4
4
|
"components.Row.regenerate": "Regenerate",
|
|
5
5
|
"containers.HomePage.Block.title": "Versions",
|
|
6
|
-
"containers.HomePage.Button.open": "Open the documentation",
|
|
7
6
|
"containers.HomePage.Button.update": "Update",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "Configure the documentation plugin",
|
|
9
7
|
"containers.HomePage.PluginHeader.title": "Documentation - Settings",
|
|
10
8
|
"containers.HomePage.PopUpWarning.confirm": "I understand",
|
|
11
9
|
"containers.HomePage.PopUpWarning.message": "Are you sure you want to delete this version?",
|
|
@@ -25,6 +23,19 @@
|
|
|
25
23
|
"notification.delete.success": "Doc deleted",
|
|
26
24
|
"notification.generate.success": "Doc generated",
|
|
27
25
|
"notification.update.success": "Settings updated successfully",
|
|
26
|
+
"pages.PluginPage.Button.open": "Open documentation",
|
|
27
|
+
"pages.PluginPage.header.description": "Configure the documentation plugin",
|
|
28
|
+
"pages.PluginPage.table.generated": "Last generated",
|
|
29
|
+
"pages.PluginPage.table.icon.delete": "Delete {target}",
|
|
30
|
+
"pages.PluginPage.table.icon.regenerate": "Regenerate {target}",
|
|
31
|
+
"pages.PluginPage.table.icon.show": "Open {target}",
|
|
32
|
+
"pages.PluginPage.table.version": "Version",
|
|
33
|
+
"pages.SettingPage.title": "Settings",
|
|
34
|
+
"pages.SettingsPage.Button.description": "Configure the documentation plugin",
|
|
35
|
+
"pages.SettingsPage.header.save": "Save",
|
|
36
|
+
"pages.SettingsPage.password.label": "Password",
|
|
37
|
+
"pages.SettingsPage.toggle.hint": "Make the documentation endpoint private",
|
|
38
|
+
"pages.SettingsPage.toggle.label": "Restricted Access",
|
|
28
39
|
"plugin.description.long": "Create an OpenAPI Document and visualize your API with SWAGGER UI.",
|
|
29
40
|
"plugin.description.short": "Create an OpenAPI Document and visualize your API with SWAGGER UI.",
|
|
30
41
|
"plugin.name": "Documentation"
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "Última generación",
|
|
3
2
|
"components.Row.open": "Abrir",
|
|
4
3
|
"components.Row.regenerate": "Regenerar",
|
|
5
4
|
"containers.HomePage.Block.title": "Versiones",
|
|
6
|
-
"containers.HomePage.Button.open": "Abrir la documentación",
|
|
7
5
|
"containers.HomePage.Button.update": "Actualizar",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "Configurar el plugin de documentación",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "Documentación - Configuración",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "Confirmar",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "¿Estás seguro de que deseas eliminar esta versión?",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "Dernière création",
|
|
3
2
|
"components.Row.open": "Ouvrir",
|
|
4
3
|
"components.Row.regenerate": "Recréer",
|
|
5
4
|
"containers.HomePage.Block.title": "Versions",
|
|
6
|
-
"containers.HomePage.Button.open": "Ouvrir la documentation",
|
|
7
5
|
"containers.HomePage.Button.update": "Mettre à jour",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "Configurez votre plugin de documentation",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "Documentation - Paramètres",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "Supprimer",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "Êtes-vous sûr·e de vouloir supprimer cette version ?",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "Generasi terakhir",
|
|
3
2
|
"components.Row.open": "Buka",
|
|
4
3
|
"components.Row.regenerate": "Diperbarui",
|
|
5
4
|
"containers.HomePage.Block.title": "Versi",
|
|
6
|
-
"containers.HomePage.Button.open": "Buka dokumentasi",
|
|
7
5
|
"containers.HomePage.Button.update": "Perbarui",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "Konfigurasikan plugin dokumentasi",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "Dokumentasi - Pengaturan",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "Saya mengerti",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "Anda yakin ingin menghapus versi ini?",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "Ultima generazione",
|
|
3
2
|
"components.Row.open": "Apri",
|
|
4
3
|
"components.Row.regenerate": "Rigenera",
|
|
5
4
|
"containers.HomePage.Block.title": "Versioni",
|
|
6
|
-
"containers.HomePage.Button.open": "Apri la documentazione",
|
|
7
5
|
"containers.HomePage.Button.update": "Aggiorna",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "Configura il plugin Documentazione",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "Documentazione - Impostazioni",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "Ho capito",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "Sei sicuro di voler eliminare questa versione?",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "Last generation",
|
|
3
2
|
"components.Row.open": "Open",
|
|
4
3
|
"components.Row.regenerate": "Regenerate",
|
|
5
4
|
"containers.HomePage.Block.title": "Versions",
|
|
6
|
-
"containers.HomePage.Button.open": "Open the documentation",
|
|
7
5
|
"containers.HomePage.Button.update": "Update",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "Configure the documentation plugin",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "Documentation - Settings",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "I understand",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "Are you sure you want to delete this version?",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "Hasil yang lalu",
|
|
3
2
|
"components.Row.open": "Buka",
|
|
4
3
|
"components.Row.regenerate": "Hasilkan Semula",
|
|
5
4
|
"containers.HomePage.Block.title": "Versi",
|
|
6
|
-
"containers.HomePage.Button.open": "Buka Dokumen",
|
|
7
5
|
"containers.HomePage.Button.update": "Kemas Kini",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "Tetapkan plugin dokumen the documentation plugin",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "Dokumen - Tetapan",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "Saya faham",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "Anda pasti untuk memadam versi ini?",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "Last generation",
|
|
3
2
|
"components.Row.open": "Open",
|
|
4
3
|
"components.Row.regenerate": "Regenerate",
|
|
5
4
|
"containers.HomePage.Block.title": "Versions",
|
|
6
|
-
"containers.HomePage.Button.open": "Open the documentation",
|
|
7
5
|
"containers.HomePage.Button.update": "Update",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "Configure the documentation plugin",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "Documentation - Settings",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "I understand",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "Are you sure you want to delete this version?",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "Data ostatniego wygenerowania",
|
|
3
2
|
"components.Row.open": "Otwórz",
|
|
4
3
|
"components.Row.regenerate": "Wygeneruj ponownie",
|
|
5
4
|
"containers.HomePage.Block.title": "Wersje",
|
|
6
|
-
"containers.HomePage.Button.open": "Otwórz dokumentację",
|
|
7
5
|
"containers.HomePage.Button.update": "Zaktualizuj",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "Skonfiguruj plugin dokumentacjis",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "Dokuemntacja - Ustawienia",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "Rozumiem",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "Czy jesteś pewien, że chcesz usunąć tę wersję?",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "Last generation",
|
|
3
2
|
"components.Row.open": "Open",
|
|
4
3
|
"components.Row.regenerate": "Regenerate",
|
|
5
4
|
"containers.HomePage.Block.title": "Versions",
|
|
6
|
-
"containers.HomePage.Button.open": "Open the documentation",
|
|
7
5
|
"containers.HomePage.Button.update": "Update",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "Configure the documentation plugin",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "Documentation - Settings",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "I understand",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "Are you sure you want to delete this version?",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "Last generation",
|
|
3
2
|
"components.Row.open": "Open",
|
|
4
3
|
"components.Row.regenerate": "Regenerate",
|
|
5
4
|
"containers.HomePage.Block.title": "Versions",
|
|
6
|
-
"containers.HomePage.Button.open": "Open the documentation",
|
|
7
5
|
"containers.HomePage.Button.update": "Update",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "Configure the documentation plugin",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "Documentation - Settings",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "I understand",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "Are you sure you want to delete this version?",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "Последнее обновление",
|
|
3
2
|
"components.Row.open": "Открыть",
|
|
4
3
|
"components.Row.regenerate": "Сгенерировать",
|
|
5
4
|
"containers.HomePage.Block.title": "Версии",
|
|
6
|
-
"containers.HomePage.Button.open": "Открыть документацию",
|
|
7
5
|
"containers.HomePage.Button.update": "Обновить",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "Настройте плагин документации",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "Документация - Настройки",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "Я понимаю",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "Вы уверены что хотите удалить эту версию?",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "Posledný dátum vygenerovania",
|
|
3
2
|
"components.Row.open": "Otvoriť",
|
|
4
3
|
"components.Row.regenerate": "Znova vygenerovať",
|
|
5
4
|
"containers.HomePage.Block.title": "Verzie",
|
|
6
|
-
"containers.HomePage.Button.open": "Otvoriť dokumentáciu",
|
|
7
5
|
"containers.HomePage.Button.update": "Upraviť",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "Nastavenia dokumentácie",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "Dokumentácia - Nastavenia",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "Rozumiem",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "Ste si istý, že chcete odstrániť túto verziu?",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "การสร้างล่าสุด",
|
|
3
2
|
"components.Row.open": "เปิด",
|
|
4
3
|
"components.Row.regenerate": "สร้างใหม่",
|
|
5
4
|
"containers.HomePage.Block.title": "เวอร์ชัน",
|
|
6
|
-
"containers.HomePage.Button.open": "เปิดเอกสารคู่มือ",
|
|
7
5
|
"containers.HomePage.Button.update": "อัพเดต",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "กำหนดค่าปลั๊กอินเอกสารคู่มือ",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "เอกสารคู่มือ - การตั้งค่า",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "ฉันเข้าใจ",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "คุณแน่ใจว่าต้องการลบเวอร์ชันนี้หรือไม่?",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "Last generation",
|
|
3
2
|
"components.Row.open": "Open",
|
|
4
3
|
"components.Row.regenerate": "Regenerate",
|
|
5
4
|
"containers.HomePage.Block.title": "Versions",
|
|
6
|
-
"containers.HomePage.Button.open": "Open the documentation",
|
|
7
5
|
"containers.HomePage.Button.update": "Update",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "Configure the documentation plugin",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "Documentation - Settings",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "I understand",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "Are you sure you want to delete this version?",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "Згенеровано востаннє",
|
|
3
2
|
"components.Row.open": "Відкрити",
|
|
4
3
|
"components.Row.regenerate": "Згенерувати",
|
|
5
4
|
"containers.HomePage.Block.title": "Версії",
|
|
6
|
-
"containers.HomePage.Button.open": "Відкрити документацію",
|
|
7
5
|
"containers.HomePage.Button.update": "Оновити",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "Налаштуйте плаґін документації",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "Документація - Налаштування",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "Я усвідомлюю",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "Ви впевнені, що хочете видалити цю версію?",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "Lần sinh ra gần nhất",
|
|
3
2
|
"components.Row.open": "Mở",
|
|
4
3
|
"components.Row.regenerate": "Sinh lại",
|
|
5
4
|
"containers.HomePage.Block.title": "Các Phiên Bản",
|
|
6
|
-
"containers.HomePage.Button.open": "Mở tải liệu",
|
|
7
5
|
"containers.HomePage.Button.update": "Cập nhật",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "Cấu hình cho tài liệu của plugin",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "Tài liệu - Cài đặt",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "Tôi hiểu",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "Bạn có chắc là muốn xóa phiên bản này không?",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "上一个生成的版本",
|
|
3
2
|
"components.Row.open": "打开",
|
|
4
3
|
"components.Row.regenerate": "重新生成",
|
|
5
4
|
"containers.HomePage.Block.title": "版本号",
|
|
6
|
-
"containers.HomePage.Button.open": "打开文档",
|
|
7
5
|
"containers.HomePage.Button.update": "更新",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "配置文档插件",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "文档 - 设置",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "我确定",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "您确定要删除此版本吗?",
|
|
@@ -22,10 +19,10 @@
|
|
|
22
19
|
"error.noVersion": "需要一个版本",
|
|
23
20
|
"error.regenerateDoc": "重新生成文件时发生错误",
|
|
24
21
|
"error.regenerateDoc.versionMissing": "您尝试重新生成的版本不存在",
|
|
25
|
-
"notification.update.success": "设置更新成功",
|
|
26
22
|
"notification.delete.success": "文档删除成功",
|
|
27
23
|
"notification.generate.success": "文档生成成功",
|
|
28
|
-
"
|
|
24
|
+
"notification.update.success": "设置更新成功",
|
|
29
25
|
"plugin.description.long": "创建OpenAPI文档并使用SwaggerUI可视化你的API",
|
|
30
|
-
"plugin.description.short": "创建OpenAPI文档并使用SwaggerUI可视化你的API"
|
|
26
|
+
"plugin.description.short": "创建OpenAPI文档并使用SwaggerUI可视化你的API",
|
|
27
|
+
"plugin.name": "文档"
|
|
31
28
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components.Row.generatedDate": "最後產生的時間",
|
|
3
2
|
"components.Row.open": "開啟",
|
|
4
3
|
"components.Row.regenerate": "重新產生",
|
|
5
4
|
"containers.HomePage.Block.title": "版本",
|
|
6
|
-
"containers.HomePage.Button.open": "打開文件資料",
|
|
7
5
|
"containers.HomePage.Button.update": "更新",
|
|
8
|
-
"containers.HomePage.PluginHeader.description": "配置文件資料擴充套件設定",
|
|
9
6
|
"containers.HomePage.PluginHeader.title": "文件資料 - 設定",
|
|
10
7
|
"containers.HomePage.PopUpWarning.confirm": "我了解了",
|
|
11
8
|
"containers.HomePage.PopUpWarning.message": "你確定要刪除這個版本嗎?",
|
package/package.json
CHANGED
|
@@ -1,72 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/plugin-documentation",
|
|
3
|
-
"version": "4.0.0
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Create an OpenAPI Document and visualize your API with SWAGGER UI.",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/strapi/strapi.git",
|
|
8
|
+
"directory": "packages/plugins/documentation"
|
|
9
|
+
},
|
|
10
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
11
|
+
"author": {
|
|
12
|
+
"name": "Strapi Solutions SAS",
|
|
13
|
+
"email": "hi@strapi.io",
|
|
14
|
+
"url": "https://strapi.io"
|
|
9
15
|
},
|
|
16
|
+
"maintainers": [
|
|
17
|
+
{
|
|
18
|
+
"name": "Strapi Solutions SAS",
|
|
19
|
+
"email": "hi@strapi.io",
|
|
20
|
+
"url": "https://strapi.io"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
10
23
|
"scripts": {
|
|
11
24
|
"test": "echo \"no tests yet\""
|
|
12
25
|
},
|
|
13
26
|
"dependencies": {
|
|
14
|
-
"@strapi/helper-plugin": "4.0.0
|
|
27
|
+
"@strapi/helper-plugin": "4.0.0",
|
|
28
|
+
"@strapi/utils": "4.0.0",
|
|
29
|
+
"bcryptjs": "2.4.3",
|
|
15
30
|
"cheerio": "^1.0.0-rc.5",
|
|
16
31
|
"fs-extra": "^9.1.0",
|
|
32
|
+
"koa-session": "6.2.0",
|
|
17
33
|
"koa-static": "^5.0.0",
|
|
18
34
|
"lodash": "4.17.21",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
35
|
+
"path-to-regexp": "6.2.0",
|
|
36
|
+
"pluralize": "8.0.0",
|
|
21
37
|
"react": "^17.0.2",
|
|
22
38
|
"react-copy-to-clipboard": "^5.0.3",
|
|
23
39
|
"react-dom": "^17.0.2",
|
|
24
40
|
"react-intl": "5.20.2",
|
|
25
41
|
"react-redux": "7.2.3",
|
|
26
42
|
"react-router": "^5.2.0",
|
|
27
|
-
"react-router-dom": "
|
|
28
|
-
"reactstrap": "8.4.1",
|
|
43
|
+
"react-router-dom": "5.2.0",
|
|
29
44
|
"redux": "^4.0.1",
|
|
30
45
|
"reselect": "^4.0.0",
|
|
31
46
|
"swagger-ui-dist": "3.47.1"
|
|
32
47
|
},
|
|
33
|
-
"author": {
|
|
34
|
-
"name": "soupette",
|
|
35
|
-
"email": "hi@strapi.io",
|
|
36
|
-
"url": "https://strapi.io"
|
|
37
|
-
},
|
|
38
|
-
"maintainers": [
|
|
39
|
-
{
|
|
40
|
-
"name": "Strapi",
|
|
41
|
-
"email": "hi@strapi.io",
|
|
42
|
-
"url": "https://strapi.io"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"name": "soupette",
|
|
46
|
-
"email": "cyril@strapi.io"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"name": "lauriejim",
|
|
50
|
-
"email": "jim@strapi.io"
|
|
51
|
-
}
|
|
52
|
-
],
|
|
53
|
-
"contributors": [
|
|
54
|
-
{
|
|
55
|
-
"name": "soupette"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"name": "Aurelsicoko",
|
|
59
|
-
"email": "aurelien@strapi.io"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"name": "lauriejim",
|
|
63
|
-
"email": "jim@strapi.io"
|
|
64
|
-
}
|
|
65
|
-
],
|
|
66
48
|
"engines": {
|
|
67
49
|
"node": ">=12.x.x <=16.x.x",
|
|
68
50
|
"npm": ">=6.0.0"
|
|
69
51
|
},
|
|
70
|
-
"
|
|
71
|
-
|
|
52
|
+
"strapi": {
|
|
53
|
+
"displayName": "Documentation",
|
|
54
|
+
"name": "documentation",
|
|
55
|
+
"description": "Create an OpenAPI Document and visualize your API with SWAGGER UI.",
|
|
56
|
+
"kind": "plugin"
|
|
57
|
+
},
|
|
58
|
+
"gitHead": "b181702f0202b2c6d645d42b195a831f25cd0b03"
|
|
72
59
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* eslint-disable no-unreachable */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
// Add permissions
|
|
5
|
+
const RBAC_ACTIONS = [
|
|
6
|
+
{
|
|
7
|
+
section: 'plugins',
|
|
8
|
+
displayName: 'Access the Documentation',
|
|
9
|
+
uid: 'read',
|
|
10
|
+
pluginName: 'documentation',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
section: 'plugins',
|
|
14
|
+
displayName: 'Update and delete',
|
|
15
|
+
uid: 'settings.update',
|
|
16
|
+
pluginName: 'documentation',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
section: 'plugins',
|
|
20
|
+
displayName: 'Regenerate',
|
|
21
|
+
uid: 'settings.regenerate',
|
|
22
|
+
pluginName: 'documentation',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
section: 'settings',
|
|
26
|
+
displayName: 'Access the documentation settings page',
|
|
27
|
+
uid: 'settings.read',
|
|
28
|
+
pluginName: 'documentation',
|
|
29
|
+
category: 'documentation',
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param {{strapi: import("@strapi/strapi").Strapi}} args
|
|
36
|
+
*/
|
|
37
|
+
module.exports = async ({ strapi }) => {
|
|
38
|
+
await strapi.admin.services.permission.actionProvider.registerMany(RBAC_ACTIONS);
|
|
39
|
+
|
|
40
|
+
const pluginStore = strapi.store({
|
|
41
|
+
environment: '',
|
|
42
|
+
type: 'plugin',
|
|
43
|
+
name: 'documentation',
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const config = await pluginStore.get({ key: 'config' });
|
|
47
|
+
|
|
48
|
+
if (!config) {
|
|
49
|
+
pluginStore.set({ key: 'config', value: { restrictedAccess: false } });
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
await strapi
|
|
53
|
+
.plugin('documentation')
|
|
54
|
+
.service('documentation')
|
|
55
|
+
.generateFullDoc();
|
|
56
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
openapi: '3.0.0',
|
|
5
|
+
info: {
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
title: 'DOCUMENTATION',
|
|
8
|
+
description: '',
|
|
9
|
+
termsOfService: 'YOUR_TERMS_OF_SERVICE_URL',
|
|
10
|
+
contact: {
|
|
11
|
+
name: 'TEAM',
|
|
12
|
+
email: 'contact-email@something.io',
|
|
13
|
+
url: 'mywebsite.io',
|
|
14
|
+
},
|
|
15
|
+
license: {
|
|
16
|
+
name: 'Apache 2.0',
|
|
17
|
+
url: 'https://www.apache.org/licenses/LICENSE-2.0.html',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
'x-strapi-config': {
|
|
21
|
+
path: '/documentation',
|
|
22
|
+
showGeneratedFiles: true,
|
|
23
|
+
generateDefaultResponse: true,
|
|
24
|
+
plugins: ['email', 'upload'],
|
|
25
|
+
},
|
|
26
|
+
servers: [],
|
|
27
|
+
externalDocs: {
|
|
28
|
+
description: 'Find out more',
|
|
29
|
+
url: 'https://docs.strapi.io/developer-docs/latest/getting-started/introduction.html',
|
|
30
|
+
},
|
|
31
|
+
security: [
|
|
32
|
+
{
|
|
33
|
+
bearerAuth: [],
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
components: {
|
|
37
|
+
securitySchemes: {
|
|
38
|
+
bearerAuth: {
|
|
39
|
+
type: 'http',
|
|
40
|
+
scheme: 'bearer',
|
|
41
|
+
bearerFormat: 'JWT',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const defaultDocumentationConfig = require('./default-config');
|
|
4
|
+
|
|
5
|
+
const defaultConfig = {
|
|
6
|
+
...defaultDocumentationConfig,
|
|
7
|
+
session: {
|
|
8
|
+
key: 'plugin::documentation.sess',
|
|
9
|
+
maxAge: 'session',
|
|
10
|
+
secretKeys: ['mySecret'],
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
module.exports = {
|
|
15
|
+
default: defaultConfig,
|
|
16
|
+
};
|