@serve.zone/interfaces 6.2.0 → 6.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/changelog.md +18 -1
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/appstore/types.d.ts +1 -1
- package/dist_ts/data/index.d.ts +1 -0
- package/dist_ts/data/index.js +2 -1
- package/dist_ts/data/mail.d.ts +291 -0
- package/dist_ts/data/mail.js +2 -0
- package/dist_ts/platform/database.d.ts +1 -1
- package/dist_ts/requests/index.d.ts +3 -1
- package/dist_ts/requests/index.js +4 -2
- package/dist_ts/requests/mail.d.ts +201 -0
- package/dist_ts/requests/mail.js +2 -0
- package/package.json +1 -1
- package/readme.md +7 -2
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/appstore/types.ts +1 -1
- package/ts/data/index.ts +1 -0
- package/ts/data/mail.ts +354 -0
- package/ts/platform/database.ts +1 -1
- package/ts/requests/index.ts +3 -0
- package/ts/requests/mail.ts +290 -0
package/readme.md
CHANGED
|
@@ -14,14 +14,15 @@ pnpm add @serve.zone/interfaces
|
|
|
14
14
|
|
|
15
15
|
## Public API
|
|
16
16
|
|
|
17
|
-
The root export exposes
|
|
17
|
+
The root export exposes five namespaces:
|
|
18
18
|
|
|
19
19
|
```typescript
|
|
20
|
-
import { data, platform, platformservice, requests } from '@serve.zone/interfaces';
|
|
20
|
+
import { appstore, data, platform, platformservice, requests } from '@serve.zone/interfaces';
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
| Namespace | Purpose |
|
|
24
24
|
| --- | --- |
|
|
25
|
+
| `appstore` | App Store catalog, manifest, service requirement, and upgrade contracts. |
|
|
25
26
|
| `data` | Durable platform object shapes such as clusters, services, deployments, images, domains, DNS entries, secrets, users, status, settings, backups, registries, BaseOS metadata, and task executions. |
|
|
26
27
|
| `requests` | TypedRequest contracts for Cloudly and serve.zone control-plane RPC methods. |
|
|
27
28
|
| `platform` | Current platform-service contracts for email, SMS, push notifications, letters, AI, databases, object storage, logging, backups, and SIP. |
|
|
@@ -71,6 +72,7 @@ Common data contracts include:
|
|
|
71
72
|
- `IService`, `IDeployment`, `IImage`, `IRegistryTarget`, and `IExternalRegistry` for workload delivery.
|
|
72
73
|
- `IDomain`, `IDnsEntry`, and traffic contracts for routing and DNS management.
|
|
73
74
|
- `ISecretBundle` and `ISecretGroup` for secret ownership and shared secret groups.
|
|
75
|
+
- Mail gateway contracts for domain authorities, address bindings, WorkApp bindings, credentials, spool items, delivery journals, and inbound/outbound message payloads.
|
|
74
76
|
- `IUser`, `IIdentity`, and token-related contracts for authentication context.
|
|
75
77
|
- `ICloudlyConfig`, `ICloudlySettings`, status, server, bare-metal, BaseOS, backup, and task execution interfaces for control-plane state.
|
|
76
78
|
|
|
@@ -99,6 +101,7 @@ interface IExampleRequest {
|
|
|
99
101
|
Request groups are exported by product area:
|
|
100
102
|
|
|
101
103
|
- `requests.admin`
|
|
104
|
+
- `requests.appstore`
|
|
102
105
|
- `requests.baremetal`
|
|
103
106
|
- `requests.baseos`
|
|
104
107
|
- `requests.backup`
|
|
@@ -109,10 +112,12 @@ Request groups are exported by product area:
|
|
|
109
112
|
- `requests.dns`
|
|
110
113
|
- `requests.domain`
|
|
111
114
|
- `requests.externalRegistry`
|
|
115
|
+
- `requests.hostedapp`
|
|
112
116
|
- `requests.identity`
|
|
113
117
|
- `requests.image`
|
|
114
118
|
- `requests.inform`
|
|
115
119
|
- `requests.log`
|
|
120
|
+
- `requests.mail`
|
|
116
121
|
- `requests.network`
|
|
117
122
|
- `requests.node`
|
|
118
123
|
- `requests.platform`
|
package/ts/00_commitinfo_data.ts
CHANGED
package/ts/appstore/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type TAppStorePlatformRequirement = 'mongodb' | 's3' | 'clickhouse' | '
|
|
1
|
+
export type TAppStorePlatformRequirement = 'mongodb' | 's3' | 'clickhouse' | 'valkey' | 'mariadb';
|
|
2
2
|
export type TAppStoreSourceType = 'inline' | 'repoManifest' | 'dockerImage';
|
|
3
3
|
export type TAppStoreTrackingMode = 'tag' | 'digest';
|
|
4
4
|
export type TAppStoreUpgradeStrategy = 'semver' | 'branch' | 'dockerDigest';
|
package/ts/data/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './event.js';
|
|
|
9
9
|
export * from './externalregistry.js';
|
|
10
10
|
export * from './hostedapp.js';
|
|
11
11
|
export * from './image.js';
|
|
12
|
+
export * from './mail.js';
|
|
12
13
|
export * from './registry.js';
|
|
13
14
|
export * from './secretbundle.js';
|
|
14
15
|
export * from './secretgroup.js';
|
package/ts/data/mail.ts
ADDED
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
export type TMailGatewayClientType = 'onebox' | 'cloudly' | 'custom' | (string & {});
|
|
2
|
+
|
|
3
|
+
export type TMailAddressPatternType = 'exactAddress' | 'domainWildcard' | 'localPartPattern';
|
|
4
|
+
|
|
5
|
+
export type TMailInboundTargetType = 'webhook' | 'smtpForward' | 'typedEndpoint' | 'discard' | 'reject';
|
|
6
|
+
|
|
7
|
+
export type TMailRecipientPolicyMode = 'acceptAll' | 'staticList' | 'cachedResolver' | 'appResolver';
|
|
8
|
+
|
|
9
|
+
export type TMailCredentialType = 'smtp' | 'api';
|
|
10
|
+
|
|
11
|
+
export type TMailCredentialStatus = 'active' | 'disabled' | 'rotated' | 'revoked';
|
|
12
|
+
|
|
13
|
+
export type TMailResourceStatus = 'active' | 'disabled' | 'pending' | 'failed';
|
|
14
|
+
|
|
15
|
+
export type TMailSpoolDirection = 'inbound' | 'outbound';
|
|
16
|
+
|
|
17
|
+
export type TMailSpoolStatus =
|
|
18
|
+
| 'accepted'
|
|
19
|
+
| 'queued'
|
|
20
|
+
| 'delivering'
|
|
21
|
+
| 'delivered'
|
|
22
|
+
| 'deferred'
|
|
23
|
+
| 'failed'
|
|
24
|
+
| 'deadLettered'
|
|
25
|
+
| 'rejected';
|
|
26
|
+
|
|
27
|
+
export type TMailDeliveryTargetType =
|
|
28
|
+
| 'webhook'
|
|
29
|
+
| 'smtpForward'
|
|
30
|
+
| 'typedEndpoint'
|
|
31
|
+
| 'mtaRelay'
|
|
32
|
+
| 'discard'
|
|
33
|
+
| 'reject';
|
|
34
|
+
|
|
35
|
+
export type TMailBounceType = 'hard' | 'soft' | 'complaint' | 'unknown';
|
|
36
|
+
|
|
37
|
+
export type TMailInboundProtocol = 'smtp' | 'submission' | 'api';
|
|
38
|
+
|
|
39
|
+
export type TMailRecipientResolutionAction = 'accept' | 'reject' | 'defer';
|
|
40
|
+
|
|
41
|
+
export type TMailDeliveryJournalEventType =
|
|
42
|
+
| 'accepted'
|
|
43
|
+
| 'queued'
|
|
44
|
+
| 'deliveryStarted'
|
|
45
|
+
| 'deliverySucceeded'
|
|
46
|
+
| 'deliveryDeferred'
|
|
47
|
+
| 'deliveryFailed'
|
|
48
|
+
| 'deadLettered'
|
|
49
|
+
| 'rejected'
|
|
50
|
+
| 'bounced'
|
|
51
|
+
| 'complaint';
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Runtime owner of a mail resource. `appInstanceId` is the deployed WorkApp or service
|
|
55
|
+
* instance, not an App Store template id.
|
|
56
|
+
*/
|
|
57
|
+
export interface IMailResourceOwner {
|
|
58
|
+
gatewayClientType: TMailGatewayClientType;
|
|
59
|
+
gatewayClientId: string;
|
|
60
|
+
appInstanceId?: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface IMailAddressPattern {
|
|
64
|
+
type: TMailAddressPatternType;
|
|
65
|
+
domain: string;
|
|
66
|
+
localPart?: string;
|
|
67
|
+
localPartPattern?: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface IMailWebhookTarget {
|
|
71
|
+
url: string;
|
|
72
|
+
signingSecretRef?: string;
|
|
73
|
+
timeoutMs?: number;
|
|
74
|
+
headers?: Record<string, string>;
|
|
75
|
+
maxInlineBytes?: number;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface IMailSmtpForwardTarget {
|
|
79
|
+
host: string;
|
|
80
|
+
port: number;
|
|
81
|
+
credentialRef?: string;
|
|
82
|
+
preserveHeaders?: boolean;
|
|
83
|
+
addHeaders?: Record<string, string>;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface IMailTypedEndpointTarget {
|
|
87
|
+
serviceRef?: string;
|
|
88
|
+
method: string;
|
|
89
|
+
queueName?: string;
|
|
90
|
+
timeoutMs?: number;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface IMailInboundTarget {
|
|
94
|
+
type: TMailInboundTargetType;
|
|
95
|
+
webhook?: IMailWebhookTarget;
|
|
96
|
+
smtpForward?: IMailSmtpForwardTarget;
|
|
97
|
+
typedEndpoint?: IMailTypedEndpointTarget;
|
|
98
|
+
reject?: {
|
|
99
|
+
smtpCode: number;
|
|
100
|
+
message: string;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface IMailRecipientResolverTarget {
|
|
105
|
+
type: 'webhook' | 'typedEndpoint';
|
|
106
|
+
webhook?: IMailWebhookTarget;
|
|
107
|
+
typedEndpoint?: IMailTypedEndpointTarget;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface IMailRecipientPolicy {
|
|
111
|
+
mode: TMailRecipientPolicyMode;
|
|
112
|
+
staticRecipients?: string[];
|
|
113
|
+
resolver?: IMailRecipientResolverTarget;
|
|
114
|
+
cacheTtlMs?: number;
|
|
115
|
+
unavailableResponse?: {
|
|
116
|
+
smtpCode: number;
|
|
117
|
+
message: string;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface IMailSpoolPolicy {
|
|
122
|
+
enabled: boolean;
|
|
123
|
+
maxRetryAgeMs?: number;
|
|
124
|
+
retentionMs?: number;
|
|
125
|
+
maxQueuedMessages?: number;
|
|
126
|
+
maxQueuedBytes?: number;
|
|
127
|
+
initialRetryDelayMs?: number;
|
|
128
|
+
maxRetryDelayMs?: number;
|
|
129
|
+
deadLetterOnExpiry?: boolean;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface IMailRateLimits {
|
|
133
|
+
messagesPerMinute?: number;
|
|
134
|
+
messagesPerHour?: number;
|
|
135
|
+
messagesPerDay?: number;
|
|
136
|
+
recipientsPerMessage?: number;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface IMailDomainAuthority {
|
|
140
|
+
id: string;
|
|
141
|
+
owner: IMailResourceOwner;
|
|
142
|
+
domain: string;
|
|
143
|
+
addressPattern: IMailAddressPattern;
|
|
144
|
+
enabled: boolean;
|
|
145
|
+
status: TMailResourceStatus;
|
|
146
|
+
inboundTarget?: IMailInboundTarget;
|
|
147
|
+
outboundPolicy?: {
|
|
148
|
+
allowedFromPatterns: IMailAddressPattern[];
|
|
149
|
+
dkimSelector?: string;
|
|
150
|
+
rateLimits?: IMailRateLimits;
|
|
151
|
+
};
|
|
152
|
+
recipientPolicy: IMailRecipientPolicy;
|
|
153
|
+
spoolPolicy?: IMailSpoolPolicy;
|
|
154
|
+
createdAt: number;
|
|
155
|
+
updatedAt: number;
|
|
156
|
+
createdBy?: string;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface IMailAddressBinding {
|
|
160
|
+
id: string;
|
|
161
|
+
owner: IMailResourceOwner;
|
|
162
|
+
address: string;
|
|
163
|
+
localPart: string;
|
|
164
|
+
domain: string;
|
|
165
|
+
enabled: boolean;
|
|
166
|
+
status: TMailResourceStatus;
|
|
167
|
+
inboundTarget?: IMailInboundTarget;
|
|
168
|
+
outboundIdentityId?: string;
|
|
169
|
+
recipientPolicy?: IMailRecipientPolicy;
|
|
170
|
+
spoolPolicy?: IMailSpoolPolicy;
|
|
171
|
+
createdAt: number;
|
|
172
|
+
updatedAt: number;
|
|
173
|
+
createdBy?: string;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export interface IMailCredentialPublic {
|
|
177
|
+
id: string;
|
|
178
|
+
type: TMailCredentialType;
|
|
179
|
+
status: TMailCredentialStatus;
|
|
180
|
+
username?: string;
|
|
181
|
+
scopes?: string[];
|
|
182
|
+
createdAt: number;
|
|
183
|
+
updatedAt: number;
|
|
184
|
+
lastRotatedAt?: number;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface IMailCredentialOneTimeSecret {
|
|
188
|
+
credential: IMailCredentialPublic;
|
|
189
|
+
secret: string;
|
|
190
|
+
secretShownOnce: true;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export interface IMailOutboundIdentity {
|
|
194
|
+
id: string;
|
|
195
|
+
owner: IMailResourceOwner;
|
|
196
|
+
enabled: boolean;
|
|
197
|
+
status: TMailResourceStatus;
|
|
198
|
+
allowedFromPatterns: IMailAddressPattern[];
|
|
199
|
+
defaultFrom?: string;
|
|
200
|
+
domain?: string;
|
|
201
|
+
dkimSelector?: string;
|
|
202
|
+
credential?: IMailCredentialPublic;
|
|
203
|
+
rateLimits?: IMailRateLimits;
|
|
204
|
+
createdAt: number;
|
|
205
|
+
updatedAt: number;
|
|
206
|
+
createdBy?: string;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export interface IWorkAppMailBinding {
|
|
210
|
+
id: string;
|
|
211
|
+
owner: IMailResourceOwner & { appInstanceId: string };
|
|
212
|
+
enabled: boolean;
|
|
213
|
+
status: TMailResourceStatus;
|
|
214
|
+
domainAuthorityIds?: string[];
|
|
215
|
+
addressBindingIds?: string[];
|
|
216
|
+
outboundIdentityIds?: string[];
|
|
217
|
+
defaultFrom?: string;
|
|
218
|
+
inboundTarget?: IMailInboundTarget;
|
|
219
|
+
createdAt: number;
|
|
220
|
+
updatedAt: number;
|
|
221
|
+
createdBy?: string;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export interface IMailEnvelope {
|
|
225
|
+
mailFrom: string;
|
|
226
|
+
rcptTo: string[];
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export interface IMailDeliveryTargetSummary {
|
|
230
|
+
type: TMailDeliveryTargetType;
|
|
231
|
+
label?: string;
|
|
232
|
+
address?: string;
|
|
233
|
+
url?: string;
|
|
234
|
+
host?: string;
|
|
235
|
+
port?: number;
|
|
236
|
+
serviceRef?: string;
|
|
237
|
+
method?: string;
|
|
238
|
+
queueName?: string;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export interface IMailConnectionInfo {
|
|
242
|
+
protocol: TMailInboundProtocol;
|
|
243
|
+
remoteAddress?: string;
|
|
244
|
+
proxyAddress?: string;
|
|
245
|
+
heloName?: string;
|
|
246
|
+
tls?: boolean;
|
|
247
|
+
authUsername?: string;
|
|
248
|
+
authenticatedCredentialId?: string;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export interface IMailRecipientResolution {
|
|
252
|
+
recipient: string;
|
|
253
|
+
action: TMailRecipientResolutionAction;
|
|
254
|
+
owner?: IMailResourceOwner;
|
|
255
|
+
domainAuthorityId?: string;
|
|
256
|
+
addressBindingId?: string;
|
|
257
|
+
target?: IMailInboundTarget;
|
|
258
|
+
smtpCode?: number;
|
|
259
|
+
message?: string;
|
|
260
|
+
cacheTtlMs?: number;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export interface IMailSpoolItem {
|
|
264
|
+
id: string;
|
|
265
|
+
owner?: IMailResourceOwner;
|
|
266
|
+
direction: TMailSpoolDirection;
|
|
267
|
+
status: TMailSpoolStatus;
|
|
268
|
+
envelope: IMailEnvelope;
|
|
269
|
+
messageId?: string;
|
|
270
|
+
subject?: string;
|
|
271
|
+
target?: IMailDeliveryTargetSummary;
|
|
272
|
+
attempts: number;
|
|
273
|
+
nextAttemptAt?: number;
|
|
274
|
+
lastError?: string;
|
|
275
|
+
rawAvailableUntil?: number;
|
|
276
|
+
createdAt: number;
|
|
277
|
+
updatedAt: number;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export interface IMailDeliveryAttempt {
|
|
281
|
+
id: string;
|
|
282
|
+
spoolItemId: string;
|
|
283
|
+
target: IMailDeliveryTargetSummary;
|
|
284
|
+
status: TMailSpoolStatus;
|
|
285
|
+
startedAt: number;
|
|
286
|
+
completedAt?: number;
|
|
287
|
+
smtpCode?: number;
|
|
288
|
+
response?: string;
|
|
289
|
+
error?: string;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export interface IMailBounceEvent {
|
|
293
|
+
id: string;
|
|
294
|
+
spoolItemId?: string;
|
|
295
|
+
owner?: IMailResourceOwner;
|
|
296
|
+
recipient: string;
|
|
297
|
+
bounceType: TMailBounceType;
|
|
298
|
+
diagnosticCode?: string;
|
|
299
|
+
receivedAt: number;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export interface IMailDeliveryStatus {
|
|
303
|
+
spoolItem?: IMailSpoolItem;
|
|
304
|
+
attempts: IMailDeliveryAttempt[];
|
|
305
|
+
bounceEvents?: IMailBounceEvent[];
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export interface IMailDeliveryJournalEvent {
|
|
309
|
+
id: string;
|
|
310
|
+
spoolItemId: string;
|
|
311
|
+
owner?: IMailResourceOwner;
|
|
312
|
+
direction: TMailSpoolDirection;
|
|
313
|
+
type: TMailDeliveryJournalEventType;
|
|
314
|
+
status: TMailSpoolStatus;
|
|
315
|
+
envelope?: IMailEnvelope;
|
|
316
|
+
target?: IMailDeliveryTargetSummary;
|
|
317
|
+
attemptId?: string;
|
|
318
|
+
smtpCode?: number;
|
|
319
|
+
response?: string;
|
|
320
|
+
error?: string;
|
|
321
|
+
message?: string;
|
|
322
|
+
createdAt: number;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
export interface IMailInboundMessagePayload {
|
|
326
|
+
spoolItemId: string;
|
|
327
|
+
owner?: IMailResourceOwner;
|
|
328
|
+
envelope: IMailEnvelope;
|
|
329
|
+
rawMessage: string;
|
|
330
|
+
sizeBytes?: number;
|
|
331
|
+
messageId?: string;
|
|
332
|
+
subject?: string;
|
|
333
|
+
headers?: Record<string, string | string[]>;
|
|
334
|
+
source?: IMailConnectionInfo;
|
|
335
|
+
receivedAt: number;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export interface IMailOutboundAttachmentPayload {
|
|
339
|
+
filename: string;
|
|
340
|
+
contentType?: string;
|
|
341
|
+
binaryAttachmentString: string;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export interface IMailOutboundMessagePayload {
|
|
345
|
+
from: string;
|
|
346
|
+
to: string[];
|
|
347
|
+
cc?: string[];
|
|
348
|
+
bcc?: string[];
|
|
349
|
+
subject: string;
|
|
350
|
+
text?: string;
|
|
351
|
+
html?: string;
|
|
352
|
+
headers?: Record<string, string>;
|
|
353
|
+
attachments?: IMailOutboundAttachmentPayload[];
|
|
354
|
+
}
|
package/ts/platform/database.ts
CHANGED
package/ts/requests/index.ts
CHANGED
|
@@ -17,6 +17,7 @@ import * as identityRequests from './identity.js';
|
|
|
17
17
|
import * as imageRequests from './image.js';
|
|
18
18
|
import * as informRequests from './inform.js';
|
|
19
19
|
import * as logRequests from './log.js';
|
|
20
|
+
import * as mailRequests from './mail.js';
|
|
20
21
|
import * as networkRequests from './network.js';
|
|
21
22
|
import * as nodeRequests from './node.js';
|
|
22
23
|
import * as platformRequests from './platform.js';
|
|
@@ -48,6 +49,7 @@ export {
|
|
|
48
49
|
imageRequests as image,
|
|
49
50
|
informRequests as inform,
|
|
50
51
|
logRequests as log,
|
|
52
|
+
mailRequests as mail,
|
|
51
53
|
networkRequests as network,
|
|
52
54
|
nodeRequests as node,
|
|
53
55
|
platformRequests as platform,
|
|
@@ -64,3 +66,4 @@ export {
|
|
|
64
66
|
|
|
65
67
|
export * from './inform.js';
|
|
66
68
|
export * from './hostedapp.js';
|
|
69
|
+
export * from './mail.js';
|