imapkit 5.1.0 → 5.3.0
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/README.md +41 -23
- package/bin/help.txt +29 -3
- package/bin/imapkit.js +43 -0
- package/dist/browser/imapkit.js +99 -35
- package/dist/cjs/control.d.ts +16 -5
- package/dist/cjs/control.js +36 -5
- package/dist/cjs/oauth/http.d.ts +28 -0
- package/dist/cjs/oauth/http.js +216 -0
- package/dist/cjs/oauth/jwt.d.ts +33 -0
- package/dist/cjs/oauth/jwt.js +58 -0
- package/dist/cjs/oauth/pages.d.ts +47 -0
- package/dist/cjs/oauth/pages.js +310 -0
- package/dist/cjs/oauth/policy.d.ts +48 -0
- package/dist/cjs/oauth/policy.js +66 -0
- package/dist/cjs/oauth/provider.d.ts +455 -0
- package/dist/cjs/oauth/provider.js +1422 -0
- package/dist/cjs/plugins/oauthbearer.js +10 -15
- package/dist/cjs/plugins/xoauth2.js +4 -3
- package/dist/cjs/rest.d.ts +18 -1
- package/dist/cjs/rest.js +63 -35
- package/dist/cjs/server.d.ts +49 -1
- package/dist/cjs/server.js +126 -12
- package/dist/cjs/smtp-listener.d.ts +3 -2
- package/dist/cjs/smtp-listener.js +15 -3
- package/dist/cjs/types.d.ts +16 -0
- package/dist/esm/control.d.ts +16 -5
- package/dist/esm/control.js +36 -6
- package/dist/esm/oauth/http.d.ts +28 -0
- package/dist/esm/oauth/http.js +211 -0
- package/dist/esm/oauth/jwt.d.ts +33 -0
- package/dist/esm/oauth/jwt.js +50 -0
- package/dist/esm/oauth/pages.d.ts +47 -0
- package/dist/esm/oauth/pages.js +305 -0
- package/dist/esm/oauth/policy.d.ts +48 -0
- package/dist/esm/oauth/policy.js +59 -0
- package/dist/esm/oauth/provider.d.ts +455 -0
- package/dist/esm/oauth/provider.js +1415 -0
- package/dist/esm/plugins/oauthbearer.js +10 -15
- package/dist/esm/plugins/xoauth2.js +4 -3
- package/dist/esm/rest.d.ts +18 -1
- package/dist/esm/rest.js +62 -36
- package/dist/esm/server.d.ts +49 -1
- package/dist/esm/server.js +127 -13
- package/dist/esm/smtp-listener.d.ts +3 -2
- package/dist/esm/smtp-listener.js +15 -3
- package/dist/esm/types.d.ts +16 -0
- package/dist/plugin-help.json +2 -2
- package/package.json +7 -7
package/dist/esm/types.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { IMAPServer, IMAPConnection } from './server.js';
|
|
2
2
|
import type { ScriptRule } from './script.js';
|
|
3
|
+
import type { OAuthOptions } from './oauth/provider.js';
|
|
4
|
+
import type { ConsentPolicy } from './oauth/policy.js';
|
|
3
5
|
export type { IMAPServer, IMAPConnection };
|
|
4
6
|
/**
|
|
5
7
|
* A value of the parsed command or of a response, as imap-handler parses and compiles it: an
|
|
@@ -210,6 +212,12 @@ export interface MailboxStatus {
|
|
|
210
212
|
}
|
|
211
213
|
export interface UserData {
|
|
212
214
|
password?: string | undefined;
|
|
215
|
+
/** the display name, the `name` claim of the OAuth provider */
|
|
216
|
+
displayName?: string | undefined;
|
|
217
|
+
/** OAuth provider settings of the user: the consent policy of sign-ins that name the user in login_hint */
|
|
218
|
+
oauth?: {
|
|
219
|
+
consent?: ConsentPolicy | undefined;
|
|
220
|
+
} | undefined;
|
|
213
221
|
xoauth2?: {
|
|
214
222
|
accessToken?: string | undefined;
|
|
215
223
|
/**
|
|
@@ -228,6 +236,12 @@ export interface IMAPServerOptions {
|
|
|
228
236
|
plugins?: (string | Plugin)[] | string | Plugin | undefined;
|
|
229
237
|
users?: Record<string, UserData> | undefined;
|
|
230
238
|
secureConnection?: boolean | undefined;
|
|
239
|
+
/** starts a second IMAP listener for implicit TLS (IMAPS) with `server.start()`, its sessions share the storage
|
|
240
|
+
* with the main listener. Without a host it listens on the host given to `start()` */
|
|
241
|
+
tls?: {
|
|
242
|
+
port?: number | undefined;
|
|
243
|
+
host?: string | undefined;
|
|
244
|
+
} | undefined;
|
|
231
245
|
/** starts an SMTP server with `server.start()` that appends every received message to INBOX, needs the optional
|
|
232
246
|
* smtp-server package */
|
|
233
247
|
smtp?: {
|
|
@@ -240,6 +254,8 @@ export interface IMAPServerOptions {
|
|
|
240
254
|
host?: string | undefined;
|
|
241
255
|
token?: string | undefined;
|
|
242
256
|
} | undefined;
|
|
257
|
+
/** starts the OAuth 2.0 / OpenID Connect provider with `server.start()`, see src/oauth/provider.ts */
|
|
258
|
+
oauth?: OAuthOptions | undefined;
|
|
243
259
|
credentials?: {
|
|
244
260
|
key: string | Buffer;
|
|
245
261
|
cert: string | Buffer;
|
package/dist/plugin-help.json
CHANGED
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"Works with and without SASL-IR [RFC4959]",
|
|
145
145
|
"Valid login info, same as for XOAUTH2:",
|
|
146
146
|
" Username (authzid, optional): testuser",
|
|
147
|
-
" Access Token: testtoken"
|
|
147
|
+
" Access Token: testtoken, or a token of the OAuth provider"
|
|
148
148
|
],
|
|
149
149
|
"OBJECTID": [
|
|
150
150
|
"Adds OBJECTID [RFC8474] capability",
|
|
@@ -280,6 +280,6 @@
|
|
|
280
280
|
"SASL-IR enabled and used while Gmail does not",
|
|
281
281
|
"Valid login info:",
|
|
282
282
|
" Username: testuser",
|
|
283
|
-
" Access Token: testtoken"
|
|
283
|
+
" Access Token: testtoken, or a token of the OAuth provider"
|
|
284
284
|
]
|
|
285
285
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "imapkit",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "Scriptable, strictly RFC compliant in-memory IMAP server for testing IMAP clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -95,16 +95,16 @@
|
|
|
95
95
|
"@types/smtp-server": "3.5.13",
|
|
96
96
|
"buffer": "6.0.3",
|
|
97
97
|
"esbuild": "0.28.2",
|
|
98
|
-
"eslint": "10.
|
|
98
|
+
"eslint": "10.14.0",
|
|
99
99
|
"eslint-config-prettier": "10.1.8",
|
|
100
100
|
"events": "3.3.0",
|
|
101
|
-
"globals": "17.
|
|
102
|
-
"imapflow": "2.
|
|
103
|
-
"prettier": "3.9.
|
|
104
|
-
"smtp-server": "3.
|
|
101
|
+
"globals": "17.14.0",
|
|
102
|
+
"imapflow": "2.10.0",
|
|
103
|
+
"prettier": "3.9.10",
|
|
104
|
+
"smtp-server": "3.21.3",
|
|
105
105
|
"tsx": "4.23.15",
|
|
106
106
|
"typescript": "6.0.3",
|
|
107
|
-
"typescript-eslint": "8.
|
|
107
|
+
"typescript-eslint": "8.72.1"
|
|
108
108
|
},
|
|
109
109
|
"engines": {
|
|
110
110
|
"node": ">=20.0.0"
|