@blues-inc/notehub-js 1.0.23 → 1.0.24-beta.2
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/README.md +199 -178
- package/dist/ApiClient.js +156 -156
- package/dist/api/AlertApi.js +23 -23
- package/dist/api/AuthorizationApi.js +17 -17
- package/dist/api/BillingAccountApi.js +15 -15
- package/dist/api/DeviceApi.js +352 -352
- package/dist/api/EventApi.js +134 -124
- package/dist/api/MonitorApi.js +53 -53
- package/dist/api/ProjectApi.js +599 -330
- package/dist/api/RouteApi.js +103 -103
- package/dist/index.js +102 -39
- package/dist/model/Alert.js +108 -62
- package/dist/model/AlertDataInner.js +36 -36
- package/dist/model/AlertNotificationsInner.js +19 -19
- package/dist/model/Aws.js +66 -66
- package/dist/model/Azure.js +44 -44
- package/dist/model/BillingAccount.js +22 -22
- package/dist/model/BillingAccountRole.js +10 -10
- package/dist/model/Body.js +6 -6
- package/dist/model/CloneProjectRequest.js +21 -21
- package/dist/model/Contact.js +23 -23
- package/dist/model/CreateFleetRequest.js +8 -8
- package/dist/model/CreateMonitor.js +127 -126
- package/dist/model/CreateProductRequest.js +23 -23
- package/dist/model/CreateProjectRequest.js +17 -17
- package/dist/model/{OTAUpdateStatus.js → CurrentFirmware.js} +34 -47
- package/dist/model/DFUEnv.js +13 -13
- package/dist/model/DFUState.js +66 -66
- package/dist/model/DeleteDeviceFleetsRequest.js +9 -9
- package/dist/model/Device.js +85 -85
- package/dist/model/DeviceDfuHistory.js +139 -0
- package/dist/model/DeviceDfuHistoryPage.js +121 -0
- package/dist/model/DeviceDfuStateMachine.js +152 -0
- package/dist/model/DeviceDfuStateMachineNode.js +132 -0
- package/dist/model/DeviceDfuStatus.js +129 -0
- package/dist/model/DeviceDfuStatusCurrent.js +158 -0
- package/dist/model/{OTAStatusList.js → DeviceDfuStatusPage.js} +34 -33
- package/dist/model/DeviceSession.js +183 -183
- package/dist/model/DeviceTowerInfo.js +15 -15
- package/dist/model/DeviceUsage.js +33 -33
- package/dist/model/DfuActionRequest.js +92 -0
- package/dist/model/EmailNotification.js +8 -8
- package/dist/model/EnvironmentVariables.js +9 -9
- package/dist/model/Error.js +32 -32
- package/dist/model/Event.js +224 -224
- package/dist/model/Firmware.js +195 -0
- package/dist/model/FirmwareInfo.js +61 -61
- package/dist/model/Fleet.js +22 -22
- package/dist/model/GetAlerts200Response.js +16 -15
- package/dist/model/GetBillingAccounts200Response.js +11 -10
- package/dist/model/GetDeviceEnvironmentVariables200Response.js +13 -13
- package/dist/model/GetDeviceHealthLog200Response.js +13 -12
- package/dist/model/GetDeviceHealthLog200ResponseHealthLogInner.js +20 -20
- package/dist/model/GetDeviceLatest200Response.js +11 -10
- package/dist/model/GetDevicePublicKey200Response.js +17 -17
- package/dist/model/GetDeviceSessions200Response.js +18 -17
- package/dist/model/GetProjectDevicePublicKeys200Response.js +18 -17
- package/dist/model/GetProjectDevicePublicKeys200ResponseDevicePublicKeysInner.js +13 -13
- package/dist/model/GetProjectDevices200Response.js +18 -17
- package/dist/model/GetProjectEvents200Response.js +22 -21
- package/dist/model/GetProjectEventsByCursor200Response.js +25 -24
- package/dist/model/GetProjectFleets200Response.js +13 -12
- package/dist/model/GetProjectMembers200Response.js +13 -12
- package/dist/model/GetProjectProducts200Response.js +11 -10
- package/dist/model/GetProjects200Response.js +11 -10
- package/dist/model/GetRouteLogsByRoute200ResponseInner.js +36 -36
- package/dist/model/Google.js +34 -34
- package/dist/model/HandleNoteChanges200Response.js +12 -12
- package/dist/model/HandleNoteGet200Response.js +14 -14
- package/dist/model/HandleNoteSignal200Response.js +6 -6
- package/dist/model/HandleNotefileChanges200Response.js +12 -12
- package/dist/model/HandleNotefileChangesPending200Response.js +15 -15
- package/dist/model/HandleNotefileDeleteRequest.js +8 -8
- package/dist/model/Http.js +36 -36
- package/dist/model/HttpFilter.js +20 -20
- package/dist/model/HttpTransform.js +21 -21
- package/dist/model/Location.js +41 -41
- package/dist/model/Login200Response.js +8 -8
- package/dist/model/LoginRequest.js +13 -13
- package/dist/model/Monitor.js +101 -100
- package/dist/model/MonitorAlertRoutesInner.js +10 -11
- package/dist/model/Mqtt.js +67 -67
- package/dist/model/Note.js +11 -11
- package/dist/model/{Route.js → NotehubRoute.js} +56 -56
- package/dist/model/{RouteSchema.js → NotehubRouteSchema.js} +70 -71
- package/dist/model/PostProvisionProjectDeviceRequest.js +14 -14
- package/dist/model/Product.js +27 -27
- package/dist/model/Project.js +35 -35
- package/dist/model/ProjectMember.js +23 -23
- package/dist/model/Proxy.js +25 -25
- package/dist/model/PutDeviceFleetsRequest.js +9 -9
- package/dist/model/Radresponder.js +26 -26
- package/dist/model/Role.js +10 -10
- package/dist/model/Slack.js +54 -54
- package/dist/model/SlackBearerNotification.js +26 -26
- package/dist/model/SlackWebHookNotification.js +21 -21
- package/dist/model/Snowflake.js +46 -46
- package/dist/model/SnowflakeTransform.js +13 -13
- package/dist/model/Thingworx.js +34 -34
- package/dist/model/TowerLocation.js +53 -53
- package/dist/model/Twilio.js +44 -44
- package/dist/model/UpdateFleetRequest.js +18 -18
- package/dist/model/UploadMetadata.js +221 -0
- package/dist/model/UserDbRoute.js +26 -26
- package/dist/model/UserDfuStateMachine.js +127 -0
- package/dist/model/UserDfuStateMachineStatus.js +123 -0
- package/dist/model/UserFirmwareInfo.js +107 -0
- package/package.json +3 -3
- package/dist/model/FirmwareStatus.js +0 -144
- package/dist/model/OTAStatus.js +0 -306
- package/dist/model/OTAUpdateRequest.js +0 -214
package/dist/model/Device.js
CHANGED
|
@@ -20,9 +20,9 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
|
|
|
20
20
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
21
21
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
22
22
|
* Notehub API
|
|
23
|
-
* The OpenAPI definition for the Notehub.io API.
|
|
23
|
+
* The OpenAPI definition for the Notehub.io API.
|
|
24
24
|
*
|
|
25
|
-
* The version of the OpenAPI document: 1.
|
|
25
|
+
* The version of the OpenAPI document: 1.2.0
|
|
26
26
|
* Contact: engineering@blues.io
|
|
27
27
|
*
|
|
28
28
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -33,18 +33,18 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
33
33
|
/**
|
|
34
34
|
* The Device model module.
|
|
35
35
|
* @module model/Device
|
|
36
|
-
* @version 1.0.
|
|
36
|
+
* @version 1.0.24-beta.2
|
|
37
37
|
*/
|
|
38
38
|
var Device = /*#__PURE__*/function () {
|
|
39
39
|
/**
|
|
40
40
|
* Constructs a new <code>Device</code>.
|
|
41
41
|
* @alias module:model/Device
|
|
42
|
-
* @param uid {String}
|
|
43
|
-
* @param provisioned {Date}
|
|
44
|
-
* @param productUid {String}
|
|
45
|
-
* @param fleetUids {Array.<String>}
|
|
46
|
-
* @param voltage {Number}
|
|
47
|
-
* @param temperature {Number}
|
|
42
|
+
* @param uid {String}
|
|
43
|
+
* @param provisioned {Date}
|
|
44
|
+
* @param productUid {String}
|
|
45
|
+
* @param fleetUids {Array.<String>}
|
|
46
|
+
* @param voltage {Number}
|
|
47
|
+
* @param temperature {Number}
|
|
48
48
|
*/
|
|
49
49
|
function Device(uid, provisioned, productUid, fleetUids, voltage, temperature) {
|
|
50
50
|
_classCallCheck(this, Device);
|
|
@@ -59,12 +59,12 @@ var Device = /*#__PURE__*/function () {
|
|
|
59
59
|
return _createClass(Device, null, [{
|
|
60
60
|
key: "initialize",
|
|
61
61
|
value: function initialize(obj, uid, provisioned, productUid, fleetUids, voltage, temperature) {
|
|
62
|
-
obj[
|
|
63
|
-
obj[
|
|
64
|
-
obj[
|
|
65
|
-
obj[
|
|
66
|
-
obj[
|
|
67
|
-
obj[
|
|
62
|
+
obj['uid'] = uid;
|
|
63
|
+
obj['provisioned'] = provisioned;
|
|
64
|
+
obj['product_uid'] = productUid;
|
|
65
|
+
obj['fleet_uids'] = fleetUids;
|
|
66
|
+
obj['voltage'] = voltage;
|
|
67
|
+
obj['temperature'] = temperature;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
/**
|
|
@@ -79,53 +79,53 @@ var Device = /*#__PURE__*/function () {
|
|
|
79
79
|
value: function constructFromObject(data, obj) {
|
|
80
80
|
if (data) {
|
|
81
81
|
obj = obj || new Device();
|
|
82
|
-
if (data.hasOwnProperty(
|
|
83
|
-
obj[
|
|
82
|
+
if (data.hasOwnProperty('uid')) {
|
|
83
|
+
obj['uid'] = _ApiClient["default"].convertToType(data['uid'], 'String');
|
|
84
84
|
}
|
|
85
|
-
if (data.hasOwnProperty(
|
|
86
|
-
obj[
|
|
85
|
+
if (data.hasOwnProperty('serial_number')) {
|
|
86
|
+
obj['serial_number'] = _ApiClient["default"].convertToType(data['serial_number'], 'String');
|
|
87
87
|
}
|
|
88
|
-
if (data.hasOwnProperty(
|
|
89
|
-
obj[
|
|
88
|
+
if (data.hasOwnProperty('provisioned')) {
|
|
89
|
+
obj['provisioned'] = _ApiClient["default"].convertToType(data['provisioned'], 'Date');
|
|
90
90
|
}
|
|
91
|
-
if (data.hasOwnProperty(
|
|
92
|
-
obj[
|
|
91
|
+
if (data.hasOwnProperty('last_activity')) {
|
|
92
|
+
obj['last_activity'] = _ApiClient["default"].convertToType(data['last_activity'], 'Date');
|
|
93
93
|
}
|
|
94
|
-
if (data.hasOwnProperty(
|
|
95
|
-
obj[
|
|
94
|
+
if (data.hasOwnProperty('contact')) {
|
|
95
|
+
obj['contact'] = _Contact["default"].constructFromObject(data['contact']);
|
|
96
96
|
}
|
|
97
|
-
if (data.hasOwnProperty(
|
|
98
|
-
obj[
|
|
97
|
+
if (data.hasOwnProperty('product_uid')) {
|
|
98
|
+
obj['product_uid'] = _ApiClient["default"].convertToType(data['product_uid'], 'String');
|
|
99
99
|
}
|
|
100
|
-
if (data.hasOwnProperty(
|
|
101
|
-
obj[
|
|
100
|
+
if (data.hasOwnProperty('fleet_uids')) {
|
|
101
|
+
obj['fleet_uids'] = _ApiClient["default"].convertToType(data['fleet_uids'], ['String']);
|
|
102
102
|
}
|
|
103
|
-
if (data.hasOwnProperty(
|
|
104
|
-
obj[
|
|
103
|
+
if (data.hasOwnProperty('tower_info')) {
|
|
104
|
+
obj['tower_info'] = _DeviceTowerInfo["default"].constructFromObject(data['tower_info']);
|
|
105
105
|
}
|
|
106
|
-
if (data.hasOwnProperty(
|
|
107
|
-
obj[
|
|
106
|
+
if (data.hasOwnProperty('tower_location')) {
|
|
107
|
+
obj['tower_location'] = _Location["default"].constructFromObject(data['tower_location']);
|
|
108
108
|
}
|
|
109
|
-
if (data.hasOwnProperty(
|
|
110
|
-
obj[
|
|
109
|
+
if (data.hasOwnProperty('gps_location')) {
|
|
110
|
+
obj['gps_location'] = _Location["default"].constructFromObject(data['gps_location']);
|
|
111
111
|
}
|
|
112
|
-
if (data.hasOwnProperty(
|
|
113
|
-
obj[
|
|
112
|
+
if (data.hasOwnProperty('triangulated_location')) {
|
|
113
|
+
obj['triangulated_location'] = _Location["default"].constructFromObject(data['triangulated_location']);
|
|
114
114
|
}
|
|
115
|
-
if (data.hasOwnProperty(
|
|
116
|
-
obj[
|
|
115
|
+
if (data.hasOwnProperty('voltage')) {
|
|
116
|
+
obj['voltage'] = _ApiClient["default"].convertToType(data['voltage'], 'Number');
|
|
117
117
|
}
|
|
118
|
-
if (data.hasOwnProperty(
|
|
119
|
-
obj[
|
|
118
|
+
if (data.hasOwnProperty('temperature')) {
|
|
119
|
+
obj['temperature'] = _ApiClient["default"].convertToType(data['temperature'], 'Number');
|
|
120
120
|
}
|
|
121
|
-
if (data.hasOwnProperty(
|
|
122
|
-
obj[
|
|
121
|
+
if (data.hasOwnProperty('dfu')) {
|
|
122
|
+
obj['dfu'] = _DFUEnv["default"].constructFromObject(data['dfu']);
|
|
123
123
|
}
|
|
124
|
-
if (data.hasOwnProperty(
|
|
125
|
-
obj[
|
|
124
|
+
if (data.hasOwnProperty('sku')) {
|
|
125
|
+
obj['sku'] = _ApiClient["default"].convertToType(data['sku'], 'String');
|
|
126
126
|
}
|
|
127
|
-
if (data.hasOwnProperty(
|
|
128
|
-
obj[
|
|
127
|
+
if (data.hasOwnProperty('disabled')) {
|
|
128
|
+
obj['disabled'] = _ApiClient["default"].convertToType(data['disabled'], 'Boolean');
|
|
129
129
|
}
|
|
130
130
|
} else if (data === null) {
|
|
131
131
|
return null;
|
|
@@ -157,54 +157,54 @@ var Device = /*#__PURE__*/function () {
|
|
|
157
157
|
} finally {
|
|
158
158
|
_iterator.f();
|
|
159
159
|
}
|
|
160
|
-
if (data[
|
|
161
|
-
throw new Error("Expected the field `uid` to be a primitive type in the JSON string but got " + data[
|
|
160
|
+
if (data['uid'] && !(typeof data['uid'] === 'string' || data['uid'] instanceof String)) {
|
|
161
|
+
throw new Error("Expected the field `uid` to be a primitive type in the JSON string but got " + data['uid']);
|
|
162
162
|
}
|
|
163
163
|
// ensure the json data is a string
|
|
164
|
-
if (data[
|
|
165
|
-
throw new Error("Expected the field `serial_number` to be a primitive type in the JSON string but got " + data[
|
|
164
|
+
if (data['serial_number'] && !(typeof data['serial_number'] === 'string' || data['serial_number'] instanceof String)) {
|
|
165
|
+
throw new Error("Expected the field `serial_number` to be a primitive type in the JSON string but got " + data['serial_number']);
|
|
166
166
|
}
|
|
167
167
|
// validate the optional field `contact`
|
|
168
|
-
if (data[
|
|
168
|
+
if (data['contact']) {
|
|
169
169
|
// data not null
|
|
170
|
-
_Contact["default"].validateJSON(data[
|
|
170
|
+
_Contact["default"].validateJSON(data['contact']);
|
|
171
171
|
}
|
|
172
172
|
// ensure the json data is a string
|
|
173
|
-
if (data[
|
|
174
|
-
throw new Error("Expected the field `product_uid` to be a primitive type in the JSON string but got " + data[
|
|
173
|
+
if (data['product_uid'] && !(typeof data['product_uid'] === 'string' || data['product_uid'] instanceof String)) {
|
|
174
|
+
throw new Error("Expected the field `product_uid` to be a primitive type in the JSON string but got " + data['product_uid']);
|
|
175
175
|
}
|
|
176
176
|
// ensure the json data is an array
|
|
177
|
-
if (!Array.isArray(data[
|
|
178
|
-
throw new Error("Expected the field `fleet_uids` to be an array in the JSON data but got " + data[
|
|
177
|
+
if (!Array.isArray(data['fleet_uids'])) {
|
|
178
|
+
throw new Error("Expected the field `fleet_uids` to be an array in the JSON data but got " + data['fleet_uids']);
|
|
179
179
|
}
|
|
180
180
|
// validate the optional field `tower_info`
|
|
181
|
-
if (data[
|
|
181
|
+
if (data['tower_info']) {
|
|
182
182
|
// data not null
|
|
183
|
-
_DeviceTowerInfo["default"].validateJSON(data[
|
|
183
|
+
_DeviceTowerInfo["default"].validateJSON(data['tower_info']);
|
|
184
184
|
}
|
|
185
185
|
// validate the optional field `tower_location`
|
|
186
|
-
if (data[
|
|
186
|
+
if (data['tower_location']) {
|
|
187
187
|
// data not null
|
|
188
|
-
_Location["default"].validateJSON(data[
|
|
188
|
+
_Location["default"].validateJSON(data['tower_location']);
|
|
189
189
|
}
|
|
190
190
|
// validate the optional field `gps_location`
|
|
191
|
-
if (data[
|
|
191
|
+
if (data['gps_location']) {
|
|
192
192
|
// data not null
|
|
193
|
-
_Location["default"].validateJSON(data[
|
|
193
|
+
_Location["default"].validateJSON(data['gps_location']);
|
|
194
194
|
}
|
|
195
195
|
// validate the optional field `triangulated_location`
|
|
196
|
-
if (data[
|
|
196
|
+
if (data['triangulated_location']) {
|
|
197
197
|
// data not null
|
|
198
|
-
_Location["default"].validateJSON(data[
|
|
198
|
+
_Location["default"].validateJSON(data['triangulated_location']);
|
|
199
199
|
}
|
|
200
200
|
// validate the optional field `dfu`
|
|
201
|
-
if (data[
|
|
201
|
+
if (data['dfu']) {
|
|
202
202
|
// data not null
|
|
203
|
-
_DFUEnv["default"].validateJSON(data[
|
|
203
|
+
_DFUEnv["default"].validateJSON(data['dfu']);
|
|
204
204
|
}
|
|
205
205
|
// ensure the json data is a string
|
|
206
|
-
if (data[
|
|
207
|
-
throw new Error("Expected the field `sku` to be a primitive type in the JSON string but got " + data[
|
|
206
|
+
if (data['sku'] && !(typeof data['sku'] === 'string' || data['sku'] instanceof String)) {
|
|
207
|
+
throw new Error("Expected the field `sku` to be a primitive type in the JSON string but got " + data['sku']);
|
|
208
208
|
}
|
|
209
209
|
return true;
|
|
210
210
|
}
|
|
@@ -215,80 +215,80 @@ Device.RequiredProperties = ["uid", "provisioned", "product_uid", "fleet_uids",
|
|
|
215
215
|
/**
|
|
216
216
|
* @member {String} uid
|
|
217
217
|
*/
|
|
218
|
-
Device.prototype[
|
|
218
|
+
Device.prototype['uid'] = undefined;
|
|
219
219
|
|
|
220
220
|
/**
|
|
221
221
|
* @member {String} serial_number
|
|
222
222
|
*/
|
|
223
|
-
Device.prototype[
|
|
223
|
+
Device.prototype['serial_number'] = undefined;
|
|
224
224
|
|
|
225
225
|
/**
|
|
226
226
|
* @member {Date} provisioned
|
|
227
227
|
*/
|
|
228
|
-
Device.prototype[
|
|
228
|
+
Device.prototype['provisioned'] = undefined;
|
|
229
229
|
|
|
230
230
|
/**
|
|
231
231
|
* @member {Date} last_activity
|
|
232
232
|
*/
|
|
233
|
-
Device.prototype[
|
|
233
|
+
Device.prototype['last_activity'] = undefined;
|
|
234
234
|
|
|
235
235
|
/**
|
|
236
236
|
* @member {module:model/Contact} contact
|
|
237
237
|
*/
|
|
238
|
-
Device.prototype[
|
|
238
|
+
Device.prototype['contact'] = undefined;
|
|
239
239
|
|
|
240
240
|
/**
|
|
241
241
|
* @member {String} product_uid
|
|
242
242
|
*/
|
|
243
|
-
Device.prototype[
|
|
243
|
+
Device.prototype['product_uid'] = undefined;
|
|
244
244
|
|
|
245
245
|
/**
|
|
246
246
|
* @member {Array.<String>} fleet_uids
|
|
247
247
|
*/
|
|
248
|
-
Device.prototype[
|
|
248
|
+
Device.prototype['fleet_uids'] = undefined;
|
|
249
249
|
|
|
250
250
|
/**
|
|
251
251
|
* @member {module:model/DeviceTowerInfo} tower_info
|
|
252
252
|
*/
|
|
253
|
-
Device.prototype[
|
|
253
|
+
Device.prototype['tower_info'] = undefined;
|
|
254
254
|
|
|
255
255
|
/**
|
|
256
256
|
* @member {module:model/Location} tower_location
|
|
257
257
|
*/
|
|
258
|
-
Device.prototype[
|
|
258
|
+
Device.prototype['tower_location'] = undefined;
|
|
259
259
|
|
|
260
260
|
/**
|
|
261
261
|
* @member {module:model/Location} gps_location
|
|
262
262
|
*/
|
|
263
|
-
Device.prototype[
|
|
263
|
+
Device.prototype['gps_location'] = undefined;
|
|
264
264
|
|
|
265
265
|
/**
|
|
266
266
|
* @member {module:model/Location} triangulated_location
|
|
267
267
|
*/
|
|
268
|
-
Device.prototype[
|
|
268
|
+
Device.prototype['triangulated_location'] = undefined;
|
|
269
269
|
|
|
270
270
|
/**
|
|
271
271
|
* @member {Number} voltage
|
|
272
272
|
*/
|
|
273
|
-
Device.prototype[
|
|
273
|
+
Device.prototype['voltage'] = undefined;
|
|
274
274
|
|
|
275
275
|
/**
|
|
276
276
|
* @member {Number} temperature
|
|
277
277
|
*/
|
|
278
|
-
Device.prototype[
|
|
278
|
+
Device.prototype['temperature'] = undefined;
|
|
279
279
|
|
|
280
280
|
/**
|
|
281
281
|
* @member {module:model/DFUEnv} dfu
|
|
282
282
|
*/
|
|
283
|
-
Device.prototype[
|
|
283
|
+
Device.prototype['dfu'] = undefined;
|
|
284
284
|
|
|
285
285
|
/**
|
|
286
286
|
* @member {String} sku
|
|
287
287
|
*/
|
|
288
|
-
Device.prototype[
|
|
288
|
+
Device.prototype['sku'] = undefined;
|
|
289
289
|
|
|
290
290
|
/**
|
|
291
291
|
* @member {Boolean} disabled
|
|
292
292
|
*/
|
|
293
|
-
Device.prototype[
|
|
293
|
+
Device.prototype['disabled'] = undefined;
|
|
294
294
|
var _default = exports["default"] = Device;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
var _DeviceDfuStateMachine = _interopRequireDefault(require("./DeviceDfuStateMachine"));
|
|
9
|
+
var _DeviceDfuStatusCurrent = _interopRequireDefault(require("./DeviceDfuStatusCurrent"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
12
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
13
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
14
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
16
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
17
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
20
|
+
* Notehub API
|
|
21
|
+
* The OpenAPI definition for the Notehub.io API.
|
|
22
|
+
*
|
|
23
|
+
* The version of the OpenAPI document: 1.2.0
|
|
24
|
+
* Contact: engineering@blues.io
|
|
25
|
+
*
|
|
26
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
27
|
+
* https://openapi-generator.tech
|
|
28
|
+
* Do not edit the class manually.
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* The DeviceDfuHistory model module.
|
|
33
|
+
* @module model/DeviceDfuHistory
|
|
34
|
+
* @version 1.0.24-beta.2
|
|
35
|
+
*/
|
|
36
|
+
var DeviceDfuHistory = /*#__PURE__*/function () {
|
|
37
|
+
/**
|
|
38
|
+
* Constructs a new <code>DeviceDfuHistory</code>.
|
|
39
|
+
* @alias module:model/DeviceDfuHistory
|
|
40
|
+
*/
|
|
41
|
+
function DeviceDfuHistory() {
|
|
42
|
+
_classCallCheck(this, DeviceDfuHistory);
|
|
43
|
+
DeviceDfuHistory.initialize(this);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Initializes the fields of this object.
|
|
48
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
49
|
+
* Only for internal use.
|
|
50
|
+
*/
|
|
51
|
+
return _createClass(DeviceDfuHistory, null, [{
|
|
52
|
+
key: "initialize",
|
|
53
|
+
value: function initialize(obj) {}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Constructs a <code>DeviceDfuHistory</code> from a plain JavaScript object, optionally creating a new instance.
|
|
57
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
58
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
59
|
+
* @param {module:model/DeviceDfuHistory} obj Optional instance to populate.
|
|
60
|
+
* @return {module:model/DeviceDfuHistory} The populated <code>DeviceDfuHistory</code> instance.
|
|
61
|
+
*/
|
|
62
|
+
}, {
|
|
63
|
+
key: "constructFromObject",
|
|
64
|
+
value: function constructFromObject(data, obj) {
|
|
65
|
+
if (data) {
|
|
66
|
+
obj = obj || new DeviceDfuHistory();
|
|
67
|
+
if (data.hasOwnProperty('device_uid')) {
|
|
68
|
+
obj['device_uid'] = _ApiClient["default"].convertToType(data['device_uid'], 'String');
|
|
69
|
+
}
|
|
70
|
+
if (data.hasOwnProperty('current')) {
|
|
71
|
+
obj['current'] = _DeviceDfuStatusCurrent["default"].constructFromObject(data['current']);
|
|
72
|
+
}
|
|
73
|
+
if (data.hasOwnProperty('history')) {
|
|
74
|
+
obj['history'] = _ApiClient["default"].convertToType(data['history'], [_DeviceDfuStateMachine["default"]]);
|
|
75
|
+
}
|
|
76
|
+
} else if (data === null) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
return obj;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Validates the JSON data with respect to <code>DeviceDfuHistory</code>.
|
|
84
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
85
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>DeviceDfuHistory</code>.
|
|
86
|
+
*/
|
|
87
|
+
}, {
|
|
88
|
+
key: "validateJSON",
|
|
89
|
+
value: function validateJSON(data) {
|
|
90
|
+
// ensure the json data is a string
|
|
91
|
+
if (data['device_uid'] && !(typeof data['device_uid'] === 'string' || data['device_uid'] instanceof String)) {
|
|
92
|
+
throw new Error("Expected the field `device_uid` to be a primitive type in the JSON string but got " + data['device_uid']);
|
|
93
|
+
}
|
|
94
|
+
// validate the optional field `current`
|
|
95
|
+
if (data['current']) {
|
|
96
|
+
// data not null
|
|
97
|
+
_DeviceDfuStatusCurrent["default"].validateJSON(data['current']);
|
|
98
|
+
}
|
|
99
|
+
if (data['history']) {
|
|
100
|
+
// data not null
|
|
101
|
+
// ensure the json data is an array
|
|
102
|
+
if (!Array.isArray(data['history'])) {
|
|
103
|
+
throw new Error("Expected the field `history` to be an array in the JSON data but got " + data['history']);
|
|
104
|
+
}
|
|
105
|
+
// validate the optional field `history` (array)
|
|
106
|
+
var _iterator = _createForOfIteratorHelper(data['history']),
|
|
107
|
+
_step;
|
|
108
|
+
try {
|
|
109
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
110
|
+
var item = _step.value;
|
|
111
|
+
_DeviceDfuStateMachine["default"].validateJsonObject(item);
|
|
112
|
+
}
|
|
113
|
+
} catch (err) {
|
|
114
|
+
_iterator.e(err);
|
|
115
|
+
} finally {
|
|
116
|
+
_iterator.f();
|
|
117
|
+
}
|
|
118
|
+
;
|
|
119
|
+
}
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
}]);
|
|
123
|
+
}();
|
|
124
|
+
/**
|
|
125
|
+
* Device UID
|
|
126
|
+
* @member {String} device_uid
|
|
127
|
+
*/
|
|
128
|
+
DeviceDfuHistory.prototype['device_uid'] = undefined;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* @member {module:model/DeviceDfuStatusCurrent} current
|
|
132
|
+
*/
|
|
133
|
+
DeviceDfuHistory.prototype['current'] = undefined;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @member {Array.<module:model/DeviceDfuStateMachine>} history
|
|
137
|
+
*/
|
|
138
|
+
DeviceDfuHistory.prototype['history'] = undefined;
|
|
139
|
+
var _default = exports["default"] = DeviceDfuHistory;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
var _DeviceDfuHistory = _interopRequireDefault(require("./DeviceDfuHistory"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
11
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
12
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
13
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
14
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
15
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
16
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
19
|
+
* Notehub API
|
|
20
|
+
* The OpenAPI definition for the Notehub.io API.
|
|
21
|
+
*
|
|
22
|
+
* The version of the OpenAPI document: 1.2.0
|
|
23
|
+
* Contact: engineering@blues.io
|
|
24
|
+
*
|
|
25
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
26
|
+
* https://openapi-generator.tech
|
|
27
|
+
* Do not edit the class manually.
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* The DeviceDfuHistoryPage model module.
|
|
32
|
+
* @module model/DeviceDfuHistoryPage
|
|
33
|
+
* @version 1.0.24-beta.2
|
|
34
|
+
*/
|
|
35
|
+
var DeviceDfuHistoryPage = /*#__PURE__*/function () {
|
|
36
|
+
/**
|
|
37
|
+
* Constructs a new <code>DeviceDfuHistoryPage</code>.
|
|
38
|
+
* @alias module:model/DeviceDfuHistoryPage
|
|
39
|
+
*/
|
|
40
|
+
function DeviceDfuHistoryPage() {
|
|
41
|
+
_classCallCheck(this, DeviceDfuHistoryPage);
|
|
42
|
+
DeviceDfuHistoryPage.initialize(this);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Initializes the fields of this object.
|
|
47
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
48
|
+
* Only for internal use.
|
|
49
|
+
*/
|
|
50
|
+
return _createClass(DeviceDfuHistoryPage, null, [{
|
|
51
|
+
key: "initialize",
|
|
52
|
+
value: function initialize(obj) {}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Constructs a <code>DeviceDfuHistoryPage</code> from a plain JavaScript object, optionally creating a new instance.
|
|
56
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
57
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
58
|
+
* @param {module:model/DeviceDfuHistoryPage} obj Optional instance to populate.
|
|
59
|
+
* @return {module:model/DeviceDfuHistoryPage} The populated <code>DeviceDfuHistoryPage</code> instance.
|
|
60
|
+
*/
|
|
61
|
+
}, {
|
|
62
|
+
key: "constructFromObject",
|
|
63
|
+
value: function constructFromObject(data, obj) {
|
|
64
|
+
if (data) {
|
|
65
|
+
obj = obj || new DeviceDfuHistoryPage();
|
|
66
|
+
if (data.hasOwnProperty('devices')) {
|
|
67
|
+
obj['devices'] = _ApiClient["default"].convertToType(data['devices'], [_DeviceDfuHistory["default"]]);
|
|
68
|
+
}
|
|
69
|
+
if (data.hasOwnProperty('has_more')) {
|
|
70
|
+
obj['has_more'] = _ApiClient["default"].convertToType(data['has_more'], 'Boolean');
|
|
71
|
+
}
|
|
72
|
+
} else if (data === null) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
return obj;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Validates the JSON data with respect to <code>DeviceDfuHistoryPage</code>.
|
|
80
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
81
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>DeviceDfuHistoryPage</code>.
|
|
82
|
+
*/
|
|
83
|
+
}, {
|
|
84
|
+
key: "validateJSON",
|
|
85
|
+
value: function validateJSON(data) {
|
|
86
|
+
if (data['devices']) {
|
|
87
|
+
// data not null
|
|
88
|
+
// ensure the json data is an array
|
|
89
|
+
if (!Array.isArray(data['devices'])) {
|
|
90
|
+
throw new Error("Expected the field `devices` to be an array in the JSON data but got " + data['devices']);
|
|
91
|
+
}
|
|
92
|
+
// validate the optional field `devices` (array)
|
|
93
|
+
var _iterator = _createForOfIteratorHelper(data['devices']),
|
|
94
|
+
_step;
|
|
95
|
+
try {
|
|
96
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
97
|
+
var item = _step.value;
|
|
98
|
+
_DeviceDfuHistory["default"].validateJsonObject(item);
|
|
99
|
+
}
|
|
100
|
+
} catch (err) {
|
|
101
|
+
_iterator.e(err);
|
|
102
|
+
} finally {
|
|
103
|
+
_iterator.f();
|
|
104
|
+
}
|
|
105
|
+
;
|
|
106
|
+
}
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
}]);
|
|
110
|
+
}();
|
|
111
|
+
/**
|
|
112
|
+
* @member {Array.<module:model/DeviceDfuHistory>} devices
|
|
113
|
+
*/
|
|
114
|
+
DeviceDfuHistoryPage.prototype['devices'] = undefined;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @member {Boolean} has_more
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
120
|
+
DeviceDfuHistoryPage.prototype['has_more'] = false;
|
|
121
|
+
var _default = exports["default"] = DeviceDfuHistoryPage;
|