@remit/api-openapi-spec 0.0.35 → 0.0.37

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/openapi.json +242 -2
  2. package/package.json +1 -1
package/openapi.json CHANGED
@@ -1467,6 +1467,63 @@
1467
1467
  }
1468
1468
  }
1469
1469
  },
1470
+ "/config/import": {
1471
+ "post": {
1472
+ "operationId": "ConfigOperations_importConfig",
1473
+ "description": "Validate, or validate and apply, a config document. `mode: validate` (the default) writes nothing and returns the same report an apply would. `onExisting: abort` (the default) refuses with 409 when this configuration already holds accounts, labels, filters or address flags. Nothing is written until the whole document has validated; a write failure after that aborts the remainder and the report names exactly what landed. Imported accounts arrive inactive with `connectionState: credentials_missing` (or `reauth_required` for OAuth) - the credentials the file deliberately omits are re-entered per account afterwards.",
1474
+ "parameters": [],
1475
+ "responses": {
1476
+ "200": {
1477
+ "description": "The request has succeeded.",
1478
+ "content": {
1479
+ "application/json": {
1480
+ "schema": {
1481
+ "$ref": "#/components/schemas/RemitImap.ConfigImportReport"
1482
+ }
1483
+ }
1484
+ }
1485
+ },
1486
+ "400": {
1487
+ "description": "Validation error response",
1488
+ "content": {
1489
+ "application/json": {
1490
+ "schema": {
1491
+ "$ref": "#/components/schemas/ApiError"
1492
+ }
1493
+ }
1494
+ }
1495
+ },
1496
+ "409": {
1497
+ "description": "The import was refused because this configuration is not empty. The body is\nflat: `code`, `message` and `details` sit at the top level.\n\n`code: \"config_not_empty\"` — the configuration already holds an account, a\nlabel, a filter or an address flag. `details` names how many of each. Re-send\nwith `onExisting: merge` to upsert instead.",
1498
+ "content": {
1499
+ "application/json": {
1500
+ "schema": {
1501
+ "$ref": "#/components/schemas/ApiError"
1502
+ }
1503
+ }
1504
+ }
1505
+ }
1506
+ },
1507
+ "requestBody": {
1508
+ "required": true,
1509
+ "content": {
1510
+ "application/json": {
1511
+ "schema": {
1512
+ "$ref": "#/components/schemas/RemitImap.ImportConfigInput"
1513
+ }
1514
+ }
1515
+ }
1516
+ },
1517
+ "x-amazon-apigateway-integration": {
1518
+ "type": "aws_proxy",
1519
+ "httpMethod": "POST",
1520
+ "passthroughBehavior": "when_no_match",
1521
+ "uri": {
1522
+ "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:{{HandlerFunctionName}}/invocations"
1523
+ }
1524
+ }
1525
+ }
1526
+ },
1470
1527
  "/mailboxes/{mailboxId}/threads": {
1471
1528
  "get": {
1472
1529
  "operationId": "ThreadOperations_listThreads",
@@ -1876,6 +1933,16 @@
1876
1933
  }
1877
1934
  }
1878
1935
  }
1936
+ },
1937
+ "409": {
1938
+ "description": "The same flat 409 body, for a message whose folder and uid do not name the same message.\n\n`code: \"message_placement_unsettled\"` — the message is mid-move, so its row names the destination folder while its uid still belongs to the source; acting on that pair would hit whatever the destination holds at that uid. `details` carries `accountId`, `messageId` and `reason`, one of: `in_flight` (the move is still running, and the same request succeeds once it confirms) or `unverified` (the move gave up without confirming, so where the message sits is unknown until the folder is resynced).",
1939
+ "content": {
1940
+ "application/json": {
1941
+ "schema": {
1942
+ "$ref": "#/components/schemas/ApiError"
1943
+ }
1944
+ }
1945
+ }
1879
1946
  }
1880
1947
  },
1881
1948
  "requestBody": {
@@ -1915,7 +1982,7 @@
1915
1982
  }
1916
1983
  },
