@meshery/schemas 1.3.51 → 1.3.53

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.
@@ -4,7 +4,32 @@
4
4
  */
5
5
 
6
6
  export interface paths {
7
- "/api/identity/orgs/{orgId}/smtp-configuration": {
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": {
8
33
  parameters: {
9
34
  query?: never;
10
35
  header?: never;
@@ -13,27 +38,70 @@ export interface paths {
13
38
  };
14
39
  /**
15
40
  * Get an organization's SMTP configuration
16
- * @description Returns the organization's mail server configuration, including its current health and from-domain verification state. The password is always the redaction sentinel `***`.
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 `***`.
17
42
  */
18
43
  get: operations["getOrganizationSmtpConfiguration"];
19
44
  /**
20
- * Create or replace an organization's SMTP configuration
21
- * @description Writes the organization's single mail server configuration, creating it if absent. The whole document is replaced, with one exception: a `password` of `***` or an empty string preserves the stored password, so a client may edit an unrelated field after a read without erasing the credential.
22
- * Changing the from address resets from-domain verification, and `enabled` is refused while the from domain is unverified.
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.
23
74
  */
24
- put: operations["upsertOrganizationSmtpConfiguration"];
75
+ put: operations["rotateOrganizationSmtpCredential"];
25
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;
26
92
  /**
27
- * Remove an organization's SMTP configuration
28
- * @description Removes the configuration and its stored credential. The organization's mail reverts to the provider's shared relay.
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.
29
96
  */
30
- delete: operations["deleteOrganizationSmtpConfiguration"];
97
+ post: operations["setOrganizationSmtpEnablement"];
98
+ delete?: never;
31
99
  options?: never;
32
100
  head?: never;
33
101
  patch?: never;
34
102
  trace?: never;
35
103
  };
36
- "/api/identity/orgs/{orgId}/smtp-configuration/test": {
104
+ "/api/orgs/{orgId}/environments/mail-relay/connection/test": {
37
105
  parameters: {
38
106
  query?: never;
39
107
  header?: never;
@@ -45,6 +113,7 @@ export interface paths {
45
113
  /**
46
114
  * Send a test message through an organization's SMTP configuration
47
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.
48
117
  * The recipient defaults to the calling administrator's own address. The outcome is a classification, never the remote server's own text.
49
118
  */
50
119
  post: operations["testOrganizationSmtpConfiguration"];
@@ -54,7 +123,7 @@ export interface paths {
54
123
  patch?: never;
55
124
  trace?: never;
56
125
  };
57
- "/api/identity/orgs/{orgId}/smtp-configuration/domain-verification": {
126
+ "/api/orgs/{orgId}/environments/mail-relay/domain-verification": {
58
127
  parameters: {
59
128
  query?: never;
60
129
  header?: never;
@@ -69,7 +138,7 @@ export interface paths {
69
138
  put?: never;
70
139
  /**
71
140
  * Check the from-domain verification challenge
72
- * @description Resolves the challenge record and records the result. Proving the domain is what permits the configuration to be enabled.
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.
73
142
  */
74
143
  post: operations["verifyOrganizationSmtpDomain"];
75
144
  delete?: never;
@@ -84,7 +153,11 @@ export interface components {
84
153
  schemas: {
85
154
  /**
86
155
  * OrganizationSmtpConfiguration
87
- * @description An organization's own outbound mail server. When present and enabled, 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.
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.
88
161
  * @example {
89
162
  * "id": "00000000-0000-0000-0000-000000000000",
90
163
  * "organizationId": "00000000-0000-0000-0000-000000000000",
@@ -97,15 +170,13 @@ export interface components {
97
170
  * "fromAddress": "no-reply@example.com",
98
171
  * "fromDisplayName": "Example Corp",
99
172
  * "replyToAddress": "support@example.com",
100
- * "enabled": true,
173
+ * "status": "registered",
101
174
  * "fallbackToProvider": true,
102
175
  * "fromDomain": "example.com",
103
176
  * "fromDomainVerificationToken": "0f6a5d2c9b1e4a7f8c3d6b0e2a4f7c19",
104
177
  * "fromDomainVerifiedAt": null,
105
- * "verificationState": "unverified",
106
178
  * "lastSuccessAt": null,
107
179
  * "lastFailureAt": null,
108
- * "lastFailureReason": null,
109
180
  * "consecutiveFailures": 0,
110
181
  * "createdBy": "00000000-0000-0000-0000-000000000000",
111
182
  * "createdAt": "0001-01-01T00:00:00Z",
@@ -127,7 +198,7 @@ export interface components {
127
198
  /** @description Hostname of the organization's SMTP server. */
128
199
  host: string;
129
200
  /**
130
- * @description TCP port the organization's SMTP server listens on.
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.
131
202
  * @default 587
132
203
  */
133
204
  port: number;
@@ -143,13 +214,16 @@ export interface components {
143
214
  * @enum {string}
144
215
  */
145
216
  authMechanism: "plain" | "cram-md5" | "none";
146
- /** @description Username presented to the organization's SMTP server. */
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. */
147
218
  username?: string;
148
- /** @description Password presented to the organization's SMTP server. Write-only. A read always returns the redaction sentinel `***`; the stored value is encrypted at rest and is never projected into a response. Writing `***` or an empty string preserves the stored password, so a client may round-trip a read without erasing the credential. */
149
- password?: 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;
150
224
  /**
151
225
  * Format: email
152
- * @description Address the organization's mail is sent from. Its domain must be verified before the configuration can be enabled.
226
+ * @description Address the organization's mail is sent from. Its domain must be verified before mail is routed through this server.
153
227
  */
154
228
  fromAddress: string;
155
229
  /** @description Display name shown alongside the from address in the message header. */
@@ -160,10 +234,13 @@ export interface components {
160
234
  */
161
235
  replyToAddress?: string;
162
236
  /**
163
- * @description Whether mail is routed through this server. Cannot be set while the from domain is unverified.
164
- * @default false
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}
165
242
  */
166
- enabled: boolean;
243
+ status: "registered" | "connected" | "disconnected" | "ignored";
167
244
  /**
168
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.
169
246
  * @default true
@@ -178,12 +255,6 @@ export interface components {
178
255
  * @description Timestamp at which control of the from domain was last proven. Null while unproven.
179
256
  */
180
257
  fromDomainVerifiedAt?: string | null;
181
- /**
182
- * @description Health of the configuration. `unverified` means it has never delivered a test message, `verified` means the last delivery attempt succeeded, and `failing` means consecutive failures have opened the circuit and mail is being handled under the fallback setting without dialling this server.
183
- * @default unverified
184
- * @enum {string}
185
- */
186
- verificationState: "unverified" | "verified" | "failing";
187
258
  /**
188
259
  * Format: date-time
189
260
  * @description Timestamp of the last message this server accepted.
@@ -225,17 +296,15 @@ export interface components {
225
296
  */
226
297
  deletedAt?: string | null;
227
298
  };
228
- /** @description Client-settable fields of an organization's mail server configuration. Health, verification state and timestamps are server-owned and are not accepted here. */
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
+ */
229
303
  OrganizationSmtpConfigurationPayload: {
230
- /**
231
- * Format: uuid
232
- * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
233
- */
234
- id?: string;
235
304
  /** @description Hostname of the organization's SMTP server. */
236
305
  host: string;
237
306
  /**
238
- * @description TCP port the organization's SMTP server listens on.
307
+ * @description TCP port the organization's SMTP server listens on. Restricted further by a submission-port allowlist.
239
308
  * @default 587
240
309
  */
241
310
  port: number;
@@ -251,13 +320,18 @@ export interface components {
251
320
  * @enum {string}
252
321
  */
253
322
  authMechanism: "plain" | "cram-md5" | "none";
254
- /** @description Username presented to the organization's SMTP server. */
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. */
255
324
  username?: string;
256
- /** @description Password presented to the organization's SMTP server. Write-only. `***` or an empty string preserves the stored password, so a client may round-trip a read without erasing the credential. */
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
+ */
257
331
  password?: string;
258
332
  /**
259
333
  * Format: email
260
- * @description Address the organization's mail is sent from. Changing it resets from-domain verification.
334
+ * @description Address the organization's mail is sent from.
261
335
  */
262
336
  fromAddress: string;
263
337
  /** @description Display name shown alongside the from address. */
@@ -268,16 +342,62 @@ export interface components {
268
342
  */
269
343
  replyToAddress?: string;
270
344
  /**
271
- * @description Whether mail is routed through this server. Refused while the from domain is unverified.
272
- * @default false
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
273
347
  */
274
- enabled: boolean;
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;
275
354
  /**
276
- * @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.
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.
277
387
  * @default true
278
388
  */
279
389
  fallbackToProvider: boolean;
280
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
+ };
281
401
  /** @description Options for a test delivery. */
282
402
  OrganizationSmtpTestRequest: {
283
403
  /**
@@ -370,6 +490,15 @@ export interface components {
370
490
  "text/plain": string;
371
491
  };
372
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
+ };
373
502
  /** @description Too many attempts for this organization */
374
503
  429: {
375
504
  headers: {
@@ -397,15 +526,10 @@ export interface components {
397
526
  organizationSmtpConfigurationPayload: {
398
527
  content: {
399
528
  "application/json": {
400
- /**
401
- * Format: uuid
402
- * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
403
- */
404
- id?: string;
405
529
  /** @description Hostname of the organization's SMTP server. */
406
530
  host: string;
407
531
  /**
408
- * @description TCP port the organization's SMTP server listens on.
532
+ * @description TCP port the organization's SMTP server listens on. Restricted further by a submission-port allowlist.
409
533
  * @default 587
410
534
  */
411
535
  port: number;
@@ -421,13 +545,18 @@ export interface components {
421
545
  * @enum {string}
422
546
  */
423
547
  authMechanism?: "plain" | "cram-md5" | "none";
424
- /** @description Username presented to the organization's SMTP server. */
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. */
425
549
  username?: string;
426
- /** @description Password presented to the organization's SMTP server. Write-only. `***` or an empty string preserves the stored password, so a client may round-trip a read without erasing the credential. */
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
+ */
427
556
  password?: string;
428
557
  /**
429
558
  * Format: email
430
- * @description Address the organization's mail is sent from. Changing it resets from-domain verification.
559
+ * @description Address the organization's mail is sent from.
431
560
  */
432
561
  fromAddress: string;
433
562
  /** @description Display name shown alongside the from address. */
@@ -438,18 +567,73 @@ export interface components {
438
567
  */
439
568
  replyToAddress?: string;
440
569
  /**
441
- * @description Whether mail is routed through this server. Refused while the from domain is unverified.
442
- * @default false
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
443
572
  */
444
- enabled?: boolean;
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;
445
582
  /**
446
- * @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.
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.
447
615
  * @default true
448
616
  */
449
617
  fallbackToProvider?: boolean;
450
618
  };
451
619
  };
452
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
+ };
453
637
  organizationSmtpTestRequest: {
454
638
  content: {
455
639
  "application/json": {
@@ -467,7 +651,7 @@ export interface components {
467
651
  }
468
652
  export type $defs = Record<string, never>;
469
653
  export interface operations {
470
- getOrganizationSmtpConfiguration: {
654
+ getOrganizationSmtpEnvironment: {
471
655
  parameters: {
472
656
  query?: never;
473
657
  header?: never;
@@ -479,7 +663,7 @@ export interface operations {
479
663
  };
480
664
  requestBody?: never;
481
665
  responses: {
482
- /** @description The organization's SMTP configuration. */
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. */
483
667
  200: {
484
668
  headers: {
485
669
  [name: string]: unknown;
@@ -488,114 +672,66 @@ export interface operations {
488
672
  "application/json": {
489
673
  /**
490
674
  * Format: uuid
491
- * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
675
+ * @description ID
492
676
  */
493
677
  id: string;
494
678
  /**
495
- * Format: uuid
496
- * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
497
- */
498
- organizationId: string;
499
- /** @description Hostname of the organization's SMTP server. */
500
- host: string;
501
- /**
502
- * @description TCP port the organization's SMTP server listens on.
503
- * @default 587
504
- */
505
- port: number;
506
- /**
507
- * @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.
508
- * @default starttls
509
- * @enum {string}
510
- */
511
- encryption: "starttls" | "tls" | "none";
512
- /**
513
- * @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.
514
- * @default plain
515
- * @enum {string}
516
- */
517
- authMechanism: "plain" | "cram-md5" | "none";
518
- /** @description Username presented to the organization's SMTP server. */
519
- username?: string;
520
- /** @description Password presented to the organization's SMTP server. Write-only. A read always returns the redaction sentinel `***`; the stored value is encrypted at rest and is never projected into a response. Writing `***` or an empty string preserves the stored password, so a client may round-trip a read without erasing the credential. */
521
- password?: string;
522
- /**
523
- * Format: email
524
- * @description Address the organization's mail is sent from. Its domain must be verified before the configuration can be enabled.
525
- */
526
- fromAddress: string;
527
- /** @description Display name shown alongside the from address in the message header. */
528
- fromDisplayName?: string;
529
- /**
530
- * Format: email
531
- * @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.
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
+ * ]
532
689
  */
533
- replyToAddress?: string;
690
+ schemaVersion: string;
691
+ /** @description Environment name */
692
+ name: string;
693
+ /** @description Environment description */
694
+ description: string;
534
695
  /**
535
- * @description Whether mail is routed through this server. Cannot be set while the from domain is unverified.
536
- * @default false
696
+ * Format: uuid
697
+ * @description Environment organization ID
537
698
  */
538
- enabled: boolean;
699
+ organizationId: string;
539
700
  /**
540
- * @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.
541
- * @default true
701
+ * Format: uuid
702
+ * @description Environment owner
542
703
  */
543
- fallbackToProvider: boolean;
544
- /** @description Registrable domain of the from address, held separately as the unit that ownership is proven for. */
545
- fromDomain?: string;
546
- /** @description Token the organization publishes in DNS to prove control of the from domain. Not a credential - it authorizes nothing and grants no access. */
547
- fromDomainVerificationToken?: string;
704
+ owner?: string;
548
705
  /**
549
706
  * Format: date-time
550
- * @description Timestamp at which control of the from domain was last proven. Null while unproven.
551
- */
552
- fromDomainVerifiedAt?: string | null;
553
- /**
554
- * @description Health of the configuration. `unverified` means it has never delivered a test message, `verified` means the last delivery attempt succeeded, and `failing` means consecutive failures have opened the circuit and mail is being handled under the fallback setting without dialling this server.
555
- * @default unverified
556
- * @enum {string}
707
+ * @description Timestamp when the environment was created.
557
708
  */
558
- verificationState: "unverified" | "verified" | "failing";
709
+ createdAt?: string;
710
+ /** @description Additional metadata associated with the environment. */
711
+ metadata?: Record<string, never>;
559
712
  /**
560
713
  * Format: date-time
561
- * @description Timestamp of the last message this server accepted.
714
+ * @description Timestamp when the environment was last updated.
562
715
  */
563
- lastSuccessAt?: string | null;
716
+ updatedAt?: string;
564
717
  /**
565
718
  * Format: date-time
566
- * @description Timestamp of the last delivery attempt this server rejected or failed to accept.
719
+ * @description Timestamp when the environment was soft deleted. Null while the environment remains active.
567
720
  */
568
- lastFailureAt?: string | null;
721
+ deletedAt?: string | null;
569
722
  /**
570
- * @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.
723
+ * @description What the environment exists for. `user` is an ordinary environment that people create to logically group Connections and their Credentials. `administrative` designates an environment the platform itself provisions to hold organization-level configuration, and which resolvers of that configuration therefore trust.
724
+ *
725
+ * Absent means `user`. Nothing may read an unset or unrecognised value as administrative: test for the administrative value explicitly rather than for "not user", so the property fails closed.
726
+ *
727
+ * At most one live environment per organization may carry any single privileged purpose - `administrative`, and each privileged value a later version adds. Name those values explicitly wherever the rule is enforced, including the database index predicate: a "not `user`" test also matches the empty value that unmigrated rows and un-normalised writes read back as, which means ordinary. A resolver that selects an environment by purpose MUST fail closed when more than one live row matches: return an error rather than whichever row the database happened to return first.
728
+ *
729
+ * Server-owned and not client-settable. It is absent from `EnvironmentPayload`, which every environment POST and PUT requestBody references, and from the create-or-edit form, so the environment create and update endpoints have no field for it. That exclusion is a codegen guarantee, never access control: the registrant connection inlines the full environment entity, so `registerRegistryComponent` and `registerRegistryRelationship` do carry `purpose` in a request type and consumers MUST refuse it on input there too. Whatever surface a value arrives on, every consumer MUST assign this property only from server-side provisioning or a data migration. Permission to create an environment does not confer the ability to make one administrative.
730
+ *
731
+ * The database index that enforces the uniqueness invariant, the migration path for environments that are administrative by naming convention today, and each consumer's obligations are specified in https://github.com/meshery/schemas/blob/master/docs/environment-purpose-contract.md.
571
732
  * @enum {string}
572
733
  */
573
- lastFailureReason?: "blocked_target" | "connect_refused" | "connect_timeout" | "tls_failed" | "starttls_unsupported" | "auth_rejected" | "relay_rejected_sender" | "relay_rejected_recipient" | "delivery_failed" | "credential_unreadable";
574
- /**
575
- * @description Delivery failures since the last success. Drives the circuit that stops dialling a persistently unreachable server.
576
- * @default 0
577
- */
578
- consecutiveFailures: number;
579
- /**
580
- * Format: uuid
581
- * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
582
- */
583
- createdBy?: string | null;
584
- /**
585
- * Format: date-time
586
- * @description Timestamp when the configuration was created.
587
- */
588
- createdAt: string;
589
- /**
590
- * Format: date-time
591
- * @description Timestamp when the configuration was last changed.
592
- */
593
- updatedAt: string;
594
- /**
595
- * Format: date-time
596
- * @description Timestamp when the configuration was soft deleted. Null while it remains active.
597
- */
598
- deletedAt?: string | null;
734
+ purpose?: "user" | "administrative";
599
735
  };
600
736
  };
601
737
  };
@@ -637,7 +773,7 @@ export interface operations {
637
773
  };
638
774
  };
639
775
  };
640
- upsertOrganizationSmtpConfiguration: {
776
+ deleteOrganizationSmtpEnvironment: {
641
777
  parameters: {
642
778
  query?: never;
643
779
  header?: never;
@@ -647,40 +783,251 @@ export interface operations {
647
783
  };
648
784
  cookie?: never;
649
785
  };
650
- requestBody: {
651
- content: {
652
- "application/json": {
653
- /**
654
- * Format: uuid
655
- * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
656
- */
657
- id?: string;
658
- /** @description Hostname of the organization's SMTP server. */
659
- host: string;
660
- /**
661
- * @description TCP port the organization's SMTP server listens on.
786
+ requestBody?: never;
787
+ responses: {
788
+ /** @description The configuration was removed. */
789
+ 204: {
790
+ headers: {
791
+ [name: string]: unknown;
792
+ };
793
+ content?: never;
794
+ };
795
+ /** @description Expired JWT token used or insufficient privilege */
796
+ 401: {
797
+ headers: {
798
+ [name: string]: unknown;
799
+ };
800
+ content: {
801
+ "text/plain": string;
802
+ };
803
+ };
804
+ /** @description Caller lacks the permission key required for this organization */
805
+ 403: {
806
+ headers: {
807
+ [name: string]: unknown;
808
+ };
809
+ content: {
810
+ "text/plain": string;
811
+ };
812
+ };
813
+ /** @description Internal server error */
814
+ 500: {
815
+ headers: {
816
+ [name: string]: unknown;
817
+ };
818
+ content: {
819
+ "text/plain": string;
820
+ };
821
+ };
822
+ };
823
+ };
824
+ getOrganizationSmtpConfiguration: {
825
+ parameters: {
826
+ query?: never;
827
+ header?: never;
828
+ path: {
829
+ /** @description Organization ID */
830
+ orgId: string;
831
+ };
832
+ cookie?: never;
833
+ };
834
+ requestBody?: never;
835
+ responses: {
836
+ /** @description The organization's SMTP configuration. */
837
+ 200: {
838
+ headers: {
839
+ [name: string]: unknown;
840
+ };
841
+ content: {
842
+ "application/json": {
843
+ /**
844
+ * Format: uuid
845
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
846
+ */
847
+ id: string;
848
+ /**
849
+ * Format: uuid
850
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
851
+ */
852
+ organizationId: string;
853
+ /** @description Hostname of the organization's SMTP server. */
854
+ host: string;
855
+ /**
856
+ * @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.
857
+ * @default 587
858
+ */
859
+ port: number;
860
+ /**
861
+ * @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.
862
+ * @default starttls
863
+ * @enum {string}
864
+ */
865
+ encryption: "starttls" | "tls" | "none";
866
+ /**
867
+ * @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.
868
+ * @default plain
869
+ * @enum {string}
870
+ */
871
+ authMechanism: "plain" | "cram-md5" | "none";
872
+ /** @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. */
873
+ username?: string;
874
+ /**
875
+ * @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.
876
+ * 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.
877
+ */
878
+ readonly password?: string;
879
+ /**
880
+ * Format: email
881
+ * @description Address the organization's mail is sent from. Its domain must be verified before mail is routed through this server.
882
+ */
883
+ fromAddress: string;
884
+ /** @description Display name shown alongside the from address in the message header. */
885
+ fromDisplayName?: string;
886
+ /**
887
+ * Format: email
888
+ * @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.
889
+ */
890
+ replyToAddress?: string;
891
+ /**
892
+ * @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.
893
+ *
894
+ * 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.
895
+ * @default registered
896
+ * @enum {string}
897
+ */
898
+ status: "registered" | "connected" | "disconnected" | "ignored";
899
+ /**
900
+ * @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.
901
+ * @default true
902
+ */
903
+ fallbackToProvider: boolean;
904
+ /** @description Registrable domain of the from address, held separately as the unit that ownership is proven for. */
905
+ fromDomain?: string;
906
+ /** @description Token the organization publishes in DNS to prove control of the from domain. Not a credential - it authorizes nothing and grants no access. */
907
+ fromDomainVerificationToken?: string;
908
+ /**
909
+ * Format: date-time
910
+ * @description Timestamp at which control of the from domain was last proven. Null while unproven.
911
+ */
912
+ fromDomainVerifiedAt?: string | null;
913
+ /**
914
+ * Format: date-time
915
+ * @description Timestamp of the last message this server accepted.
916
+ */
917
+ lastSuccessAt?: string | null;
918
+ /**
919
+ * Format: date-time
920
+ * @description Timestamp of the last delivery attempt this server rejected or failed to accept.
921
+ */
922
+ lastFailureAt?: string | null;
923
+ /**
924
+ * @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.
925
+ * @enum {string}
926
+ */
927
+ lastFailureReason?: "blocked_target" | "connect_refused" | "connect_timeout" | "tls_failed" | "starttls_unsupported" | "auth_rejected" | "relay_rejected_sender" | "relay_rejected_recipient" | "delivery_failed" | "credential_unreadable";
928
+ /**
929
+ * @description Delivery failures since the last success. Drives the circuit that stops dialling a persistently unreachable server.
930
+ * @default 0
931
+ */
932
+ consecutiveFailures: number;
933
+ /**
934
+ * Format: uuid
935
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
936
+ */
937
+ createdBy?: string | null;
938
+ /**
939
+ * Format: date-time
940
+ * @description Timestamp when the configuration was created.
941
+ */
942
+ createdAt: string;
943
+ /**
944
+ * Format: date-time
945
+ * @description Timestamp when the configuration was last changed.
946
+ */
947
+ updatedAt: string;
948
+ /**
949
+ * Format: date-time
950
+ * @description Timestamp when the configuration was soft deleted. Null while it remains active.
951
+ */
952
+ deletedAt?: string | null;
953
+ };
954
+ };
955
+ };
956
+ /** @description Expired JWT token used or insufficient privilege */
957
+ 401: {
958
+ headers: {
959
+ [name: string]: unknown;
960
+ };
961
+ content: {
962
+ "text/plain": string;
963
+ };
964
+ };
965
+ /** @description Caller lacks the permission key required for this organization */
966
+ 403: {
967
+ headers: {
968
+ [name: string]: unknown;
969
+ };
970
+ content: {
971
+ "text/plain": string;
972
+ };
973
+ };
974
+ /** @description Result not found */
975
+ 404: {
976
+ headers: {
977
+ [name: string]: unknown;
978
+ };
979
+ content: {
980
+ "text/plain": string;
981
+ };
982
+ };
983
+ /** @description Internal server error */
984
+ 500: {
985
+ headers: {
986
+ [name: string]: unknown;
987
+ };
988
+ content: {
989
+ "text/plain": string;
990
+ };
991
+ };
992
+ };
993
+ };
994
+ updateOrganizationSmtpConfiguration: {
995
+ parameters: {
996
+ query?: never;
997
+ header?: never;
998
+ path: {
999
+ /** @description Organization ID */
1000
+ orgId: string;
1001
+ };
1002
+ cookie?: never;
1003
+ };
1004
+ requestBody: {
1005
+ content: {
1006
+ "application/json": {
1007
+ /** @description Hostname of the organization's SMTP server. */
1008
+ host: string;
1009
+ /**
1010
+ * @description TCP port the organization's SMTP server listens on. Restricted further by a submission-port allowlist.
662
1011
  * @default 587
663
1012
  */
664
1013
  port: number;
665
1014
  /**
666
- * @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.
1015
+ * @description Transport encryption to negotiate.
667
1016
  * @default starttls
668
1017
  * @enum {string}
669
1018
  */
670
1019
  encryption?: "starttls" | "tls" | "none";
671
1020
  /**
672
- * @description SMTP authentication mechanism. Any mechanism other than `none` requires both a username and a password.
1021
+ * @description SMTP authentication mechanism. Changing this to a mechanism other than `none` while no password is stored is refused; rotate the credential first.
673
1022
  * @default plain
674
1023
  * @enum {string}
675
1024
  */
676
1025
  authMechanism?: "plain" | "cram-md5" | "none";
677
1026
  /** @description Username presented to the organization's SMTP server. */
678
1027
  username?: string;
679
- /** @description Password presented to the organization's SMTP server. Write-only. `***` or an empty string preserves the stored password, so a client may round-trip a read without erasing the credential. */
680
- password?: string;
681
1028
  /**
682
1029
  * Format: email
683
- * @description Address the organization's mail is sent from. Changing it resets from-domain verification.
1030
+ * @description Address the organization's mail is sent from. Changing it to a different registrable domain resets from-domain verification.
684
1031
  */
685
1032
  fromAddress: string;
686
1033
  /** @description Display name shown alongside the from address. */
@@ -691,12 +1038,7 @@ export interface operations {
691
1038
  */
692
1039
  replyToAddress?: string;
693
1040
  /**
694
- * @description Whether mail is routed through this server. Refused while the from domain is unverified.
695
- * @default false
696
- */
697
- enabled?: boolean;
698
- /**
699
- * @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.
1041
+ * @description Whether a message this server fails to accept is re-sent through the provider's shared relay.
700
1042
  * @default true
701
1043
  */
702
1044
  fallbackToProvider?: boolean;
@@ -724,7 +1066,7 @@ export interface operations {
724
1066
  /** @description Hostname of the organization's SMTP server. */
725
1067
  host: string;
726
1068
  /**
727
- * @description TCP port the organization's SMTP server listens on.
1069
+ * @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.
728
1070
  * @default 587
729
1071
  */
730
1072
  port: number;
@@ -740,13 +1082,16 @@ export interface operations {
740
1082
  * @enum {string}
741
1083
  */
742
1084
  authMechanism: "plain" | "cram-md5" | "none";
743
- /** @description Username presented to the organization's SMTP server. */
1085
+ /** @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. */
744
1086
  username?: string;
745
- /** @description Password presented to the organization's SMTP server. Write-only. A read always returns the redaction sentinel `***`; the stored value is encrypted at rest and is never projected into a response. Writing `***` or an empty string preserves the stored password, so a client may round-trip a read without erasing the credential. */
746
- password?: string;
1087
+ /**
1088
+ * @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.
1089
+ * 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.
1090
+ */
1091
+ readonly password?: string;
747
1092
  /**
748
1093
  * Format: email
749
- * @description Address the organization's mail is sent from. Its domain must be verified before the configuration can be enabled.
1094
+ * @description Address the organization's mail is sent from. Its domain must be verified before mail is routed through this server.
750
1095
  */
751
1096
  fromAddress: string;
752
1097
  /** @description Display name shown alongside the from address in the message header. */
@@ -757,10 +1102,13 @@ export interface operations {
757
1102
  */
758
1103
  replyToAddress?: string;
759
1104
  /**
760
- * @description Whether mail is routed through this server. Cannot be set while the from domain is unverified.
761
- * @default false
1105
+ * @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.
1106
+ *
1107
+ * 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.
1108
+ * @default registered
1109
+ * @enum {string}
762
1110
  */
763
- enabled: boolean;
1111
+ status: "registered" | "connected" | "disconnected" | "ignored";
764
1112
  /**
765
1113
  * @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.
766
1114
  * @default true
@@ -775,12 +1123,6 @@ export interface operations {
775
1123
  * @description Timestamp at which control of the from domain was last proven. Null while unproven.
776
1124
  */
777
1125
  fromDomainVerifiedAt?: string | null;
778
- /**
779
- * @description Health of the configuration. `unverified` means it has never delivered a test message, `verified` means the last delivery attempt succeeded, and `failing` means consecutive failures have opened the circuit and mail is being handled under the fallback setting without dialling this server.
780
- * @default unverified
781
- * @enum {string}
782
- */
783
- verificationState: "unverified" | "verified" | "failing";
784
1126
  /**
785
1127
  * Format: date-time
786
1128
  * @description Timestamp of the last message this server accepted.
@@ -871,7 +1213,7 @@ export interface operations {
871
1213
  };
872
1214
  };
873
1215
  };
874
- deleteOrganizationSmtpConfiguration: {
1216
+ createOrganizationSmtpConfiguration: {
875
1217
  parameters: {
876
1218
  query?: never;
877
1219
  header?: never;
@@ -881,35 +1223,588 @@ export interface operations {
881
1223
  };
882
1224
  cookie?: never;
883
1225
  };
884
- requestBody?: never;
885
- responses: {
886
- /** @description The configuration was removed. */
887
- 204: {
888
- headers: {
889
- [name: string]: unknown;
890
- };
891
- content?: never;
892
- };
893
- /** @description Expired JWT token used or insufficient privilege */
894
- 401: {
895
- headers: {
896
- [name: string]: unknown;
897
- };
898
- content: {
899
- "text/plain": string;
900
- };
901
- };
902
- /** @description Caller lacks the permission key required for this organization */
903
- 403: {
904
- headers: {
905
- [name: string]: unknown;
906
- };
907
- content: {
908
- "text/plain": string;
909
- };
910
- };
911
- /** @description Result not found */
912
- 404: {
1226
+ requestBody: {
1227
+ content: {
1228
+ "application/json": {
1229
+ /** @description Hostname of the organization's SMTP server. */
1230
+ host: string;
1231
+ /**
1232
+ * @description TCP port the organization's SMTP server listens on. Restricted further by a submission-port allowlist.
1233
+ * @default 587
1234
+ */
1235
+ port: number;
1236
+ /**
1237
+ * @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.
1238
+ * @default starttls
1239
+ * @enum {string}
1240
+ */
1241
+ encryption?: "starttls" | "tls" | "none";
1242
+ /**
1243
+ * @description SMTP authentication mechanism. Any mechanism other than `none` requires both a username and a password.
1244
+ * @default plain
1245
+ * @enum {string}
1246
+ */
1247
+ authMechanism?: "plain" | "cram-md5" | "none";
1248
+ /** @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. */
1249
+ username?: string;
1250
+ /**
1251
+ * @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.
1252
+ * 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.
1253
+ * 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.
1254
+ * 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.
1255
+ */
1256
+ password?: string;
1257
+ /**
1258
+ * Format: email
1259
+ * @description Address the organization's mail is sent from.
1260
+ */
1261
+ fromAddress: string;
1262
+ /** @description Display name shown alongside the from address. */
1263
+ fromDisplayName?: string;
1264
+ /**
1265
+ * Format: email
1266
+ * @description Address replies are directed to.
1267
+ */
1268
+ replyToAddress?: string;
1269
+ /**
1270
+ * @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.
1271
+ * @default true
1272
+ */
1273
+ fallbackToProvider?: boolean;
1274
+ };
1275
+ };
1276
+ };
1277
+ responses: {
1278
+ /** @description The stored SMTP configuration. */
1279
+ 201: {
1280
+ headers: {
1281
+ [name: string]: unknown;
1282
+ };
1283
+ content: {
1284
+ "application/json": {
1285
+ /**
1286
+ * Format: uuid
1287
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
1288
+ */
1289
+ id: string;
1290
+ /**
1291
+ * Format: uuid
1292
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
1293
+ */
1294
+ organizationId: string;
1295
+ /** @description Hostname of the organization's SMTP server. */
1296
+ host: string;
1297
+ /**
1298
+ * @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.
1299
+ * @default 587
1300
+ */
1301
+ port: number;
1302
+ /**
1303
+ * @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.
1304
+ * @default starttls
1305
+ * @enum {string}
1306
+ */
1307
+ encryption: "starttls" | "tls" | "none";
1308
+ /**
1309
+ * @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.
1310
+ * @default plain
1311
+ * @enum {string}
1312
+ */
1313
+ authMechanism: "plain" | "cram-md5" | "none";
1314
+ /** @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. */
1315
+ username?: string;
1316
+ /**
1317
+ * @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.
1318
+ * 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.
1319
+ */
1320
+ readonly password?: string;
1321
+ /**
1322
+ * Format: email
1323
+ * @description Address the organization's mail is sent from. Its domain must be verified before mail is routed through this server.
1324
+ */
1325
+ fromAddress: string;
1326
+ /** @description Display name shown alongside the from address in the message header. */
1327
+ fromDisplayName?: string;
1328
+ /**
1329
+ * Format: email
1330
+ * @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.
1331
+ */
1332
+ replyToAddress?: string;
1333
+ /**
1334
+ * @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.
1335
+ *
1336
+ * 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.
1337
+ * @default registered
1338
+ * @enum {string}
1339
+ */
1340
+ status: "registered" | "connected" | "disconnected" | "ignored";
1341
+ /**
1342
+ * @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.
1343
+ * @default true
1344
+ */
1345
+ fallbackToProvider: boolean;
1346
+ /** @description Registrable domain of the from address, held separately as the unit that ownership is proven for. */
1347
+ fromDomain?: string;
1348
+ /** @description Token the organization publishes in DNS to prove control of the from domain. Not a credential - it authorizes nothing and grants no access. */
1349
+ fromDomainVerificationToken?: string;
1350
+ /**
1351
+ * Format: date-time
1352
+ * @description Timestamp at which control of the from domain was last proven. Null while unproven.
1353
+ */
1354
+ fromDomainVerifiedAt?: string | null;
1355
+ /**
1356
+ * Format: date-time
1357
+ * @description Timestamp of the last message this server accepted.
1358
+ */
1359
+ lastSuccessAt?: string | null;
1360
+ /**
1361
+ * Format: date-time
1362
+ * @description Timestamp of the last delivery attempt this server rejected or failed to accept.
1363
+ */
1364
+ lastFailureAt?: string | null;
1365
+ /**
1366
+ * @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.
1367
+ * @enum {string}
1368
+ */
1369
+ lastFailureReason?: "blocked_target" | "connect_refused" | "connect_timeout" | "tls_failed" | "starttls_unsupported" | "auth_rejected" | "relay_rejected_sender" | "relay_rejected_recipient" | "delivery_failed" | "credential_unreadable";
1370
+ /**
1371
+ * @description Delivery failures since the last success. Drives the circuit that stops dialling a persistently unreachable server.
1372
+ * @default 0
1373
+ */
1374
+ consecutiveFailures: number;
1375
+ /**
1376
+ * Format: uuid
1377
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
1378
+ */
1379
+ createdBy?: string | null;
1380
+ /**
1381
+ * Format: date-time
1382
+ * @description Timestamp when the configuration was created.
1383
+ */
1384
+ createdAt: string;
1385
+ /**
1386
+ * Format: date-time
1387
+ * @description Timestamp when the configuration was last changed.
1388
+ */
1389
+ updatedAt: string;
1390
+ /**
1391
+ * Format: date-time
1392
+ * @description Timestamp when the configuration was soft deleted. Null while it remains active.
1393
+ */
1394
+ deletedAt?: string | null;
1395
+ };
1396
+ };
1397
+ };
1398
+ /** @description Invalid request body or request param */
1399
+ 400: {
1400
+ headers: {
1401
+ [name: string]: unknown;
1402
+ };
1403
+ content: {
1404
+ "text/plain": string;
1405
+ };
1406
+ };
1407
+ /** @description Expired JWT token used or insufficient privilege */
1408
+ 401: {
1409
+ headers: {
1410
+ [name: string]: unknown;
1411
+ };
1412
+ content: {
1413
+ "text/plain": string;
1414
+ };
1415
+ };
1416
+ /** @description Caller lacks the permission key required for this organization */
1417
+ 403: {
1418
+ headers: {
1419
+ [name: string]: unknown;
1420
+ };
1421
+ content: {
1422
+ "text/plain": string;
1423
+ };
1424
+ };
1425
+ /** @description The configuration already exists, or the requested state transition is refused in the configuration's current state */
1426
+ 409: {
1427
+ headers: {
1428
+ [name: string]: unknown;
1429
+ };
1430
+ content: {
1431
+ "text/plain": string;
1432
+ };
1433
+ };
1434
+ /** @description Internal server error */
1435
+ 500: {
1436
+ headers: {
1437
+ [name: string]: unknown;
1438
+ };
1439
+ content: {
1440
+ "text/plain": string;
1441
+ };
1442
+ };
1443
+ };
1444
+ };
1445
+ rotateOrganizationSmtpCredential: {
1446
+ parameters: {
1447
+ query?: never;
1448
+ header?: never;
1449
+ path: {
1450
+ /** @description Organization ID */
1451
+ orgId: string;
1452
+ };
1453
+ cookie?: never;
1454
+ };
1455
+ requestBody: {
1456
+ content: {
1457
+ "application/json": {
1458
+ /** @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. */
1459
+ password: string;
1460
+ };
1461
+ };
1462
+ };
1463
+ responses: {
1464
+ /** @description The stored SMTP configuration, with the password redacted. */
1465
+ 200: {
1466
+ headers: {
1467
+ [name: string]: unknown;
1468
+ };
1469
+ content: {
1470
+ "application/json": {
1471
+ /**
1472
+ * Format: uuid
1473
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
1474
+ */
1475
+ id: string;
1476
+ /**
1477
+ * Format: uuid
1478
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
1479
+ */
1480
+ organizationId: string;
1481
+ /** @description Hostname of the organization's SMTP server. */
1482
+ host: string;
1483
+ /**
1484
+ * @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.
1485
+ * @default 587
1486
+ */
1487
+ port: number;
1488
+ /**
1489
+ * @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.
1490
+ * @default starttls
1491
+ * @enum {string}
1492
+ */
1493
+ encryption: "starttls" | "tls" | "none";
1494
+ /**
1495
+ * @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.
1496
+ * @default plain
1497
+ * @enum {string}
1498
+ */
1499
+ authMechanism: "plain" | "cram-md5" | "none";
1500
+ /** @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. */
1501
+ username?: string;
1502
+ /**
1503
+ * @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.
1504
+ * 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.
1505
+ */
1506
+ readonly password?: string;
1507
+ /**
1508
+ * Format: email
1509
+ * @description Address the organization's mail is sent from. Its domain must be verified before mail is routed through this server.
1510
+ */
1511
+ fromAddress: string;
1512
+ /** @description Display name shown alongside the from address in the message header. */
1513
+ fromDisplayName?: string;
1514
+ /**
1515
+ * Format: email
1516
+ * @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.
1517
+ */
1518
+ replyToAddress?: string;
1519
+ /**
1520
+ * @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.
1521
+ *
1522
+ * 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.
1523
+ * @default registered
1524
+ * @enum {string}
1525
+ */
1526
+ status: "registered" | "connected" | "disconnected" | "ignored";
1527
+ /**
1528
+ * @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.
1529
+ * @default true
1530
+ */
1531
+ fallbackToProvider: boolean;
1532
+ /** @description Registrable domain of the from address, held separately as the unit that ownership is proven for. */
1533
+ fromDomain?: string;
1534
+ /** @description Token the organization publishes in DNS to prove control of the from domain. Not a credential - it authorizes nothing and grants no access. */
1535
+ fromDomainVerificationToken?: string;
1536
+ /**
1537
+ * Format: date-time
1538
+ * @description Timestamp at which control of the from domain was last proven. Null while unproven.
1539
+ */
1540
+ fromDomainVerifiedAt?: string | null;
1541
+ /**
1542
+ * Format: date-time
1543
+ * @description Timestamp of the last message this server accepted.
1544
+ */
1545
+ lastSuccessAt?: string | null;
1546
+ /**
1547
+ * Format: date-time
1548
+ * @description Timestamp of the last delivery attempt this server rejected or failed to accept.
1549
+ */
1550
+ lastFailureAt?: string | null;
1551
+ /**
1552
+ * @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.
1553
+ * @enum {string}
1554
+ */
1555
+ lastFailureReason?: "blocked_target" | "connect_refused" | "connect_timeout" | "tls_failed" | "starttls_unsupported" | "auth_rejected" | "relay_rejected_sender" | "relay_rejected_recipient" | "delivery_failed" | "credential_unreadable";
1556
+ /**
1557
+ * @description Delivery failures since the last success. Drives the circuit that stops dialling a persistently unreachable server.
1558
+ * @default 0
1559
+ */
1560
+ consecutiveFailures: number;
1561
+ /**
1562
+ * Format: uuid
1563
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
1564
+ */
1565
+ createdBy?: string | null;
1566
+ /**
1567
+ * Format: date-time
1568
+ * @description Timestamp when the configuration was created.
1569
+ */
1570
+ createdAt: string;
1571
+ /**
1572
+ * Format: date-time
1573
+ * @description Timestamp when the configuration was last changed.
1574
+ */
1575
+ updatedAt: string;
1576
+ /**
1577
+ * Format: date-time
1578
+ * @description Timestamp when the configuration was soft deleted. Null while it remains active.
1579
+ */
1580
+ deletedAt?: string | null;
1581
+ };
1582
+ };
1583
+ };
1584
+ /** @description Invalid request body or request param */
1585
+ 400: {
1586
+ headers: {
1587
+ [name: string]: unknown;
1588
+ };
1589
+ content: {
1590
+ "text/plain": string;
1591
+ };
1592
+ };
1593
+ /** @description Expired JWT token used or insufficient privilege */
1594
+ 401: {
1595
+ headers: {
1596
+ [name: string]: unknown;
1597
+ };
1598
+ content: {
1599
+ "text/plain": string;
1600
+ };
1601
+ };
1602
+ /** @description Caller lacks the permission key required for this organization */
1603
+ 403: {
1604
+ headers: {
1605
+ [name: string]: unknown;
1606
+ };
1607
+ content: {
1608
+ "text/plain": string;
1609
+ };
1610
+ };
1611
+ /** @description Result not found */
1612
+ 404: {
1613
+ headers: {
1614
+ [name: string]: unknown;
1615
+ };
1616
+ content: {
1617
+ "text/plain": string;
1618
+ };
1619
+ };
1620
+ /** @description Internal server error */
1621
+ 500: {
1622
+ headers: {
1623
+ [name: string]: unknown;
1624
+ };
1625
+ content: {
1626
+ "text/plain": string;
1627
+ };
1628
+ };
1629
+ };
1630
+ };
1631
+ setOrganizationSmtpEnablement: {
1632
+ parameters: {
1633
+ query?: never;
1634
+ header?: never;
1635
+ path: {
1636
+ /** @description Organization ID */
1637
+ orgId: string;
1638
+ };
1639
+ cookie?: never;
1640
+ };
1641
+ requestBody: {
1642
+ content: {
1643
+ "application/json": {
1644
+ /** @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. */
1645
+ enabled: boolean;
1646
+ };
1647
+ };
1648
+ };
1649
+ responses: {
1650
+ /** @description The stored SMTP configuration. */
1651
+ 200: {
1652
+ headers: {
1653
+ [name: string]: unknown;
1654
+ };
1655
+ content: {
1656
+ "application/json": {
1657
+ /**
1658
+ * Format: uuid
1659
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
1660
+ */
1661
+ id: string;
1662
+ /**
1663
+ * Format: uuid
1664
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
1665
+ */
1666
+ organizationId: string;
1667
+ /** @description Hostname of the organization's SMTP server. */
1668
+ host: string;
1669
+ /**
1670
+ * @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.
1671
+ * @default 587
1672
+ */
1673
+ port: number;
1674
+ /**
1675
+ * @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.
1676
+ * @default starttls
1677
+ * @enum {string}
1678
+ */
1679
+ encryption: "starttls" | "tls" | "none";
1680
+ /**
1681
+ * @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.
1682
+ * @default plain
1683
+ * @enum {string}
1684
+ */
1685
+ authMechanism: "plain" | "cram-md5" | "none";
1686
+ /** @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. */
1687
+ username?: string;
1688
+ /**
1689
+ * @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.
1690
+ * 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.
1691
+ */
1692
+ readonly password?: string;
1693
+ /**
1694
+ * Format: email
1695
+ * @description Address the organization's mail is sent from. Its domain must be verified before mail is routed through this server.
1696
+ */
1697
+ fromAddress: string;
1698
+ /** @description Display name shown alongside the from address in the message header. */
1699
+ fromDisplayName?: string;
1700
+ /**
1701
+ * Format: email
1702
+ * @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.
1703
+ */
1704
+ replyToAddress?: string;
1705
+ /**
1706
+ * @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.
1707
+ *
1708
+ * 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.
1709
+ * @default registered
1710
+ * @enum {string}
1711
+ */
1712
+ status: "registered" | "connected" | "disconnected" | "ignored";
1713
+ /**
1714
+ * @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.
1715
+ * @default true
1716
+ */
1717
+ fallbackToProvider: boolean;
1718
+ /** @description Registrable domain of the from address, held separately as the unit that ownership is proven for. */
1719
+ fromDomain?: string;
1720
+ /** @description Token the organization publishes in DNS to prove control of the from domain. Not a credential - it authorizes nothing and grants no access. */
1721
+ fromDomainVerificationToken?: string;
1722
+ /**
1723
+ * Format: date-time
1724
+ * @description Timestamp at which control of the from domain was last proven. Null while unproven.
1725
+ */
1726
+ fromDomainVerifiedAt?: string | null;
1727
+ /**
1728
+ * Format: date-time
1729
+ * @description Timestamp of the last message this server accepted.
1730
+ */
1731
+ lastSuccessAt?: string | null;
1732
+ /**
1733
+ * Format: date-time
1734
+ * @description Timestamp of the last delivery attempt this server rejected or failed to accept.
1735
+ */
1736
+ lastFailureAt?: string | null;
1737
+ /**
1738
+ * @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.
1739
+ * @enum {string}
1740
+ */
1741
+ lastFailureReason?: "blocked_target" | "connect_refused" | "connect_timeout" | "tls_failed" | "starttls_unsupported" | "auth_rejected" | "relay_rejected_sender" | "relay_rejected_recipient" | "delivery_failed" | "credential_unreadable";
1742
+ /**
1743
+ * @description Delivery failures since the last success. Drives the circuit that stops dialling a persistently unreachable server.
1744
+ * @default 0
1745
+ */
1746
+ consecutiveFailures: number;
1747
+ /**
1748
+ * Format: uuid
1749
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
1750
+ */
1751
+ createdBy?: string | null;
1752
+ /**
1753
+ * Format: date-time
1754
+ * @description Timestamp when the configuration was created.
1755
+ */
1756
+ createdAt: string;
1757
+ /**
1758
+ * Format: date-time
1759
+ * @description Timestamp when the configuration was last changed.
1760
+ */
1761
+ updatedAt: string;
1762
+ /**
1763
+ * Format: date-time
1764
+ * @description Timestamp when the configuration was soft deleted. Null while it remains active.
1765
+ */
1766
+ deletedAt?: string | null;
1767
+ };
1768
+ };
1769
+ };
1770
+ /** @description Invalid request body or request param */
1771
+ 400: {
1772
+ headers: {
1773
+ [name: string]: unknown;
1774
+ };
1775
+ content: {
1776
+ "text/plain": string;
1777
+ };
1778
+ };
1779
+ /** @description Expired JWT token used or insufficient privilege */
1780
+ 401: {
1781
+ headers: {
1782
+ [name: string]: unknown;
1783
+ };
1784
+ content: {
1785
+ "text/plain": string;
1786
+ };
1787
+ };
1788
+ /** @description Caller lacks the permission key required for this organization */
1789
+ 403: {
1790
+ headers: {
1791
+ [name: string]: unknown;
1792
+ };
1793
+ content: {
1794
+ "text/plain": string;
1795
+ };
1796
+ };
1797
+ /** @description Result not found */
1798
+ 404: {
1799
+ headers: {
1800
+ [name: string]: unknown;
1801
+ };
1802
+ content: {
1803
+ "text/plain": string;
1804
+ };
1805
+ };
1806
+ /** @description The configuration already exists, or the requested state transition is refused in the configuration's current state */
1807
+ 409: {
913
1808
  headers: {
914
1809
  [name: string]: unknown;
915
1810
  };