@remit/api-openapi-types 0.0.89 → 0.0.91

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 +159 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/api-openapi-types",
3
- "version": "0.0.89",
3
+ "version": "0.0.91",
4
4
  "type": "module",
5
5
  "main": "types.d.ts",
6
6
  "types": "types.d.ts",
package/types.d.ts CHANGED
@@ -225,6 +225,18 @@ current enum emitter anyway, so the wire contract uses the bare form.
225
225
  * The request shape a classification provider speaks. `DecisionApi` returns a calibrated probability per label; `ChatJsonSchema` is an OpenAI-compatible chat completion constrained to the label enum; `JinaClassify` is Jina's `/v1/classify`.
226
226
  */
227
227
  export type ClassificationAdapterShape = "DecisionApi" | "ChatJsonSchema" | "JinaClassify";
228
+ /**
229
+ * A label a classification provider picks for a message: the junk verdicts, priority, and the message categories.
230
+ */
231
+ export type ClassificationLabel = "Spam" | "Phishing" | "Priority" | "Personal" | "Newsletter" | "Marketing" | "Automated" | "Transactional" | "Social";
232
+ /**
233
+ * Why a classification provider call gave no usable answer.
234
+ */
235
+ export type ClassificationFailureKind = "Unauthorized" | "ModelNotFound" | "RateLimited" | "Rejected" | "ProviderError" | "Unreachable" | "TimedOut" | "Unparseable";
236
+ /**
237
+ * The classification provider form field a failure points at.
238
+ */
239
+ export type ClassificationField = "ApiKey" | "Model" | "BaseUrl";
228
240
  /**
229
241
  * Sort order for list operations
230
242
  */
@@ -375,7 +387,7 @@ distinguishable from a network failure without parsing prose.
375
387
  /**
376
388
  * Known user-setting keys. Each maps, in the registry, to a required value kind and a zod schema. New keys are added deliberately by extending this enum and the registry — never as an ad-hoc column.
377
389
  */
378
- export type AccountSettingName = "Theme" | "Density" | "DefaultComposerFormat" | "PinnedFolders" | "AccountSignaturePlainText" | "AccountSignatureHtml" | "AccountDisplayName" | "AccountMuted" | "AccountComposeLanguages" | "MailboxDisplayName" | "MailboxMuted" | "FolderRoleAppointment" | "FolderRoleAppointmentLabel" | "MailboxRole" | "DefaultInvitationSenderAccountId" | "ClassificationPresetId" | "ClassificationModel" | "ClassificationBaseUrl" | "ClassificationApiKey" | "ClassificationEnabled" | "ClassificationDailyLimit";
390
+ export type AccountSettingName = "Theme" | "Density" | "DefaultComposerFormat" | "PinnedFolders" | "AccountSignaturePlainText" | "AccountSignatureHtml" | "AccountDisplayName" | "AccountMuted" | "AccountComposeLanguages" | "MailboxDisplayName" | "MailboxMuted" | "FolderRoleAppointment" | "FolderRoleAppointmentLabel" | "MailboxRole" | "DefaultInvitationSenderAccountId" | "ClassificationPresetId" | "ClassificationModel" | "ClassificationBaseUrl" | "ClassificationApiKey" | "ClassificationEnabled" | "ClassificationDailyLimit" | "ClassificationUsage";
379
391
  /**
380
392
  * Lifecycle of one applied configuration import. An import is Complete the moment every folder reference in the file has been bound to a real mailbox; until then it is Pending, waiting on the IMAP discovery that will produce those mailboxes.
381
393
  */
@@ -3708,6 +3720,40 @@ field on this resource rather than one more operation.
3708
3720
  * When the provider, model, base URL or key was last saved, in epoch milliseconds (UTC).
3709
3721
  */
3710
3722
  savedAt: number;
3723
+ /**
3724
+ * Today's provider calls, one row per mail account of the account config.
3725
+ */
3726
+ usage: ClassificationUsage[];
3727
+ }
3728
+ /**
3729
+ * One mail account's classification calls today.
3730
+ */
3731
+ export interface ClassificationUsage {
3732
+ accountId: UUID;
3733
+ /**
3734
+ * Provider calls made today (UTC). Test calls do not count.
3735
+ */
3736
+ calls: number;
3737
+ /**
3738
+ * The most calls this mail account makes per UTC day.
3739
+ */
3740
+ dailyLimit: number;
3741
+ /**
3742
+ * When `calls` restarts at zero: the next 00:00 UTC.
3743
+ */
3744
+ resetsAt: string;
3745
+ cost: ClassificationCostPriced | ClassificationNoPrice;
3746
+ }
3747
+ /**
3748
+ * The cost of today's calls, counting each call as 1,500 input tokens at the preset's price.
3749
+ */
3750
+ export interface ClassificationCostPriced {
3751
+ state: "Priced";
3752
+ /**
3753
+ * ISO 4217 currency of `amount`.
3754
+ */
3755
+ currency: "USD";
3756
+ amount: number;
3711
3757
  }
