@remit/api-openapi-types 0.0.23 → 0.0.25

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 +115 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/api-openapi-types",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "type": "module",
5
5
  "main": "types.d.ts",
6
6
  "types": "types.d.ts",
package/types.d.ts CHANGED
@@ -141,6 +141,10 @@ current enum emitter anyway, so the wire contract uses the bare form.
141
141
  * Trust level for the From address, derived at read time from AddressFlags + counters.
142
142
  */
143
143
  export type SenderTrust = "unknown" | "wellknown" | "vip";
144
+ /**
145
+ * How the From display name relates to the From domain. `Corresponds` — the name is contained in the domain. `Lookalike` — the name is one or two characters away from a domain label. `Unrelated` — no relation. `NoClaim` — the name is empty or is the address itself, so it claims no identity.
146
+ */
147
+ export type DisplayNameCorrespondence = "Corresponds" | "Lookalike" | "Unrelated" | "NoClaim";
144
148
  /**
145
149
  * Actionable placement verdict — the direction Remit decided to move a message. `leave` is not represented: a left-in-place verdict means the placement sub-model is absent.
146
150
  */
@@ -2451,6 +2455,10 @@ standing to persist.
2451
2455
  * Labels applied to this message — filter-, organize-, and manually-applied alike (issue #26). Absent/empty means no label is applied.
2452
2456
  */
2453
2457
  labels?: LabelSummaryResponse[];
2458
+ /**
2459
+ * Present when the user reported this message as spam and the report has not been undone, projected from the underlying Message row. Backs the "Reported as spam · Undo" affordance in list views.
2460
+ */
2461
+ spamReport?: MessageSpamReport;
2454
2462
  }
2455
2463
  /**
2456
2464
  * Structured sender-authenticity signal, derived from headers at classification time. Absent for messages classified before this field was introduced — clients should treat absence as no-signal.
@@ -2468,6 +2476,14 @@ standing to persist.
2468
2476
  * True when DKIM signing domain(s) are present and none aligns with the From domain
2469
2477
  */
2470
2478
  dkimMismatch: boolean;
2479
+ /**
2480
+ * How the From display name relates to the From domain. Present only for a message the provider's own filter already classified as spam, and only when the sender is not bulk-shaped (no List-Unsubscribe) — absence means the comparison was never made, never that it found nothing.
2481
+ */
2482
+ displayNameCorrespondence?: DisplayNameCorrespondence;
2483
+ /**
2484
+ * Registrable domains (eTLD+1) the body's links point at, excluding the From address's own registrable domain. Present only for a message the provider's own filter already classified as spam; an empty array means every link stayed on the sender's domain, absence means the comparison was never made.
2485
+ */
2486
+ offDomainLinkDomains?: string[];
2471
2487
  }
2472
2488
  /**
2473
2489
  * Present only when Remit auto-moved this message on body-sync. Two shapes share this model: a classifier placement move carries `action` + `fromPlacement` (Inbox/Junk direction); a standing-filter move carries `fromMailboxId` + `destinationMailboxId` + `filterId` (an arbitrary destination folder). Absent means the message was not auto-moved by Remit — clients treat absence as no indicator.
@@ -2502,6 +2518,15 @@ standing to persist.
2502
2518
  name: String140;
2503
2519
  color: LabelColor;
2504
2520
  }
2521
+ /**
2522
+ * Recorded when the user reported this message as spam via `POST /messages/report-spam`. Present means the report stands; absent means never reported, or reported and then undone via `POST /messages/not-spam` (which clears it). Backs the "Reported as spam · Undo" affordance independent of the message's current folder — the underlying move can settle, fail, or no-op (already in Junk) without changing whether the report itself is shown.
2523
+ */
2524
+ export interface MessageSpamReport {
2525
+ /**
2526
+ * Timestamp (epoch millis) the report was made.
2527
+ */
2528
+ reportedAt: number;
2529
+ }
2505
2530
  /**
2506
2531
  * Aggregate response for `searchThreads`. Carries the matching rows (`items`), a
2507
2532
  pagination `continuationToken`, and an optional `count` of every message the
@@ -3228,6 +3253,10 @@ present only when `count=true`. Thread-specific so the shared `ResultList<T>`
3228
3253
  * Body-sync timestamp (epoch millis) the classifier's placement verdict was first decided, whether the verdict was to move the message or to leave it in place. Absent means placement has never been evaluated for this message. Guards `computePlacement` against a re-entrant body-sync pass (`fetchAndGetBody`'s `NoSuchKey` fallback, `syncBodies(..., force: true)`) re-deciding — and possibly reversing — a placement a user has since overridden by hand. `movedByRemit` remains the guard for a message that was placement-decided before this field existed.
3229
3254
  */
3230
3255
  placementDecidedAt?: number;
