node-scoreg
v3.1.0
Published
A simple client to the scoreg.at webservices
Downloads
19
Readme
node-scoreg
A simple client to the scoreg.at webservices, now with TypeScript support.
Install
$ npm install node-scoreg --save
Usage
const { MemberV2 } = require("node-scoreg");
const memberV2service = new MemberV2({
username: "myUsername",
password: "myPassword",
accessKey: "myAccessKey",
});
memberV2service.findScoutIdsForOrganization().then(scoutIds => console.log(scoutIds));
memberV2service.findMemberByScoutId("anyScoutId").then(member => console.log(member));
memberV2service.findMemberCompleteByScoutId("anyScoutId").then(memberComplete => console.log(memberComplete));
As of ECMAScript 2017 (ES8), you can also use async/await:
const scoutIds = await memberV2service.findScoutIdsForOrganization();
console.log(scoutIds.length);
How to get your access key
Ask your Gruppen-Administrator! The Gruppen-Administrator will...
- Log in to SCOREG
- Open your member details (the page with your "Stammdaten", "Details", "Beschreibung", etc.)
- Click on tab "Berechtigungen"
- Add "WebService-Zugriff Mitglieder (Gruppe)" for your organization to you
- Locate the access key for your organization within the table, and send it to you
API
constructor({ username, password, accessKey, agent = { keepAlive: true } })
/**
* @constructor
* @param {object} options
* @param {string} options.username
* @param {string} options.password
* @param {string} options.accessKey
* @param {object} [options.agent] - An instance of {@link https://nodejs.org/dist/latest-v8.x/docs/api/http.html#http_class_http_agent https.Agent}, or options to create one
*/
constructor({ username, password, accessKey, agent = { keepAlive: true } }) {}
findScoutIdsForOrganization()
/**
* @return {Promise<string[]>}
*/
findScoutIdsForOrganization() {}
findMemberByScoutId(scoutId)
/**
* @param {string} scoutId
* @return {Promise<object>}
*/
findMemberByScoutId(scoutId) {}
findMemberCompleteByScoutId(scoutId)
/**
* @param {string} scoutId
* @return {Promise<object>}
*/
findMemberCompleteByScoutId(scoutId) {}