apeframework 0.0.0-dev.6 → 0.0.0-dev.8
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/api/Api.d.ts +3 -1
- package/api/Api.js +4 -2
- package/api/Api.ts +7 -3
- package/package.json +9 -9
package/api/Api.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Endpoint } from './Endpoint';
|
|
2
2
|
import type { ErrorHandler } from './ErrorHandler';
|
|
3
3
|
import type { Handler } from './Handler';
|
|
4
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
4
5
|
declare class Api {
|
|
5
6
|
private readonly host;
|
|
6
7
|
private readonly port;
|
|
@@ -14,7 +15,7 @@ declare class Api {
|
|
|
14
15
|
onNotFound?: Handler;
|
|
15
16
|
onError?: ErrorHandler;
|
|
16
17
|
openapi?: {
|
|
17
|
-
|
|
18
|
+
name?: string;
|
|
18
19
|
version?: string;
|
|
19
20
|
};
|
|
20
21
|
cors?: {
|
|
@@ -24,5 +25,6 @@ declare class Api {
|
|
|
24
25
|
responseValidation?: boolean;
|
|
25
26
|
});
|
|
26
27
|
start(): Promise<string>;
|
|
28
|
+
openapi(): OpenAPIV3.Document;
|
|
27
29
|
}
|
|
28
30
|
export { Api, };
|
package/api/Api.js
CHANGED
|
@@ -30,9 +30,8 @@ class Api {
|
|
|
30
30
|
}
|
|
31
31
|
this.server.register(swagger_1.default, {
|
|
32
32
|
openapi: {
|
|
33
|
-
openapi: '3.1.0',
|
|
34
33
|
info: {
|
|
35
|
-
title: params.openapi?.
|
|
34
|
+
title: params.openapi?.name ?? '',
|
|
36
35
|
version: params.openapi?.version ?? '',
|
|
37
36
|
},
|
|
38
37
|
},
|
|
@@ -68,5 +67,8 @@ class Api {
|
|
|
68
67
|
port: this.port,
|
|
69
68
|
});
|
|
70
69
|
}
|
|
70
|
+
openapi() {
|
|
71
|
+
return this.server.swagger();
|
|
72
|
+
}
|
|
71
73
|
}
|
|
72
74
|
exports.Api = Api;
|
package/api/Api.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { Endpoint } from './Endpoint'
|
|
|
6
6
|
import type { ErrorHandler } from './ErrorHandler'
|
|
7
7
|
import type { Handler } from './Handler'
|
|
8
8
|
import type { FastifyInstance } from 'fastify'
|
|
9
|
+
import type { OpenAPIV3 } from 'openapi-types'
|
|
9
10
|
|
|
10
11
|
class Api {
|
|
11
12
|
private readonly host: string
|
|
@@ -23,7 +24,7 @@ class Api {
|
|
|
23
24
|
onNotFound?: Handler,
|
|
24
25
|
onError?: ErrorHandler,
|
|
25
26
|
openapi?: {
|
|
26
|
-
|
|
27
|
+
name?: string,
|
|
27
28
|
version?: string,
|
|
28
29
|
},
|
|
29
30
|
cors?: {
|
|
@@ -55,9 +56,8 @@ class Api {
|
|
|
55
56
|
|
|
56
57
|
this.server.register(swagger, {
|
|
57
58
|
openapi: {
|
|
58
|
-
openapi: '3.1.0',
|
|
59
59
|
info: {
|
|
60
|
-
title: params.openapi?.
|
|
60
|
+
title: params.openapi?.name ?? '',
|
|
61
61
|
version: params.openapi?.version ?? '',
|
|
62
62
|
},
|
|
63
63
|
},
|
|
@@ -97,6 +97,10 @@ class Api {
|
|
|
97
97
|
port: this.port,
|
|
98
98
|
})
|
|
99
99
|
}
|
|
100
|
+
|
|
101
|
+
public openapi(): OpenAPIV3.Document {
|
|
102
|
+
return this.server.swagger() as OpenAPIV3.Document
|
|
103
|
+
}
|
|
100
104
|
}
|
|
101
105
|
|
|
102
106
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apeframework",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Matthieu Symoens",
|
|
6
6
|
"description": "Node.js app framework",
|
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
"node": "^22"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@fastify/cors": "^
|
|
26
|
-
"@fastify/response-validation": "^
|
|
27
|
-
"@fastify/swagger": "^
|
|
25
|
+
"@fastify/cors": "^10.0",
|
|
26
|
+
"@fastify/response-validation": "^3.0",
|
|
27
|
+
"@fastify/swagger": "^9.2",
|
|
28
28
|
"bcryptjs": "^2.4",
|
|
29
|
-
"bullmq": "^5.
|
|
29
|
+
"bullmq": "^5.19",
|
|
30
30
|
"dotenv": "^16.4",
|
|
31
|
-
"fastify": "^
|
|
31
|
+
"fastify": "^5.0",
|
|
32
32
|
"fs-extra": "^11.2",
|
|
33
33
|
"ical-generator": "^8.0",
|
|
34
34
|
"ioredis": "^5.4",
|
|
35
|
-
"jose": "^5.
|
|
35
|
+
"jose": "^5.9",
|
|
36
36
|
"nodemailer": "^6.9",
|
|
37
37
|
"openapi-types": "^12.1",
|
|
38
38
|
"pino": "^9.4",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"yargs-parser": "^21.1"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@types/node": "^22.
|
|
43
|
+
"@types/node": "^22.7",
|
|
44
44
|
"ts-node": "^10.9",
|
|
45
|
-
"typescript": "^5.
|
|
45
|
+
"typescript": "^5.6"
|
|
46
46
|
}
|
|
47
47
|
}
|