@remit/api-openapi-spec 0.0.85 → 0.0.87

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.
package/openapi.json CHANGED
@@ -6559,6 +6559,63 @@
6559
6559
  }
6560
6560
  }
6561
6561
  },
6562
+ "/settings/classification-test": {
6563
+ "post": {
6564
+ "operationId": "UserSettingsOperations_testClassificationProvider",
6565
+ "description": "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.",
6566
+ "parameters": [],
6567
+ "responses": {
6568
+ "200": {
6569
+ "description": "The request has succeeded.",
6570
+ "content": {
6571
+ "application/json": {
6572
+ "schema": {
6573
+ "$ref": "#/components/schemas/RemitImap.ClassificationTestResponse"
6574
+ }
6575
+ }
6576
+ }
6577
+ },
6578
+ "400": {
6579
+ "description": "The request was refused as malformed or contradictory. `code` is\n`invalid_request` where nothing more specific is known, and the refusal's own\ntoken where there is one.\n\nThe calendar surface answers with the reason it read the request by:\n`invalid_window`, `invalid_scope`, `invalid_url_segment`, `url_segment_taken`,\n`unknown_time_zone` and `default_calendar_undeletable` on the collection and\nthe query, and, for a VCALENDAR it could not accept,\n`malformed_icalendar`, `not_a_calendar`, `unsupported_component`, `no_event`,\n`no_master_event`, `multiple_master_events`, `missing_uid`, `mismatched_uid`,\n`missing_dt_start`, `backwards_end`, `invalid_date_time`,\n`invalid_recurrence_rule`, `missing_recurrence_id`, `not_recurring`,\n`unknown_occurrence` and `unmovable_recurrence_rule`. The outbox answers `mail_sync_off` to a\nsend from an account whose `syncedServices` leave out `Mail`, with the\naccount in `details.accountId`.\n\n`errors` is present only when the request failed schema validation before any\nhandler ran, and names every field that was refused.",
6580
+ "content": {
6581
+ "application/json": {
6582
+ "schema": {
6583
+ "$ref": "#/components/schemas/ValidationError"
6584
+ }
6585
+ }
6586
+ }
6587
+ },
6588
+ "401": {
6589
+ "description": "The request carried no usable credential. `code` is `unauthorized`.",
6590
+ "content": {
6591
+ "application/json": {
6592
+ "schema": {
6593
+ "$ref": "#/components/schemas/ApiError"
6594
+ }
6595
+ }
6596
+ }
6597
+ }
6598
+ },
6599
+ "requestBody": {
6600
+ "required": true,
6601
+ "content": {
6602
+ "application/json": {
6603
+ "schema": {
6604
+ "$ref": "#/components/schemas/RemitImap.ClassificationTestInput"
6605
+ }
6606
+ }
6607
+ }
6608
+ },
6609
+ "x-amazon-apigateway-integration": {
6610
+ "type": "aws_proxy",
6611
+ "httpMethod": "POST",
6612
+ "passthroughBehavior": "when_no_match",
6613
+ "uri": {
6614
+ "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:{{HandlerFunctionName}}/invocations"
6615
+ }
6616
+ }
6617
+ }
6618
+ },
6562
6619
  "/settings/default-invitation-sender": {
6563
6620
  "delete": {
6564
6621
  "operationId": "UserSettingsOperations_clearDefaultInvitationSender",
@@ -9404,7 +9461,8 @@
9404
9461
  "apiKeySaved",
9405
9462
  "enabled",
9406
9463
  "dailyLimit",
9407
- "savedAt"
9464
+ "savedAt",
9465
+ "usage"
9408
9466
  ],
9409
9467
  "properties": {
9410
9468
  "state": {
@@ -9439,10 +9497,93 @@
9439
9497
  "type": "integer",
9440
9498
  "format": "int64",
9441
9499
  "description": "When the provider, model, base URL or key was last saved, in epoch milliseconds (UTC)."
9500
+ },
9501
+ "usage": {
9502
+ "type": "array",
9503
+ "items": {
9504
+ "$ref": "#/components/schemas/RemitImap.ClassificationUsage"
9505
+ },
9506
+ "description": "Today's provider calls, one row per mail account of the account config."
9442
9507
  }
9443
9508
  },
9444
9509
  "description": "The saved classification provider. The API key itself is never returned."
9445
9510
  },
