Skip to content

Commit 41f6f68

Browse files
committed
👽️(api) update openapi schema and api client
Run `make api-update`
1 parent 52d7ab9 commit 41f6f68

17 files changed

+1052
-30
lines changed

src/backend/core/api/openapi.json

Lines changed: 273 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,90 @@
144144
}
145145
}
146146
},
147+
"/api/v1.0/contacts/": {
148+
"get": {
149+
"operationId": "contacts_list",
150+
"description": "List contacts with optional filtering by mailbox and search query.\n\nQuery parameters:\n- mailbox_id: Optional UUID to filter contacts by mailbox\n- q: Optional search query for name or email (case insensitive)",
151+
"parameters": [
152+
{
153+
"in": "query",
154+
"name": "mailbox_id",
155+
"schema": {
156+
"type": "string",
157+
"format": "uuid"
158+
},
159+
"description": "Filter contacts by mailbox ID."
160+
},
161+
{
162+
"in": "query",
163+
"name": "q",
164+
"schema": {
165+
"type": "string"
166+
},
167+
"description": "Search contacts by name or email (case insensitive)."
168+
}
169+
],
170+
"tags": [
171+
"contacts"
172+
],
173+
"security": [
174+
{
175+
"cookieAuth": []
176+
}
177+
],
178+
"responses": {
179+
"200": {
180+
"content": {
181+
"application/json": {
182+
"schema": {
183+
"type": "array",
184+
"items": {
185+
"$ref": "#/components/schemas/Contact"
186+
}
187+
}
188+
}
189+
},
190+
"description": ""
191+
}
192+
}
193+
}
194+
},
195+
"/api/v1.0/contacts/{id}/": {
196+
"get": {
197+
"operationId": "contacts_retrieve",
198+
"description": "ViewSet for Contact model.",
199+
"parameters": [
200+
{
201+
"in": "path",
202+
"name": "id",
203+
"schema": {
204+
"type": "string"
205+
},
206+
"required": true
207+
}
208+
],
209+
"tags": [
210+
"contacts"
211+
],
212+
"security": [
213+
{
214+
"cookieAuth": []
215+
}
216+
],
217+
"responses": {
218+
"200": {
219+
"content": {
220+
"application/json": {
221+
"schema": {
222+
"$ref": "#/components/schemas/Contact"
223+
}
224+
}
225+
},
226+
"description": ""
227+
}
228+
}
229+
}
230+
},
147231
"/api/v1.0/draft/": {
148232
"post": {
149233
"operationId": "draft_create",
@@ -2244,7 +2328,7 @@
22442328
},
22452329
"post": {
22462330
"operationId": "maildomains_mailboxes_create",
2247-
"description": "ViewSet for managing Mailboxes within a specific MailDomain.\nNested under /maildomains/{maildomain_pk}/mailboxes/\nPermissions are checked by IsMailDomainAdmin for the maildomain_pk.\n\nThis viewset serves a different purpose than the one in mailbox.py (/api/v1.0/mailboxes/).\nThat other one is for listing the mailboxes a user has access to in regular app use.\nThis one is for managing mailboxes within a specific maildomain in the admin interface.",
2331+
"description": "Create new mailbox in a specific maildomain.",
22482332
"parameters": [
22492333
{
22502334
"in": "path",
@@ -2259,21 +2343,36 @@
22592343
"tags": [
22602344
"maildomains"
22612345
],
2346+
"requestBody": {
2347+
"content": {
2348+
"application/json": {
2349+
"schema": {
2350+
"$ref": "#/components/schemas/MailboxAdminCreatePayloadRequest"
2351+
}
2352+
},
2353+
"multipart/form-data": {
2354+
"schema": {
2355+
"$ref": "#/components/schemas/MailboxAdminCreatePayloadRequest"
2356+
}
2357+
}
2358+
},
2359+
"required": true
2360+
},
22622361
"security": [
22632362
{
22642363
"cookieAuth": []
22652364
}
22662365
],
22672366
"responses": {
2268-
"201": {
2367+
"200": {
22692368
"content": {
22702369
"application/json": {
22712370
"schema": {
2272-
"$ref": "#/components/schemas/MailboxAdmin"
2371+
"$ref": "#/components/schemas/MailboxAdminCreate"
22732372
}
22742373
}
22752374
},
2276-
"description": ""
2375+
"description": "The new mailbox with one extra field `one_time_password` if identity provider is keycloak."
22772376
}
22782377
}
22792378
}
@@ -2453,6 +2552,54 @@
24532552
}
24542553
}
24552554
},
2555+
"/api/v1.0/maildomains/{maildomain_pk}/users/": {
2556+
"get": {
2557+
"operationId": "maildomains_users_list",
2558+
"description": "Search users by email, first name and last name.",
2559+
"parameters": [
2560+
{
2561+
"in": "path",
2562+
"name": "maildomain_pk",
2563+
"schema": {
2564+
"type": "string",
2565+
"format": "uuid"
2566+
},
2567+
"required": true
2568+
},
2569+
{
2570+
"in": "query",
2571+
"name": "q",
2572+
"schema": {
2573+
"type": "string"
2574+
},
2575+
"description": "Search maildomains user by full name, short name or email."
2576+
}
2577+
],
2578+
"tags": [
2579+
"admin-maildomain-user"
2580+
],
2581+
"security": [
2582+
{
2583+
"cookieAuth": []
2584+
}
2585+
],
2586+
"responses": {
2587+
"200": {
2588+
"content": {
2589+
"application/json": {
2590+
"schema": {
2591+
"type": "array",
2592+
"items": {
2593+
"$ref": "#/components/schemas/User"
2594+
}
2595+
}
2596+
}
2597+
},
2598+
"description": ""
2599+
}
2600+
}
2601+
}
2602+
},
24562603
"/api/v1.0/messages/": {
24572604
"get": {
24582605
"operationId": "messages_list",
@@ -3983,6 +4130,107 @@
39834130
"updated_at"
39844131
]
39854132
},
4133+
"MailboxAdminCreate": {
4134+
"type": "object",
4135+
"description": "Serialize Mailbox details for create admin endpoint, including users with access and\nmetadata.",
4136+
"properties": {
4137+
"id": {
4138+
"type": "string",
4139+
"format": "uuid",
4140+
"readOnly": true,
4141+
"description": "primary key for the record as UUID"
4142+
},
4143+
"local_part": {
4144+
"type": "string",
4145+
"readOnly": true
4146+
},
4147+
"domain_name": {
4148+
"type": "string",
4149+
"readOnly": true
4150+
},
4151+
"alias_of": {
4152+
"type": "string",
4153+
"format": "uuid",
4154+
"description": "primary key for the record as UUID",
4155+
"readOnly": true,
4156+
"nullable": true
4157+
},
4158+
"accesses": {
4159+
"type": "array",
4160+
"items": {
4161+
"$ref": "#/components/schemas/MailboxAccessNestedUser"
4162+
},
4163+
"readOnly": true
4164+
},
4165+
"created_at": {
4166+
"type": "string",
4167+
"format": "date-time",
4168+
"readOnly": true,
4169+
"title": "Created on",
4170+
"description": "date and time at which a record was created"
4171+
},
4172+
"updated_at": {
4173+
"type": "string",
4174+
"format": "date-time",
4175+
"readOnly": true,
4176+
"title": "Updated on",
4177+
"description": "date and time at which a record was last updated"
4178+
},
4179+
"one_time_password": {
4180+
"type": "string",
4181+
"nullable": true,
4182+
"description": "Fake method just to make the OpenAPI schema valid.",
4183+
"readOnly": true
4184+
}
4185+
},
4186+
"required": [
4187+
"accesses",
4188+
"alias_of",
4189+
"created_at",
4190+
"domain_name",
4191+
"id",
4192+
"local_part",
4193+
"one_time_password",
4194+
"updated_at"
4195+
]
4196+
},
4197+
"MailboxAdminCreateMetadataRequest": {
4198+
"type": "object",
4199+
"properties": {
4200+
"type": {
4201+
"$ref": "#/components/schemas/TypeEnum"
4202+
},
4203+
"first_name": {
4204+
"type": "string"
4205+
},
4206+
"last_name": {
4207+
"type": "string"
4208+
}
4209+
},
4210+
"required": [
4211+
"type"
4212+
]
4213+
},
4214+
"MailboxAdminCreatePayloadRequest": {
4215+
"type": "object",
4216+
"properties": {
4217+
"local_part": {
4218+
"type": "string",
4219+
"minLength": 1
4220+
},
4221+
"alias_of": {
4222+
"type": "string",
4223+
"format": "uuid"
4224+
},
4225+
"metadata": {
4226+
"$ref": "#/components/schemas/MailboxAdminCreateMetadataRequest"
4227+
}
4228+
},
4229+
"required": [
4230+
"local_part",
4231+
"metadata"
4232+
]
4233+
},
39864234
"MailboxLight": {
39874235
"type": "object",
39884236
"description": "Serializer for mailbox details in thread access.",
@@ -4032,7 +4280,8 @@
40324280
},
40334281
"subject": {
40344282
"type": "string",
4035-
"readOnly": true
4283+
"readOnly": true,
4284+
"nullable": true
40364285
},
40374286
"created_at": {
40384287
"type": "string",
@@ -4501,7 +4750,8 @@
45014750
},
45024751
"subject": {
45034752
"type": "string",
4504-
"readOnly": true
4753+
"readOnly": true,
4754+
"nullable": true
45054755
},
45064756
"snippet": {
45074757
"type": "string",
@@ -4783,6 +5033,15 @@
47835033
"slug"
47845034
]
47855035
},
5036+
"TypeEnum": {
5037+
"enum": [
5038+
"personal",
5039+
"shared",
5040+
"redirect"
5041+
],
5042+
"type": "string",
5043+
"description": "* `personal` - personal\n* `shared` - shared\n* `redirect` - redirect"
5044+
},
47865045
"User": {
47875046
"type": "object",
47885047
"description": "Serialize users.",
@@ -4809,9 +5068,16 @@
48095068
"type": "string",
48105069
"readOnly": true,
48115070
"nullable": true
5071+
},
5072+
"abilities": {
5073+
"type": "object",
5074+
"additionalProperties": {},
5075+
"description": "Return abilities of the logged-in user on the mail domain.",
5076+
"readOnly": true
48125077
}
48135078
},
48145079
"required": [
5080+
"abilities",
48155081
"email",
48165082
"full_name",
48175083
"id",
@@ -4827,4 +5093,4 @@
48275093
}
48285094
}
48295095
}
4830-
}
5096+
}

0 commit comments

Comments
 (0)