1917
1984
  "409": {
1918
- "description": "An action was refused because the folder role it needs is not settled. The body is flat: `code`, `message` and `details` sit at the top level, which is what the API emits. Clients branch on `code` and word their prompt from `details`, never from `message`.\n\n`code: \"folder_role_unresolved\"` — no folder holds the role this action needs. `details` carries `role`, `accountId`, and `reason`, one of: `none` (the account has no candidate folder), `stale` (the folder the user appointed is gone from the mail server), `unconfirmed` (a folder matches by name, but neither the user nor the server's own flag ever said it holds the role).",
1985
+ "description": "The same flat 409 body, with the two codes this endpoint can answer with.\n\n`code: \"folder_role_unresolved\"` — as everywhere else, with `details` carrying `role`, `accountId` and `reason`.\n\n`code: \"message_placement_unsettled\"` as `MessagePlacementConflict`, with `details` carrying `accountId`, `messageId` and `reason`.",
1919
1986
  "content": {
1920
1987
  "application/json": {
1921
1988
  "schema": {
@@ -4011,6 +4078,14 @@
4011
4078
  "$ref": "#/components/schemas/RemitImap.AccountResponse"
4012
4079
  },
4013
4080
  "description": "Associated email accounts"
4081
+ },
4082
+ "pendingImport": {
4083
+ "allOf": [
4084
+ {
4085
+ "$ref": "#/components/schemas/RemitImap.PendingConfigImport"
4086
+ }
4087
+ ],
4088
+ "description": "Absent unless a configuration import is still waiting on folders IMAP has not produced yet (#1021). Nothing polls a separate route for it."
4014
4089
  }
4015
4090
  },
4016
4091
  "description": "Full configuration description including accounts"
@@ -4035,6 +4110,113 @@
4035
4110
  },
4036
4111
  "description": "A configuration export: one versioned document carrying every user decision this instance holds, and no credential."
4037
4112
  },
4113
+ "RemitImap.ConfigImportItemReport": {
4114
+ "type": "object",
4115
+ "required": [
4116
+ "section",
4117
+ "key",
4118
+ "verdict"
4119
+ ],
4120
+ "properties": {
4121
+ "section": {
4122
+ "type": "string",
4123
+ "description": "Which section: accounts | labels | filters | addressFlags | settings"
4124
+ },
4125
+ "key": {
4126
+ "type": "string",
4127
+ "description": "Human key of the item - an email, a label name, a filter name"
4128
+ },
4129
+ "verdict": {
4130
+ "type": "string",
4131
+ "description": "created | updated | unchanged | skipped | rejected"
4132
+ },
4133
+ "reason": {
4134
+ "type": "string",
4135
+ "description": "Why, when the verdict is skipped or rejected"
4136
+ }
4137
+ },
4138
+ "description": "What became of one item in the submitted document"
4139
+ },
4140
+ "RemitImap.ConfigImportMode": {
4141
+ "type": "string",
4142
+ "enum": [
4143
+ "validate",
4144
+ "apply"
4145
+ ],
4146
+ "description": "Whether an import writes. The default is the dry run, so the wizard can show what a file would do before anything lands."
4147
+ },
4148
+ "RemitImap.ConfigImportOnExisting": {
4149
+ "type": "string",
4150
+ "enum": [
4151
+ "abort",
4152
+ "merge"
4153
+ ],
4154
+ "description": "What an import does when the configuration it is importing into is not empty."
4155
+ },
4156
+ "RemitImap.ConfigImportReport": {
4157
+ "type": "object",
4158
+ "required": [
4159
+ "valid",
4160
+ "schemaVersion",
4161
+ "applied",
4162
+ "items",
4163
+ "errors",
4164
+ "warnings",
4165
+ "accountsNeedingCredentials"
4166
+ ],
4167
+ "properties": {
4168
+ "importId": {
4169
+ "allOf": [
4170
+ {
4171
+ "$ref": "#/components/schemas/UUID"
4172
+ }
4173
+ ],
4174
+ "description": "Import identity; present on apply, so the folder bindings this import is still waiting on can be named later"
4175
+ },
4176
+ "valid": {
4177
+ "type": "boolean",
4178
+ "description": "Whether the document is importable at all"
4179
+ },
4180
+ "schemaVersion": {
4181
+ "type": "integer",
4182
+ "format": "int32",
4183
+ "description": "Schema version of the submitted document"
4184
+ },
4185
+ "applied": {
4186
+ "type": "boolean",
4187
+ "description": "Whether anything was written"
4188
+ },
4189
+ "items": {
4190
+ "type": "array",
4191
+ "items": {
4192
+ "$ref": "#/components/schemas/RemitImap.ConfigImportItemReport"
4193
+ },
4194
+ "description": "Per-item verdicts"
4195
+ },
4196
+ "errors": {
4197
+ "type": "array",
4198
+ "items": {
4199
+ "$ref": "#/components/schemas/ApiError"
4200
+ },
4201
+ "description": "Blocking problems; non-empty means nothing was written"
4202
+ },
4203
+ "warnings": {
4204
+ "type": "array",
4205
+ "items": {
4206
+ "$ref": "#/components/schemas/ApiError"
4207
+ },
4208
+ "description": "Non-blocking notes - e.g. a folder path this account does not hold yet"
4209
+ },
4210
+ "accountsNeedingCredentials": {
4211
+ "type": "array",
4212
+ "items": {
4213
+ "$ref": "#/components/schemas/UUID"
4214
+ },
4215
+ "description": "Accounts that landed needing a credential before they can sync"
4216
+ }
4217
+ },
4218
+ "description": "The outcome of a validate or an apply. A rejected document is an answer, not a failure: `valid` is false and `errors` says why."
4219
+ },
4038
4220
  "RemitImap.ConnectionState": {
4039
4221
  "type": "string",
4040
4222
  "enum": [
@@ -4042,7 +4224,8 @@
4042
4224
  "authenticated",
4043
4225
  "selected",
4044
4226
  "logout",
4045
- "reauth_required"
4227
+ "reauth_required",
4228
+ "credentials_missing"
4046
4229
  ],
4047
4230
  "description": "IMAP connection states per RFC 9051 Section 3"
4048
4231
  },
