@remit/api-openapi-types 0.0.100 → 0.0.102

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 +203 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/api-openapi-types",
3
- "version": "0.0.100",
3
+ "version": "0.0.102",
4
4
  "type": "module",
5
5
  "main": "types.d.ts",
6
6
  "types": "types.d.ts",
package/types.d.ts CHANGED
@@ -153,6 +153,18 @@ current enum emitter anyway, so the wire contract uses the bare form.
153
153
  * Message attribute a FilterClause matches against — RFC 031's Tier 0 literal predicates plus the RFC 038 D2 additions (list membership and sender domain). Every member is matched at index time and in the back-apply corpus projection.
154
154
  */
155
155
  export type FilterClauseField = "From" | "Subject" | "HasWords" | "ListId" | "FromDomain";
156
+ /**
157
+ * How a FilterRule header or address test compares its key (RFC 040, after Sieve's `:is` and `:contains`). Both fold case.
158
+ */
159
+ export type FilterRuleMatch = "Is" | "Contains";
160
+ /**
161
+ * The header a FilterRule header test reads (RFC 040). `ListId` is normalized as a `List-Id` filter clause is.
162
+ */
163
+ export type FilterRuleHeader = "From" | "Subject" | "ListId";
164
+ /**
165
+ * The part of the From address a FilterRule address test reads (RFC 040). `RegistrableDomain` is the public-suffix aware domain.
166
+ */
167
+ export type FilterRuleAddressPart = "All" | "Localpart" | "Domain" | "RegistrableDomain";
156
168
  /**
157
169
  * Display color for a user-defined Label (RFC 030).
158
170
  */
@@ -236,7 +248,7 @@ current enum emitter anyway, so the wire contract uses the bare form.
236
248
  /**
237
249
  * A label a classification provider picks for a message: the junk verdicts, priority, and the message categories.
238
250
  */
239
- export type ClassificationLabel = "Spam" | "Phishing" | "Priority" | "Personal" | "Newsletter" | "Marketing" | "Automated" | "Transactional" | "Social";
251
+ export type ClassificationLabel = "Spam" | "Phishing" | "Priority" | "Personal" | "Newsletter" | "Marketing" | "Automated" | "Transactional" | "Social" | "ColdOutreach";
240
252
  /**
241
253
  * Why a classification provider call gave no usable answer.
242
254
  */
@@ -245,6 +257,10 @@ current enum emitter anyway, so the wire contract uses the bare form.
245
257
  * The classification provider form field a failure points at.
246
258
  */
247
259
  export type ClassificationField = "ApiKey" | "Model" | "BaseUrl";
260
+ /**
261
+ * Header-derived message category. Set by classifyByHeaders during body-sync. Defaults to `uncategorized`, which covers both a message that has not been classified yet and one the classifier declined to categorize; `Message.classificationState` is what tells those apart.
262
+ */
263
+ export type MessageCategory = "uncategorized" | "personal" | "newsletter" | "marketing" | "automated" | "transactional" | "social" | "coldOutreach";
248
264
  /**
249
265
  * Sort order for list operations
250
266
  */
@@ -253,10 +269,6 @@ current enum emitter anyway, so the wire contract uses the bare form.
253
269
  * Gmail-style star colors for message/thread marking
254
270
  */
255
271
  export type StarColor = "none" | "yellow" | "orange" | "red" | "purple" | "blue" | "teal" | "green" | "yellow_bang" | "red_bang" | "purple_question" | "blue_info" | "orange_guillemet" | "green_check" | "yellow_check" | "blue_star";
256
- /**
257
- * Header-derived message category. Set by classifyByHeaders during body-sync. Defaults to `uncategorized`, which covers both a message that has not been classified yet and one the classifier declined to categorize; `Message.classificationState` is what tells those apart.
258
- */
259
- export type MessageCategory = "uncategorized" | "personal" | "newsletter" | "marketing" | "automated" | "transactional" | "social";
260
272
  /**
261
273
  * Trust level for the From address, derived at read time from AddressFlags + counters.
262
274
  */
