mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-14 13:21:39 +00:00
Moved Collection schema to objects/
This commit is contained in:
parent
cc53f16185
commit
c89bd1b414
2 changed files with 47 additions and 47 deletions
|
|
@ -2,53 +2,6 @@ const { DataTypes, Model, Sequelize } = require('sequelize')
|
||||||
|
|
||||||
const oldCollection = require('../objects/Collection')
|
const oldCollection = require('../objects/Collection')
|
||||||
|
|
||||||
/**
|
|
||||||
* @openapi
|
|
||||||
* components:
|
|
||||||
* schemas:
|
|
||||||
* collectionBase:
|
|
||||||
* type: object
|
|
||||||
* description: A public collection of library items which can be ordered and has a description, base schema.
|
|
||||||
* properties:
|
|
||||||
* id:
|
|
||||||
* description: The ID of the collection.
|
|
||||||
* type: string
|
|
||||||
* libraryId:
|
|
||||||
* description: The ID of the library the collection belongs to.
|
|
||||||
* type: string
|
|
||||||
* name:
|
|
||||||
* description: The name of the collection.
|
|
||||||
* type: string
|
|
||||||
* description:
|
|
||||||
* description: The description of the collection.
|
|
||||||
* type: [string, null]
|
|
||||||
* lastUpdate:
|
|
||||||
* description: The time (in ms since POSIX epoch) when the collection was last updated.
|
|
||||||
* type: integer
|
|
||||||
* createdAt:
|
|
||||||
* description: The time (in ms since POSIX epoch) when the collection was created.
|
|
||||||
* type: integer
|
|
||||||
* collection:
|
|
||||||
* type: object
|
|
||||||
* description: A public collection of library items which can be ordered and has a description.
|
|
||||||
* allOf:
|
|
||||||
* - $ref: '#/components/schemas/collectionBase'
|
|
||||||
* - books:
|
|
||||||
* description: The books that belong to the collection.
|
|
||||||
* type: array
|
|
||||||
* items:
|
|
||||||
* $ref: '#/components/schemas/libraryItem'
|
|
||||||
* collectionExpanded:
|
|
||||||
* type: object
|
|
||||||
* description: A public collection of library items which can be ordered and has a description. Replaces `libraryItem` with `libraryItemExtended`.
|
|
||||||
* allOf:
|
|
||||||
* - $ref: '#/components/schemas/collectionBase'
|
|
||||||
* - books:
|
|
||||||
* description: The books that belong to the collection.
|
|
||||||
* type: array
|
|
||||||
* items:
|
|
||||||
* $ref: '#/components/schemas/libraryItemExpanded'
|
|
||||||
*/
|
|
||||||
class Collection extends Model {
|
class Collection extends Model {
|
||||||
constructor(values, options) {
|
constructor(values, options) {
|
||||||
super(values, options)
|
super(values, options)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,52 @@
|
||||||
const uuidv4 = require("uuid").v4
|
const uuidv4 = require("uuid").v4
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @openapi
|
||||||
|
* components:
|
||||||
|
* schemas:
|
||||||
|
* collectionBase:
|
||||||
|
* type: object
|
||||||
|
* description: A public collection of library items which can be ordered and has a description, base schema.
|
||||||
|
* properties:
|
||||||
|
* id:
|
||||||
|
* description: The ID of the collection.
|
||||||
|
* type: string
|
||||||
|
* libraryId:
|
||||||
|
* description: The ID of the library the collection belongs to.
|
||||||
|
* type: string
|
||||||
|
* name:
|
||||||
|
* description: The name of the collection.
|
||||||
|
* type: string
|
||||||
|
* description:
|
||||||
|
* description: The description of the collection.
|
||||||
|
* type: [string, null]
|
||||||
|
* lastUpdate:
|
||||||
|
* description: The time (in ms since POSIX epoch) when the collection was last updated.
|
||||||
|
* type: integer
|
||||||
|
* createdAt:
|
||||||
|
* description: The time (in ms since POSIX epoch) when the collection was created.
|
||||||
|
* type: integer
|
||||||
|
* collection:
|
||||||
|
* type: object
|
||||||
|
* description: A public collection of library items which can be ordered and has a description.
|
||||||
|
* allOf:
|
||||||
|
* - $ref: '#/components/schemas/collectionBase'
|
||||||
|
* - books:
|
||||||
|
* description: The books that belong to the collection.
|
||||||
|
* type: array
|
||||||
|
* items:
|
||||||
|
* $ref: '#/components/schemas/libraryItem'
|
||||||
|
* collectionExpanded:
|
||||||
|
* type: object
|
||||||
|
* description: A public collection of library items which can be ordered and has a description. Replaces `libraryItem` with `libraryItemExtended`.
|
||||||
|
* allOf:
|
||||||
|
* - $ref: '#/components/schemas/collectionBase'
|
||||||
|
* - books:
|
||||||
|
* description: The books that belong to the collection.
|
||||||
|
* type: array
|
||||||
|
* items:
|
||||||
|
* $ref: '#/components/schemas/libraryItemExpanded'
|
||||||
|
*/
|
||||||
class Collection {
|
class Collection {
|
||||||
constructor(collection) {
|
constructor(collection) {
|
||||||
this.id = null
|
this.id = null
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue