@remit/api-openapi-types 0.0.106 → 0.0.108

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 +289 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/api-openapi-types",
3
- "version": "0.0.106",
3
+ "version": "0.0.108",
4
4
  "type": "module",
5
5
  "main": "types.d.ts",
6
6
  "types": "types.d.ts",
package/types.d.ts CHANGED
@@ -312,6 +312,26 @@ explained to the user as a failed delete.
312
312
  * Confidence of a placement verdict. `Confident` verdicts move mail (when the dark-ship flag is on); `Unsure` verdicts are recorded but never moved.
313
313
  */
314
314
  export type PlacementConfidence = "Confident" | "Unsure";
315
+ /**
316
+ * The stage 1 rule that let a message through without a spam check, when the sender decided it (RFC 041).
317
+ */
318
+ export type SpamSenderScreenRule = "ReportedSender" | "NeverSpam" | "Vip" | "WellKnown" | "Newsletter";
319
+ /**
320
+ * What the spam service tells Remit to do with a checked message (RFC 041).
321
+ */
322
+ export type SpamAction = "None" | "Warn" | "Junk";
323
+ /**
324
+ * What the spam service suspects a checked message of (RFC 041).
325
+ */
326
+ export type SpamKind = "Spam" | "Phishing";
327
+ /**
328
+ * The stable name of one check the spam service ran and found something with (RFC 041). A client holds one sentence per name.
329
+ */
330
+ export type SpamReasonName = "DmarcFail" | "SignerMismatch" | "ReplyToMismatch" | "LinkTextMismatch" | "LinkDomainDistant" | "PunycodeDomain" | "MixedScriptDomain" | "ConfusableDomains" | "SingleOffDomainLink" | "GeneratedName" | "FirstContactDomain" | "RecentlyRegisteredDomain" | "UnknownRegistrationDate" | "ClassifierSpam" | "ClassifierPhishing" | "ProviderSpam" | "DisplayNameForeignAddress" | "DisplayNameLookalike" | "BackendSymbol";
331
+ /**
332
+ * Why a spam service gave no verdict (RFC 041).
333
+ */
334
+ export type SpamFailureKind = "Unreachable" | "TimedOut" | "ServiceError" | "Unparseable";
315
335
  /**
316
336
  * Where an attachment is between being promised and being sendable.
317
337
 
@@ -424,6 +444,10 @@ distinguishable from a network failure without parsing prose.
424
444
  * Whether sync still retries a warned message. Derived from stage and attempts, never stored.
425
445
  */
426
446
  export type SyncWarningState = "Retrying" | "GaveUp";
447
+ /**
448
+ * What the owner's mail provider said about a message, as the spam request carries it (RFC 041).
449
+ */
450
+ export type ProviderSpamVerdict = "Spam" | "Clean" | "Absent";
427
451
  /**
428
452
  * 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.
429
453
  */
@@ -2967,6 +2991,14 @@ standing to persist.
2967
2991
  * Snapshot of the one folder the pass runs over, or `"None"` for every folder. With a folder, a rule with no tests matches every message in it.
2968
2992
  */
2969
2993
  sourceMailboxId: string;
2994
+ /**
2995
+ * Snapshot of the lower bound of the message date facet, inclusive: an ISO 8601 date-time with zone offset, or `"None"` for no lower bound.
2996
+ */
2997
+ sentAfter: string;
2998
+ /**
2999
+ * Snapshot of the upper bound of the message date facet, exclusive: an ISO 8601 date-time with zone offset, or `"None"` for no upper bound.
3000
+ */
3001
+ sentBefore: string;
2970
3002
  /**
2971
3003
  * Number of messages matched by the predicate, set when the pass completes
2972
3004
  */
@@ -4798,6 +4830,10 @@ every reader of either would otherwise narrow on the kind first.
4798
4830
  * Remit's placement verdict for this message, projected from the underlying Message row. Absent for a message judged before placement verdicts were recorded, or one Remit left in place.
4799
4831
  */
4800
4832
  placementVerdict?: MessagePlacementVerdict;
4833
+ /**
4834
+ * The spam outcome of the underlying Message (RFC 041), projected at read time. `NotChecked` when the Message row is missing from the batch.
4835
+ */
4836
+ spamVerdict: SpamVerdictNotChecked | SpamVerdictScreenedOut | SpamChecked | SpamFailed;
4801
4837
  }
