Skip to content

Commit a620d72

Browse files
author
Marek Sierociński
authored
Merge pull request #34 from marverix/master
Added changes for SDCC-115
2 parents 451fd43 + bc68ec1 commit a620d72

12 files changed

+121
-23
lines changed

dist/api/APIListServices.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import APIListPurchased from './APIListPurchased';
33
declare class APIListServices extends APIList {
44
constructor(parent: object);
55
purchased(): APIListPurchased;
6-
available(): void;
6+
available(): APIList;
7+
active(): APIList;
78
}
89
export default APIListServices;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import APIResource from './APIResource';
2+
declare class APIResourceAccountService extends APIResource {
3+
constructor(parent: object, id: number);
4+
activate(): APIResource;
5+
deactivate(): APIResource;
6+
billingPeriod(): APIResource;
7+
}
8+
export default APIResourceAccountService;

dist/api/APIResourceUser.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ import APIListFiles from './APIListFiles';
1414
import APIListServices from './APIListServices';
1515
import APIListRuns from './APIListRuns';
1616
import APIListNotifications from './APIListNotifications';
17+
import APIResourceAccountService from './APIResourceAccountService';
1718
declare class APIResourceUser extends APIResource {
1819
constructor(parent: object, id: number | 'me');
1920
account(): APIResourceAccount;
2021
deviceTime(): APIListDeviceTime;
2122
deviceTimeSummary(): APIList;
2223
services(): APIListServices;
2324
service(id: number): APIResource;
24-
accountServiceBillingPeriod(id: number): APIResource;
25+
accountServices(): APIList;
26+
accountService(id: number): APIResourceAccountService;
2527
billingPeriods(): APIList;
2628
billingPeriod(id: number): APIResourceBillingPeriod;
2729
jobs(): APIList;

dist/bitbar-cloud-api-client.js

Lines changed: 39 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bitbar-cloud-api-client.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bitbar-cloud-api-client.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bitbar-cloud-api-client.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bitbar/cloud-api-client",
3-
"version": "0.23.0",
3+
"version": "0.24.0",
44
"description": "Bitbar Cloud API Client for JavaScript",
55
"main": "dist/bitbar-cloud-api-client.min.js",
66
"types": "dist/index.d.ts",

src/api/APIListServices.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,19 @@ class APIListServices extends APIList {
2323

2424
// /services/available
2525
public available () {
26-
this.push('available');
26+
return new APIList(this).push('available');
27+
}
28+
29+
public active () {
30+
const a = new APIList(this);
31+
if (this.stack[0] === 'me') {
32+
a.push('active');
33+
} else {
34+
a.params({
35+
notArchived: true
36+
});
37+
}
38+
return a;
2739
}
2840

2941
}

0 commit comments

Comments
 (0)