Skip to content

Commit aa91627

Browse files
author
Marek Sierociński
authored
Merge pull request #52 from krzysztof-moscichowski-smartbear/master
SDCC-889 - adding possibility to fetch tunnels depending on their activity
2 parents e33bac6 + 0630f1e commit aa91627

10 files changed

+63
-12
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import APIList from './APIList';
2+
declare class APIListSmartbearTunnels extends APIList {
3+
constructor(parent: object);
4+
active(active: boolean): this;
5+
}
6+
export default APIListSmartbearTunnels;

dist/api/APIResourceUser.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import APIListFiles from './APIListFiles';
1414
import APIListServices from './APIListServices';
1515
import APIListRuns from './APIListRuns';
1616
import APIListNotifications from './APIListNotifications';
17+
import APIListSmartbearTunnels from './APIListSmartbearTunnels';
1718
declare class APIResourceUser extends APIResource {
1819
constructor(parent: object, id: number | 'me');
1920
account(): APIUserResourceAccount;
@@ -52,6 +53,6 @@ declare class APIResourceUser extends APIResource {
5253
accessGroups(): APIList;
5354
accessGroup(id: number): APIResourceAccessGroup;
5455
smartbearTunnel(id: number): APIResource;
55-
smartbearTunnels(): APIList;
56+
smartbearTunnels(): APIListSmartbearTunnels;
5657
}
5758
export default APIResourceUser;

dist/bitbar-cloud-api-client.js

Lines changed: 13 additions & 3 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.27.0",
3+
"version": "0.28.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/APIListSmartbearTunnels.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import APIList from './APIList'
2+
3+
/**
4+
* APIListSmartbearTunnels
5+
*
6+
* @class
7+
* @extends APIList
8+
*/
9+
class APIListSmartbearTunnels extends APIList {
10+
11+
/**
12+
* /tunnels
13+
*
14+
* Constructor
15+
*/
16+
constructor (parent: object) {
17+
super(parent);
18+
this.push('tunnels');
19+
}
20+
21+
/**
22+
* Sets tunnel activity parameter
23+
*
24+
* @public
25+
* @param {number} active - fetching active or inactive tunnels
26+
* @returns this
27+
*/
28+
public active (active: boolean) {
29+
return this.params({ active: active });
30+
}
31+
}
32+
33+
export default APIListSmartbearTunnels;

src/api/APIResourceUser.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import APIListFiles from './APIListFiles'
1616
import APIListServices from './APIListServices'
1717
import APIListRuns from './APIListRuns'
1818
import APIListNotifications from './APIListNotifications'
19+
import APIListSmartbearTunnels from './APIListSmartbearTunnels'
1920

2021

2122
/**
@@ -75,7 +76,7 @@ class APIResourceUser extends APIResource {
7576

7677
return new APIResource(this).push('services', id);
7778
}
78-
79+
7980
// /users/{id}/billing-periods
8081
public billingPeriods () {
8182
return new APIList(this).push('billing-periods');
@@ -240,7 +241,7 @@ class APIResourceUser extends APIResource {
240241

241242
// /users/{id}/tunnels
242243
public smartbearTunnels () {
243-
return new APIList(this).push('tunnels');
244+
return new APIListSmartbearTunnels(this);
244245
}
245246
}
246247

0 commit comments

Comments
 (0)