9511
+ "RemitImap.ClassificationCost": {
9512
+ "anyOf": [
9513
+ {
9514
+ "$ref": "#/components/schemas/RemitImap.ClassificationCostPriced"
9515
+ },
9516
+ {
9517
+ "$ref": "#/components/schemas/RemitImap.ClassificationNoPrice"
9518
+ }
9519
+ ]
9520
+ },
9521
+ "RemitImap.ClassificationCostPriced": {
9522
+ "type": "object",
9523
+ "required": [
9524
+ "state",
9525
+ "currency",
9526
+ "amount"
9527
+ ],
9528
+ "properties": {
9529
+ "state": {
9530
+ "type": "string",
9531
+ "enum": [
9532
+ "Priced"
9533
+ ]
9534
+ },
9535
+ "currency": {
9536
+ "type": "string",
9537
+ "enum": [
9538
+ "USD"
9539
+ ],
9540
+ "description": "ISO 4217 currency of `amount`."
9541
+ },
9542
+ "amount": {
9543
+ "type": "number",
9544
+ "format": "double"
9545
+ }
9546
+ },
9547
+ "description": "The cost of today's calls, counting each call as 1,500 input tokens at the preset's price."
9548
+ },
9549
+ "RemitImap.ClassificationFailureKind": {
9550
+ "type": "string",
9551
+ "enum": [
9552
+ "Unauthorized",
9553
+ "ModelNotFound",
9554
+ "RateLimited",
9555
+ "Rejected",
9556
+ "ProviderError",
9557
+ "Unreachable",
9558
+ "TimedOut",
9559
+ "Unparseable"
9560
+ ],
9561
+ "description": "Why a classification provider call gave no usable answer."
9562
+ },
9563
+ "RemitImap.ClassificationField": {
9564
+ "type": "string",
9565
+ "enum": [
9566
+ "ApiKey",
9567
+ "Model",
9568
+ "BaseUrl"
9569
+ ],
9570
+ "description": "The classification provider form field a failure points at."
9571
+ },
9572
+ "RemitImap.ClassificationLabel": {
9573
+ "type": "string",
9574
+ "enum": [
9575
+ "Spam",
9576
+ "Phishing",
9577
+ "Priority",
9578
+ "Personal",
9579
+ "Newsletter",
9580
+ "Marketing",
9581
+ "Automated",
9582
+ "Transactional",
9583
+ "Social"
9584
+ ],
9585
+ "description": "A label a classification provider picks for a message: the junk verdicts, priority, and the message categories."
9586
+ },
9446
9587
  "RemitImap.ClassificationNoPrice": {
9447
9588
  "type": "object",
9448
9589
  "required": [
@@ -9585,6 +9726,156 @@
9585
9726
  }
9586
9727
  ]
9587
9728
  },
