apeframework 0.0.0-dev.23 → 0.0.0-dev.25
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/dist/jwt/Jwt.js +1 -1
- package/dist/mailer/adapters/smtp/SmtpMailer.js +1 -1
- package/dist/mailer/adapters/smtp/getAddress.d.ts +4 -1
- package/dist/mailer/adapters/smtp/getAddresses.d.ts +4 -1
- package/dist/mailer/adapters/smtp/getAttachments.d.ts +7 -1
- package/dist/server/Server.d.ts +9 -1
- package/dist/server/Server.js +13 -2
- package/package.json +33 -33
package/dist/jwt/Jwt.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import nodemailer from 'nodemailer';
|
|
2
2
|
import { getTls } from '../../../tls/getTls.js';
|
|
3
|
-
import { Mailer } from '../../Mailer.js';
|
|
4
3
|
import { getIcalendar } from '../../getIcalendar.js';
|
|
4
|
+
import { Mailer } from '../../Mailer.js';
|
|
5
5
|
import { getAddress } from './getAddress.js';
|
|
6
6
|
import { getAddresses } from './getAddresses.js';
|
|
7
7
|
import { getAttachments } from './getAttachments.js';
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { Address } from '../../Address.js';
|
|
2
|
-
|
|
2
|
+
interface NodemailerAddress {
|
|
3
|
+
address: string;
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
3
6
|
declare const getAddress: (address?: Address) => NodemailerAddress | undefined;
|
|
4
7
|
export { getAddress, };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { Address } from '../../Address.js';
|
|
2
|
-
|
|
2
|
+
interface NodemailerAddress {
|
|
3
|
+
address: string;
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
3
6
|
declare const getAddresses: (addresses?: Address[]) => NodemailerAddress[];
|
|
4
7
|
export { getAddresses, };
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { Attachment } from '../../Attachment.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Readable } from 'stream';
|
|
3
|
+
interface NodemailerAttachment {
|
|
4
|
+
filename: string;
|
|
5
|
+
cid: string;
|
|
6
|
+
contentType: string | undefined;
|
|
7
|
+
content: Buffer | Readable | string;
|
|
8
|
+
}
|
|
3
9
|
declare const getAttachments: (attachments?: Attachment[]) => NodemailerAttachment[];
|
|
4
10
|
export { getAttachments, };
|
package/dist/server/Server.d.ts
CHANGED
|
@@ -24,7 +24,14 @@ declare class Server {
|
|
|
24
24
|
};
|
|
25
25
|
cors?: {
|
|
26
26
|
enabled?: boolean;
|
|
27
|
-
|
|
27
|
+
allowedOrigins?: string[];
|
|
28
|
+
allowedMethods?: string[];
|
|
29
|
+
allowedHeaders?: string[];
|
|
30
|
+
exposedHeaders?: string[];
|
|
31
|
+
allowCredentials?: boolean;
|
|
32
|
+
};
|
|
33
|
+
cookies?: {
|
|
34
|
+
enabled?: boolean;
|
|
28
35
|
};
|
|
29
36
|
onRequest?: Handler;
|
|
30
37
|
onResponse?: Handler;
|
|
@@ -32,6 +39,7 @@ declare class Server {
|
|
|
32
39
|
onError?: ErrorHandler;
|
|
33
40
|
});
|
|
34
41
|
start(): Promise<string>;
|
|
42
|
+
close(): Promise<void>;
|
|
35
43
|
openapi(format: OpenApiFormat): OpenAPIV3.Document;
|
|
36
44
|
}
|
|
37
45
|
export { Server, };
|
package/dist/server/Server.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import compress from '@fastify/compress';
|
|
2
|
+
import cookie from '@fastify/cookie';
|
|
2
3
|
import cors from '@fastify/cors';
|
|
3
4
|
import responseValidation from '@fastify/response-validation';
|
|
4
5
|
import swagger from '@fastify/swagger';
|
|
5
6
|
import fastify from 'fastify';
|
|
6
|
-
import { OpenApiFormat } from './OpenApiFormat.js';
|
|
7
7
|
import { getAjv } from './getAjv.js';
|
|
8
|
+
import { OpenApiFormat } from './OpenApiFormat.js';
|
|
8
9
|
class Server {
|
|
9
10
|
server;
|
|
10
11
|
host;
|
|
@@ -36,9 +37,16 @@ class Server {
|
|
|
36
37
|
}
|
|
37
38
|
if (params.cors?.enabled) {
|
|
38
39
|
this.server.register(cors, {
|
|
39
|
-
origin: params.cors.
|
|
40
|
+
origin: params.cors.allowedOrigins,
|
|
41
|
+
methods: params.cors.allowedMethods,
|
|
42
|
+
allowedHeaders: params.cors.allowedHeaders,
|
|
43
|
+
exposedHeaders: params.cors.exposedHeaders,
|
|
44
|
+
credentials: params.cors.allowCredentials,
|
|
40
45
|
});
|
|
41
46
|
}
|
|
47
|
+
if (params.cookies?.enabled) {
|
|
48
|
+
this.server.register(cookie);
|
|
49
|
+
}
|
|
42
50
|
this.server.register((server, options, done) => {
|
|
43
51
|
params.routes.forEach((route) => {
|
|
44
52
|
server.route({
|
|
@@ -77,6 +85,9 @@ class Server {
|
|
|
77
85
|
port: this.port,
|
|
78
86
|
});
|
|
79
87
|
}
|
|
88
|
+
async close() {
|
|
89
|
+
await this.server.close();
|
|
90
|
+
}
|
|
80
91
|
openapi(format) {
|
|
81
92
|
return this.server.swagger({
|
|
82
93
|
yaml: format === OpenApiFormat.YAML,
|
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.25",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -17,6 +17,38 @@
|
|
|
17
17
|
"url": "git+https://github.com/ApeFramework/apeframework.git"
|
|
18
18
|
},
|
|
19
19
|
"type": "module",
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=22"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@fastify/compress": "^8.0",
|
|
25
|
+
"@fastify/cookie": "^11.0",
|
|
26
|
+
"@fastify/cors": "^11.0",
|
|
27
|
+
"@fastify/response-validation": "^3.0",
|
|
28
|
+
"@fastify/swagger": "^9.5",
|
|
29
|
+
"@types/fs-extra": "^11.0",
|
|
30
|
+
"@types/nodemailer": "^6.4",
|
|
31
|
+
"@types/yargs-parser": "^21.0",
|
|
32
|
+
"ajv": "^8.17",
|
|
33
|
+
"bcryptjs": "^3.0",
|
|
34
|
+
"bullmq": "^5.49",
|
|
35
|
+
"dotenv": "^16.5",
|
|
36
|
+
"fast-uri": "^3.0",
|
|
37
|
+
"fastify": "^5.3",
|
|
38
|
+
"fs-extra": "^11.3",
|
|
39
|
+
"ical-generator": "^8.1",
|
|
40
|
+
"ioredis": "^5.6",
|
|
41
|
+
"jose": "^6.0",
|
|
42
|
+
"nodemailer": "^6.10",
|
|
43
|
+
"openapi-types": "^12.1",
|
|
44
|
+
"pino": "^9.6",
|
|
45
|
+
"pino-pretty": "^13.0",
|
|
46
|
+
"yargs-parser": "^21.1"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"@types/node": "^22.14",
|
|
50
|
+
"typescript": "^5.8"
|
|
51
|
+
},
|
|
20
52
|
"exports": {
|
|
21
53
|
"./cipher/Algorithm": {
|
|
22
54
|
"import": {
|
|
@@ -642,37 +674,5 @@
|
|
|
642
674
|
"default": "./dist/utils/wait.js"
|
|
643
675
|
}
|
|
644
676
|
}
|
|
645
|
-
},
|
|
646
|
-
"engines": {
|
|
647
|
-
"node": ">=22"
|
|
648
|
-
},
|
|
649
|
-
"dependencies": {
|
|
650
|
-
"@fastify/compress": "^8.0",
|
|
651
|
-
"@fastify/cors": "^10.0",
|
|
652
|
-
"@fastify/response-validation": "^3.0",
|
|
653
|
-
"@fastify/swagger": "^9.4",
|
|
654
|
-
"@types/bcryptjs": "^2.4",
|
|
655
|
-
"@types/fs-extra": "^11.0",
|
|
656
|
-
"@types/nodemailer": "^6.4",
|
|
657
|
-
"@types/yargs-parser": "^21.0",
|
|
658
|
-
"ajv": "^8.17",
|
|
659
|
-
"bcryptjs": "^2.4",
|
|
660
|
-
"bullmq": "^5.34",
|
|
661
|
-
"dotenv": "^16.4",
|
|
662
|
-
"fast-uri": "^3.0",
|
|
663
|
-
"fastify": "^5.2",
|
|
664
|
-
"fs-extra": "^11.2",
|
|
665
|
-
"ical-generator": "^8.0",
|
|
666
|
-
"ioredis": "^5.4",
|
|
667
|
-
"jose": "^5.9",
|
|
668
|
-
"nodemailer": "^6.9",
|
|
669
|
-
"openapi-types": "^12.1",
|
|
670
|
-
"pino": "^9.6",
|
|
671
|
-
"pino-pretty": "^13.0",
|
|
672
|
-
"yargs-parser": "^21.1"
|
|
673
|
-
},
|
|
674
|
-
"peerDependencies": {
|
|
675
|
-
"@types/node": "^22.10",
|
|
676
|
-
"typescript": "^5.7"
|
|
677
677
|
}
|
|
678
678
|
}
|