@tremho/mist-lift 1.0.2-pre-release.4 → 1.0.2

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.
Files changed (107) hide show
  1. package/README.md +12 -0
  2. package/build/commands/actions/initQuestions.js +24 -22
  3. package/build/commands/actions/initQuestions.js.map +1 -1
  4. package/build/commands/actions/setupPackageJson.js +4 -4
  5. package/build/commands/actions/setupPackageJson.js.map +1 -1
  6. package/build/commands/build.js +31 -25
  7. package/build/commands/build.js.map +1 -1
  8. package/build/commands/builtin/ApiDocMaker.js +60 -23
  9. package/build/commands/builtin/ApiDocMaker.js.map +1 -1
  10. package/build/commands/builtin/BuiltInHandler.js +6 -6
  11. package/build/commands/builtin/BuiltInHandler.js.map +1 -1
  12. package/build/commands/builtin/DeployBuiltInZip.js +4 -4
  13. package/build/commands/builtin/DeployBuiltInZip.js.map +1 -1
  14. package/build/commands/builtin/StageWebrootZip.js +1 -0
  15. package/build/commands/builtin/StageWebrootZip.js.map +1 -1
  16. package/build/commands/create.js +10 -11
  17. package/build/commands/create.js.map +1 -1
  18. package/build/commands/deploy.js +38 -42
  19. package/build/commands/deploy.js.map +1 -1
  20. package/build/commands/doctor.js +38 -37
  21. package/build/commands/doctor.js.map +1 -1
  22. package/build/commands/help.js +93 -93
  23. package/build/commands/help.js.map +1 -1
  24. package/build/commands/init.js +7 -7
  25. package/build/commands/init.js.map +1 -1
  26. package/build/commands/package.js +50 -51
  27. package/build/commands/package.js.map +1 -1
  28. package/build/commands/publish.js +98 -102
  29. package/build/commands/publish.js.map +1 -1
  30. package/build/commands/settings.js +19 -18
  31. package/build/commands/settings.js.map +1 -1
  32. package/build/commands/start.js +4 -4
  33. package/build/commands/start.js.map +1 -1
  34. package/build/commands/test.js +3 -3
  35. package/build/commands/test.js.map +1 -1
  36. package/build/commands/user.js +1 -1
  37. package/build/commands/user.js.map +1 -1
  38. package/build/expressRoutes/all.js +27 -26
  39. package/build/expressRoutes/all.js.map +1 -1
  40. package/build/expressRoutes/api.js +9 -7
  41. package/build/expressRoutes/api.js.map +1 -1
  42. package/build/expressRoutes/functionBinder.js +38 -36
  43. package/build/expressRoutes/functionBinder.js.map +1 -1
  44. package/build/lib/CaseUtils.js +2 -2
  45. package/build/lib/CaseUtils.js.map +1 -1
  46. package/build/lib/DirectoryUtils.js +4 -3
  47. package/build/lib/DirectoryUtils.js.map +1 -1
  48. package/build/lib/LiftConfig.js +18 -20
  49. package/build/lib/LiftConfig.js.map +1 -1
  50. package/build/lib/LiftVersion.js +17 -12
  51. package/build/lib/LiftVersion.js.map +1 -1
  52. package/build/lib/Tests/fileCompare.test.js +11 -10
  53. package/build/lib/Tests/fileCompare.test.js.map +1 -1
  54. package/build/lib/askQuestion.js +3 -2
  55. package/build/lib/askQuestion.js.map +1 -1
  56. package/build/lib/executeCommand.js +46 -33
  57. package/build/lib/executeCommand.js.map +1 -1
  58. package/build/lib/fileCompare.js +9 -8
  59. package/build/lib/fileCompare.js.map +1 -1
  60. package/build/lib/openAPI/ApiBuildCollector.js +9 -8
  61. package/build/lib/openAPI/ApiBuildCollector.js.map +1 -1
  62. package/build/lib/openAPI/WebrootFileSupport.js +4 -3
  63. package/build/lib/openAPI/WebrootFileSupport.js.map +1 -1
  64. package/build/lib/openAPI/openApiConstruction.js +62 -61
  65. package/build/lib/openAPI/openApiConstruction.js.map +1 -1
  66. package/build/lib/pathResolve.js +4 -4
  67. package/build/lib/pathResolve.js.map +1 -1
  68. package/build/lib/utils.js +5 -4
  69. package/build/lib/utils.js.map +1 -1
  70. package/build/lift.js +14 -15
  71. package/build/lift.js.map +1 -1
  72. package/package.json +2 -1
  73. package/src/commands/actions/initQuestions.ts +112 -112
  74. package/src/commands/actions/setupPackageJson.ts +21 -25
  75. package/src/commands/build.ts +143 -146
  76. package/src/commands/builtin/ApiDocMaker.ts +86 -54
  77. package/src/commands/builtin/BuiltInHandler.ts +31 -35
  78. package/src/commands/builtin/DeployBuiltInZip.ts +15 -17
  79. package/src/commands/builtin/StageWebrootZip.ts +29 -32
  80. package/src/commands/create.ts +40 -47
  81. package/src/commands/deploy.ts +139 -152
  82. package/src/commands/doctor.ts +86 -82
  83. package/src/commands/help.ts +152 -153
  84. package/src/commands/init.ts +37 -39
  85. package/src/commands/package.ts +201 -204
  86. package/src/commands/publish.ts +277 -312
  87. package/src/commands/settings.ts +67 -70
  88. package/src/commands/start.ts +32 -37
  89. package/src/commands/test.ts +15 -16
  90. package/src/commands/user.ts +1 -1
  91. package/src/expressRoutes/all.ts +73 -78
  92. package/src/expressRoutes/api.ts +14 -16
  93. package/src/expressRoutes/functionBinder.ts +144 -151
  94. package/src/lib/CaseUtils.ts +49 -54
  95. package/src/lib/DirectoryUtils.ts +25 -27
  96. package/src/lib/LiftConfig.ts +46 -54
  97. package/src/lib/LiftVersion.ts +69 -77
  98. package/src/lib/Tests/fileCompare.test.ts +27 -26
  99. package/src/lib/askQuestion.ts +12 -13
  100. package/src/lib/executeCommand.ts +40 -33
  101. package/src/lib/fileCompare.ts +46 -37
  102. package/src/lib/openAPI/ApiBuildCollector.ts +36 -36
  103. package/src/lib/openAPI/WebrootFileSupport.ts +15 -17
  104. package/src/lib/openAPI/openApiConstruction.ts +169 -175
  105. package/src/lib/pathResolve.ts +22 -28
  106. package/src/lib/utils.ts +31 -33
  107. package/src/lift.ts +68 -67
