@remit/api-openapi-types 0.0.7 → 0.0.8

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 +293 -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.8",
4
4
  "type": "module",
5
5
  "main": "types.d.ts",
6
6
  "types": "types.d.ts",
package/types.d.ts CHANGED
@@ -13,6 +13,31 @@ 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. No catch site on the sync path can currently tell a parse failure
24
+ from an infrastructure failure: the per-message frame in `body-sync.ts` wraps
25
+ the S3 body write, the parsed-body cache write, the body-part upserts, the
26
+ placement move and the label and counter writes alongside the `simpleParser`
27
+ call, and filters only connection drops out of it. A stage is added when a
28
+ try block is narrowed far enough to attribute it, never ahead of that — an
29
+ enum member that reached stored rows cannot be walked back.
30
+ */
31
+ export type QuarantineFailureStage = "BodyParse";
32
+ /**
33
+ * The specific defect within a stage.
34
+
35
+ Closed rather than free text: this is the one diagnostic that is interpolated
36
+ into the title of an issue filed under the user's own GitHub account, so its
37
+ publishability has to be a property of the type instead of a claim about the
38
+ writer. Grows with the same narrowing that grows QuarantineFailureStage.
39
+ */
40
+ export type QuarantineFailureCode = "UnterminatedMultipartBoundary" | "UnknownCharset" | "TruncatedBody";
16
41
  /**
17
42
  * Lifecycle state of an account configuration
18
43
  */
@@ -29,10 +54,6 @@ declare namespace Components {
29
54
  * Phase of the initial account sync lifecycle
30
55
  */
31
56
  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
57
  /**
37
58
  * IMAP namespace types per RFC 9051 Section 6.3.10
38
59
  */
@@ -182,8 +203,10 @@ current enum emitter anyway, so the wire contract uses the bare form.
182
203
  */
183
204
  export type MessageFlagPushState = "pending" | "queued" | "processing" | "processed";
184
205
  export type UUID = string;
185
- export type String800 = string;
186
206
  export type String512 = string;
207
+ export type String140 = string;
208
+ export type String64 = string;
209
+ export type String800 = string;
187
210
  export type String32 = string;
188
211
  export type String256 = string;
189
212
  /**
@@ -201,8 +224,6 @@ a compile-time error rather than a value that silently sorts incorrectly.
201
224
  export type SemanticVersion = string;
202
225
  export type String2048 = string;
203
226
  export type String200 = string;
204
- export type String140 = string;
205
- export type String64 = string;
206
227
  export interface CognitoAuthorizer {
207
228
  /**
208
229
  * API key authentication
@@ -452,6 +473,238 @@ a compile-time error rather than a value that silently sorts incorrectly.
452
473
  */
453
474
  errorMessage?: string;
454
475
  }