@@ -2389,6 +2401,10 @@ create one (RFC 034 recap).
2389
2401
  * Literal from/subject/has-words predicate clauses (RFC 031). A filter carries at least one.
2390
2402
  */
2391
2403
  literalClauses: FilterClause[];
2404
+ /**
2405
+ * The stored rule. A version 0 row predates rules and its literalClauses are the truth. Not surfaced on the API yet.
2406
+ */
2407
+ rule: FilterRuleV0 | FilterRuleV1;
2392
2408
  /**
2393
2409
  * Label applied when this filter matches — additive action, any number of filters can independently apply their own label (RFC 034 Decision 3.1). The named sentinel `"None"` means no label action; never an empty/optional field.
2394
2410
  */
@@ -2413,6 +2429,65 @@ create one (RFC 034 recap).
2413
2429
  */
2414
2430
  value: String256;
2415
2431
  }
2432
+ /**
2433
+ * A row written before rules existed: the filter's literal clauses are the truth.
2434
+ */
2435
+ export interface FilterRuleV0 {
2436
+ version: 0;
2437
+ }
2438
+ /**
2439
+ * A rule whose test is the truth; the row's literal clauses are empty.
2440
+ */
2441
+ export interface FilterRuleV1 {
2442
+ version: 1;
2443
+ test: FilterAllOfTest | FilterAnyOfTest | FilterNotTest | FilterHeaderTest | FilterAddressTest | FilterHasWordsTest;
2444
+ }
2445
+ /**
2446
+ * Matches when every test in `tests` matches (Sieve `allof`).
2447
+ */
2448
+ export interface FilterAllOfTest {
2449
+ test: "allof";
2450
+ tests: FilterAllOfTest | FilterAnyOfTest | FilterNotTest | FilterHeaderTest | FilterAddressTest | FilterHasWordsTest[];
2451
+ }
2452
+ /**
2453
+ * Matches when any test in `tests` matches (Sieve `anyof`).
2454
+ */
2455
+ export interface FilterAnyOfTest {
2456
+ test: "anyof";
2457
+ tests: FilterAllOfTest | FilterAnyOfTest | FilterNotTest | FilterHeaderTest | FilterAddressTest | FilterHasWordsTest[];
2458
+ }
2459
+ /**
2460
+ * Matches when `operand` does not (Sieve `not`).
2461
+ */
2462
+ export interface FilterNotTest {
2463
+ test: "not";
2464
+ operand: FilterAllOfTest | FilterAnyOfTest | FilterNotTest | FilterHeaderTest | FilterAddressTest | FilterHasWordsTest;
2465
+ }
2466
+ /**
2467
+ * Compares one header against one key (Sieve `header`).
2468
+ */
2469
+ export interface FilterHeaderTest {
2470
+ test: "header";
2471
+ match: FilterRuleMatch;
2472
+ header: FilterRuleHeader;
2473
+ key: String256;
2474
+ }
2475
+ /**
2476
+ * Compares one part of the From address against one key (Sieve `address`). Reads `from` only.
2477
+ */
2478
+ export interface FilterAddressTest {
2479
+ test: "address";
2480
+ match: FilterRuleMatch;
2481
+ part: FilterRuleAddressPart;
2482
+ key: String256;
2483
+ }
2484
+ /**
2485
+ * Matches when every word occurs in the sender, the subject or the body.
2486
+ */
2487
+ export interface FilterHasWordsTest {
2488
+ test: "hasWords";
2489
+ words: String256[];
2490
+ }
2416
2491
  /**
2417
2492
  * Filter item returned by list/get/create/update operations. `ttl` is internal bookkeeping (RFC 034 Decision 1.3) and not surfaced.
2418
2493
  */
@@ -2793,6 +2868,10 @@ standing to persist.
2793
2868
  * Snapshot of the literal predicate clauses
2794
2869
  */
2795
2870
  literalClauses: FilterClause[];
