@remit/api-openapi-types 0.0.38 → 0.0.40

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types.d.ts +290 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/api-openapi-types",
3
- "version": "0.0.38",
3
+ "version": "0.0.40",
4
4
  "type": "module",
5
5
  "main": "types.d.ts",
6
6
  "types": "types.d.ts",
package/types.d.ts CHANGED
@@ -64,7 +64,7 @@ writer can reach is a vocabulary that lies about what the field means.
64
64
  /**
65
65
  * IMAP connection states per RFC 9051 Section 3
66
66
  */
67
- export type ConnectionState = "not_authenticated" | "authenticated" | "selected" | "logout" | "reauth_required";
67
+ export type ConnectionState = "not_authenticated" | "authenticated" | "selected" | "logout" | "reauth_required" | "credentials_missing";
68
68
  /**
69
69
  * Phase of the initial account sync lifecycle
70
70
  */
@@ -73,6 +73,14 @@ writer can reach is a vocabulary that lies about what the field means.
73
73
  * Where a resolved FolderAppointment came from. Total and required: every role carries one, so a surface can tell a folder somebody chose from a folder reader guessed without inferring it from which fields happen to be present.
74
74
  */
75
75
  export type FolderAppointmentSource = "Appointed" | "Flagged" | "Reserved" | "Proposed" | "Stale" | "None";
76
+ /**
77
+ * Whether an import writes. The default is the dry run, so the wizard can show what a file would do before anything lands.
78
+ */
79
+ export type ConfigImportMode = "validate" | "apply";
80
+ /**
81
+ * What an import does when the configuration it is importing into is not empty.
82
+ */
83
+ export type ConfigImportOnExisting = "abort" | "merge";
76
84
  /**
77
85
  * Outcome of the most recent manifest check. `ok` when a manifest was fetched and validated, `failed` when it could not be, `disabled` when no manifest URL is configured or no check has ever run (RFC 037 D8).
78
86
  */
@@ -249,6 +257,14 @@ distinguishable from a network failure without parsing prose.
249
257
  * Known user-setting keys. Each maps, in the registry, to a required value kind and a zod schema. New keys are added deliberately by extending this enum and the registry — never as an ad-hoc column.
250
258
  */
251
259
  export type AccountSettingName = "Theme" | "Density" | "DefaultComposerFormat" | "PinnedFolders" | "AccountSignaturePlainText" | "AccountSignatureHtml" | "AccountDisplayName" | "AccountMuted" | "AccountComposeLanguages" | "MailboxDisplayName" | "MailboxMuted" | "FolderRoleAppointment" | "FolderRoleAppointmentLabel" | "MailboxRole";
260
+ /**
261
+ * Lifecycle of one applied configuration import. An import is Complete the moment every folder reference in the file has been bound to a real mailbox; until then it is Pending, waiting on the IMAP discovery that will produce those mailboxes.
262
+ */
263
+ export type ConfigImportState = "Pending" | "Complete";
264
+ /**
265
+ * Which piece of configuration a still-unbound folder reference belongs to. A mailbox id is regenerated by every discovery, so an imported file names folders by IMAP path and the binder writes the row once a path resolves.
266
+ */
267
+ export type ConfigImportRefKind = "FolderRole" | "MailboxOverride" | "FilterAction";
252
268
  /**
253
269
  * Explicit state engine for a pending placement-move marker (issue #1271, epic #1281). Recovery keys off this field, not control-flow inference: a redelivered/retried call drives a marker forward from whichever state it is actually in, rather than re-deriving intent by comparing the message's current location.
254
270
  */
@@ -375,6 +391,48 @@ a compile-time error rather than a value that silently sorts incorrectly.
375
391
  */
376
392
  details?: Record;
377
393
  }
394
+ /**
395
+ * The same flat 409 body, with the two codes this endpoint can answer with.
396
+
397
+ `code: "folder_role_unresolved"` — as everywhere else, with `details` carrying `role`, `accountId` and `reason`.
398
+
399
+ `code: "message_placement_unsettled"` — as `MessagePlacementConflict`, with `details` carrying `accountId`, `messageId` and `reason`.
400
+ */
401
+ export interface DeleteMessagesConflict {
402
+ statusCode: 409;
403
+ /**
404
+ * Error code
405
+ */
406
+ code: string;
407
+ /**
408
+ * Human-readable error message
409
+ */
410
+ message: string;
411
+ /**
412
+ * Additional error details
413
+ */
414
+ details?: Record;
415
+ }
416
+ /**
417
+ * The same flat 409 body, for a message whose folder and uid do not name the same message.
418
+
419
+ `code: "message_placement_unsettled"` — the message is mid-move, so its row names the destination folder while its uid still belongs to the source; acting on that pair would hit whatever the destination holds at that uid. `details` carries `accountId`, `messageId` and `reason`, one of: `in_flight` (the move is still running, and the same request succeeds once it confirms) or `unverified` (the move gave up without confirming, so where the message sits is unknown until the folder is resynced).
420
+ */
421
+ export interface MessagePlacementConflict {
422
+ statusCode: 409;
423
+ /**
424
+ * Error code
425
+ */
426
+ code: string;
427
+ /**
428
+ * Human-readable error message
429
+ */
430
+ message: string;
431
+ /**
432
+ * Additional error details
433
+ */
434
+ details?: Record;
435
+ }
378
436
  export interface AmazonApiGatewayIntegration {
379
437
  type: "aws_proxy";
380
438
  httpMethod: "POST";
@@ -818,6 +876,10 @@ never from a raw content-type line — parameters carry `name=` and
818
876
  * Associated email accounts
819
877
  */
820
878
  accounts: AccountResponse[];
879
+ /**
880
+ * Absent unless a configuration import is still waiting on folders IMAP has not produced yet (#1021). Nothing polls a separate route for it.
881
+ */
882
+ pendingImport?: PendingConfigImport;
821
883
  }
822
884
  /**
823
885
  * Configuration container for user accounts. Groups multiple IMAP accounts under a single user.
@@ -1191,6 +1253,23 @@ never from a raw content-type line — parameters carry `name=` and
1191
1253
  */
1192
1254
  staleAppointmentPath?: String512;
1193
1255
  }
1256
+ /**
1257
+ * An import that is still waiting for IMAP discovery to produce the folders its
1258
+ file named. The folder appointed to a role, a folder's own display name or
1259
+ mute, and a filter's move destination are all bound by path; a path this
1260
+ account does not hold yet is kept, not guessed, and bound the moment discovery
1261
+ finds it.
1262
+ */
1263
+ export interface PendingConfigImport {
1264
+ /**
1265
+ * The import still waiting
1266
+ */
1267
+ importId: UUID;
1268
+ /**
1269
+ * The IMAP paths no mailbox answers to yet, deduplicated
1270
+ */
1271
+ folderPaths: string[];
1272
+ }
1194
1273
  /**
1195
1274
  * A configuration export: one versioned document carrying every user decision this instance holds, and no credential.
1196
1275
  */
@@ -1204,6 +1283,104 @@ never from a raw content-type line — parameters carry `name=` and
1204
1283
  */
1205
1284
  document: Record;
1206
1285
  }
1286
+ /**
1287
+ * Request body for POST /config/import
1288
+ */
1289
+ export interface ImportConfigInput {
1290
+ /**
1291
+ * `validate` writes nothing; `apply` writes.
1292
+ */
1293
+ mode?: ConfigImportMode;
1294
+ /**
1295
+ * What to do when this configuration is not empty.
1296
+ */
1297
+ onExisting?: ConfigImportOnExisting;
1298
+ /**
1299
+ * The config document, as exported.
1300
+ */
1301
+ document: Record;
1302
+ }
1303
+ /**
1304
+ * The outcome of a validate or an apply. A rejected document is an answer, not a failure: `valid` is false and `errors` says why.
1305
+ */
1306
+ export interface ConfigImportReport {
1307
+ /**
1308
+ * Import identity; present on apply, so the folder bindings this import is still waiting on can be named later
1309
+ */
1310
+ importId?: UUID;
1311
+ /**
1312
+ * Whether the document is importable at all
1313
+ */
1314
+ valid: boolean;
1315
+ /**
1316
+ * Schema version of the submitted document
1317
+ */
1318
+ schemaVersion: number;
1319
+ /**
1320
+ * Whether anything was written
1321
+ */
1322
+ applied: boolean;
1323
+ /**
1324
+ * Per-item verdicts
1325
+ */
1326
+ items: ConfigImportItemReport[];
1327
+ /**
1328
+ * Blocking problems; non-empty means nothing was written
1329
+ */
1330
+ errors: ApiError[];
1331
+ /**
1332
+ * Non-blocking notes - e.g. a folder path this account does not hold yet
1333
+ */
1334
+ warnings: ApiError[];
1335
+ /**
1336
+ * Accounts that landed needing a credential before they can sync
1337
+ */
1338
+ accountsNeedingCredentials: UUID[];
1339
+ }
1340
+ /**
1341
+ * What became of one item in the submitted document
1342
+ */
1343
+ export interface ConfigImportItemReport {
1344
+ /**
1345
+ * Which section: accounts | labels | filters | addressFlags | settings
1346
+ */
1347
+ section: string;
1348
+ /**
1349
+ * Human key of the item - an email, a label name, a filter name
1350
+ */
1351
+ key: string;
1352
+ /**
1353
+ * created | updated | unchanged | skipped | rejected
1354
+ */
1355
+ verdict: string;
1356
+ /**
1357
+ * Why, when the verdict is skipped or rejected
1358
+ */
1359
+ reason?: string;
1360
+ }
1361
+ /**
1362
+ * The import was refused because this configuration is not empty. The body is
1363
+ flat: `code`, `message` and `details` sit at the top level.
1364
+
1365
+ `code: "config_not_empty"` — the configuration already holds an account, a
1366
+ label, a filter or an address flag. `details` names how many of each. Re-send
1367
+ with `onExisting: merge` to upsert instead.
1368
+ */
1369
+ export interface ConfigImportConflict {
1370
+ statusCode: 409;
1371
+ /**
1372
+ * Error code
1373
+ */
1374
+ code: string;
1375
+ /**
1376
+ * Human-readable error message
1377
+ */
1378
+ message: string;
1379
+ /**
1380
+ * Additional error details
1381
+ */
1382
+ details?: Record;
1383
+ }
1207
1384
  /**
1208
1385
  * The self-update resource: the running version, the outcome of the most recent manifest check, and the state of the current or last run. One read serves every interface state. The check block and the run block are independent by construction (RFC 037 D7).
1209
1386
  */