476
+ /**
477
+ * 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.
478
+ */
479
+ export interface QuarantineListResponse {
480
+ /**
481
+ * Quarantined messages, newest first.
482
+ */
483
+ entries: QuarantineResponse[];
484
+ }
485
+ /**
486
+ * A message the sync path could not apply, set aside so the mailbox cursor can
487
+ advance past it (issue #72).
488
+
489
+ Quarantine is a record, not a flag: the failing message was never written, so
490
+ there is no row to mark. The record carries what was quarantined, why, and
491
+ the diagnostics a bug report needs — it is the artifact, not a side effect of
492
+ one.
493
+
494
+ Two stored fields are shown on screen and never travel in a report:
495
+ `mailboxPath` (folder names are the user's own words) and `failureMessage`
496
+ (parser errors quote the input that broke them, and redacting arbitrary
497
+ parser output is not solvable). Nothing else here is message content —
498
+ no body, subject, addresses, attachment names, or Message-ID in the clear.
499
+
500
+ The boundary this entity must not cross: a malformed message is
501
+ quarantinable, an S3, queue or database failure is not. Writing an
502
+ infrastructure failure here would advance the cursor past mail that is fine
503
+ and tell the user it was unreadable.
504
+ */
505
+ export interface Quarantine {
506
+ /**
507
+ * 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.
508
+ */
509
+ quarantineId: UUID;
510
+ /**
511
+ * Owning account configuration — the user. Scopes the settings list and the read endpoint.
512
+ */
513
+ accountConfigId: UUID;
514
+ /**
515
+ * Mail account the message arrived on. Part of the quarantineId derivation.
516
+ */
517
+ accountId: UUID;
518
+ /**
519
+ * Mailbox the message arrived in. Part of the quarantineId derivation.
520
+ */
521
+ mailboxId: UUID;
522
+ /**
523
+ * 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.
524
+ */
525
+ uidValidity: number;
526
+ /**
527
+ * The IMAP uid that was never written. Part of the quarantineId derivation.
528
+ */
529
+ uid: number;
530
+ /**
531
+ * 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.
532
+ */
533
+ mailboxRole?: CanonicalMailboxRole;
534
+ /**
535
+ * The user's own folder name. Shown on screen, withheld from the report.
536
+ */
537
+ mailboxPath: String512;
538
+ /**
539
+ * Epoch millis the message was set aside.
540
+ */
541
+ quarantinedAt: number;
542
+ /**
543
+ * Rounds tried before the message was set aside.
544
+ */
545
+ attempts: number;
546
+ /**
547
+ * Pipeline step that refused the message.
548
+ */
549
+ failureStage: QuarantineFailureStage;
550
+ /**
551
+ * The specific defect. Closed vocabulary, because this is what a filed issue quotes.
552
+ */
553
+ failureCode: QuarantineFailureCode;
554
+ /**
555
+ * Parser error text. Shown on screen, never in the report.
556
+ */
557
+ failureMessage: String512;
558
+ /**
559
+ * 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.
560
+ */
561
+ failurePartPath?: String140;
562
+ /**
563
+ * 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.
564
+ */
565
+ workerVersion: String64;
566
+ /**
567
+ * 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.
568
+ */
569
+ contentType?: String140;
570
+ /**
571
+ * Content-Transfer-Encoding as declared. Sender-controlled text. Absent when there was no BODYSTRUCTURE to read it from.
572
+ */
573
+ transferEncoding?: String64;
574
+ /**
575
+ * Declared charset. Sender-controlled text. Absent is meaningful: an undeclared charset is a cause in its own right, distinct from a charset nobody recognises.
576
+ */
577
+ charset?: String64;
578
+ /**
579
+ * RFC822.SIZE. Separates "too large" from "malformed". Absent when the FETCH that failed carried no size.
580
+ */
581
+ sizeBytes?: number;
582
+ /**
583
+ * 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.
584
+ */
585
+ structure: QuarantineMimeNode[];
586
+ /**
587
+ * 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.
588
+ */
589
+ messageIdHash?: String140;
590
+ createdAt: number;
591
+ updatedAt: number;
592
+ }
593
+ /**
594
+ * One node of a quarantined message's MIME tree, in a pre-order walk.
595
+
596
+ The tree is carried flat with an explicit `depth` rather than as nested
597
+ children: a self-referential model is not expressible here (the entity
598
+ emitter recurses forever on one), and the tree is only ever rendered as an
599
+ indented list, which a pre-order walk reproduces exactly. Nothing caps the
600
+ walk — it is as long as the message has parts.
601
+
602
+ `contentType` is `type/subtype` only. BODYSTRUCTURE hands the type and its
603
+ parameters over separately, so a node is built from `type`/`subtype` and
604
+ never from a raw content-type line — parameters carry `name=` and
605
+ `filename=`, which name the user's attachments.
606
+ */
607
+ export interface QuarantineMimeNode {
608
+ /**
609
+ * Nesting level, 0 for the root part.
610
+ */
611
+ depth: number;
612
+ /**
613
+ * Media type of this node, `type/subtype`, parameters stripped.
614
+ */
615
+ contentType: String140;
616
+ }
617
+ /**
618
+ * One quarantined message as the settings surface sees it.
619
+ */
620
+ export interface QuarantineResponse {
621
+ /**
622
+ * 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.
623
+ */
624
+ quarantineId: UUID;
625
+ /**
626
+ * Owning account configuration — the user. Scopes the settings list and the read endpoint.
627
+ */
628
+ accountConfigId: UUID;
629
+ /**
630
+ * Mail account the message arrived on. Part of the quarantineId derivation.
631
+ */
632
+ accountId: UUID;
633
+ /**
634
+ * Mailbox the message arrived in. Part of the quarantineId derivation.
635
+ */
636
+ mailboxId: UUID;
637
+ /**
638
+ * 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.
639
+ */
640
+ uidValidity: number;
641
+ /**
642
+ * The IMAP uid that was never written. Part of the quarantineId derivation.
643
+ */
644
+ uid: number;
645
+ /**
646
+ * 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.
647
+ */
648
+ mailboxRole?: CanonicalMailboxRole;
649
+ /**
650
+ * The user's own folder name. Shown on screen, withheld from the report.
651
+ */
652
+ mailboxPath: String512;
653
+ /**
654
+ * Epoch millis the message was set aside.
655
+ */
656
+ quarantinedAt: number;
657
+ /**
658
+ * Rounds tried before the message was set aside.
659
+ */
660
+ attempts: number;
661
+ /**
662
+ * Pipeline step that refused the message.
663
+ */
664
+ failureStage: QuarantineFailureStage;
665
+ /**
666
+ * The specific defect. Closed vocabulary, because this is what a filed issue quotes.
667
+ */
668
+ failureCode: QuarantineFailureCode;
669
+ /**
670
+ * Parser error text. Shown on screen, never in the report.
671
+ */
672
+ failureMessage: String512;
673
+ /**
674
+ * 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.
675
+ */
676
+ failurePartPath?: String140;
677
+ /**
678
+ * 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.
679
+ */
680
+ workerVersion: String64;
681
+ /**
682
+ * 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.
683
+ */
684
+ contentType?: String140;
685
+ /**
686
+ * Content-Transfer-Encoding as declared. Sender-controlled text. Absent when there was no BODYSTRUCTURE to read it from.
687
+ */
688
+ transferEncoding?: String64;
689
+ /**
690
+ * Declared charset. Sender-controlled text. Absent is meaningful: an undeclared charset is a cause in its own right, distinct from a charset nobody recognises.
691
+ */
692
+ charset?: String64;
693
+ /**
694
+ * RFC822.SIZE. Separates "too large" from "malformed". Absent when the FETCH that failed carried no size.
695
+ */
696
+ sizeBytes?: number;
697
+ /**
698
+ * 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.
699
+ */
700
+ structure: QuarantineMimeNode[];
701
+ /**
702
+ * 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.
703
+ */
704
+ messageIdHash?: String140;
705
+ createdAt: number;
706
+ updatedAt: number;
707
+ }
455
708
  /**
456
709
  * Full configuration description including accounts
457
710
  */
