@meshery/schemas 1.3.50 → 1.3.52
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 +2 -1
- package/dist/cloudApi.d.mts +5825 -3150
- package/dist/cloudApi.d.ts +5825 -3150
- package/dist/cloudApi.js +1 -1
- package/dist/cloudApi.mjs +1 -1
- package/dist/constructs/v1beta1/organization_smtp/OrganizationSmtp.d.ts +2102 -0
- package/dist/constructs/v1beta1/organization_smtp/OrganizationSmtp.js +1 -0
- package/dist/constructs/v1beta1/organization_smtp/OrganizationSmtp.mjs +0 -0
- package/dist/constructs/v1beta1/organization_smtp/OrganizationSmtpSchema.d.ts +2 -0
- package/dist/constructs/v1beta1/organization_smtp/OrganizationSmtpSchema.js +8 -0
- package/dist/constructs/v1beta1/organization_smtp/OrganizationSmtpSchema.mjs +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,2102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by openapi-typescript.
|
|
3
|
+
* Do not make direct changes to the file.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export interface paths {
|
|
7
|
+
"/api/orgs/{orgId}/environments/mail-relay": {
|
|
8
|
+
parameters: {
|
|
9
|
+
query?: never;
|
|
10
|
+
header?: never;
|
|
11
|
+
path?: never;
|
|
12
|
+
cookie?: never;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Probe whether an organization has brought its own mail server
|
|
16
|
+
* @description Returns the organization's mail-relay environment when it exists. A 404 is the ordinary answer for an organization using the provider's shared relay, and is not an error condition.
|
|
17
|
+
*/
|
|
18
|
+
get: operations["getOrganizationSmtpEnvironment"];
|
|
19
|
+
put?: never;
|
|
20
|
+
post?: never;
|
|
21
|
+
/**
|
|
22
|
+
* Remove an organization's mail server entirely
|
|
23
|
+
* @description Removes the configuration, its stored credential and the environment that held them, together. The organization's mail reverts to the provider's shared relay.
|
|
24
|
+
* Idempotent, and deliberately declares no 404: removing an absent configuration succeeds with the same 204 as removing a present one, so "not found" is not an outcome this operation has. An unknown or unauthorized organization is answered by the permission middleware before the handler runs.
|
|
25
|
+
*/
|
|
26
|
+
delete: operations["deleteOrganizationSmtpEnvironment"];
|
|
27
|
+
options?: never;
|
|
28
|
+
head?: never;
|
|
29
|
+
patch?: never;
|
|
30
|
+
trace?: never;
|
|
31
|
+
};
|
|
32
|
+
"/api/orgs/{orgId}/environments/mail-relay/connection": {
|
|
33
|
+
parameters: {
|
|
34
|
+
query?: never;
|
|
35
|
+
header?: never;
|
|
36
|
+
path?: never;
|
|
37
|
+
cookie?: never;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Get an organization's SMTP configuration
|
|
41
|
+
* @description Returns the organization's mail server configuration, including its current status and from-domain verification state. The password is always the redaction sentinel `***`.
|
|
42
|
+
*/
|
|
43
|
+
get: operations["getOrganizationSmtpConfiguration"];
|
|
44
|
+
/**
|
|
45
|
+
* Update an organization's SMTP settings
|
|
46
|
+
* @description Replaces the settings. The payload has no `password` property at all and rejects unknown properties, so this operation cannot carry a credential even by accident - rotating the password is a separate operation. That is what lets an administrator rename a display name without retyping a secret, while the redaction sentinel stays refused everywhere it can be written.
|
|
47
|
+
* Changing the from address to a different registrable domain resets from-domain verification and returns the configuration to `registered`.
|
|
48
|
+
*/
|
|
49
|
+
put: operations["updateOrganizationSmtpConfiguration"];
|
|
50
|
+
/**
|
|
51
|
+
* Register an organization's SMTP server
|
|
52
|
+
* @description Creates the configuration, provisioning the mail-relay environment on the organization's behalf when it does not yet exist. This is the only operation that accepts the password alongside the settings; afterwards the two are written separately.
|
|
53
|
+
* The new configuration starts unproven, so mail continues to take the provider relay until the from domain is verified and a test delivery succeeds.
|
|
54
|
+
* Declares no 404 for the same reason the delete does not: this operation brings the configuration into existence, so its absence beforehand is the normal case rather than an error.
|
|
55
|
+
*/
|
|
56
|
+
post: operations["createOrganizationSmtpConfiguration"];
|
|
57
|
+
delete?: never;
|
|
58
|
+
options?: never;
|
|
59
|
+
head?: never;
|
|
60
|
+
patch?: never;
|
|
61
|
+
trace?: never;
|
|
62
|
+
};
|
|
63
|
+
"/api/orgs/{orgId}/environments/mail-relay/connection/credential": {
|
|
64
|
+
parameters: {
|
|
65
|
+
query?: never;
|
|
66
|
+
header?: never;
|
|
67
|
+
path?: never;
|
|
68
|
+
cookie?: never;
|
|
69
|
+
};
|
|
70
|
+
get?: never;
|
|
71
|
+
/**
|
|
72
|
+
* Rotate the password presented to an organization's SMTP server
|
|
73
|
+
* @description Replaces the stored password. The redaction sentinel `***` and the empty string are REFUSED with a 400 rather than treated as "leave it alone", so a client that echoes a read back cannot overwrite the credential with the sentinel.
|
|
74
|
+
*/
|
|
75
|
+
put: operations["rotateOrganizationSmtpCredential"];
|
|
76
|
+
post?: never;
|
|
77
|
+
delete?: never;
|
|
78
|
+
options?: never;
|
|
79
|
+
head?: never;
|
|
80
|
+
patch?: never;
|
|
81
|
+
trace?: never;
|
|
82
|
+
};
|
|
83
|
+
"/api/orgs/{orgId}/environments/mail-relay/connection/enablement": {
|
|
84
|
+
parameters: {
|
|
85
|
+
query?: never;
|
|
86
|
+
header?: never;
|
|
87
|
+
path?: never;
|
|
88
|
+
cookie?: never;
|
|
89
|
+
};
|
|
90
|
+
get?: never;
|
|
91
|
+
put?: never;
|
|
92
|
+
/**
|
|
93
|
+
* Turn an organization's own mail server on or off
|
|
94
|
+
* @description The only operation by which an administrator writes the configuration's status, and it can write only the two administrative states: turning it off moves the configuration to `ignored`, and turning it on returns it to `registered` so that it must prove itself again before mail is routed. `connected` and `disconnected` are written by delivery outcomes alone and are never settable here, which is what keeps a deliberate opt-out distinguishable from a failing relay.
|
|
95
|
+
* Turning it on is refused with a 409 while the from domain is unverified.
|
|
96
|
+
*/
|
|
97
|
+
post: operations["setOrganizationSmtpEnablement"];
|
|
98
|
+
delete?: never;
|
|
99
|
+
options?: never;
|
|
100
|
+
head?: never;
|
|
101
|
+
patch?: never;
|
|
102
|
+
trace?: never;
|
|
103
|
+
};
|
|
104
|
+
"/api/orgs/{orgId}/environments/mail-relay/connection/test": {
|
|
105
|
+
parameters: {
|
|
106
|
+
query?: never;
|
|
107
|
+
header?: never;
|
|
108
|
+
path?: never;
|
|
109
|
+
cookie?: never;
|
|
110
|
+
};
|
|
111
|
+
get?: never;
|
|
112
|
+
put?: never;
|
|
113
|
+
/**
|
|
114
|
+
* Send a test message through an organization's SMTP configuration
|
|
115
|
+
* @description Delivers a real message through the configured server and reports a classified outcome. A real delivery rather than a connection probe on purpose: a server that connects and authenticates but refuses the sender or the recipient is the most common misconfiguration, and a probe reports it healthy.
|
|
116
|
+
* A successful test is also what promotes a verified configuration from `registered` to `connected`, so this operation is part of the lifecycle rather than a convenience. It takes the same permission as a write, because there is no read-only form of dialling an arbitrary host, and it is rate limited per organization.
|
|
117
|
+
* The recipient defaults to the calling administrator's own address. The outcome is a classification, never the remote server's own text.
|
|
118
|
+
*/
|
|
119
|
+
post: operations["testOrganizationSmtpConfiguration"];
|
|
120
|
+
delete?: never;
|
|
121
|
+
options?: never;
|
|
122
|
+
head?: never;
|
|
123
|
+
patch?: never;
|
|
124
|
+
trace?: never;
|
|
125
|
+
};
|
|
126
|
+
"/api/orgs/{orgId}/environments/mail-relay/domain-verification": {
|
|
127
|
+
parameters: {
|
|
128
|
+
query?: never;
|
|
129
|
+
header?: never;
|
|
130
|
+
path?: never;
|
|
131
|
+
cookie?: never;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Get the from-domain verification challenge
|
|
135
|
+
* @description Returns the DNS record the organization must publish to prove control of its from domain, together with the current verification state. A from domain that matches the organization's own registered custom domain is already proven and needs no record.
|
|
136
|
+
*/
|
|
137
|
+
get: operations["getOrganizationSmtpDomainVerification"];
|
|
138
|
+
put?: never;
|
|
139
|
+
/**
|
|
140
|
+
* Check the from-domain verification challenge
|
|
141
|
+
* @description Resolves the challenge record and records the result. Proving the domain is what permits mail to be routed through the organization's server. Rate limited per organization.
|
|
142
|
+
*/
|
|
143
|
+
post: operations["verifyOrganizationSmtpDomain"];
|
|
144
|
+
delete?: never;
|
|
145
|
+
options?: never;
|
|
146
|
+
head?: never;
|
|
147
|
+
patch?: never;
|
|
148
|
+
trace?: never;
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
export type webhooks = Record<string, never>;
|
|
152
|
+
export interface components {
|
|
153
|
+
schemas: {
|
|
154
|
+
/**
|
|
155
|
+
* OrganizationSmtpConfiguration
|
|
156
|
+
* @description An organization's own outbound mail server. When present and healthy, every transactional email whose reader belongs to this organization - application notifications and identity-flow mail (account verification, password recovery) alike - is delivered through this server rather than through the provider's shared relay, so the message leaves from the organization's own domain. At most one live configuration exists per organization. The SMTP password is encrypted at rest and is never returned; reads always carry the redaction sentinel instead.
|
|
157
|
+
*
|
|
158
|
+
* This is a WIRE contract only. It is not backed by a table of its own: the configuration is stored on the same environment/connection/credential chain that bring-your-own identity providers already uses - a well-known per-organization Environment, joined through environments_connections_mappings to a Connection whose credential_id points at a Credential. The organization relationship lives on `environments.organization_id`, the dial target on `connections.url` and `connections.metadata`, the transport verdict on `connections.status`, and the password alone in `credentials.secret`.
|
|
159
|
+
*
|
|
160
|
+
* No property here carries a construct-specific `db` tag, because no property here names a column of its own. The exception is deliberate and inherited: `createdAt` and `updatedAt` `$ref` the shared core definitions, which declare `db: created_at` / `db: updated_at` for every construct that uses them, and those two tags are accurate for the underlying connection row.
|
|
161
|
+
* @example {
|
|
162
|
+
* "id": "00000000-0000-0000-0000-000000000000",
|
|
163
|
+
* "organizationId": "00000000-0000-0000-0000-000000000000",
|
|
164
|
+
* "host": "smtp.example.com",
|
|
165
|
+
* "port": 587,
|
|
166
|
+
* "encryption": "starttls",
|
|
167
|
+
* "authMechanism": "plain",
|
|
168
|
+
* "username": "no-reply@example.com",
|
|
169
|
+
* "password": "***",
|
|
170
|
+
* "fromAddress": "no-reply@example.com",
|
|
171
|
+
* "fromDisplayName": "Example Corp",
|
|
172
|
+
* "replyToAddress": "support@example.com",
|
|
173
|
+
* "status": "registered",
|
|
174
|
+
* "fallbackToProvider": true,
|
|
175
|
+
* "fromDomain": "example.com",
|
|
176
|
+
* "fromDomainVerificationToken": "0f6a5d2c9b1e4a7f8c3d6b0e2a4f7c19",
|
|
177
|
+
* "fromDomainVerifiedAt": null,
|
|
178
|
+
* "lastSuccessAt": null,
|
|
179
|
+
* "lastFailureAt": null,
|
|
180
|
+
* "consecutiveFailures": 0,
|
|
181
|
+
* "createdBy": "00000000-0000-0000-0000-000000000000",
|
|
182
|
+
* "createdAt": "0001-01-01T00:00:00Z",
|
|
183
|
+
* "updatedAt": "0001-01-01T00:00:00Z",
|
|
184
|
+
* "deletedAt": null
|
|
185
|
+
* }
|
|
186
|
+
*/
|
|
187
|
+
OrganizationSmtpConfiguration: {
|
|
188
|
+
/**
|
|
189
|
+
* Format: uuid
|
|
190
|
+
* @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
|
|
191
|
+
*/
|
|
192
|
+
id: string;
|
|
193
|
+
/**
|
|
194
|
+
* Format: uuid
|
|
195
|
+
* @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
|
|
196
|
+
*/
|
|
197
|
+
organizationId: string;
|
|
198
|
+
/** @description Hostname of the organization's SMTP server. */
|
|
199
|
+
host: string;
|
|
200
|
+
/**
|
|
201
|
+
* @description TCP port the organization's SMTP server listens on. The server additionally restricts this to a submission-port allowlist; a syntactically valid port outside it is refused.
|
|
202
|
+
* @default 587
|
|
203
|
+
*/
|
|
204
|
+
port: number;
|
|
205
|
+
/**
|
|
206
|
+
* @description Transport encryption to negotiate. `starttls` upgrades a cleartext connection (typically port 587), `tls` opens an implicit TLS connection (typically port 465), and `none` sends in cleartext and is intended only for an internal relay on a trusted network.
|
|
207
|
+
* @default starttls
|
|
208
|
+
* @enum {string}
|
|
209
|
+
*/
|
|
210
|
+
encryption: "starttls" | "tls" | "none";
|
|
211
|
+
/**
|
|
212
|
+
* @description SMTP authentication mechanism. `none` is permitted only for a relay that authorizes by source address; a configuration using any other mechanism must carry both a username and a password.
|
|
213
|
+
* @default plain
|
|
214
|
+
* @enum {string}
|
|
215
|
+
*/
|
|
216
|
+
authMechanism: "plain" | "cram-md5" | "none";
|
|
217
|
+
/** @description Username presented to the organization's SMTP server. Held beside the host rather than with the password because it is an identifier rather than a secret, and the health surface must show it without a decryption round trip. It is usually an email address, so it is returned only on an authorized read. */
|
|
218
|
+
username?: string;
|
|
219
|
+
/**
|
|
220
|
+
* @description Present only when a password is stored, and then always the redaction sentinel `***` - never the stored value, which is encrypted at rest and is never projected into a response. Its presence is therefore the only thing it reports: a configuration whose `authMechanism` is `none` stores no password and omits this property entirely. It is optional rather than required for exactly that reason.
|
|
221
|
+
* Read-only, and read-only here means read-only: no request body references this schema. The write semantics belong to the payload schemas - `OrganizationSmtpConfigurationPayload` on create and `OrganizationSmtpCredentialPayload` on rotation - and are documented there.
|
|
222
|
+
*/
|
|
223
|
+
readonly password?: string;
|
|
224
|
+
/**
|
|
225
|
+
* Format: email
|
|
226
|
+
* @description Address the organization's mail is sent from. Its domain must be verified before mail is routed through this server.
|
|
227
|
+
*/
|
|
228
|
+
fromAddress: string;
|
|
229
|
+
/** @description Display name shown alongside the from address in the message header. */
|
|
230
|
+
fromDisplayName?: string;
|
|
231
|
+
/**
|
|
232
|
+
* Format: email
|
|
233
|
+
* @description Address replies are directed to. It is also the address carried when a message falls back to the provider relay, which rewrites the from address to the provider's own so the message stays aligned for SPF and DMARC.
|
|
234
|
+
*/
|
|
235
|
+
replyToAddress?: string;
|
|
236
|
+
/**
|
|
237
|
+
* @description Lifecycle and transport verdict, carrying the connection status vocabulary because the configuration IS a connection. `registered` means configured but never proven - the from domain is unverified, or no message has yet been delivered - and mail takes the provider relay. `connected` means the last delivery attempt succeeded and mail is routed through this server. `disconnected` means consecutive failures opened the circuit, so the server is no longer dialled and the fallback setting decides what happens. `ignored` means an administrator turned it off.
|
|
238
|
+
*
|
|
239
|
+
* The writers are disjoint on purpose: only an administrator writes `ignored`, and only the delivery circuit writes `connected` or `disconnected`. That is what keeps a deliberate opt-out distinguishable from a failing relay. It also makes "enabled while the from domain is unverified" unrepresentable rather than merely forbidden, which is why this property replaces the separate `enabled` and `verificationState` pair it supersedes.
|
|
240
|
+
* @default registered
|
|
241
|
+
* @enum {string}
|
|
242
|
+
*/
|
|
243
|
+
status: "registered" | "connected" | "disconnected" | "ignored";
|
|
244
|
+
/**
|
|
245
|
+
* @description Whether a message that this server fails to accept is re-sent through the provider's shared relay. Disabling it means the organization owns delivery entirely and a failure is a dropped message, including account verification and password recovery.
|
|
246
|
+
* @default true
|
|
247
|
+
*/
|
|
248
|
+
fallbackToProvider: boolean;
|
|
249
|
+
/** @description Registrable domain of the from address, held separately as the unit that ownership is proven for. */
|
|
250
|
+
fromDomain?: string;
|
|
251
|
+
/** @description Token the organization publishes in DNS to prove control of the from domain. Not a credential - it authorizes nothing and grants no access. */
|
|
252
|
+
fromDomainVerificationToken?: string;
|
|
253
|
+
/**
|
|
254
|
+
* Format: date-time
|
|
255
|
+
* @description Timestamp at which control of the from domain was last proven. Null while unproven.
|
|
256
|
+
*/
|
|
257
|
+
fromDomainVerifiedAt?: string | null;
|
|
258
|
+
/**
|
|
259
|
+
* Format: date-time
|
|
260
|
+
* @description Timestamp of the last message this server accepted.
|
|
261
|
+
*/
|
|
262
|
+
lastSuccessAt?: string | null;
|
|
263
|
+
/**
|
|
264
|
+
* Format: date-time
|
|
265
|
+
* @description Timestamp of the last delivery attempt this server rejected or failed to accept.
|
|
266
|
+
*/
|
|
267
|
+
lastFailureAt?: string | null;
|
|
268
|
+
/**
|
|
269
|
+
* @description Classification of the last failure. Always a classification, never the remote server's own message: the set is closed on purpose, because reporting a remote server's text back to a caller would turn a refusal into an oracle for what the network can reach.
|
|
270
|
+
* @enum {string}
|
|
271
|
+
*/
|
|
272
|
+
lastFailureReason?: "blocked_target" | "connect_refused" | "connect_timeout" | "tls_failed" | "starttls_unsupported" | "auth_rejected" | "relay_rejected_sender" | "relay_rejected_recipient" | "delivery_failed" | "credential_unreadable";
|
|
273
|
+
/**
|
|
274
|
+
* @description Delivery failures since the last success. Drives the circuit that stops dialling a persistently unreachable server.
|
|
275
|
+
* @default 0
|
|
276
|
+
*/
|
|
277
|
+
consecutiveFailures: number;
|
|
278
|
+
/**
|
|
279
|
+
* Format: uuid
|
|
280
|
+
* @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
|
|
281
|
+
*/
|
|
282
|
+
createdBy?: string | null;
|
|
283
|
+
/**
|
|
284
|
+
* Format: date-time
|
|
285
|
+
* @description Timestamp when the configuration was created.
|
|
286
|
+
*/
|
|
287
|
+
createdAt: string;
|
|
288
|
+
/**
|
|
289
|
+
* Format: date-time
|
|
290
|
+
* @description Timestamp when the configuration was last changed.
|
|
291
|
+
*/
|
|
292
|
+
updatedAt: string;
|
|
293
|
+
/**
|
|
294
|
+
* Format: date-time
|
|
295
|
+
* @description Timestamp when the configuration was soft deleted. Null while it remains active.
|
|
296
|
+
*/
|
|
297
|
+
deletedAt?: string | null;
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* @description Everything needed to register an organization's mail server, settings and password together, so that registration is one operation. Accepted only on create; afterwards the settings and the credential are written by separate operations.
|
|
301
|
+
* `status`, the delivery counters behind it, the from-domain proof and the timestamps are all server-owned and are not accepted here. A new configuration therefore always starts at `registered`, whatever the caller sends.
|
|
302
|
+
*/
|
|
303
|
+
OrganizationSmtpConfigurationPayload: {
|
|
304
|
+
/** @description Hostname of the organization's SMTP server. */
|
|
305
|
+
host: string;
|
|
306
|
+
/**
|
|
307
|
+
* @description TCP port the organization's SMTP server listens on. Restricted further by a submission-port allowlist.
|
|
308
|
+
* @default 587
|
|
309
|
+
*/
|
|
310
|
+
port: number;
|
|
311
|
+
/**
|
|
312
|
+
* @description Transport encryption to negotiate. `starttls` upgrades a cleartext connection (typically port 587), `tls` opens an implicit TLS connection (typically port 465), and `none` sends in cleartext.
|
|
313
|
+
* @default starttls
|
|
314
|
+
* @enum {string}
|
|
315
|
+
*/
|
|
316
|
+
encryption: "starttls" | "tls" | "none";
|
|
317
|
+
/**
|
|
318
|
+
* @description SMTP authentication mechanism. Any mechanism other than `none` requires both a username and a password.
|
|
319
|
+
* @default plain
|
|
320
|
+
* @enum {string}
|
|
321
|
+
*/
|
|
322
|
+
authMechanism: "plain" | "cram-md5" | "none";
|
|
323
|
+
/** @description Username presented to the organization's SMTP server. Required by the server, together with `password`, for every `authMechanism` other than `none`; see that property for why the pairing is a server-enforced contract rather than a schema constraint. */
|
|
324
|
+
username?: string;
|
|
325
|
+
/**
|
|
326
|
+
* @description Password presented to the organization's SMTP server. The server requires it, together with `username`, for every `authMechanism` other than `none`, and answers 400 when either is missing.
|
|
327
|
+
* That rule is deliberately NOT encoded in `required` or as a `oneOf`/`if`-`then`. Both encodings were measured against the generator: `if`/`then` collapses this payload to `interface{}`, and `oneOf` injects a `union json.RawMessage` field with a custom marshaller, either of which costs every consumer its generated type or its wire behaviour to express a constraint the server enforces anyway. Treat this property as conditionally required by contract, not by schema.
|
|
328
|
+
* This is the ONLY operation that accepts the password alongside the settings, so that registering a mail server is one call and no configuration exists in a state where it is expected to send but holds no credential. Afterwards the password is written only by the rotation operation, never by the settings update, whose payload declares no `password` property at all.
|
|
329
|
+
* The redaction sentinel `***` is refused, and so is the empty string - omit the property instead of sending it empty, which the `minLength` below enforces so this payload and the rotation payload agree.
|
|
330
|
+
*/
|
|
331
|
+
password?: string;
|
|
332
|
+
/**
|
|
333
|
+
* Format: email
|
|
334
|
+
* @description Address the organization's mail is sent from.
|
|
335
|
+
*/
|
|
336
|
+
fromAddress: string;
|
|
337
|
+
/** @description Display name shown alongside the from address. */
|
|
338
|
+
fromDisplayName?: string;
|
|
339
|
+
/**
|
|
340
|
+
* Format: email
|
|
341
|
+
* @description Address replies are directed to.
|
|
342
|
+
*/
|
|
343
|
+
replyToAddress?: string;
|
|
344
|
+
/**
|
|
345
|
+
* @description Whether a message this server fails to accept is re-sent through the provider's shared relay. Disabling it means a failure is a dropped message, account verification and password recovery included.
|
|
346
|
+
* @default true
|
|
347
|
+
*/
|
|
348
|
+
fallbackToProvider: boolean;
|
|
349
|
+
};
|
|
350
|
+
/** @description Client-settable settings of an organization's mail server, WITHOUT the password. The omission is deliberate and structural: because this schema forbids unknown properties, a client cannot send a credential through this operation at all, so the read-then-write round trip that would otherwise overwrite a stored password with the redaction sentinel is not expressible. Rotate the password through its own operation. */
|
|
351
|
+
OrganizationSmtpSettingsPayload: {
|
|
352
|
+
/** @description Hostname of the organization's SMTP server. */
|
|
353
|
+
host: string;
|
|
354
|
+
/**
|
|
355
|
+
* @description TCP port the organization's SMTP server listens on. Restricted further by a submission-port allowlist.
|
|
356
|
+
* @default 587
|
|
357
|
+
*/
|
|
358
|
+
port: number;
|
|
359
|
+
/**
|
|
360
|
+
* @description Transport encryption to negotiate.
|
|
361
|
+
* @default starttls
|
|
362
|
+
* @enum {string}
|
|
363
|
+
*/
|
|
364
|
+
encryption: "starttls" | "tls" | "none";
|
|
365
|
+
/**
|
|
366
|
+
* @description SMTP authentication mechanism. Changing this to a mechanism other than `none` while no password is stored is refused; rotate the credential first.
|
|
367
|
+
* @default plain
|
|
368
|
+
* @enum {string}
|
|
369
|
+
*/
|
|
370
|
+
authMechanism: "plain" | "cram-md5" | "none";
|
|
371
|
+
/** @description Username presented to the organization's SMTP server. */
|
|
372
|
+
username?: string;
|
|
373
|
+
/**
|
|
374
|
+
* Format: email
|
|
375
|
+
* @description Address the organization's mail is sent from. Changing it to a different registrable domain resets from-domain verification.
|
|
376
|
+
*/
|
|
377
|
+
fromAddress: string;
|
|
378
|
+
/** @description Display name shown alongside the from address. */
|
|
379
|
+
fromDisplayName?: string;
|
|
380
|
+
/**
|
|
381
|
+
* Format: email
|
|
382
|
+
* @description Address replies are directed to.
|
|
383
|
+
*/
|
|
384
|
+
replyToAddress?: string;
|
|
385
|
+
/**
|
|
386
|
+
* @description Whether a message this server fails to accept is re-sent through the provider's shared relay.
|
|
387
|
+
* @default true
|
|
388
|
+
*/
|
|
389
|
+
fallbackToProvider: boolean;
|
|
390
|
+
};
|
|
391
|
+
/** @description The password presented to an organization's SMTP server. The only payload that carries it after creation. */
|
|
392
|
+
OrganizationSmtpCredentialPayload: {
|
|
393
|
+
/** @description New password. The redaction sentinel `***` and the empty string are refused with a 400 rather than treated as "leave the stored value alone", so echoing a read back cannot erase the credential. */
|
|
394
|
+
password: string;
|
|
395
|
+
};
|
|
396
|
+
/** @description Administrative on/off for an organization's own mail server. It cannot express the delivery-driven states, which are written by outcomes alone. */
|
|
397
|
+
OrganizationSmtpEnablementPayload: {
|
|
398
|
+
/** @description True returns the configuration to `registered` so it may prove itself and carry mail; false moves it to `ignored`. Turning it on is refused while the from domain is unverified. */
|
|
399
|
+
enabled: boolean;
|
|
400
|
+
};
|
|
401
|
+
/** @description Options for a test delivery. */
|
|
402
|
+
OrganizationSmtpTestRequest: {
|
|
403
|
+
/**
|
|
404
|
+
* Format: email
|
|
405
|
+
* @description Recipient of the test message. Defaults to the calling administrator's own address.
|
|
406
|
+
*/
|
|
407
|
+
to?: string;
|
|
408
|
+
};
|
|
409
|
+
/** @description Classified outcome of a test delivery. Carries no text from the remote server, so a refusal reveals nothing about what the network can reach. */
|
|
410
|
+
OrganizationSmtpTestResult: {
|
|
411
|
+
/**
|
|
412
|
+
* @description What happened. `delivered` means the server accepted the message; every other value names the stage that refused it.
|
|
413
|
+
* @enum {string}
|
|
414
|
+
*/
|
|
415
|
+
outcome: "delivered" | "blocked_target" | "connect_refused" | "connect_timeout" | "tls_failed" | "starttls_unsupported" | "auth_rejected" | "relay_rejected_sender" | "relay_rejected_recipient" | "delivery_failed" | "credential_unreadable";
|
|
416
|
+
/** @description Human-readable summary of the outcome, drawn from a fixed set of phrasings. */
|
|
417
|
+
message?: string;
|
|
418
|
+
/**
|
|
419
|
+
* Format: email
|
|
420
|
+
* @description Address the test message was addressed to.
|
|
421
|
+
*/
|
|
422
|
+
sentTo?: string;
|
|
423
|
+
/**
|
|
424
|
+
* Format: date-time
|
|
425
|
+
* @description When the delivery was attempted.
|
|
426
|
+
*/
|
|
427
|
+
testedAt: string;
|
|
428
|
+
};
|
|
429
|
+
/** @description The DNS record proving control of an organization's from domain, and the current state of that proof. */
|
|
430
|
+
OrganizationSmtpDomainChallenge: {
|
|
431
|
+
/** @description Registrable domain the proof applies to. */
|
|
432
|
+
domain: string;
|
|
433
|
+
/**
|
|
434
|
+
* @description How the domain is proven. `custom-domain` means it matches the organization's own registered custom domain and needs no record; `dns-txt` means the record below must be published.
|
|
435
|
+
* @enum {string}
|
|
436
|
+
*/
|
|
437
|
+
method: "custom-domain" | "dns-txt";
|
|
438
|
+
/** @description Fully qualified name of the TXT record to publish. */
|
|
439
|
+
recordName?: string;
|
|
440
|
+
/** @description Value the TXT record must carry. */
|
|
441
|
+
recordValue?: string;
|
|
442
|
+
/** @description Whether control of the domain is currently proven. */
|
|
443
|
+
verified: boolean;
|
|
444
|
+
/**
|
|
445
|
+
* Format: date-time
|
|
446
|
+
* @description When control was last proven. Null while unproven.
|
|
447
|
+
*/
|
|
448
|
+
verifiedAt?: string | null;
|
|
449
|
+
/**
|
|
450
|
+
* @description Why the last check did not prove control.
|
|
451
|
+
* @enum {string}
|
|
452
|
+
*/
|
|
453
|
+
failureReason?: "record_not_found" | "record_mismatch" | "lookup_failed" | "domain_reserved";
|
|
454
|
+
};
|
|
455
|
+
};
|
|
456
|
+
responses: {
|
|
457
|
+
/** @description Invalid request body or request param */
|
|
458
|
+
400: {
|
|
459
|
+
headers: {
|
|
460
|
+
[name: string]: unknown;
|
|
461
|
+
};
|
|
462
|
+
content: {
|
|
463
|
+
"text/plain": string;
|
|
464
|
+
};
|
|
465
|
+
};
|
|
466
|
+
/** @description Expired JWT token used or insufficient privilege */
|
|
467
|
+
401: {
|
|
468
|
+
headers: {
|
|
469
|
+
[name: string]: unknown;
|
|
470
|
+
};
|
|
471
|
+
content: {
|
|
472
|
+
"text/plain": string;
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
/** @description Caller lacks the permission key required for this organization */
|
|
476
|
+
403: {
|
|
477
|
+
headers: {
|
|
478
|
+
[name: string]: unknown;
|
|
479
|
+
};
|
|
480
|
+
content: {
|
|
481
|
+
"text/plain": string;
|
|
482
|
+
};
|
|
483
|
+
};
|
|
484
|
+
/** @description Result not found */
|
|
485
|
+
404: {
|
|
486
|
+
headers: {
|
|
487
|
+
[name: string]: unknown;
|
|
488
|
+
};
|
|
489
|
+
content: {
|
|
490
|
+
"text/plain": string;
|
|
491
|
+
};
|
|
492
|
+
};
|
|
493
|
+
/** @description The configuration already exists, or the requested state transition is refused in the configuration's current state */
|
|
494
|
+
409: {
|
|
495
|
+
headers: {
|
|
496
|
+
[name: string]: unknown;
|
|
497
|
+
};
|
|
498
|
+
content: {
|
|
499
|
+
"text/plain": string;
|
|
500
|
+
};
|
|
501
|
+
};
|
|
502
|
+
/** @description Too many attempts for this organization */
|
|
503
|
+
429: {
|
|
504
|
+
headers: {
|
|
505
|
+
[name: string]: unknown;
|
|
506
|
+
};
|
|
507
|
+
content: {
|
|
508
|
+
"text/plain": string;
|
|
509
|
+
};
|
|
510
|
+
};
|
|
511
|
+
/** @description Internal server error */
|
|
512
|
+
500: {
|
|
513
|
+
headers: {
|
|
514
|
+
[name: string]: unknown;
|
|
515
|
+
};
|
|
516
|
+
content: {
|
|
517
|
+
"text/plain": string;
|
|
518
|
+
};
|
|
519
|
+
};
|
|
520
|
+
};
|
|
521
|
+
parameters: {
|
|
522
|
+
/** @description Organization ID */
|
|
523
|
+
orgId: string;
|
|
524
|
+
};
|
|
525
|
+
requestBodies: {
|
|
526
|
+
organizationSmtpConfigurationPayload: {
|
|
527
|
+
content: {
|
|
528
|
+
"application/json": {
|
|
529
|
+
/** @description Hostname of the organization's SMTP server. */
|
|
530
|
+
host: string;
|
|
531
|
+
/**
|
|
532
|
+
* @description TCP port the organization's SMTP server listens on. Restricted further by a submission-port allowlist.
|
|
533
|
+
* @default 587
|
|
534
|
+
*/
|
|
535
|
+
port: number;
|
|
536
|
+
/**
|
|
537
|
+
* @description Transport encryption to negotiate. `starttls` upgrades a cleartext connection (typically port 587), `tls` opens an implicit TLS connection (typically port 465), and `none` sends in cleartext.
|
|
538
|
+
* @default starttls
|
|
539
|
+
* @enum {string}
|
|
540
|
+
*/
|
|
541
|
+
encryption?: "starttls" | "tls" | "none";
|
|
542
|
+
/**
|
|
543
|
+
* @description SMTP authentication mechanism. Any mechanism other than `none` requires both a username and a password.
|
|
544
|
+
* @default plain
|
|
545
|
+
* @enum {string}
|
|
546
|
+
*/
|
|
547
|
+
authMechanism?: "plain" | "cram-md5" | "none";
|
|
548
|
+
/** @description Username presented to the organization's SMTP server. Required by the server, together with `password`, for every `authMechanism` other than `none`; see that property for why the pairing is a server-enforced contract rather than a schema constraint. */
|
|
549
|
+
username?: string;
|
|
550
|
+
/**
|
|
551
|
+
* @description Password presented to the organization's SMTP server. The server requires it, together with `username`, for every `authMechanism` other than `none`, and answers 400 when either is missing.
|
|
552
|
+
* That rule is deliberately NOT encoded in `required` or as a `oneOf`/`if`-`then`. Both encodings were measured against the generator: `if`/`then` collapses this payload to `interface{}`, and `oneOf` injects a `union json.RawMessage` field with a custom marshaller, either of which costs every consumer its generated type or its wire behaviour to express a constraint the server enforces anyway. Treat this property as conditionally required by contract, not by schema.
|
|
553
|
+
* This is the ONLY operation that accepts the password alongside the settings, so that registering a mail server is one call and no configuration exists in a state where it is expected to send but holds no credential. Afterwards the password is written only by the rotation operation, never by the settings update, whose payload declares no `password` property at all.
|
|
554
|
+
* The redaction sentinel `***` is refused, and so is the empty string - omit the property instead of sending it empty, which the `minLength` below enforces so this payload and the rotation payload agree.
|
|
555
|
+
*/
|
|
556
|
+
password?: string;
|
|
557
|
+
/**
|
|
558
|
+
* Format: email
|
|
559
|
+
* @description Address the organization's mail is sent from.
|
|
560
|
+
*/
|
|
561
|
+
fromAddress: string;
|
|
562
|
+
/** @description Display name shown alongside the from address. */
|
|
563
|
+
fromDisplayName?: string;
|
|
564
|
+
/**
|
|
565
|
+
* Format: email
|
|
566
|
+
* @description Address replies are directed to.
|
|
567
|
+
*/
|
|
568
|
+
replyToAddress?: string;
|
|
569
|
+
/**
|
|
570
|
+
* @description Whether a message this server fails to accept is re-sent through the provider's shared relay. Disabling it means a failure is a dropped message, account verification and password recovery included.
|
|
571
|
+
* @default true
|
|
572
|
+
*/
|
|
573
|
+
fallbackToProvider?: boolean;
|
|
574
|
+
};
|
|
575
|
+
};
|
|
576
|
+
};
|
|
577
|
+
organizationSmtpSettingsPayload: {
|
|
578
|
+
content: {
|
|
579
|
+
"application/json": {
|
|
580
|
+
/** @description Hostname of the organization's SMTP server. */
|
|
581
|
+
host: string;
|
|
582
|
+
/**
|
|
583
|
+
* @description TCP port the organization's SMTP server listens on. Restricted further by a submission-port allowlist.
|
|
584
|
+
* @default 587
|
|
585
|
+
*/
|
|
586
|
+
port: number;
|
|
587
|
+
/**
|
|
588
|
+
* @description Transport encryption to negotiate.
|
|
589
|
+
* @default starttls
|
|
590
|
+
* @enum {string}
|
|
591
|
+
*/
|
|
592
|
+
encryption?: "starttls" | "tls" | "none";
|
|
593
|
+
/**
|
|
594
|
+
* @description SMTP authentication mechanism. Changing this to a mechanism other than `none` while no password is stored is refused; rotate the credential first.
|
|
595
|
+
* @default plain
|
|
596
|
+
* @enum {string}
|
|
597
|
+
*/
|
|
598
|
+
authMechanism?: "plain" | "cram-md5" | "none";
|
|
599
|
+
/** @description Username presented to the organization's SMTP server. */
|
|
600
|
+
username?: string;
|
|
601
|
+
/**
|
|
602
|
+
* Format: email
|
|
603
|
+
* @description Address the organization's mail is sent from. Changing it to a different registrable domain resets from-domain verification.
|
|
604
|
+
*/
|
|
605
|
+
fromAddress: string;
|
|
606
|
+
/** @description Display name shown alongside the from address. */
|
|
607
|
+
fromDisplayName?: string;
|
|
608
|
+
/**
|
|
609
|
+
* Format: email
|
|
610
|
+
* @description Address replies are directed to.
|
|
611
|
+
*/
|
|
612
|
+
replyToAddress?: string;
|
|
613
|
+
/**
|
|
614
|
+
* @description Whether a message this server fails to accept is re-sent through the provider's shared relay.
|
|
615
|
+
* @default true
|
|
616
|
+
*/
|
|
617
|
+
fallbackToProvider?: boolean;
|
|
618
|
+
};
|
|
619
|
+
};
|
|
620
|
+
};
|
|
621
|
+
organizationSmtpCredentialPayload: {
|
|
622
|
+
content: {
|
|
623
|
+
"application/json": {
|
|
624
|
+
/** @description New password. The redaction sentinel `***` and the empty string are refused with a 400 rather than treated as "leave the stored value alone", so echoing a read back cannot erase the credential. */
|
|
625
|
+
password: string;
|
|
626
|
+
};
|
|
627
|
+
};
|
|
628
|
+
};
|
|
629
|
+
organizationSmtpEnablementPayload: {
|
|
630
|
+
content: {
|
|
631
|
+
"application/json": {
|
|
632
|
+
/** @description True returns the configuration to `registered` so it may prove itself and carry mail; false moves it to `ignored`. Turning it on is refused while the from domain is unverified. */
|
|
633
|
+
enabled: boolean;
|
|
634
|
+
};
|
|
635
|
+
};
|
|
636
|
+
};
|
|
637
|
+
organizationSmtpTestRequest: {
|
|
638
|
+
content: {
|
|
639
|
+
"application/json": {
|
|
640
|
+
/**
|
|
641
|
+
* Format: email
|
|
642
|
+
* @description Recipient of the test message. Defaults to the calling administrator's own address.
|
|
643
|
+
*/
|
|
644
|
+
to?: string;
|
|
645
|
+
};
|
|
646
|
+
};
|
|
647
|
+
};
|
|
648
|
+
};
|
|
649
|
+
headers: never;
|
|
650
|
+
pathItems: never;
|
|
651
|
+
}
|
|
652
|
+
export type $defs = Record<string, never>;
|
|
653
|
+
export interface operations {
|
|
654
|
+
getOrganizationSmtpEnvironment: {
|
|
655
|
+
parameters: {
|
|
656
|
+
query?: never;
|
|
657
|
+
header?: never;
|
|
658
|
+
path: {
|
|
659
|
+
/** @description Organization ID */
|
|
660
|
+
orgId: string;
|
|
661
|
+
};
|
|
662
|
+
cookie?: never;
|
|
663
|
+
};
|
|
664
|
+
requestBody?: never;
|
|
665
|
+
responses: {
|
|
666
|
+
/** @description The organization has its own mail-relay environment. The canonical Environment shape, not a bespoke one: this endpoint returns an ordinary environment row that happens to carry the well-known name. */
|
|
667
|
+
200: {
|
|
668
|
+
headers: {
|
|
669
|
+
[name: string]: unknown;
|
|
670
|
+
};
|
|
671
|
+
content: {
|
|
672
|
+
"application/json": {
|
|
673
|
+
/**
|
|
674
|
+
* Format: uuid
|
|
675
|
+
* @description ID
|
|
676
|
+
*/
|
|
677
|
+
id: string;
|
|
678
|
+
/**
|
|
679
|
+
* @description Specifies the version of the schema to which the environment conforms.
|
|
680
|
+
* @default environments.meshery.io/v1beta3
|
|
681
|
+
* @example [
|
|
682
|
+
* "v1",
|
|
683
|
+
* "v1alpha1",
|
|
684
|
+
* "v2beta3",
|
|
685
|
+
* "v1.custom-suffix",
|
|
686
|
+
* "models.meshery.io/v1beta1",
|
|
687
|
+
* "capability.meshery.io/v1alpha1"
|
|
688
|
+
* ]
|
|
689
|
+
*/
|
|
690
|
+
schemaVersion: string;
|
|
691
|
+
/** @description Environment name */
|
|
692
|
+
name: string;
|
|
693
|
+
/** @description Environment description */
|
|
694
|
+
description: string;
|
|
695
|
+
/**
|
|
696
|
+
* Format: uuid
|
|
697
|
+
* @description Environment organization ID
|
|
698
|
+
*/
|
|
699
|
+
organizationId: string;
|
|
700
|
+
/**
|
|
701
|
+
* Format: uuid
|
|
702
|
+
* @description Environment owner
|
|
703
|
+
*/
|
|
704
|
+
owner?: string;
|
|
705
|
+
/**
|
|
706
|
+
* Format: date-time
|
|
707
|
+
* @description Timestamp when the environment was created.
|
|
708
|
+
*/
|
|
709
|
+
createdAt?: string;
|
|
710
|
+
/** @description Additional metadata associated with the environment. */
|
|
711
|
+
metadata?: Record<string, never>;
|
|
712
|
+
/**
|
|
713
|
+
* Format: date-time
|
|
714
|
+
* @description Timestamp when the environment was last updated.
|
|
715
|
+
*/
|
|
716
|
+
updatedAt?: string;
|
|
717
|
+
/**
|
|
718
|
+
* Format: date-time
|
|
719
|
+
* @description Timestamp when the environment was soft deleted. Null while the environment remains active.
|
|
720
|
+
*/
|
|
721
|
+
deletedAt?: string | null;
|
|
722
|
+
};
|
|
723
|
+
};
|
|
724
|
+
};
|
|
725
|
+
/** @description Expired JWT token used or insufficient privilege */
|
|
726
|
+
401: {
|
|
727
|
+
headers: {
|
|
728
|
+
[name: string]: unknown;
|
|
729
|
+
};
|
|
730
|
+
content: {
|
|
731
|
+
"text/plain": string;
|
|
732
|
+
};
|
|
733
|
+
};
|
|
734
|
+
/** @description Caller lacks the permission key required for this organization */
|
|
735
|
+
403: {
|
|
736
|
+
headers: {
|
|
737
|
+
[name: string]: unknown;
|
|
738
|
+
};
|
|
739
|
+
content: {
|
|
740
|
+
"text/plain": string;
|
|
741
|
+
};
|
|
742
|
+
};
|
|
743
|
+
/** @description Result not found */
|
|
744
|
+
404: {
|
|
745
|
+
headers: {
|
|
746
|
+
[name: string]: unknown;
|
|
747
|
+
};
|
|
748
|
+
content: {
|
|
749
|
+
"text/plain": string;
|
|
750
|
+
};
|
|
751
|
+
};
|
|
752
|
+
/** @description Internal server error */
|
|
753
|
+
500: {
|
|
754
|
+
headers: {
|
|
755
|
+
[name: string]: unknown;
|
|
756
|
+
};
|
|
757
|
+
content: {
|
|
758
|
+
"text/plain": string;
|
|
759
|
+
};
|
|
760
|
+
};
|
|
761
|
+
};
|
|
762
|
+
};
|
|
763
|
+
deleteOrganizationSmtpEnvironment: {
|
|
764
|
+
parameters: {
|
|
765
|
+
query?: never;
|
|
766
|
+
header?: never;
|
|
767
|
+
path: {
|
|
768
|
+
/** @description Organization ID */
|
|
769
|
+
orgId: string;
|
|
770
|
+
};
|
|
771
|
+
cookie?: never;
|
|
772
|
+
};
|
|
773
|
+
requestBody?: never;
|
|
774
|
+
responses: {
|
|
775
|
+
/** @description The configuration was removed. */
|
|
776
|
+
204: {
|
|
777
|
+
headers: {
|
|
778
|
+
[name: string]: unknown;
|
|
779
|
+
};
|
|
780
|
+
content?: never;
|
|
781
|
+
};
|
|
782
|
+
/** @description Expired JWT token used or insufficient privilege */
|
|
783
|
+
401: {
|
|
784
|
+
headers: {
|
|
785
|
+
[name: string]: unknown;
|
|
786
|
+
};
|
|
787
|
+
content: {
|
|
788
|
+
"text/plain": string;
|
|
789
|
+
};
|
|
790
|
+
};
|
|
791
|
+
/** @description Caller lacks the permission key required for this organization */
|
|
792
|
+
403: {
|
|
793
|
+
headers: {
|
|
794
|
+
[name: string]: unknown;
|
|
795
|
+
};
|
|
796
|
+
content: {
|
|
797
|
+
"text/plain": string;
|
|
798
|
+
};
|
|
799
|
+
};
|
|
800
|
+
/** @description Internal server error */
|
|
801
|
+
500: {
|
|
802
|
+
headers: {
|
|
803
|
+
[name: string]: unknown;
|
|
804
|
+
};
|
|
805
|
+
content: {
|
|
806
|
+
"text/plain": string;
|
|
807
|
+
};
|
|
808
|
+
};
|
|
809
|
+
};
|
|
810
|
+
};
|
|
811
|
+
getOrganizationSmtpConfiguration: {
|
|
812
|
+
parameters: {
|
|
813
|
+
query?: never;
|
|
814
|
+
header?: never;
|
|
815
|
+
path: {
|
|
816
|
+
/** @description Organization ID */
|
|
817
|
+
orgId: string;
|
|
818
|
+
};
|
|
819
|
+
cookie?: never;
|
|
820
|
+
};
|
|
821
|
+
requestBody?: never;
|
|
822
|
+
responses: {
|
|
823
|
+
/** @description The organization's SMTP configuration. */
|
|
824
|
+
200: {
|
|
825
|
+
headers: {
|
|
826
|
+
[name: string]: unknown;
|
|
827
|
+
};
|
|
828
|
+
content: {
|
|
829
|
+
"application/json": {
|
|
830
|
+
/**
|
|
831
|
+
* Format: uuid
|
|
832
|
+
* @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
|
|
833
|
+
*/
|
|
834
|
+
id: string;
|
|
835
|
+
/**
|
|
836
|
+
* Format: uuid
|
|
837
|
+
* @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
|
|
838
|
+
*/
|
|
839
|
+
organizationId: string;
|
|
840
|
+
/** @description Hostname of the organization's SMTP server. */
|
|
841
|
+
host: string;
|
|
842
|
+
/**
|
|
843
|
+
* @description TCP port the organization's SMTP server listens on. The server additionally restricts this to a submission-port allowlist; a syntactically valid port outside it is refused.
|
|
844
|
+
* @default 587
|
|
845
|
+
*/
|
|
846
|
+
port: number;
|
|
847
|
+
/**
|
|
848
|
+
* @description Transport encryption to negotiate. `starttls` upgrades a cleartext connection (typically port 587), `tls` opens an implicit TLS connection (typically port 465), and `none` sends in cleartext and is intended only for an internal relay on a trusted network.
|
|
849
|
+
* @default starttls
|
|
850
|
+
* @enum {string}
|
|
851
|
+
*/
|
|
852
|
+
encryption: "starttls" | "tls" | "none";
|
|
853
|
+
/**
|
|
854
|
+
* @description SMTP authentication mechanism. `none` is permitted only for a relay that authorizes by source address; a configuration using any other mechanism must carry both a username and a password.
|
|
855
|
+
* @default plain
|
|
856
|
+
* @enum {string}
|
|
857
|
+
*/
|
|
858
|
+
authMechanism: "plain" | "cram-md5" | "none";
|
|
859
|
+
/** @description Username presented to the organization's SMTP server. Held beside the host rather than with the password because it is an identifier rather than a secret, and the health surface must show it without a decryption round trip. It is usually an email address, so it is returned only on an authorized read. */
|
|
860
|
+
username?: string;
|
|
861
|
+
/**
|
|
862
|
+
* @description Present only when a password is stored, and then always the redaction sentinel `***` - never the stored value, which is encrypted at rest and is never projected into a response. Its presence is therefore the only thing it reports: a configuration whose `authMechanism` is `none` stores no password and omits this property entirely. It is optional rather than required for exactly that reason.
|
|
863
|
+
* Read-only, and read-only here means read-only: no request body references this schema. The write semantics belong to the payload schemas - `OrganizationSmtpConfigurationPayload` on create and `OrganizationSmtpCredentialPayload` on rotation - and are documented there.
|
|
864
|
+
*/
|
|
865
|
+
readonly password?: string;
|
|
866
|
+
/**
|
|
867
|
+
* Format: email
|
|
868
|
+
* @description Address the organization's mail is sent from. Its domain must be verified before mail is routed through this server.
|
|
869
|
+
*/
|
|
870
|
+
fromAddress: string;
|
|
871
|
+
/** @description Display name shown alongside the from address in the message header. */
|
|
872
|
+
fromDisplayName?: string;
|
|
873
|
+
/**
|
|
874
|
+
* Format: email
|
|
875
|
+
* @description Address replies are directed to. It is also the address carried when a message falls back to the provider relay, which rewrites the from address to the provider's own so the message stays aligned for SPF and DMARC.
|
|
876
|
+
*/
|
|
877
|
+
replyToAddress?: string;
|
|
878
|
+
/**
|
|
879
|
+
* @description Lifecycle and transport verdict, carrying the connection status vocabulary because the configuration IS a connection. `registered` means configured but never proven - the from domain is unverified, or no message has yet been delivered - and mail takes the provider relay. `connected` means the last delivery attempt succeeded and mail is routed through this server. `disconnected` means consecutive failures opened the circuit, so the server is no longer dialled and the fallback setting decides what happens. `ignored` means an administrator turned it off.
|
|
880
|
+
*
|
|
881
|
+
* The writers are disjoint on purpose: only an administrator writes `ignored`, and only the delivery circuit writes `connected` or `disconnected`. That is what keeps a deliberate opt-out distinguishable from a failing relay. It also makes "enabled while the from domain is unverified" unrepresentable rather than merely forbidden, which is why this property replaces the separate `enabled` and `verificationState` pair it supersedes.
|
|
882
|
+
* @default registered
|
|
883
|
+
* @enum {string}
|
|
884
|
+
*/
|
|
885
|
+
status: "registered" | "connected" | "disconnected" | "ignored";
|
|
886
|
+
/**
|
|
887
|
+
* @description Whether a message that this server fails to accept is re-sent through the provider's shared relay. Disabling it means the organization owns delivery entirely and a failure is a dropped message, including account verification and password recovery.
|
|
888
|
+
* @default true
|
|
889
|
+
*/
|
|
890
|
+
fallbackToProvider: boolean;
|
|
891
|
+
/** @description Registrable domain of the from address, held separately as the unit that ownership is proven for. */
|
|
892
|
+
fromDomain?: string;
|
|
893
|
+
/** @description Token the organization publishes in DNS to prove control of the from domain. Not a credential - it authorizes nothing and grants no access. */
|
|
894
|
+
fromDomainVerificationToken?: string;
|
|
895
|
+
/**
|
|
896
|
+
* Format: date-time
|
|
897
|
+
* @description Timestamp at which control of the from domain was last proven. Null while unproven.
|
|
898
|
+
*/
|
|
899
|
+
fromDomainVerifiedAt?: string | null;
|
|
900
|
+
/**
|
|
901
|
+
* Format: date-time
|
|
902
|
+
* @description Timestamp of the last message this server accepted.
|
|
903
|
+
*/
|
|
904
|
+
lastSuccessAt?: string | null;
|
|
905
|
+
/**
|
|
906
|
+
* Format: date-time
|
|
907
|
+
* @description Timestamp of the last delivery attempt this server rejected or failed to accept.
|
|
908
|
+
*/
|
|
909
|
+
lastFailureAt?: string | null;
|
|
910
|
+
/**
|
|
911
|
+
* @description Classification of the last failure. Always a classification, never the remote server's own message: the set is closed on purpose, because reporting a remote server's text back to a caller would turn a refusal into an oracle for what the network can reach.
|
|
912
|
+
* @enum {string}
|
|
913
|
+
*/
|
|
914
|
+
lastFailureReason?: "blocked_target" | "connect_refused" | "connect_timeout" | "tls_failed" | "starttls_unsupported" | "auth_rejected" | "relay_rejected_sender" | "relay_rejected_recipient" | "delivery_failed" | "credential_unreadable";
|
|
915
|
+
/**
|
|
916
|
+
* @description Delivery failures since the last success. Drives the circuit that stops dialling a persistently unreachable server.
|
|
917
|
+
* @default 0
|
|
918
|
+
*/
|
|
919
|
+
consecutiveFailures: number;
|
|
920
|
+
/**
|
|
921
|
+
* Format: uuid
|
|
922
|
+
* @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
|
|
923
|
+
*/
|
|
924
|
+
createdBy?: string | null;
|
|
925
|
+
/**
|
|
926
|
+
* Format: date-time
|
|
927
|
+
* @description Timestamp when the configuration was created.
|
|
928
|
+
*/
|
|
929
|
+
createdAt: string;
|
|
930
|
+
/**
|
|
931
|
+
* Format: date-time
|
|
932
|
+
* @description Timestamp when the configuration was last changed.
|
|
933
|
+
*/
|
|
934
|
+
updatedAt: string;
|
|
935
|
+
/**
|
|
936
|
+
* Format: date-time
|
|
937
|
+
* @description Timestamp when the configuration was soft deleted. Null while it remains active.
|
|
938
|
+
*/
|
|
939
|
+
deletedAt?: string | null;
|
|
940
|
+
};
|
|
941
|
+
};
|
|
942
|
+
};
|
|
943
|
+
/** @description Expired JWT token used or insufficient privilege */
|
|
944
|
+
401: {
|
|
945
|
+
headers: {
|
|
946
|
+
[name: string]: unknown;
|
|
947
|
+
};
|
|
948
|
+
content: {
|
|
949
|
+
"text/plain": string;
|
|
950
|
+
};
|
|
951
|
+
};
|
|
952
|
+
/** @description Caller lacks the permission key required for this organization */
|
|
953
|
+
403: {
|
|
954
|
+
headers: {
|
|
955
|
+
[name: string]: unknown;
|
|
956
|
+
};
|
|
957
|
+
content: {
|
|
958
|
+
"text/plain": string;
|
|
959
|
+
};
|
|
960
|
+
};
|
|
961
|
+
/** @description Result not found */
|
|
962
|
+
404: {
|
|
963
|
+
headers: {
|
|
964
|
+
[name: string]: unknown;
|
|
965
|
+
};
|
|
966
|
+
content: {
|
|
967
|
+
"text/plain": string;
|
|
968
|
+
};
|
|
969
|
+
};
|
|
970
|
+
/** @description Internal server error */
|
|
971
|
+
500: {
|
|
972
|
+
headers: {
|
|
973
|
+
[name: string]: unknown;
|
|
974
|
+
};
|
|
975
|
+
content: {
|
|
976
|
+
"text/plain": string;
|
|
977
|
+
};
|
|
978
|
+
};
|
|
979
|
+
};
|
|
980
|
+
};
|
|
981
|
+
updateOrganizationSmtpConfiguration: {
|
|
982
|
+
parameters: {
|
|
983
|
+
query?: never;
|
|
984
|
+
header?: never;
|
|
985
|
+
path: {
|
|
986
|
+
/** @description Organization ID */
|
|
987
|
+
orgId: string;
|
|
988
|
+
};
|
|
989
|
+
cookie?: never;
|
|
990
|
+
};
|
|
991
|
+
requestBody: {
|
|
992
|
+
content: {
|
|
993
|
+
"application/json": {
|
|
994
|
+
/** @description Hostname of the organization's SMTP server. */
|
|
995
|
+
host: string;
|
|
996
|
+
/**
|
|
997
|
+
* @description TCP port the organization's SMTP server listens on. Restricted further by a submission-port allowlist.
|
|
998
|
+
* @default 587
|
|
999
|
+
*/
|
|
1000
|
+
port: number;
|
|
1001
|
+
/**
|
|
1002
|
+
* @description Transport encryption to negotiate.
|
|
1003
|
+
* @default starttls
|
|
1004
|
+
* @enum {string}
|
|
1005
|
+
*/
|
|
1006
|
+
encryption?: "starttls" | "tls" | "none";
|
|
1007
|
+
/**
|
|
1008
|
+
* @description SMTP authentication mechanism. Changing this to a mechanism other than `none` while no password is stored is refused; rotate the credential first.
|
|
1009
|
+
* @default plain
|
|
1010
|
+
* @enum {string}
|
|
1011
|
+
*/
|
|
1012
|
+
authMechanism?: "plain" | "cram-md5" | "none";
|
|
1013
|
+
/** @description Username presented to the organization's SMTP server. */
|
|
1014
|
+
username?: string;
|
|
1015
|
+
/**
|
|
1016
|
+
* Format: email
|
|
1017
|
+
* @description Address the organization's mail is sent from. Changing it to a different registrable domain resets from-domain verification.
|
|
1018
|
+
*/
|
|
1019
|
+
fromAddress: string;
|
|
1020
|
+
/** @description Display name shown alongside the from address. */
|
|
1021
|
+
fromDisplayName?: string;
|
|
1022
|
+
/**
|
|
1023
|
+
* Format: email
|
|
1024
|
+
* @description Address replies are directed to.
|
|
1025
|
+
*/
|
|
1026
|
+
replyToAddress?: string;
|
|
1027
|
+
/**
|
|
1028
|
+
* @description Whether a message this server fails to accept is re-sent through the provider's shared relay.
|
|
1029
|
+
* @default true
|
|
1030
|
+
*/
|
|
1031
|
+
fallbackToProvider?: boolean;
|
|
1032
|
+
};
|
|
1033
|
+
};
|
|
1034
|
+
};
|
|
1035
|
+
responses: {
|
|
1036
|
+
/** @description The stored SMTP configuration. */
|
|
1037
|
+
200: {
|
|
1038
|
+
headers: {
|
|
1039
|
+
[name: string]: unknown;
|
|
1040
|
+
};
|
|
1041
|
+
content: {
|
|
1042
|
+
"application/json": {
|
|
1043
|
+
/**
|
|
1044
|
+
* Format: uuid
|
|
1045
|
+
* @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
|
|
1046
|
+
*/
|
|
1047
|
+
id: string;
|
|
1048
|
+
/**
|
|
1049
|
+
* Format: uuid
|
|
1050
|
+
* @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
|
|
1051
|
+
*/
|
|
1052
|
+
organizationId: string;
|
|
1053
|
+
/** @description Hostname of the organization's SMTP server. */
|
|
1054
|
+
host: string;
|
|
1055
|
+
/**
|
|
1056
|
+
* @description TCP port the organization's SMTP server listens on. The server additionally restricts this to a submission-port allowlist; a syntactically valid port outside it is refused.
|
|
1057
|
+
* @default 587
|
|
1058
|
+
*/
|
|
1059
|
+
port: number;
|
|
1060
|
+
/**
|
|
1061
|
+
* @description Transport encryption to negotiate. `starttls` upgrades a cleartext connection (typically port 587), `tls` opens an implicit TLS connection (typically port 465), and `none` sends in cleartext and is intended only for an internal relay on a trusted network.
|
|
1062
|
+
* @default starttls
|
|
1063
|
+
* @enum {string}
|
|
1064
|
+
*/
|
|
1065
|
+
encryption: "starttls" | "tls" | "none";
|
|
1066
|
+
/**
|
|
1067
|
+
* @description SMTP authentication mechanism. `none` is permitted only for a relay that authorizes by source address; a configuration using any other mechanism must carry both a username and a password.
|
|
1068
|
+
* @default plain
|
|
1069
|
+
* @enum {string}
|
|
1070
|
+
*/
|
|
1071
|
+
authMechanism: "plain" | "cram-md5" | "none";
|
|
1072
|
+
/** @description Username presented to the organization's SMTP server. Held beside the host rather than with the password because it is an identifier rather than a secret, and the health surface must show it without a decryption round trip. It is usually an email address, so it is returned only on an authorized read. */
|
|
1073
|
+
username?: string;
|
|
1074
|
+
/**
|
|
1075
|
+
* @description Present only when a password is stored, and then always the redaction sentinel `***` - never the stored value, which is encrypted at rest and is never projected into a response. Its presence is therefore the only thing it reports: a configuration whose `authMechanism` is `none` stores no password and omits this property entirely. It is optional rather than required for exactly that reason.
|
|
1076
|
+
* Read-only, and read-only here means read-only: no request body references this schema. The write semantics belong to the payload schemas - `OrganizationSmtpConfigurationPayload` on create and `OrganizationSmtpCredentialPayload` on rotation - and are documented there.
|
|
1077
|
+
*/
|
|
1078
|
+
readonly password?: string;
|
|
1079
|
+
/**
|
|
1080
|
+
* Format: email
|
|
1081
|
+
* @description Address the organization's mail is sent from. Its domain must be verified before mail is routed through this server.
|
|
1082
|
+
*/
|
|
1083
|
+
fromAddress: string;
|
|
1084
|
+
/** @description Display name shown alongside the from address in the message header. */
|
|
1085
|
+
fromDisplayName?: string;
|
|
1086
|
+
/**
|
|
1087
|
+
* Format: email
|
|
1088
|
+
* @description Address replies are directed to. It is also the address carried when a message falls back to the provider relay, which rewrites the from address to the provider's own so the message stays aligned for SPF and DMARC.
|
|
1089
|
+
*/
|
|
1090
|
+
replyToAddress?: string;
|
|
1091
|
+
/**
|
|
1092
|
+
* @description Lifecycle and transport verdict, carrying the connection status vocabulary because the configuration IS a connection. `registered` means configured but never proven - the from domain is unverified, or no message has yet been delivered - and mail takes the provider relay. `connected` means the last delivery attempt succeeded and mail is routed through this server. `disconnected` means consecutive failures opened the circuit, so the server is no longer dialled and the fallback setting decides what happens. `ignored` means an administrator turned it off.
|
|
1093
|
+
*
|
|
1094
|
+
* The writers are disjoint on purpose: only an administrator writes `ignored`, and only the delivery circuit writes `connected` or `disconnected`. That is what keeps a deliberate opt-out distinguishable from a failing relay. It also makes "enabled while the from domain is unverified" unrepresentable rather than merely forbidden, which is why this property replaces the separate `enabled` and `verificationState` pair it supersedes.
|
|
1095
|
+
* @default registered
|
|
1096
|
+
* @enum {string}
|
|
1097
|
+
*/
|
|
1098
|
+
status: "registered" | "connected" | "disconnected" | "ignored";
|
|
1099
|
+
/**
|
|
1100
|
+
* @description Whether a message that this server fails to accept is re-sent through the provider's shared relay. Disabling it means the organization owns delivery entirely and a failure is a dropped message, including account verification and password recovery.
|
|
1101
|
+
* @default true
|
|
1102
|
+
*/
|
|
1103
|
+
fallbackToProvider: boolean;
|
|
1104
|
+
/** @description Registrable domain of the from address, held separately as the unit that ownership is proven for. */
|
|
1105
|
+
fromDomain?: string;
|
|
1106
|
+
/** @description Token the organization publishes in DNS to prove control of the from domain. Not a credential - it authorizes nothing and grants no access. */
|
|
1107
|
+
fromDomainVerificationToken?: string;
|
|
1108
|
+
/**
|
|
1109
|
+
* Format: date-time
|
|
1110
|
+
* @description Timestamp at which control of the from domain was last proven. Null while unproven.
|
|
1111
|
+
*/
|
|
1112
|
+
fromDomainVerifiedAt?: string | null;
|
|
1113
|
+
/**
|
|
1114
|
+
* Format: date-time
|
|
1115
|
+
* @description Timestamp of the last message this server accepted.
|
|
1116
|
+
*/
|
|
1117
|
+
lastSuccessAt?: string | null;
|
|
1118
|
+
/**
|
|
1119
|
+
* Format: date-time
|
|
1120
|
+
* @description Timestamp of the last delivery attempt this server rejected or failed to accept.
|
|
1121
|
+
*/
|
|
1122
|
+
lastFailureAt?: string | null;
|
|
1123
|
+
/**
|
|
1124
|
+
* @description Classification of the last failure. Always a classification, never the remote server's own message: the set is closed on purpose, because reporting a remote server's text back to a caller would turn a refusal into an oracle for what the network can reach.
|
|
1125
|
+
* @enum {string}
|
|
1126
|
+
*/
|
|
1127
|
+
lastFailureReason?: "blocked_target" | "connect_refused" | "connect_timeout" | "tls_failed" | "starttls_unsupported" | "auth_rejected" | "relay_rejected_sender" | "relay_rejected_recipient" | "delivery_failed" | "credential_unreadable";
|
|
1128
|
+
/**
|
|
1129
|
+
* @description Delivery failures since the last success. Drives the circuit that stops dialling a persistently unreachable server.
|
|
1130
|
+
* @default 0
|
|
1131
|
+
*/
|
|
1132
|
+
consecutiveFailures: number;
|
|
1133
|
+
/**
|
|
1134
|
+
* Format: uuid
|
|
1135
|
+
* @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
|
|
1136
|
+
*/
|
|
1137
|
+
createdBy?: string | null;
|
|
1138
|
+
/**
|
|
1139
|
+
* Format: date-time
|
|
1140
|
+
* @description Timestamp when the configuration was created.
|
|
1141
|
+
*/
|
|
1142
|
+
createdAt: string;
|
|
1143
|
+
/**
|
|
1144
|
+
* Format: date-time
|
|
1145
|
+
* @description Timestamp when the configuration was last changed.
|
|
1146
|
+
*/
|
|
1147
|
+
updatedAt: string;
|
|
1148
|
+
/**
|
|
1149
|
+
* Format: date-time
|
|
1150
|
+
* @description Timestamp when the configuration was soft deleted. Null while it remains active.
|
|
1151
|
+
*/
|
|
1152
|
+
deletedAt?: string | null;
|
|
1153
|
+
};
|
|
1154
|
+
};
|
|
1155
|
+
};
|
|
1156
|
+
/** @description Invalid request body or request param */
|
|
1157
|
+
400: {
|
|
1158
|
+
headers: {
|
|
1159
|
+
[name: string]: unknown;
|
|
1160
|
+
};
|
|
1161
|
+
content: {
|
|
1162
|
+
"text/plain": string;
|
|
1163
|
+
};
|
|
1164
|
+
};
|
|
1165
|
+
/** @description Expired JWT token used or insufficient privilege */
|
|
1166
|
+
401: {
|
|
1167
|
+
headers: {
|
|
1168
|
+
[name: string]: unknown;
|
|
1169
|
+
};
|
|
1170
|
+
content: {
|
|
1171
|
+
"text/plain": string;
|
|
1172
|
+
};
|
|
1173
|
+
};
|
|
1174
|
+
/** @description Caller lacks the permission key required for this organization */
|
|
1175
|
+
403: {
|
|
1176
|
+
headers: {
|
|
1177
|
+
[name: string]: unknown;
|
|
1178
|
+
};
|
|
1179
|
+
content: {
|
|
1180
|
+
"text/plain": string;
|
|
1181
|
+
};
|
|
1182
|
+
};
|
|
1183
|
+
/** @description Result not found */
|
|
1184
|
+
404: {
|
|
1185
|
+
headers: {
|
|
1186
|
+
[name: string]: unknown;
|
|
1187
|
+
};
|
|
1188
|
+
content: {
|
|
1189
|
+
"text/plain": string;
|
|
1190
|
+
};
|
|
1191
|
+
};
|
|
1192
|
+
/** @description Internal server error */
|
|
1193
|
+
500: {
|
|
1194
|
+
headers: {
|
|
1195
|
+
[name: string]: unknown;
|
|
1196
|
+
};
|
|
1197
|
+
content: {
|
|
1198
|
+
"text/plain": string;
|
|
1199
|
+
};
|
|
1200
|
+
};
|
|
1201
|
+
};
|
|
1202
|
+
};
|
|
1203
|
+
createOrganizationSmtpConfiguration: {
|
|
1204
|
+
parameters: {
|
|
1205
|
+
query?: never;
|
|
1206
|
+
header?: never;
|
|
1207
|
+
path: {
|
|
1208
|
+
/** @description Organization ID */
|
|
1209
|
+
orgId: string;
|
|
1210
|
+
};
|
|
1211
|
+
cookie?: never;
|
|
1212
|
+
};
|
|
1213
|
+
requestBody: {
|
|
1214
|
+
content: {
|
|
1215
|
+
"application/json": {
|
|
1216
|
+
/** @description Hostname of the organization's SMTP server. */
|
|
1217
|
+
host: string;
|
|
1218
|
+
/**
|
|
1219
|
+
* @description TCP port the organization's SMTP server listens on. Restricted further by a submission-port allowlist.
|
|
1220
|
+
* @default 587
|
|
1221
|
+
*/
|
|
1222
|
+
port: number;
|
|
1223
|
+
/**
|
|
1224
|
+
* @description Transport encryption to negotiate. `starttls` upgrades a cleartext connection (typically port 587), `tls` opens an implicit TLS connection (typically port 465), and `none` sends in cleartext.
|
|
1225
|
+
* @default starttls
|
|
1226
|
+
* @enum {string}
|
|
1227
|
+
*/
|
|
1228
|
+
encryption?: "starttls" | "tls" | "none";
|
|
1229
|
+
/**
|
|
1230
|
+
* @description SMTP authentication mechanism. Any mechanism other than `none` requires both a username and a password.
|
|
1231
|
+
* @default plain
|
|
1232
|
+
* @enum {string}
|
|
1233
|
+
*/
|
|
1234
|
+
authMechanism?: "plain" | "cram-md5" | "none";
|
|
1235
|
+
/** @description Username presented to the organization's SMTP server. Required by the server, together with `password`, for every `authMechanism` other than `none`; see that property for why the pairing is a server-enforced contract rather than a schema constraint. */
|
|
1236
|
+
username?: string;
|
|
1237
|
+
/**
|
|
1238
|
+
* @description Password presented to the organization's SMTP server. The server requires it, together with `username`, for every `authMechanism` other than `none`, and answers 400 when either is missing.
|
|
1239
|
+
* That rule is deliberately NOT encoded in `required` or as a `oneOf`/`if`-`then`. Both encodings were measured against the generator: `if`/`then` collapses this payload to `interface{}`, and `oneOf` injects a `union json.RawMessage` field with a custom marshaller, either of which costs every consumer its generated type or its wire behaviour to express a constraint the server enforces anyway. Treat this property as conditionally required by contract, not by schema.
|
|
1240
|
+
* This is the ONLY operation that accepts the password alongside the settings, so that registering a mail server is one call and no configuration exists in a state where it is expected to send but holds no credential. Afterwards the password is written only by the rotation operation, never by the settings update, whose payload declares no `password` property at all.
|
|
1241
|
+
* The redaction sentinel `***` is refused, and so is the empty string - omit the property instead of sending it empty, which the `minLength` below enforces so this payload and the rotation payload agree.
|
|
1242
|
+
*/
|
|
1243
|
+
password?: string;
|
|
1244
|
+
/**
|
|
1245
|
+
* Format: email
|
|
1246
|
+
* @description Address the organization's mail is sent from.
|
|
1247
|
+
*/
|
|
1248
|
+
fromAddress: string;
|
|
1249
|
+
/** @description Display name shown alongside the from address. */
|
|
1250
|
+
fromDisplayName?: string;
|
|
1251
|
+
/**
|
|
1252
|
+
* Format: email
|
|
1253
|
+
* @description Address replies are directed to.
|
|
1254
|
+
*/
|
|
1255
|
+
replyToAddress?: string;
|
|
1256
|
+
/**
|
|
1257
|
+
* @description Whether a message this server fails to accept is re-sent through the provider's shared relay. Disabling it means a failure is a dropped message, account verification and password recovery included.
|
|
1258
|
+
* @default true
|
|
1259
|
+
*/
|
|
1260
|
+
fallbackToProvider?: boolean;
|
|
1261
|
+
};
|
|
1262
|
+
};
|
|
1263
|
+
};
|
|
1264
|
+
responses: {
|
|
1265
|
+
/** @description The stored SMTP configuration. */
|
|
1266
|
+
201: {
|
|
1267
|
+
headers: {
|
|
1268
|
+
[name: string]: unknown;
|
|
1269
|
+
};
|
|
1270
|
+
content: {
|
|
1271
|
+
"application/json": {
|
|
1272
|
+
/**
|
|
1273
|
+
* Format: uuid
|
|
1274
|
+
* @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
|
|
1275
|
+
*/
|
|
1276
|
+
id: string;
|
|
1277
|
+
/**
|
|
1278
|
+
* Format: uuid
|
|
1279
|
+
* @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
|
|
1280
|
+
*/
|
|
1281
|
+
organizationId: string;
|
|
1282
|
+
/** @description Hostname of the organization's SMTP server. */
|
|
1283
|
+
host: string;
|
|
1284
|
+
/**
|
|
1285
|
+
* @description TCP port the organization's SMTP server listens on. The server additionally restricts this to a submission-port allowlist; a syntactically valid port outside it is refused.
|
|
1286
|
+
* @default 587
|
|
1287
|
+
*/
|
|
1288
|
+
port: number;
|
|
1289
|
+
/**
|
|
1290
|
+
* @description Transport encryption to negotiate. `starttls` upgrades a cleartext connection (typically port 587), `tls` opens an implicit TLS connection (typically port 465), and `none` sends in cleartext and is intended only for an internal relay on a trusted network.
|
|
1291
|
+
* @default starttls
|
|
1292
|
+
* @enum {string}
|
|
1293
|
+
*/
|
|
1294
|
+
encryption: "starttls" | "tls" | "none";
|
|
1295
|
+
/**
|
|
1296
|
+
* @description SMTP authentication mechanism. `none` is permitted only for a relay that authorizes by source address; a configuration using any other mechanism must carry both a username and a password.
|
|
1297
|
+
* @default plain
|
|
1298
|
+
* @enum {string}
|
|
1299
|
+
*/
|
|
1300
|
+
authMechanism: "plain" | "cram-md5" | "none";
|
|
1301
|
+
/** @description Username presented to the organization's SMTP server. Held beside the host rather than with the password because it is an identifier rather than a secret, and the health surface must show it without a decryption round trip. It is usually an email address, so it is returned only on an authorized read. */
|
|
1302
|
+
username?: string;
|
|
1303
|
+
/**
|
|
1304
|
+
* @description Present only when a password is stored, and then always the redaction sentinel `***` - never the stored value, which is encrypted at rest and is never projected into a response. Its presence is therefore the only thing it reports: a configuration whose `authMechanism` is `none` stores no password and omits this property entirely. It is optional rather than required for exactly that reason.
|
|
1305
|
+
* Read-only, and read-only here means read-only: no request body references this schema. The write semantics belong to the payload schemas - `OrganizationSmtpConfigurationPayload` on create and `OrganizationSmtpCredentialPayload` on rotation - and are documented there.
|
|
1306
|
+
*/
|
|
1307
|
+
readonly password?: string;
|
|
1308
|
+
/**
|
|
1309
|
+
* Format: email
|
|
1310
|
+
* @description Address the organization's mail is sent from. Its domain must be verified before mail is routed through this server.
|
|
1311
|
+
*/
|
|
1312
|
+
fromAddress: string;
|
|
1313
|
+
/** @description Display name shown alongside the from address in the message header. */
|
|
1314
|
+
fromDisplayName?: string;
|
|
1315
|
+
/**
|
|
1316
|
+
* Format: email
|
|
1317
|
+
* @description Address replies are directed to. It is also the address carried when a message falls back to the provider relay, which rewrites the from address to the provider's own so the message stays aligned for SPF and DMARC.
|
|
1318
|
+
*/
|
|
1319
|
+
replyToAddress?: string;
|
|
1320
|
+
/**
|
|
1321
|
+
* @description Lifecycle and transport verdict, carrying the connection status vocabulary because the configuration IS a connection. `registered` means configured but never proven - the from domain is unverified, or no message has yet been delivered - and mail takes the provider relay. `connected` means the last delivery attempt succeeded and mail is routed through this server. `disconnected` means consecutive failures opened the circuit, so the server is no longer dialled and the fallback setting decides what happens. `ignored` means an administrator turned it off.
|
|
1322
|
+
*
|
|
1323
|
+
* The writers are disjoint on purpose: only an administrator writes `ignored`, and only the delivery circuit writes `connected` or `disconnected`. That is what keeps a deliberate opt-out distinguishable from a failing relay. It also makes "enabled while the from domain is unverified" unrepresentable rather than merely forbidden, which is why this property replaces the separate `enabled` and `verificationState` pair it supersedes.
|
|
1324
|
+
* @default registered
|
|
1325
|
+
* @enum {string}
|
|
1326
|
+
*/
|
|
1327
|
+
status: "registered" | "connected" | "disconnected" | "ignored";
|
|
1328
|
+
/**
|
|
1329
|
+
* @description Whether a message that this server fails to accept is re-sent through the provider's shared relay. Disabling it means the organization owns delivery entirely and a failure is a dropped message, including account verification and password recovery.
|
|
1330
|
+
* @default true
|
|
1331
|
+
*/
|
|
1332
|
+
fallbackToProvider: boolean;
|
|
1333
|
+
/** @description Registrable domain of the from address, held separately as the unit that ownership is proven for. */
|
|
1334
|
+
fromDomain?: string;
|
|
1335
|
+
/** @description Token the organization publishes in DNS to prove control of the from domain. Not a credential - it authorizes nothing and grants no access. */
|
|
1336
|
+
fromDomainVerificationToken?: string;
|
|
1337
|
+
/**
|
|
1338
|
+
* Format: date-time
|
|
1339
|
+
* @description Timestamp at which control of the from domain was last proven. Null while unproven.
|
|
1340
|
+
*/
|
|
1341
|
+
fromDomainVerifiedAt?: string | null;
|
|
1342
|
+
/**
|
|
1343
|
+
* Format: date-time
|
|
1344
|
+
* @description Timestamp of the last message this server accepted.
|
|
1345
|
+
*/
|
|
1346
|
+
lastSuccessAt?: string | null;
|
|
1347
|
+
/**
|
|
1348
|
+
* Format: date-time
|
|
1349
|
+
* @description Timestamp of the last delivery attempt this server rejected or failed to accept.
|
|
1350
|
+
*/
|
|
1351
|
+
lastFailureAt?: string | null;
|
|
1352
|
+
/**
|
|
1353
|
+
* @description Classification of the last failure. Always a classification, never the remote server's own message: the set is closed on purpose, because reporting a remote server's text back to a caller would turn a refusal into an oracle for what the network can reach.
|
|
1354
|
+
* @enum {string}
|
|
1355
|
+
*/
|
|
1356
|
+
lastFailureReason?: "blocked_target" | "connect_refused" | "connect_timeout" | "tls_failed" | "starttls_unsupported" | "auth_rejected" | "relay_rejected_sender" | "relay_rejected_recipient" | "delivery_failed" | "credential_unreadable";
|
|
1357
|
+
/**
|
|
1358
|
+
* @description Delivery failures since the last success. Drives the circuit that stops dialling a persistently unreachable server.
|
|
1359
|
+
* @default 0
|
|
1360
|
+
*/
|
|
1361
|
+
consecutiveFailures: number;
|
|
1362
|
+
/**
|
|
1363
|
+
* Format: uuid
|
|
1364
|
+
* @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
|
|
1365
|
+
*/
|
|
1366
|
+
createdBy?: string | null;
|
|
1367
|
+
/**
|
|
1368
|
+
* Format: date-time
|
|
1369
|
+
* @description Timestamp when the configuration was created.
|
|
1370
|
+
*/
|
|
1371
|
+
createdAt: string;
|
|
1372
|
+
/**
|
|
1373
|
+
* Format: date-time
|
|
1374
|
+
* @description Timestamp when the configuration was last changed.
|
|
1375
|
+
*/
|
|
1376
|
+
updatedAt: string;
|
|
1377
|
+
/**
|
|
1378
|
+
* Format: date-time
|
|
1379
|
+
* @description Timestamp when the configuration was soft deleted. Null while it remains active.
|
|
1380
|
+
*/
|
|
1381
|
+
deletedAt?: string | null;
|
|
1382
|
+
};
|
|
1383
|
+
};
|
|
1384
|
+
};
|
|
1385
|
+
/** @description Invalid request body or request param */
|
|
1386
|
+
400: {
|
|
1387
|
+
headers: {
|
|
1388
|
+
[name: string]: unknown;
|
|
1389
|
+
};
|
|
1390
|
+
content: {
|
|
1391
|
+
"text/plain": string;
|
|
1392
|
+
};
|
|
1393
|
+
};
|
|
1394
|
+
/** @description Expired JWT token used or insufficient privilege */
|
|
1395
|
+
401: {
|
|
1396
|
+
headers: {
|
|
1397
|
+
[name: string]: unknown;
|
|
1398
|
+
};
|
|
1399
|
+
content: {
|
|
1400
|
+
"text/plain": string;
|
|
1401
|
+
};
|
|
1402
|
+
};
|
|
1403
|
+
/** @description Caller lacks the permission key required for this organization */
|
|
1404
|
+
403: {
|
|
1405
|
+
headers: {
|
|
1406
|
+
[name: string]: unknown;
|
|
1407
|
+
};
|
|
1408
|
+
content: {
|
|
1409
|
+
"text/plain": string;
|
|
1410
|
+
};
|
|
1411
|
+
};
|
|
1412
|
+
/** @description The configuration already exists, or the requested state transition is refused in the configuration's current state */
|
|
1413
|
+
409: {
|
|
1414
|
+
headers: {
|
|
1415
|
+
[name: string]: unknown;
|
|
1416
|
+
};
|
|
1417
|
+
content: {
|
|
1418
|
+
"text/plain": string;
|
|
1419
|
+
};
|
|
1420
|
+
};
|
|
1421
|
+
/** @description Internal server error */
|
|
1422
|
+
500: {
|
|
1423
|
+
headers: {
|
|
1424
|
+
[name: string]: unknown;
|
|
1425
|
+
};
|
|
1426
|
+
content: {
|
|
1427
|
+
"text/plain": string;
|
|
1428
|
+
};
|
|
1429
|
+
};
|
|
1430
|
+
};
|
|
1431
|
+
};
|
|
1432
|
+
rotateOrganizationSmtpCredential: {
|
|
1433
|
+
parameters: {
|
|
1434
|
+
query?: never;
|
|
1435
|
+
header?: never;
|
|
1436
|
+
path: {
|
|
1437
|
+
/** @description Organization ID */
|
|
1438
|
+
orgId: string;
|
|
1439
|
+
};
|
|
1440
|
+
cookie?: never;
|
|
1441
|
+
};
|
|
1442
|
+
requestBody: {
|
|
1443
|
+
content: {
|
|
1444
|
+
"application/json": {
|
|
1445
|
+
/** @description New password. The redaction sentinel `***` and the empty string are refused with a 400 rather than treated as "leave the stored value alone", so echoing a read back cannot erase the credential. */
|
|
1446
|
+
password: string;
|
|
1447
|
+
};
|
|
1448
|
+
};
|
|
1449
|
+
};
|
|
1450
|
+
responses: {
|
|
1451
|
+
/** @description The stored SMTP configuration, with the password redacted. */
|
|
1452
|
+
200: {
|
|
1453
|
+
headers: {
|
|
1454
|
+
[name: string]: unknown;
|
|
1455
|
+
};
|
|
1456
|
+
content: {
|
|
1457
|
+
"application/json": {
|
|
1458
|
+
/**
|
|
1459
|
+
* Format: uuid
|
|
1460
|
+
* @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
|
|
1461
|
+
*/
|
|
1462
|
+
id: string;
|
|
1463
|
+
/**
|
|
1464
|
+
* Format: uuid
|
|
1465
|
+
* @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
|
|
1466
|
+
*/
|
|
1467
|
+
organizationId: string;
|
|
1468
|
+
/** @description Hostname of the organization's SMTP server. */
|
|
1469
|
+
host: string;
|
|
1470
|
+
/**
|
|
1471
|
+
* @description TCP port the organization's SMTP server listens on. The server additionally restricts this to a submission-port allowlist; a syntactically valid port outside it is refused.
|
|
1472
|
+
* @default 587
|
|
1473
|
+
*/
|
|
1474
|
+
port: number;
|
|
1475
|
+
/**
|
|
1476
|
+
* @description Transport encryption to negotiate. `starttls` upgrades a cleartext connection (typically port 587), `tls` opens an implicit TLS connection (typically port 465), and `none` sends in cleartext and is intended only for an internal relay on a trusted network.
|
|
1477
|
+
* @default starttls
|
|
1478
|
+
* @enum {string}
|
|
1479
|
+
*/
|
|
1480
|
+
encryption: "starttls" | "tls" | "none";
|
|
1481
|
+
/**
|
|
1482
|
+
* @description SMTP authentication mechanism. `none` is permitted only for a relay that authorizes by source address; a configuration using any other mechanism must carry both a username and a password.
|
|
1483
|
+
* @default plain
|
|
1484
|
+
* @enum {string}
|
|
1485
|
+
*/
|
|
1486
|
+
authMechanism: "plain" | "cram-md5" | "none";
|
|
1487
|
+
/** @description Username presented to the organization's SMTP server. Held beside the host rather than with the password because it is an identifier rather than a secret, and the health surface must show it without a decryption round trip. It is usually an email address, so it is returned only on an authorized read. */
|
|
1488
|
+
username?: string;
|
|
1489
|
+
/**
|
|
1490
|
+
* @description Present only when a password is stored, and then always the redaction sentinel `***` - never the stored value, which is encrypted at rest and is never projected into a response. Its presence is therefore the only thing it reports: a configuration whose `authMechanism` is `none` stores no password and omits this property entirely. It is optional rather than required for exactly that reason.
|
|
1491
|
+
* Read-only, and read-only here means read-only: no request body references this schema. The write semantics belong to the payload schemas - `OrganizationSmtpConfigurationPayload` on create and `OrganizationSmtpCredentialPayload` on rotation - and are documented there.
|
|
1492
|
+
*/
|
|
1493
|
+
readonly password?: string;
|
|
1494
|
+
/**
|
|
1495
|
+
* Format: email
|
|
1496
|
+
* @description Address the organization's mail is sent from. Its domain must be verified before mail is routed through this server.
|
|
1497
|
+
*/
|
|
1498
|
+
fromAddress: string;
|
|
1499
|
+
/** @description Display name shown alongside the from address in the message header. */
|
|
1500
|
+
fromDisplayName?: string;
|
|
1501
|
+
/**
|
|
1502
|
+
* Format: email
|
|
1503
|
+
* @description Address replies are directed to. It is also the address carried when a message falls back to the provider relay, which rewrites the from address to the provider's own so the message stays aligned for SPF and DMARC.
|
|
1504
|
+
*/
|
|
1505
|
+
replyToAddress?: string;
|
|
1506
|
+
/**
|
|
1507
|
+
* @description Lifecycle and transport verdict, carrying the connection status vocabulary because the configuration IS a connection. `registered` means configured but never proven - the from domain is unverified, or no message has yet been delivered - and mail takes the provider relay. `connected` means the last delivery attempt succeeded and mail is routed through this server. `disconnected` means consecutive failures opened the circuit, so the server is no longer dialled and the fallback setting decides what happens. `ignored` means an administrator turned it off.
|
|
1508
|
+
*
|
|
1509
|
+
* The writers are disjoint on purpose: only an administrator writes `ignored`, and only the delivery circuit writes `connected` or `disconnected`. That is what keeps a deliberate opt-out distinguishable from a failing relay. It also makes "enabled while the from domain is unverified" unrepresentable rather than merely forbidden, which is why this property replaces the separate `enabled` and `verificationState` pair it supersedes.
|
|
1510
|
+
* @default registered
|
|
1511
|
+
* @enum {string}
|
|
1512
|
+
*/
|
|
1513
|
+
status: "registered" | "connected" | "disconnected" | "ignored";
|
|
1514
|
+
/**
|
|
1515
|
+
* @description Whether a message that this server fails to accept is re-sent through the provider's shared relay. Disabling it means the organization owns delivery entirely and a failure is a dropped message, including account verification and password recovery.
|
|
1516
|
+
* @default true
|
|
1517
|
+
*/
|
|
1518
|
+
fallbackToProvider: boolean;
|
|
1519
|
+
/** @description Registrable domain of the from address, held separately as the unit that ownership is proven for. */
|
|
1520
|
+
fromDomain?: string;
|
|
1521
|
+
/** @description Token the organization publishes in DNS to prove control of the from domain. Not a credential - it authorizes nothing and grants no access. */
|
|
1522
|
+
fromDomainVerificationToken?: string;
|
|
1523
|
+
/**
|
|
1524
|
+
* Format: date-time
|
|
1525
|
+
* @description Timestamp at which control of the from domain was last proven. Null while unproven.
|
|
1526
|
+
*/
|
|
1527
|
+
fromDomainVerifiedAt?: string | null;
|
|
1528
|
+
/**
|
|
1529
|
+
* Format: date-time
|
|
1530
|
+
* @description Timestamp of the last message this server accepted.
|
|
1531
|
+
*/
|
|
1532
|
+
lastSuccessAt?: string | null;
|
|
1533
|
+
/**
|
|
1534
|
+
* Format: date-time
|
|
1535
|
+
* @description Timestamp of the last delivery attempt this server rejected or failed to accept.
|
|
1536
|
+
*/
|
|
1537
|
+
lastFailureAt?: string | null;
|
|
1538
|
+
/**
|
|
1539
|
+
* @description Classification of the last failure. Always a classification, never the remote server's own message: the set is closed on purpose, because reporting a remote server's text back to a caller would turn a refusal into an oracle for what the network can reach.
|
|
1540
|
+
* @enum {string}
|
|
1541
|
+
*/
|
|
1542
|
+
lastFailureReason?: "blocked_target" | "connect_refused" | "connect_timeout" | "tls_failed" | "starttls_unsupported" | "auth_rejected" | "relay_rejected_sender" | "relay_rejected_recipient" | "delivery_failed" | "credential_unreadable";
|
|
1543
|
+
/**
|
|
1544
|
+
* @description Delivery failures since the last success. Drives the circuit that stops dialling a persistently unreachable server.
|
|
1545
|
+
* @default 0
|
|
1546
|
+
*/
|
|
1547
|
+
consecutiveFailures: number;
|
|
1548
|
+
/**
|
|
1549
|
+
* Format: uuid
|
|
1550
|
+
* @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
|
|
1551
|
+
*/
|
|
1552
|
+
createdBy?: string | null;
|
|
1553
|
+
/**
|
|
1554
|
+
* Format: date-time
|
|
1555
|
+
* @description Timestamp when the configuration was created.
|
|
1556
|
+
*/
|
|
1557
|
+
createdAt: string;
|
|
1558
|
+
/**
|
|
1559
|
+
* Format: date-time
|
|
1560
|
+
* @description Timestamp when the configuration was last changed.
|
|
1561
|
+
*/
|
|
1562
|
+
updatedAt: string;
|
|
1563
|
+
/**
|
|
1564
|
+
* Format: date-time
|
|
1565
|
+
* @description Timestamp when the configuration was soft deleted. Null while it remains active.
|
|
1566
|
+
*/
|
|
1567
|
+
deletedAt?: string | null;
|
|
1568
|
+
};
|
|
1569
|
+
};
|
|
1570
|
+
};
|
|
1571
|
+
/** @description Invalid request body or request param */
|
|
1572
|
+
400: {
|
|
1573
|
+
headers: {
|
|
1574
|
+
[name: string]: unknown;
|
|
1575
|
+
};
|
|
1576
|
+
content: {
|
|
1577
|
+
"text/plain": string;
|
|
1578
|
+
};
|
|
1579
|
+
};
|
|
1580
|
+
/** @description Expired JWT token used or insufficient privilege */
|
|
1581
|
+
401: {
|
|
1582
|
+
headers: {
|
|
1583
|
+
[name: string]: unknown;
|
|
1584
|
+
};
|
|
1585
|
+
content: {
|
|
1586
|
+
"text/plain": string;
|
|
1587
|
+
};
|
|
1588
|
+
};
|
|
1589
|
+
/** @description Caller lacks the permission key required for this organization */
|
|
1590
|
+
403: {
|
|
1591
|
+
headers: {
|
|
1592
|
+
[name: string]: unknown;
|
|
1593
|
+
};
|
|
1594
|
+
content: {
|
|
1595
|
+
"text/plain": string;
|
|
1596
|
+
};
|
|
1597
|
+
};
|
|
1598
|
+
/** @description Result not found */
|
|
1599
|
+
404: {
|
|
1600
|
+
headers: {
|
|
1601
|
+
[name: string]: unknown;
|
|
1602
|
+
};
|
|
1603
|
+
content: {
|
|
1604
|
+
"text/plain": string;
|
|
1605
|
+
};
|
|
1606
|
+
};
|
|
1607
|
+
/** @description Internal server error */
|
|
1608
|
+
500: {
|
|
1609
|
+
headers: {
|
|
1610
|
+
[name: string]: unknown;
|
|
1611
|
+
};
|
|
1612
|
+
content: {
|
|
1613
|
+
"text/plain": string;
|
|
1614
|
+
};
|
|
1615
|
+
};
|
|
1616
|
+
};
|
|
1617
|
+
};
|
|
1618
|
+
setOrganizationSmtpEnablement: {
|
|
1619
|
+
parameters: {
|
|
1620
|
+
query?: never;
|
|
1621
|
+
header?: never;
|
|
1622
|
+
path: {
|
|
1623
|
+
/** @description Organization ID */
|
|
1624
|
+
orgId: string;
|
|
1625
|
+
};
|
|
1626
|
+
cookie?: never;
|
|
1627
|
+
};
|
|
1628
|
+
requestBody: {
|
|
1629
|
+
content: {
|
|
1630
|
+
"application/json": {
|
|
1631
|
+
/** @description True returns the configuration to `registered` so it may prove itself and carry mail; false moves it to `ignored`. Turning it on is refused while the from domain is unverified. */
|
|
1632
|
+
enabled: boolean;
|
|
1633
|
+
};
|
|
1634
|
+
};
|
|
1635
|
+
};
|
|
1636
|
+
responses: {
|
|
1637
|
+
/** @description The stored SMTP configuration. */
|
|
1638
|
+
200: {
|
|
1639
|
+
headers: {
|
|
1640
|
+
[name: string]: unknown;
|
|
1641
|
+
};
|
|
1642
|
+
content: {
|
|
1643
|
+
"application/json": {
|
|
1644
|
+
/**
|
|
1645
|
+
* Format: uuid
|
|
1646
|
+
* @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
|
|
1647
|
+
*/
|
|
1648
|
+
id: string;
|
|
1649
|
+
/**
|
|
1650
|
+
* Format: uuid
|
|
1651
|
+
* @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
|
|
1652
|
+
*/
|
|
1653
|
+
organizationId: string;
|
|
1654
|
+
/** @description Hostname of the organization's SMTP server. */
|
|
1655
|
+
host: string;
|
|
1656
|
+
/**
|
|
1657
|
+
* @description TCP port the organization's SMTP server listens on. The server additionally restricts this to a submission-port allowlist; a syntactically valid port outside it is refused.
|
|
1658
|
+
* @default 587
|
|
1659
|
+
*/
|
|
1660
|
+
port: number;
|
|
1661
|
+
/**
|
|
1662
|
+
* @description Transport encryption to negotiate. `starttls` upgrades a cleartext connection (typically port 587), `tls` opens an implicit TLS connection (typically port 465), and `none` sends in cleartext and is intended only for an internal relay on a trusted network.
|
|
1663
|
+
* @default starttls
|
|
1664
|
+
* @enum {string}
|
|
1665
|
+
*/
|
|
1666
|
+
encryption: "starttls" | "tls" | "none";
|
|
1667
|
+
/**
|
|
1668
|
+
* @description SMTP authentication mechanism. `none` is permitted only for a relay that authorizes by source address; a configuration using any other mechanism must carry both a username and a password.
|
|
1669
|
+
* @default plain
|
|
1670
|
+
* @enum {string}
|
|
1671
|
+
*/
|
|
1672
|
+
authMechanism: "plain" | "cram-md5" | "none";
|
|
1673
|
+
/** @description Username presented to the organization's SMTP server. Held beside the host rather than with the password because it is an identifier rather than a secret, and the health surface must show it without a decryption round trip. It is usually an email address, so it is returned only on an authorized read. */
|
|
1674
|
+
username?: string;
|
|
1675
|
+
/**
|
|
1676
|
+
* @description Present only when a password is stored, and then always the redaction sentinel `***` - never the stored value, which is encrypted at rest and is never projected into a response. Its presence is therefore the only thing it reports: a configuration whose `authMechanism` is `none` stores no password and omits this property entirely. It is optional rather than required for exactly that reason.
|
|
1677
|
+
* Read-only, and read-only here means read-only: no request body references this schema. The write semantics belong to the payload schemas - `OrganizationSmtpConfigurationPayload` on create and `OrganizationSmtpCredentialPayload` on rotation - and are documented there.
|
|
1678
|
+
*/
|
|
1679
|
+
readonly password?: string;
|
|
1680
|
+
/**
|
|
1681
|
+
* Format: email
|
|
1682
|
+
* @description Address the organization's mail is sent from. Its domain must be verified before mail is routed through this server.
|
|
1683
|
+
*/
|
|
1684
|
+
fromAddress: string;
|
|
1685
|
+
/** @description Display name shown alongside the from address in the message header. */
|
|
1686
|
+
fromDisplayName?: string;
|
|
1687
|
+
/**
|
|
1688
|
+
* Format: email
|
|
1689
|
+
* @description Address replies are directed to. It is also the address carried when a message falls back to the provider relay, which rewrites the from address to the provider's own so the message stays aligned for SPF and DMARC.
|
|
1690
|
+
*/
|
|
1691
|
+
replyToAddress?: string;
|
|
1692
|
+
/**
|
|
1693
|
+
* @description Lifecycle and transport verdict, carrying the connection status vocabulary because the configuration IS a connection. `registered` means configured but never proven - the from domain is unverified, or no message has yet been delivered - and mail takes the provider relay. `connected` means the last delivery attempt succeeded and mail is routed through this server. `disconnected` means consecutive failures opened the circuit, so the server is no longer dialled and the fallback setting decides what happens. `ignored` means an administrator turned it off.
|
|
1694
|
+
*
|
|
1695
|
+
* The writers are disjoint on purpose: only an administrator writes `ignored`, and only the delivery circuit writes `connected` or `disconnected`. That is what keeps a deliberate opt-out distinguishable from a failing relay. It also makes "enabled while the from domain is unverified" unrepresentable rather than merely forbidden, which is why this property replaces the separate `enabled` and `verificationState` pair it supersedes.
|
|
1696
|
+
* @default registered
|
|
1697
|
+
* @enum {string}
|
|
1698
|
+
*/
|
|
1699
|
+
status: "registered" | "connected" | "disconnected" | "ignored";
|
|
1700
|
+
/**
|
|
1701
|
+
* @description Whether a message that this server fails to accept is re-sent through the provider's shared relay. Disabling it means the organization owns delivery entirely and a failure is a dropped message, including account verification and password recovery.
|
|
1702
|
+
* @default true
|
|
1703
|
+
*/
|
|
1704
|
+
fallbackToProvider: boolean;
|
|
1705
|
+
/** @description Registrable domain of the from address, held separately as the unit that ownership is proven for. */
|
|
1706
|
+
fromDomain?: string;
|
|
1707
|
+
/** @description Token the organization publishes in DNS to prove control of the from domain. Not a credential - it authorizes nothing and grants no access. */
|
|
1708
|
+
fromDomainVerificationToken?: string;
|
|
1709
|
+
/**
|
|
1710
|
+
* Format: date-time
|
|
1711
|
+
* @description Timestamp at which control of the from domain was last proven. Null while unproven.
|
|
1712
|
+
*/
|
|
1713
|
+
fromDomainVerifiedAt?: string | null;
|
|
1714
|
+
/**
|
|
1715
|
+
* Format: date-time
|
|
1716
|
+
* @description Timestamp of the last message this server accepted.
|
|
1717
|
+
*/
|
|
1718
|
+
lastSuccessAt?: string | null;
|
|
1719
|
+
/**
|
|
1720
|
+
* Format: date-time
|
|
1721
|
+
* @description Timestamp of the last delivery attempt this server rejected or failed to accept.
|
|
1722
|
+
*/
|
|
1723
|
+
lastFailureAt?: string | null;
|
|
1724
|
+
/**
|
|
1725
|
+
* @description Classification of the last failure. Always a classification, never the remote server's own message: the set is closed on purpose, because reporting a remote server's text back to a caller would turn a refusal into an oracle for what the network can reach.
|
|
1726
|
+
* @enum {string}
|
|
1727
|
+
*/
|
|
1728
|
+
lastFailureReason?: "blocked_target" | "connect_refused" | "connect_timeout" | "tls_failed" | "starttls_unsupported" | "auth_rejected" | "relay_rejected_sender" | "relay_rejected_recipient" | "delivery_failed" | "credential_unreadable";
|
|
1729
|
+
/**
|
|
1730
|
+
* @description Delivery failures since the last success. Drives the circuit that stops dialling a persistently unreachable server.
|
|
1731
|
+
* @default 0
|
|
1732
|
+
*/
|
|
1733
|
+
consecutiveFailures: number;
|
|
1734
|
+
/**
|
|
1735
|
+
* Format: uuid
|
|
1736
|
+
* @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
|
|
1737
|
+
*/
|
|
1738
|
+
createdBy?: string | null;
|
|
1739
|
+
/**
|
|
1740
|
+
* Format: date-time
|
|
1741
|
+
* @description Timestamp when the configuration was created.
|
|
1742
|
+
*/
|
|
1743
|
+
createdAt: string;
|
|
1744
|
+
/**
|
|
1745
|
+
* Format: date-time
|
|
1746
|
+
* @description Timestamp when the configuration was last changed.
|
|
1747
|
+
*/
|
|
1748
|
+
updatedAt: string;
|
|
1749
|
+
/**
|
|
1750
|
+
* Format: date-time
|
|
1751
|
+
* @description Timestamp when the configuration was soft deleted. Null while it remains active.
|
|
1752
|
+
*/
|
|
1753
|
+
deletedAt?: string | null;
|
|
1754
|
+
};
|
|
1755
|
+
};
|
|
1756
|
+
};
|
|
1757
|
+
/** @description Invalid request body or request param */
|
|
1758
|
+
400: {
|
|
1759
|
+
headers: {
|
|
1760
|
+
[name: string]: unknown;
|
|
1761
|
+
};
|
|
1762
|
+
content: {
|
|
1763
|
+
"text/plain": string;
|
|
1764
|
+
};
|
|
1765
|
+
};
|
|
1766
|
+
/** @description Expired JWT token used or insufficient privilege */
|
|
1767
|
+
401: {
|
|
1768
|
+
headers: {
|
|
1769
|
+
[name: string]: unknown;
|
|
1770
|
+
};
|
|
1771
|
+
content: {
|
|
1772
|
+
"text/plain": string;
|
|
1773
|
+
};
|
|
1774
|
+
};
|
|
1775
|
+
/** @description Caller lacks the permission key required for this organization */
|
|
1776
|
+
403: {
|
|
1777
|
+
headers: {
|
|
1778
|
+
[name: string]: unknown;
|
|
1779
|
+
};
|
|
1780
|
+
content: {
|
|
1781
|
+
"text/plain": string;
|
|
1782
|
+
};
|
|
1783
|
+
};
|
|
1784
|
+
/** @description Result not found */
|
|
1785
|
+
404: {
|
|
1786
|
+
headers: {
|
|
1787
|
+
[name: string]: unknown;
|
|
1788
|
+
};
|
|
1789
|
+
content: {
|
|
1790
|
+
"text/plain": string;
|
|
1791
|
+
};
|
|
1792
|
+
};
|
|
1793
|
+
/** @description The configuration already exists, or the requested state transition is refused in the configuration's current state */
|
|
1794
|
+
409: {
|
|
1795
|
+
headers: {
|
|
1796
|
+
[name: string]: unknown;
|
|
1797
|
+
};
|
|
1798
|
+
content: {
|
|
1799
|
+
"text/plain": string;
|
|
1800
|
+
};
|
|
1801
|
+
};
|
|
1802
|
+
/** @description Internal server error */
|
|
1803
|
+
500: {
|
|
1804
|
+
headers: {
|
|
1805
|
+
[name: string]: unknown;
|
|
1806
|
+
};
|
|
1807
|
+
content: {
|
|
1808
|
+
"text/plain": string;
|
|
1809
|
+
};
|
|
1810
|
+
};
|
|
1811
|
+
};
|
|
1812
|
+
};
|
|
1813
|
+
testOrganizationSmtpConfiguration: {
|
|
1814
|
+
parameters: {
|
|
1815
|
+
query?: never;
|
|
1816
|
+
header?: never;
|
|
1817
|
+
path: {
|
|
1818
|
+
/** @description Organization ID */
|
|
1819
|
+
orgId: string;
|
|
1820
|
+
};
|
|
1821
|
+
cookie?: never;
|
|
1822
|
+
};
|
|
1823
|
+
requestBody?: {
|
|
1824
|
+
content: {
|
|
1825
|
+
"application/json": {
|
|
1826
|
+
/**
|
|
1827
|
+
* Format: email
|
|
1828
|
+
* @description Recipient of the test message. Defaults to the calling administrator's own address.
|
|
1829
|
+
*/
|
|
1830
|
+
to?: string;
|
|
1831
|
+
};
|
|
1832
|
+
};
|
|
1833
|
+
};
|
|
1834
|
+
responses: {
|
|
1835
|
+
/** @description The classified outcome of the delivery attempt. */
|
|
1836
|
+
200: {
|
|
1837
|
+
headers: {
|
|
1838
|
+
[name: string]: unknown;
|
|
1839
|
+
};
|
|
1840
|
+
content: {
|
|
1841
|
+
"application/json": {
|
|
1842
|
+
/**
|
|
1843
|
+
* @description What happened. `delivered` means the server accepted the message; every other value names the stage that refused it.
|
|
1844
|
+
* @enum {string}
|
|
1845
|
+
*/
|
|
1846
|
+
outcome: "delivered" | "blocked_target" | "connect_refused" | "connect_timeout" | "tls_failed" | "starttls_unsupported" | "auth_rejected" | "relay_rejected_sender" | "relay_rejected_recipient" | "delivery_failed" | "credential_unreadable";
|
|
1847
|
+
/** @description Human-readable summary of the outcome, drawn from a fixed set of phrasings. */
|
|
1848
|
+
message?: string;
|
|
1849
|
+
/**
|
|
1850
|
+
* Format: email
|
|
1851
|
+
* @description Address the test message was addressed to.
|
|
1852
|
+
*/
|
|
1853
|
+
sentTo?: string;
|
|
1854
|
+
/**
|
|
1855
|
+
* Format: date-time
|
|
1856
|
+
* @description When the delivery was attempted.
|
|
1857
|
+
*/
|
|
1858
|
+
testedAt: string;
|
|
1859
|
+
};
|
|
1860
|
+
};
|
|
1861
|
+
};
|
|
1862
|
+
/** @description Invalid request body or request param */
|
|
1863
|
+
400: {
|
|
1864
|
+
headers: {
|
|
1865
|
+
[name: string]: unknown;
|
|
1866
|
+
};
|
|
1867
|
+
content: {
|
|
1868
|
+
"text/plain": string;
|
|
1869
|
+
};
|
|
1870
|
+
};
|
|
1871
|
+
/** @description Expired JWT token used or insufficient privilege */
|
|
1872
|
+
401: {
|
|
1873
|
+
headers: {
|
|
1874
|
+
[name: string]: unknown;
|
|
1875
|
+
};
|
|
1876
|
+
content: {
|
|
1877
|
+
"text/plain": string;
|
|
1878
|
+
};
|
|
1879
|
+
};
|
|
1880
|
+
/** @description Caller lacks the permission key required for this organization */
|
|
1881
|
+
403: {
|
|
1882
|
+
headers: {
|
|
1883
|
+
[name: string]: unknown;
|
|
1884
|
+
};
|
|
1885
|
+
content: {
|
|
1886
|
+
"text/plain": string;
|
|
1887
|
+
};
|
|
1888
|
+
};
|
|
1889
|
+
/** @description Result not found */
|
|
1890
|
+
404: {
|
|
1891
|
+
headers: {
|
|
1892
|
+
[name: string]: unknown;
|
|
1893
|
+
};
|
|
1894
|
+
content: {
|
|
1895
|
+
"text/plain": string;
|
|
1896
|
+
};
|
|
1897
|
+
};
|
|
1898
|
+
/** @description Too many attempts for this organization */
|
|
1899
|
+
429: {
|
|
1900
|
+
headers: {
|
|
1901
|
+
[name: string]: unknown;
|
|
1902
|
+
};
|
|
1903
|
+
content: {
|
|
1904
|
+
"text/plain": string;
|
|
1905
|
+
};
|
|
1906
|
+
};
|
|
1907
|
+
/** @description Internal server error */
|
|
1908
|
+
500: {
|
|
1909
|
+
headers: {
|
|
1910
|
+
[name: string]: unknown;
|
|
1911
|
+
};
|
|
1912
|
+
content: {
|
|
1913
|
+
"text/plain": string;
|
|
1914
|
+
};
|
|
1915
|
+
};
|
|
1916
|
+
};
|
|
1917
|
+
};
|
|
1918
|
+
getOrganizationSmtpDomainVerification: {
|
|
1919
|
+
parameters: {
|
|
1920
|
+
query?: never;
|
|
1921
|
+
header?: never;
|
|
1922
|
+
path: {
|
|
1923
|
+
/** @description Organization ID */
|
|
1924
|
+
orgId: string;
|
|
1925
|
+
};
|
|
1926
|
+
cookie?: never;
|
|
1927
|
+
};
|
|
1928
|
+
requestBody?: never;
|
|
1929
|
+
responses: {
|
|
1930
|
+
/** @description The verification challenge and its current state. */
|
|
1931
|
+
200: {
|
|
1932
|
+
headers: {
|
|
1933
|
+
[name: string]: unknown;
|
|
1934
|
+
};
|
|
1935
|
+
content: {
|
|
1936
|
+
"application/json": {
|
|
1937
|
+
/** @description Registrable domain the proof applies to. */
|
|
1938
|
+
domain: string;
|
|
1939
|
+
/**
|
|
1940
|
+
* @description How the domain is proven. `custom-domain` means it matches the organization's own registered custom domain and needs no record; `dns-txt` means the record below must be published.
|
|
1941
|
+
* @enum {string}
|
|
1942
|
+
*/
|
|
1943
|
+
method: "custom-domain" | "dns-txt";
|
|
1944
|
+
/** @description Fully qualified name of the TXT record to publish. */
|
|
1945
|
+
recordName?: string;
|
|
1946
|
+
/** @description Value the TXT record must carry. */
|
|
1947
|
+
recordValue?: string;
|
|
1948
|
+
/** @description Whether control of the domain is currently proven. */
|
|
1949
|
+
verified: boolean;
|
|
1950
|
+
/**
|
|
1951
|
+
* Format: date-time
|
|
1952
|
+
* @description When control was last proven. Null while unproven.
|
|
1953
|
+
*/
|
|
1954
|
+
verifiedAt?: string | null;
|
|
1955
|
+
/**
|
|
1956
|
+
* @description Why the last check did not prove control.
|
|
1957
|
+
* @enum {string}
|
|
1958
|
+
*/
|
|
1959
|
+
failureReason?: "record_not_found" | "record_mismatch" | "lookup_failed" | "domain_reserved";
|
|
1960
|
+
};
|
|
1961
|
+
};
|
|
1962
|
+
};
|
|
1963
|
+
/** @description Expired JWT token used or insufficient privilege */
|
|
1964
|
+
401: {
|
|
1965
|
+
headers: {
|
|
1966
|
+
[name: string]: unknown;
|
|
1967
|
+
};
|
|
1968
|
+
content: {
|
|
1969
|
+
"text/plain": string;
|
|
1970
|
+
};
|
|
1971
|
+
};
|
|
1972
|
+
/** @description Caller lacks the permission key required for this organization */
|
|
1973
|
+
403: {
|
|
1974
|
+
headers: {
|
|
1975
|
+
[name: string]: unknown;
|
|
1976
|
+
};
|
|
1977
|
+
content: {
|
|
1978
|
+
"text/plain": string;
|
|
1979
|
+
};
|
|
1980
|
+
};
|
|
1981
|
+
/** @description Result not found */
|
|
1982
|
+
404: {
|
|
1983
|
+
headers: {
|
|
1984
|
+
[name: string]: unknown;
|
|
1985
|
+
};
|
|
1986
|
+
content: {
|
|
1987
|
+
"text/plain": string;
|
|
1988
|
+
};
|
|
1989
|
+
};
|
|
1990
|
+
/** @description Internal server error */
|
|
1991
|
+
500: {
|
|
1992
|
+
headers: {
|
|
1993
|
+
[name: string]: unknown;
|
|
1994
|
+
};
|
|
1995
|
+
content: {
|
|
1996
|
+
"text/plain": string;
|
|
1997
|
+
};
|
|
1998
|
+
};
|
|
1999
|
+
};
|
|
2000
|
+
};
|
|
2001
|
+
verifyOrganizationSmtpDomain: {
|
|
2002
|
+
parameters: {
|
|
2003
|
+
query?: never;
|
|
2004
|
+
header?: never;
|
|
2005
|
+
path: {
|
|
2006
|
+
/** @description Organization ID */
|
|
2007
|
+
orgId: string;
|
|
2008
|
+
};
|
|
2009
|
+
cookie?: never;
|
|
2010
|
+
};
|
|
2011
|
+
requestBody?: never;
|
|
2012
|
+
responses: {
|
|
2013
|
+
/** @description The outcome of the verification check. */
|
|
2014
|
+
200: {
|
|
2015
|
+
headers: {
|
|
2016
|
+
[name: string]: unknown;
|
|
2017
|
+
};
|
|
2018
|
+
content: {
|
|
2019
|
+
"application/json": {
|
|
2020
|
+
/** @description Registrable domain the proof applies to. */
|
|
2021
|
+
domain: string;
|
|
2022
|
+
/**
|
|
2023
|
+
* @description How the domain is proven. `custom-domain` means it matches the organization's own registered custom domain and needs no record; `dns-txt` means the record below must be published.
|
|
2024
|
+
* @enum {string}
|
|
2025
|
+
*/
|
|
2026
|
+
method: "custom-domain" | "dns-txt";
|
|
2027
|
+
/** @description Fully qualified name of the TXT record to publish. */
|
|
2028
|
+
recordName?: string;
|
|
2029
|
+
/** @description Value the TXT record must carry. */
|
|
2030
|
+
recordValue?: string;
|
|
2031
|
+
/** @description Whether control of the domain is currently proven. */
|
|
2032
|
+
verified: boolean;
|
|
2033
|
+
/**
|
|
2034
|
+
* Format: date-time
|
|
2035
|
+
* @description When control was last proven. Null while unproven.
|
|
2036
|
+
*/
|
|
2037
|
+
verifiedAt?: string | null;
|
|
2038
|
+
/**
|
|
2039
|
+
* @description Why the last check did not prove control.
|
|
2040
|
+
* @enum {string}
|
|
2041
|
+
*/
|
|
2042
|
+
failureReason?: "record_not_found" | "record_mismatch" | "lookup_failed" | "domain_reserved";
|
|
2043
|
+
};
|
|
2044
|
+
};
|
|
2045
|
+
};
|
|
2046
|
+
/** @description Invalid request body or request param */
|
|
2047
|
+
400: {
|
|
2048
|
+
headers: {
|
|
2049
|
+
[name: string]: unknown;
|
|
2050
|
+
};
|
|
2051
|
+
content: {
|
|
2052
|
+
"text/plain": string;
|
|
2053
|
+
};
|
|
2054
|
+
};
|
|
2055
|
+
/** @description Expired JWT token used or insufficient privilege */
|
|
2056
|
+
401: {
|
|
2057
|
+
headers: {
|
|
2058
|
+
[name: string]: unknown;
|
|
2059
|
+
};
|
|
2060
|
+
content: {
|
|
2061
|
+
"text/plain": string;
|
|
2062
|
+
};
|
|
2063
|
+
};
|
|
2064
|
+
/** @description Caller lacks the permission key required for this organization */
|
|
2065
|
+
403: {
|
|
2066
|
+
headers: {
|
|
2067
|
+
[name: string]: unknown;
|
|
2068
|
+
};
|
|
2069
|
+
content: {
|
|
2070
|
+
"text/plain": string;
|
|
2071
|
+
};
|
|
2072
|
+
};
|
|
2073
|
+
/** @description Result not found */
|
|
2074
|
+
404: {
|
|
2075
|
+
headers: {
|
|
2076
|
+
[name: string]: unknown;
|
|
2077
|
+
};
|
|
2078
|
+
content: {
|
|
2079
|
+
"text/plain": string;
|
|
2080
|
+
};
|
|
2081
|
+
};
|
|
2082
|
+
/** @description Too many attempts for this organization */
|
|
2083
|
+
429: {
|
|
2084
|
+
headers: {
|
|
2085
|
+
[name: string]: unknown;
|
|
2086
|
+
};
|
|
2087
|
+
content: {
|
|
2088
|
+
"text/plain": string;
|
|
2089
|
+
};
|
|
2090
|
+
};
|
|
2091
|
+
/** @description Internal server error */
|
|
2092
|
+
500: {
|
|
2093
|
+
headers: {
|
|
2094
|
+
[name: string]: unknown;
|
|
2095
|
+
};
|
|
2096
|
+
content: {
|
|
2097
|
+
"text/plain": string;
|
|
2098
|
+
};
|
|
2099
|
+
};
|
|
2100
|
+
};
|
|
2101
|
+
};
|
|
2102
|
+
}
|