2871
+ /**
2872
+ * Snapshot of the rule. A version 0 row predates rules and its literalClauses are the truth.
2873
+ */
2874
+ rule: FilterRuleV0 | FilterRuleV1;
2796
2875
  /**
2797
2876
  * Snapshot of the additive label action, or `"None"`
2798
2877
  */
@@ -3873,6 +3952,55 @@ field on this resource rather than one more operation.
3873
3952
  */
3874
3953
  fix: string;
3875
3954
  }
3955
+ /**
3956
+ * The classifier's distribution and corrections over mail that arrived on or after `since`, across every account the caller holds.
3957
+ */
3958
+ export interface ClassifierStats {
3959
+ /**
3960
+ * The start of the window, as the request gave it: an ISO 8601 date-time with zone offset.
3961
+ */
3962
+ since: string;
3963
+ /**
3964
+ * Messages that arrived on or after `since` whose body sync classified them.
3965
+ */
3966
+ examined: number;
3967
+ /**
3968
+ * Examined messages per category; a category with none is absent.
3969
+ */
3970
+ byCategory: ClassifierCategoryCount[];
3971
+ /**
3972
+ * Confident scores per label, over the examined messages; a label with none is absent.
3973
+ */
3974
+ byLabel: ClassifierLabelCount[];
3975
+ corrections: ClassifierCorrections;
3976
+ }
3977
+ /**
3978
+ * Examined messages in one category.
3979
+ */
3980
+ export interface ClassifierCategoryCount {
3981
+ category: MessageCategory;
3982
+ count: number;
3983
+ }
3984
+ /**
3985
+ * Confident scores for one label.
3986
+ */
3987
+ export interface ClassifierLabelCount {
3988
+ label: ClassificationLabel;
3989
+ count: number;
3990
+ }
3991
+ /**
3992
+ * Times the reader disagreed with the classifier since `since`.
3993
+ */
3994
+ export interface ClassifierCorrections {
3995
+ /**
3996
+ * Messages the reader reported as spam whose stored scores held no confident `Spam` or `Phishing` score.
3997
+ */
3998
+ spamReportedNotJunk: number;
3999
+ /**
4000
+ * Senders whose `Address.flags.category` override was set on or after `since`.
4001
+ */
4002
+ categoryOverridden: number;
4003
+ }
3876
4004
  /**
3877
4005
  * Tasks due in the requested window, in due order. Unpaginated: the window is the bound.
3878
4006
  */
@@ -5710,6 +5838,10 @@ either way and cannot tell which it received.
5710
5838
  * 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.
5711
5839
  */
5712
5840
  placementDecidedAt?: number;
5841
+ /**
5842
+ * Every score the classification provider gave this message at body sync. Empty when the provider was not asked or gave no answer, and for every message synced before scores were stored. Persistence-only: no response model exposes it.
5843
+ */
5844
+ classifierScores: ClassifierScore[];
5713
5845
  /**
5714
5846
  * 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.
5715
5847
  */
@@ -5772,6 +5904,23 @@ either way and cannot tell which it received.
5772
5904
  */
5773
5905
  decidedAt: number;
5774
5906
  }
5907
+ /**
5908
+ * One label the classification provider scored for a message, as body sync stored it.
5909
+ */
5910
+ export interface ClassifierScore {
5911
+ /**
5912
+ * The label the provider scored.
5913
+ */
5914
+ label: ClassificationLabel;
5915
+ /**
5916
+ * The provider's confidence in `label`, between 0 and 1.
5917
+ */
5918
+ confidence: number;
5919
+ /**
5920
+ * True when `confidence` reached the threshold for the provider's kind of confidence when body sync stored it: 0.7 for a calibrated provider, 0.8 for an advisory one.
5921
+ */
5922
+ confident: boolean;
5923
+ }
5775
5924
  /**
5776
5925
  * Core message entity as the API carries it: the stored row plus the Message-ID header, which is stored on the message's thread row.
5777
5926
  */
@@ -5876,6 +6025,10 @@ either way and cannot tell which it received.
5876
6025
  * 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.
5877
6026
  */