@@ -1,76 +1,73 @@
1
- import path from "path";
2
- import fs from "fs";
3
- import {LiftConfig, RuntimeType} from '../lib/LiftConfig'
4
- import {homedir} from 'os'
5
- import {ask} from "../lib/askQuestion";
1
+ import path from 'path'
2
+ import fs from 'fs'
3
+ import { LiftConfig, RuntimeType } from '../lib/LiftConfig'
4
+ import { homedir } from 'os'
5
+ import { ask } from '../lib/askQuestion'
6
6
  import * as ac from 'ansi-colors'
7
7
 
8
+ export async function doSettings (): Promise<number> {
9
+ try {
10
+ const mistLiftPath = path.join(homedir(), '.mistlift')
11
+ let settings: LiftConfig = { cloudHost: 'AWS' }
12
+ if (fs.existsSync(mistLiftPath)) {
13
+ settings = JSON.parse(fs.readFileSync(mistLiftPath).toString())
14
+ }
8
15
 
9
- export async function doSettings()
10
- {
11
-
12
- try {
13
- const mistLiftPath = path.join(homedir(), ".mistlift")
14
- let settings:LiftConfig = {cloudHost: "AWS"}
15
- if(fs.existsSync(mistLiftPath)) {
16
- settings = JSON.parse(fs.readFileSync(mistLiftPath).toString())
17
- }
18
-
19
- let ok = false;
20
- while(!ok) {
21
- settings.cloudHost = ask("Type of cloud host (AWS)",
22
- "cloud host",
23
- settings.cloudHost
24
- )
25
- ok = settings.cloudHost == "AWS" // all we support now
26
- }
27
- ok = false
28
-
29
- if(settings.cloudHost === "AWS") {
30
- console.log("Choose from a configured AWS profile, or leave empty to use a custom credentials config file")
31
- while (!ok) {
32
- settings.awsIniProfile = ask("Name of AWS profile to use",
33
- "AWS Profile",
34
- settings.awsIniProfile??"default"
35
- )
36
- ok = settings.awsIniProfile !== "";
37
- }
38
- ok = false;
39
- let runtime:string = settings.awsNodeRuntime as string
40
- while(!ok) {
41
- runtime = ask("AWS Node Runtime Version",
42
- "NodeJS Runtime",
43
- "Nodejs20.x"
44
- )
45
- ok = !!runtime
46
- }
47
- settings.awsNodeRuntime = runtime.toLowerCase() as RuntimeType
16
+ let ok = false
17
+ while (!ok) {
18
+ settings.cloudHost = ask('Type of cloud host (AWS)',
19
+ 'cloud host',
20
+ settings.cloudHost
21
+ )
22
+ ok = settings.cloudHost === 'AWS' // all we support now
23
+ }
24
+ ok = false
48
25
 
49
- ok = false;
50
- while(!ok) {
51
- settings.awsPreferredRegion = ask("Preferred AWS region",
52
- "preferred AWS region",
53
- settings.awsPreferredRegion??"us-east-1"
54
- )
55
- ok = !!settings.awsPreferredRegion
56
- }
57
- ok = false;
58
- console.log("Supply the ARN for the service role you have created in your AWS IAM account for Lambda, S3, and Cloudwatch access")
59
- while(!ok) {
60
- settings.awsServiceRoleARN = ask("AWS service role ARN",
61
- "serviceRole ARN",
62
- settings.awsServiceRoleARN??"arn:aws.iam::xxxxxxxxxxxx:role/service-role-name"
63
- )
64
- ok = settings.awsServiceRoleARN !== "arn:aws.iam::xxxxxxxxxxxx:role/service-role-name"
65
- && settings.awsServiceRoleARN !== ""
66
- }
67
- }
68
- fs.writeFileSync(mistLiftPath, JSON.stringify(settings))
26
+ if (settings.cloudHost === 'AWS') {
27
+ ok = false
28
+ console.log('Choose from a configured AWS profile, or leave empty to use a custom credentials config file')
29
+ while (!ok) {
30
+ settings.awsIniProfile = ask('Name of AWS profile to use',
31
+ 'AWS Profile',
32
+ settings.awsIniProfile ?? 'default'
33
+ )
34
+ ok = settings.awsIniProfile !== ''
35
+ }
36
+ ok = false
37
+ let runtime: string = settings.awsNodeRuntime as string
38
+ while (!ok) {
39
+ runtime = ask('AWS Node Runtime Version',
40
+ 'NodeJS Runtime',
41
+ 'Nodejs20.x'
42
+ )
43
+ ok = runtime !== ''
44
+ }
45
+ settings.awsNodeRuntime = runtime.toLowerCase() as RuntimeType
69
46
 
70
- return 0;
71
- }
72
- catch(e:any) {
73
- console.error(ac.bold.red("Error with settings:"), e)
74
- return -1;
47
+ ok = false
48
+ while (!ok) {
49
+ settings.awsPreferredRegion = ask('Preferred AWS region',
50
+ 'preferred AWS region',
51
+ settings.awsPreferredRegion ?? 'us-east-1'
52
+ )
53
+ ok = (settings.awsPreferredRegion ?? '') !== ''
54
+ }
55
+ ok = false
56
+ console.log('Supply the ARN for the service role you have created in your AWS IAM account for Lambda and Cloudwatch access')
57
+ while (!ok) {
58
+ settings.awsServiceRoleARN = ask('AWS service role ARN',
59
+ 'serviceRole ARN',
60
+ settings.awsServiceRoleARN ?? 'arn:aws.iam::xxxxxxxxxxxx:role/service-role-name'
61
+ )
62
+ ok = settings.awsServiceRoleARN !== 'arn:aws.iam::xxxxxxxxxxxx:role/service-role-name' &&
63
+ settings.awsServiceRoleARN !== ''
64
+ }
75
65
  }
76
- }
66
+ fs.writeFileSync(mistLiftPath, JSON.stringify(settings))
67
+
68
+ return 0
69
+ } catch (e: any) {
70
+ console.error(ac.bold.red('Error with settings:'), e)
71
+ return -1
72
+ }
73
+ }
@@ -1,46 +1,41 @@
1
1
  /** Run Express Server */
2
2
  import express from 'express'
3
- import fs from 'fs'
4
- import path from 'path'
5
- import bodyParser from 'body-parser'
6
3
 
7
- import functionRouter, {functionBinder} from "../expressRoutes/functionBinder"
4
+ import functionRouter, { functionBinder } from '../expressRoutes/functionBinder'
8
5
 
9
- import apiRouter from "../expressRoutes/api"
10
- import allRouter, {allBinder} from "../expressRoutes/all"
11
- import {gatherFunctionDefinitions} from "../lib/openAPI/ApiBuildCollector";
12
- import {buildOpenApi} from "../lib/openAPI/openApiConstruction";
13
- import {resolvePaths} from "../lib/pathResolve";
6
+ import apiRouter from '../expressRoutes/api'
7
+ import allRouter, { allBinder } from '../expressRoutes/all'
8
+ import { resolvePaths } from '../lib/pathResolve'
14
9
 
15
- import * as ac from "ansi-colors"
10
+ import * as ac from 'ansi-colors'
16
11
 
17
- export function startLocalServer() {
18
- const projectPaths = resolvePaths();
19
- if(!projectPaths.verified) {
20
- console.log(ac.bold.red("Cannot start local server"))
21
- console.log(ac.blue.italic("Not in a valid MistLift project directory"))
22
- console.log("")
23
- return
24
- }
25
- const port = 8081
26
- allBinder()
27
- functionBinder()
28
- const app = express()
29
- // for JSON posts
30
- // app.use(bodyParser.json({limit: '50mb'}))
31
- app.use(express.json());
32
- // for form posts
33
- app.use(express.urlencoded({extended: true}))
12
+ export function startLocalServer (): void {
13
+ const projectPaths = resolvePaths()
14
+ if (!projectPaths.verified) {
15
+ console.log(ac.bold.red('Cannot start local server'))
16
+ console.log(ac.blue.italic('Not in a valid MistLift project directory'))
17
+ console.log('')
18
+ return
19
+ }
20
+ const port = 8081
21
+ allBinder()
22
+ functionBinder()
23
+ const app = express()
24
+ // for JSON posts
25
+ // app.use(bodyParser.json({limit: '50mb'}))
26
+ app.use(express.json())
27
+ // for form posts
28
+ app.use(express.urlencoded({ extended: true }))
34
29
 
35
- app.use('/', functionRouter)
36
- app.use('/api', apiRouter)
37
- app.use('*', allRouter)
30
+ app.use('/', functionRouter)
31
+ app.use('/api', apiRouter)
32
+ app.use('*', allRouter)
38
33
 
39
- // =========================================
40
- // Start server
41
- // http only
42
- app.listen(port, function () {
43
- console.log('http listening on port ' + port)
44
- })
34
+ // =========================================
35
+ // Start server
36
+ // http only
37
+ app.listen(port, function () {
38
+ console.log(`http listening on port ${port}`)
39
+ })
45
40
  // ================================================
46
- }
41
+ }
@@ -1,13 +1,12 @@
1
- import {executeCommand} from "../lib/executeCommand";
2
- import {doBuildAsync} from "./build";
1
+ import { executeCommand } from '../lib/executeCommand'
2
+ import { doBuildAsync } from './build'
3
3
 
4
- export async function doTestAsync(args:string[] ): Promise<number>
5
- {
6
- if(await doBuildAsync(args)) return 1 // don't test if build fails
7
- if(args.length === 0) args = ['*']
8
- let ret = 0;
9
- for (let funcName of args) {
10
- const result = await executeCommand('tap', [
4
+ export async function doTestAsync (args: string[]): Promise<number> {
5
+ if (await doBuildAsync(args) !== 0) return 1 // don't test if build fails
6
+ if (args.length === 0) args = ['*']
7
+ let ret = 0
8
+ for (const funcName of args) {
9
+ const result = await executeCommand('tap', [
11
10
  `build/functions/${funcName}/*-tests/*.js`,
12
11
  /*
13
12
  - base -- looks a lot like terse
@@ -27,12 +26,12 @@ export async function doTestAsync(args:string[] ): Promise<number>
27
26
  '--allow-empty-coverage',
28
27
  '--allow-incomplete-coverage'
29
28
 
30
- ], '', true)
29
+ ], '', true)
31
30
 
32
- if (result.retcode) {
33
- ret = result.retcode
34
- break;
35
- }
31
+ if (result.retcode !== 0) {
32
+ ret = result.retcode
33
+ break
36
34
  }
37
- return ret;
38
- }
35
+ }
36
+ return ret
37
+ }
@@ -17,4 +17,4 @@
17
17
 
18
18
  */
19
19
  // }
20
- //}
20
+ // }
@@ -1,18 +1,18 @@
1
- import path from "path";
2
- import fs from "fs";
1
+ import path from 'path'
2
+ import fs from 'fs'
3
3
 
4
- import * as ac from "ansi-colors"
5
- import {resolvePaths} from "../lib/pathResolve";
6
- import {gatherFunctionDefinitions} from "../lib/openAPI/ApiBuildCollector";
4
+ import * as ac from 'ansi-colors'
5
+ import { resolvePaths } from '../lib/pathResolve'
6
+ import { gatherFunctionDefinitions } from '../lib/openAPI/ApiBuildCollector'
7
7
 
8
8
  import express from 'express'
9
- const router = express.Router();
9
+ const router = express.Router()
10
10
 
11
- export function allBinder() {
12
- const projectPaths = resolvePaths();
13
- const defs = gatherFunctionDefinitions();
11
+ export function allBinder (): void {
12
+ const projectPaths = resolvePaths()
13
+ const defs = gatherFunctionDefinitions()
14
14
 
15
- /**
15
+ /**
16
16
  * @name /all
17
17
  * @description
18
18
  * Catch-all handler for URLs
@@ -27,78 +27,73 @@ export function allBinder() {
27
27
  * - File contents passed through using `sendFile` (will handle its own 404 if not found)
28
28
  *
29
29
  */
30
- router.all('*', (req, res, next) => {
30
+ router.all('*', (req, res, next) => {
31
+ // any PHP requests should be ignored
32
+ // ClogTrace('incoming: '+req.originalUrl)
33
+ if (req.originalUrl.includes('.php')) {
34
+ return res.send('')
35
+ }
36
+ if (req.originalUrl.includes('.env')) {
37
+ return res.send('')
38
+ }
31
39
 
32
- // any PHP requests should be ignored
33
- // ClogTrace('incoming: '+req.originalUrl)
34
- if (req.originalUrl.indexOf('.php') !== -1) {
35
- return res.send('')
40
+ let filepath = req.originalUrl ?? '/'
41
+ // match cloud behavior for docs because /api doesn't change cwd there
42
+ if (filepath.substring(0, 10) === '/api/docs/') {
43
+ filepath = filepath.replace('/api', '')
44
+ }
45
+ let funcFound = filepath === '/api' // reserved "function"
46
+ if (!funcFound) {
47
+ if (filepath.charAt(0) === '/') {
48
+ let n = filepath.indexOf('/', 1)
49
+ if (n === -1) n = filepath.length
50
+ let rootEntity = filepath.substring(0, n)
51
+ n = rootEntity.indexOf('?')
52
+ if (n === -1) n = rootEntity.length
53
+ rootEntity = rootEntity.substring(0, n)
54
+ for (const entry of defs) {
55
+ let entryRoot = entry.pathMap
56
+ const n = entryRoot.indexOf('/{')
57
+ if (n !== -1) entryRoot = entryRoot.substring(0, n)
58
+ if (rootEntity === entryRoot) {
59
+ funcFound = true
60
+ break
61
+ }
36
62
  }
37
- if (req.originalUrl.indexOf('.env') !== -1) {
38
- return res.send('')
39
- }
40
-
63
+ }
64
+ }
41
65
 
66
+ if (!funcFound) {
67
+ // check for '/' in path beyond the first one
68
+ if (filepath.includes('/', 1)) {
69
+ // console.log(ac.magenta.italic("Warning: / path delimiters will not be honored in a cloud deployment, use + instead ")+filepath)
70
+ }
71
+ // convert any incoming + to / to match cloud behavior
72
+ while (filepath.includes('+')) filepath = filepath.replace('+', '/')
42
73
 
43
- let filepath = req.originalUrl || '/'
44
- // match cloud behavior for docs because /api doesn't change cwd there
45
- if(filepath.substring(0, 10) == '/api/docs/') {
46
- filepath = filepath.replace('/api', '');
74
+ // Put any other filtering here
75
+ if (filepath.includes('?')) {
76
+ filepath = filepath.substring(0, filepath.indexOf('?'))
77
+ }
78
+ if (filepath.substring(filepath.length - 1) === '/') filepath += 'index.html'
79
+ if (filepath.substring(0, 10) === '/api/docs/') {
80
+ filepath = filepath.replace('/api', '')
81
+ }
82
+ if (filepath.includes('/docs')) {
83
+ if (filepath.includes('.map')) {
84
+ return res.sendStatus(200)
47
85
  }
48
- let funcFound = filepath === '/api'; // reserved "function"
49
- if(!funcFound) {
50
- if (filepath.charAt(0) === '/') {
51
- let n = filepath.indexOf('/', 1);
52
- if (n === -1) n = filepath.length;
53
- let rootEntity = filepath.substring(0, n)
54
- n = rootEntity.indexOf('?');
55
- if (n === -1) n = rootEntity.length;
56
- rootEntity = rootEntity.substring(0, n);
57
- for (const entry of defs) {
58
- let entryRoot = entry.pathMap;
59
- let n = entryRoot.indexOf("/{");
60
- if (n !== -1) entryRoot = entryRoot.substring(0, n);
61
- if (rootEntity === entryRoot) {
62
- funcFound = true;
63
- break;
64
- }
65
- }
66
- }
67
- }
68
-
69
- if (!funcFound) {
70
- // check for '/' in path beyond the first one
71
- if(filepath.indexOf('/',1) !== -1)
72
- {
73
- // console.log(ac.magenta.italic("Warning: / path delimiters will not be honored in a cloud deployment, use + instead ")+filepath)
74
- }
75
- // convert any incoming + to / to match cloud behavior
76
- while(filepath.indexOf("+")!== -1) filepath = filepath.replace("+", "/")
77
-
78
- // Put any other filtering here
79
- if (filepath.indexOf('?') !== -1) {
80
- filepath = filepath.substring(0, filepath.indexOf('?'))
81
- }
82
- if (filepath.substring(filepath.length - 1) === '/') filepath += 'index.html'
83
- if(filepath.substring(0, 10) == '/api/docs/') {
84
- filepath = filepath.replace('/api', '');
85
- }
86
- if(filepath.indexOf("/docs") !== -1) {
87
- if(filepath.indexOf('.map') !== -1) {
88
- return res.sendStatus(200)
89
- }
90
- }
91
- filepath = path.resolve(path.join(projectPaths.basePath, 'webroot', filepath)) // .. out of build
92
- if (fs.existsSync(filepath)) {
93
- return res.sendFile(filepath)
94
- } else {
95
- console.log(ac.red.bold("can't find " + filepath));
96
- return res.sendStatus(404);
97
- }
98
- }
99
- // if none of the above, tickle enumerator so we can process other paths
100
- next()
101
- })
86
+ }
87
+ filepath = path.resolve(path.join(projectPaths.basePath, 'webroot', filepath)) // .. out of build
88
+ if (fs.existsSync(filepath)) {
89
+ return res.sendFile(filepath)
90
+ } else {
91
+ console.log(ac.red.bold("can't find " + filepath))
92
+ return res.sendStatus(404)
93
+ }
94
+ }
95
+ // if none of the above, tickle enumerator so we can process other paths
96
+ next()
97
+ })
102
98
  }
103
99
  export default router
104
-
@@ -1,24 +1,22 @@
1
+ /* eslint @typescript-eslint/no-var-requires: "off" */
1
2
  import express from 'express'
2
- const router = express.Router();
3
3
 
4
- import {getProjectName, getProjectVersion} from "../lib/LiftVersion";
4
+ import { getProjectName, getProjectVersion } from '../lib/LiftVersion'
5
5
 
6
- const openApiUI = require("openapi-ui");
6
+ const openApiUi = require('openapi-ui')
7
+ const router = express.Router()
7
8
 
8
-
9
- router.get('/', function(req, res, next) {
9
+ router.get('/', function (req, res, next) {
10
10
  res.send(generateApiDoc())
11
- });
11
+ })
12
12
 
13
13
  export default router
14
14
 
15
- function generateApiDoc()
16
- {
17
- console.log("---- Serving up api")
18
- return openApiUI.generateIndex({
19
- baseUrl: "docs",
20
- title: `${getProjectName()} ${getProjectVersion()}`,
21
- url: "docs/apidoc.yaml"
22
- });
23
-
24
- }
15
+ function generateApiDoc (): void {
16
+ console.log('---- Serving up api')
17
+ return openApiUi.generateIndex({
18
+ baseUrl: 'docs',
19
+ title: `${getProjectName() ?? ''} ${getProjectVersion()?.toString() ?? ''}`,
20
+ url: 'docs/apidoc.yaml'
21
+ })
22
+ }