Skip to content
/ scjs Public

A simple interface to Scala Content Manager web-services.

License

Notifications You must be signed in to change notification settings

CISC/scjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 15, 2019
68523ec · Jan 15, 2019

History

27 Commits
May 2, 2017
Sep 6, 2016
Mar 20, 2017
Mar 20, 2017
Jan 15, 2019
Jan 15, 2019

Repository files navigation

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

NPM Version NPM Downloads GitHub Issues GitHub Pull Requests Inline docs Known 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):

var scjs = require('scjs');

var baseurl = "http://localhost/ContentManager";
var username = "user";
var password = "pass";
var cm = new scjs.ConManager(baseurl);
cm.login(username, password).then((resp) => {
    cm.get('players', { 'limit': 0, 'offset': 0, 'fields': 'id,name,enabled,active,type' }).then((players) => {
        console.log(players.list);
    });
    cm.get('media', { 'limit': 10, 'filters': '{"type":{"values":["IMAGE"]}}' }).then((media) => {
        var p = Promise.resolve();
        media.list.forEach((item) => {
            p = p.then(cm.download(item.downloadPath, item.name));
        });
    });
    cm.upload('LocalFolder/MyPicture.jpg', 'RemoteFolder/MyPicture.jpg').then((item) => {
        console.log(item);
    });
}).catch((e) => {
    console.log(e);
});

About

A simple interface to Scala Content Manager web-services.

Resources

License

Stars

Watchers

Forks

Packages

No packages published