@strapi/plugin-documentation 4.2.0 → 4.3.0-beta.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/plugin-documentation",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0-beta.1",
|
|
4
4
|
"description": "Create an OpenAPI Document and visualize your API with SWAGGER UI.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"test": "echo \"no tests yet\""
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@strapi/helper-plugin": "4.
|
|
28
|
-
"@strapi/utils": "4.
|
|
27
|
+
"@strapi/helper-plugin": "4.3.0-beta.1",
|
|
28
|
+
"@strapi/utils": "4.3.0-beta.1",
|
|
29
29
|
"bcryptjs": "2.4.3",
|
|
30
30
|
"cheerio": "^1.0.0-rc.5",
|
|
31
31
|
"fs-extra": "10.0.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": "9d6555398960c39159d66bb4eea3bcb0362e37e3"
|
|
61
61
|
}
|
|
@@ -49,7 +49,7 @@ module.exports = {
|
|
|
49
49
|
.getDocumentationVersion();
|
|
50
50
|
|
|
51
51
|
const openAPISpecsPath = path.join(
|
|
52
|
-
strapi.dirs.extensions,
|
|
52
|
+
strapi.dirs.app.extensions,
|
|
53
53
|
'documentation',
|
|
54
54
|
'documentation',
|
|
55
55
|
version,
|
|
@@ -69,7 +69,7 @@ module.exports = {
|
|
|
69
69
|
|
|
70
70
|
try {
|
|
71
71
|
const layoutPath = path.resolve(
|
|
72
|
-
strapi.dirs.extensions,
|
|
72
|
+
strapi.dirs.app.extensions,
|
|
73
73
|
'documentation',
|
|
74
74
|
'public',
|
|
75
75
|
'index.html'
|
|
@@ -81,7 +81,11 @@ module.exports = {
|
|
|
81
81
|
ctx.url = path.basename(`${ctx.url}/index.html`);
|
|
82
82
|
|
|
83
83
|
try {
|
|
84
|
-
const staticFolder = path.resolve(
|
|
84
|
+
const staticFolder = path.resolve(
|
|
85
|
+
strapi.dirs.app.extensions,
|
|
86
|
+
'documentation',
|
|
87
|
+
'public'
|
|
88
|
+
);
|
|
85
89
|
return koaStatic(staticFolder)(ctx, next);
|
|
86
90
|
} catch (e) {
|
|
87
91
|
strapi.log.error(e);
|
|
@@ -116,7 +120,7 @@ module.exports = {
|
|
|
116
120
|
|
|
117
121
|
try {
|
|
118
122
|
const layoutPath = path.resolve(
|
|
119
|
-
strapi.dirs.extensions,
|
|
123
|
+
strapi.dirs.app.extensions,
|
|
120
124
|
'documentation',
|
|
121
125
|
'public',
|
|
122
126
|
'login.html'
|
|
@@ -127,7 +131,7 @@ module.exports = {
|
|
|
127
131
|
ctx.url = path.basename(`${ctx.url}/login.html`);
|
|
128
132
|
|
|
129
133
|
try {
|
|
130
|
-
const staticFolder = path.resolve(strapi.dirs.extensions, 'documentation', 'public');
|
|
134
|
+
const staticFolder = path.resolve(strapi.dirs.app.extensions, 'documentation', 'public');
|
|
131
135
|
return koaStatic(staticFolder)(ctx, next);
|
|
132
136
|
} catch (e) {
|
|
133
137
|
strapi.log.error(e);
|
|
@@ -17,11 +17,12 @@ module.exports = ({ strapi }) => {
|
|
|
17
17
|
},
|
|
18
18
|
|
|
19
19
|
getFullDocumentationPath() {
|
|
20
|
-
return path.join(strapi.dirs.extensions, 'documentation', 'documentation');
|
|
20
|
+
return path.join(strapi.dirs.app.extensions, 'documentation', 'documentation');
|
|
21
21
|
},
|
|
22
22
|
|
|
23
23
|
getCustomDocumentationPath() {
|
|
24
|
-
|
|
24
|
+
// ??
|
|
25
|
+
return path.join(strapi.dirs.app.extensions, 'documentation', 'config', 'settings.json');
|
|
25
26
|
},
|
|
26
27
|
|
|
27
28
|
getDocumentationVersions() {
|
|
@@ -71,10 +72,10 @@ module.exports = ({ strapi }) => {
|
|
|
71
72
|
*/
|
|
72
73
|
getApiDocumentationPath(api) {
|
|
73
74
|
if (api.getter === 'plugin') {
|
|
74
|
-
return path.join(strapi.dirs.extensions, api.name, 'documentation');
|
|
75
|
+
return path.join(strapi.dirs.app.extensions, api.name, 'documentation');
|
|
75
76
|
}
|
|
76
77
|
|
|
77
|
-
return path.join(strapi.dirs.api, api.name, 'documentation');
|
|
78
|
+
return path.join(strapi.dirs.app.api, api.name, 'documentation');
|
|
78
79
|
},
|
|
79
80
|
|
|
80
81
|
async deleteDocumentation(version) {
|