@bitbar/cloud-api-client 0.55.1 → 0.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/API.d.ts +40 -38
  2. package/dist/ApiConfig.d.ts +10 -10
  3. package/dist/CloudAPIClient.d.ts +7 -7
  4. package/dist/Filter.d.ts +7 -7
  5. package/dist/FilterBuilder.d.ts +25 -25
  6. package/dist/api/APIAdminListDevices.d.ts +12 -12
  7. package/dist/api/APIAdminListNotificationPlans.d.ts +7 -7
  8. package/dist/api/APIAdminListRuns.d.ts +7 -7
  9. package/dist/api/APIAdminListServices.d.ts +12 -12
  10. package/dist/api/APIAdminListStatistics.d.ts +7 -7
  11. package/dist/api/APIAdminResource.d.ts +91 -91
  12. package/dist/api/APIAdminResourceAccount.d.ts +5 -5
  13. package/dist/api/APIAdminResourceAccountService.d.ts +7 -7
  14. package/dist/api/APIAdminResourceCluster.d.ts +7 -7
  15. package/dist/api/APIAdminResourceDevice.d.ts +11 -11
  16. package/dist/api/APIAdminResourceDeviceModel.d.ts +7 -7
  17. package/dist/api/APIAdminResourceDeviceSession.d.ts +5 -5
  18. package/dist/api/APIAdminResourceDeviceSessionStandalone.d.ts +12 -12
  19. package/dist/api/APIAdminResourceDeviceTime.d.ts +8 -8
  20. package/dist/api/APIAdminResourceFramework.d.ts +8 -8
  21. package/dist/api/APIAdminResourceLicense.d.ts +9 -9
  22. package/dist/api/APIAdminResourceNotificationPlan.d.ts +9 -9
  23. package/dist/api/APIAdminResourceProject.d.ts +6 -6
  24. package/dist/api/APIAdminResourceRun.d.ts +7 -7
  25. package/dist/api/APIAdminResourceRunStandalone.d.ts +13 -13
  26. package/dist/api/APIAdminResourceService.d.ts +9 -9
  27. package/dist/api/APIAdminResourceUser.d.ts +12 -12
  28. package/dist/api/APIAdminResourceUserAccount.d.ts +10 -10
  29. package/dist/api/APIEntity.d.ts +32 -32
  30. package/dist/api/APIList.d.ts +24 -24
  31. package/dist/api/APIListCleanupConfigurations.d.ts +7 -7
  32. package/dist/api/APIListDeviceTime.d.ts +7 -7
  33. package/dist/api/APIListDevices.d.ts +12 -12
  34. package/dist/api/APIListFiles.d.ts +10 -10
  35. package/dist/api/APIListNotifications.d.ts +7 -7
  36. package/dist/api/APIListProperties.d.ts +6 -6
  37. package/dist/api/APIListPurchased.d.ts +5 -5
  38. package/dist/api/APIListRuns.d.ts +7 -7
  39. package/dist/api/APIListServices.d.ts +9 -9
  40. package/dist/api/APIListSmartbearTunnels.d.ts +6 -6
  41. package/dist/api/APIListStatistics.d.ts +6 -6
  42. package/dist/api/APIListUsers.d.ts +11 -11
  43. package/dist/api/APIResource.d.ts +5 -5
  44. package/dist/api/APIResourceAccessGroup.d.ts +10 -10
  45. package/dist/api/APIResourceAccount.d.ts +7 -7
  46. package/dist/api/APIResourceAccountService.d.ts +6 -6
  47. package/dist/api/APIResourceAdditionalUser.d.ts +6 -6
  48. package/dist/api/APIResourceBillingPeriod.d.ts +6 -6
  49. package/dist/api/APIResourceBroker.d.ts +7 -0
  50. package/dist/api/APIResourceBuild.d.ts +8 -8
  51. package/dist/api/APIResourceCleanupConfiguration.d.ts +7 -7
  52. package/dist/api/APIResourceDevice.d.ts +7 -7
  53. package/dist/api/APIResourceDeviceGroup.d.ts +11 -11
  54. package/dist/api/APIResourceDeviceSession.d.ts +8 -8
  55. package/dist/api/APIResourceDeviceSessionCommon.d.ts +18 -18
  56. package/dist/api/APIResourceDeviceSessionStandalone.d.ts +14 -14
  57. package/dist/api/APIResourceFile.d.ts +9 -9
  58. package/dist/api/APIResourceJob.d.ts +9 -9
  59. package/dist/api/APIResourceLabelGroup.d.ts +8 -8
  60. package/dist/api/APIResourceNotification.d.ts +6 -6
  61. package/dist/api/APIResourceProject.d.ts +15 -15
  62. package/dist/api/APIResourceRun.d.ts +6 -6
  63. package/dist/api/APIResourceRunCommon.d.ts +19 -19
  64. package/dist/api/APIResourceUser.d.ts +56 -56
  65. package/dist/api/APIResourceUserSession.d.ts +9 -9
  66. package/dist/api/APIUserResourceAccount.d.ts +10 -10
  67. package/dist/api/class/InputFileset.d.ts +8 -8
  68. package/dist/api/class/OutputFileset.d.ts +14 -14
  69. package/dist/api/factory/postAdminDeviceSessionChangeBillable.d.ts +4 -4
  70. package/dist/api/factory/postDeviceRunIds.d.ts +4 -4
  71. package/dist/api/interface/DeviceSession.d.ts +7 -7
  72. package/dist/api/interface/DeviceSessionBase.d.ts +8 -8
  73. package/dist/api/interface/DeviceSessionCommon.d.ts +13 -13
  74. package/dist/api/interface/DeviceSessionStandalone.d.ts +9 -9
  75. package/dist/bitbar-cloud-api-client.js +1740 -1725
  76. package/dist/bitbar-cloud-api-client.js.map +1 -1
  77. package/dist/bitbar-cloud-api-client.min.js +2 -2
  78. package/dist/bitbar-cloud-api-client.min.js.map +1 -1
  79. package/dist/finka.d.ts +2 -2
  80. package/dist/index.d.ts +2 -2
  81. package/package.json +11 -11
@@ -1,1851 +1,1866 @@
1
- /* @bitbar/cloud-api-client v0.55.1 | Copyright 2021 (c) SmartBear Software and contributors | .git/blob/master/LICENSE */
1
+ /* @bitbar/cloud-api-client v0.56.0 | Copyright 2022 (c) SmartBear Software and contributors | .git/blob/master/LICENSE */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@bitbar/finka'), require('axios'), require('qs')) :
4
4
  typeof define === 'function' && define.amd ? define(['@bitbar/finka', 'axios', 'qs'], factory) :