@@ -4935,6 +5118,38 @@
4935
5118
  ],
4936
5119
  "description": "Where a resolved FolderAppointment came from. Total and required: every role carries one, so a surface can tell a folder somebody chose from a folder reader guessed without inferring it from which fields happen to be present."
4937
5120
  },
5121
+ "RemitImap.ImportConfigInput": {
5122
+ "type": "object",
5123
+ "required": [
5124
+ "document"
5125
+ ],
5126
+ "properties": {
5127
+ "mode": {
5128
+ "allOf": [
5129
+ {
5130
+ "$ref": "#/components/schemas/RemitImap.ConfigImportMode"
5131
+ }
5132
+ ],
5133
+ "description": "`validate` writes nothing; `apply` writes.",
5134
+ "default": "validate"
5135
+ },
5136
+ "onExisting": {
5137
+ "allOf": [
5138
+ {
5139
+ "$ref": "#/components/schemas/RemitImap.ConfigImportOnExisting"
5140
+ }
5141
+ ],
5142
+ "description": "What to do when this configuration is not empty.",
5143
+ "default": "abort"
5144
+ },
5145
+ "document": {
5146
+ "type": "object",
5147
+ "additionalProperties": {},
5148
+ "description": "The config document, as exported."
5149
+ }
5150
+ },
5151
+ "description": "Request body for POST /config/import"
5152
+ },
4938
5153
  "RemitImap.JunkOnlyFlag": {
4939
5154
  "type": "object",
4940
5155
  "required": [
@@ -6203,6 +6418,31 @@
6203
6418
  ],
6204
6419
  "description": "Status of an outbox message in the send queue"
6205
6420
  },
6421
+ "RemitImap.PendingConfigImport": {
6422
+ "type": "object",
6423
+ "required": [
6424
+ "importId",
6425
+ "folderPaths"
6426
+ ],
6427
+ "properties": {
6428
+ "importId": {
6429
+ "allOf": [
6430
+ {
6431
+ "$ref": "#/components/schemas/UUID"
6432
+ }
6433
+ ],
6434
+ "description": "The import still waiting"
6435
+ },
6436
+ "folderPaths": {
6437
+ "type": "array",
6438
+ "items": {
6439
+ "type": "string"
6440
+ },
6441
+ "description": "The IMAP paths no mailbox answers to yet, deduplicated"
6442
+ }
6443
+ },
6444
+ "description": "An import that is still waiting for IMAP discovery to produce the folders its\nfile named. The folder appointed to a role, a folder's own display name or\nmute, and a filter's move destination are all bound by path; a path this\naccount does not hold yet is kept, not guessed, and bound the moment discovery\nfinds it."
6445
+ },
6206
6446
  "RemitImap.PlacementAction": {
6207
6447
  "type": "string",
6208
6448
  "enum": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/api-openapi-spec",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
4
4
  "description": "Remit API OpenAPI 3 document, generated from TypeSpec.",
5
5
  "exports": {
6
6
  ".": "./openapi.json",