@seip/blue-bird 0.4.3 → 0.4.5
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 +21 -0
- package/backend/index.js +1 -1
- package/backend/routes/api.js +31 -31
- package/backend/routes/frontend.js +3 -3
- package/core/auth.js +61 -30
- package/core/cli/scaffolding-auth.js +1037 -0
- package/core/swagger.js +40 -25
- package/frontend/public/robots.txt +0 -0
- package/frontend/public/sitemap.xml +0 -0
- package/package.json +1 -1
package/core/swagger.js
CHANGED
|
@@ -1,25 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import { execSync } from "node:child_process";
|
|
2
|
+
|
|
3
|
+
class SwaggerCli {
|
|
4
|
+
install() {
|
|
5
|
+
const dependencies = this.checkDependencies();
|
|
6
|
+
if (dependencies.missingDependencies.length > 0) {
|
|
7
|
+
console.log("Installing dependencies...");
|
|
8
|
+
console.log(`Installing swagger-jsdoc...`);
|
|
9
|
+
execSync(`npm install swagger-jsdoc@6.2.8`, { stdio: "inherit" });
|
|
10
|
+
console.log(`Installing swagger-ui-express...`);
|
|
11
|
+
execSync(`npm install swagger-ui-express@5.0.1`, { stdio: "inherit" });
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
checkDependencies() {
|
|
15
|
+
const dependencies = [
|
|
16
|
+
"swagger-jsdoc",
|
|
17
|
+
"swagger-ui-express"
|
|
18
|
+
];
|
|
19
|
+
const missingDependencies = [];
|
|
20
|
+
dependencies.forEach(dependency => {
|
|
21
|
+
if (!this.checkDependency(dependency)) {
|
|
22
|
+
missingDependencies.push(dependency);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
missingDependencies
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
checkDependency(dependency) {
|
|
30
|
+
try {
|
|
31
|
+
require.resolve(dependency);
|
|
32
|
+
return true;
|
|
33
|
+
} catch (error) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const swaggerExecutor = new SwaggerCli();
|
|
40
|
+
swaggerExecutor.install();
|
|
File without changes
|
|
File without changes
|