@strapi/plugin-documentation 4.0.7 → 4.1.1-alpha.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.
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
2
|
+
"coming-soon": "Indholdet er på nuværende tidspunkt under konstruktion og kommer tilbage om et par uger!",
|
|
3
|
+
"components.Row.open": "Åben",
|
|
4
|
+
"components.Row.regenerate": "Regenerér",
|
|
5
|
+
"containers.HomePage.Block.title": "Versioner",
|
|
6
|
+
"containers.HomePage.Button.update": "Opdatér",
|
|
7
|
+
"containers.HomePage.PluginHeader.title": "Dokumentation - Indstillinger",
|
|
8
|
+
"containers.HomePage.PopUpWarning.confirm": "Jeg forstår",
|
|
9
|
+
"containers.HomePage.PopUpWarning.message": "Er du sikker på at du vil slette denne version?",
|
|
10
|
+
"containers.HomePage.copied": "Token kopieret til klippebord",
|
|
11
|
+
"containers.HomePage.form.jwtToken": "Hent dit jwt token",
|
|
12
|
+
"containers.HomePage.form.jwtToken.description": "Kopier dette token og brug det i swagger når du laver requests",
|
|
13
|
+
"containers.HomePage.form.password": "Kodeord",
|
|
14
|
+
"containers.HomePage.form.password.inputDescription": "Indstil kodeordet for at tilgå dokumentationen",
|
|
15
|
+
"containers.HomePage.form.restrictedAccess": "Begrænset adgang",
|
|
16
|
+
"containers.HomePage.form.restrictedAccess.inputDescription": "Gør dokumentationens endpoint private. Som standard er det offentligt",
|
|
17
|
+
"containers.HomePage.form.showGeneratedFiles": "Vis genererede filer",
|
|
18
|
+
"containers.HomePage.form.showGeneratedFiles.inputDescription": "Nyttig når du vil overskrive den genererede dokumentation. \nPluginnet vil generere filter splittet af model og plugin. \nVed at aktivere denne option bliver det nemmere at tilpasse din dokumentation",
|
|
19
|
+
"error.deleteDoc.versionMissing": "Versionen du prøver at slette, findes ikke.",
|
|
20
|
+
"error.noVersion": "En version er påkrævet",
|
|
21
|
+
"error.regenerateDoc": "Der opstod en fejl ved generering af dokumentation",
|
|
22
|
+
"error.regenerateDoc.versionMissing": "Versionen du forsøger at generere findes ikke",
|
|
23
|
+
"notification.delete.success": "Dokumentation slettet",
|
|
24
|
+
"notification.generate.success": "Dokumentation genereret",
|
|
25
|
+
"notification.update.success": "Indstillingerne er opdateret",
|
|
26
|
+
"pages.PluginPage.Button.open": "Åben dokumentation",
|
|
27
|
+
"pages.PluginPage.header.description": "Konfigurér dokumentations pluginnet",
|
|
28
|
+
"pages.PluginPage.table.generated": "Sidst genereret",
|
|
29
|
+
"pages.PluginPage.table.icon.delete": "Slet {target}",
|
|
30
|
+
"pages.PluginPage.table.icon.regenerate": "Regenerér {target}",
|
|
31
|
+
"pages.PluginPage.table.icon.show": "Åben {target}",
|
|
32
|
+
"pages.PluginPage.table.version": "Version",
|
|
33
|
+
"pages.SettingsPage.Button.description": "Konfigurér dokumentations pluginnet",
|
|
34
|
+
"pages.SettingsPage.header.save": "Gem",
|
|
35
|
+
"pages.SettingsPage.password.label": "Kodeord",
|
|
36
|
+
"pages.SettingsPage.title": "Indstillinger",
|
|
37
|
+
"pages.SettingsPage.toggle.hint": "Gør dokumentationens endpoint privat",
|
|
38
|
+
"pages.SettingsPage.toggle.label": "Begrænset adgang",
|
|
39
|
+
"plugin.description.long": "Opret et OpenAPI dokument og visualisér dit API med SWAGGER UI.",
|
|
40
|
+
"plugin.description.short": "Opret et OpenAPI dokument og visualisér dit API med SWAGGER UI.",
|
|
41
|
+
"plugin.name": "Dokumentation"
|
|
42
42
|
}
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"pages.PluginPage.table.icon.regenerate": "Regenerate {target}",
|
|
31
31
|
"pages.PluginPage.table.icon.show": "Open {target}",
|
|
32
32
|
"pages.PluginPage.table.version": "Version",
|
|
33
|
-
"pages.SettingsPage.title": "Settings",
|
|
34
33
|
"pages.SettingsPage.Button.description": "Configure the documentation plugin",
|
|
35
34
|
"pages.SettingsPage.header.save": "Save",
|
|
36
35
|
"pages.SettingsPage.password.label": "Password",
|
|
36
|
+
"pages.SettingsPage.title": "Settings",
|
|
37
37
|
"pages.SettingsPage.toggle.hint": "Make the documentation endpoint private",
|
|
38
38
|
"pages.SettingsPage.toggle.label": "Restricted Access",
|
|
39
39
|
"plugin.description.long": "Create an OpenAPI Document and visualize your API with SWAGGER UI.",
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"pages.PluginPage.table.icon.regenerate": "Regenerar {target}",
|
|
31
31
|
"pages.PluginPage.table.icon.show": "Abrir {target}",
|
|
32
32
|
"pages.PluginPage.table.version": "Versión",
|
|
33
|
-
"pages.SettingsPage.title": "Ajustes",
|
|
34
33
|
"pages.SettingsPage.Button.description": "Configura el plugin de documentación",
|
|
35
34
|
"pages.SettingsPage.header.save": "Guardar",
|
|
36
35
|
"pages.SettingsPage.password.label": "Contraseña",
|
|
36
|
+
"pages.SettingsPage.title": "Ajustes",
|
|
37
37
|
"pages.SettingsPage.toggle.hint": "Hacer que la documentación sea privada",
|
|
38
38
|
"pages.SettingsPage.toggle.label": "Acceso restringido",
|
|
39
39
|
"plugin.description.long": "Cree un documento OpenAPI y visualice su API con SWAGGER UI.",
|
|
@@ -30,11 +30,10 @@
|
|
|
30
30
|
"pages.PluginPage.table.icon.regenerate": "{target} 재생성",
|
|
31
31
|
"pages.PluginPage.table.icon.show": "{target} 열기",
|
|
32
32
|
"pages.PluginPage.table.version": "버전",
|
|
33
|
-
"pages.SettingsPage.title": "설정",
|
|
34
|
-
"pages.SettingsPage.header.description": "도큐멘테이션 플러그인 설정",
|
|
35
33
|
"pages.SettingsPage.Button.description": "도큐멘테이션 플러그인 설정",
|
|
36
34
|
"pages.SettingsPage.header.save": "저장",
|
|
37
35
|
"pages.SettingsPage.password.label": "비밀번호",
|
|
36
|
+
"pages.SettingsPage.title": "설정",
|
|
38
37
|
"pages.SettingsPage.toggle.hint": "도큐멘테이션 엔드포인트를 비공개로 설정합니다.",
|
|
39
38
|
"pages.SettingsPage.toggle.label": "액세스 제한",
|
|
40
39
|
"plugin.description.long": "SWAGER UI를 사용하여 오픈 API 문서를 만들고 API를 시각화합니다.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/plugin-documentation",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.1-alpha.0",
|
|
4
4
|
"description": "Create an OpenAPI Document and visualize your API with SWAGGER UI.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"test": "echo \"no tests yet\""
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@strapi/helper-plugin": "4.0
|
|
28
|
-
"@strapi/utils": "4.0
|
|
27
|
+
"@strapi/helper-plugin": "4.1.1-alpha.0",
|
|
28
|
+
"@strapi/utils": "4.1.1-alpha.0",
|
|
29
29
|
"bcryptjs": "2.4.3",
|
|
30
30
|
"cheerio": "^1.0.0-rc.5",
|
|
31
|
-
"fs-extra": "
|
|
31
|
+
"fs-extra": "10.0.0",
|
|
32
32
|
"koa-static": "^5.0.0",
|
|
33
33
|
"lodash": "4.17.21",
|
|
34
34
|
"path-to-regexp": "6.2.0",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"description": "Create an OpenAPI Document and visualize your API with SWAGGER UI.",
|
|
58
58
|
"kind": "plugin"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "bedb04a0cc23719e4eac43e6005fe0fa3d48a9a6"
|
|
61
61
|
}
|
|
@@ -20,6 +20,10 @@ module.exports = ({ strapi }) => {
|
|
|
20
20
|
return path.join(strapi.dirs.extensions, 'documentation', 'documentation');
|
|
21
21
|
},
|
|
22
22
|
|
|
23
|
+
getCustomDocumentationPath() {
|
|
24
|
+
return path.join(strapi.dirs.extensions, 'documentation', 'config', 'settings.json');
|
|
25
|
+
},
|
|
26
|
+
|
|
23
27
|
getDocumentationVersions() {
|
|
24
28
|
return fs
|
|
25
29
|
.readdirSync(this.getFullDocumentationPath())
|
|
@@ -103,6 +107,16 @@ module.exports = ({ strapi }) => {
|
|
|
103
107
|
return [...apisToDocument, ...pluginsToDocument];
|
|
104
108
|
},
|
|
105
109
|
|
|
110
|
+
async getCustomSettings() {
|
|
111
|
+
const customConfigPath = this.getCustomDocumentationPath();
|
|
112
|
+
const pathExists = await fs.pathExists(customConfigPath);
|
|
113
|
+
if (pathExists) {
|
|
114
|
+
return fs.readJson(customConfigPath);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return {};
|
|
118
|
+
},
|
|
119
|
+
|
|
106
120
|
/**
|
|
107
121
|
* @description - Creates the Swagger json files
|
|
108
122
|
*/
|
|
@@ -133,20 +147,24 @@ module.exports = ({ strapi }) => {
|
|
|
133
147
|
'full_documentation.json'
|
|
134
148
|
);
|
|
135
149
|
|
|
136
|
-
const
|
|
150
|
+
const defaultSettings = _.cloneDeep(defaultConfig);
|
|
137
151
|
|
|
138
152
|
const serverUrl = getAbsoluteServerUrl(strapi.config);
|
|
139
153
|
const apiPath = strapi.config.get('api.rest.prefix');
|
|
140
154
|
|
|
141
|
-
_.set(
|
|
155
|
+
_.set(defaultSettings, 'servers', [
|
|
142
156
|
{
|
|
143
157
|
url: `${serverUrl}${apiPath}`,
|
|
144
158
|
description: 'Development server',
|
|
145
159
|
},
|
|
146
160
|
]);
|
|
147
161
|
|
|
148
|
-
_.set(
|
|
149
|
-
_.set(
|
|
162
|
+
_.set(defaultSettings, ['info', 'x-generation-date'], new Date().toISOString());
|
|
163
|
+
_.set(defaultSettings, ['info', 'version'], version);
|
|
164
|
+
|
|
165
|
+
const customSettings = await this.getCustomSettings();
|
|
166
|
+
|
|
167
|
+
const settings = _.merge(defaultSettings, customSettings);
|
|
150
168
|
|
|
151
169
|
await fs.ensureFile(fullDocJsonPath);
|
|
152
170
|
await fs.writeJson(fullDocJsonPath, { ...settings, paths }, { spaces: 2 });
|