3256
+ /**
3257
+ * Recorded when the user reported this message as spam. Absent means never reported, or reported and then undone (`POST /messages/not-spam` clears it). Independent of the message's current folder — deliberately not derived from "sits in Junk", which is also true of a message Remit moved on its own.
3258
+ */
3259
+ spamReport?: MessageSpamReport;
3231
3260
  createdAt: number;
3232
3261
  updatedAt: number;
3233
3262
  }
@@ -3355,6 +3384,10 @@ present only when `count=true`. Thread-specific so the shared `ResultList<T>`
3355
3384
  * Labels applied to this message — filter-, organize-, and manually-applied alike (issue #26). Absent/empty means no label is applied.
3356
3385
  */
3357
3386
  labels?: LabelSummaryResponse[];
3387
+ /**
3388
+ * Present when the user reported this message as spam and the report has not been undone. Backs the "Reported as spam · Undo" affordance.
3389
+ */
3390
+ spamReport?: MessageSpamReport;
3358
3391
  }
3359
3392
  /**
3360
3393
  * Message envelope (header metadata)
@@ -3727,6 +3760,36 @@ present only when `count=true`. Thread-specific so the shared `ResultList<T>`
3727
3760
  */
3728
3761
  action: LabelAction;
3729
3762
  }
3763
+ /**
3764
+ * Result of a report-spam or not-spam bulk call. Extends the standard counts with a reason per failed message: a partial failure here is an expected, routine outcome (a move from a prior press still settling) the client should be able to explain, not just count.
3765
+ */
3766
+ export interface SpamReportBulkResult {
3767
+ /**
3768
+ * Number of items accepted for processing
3769
+ */
3770
+ successCount: number;
3771
+ /**
3772
+ * Number of items rejected before processing
3773
+ */
3774
+ failureCount: number;
3775
+ /**
3776
+ * One entry per message that failed, naming why. Absent or empty when every message succeeded.
3777
+ */
3778
+ failures?: SpamReportFailure[];
3779
+ }
3780
+ /**
3781
+ * One message's failure reason within a report-spam or not-spam bulk call.
3782
+ */
3783
+ export interface SpamReportFailure {
3784
+ /**
3785
+ * The message that failed
3786
+ */
3787
+ messageId: UUID;
3788
+ /**
3789
+ * Why it failed, safe to show the user as-is. One of a small allowlisted set of user-facing messages (e.g. "has not settled yet" while a prior move is still in flight) — never a raw internal error, which is logged server-side instead and never returned here. Not intended to be parsed programmatically.
3790
+ */
3791
+ reason: string;
3792
+ }
3730
3793
  /**
3731
3794
  * Junction table linking envelope addresses to normalized addresses. Stores per-message display name since it may vary.
3732
3795
  */
@@ -4800,6 +4863,18 @@ declare namespace Paths {
4800
4863
  export type $200 = void;
4801
4864
  }
4802
4865
  }
4866
+ namespace ReportSpam {
4867
+ export type RequestBody = Components.Schemas.BulkMessageInput;
4868
+ namespace Responses {
4869
+ export type $200 = void;
4870
+ }
4871
+ }
4872
+ namespace NotSpam {
4873
+ export type RequestBody = Components.Schemas.BulkMessageInput;
4874
+ namespace Responses {
4875
+ export type $200 = void;
4876
+ }
4877
+ }
4803
4878
  }
4804
4879
 
4805
4880
  export interface OperationMethods {
@@ -5283,6 +5358,22 @@ Callers that omit `query` are unaffected: the INBOX (and starred) listings behav
5283
5358
  data?: Paths.UpdateMessageLabels.RequestBody,
5284
5359
  config?: AxiosRequestConfig
5285
5360
  ): OperationResponse<Paths.UpdateMessageLabels.Responses.$200>;
5361
+ /**
5362
+ * reportSpam - Report messages as spam: block the sender (Address.flags.blocked) and move each message to the account's Junk folder. Skips the block (but still moves the message) when the sender is the account's own address. One call replaces composing the old separate `Block` and `Mark spam` actions — a single user intent, a single failure story. The sender block is written first and does not wait on the move; a failed move never rolls it back. Idempotent under a repeated call.
5363
+ */
5364
+ 'reportSpam'(
5365
+ parameters?: Parameters<UnknownParamsObject> | null,
5366
+ data?: Paths.ReportSpam.RequestBody,
5367
+ config?: AxiosRequestConfig
5368
+ ): OperationResponse<Paths.ReportSpam.Responses.$200>;
5369
+ /**
5370
+ * notSpam - Undo a spam report: clear the sender's `blocked` flag (never promotes to trusted/wellknown) and move each message back to `Message.originalMailboxId`. Idempotent under a repeated call. Each message is processed independently and concurrently, so the request's total wait is bounded by one message's settle timeout rather than accumulating across the batch.
5371
+ */
5372
+ 'notSpam'(
5373
+ parameters?: Parameters<UnknownParamsObject> | null,
5374
+ data?: Paths.NotSpam.RequestBody,
5375
+ config?: AxiosRequestConfig
5376
+ ): OperationResponse<Paths.NotSpam.Responses.$200>;
5286
5377
  }