5
- (global = global || self, global['bitbar-cloud-api-client'] = factory(global['@bitbar/finka'], global.axios, global.qs));
6
- }(this, (function (finka, axios, qs) { 'use strict';
7
-
8
- finka = finka && Object.prototype.hasOwnProperty.call(finka, 'default') ? finka['default'] : finka;
9
- axios = axios && Object.prototype.hasOwnProperty.call(axios, 'default') ? axios['default'] : axios;
10
- qs = qs && Object.prototype.hasOwnProperty.call(qs, 'default') ? qs['default'] : qs;
11
-
12
- finka();
13
-
14
- var version = "0.55.1";
15
-
16
- var ALLOWED_HTTP_METHODS;
17
- (function (ALLOWED_HTTP_METHODS) {
18
- ALLOWED_HTTP_METHODS["GET"] = "GET";
19
- ALLOWED_HTTP_METHODS["POST"] = "POST";
20
- ALLOWED_HTTP_METHODS["DELETE"] = "DELETE";
21
- })(ALLOWED_HTTP_METHODS || (ALLOWED_HTTP_METHODS = {}));
22
- class APIEntity {
23
- constructor(parent) {
24
- this.stack = [];
25
- this.requestConfig = {};
26
- if (parent instanceof APIEntity) {
27
- this.root = parent.root;
28
- if (Array.isArray(parent.stack)) {
29
- this.push(...parent.stack);
30
- }
31
- if (parent.requestConfig != null) {
32
- this.setRequestConfig(parent.requestConfig);
33
- }
34
- }
35
- else {
36
- this.root = parent;
37
- }
38
- }
39
- push(...items) {
40
- for (const item of items) {
41
- this.stack.push(item);
42
- }
43
- return this;
44
- }
45
- pop() {
46
- this.stack.pop();
47
- return this;
48
- }
49
- shift() {
50
- this.stack.shift();
51
- return this;
52
- }
53
- unshift(...items) {
54
- for (const item of items) {
55
- this.stack.unshift(item);
56
- }
57
- return this;
58
- }
59
- restack(...items) {
60
- this.stack = items;
61
- return this;
62
- }
63
- get first() {
64
- return this.stack[0];
65
- }
66
- set first(val) {
67
- this.stack[0] = val;
68
- }
69
- get last() {
70
- return this.stack[this.stack.length - 1];
71
- }
72
- set last(val) {
73
- this.stack[this.stack.length - 1] = val;
74
- }
75
- toUrl(absolute = false) {
76
- let url = `/${this.stack.join('/')}`;
77
- if (absolute) {
78
- url = this.root.axiosConfig.baseURL + url;
79
- }
80
- return url;
81
- }
82
- setRequestConfig(requestConfig) {
83
- Object.deepAssign(this.requestConfig, requestConfig);
84
- return this;
85
- }
86
- removeRequestConfig(key) {
87
- delete this.requestConfig[key];
88
- return this;
89
- }
90
- headers(headers) {
91
- const _headers = {};
92
- for (const key in headers) {
93
- const newKey = key.replace(/(?:^|-)([a-z])/g, (letter) => letter.toUpperCase());
94
- _headers[newKey] = headers[key];
95
- }
96
- return this.setRequestConfig({
97
- headers: _headers
98
- });
99
- }
100
- method(name) {
101
- const NAME = name.toLocaleUpperCase();
102
- if (!ALLOWED_HTTP_METHODS[NAME]) {
103
- throw new Error(`Method '${NAME}' is not allowed! You can use: ${Object.keys(ALLOWED_HTTP_METHODS).join(', ')}`);
104
- }
105
- return this.setRequestConfig({
106
- method: NAME
107
- });
108
- }
109
- get() {
110
- return this.method('GET');
111
- }
112
- post() {
113
- return this.method('POST');
114
- }
115
- params(params) {
116
- Object.deepAssign(this.requestConfig, {
117
- params
118
- });
119
- return this;
120
- }
121
- getParams() {
122
- return this.requestConfig.params == null ? {} : this.requestConfig.params;
123
- }
124
- removeParam(key) {
125
- delete this.requestConfig.params[key];
126
- return this;
127
- }
128
- data(data) {
129
- Object.deepAssign(this.requestConfig, {
130
- data
131
- });
132
- return this;
133
- }
134
- jsonData(data) {
135
- this.headers({
136
- 'Content-Type': 'application/json'
137
- }).data(data);
138
- return this;
139
- }
140
- formData(data) {
141
- this.headers({
142
- 'Content-Type': 'multipart/form-data'
143
- }).data(data);
144
- return this;
145
- }
146
- paramsSerializer(params) {
147
- return qs.stringify(params, {
148
- arrayFormat: 'brackets'
149
- });
150
- }
151
- send() {
152
- const requestConfig = Object.deepAssign({}, this.requestConfig, {
153
- url: `/${this.stack.join('/')}`
154
- });
155
- if (requestConfig.headers == null) {
156
- requestConfig.headers = {};
157
- }
158
- if (requestConfig.headers['Content-Type'] == null) {
159
- requestConfig.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';
160
- }
161
- if (requestConfig.method === 'POST' &&
162
- requestConfig.headers['Content-Type'].startsWith('application/x-www-form-urlencoded') &&
163
- requestConfig.data != null) {
164
- requestConfig.data = qs.stringify(requestConfig.data, {
165
- arrayFormat: 'brackets'
166
- });
167
- }
168
- if (requestConfig.params) {
169
- requestConfig.paramsSerializer = this.paramsSerializer;
170
- }
171
- return this.root.axios.request(requestConfig);
172
- }
5
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global["bitbar-cloud-api-client"] = factory(global["@bitbar/finka"], global.axios, global.qs));
6
+ })(this, (function (finka, axios, qs) { 'use strict';
7
+
8
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
+
10
+ var finka__default = /*#__PURE__*/_interopDefaultLegacy(finka);
11
+ var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
12
+ var qs__default = /*#__PURE__*/_interopDefaultLegacy(qs);
13
+
14
+ finka__default["default"]();
15
+
16
+ var version = "0.56.0";
17
+
18
+ var ALLOWED_HTTP_METHODS;
19
+ (function (ALLOWED_HTTP_METHODS) {
20
+ ALLOWED_HTTP_METHODS["GET"] = "GET";
21
+ ALLOWED_HTTP_METHODS["POST"] = "POST";
22
+ ALLOWED_HTTP_METHODS["DELETE"] = "DELETE";
23
+ })(ALLOWED_HTTP_METHODS || (ALLOWED_HTTP_METHODS = {}));
24
+ class APIEntity {
25
+ constructor(parent) {
26
+ this.stack = [];
27
+ this.requestConfig = {};
28
+ if (parent instanceof APIEntity) {
29
+ this.root = parent.root;
30
+ if (Array.isArray(parent.stack)) {
31
+ this.push(...parent.stack);
32
+ }
33
+ if (parent.requestConfig != null) {
34
+ this.setRequestConfig(parent.requestConfig);
35
+ }
36
+ }
37
+ else {
38
+ this.root = parent;
39
+ }
40
+ }
41
+ push(...items) {
42
+ for (const item of items) {
43
+ this.stack.push(item);
44
+ }
45
+ return this;
46
+ }
47
+ pop() {
48
+ this.stack.pop();
49
+ return this;
50
+ }
51
+ shift() {
52
+ this.stack.shift();
53
+ return this;
54
+ }
55
+ unshift(...items) {
56
+ for (const item of items) {
57
+ this.stack.unshift(item);
58
+ }
59
+ return this;
60
+ }
61
+ restack(...items) {
62
+ this.stack = items;
63
+ return this;
64
+ }
65
+ get first() {
66
+ return this.stack[0];
67
+ }
68
+ set first(val) {
69
+ this.stack[0] = val;
70
+ }
71
+ get last() {
72
+ return this.stack[this.stack.length - 1];
73
+ }
74
+ set last(val) {
75
+ this.stack[this.stack.length - 1] = val;
76
+ }
77
+ toUrl(absolute = false) {
78
+ let url = `/${this.stack.join('/')}`;
79
+ if (absolute) {
80
+ url = this.root.axiosConfig.baseURL + url;
81
+ }
82
+ return url;
83
+ }
84
+ setRequestConfig(requestConfig) {
85
+ Object.deepAssign(this.requestConfig, requestConfig);
86
+ return this;
87
+ }
88
+ removeRequestConfig(key) {
89
+ delete this.requestConfig[key];
90
+ return this;
91
+ }
92
+ headers(headers) {
93
+ const _headers = {};
94
+ for (const key in headers) {
95
+ const newKey = key.replace(/(?:^|-)([a-z])/g, (letter) => letter.toUpperCase());
96
+ _headers[newKey] = headers[key];
97
+ }
98
+ return this.setRequestConfig({
99
+ headers: _headers
100
+ });
101
+ }
102
+ method(name) {
103
+ const NAME = name.toLocaleUpperCase();
104
+ if (!ALLOWED_HTTP_METHODS[NAME]) {
105
+ throw new Error(`Method '${NAME}' is not allowed! You can use: ${Object.keys(ALLOWED_HTTP_METHODS).join(', ')}`);
106
+ }
107
+ return this.setRequestConfig({
108
+ method: NAME
109
+ });
110
+ }
111
+ get() {
112
+ return this.method('GET');
113
+ }
114
+ post() {
115
+ return this.method('POST');
116
+ }
117
+ params(params) {
118
+ Object.deepAssign(this.requestConfig, {
119
+ params
120
+ });
121
+ return this;
122
+ }
123
+ getParams() {
124
+ return this.requestConfig.params == null ? {} : this.requestConfig.params;
125
+ }
126
+ removeParam(key) {
127
+ delete this.requestConfig.params[key];
128
+ return this;
129
+ }
130
+ data(data) {
131
+ Object.deepAssign(this.requestConfig, {
132
+ data
133
+ });
134
+ return this;
135
+ }
136
+ jsonData(data) {
137
+ this.headers({
138
+ 'Content-Type': 'application/json'
139
+ }).data(data);
140
+ return this;
141
+ }
142
+ formData(data) {
143
+ this.headers({
144
+ 'Content-Type': 'multipart/form-data'
145
+ }).data(data);
146
+ return this;
147
+ }
148
+ paramsSerializer(params) {
149
+ return qs__default["default"].stringify(params, {
150
+ arrayFormat: 'brackets'
151
+ });
152
+ }
153
+ send() {
154
+ const requestConfig = Object.deepAssign({}, this.requestConfig, {
155
+ url: `/${this.stack.join('/')}`
156
+ });
157
+ if (requestConfig.headers == null) {
158
+ requestConfig.headers = {};
159
+ }
160
+ if (requestConfig.headers['Content-Type'] == null) {
161
+ requestConfig.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';
162
+ }
163
+ if (requestConfig.method === 'POST' &&
164
+ requestConfig.headers['Content-Type'].startsWith('application/x-www-form-urlencoded') &&
165
+ requestConfig.data != null) {
166
+ requestConfig.data = qs__default["default"].stringify(requestConfig.data, {
167
+ arrayFormat: 'brackets'
168
+ });
169
+ }
170
+ if (requestConfig.params) {
171
+ requestConfig.paramsSerializer = this.paramsSerializer;
172
+ }
173
+ return this.root.axios.request(requestConfig);
174
+ }
173
175
  }
174
176
 
175
- class Filter {
176
- constructor(name, value, operand) {
177
- this.name = name;
178
- this.value = value;
179
- this.operand = operand;
180
- }
177
+ class Filter {
178
+ constructor(name, value, operand) {
179
+ this.name = name;
180
+ this.value = value;
181
+ this.operand = operand;
182
+ }
181
183
  }
182
184
 
183
- class FilterBuilder {
184
- constructor() {
185
- this.filters = [];
186
- }
187
- add(name, value, operand, checkNull = false) {
188
- value = Array.wrap(value);
189
- if (value.length === 0) {
190
- return this;
191
- }
192
- for (let i = 0; i < value.length; i++) {
193
- const v = value[i];
194
- if (typeof v === 'object' && v instanceof Date) {
195
- value[i] = v.getTime();
196
- }
197
- }
198
- if (checkNull) {
199
- for (const v of value) {
200
- if (v !== null) {
201
- continue;
202
- }
203
- }
204
- }
205
- if (operand.endsWith('ornull') && value.length === 0) {
206
- operand = 'isnull';
207
- }
208
- this.filters.push(new Filter(name, value, operand));
209
- return this;
210
- }
211
- gt(name, value) {
212
- return this.add(name, value, 'gt');
213
- }
214
- lt(name, value) {
215
- return this.add(name, value, 'lt');
216
- }
217
- after(name, value) {
218
- return this.add(name, value, 'after', true);
219
- }
220
- afterorequal(name, value) {
221
- return this.add(name, value, 'afterorequal', true);
222
- }
223
- before(name, value) {
224
- return this.add(name, value, 'before', true);
225
- }
226
- beforeorequal(name, value) {
227
- return this.add(name, value, 'beforeorequal', true);
228
- }
229
- on(name, value) {
230
- return this.add(name, value, 'on');
231
- }
232
- eq(name, value) {
233
- return this.add(name, value, 'eq');
234
- }
235
- contains(name, value) {
236
- return this.add(name, value, 'contains');
237
- }
238
- like(name, value) {
239
- return this.add(name, value, 'like');
240
- }
241
- notlike(name, value) {
242
- return this.add(name, value, 'notlike');
243
- }
244
- isnull(name) {
245
- return this.add(name, undefined, 'isnull');
246
- }
247
- in(name, value) {
248
- return this.add(name, value, 'in', true);
249
- }
250
- notin(name, value) {
251
- return this.add(name, value, 'notin', true);
252
- }
253
- raw(filter) {
254
- const filters = Array.wrap(filter);
255
- for (const filter of filters) {
256
- if (this.isFilterPart(filter)) {
257
- this.filters.push(filter);
258
- }
259
- else {
260
- throw new SyntaxError(`Filter ${filter} has invalid syntax`);
261
- }
262
- }
263
- }
264
- isFilterPart(str) {
265
- return /^[a-zA-Z0-9.]{2,12}_(?:isnull$|(?:gt|lt|(?:after|before)(?:orequal)?|on|eq|contains|like|(?:not)?in)_)/.test(str);
266
- }
267
- toString() {
268
- const parts = [];
269
- let part, val;
270
- for (const filter of this.filters) {
271
- if (typeof filter === 'string') {
272
- part = filter;
273
- }
274
- else {
275
- val = '';
276
- if (filter.value.length > 1 || typeof filter.value[0] !== 'undefined') {
277
- val = `_${filter.value.join('|')}`;
278
- }
279
- part = `${filter.name}_${filter.operand}${val}`;
280
- }
281
- parts.push(part);
282
- }
283
- return parts.join(';');
284
- }
185
+ class FilterBuilder {
186
+ constructor() {
187
+ this.filters = [];
188
+ }
189
+ add(name, value, operand, checkNull = false) {
190
+ value = Array.wrap(value);
191
+ if (value.length === 0) {
192
+ return this;
193
+ }
194
+ for (let i = 0; i < value.length; i++) {
195
+ const v = value[i];
196
+ if (typeof v === 'object' && v instanceof Date) {
197
+ value[i] = v.getTime();
198
+ }
199
+ }
200
+ if (checkNull) {
201
+ for (const v of value) {
202
+ if (v !== null) {
203
+ continue;
204
+ }
205
+ }
206
+ }
207
+ if (operand.endsWith('ornull') && value.length === 0) {
208
+ operand = 'isnull';
209
+ }
210
+ this.filters.push(new Filter(name, value, operand));
211
+ return this;
212
+ }
213
+ gt(name, value) {
214
+ return this.add(name, value, 'gt');
215
+ }
216
+ lt(name, value) {
217
+ return this.add(name, value, 'lt');
218
+ }
219
+ after(name, value) {
220
+ return this.add(name, value, 'after', true);
221
+ }
222
+ afterorequal(name, value) {
223
+ return this.add(name, value, 'afterorequal', true);
224
+ }
225
+ before(name, value) {
226
+ return this.add(name, value, 'before', true);
227
+ }
228
+ beforeorequal(name, value) {
229
+ return this.add(name, value, 'beforeorequal', true);
230
+ }
231
+ on(name, value) {
232
+ return this.add(name, value, 'on');
233
+ }
234
+ eq(name, value) {
235
+ return this.add(name, value, 'eq');
236
+ }
237
+ contains(name, value) {
238
+ return this.add(name, value, 'contains');
239
+ }
240
+ like(name, value) {
241
+ return this.add(name, value, 'like');
242
+ }
243
+ notlike(name, value) {
244
+ return this.add(name, value, 'notlike');
245
+ }
246
+ isnull(name) {
247
+ return this.add(name, undefined, 'isnull');
248
+ }
249
+ in(name, value) {
250
+ return this.add(name, value, 'in', true);
251
+ }
252
+ notin(name, value) {
253
+ return this.add(name, value, 'notin', true);
254
+ }
255
+ raw(filter) {
256
+ const filters = Array.wrap(filter);
257
+ for (const filter of filters) {
258
+ if (this.isFilterPart(filter)) {
259
+ this.filters.push(filter);
260
+ }
261
+ else {
262
+ throw new SyntaxError(`Filter ${filter} has invalid syntax`);
263
+ }
264
+ }
265
+ }
266
+ isFilterPart(str) {
267
+ return /^[a-zA-Z0-9.]{2,12}_(?:isnull$|(?:gt|lt|(?:after|before)(?:orequal)?|on|eq|contains|like|(?:not)?in)_)/.test(str);
268
+ }
269
+ toString() {
270
+ const parts = [];
271
+ let part, val;
272
+ for (const filter of this.filters) {
273
+ if (typeof filter === 'string') {
274
+ part = filter;
275
+ }
276
+ else {
277
+ val = '';
278
+ if (filter.value.length > 1 || typeof filter.value[0] !== 'undefined') {
279
+ val = `_${filter.value.join('|')}`;
280
+ }
281
+ part = `${filter.name}_${filter.operand}${val}`;
282
+ }
283
+ parts.push(part);
284
+ }
285
+ return parts.join(';');
286
+ }
285
287
  }
286
288
 
287
- const DEFAULT_LIMIT = 20;
288
- const DEFAULT_OFFSET = 0;
289
- var APIOrder;
290
- (function (APIOrder) {
291
- APIOrder["asc"] = "a";
292
- APIOrder["desc"] = "d";
293
- })(APIOrder || (APIOrder = {}));
294
- class APIList extends APIEntity {
295
- create(data) {
296
- return this.post().data(data).send();
297
- }
298
- sort(name, order = APIOrder.asc) {
299
- return this.params({
300
- sort: `${name}_${order}`
301
- });
302
- }
303
- limit(limit = DEFAULT_LIMIT) {
304
- if (!Number.isNatural(limit)) {
305
- throw new Error(`Limit '${limit}' is invalid!`);
306
- }
307
- return this.params({
308
- limit
309
- });
310
- }
311
- getLimit() {
312
- const params = this.getParams();
313
- return params.limit == null ? DEFAULT_LIMIT : params.limit;
314
- }
315
- noLimit() {
316
- return this.limit(0);
317
- }
318
- offset(offset = DEFAULT_OFFSET) {
319
- if (!Number.isNatural(offset)) {
320
- throw new Error(`Offset '${offset}' is invalid!`);
321
- }
322
- return this.params({
323
- offset
324
- });
325
- }
326
- between(from, to) {
327
- if (!Number.isNatural(from)) {
328
- throw new Error(`From '${from}' is invalid!`);
329
- }
330
- if (!Number.isNatural(to)) {
331
- throw new Error(`To '${to}' is invalid!`);
332
- }
333
- return this.params({
334
- offset: from,
335
- limit: 1 + (to - from)
336
- });
337
- }
338
- only(idx) {
339
- if (!Number.isNatural(idx)) {
340
- throw new Error(`Index '${idx}' is invalid!`);
341
- }
342
- return this.params({
343
- offset: idx,
344
- limit: 1
345
- });
346
- }
347
- page(page = 1) {
348
- if (!Number.isNatural(page) || page == 0) {
349
- throw new Error(`Page '${page}' is invalid!`);
350
- }
351
- const limit = this.getLimit();
352
- const offset = (page - 1) * limit;
353
- return this.params({
354
- offset,
355
- limit
356
- });
357
- }
358
- search(query) {
359
- if (typeof query !== 'string') {
360
- throw new Error('Search query must be a string!');
361
- }
362
- return this.params({
363
- search: query
364
- });
365
- }
366
- filter(filter) {
367
- const isFilterBuilder = filter instanceof FilterBuilder;
368
- if (typeof filter !== 'string' && !isFilterBuilder) {
369
- throw new Error('Filter must be either string or instance of FilterBuilder');
370
- }
371
- if (isFilterBuilder) {
372
- filter = filter.toString();
373
- }
374
- return this.params({
375
- filter
376
- });
377
- }
378
- }
379
- APIList.prototype.all = APIList.prototype.noLimit;
289
+ const DEFAULT_LIMIT = 20;
290
+ const DEFAULT_OFFSET = 0;
291
+ var APIOrder;
292
+ (function (APIOrder) {
293
+ APIOrder["asc"] = "a";
294
+ APIOrder["desc"] = "d";
295
+ })(APIOrder || (APIOrder = {}));
296
+ class APIList extends APIEntity {
297
+ create(data) {
298
+ return this.post().data(data).send();
299
+ }
300
+ sort(name, order = APIOrder.asc) {
301
+ return this.params({
302
+ sort: `${name}_${order}`
303
+ });
304
+ }
305
+ limit(limit = DEFAULT_LIMIT) {
306
+ if (!Number.isNatural(limit)) {
307
+ throw new Error(`Limit '${limit}' is invalid!`);
308
+ }
309
+ return this.params({
310
+ limit
311
+ });
312
+ }
313
+ getLimit() {
314
+ const params = this.getParams();
315
+ return params.limit == null ? DEFAULT_LIMIT : params.limit;
316
+ }
317
+ noLimit() {
318
+ return this.limit(0);
319
+ }
320
+ offset(offset = DEFAULT_OFFSET) {
321
+ if (!Number.isNatural(offset)) {
322
+ throw new Error(`Offset '${offset}' is invalid!`);
323
+ }
324
+ return this.params({
325
+ offset
326
+ });
327
+ }
328
+ between(from, to) {
329
+ if (!Number.isNatural(from)) {
330
+ throw new Error(`From '${from}' is invalid!`);
331
+ }
332
+ if (!Number.isNatural(to)) {
333
+ throw new Error(`To '${to}' is invalid!`);
334
+ }
335
+ return this.params({
336
+ offset: from,
337
+ limit: 1 + (to - from)
338
+ });
339
+ }
340
+ only(idx) {
341
+ if (!Number.isNatural(idx)) {
342
+ throw new Error(`Index '${idx}' is invalid!`);
343
+ }
344
+ return this.params({
345
+ offset: idx,
346
+ limit: 1
347
+ });
348
+ }
349
+ page(page = 1) {
350
+ if (!Number.isNatural(page) || page == 0) {
351
+ throw new Error(`Page '${page}' is invalid!`);
352
+ }
353
+ const limit = this.getLimit();
354
+ const offset = (page - 1) * limit;
355
+ return this.params({
356
+ offset,
357
+ limit
358
+ });
359
+ }
360
+ search(query) {
361
+ if (typeof query !== 'string') {
362
+ throw new Error('Search query must be a string!');
363
+ }
364
+ return this.params({
365
+ search: query
366
+ });
367
+ }
368
+ filter(filter) {
369
+ const isFilterBuilder = filter instanceof FilterBuilder;
370
+ if (typeof filter !== 'string' && !isFilterBuilder) {
371
+ throw new Error('Filter must be either string or instance of FilterBuilder');
372
+ }
373
+ if (isFilterBuilder) {
374
+ filter = filter.toString();
375
+ }
376
+ return this.params({
377
+ filter
378
+ });
379
+ }
380
+ }
381
+ APIList.prototype.all = APIList.prototype.noLimit;
380
382
  APIList.prototype.cut = APIList.prototype.between;
381
383
 
382
- class APIResource extends APIEntity {
383
- delete() {
384
- return this.method('DELETE');
385
- }
384
+ class APIResource extends APIEntity {
385
+ delete() {
386
+ return this.method('DELETE');
387
+ }
388
+ }
389
+
390
+ class APIListCleanupConfigurations extends APIList {
391
+ constructor(parent) {
392
+ super(parent);
393
+ this.push('cleanup-configurations');
394
+ }
395
+ specific() {
396
+ return new APIResource(this).push('specific');
397
+ }
386
398
  }
387
399
 
388
- class APIListCleanupConfigurations extends APIList {
389
- constructor(parent) {
390
- super(parent);
391
- this.push('cleanup-configurations');
392
- }
393
- specific() {
394
- return new APIResource(this).push('specific');
395
- }
400
+ class APIResourceCleanupConfiguration extends APIResource {
401
+ constructor(parent, id) {
402
+ if (id == null) {
403
+ throw new Error('Resource ID cannot be null!');
404
+ }
405
+ super(parent);
406
+ this.push('cleanup-configurations', id);
407
+ }
408
+ devices() {
409
+ return new APIList(this).push('devices');
410
+ }
396
411
  }
397
412
 
398
- class APIResourceCleanupConfiguration extends APIResource {
399
- constructor(parent, id) {
400
- if (id == null) {
401
- throw new Error('Resource ID cannot be null!');
402
- }
403
- super(parent);
404
- this.push('cleanup-configurations', id);
405
- }
406
- devices() {
407
- return new APIList(this).push('devices');
408
- }
413
+ class APIListDevices extends APIList {
414
+ constructor(parent) {
415
+ super(parent);
416
+ this.push('devices');
417
+ }
418
+ filters() {
419
+ return new APIResource(this).push('filters');
420
+ }
421
+ cleanupConfigurations() {
422
+ return new APIListCleanupConfigurations(this);
423
+ }
424
+ cleanupConfiguration(id) {
425
+ return new APIResourceCleanupConfiguration(this, id);
426
+ }
427
+ desktopBrowserCapabilities() {
428
+ return new APIResource(this).push('desktop-browser-capabilities');
429
+ }
409
430
  }
410
431
 
411
- class APIListDevices extends APIList {
412
- constructor(parent) {
413
- super(parent);
414
- this.push('devices');
415
- }
416
- filters() {
417
- return new APIResource(this).push('filters');
418
- }
419
- cleanupConfigurations() {
420
- return new APIListCleanupConfigurations(this);
421
- }
422
- cleanupConfiguration(id) {
423
- return new APIResourceCleanupConfiguration(this, id);
424
- }
425
- desktopBrowserCapabilities() {
426
- return new APIResource(this).push('desktop-browser-capabilities');
427
- }
432
+ class APIListUsers extends APIList {
433
+ constructor(parent) {
434
+ super(parent);
435
+ this.push('users');
436
+ }
437
+ activate() {
438
+ return new APIResource(this).push('activate').post();
439
+ }
440
+ recoveries() {
441
+ return new APIResource(this).push('recoveries');
442
+ }
443
+ passwordRecovery() {
444
+ return new APIResource(this).push('password-recovery');
445
+ }
446
+ resetApiKey() {
447
+ return new APIResource(this).push('reset-api-key');
448
+ }
449
+ validateVatId() {
450
+ return new APIResource(this).push('validateVatId');
451
+ }
428
452
  }
429
453
 
430
- class APIListUsers extends APIList {
431
- constructor(parent) {
432
- super(parent);
433
- this.push('users');
434
- }
435
- activate() {
436
- return new APIResource(this).push('activate').post();
437
- }
438
- recoveries() {
439
- return new APIResource(this).push('recoveries');
440
- }
441
- passwordRecovery() {
442
- return new APIResource(this).push('password-recovery');
443
- }
444
- resetApiKey() {
445
- return new APIResource(this).push('reset-api-key');
446
- }
447
- validateVatId() {
448
- return new APIResource(this).push('validateVatId');
449
- }
454
+ class APIResourceBillingPeriod extends APIResource {
455
+ constructor(parent, id) {
456
+ if (id == null) {
457
+ throw new Error('Resource ID cannot be null!');
458
+ }
459
+ super(parent);
460
+ this.push('billing-periods', id);
461
+ }
462
+ receipt() {
463
+ return new APIResource(this).push('receipt').setRequestConfig({
464
+ responseType: 'arraybuffer'
465
+ });
466
+ }
450
467
  }
451
468
 
452
- class APIResourceBillingPeriod extends APIResource {
453
- constructor(parent, id) {
454
- if (id == null) {
455
- throw new Error('Resource ID cannot be null!');
456
- }
457
- super(parent);
458
- this.push('billing-periods', id);
459
- }
460
- receipt() {
461
- return new APIResource(this).push('receipt').setRequestConfig({
462
- responseType: 'arraybuffer'
463
- });
464
- }
469
+ class APIResourceBuild extends APIResource {
470
+ constructor(parent, id) {
471
+ if (id == null) {
472
+ throw new Error('Resource ID cannot be null!');
473
+ }
474
+ super(parent);
475
+ this.push('builds', id);
476
+ }
477
+ abort() {
478
+ return new APIResource(this).push('abort');
479
+ }
480
+ outputFiles() {
481
+ return new APIList(this).push('output-file-set', 'files');
482
+ }
465
483
  }
466
484
 
467
- class APIResourceBuild extends APIResource {
468
- constructor(parent, id) {
469
- if (id == null) {
470
- throw new Error('Resource ID cannot be null!');
471
- }
472
- super(parent);
473
- this.push('builds', id);
474
- }
475
- abort() {
476
- return new APIResource(this).push('abort');
477
- }
478
- outputFiles() {
479
- return new APIList(this).push('output-file-set', 'files');
480
- }
485
+ class APIResourceJob extends APIResource {
486
+ constructor(parent, id) {
487
+ if (id == null) {
488
+ throw new Error('Resource ID cannot be null!');
489
+ }
490
+ super(parent);
491
+ this.push('jobs', id);
492
+ }
493
+ builds() {
494
+ return new APIList(this).push('builds');
495
+ }
496
+ build(id) {
497
+ return new APIResourceBuild(this, id);
498
+ }
481
499
  }
482
500
 
483
- class APIResourceJob extends APIResource {
484
- constructor(parent, id) {
485
- if (id == null) {
486
- throw new Error('Resource ID cannot be null!');
487
- }
488
- super(parent);
489
- this.push('jobs', id);
490
- }
491
- builds() {
492
- return new APIList(this).push('builds');
493
- }
494
- build(id) {
495
- return new APIResourceBuild(this, id);
496
- }
501
+ class APIResourceDeviceGroup extends APIResource {
502
+ constructor(parent, id) {
503
+ if (id == null) {
504
+ throw new Error('Resource ID cannot be null!');
505
+ }
506
+ super(parent);
507
+ this.push('device-groups', id);
508
+ }
509
+ devices() {
510
+ return new APIList(this).push('devices');
511
+ }
512
+ device(id) {
513
+ if (id == null) {
514
+ throw new Error('Resource ID cannot be null!');
515
+ }
516
+ return new APIResource(this).push('devices', id);
517
+ }
518
+ selectors() {
519
+ return new APIList(this).push('selectors');
520
+ }
521
+ selector(id) {
522
+ if (id == null) {
523
+ throw new Error('Resource ID cannot be null!');
524
+ }
525
+ return new APIResource(this).push('selectors', id);
526
+ }
527
+ share() {
528
+ return new APIResource(this).push('share');
529
+ }
497
530
  }
498
531
 
499
- class APIResourceDeviceGroup extends APIResource {
500
- constructor(parent, id) {
501
- if (id == null) {
502
- throw new Error('Resource ID cannot be null!');
503
- }
504
- super(parent);
505
- this.push('device-groups', id);
506
- }
507
- devices() {
508
- return new APIList(this).push('devices');
509
- }
510
- device(id) {
511
- if (id == null) {
512
- throw new Error('Resource ID cannot be null!');
513
- }
514
- return new APIResource(this).push('devices', id);
515
- }
516
- selectors() {
517
- return new APIList(this).push('selectors');
518
- }
519
- selector(id) {
520
- if (id == null) {
521
- throw new Error('Resource ID cannot be null!');
522
- }
523
- return new APIResource(this).push('selectors', id);
524
- }
525
- share() {
526
- return new APIResource(this).push('share');
527
- }
532
+ function postDeviceRunIds(parent, name, ids) {
533
+ const a = new APIResource(parent).push(name);
534
+ if (ids != null) {
535
+ a.params({
536
+ deviceRunIds: ids
537
+ });
538
+ }
539
+ return a.post();
528
540
  }
529
541
 
530
- function postDeviceRunIds(parent, name, ids) {
531
- const a = new APIResource(parent).push(name);
532
- if (ids != null) {
533
- a.params({
534
- deviceRunIds: ids
535
- });
536
- }
537
- return a.post();
542
+ class APIResourceRunCommon extends APIResource {
543
+ constructor(parent, id) {
544
+ if (id == null) {
545
+ throw new Error('Resource ID cannot be null!');
546
+ }
547
+ super(parent);
548
+ this.push('runs', id);
549
+ }
550
+ abort() {
551
+ return new APIResource(this).push('abort').post();
552
+ }
553
+ dataAvailability() {
554
+ return new APIList(this).push('data-availability');
555
+ }
556
+ deviceSessions() {
557
+ return new APIList(this).push('device-sessions');
558
+ }
559
+ filesZip(ids) {
560
+ return postDeviceRunIds(this, 'files.zip', ids);
561
+ }
562
+ logsZip(ids) {
563
+ return postDeviceRunIds(this, 'logs.zip', ids);
564
+ }
565
+ performanceZip(ids) {
566
+ return postDeviceRunIds(this, 'performance.zip', ids);
567
+ }
568
+ retry(ids) {
569
+ return postDeviceRunIds(this, 'retry', ids).setRequestConfig({
570
+ timeout: 0
571
+ });
572
+ }
573
+ screenshotNames() {
574
+ return new APIList(this).push('screenshot-names');
575
+ }
576
+ screenshots() {
577
+ return new APIList(this).push('screenshots');
578
+ }
579
+ screenshotsZip(ids) {
580
+ return postDeviceRunIds(this, 'screenshots.zip', ids);
581
+ }
582
+ steps() {
583
+ return new APIList(this).push('steps');
584
+ }
585
+ tags() {
586
+ return new APIList(this).push('tags');
587
+ }
588
+ tag(id) {
589
+ if (id == null) {
590
+ throw new Error('Resource ID cannot be null!');
591
+ }
592
+ return new APIResource(this).push('tags', id);
593
+ }
538
594
  }
539
595
 
540
- class APIResourceRunCommon extends APIResource {
541
- constructor(parent, id) {
542
- if (id == null) {
543
- throw new Error('Resource ID cannot be null!');
544
- }
545
- super(parent);
546
- this.push('runs', id);
547
- }
548
- abort() {
549
- return new APIResource(this).push('abort').post();
550
- }
551
- dataAvailability() {
552
- return new APIList(this).push('data-availability');
553
- }
554
- deviceSessions() {
555
- return new APIList(this).push('device-sessions');
556
- }
557
- filesZip(ids) {
558
- return postDeviceRunIds(this, 'files.zip', ids);
559
- }
560
- logsZip(ids) {
561
- return postDeviceRunIds(this, 'logs.zip', ids);
562
- }
563
- performanceZip(ids) {
564
- return postDeviceRunIds(this, 'performance.zip', ids);
565
- }
566
- retry(ids) {
567
- return postDeviceRunIds(this, 'retry', ids).setRequestConfig({
568
- timeout: 0
569
- });
570
- }
571
- screenshotNames() {
572
- return new APIList(this).push('screenshot-names');
573
- }
574
- screenshots() {
575
- return new APIList(this).push('screenshots');
576
- }
577
- screenshotsZip(ids) {
578
- return postDeviceRunIds(this, 'screenshots.zip', ids);
579
- }
580
- steps() {
581
- return new APIList(this).push('steps');
582
- }
583
- tags() {
584
- return new APIList(this).push('tags');
585
- }
586
- tag(id) {
587
- if (id == null) {
588
- throw new Error('Resource ID cannot be null!');
589
- }
590
- return new APIResource(this).push('tags', id);
591
- }
596
+ class InputFileset extends APIResource {
597
+ constructor(parent) {
598
+ super(parent);
599
+ this.push('input-file-set');
600
+ }
601
+ files() {
602
+ return new APIList(this).push('files');
603
+ }
604
+ filesZip() {
605
+ return new APIResource(this).push('files.zip');
606
+ }
592
607
  }
593
608
 
594
- class InputFileset extends APIResource {
595
- constructor(parent) {
596
- super(parent);
597
- this.push('input-file-set');
598
- }
599
- files() {
600
- return new APIList(this).push('files');
601
- }
602
- filesZip() {
603
- return new APIResource(this).push('files.zip');
604
- }
609
+ const NON_MEDIA_FILES_FILTER = new FilterBuilder();
610
+ NON_MEDIA_FILES_FILTER.eq('state', 'READY');
611
+ NON_MEDIA_FILES_FILTER.notin('mimetype', [
612
+ 'image/png', 'image/jpg', 'image/jpeg', 'image/webp', 'image/gif',
613
+ 'video/mp4', 'video/avi', 'video/webm', 'video/ogg', 'video/mpeg'
614
+ ]);
615
+ class OutputFileset extends APIResource {
616
+ constructor(parent) {
617
+ super(parent);
618
+ this.push('output-file-set');
619
+ }
620
+ files() {
621
+ return new APIList(this).push('files');
622
+ }
623
+ file(id) {
624
+ if (id == null) {
625
+ throw new Error('Resource ID cannot be null!');
626
+ }
627
+ return new APIResource(this).push('files', id);
628
+ }
629
+ filesZip() {
630
+ return new APIResource(this).push('files.zip');
631
+ }
632
+ screenshots() {
633
+ return new APIList(this).push('screenshots');
634
+ }
635
+ screenshot(id) {
636
+ if (id == null) {
637
+ throw new Error('Resource ID cannot be null!');
638
+ }
639
+ return new APIResource(this).push('screenshots', id);
640
+ }
641
+ screenshotFile(id) {
642
+ this.screenshot(id).push('file');
643
+ }
644
+ videos() {
645
+ return this.files().params({
646
+ filter: 's_state_eq_READY',
647
+ tag: ['video']
648
+ });
649
+ }
650
+ nonMediaFiles() {
651
+ return this.files().filter(NON_MEDIA_FILES_FILTER);
652
+ }
605
653
  }
606
654
 
607
- const NON_MEDIA_FILES_FILTER = new FilterBuilder();
608
- NON_MEDIA_FILES_FILTER.eq('state', 'READY');
609
- NON_MEDIA_FILES_FILTER.notin('mimetype', [
610
- 'image/png', 'image/jpg', 'image/jpeg', 'image/webp', 'image/gif',
611
- 'video/mp4', 'video/avi', 'video/webm', 'video/ogg', 'video/mpeg'
612
- ]);
613
- class OutputFileset extends APIResource {
614
- constructor(parent) {
615
- super(parent);
616
- this.push('output-file-set');
617
- }
618
- files() {
619
- return new APIList(this).push('files');
620
- }
621
- file(id) {
622
- if (id == null) {
623
- throw new Error('Resource ID cannot be null!');
624
- }
625
- return new APIResource(this).push('files', id);
626
- }
627
- filesZip() {
628
- return new APIResource(this).push('files.zip');
629
- }
630
- screenshots() {
631
- return new APIList(this).push('screenshots');
632
- }
633
- screenshot(id) {
634
- if (id == null) {
635
- throw new Error('Resource ID cannot be null!');
636
- }
637
- return new APIResource(this).push('screenshots', id);
638
- }
639
- screenshotFile(id) {
640
- this.screenshot(id).push('file');
641
- }
642
- videos() {
643
- return this.files().params({
644
- filter: 's_state_eq_READY',
645
- tag: ['video']
646
- });
647
- }
648
- nonMediaFiles() {
649
- return this.files().filter(NON_MEDIA_FILES_FILTER);
650
- }
655
+ class APIResourceDeviceSessionCommon extends APIResource {
656
+ constructor(parent, id) {
657
+ if (id == null) {
658
+ throw new Error('Resource ID cannot be null!');
659
+ }
660
+ super(parent);
661
+ this.push('device-sessions', id);
662
+ }
663
+ commands() {
664
+ return new APIList(this).push('commands');
665
+ }
666
+ input() {
667
+ return new InputFileset(this);
668
+ }
669
+ output() {
670
+ return new OutputFileset(this);
671
+ }
672
+ screenshots() {
673
+ return new APIList(this).push('screenshots');
674
+ }
675
+ screenshot(id) {
676
+ if (id == null) {
677
+ throw new Error('Resource ID cannot be null!');
678
+ }
679
+ return new APIResource(this).push('screenshots', id);
680
+ }
681
+ steps() {
682
+ return new APIList(this).push('steps');
683
+ }
684
+ step(id) {
685
+ if (id == null) {
686
+ throw new Error('Resource ID cannot be null!');
687
+ }
688
+ return new APIResource(this).push('steps', id);
689
+ }
690
+ currentStep() {
691
+ return this.step('current');
692
+ }
693
+ testCaseRuns() {
694
+ return new APIList(this).push('test-case-runs');
695
+ }
651
696
  }
652
697
 
653
- class APIResourceDeviceSessionCommon extends APIResource {
654
- constructor(parent, id) {
655
- if (id == null) {
656
- throw new Error('Resource ID cannot be null!');
657
- }
658
- super(parent);
659
- this.push('device-sessions', id);
660
- }
661
- commands() {
662
- return new APIList(this).push('commands');
663
- }
664
- input() {
665
- return new InputFileset(this);
666
- }
667
- output() {
668
- return new OutputFileset(this);
669
- }
670
- screenshots() {
671
- return new APIList(this).push('screenshots');
672
- }
673
- screenshot(id) {
674
- if (id == null) {
675
- throw new Error('Resource ID cannot be null!');
676
- }
677
- return new APIResource(this).push('screenshots', id);
678
- }
679
- steps() {
680
- return new APIList(this).push('steps');
681
- }
682
- step(id) {
683
- if (id == null) {
684
- throw new Error('Resource ID cannot be null!');
685
- }
686
- return new APIResource(this).push('steps', id);
687
- }
688
- currentStep() {
689
- return this.step('current');
690
- }
691
- testCaseRuns() {
692
- return new APIList(this).push('test-case-runs');
693
- }
698
+ class APIResourceDeviceSession extends APIResourceDeviceSessionCommon {
699
+ abort() {
700
+ return new APIResource(this).push('abort').post();
701
+ }
702
+ retry() {
703
+ return new APIResource(this).push('retry').post();
704
+ }
694
705
  }
695
706
 
696
- class APIResourceDeviceSession extends APIResourceDeviceSessionCommon {
697
- abort() {
698
- return new APIResource(this).push('abort').post();
699
- }
700
- retry() {
701
- return new APIResource(this).push('retry').post();
702
- }
707
+ class APIResourceRun extends APIResourceRunCommon {
708
+ deviceSession(id) {
709
+ return new APIResourceDeviceSession(this, id);
710
+ }
703
711
  }
704
712
 
705
- class APIResourceRun extends APIResourceRunCommon {
706
- deviceSession(id) {
707
- return new APIResourceDeviceSession(this, id);
708
- }
713
+ class APIResourceProject extends APIResource {
714
+ constructor(parent, id) {
715
+ if (id == null) {
716
+ throw new Error('Resource ID cannot be null!');
717
+ }
718
+ super(parent);
719
+ this.push('projects', id);
720
+ }
721
+ runs() {
722
+ return new APIList(this).push('runs');
723
+ }
724
+ run(id) {
725
+ return new APIResourceRun(this, id);
726
+ }
727
+ runsExtended() {
728
+ return new APIList(this).push('runs-extended');
729
+ }
730
+ runExtended(id) {
731
+ if (id == null) {
732
+ throw new Error('Resource ID cannot be null!');
733
+ }
734
+ return new APIResource(this).push('runs-extended', id);
735
+ }
736
+ files() {
737
+ return new APIList(this).push('files');
738
+ }
739
+ filesZip() {
740
+ return new APIResource(this).push('files.zip');
741
+ }
742
+ sharings() {
743
+ return new APIList(this).push('sharings');
744
+ }
745
+ sharing(id) {
746
+ if (id == null) {
747
+ throw new Error('Resource ID cannot be null!');
748
+ }
749
+ return new APIResource(this).push('sharings', id);
750
+ }
709
751
  }
710
752
 
711
- class APIResourceProject extends APIResource {
712
- constructor(parent, id) {
713
- if (id == null) {
714
- throw new Error('Resource ID cannot be null!');
715
- }
716
- super(parent);
717
- this.push('projects', id);
718
- }
719
- runs() {
720
- return new APIList(this).push('runs');
721
- }
722
- run(id) {
723
- return new APIResourceRun(this, id);
724
- }
725
- runsExtended() {
726
- return new APIList(this).push('runs-extended');
727
- }
728
- runExtended(id) {
729
- if (id == null) {
730
- throw new Error('Resource ID cannot be null!');
731
- }
732
- return new APIResource(this).push('runs-extended', id);
733
- }
734
- files() {
735
- return new APIList(this).push('files');
736
- }
737
- filesZip() {
738
- return new APIResource(this).push('files.zip');
739
- }
740
- sharings() {
741
- return new APIList(this).push('sharings');
742
- }
743
- sharing(id) {
744
- if (id == null) {
745
- throw new Error('Resource ID cannot be null!');
746
- }
747
- return new APIResource(this).push('sharings', id);
748
- }
753
+ class APIResourceFile extends APIResource {
754
+ constructor(parent, id) {
755
+ if (id == null) {
756
+ throw new Error('Resource ID cannot be null!');
757
+ }
758
+ super(parent);
759
+ this.push('files', id);
760
+ }
761
+ file() {
762
+ return new APIResource(this).push('file');
763
+ }
764
+ icon() {
765
+ return new APIResource(this).push('icon');
766
+ }
767
+ tags() {
768
+ return new APIList(this).push('tags');
769
+ }
749
770
  }
750
771
 
751
- class APIResourceFile extends APIResource {
752
- constructor(parent, id) {
753
- if (id == null) {
754
- throw new Error('Resource ID cannot be null!');
755
- }
756
- super(parent);
757
- this.push('files', id);
758
- }
759
- file() {
760
- return new APIResource(this).push('file');
761
- }
762
- icon() {
763
- return new APIResource(this).push('icon');
764
- }
765
- tags() {
766
- return new APIList(this).push('tags');
767
- }
772
+ class APIResourceNotification extends APIResource {
773
+ constructor(parent, id) {
774
+ if (id == null) {
775
+ throw new Error('Resource ID cannot be null!');
776
+ }
777
+ super(parent);
778
+ this.push('notifications', id);
779
+ }
780
+ test() {
781
+ return new APIResource(this).push('test');
782
+ }
768
783
  }
769
784
 
770
- class APIResourceNotification extends APIResource {
771
- constructor(parent, id) {
772
- if (id == null) {
773
- throw new Error('Resource ID cannot be null!');
774
- }
775
- super(parent);
776
- this.push('notifications', id);
777
- }
778
- test() {
779
- return new APIResource(this).push('test');
780
- }
785
+ class APIResourceAccessGroup extends APIResource {
786
+ constructor(parent, id) {
787
+ if (id == null) {
788
+ throw new Error('Resource ID cannot be null!');
789
+ }
790
+ super(parent);
791
+ this.push('access-groups', id);
792
+ }
793
+ users() {
794
+ return new APIList(this).push('users');
795
+ }
796
+ user(id) {
797
+ if (id == null) {
798
+ throw new Error('Resource ID cannot be null!');
799
+ }
800
+ return new APIResource(this).push('users', id);
801
+ }
802
+ resources() {
803
+ return new APIList(this).push('resources');
804
+ }
805
+ resource(id) {
806
+ if (id == null) {
807
+ throw new Error('Resource ID cannot be null!');
808
+ }
809
+ return new APIResource(this).push('resources', id);
810
+ }
781
811
  }
782
812
 
783
- class APIResourceAccessGroup extends APIResource {
784
- constructor(parent, id) {
785
- if (id == null) {
786
- throw new Error('Resource ID cannot be null!');
787
- }
788
- super(parent);
789
- this.push('access-groups', id);
790
- }
791
- users() {
792
- return new APIList(this).push('users');
793
- }
794
- user(id) {
795
- if (id == null) {
796
- throw new Error('Resource ID cannot be null!');
797
- }
798
- return new APIResource(this).push('users', id);
799
- }
800
- resources() {
801
- return new APIList(this).push('resources');
802
- }
803
- resource(id) {
804
- if (id == null) {
805
- throw new Error('Resource ID cannot be null!');
806
- }
807
- return new APIResource(this).push('resources', id);
808
- }
813
+ class APIResourceAdditionalUser extends APIResource {
814
+ constructor(parent, id) {
815
+ if (id == null) {
816
+ throw new Error('Resource ID cannot be null!');
817
+ }
818
+ super(parent);
819
+ this.push('additional-users', id);
820
+ }
821
+ resendActivation() {
822
+ return new APIResource(this).push('resend-activation');
823
+ }
809
824
  }
810
825
 
811
- class APIResourceAdditionalUser extends APIResource {
812
- constructor(parent, id) {
813
- if (id == null) {
814
- throw new Error('Resource ID cannot be null!');
815
- }
816
- super(parent);
817
- this.push('additional-users', id);
818
- }
819
- resendActivation() {
820
- return new APIResource(this).push('resend-activation');
821
- }
826
+ class APIUserResourceAccount extends APIResource {
827
+ constructor(parent) {
828
+ super(parent);
829
+ this.push('account');
830
+ }
831
+ additionalUsers() {
832
+ return new APIList(this).push('additional-users');
833
+ }
834
+ additionalUser(id) {
835
+ return new APIResourceAdditionalUser(this, id);
836
+ }
837
+ serviceBillingPeriod(id) {
838
+ if (id == null) {
839
+ throw new Error('Resource ID cannot be null!');
840
+ }
841
+ const a = new APIResource(this);
842
+ a.last += '-services';
843
+ a.push(id, 'billing-period');
844
+ return a;
845
+ }
822
846
  }
823
847
 
824
- class APIUserResourceAccount extends APIResource {
825
- constructor(parent) {
826
- super(parent);
827
- this.push('account');
828
- }
829
- additionalUsers() {
830
- return new APIList(this).push('additional-users');
831
- }
832
- additionalUser(id) {
833
- return new APIResourceAdditionalUser(this, id);
834
- }
835
- serviceBillingPeriod(id) {
836
- if (id == null) {
837
- throw new Error('Resource ID cannot be null!');
838
- }
839
- const a = new APIResource(this);
840
- a.last += '-services';
841
- a.push(id, 'billing-period');
842
- return a;
843
- }
848
+ class APIListDeviceTime extends APIList {
849
+ constructor(parent) {
850
+ super(parent);
851
+ this.push('device-time');
852
+ }
853
+ reserved() {
854
+ return new APIList(this).push('reserved');
855
+ }
856
+ used() {
857
+ return new APIList(this).push('used');
858
+ }
844
859
  }
845
860
 
846
- class APIListDeviceTime extends APIList {
847
- constructor(parent) {
848
- super(parent);
849
- this.push('device-time');
850
- }
851
- reserved() {
852
- return new APIList(this).push('reserved');
853
- }
854
- used() {
855
- return new APIList(this).push('used');
856
- }
861
+ class APIListFiles extends APIList {
862
+ constructor(parent) {
863
+ super(parent);
864
+ this.push('files');
865
+ }
866
+ upload(obj) {
867
+ let form;
868
+ if (global.isNodeJs) {
869
+ const fs = require('fs');
870
+ const FormData = require('form-data');
871
+ form = new FormData();
872
+ form.append('file', fs.createReadStream(obj.dir + '/' + obj.filename), {
873
+ filename: obj.filename
874
+ });
875
+ }
876
+ else {
877
+ throw new Error('Not supported yet!');
878
+ }
879
+ return this.post().headers(form.getHeaders()).data(form);
880
+ }
857
881
  }
858
882
 
859
- class APIListFiles extends APIList {
860
- constructor(parent) {
861
- super(parent);
862
- this.push('files');
863
- }
864
- upload(obj) {
865
- let form;
866
- if (global.isNodeJs) {
867
- const fs = require('fs');
868
- const FormData = require('form-data');
869
- form = new FormData();
870
- form.append('file', fs.createReadStream(obj.dir + '/' + obj.filename), {
871
- filename: obj.filename
872
- });
873
- }
874
- else {
875
- throw new Error('Not supported yet!');
876
- }
877
- return this.post().headers(form.getHeaders()).data(form);
878
- }
883
+ class APIListPurchased extends APIList {
884
+ constructor(parent) {
885
+ super(parent);
886
+ this.push('purchased');
887
+ }
879
888
  }
880
889
 
881
- class APIListPurchased extends APIList {
882
- constructor(parent) {
883
- super(parent);
884
- this.push('purchased');
885
- }
890
+ class APIListServices extends APIList {
891
+ constructor(parent) {
892
+ super(parent);
893
+ this.push('services');
894
+ }
895
+ purchased() {
896
+ return new APIListPurchased(this);
897
+ }
898
+ available() {
899
+ return new APIList(this).push('available');
900
+ }
901
+ active() {
902
+ const a = new APIList(this);
903
+ if (this.first === 'me') {
904
+ a.push('active');
905
+ }
906
+ else {
907
+ a.params({
908
+ notArchived: true
909
+ });
910
+ }
911
+ return a;
912
+ }
886
913
  }
887
914
 
888
- class APIListServices extends APIList {
889
- constructor(parent) {
890
- super(parent);
891
- this.push('services');
892
- }
893
- purchased() {
894
- return new APIListPurchased(this);
895
- }
896
- available() {
897
- return new APIList(this).push('available');
898
- }
899
- active() {
900
- const a = new APIList(this);
901
- if (this.first === 'me') {
902
- a.push('active');
903
- }
904
- else {
905
- a.params({
906
- notArchived: true
907
- });
908
- }
909
- return a;
910
- }
915
+ class APIListRuns extends APIList {
916
+ constructor(parent) {
917
+ super(parent);
918
+ this.push('runs');
919
+ }
920
+ config() {
921
+ return new APIResource(this).push('config');
922
+ }
911
923
  }
912
924
 
913
- class APIListRuns extends APIList {
914
- constructor(parent) {
915
- super(parent);
916
- this.push('runs');
917
- }
918
- config() {
919
- return new APIResource(this).push('config');
920
- }
925
+ class APIListNotifications extends APIList {
926
+ constructor(parent) {
927
+ super(parent);
928
+ this.push('notifications');
929
+ }
930
+ scopes() {
931
+ return new APIList(this).push('scopes');
932
+ }
933
+ channels() {
934
+ return new APIList(this).push('channels');
935
+ }
921
936
  }
922
937
 
923
- class APIListNotifications extends APIList {
924
- constructor(parent) {
925
- super(parent);
926
- this.push('notifications');
927
- }
928
- scopes() {
929
- return new APIList(this).push('scopes');
930
- }
931
- channels() {
932
- return new APIList(this).push('channels');
933
- }
938
+ class APIListSmartbearTunnels extends APIList {
939
+ constructor(parent) {
940
+ super(parent);
941
+ this.push('tunnels');
942
+ }
943
+ active(active) {
944
+ return this.params({ active: active });
945
+ }
934
946
  }
935
947
 
936
- class APIListSmartbearTunnels extends APIList {
937
- constructor(parent) {
938
- super(parent);
939
- this.push('tunnels');
940
- }
941
- active(active) {
942
- return this.params({ active: active });
943
- }
948
+ class APIResourceDeviceSessionStandalone extends APIResource {
949
+ constructor(parent, id) {
950
+ if (id == null) {
951
+ throw new Error('Resource ID cannot be null!');
952
+ }
953
+ super(parent);
954
+ this.push('device-sessions', id);
955
+ }
956
+ connections() {
957
+ return new APIList(this).push('connections');
958
+ }
959
+ connection(id) {
960
+ if (id == null) {
961
+ throw new Error('Resource ID cannot be null!');
962
+ }
963
+ return new APIResource(this).push('connections', id);
964
+ }
965
+ input() {
966
+ return new InputFileset(this);
967
+ }
968
+ output() {
969
+ return new OutputFileset(this);
970
+ }
971
+ release() {
972
+ return new APIResource(this).push('release').post();
973
+ }
944
974
  }
945
975
 
946
- class APIResourceDeviceSessionStandalone extends APIResource {
947
- constructor(parent, id) {
948
- if (id == null) {
949
- throw new Error('Resource ID cannot be null!');
950
- }
951
- super(parent);
952
- this.push('device-sessions', id);
953
- }
954
- connections() {
955
- return new APIList(this).push('connections');
956
- }
957
- connection(id) {
958
- if (id == null) {
959
- throw new Error('Resource ID cannot be null!');
960
- }
961
- return new APIResource(this).push('connections', id);
962
- }
963
- input() {
964
- return new InputFileset(this);
965
- }
966
- output() {
967
- return new OutputFileset(this);
968
- }
969
- release() {
970
- return new APIResource(this).push('release').post();
971
- }
976
+ class APIResourceUser extends APIResource {
977
+ constructor(parent, id) {
978
+ if (id == null) {
979
+ throw new Error('Resource ID cannot be null!');
980
+ }
981
+ super(parent);
982
+ if (id === 'me') {
983
+ this.push('me');
984
+ }
985
+ else if (typeof id === 'number') {
986
+ this.push('users', id);
987
+ }
988
+ else {
989
+ throw new TypeError('id is not a number');
990
+ }
991
+ }
992
+ account() {
993
+ return new APIUserResourceAccount(this);
994
+ }
995
+ deviceTime() {
996
+ return new APIListDeviceTime(this);
997
+ }
998
+ deviceTimeSummary() {
999
+ return new APIList(this).push('device-time-summary');
1000
+ }
1001
+ services() {
1002
+ return new APIListServices(this);
1003
+ }
1004
+ service(id) {
1005
+ if (id == null) {
1006
+ throw new Error('Resource ID cannot be null!');
1007
+ }
1008
+ return new APIResource(this).push('services', id);
1009
+ }
1010
+ billingPeriods() {
1011
+ return new APIList(this).push('billing-periods');
1012
+ }
1013
+ billingPeriod(id) {
1014
+ return new APIResourceBillingPeriod(this, id);
1015
+ }
1016
+ jobs() {
1017
+ return new APIList(this).push('jobs');
1018
+ }
1019
+ job(id) {
1020
+ return new APIResourceJob(this, id);
1021
+ }
1022
+ deviceGroups() {
1023
+ return new APIList(this).push('device-groups');
1024
+ }
1025
+ deviceGroup(id) {
1026
+ return new APIResourceDeviceGroup(this, id);
1027
+ }
1028
+ deviceSessions() {
1029
+ return new APIList(this).push('device-sessions');
1030
+ }
1031
+ deviceSession(id) {
1032
+ return new APIResourceDeviceSessionStandalone(this, id);
1033
+ }
1034
+ projects() {
1035
+ return new APIList(this).push('projects');
1036
+ }
1037
+ project(id) {
1038
+ return new APIResourceProject(this, id);
1039
+ }
1040
+ files() {
1041
+ return new APIListFiles(this);
1042
+ }
1043
+ file(id) {
1044
+ return new APIResourceFile(this, id);
1045
+ }
1046
+ runs() {
1047
+ return new APIListRuns(this);
1048
+ }
1049
+ availableBuildExecutors() {
1050
+ return new APIList(this).push('available-build-executors');
1051
+ }
1052
+ availableFrameworks() {
1053
+ return new APIList(this).push('available-frameworks');
1054
+ }
1055
+ resetApiKey() {
1056
+ return new APIResource(this).push('reset-api-key');
1057
+ }
1058
+ restore() {
1059
+ return new APIResource(this).push('restore');
1060
+ }
1061
+ feedback() {
1062
+ return new APIResource(this).push('feedback');
1063
+ }
1064
+ notifications() {
1065
+ return new APIListNotifications(this);
1066
+ }
1067
+ notification(id) {
1068
+ return new APIResourceNotification(this, id);
1069
+ }
1070
+ receipts() {
1071
+ return new APIList(this).push('receipts');
1072
+ }
1073
+ preferences() {
1074
+ return new APIResource(this).push('preferences');
1075
+ }
1076
+ uiPreferences() {
1077
+ return new APIResource(this).push('ui-preferences');
1078
+ }
1079
+ deviceUsage() {
1080
+ return new APIList(this).push('device-usage');
1081
+ }
1082
+ statistics() {
1083
+ return new APIList(this).push('statistics');
1084
+ }
1085
+ deviceStatistics() {
1086
+ return new APIList(this).push('device-statistics');
1087
+ }
1088
+ accessGroups() {
1089
+ return new APIList(this).push('access-groups');
1090
+ }
1091
+ accessGroup(id) {
1092
+ return new APIResourceAccessGroup(this, id);
1093
+ }
1094
+ smartbearTunnel(id) {
1095
+ return new APIResource(this).push('tunnels', id);
1096
+ }
1097
+ smartbearTunnels() {
1098
+ return new APIListSmartbearTunnels(this);
1099
+ }
972
1100
  }
973
1101
 
974
- class APIResourceUser extends APIResource {
975
- constructor(parent, id) {
976
- if (id == null) {
977
- throw new Error('Resource ID cannot be null!');
978
- }
979
- super(parent);
980
- if (id === 'me') {
981
- this.push('me');
982
- }
983
- else if (typeof id === 'number') {
984
- this.push('users', id);
985
- }
986
- else {
987
- throw new TypeError('id is not a number');
988
- }
989
- }
990
- account() {
991
- return new APIUserResourceAccount(this);
992
- }
993
- deviceTime() {
994
- return new APIListDeviceTime(this);
995
- }
996
- deviceTimeSummary() {
997
- return new APIList(this).push('device-time-summary');
998
- }
999
- services() {
1000
- return new APIListServices(this);
1001
- }
1002
- service(id) {
1003
- if (id == null) {
1004
- throw new Error('Resource ID cannot be null!');
1005
- }
1006
- return new APIResource(this).push('services', id);
1007
- }
1008
- billingPeriods() {
1009
- return new APIList(this).push('billing-periods');
1010
- }
1011
- billingPeriod(id) {
1012
- return new APIResourceBillingPeriod(this, id);
1013
- }
1014
- jobs() {
1015
- return new APIList(this).push('jobs');
1016
- }
1017
- job(id) {
1018
- return new APIResourceJob(this, id);
1019
- }
1020
- deviceGroups() {
1021
- return new APIList(this).push('device-groups');
1022
- }
1023
- deviceGroup(id) {
1024
- return new APIResourceDeviceGroup(this, id);
1025
- }
1026
- deviceSessions() {
1027
- return new APIList(this).push('device-sessions');
1028
- }
1029
- deviceSession(id) {
1030
- return new APIResourceDeviceSessionStandalone(this, id);
1031
- }
1032
- projects() {
1033
- return new APIList(this).push('projects');
1034
- }
1035
- project(id) {
1036
- return new APIResourceProject(this, id);
1037
- }
1038
- files() {
1039
- return new APIListFiles(this);
1040
- }
1041
- file(id) {
1042
- return new APIResourceFile(this, id);
1043
- }
1044
- runs() {
1045
- return new APIListRuns(this);
1046
- }
1047
- availableBuildExecutors() {
1048
- return new APIList(this).push('available-build-executors');
1049
- }
1050
- availableFrameworks() {
1051
- return new APIList(this).push('available-frameworks');
1052
- }
1053
- resetApiKey() {
1054
- return new APIResource(this).push('reset-api-key');
1055
- }
1056
- restore() {
1057
- return new APIResource(this).push('restore');
1058
- }
1059
- feedback() {
1060
- return new APIResource(this).push('feedback');
1061
- }
1062
- notifications() {
1063
- return new APIListNotifications(this);
1064
- }
1065
- notification(id) {
1066
- return new APIResourceNotification(this, id);
1067
- }
1068
- receipts() {
1069
- return new APIList(this).push('receipts');
1070
- }
1071
- preferences() {
1072
- return new APIResource(this).push('preferences');
1073
- }
1074
- uiPreferences() {
1075
- return new APIResource(this).push('ui-preferences');
1076
- }
1077
- deviceUsage() {
1078
- return new APIList(this).push('device-usage');
1079
- }
1080
- statistics() {
1081
- return new APIList(this).push('statistics');
1082
- }
1083
- deviceStatistics() {
1084
- return new APIList(this).push('device-statistics');
1085
- }
1086
- accessGroups() {
1087
- return new APIList(this).push('access-groups');
1088
- }
1089
- accessGroup(id) {
1090
- return new APIResourceAccessGroup(this, id);
1091
- }
1092
- smartbearTunnel(id) {
1093
- return new APIResource(this).push('tunnels', id);
1094
- }
1095
- smartbearTunnels() {
1096
- return new APIListSmartbearTunnels(this);
1097
- }
1102
+ class APIResourceDevice extends APIResource {
1103
+ constructor(parent, id) {
1104
+ if (id == null) {
1105
+ throw new Error('Resource ID cannot be null!');
1106
+ }
1107
+ super(parent);
1108
+ this.push('devices', id);
1109
+ }
1110
+ properties() {
1111
+ return new APIList(this).push('properties');
1112
+ }
1098
1113
  }
1099
1114
 
1100
- class APIResourceDevice extends APIResource {
1101
- constructor(parent, id) {
1102
- if (id == null) {
1103
- throw new Error('Resource ID cannot be null!');
1104
- }
1105
- super(parent);
1106
- this.push('devices', id);
1107
- }
1108
- properties() {
1109
- return new APIList(this).push('properties');
1110
- }
1115
+ class APIResourceUserSession extends APIResource {
1116
+ constructor(parent) {
1117
+ super(parent);
1118
+ this.push('user-sessions');
1119
+ }
1120
+ login(data) {
1121
+ return new APIResource(this).push('login').post().data(data);
1122
+ }
1123
+ logout() {
1124
+ return new APIResource(this).push('logout').post();
1125
+ }
1126
+ sso(name) {
1127
+ return new APIResource(this).push(name + '-login');
1128
+ }
1129
+ portalLogin() {
1130
+ return new APIResource(this).push('portal-login').post();
1131
+ }
1111
1132
  }
1112
1133
 
1113
- class APIResourceUserSession extends APIResource {
1114
- constructor(parent) {
1115
- super(parent);
1116
- this.push('user-sessions');
1117
- }
1118
- login(data) {
1119
- return new APIResource(this).push('login').post().data(data);
1120
- }
1121
- logout() {
1122
- return new APIResource(this).push('logout').post();
1123
- }
1124
- sso(name) {
1125
- return new APIResource(this).push(name + '-login');
1126
- }
1127
- portalLogin() {
1128
- return new APIResource(this).push('portal-login').post();
1129
- }
1134
+ class APIAdminListRuns extends APIList {
1135
+ constructor(parent) {
1136
+ super(parent);
1137
+ this.push('admin', 'runs');
1138
+ }
1139
+ config() {
1140
+ const a = new APIResource(this);
1141
+ a.stack = ['runs', 'config'];
1142
+ return a;
1143
+ }
1130
1144
  }
1131
1145
 
1132
- class APIAdminListRuns extends APIList {
1133
- constructor(parent) {
1134
- super(parent);
1135
- this.push('admin', 'runs');
1136
- }
1137
- config() {
1138
- const a = new APIResource(this);
1139
- a.stack = ['runs', 'config'];
1140
- return a;
1141
- }
1146
+ class APIAdminResourceCluster extends APIResource {
1147
+ constructor(parent, id) {
1148
+ if (id == null) {
1149
+ throw new Error('Resource ID cannot be null!');
1150
+ }
1151
+ super(parent);
1152
+ this.push('clusters', id);
1153
+ }
1154
+ devices() {
1155
+ return new APIList(this).push('devices');
1156
+ }
1142
1157
  }
1143
1158
 
1144
- class APIAdminResourceCluster extends APIResource {
1145
- constructor(parent, id) {
1146
- if (id == null) {
1147
- throw new Error('Resource ID cannot be null!');
1148
- }
1149
- super(parent);
1150
- this.push('clusters', id);
1151
- }
1152
- devices() {
1153
- return new APIList(this).push('devices');
1154
- }
1159
+ class APIAdminResourceDeviceTime extends APIResource {
1160
+ constructor(parent) {
1161
+ super(parent);
1162
+ this.push('admin', 'device-time');
1163
+ }
1164
+ countSessionReport() {
1165
+ return new APIList(this).push('count-session-report');
1166
+ }
1167
+ stepTimeReport() {
1168
+ return new APIList(this).push('step-time-report');
1169
+ }
1155
1170
  }
1156
1171
 
1157
- class APIAdminResourceDeviceTime extends APIResource {
1158
- constructor(parent) {
1159
- super(parent);
1160
- this.push('admin', 'device-time');
1161
- }
1162
- countSessionReport() {
1163
- return new APIList(this).push('count-session-report');
1164
- }
1165
- stepTimeReport() {
1166
- return new APIList(this).push('step-time-report');
1167
- }
1172
+ class APIAdminResourceRunStandalone extends APIResource {
1173
+ constructor(parent, id) {
1174
+ if (id == null) {
1175
+ throw new Error('Resource ID cannot be null!');
1176
+ }
1177
+ super(parent);
1178
+ this.push('admin', 'runs', id);
1179
+ }
1180
+ abort() {
1181
+ return new APIResource(this).push('abort').post();
1182
+ }
1183
+ changeBillable(billable) {
1184
+ return new APIResource(this).push('changebillable').post().params({
1185
+ billable
1186
+ });
1187
+ }
1188
+ changePriority(priority) {
1189
+ return new APIResource(this).push('changepriority').post().params({
1190
+ priority
1191
+ });
1192
+ }
1193
+ retry(ids) {
1194
+ return postDeviceRunIds(this, 'retry', ids).setRequestConfig({
1195
+ timeout: 0
1196
+ });
1197
+ }
1198
+ deviceSessions() {
1199
+ return new APIList(this).shift().push('device-sessions');
1200
+ }
1201
+ deviceSession(id) {
1202
+ return new APIResourceDeviceSessionCommon(this, id).shift();
1203
+ }
1168
1204
  }
1169
1205
 
1170
- class APIAdminResourceRunStandalone extends APIResource {
1171
- constructor(parent, id) {
1172
- if (id == null) {
1173
- throw new Error('Resource ID cannot be null!');
1174
- }
1175
- super(parent);
1176
- this.push('admin', 'runs', id);
1177
- }
1178
- abort() {
1179
- return new APIResource(this).push('abort').post();
1180
- }
1181
- changeBillable(billable) {
1182
- return new APIResource(this).push('changebillable').post().params({
1183
- billable
1184
- });
1185
- }
1186
- changePriority(priority) {
1187
- return new APIResource(this).push('changepriority').post().params({
1188
- priority
1189
- });
1190
- }
1191
- retry(ids) {
1192
- return postDeviceRunIds(this, 'retry', ids).setRequestConfig({
1193
- timeout: 0
1194
- });
1195
- }
1196
- deviceSessions() {
1197
- return new APIList(this).shift().push('device-sessions');
1198
- }
1199
- deviceSession(id) {
1200
- return new APIResourceDeviceSessionCommon(this, id).shift();
1201
- }
1206
+ class APIAdminResourceDevice extends APIResource {
1207
+ constructor(parent, id) {
1208
+ if (id == null) {
1209
+ throw new Error('Resource ID cannot be null!');
1210
+ }
1211
+ super(parent);
1212
+ this.push('admin', 'devices', id);
1213
+ }
1214
+ queue() {
1215
+ return new APIList(this).push('queue');
1216
+ }
1217
+ cleanupConfiguration() {
1218
+ return new APIResource(this).push('cleanup-configuration');
1219
+ }
1220
+ labels() {
1221
+ return new APIList(this).push('labels');
1222
+ }
1223
+ label(id) {
1224
+ return new APIResource(this).push('labels', id);
1225
+ }
1226
+ blink() {
1227
+ return new APIResource(this).push('blink').post();
1228
+ }
1202
1229
  }
1203
1230
 
1204
- class APIAdminResourceDevice extends APIResource {
1205
- constructor(parent, id) {
1206
- if (id == null) {
1207
- throw new Error('Resource ID cannot be null!');
1208
- }
1209
- super(parent);
1210
- this.push('admin', 'devices', id);
1211
- }
1212
- queue() {
1213
- return new APIList(this).push('queue');
1214
- }
1215
- cleanupConfiguration() {
1216
- return new APIResource(this).push('cleanup-configuration');
1217
- }
1218
- labels() {
1219
- return new APIList(this).push('labels');
1220
- }
1221
- label(id) {
1222
- return new APIResource(this).push('labels', id);
1223
- }
1224
- blink() {
1225
- return new APIResource(this).push('blink').post();
1226
- }
1231
+ class APIAdminResourceAccountService extends APIResource {
1232
+ constructor(parent, id) {
1233
+ if (id == null) {
1234
+ throw new Error('Resource ID cannot be null!');
1235
+ }
1236
+ super(parent);
1237
+ this.push('admin', 'account-services', id);
1238
+ }
1239
+ activate() {
1240
+ return new APIResource(this).push('activate').post();
1241
+ }
1242
+ deactivate() {
1243
+ return new APIResource(this).push('deactivate').post();
1244
+ }
1227
1245
  }
1228
1246
 
1229
- class APIAdminResourceAccountService extends APIResource {
1230
- constructor(parent, id) {
1231
- if (id == null) {
1232
- throw new Error('Resource ID cannot be null!');
1233
- }
1234
- super(parent);
1235
- this.push('admin', 'account-services', id);
1236
- }
1237
- activate() {
1238
- return new APIResource(this).push('activate').post();
1239
- }
1240
- deactivate() {
1241
- return new APIResource(this).push('deactivate').post();
1242
- }
1247
+ class APIAdminResourceUserAccount extends APIResource {
1248
+ constructor(parent) {
1249
+ super(parent);
1250
+ this.push('account');
1251
+ }
1252
+ roles() {
1253
+ return new APIList(this).push('roles');
1254
+ }
1255
+ role(id) {
1256
+ if (id == null) {
1257
+ throw new Error('Resource ID cannot be null!');
1258
+ }
1259
+ return new APIResource(this).push('roles', id);
1260
+ }
1261
+ services() {
1262
+ const a = new APIList(this);
1263
+ a.last += '-services';
1264
+ return a;
1265
+ }
1266
+ update() {
1267
+ const a = new APIResource(this);
1268
+ a.last = 'update-account';
1269
+ return a.post();
1270
+ }
1243
1271
  }
1244
1272
 
1245
- class APIAdminResourceUserAccount extends APIResource {
1246
- constructor(parent) {
1247
- super(parent);
1248
- this.push('account');
1249
- }
1250
- roles() {
1251
- return new APIList(this).push('roles');
1252
- }
1253
- role(id) {
1254
- if (id == null) {
1255
- throw new Error('Resource ID cannot be null!');
1256
- }
1257
- return new APIResource(this).push('roles', id);
1258
- }
1259
- services() {
1260
- const a = new APIList(this);
1261
- a.last += '-services';
1262
- return a;
1263
- }
1264
- update() {
1265
- const a = new APIResource(this);
1266
- a.last = 'update-account';
1267
- return a.post();
1268
- }
1273
+ class APIAdminResourceUser extends APIResource {
1274
+ constructor(parent, id) {
1275
+ if (id == null) {
1276
+ throw new Error('Resource ID cannot be null!');
1277
+ }
1278
+ super(parent);
1279
+ this.push('admin', 'users', id);
1280
+ }
1281
+ disable() {
1282
+ return new APIResource(this).push('disable');
1283
+ }
1284
+ enable() {
1285
+ return new APIResource(this).push('enable');
1286
+ }
1287
+ licenses() {
1288
+ return new APIList(this).push('licenses');
1289
+ }
1290
+ resendActivation() {
1291
+ return new APIResource(this).push('resend-activation').post();
1292
+ }
1293
+ account() {
1294
+ return new APIAdminResourceUserAccount(this);
1295
+ }
1269
1296
  }
1270
1297
 
1271
- class APIAdminResourceUser extends APIResource {
1272
- constructor(parent, id) {
1273
- if (id == null) {
1274
- throw new Error('Resource ID cannot be null!');
1275
- }
1276
- super(parent);
1277
- this.push('admin', 'users', id);
1278
- }
1279
- disable() {
1280
- return new APIResource(this).push('disable');
1281
- }
1282
- enable() {
1283
- return new APIResource(this).push('enable');
1284
- }
1285
- licenses() {
1286
- return new APIList(this).push('licenses');
1287
- }
1288
- resendActivation() {
1289
- return new APIResource(this).push('resend-activation').post();
1290
- }
1291
- account() {
1292
- return new APIAdminResourceUserAccount(this);
1293
- }
1298
+ function postAdminDeviceSessionChangeBillable(parent, billable) {
1299
+ const a = new APIResource(parent);
1300
+ const deviceSessionId = a.last;
1301
+ return a.restack('admin', 'device-sessions', deviceSessionId, 'changebillable').params({
1302
+ billable
1303
+ }).post();
1294
1304
  }
1295
1305
 
1296
- function postAdminDeviceSessionChangeBillable(parent, billable) {
1297
- const a = new APIResource(parent);
1298
- const deviceSessionId = a.last;
1299
- return a.restack('admin', 'device-sessions', deviceSessionId, 'changebillable').params({
1300
- billable
1301
- }).post();
1306
+ class APIAdminResourceDeviceSessionStandalone extends APIResourceDeviceSessionCommon {
1307
+ changeBillable(billable) {
1308
+ return postAdminDeviceSessionChangeBillable(this, billable);
1309
+ }
1310
+ connections() {
1311
+ return new APIList(this).push('connections');
1312
+ }
1313
+ connection(id) {
1314
+ if (id == null) {
1315
+ throw new Error('Resource ID cannot be null!');
1316
+ }
1317
+ return new APIResource(this).push('connections', id);
1318
+ }
1319
+ release() {
1320
+ return new APIResource(this).push('release').post();
1321
+ }
1302
1322
  }
1303
1323
 
1304
- class APIAdminResourceDeviceSessionStandalone extends APIResourceDeviceSessionCommon {
1305
- changeBillable(billable) {
1306
- return postAdminDeviceSessionChangeBillable(this, billable);
1307
- }
1308
- connections() {
1309
- return new APIList(this).push('connections');
1310
- }
1311
- connection(id) {
1312
- if (id == null) {
1313
- throw new Error('Resource ID cannot be null!');
1314
- }
1315
- return new APIResource(this).push('connections', id);
1316
- }
1317
- release() {
1318
- return new APIResource(this).push('release').post();
1319
- }
1324
+ class APIAdminListDevices extends APIList {
1325
+ constructor(parent) {
1326
+ super(parent);
1327
+ this.push('admin', 'devices');
1328
+ }
1329
+ filters() {
1330
+ return new APIResource(this).push('filters');
1331
+ }
1332
+ cleanupConfigurations() {
1333
+ return new APIListCleanupConfigurations(this);
1334
+ }
1335
+ cleanupConfiguration(id) {
1336
+ return new APIResourceCleanupConfiguration(this, id);
1337
+ }
1338
+ desktopBrowserCapabilities() {
1339
+ return new APIResource(this).push('desktop-browser-capabilities');
1340
+ }
1320
1341
  }
1321
1342
 
1322
- class APIAdminListDevices extends APIList {
1323
- constructor(parent) {
1324
- super(parent);
1325
- this.push('admin', 'devices');
1326
- }
1327
- filters() {
1328
- return new APIResource(this).push('filters');
1329
- }
1330
- cleanupConfigurations() {
1331
- return new APIListCleanupConfigurations(this);
1332
- }
1333
- cleanupConfiguration(id) {
1334
- return new APIResourceCleanupConfiguration(this, id);
1335
- }
1336
- desktopBrowserCapabilities() {
1337
- return new APIResource(this).push('desktop-browser-capabilities');
1338
- }
1343
+ class APIAdminResourceFramework extends APIResource {
1344
+ constructor(parent, id) {
1345
+ if (id == null) {
1346
+ throw new Error('Resource ID cannot be null!');
1347
+ }
1348
+ super(parent);
1349
+ this.push('admin', 'frameworks', id);
1350
+ }
1351
+ config() {
1352
+ return new APIResource(this).push('config');
1353
+ }
1354
+ requiredRoles() {
1355
+ return new APIList(this).push('required-roles');
1356
+ }
1339
1357
  }
1340
1358
 
1341
- class APIAdminResourceFramework extends APIResource {
1342
- constructor(parent, id) {
1343
- if (id == null) {
1344
- throw new Error('Resource ID cannot be null!');
1345
- }
1346
- super(parent);
1347
- this.push('admin', 'frameworks', id);
1348
- }
1349
- config() {
1350
- return new APIResource(this).push('config');
1351
- }
1352
- requiredRoles() {
1353
- return new APIList(this).push('required-roles');
1354
- }
1359
+ class APIAdminResourceLicense extends APIResource {
1360
+ constructor(parent, id) {
1361
+ if (id == null) {
1362
+ throw new Error('Resource ID cannot be null!');
1363
+ }
1364
+ super(parent);
1365
+ this.push('admin', 'licenses', id);
1366
+ }
1367
+ activate() {
1368
+ return new APIResource(this).push('activate');
1369
+ }
1370
+ deactivate() {
1371
+ return new APIResource(this).push('deactivate');
1372
+ }
1373
+ resend() {
1374
+ return new APIResource(this).push('resend');
1375
+ }
1376
+ download() {
1377
+ return new APIResource(this).push('download');
1378
+ }
1355
1379
  }
1356
1380
 
1357
- class APIAdminResourceLicense extends APIResource {
1358
- constructor(parent, id) {
1359
- if (id == null) {
1360
- throw new Error('Resource ID cannot be null!');
1361
- }
1362
- super(parent);
1363
- this.push('admin', 'licenses', id);
1364
- }
1365
- activate() {
1366
- return new APIResource(this).push('activate');
1367
- }
1368
- deactivate() {
1369
- return new APIResource(this).push('deactivate');
1370
- }
1371
- resend() {
1372
- return new APIResource(this).push('resend');
1373
- }
1374
- download() {
1375
- return new APIResource(this).push('download');
1376
- }
1381
+ class APIAdminListNotificationPlans extends APIList {
1382
+ constructor(parent) {
1383
+ super(parent);
1384
+ this.push('admin', 'notification-plans');
1385
+ }
1386
+ channels() {
1387
+ return new APIList(this).push('channels');
1388
+ }
1389
+ scopes() {
1390
+ return new APIList(this).push('scopes');
1391
+ }
1377
1392
  }
1378
1393
 
1379
- class APIAdminListNotificationPlans extends APIList {
1380
- constructor(parent) {
1381
- super(parent);
1382
- this.push('admin', 'notification-plans');
1383
- }
1384
- channels() {
1385
- return new APIList(this).push('channels');
1386
- }
1387
- scopes() {
1388
- return new APIList(this).push('scopes');
1389
- }
1394
+ class APIAdminResourceNotificationPlan extends APIResource {
1395
+ constructor(parent, id) {
1396
+ if (id == null) {
1397
+ throw new Error('Resource ID cannot be null!');
1398
+ }
1399
+ super(parent);
1400
+ this.push('admin', 'notification-plans', id);
1401
+ }
1402
+ check() {
1403
+ return new APIList(this).push('check');
1404
+ }
1405
+ test() {
1406
+ return new APIResource(this).push('test');
1407
+ }
1408
+ execute() {
1409
+ return new APIResource(this).push('execute');
1410
+ }
1390
1411
  }
1391
1412
 
1392
- class APIAdminResourceNotificationPlan extends APIResource {
1393
- constructor(parent, id) {
1394
- if (id == null) {
1395
- throw new Error('Resource ID cannot be null!');
1396
- }
1397
- super(parent);
1398
- this.push('admin', 'notification-plans', id);
1399
- }
1400
- check() {
1401
- return new APIList(this).push('check');
1402
- }
1403
- test() {
1404
- return new APIResource(this).push('test');
1405
- }
1406
- execute() {
1407
- return new APIResource(this).push('execute');
1408
- }
1413
+ class APIAdminResourceService extends APIResource {
1414
+ constructor(parent, id) {
1415
+ if (id == null) {
1416
+ throw new Error('Resource ID cannot be null!');
1417
+ }
1418
+ super(parent);
1419
+ this.push('admin', 'services', id);
1420
+ }
1421
+ activate() {
1422
+ return new APIResource(this).push('activate').post();
1423
+ }
1424
+ deactivate() {
1425
+ return new APIResource(this).push('deactivate').post();
1426
+ }
1427
+ roles() {
1428
+ return new APIList(this).push('roles');
1429
+ }
1409
1430
  }
1410
1431
 
1411
- class APIAdminResourceService extends APIResource {
1412
- constructor(parent, id) {
1413
- if (id == null) {
1414
- throw new Error('Resource ID cannot be null!');
1415
- }
1416
- super(parent);
1417
- this.push('admin', 'services', id);
1418
- }
1419
- activate() {
1420
- return new APIResource(this).push('activate').post();
1421
- }
1422
- deactivate() {
1423
- return new APIResource(this).push('deactivate').post();
1424
- }
1425
- roles() {
1426
- return new APIList(this).push('roles');
1427
- }
1432
+ class APIAdminListServices extends APIList {
1433
+ constructor(parent) {
1434
+ super(parent);
1435
+ this.push('admin', 'services');
1436
+ }
1437
+ purchased() {
1438
+ return new APIListPurchased(this);
1439
+ }
1440
+ available() {
1441
+ return new APIList(this).push('available');
1442
+ }
1443
+ active() {
1444
+ const a = new APIList(this);
1445
+ if (this.first === 'me') {
1446
+ a.push('active');
1447
+ }
1448
+ else {
1449
+ a.params({
1450
+ notArchived: true
1451
+ });
1452
+ }
1453
+ return a;
1454
+ }
1455
+ activated() {
1456
+ const a = this.active();
1457
+ a.params({
1458
+ filter: 'activated_eq_true',
1459
+ limit: 0,
1460
+ sort: 'name_a'
1461
+ });
1462
+ return a;
1463
+ }
1464
+ inUse() {
1465
+ const a = new APIList(this);
1466
+ a.params({
1467
+ inUse: true,
1468
+ limit: 0,
1469
+ sort: 'name_a'
1470
+ });
1471
+ return a;
1472
+ }
1473
+ byPrice() {
1474
+ const a = new APIList(this);
1475
+ a.params({
1476
+ sort: 'centPrice_a'
1477
+ });
1478
+ return a;
1479
+ }
1428
1480
  }
1429
1481
 
1430
- class APIAdminListServices extends APIList {
1431
- constructor(parent) {
1432
- super(parent);
1433
- this.push('admin', 'services');
1434
- }
1435
- purchased() {
1436
- return new APIListPurchased(this);
1437
- }
1438
- available() {
1439
- return new APIList(this).push('available');
1440
- }
1441
- active() {
1442
- const a = new APIList(this);
1443
- if (this.first === 'me') {
1444
- a.push('active');
1445
- }
1446
- else {
1447
- a.params({
1448
- notArchived: true
1449
- });
1450
- }
1451
- return a;
1452
- }
1453
- activated() {
1454
- const a = this.active();
1455
- a.params({
1456
- filter: 'activated_eq_true',
1457
- limit: 0,
1458
- sort: 'name_a'
1459
- });
1460
- return a;
1461
- }
1462
- inUse() {
1463
- const a = new APIList(this);
1464
- a.params({
1465
- inUse: true,
1466
- limit: 0,
1467
- sort: 'name_a'
1468
- });
1469
- return a;
1470
- }
1471
- byPrice() {
1472
- const a = new APIList(this);
1473
- a.params({
1474
- sort: 'centPrice_a'
1475
- });
1476
- return a;
1477
- }
1482
+ class APIAdminListStatistics extends APIList {
1483
+ constructor(parent) {
1484
+ super(parent);
1485
+ this.push('admin', 'statistics');
1486
+ }
1487
+ deviceSessions() {
1488
+ return new APIList(this).push('device-sessions');
1489
+ }
1490
+ frameworks() {
1491
+ return new APIList(this).push('frameworks');
1492
+ }
1478
1493
  }
1479
1494
 
1480
- class APIAdminListStatistics extends APIList {
1481
- constructor(parent) {
1482
- super(parent);
1483
- this.push('admin', 'statistics');
1484
- }
1485
- deviceSessions() {
1486
- return new APIList(this).push('device-sessions');
1487
- }
1488
- frameworks() {
1489
- return new APIList(this).push('frameworks');
1490
- }
1495
+ class APIAdminResourceDeviceModel extends APIResource {
1496
+ constructor(parent, id) {
1497
+ if (id == null) {
1498
+ throw new Error('Resource ID cannot be null!');
1499
+ }
1500
+ super(parent);
1501
+ this.push('admin', 'device-models', id);
1502
+ }
1503
+ browsers() {
1504
+ return new APIList(this).push('browsers');
1505
+ }
1491
1506
  }
1492
1507
 
1493
- class APIAdminResourceDeviceModel extends APIResource {
1494
- constructor(parent, id) {
1495
- if (id == null) {
1496
- throw new Error('Resource ID cannot be null!');
1497
- }
1498
- super(parent);
1499
- this.push('admin', 'device-models', id);
1500
- }
1501
- browsers() {
1502
- return new APIList(this).push('browsers');
1503
- }
1508
+ class APIAdminResource extends APIResource {
1509
+ constructor(parent) {
1510
+ super(parent);
1511
+ }
1512
+ accessGroups() {
1513
+ return new APIList(this).push('access-groups');
1514
+ }
1515
+ accessGroup(id) {
1516
+ return new APIResourceAccessGroup(this, id);
1517
+ }
1518
+ accounts() {
1519
+ return new APIList(this).push('admin', 'accounts');
1520
+ }
1521
+ account(id) {
1522
+ if (id == null) {
1523
+ throw new Error('Resource ID cannot be null!');
1524
+ }
1525
+ return new APIResource(this).push('admin', 'accounts', id);
1526
+ }
1527
+ accountServices() {
1528
+ return new APIList(this).push('admin', 'account-services');
1529
+ }
1530
+ accountService(id) {
1531
+ return new APIAdminResourceAccountService(this, id);
1532
+ }
1533
+ activities() {
1534
+ return new APIList(this).push('admin', 'activities');
1535
+ }
1536
+ billingPeriods() {
1537
+ return new APIList(this).push('admin', 'billing-periods');
1538
+ }
1539
+ billingPeriod(id) {
1540
+ if (id == null) {
1541
+ throw new Error('Resource ID cannot be null!');
1542
+ }
1543
+ return new APIResource(this).push('admin', 'billing-periods', id);
1544
+ }
1545
+ browsers() {
1546
+ return new APIList(this).push('admin', 'browsers');
1547
+ }
1548
+ browser(id) {
1549
+ if (id == null) {
1550
+ throw new Error('Resource ID cannot be null!');
1551
+ }
1552
+ return new APIResource(this).push('admin', 'browsers', id);
1553
+ }
1554
+ clusters() {
1555
+ return new APIList(this).push('clusters');
1556
+ }
1557
+ cluster(id) {
1558
+ return new APIAdminResourceCluster(this, id);
1559
+ }
1560
+ countryVatRates() {
1561
+ return new APIList(this).push('admin', 'country-vat-rates');
1562
+ }
1563
+ countryVatRate(id) {
1564
+ if (id == null) {
1565
+ throw new Error('Resource ID cannot be null!');
1566
+ }
1567
+ return new APIResource(this).push('admin', 'country-vat-rates', id);
1568
+ }
1569
+ devices() {
1570
+ return new APIAdminListDevices(this);
1571
+ }
1572
+ device(id) {
1573
+ return new APIAdminResourceDevice(this, id);
1574
+ }
1575
+ devicesForModel(id) {
1576
+ if (id == null) {
1577
+ throw new Error('Resource ID cannot be null!');
1578
+ }
1579
+ const a = this.devices();
1580
+ a.params({
1581
+ filter: 'deviceModelId_eq_' + id
1582
+ });
1583
+ return a;
1584
+ }
1585
+ deviceStatuses() {
1586
+ return new APIList(this).push('admin', 'device', 'statuses');
1587
+ }
1588
+ deviceModels() {
1589
+ return new APIList(this).push('admin', 'device-models');
1590
+ }
1591
+ deviceModel(id) {
1592
+ return new APIAdminResourceDeviceModel(this, id);
1593
+ }
1594
+ deviceProblems() {
1595
+ return new APIList(this).push('admin', 'device-problems');
1596
+ }
1597
+ deviceModelCriterias() {
1598
+ return new APIList(this).push('admin', 'device-model-criteria');
1599
+ }
1600
+ deviceModelCriteria(id) {
1601
+ if (id == null) {
1602
+ throw new Error('Resource ID cannot be null!');
1603
+ }
1604
+ return new APIResource(this).push('admin', 'device-model-criteria', id);
1605
+ }
1606
+ deviceSessions() {
1607
+ return new APIList(this).push('admin', 'device-sessions');
1608
+ }
1609
+ deviceSession(id) {
1610
+ return new APIAdminResourceDeviceSessionStandalone(this, id);
1611
+ }
1612
+ deviceTime() {
1613
+ return new APIAdminResourceDeviceTime(this);
1614
+ }
1615
+ deviceTimeSummary() {
1616
+ return new APIList(this).push('admin', 'device-time-summary');
1617
+ }
1618
+ deviceTypes() {
1619
+ return new APIList(this).push('admin', 'device-types');
1620
+ }
1621
+ deviceType(id) {
1622
+ return new APIResource(this).push('admin', 'device-types', id);
1623
+ }
1624
+ deviceGroups() {
1625
+ return new APIList(this).push('device-groups');
1626
+ }
1627
+ deviceGroup(id) {
1628
+ return new APIResourceDeviceGroup(this, id);
1629
+ }
1630
+ emails() {
1631
+ return new APIList(this).push('admin', 'emails');
1632
+ }
1633
+ resendEmail(id) {
1634
+ if (id == null) {
1635
+ throw new Error('Resource ID cannot be null!');
1636
+ }
1637
+ return new APIResource(this).push('admin', 'emails', id, 'resend').post();
1638
+ }
1639
+ errors() {
1640
+ return new APIList(this).push('admin', 'errors');
1641
+ }
1642
+ files() {
1643
+ return new APIList(this).push('files');
1644
+ }
1645
+ file(id) {
1646
+ return new APIResourceFile(this, id);
1647
+ }
1648
+ frameworks() {
1649
+ return new APIList(this).push('admin', 'frameworks');
1650
+ }
1651
+ framework(id) {
1652
+ return new APIAdminResourceFramework(this, id);
1653
+ }
1654
+ frameworkAvailableLabels() {
1655
+ const a = this.frameworks();
1656
+ a.push('available-labels');
1657
+ return a;
1658
+ }
1659
+ interactiveQueue() {
1660
+ return new APIList(this).push('admin', 'interactive-queue');
1661
+ }
1662
+ licenses() {
1663
+ return new APIList(this).push('admin', 'licenses');
1664
+ }
1665
+ license(id) {
1666
+ return new APIAdminResourceLicense(this, id);
1667
+ }
1668
+ maintenance() {
1669
+ return new APIResource(this).push('admin', 'maintenance');
1670
+ }
1671
+ marketShares() {
1672
+ return new APIList(this).push('admin', 'market-shares');
1673
+ }
1674
+ notificationPlans() {
1675
+ return new APIAdminListNotificationPlans(this);
1676
+ }
1677
+ notificationPlan(id) {
1678
+ return new APIAdminResourceNotificationPlan(this, id);
1679
+ }
1680
+ overview() {
1681
+ return new APIResource(this).push('admin', 'overview');
1682
+ }
1683
+ pools() {
1684
+ return new APIList(this).push('admin', 'pools');
1685
+ }
1686
+ pool(id) {
1687
+ return new APIResource(this).push('admin', 'pools', id);
1688
+ }
1689
+ projects() {
1690
+ return new APIList(this).push('projects');
1691
+ }
1692
+ project(id) {
1693
+ return new APIResourceProject(this, id);
1694
+ }
1695
+ roles() {
1696
+ return new APIList(this).push('admin', 'roles');
1697
+ }
1698
+ runs() {
1699
+ return new APIAdminListRuns(this);
1700
+ }
1701
+ run(id) {
1702
+ return new APIAdminResourceRunStandalone(this, id);
1703
+ }
1704
+ samples() {
1705
+ return new APIList(this).push('admin', 'samples');
1706
+ }
1707
+ sample(id) {
1708
+ if (id == null) {
1709
+ throw new Error('Resource ID cannot be null!');
1710
+ }
1711
+ return new APIResource(this).push('admin', 'samples', id);
1712
+ }
1713
+ services() {
1714
+ return new APIAdminListServices(this);
1715
+ }
1716
+ service(id) {
1717
+ return new APIAdminResourceService(this, id);
1718
+ }
1719
+ settings() {
1720
+ return new APIResource(this).push('admin', 'settings');
1721
+ }
1722
+ statistics() {
1723
+ return new APIAdminListStatistics(this);
1724
+ }
1725
+ users() {
1726
+ return new APIList(this).push('users');
1727
+ }
1728
+ createUser() {
1729
+ return new APIList(this).push('admin', 'users').post();
1730
+ }
1731
+ user(id) {
1732
+ return new APIAdminResourceUser(this, id);
1733
+ }
1504
1734
  }
1505
1735
 
1506
- class APIAdminResource extends APIResource {
1507
- constructor(parent) {
1508
- super(parent);
1509
- }
1510
- accessGroups() {
1511
- return new APIList(this).push('access-groups');
1512
- }
1513
- accessGroup(id) {
1514
- return new APIResourceAccessGroup(this, id);
1515
- }
1516
- accounts() {
1517
- return new APIList(this).push('admin', 'accounts');
1518
- }
1519
- account(id) {
1520
- if (id == null) {
1521
- throw new Error('Resource ID cannot be null!');
1522
- }
1523
- return new APIResource(this).push('admin', 'accounts', id);
1524
- }
1525
- accountServices() {
1526
- return new APIList(this).push('admin', 'account-services');
1527
- }
1528
- accountService(id) {
1529
- return new APIAdminResourceAccountService(this, id);
1530
- }
1531
- activities() {
1532
- return new APIList(this).push('admin', 'activities');
1533
- }
1534
- billingPeriods() {
1535
- return new APIList(this).push('admin', 'billing-periods');
1536
- }
1537
- billingPeriod(id) {
1538
- if (id == null) {
1539
- throw new Error('Resource ID cannot be null!');
1540
- }
1541
- return new APIResource(this).push('admin', 'billing-periods', id);
1542
- }
1543
- browsers() {
1544
- return new APIList(this).push('admin', 'browsers');
1545
- }
1546
- browser(id) {
1547
- if (id == null) {
1548
- throw new Error('Resource ID cannot be null!');
1549
- }
1550
- return new APIResource(this).push('admin', 'browsers', id);
1551
- }
1552
- clusters() {
1553
- return new APIList(this).push('clusters');
1554
- }
1555
- cluster(id) {
1556
- return new APIAdminResourceCluster(this, id);
1557
- }
1558
- countryVatRates() {
1559
- return new APIList(this).push('admin', 'country-vat-rates');
1560
- }
1561
- countryVatRate(id) {
1562
- if (id == null) {
1563
- throw new Error('Resource ID cannot be null!');
1564
- }
1565
- return new APIResource(this).push('admin', 'country-vat-rates', id);
1566
- }
1567
- devices() {
1568
- return new APIAdminListDevices(this);
1569
- }
1570
- device(id) {
1571
- return new APIAdminResourceDevice(this, id);
1572
- }
1573
- devicesForModel(id) {
1574
- if (id == null) {
1575
- throw new Error('Resource ID cannot be null!');
1576
- }
1577
- const a = this.devices();
1578
- a.params({
1579
- filter: 'deviceModelId_eq_' + id
1580
- });
1581
- return a;
1582
- }
1583
- deviceStatuses() {
1584
- return new APIList(this).push('admin', 'device', 'statuses');
1585
- }
1586
- deviceModels() {
1587
- return new APIList(this).push('admin', 'device-models');
1588
- }
1589
- deviceModel(id) {
1590
- return new APIAdminResourceDeviceModel(this, id);
1591
- }
1592
- deviceProblems() {
1593
- return new APIList(this).push('admin', 'device-problems');
1594
- }
1595
- deviceModelCriterias() {
1596
- return new APIList(this).push('admin', 'device-model-criteria');
1597
- }
1598
- deviceModelCriteria(id) {
1599
- if (id == null) {
1600
- throw new Error('Resource ID cannot be null!');
1601
- }
1602
- return new APIResource(this).push('admin', 'device-model-criteria', id);
1603
- }
1604
- deviceSessions() {
1605
- return new APIList(this).push('admin', 'device-sessions');
1606
- }
1607
- deviceSession(id) {
1608
- return new APIAdminResourceDeviceSessionStandalone(this, id);
1609
- }
1610
- deviceTime() {
1611
- return new APIAdminResourceDeviceTime(this);
1612
- }
1613
- deviceTimeSummary() {
1614
- return new APIList(this).push('admin', 'device-time-summary');
1615
- }
1616
- deviceTypes() {
1617
- return new APIList(this).push('admin', 'device-types');
1618
- }
1619
- deviceType(id) {
1620
- return new APIResource(this).push('admin', 'device-types', id);
1621
- }
1622
- deviceGroups() {
1623
- return new APIList(this).push('device-groups');
1624
- }
1625
- deviceGroup(id) {
1626
- return new APIResourceDeviceGroup(this, id);
1627
- }
1628
- emails() {
1629
- return new APIList(this).push('admin', 'emails');
1630
- }
1631
- resendEmail(id) {
1632
- if (id == null) {
1633
- throw new Error('Resource ID cannot be null!');
1634
- }
1635
- return new APIResource(this).push('admin', 'emails', id, 'resend').post();
1636
- }
1637
- errors() {
1638
- return new APIList(this).push('admin', 'errors');
1639
- }
1640
- files() {
1641
- return new APIList(this).push('files');
1642
- }
1643
- file(id) {
1644
- return new APIResourceFile(this, id);
1645
- }
1646
- frameworks() {
1647
- return new APIList(this).push('admin', 'frameworks');
1648
- }
1649
- framework(id) {
1650
- return new APIAdminResourceFramework(this, id);
1651
- }
1652
- frameworkAvailableLabels() {
1653
- const a = this.frameworks();
1654
- a.push('available-labels');
1655
- return a;
1656
- }
1657
- interactiveQueue() {
1658
- return new APIList(this).push('admin', 'interactive-queue');
1659
- }
1660
- licenses() {
1661
- return new APIList(this).push('admin', 'licenses');
1662
- }
1663
- license(id) {
1664
- return new APIAdminResourceLicense(this, id);
1665
- }
1666
- maintenance() {
1667
- return new APIResource(this).push('admin', 'maintenance');
1668
- }
1669
- marketShares() {
1670
- return new APIList(this).push('admin', 'market-shares');
1671
- }
1672
- notificationPlans() {
1673
- return new APIAdminListNotificationPlans(this);
1674
- }
1675
- notificationPlan(id) {
1676
- return new APIAdminResourceNotificationPlan(this, id);
1677
- }
1678
- overview() {
1679
- return new APIResource(this).push('admin', 'overview');
1680
- }
1681
- pools() {
1682
- return new APIList(this).push('admin', 'pools');
1683
- }
1684
- pool(id) {
1685
- return new APIResource(this).push('admin', 'pools', id);
1686
- }
1687
- projects() {
1688
- return new APIList(this).push('projects');
1689
- }
1690
- project(id) {
1691
- return new APIResourceProject(this, id);
1692
- }
1693
- roles() {
1694
- return new APIList(this).push('admin', 'roles');
1695
- }
1696
- runs() {
1697
- return new APIAdminListRuns(this);
1698
- }
1699
- run(id) {
1700
- return new APIAdminResourceRunStandalone(this, id);
1701
- }
1702
- samples() {
1703
- return new APIList(this).push('admin', 'samples');
1704
- }
1705
- sample(id) {
1706
- if (id == null) {
1707
- throw new Error('Resource ID cannot be null!');
1708
- }
1709
- return new APIResource(this).push('admin', 'samples', id);
1710
- }
1711
- services() {
1712
- return new APIAdminListServices(this);
1713
- }
1714
- service(id) {
1715
- return new APIAdminResourceService(this, id);
1716
- }
1717
- settings() {
1718
- return new APIResource(this).push('admin', 'settings');
1719
- }
1720
- statistics() {
1721
- return new APIAdminListStatistics(this);
1722
- }
1723
- users() {
1724
- return new APIList(this).push('users');
1725
- }
1726
- createUser() {
1727
- return new APIList(this).push('admin', 'users').post();
1728
- }
1729
- user(id) {
1730
- return new APIAdminResourceUser(this, id);
1731
- }
1736
+ class APIResourceAccount extends APIResource {
1737
+ constructor(parent, id) {
1738
+ if (id == null) {
1739
+ throw new Error('Resource ID cannot be null!');
1740
+ }
1741
+ super(parent);
1742
+ this.push('accounts', id);
1743
+ }
1744
+ concurrencyStatus() {
1745
+ return new APIResource(this).push('concurrency-status');
1746
+ }
1747
+ preferences() {
1748
+ return new APIResource(this).push('preferences');
1749
+ }
1732
1750
  }
1733
1751
 
1734
- class APIResourceAccount extends APIResource {
1735
- constructor(parent, id) {
1736
- if (id == null) {
1737
- throw new Error('Resource ID cannot be null!');
1738
- }
1739
- super(parent);
1740
- this.push('accounts', id);
1741
- }
1742
- concurrencyStatus() {
1743
- return new APIResource(this).push('concurrency-status');
1744
- }
1745
- preferences() {
1746
- return new APIResource(this).push('preferences');
1747
- }
1752
+ class APIResourceBroker extends APIResource {
1753
+ constructor(parent) {
1754
+ super(parent);
1755
+ this.push('broker');
1756
+ }
1757
+ hubs() {
1758
+ return new APIList(this).push('hubs');
1759
+ }
1748
1760
  }
1749
1761
 
1750
- if (global.isNodeJs) {
1751
- axios.defaults.headers.common['User-Agent'] = `Bitbar Cloud API Client for JavaScript v${version}`;
1752
- }
1753
- axios.defaults.maxContentLength = 1073741824;
1754
- class API {
1755
- constructor(config) {
1756
- if (config == null) {
1757
- throw new Error('config cannot be empty');
1758
- }
1759
- this.config = config;
1760
- this.axiosConfig = {};
1761
- if (this.config.cloudUrl == null) {
1762
- throw new TypeError('cloudUrl cannot be empty');
1763
- }
1764
- else if (typeof this.config.cloudUrl !== 'string') {
1765
- throw new TypeError('cloudUrl must be a string');
1766
- }
1767
- else if (!/^https?:\/\/.{2,}/.test(this.config.cloudUrl)) {
1768
- throw new Error("cloudUrl doesn't look like a URL");
1769
- }
1770
- this.axiosConfig.baseURL = this.config.cloudUrl.replace(/\/+$/, '') + '/api';
1771
- this.config.v2 = !!this.config.v2;
1772
- if (this.config.v2) {
1773
- this.axiosConfig.baseURL += '/v2';
1774
- }
1775
- if (this.config.apiKey) {
1776
- if (typeof this.config.apiKey !== 'string') {
1777
- throw new TypeError('apiKey must be a string');
1778
- }
1779
- else if (!/^[A-Za-z0-9]{32}$/.test(this.config.apiKey)) {
1780
- throw new Error("apiKey is in the wrong format");
1781
- }
1782
- this.axiosConfig.auth = {
1783
- username: this.config.apiKey,
1784
- password: ''
1785
- };
1786
- }
1787
- this.axiosConfig.withCredentials = config.withCredentials == null ? false : config.withCredentials;
1788
- this.axios = axios.create(this.axiosConfig);
1789
- }
1790
- userSession() {
1791
- return new APIResourceUserSession(this);
1792
- }
1793
- user(id) {
1794
- return new APIResourceUser(this, id);
1795
- }
1796
- users() {
1797
- return new APIListUsers(this);
1798
- }
1799
- account(id) {
1800
- return new APIResourceAccount(this, id);
1801
- }
1802
- me() {
1803
- return this.user('me');
1804
- }
1805
- admin() {
1806
- return new APIAdminResource(this);
1807
- }
1808
- devices() {
1809
- return new APIListDevices(this);
1810
- }
1811
- device(id) {
1812
- return new APIResourceDevice(this, id);
1813
- }
1814
- deviceGroups() {
1815
- return new APIList(this).push('device-groups');
1816
- }
1817
- deviceGroup(id) {
1818
- return new APIResourceDeviceGroup(this, id);
1819
- }
1820
- deviceSessions() {
1821
- return new APIList(this).push('device-sessions');
1822
- }
1823
- deviceSession(id) {
1824
- return new APIResourceDeviceSession(this, id);
1825
- }
1826
- labelGroups() {
1827
- return new APIList(this).push('label-groups');
1828
- }
1829
- deviceStatistics() {
1830
- return new APIList(this).push('device-statistics');
1831
- }
1832
- enums() {
1833
- return new APIResource(this).push('enums');
1834
- }
1835
- licenses() {
1836
- return new APIResource(this).push('licenses');
1837
- }
1838
- labels() {
1839
- return new APIList(this).push('labels');
1840
- }
1762
+ if (global.isNodeJs) {
1763
+ axios__default["default"].defaults.headers.common['User-Agent'] = `Bitbar Cloud API Client for JavaScript v${version}`;
1764
+ }
1765
+ axios__default["default"].defaults.maxContentLength = 1073741824;
1766
+ class API {
1767
+ constructor(config) {
1768
+ if (config == null) {
1769
+ throw new Error('config cannot be empty');
1770
+ }
1771
+ this.config = config;
1772
+ this.axiosConfig = {};
1773
+ if (this.config.cloudUrl == null) {
1774
+ throw new TypeError('cloudUrl cannot be empty');
1775
+ }
1776
+ else if (typeof this.config.cloudUrl !== 'string') {
1777
+ throw new TypeError('cloudUrl must be a string');
1778
+ }
1779
+ else if (!/^https?:\/\/.{2,}/.test(this.config.cloudUrl)) {
1780
+ throw new Error("cloudUrl doesn't look like a URL");
1781
+ }
1782
+ this.axiosConfig.baseURL = this.config.cloudUrl.replace(/\/+$/, '') + '/api';
1783
+ this.config.v2 = !!this.config.v2;
1784
+ if (this.config.v2) {
1785
+ this.axiosConfig.baseURL += '/v2';
1786
+ }
1787
+ if (this.config.apiKey) {
1788
+ if (typeof this.config.apiKey !== 'string') {
1789
+ throw new TypeError('apiKey must be a string');
1790
+ }
1791
+ else if (!/^[A-Za-z0-9]{32}$/.test(this.config.apiKey)) {
1792
+ throw new Error("apiKey is in the wrong format");
1793
+ }
1794
+ this.axiosConfig.auth = {
1795
+ username: this.config.apiKey,
1796
+ password: ''
1797
+ };
1798
+ }
1799
+ this.axiosConfig.withCredentials = config.withCredentials == null ? false : config.withCredentials;
1800
+ this.axios = axios__default["default"].create(this.axiosConfig);
1801
+ }
1802
+ userSession() {
1803
+ return new APIResourceUserSession(this);
1804
+ }
1805
+ user(id) {
1806
+ return new APIResourceUser(this, id);
1807
+ }
1808
+ users() {
1809
+ return new APIListUsers(this);
1810
+ }
1811
+ account(id) {
1812
+ return new APIResourceAccount(this, id);
1813
+ }
1814
+ me() {
1815
+ return this.user('me');
1816
+ }
1817
+ admin() {
1818
+ return new APIAdminResource(this);
1819
+ }
1820
+ devices() {
1821
+ return new APIListDevices(this);
1822
+ }
1823
+ device(id) {
1824
+ return new APIResourceDevice(this, id);
1825
+ }
1826
+ deviceGroups() {
1827
+ return new APIList(this).push('device-groups');
1828
+ }
1829
+ deviceGroup(id) {
1830
+ return new APIResourceDeviceGroup(this, id);
1831
+ }
1832
+ deviceSessions() {
1833
+ return new APIList(this).push('device-sessions');
1834
+ }
1835
+ deviceSession(id) {
1836
+ return new APIResourceDeviceSession(this, id);
1837
+ }
1838
+ labelGroups() {
1839
+ return new APIList(this).push('label-groups');
1840
+ }
1841
+ deviceStatistics() {
1842
+ return new APIList(this).push('device-statistics');
1843
+ }
1844
+ enums() {
1845
+ return new APIResource(this).push('enums');
1846
+ }
1847
+ licenses() {
1848
+ return new APIResource(this).push('licenses');
1849
+ }
1850
+ labels() {
1851
+ return new APIList(this).push('labels');
1852
+ }
1853
+ broker() {
1854
+ return new APIResourceBroker(this);
1855
+ }
1841
1856
  }
1842
1857
 
1843
- const CloudAPIClient = {
1844
- API,
1845
- FilterBuilder
1858
+ const CloudAPIClient = {
1859
+ API,
1860
+ FilterBuilder
1846
1861
  };
1847
1862
 
1848
1863
  return CloudAPIClient;
1849
1864
 
1850
- })));
1865
+ }));
1851
1866
  //# sourceMappingURL=bitbar-cloud-api-client.js.map