@@ -4166,6 +4343,78 @@ either way and cannot tell which it received.
4166
4343
  createdAt: number;
4167
4344
  updatedAt: number;
4168
4345
  }
4346
+ /**
4347
+ * A folder reference an import could not bind yet. Every folder in a
4348
+ configuration file is named by IMAP path, because mailbox ids are regenerated
4349
+ by each discovery, and a fresh database holds no mailboxes at all until IMAP
4350
+ has been read. The reference is recorded rather than dropped or guessed, and
4351
+ the binder writes the row it belongs to once the path resolves.
4352
+ */
4353
+ export interface ConfigImportUnresolvedRef {
4354
+ /**
4355
+ * Which piece of configuration this reference belongs to
4356
+ */
4357
+ kind: ConfigImportRefKind;
4358
+ /**
4359
+ * The account whose folders this path resolves against
4360
+ */
4361
+ accountId: UUID;
4362
+ /**
4363
+ * The IMAP path, as the exporting instance spelled it
4364
+ */
4365
+ folderPath: String512;
4366
+ /**
4367
+ * The role for a folder role, the folder path for a mailbox override, the filter id for a filter's move action
4368
+ */
4369
+ target: String256;
4370
+ }
4371
+ /**
4372
+ * One applied configuration import (#1021). It exists because a file's folder
4373
+ references cannot bind at apply time: IMAP discovery produces the mailboxes,
4374
+ minutes to hours later, and the ids it assigns are new every run.
4375
+
4376
+ The row keeps the document as applied — credential-stripped, like the file
4377
+ itself — so the binder can re-read the payload behind each reference instead
4378
+ of copying it, and so a person can see what was imported after the fact.
4379
+ */
4380
+ export interface ConfigImport {
4381
+ /**
4382
+ * Primary identifier
4383
+ */
4384
+ importId: UUID;
4385
+ /**
4386
+ * The configuration this file was imported into — the caller's own, never the one the file records as its provenance
4387
+ */
4388
+ accountConfigId: UUID;
4389
+ /**
4390
+ * Schema version of the document as applied, after migration
4391
+ */
4392
+ schemaVersion: number;
4393
+ /**
4394
+ * Whether every folder reference has been bound
4395
+ */
4396
+ state: ConfigImportState;
4397
+ /**
4398
+ * The document as applied. Carries no credential, for the same reason the file does not.
4399
+ */
4400
+ document: Record;
4401
+ /**
4402
+ * Folder references still waiting for a mailbox. Emptied by the binder as discovery resolves each path; an empty list is what makes the import Complete.
4403
+ */
4404
+ unresolvedRefs: ConfigImportUnresolvedRef[];
4405
+ /**
4406
+ * Epoch millis when the import was applied
4407
+ */
4408
+ createdAt: number;
4409
+ /**
4410
+ * Epoch millis when the last folder reference was bound; `0` while the import is still Pending
4411
+ */
4412
+ completedAt: number;
4413
+ /**
4414
+ * Epoch millis when the row was last written
4415
+ */
4416
+ updatedAt: number;
4417
+ }
4169
4418
  /**
4170
4419
  * Typed value for a user setting. `kind` discriminates the concrete shape; a registry binds each setting name to the kind it requires.
4171
4420
  */