3712
3758
  /**
3713
3759
  * A change to the caller's settings. Every field is optional and absence means untouched.
@@ -3742,6 +3788,65 @@ field on this resource rather than one more operation.
3742
3788
  */
3743
3789
  classificationDailyLimit?: number;
3744
3790
  }
3791
+ /**
3792
+ * The classification provider form as it stands, saved or not.
3793
+ */
3794
+ export interface ClassificationTestInput {
3795
+ presetId: ClassificationPresetId;
3796
+ /**
3797
+ * The model to ask for. Empty means the preset's default model.
3798
+ */
3799
+ model: string;
3800
+ /**
3801
+ * The http or https base URL to call. Empty means the preset's default base URL.
3802
+ */
3803
+ baseUrl: string;
3804
+ /**
3805
+ * The provider's API key. Empty means the key saved for this preset.
3806
+ */
3807
+ apiKey: string;
3808
+ }
3809
+ /**
3810
+ * The provider classified the sample message.
3811
+ */
3812
+ export interface ClassificationTestPassed {
3813
+ state: "Passed";
3814
+ /**
3815
+ * How long the provider call took, in milliseconds.
3816
+ */
3817
+ latencyMs: number;
3818
+ /**
3819
+ * The label the provider chose for the sample message.
3820
+ */
3821
+ label: ClassificationLabel;
3822
+ /**
3823
+ * The provider's confidence in `label`, between 0 and 1.
3824
+ */
3825
+ confidence: number;
3826
+ }
3827
+ /**
3828
+ * The provider call gave no usable answer.
3829
+ */
3830
+ export interface ClassificationTestFailed {
3831
+ state: "Failed";
3832
+ /**
3833
+ * How long the provider call took, in milliseconds.
3834
+ */
3835
+ latencyMs: number;
3836
+ /**
3837
+ * The HTTP status the provider answered with. Absent when no answer arrived.
3838
+ */
3839
+ status?: number;
3840
+ kind: ClassificationFailureKind;
3841
+ /**
3842
+ * The form field to change. Absent when no field can fix it: a rate limit or a provider error.
3843
+ */
3844
+ field?: ClassificationField;
3845
+ /**
3846
+ * What to change so the next test passes.
3847
+ */
3848
+ fix: string;
3849
+ }
3745
3850
  /**
3746
3851
  * Tasks due in the requested window, in due order. Unpaginated: the window is the bound.
3747
3852
  */
@@ -6603,6 +6708,23 @@ of copying it, and so a person can see what was imported after the fact.
6603
6708
  kind: "MutedFlag";
6604
6709
  value: MutedFlag;
6605
6710
  }
6711
+ /**
6712
+ * A count that restarts every UTC day.
6713
+ */
6714
+ export interface DailyCount {
6715
+ /**
6716
+ * The UTC date the count belongs to.
6717
+ */
6718
+ date: string;
6719
+ calls: number;
6720
+ }
6721
+ /**
6722
+ * DailyCount-valued setting: a count for one UTC date.
6723
+ */
6724
+ export interface DailyCountSetting {
6725
+ kind: "DailyCount";
6726
+ value: DailyCount;
6727
+ }
6606
6728
  /**
6607
6729
  * A single user setting for an account configuration. One row per (accountConfigId, name); the primary key is a deterministic UUID v5 of that pair, so writes are idempotent upserts.
6608
6730
  */
@@ -6622,7 +6744,7 @@ of copying it, and so a person can see what was imported after the fact.
6622
6744
  /**
6623
6745
  * Typed setting value
6624
6746
  */
6625
- value: BooleanSetting | StringSetting | NumberSetting | StringListSetting | MapSetting | MutedFlagSetting;
6747
+ value: BooleanSetting | StringSetting | NumberSetting | StringListSetting | MapSetting | MutedFlagSetting | DailyCountSetting;
6626
6748
  createdAt: number;
6627
6749
  updatedAt: number;
6628
6750
  }
@@ -7801,6 +7923,13 @@ declare namespace Paths {
7801
7923
  export type $401 = void;
7802
7924
  }
7803
7925
  }