9729
+ "RemitImap.ClassificationTestFailed": {
9730
+ "type": "object",
9731
+ "required": [
9732
+ "state",
9733
+ "latencyMs",
9734
+ "kind",
9735
+ "fix"
9736
+ ],
9737
+ "properties": {
9738
+ "state": {
9739
+ "type": "string",
9740
+ "enum": [
9741
+ "Failed"
9742
+ ]
9743
+ },
9744
+ "latencyMs": {
9745
+ "type": "integer",
9746
+ "format": "int32",
9747
+ "description": "How long the provider call took, in milliseconds."
9748
+ },
9749
+ "status": {
9750
+ "type": "integer",
9751
+ "format": "int32",
9752
+ "description": "The HTTP status the provider answered with. Absent when no answer arrived."
9753
+ },
9754
+ "kind": {
9755
+ "$ref": "#/components/schemas/RemitImap.ClassificationFailureKind"
9756
+ },
9757
+ "field": {
9758
+ "allOf": [
9759
+ {
9760
+ "$ref": "#/components/schemas/RemitImap.ClassificationField"
9761
+ }
9762
+ ],
9763
+ "description": "The form field to change. Absent when no field can fix it: a rate limit or a provider error."
9764
+ },
9765
+ "fix": {
9766
+ "type": "string",
9767
+ "description": "What to change so the next test passes."
9768
+ }
9769
+ },
9770
+ "description": "The provider call gave no usable answer."
9771
+ },
9772
+ "RemitImap.ClassificationTestInput": {
9773
+ "type": "object",
9774
+ "required": [
9775
+ "presetId",
9776
+ "model",
9777
+ "baseUrl",
9778
+ "apiKey"
9779
+ ],
9780
+ "properties": {
9781
+ "presetId": {
9782
+ "$ref": "#/components/schemas/RemitImap.ClassificationPresetId"
9783
+ },
9784
+ "model": {
9785
+ "type": "string",
9786
+ "description": "The model to ask for. Empty means the preset's default model."
9787
+ },
9788
+ "baseUrl": {
9789
+ "type": "string",
9790
+ "description": "The http or https base URL to call. Empty means the preset's default base URL."
9791
+ },
9792
+ "apiKey": {
9793
+ "type": "string",
9794
+ "description": "The provider's API key. Empty means the key saved for this preset."
9795
+ }
9796
+ },
9797
+ "description": "The classification provider form as it stands, saved or not."
9798
+ },
9799
+ "RemitImap.ClassificationTestPassed": {
9800
+ "type": "object",
9801
+ "required": [
9802
+ "state",
9803
+ "latencyMs",
9804
+ "label",
9805
+ "confidence"
9806
+ ],
9807
+ "properties": {
9808
+ "state": {
9809
+ "type": "string",
9810
+ "enum": [
9811
+ "Passed"
9812
+ ]
9813
+ },
9814
+ "latencyMs": {
9815
+ "type": "integer",
9816
+ "format": "int32",
9817
+ "description": "How long the provider call took, in milliseconds."
9818
+ },
9819
+ "label": {
9820
+ "allOf": [
9821
+ {
9822
+ "$ref": "#/components/schemas/RemitImap.ClassificationLabel"
9823
+ }
9824
+ ],
9825
+ "description": "The label the provider chose for the sample message."
9826
+ },
9827
+ "confidence": {
9828
+ "type": "number",
9829
+ "format": "double",
9830
+ "description": "The provider's confidence in `label`, between 0 and 1."
9831
+ }
9832
+ },
9833
+ "description": "The provider classified the sample message."
9834
+ },
9835
+ "RemitImap.ClassificationTestResponse": {
9836
+ "anyOf": [
9837
+ {
9838
+ "$ref": "#/components/schemas/RemitImap.ClassificationTestPassed"
9839
+ },
9840
+ {
9841
+ "$ref": "#/components/schemas/RemitImap.ClassificationTestFailed"
9842
+ }
9843
+ ]
9844
+ },
9845
+ "RemitImap.ClassificationUsage": {
9846
+ "type": "object",
9847
+ "required": [
9848
+ "accountId",
9849
+ "calls",
9850
+ "dailyLimit",
9851
+ "resetsAt",
9852
+ "cost"
9853
+ ],
9854
+ "properties": {
9855
+ "accountId": {
9856
+ "$ref": "#/components/schemas/UUID"
9857
+ },
9858
+ "calls": {
9859
+ "type": "integer",
9860
+ "format": "int32",
9861
+ "description": "Provider calls made today (UTC). Test calls do not count."
9862
+ },
9863
+ "dailyLimit": {
9864
+ "type": "integer",
9865
+ "format": "int32",
9866
+ "description": "The most calls this mail account makes per UTC day."
9867
+ },
9868
+ "resetsAt": {
9869
+ "type": "string",
9870
+ "format": "date-time",
9871
+ "description": "When `calls` restarts at zero: the next 00:00 UTC."
9872
+ },
9873
+ "cost": {
9874
+ "$ref": "#/components/schemas/RemitImap.ClassificationCost"
9875
+ }
9876
+ },
9877
+ "description": "One mail account's classification calls today."
9878
+ },
9588
9879
  "RemitImap.ConfigDescriptionResponse": {
9589
9880
  "type": "object",
9590
9881
  "required": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/api-openapi-spec",
3
- "version": "0.0.85",
3
+ "version": "0.0.87",
4
4
  "description": "Remit API OpenAPI 3 document, generated from TypeSpec, and its precompiled request validators.",
5
5
  "exports": {
6
6
  ".": "./openapi.json",