5878
6027
  placementDecidedAt?: number;
6028
+ /**
6029
+ * Every score the classification provider gave this message at body sync. Empty when the provider was not asked or gave no answer, and for every message synced before scores were stored. Persistence-only: no response model exposes it.
6030
+ */
6031
+ classifierScores: ClassifierScore[];
5879
6032
  /**
5880
6033
  * 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.
5881
6034
  */
@@ -7954,6 +8107,16 @@ declare namespace Paths {
7954
8107
  export type $401 = void;
7955
8108
  }
7956
8109
  }
8110
+ namespace GetClassificationStats {
8111
+ export interface QueryParameters {
8112
+ since: string;
8113
+ }
8114
+ namespace Responses {
8115
+ export type $200 = void;
8116
+ export type $400 = void;
8117
+ export type $401 = void;
8118
+ }
8119
+ }
7957
8120
  namespace ListCalendarTasks {
7958
8121
  export interface QueryParameters {
7959
8122
  from: string;
@@ -8957,6 +9120,14 @@ reader organizes the event, none otherwise.
8957
9120
  data?: Paths.TestClassificationProvider.RequestBody,
8958
9121
  config?: AxiosRequestConfig
8959
9122
  ): OperationResponse<any>;
9123
+ /**
9124
+ * getClassificationStats - Count what the classifier decided for mail that arrived on or after `since`, and how often the reader corrected it. Refused with 400 when `since` is not an ISO 8601 date-time with zone offset.
9125
+ */
9126
+ 'getClassificationStats'(
9127
+ parameters?: Parameters<Paths.GetClassificationStats.QueryParameters> | null,
9128
+ data?: any,
9129
+ config?: AxiosRequestConfig
9130
+ ): OperationResponse<Paths.GetClassificationStats.Responses.$200>;
8960
9131
  /**
8961
9132
  * listCalendarTasks - Tasks due in a window, across every task collection the caller holds, in due order. Refused with 400 on the same window rules as the event listing.
8962
9133
  */
@@ -9936,6 +10107,16 @@ reader organizes the event, none otherwise.
9936
10107
  config?: AxiosRequestConfig
9937
10108
  ): OperationResponse<any>;
9938
10109
  };
