ecodms-node
v0.0.10
Published
Abstraction for the ecoDMS 18.09 (apu) API
Downloads
13
Readme
ecodms-node
Abstraction for the ecoDMS 18.09 (apu) API.
Documentation
constructor(config)
- Parameters:
config
—object
origin
–string
username
–string
password
–string
port
–number|string
(optional, default:8180
)
test()
- Returns:
Promise<string>
getStatus()
- Returns:
Promise<object[]>
getRoles()
- Returns:
Promise<string[]>
getUserRoles()
- Returns:
Promise<string[]>
getTypes()
- Returns:
Promise<object[]>
getFolders()
- Returns:
Promise<object[]>
getFolderById(id)
- Parameters:
id
—number|string
- Returns:
Promise<object>
getDocumentById(id)
- Parameters:
id
—number|string
- Returns:
Promise<string>
getDocumentByIdAndVersion(id, version)
- Parameters:
id
—number|string
version
—number|string
- Returns:
Promise<string>
deleteDocumentById(id)
- Parameters:
id
—number|string
- Returns:
Promise<boolean>
recoverDocumentById(id)
- Parameters:
id
—number|string
- Returns:
Promise<boolean>
getLinkedDocumentsById(id)
- Parameters:
id
—number|string
- Returns:
Promise<number[]>
linkDocuments(id, linkIds)
- Parameters:
id
—number|string
linkIds
—number[]|string[]
- Returns:
Promise<number[]>
deleteLinked(id, linkIds)
- Parameters:
id
—number|string
linkIds
—number[]|string[]
- Returns:
Promise<boolean>
getDocumentInfoById(id)
- Parameters:
id
—number|string
- Returns:
Promise<object[]>
getDocumentPreview(id, page, height)
- Parameters:
id
—number|string
page
—number|string
height
—number|string
- Returns:
Promise<string>
getClassifyAttributes()
- Returns:
Promise<number[]>
uploadFile(filepath, versionControlled = false)
- Parameters:
filepath
—string
versionControlled
—boolean
(optional, default:false
)
- Returns:
Promise<number>
uploadFileWithPdf(filepath, pdfpath, versionControlled = false)
- Parameters:
filepath
—string
pdfpath
—string
versionControlled
—boolean
(optional, default:false
)
- Returns:
Promise<number>
addVersionToDocument(id, filepath, fixed = false)
- Parameters:
id
—number|string
filepath
—string
fixed
—boolean
(optional, default:false
)
- Returns:
Promise<boolean>
addVersionWithPdfToDocument(id, filepath, pdfpath, fixed = false)
- Parameters:
id
—number|string
filepath
—string
pdfpath
—string
fixed
—boolean
(optional, default:false
)
- Returns:
Promise<boolean>
createNewClassify(docInfoObject)
- Parameters:
docInfoObject
—object
- Returns:
Promise<number>
createFolder(folderObject)
- Parameters:
folderObject
—object
- Returns:
Promise<number>
createSubfolder(folderObject, parentFolderId)
- Parameters:
folderObject
—object
parentFolderId
—number|string
- Returns:
Promise<number>
Examples
const EcoDms = require('ecodms-node');
const api = new EcoDms({
origin: 'http://example-ecodms.com',
username: 'user',
password: 'pass'
});
api.test()
.then((res) => console.log('API works'))
.catch((err) => console.log('API does not work'));
// Do anything you want from here