@rgwch/mayan_edms-api

    Class Mayan

    Index

    Constructors

    Methods

    • Add a document to a cabinet (Current user need permission to add documents to cabinets)

      Parameters

      • document_id: number
      • cabinet_id: string

      Returns Promise<any>

    • Add an existing tag to a document

      Parameters

      Returns Promise<any>

    • Add document to the current user's favorite list

      Parameters

      Returns Promise<any>

    • Check if a previous session can be resumed with a previously stored token (and resume it, of so).

      Returns Promise<boolean>

      true if a previous session was resumed.

    • Connect to a running Mayan EDMS instance. Username and password are the credentials of a user with access to the API. If valid, Mayan will return a token which is stored locally and will be used for all further requests.

      Parameters

      • url: string

        The base URL of the server (e.g. https://mayan.example.com)

      • username: string
      • password: string
      • resumable: boolean

        if true, the token is stored in local storage and can be used to resume the session later

      Returns Promise<boolean>

      true on success

    • Create a new cabinet

      Parameters

      • name: string

        label for the cabinet

      • parent: null | number = null

        null to create toplevel cabinet, or the id of the parent cabinet

      Returns Promise<Cabinet>

      tne newly created cabinet

    • Create a new document

      Parameters

      • documentType_id: number
      • cabinet_id: number
      • language: string = "deu"
      • title: string
      • contents: Blob | File

      Returns Promise<Document>

    • Create a Document Type

      Parameters

      • name: string

        Arbitrary name for the document type

      Returns Promise<DocumentType>

    • Create a new tag. A Tag is a label which can be attached to documents. It has a name and a coler (for display in an UI)

      Parameters

      • name: string
      • color: string

        a color in hex format (e.g. #FF0000)

      Returns Promise<Tag>

      the newly cxreated tag

    • Remove a cabinet

      Parameters

      • cabinet_id: number

      Returns Promise<boolean>

      true on success

    • Delete a document (i.e. move it to the trash)

      Parameters

      Returns Promise<boolean>

      true on success

    • Delete a document typ. Note: At least one document type must exist in the system. This is usually "Default"

      Parameters

      Returns Promise<boolean>

    • Delete a tag. This will remove the tag from all documents it is attached to.

      Parameters

      Returns Promise<boolean>

      true on success

    • retrieve documents matching a given query

      Parameters

      • query: string

        a search term

      Returns Promise<MayanResult<Document>>

      the list of matching documents

    • Fetch the preview images for a document

      Parameters

      Returns Promise<string[]>

      a list of URLs with image data

    • List all cabinets a document is in

      Parameters

      Returns Promise<Cabinet[]>

    • Generic retrieve a single object from Mayan (used e.g. to download files)

      Parameters

      • url: string

        the URL to retrieve

      Returns Promise<any>

    • Generic retrieve an image from Mayan (used to download preview images)

      Parameters

      • url: string

        the URL to retrieve

      Returns Promise<any>

      an ObjectURL for the image

    • Logout from the current session. The token is removed from the local storage

      Returns void

    • remove a document from a cabinet (Current user need permission to remove documents from cabinets)

      Parameters

      • document_id: number
      • cabinet: Cabinet

      Returns Promise<any>

    • remove document from the current user's favorite list

      Parameters

      • document_id: number

      Returns Promise<boolean>

      true on success

    • remove a tag from a document (without removing the tag itself from the system )

      Parameters

      Returns Promise<any>

    • generic GET request to Mayan (internally used by other methods) The method will call the endpoint repeatedly until all results are fetched or the limit is reached

      Parameters

      • suburl: string

        REST Endpoint to call

      • Optionalsegment: querySegment = ...

        the page and pagesize to fetch

      • Optionalparams: string

        query parameters to pass to the endpoint

      Returns Promise<MayanResult<any>>

      • the result.data portion of the server's answer
    • Set a desription for a document

      Parameters

      Returns Promise<any>

    • Parameters

      • document_id: number
      • type_id: number

      Returns Promise<any>

    • Modify a document

      Parameters

      Returns Promise<Document>

    MMNEPVFCICPMFPCPTTAAATR