@@ -3772,6 +4025,11 @@ declare namespace Paths {
3772
4025
  export type $200 = void;
3773
4026
  }
3774
4027
  }
4028
+ namespace ListQuarantine {
4029
+ namespace Responses {
4030
+ export type $200 = void;
4031
+ }
4032
+ }
3775
4033
  namespace GetConfig {
3776
4034
  namespace Responses {
3777
4035
  export type $200 = void;
@@ -4200,6 +4458,14 @@ export interface OperationMethods {
4200
4458
  data?: any,
4201
4459
  config?: AxiosRequestConfig
4202
4460
  ): OperationResponse<Paths.GetExport.Responses.$200>;
4461
+ /**
4462
+ * 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.
4463
+ */
4464
+ 'listQuarantine'(
4465
+ parameters?: Parameters<UnknownParamsObject> | null,
4466
+ data?: any,
4467
+ config?: AxiosRequestConfig
4468
+ ): OperationResponse<Paths.ListQuarantine.Responses.$200>;
4203
4469
  /**
4204
4470
  * getConfig - Get the current user's configuration including accounts and addresses
4205
4471
  */
@@ -4619,6 +4885,16 @@ export interface PathsDictionary {
4619
4885
  config?: AxiosRequestConfig
4620
4886
  ): OperationResponse<Paths.GetExport.Responses.$200>;
4621
4887
  };
4888
+ ['/me/quarantine']: {
4889
+ /**
4890
+ * 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.
4891
+ */
4892
+ 'get'(
4893
+ parameters?: Parameters<UnknownParamsObject> | null,
4894
+ data?: any,
4895
+ config?: AxiosRequestConfig
4896
+ ): OperationResponse<Paths.ListQuarantine.Responses.$200>;
4897
+ };
4622
4898
  ['/config']: {
4623
4899
  /**
4624
4900
  * getConfig - Get the current user's configuration including accounts and addresses
@@ -5084,6 +5360,10 @@ export type VipSuggestionEntry = Components.Schemas.VipSuggestionEntry;
5084
5360
  export type CreateExportResponse = Components.Schemas.CreateExportResponse;
5085
5361
  export type AccountExportRequest = Components.Schemas.AccountExportRequest;
5086
5362
  export type AccountExportRequestResponse = Components.Schemas.AccountExportRequestResponse;
5363
+ export type QuarantineListResponse = Components.Schemas.QuarantineListResponse;
5364
+ export type Quarantine = Components.Schemas.Quarantine;
5365
+ export type QuarantineMimeNode = Components.Schemas.QuarantineMimeNode;
5366
+ export type QuarantineResponse = Components.Schemas.QuarantineResponse;
5087
5367
  export type ConfigDescriptionResponse = Components.Schemas.ConfigDescriptionResponse;
5088
5368
  export type AccountConfig = Components.Schemas.AccountConfig;
5089
5369
  export type AccountConfigResponse = Components.Schemas.AccountConfigResponse;
@@ -5186,11 +5466,13 @@ export type MicrosoftOAuthStartRequest = Components.Schemas.MicrosoftOAuthStartR
5186
5466
  export type MicrosoftOAuthStartResponse = Components.Schemas.MicrosoftOAuthStartResponse;
5187
5467
  export type IndexType = Components.Schemas.IndexType;
5188
5468
  export type AccountExportState = Components.Schemas.AccountExportState;
5469
+ export type CanonicalMailboxRole = Components.Schemas.CanonicalMailboxRole;
5470
+ export type QuarantineFailureStage = Components.Schemas.QuarantineFailureStage;
5471
+ export type QuarantineFailureCode = Components.Schemas.QuarantineFailureCode;
5189
5472
  export type AccountConfigState = Components.Schemas.AccountConfigState;
5190
5473
  export type AccountAuthType = Components.Schemas.AccountAuthType;
5191
5474
  export type ConnectionState = Components.Schemas.ConnectionState;
5192
5475
  export type SyncPhase = Components.Schemas.SyncPhase;
5193
- export type CanonicalMailboxRole = Components.Schemas.CanonicalMailboxRole;
5194
5476
  export type NamespaceType = Components.Schemas.NamespaceType;
5195
5477
  export type MailboxSyncStatus = Components.Schemas.MailboxSyncStatus;
5196
5478
  export type MailboxCursorState = Components.Schemas.MailboxCursorState;
@@ -5228,12 +5510,12 @@ export type MessagePlacementMoveState = Components.Schemas.MessagePlacementMoveS
5228
5510
  export type FlagPushOperation = Components.Schemas.FlagPushOperation;
5229
5511
  export type MessageFlagPushState = Components.Schemas.MessageFlagPushState;
5230
5512
  export type UUID = Components.Schemas.UUID;
5231
- export type String800 = Components.Schemas.String800;
5232
5513
  export type String512 = Components.Schemas.String512;
5514
+ export type String140 = Components.Schemas.String140;
5515
+ export type String64 = Components.Schemas.String64;
5516
+ export type String800 = Components.Schemas.String800;
5233
5517
  export type String32 = Components.Schemas.String32;
5234
5518
  export type String256 = Components.Schemas.String256;
5235
5519
  export type SemanticVersion = Components.Schemas.SemanticVersion;
5236
5520
  export type String2048 = Components.Schemas.String2048;
5237
5521
  export type String200 = Components.Schemas.String200;
5238
- export type String140 = Components.Schemas.String140;
5239
- export type String64 = Components.Schemas.String64;