@@ -4807,6 +5056,14 @@ declare namespace Paths {
4807
5056
  export type $200 = void;
4808
5057
  }
4809
5058
  }
5059
+ namespace ImportConfig {
5060
+ export type RequestBody = Components.Schemas.ImportConfigInput;
5061
+ namespace Responses {
5062
+ export type $200 = void;
5063
+ export type $400 = void;
5064
+ export type $409 = void;
5065
+ }
5066
+ }
4810
5067
  namespace GetSystemUpdate {
4811
5068
  export interface QueryParameters {
4812
5069
  refresh?: boolean;
@@ -5280,6 +5537,7 @@ declare namespace Paths {
5280
5537
  export type RequestBody = Components.Schemas.CopyMessagesInput;
5281
5538
  namespace Responses {
5282
5539
  export type $200 = void;
5540
+ export type $409 = void;
5283
5541
  }
5284
5542
  }
5285
5543
  namespace UpdateMessageLabels {
@@ -5359,6 +5617,14 @@ export interface OperationMethods {
5359
5617
  data?: any,
5360
5618
  config?: AxiosRequestConfig
5361
5619
  ): OperationResponse<Paths.ExportConfig.Responses.$200>;
5620
+ /**
5621
+ * importConfig - Validate, or validate and apply, a config document. `mode: validate` (the default) writes nothing and returns the same report an apply would. `onExisting: abort` (the default) refuses with 409 when this configuration already holds accounts, labels, filters or address flags. Nothing is written until the whole document has validated; a write failure after that aborts the remainder and the report names exactly what landed. Imported accounts arrive inactive with `connectionState: credentials_missing` (or `reauth_required` for OAuth) - the credentials the file deliberately omits are re-entered per account afterwards.
5622
+ */
5623
+ 'importConfig'(
5624
+ parameters?: Parameters<UnknownParamsObject> | null,
5625
+ data?: Paths.ImportConfig.RequestBody,
5626
+ config?: AxiosRequestConfig
5627
+ ): OperationResponse<Paths.ImportConfig.Responses.$200>;
5362
5628
  /**
5363
5629
  * getSystemUpdate - Read the self-update resource: the running version, the outcome of the most recent manifest check, and the state of the current or last run. With `refresh=true`, records a check request on the control volume for the updater to pick up and answers with the stored state as it stands; the caller watches `check.lastCheckedAt` for the updater's answer. Owner-only, and absent (404) unless a manifest URL is configured (RFC 037 D7, D8).
5364
5630
  */
@@ -5896,6 +6162,16 @@ export interface PathsDictionary {
5896
6162
  config?: AxiosRequestConfig
5897
6163
  ): OperationResponse<Paths.ExportConfig.Responses.$200>;
5898
6164
  };
6165
+ ['/config/import']: {
6166
+ /**
6167
+ * importConfig - Validate, or validate and apply, a config document. `mode: validate` (the default) writes nothing and returns the same report an apply would. `onExisting: abort` (the default) refuses with 409 when this configuration already holds accounts, labels, filters or address flags. Nothing is written until the whole document has validated; a write failure after that aborts the remainder and the report names exactly what landed. Imported accounts arrive inactive with `connectionState: credentials_missing` (or `reauth_required` for OAuth) - the credentials the file deliberately omits are re-entered per account afterwards.
6168
+ */
6169
+ 'post'(
6170
+ parameters?: Parameters<UnknownParamsObject> | null,
6171
+ data?: Paths.ImportConfig.RequestBody,
6172
+ config?: AxiosRequestConfig
6173
+ ): OperationResponse<Paths.ImportConfig.Responses.$200>;
6174
+ };
5899
6175
  ['/system/update']: {
5900
6176
  /**
5901
6177
  * getSystemUpdate - Read the self-update resource: the running version, the outcome of the most recent manifest check, and the state of the current or last run. With `refresh=true`, records a check request on the control volume for the updater to pick up and answers with the stored state as it stands; the caller watches `check.lastCheckedAt` for the updater's answer. Owner-only, and absent (404) unless a manifest URL is configured (RFC 037 D7, D8).
@@ -6453,6 +6729,8 @@ export type AccessPattern = Components.Schemas.AccessPattern;
6453
6729
  export type ResultList = Components.Schemas.ResultList;
6454
6730
  export type FolderRoleConflict = Components.Schemas.FolderRoleConflict;
6455
6731
  export type AppointFolderRoleConflict = Components.Schemas.AppointFolderRoleConflict;
6732
+ export type DeleteMessagesConflict = Components.Schemas.DeleteMessagesConflict;
6733
+ export type MessagePlacementConflict = Components.Schemas.MessagePlacementConflict;
6456
6734
  export type AmazonApiGatewayIntegration = Components.Schemas.AmazonApiGatewayIntegration;
6457
6735
  export type NotFoundError = Components.Schemas.NotFoundError;
6458
6736
  export type InternalServerError = Components.Schemas.InternalServerError;
@@ -6477,7 +6755,12 @@ export type AccountResponse = Components.Schemas.AccountResponse;
6477
6755
  export type AddressFlagBase = Components.Schemas.AddressFlagBase;
6478
6756
  export type MutedFlag = Components.Schemas.MutedFlag;
6479
6757
  export type FolderAppointment = Components.Schemas.FolderAppointment;
6758
+ export type PendingConfigImport = Components.Schemas.PendingConfigImport;
6480
6759
  export type ConfigExportResponse = Components.Schemas.ConfigExportResponse;
6760
+ export type ImportConfigInput = Components.Schemas.ImportConfigInput;
6761
+ export type ConfigImportReport = Components.Schemas.ConfigImportReport;
6762
+ export type ConfigImportItemReport = Components.Schemas.ConfigImportItemReport;
6763
+ export type ConfigImportConflict = Components.Schemas.ConfigImportConflict;
6481
6764
  export type SystemUpdateResponse = Components.Schemas.SystemUpdateResponse;
6482
6765
  export type SystemUpdateCheck = Components.Schemas.SystemUpdateCheck;
6483
6766
  export type SystemUpdateRun = Components.Schemas.SystemUpdateRun;
@@ -6566,6 +6849,8 @@ export type UpdateMessageLabelsInput = Components.Schemas.UpdateMessageLabelsInp
6566
6849
  export type SpamReportBulkResult = Components.Schemas.SpamReportBulkResult;
6567
6850
  export type SpamReportFailure = Components.Schemas.SpamReportFailure;
6568
6851
  export type EnvelopeAddress = Components.Schemas.EnvelopeAddress;
6852
+ export type ConfigImportUnresolvedRef = Components.Schemas.ConfigImportUnresolvedRef;
6853
+ export type ConfigImport = Components.Schemas.ConfigImport;
6569
6854
  export type AccountSettingValue = Components.Schemas.AccountSettingValue;
6570
6855
  export type BooleanSetting = Components.Schemas.BooleanSetting;
6571
6856
  export type StringSetting = Components.Schemas.StringSetting;
@@ -6601,6 +6886,8 @@ export type AccountAuthType = Components.Schemas.AccountAuthType;
6601
6886
  export type ConnectionState = Components.Schemas.ConnectionState;
6602
6887
  export type SyncPhase = Components.Schemas.SyncPhase;
6603
6888
  export type FolderAppointmentSource = Components.Schemas.FolderAppointmentSource;
6889
+ export type ConfigImportMode = Components.Schemas.ConfigImportMode;
6890
+ export type ConfigImportOnExisting = Components.Schemas.ConfigImportOnExisting;
6604
6891
  export type SystemUpdateCheckStatus = Components.Schemas.SystemUpdateCheckStatus;
6605
6892
  export type SystemUpdatePhase = Components.Schemas.SystemUpdatePhase;
6606
6893
  export type SystemUpdateOutcome = Components.Schemas.SystemUpdateOutcome;
@@ -6642,6 +6929,8 @@ export type MailboxAttribute = Components.Schemas.MailboxAttribute;
6642
6929
  export type StorageType = Components.Schemas.StorageType;
6643
6930
  export type ContentEncoding = Components.Schemas.ContentEncoding;
6644
6931
  export type AccountSettingName = Components.Schemas.AccountSettingName;
6932
+ export type ConfigImportState = Components.Schemas.ConfigImportState;
6933
+ export type ConfigImportRefKind = Components.Schemas.ConfigImportRefKind;
6645
6934
  export type MessagePlacementMoveState = Components.Schemas.MessagePlacementMoveState;
6646
6935
  export type FlagPushOperation = Components.Schemas.FlagPushOperation;
6647
6936
  export type MessageFlagPushState = Components.Schemas.MessageFlagPushState;