4802
4838
  /**
4803
4839
  * 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.
@@ -4911,6 +4947,71 @@ every reader of either would otherwise narrow on the kind first.
4911
4947
  */
4912
4948
  decidedAt: number;
4913
4949
  }
4950
+ /**
4951
+ * No spam check has run on this message.
4952
+ */
4953
+ export interface SpamVerdictNotChecked {
4954
+ state: "NotChecked";
4955
+ }
4956
+ /**
4957
+ * Stage 1 let the message through without a call to the spam service.
4958
+ */
4959
+ export interface SpamVerdictScreenedOut {
4960
+ state: "ScreenedOut";
4961
+ screen: SpamScreenBySender | SpamScreenByFilter;
4962
+ }
4963
+ /**
4964
+ * The sender's standing let the message through.
4965
+ */
4966
+ export interface SpamScreenBySender {
4967
+ rule: SpamSenderScreenRule;
4968
+ }
4969
+ /**
4970
+ * One of the owner's filters matched the message.
4971
+ */
4972
+ export interface SpamScreenByFilter {
4973
+ rule: "Filter";
4974
+ filterId: UUID;
4975
+ }
4976
+ /**
4977
+ * A spam service weighed the message.
4978
+ */
4979
+ export interface SpamChecked {
4980
+ state: "Checked";
4981
+ score: number;
4982
+ action: SpamAction;
4983
+ kind: SpamKind;
4984
+ reasons: SpamReason[];
4985
+ /**
4986
+ * The service called a model, so Remit counts the call against the daily cap.
4987
+ */
4988
+ modelCalled: boolean;
4989
+ }
4990
+ /**
4991
+ * One check that found something, shaped like an rspamd symbol.
4992
+ */
4993
+ export interface SpamReason {
4994
+ name: SpamReasonName;
4995
+ /**
4996
+ * The backend's own name for the check, as rspamd names a symbol. The inline engine uses `name`; a backend whose symbol has no `SpamReasonName` sends `BackendSymbol` and its raw symbol here.
4997
+ */
4998
+ symbol: string;
4999
+ /**
5000
+ * What the check added to the score.
5001
+ */
5002
+ score: number;
5003
+ /**
5004
+ * What the check found, such as the domain behind a link.
5005
+ */
5006
+ options: string[];
5007
+ }
5008
+ /**
5009
+ * A spam service gave no verdict.
5010
+ */
5011
+ export interface SpamFailed {
5012
+ state: "Failed";
5013
+ kind: SpamFailureKind;
5014
+ }
4914
5015
  /**
4915
5016
  * A page of thread messages.
4916
5017
  */
@@ -5933,6 +6034,10 @@ either way and cannot tell which it received.
5933
6034
  * 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.
5934
6035
  */
5935
6036
  spamReport?: MessageSpamReport;
6037
+ /**
6038
+ * The spam outcome for this message (RFC 041). Defaults to `NotChecked`; body sync records `ScreenedOut` when stage 1 let the message through, or the spam service's answer.
6039
+ */
6040
+ spamVerdict: SpamVerdictNotChecked | SpamVerdictScreenedOut | SpamChecked | SpamFailed;
5936
6041
  createdAt: number;
5937
6042
  updatedAt: number;
5938
6043
  }
@@ -6120,6 +6225,10 @@ either way and cannot tell which it received.
6120
6225
  * 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.
6121
6226
  */
6122
6227
  spamReport?: MessageSpamReport;
6228
+ /**
6229
+ * The spam outcome for this message (RFC 041). Defaults to `NotChecked`; body sync records `ScreenedOut` when stage 1 let the message through, or the spam service's answer.
6230
+ */
6231
+ spamVerdict: SpamVerdictNotChecked | SpamVerdictScreenedOut | SpamChecked | SpamFailed;
6123
6232
  createdAt: number;
6124
6233
  updatedAt: number;
6125
6234
  /**
@@ -6167,6 +6276,10 @@ either way and cannot tell which it received.
6167
6276
  * Structured sender-authenticity signal derived from DKIM headers at classification time. Absent for messages classified before this field was introduced — absence means no signal.
6168
6277
  */
6169
6278
  authenticity?: MessageAuthenticity;
6279
+ /**
6280
+ * The spam outcome for this message (RFC 041). Defaults to `NotChecked`; body sync records `ScreenedOut` when stage 1 let the message through, or the spam service's answer.
6281
+ */
6282
+ spamVerdict: SpamVerdictNotChecked | SpamVerdictScreenedOut | SpamChecked | SpamFailed;
6170
6283
  /**
6171
6284
  * Message-ID header value for quick reference
6172
6285
  */
