Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
advplyr committed Jun 23, 2024
2 parents 903b685 + 7d05317 commit 09d7880
Show file tree
Hide file tree
Showing 7 changed files with 961 additions and 8 deletions.
9 changes: 6 additions & 3 deletions docs/controllers/LibraryController.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,12 @@ paths:
content:
application/json:
schema:
type: array
items:
$ref: '../objects/Library.yaml#/components/schemas/library'
type: object
properties:
libraries:
type: array
items:
$ref: '../objects/Library.yaml#/components/schemas/library'
post:
operationId: createLibrary
summary: Create a new library on server
Expand Down
223 changes: 223 additions & 0 deletions docs/controllers/NotificationController.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
components:
responses:
notification200:
description: Notification endpoint success.
content:
text/html:
schema:
type: string
example: OK
notification404:
description: An admin user is required or notification with the given ID not found.
content:
text/html:
schema:
type: string
example: Series not found.
paths:
/api/notifications:
get:
operationId: getNotifications
description: Get all Apprise notification events and notification settings for server.
tags:
- Notification
responses:
'200':
description: Success
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
events:
type: array
items:
$ref: '../objects/Notification.yaml#/components/schemas/NotificationEvent'
settings:
$ref: '../objects/Notification.yaml#/components/schemas/NotificationSettings'
'404':
$ref: '#/components/responses/notification404'
patch:
operationId: updateNotificationSettings
description: Update Notification settings.
tags:
- Notification
requestBody:
content:
application/json:
schema:
type: object
properties:
appriseApiUrl:
$ref: '../objects/Notification.yaml#/components/schemas/appriseApiUrl'
maxFailedAttempts:
$ref: '../objects/Notification.yaml#/components/schemas/maxFailedAttempts'
maxNotificationQueue:
$ref: '../objects/Notification.yaml#/components/schemas/maxNotificationQueue'
responses:
'200':
$ref: '#/components/responses/notification200'
'404':
$ref: '#/components/responses/notification404'
post:
operationId: createNotification
description: Update Notification settings.
tags:
- Notification
requestBody:
content:
application/json:
schema:
type: object
properties:
libraryId:
$ref: '../objects/Library.yaml#/components/schemas/libraryIdNullable'
eventName:
$ref: '../objects/Notification.yaml#/components/schemas/notificationEventName'
urls:
$ref: '../objects/Notification.yaml#/components/schemas/urls'
titleTemplate:
$ref: '../objects/Notification.yaml#/components/schemas/titleTemplate'
bodyTemplate:
$ref: '../objects/Notification.yaml#/components/schemas/bodyTemplate'
enabled:
$ref: '../objects/Notification.yaml#/components/schemas/enabled'
type:
$ref: '../objects/Notification.yaml#/components/schemas/notificationType'
required:
- eventName
- urls
- titleTemplate
- bodyTemplate
responses:
'200':
description: Success
content:
application/json:
schema:
type: object
properties:
settings:
$ref: '../objects/Notification.yaml#/components/schemas/NotificationSettings'
'404':
$ref: '#/components/responses/notification404'
/api/notificationdata:
get:
operationId: getNotificationEventData
description: Get all Apprise notification event data for the server.
tags:
- Notification
responses:
'200':
description: Success
content:
application/json:
schema:
type: object
properties:
events:
type: array
items:
$ref: '../objects/Notification.yaml#/components/schemas/NotificationEvent'
'404':
$ref: '#/components/responses/notification404'
/api/notifications/test:
get:
operationId: sendDefaultTestNotification
description: Send a test notification.
tags:
- Notification
parameters:
- in: query
name: fail
description: Whether to intentionally cause the notification to fail. `0` for false, `1` for true.
schema:
type: integer
responses:
'200':
$ref: '#/components/responses/notification200'
'404':
$ref: '#/components/responses/notification404'
/api/notifications/{id}:
parameters:
- name: id
in: path
description: The ID of the notification.
required: true
schema:
$ref: '../objects/Notification.yaml#/components/schemas/notificationId'
delete:
operationId: deleteNotification
description: Delete the notification by ID and return the notification settings.
tags:
- Notification
responses:
'200':
description: Success
content:
application/json:
schema:
type: object
properties:
settings:
$ref: '../objects/Notification.yaml#/components/schemas/NotificationSettings'
'404':
$ref: '#/components/responses/notification404'
patch:
operationId: updateNotification
description: Update individual Notification
tags:
- Notification
requestBody:
content:
application/json:
schema:
type: object
properties:
libraryId:
$ref: '../objects/Library.yaml#/components/schemas/libraryId'
eventName:
$ref: '../objects/Notification.yaml#/components/schemas/notificationEventName'
urls:
$ref: '../objects/Notification.yaml#/components/schemas/urls'
titleTemplate:
$ref: '../objects/Notification.yaml#/components/schemas/titleTemplate'
bodyTemplate:
$ref: '../objects/Notification.yaml#/components/schemas/bodyTemplate'
enabled:
$ref: '../objects/Notification.yaml#/components/schemas/enabled'
type:
$ref: '../objects/Notification.yaml#/components/schemas/notificationType'
responses:
'200':
description: Success
content:
application/json:
schema:
type: object
properties:
settings:
$ref: '../objects/Notification.yaml#/components/schemas/NotificationSettings'
'404':
$ref: '#/components/responses/notification404'
/api/notifications/{id}/test:
parameters:
- name: id
in: path
description: The ID of the notification.
required: true
schema:
$ref: '../objects/Notification.yaml#/components/schemas/notificationId'
get:
operationId: sendTestNotification
description: Send a test to the given notification.
tags:
- Notification
responses:
'200':
$ref: '#/components/responses/notification200'
'404':
$ref: '#/components/responses/notification404'
6 changes: 6 additions & 0 deletions docs/objects/Library.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ components:
description: The ID of the library.
format: uuid
example: 'e4bb1afb-4a4f-4dd6-8be0-e615d233185b'
libraryIdNullable:
type: string
description: The ID of the library. Applies to all libraries if `null`.
format: uuid
nullable: true
example: 'e4bb1afb-4a4f-4dd6-8be0-e615d233185b'
libraryName:
description: The name of the library.
type: string
Expand Down
5 changes: 4 additions & 1 deletion docs/objects/LibraryItem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,7 @@ components:
description: A single item on the server, like a book or podcast. Includes series sequence information.
allOf:
- $ref: '#/components/schemas/libraryItemBase'
- $ref: './entities/Series.yaml#/components/schemas/sequence'
- type: object
properties:
sequence:
$ref: './entities/Series.yaml#/components/schemas/sequence'
Loading

0 comments on commit 09d7880

Please sign in to comment.