@rgwch/mayan_edms-api
TypeScript icon, indicating that this package has built-in type declarations

0.4.5 • Public • Published

Mayan EDMS API

Overview

This is a nodejs library to access the API of the Mayan EDMS. It tries to simplify some common tasks when using automated services to work with Mayan.

Usage

import {mayan} from '@rgwch/mayan_edms-api'

mayan.connect("https://some.mayan.server","username","password", false).then(result)=>{
    if(result){
        console.log("We are connected. Use API now")
    }
})

All methods are async. Connect should be the first call. On success, it receives a token which is stored internally and used for all subsequent API calls. Note that the user who connects must have specific rights for every method in the fairly fine-grained permission system of Mayan EDMS. I recommend to test first as admin user and change to the real user only if that is successful.

You can use the provided test/docker-compose.yml for a quick test installation of Mayan EDMS

Documentation, see docs

Contributing

git clone https://github.com/rgwch/mayan_edms-api
cd mayan_edms-api
npm i
npm run build

Testing

There's only an integration test.

First run

Before first run you must initialize a Mayan EDMS for testing:

cd test
docker-compose up -d
# or: docker compose up -d

Then navigate to [http://localhost:5656/]

Login as admin with the indicated password. Go to the "User" Menu in the right upper part of the window. Change the password to "testuser".

Then you can leave the Mayan UI and run the tests

Test runs

npm test

Cleaning up

docker-compose down

Later runs of docker-compose up -d will be much faster and no initialization is needed.

Readme

Keywords

none

Package Sidebar

Install

npm i @rgwch/mayan_edms-api

Weekly Downloads

8

Version

0.4.5

License

MIT

Unpacked Size

123 kB

Total Files

9

Last publish

Collaborators

  • rgwch