@@ -7123,6 +7236,127 @@ of copying it, and so a person can see what was imported after the fact.
7123
7236
  createdAt: number;
7124
7237
  updatedAt: number;
7125
7238
  }
7239
+ /**
7240
+ * One header line, name and unfolded value.
7241
+ */
7242
+ export interface SpamHeader {
7243
+ name: string;
7244
+ value: string;
7245
+ }
7246
+ /**
7247
+ * One link in the message body: where it points, and the text the reader sees.
7248
+ */
7249
+ export interface SpamLink {
7250
+ href: string;
7251
+ text: string;
7252
+ }
7253
+ /**
7254
+ * The message as Remit parsed it once, so a backend needs no MIME parser.
7255
+ */
7256
+ export interface SpamRequestMessage {
7257
+ /**
7258
+ * The RFC 822 message, base64.
7259
+ */
7260
+ raw: string;
7261
+ headers: SpamHeader[];
7262
+ text: string;
7263
+ html: string;
7264
+ links: SpamLink[];
7265
+ }
7266
+ /**
7267
+ * Envelope facts, as rspamd's `/checkv2` takes them.
7268
+ */
7269
+ export interface SpamRequestEnvelope {
7270
+ /**
7271
+ * The Return-Path address, or empty.
7272
+ */
7273
+ mailFrom: string;
7274
+ /**
7275
+ * The account's own addresses.
7276
+ */
7277
+ rcpt: string[];
7278
+ /**
7279
+ * The connecting IP from the receiving server's Received header, or empty.
7280
+ */
7281
+ ip: string;
7282
+ /**
7283
+ * The HELO name from the receiving server's Received header, or empty.
7284
+ */
7285
+ helo: string;
7286
+ }
7287
+ /**
7288
+ * The provider's authentication results, read from its Authentication-Results.
7289
+ */
7290
+ export interface SpamRequestAuthentication {
7291
+ dmarc: AuthResultVerdict;
7292
+ spf: AuthResultVerdict;
7293
+ dkim: AuthResultVerdict;
7294
+ /**
7295
+ * Registrable domain of the first passing DKIM signature, or `unverified` when no signature passed.
7296
+ */
7297
+ signerDomain: string;
7298
+ /**
7299
+ * The SPF-checked envelope domain, or empty.
7300
+ */
7301
+ envelopeDomain: string;
7302
+ }
7303
+ /**
7304
+ * The owner's mail provider's own spam verdict.
7305
+ */
7306
+ export interface SpamRequestProvider {
7307
+ verdict: ProviderSpamVerdict;
7308
+ /**
7309
+ * The score the provider's header carries, or empty.
7310
+ */
7311
+ score: string;
7312
+ /**
7313
+ * X-Spam-* and the like.
7314
+ */
7315
+ headers: SpamHeader[];
7316
+ }
7317
+ /**
7318
+ * What Remit knows about the sender and the account. The spam service never reads Remit's database, so every fact it weighs arrives here.
7319
+ */
7320
+ export interface SpamRequestContext {
7321
+ /**
7322
+ * The owner has sent mail to this address.
7323
+ */
7324
+ knownSender: boolean;
7325
+ /**
7326
+ * Earlier messages from this address.
7327
+ */
7328
+ senderMessagesSeen: number;
7329
+ /**
7330
+ * Earlier messages from the address's registrable domain.
7331
+ */
7332
+ senderDomainMessagesSeen: number;
7333
+ /**
7334
+ * ISO 8601 date-time with offset the sender's registrable domain was registered, from RDAP. Absent when the registry publishes none or the lookup failed; Remit never fills in a placeholder.
7335
+ */
7336
+ senderDomainRegisteredAt?: string;
7337
+ /**
7338
+ * ISO 8601 date-time with offset the receiving server took the message (INTERNALDATE). Domain age is measured against it, so the judge stays a function of the request.
7339
+ */
7340
+ receivedAt: string;
7341
+ /**
7342
+ * The category classifier's answer, or empty.
7343
+ */
7344
+ classifierScores: ClassifierScore[];
7345
+ /**
7346
+ * The account has a model and is under its daily cap.
7347
+ */
7348
+ modelAllowed: boolean;
7349
+ }
7350
+ /**
7351
+ * Everything a spam service weighs for one message (RFC 041). The shape follows rspamd's `/checkv2`: the raw message plus envelope facts as named fields.
7352
+ */
7353
+ export interface SpamRequest {
7354
+ message: SpamRequestMessage;
7355
+ envelope: SpamRequestEnvelope;
7356
+ authentication: SpamRequestAuthentication;
7357
+ provider: SpamRequestProvider;
7358
+ context: SpamRequestContext;
7359
+ }
7126
7360
  /**
7127
7361
  * Pending-move marker for a Remit-driven placement move (issue #1271, epic
7128
7362
  #1281). Written in the SAME local step that moves a Message's `mailboxId` to
@@ -7247,6 +7481,34 @@ locally".
7247
7481
  createdAt: number;
7248
7482
  updatedAt: number;
7249
7483
  }
7484
+ /**
7485
+ * The registry published a registration date.
7486
+ */
7487
+ export interface DomainRegistrationPublished {
7488
+ state: "Published";
7489
+ /**
7490
+ * ISO 8601 date-time with offset, as the registry's RDAP `registration` event states it.
7491
+ */
7492
+ registeredAt: string;
7493
+ }
7494
+ /**
7495
+ * The registry answered and published no registration date, as DENIC does for .de.
7496
+ */
7497
+ export interface DomainRegistrationUnpublished {
7498
+ state: "Unpublished";
7499
+ }
7500
+ /**
7501
+ * A successful RDAP answer for one registrable domain, cached because a registration date never changes (RFC 041). A failed lookup is never cached.
7502
+ */
7503
+ export interface DomainRegistration {
7504
+ /**
7505
+ * The registrable domain (eTLD+1), lowercased. It is the row's identity: one row per domain.
7506
+ */
7507
+ domainRegistrationId: String256;
7508
+ registration: DomainRegistrationPublished | DomainRegistrationUnpublished;
7509
+ createdAt: number;
7510
+ updatedAt: number;
7511
+ }
7250
7512
  /**
7251
7513
  * How often this account has seen mail from one sender arrive under one DKIM
7252
7514
  signing identity. A third-party signer is not suspicious in itself — an ESP
@@ -8419,6 +8681,8 @@ declare namespace Paths {
8419
8681
  category?: Components.Schemas.MessageCategory[];
8420
8682
  unread?: boolean;
8421
8683
  attachments?: boolean;
8684
+ before?: string;
8685
+ after?: string;
8422
8686
  count?: boolean;
8423
8687
  results?: boolean;
8424
8688
  }
@@ -11294,7 +11558,7 @@ export interface Operations {
11294
11558
  };
11295
11559
  'UnifiedThreadOperations_listAllThreads': {
11296
11560
  params: {};
11297
- query: { continuationToken?: string; order?: Components.Schemas.SortOrder; limit?: number; starred?: boolean; query?: string; from?: string; subject?: string; accountId?: Components.Schemas.UUID; mailboxId?: Components.Schemas.UUID; labelId?: Components.Schemas.UUID; muted?: boolean; category?: Components.Schemas.MessageCategory[]; unread?: boolean; attachments?: boolean; count?: boolean; results?: boolean };
11561
+ query: { continuationToken?: string; order?: Components.Schemas.SortOrder; limit?: number; starred?: boolean; query?: string; from?: string; subject?: string; accountId?: Components.Schemas.UUID; mailboxId?: Components.Schemas.UUID; labelId?: Components.Schemas.UUID; muted?: boolean; category?: Components.Schemas.MessageCategory[]; unread?: boolean; attachments?: boolean; before?: string; after?: string; count?: boolean; results?: boolean };
11298
11562
  headers: {};
11299
11563
  cookies: {};
11300
11564
  requestBody: undefined;
@@ -11685,6 +11949,13 @@ export type AutoMovedInfo = Components.Schemas.AutoMovedInfo;
11685
11949
  export type LabelSummaryResponse = Components.Schemas.LabelSummaryResponse;
11686
11950
  export type MessageSpamReport = Components.Schemas.MessageSpamReport;
11687
11951
  export type MessagePlacementVerdict = Components.Schemas.MessagePlacementVerdict;
11952
+ export type SpamVerdictNotChecked = Components.Schemas.SpamVerdictNotChecked;
11953
+ export type SpamVerdictScreenedOut = Components.Schemas.SpamVerdictScreenedOut;
11954
+ export type SpamScreenBySender = Components.Schemas.SpamScreenBySender;
11955
+ export type SpamScreenByFilter = Components.Schemas.SpamScreenByFilter;
11956
+ export type SpamChecked = Components.Schemas.SpamChecked;
11957
+ export type SpamReason = Components.Schemas.SpamReason;
11958
+ export type SpamFailed = Components.Schemas.SpamFailed;
11688
11959
  export type ThreadMessageListResponse = Components.Schemas.ThreadMessageListResponse;
11689
11960
  export type ThreadSearchResponse = Components.Schemas.ThreadSearchResponse;
11690
11961
  export type CreateOutboxMessageInput = Components.Schemas.CreateOutboxMessageInput;
@@ -11759,9 +12030,20 @@ export type MailboxSpecialUseEntry = Components.Schemas.MailboxSpecialUseEntry;
11759
12030
  export type MailboxFlag = Components.Schemas.MailboxFlag;
11760
12031
  export type MailboxLock = Components.Schemas.MailboxLock;
11761
12032
  export type MessageFlag = Components.Schemas.MessageFlag;
12033
+ export type SpamHeader = Components.Schemas.SpamHeader;
12034
+ export type SpamLink = Components.Schemas.SpamLink;
12035
+ export type SpamRequestMessage = Components.Schemas.SpamRequestMessage;
12036
+ export type SpamRequestEnvelope = Components.Schemas.SpamRequestEnvelope;
12037
+ export type SpamRequestAuthentication = Components.Schemas.SpamRequestAuthentication;
12038
+ export type SpamRequestProvider = Components.Schemas.SpamRequestProvider;
12039
+ export type SpamRequestContext = Components.Schemas.SpamRequestContext;
12040
+ export type SpamRequest = Components.Schemas.SpamRequest;
11762
12041
  export type MessagePlacementMove = Components.Schemas.MessagePlacementMove;
11763
12042
  export type MessageFlagPush = Components.Schemas.MessageFlagPush;
11764
12043
  export type Envelope = Components.Schemas.Envelope;
12044
+ export type DomainRegistrationPublished = Components.Schemas.DomainRegistrationPublished;
12045
+ export type DomainRegistrationUnpublished = Components.Schemas.DomainRegistrationUnpublished;
12046
+ export type DomainRegistration = Components.Schemas.DomainRegistration;
11765
12047
  export type SenderSignerStanding = Components.Schemas.SenderSignerStanding;
11766
12048
  export type BodyPartParameter = Components.Schemas.BodyPartParameter;
11767
12049
  export type BodyStructureRefetch = Components.Schemas.BodyStructureRefetch;
@@ -11840,6 +12122,11 @@ export type MessageSyncStatus = Components.Schemas.MessageSyncStatus;
11840
12122
  export type MessageMutation = Components.Schemas.MessageMutation;
11841
12123
  export type PlacementAction = Components.Schemas.PlacementAction;
11842
12124
  export type PlacementConfidence = Components.Schemas.PlacementConfidence;
12125
+ export type SpamSenderScreenRule = Components.Schemas.SpamSenderScreenRule;
12126
+ export type SpamAction = Components.Schemas.SpamAction;
12127
+ export type SpamKind = Components.Schemas.SpamKind;
12128
+ export type SpamReasonName = Components.Schemas.SpamReasonName;
12129
+ export type SpamFailureKind = Components.Schemas.SpamFailureKind;
11843
12130
  export type OutboxAttachmentState = Components.Schemas.OutboxAttachmentState;
11844
12131
  export type OutboxAttachmentRejectionReason = Components.Schemas.OutboxAttachmentRejectionReason;
11845
12132
  export type AddressFlagKey = Components.Schemas.AddressFlagKey;
@@ -11866,6 +12153,7 @@ export type AccountSettingName = Components.Schemas.AccountSettingName;
11866
12153
  export type ConfigImportState = Components.Schemas.ConfigImportState;
11867
12154
  export type ConfigImportRefKind = Components.Schemas.ConfigImportRefKind;
11868
12155
  export type SyncWarningState = Components.Schemas.SyncWarningState;
12156
+ export type ProviderSpamVerdict = Components.Schemas.ProviderSpamVerdict;
11869
12157
  export type MessagePlacementMoveState = Components.Schemas.MessagePlacementMoveState;
11870
12158
  export type FlagPushOperation = Components.Schemas.FlagPushOperation;
11871
12159
  export type MessageFlagPushState = Components.Schemas.MessageFlagPushState;