@remit/api-openapi-types 0.0.7 → 0.0.9

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 +308 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/api-openapi-types",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "type": "module",
5
5
  "main": "types.d.ts",
6
6
  "types": "types.d.ts",
package/types.d.ts CHANGED
@@ -13,6 +13,46 @@ declare namespace Components {
13
13
  * Lifecycle state of an account export request
14
14
  */
15
15
  export type AccountExportState = "Pending" | "Processing" | "Ready" | "Failed";
16
+ /**
17
+ * The fixed anchor set of canonical mailbox roles a user appoints to a folder (RFC 032 exclusive-folder-appointment, issue #976). Mirrors the IMAP SPECIAL-USE roles (RFC 6154). Each role resolves to at most one mailbox per account — see FolderAppointment.
18
+ */
19
+ export type CanonicalMailboxRole = "Inbox" | "Drafts" | "Sent" | "Archive" | "Junk" | "Trash" | "All" | "Flagged";
20
+ /**
21
+ * The pipeline step that refused a quarantined message.
22
+
23
+ One member, and it is behind a real narrowing rather than a promise of one:
24
+ the body parse has its own try block around the parse call and nothing else,
25
+ so an error out of it can only be the message. S3, queue and database
26
+ failures propagate and never become a record here — quarantining one would
27
+ set a message aside for an outage, tell the user it was unreadable, and
28
+ invite a public GitHub issue about it.
29
+
30
+ A message that arrives with no ENVELOPE is deliberately NOT a member. Nothing
31
+ can tell that apart from the FETCH row glitching (#408), and the IMAP client
32
+ is far more often the cause than the message; the sync path holds its cursor
33
+ and retries instead, so a transient glitch heals and a persistent one trips
34
+ the stalled-cursor alert.
35
+ */
36
+ export type QuarantineFailureStage = "BodyParse";
37
+ /**
38
+ * The specific defect within a stage.
39
+
40
+ Closed rather than free text: this is the one diagnostic that is interpolated
41
+ into the title of an issue filed under the user's own GitHub account, so its
42
+ publishability has to be a property of the type instead of a claim about the
43
+ writer.
44
+
45
+ The vocabulary is total — every quarantine write picks a member, and a defect
46
+ the writer cannot name is `UnreadableBody` rather than an invented code. It
47
+ is deliberately small: the body parser reports its refusals as free text with
48
+ no stable type or code, so a member exists only where the writer can identify
49
+ the defect without reading parser prose. `UnterminatedMultipartBoundary` and
50
+ `TruncatedBody` were provisional members carried by Phase 2 and are gone —
51
+ nothing on the narrowed sync path could produce either, and a member no
52
+ writer can reach is a vocabulary that lies about what the field means.
53
+ `MissingEnvelope` is absent for the same reason: see QuarantineFailureStage.
54
+ */
55
+ export type QuarantineFailureCode = "UnknownCharset" | "UnreadableBody";
16
56
  /**
17
57
  * Lifecycle state of an account configuration
18
58
  */
@@ -29,10 +69,6 @@ declare namespace Components {
29
69
  * Phase of the initial account sync lifecycle
30
70
  */
31
71
  export type SyncPhase = "idle" | "discovering_mailboxes" | "syncing_inbox" | "syncing_others" | "complete" | "error";
32
- /**
33
- * The fixed anchor set of canonical mailbox roles a user appoints to a folder (RFC 032 exclusive-folder-appointment, issue #976). Mirrors the IMAP SPECIAL-USE roles (RFC 6154). Each role resolves to at most one mailbox per account — see FolderAppointment.
34
- */
35
- export type CanonicalMailboxRole = "Inbox" | "Drafts" | "Sent" | "Archive" | "Junk" | "Trash" | "All" | "Flagged";
36
72
  /**
37
73
  * IMAP namespace types per RFC 9051 Section 6.3.10
38
74
  */
@@ -182,8 +218,10 @@ current enum emitter anyway, so the wire contract uses the bare form.
182
218
  */
183
219
  export type MessageFlagPushState = "pending" | "queued" | "processing" | "processed";
184
220
  export type UUID = string;
185
- export type String800 = string;
186
221
  export type String512 = string;
222
+ export type String140 = string;
223
+ export type String64 = string;
224
+ export type String800 = string;
187
225
  export type String32 = string;
188
226
  export type String256 = string;
189
227
  /**
@@ -201,8 +239,6 @@ a compile-time error rather than a value that silently sorts incorrectly.
201
239
  export type SemanticVersion = string;
202
240
  export type String2048 = string;
203
241
  export type String200 = string;
204
- export type String140 = string;
205
- export type String64 = string;
206
242
  export interface CognitoAuthorizer {
207
243
  /**
208
244
  * API key authentication
@@ -452,6 +488,238 @@ a compile-time error rather than a value that silently sorts incorrectly.
452
488
  */
453
489
  errorMessage?: string;
454
490
  }
491
+ /**
492
+ * Everything quarantined for the current user, newest first. The list is small by design — a mailbox with a growing quarantine list is a bug being reported, not a page to paginate.
493
+ */
494
+ export interface QuarantineListResponse {
495
+ /**
496
+ * Quarantined messages, newest first.
497
+ */
498
+ entries: QuarantineResponse[];
499
+ }
500
+ /**
501
+ * A message the sync path could not apply, set aside so the mailbox cursor can
502
+ advance past it (issue #72).
503
+
504
+ Quarantine is a record, not a flag: the failing message was never written, so
505
+ there is no row to mark. The record carries what was quarantined, why, and
506
+ the diagnostics a bug report needs — it is the artifact, not a side effect of
507
+ one.
508
+
509
+ Two stored fields are shown on screen and never travel in a report:
510
+ `mailboxPath` (folder names are the user's own words) and `failureMessage`
511
+ (parser errors quote the input that broke them, and redacting arbitrary
512
+ parser output is not solvable). Nothing else here is message content —
513
+ no body, subject, addresses, attachment names, or Message-ID in the clear.
514
+
515
+ The boundary this entity must not cross: a malformed message is
516
+ quarantinable, an S3, queue or database failure is not. Writing an
517
+ infrastructure failure here would advance the cursor past mail that is fine
518
+ and tell the user it was unreadable.
519
+ */
520
+ export interface Quarantine {
521
+ /**
522
+ * Deterministic v5 identity derived from accountId, mailboxId, uidValidity and uid. Idempotent by construction: the same failing message keys the same row on every retry, so nothing has to check for an existing entry before writing one.
523
+ */
524
+ quarantineId: UUID;
525
+ /**
526
+ * Owning account configuration — the user. Scopes the settings list and the read endpoint.
527
+ */
528
+ accountConfigId: UUID;
529
+ /**
530
+ * Mail account the message arrived on. Part of the quarantineId derivation.
531
+ */
532
+ accountId: UUID;
533
+ /**
534
+ * Mailbox the message arrived in. Part of the quarantineId derivation.
535
+ */
536
+ mailboxId: UUID;
537
+ /**
538
+ * UIDVALIDITY of the mailbox when the message was set aside. A uid means nothing without it — only uidValidity + uid names a message forever (RFC 9051 2.3.1.1), and a mailbox keeps its mailboxId across a bump, so leaving this out would let a stale entry claim the identity of a later, unrelated message and suppress it from a sync round.
539
+ */
540
+ uidValidity: number;
541
+ /**
542
+ * The IMAP uid that was never written. Part of the quarantineId derivation.
543
+ */
544
+ uid: number;
545
+ /**
546
+ * Canonical role of the folder the message arrived in — travels in the report. Absent when the user has appointed no role to that folder, which is the normal state for a plain folder. A sentinel would mean a new member on the shared canonical-role enum, which FolderAppointment would then have to mean something by.
547
+ */
548
+ mailboxRole?: CanonicalMailboxRole;
549
+ /**
550
+ * The user's own folder name. Shown on screen, withheld from the report.
551
+ */
552
+ mailboxPath: String512;
553
+ /**
554
+ * Epoch millis the message was set aside.
555
+ */
556
+ quarantinedAt: number;
557
+ /**
558
+ * Rounds tried before the message was set aside.
559
+ */
560
+ attempts: number;
561
+ /**
562
+ * Pipeline step that refused the message.
563
+ */
564
+ failureStage: QuarantineFailureStage;
565
+ /**
566
+ * The specific defect. Closed vocabulary, because this is what a filed issue quotes.
567
+ */
568
+ failureCode: QuarantineFailureCode;
569
+ /**
570
+ * Parser error text. Shown on screen, never in the report.
571
+ */
572
+ failureMessage: String512;
573
+ /**
574
+ * Dot-numbered part path the failure is attributable to, off ROOT_PART_PATH. Absent when the failure belongs to no single node — every whole-body parse failure today.
575
+ */
576
+ failurePartPath?: String140;
577
+ /**
578
+ * Build of the imap-worker that failed to read the message. Named for the worker, not the app: the record is written by the sync worker, and stamping the client build on a backend parse failure points a maintainer at the wrong commit.
579
+ */
580
+ workerVersion: String64;
581
+ /**
582
+ * Top-level Content-Type, `type/subtype` only. Sender-controlled text — escape it wherever it is rendered. Absent together with the other BODYSTRUCTURE-derived fields when the message failed before its structure was read.
583
+ */
584
+ contentType?: String140;
585
+ /**
586
+ * Content-Transfer-Encoding as declared. Sender-controlled text. Absent when there was no BODYSTRUCTURE to read it from.
587
+ */
588
+ transferEncoding?: String64;
589
+ /**
590
+ * Declared charset. Sender-controlled text. Absent is meaningful: an undeclared charset is a cause in its own right, distinct from a charset nobody recognises.
591
+ */
592
+ charset?: String64;
593
+ /**
594
+ * RFC822.SIZE. Separates "too large" from "malformed". Absent when the FETCH that failed carried no size.
595
+ */
596
+ sizeBytes?: number;
597
+ /**
598
+ * The MIME tree, structure only, as a pre-order walk. The one field here that cannot be a column, because it is a tree; every other message-shape field is flat and stays typed. Empty when the message failed before its BODYSTRUCTURE was read.
599
+ */
600
+ structure: QuarantineMimeNode[];
601
+ /**
602
+ * SHA-256 of the Message-ID, `sha256:` prefixed. Pinned to one algorithm: correlating two reports of the same message is the whole point of the field, and two builds hashing differently make it useless. Absent when the message declared no Message-ID — a hash of the empty string would make every such message correlate with every other, which is worse than no value at all.
603
+ */
604
+ messageIdHash?: String140;
605
+ createdAt: number;
606
+ updatedAt: number;
607
+ }
608
+ /**
609
+ * One node of a quarantined message's MIME tree, in a pre-order walk.
610
+
611
+ The tree is carried flat with an explicit `depth` rather than as nested
612
+ children: a self-referential model is not expressible here (the entity
613
+ emitter recurses forever on one), and the tree is only ever rendered as an
614
+ indented list, which a pre-order walk reproduces exactly. Nothing caps the
615
+ walk — it is as long as the message has parts.
616
+
617
+ `contentType` is `type/subtype` only. BODYSTRUCTURE hands the type and its
618
+ parameters over separately, so a node is built from `type`/`subtype` and
619
+ never from a raw content-type line — parameters carry `name=` and
620
+ `filename=`, which name the user's attachments.
621
+ */
622
+ export interface QuarantineMimeNode {
623
+ /**
624
+ * Nesting level, 0 for the root part.
625
+ */
626
+ depth: number;
627
+ /**
628
+ * Media type of this node, `type/subtype`, parameters stripped.
629
+ */
630
+ contentType: String140;
631
+ }
632
+ /**
633
+ * One quarantined message as the settings surface sees it.
634
+ */
635
+ export interface QuarantineResponse {
636
+ /**
637
+ * Deterministic v5 identity derived from accountId, mailboxId, uidValidity and uid. Idempotent by construction: the same failing message keys the same row on every retry, so nothing has to check for an existing entry before writing one.
638
+ */
639
+ quarantineId: UUID;
640
+ /**
641
+ * Owning account configuration — the user. Scopes the settings list and the read endpoint.
642
+ */
643
+ accountConfigId: UUID;
644
+ /**
645
+ * Mail account the message arrived on. Part of the quarantineId derivation.
646
+ */
647
+ accountId: UUID;
648
+ /**
649
+ * Mailbox the message arrived in. Part of the quarantineId derivation.
650
+ */
651
+ mailboxId: UUID;
652
+ /**
653
+ * UIDVALIDITY of the mailbox when the message was set aside. A uid means nothing without it — only uidValidity + uid names a message forever (RFC 9051 2.3.1.1), and a mailbox keeps its mailboxId across a bump, so leaving this out would let a stale entry claim the identity of a later, unrelated message and suppress it from a sync round.
654
+ */
655
+ uidValidity: number;
656
+ /**
657
+ * The IMAP uid that was never written. Part of the quarantineId derivation.
658
+ */
659
+ uid: number;
660
+ /**
661
+ * Canonical role of the folder the message arrived in — travels in the report. Absent when the user has appointed no role to that folder, which is the normal state for a plain folder. A sentinel would mean a new member on the shared canonical-role enum, which FolderAppointment would then have to mean something by.
662
+ */
663
+ mailboxRole?: CanonicalMailboxRole;
664
+ /**
665
+ * The user's own folder name. Shown on screen, withheld from the report.
666
+ */
667
+ mailboxPath: String512;
668
+ /**
669
+ * Epoch millis the message was set aside.
670
+ */
671
+ quarantinedAt: number;
672
+ /**
673
+ * Rounds tried before the message was set aside.
674
+ */
675
+ attempts: number;
676
+ /**
677
+ * Pipeline step that refused the message.
678
+ */
679
+ failureStage: QuarantineFailureStage;
680
+ /**
681
+ * The specific defect. Closed vocabulary, because this is what a filed issue quotes.
682
+ */
683
+ failureCode: QuarantineFailureCode;
684
+ /**
685
+ * Parser error text. Shown on screen, never in the report.
686
+ */
687
+ failureMessage: String512;
688
+ /**
689
+ * Dot-numbered part path the failure is attributable to, off ROOT_PART_PATH. Absent when the failure belongs to no single node — every whole-body parse failure today.
690
+ */
691
+ failurePartPath?: String140;
692
+ /**
693
+ * Build of the imap-worker that failed to read the message. Named for the worker, not the app: the record is written by the sync worker, and stamping the client build on a backend parse failure points a maintainer at the wrong commit.
694
+ */
695
+ workerVersion: String64;
696
+ /**
697
+ * Top-level Content-Type, `type/subtype` only. Sender-controlled text — escape it wherever it is rendered. Absent together with the other BODYSTRUCTURE-derived fields when the message failed before its structure was read.
698
+ */
699
+ contentType?: String140;
700
+ /**
701
+ * Content-Transfer-Encoding as declared. Sender-controlled text. Absent when there was no BODYSTRUCTURE to read it from.
702
+ */
703
+ transferEncoding?: String64;
704
+ /**
705
+ * Declared charset. Sender-controlled text. Absent is meaningful: an undeclared charset is a cause in its own right, distinct from a charset nobody recognises.
706
+ */
707
+ charset?: String64;
708
+ /**
709
+ * RFC822.SIZE. Separates "too large" from "malformed". Absent when the FETCH that failed carried no size.
710
+ */
711
+ sizeBytes?: number;
712
+ /**
713
+ * The MIME tree, structure only, as a pre-order walk. The one field here that cannot be a column, because it is a tree; every other message-shape field is flat and stays typed. Empty when the message failed before its BODYSTRUCTURE was read.
714
+ */
715
+ structure: QuarantineMimeNode[];
716
+ /**
717
+ * SHA-256 of the Message-ID, `sha256:` prefixed. Pinned to one algorithm: correlating two reports of the same message is the whole point of the field, and two builds hashing differently make it useless. Absent when the message declared no Message-ID — a hash of the empty string would make every such message correlate with every other, which is worse than no value at all.
718
+ */
719
+ messageIdHash?: String140;
720
+ createdAt: number;
721
+ updatedAt: number;
722
+ }
455
723
  /**
456
724
  * Full configuration description including accounts
457
725
  */
@@ -3772,6 +4040,11 @@ declare namespace Paths {
3772
4040
  export type $200 = void;
3773
4041
  }
3774
4042
  }
