@serve.zone/interfaces 20.0.0 → 20.2.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 +24 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/data/coremail.d.ts +216 -0
- package/dist_ts/data/coremail.js +24 -0
- package/dist_ts/data/index.d.ts +1 -0
- package/dist_ts/data/index.js +2 -1
- package/dist_ts/data/isolatedrestore.js +7 -82
- package/dist_ts/platform/index.d.ts +3 -1
- package/dist_ts/platform/index.js +4 -2
- package/dist_ts/platform/storagemigration.d.ts +346 -0
- package/dist_ts/platform/storagemigration.golden.d.ts +49 -0
- package/dist_ts/platform/storagemigration.golden.js +207 -0
- package/dist_ts/platform/storagemigration.js +1554 -0
- package/dist_ts/private/canonicaljson.d.ts +14 -0
- package/dist_ts/private/canonicaljson.js +154 -0
- package/dist_ts/requests/coremail.d.ts +248 -0
- package/dist_ts/requests/coremail.js +2 -0
- package/dist_ts/requests/index.d.ts +2 -1
- package/dist_ts/requests/index.js +3 -2
- package/package.json +2 -2
- package/readme.md +156 -0
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/data/coremail.ts +277 -0
- package/ts/data/index.ts +1 -0
- package/ts/data/isolatedrestore.ts +12 -93
- package/ts/platform/index.ts +3 -0
- package/ts/platform/storagemigration.golden.ts +241 -0
- package/ts/platform/storagemigration.ts +3082 -0
- package/ts/private/canonicaljson.ts +221 -0
- package/ts/requests/coremail.ts +346 -0
- package/ts/requests/index.ts +2 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
export const strictCanonicalJsonRules = Object.freeze({
|
|
2
|
+
version: 1 as const,
|
|
3
|
+
encoding: 'utf-8' as const,
|
|
4
|
+
objectKeyOrdering: 'utf-16-code-unit-ascending' as const,
|
|
5
|
+
arrayOrdering: 'preserved-dense' as const,
|
|
6
|
+
unicodeNormalization: 'preserved' as const,
|
|
7
|
+
numberEncoding: 'safe-integer-json-no-negative-zero' as const,
|
|
8
|
+
digest: 'sha256-lowercase-hex' as const,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type TCanonicalJsonFailure = (reasonArg: string) => never;
|
|
12
|
+
|
|
13
|
+
const assertUnicodeScalarString = (
|
|
14
|
+
valueArg: string,
|
|
15
|
+
fieldNameArg: string,
|
|
16
|
+
failArg: TCanonicalJsonFailure,
|
|
17
|
+
): void => {
|
|
18
|
+
for (let index = 0; index < valueArg.length; index++) {
|
|
19
|
+
const codeUnit = valueArg.charCodeAt(index);
|
|
20
|
+
if (codeUnit >= 0xd800 && codeUnit <= 0xdbff) {
|
|
21
|
+
const followingCodeUnit = valueArg.charCodeAt(index + 1);
|
|
22
|
+
if (
|
|
23
|
+
!Number.isInteger(followingCodeUnit) ||
|
|
24
|
+
followingCodeUnit < 0xdc00 ||
|
|
25
|
+
followingCodeUnit > 0xdfff
|
|
26
|
+
) {
|
|
27
|
+
failArg(`${fieldNameArg} must not contain an unpaired UTF-16 surrogate`);
|
|
28
|
+
}
|
|
29
|
+
index++;
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (codeUnit >= 0xdc00 && codeUnit <= 0xdfff) {
|
|
33
|
+
failArg(`${fieldNameArg} must not contain an unpaired UTF-16 surrogate`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const readStrictRecord = (
|
|
39
|
+
valueArg: object,
|
|
40
|
+
fieldNameArg: string,
|
|
41
|
+
failArg: TCanonicalJsonFailure,
|
|
42
|
+
): Record<string, unknown> => {
|
|
43
|
+
const prototype = Object.getPrototypeOf(valueArg);
|
|
44
|
+
if (prototype !== Object.prototype && prototype !== null) {
|
|
45
|
+
return failArg(`${fieldNameArg} must be a plain object`);
|
|
46
|
+
}
|
|
47
|
+
const record = valueArg as Record<string, unknown>;
|
|
48
|
+
const ownKeys = Reflect.ownKeys(record);
|
|
49
|
+
if (ownKeys.some((keyArg) => typeof keyArg !== 'string')) {
|
|
50
|
+
return failArg(`${fieldNameArg} must not contain symbol keys`);
|
|
51
|
+
}
|
|
52
|
+
for (const key of ownKeys as string[]) {
|
|
53
|
+
const descriptor = Object.getOwnPropertyDescriptor(record, key);
|
|
54
|
+
if (
|
|
55
|
+
!descriptor ||
|
|
56
|
+
!descriptor.enumerable ||
|
|
57
|
+
!Object.hasOwn(descriptor, 'value')
|
|
58
|
+
) {
|
|
59
|
+
return failArg(
|
|
60
|
+
`${fieldNameArg} must contain enumerable data properties only`,
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return record;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const readStrictArray = (
|
|
68
|
+
valueArg: unknown[],
|
|
69
|
+
fieldNameArg: string,
|
|
70
|
+
failArg: TCanonicalJsonFailure,
|
|
71
|
+
): unknown[] => {
|
|
72
|
+
if (Object.getPrototypeOf(valueArg) !== Array.prototype) {
|
|
73
|
+
return failArg(`${fieldNameArg} must be a dense plain array`);
|
|
74
|
+
}
|
|
75
|
+
for (let index = 0; index < valueArg.length; index++) {
|
|
76
|
+
if (!Object.hasOwn(valueArg, index)) {
|
|
77
|
+
return failArg(`${fieldNameArg} must not contain sparse entries`);
|
|
78
|
+
}
|
|
79
|
+
const descriptor = Object.getOwnPropertyDescriptor(valueArg, String(index));
|
|
80
|
+
if (
|
|
81
|
+
!descriptor ||
|
|
82
|
+
!descriptor.enumerable ||
|
|
83
|
+
!Object.hasOwn(descriptor, 'value')
|
|
84
|
+
) {
|
|
85
|
+
return failArg(`${fieldNameArg} must contain enumerable data entries only`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
for (const key of Reflect.ownKeys(valueArg)) {
|
|
89
|
+
if (key === 'length') {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
if (
|
|
93
|
+
typeof key !== 'string' ||
|
|
94
|
+
!/^(?:0|[1-9][0-9]*)$/.test(key) ||
|
|
95
|
+
Number(key) >= valueArg.length
|
|
96
|
+
) {
|
|
97
|
+
return failArg(`${fieldNameArg} must not contain extra properties`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return valueArg;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const canonicalizeStrictJson = (
|
|
104
|
+
valueArg: unknown,
|
|
105
|
+
failArg: TCanonicalJsonFailure,
|
|
106
|
+
fieldNameArg = 'canonical JSON input',
|
|
107
|
+
): string => {
|
|
108
|
+
const ancestors = new Set<object>();
|
|
109
|
+
|
|
110
|
+
const visit = (currentValueArg: unknown, currentFieldNameArg: string): string => {
|
|
111
|
+
if (currentValueArg === null) {
|
|
112
|
+
return 'null';
|
|
113
|
+
}
|
|
114
|
+
if (typeof currentValueArg === 'boolean') {
|
|
115
|
+
return currentValueArg ? 'true' : 'false';
|
|
116
|
+
}
|
|
117
|
+
if (typeof currentValueArg === 'string') {
|
|
118
|
+
assertUnicodeScalarString(currentValueArg, currentFieldNameArg, failArg);
|
|
119
|
+
return JSON.stringify(currentValueArg);
|
|
120
|
+
}
|
|
121
|
+
if (typeof currentValueArg === 'number') {
|
|
122
|
+
if (
|
|
123
|
+
!Number.isSafeInteger(currentValueArg) ||
|
|
124
|
+
Object.is(currentValueArg, -0)
|
|
125
|
+
) {
|
|
126
|
+
return failArg(`${currentFieldNameArg} must contain safe integers only`);
|
|
127
|
+
}
|
|
128
|
+
return String(currentValueArg);
|
|
129
|
+
}
|
|
130
|
+
if (!currentValueArg || typeof currentValueArg !== 'object') {
|
|
131
|
+
return failArg(`${currentFieldNameArg} contains a non-JSON value`);
|
|
132
|
+
}
|
|
133
|
+
if (ancestors.has(currentValueArg)) {
|
|
134
|
+
return failArg(`${currentFieldNameArg} contains a cycle`);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
ancestors.add(currentValueArg);
|
|
138
|
+
try {
|
|
139
|
+
if (Array.isArray(currentValueArg)) {
|
|
140
|
+
const array = readStrictArray(
|
|
141
|
+
currentValueArg,
|
|
142
|
+
currentFieldNameArg,
|
|
143
|
+
failArg,
|
|
144
|
+
);
|
|
145
|
+
return `[${array
|
|
146
|
+
.map((entryArg, indexArg) =>
|
|
147
|
+
visit(entryArg, `${currentFieldNameArg}[${indexArg}]`),
|
|
148
|
+
)
|
|
149
|
+
.join(',')}]`;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const record = readStrictRecord(
|
|
153
|
+
currentValueArg,
|
|
154
|
+
currentFieldNameArg,
|
|
155
|
+
failArg,
|
|
156
|
+
);
|
|
157
|
+
const keys = Object.keys(record).sort((leftArg, rightArg) => {
|
|
158
|
+
return leftArg < rightArg ? -1 : leftArg > rightArg ? 1 : 0;
|
|
159
|
+
});
|
|
160
|
+
return `{${keys
|
|
161
|
+
.map((keyArg) => {
|
|
162
|
+
assertUnicodeScalarString(
|
|
163
|
+
keyArg,
|
|
164
|
+
`${currentFieldNameArg} key`,
|
|
165
|
+
failArg,
|
|
166
|
+
);
|
|
167
|
+
return `${JSON.stringify(keyArg)}:${visit(
|
|
168
|
+
record[keyArg],
|
|
169
|
+
`${currentFieldNameArg}.${keyArg}`,
|
|
170
|
+
)}`;
|
|
171
|
+
})
|
|
172
|
+
.join(',')}}`;
|
|
173
|
+
} finally {
|
|
174
|
+
ancestors.delete(currentValueArg);
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
return visit(valueArg, fieldNameArg);
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export const createSha256Hex = async (
|
|
182
|
+
contentsArg: Uint8Array,
|
|
183
|
+
failArg: TCanonicalJsonFailure,
|
|
184
|
+
): Promise<string> => {
|
|
185
|
+
const subtle = globalThis.crypto?.subtle;
|
|
186
|
+
if (!subtle) {
|
|
187
|
+
return failArg('Web Crypto SHA-256 is unavailable in this runtime');
|
|
188
|
+
}
|
|
189
|
+
const digest = await subtle.digest('SHA-256', new Uint8Array(contentsArg));
|
|
190
|
+
return Array.from(new Uint8Array(digest), (byteArg) =>
|
|
191
|
+
byteArg.toString(16).padStart(2, '0'),
|
|
192
|
+
).join('');
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
export const createCanonicalJsonSha256Hex = async (
|
|
196
|
+
canonicalJsonArg: string,
|
|
197
|
+
failArg: TCanonicalJsonFailure,
|
|
198
|
+
): Promise<string> => {
|
|
199
|
+
return createSha256Hex(new TextEncoder().encode(canonicalJsonArg), failArg);
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
export const deepFreezeValue = <T>(
|
|
203
|
+
valueArg: T,
|
|
204
|
+
seenArg = new WeakSet<object>(),
|
|
205
|
+
): T => {
|
|
206
|
+
if (!valueArg || typeof valueArg !== 'object') {
|
|
207
|
+
return valueArg;
|
|
208
|
+
}
|
|
209
|
+
const object = valueArg as object;
|
|
210
|
+
if (ArrayBuffer.isView(object) || seenArg.has(object)) {
|
|
211
|
+
return valueArg;
|
|
212
|
+
}
|
|
213
|
+
seenArg.add(object);
|
|
214
|
+
for (const key of Reflect.ownKeys(object)) {
|
|
215
|
+
const descriptor = Object.getOwnPropertyDescriptor(object, key);
|
|
216
|
+
if (descriptor && Object.hasOwn(descriptor, 'value')) {
|
|
217
|
+
deepFreezeValue(descriptor.value, seenArg);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return Object.freeze(valueArg);
|
|
221
|
+
};
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import type * as plugins from '../plugins.js';
|
|
2
|
+
import type {
|
|
3
|
+
ICoreMailEnvelope,
|
|
4
|
+
ICoreMailDownloadGrant,
|
|
5
|
+
ICoreMailGatewayMessageDescriptor,
|
|
6
|
+
ICoreMailGatewayOutboundStatus,
|
|
7
|
+
ICoreMailInboundDelivery,
|
|
8
|
+
ICoreMailOutboundMessageDescriptor,
|
|
9
|
+
ICoreMailRecipientResolution,
|
|
10
|
+
ICoreMailReconciliationStatus,
|
|
11
|
+
ICoreMailReplicaIdentity,
|
|
12
|
+
ICoreMailSubmission,
|
|
13
|
+
ICoreMailUploadGrant,
|
|
14
|
+
TCoreMailInboundAckOutcome,
|
|
15
|
+
TCoreMailSha256,
|
|
16
|
+
} from '../data/coremail.js';
|
|
17
|
+
import type { IMailConnectionInfo } from '../data/mail.js';
|
|
18
|
+
|
|
19
|
+
export interface IReq_CoreMailAuthenticateWorkload extends plugins.typedrequestInterfaces.implementsTR<
|
|
20
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
21
|
+
IReq_CoreMailAuthenticateWorkload
|
|
22
|
+
> {
|
|
23
|
+
method: 'coreMailAuthenticateWorkload';
|
|
24
|
+
request: {
|
|
25
|
+
bindingId: string;
|
|
26
|
+
credentialId: string;
|
|
27
|
+
credentialVersion: number;
|
|
28
|
+
credentialSecret: string;
|
|
29
|
+
};
|
|
30
|
+
response: {
|
|
31
|
+
authenticated: true;
|
|
32
|
+
credentialVersion: number;
|
|
33
|
+
capabilities: Array<'outbound' | 'inbound'>;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface IReq_CoreMailPrepareOutboundSubmission extends plugins.typedrequestInterfaces.implementsTR<
|
|
38
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
39
|
+
IReq_CoreMailPrepareOutboundSubmission
|
|
40
|
+
> {
|
|
41
|
+
method: 'coreMailPrepareOutboundSubmission';
|
|
42
|
+
request: {
|
|
43
|
+
/** Required replay key. Authority is added by the authenticated server session. */
|
|
44
|
+
idempotencyKey: string;
|
|
45
|
+
message: ICoreMailOutboundMessageDescriptor;
|
|
46
|
+
};
|
|
47
|
+
response: {
|
|
48
|
+
submission: ICoreMailSubmission;
|
|
49
|
+
replayed: boolean;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface IReq_CoreMailPrepareOutboundPartUpload extends plugins.typedrequestInterfaces.implementsTR<
|
|
54
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
55
|
+
IReq_CoreMailPrepareOutboundPartUpload
|
|
56
|
+
> {
|
|
57
|
+
method: 'coreMailPrepareOutboundPartUpload';
|
|
58
|
+
request: {
|
|
59
|
+
submissionId: string;
|
|
60
|
+
partId: string;
|
|
61
|
+
};
|
|
62
|
+
response: {
|
|
63
|
+
grant: ICoreMailUploadGrant;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface IReq_CoreMailCompleteOutboundPartUpload extends plugins.typedrequestInterfaces.implementsTR<
|
|
68
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
69
|
+
IReq_CoreMailCompleteOutboundPartUpload
|
|
70
|
+
> {
|
|
71
|
+
method: 'coreMailCompleteOutboundPartUpload';
|
|
72
|
+
request: {
|
|
73
|
+
submissionId: string;
|
|
74
|
+
partId: string;
|
|
75
|
+
grantId: string;
|
|
76
|
+
sha256: TCoreMailSha256;
|
|
77
|
+
lengthBytes: number;
|
|
78
|
+
};
|
|
79
|
+
response: {
|
|
80
|
+
submission: ICoreMailSubmission;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface IReq_CoreMailFinalizeOutboundSubmission extends plugins.typedrequestInterfaces.implementsTR<
|
|
85
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
86
|
+
IReq_CoreMailFinalizeOutboundSubmission
|
|
87
|
+
> {
|
|
88
|
+
method: 'coreMailFinalizeOutboundSubmission';
|
|
89
|
+
request: {
|
|
90
|
+
submissionId: string;
|
|
91
|
+
};
|
|
92
|
+
response: {
|
|
93
|
+
submission: ICoreMailSubmission;
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface IReq_CoreMailGetOutboundSubmission extends plugins.typedrequestInterfaces.implementsTR<
|
|
98
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
99
|
+
IReq_CoreMailGetOutboundSubmission
|
|
100
|
+
> {
|
|
101
|
+
method: 'coreMailGetOutboundSubmission';
|
|
102
|
+
request: {
|
|
103
|
+
submissionId: string;
|
|
104
|
+
};
|
|
105
|
+
response: {
|
|
106
|
+
submission: ICoreMailSubmission;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface IReq_CoreMailListInboundDeliveries extends plugins.typedrequestInterfaces.implementsTR<
|
|
111
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
112
|
+
IReq_CoreMailListInboundDeliveries
|
|
113
|
+
> {
|
|
114
|
+
method: 'coreMailListInboundDeliveries';
|
|
115
|
+
request: {
|
|
116
|
+
afterDeliveryId?: string;
|
|
117
|
+
limit: number;
|
|
118
|
+
};
|
|
119
|
+
response: {
|
|
120
|
+
deliveries: ICoreMailInboundDelivery[];
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface IReq_CoreMailPrepareInboundFetch extends plugins.typedrequestInterfaces.implementsTR<
|
|
125
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
126
|
+
IReq_CoreMailPrepareInboundFetch
|
|
127
|
+
> {
|
|
128
|
+
method: 'coreMailPrepareInboundFetch';
|
|
129
|
+
request: {
|
|
130
|
+
deliveryId: string;
|
|
131
|
+
};
|
|
132
|
+
response: {
|
|
133
|
+
grant: ICoreMailDownloadGrant;
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface IReq_CoreMailCompleteInboundFetch extends plugins.typedrequestInterfaces.implementsTR<
|
|
138
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
139
|
+
IReq_CoreMailCompleteInboundFetch
|
|
140
|
+
> {
|
|
141
|
+
method: 'coreMailCompleteInboundFetch';
|
|
142
|
+
request: {
|
|
143
|
+
deliveryId: string;
|
|
144
|
+
grantId: string;
|
|
145
|
+
sha256: TCoreMailSha256;
|
|
146
|
+
lengthBytes: number;
|
|
147
|
+
};
|
|
148
|
+
response: {
|
|
149
|
+
delivery: ICoreMailInboundDelivery;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface IReq_CoreMailAcknowledgeInboundDelivery extends plugins.typedrequestInterfaces.implementsTR<
|
|
154
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
155
|
+
IReq_CoreMailAcknowledgeInboundDelivery
|
|
156
|
+
> {
|
|
157
|
+
method: 'coreMailAcknowledgeInboundDelivery';
|
|
158
|
+
request: {
|
|
159
|
+
deliveryId: string;
|
|
160
|
+
outcome: TCoreMailInboundAckOutcome;
|
|
161
|
+
};
|
|
162
|
+
response: {
|
|
163
|
+
delivery: ICoreMailInboundDelivery;
|
|
164
|
+
replayed: boolean;
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface IReq_CoreMailAuthenticateControl extends plugins.typedrequestInterfaces.implementsTR<
|
|
169
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
170
|
+
IReq_CoreMailAuthenticateControl
|
|
171
|
+
> {
|
|
172
|
+
method: 'coreMailAuthenticateControl';
|
|
173
|
+
request: {
|
|
174
|
+
credentialId: string;
|
|
175
|
+
credentialVersion: number;
|
|
176
|
+
credentialSecret: string;
|
|
177
|
+
};
|
|
178
|
+
response: {
|
|
179
|
+
authenticated: true;
|
|
180
|
+
replica: ICoreMailReplicaIdentity;
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface IReq_CoreMailPrepareDesiredStateUpload extends plugins.typedrequestInterfaces.implementsTR<
|
|
185
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
186
|
+
IReq_CoreMailPrepareDesiredStateUpload
|
|
187
|
+
> {
|
|
188
|
+
method: 'coreMailPrepareDesiredStateUpload';
|
|
189
|
+
request: {
|
|
190
|
+
expectedAppliedConfigEpoch: number;
|
|
191
|
+
configEpoch: number;
|
|
192
|
+
desiredStateDigest: TCoreMailSha256;
|
|
193
|
+
lengthBytes: number;
|
|
194
|
+
};
|
|
195
|
+
response: {
|
|
196
|
+
reconciliationId: string;
|
|
197
|
+
grant: ICoreMailUploadGrant;
|
|
198
|
+
replayed: boolean;
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export interface IReq_CoreMailApplyDesiredState extends plugins.typedrequestInterfaces.implementsTR<
|
|
203
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
204
|
+
IReq_CoreMailApplyDesiredState
|
|
205
|
+
> {
|
|
206
|
+
method: 'coreMailApplyDesiredState';
|
|
207
|
+
request: {
|
|
208
|
+
reconciliationId: string;
|
|
209
|
+
grantId: string;
|
|
210
|
+
desiredStateDigest: TCoreMailSha256;
|
|
211
|
+
lengthBytes: number;
|
|
212
|
+
};
|
|
213
|
+
response: {
|
|
214
|
+
status: ICoreMailReconciliationStatus;
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export interface IReq_CoreMailGetReconciliationStatus extends plugins.typedrequestInterfaces.implementsTR<
|
|
219
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
220
|
+
IReq_CoreMailGetReconciliationStatus
|
|
221
|
+
> {
|
|
222
|
+
method: 'coreMailGetReconciliationStatus';
|
|
223
|
+
request: {
|
|
224
|
+
configEpoch: number;
|
|
225
|
+
desiredStateDigest: TCoreMailSha256;
|
|
226
|
+
};
|
|
227
|
+
response: {
|
|
228
|
+
status: ICoreMailReconciliationStatus;
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export interface IReq_CoreMailGatewayAuthenticate extends plugins.typedrequestInterfaces.implementsTR<
|
|
233
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
234
|
+
IReq_CoreMailGatewayAuthenticate
|
|
235
|
+
> {
|
|
236
|
+
method: 'coreMailGatewayAuthenticate';
|
|
237
|
+
request: {
|
|
238
|
+
credentialId: string;
|
|
239
|
+
credentialVersion: number;
|
|
240
|
+
credentialSecret: string;
|
|
241
|
+
};
|
|
242
|
+
response: {
|
|
243
|
+
authenticated: true;
|
|
244
|
+
credentialVersion: number;
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export interface IReq_CoreMailGatewayResolveRecipients extends plugins.typedrequestInterfaces.implementsTR<
|
|
249
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
250
|
+
IReq_CoreMailGatewayResolveRecipients
|
|
251
|
+
> {
|
|
252
|
+
method: 'coreMailGatewayResolveRecipients';
|
|
253
|
+
request: {
|
|
254
|
+
envelope: ICoreMailEnvelope;
|
|
255
|
+
recipients: string[];
|
|
256
|
+
source: IMailConnectionInfo;
|
|
257
|
+
};
|
|
258
|
+
response: {
|
|
259
|
+
resolutions: ICoreMailRecipientResolution[];
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export interface IReq_CoreMailGatewayPrepareInboundHandoff extends plugins.typedrequestInterfaces.implementsTR<
|
|
264
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
265
|
+
IReq_CoreMailGatewayPrepareInboundHandoff
|
|
266
|
+
> {
|
|
267
|
+
method: 'coreMailGatewayPrepareInboundHandoff';
|
|
268
|
+
request: {
|
|
269
|
+
transportDeliveryId: string;
|
|
270
|
+
routingHandles: string[];
|
|
271
|
+
message: ICoreMailGatewayMessageDescriptor;
|
|
272
|
+
source: IMailConnectionInfo;
|
|
273
|
+
};
|
|
274
|
+
response: {
|
|
275
|
+
handoffId: string;
|
|
276
|
+
grant?: ICoreMailUploadGrant;
|
|
277
|
+
replayed: boolean;
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export interface IReq_CoreMailGatewayCompleteInboundHandoff extends plugins.typedrequestInterfaces.implementsTR<
|
|
282
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
283
|
+
IReq_CoreMailGatewayCompleteInboundHandoff
|
|
284
|
+
> {
|
|
285
|
+
method: 'coreMailGatewayCompleteInboundHandoff';
|
|
286
|
+
request: {
|
|
287
|
+
handoffId: string;
|
|
288
|
+
grantId: string;
|
|
289
|
+
sha256: TCoreMailSha256;
|
|
290
|
+
lengthBytes: number;
|
|
291
|
+
};
|
|
292
|
+
response: {
|
|
293
|
+
accepted: true;
|
|
294
|
+
deliveryIds: string[];
|
|
295
|
+
replayed: boolean;
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export interface IReq_CoreMailGatewayPrepareOutboundHandoff extends plugins.typedrequestInterfaces.implementsTR<
|
|
300
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
301
|
+
IReq_CoreMailGatewayPrepareOutboundHandoff
|
|
302
|
+
> {
|
|
303
|
+
method: 'coreMailGatewayPrepareOutboundHandoff';
|
|
304
|
+
request: {
|
|
305
|
+
transportSubmissionId: string;
|
|
306
|
+
submissionDigest: TCoreMailSha256;
|
|
307
|
+
message: ICoreMailGatewayMessageDescriptor;
|
|
308
|
+
/** CoreMail-issued GET grant. dcrouter resolves the path against the authenticated peer. */
|
|
309
|
+
grant: ICoreMailDownloadGrant;
|
|
310
|
+
};
|
|
311
|
+
response: {
|
|
312
|
+
transportMessageId: string;
|
|
313
|
+
status: ICoreMailGatewayOutboundStatus;
|
|
314
|
+
replayed: boolean;
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export interface IReq_CoreMailGatewayCompleteOutboundHandoff extends plugins.typedrequestInterfaces.implementsTR<
|
|
319
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
320
|
+
IReq_CoreMailGatewayCompleteOutboundHandoff
|
|
321
|
+
> {
|
|
322
|
+
method: 'coreMailGatewayCompleteOutboundHandoff';
|
|
323
|
+
request: {
|
|
324
|
+
transportMessageId: string;
|
|
325
|
+
grantId: string;
|
|
326
|
+
sha256: TCoreMailSha256;
|
|
327
|
+
lengthBytes: number;
|
|
328
|
+
};
|
|
329
|
+
response: {
|
|
330
|
+
status: ICoreMailGatewayOutboundStatus;
|
|
331
|
+
replayed: boolean;
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
export interface IReq_CoreMailGatewayGetOutboundStatus extends plugins.typedrequestInterfaces.implementsTR<
|
|
336
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
337
|
+
IReq_CoreMailGatewayGetOutboundStatus
|
|
338
|
+
> {
|
|
339
|
+
method: 'coreMailGatewayGetOutboundStatus';
|
|
340
|
+
request: {
|
|
341
|
+
transportMessageId: string;
|
|
342
|
+
};
|
|
343
|
+
response: {
|
|
344
|
+
status: ICoreMailGatewayOutboundStatus;
|
|
345
|
+
};
|
|
346
|
+
}
|
package/ts/requests/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ import * as backupRequests from './backup.js';
|
|
|
8
8
|
import * as certificateRequests from './certificate.js';
|
|
9
9
|
import * as clusterRequests from './cluster.js';
|
|
10
10
|
import * as configRequests from './config.js';
|
|
11
|
+
import * as coreMailRequests from './coremail.js';
|
|
11
12
|
import * as corestoreRequests from './corestore.js';
|
|
12
13
|
import * as deploymentRequests from './deployment.js';
|
|
13
14
|
import * as dnsRequests from './dns.js';
|
|
@@ -45,6 +46,7 @@ export {
|
|
|
45
46
|
certificateRequests as certificate,
|
|
46
47
|
clusterRequests as cluster,
|
|
47
48
|
configRequests as config,
|
|
49
|
+
coreMailRequests as coremail,
|
|
48
50
|
corestoreRequests as corestore,
|
|
49
51
|
deploymentRequests as deployment,
|
|
50
52
|
dnsRequests as dns,
|