---
openapi: 3.0.3
info:
  title: Clelo API
  description: Clelo API zur Bereitstellung von Clelo APKs und Büchern an den Endverbraucher.
  contact:
    name: H. Endres
    url: https://clelo.de/impressum/
    email: contact@clelo.de
  version: 1.0.1
servers:
- url: http://localhost:8080
- url: https://svr.clelo.de/
tags:
- name: Auth
paths:
  /activation:
    get:
      tags:
      - Activation Resource
      operationId: list
      parameters:
      - name: page
        in: query
        schema:
          format: int32
          default: 0
          type: integer
      - name: size
        in: query
        schema:
          format: int32
          default: 20
          type: integer
      - name: sort
        in: query
        schema:
          type: array
          items:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ActivationInfoDto'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
    post:
      tags:
      - Activation Resource
      operationId: add
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivationCreationDto'
      responses:
        "200":
          description: OK
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /activation-qr-code:
    get:
      tags:
      - Activation QR Code Resource
      operationId: list
      parameters:
      - name: page
        in: query
        schema:
          format: int32
          default: 0
          type: integer
      - name: size
        in: query
        schema:
          format: int32
          default: 20
          type: integer
      - name: sort
        in: query
        schema:
          type: array
          items:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ActivationQRCodeDto'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
    post:
      tags:
      - Activation QR Code Resource
      operationId: generate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivationQRCodeGenerateRequest'
      responses:
        "200":
          description: OK
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /activation-qr-code/count:
    get:
      tags:
      - Activation QR Code Resource
      operationId: count
      responses:
        "200":
          description: OK
          content:
            text/plain:
              schema:
                format: int64
                type: integer
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /activation-qr-code/ofbook/{bookId}:
    get:
      tags:
      - Activation QR Code Resource
      operationId: listByBookId
      parameters:
      - name: bookId
        in: path
        required: true
        schema:
          format: int64
          type: integer
      - name: page
        in: query
        schema:
          format: int32
          default: 0
          type: integer
      - name: size
        in: query
        schema:
          format: int32
          default: 20
          type: integer
      - name: sort
        in: query
        schema:
          type: array
          items:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ActivationQRCodeDto'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /activation-qr-code/ofbook/{bookId}/count:
    get:
      tags:
      - Activation QR Code Resource
      operationId: countByUserUUID
      parameters:
      - name: bookId
        in: path
        required: true
        schema:
          format: int64
          type: integer
      responses:
        "200":
          description: OK
          content:
            text/plain:
              schema:
                format: int64
                type: integer
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /activation-qr-code/{id}:
    get:
      tags:
      - Activation QR Code Resource
      operationId: get
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivationQRCodeDto'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /activation-qr-code/{id}/en-disable:
    post:
      tags:
      - Activation QR Code Resource
      operationId: enDisable
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivationQRCodeEnDisableRequest'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivationQRCodeDto'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /activation-qr-code/{id}/qr:
    get:
      tags:
      - Activation QR Code Resource
      operationId: downloadQR
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      responses:
        "200":
          description: OK
          content:
            image/png:
              schema:
                format: binary
                type: string
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /activation/by-qr-code:
    post:
      tags:
      - Activation Resource
      operationId: activateByQRCode
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SerialNumberRequest'
      responses:
        "200":
          description: OK
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - clelobookuser
        - cleloadmin
  /activation/count:
    get:
      tags:
      - Activation Resource
      operationId: count
      responses:
        "200":
          description: OK
          content:
            text/plain:
              schema:
                format: int64
                type: integer
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /activation/ofuser/{userUUID}:
    get:
      tags:
      - Activation Resource
      operationId: listByUserUUID
      parameters:
      - name: userUUID
        in: path
        required: true
        schema:
          type: string
      - name: page
        in: query
        schema:
          format: int32
          default: 0
          type: integer
      - name: size
        in: query
        schema:
          format: int32
          default: 20
          type: integer
      - name: sort
        in: query
        schema:
          type: array
          items:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ActivationInfoDto'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /activation/ofuser/{userUUID}/count:
    get:
      tags:
      - Activation Resource
      operationId: countByUserUUID
      parameters:
      - name: userUUID
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            text/plain:
              schema:
                format: int64
                type: integer
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /activation/{id}:
    get:
      tags:
      - Activation Resource
      operationId: get
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivationInfoDto'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
    put:
      tags:
      - Activation Resource
      operationId: update
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivationCreationDto'
      responses:
        "200":
          description: OK
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
    delete:
      tags:
      - Activation Resource
      operationId: delete
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      responses:
        "204":
          description: No Content
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /apk:
    get:
      tags:
      - APK Resource
      operationId: list
      parameters:
      - name: page
        in: query
        schema:
          format: int32
          default: 0
          type: integer
      - name: size
        in: query
        schema:
          format: int32
          default: 20
          type: integer
      - name: sort
        in: query
        schema:
          type: array
          items:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/APKInfoDto'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
    post:
      tags:
      - APK Resource
      operationId: add
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/APKCreateDto'
      responses:
        "200":
          description: OK
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /apk/active:
    get:
      tags:
      - APK Resource
      operationId: getActiveAPKInfo
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APKInfo'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - clelobookuser
        - cleloadmin
  /apk/count:
    get:
      tags:
      - APK Resource
      operationId: count
      responses:
        "200":
          description: OK
          content:
            text/plain:
              schema:
                format: int64
                type: integer
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /apk/download/activebookapp:
    get:
      tags:
      - APK Resource
      operationId: getSingleActiveBookAppAPK
      responses:
        "200":
          description: OK
          content:
            application/octet-stream:
              schema:
                format: binary
                type: string
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - clelobookuser
        - cleloadmin
  /apk/download/activelauncher:
    get:
      tags:
      - APK Resource
      operationId: getSingleActiveLauncherAPK
      responses:
        "200":
          description: OK
          content:
            application/octet-stream:
              schema:
                format: binary
                type: string
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - clelobookuser
        - cleloadmin
  /apk/{id}:
    get:
      tags:
      - APK Resource
      operationId: get
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APKInfoDto'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
    put:
      tags:
      - APK Resource
      operationId: update
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/APKCreateDto'
      responses:
        "200":
          description: OK
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
    delete:
      tags:
      - APK Resource
      operationId: delete
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      responses:
        "204":
          description: No Content
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /apk/{id}/download:
    get:
      tags:
      - APK Resource
      operationId: getSingleAPKFile
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      responses:
        "200":
          description: OK
          content:
            application/octet-stream:
              schema:
                format: binary
                type: string
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /apk/{id}/upload:
    post:
      tags:
      - APK Resource
      operationId: uploadSingleAPKFile
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
              - file
              - fileName
              type: object
              properties:
                file:
                  format: binary
                  type: string
                fileName:
                  type: string
            encoding:
              fileName:
                contentType: text/plain
              file:
                contentType: application/octet-stream
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APKInfoDto'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /authentication/login:
    post:
      tags:
      - Auth
      operationId: login
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoginRequest'
      responses:
        "200":
          description: Authorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoginResponse'
        "400":
          description: Fehlerhafter Request
        "403":
          description: Anmeldung fehlgeschlagen
        "404":
          description: Der User ist nicht registriert.
  /authentication/register:
    post:
      tags:
      - Auth
      operationId: registerUser
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterRequest'
      responses:
        "201":
          description: Der Kunde wurde auf dem WooCommerce Portal angelegt.
        "409":
          description: Der Kunde mit der angegebenen E-Mail existert bereits.
        "400":
          description: Die E-Mailadresse fehlt oder ist ungültig.
  /book:
    get:
      tags:
      - Book Resource
      operationId: list
      parameters:
      - name: page
        in: query
        schema:
          format: int32
          default: 0
          type: integer
      - name: size
        in: query
        schema:
          format: int32
          default: 20
          type: integer
      - name: sort
        in: query
        schema:
          type: array
          items:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BookDto'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
    post:
      tags:
      - Book Resource
      operationId: add
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BookCreateDto'
      responses:
        "200":
          description: OK
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /book/all-books-with-version-and-activation:
    get:
      tags:
      - Book Resource
      operationId: listAllBooksWithVersionAndActivation
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BookWithVersionDTO'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
        - clelobookuser
  /book/count:
    get:
      tags:
      - Book Resource
      operationId: count
      responses:
        "200":
          description: OK
          content:
            text/plain:
              schema:
                format: int64
                type: integer
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /book/my-books:
    get:
      tags:
      - Book Resource
      operationId: listMyBooks
      parameters:
      - name: page
        in: query
        schema:
          format: int32
          default: 0
          type: integer
      - name: size
        in: query
        schema:
          format: int32
          default: 20
          type: integer
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MyBookDto'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
        - clelobookuser
  /book/{id}:
    get:
      tags:
      - Book Resource
      operationId: get
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookDto'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
    put:
      tags:
      - Book Resource
      operationId: update
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BookCreateDto'
      responses:
        "200":
          description: OK
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
    delete:
      tags:
      - Book Resource
      operationId: delete
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      responses:
        "204":
          description: No Content
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /book/{id}/activations:
    get:
      tags:
      - Book Resource
      operationId: listActivationsOfBook
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      - name: page
        in: query
        schema:
          format: int32
          default: 0
          type: integer
      - name: size
        in: query
        schema:
          format: int32
          default: 20
          type: integer
      - name: sort
        in: query
        schema:
          type: array
          items:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ActivationInfoDto'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /book/{id}/activations/count:
    get:
      tags:
      - Book Resource
      operationId: countActivationsOfBook
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      responses:
        "200":
          description: OK
          content:
            text/plain:
              schema:
                format: int64
                type: integer
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /book/{id}/bookversions:
    get:
      tags:
      - Book Resource
      operationId: listBookVersionsOfBook
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      - name: page
        in: query
        schema:
          format: int32
          default: 0
          type: integer
      - name: size
        in: query
        schema:
          format: int32
          default: 20
          type: integer
      - name: sort
        in: query
        schema:
          type: array
          items:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BookVersionInfoDto'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /book/{id}/cover:
    get:
      tags:
      - Book Resource
      operationId: downloadCover
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      responses:
        "200":
          description: OK
          content:
            image/png:
              schema:
                format: binary
                type: string
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - clelobookuser
        - cleloadmin
    post:
      tags:
      - Book Resource
      operationId: uploadCover
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
              - file
              - fileName
              type: object
              properties:
                file:
                  format: binary
                  type: string
                fileName:
                  type: string
            encoding:
              fileName:
                contentType: text/plain
              file:
                contentType: application/octet-stream
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookDto'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /book/{id}/newest-book-version:
    get:
      tags:
      - Book Resource
      operationId: downloadBookVersion
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      responses:
        "200":
          description: OK
          content:
            application/zip:
              schema:
                format: binary
                type: string
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
        - clelobookuser
  /book/{id}/with-version-and-activation:
    get:
      tags:
      - Book Resource
      operationId: getWithVersionAndActivation
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookWithVersionDTO'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
        - clelobookuser
  /bookversion:
    get:
      tags:
      - Book Version Resource
      operationId: list
      parameters:
      - name: page
        in: query
        schema:
          format: int32
          default: 0
          type: integer
      - name: size
        in: query
        schema:
          format: int32
          default: 20
          type: integer
      - name: sort
        in: query
        schema:
          type: array
          items:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BookVersionInfoDto'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
    post:
      tags:
      - Book Version Resource
      operationId: add
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BookVersionCreateDto'
      responses:
        "200":
          description: OK
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /bookversion/count:
    get:
      tags:
      - Book Version Resource
      operationId: count
      responses:
        "200":
          description: OK
          content:
            text/plain:
              schema:
                format: int64
                type: integer
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /bookversion/{id}:
    get:
      tags:
      - Book Version Resource
      operationId: get
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookVersionInfoDto'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
    put:
      tags:
      - Book Version Resource
      operationId: update
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BookVersionCreateDto'
      responses:
        "200":
          description: OK
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
    delete:
      tags:
      - Book Version Resource
      operationId: delete
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      responses:
        "204":
          description: No Content
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
  /bookversion/{id}/download:
    get:
      tags:
      - Book Version Resource
      operationId: downloadBookVersion
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      responses:
        "200":
          description: OK
          content:
            application/zip:
              schema:
                format: binary
                type: string
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
        - clelobookuser
  /bookversion/{id}/upload:
    post:
      tags:
      - Book Version Resource
      operationId: uploadBookVersion
      parameters:
      - name: id
        in: path
        required: true
        schema:
          format: int64
          type: integer
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
              - file
              - fileName
              type: object
              properties:
                file:
                  format: binary
                  type: string
                fileName:
                  type: string
            encoding:
              fileName:
                contentType: text/plain
              file:
                contentType: application/octet-stream
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookVersionInfoDto'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - cleloadmin
components:
  schemas:
    APKCreateDto:
      required:
      - apkType
      - active
      - version
      type: object
      properties:
        apkType:
          $ref: '#/components/schemas/APKType'
        active:
          type: boolean
        version:
          format: int32
          type: integer
    APKInfo:
      type: object
      properties:
        launcher:
          $ref: '#/components/schemas/APKInfoDto'
        bookapp:
          $ref: '#/components/schemas/APKInfoDto'
    APKInfoDto:
      type: object
      properties:
        id:
          format: int64
          type: integer
        apkType:
          $ref: '#/components/schemas/APKType'
        active:
          type: boolean
        version:
          format: int32
          type: integer
        filename:
          type: string
        sha256:
          type: string
    APKType:
      enum:
      - LAUNCHER
      - BOOKAPP
      type: string
    ActivationCreationDto:
      required:
      - userUUID
      - bookId
      type: object
      properties:
        userUUID:
          pattern: \S
          type: string
        bookId:
          format: int64
          type: integer
        source:
          $ref: '#/components/schemas/ActivationSource'
    ActivationInfoDto:
      type: object
      properties:
        id:
          format: int64
          type: integer
        userUUID:
          type: string
        bookId:
          format: int64
          type: integer
        bookName:
          type: string
        source:
          $ref: '#/components/schemas/ActivationSource'
        updatedAt:
          $ref: '#/components/schemas/LocalDateTime'
        createdAt:
          $ref: '#/components/schemas/LocalDateTime'
    ActivationQRCodeDto:
      type: object
      properties:
        id:
          format: int64
          type: integer
        vendor:
          type: string
        lot:
          type: string
        serialNumber:
          type: string
        enabled:
          type: boolean
        updatedAt:
          $ref: '#/components/schemas/LocalDateTime'
        createdAt:
          $ref: '#/components/schemas/LocalDateTime'
        book:
          $ref: '#/components/schemas/BookDto'
        activation:
          $ref: '#/components/schemas/ActivationInfoDto'
    ActivationQRCodeEnDisableRequest:
      required:
      - enable
      type: object
      properties:
        enable:
          type: boolean
    ActivationQRCodeGenerateRequest:
      required:
      - generationCount
      - vendor
      - lot
      - enabled
      - bookId
      type: object
      properties:
        generationCount:
          format: int32
          maximum: 1000
          minimum: 0
          type: integer
        vendor:
          type: string
        lot:
          type: string
        enabled:
          type: boolean
        bookId:
          format: int64
          type: integer
    ActivationSource:
      enum:
      - APPSMITH
      - WOOCOMMERCE
      - QR_CODE
      type: string
    BookCreateDto:
      required:
      - woocommerceId
      - name
      - shopText
      - orderInLibrary
      type: object
      properties:
        woocommerceId:
          format: int64
          type: integer
        name:
          minLength: 1
          type: string
        shopText:
          minLength: 1
          type: string
        orderInLibrary:
          format: int32
          type: integer
    BookDto:
      type: object
      properties:
        id:
          format: int64
          type: integer
        woocommerceId:
          format: int64
          type: integer
        name:
          type: string
        shopText:
          type: string
        orderInLibrary:
          format: int32
          type: integer
        updatedAt:
          $ref: '#/components/schemas/LocalDateTime'
        createdAt:
          $ref: '#/components/schemas/LocalDateTime'
    BookDto1:
      type: object
      properties:
        id:
          format: int64
          type: integer
        woocommerceId:
          format: int64
          type: integer
        name:
          type: string
        shopText:
          type: string
        orderInLibrary:
          format: int32
          type: integer
        bookVersion:
          $ref: '#/components/schemas/BookVersionDto'
        updatedAt:
          $ref: '#/components/schemas/LocalDateTime'
        createdAt:
          $ref: '#/components/schemas/LocalDateTime'
    BookVersionCreateDto:
      type: object
      properties:
        active:
          type: boolean
        version:
          format: int32
          type: integer
        bookId:
          format: int64
          type: integer
    BookVersionDto:
      type: object
      properties:
        id:
          format: int64
          type: integer
        active:
          type: boolean
        version:
          format: int32
          type: integer
        filename:
          type: string
        bytes:
          format: int64
          type: integer
        sha256:
          type: string
        updatedAt:
          $ref: '#/components/schemas/LocalDateTime'
        createdAt:
          $ref: '#/components/schemas/LocalDateTime'
    BookVersionInfoDto:
      type: object
      properties:
        id:
          format: int64
          type: integer
        active:
          type: boolean
        version:
          format: int32
          type: integer
        filename:
          type: string
        sha256:
          type: string
        updatedAt:
          $ref: '#/components/schemas/LocalDateTime'
        createdAt:
          $ref: '#/components/schemas/LocalDateTime'
    BookWithVersionDTO:
      type: object
      properties:
        id:
          format: int64
          type: integer
        woocommerceId:
          format: int64
          type: integer
        name:
          type: string
        shopText:
          type: string
        orderInLibrary:
          format: int32
          type: integer
        bookVersion:
          $ref: '#/components/schemas/BookVersionInfoDto'
        activated:
          type: boolean
        updatedAt:
          $ref: '#/components/schemas/LocalDateTime'
        createdAt:
          $ref: '#/components/schemas/LocalDateTime'
    LocalDateTime:
      format: date-time
      type: string
      example: 2022-03-10T12:15:50
    LoginRequest:
      required:
      - email
      - password
      type: object
      properties:
        email:
          type: string
        password:
          minLength: 1
          type: string
    LoginResponse:
      type: object
      properties:
        accessToken:
          type: string
        expiresIn:
          format: int64
          type: integer
        tokenType:
          type: string
        notBeforePolicy:
          format: int64
          type: integer
        scope:
          type: string
    MyBookDto:
      type: object
      properties:
        id:
          format: int64
          type: integer
        userUUID:
          type: string
        book:
          $ref: '#/components/schemas/BookDto1'
        source:
          $ref: '#/components/schemas/ActivationSource'
        updatedAt:
          $ref: '#/components/schemas/LocalDateTime'
        createdAt:
          $ref: '#/components/schemas/LocalDateTime'
    RegisterRequest:
      required:
      - email
      - password
      type: object
      properties:
        email:
          type: string
        password:
          type: string
    SerialNumberRequest:
      required:
      - serialNumber
      type: object
      properties:
        serialNumber:
          type: string
  securitySchemes:
    SecurityScheme:
      type: http
      description: Authentication
      scheme: basic