4043
+ namespace ListQuarantine {
4044
+ namespace Responses {
4045
+ export type $200 = void;
4046
+ }
4047
+ }
3775
4048
  namespace GetConfig {
3776
4049
  namespace Responses {
3777
4050
  export type $200 = void;
@@ -4200,6 +4473,14 @@ export interface OperationMethods {
4200
4473
  data?: any,
4201
4474
  config?: AxiosRequestConfig
4202
4475
  ): OperationResponse<Paths.GetExport.Responses.$200>;
4476
+ /**
4477
+ * listQuarantine - List every message the sync path could not read, for the current user across all of their mail accounts (issue #72). Backs the quarantine section in settings. Unpaginated: the list is small by design, and an entry is a defect waiting to be reported rather than a page of mail.
4478
+ */
4479
+ 'listQuarantine'(
4480
+ parameters?: Parameters<UnknownParamsObject> | null,
4481
+ data?: any,
4482
+ config?: AxiosRequestConfig
4483
+ ): OperationResponse<Paths.ListQuarantine.Responses.$200>;
4203
4484
  /**
4204
4485
  * getConfig - Get the current user's configuration including accounts and addresses
4205
4486
  */
@@ -4619,6 +4900,16 @@ export interface PathsDictionary {
4619
4900
  config?: AxiosRequestConfig
4620
4901
  ): OperationResponse<Paths.GetExport.Responses.$200>;
4621
4902
  };
4903
+ ['/me/quarantine']: {
4904
+ /**
4905
+ * listQuarantine - List every message the sync path could not read, for the current user across all of their mail accounts (issue #72). Backs the quarantine section in settings. Unpaginated: the list is small by design, and an entry is a defect waiting to be reported rather than a page of mail.
4906
+ */
4907
+ 'get'(
4908
+ parameters?: Parameters<UnknownParamsObject> | null,
4909
+ data?: any,
4910
+ config?: AxiosRequestConfig
4911
+ ): OperationResponse<Paths.ListQuarantine.Responses.$200>;
4912
+ };
4622
4913
  ['/config']: {
4623
4914
  /**
4624
4915
  * getConfig - Get the current user's configuration including accounts and addresses
@@ -5084,6 +5375,10 @@ export type VipSuggestionEntry = Components.Schemas.VipSuggestionEntry;
5084
5375
  export type CreateExportResponse = Components.Schemas.CreateExportResponse;
5085
5376
  export type AccountExportRequest = Components.Schemas.AccountExportRequest;
5086
5377
  export type AccountExportRequestResponse = Components.Schemas.AccountExportRequestResponse;
5378
+ export type QuarantineListResponse = Components.Schemas.QuarantineListResponse;
5379
+ export type Quarantine = Components.Schemas.Quarantine;
5380
+ export type QuarantineMimeNode = Components.Schemas.QuarantineMimeNode;
5381
+ export type QuarantineResponse = Components.Schemas.QuarantineResponse;
5087
5382
  export type ConfigDescriptionResponse = Components.Schemas.ConfigDescriptionResponse;
5088
5383
  export type AccountConfig = Components.Schemas.AccountConfig;
5089
5384
  export type AccountConfigResponse = Components.Schemas.AccountConfigResponse;
@@ -5186,11 +5481,13 @@ export type MicrosoftOAuthStartRequest = Components.Schemas.MicrosoftOAuthStartR
5186
5481
  export type MicrosoftOAuthStartResponse = Components.Schemas.MicrosoftOAuthStartResponse;
5187
5482
  export type IndexType = Components.Schemas.IndexType;
5188
5483
  export type AccountExportState = Components.Schemas.AccountExportState;
5484
+ export type CanonicalMailboxRole = Components.Schemas.CanonicalMailboxRole;
5485
+ export type QuarantineFailureStage = Components.Schemas.QuarantineFailureStage;
5486
+ export type QuarantineFailureCode = Components.Schemas.QuarantineFailureCode;
5189
5487
  export type AccountConfigState = Components.Schemas.AccountConfigState;
5190
5488
  export type AccountAuthType = Components.Schemas.AccountAuthType;
5191
5489
  export type ConnectionState = Components.Schemas.ConnectionState;
5192
5490
  export type SyncPhase = Components.Schemas.SyncPhase;
5193
- export type CanonicalMailboxRole = Components.Schemas.CanonicalMailboxRole;
5194
5491
  export type NamespaceType = Components.Schemas.NamespaceType;
5195
5492
  export type MailboxSyncStatus = Components.Schemas.MailboxSyncStatus;
5196
5493
  export type MailboxCursorState = Components.Schemas.MailboxCursorState;
@@ -5228,12 +5525,12 @@ export type MessagePlacementMoveState = Components.Schemas.MessagePlacementMoveS
5228
5525
  export type FlagPushOperation = Components.Schemas.FlagPushOperation;
5229
5526
  export type MessageFlagPushState = Components.Schemas.MessageFlagPushState;
5230
5527
  export type UUID = Components.Schemas.UUID;
5231
- export type String800 = Components.Schemas.String800;
5232
5528
  export type String512 = Components.Schemas.String512;
5529
+ export type String140 = Components.Schemas.String140;
5530
+ export type String64 = Components.Schemas.String64;
5531
+ export type String800 = Components.Schemas.String800;
5233
5532
  export type String32 = Components.Schemas.String32;
5234
5533
  export type String256 = Components.Schemas.String256;
5235
5534
  export type SemanticVersion = Components.Schemas.SemanticVersion;
5236
5535
  export type String2048 = Components.Schemas.String2048;
5237
5536
  export type String200 = Components.Schemas.String200;
5238
- export type String140 = Components.Schemas.String140;
5239
- export type String64 = Components.Schemas.String64;