feat: notifications

This commit is contained in:
2026-04-06 18:09:54 +03:00
parent 8403ee0aa4
commit 33956a7ea4
15 changed files with 1242 additions and 4 deletions

View File

@@ -335,6 +335,25 @@
}
}
},
"NotificationPrefs": {
"type": "object",
"required": [
"notifyPhoto",
"notifyNoteCreate",
"notifyNoteEdit"
],
"properties": {
"notifyPhoto": {
"type": "boolean"
},
"notifyNoteCreate": {
"type": "boolean"
},
"notifyNoteEdit": {
"type": "boolean"
}
}
},
"OCSMeta": {
"type": "object",
"required": [
@@ -4393,6 +4412,232 @@
}
}
},
"/ocs/v2.php/apps/pantry/api/houses/{houseId}/prefs/notifications": {
"get": {
"operationId": "prefs-get-notification-prefs",
"summary": "Get notification preferences for a house",
"tags": [
"prefs"
],
"security": [
{
"bearer_auth": []
},
{
"basic_auth": []
}
],
"parameters": [
{
"name": "houseId",
"in": "path",
"description": "House id.",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "OCS-APIRequest",
"in": "header",
"description": "Required to be true for the API request to pass",
"required": true,
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": {
"200": {
"description": "Prefs returned",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"$ref": "#/components/schemas/NotificationPrefs"
}
}
}
}
}
}
}
},
"401": {
"description": "Current user is not logged in",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
}
}
},
"put": {
"operationId": "prefs-set-notification-prefs",
"summary": "Update notification preferences for a house",
"tags": [
"prefs"
],
"security": [
{
"bearer_auth": []
},
{
"basic_auth": []
}
],
"requestBody": {
"required": false,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"notifyPhoto": {
"type": "boolean",
"nullable": true,
"default": null,
"description": "Photo upload notifications."
},
"notifyNoteCreate": {
"type": "boolean",
"nullable": true,
"default": null,
"description": "Note creation notifications."
},
"notifyNoteEdit": {
"type": "boolean",
"nullable": true,
"default": null,
"description": "Note edit notifications."
}
}
}
}
}
},
"parameters": [
{
"name": "houseId",
"in": "path",
"description": "House id.",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "OCS-APIRequest",
"in": "header",
"description": "Required to be true for the API request to pass",
"required": true,
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": {
"200": {
"description": "Prefs updated",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"$ref": "#/components/schemas/NotificationPrefs"
}
}
}
}
}
}
}
},
"401": {
"description": "Current user is not logged in",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
}
}
}
},
"/ocs/v2.php/apps/pantry/api/houses/{houseId}/lists": {
"get": {
"operationId": "shopping_list-index-lists",