7926
+ namespace TestClassificationProvider {
7927
+ export type RequestBody = Components.Schemas.ClassificationTestInput;
7928
+ namespace Responses {
7929
+ export type $400 = void;
7930
+ export type $401 = void;
7931
+ }
7932
+ }
7804
7933
  namespace ListCalendarTasks {
7805
7934
  export interface QueryParameters {
7806
7935
  from: string;
@@ -8796,6 +8925,14 @@ reader organizes the event, none otherwise.
8796
8925
  data?: any,
8797
8926
  config?: AxiosRequestConfig
8798
8927
  ): OperationResponse<Paths.ClearClassificationProvider.Responses.$200>;
8928
+ /**
8929
+ * testClassificationProvider - Classify one built-in sample message with the form values, saved or not, and answer with the label or the failure. An empty key uses the saved key. Saved settings stay as they were, and the call counts toward no daily limit.
8930
+ */
8931
+ 'testClassificationProvider'(
8932
+ parameters?: Parameters<UnknownParamsObject> | null,
8933
+ data?: Paths.TestClassificationProvider.RequestBody,
8934
+ config?: AxiosRequestConfig
8935
+ ): OperationResponse<any>;
8799
8936
  /**
8800
8937
  * 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.
8801
8938
  */
@@ -9765,6 +9902,16 @@ reader organizes the event, none otherwise.
9765
9902
  config?: AxiosRequestConfig
9766
9903
  ): OperationResponse<Paths.ClearClassificationProvider.Responses.$200>;
9767
9904
  };
9905
+ ['/settings/classification-test']: {
9906
+ /**
9907
+ * testClassificationProvider - Classify one built-in sample message with the form values, saved or not, and answer with the label or the failure. An empty key uses the saved key. Saved settings stay as they were, and the call counts toward no daily limit.
9908
+ */
9909
+ 'post'(
9910
+ parameters?: Parameters<UnknownParamsObject> | null,
9911
+ data?: Paths.TestClassificationProvider.RequestBody,
9912
+ config?: AxiosRequestConfig
9913
+ ): OperationResponse<any>;
9914
+ };
9768
9915
  ['/calendar-tasks']: {
9769
9916
  /**
9770
9917
  * 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.
@@ -10381,7 +10528,12 @@ export type ClassificationPriced = Components.Schemas.ClassificationPriced;
10381
10528
  export type ClassificationNoPrice = Components.Schemas.ClassificationNoPrice;
10382
10529
  export type ClassificationNotConfigured = Components.Schemas.ClassificationNotConfigured;
10383
10530
  export type ClassificationConfigured = Components.Schemas.ClassificationConfigured;
10531
+ export type ClassificationUsage = Components.Schemas.ClassificationUsage;
10532
+ export type ClassificationCostPriced = Components.Schemas.ClassificationCostPriced;
10384
10533
  export type UpdateUserSettingsInput = Components.Schemas.UpdateUserSettingsInput;
10534
+ export type ClassificationTestInput = Components.Schemas.ClassificationTestInput;
10535
+ export type ClassificationTestPassed = Components.Schemas.ClassificationTestPassed;
10536
+ export type ClassificationTestFailed = Components.Schemas.ClassificationTestFailed;
10385
10537
  export type CalendarTaskListResponse = Components.Schemas.CalendarTaskListResponse;
10386
10538
  export type CalendarTask = Components.Schemas.CalendarTask;
10387
10539
  export type CalendarTaskResponse = Components.Schemas.CalendarTaskResponse;
@@ -10468,6 +10620,8 @@ export type NumberSetting = Components.Schemas.NumberSetting;
10468
10620
  export type StringListSetting = Components.Schemas.StringListSetting;
10469
10621
  export type MapSetting = Components.Schemas.MapSetting;
10470
10622
  export type MutedFlagSetting = Components.Schemas.MutedFlagSetting;
10623
+ export type DailyCount = Components.Schemas.DailyCount;
10624
+ export type DailyCountSetting = Components.Schemas.DailyCountSetting;
10471
10625
  export type AccountSetting = Components.Schemas.AccountSetting;
10472
10626
  export type MailboxAttributeEntry = Components.Schemas.MailboxAttributeEntry;
10473
10627
  export type MailboxSpecialUseEntry = Components.Schemas.MailboxSpecialUseEntry;
@@ -10535,6 +10689,9 @@ export type CalendarInviteAnswer = Components.Schemas.CalendarInviteAnswer;
10535
10689
  export type ClassificationPresetId = Components.Schemas.ClassificationPresetId;
10536
10690
  export type ClassificationPresetGroup = Components.Schemas.ClassificationPresetGroup;
10537
10691
  export type ClassificationAdapterShape = Components.Schemas.ClassificationAdapterShape;
10692
+ export type ClassificationLabel = Components.Schemas.ClassificationLabel;
10693
+ export type ClassificationFailureKind = Components.Schemas.ClassificationFailureKind;
10694
+ export type ClassificationField = Components.Schemas.ClassificationField;
10538
10695
  export type SortOrder = Components.Schemas.SortOrder;
10539
10696
  export type StarColor = Components.Schemas.StarColor;
10540
10697
  export type MessageCategory = Components.Schemas.MessageCategory;