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.
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
git clone https://github.com/rgwch/mayan_edms-api
cd mayan_edms-api
npm i
npm run build
There's only an integration test.
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
npm test
docker-compose down
Later runs of docker-compose up -d
will be much faster and no initialization is needed.