5287
5378
 
5288
5379
  export interface PathsDictionary {
@@ -5852,6 +5943,26 @@ Callers that omit `query` are unaffected: the INBOX (and starred) listings behav
5852
5943
  config?: AxiosRequestConfig
5853
5944
  ): OperationResponse<Paths.UpdateMessageLabels.Responses.$200>;
5854
5945
  };
5946
+ ['/messages/report-spam']: {
5947
+ /**
5948
+ * reportSpam - Report messages as spam: block the sender (Address.flags.blocked) and move each message to the account's Junk folder. Skips the block (but still moves the message) when the sender is the account's own address. One call replaces composing the old separate `Block` and `Mark spam` actions — a single user intent, a single failure story. The sender block is written first and does not wait on the move; a failed move never rolls it back. Idempotent under a repeated call.
5949
+ */
5950
+ 'post'(
5951
+ parameters?: Parameters<UnknownParamsObject> | null,
5952
+ data?: Paths.ReportSpam.RequestBody,
5953
+ config?: AxiosRequestConfig
5954
+ ): OperationResponse<Paths.ReportSpam.Responses.$200>;
5955
+ };
5956
+ ['/messages/not-spam']: {
5957
+ /**
5958
+ * notSpam - Undo a spam report: clear the sender's `blocked` flag (never promotes to trusted/wellknown) and move each message back to `Message.originalMailboxId`. Idempotent under a repeated call. Each message is processed independently and concurrently, so the request's total wait is bounded by one message's settle timeout rather than accumulating across the batch.
5959
+ */
5960
+ 'post'(
5961
+ parameters?: Parameters<UnknownParamsObject> | null,
5962
+ data?: Paths.NotSpam.RequestBody,
5963
+ config?: AxiosRequestConfig
5964
+ ): OperationResponse<Paths.NotSpam.Responses.$200>;
5965
+ };
5855
5966
  }
5856
5967
 
5857
5968
  export type Client = OpenAPIClient<OperationMethods, PathsDictionary>;
@@ -5922,6 +6033,7 @@ export type ThreadMessageResponse = Components.Schemas.ThreadMessageResponse;
5922
6033
  export type MessageAuthenticity = Components.Schemas.MessageAuthenticity;
5923
6034
  export type AutoMovedInfo = Components.Schemas.AutoMovedInfo;
5924
6035
  export type LabelSummaryResponse = Components.Schemas.LabelSummaryResponse;
6036
+ export type MessageSpamReport = Components.Schemas.MessageSpamReport;
5925
6037
  export type ThreadSearchResponse = Components.Schemas.ThreadSearchResponse;
5926
6038
  export type SemanticSearchResult = Components.Schemas.SemanticSearchResult;
5927
6039
  export type CreateOutboxMessageInput = Components.Schemas.CreateOutboxMessageInput;
@@ -5962,6 +6074,8 @@ export type BulkMessageInput = Components.Schemas.BulkMessageInput;
5962
6074
  export type MoveMessagesInput = Components.Schemas.MoveMessagesInput;
5963
6075
  export type CopyMessagesInput = Components.Schemas.CopyMessagesInput;
5964
6076
  export type UpdateMessageLabelsInput = Components.Schemas.UpdateMessageLabelsInput;
6077
+ export type SpamReportBulkResult = Components.Schemas.SpamReportBulkResult;
6078
+ export type SpamReportFailure = Components.Schemas.SpamReportFailure;
5965
6079
  export type EnvelopeAddress = Components.Schemas.EnvelopeAddress;
5966
6080
  export type AccountSettingValue = Components.Schemas.AccountSettingValue;
5967
6081
  export type BooleanSetting = Components.Schemas.BooleanSetting;
@@ -6013,6 +6127,7 @@ export type SortOrder = Components.Schemas.SortOrder;
6013
6127
  export type StarColor = Components.Schemas.StarColor;
6014
6128
  export type MessageCategory = Components.Schemas.MessageCategory;
6015
6129
  export type SenderTrust = Components.Schemas.SenderTrust;
6130
+ export type DisplayNameCorrespondence = Components.Schemas.DisplayNameCorrespondence;
6016
6131
  export type PlacementAction = Components.Schemas.PlacementAction;
6017
6132
  export type SemanticSearchChunkType = Components.Schemas.SemanticSearchChunkType;
6018
6133
  export type OutboxMessageStatus = Components.Schemas.OutboxMessageStatus;