Skip to content

Latest commit

History

34 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

scjs - A simple interface to Scala Content Manager web-services.

NPM VersionNPM DownloadsGitHub IssuesGitHub Pull RequestsInline docsKnown Vulnerabilities

This module is loosely modelled after the scws2 Python module, supporting the 2.x REST API.

Example usage (set DEBUG=scjs for debug output):

const{ ConManager }=require('scjs');constbaseurl="http://localhost/ContentManager";constusername="user";constpassword="pass";constcm=newConManager(baseurl);(async()=>{constresp=awaitcm.login(username,password);try{constplayers=awaitcm.get('players',{'limit': 0,'offset': 0,'fields': 'id,name,enabled,active,type'});console.log(players.list);constmedia=awaitcm.get('media',{'limit': 10,'filters': '{"type":{"values":["IMAGE"]}}'});letitems=[];for(constitemofmedia.list){items.push(cm.download(item.downloadPath,item.name));}awaitPromise.all(items);constitem=awaitcm.upload('LocalFolder/MyPicture.jpg','RemoteFolder/MyPicture.jpg');console.log(item);}finally{awaitcm.post('auth/logout');}})().catch((e)=>{console.log(e);});

About

A simple interface to Scala Content Manager web-services.

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages