@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.
@@ -0,0 +1,290 @@
1
+ import * as plugins from '../plugins.js';
2
+ import type { IIdentity } from '../data/user.js';
3
+ import type {
4
+ IMailAddressBinding,
5
+ IMailCredentialOneTimeSecret,
6
+ IMailConnectionInfo,
7
+ IMailDeliveryJournalEvent,
8
+ IMailDeliveryStatus,
9
+ IMailDomainAuthority,
10
+ IMailEnvelope,
11
+ IMailInboundMessagePayload,
12
+ IMailOutboundIdentity,
13
+ IMailOutboundMessagePayload,
14
+ IMailRecipientResolution,
15
+ IMailResourceOwner,
16
+ IMailSpoolItem,
17
+ IWorkAppMailBinding,
18
+ } from '../data/mail.js';
19
+
20
+ export interface IMailControlRequestAuth {
21
+ identity?: IIdentity;
22
+ apiToken?: string;
23
+ }
24
+
25
+ export interface IMailSubmissionRequestAuth extends IMailControlRequestAuth {
26
+ credentialId?: string;
27
+ credentialSecret?: string;
28
+ }
29
+
30
+ export type TMailDomainAuthoritySync = Omit<
31
+ IMailDomainAuthority,
32
+ 'id' | 'status' | 'createdAt' | 'updatedAt' | 'createdBy'
33
+ > & {
34
+ id?: string;
35
+ };
36
+
37
+ export type TMailAddressBindingSync = Omit<
38
+ IMailAddressBinding,
39
+ 'id' | 'status' | 'createdAt' | 'updatedAt' | 'createdBy'
40
+ > & {
41
+ id?: string;
42
+ };
43
+
44
+ export type TWorkAppMailBindingSync = Omit<
45
+ IWorkAppMailBinding,
46
+ 'id' | 'status' | 'createdAt' | 'updatedAt' | 'createdBy'
47
+ > & {
48
+ id?: string;
49
+ };
50
+
51
+ export interface IReq_ListMailDomainAuthorities extends plugins.typedrequestInterfaces.implementsTR<
52
+ plugins.typedrequestInterfaces.ITypedRequest,
53
+ IReq_ListMailDomainAuthorities
54
+ > {
55
+ method: 'listMailDomainAuthorities';
56
+ request: {
57
+ auth: IMailControlRequestAuth;
58
+ owner?: Partial<IMailResourceOwner>;
59
+ domain?: string;
60
+ };
61
+ response: {
62
+ authorities: IMailDomainAuthority[];
63
+ };
64
+ }
65
+
66
+ export interface IReq_SyncMailDomainAuthority extends plugins.typedrequestInterfaces.implementsTR<
67
+ plugins.typedrequestInterfaces.ITypedRequest,
68
+ IReq_SyncMailDomainAuthority
69
+ > {
70
+ method: 'syncMailDomainAuthority';
71
+ request: {
72
+ auth: IMailControlRequestAuth;
73
+ authority: TMailDomainAuthoritySync;
74
+ };
75
+ response: {
76
+ success: boolean;
77
+ authority?: IMailDomainAuthority;
78
+ message?: string;
79
+ };
80
+ }
81
+
82
+ export interface IReq_DeleteMailDomainAuthority extends plugins.typedrequestInterfaces.implementsTR<
83
+ plugins.typedrequestInterfaces.ITypedRequest,
84
+ IReq_DeleteMailDomainAuthority
85
+ > {
86
+ method: 'deleteMailDomainAuthority';
87
+ request: {
88
+ auth: IMailControlRequestAuth;
89
+ id: string;
90
+ };
91
+ response: {
92
+ success: boolean;
93
+ message?: string;
94
+ };
95
+ }
96
+
97
+ export interface IReq_ListMailAddressBindings extends plugins.typedrequestInterfaces.implementsTR<
98
+ plugins.typedrequestInterfaces.ITypedRequest,
99
+ IReq_ListMailAddressBindings
100
+ > {
101
+ method: 'listMailAddressBindings';
102
+ request: {
103
+ auth: IMailControlRequestAuth;
104
+ owner?: Partial<IMailResourceOwner>;
105
+ domain?: string;
106
+ address?: string;
107
+ };
108
+ response: {
109
+ bindings: IMailAddressBinding[];
110
+ };
111
+ }
112
+
113
+ export interface IReq_SyncMailAddressBinding extends plugins.typedrequestInterfaces.implementsTR<
114
+ plugins.typedrequestInterfaces.ITypedRequest,
115
+ IReq_SyncMailAddressBinding
116
+ > {
117
+ method: 'syncMailAddressBinding';
118
+ request: {
119
+ auth: IMailControlRequestAuth;
120
+ binding: TMailAddressBindingSync;
121
+ };
122
+ response: {
123
+ success: boolean;
124
+ binding?: IMailAddressBinding;
125
+ message?: string;
126
+ };
127
+ }
128
+
129
+ export interface IReq_DeleteMailAddressBinding extends plugins.typedrequestInterfaces.implementsTR<
130
+ plugins.typedrequestInterfaces.ITypedRequest,
131
+ IReq_DeleteMailAddressBinding
132
+ > {
133
+ method: 'deleteMailAddressBinding';
134
+ request: {
135
+ auth: IMailControlRequestAuth;
136
+ id: string;
137
+ };
138
+ response: {
139
+ success: boolean;
140
+ message?: string;
141
+ };
142
+ }
143
+
144
+ export interface IReq_ListWorkAppMailBindings extends plugins.typedrequestInterfaces.implementsTR<
145
+ plugins.typedrequestInterfaces.ITypedRequest,
146
+ IReq_ListWorkAppMailBindings
147
+ > {
148
+ method: 'listWorkAppMailBindings';
149
+ request: {
150
+ auth: IMailControlRequestAuth;
151
+ owner?: Partial<IMailResourceOwner>;
152
+ };
153
+ response: {
154
+ bindings: IWorkAppMailBinding[];
155
+ };
156
+ }
157
+
158
+ export interface IReq_SyncWorkAppMailBinding extends plugins.typedrequestInterfaces.implementsTR<
159
+ plugins.typedrequestInterfaces.ITypedRequest,
160
+ IReq_SyncWorkAppMailBinding
161
+ > {
162
+ method: 'syncWorkAppMailBinding';
163
+ request: {
164
+ auth: IMailControlRequestAuth;
165
+ binding: TWorkAppMailBindingSync;
166
+ };
167
+ response: {
168
+ success: boolean;
169
+ binding?: IWorkAppMailBinding;
170
+ credentials?: IMailCredentialOneTimeSecret[];
171
+ message?: string;
172
+ };
173
+ }
174
+
175
+ export interface IReq_RotateMailCredential extends plugins.typedrequestInterfaces.implementsTR<
176
+ plugins.typedrequestInterfaces.ITypedRequest,
177
+ IReq_RotateMailCredential
178
+ > {
179
+ method: 'rotateMailCredential';
180
+ request: {
181
+ auth: IMailControlRequestAuth;
182
+ credentialId: string;
183
+ };
184
+ response: {
185
+ success: boolean;
186
+ credential?: IMailCredentialOneTimeSecret;
187
+ message?: string;
188
+ };
189
+ }
190
+
191
+ export interface IReq_ResolveMailRecipients extends plugins.typedrequestInterfaces.implementsTR<
192
+ plugins.typedrequestInterfaces.ITypedRequest,
193
+ IReq_ResolveMailRecipients
194
+ > {
195
+ method: 'resolveMailRecipients';
196
+ request: {
197
+ auth: IMailControlRequestAuth;
198
+ owner: IMailResourceOwner;
199
+ domainAuthorityId?: string;
200
+ envelope: IMailEnvelope;
201
+ recipients: string[];
202
+ source?: IMailConnectionInfo;
203
+ };
204
+ response: {
205
+ resolutions: IMailRecipientResolution[];
206
+ cacheTtlMs?: number;
207
+ };
208
+ }
209
+
210
+ export interface IReq_DeliverInboundMail extends plugins.typedrequestInterfaces.implementsTR<
211
+ plugins.typedrequestInterfaces.ITypedRequest,
212
+ IReq_DeliverInboundMail
213
+ > {
214
+ method: 'deliverInboundMail';
215
+ request: {
216
+ auth: IMailControlRequestAuth;
217
+ delivery: IMailInboundMessagePayload;
218
+ };
219
+ response: {
220
+ accepted: boolean;
221
+ workAppMessageId?: string;
222
+ message?: string;
223
+ };
224
+ }
225
+
226
+ export interface IReq_GetMailDeliveryStatus extends plugins.typedrequestInterfaces.implementsTR<
227
+ plugins.typedrequestInterfaces.ITypedRequest,
228
+ IReq_GetMailDeliveryStatus
229
+ > {
230
+ method: 'getMailDeliveryStatus';
231
+ request: {
232
+ auth: IMailControlRequestAuth;
233
+ spoolItemId: string;
234
+ };
235
+ response: IMailDeliveryStatus;
236
+ }
237
+
238
+ export interface IReq_ListMailSpoolItems extends plugins.typedrequestInterfaces.implementsTR<
239
+ plugins.typedrequestInterfaces.ITypedRequest,
240
+ IReq_ListMailSpoolItems
241
+ > {
242
+ method: 'listMailSpoolItems';
243
+ request: {
244
+ auth: IMailControlRequestAuth;
245
+ owner?: Partial<IMailResourceOwner>;
246
+ status?: IMailSpoolItem['status'];
247
+ direction?: IMailSpoolItem['direction'];
248
+ limit?: number;
249
+ };
250
+ response: {
251
+ spoolItems: IMailSpoolItem[];
252
+ };
253
+ }
254
+
255
+ export interface IReq_ListMailDeliveryJournal extends plugins.typedrequestInterfaces.implementsTR<
256
+ plugins.typedrequestInterfaces.ITypedRequest,
257
+ IReq_ListMailDeliveryJournal
258
+ > {
259
+ method: 'listMailDeliveryJournal';
260
+ request: {
261
+ auth: IMailControlRequestAuth;
262
+ owner?: Partial<IMailResourceOwner>;
263
+ spoolItemId?: string;
264
+ direction?: IMailSpoolItem['direction'];
265
+ status?: IMailSpoolItem['status'];
266
+ type?: IMailDeliveryJournalEvent['type'];
267
+ limit?: number;
268
+ };
269
+ response: {
270
+ events: IMailDeliveryJournalEvent[];
271
+ };
272
+ }
273
+
274
+ export interface IReq_EnqueueMail extends plugins.typedrequestInterfaces.implementsTR<
275
+ plugins.typedrequestInterfaces.ITypedRequest,
276
+ IReq_EnqueueMail
277
+ > {
278
+ method: 'enqueueMail';
279
+ request: {
280
+ auth: IMailSubmissionRequestAuth;
281
+ outboundIdentityId?: string;
282
+ message: IMailOutboundMessagePayload;
283
+ };
284
+ response: {
285
+ accepted: boolean;
286
+ spoolItemId?: string;
287
+ outboundIdentity?: IMailOutboundIdentity;
288
+ message?: string;
289
+ };
290
+ }