Skip to content

Commit ee0849e

Browse files
Version 1.0.2 with all PSP routes and the entire API is done
1 parent 9b2dd7b commit ee0849e

File tree

4 files changed

+91
-1
lines changed

4 files changed

+91
-1
lines changed

index.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,29 @@ module.exports = function (apiKey, forceRun) {
281281
}
282282
}
283283
}
284+
},
285+
psp: {
286+
pack: {
287+
info: function (pack, callback) {
288+
makeRequest(false, makeUrl('psp/pack/' + pack), 'GET', callback);
289+
},
290+
version: {
291+
info: function (pack, version, callback) {
292+
makeRequest(false, makeUrl('psp/pack/' + pack + '/' + version), 'GET', callback);
293+
}
294+
}
295+
},
296+
packs: {
297+
all: function (callback) {
298+
makeRequest(false, makeUrl('psp/packs/all'), 'GET', callback);
299+
},
300+
public: function (callback) {
301+
makeRequest(false, makeUrl('psp/packs/public'), 'GET', callback);
302+
},
303+
semipublic: function (callback) {
304+
makeRequest(false, makeUrl('psp/packs/semipublic'), 'GET', callback);
305+
}
306+
}
284307
}
285308
};
286309
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "atlauncher-api",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Node.js module for interacting with the ATLauncher API",
55
"main": "index.js",
66
"scripts": {

tests/psp.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* ATLauncher API - NodeJS - https://github.com/ATLauncher/ATLauncher-API---NodeJS
3+
* Copyright (C) 2015 ATLauncher
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
19+
'use strict';
20+
21+
var atlauncher = require('../index')(process.env.PSP_API_KEY),
22+
assert = require('assert');
23+
24+
atlauncher.psp.packs.all(function (err, res) {
25+
if (err) {
26+
return console.log(err);
27+
}
28+
29+
assert.equal(false, res.error);
30+
31+
atlauncher.psp.pack.info(res.data[0].name, function (err, res) {
32+
if (err) {
33+
return console.log(err);
34+
}
35+
36+
assert.equal(false, res.error);
37+
38+
atlauncher.psp.pack.version.info(res.data.name, res.data.versions[0].version, function (err, res) {
39+
if (err) {
40+
return console.log(err);
41+
}
42+
43+
assert.equal(false, res.error);
44+
});
45+
});
46+
});
47+
48+
atlauncher.psp.packs.public(function (err, res) {
49+
if (err) {
50+
return console.log(err);
51+
}
52+
53+
assert.equal(false, res.error);
54+
});
55+
56+
atlauncher.psp.packs.semipublic(function (err, res) {
57+
if (err) {
58+
return console.log(err);
59+
}
60+
61+
assert.equal(false, res.error);
62+
});

tests/test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,9 @@ require('./public.js');
2424
if (process.env.API_KEY) {
2525
console.log('Running admin API tests!');
2626
require('./admin.js');
27+
}
28+
29+
if (process.env.PSP_API_KEY) {
30+
console.log('Running PSP API tests!');
31+
require('./psp.js');
2732
}

0 commit comments

Comments
 (0)