10110
+ ['/classification-stats']: {
10111
+ /**
10112
+ * getClassificationStats - Count what the classifier decided for mail that arrived on or after `since`, and how often the reader corrected it. Refused with 400 when `since` is not an ISO 8601 date-time with zone offset.
10113
+ */
10114
+ 'get'(
10115
+ parameters?: Parameters<Paths.GetClassificationStats.QueryParameters> | null,
10116
+ data?: any,
10117
+ config?: AxiosRequestConfig
10118
+ ): OperationResponse<Paths.GetClassificationStats.Responses.$200>;
10119
+ };
9939
10120
  ['/calendar-tasks']: {
9940
10121
  /**
9941
10122
  * listCalendarTasks - Tasks due in a window, across every task collection the caller holds, in due order. Refused with 400 on the same window rules as the event listing.
@@ -10509,6 +10690,14 @@ export type RenameMailboxInput = Components.Schemas.RenameMailboxInput;
10509
10690
  export type AppointFolderRoleInput = Components.Schemas.AppointFolderRoleInput;
10510
10691
  export type Filter = Components.Schemas.Filter;
10511
10692
  export type FilterClause = Components.Schemas.FilterClause;
10693
+ export type FilterRuleV0 = Components.Schemas.FilterRuleV0;
10694
+ export type FilterRuleV1 = Components.Schemas.FilterRuleV1;
10695
+ export type FilterAllOfTest = Components.Schemas.FilterAllOfTest;
10696
+ export type FilterAnyOfTest = Components.Schemas.FilterAnyOfTest;
10697
+ export type FilterNotTest = Components.Schemas.FilterNotTest;
10698
+ export type FilterHeaderTest = Components.Schemas.FilterHeaderTest;
10699
+ export type FilterAddressTest = Components.Schemas.FilterAddressTest;
10700
+ export type FilterHasWordsTest = Components.Schemas.FilterHasWordsTest;
10512
10701
  export type FilterResponse = Components.Schemas.FilterResponse;
10513
10702
  export type CreateFilterInput = Components.Schemas.CreateFilterInput;
10514
10703
  export type CreateFilterResponse = Components.Schemas.CreateFilterResponse;
@@ -10560,6 +10749,10 @@ export type UpdateUserSettingsInput = Components.Schemas.UpdateUserSettingsInput
10560
10749
  export type ClassificationTestInput = Components.Schemas.ClassificationTestInput;
10561
10750
  export type ClassificationTestPassed = Components.Schemas.ClassificationTestPassed;
10562
10751
  export type ClassificationTestFailed = Components.Schemas.ClassificationTestFailed;
10752
+ export type ClassifierStats = Components.Schemas.ClassifierStats;
10753
+ export type ClassifierCategoryCount = Components.Schemas.ClassifierCategoryCount;
10754
+ export type ClassifierLabelCount = Components.Schemas.ClassifierLabelCount;
10755
+ export type ClassifierCorrections = Components.Schemas.ClassifierCorrections;
10563
10756
  export type CalendarTaskListResponse = Components.Schemas.CalendarTaskListResponse;
10564
10757
  export type CalendarTask = Components.Schemas.CalendarTask;
10565
10758
  export type CalendarTaskResponse = Components.Schemas.CalendarTaskResponse;
@@ -10613,6 +10806,7 @@ export type MessageRecord = Components.Schemas.MessageRecord;
10613
10806
  export type MessageAuthResult = Components.Schemas.MessageAuthResult;
10614
10807
  export type MessageProviderSpam = Components.Schemas.MessageProviderSpam;
10615
10808
  export type MessageFilterMove = Components.Schemas.MessageFilterMove;
10809
+ export type ClassifierScore = Components.Schemas.ClassifierScore;
10616
10810
  export type Message = Components.Schemas.Message;
10617
10811
  export type MessageSummaryResponse = Components.Schemas.MessageSummaryResponse;
10618
10812
  export type EnvelopeResponse = Components.Schemas.EnvelopeResponse;
@@ -10697,6 +10891,9 @@ export type FilterState = Components.Schemas.FilterState;
10697
10891
  export type FilterDisabledReason = Components.Schemas.FilterDisabledReason;
10698
10892
  export type FilterMatchOperator = Components.Schemas.FilterMatchOperator;
10699
10893
  export type FilterClauseField = Components.Schemas.FilterClauseField;
10894
+ export type FilterRuleMatch = Components.Schemas.FilterRuleMatch;
10895
+ export type FilterRuleHeader = Components.Schemas.FilterRuleHeader;
10896
+ export type FilterRuleAddressPart = Components.Schemas.FilterRuleAddressPart;
10700
10897
  export type LabelColor = Components.Schemas.LabelColor;
10701
10898
  export type OrganizeJobState = Components.Schemas.OrganizeJobState;
10702
10899
  export type CalendarColor = Components.Schemas.CalendarColor;
@@ -10720,9 +10917,9 @@ export type ClassificationUnrunnableReason = Components.Schemas.ClassificationUn
10720
10917
  export type ClassificationLabel = Components.Schemas.ClassificationLabel;
10721
10918
  export type ClassificationFailureKind = Components.Schemas.ClassificationFailureKind;
10722
10919
  export type ClassificationField = Components.Schemas.ClassificationField;
10920
+ export type MessageCategory = Components.Schemas.MessageCategory;
10723
10921
  export type SortOrder = Components.Schemas.SortOrder;
10724
10922
  export type StarColor = Components.Schemas.StarColor;
10725
- export type MessageCategory = Components.Schemas.MessageCategory;
10726
10923
  export type SenderTrust = Components.Schemas.SenderTrust;
10727
10924
  export type DisplayNameCorrespondence = Components.Schemas.DisplayNameCorrespondence;
10728
10925
  export type MessageStatus = Components.Schemas.MessageStatus;