@remit/api-openapi-spec 0.0.36 → 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 +231 -1
  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",
@@ -4021,6 +4078,14 @@
4021
4078
  "$ref": "#/components/schemas/RemitImap.AccountResponse"
4022
4079
  },
4023
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."
4024
4089
  }
4025
4090
  },
4026
4091
  "description": "Full configuration description including accounts"
@@ -4045,6 +4110,113 @@
4045
4110
  },
4046
4111
  "description": "A configuration export: one versioned document carrying every user decision this instance holds, and no credential."
4047
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
+ },
4048
4220
  "RemitImap.ConnectionState": {
4049
4221
  "type": "string",
4050
4222
  "enum": [
@@ -4052,7 +4224,8 @@
4052
4224
  "authenticated",
4053
4225
  "selected",
4054
4226
  "logout",
4055
- "reauth_required"
4227
+ "reauth_required",
4228
+ "credentials_missing"
4056
4229
  ],
4057
4230
  "description": "IMAP connection states per RFC 9051 Section 3"
4058
4231
  },
@@ -4945,6 +5118,38 @@
4945
5118
  ],
4946
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."
4947
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
+ },
4948
5153
  "RemitImap.JunkOnlyFlag": {
4949
5154
  "type": "object",
4950
5155
  "required": [
@@ -6213,6 +6418,31 @@
6213
6418
  ],
6214
6419
  "description": "Status of an outbox message in the send queue"
6215
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
+ },
6216
6446
  "RemitImap.PlacementAction": {
6217
6447
  "type": "string",
6218
6448
  "enum": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/api-openapi-spec",
3
- "version": "0.0.36",
3
+ "version": "0.0.37",
4
4
  "description": "Remit API OpenAPI 3 document, generated from TypeSpec.",
5
5
  "exports": {
6
6
  ".": "./openapi.json",