diff --git a/docs/controllers/EmailController.yaml b/docs/controllers/EmailController.yaml new file mode 100644 index 00000000..e0025c14 --- /dev/null +++ b/docs/controllers/EmailController.yaml @@ -0,0 +1,95 @@ +components: + schemas: + emailSettings: + type: string + description: The field to sort by from the request. + example: 'media.metadata.title' + responses: + email200: + description: Successful response - Email + content: + application/json: + schema: + $ref: '../objects/settings/EmailSettings.yaml#/components/schemas/EmailSettings' + ereader200: + description: Successful response - Ereader + content: + application/json: + schema: + type: object + properties: + ereaderDevices: + type: array + items: + $ref: '../objects/settings/EmailSettings.yaml#/components/schemas/EreaderDeviceObject' +paths: + /api/emails: + get: + description: Get email settings + operationId: getEmailSettings + responses: + 200: + $ref: '#/components/responses/email200' + patch: + summary: Update email settings + operationId: updateEmailSettings + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EmailSettings' + responses: + 200: + $ref: '#/components/responses/email200' + /api/emails/test: + post: + summary: Send test email + operationId: sendTestEmail + responses: + 200: + description: Successful response + /api/emails/ereader-devices: + post: + summary: Update e-reader devices + operationId: updateEReaderDevices + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + ereaderDevices: + type: array + items: + $ref: '#/components/schemas/EreaderDeviceObject' + responses: + 200: + $ref: '#/components/responses/ereader200' + 400: + description: Invalid payload + /api/emails/send-ebook-to-device: + post: + summary: Send ebook to device + operationId: sendEBookToDevice + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + libraryItemId: + $ref: '../objects/LibraryItem.yaml#/components/schemas/libraryItemId' + deviceName: + $ref: '../objects/schemas/EmailSettings.yaml#/components/schemas/ereaderName' + responses: + 200: + description: Successful response + 400: + description: Invalid request + 403: + description: Forbidden + 404: + description: Not found diff --git a/docs/objects/setings/EmailSettings.yaml b/docs/objects/setings/EmailSettings.yaml index efa2a5d7..acce79c7 100644 --- a/docs/objects/setings/EmailSettings.yaml +++ b/docs/objects/setings/EmailSettings.yaml @@ -1,12 +1,14 @@ components: schemas: + ereaderName: + type: string + description: The name of the e-reader device. EreaderDeviceObject: type: object description: An e-reader device configured to receive EPUB through e-mail. properties: name: - type: string - description: The name of the e-reader device. + $ref: '#/components/schemas/ereaderName' email: type: string description: The email address associated with the e-reader device. @@ -73,5 +75,4 @@ components: - id - port - secure - - rejectUnauthorized - ereaderDevices