1.1.1 • Published 5 years ago

scjs v1.1.1

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

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):

const { ConManager } = require('scjs');

const baseurl = "http://localhost/ContentManager";
const username = "user";
const password = "pass";
const cm = new ConManager(baseurl);

(async () => {
    const resp = await cm.login(username, password);

    try {
        const players = await cm.get('players', { 'limit': 0, 'offset': 0, 'fields': 'id,name,enabled,active,type' });
        console.log(players.list);

        const media = await cm.get('media', { 'limit': 10, 'filters': '{"type":{"values":["IMAGE"]}}' });

        let items = [];
        for (const item of media.list) {
            items.push(cm.download(item.downloadPath, item.name));
        }
        await Promise.all(items);

        const item = await cm.upload('LocalFolder/MyPicture.jpg', 'RemoteFolder/MyPicture.jpg');
        console.log(item);
    } finally {
        await cm.post('auth/logout');
    }
})().catch((e) => {
    console.log(e);
});
1.1.1

5 years ago

1.1.0

5 years ago

1.0.9

5 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago