@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.
- package/dist/API.d.ts +40 -38
- package/dist/ApiConfig.d.ts +10 -10
- package/dist/CloudAPIClient.d.ts +7 -7
- package/dist/Filter.d.ts +7 -7
- package/dist/FilterBuilder.d.ts +25 -25
- package/dist/api/APIAdminListDevices.d.ts +12 -12
- package/dist/api/APIAdminListNotificationPlans.d.ts +7 -7
- package/dist/api/APIAdminListRuns.d.ts +7 -7
- package/dist/api/APIAdminListServices.d.ts +12 -12
- package/dist/api/APIAdminListStatistics.d.ts +7 -7
- package/dist/api/APIAdminResource.d.ts +91 -91
- package/dist/api/APIAdminResourceAccount.d.ts +5 -5
- package/dist/api/APIAdminResourceAccountService.d.ts +7 -7
- package/dist/api/APIAdminResourceCluster.d.ts +7 -7
- package/dist/api/APIAdminResourceDevice.d.ts +11 -11
- package/dist/api/APIAdminResourceDeviceModel.d.ts +7 -7
- package/dist/api/APIAdminResourceDeviceSession.d.ts +5 -5
- package/dist/api/APIAdminResourceDeviceSessionStandalone.d.ts +12 -12
- package/dist/api/APIAdminResourceDeviceTime.d.ts +8 -8
- package/dist/api/APIAdminResourceFramework.d.ts +8 -8
- package/dist/api/APIAdminResourceLicense.d.ts +9 -9
- package/dist/api/APIAdminResourceNotificationPlan.d.ts +9 -9
- package/dist/api/APIAdminResourceProject.d.ts +6 -6
- package/dist/api/APIAdminResourceRun.d.ts +7 -7
- package/dist/api/APIAdminResourceRunStandalone.d.ts +13 -13
- package/dist/api/APIAdminResourceService.d.ts +9 -9
- package/dist/api/APIAdminResourceUser.d.ts +12 -12
- package/dist/api/APIAdminResourceUserAccount.d.ts +10 -10
- package/dist/api/APIEntity.d.ts +32 -32
- package/dist/api/APIList.d.ts +24 -24
- package/dist/api/APIListCleanupConfigurations.d.ts +7 -7
- package/dist/api/APIListDeviceTime.d.ts +7 -7
- package/dist/api/APIListDevices.d.ts +12 -12
- package/dist/api/APIListFiles.d.ts +10 -10
- package/dist/api/APIListNotifications.d.ts +7 -7
- package/dist/api/APIListProperties.d.ts +6 -6
- package/dist/api/APIListPurchased.d.ts +5 -5
- package/dist/api/APIListRuns.d.ts +7 -7
- package/dist/api/APIListServices.d.ts +9 -9
- package/dist/api/APIListSmartbearTunnels.d.ts +6 -6
- package/dist/api/APIListStatistics.d.ts +6 -6
- package/dist/api/APIListUsers.d.ts +11 -11
- package/dist/api/APIResource.d.ts +5 -5
- package/dist/api/APIResourceAccessGroup.d.ts +10 -10
- package/dist/api/APIResourceAccount.d.ts +7 -7
- package/dist/api/APIResourceAccountService.d.ts +6 -6
- package/dist/api/APIResourceAdditionalUser.d.ts +6 -6
- package/dist/api/APIResourceBillingPeriod.d.ts +6 -6
- package/dist/api/APIResourceBroker.d.ts +7 -0
- package/dist/api/APIResourceBuild.d.ts +8 -8
- package/dist/api/APIResourceCleanupConfiguration.d.ts +7 -7
- package/dist/api/APIResourceDevice.d.ts +7 -7
- package/dist/api/APIResourceDeviceGroup.d.ts +11 -11
- package/dist/api/APIResourceDeviceSession.d.ts +8 -8
- package/dist/api/APIResourceDeviceSessionCommon.d.ts +18 -18
- package/dist/api/APIResourceDeviceSessionStandalone.d.ts +14 -14
- package/dist/api/APIResourceFile.d.ts +9 -9
- package/dist/api/APIResourceJob.d.ts +9 -9
- package/dist/api/APIResourceLabelGroup.d.ts +8 -8
- package/dist/api/APIResourceNotification.d.ts +6 -6
- package/dist/api/APIResourceProject.d.ts +15 -15
- package/dist/api/APIResourceRun.d.ts +6 -6
- package/dist/api/APIResourceRunCommon.d.ts +19 -19
- package/dist/api/APIResourceUser.d.ts +56 -56
- package/dist/api/APIResourceUserSession.d.ts +9 -9
- package/dist/api/APIUserResourceAccount.d.ts +10 -10
- package/dist/api/class/InputFileset.d.ts +8 -8
- package/dist/api/class/OutputFileset.d.ts +14 -14
- package/dist/api/factory/postAdminDeviceSessionChangeBillable.d.ts +4 -4
- package/dist/api/factory/postDeviceRunIds.d.ts +4 -4
- package/dist/api/interface/DeviceSession.d.ts +7 -7
- package/dist/api/interface/DeviceSessionBase.d.ts +8 -8
- package/dist/api/interface/DeviceSessionCommon.d.ts +13 -13
- package/dist/api/interface/DeviceSessionStandalone.d.ts +9 -9
- package/dist/bitbar-cloud-api-client.js +1740 -1725
- package/dist/bitbar-cloud-api-client.js.map +1 -1
- package/dist/bitbar-cloud-api-client.min.js +2 -2
- package/dist/bitbar-cloud-api-client.min.js.map +1 -1
- package/dist/finka.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/package.json +11 -11
|
@@ -1,1851 +1,1866 @@
|
|
|
1
|
-
/* @bitbar/cloud-api-client v0.
|
|
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[
|
|
6
|
-
}(this, (function (finka, axios, qs) { 'use strict';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
ALLOWED_HTTP_METHODS["
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
requestConfig.
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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
|
|
389
|
-
constructor(parent) {
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
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
|
|
399
|
-
constructor(parent
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
this.push('
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
return new
|
|
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
|
|
412
|
-
constructor(parent) {
|
|
413
|
-
super(parent);
|
|
414
|
-
this.push('
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
return new APIResource(this).push('
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
return new
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
return new
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
return new APIResource(this).push('
|
|
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
|
|
431
|
-
constructor(parent) {
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
return new APIResource(this).push('
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
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
|
|
453
|
-
constructor(parent, id) {
|
|
454
|
-
if (id == null) {
|
|
455
|
-
throw new Error('Resource ID cannot be null!');
|
|
456
|
-
}
|
|
457
|
-
super(parent);
|
|
458
|
-
this.push('
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
return new APIResource(this).push('
|
|
462
|
-
|
|
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
|
|
468
|
-
constructor(parent, id) {
|
|
469
|
-
if (id == null) {
|
|
470
|
-
throw new Error('Resource ID cannot be null!');
|
|
471
|
-
}
|
|
472
|
-
super(parent);
|
|
473
|
-
this.push('
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
return new
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
return new
|
|
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
|
|
484
|
-
constructor(parent, id) {
|
|
485
|
-
if (id == null) {
|
|
486
|
-
throw new Error('Resource ID cannot be null!');
|
|
487
|
-
}
|
|
488
|
-
super(parent);
|
|
489
|
-
this.push('
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
return new APIList(this).push('
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
|
|
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
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
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
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
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
|
|
541
|
-
constructor(parent
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
this.push('
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
return new APIResource(this).push('
|
|
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
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
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
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
this.push('
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
return new
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
return new
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
return new
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
this
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
return this.
|
|
644
|
-
|
|
645
|
-
|
|
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
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
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
|
|
697
|
-
|
|
698
|
-
return new
|
|
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
|
|
706
|
-
|
|
707
|
-
|
|
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
|
|
712
|
-
constructor(parent, id) {
|
|
713
|
-
if (id == null) {
|
|
714
|
-
throw new Error('Resource ID cannot be null!');
|
|
715
|
-
}
|
|
716
|
-
super(parent);
|
|
717
|
-
this.push('
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
return new
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
return new
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
return new APIList(this).push('
|
|
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
|
|
752
|
-
constructor(parent, id) {
|
|
753
|
-
if (id == null) {
|
|
754
|
-
throw new Error('Resource ID cannot be null!');
|
|
755
|
-
}
|
|
756
|
-
super(parent);
|
|
757
|
-
this.push('
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
return new APIResource(this).push('
|
|
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
|
|
771
|
-
constructor(parent, id) {
|
|
772
|
-
if (id == null) {
|
|
773
|
-
throw new Error('Resource ID cannot be null!');
|
|
774
|
-
}
|
|
775
|
-
super(parent);
|
|
776
|
-
this.push('
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
return new
|
|
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
|
|
784
|
-
constructor(parent, id) {
|
|
785
|
-
if (id == null) {
|
|
786
|
-
throw new Error('Resource ID cannot be null!');
|
|
787
|
-
}
|
|
788
|
-
super(parent);
|
|
789
|
-
this.push('
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
return new
|
|
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
|
|
812
|
-
constructor(parent
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
this.push('additional-users'
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
return new
|
|
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
|
|
825
|
-
constructor(parent) {
|
|
826
|
-
super(parent);
|
|
827
|
-
this.push('
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
return new APIList(this).push('
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
return new
|
|
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
|
|
847
|
-
constructor(parent) {
|
|
848
|
-
super(parent);
|
|
849
|
-
this.push('
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
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
|
|
860
|
-
constructor(parent) {
|
|
861
|
-
super(parent);
|
|
862
|
-
this.push('
|
|
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
|
|
882
|
-
constructor(parent) {
|
|
883
|
-
super(parent);
|
|
884
|
-
this.push('
|
|
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
|
|
889
|
-
constructor(parent) {
|
|
890
|
-
super(parent);
|
|
891
|
-
this.push('
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
return new
|
|
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
|
|
914
|
-
constructor(parent) {
|
|
915
|
-
super(parent);
|
|
916
|
-
this.push('
|
|
917
|
-
}
|
|
918
|
-
|
|
919
|
-
return new
|
|
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
|
|
924
|
-
constructor(parent) {
|
|
925
|
-
super(parent);
|
|
926
|
-
this.push('
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
return
|
|
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
|
|
937
|
-
constructor(parent) {
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
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
|
|
947
|
-
constructor(parent, id) {
|
|
948
|
-
if (id == null) {
|
|
949
|
-
throw new Error('Resource ID cannot be null!');
|
|
950
|
-
}
|
|
951
|
-
super(parent);
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
throw new
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
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
|
|
975
|
-
constructor(parent, id) {
|
|
976
|
-
if (id == null) {
|
|
977
|
-
throw new Error('Resource ID cannot be null!');
|
|
978
|
-
}
|
|
979
|
-
super(parent);
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
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
|
|
1101
|
-
constructor(parent
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
this.push('
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
return new
|
|
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
|
|
1114
|
-
constructor(parent) {
|
|
1115
|
-
super(parent);
|
|
1116
|
-
this.push('
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
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
|
|
1133
|
-
constructor(parent) {
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
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
|
|
1145
|
-
constructor(parent
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
this.push('
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
|
-
return new APIList(this).push('
|
|
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
|
|
1158
|
-
constructor(parent) {
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
}
|
|
1165
|
-
|
|
1166
|
-
return new
|
|
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
|
|
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', '
|
|
1177
|
-
}
|
|
1178
|
-
|
|
1179
|
-
return new
|
|
1180
|
-
}
|
|
1181
|
-
|
|
1182
|
-
return new APIResource(this).push('
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
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
|
|
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', '
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
|
-
return new
|
|
1214
|
-
}
|
|
1215
|
-
|
|
1216
|
-
return new APIResource(this).push('
|
|
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
|
|
1230
|
-
constructor(parent
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
this.push('
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
return new APIResource(this).push('
|
|
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
|
|
1246
|
-
constructor(parent) {
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
return new APIResource(this).push('
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
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
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
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
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
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
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
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
|
|
1323
|
-
constructor(parent) {
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
}
|
|
1330
|
-
|
|
1331
|
-
return new
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
return new
|
|
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
|
|
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', '
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
return new APIResource(this).push('
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
return new
|
|
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
|
|
1358
|
-
constructor(parent
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
this.push('
|
|
1364
|
-
}
|
|
1365
|
-
|
|
1366
|
-
return new
|
|
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
|
|
1380
|
-
constructor(parent) {
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
}
|
|
1387
|
-
|
|
1388
|
-
return new APIList(this).push('
|
|
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
|
|
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', '
|
|
1399
|
-
}
|
|
1400
|
-
|
|
1401
|
-
return new
|
|
1402
|
-
}
|
|
1403
|
-
|
|
1404
|
-
return new APIResource(this).push('
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
return new
|
|
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
|
|
1412
|
-
constructor(parent
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
}
|
|
1419
|
-
|
|
1420
|
-
return new
|
|
1421
|
-
}
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
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
|
|
1431
|
-
constructor(parent) {
|
|
1432
|
-
super(parent);
|
|
1433
|
-
this.push('admin', '
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
return new
|
|
1437
|
-
}
|
|
1438
|
-
|
|
1439
|
-
return new APIList(this).push('
|
|
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
|
|
1481
|
-
constructor(parent) {
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
}
|
|
1488
|
-
|
|
1489
|
-
return new APIList(this).push('
|
|
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
|
|
1494
|
-
constructor(parent
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
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
|
|
1507
|
-
constructor(parent) {
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
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
|
|
1735
|
-
constructor(parent
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
this.push('
|
|
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
|
-
|
|
1752
|
-
}
|
|
1753
|
-
|
|
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 =
|
|
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
|