@sockethub/platform-email 0.0.0-stage → 1.0.0-beta.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.
- package/LICENSE +165 -0
- package/README.md +237 -2
- package/dist/index.d.ts +263 -0
- package/dist/index.js +134943 -0
- package/dist/index.js.map +550 -0
- package/dist/net.d.ts +1 -0
- package/dist/schema.d.ts +218 -0
- package/dist/types.d.ts +51 -0
- package/package.json +58 -4
package/dist/net.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function mailHost(host: string, allowPrivate: boolean): Promise<string>;
|
package/dist/schema.d.ts
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
export declare const PlatformEmailSchema: {
|
|
2
|
+
name: string;
|
|
3
|
+
version: string;
|
|
4
|
+
contextUrl: string;
|
|
5
|
+
contextVersion: string;
|
|
6
|
+
schemaVersion: string;
|
|
7
|
+
credentials: {
|
|
8
|
+
required: string[];
|
|
9
|
+
properties: {
|
|
10
|
+
object: {
|
|
11
|
+
type: string;
|
|
12
|
+
additionalProperties: boolean;
|
|
13
|
+
required: string[];
|
|
14
|
+
properties: {
|
|
15
|
+
type: {
|
|
16
|
+
const: string;
|
|
17
|
+
};
|
|
18
|
+
from: {
|
|
19
|
+
type: string;
|
|
20
|
+
format: string;
|
|
21
|
+
maxLength: number;
|
|
22
|
+
};
|
|
23
|
+
imap: {
|
|
24
|
+
type: string;
|
|
25
|
+
additionalProperties: boolean;
|
|
26
|
+
required: string[];
|
|
27
|
+
properties: {
|
|
28
|
+
host: {
|
|
29
|
+
type: string;
|
|
30
|
+
minLength: number;
|
|
31
|
+
maxLength: number;
|
|
32
|
+
pattern: string;
|
|
33
|
+
};
|
|
34
|
+
port: {
|
|
35
|
+
type: string;
|
|
36
|
+
minimum: number;
|
|
37
|
+
maximum: number;
|
|
38
|
+
};
|
|
39
|
+
secure: {
|
|
40
|
+
type: string;
|
|
41
|
+
};
|
|
42
|
+
username: {
|
|
43
|
+
type: string;
|
|
44
|
+
minLength: number;
|
|
45
|
+
maxLength: number;
|
|
46
|
+
};
|
|
47
|
+
password: {
|
|
48
|
+
type: string;
|
|
49
|
+
minLength: number;
|
|
50
|
+
maxLength: number;
|
|
51
|
+
};
|
|
52
|
+
token: {
|
|
53
|
+
type: string;
|
|
54
|
+
minLength: number;
|
|
55
|
+
maxLength: number;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
oneOf: {
|
|
59
|
+
required: string[];
|
|
60
|
+
}[];
|
|
61
|
+
};
|
|
62
|
+
smtp: {
|
|
63
|
+
type: string;
|
|
64
|
+
additionalProperties: boolean;
|
|
65
|
+
required: string[];
|
|
66
|
+
properties: {
|
|
67
|
+
host: {
|
|
68
|
+
type: string;
|
|
69
|
+
minLength: number;
|
|
70
|
+
maxLength: number;
|
|
71
|
+
pattern: string;
|
|
72
|
+
};
|
|
73
|
+
port: {
|
|
74
|
+
type: string;
|
|
75
|
+
minimum: number;
|
|
76
|
+
maximum: number;
|
|
77
|
+
};
|
|
78
|
+
secure: {
|
|
79
|
+
type: string;
|
|
80
|
+
};
|
|
81
|
+
username: {
|
|
82
|
+
type: string;
|
|
83
|
+
minLength: number;
|
|
84
|
+
maxLength: number;
|
|
85
|
+
};
|
|
86
|
+
password: {
|
|
87
|
+
type: string;
|
|
88
|
+
minLength: number;
|
|
89
|
+
maxLength: number;
|
|
90
|
+
};
|
|
91
|
+
token: {
|
|
92
|
+
type: string;
|
|
93
|
+
minLength: number;
|
|
94
|
+
maxLength: number;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
oneOf: {
|
|
98
|
+
required: string[];
|
|
99
|
+
}[];
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
anyOf: {
|
|
103
|
+
required: string[];
|
|
104
|
+
}[];
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
messages: {
|
|
109
|
+
required: string[];
|
|
110
|
+
properties: {
|
|
111
|
+
type: {
|
|
112
|
+
enum: string[];
|
|
113
|
+
};
|
|
114
|
+
object: {
|
|
115
|
+
type: string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
allOf: ({
|
|
119
|
+
if: {
|
|
120
|
+
properties: {
|
|
121
|
+
type: {
|
|
122
|
+
const: string;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
then: {
|
|
127
|
+
properties: {
|
|
128
|
+
object: {
|
|
129
|
+
type: string;
|
|
130
|
+
additionalProperties: boolean;
|
|
131
|
+
properties: {
|
|
132
|
+
type: {
|
|
133
|
+
const: string;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
required?: undefined;
|
|
139
|
+
};
|
|
140
|
+
} | {
|
|
141
|
+
if: {
|
|
142
|
+
properties: {
|
|
143
|
+
type: {
|
|
144
|
+
const: string;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
then: {
|
|
149
|
+
required: string[];
|
|
150
|
+
properties: {
|
|
151
|
+
object: {
|
|
152
|
+
required: string[];
|
|
153
|
+
anyOf: {
|
|
154
|
+
required: string[];
|
|
155
|
+
}[];
|
|
156
|
+
type: string;
|
|
157
|
+
additionalProperties: boolean;
|
|
158
|
+
properties: {
|
|
159
|
+
type: {
|
|
160
|
+
const: string;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
})[];
|
|
167
|
+
};
|
|
168
|
+
responses: {
|
|
169
|
+
type: string;
|
|
170
|
+
required: string[];
|
|
171
|
+
properties: {
|
|
172
|
+
type: {
|
|
173
|
+
enum: string[];
|
|
174
|
+
};
|
|
175
|
+
actor: {
|
|
176
|
+
type: string;
|
|
177
|
+
required: string[];
|
|
178
|
+
};
|
|
179
|
+
object: {
|
|
180
|
+
type: string;
|
|
181
|
+
};
|
|
182
|
+
items: {
|
|
183
|
+
type: string;
|
|
184
|
+
maxItems: number;
|
|
185
|
+
items: {
|
|
186
|
+
type: string;
|
|
187
|
+
required: string[];
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
cursors: {
|
|
191
|
+
type: string;
|
|
192
|
+
additionalProperties: {
|
|
193
|
+
type: string;
|
|
194
|
+
additionalProperties: boolean;
|
|
195
|
+
required: string[];
|
|
196
|
+
properties: {
|
|
197
|
+
uidValidity: {
|
|
198
|
+
type: string;
|
|
199
|
+
pattern: string;
|
|
200
|
+
maxLength: number;
|
|
201
|
+
};
|
|
202
|
+
uid: {
|
|
203
|
+
type: string;
|
|
204
|
+
minimum: number;
|
|
205
|
+
maximum: number;
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
hasMore: {
|
|
211
|
+
type: string;
|
|
212
|
+
};
|
|
213
|
+
error: {
|
|
214
|
+
type: string;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
};
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ActivityStream, CredentialsObject } from "@sockethub/schemas";
|
|
2
|
+
export interface MailServer {
|
|
3
|
+
host: string;
|
|
4
|
+
port?: number;
|
|
5
|
+
secure?: boolean;
|
|
6
|
+
username: string;
|
|
7
|
+
password?: string;
|
|
8
|
+
token?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface EmailCredentials extends CredentialsObject {
|
|
11
|
+
object: CredentialsObject["object"] & {
|
|
12
|
+
imap?: MailServer;
|
|
13
|
+
smtp?: MailServer;
|
|
14
|
+
from: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface EmailAttachment {
|
|
18
|
+
filename?: string;
|
|
19
|
+
contentType: string;
|
|
20
|
+
}
|
|
21
|
+
export interface Cursor {
|
|
22
|
+
uidValidity: string;
|
|
23
|
+
uid: number;
|
|
24
|
+
}
|
|
25
|
+
export interface Filter {
|
|
26
|
+
from?: string[];
|
|
27
|
+
to?: string[];
|
|
28
|
+
match?: "any" | "all";
|
|
29
|
+
}
|
|
30
|
+
export interface FetchOptions extends Filter {
|
|
31
|
+
folders?: string[];
|
|
32
|
+
cursors?: Record<string, Cursor>;
|
|
33
|
+
limit?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface WatchOptions extends Filter {
|
|
36
|
+
folder?: string;
|
|
37
|
+
cursor?: Cursor;
|
|
38
|
+
}
|
|
39
|
+
export interface SendOptions {
|
|
40
|
+
to: string[];
|
|
41
|
+
cc?: string[];
|
|
42
|
+
bcc?: string[];
|
|
43
|
+
subject?: string;
|
|
44
|
+
content?: string;
|
|
45
|
+
html?: string;
|
|
46
|
+
inReplyTo?: string;
|
|
47
|
+
references?: string[];
|
|
48
|
+
}
|
|
49
|
+
export type EmailJob<T> = ActivityStream & {
|
|
50
|
+
object?: ActivityStream["object"] & T;
|
|
51
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sockethub/platform-email",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"description": "IMAP receiving and SMTP sending for Sockethub",
|
|
4
|
+
"version": "1.0.0-beta.2",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"private": false,
|
|
7
|
+
"license": "LGPL-3.0+",
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist/"
|
|
21
|
+
],
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=20.19"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/sockethub/sockethub.git",
|
|
28
|
+
"directory": "packages/platform-email"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/sockethub/sockethub/tree/master/packages/platform-email",
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "bun build src/index.ts --outdir dist --target node --format esm --sourcemap=external",
|
|
33
|
+
"clean": "rm -rf dist",
|
|
34
|
+
"clean:deps": "rm -rf node_modules",
|
|
35
|
+
"test": "bun run --cwd ../.. build:foundations && bun test src/",
|
|
36
|
+
"test:integration": "node ../../integration/email-node.integration.mjs"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@sockethub/schemas": "^3.0.0-beta.2",
|
|
40
|
+
"@sockethub/util": "^1.0.0-beta.2",
|
|
41
|
+
"imapflow": "^1.7.8",
|
|
42
|
+
"mailparser": "^3.14.1",
|
|
43
|
+
"nodemailer": "^10.3.1"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/bun": "latest",
|
|
47
|
+
"@types/mailparser": "^3.4.0",
|
|
48
|
+
"@types/nodemailer": "^7.0.0"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@sockethub/server": "^5.0.0-beta.2"
|
|
52
|
+
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"@sockethub/server": {
|
|
55
|
+
"optional": true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"types": "./dist/index.d.ts",
|
|
59
|
+
"gitHead": "d241420f9743f66a15ed083a1390595b331a96ac"
|
|
60
|
+
}
|