@blues-inc/notehub-js 1.0.23-beta.5 → 1.0.23-beta.7
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 +17 -9
- package/dist/ApiClient.js +3 -3
- package/dist/api/AlertApi.js +2 -2
- package/dist/api/AuthorizationApi.js +2 -2
- package/dist/api/BillingAccountApi.js +2 -2
- package/dist/api/DeviceApi.js +2 -2
- package/dist/api/EventApi.js +2 -2
- package/dist/api/MonitorApi.js +2 -2
- package/dist/api/ProjectApi.js +233 -108
- package/dist/api/RouteApi.js +2 -2
- package/dist/index.js +82 -33
- package/dist/model/Alert.js +2 -2
- package/dist/model/AlertDataInner.js +2 -2
- package/dist/model/AlertNotificationsInner.js +2 -2
- package/dist/model/Aws.js +2 -2
- package/dist/model/Azure.js +2 -2
- package/dist/model/BillingAccount.js +2 -2
- package/dist/model/BillingAccountRole.js +1 -1
- package/dist/model/Body.js +2 -2
- package/dist/model/CloneProjectRequest.js +2 -2
- package/dist/model/Contact.js +2 -2
- package/dist/model/CreateFleetRequest.js +2 -2
- package/dist/model/CreateMonitor.js +2 -2
- package/dist/model/CreateProductRequest.js +2 -2
- package/dist/model/CreateProjectRequest.js +2 -2
- package/dist/model/CurrentFirmware.js +105 -0
- package/dist/model/DFUEnv.js +2 -2
- package/dist/model/DFUState.js +2 -2
- package/dist/model/DeleteDeviceFleetsRequest.js +2 -2
- package/dist/model/Device.js +2 -2
- package/dist/model/DeviceOtaStateMachine.js +152 -0
- package/dist/model/DeviceOtaStateMachineNode.js +132 -0
- package/dist/model/DeviceOtaStatus.js +139 -0
- package/dist/model/{FirmwareStatus.js → DeviceOtaStatusCurrent.js} +42 -28
- package/dist/model/{OTAStatusList.js → DeviceOtaStatusPage.js} +25 -25
- package/dist/model/DeviceSession.js +2 -2
- package/dist/model/DeviceTowerInfo.js +2 -2
- package/dist/model/DeviceUsage.js +2 -2
- package/dist/model/DfuActionRequest.js +92 -0
- package/dist/model/EmailNotification.js +2 -2
- package/dist/model/EnvironmentVariables.js +2 -2
- package/dist/model/Error.js +2 -2
- package/dist/model/Event.js +2 -2
- package/dist/model/Firmware.js +195 -0
- package/dist/model/FirmwareInfo.js +2 -2
- package/dist/model/Fleet.js +2 -2
- package/dist/model/GetAlerts200Response.js +2 -2
- package/dist/model/GetBillingAccounts200Response.js +2 -2
- package/dist/model/GetDeviceEnvironmentVariables200Response.js +2 -2
- package/dist/model/GetDeviceHealthLog200Response.js +2 -2
- package/dist/model/GetDeviceHealthLog200ResponseHealthLogInner.js +2 -2
- package/dist/model/GetDeviceLatest200Response.js +2 -2
- package/dist/model/GetDevicePublicKey200Response.js +2 -2
- package/dist/model/GetDeviceSessions200Response.js +2 -2
- package/dist/model/GetProjectDevicePublicKeys200Response.js +2 -2
- package/dist/model/GetProjectDevicePublicKeys200ResponseDevicePublicKeysInner.js +2 -2
- package/dist/model/GetProjectDevices200Response.js +2 -2
- package/dist/model/GetProjectEvents200Response.js +2 -2
- package/dist/model/GetProjectEventsByCursor200Response.js +2 -2
- package/dist/model/GetProjectFleets200Response.js +2 -2
- package/dist/model/GetProjectMembers200Response.js +2 -2
- package/dist/model/GetProjectProducts200Response.js +2 -2
- package/dist/model/GetProjects200Response.js +2 -2
- package/dist/model/GetRouteLogsByRoute200ResponseInner.js +2 -2
- package/dist/model/Google.js +2 -2
- package/dist/model/HandleNoteChanges200Response.js +2 -2
- package/dist/model/HandleNoteGet200Response.js +2 -2
- package/dist/model/HandleNoteSignal200Response.js +2 -2
- package/dist/model/HandleNotefileChanges200Response.js +2 -2
- package/dist/model/HandleNotefileChangesPending200Response.js +2 -2
- package/dist/model/HandleNotefileDeleteRequest.js +2 -2
- package/dist/model/Http.js +2 -2
- package/dist/model/HttpFilter.js +2 -2
- package/dist/model/HttpTransform.js +2 -2
- package/dist/model/Location.js +2 -2
- package/dist/model/Login200Response.js +2 -2
- package/dist/model/LoginRequest.js +2 -2
- package/dist/model/Monitor.js +2 -2
- package/dist/model/MonitorAlertRoutesInner.js +2 -2
- package/dist/model/Mqtt.js +2 -2
- package/dist/model/Note.js +2 -2
- package/dist/model/PostProvisionProjectDeviceRequest.js +2 -2
- package/dist/model/Product.js +2 -2
- package/dist/model/Project.js +2 -2
- package/dist/model/ProjectMember.js +2 -2
- package/dist/model/Proxy.js +2 -2
- package/dist/model/PutDeviceFleetsRequest.js +2 -2
- package/dist/model/Radresponder.js +2 -2
- package/dist/model/Role.js +1 -1
- package/dist/model/Route.js +2 -2
- package/dist/model/RouteSchema.js +2 -2
- package/dist/model/Slack.js +2 -2
- package/dist/model/SlackBearerNotification.js +2 -2
- package/dist/model/SlackWebHookNotification.js +2 -2
- package/dist/model/Snowflake.js +2 -2
- package/dist/model/SnowflakeTransform.js +2 -2
- package/dist/model/Thingworx.js +2 -2
- package/dist/model/TowerLocation.js +2 -2
- package/dist/model/Twilio.js +2 -2
- package/dist/model/UpdateFleetRequest.js +2 -2
- package/dist/model/UploadMetadata.js +221 -0
- package/dist/model/UserDbRoute.js +2 -2
- package/dist/model/UserDfuStateMachine.js +127 -0
- package/dist/model/{OTAUpdateStatus.js → UserDfuStateMachineStatus.js} +46 -41
- package/dist/model/UserFirmwareInfo.js +107 -0
- package/package.json +2 -2
- package/dist/model/OTAStatus.js +0 -306
- package/dist/model/OTAUpdateRequest.js +0 -214
|
@@ -0,0 +1,152 @@
|
|
|
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 _DeviceOtaStateMachineNode = _interopRequireDefault(require("./DeviceOtaStateMachineNode"));
|
|
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.1.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 DeviceOtaStateMachine model module.
|
|
32
|
+
* @module model/DeviceOtaStateMachine
|
|
33
|
+
* @version 1.0.23-beta.7
|
|
34
|
+
*/
|
|
35
|
+
var DeviceOtaStateMachine = /*#__PURE__*/function () {
|
|
36
|
+
/**
|
|
37
|
+
* Constructs a new <code>DeviceOtaStateMachine</code>.
|
|
38
|
+
* Represents a single request to update the host or Notecard firmware
|
|
39
|
+
* @alias module:model/DeviceOtaStateMachine
|
|
40
|
+
*/
|
|
41
|
+
function DeviceOtaStateMachine() {
|
|
42
|
+
_classCallCheck(this, DeviceOtaStateMachine);
|
|
43
|
+
DeviceOtaStateMachine.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(DeviceOtaStateMachine, null, [{
|
|
52
|
+
key: "initialize",
|
|
53
|
+
value: function initialize(obj) {}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Constructs a <code>DeviceOtaStateMachine</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/DeviceOtaStateMachine} obj Optional instance to populate.
|
|
60
|
+
* @return {module:model/DeviceOtaStateMachine} The populated <code>DeviceOtaStateMachine</code> instance.
|
|
61
|
+
*/
|
|
62
|
+
}, {
|
|
63
|
+
key: "constructFromObject",
|
|
64
|
+
value: function constructFromObject(data, obj) {
|
|
65
|
+
if (data) {
|
|
66
|
+
obj = obj || new DeviceOtaStateMachine();
|
|
67
|
+
if (data.hasOwnProperty('requested_version')) {
|
|
68
|
+
obj['requested_version'] = _ApiClient["default"].convertToType(data['requested_version'], 'String');
|
|
69
|
+
}
|
|
70
|
+
if (data.hasOwnProperty('current_version')) {
|
|
71
|
+
obj['current_version'] = _ApiClient["default"].convertToType(data['current_version'], 'String');
|
|
72
|
+
}
|
|
73
|
+
if (data.hasOwnProperty('initiated')) {
|
|
74
|
+
obj['initiated'] = _ApiClient["default"].convertToType(data['initiated'], 'String');
|
|
75
|
+
}
|
|
76
|
+
if (data.hasOwnProperty('updates')) {
|
|
77
|
+
obj['updates'] = _ApiClient["default"].convertToType(data['updates'], [_DeviceOtaStateMachineNode["default"]]);
|
|
78
|
+
}
|
|
79
|
+
} else if (data === null) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
return obj;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Validates the JSON data with respect to <code>DeviceOtaStateMachine</code>.
|
|
87
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
88
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>DeviceOtaStateMachine</code>.
|
|
89
|
+
*/
|
|
90
|
+
}, {
|
|
91
|
+
key: "validateJSON",
|
|
92
|
+
value: function validateJSON(data) {
|
|
93
|
+
// ensure the json data is a string
|
|
94
|
+
if (data['requested_version'] && !(typeof data['requested_version'] === 'string' || data['requested_version'] instanceof String)) {
|
|
95
|
+
throw new Error("Expected the field `requested_version` to be a primitive type in the JSON string but got " + data['requested_version']);
|
|
96
|
+
}
|
|
97
|
+
// ensure the json data is a string
|
|
98
|
+
if (data['current_version'] && !(typeof data['current_version'] === 'string' || data['current_version'] instanceof String)) {
|
|
99
|
+
throw new Error("Expected the field `current_version` to be a primitive type in the JSON string but got " + data['current_version']);
|
|
100
|
+
}
|
|
101
|
+
// ensure the json data is a string
|
|
102
|
+
if (data['initiated'] && !(typeof data['initiated'] === 'string' || data['initiated'] instanceof String)) {
|
|
103
|
+
throw new Error("Expected the field `initiated` to be a primitive type in the JSON string but got " + data['initiated']);
|
|
104
|
+
}
|
|
105
|
+
if (data['updates']) {
|
|
106
|
+
// data not null
|
|
107
|
+
// ensure the json data is an array
|
|
108
|
+
if (!Array.isArray(data['updates'])) {
|
|
109
|
+
throw new Error("Expected the field `updates` to be an array in the JSON data but got " + data['updates']);
|
|
110
|
+
}
|
|
111
|
+
// validate the optional field `updates` (array)
|
|
112
|
+
var _iterator = _createForOfIteratorHelper(data['updates']),
|
|
113
|
+
_step;
|
|
114
|
+
try {
|
|
115
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
116
|
+
var item = _step.value;
|
|
117
|
+
_DeviceOtaStateMachineNode["default"].validateJsonObject(item);
|
|
118
|
+
}
|
|
119
|
+
} catch (err) {
|
|
120
|
+
_iterator.e(err);
|
|
121
|
+
} finally {
|
|
122
|
+
_iterator.f();
|
|
123
|
+
}
|
|
124
|
+
;
|
|
125
|
+
}
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
}]);
|
|
129
|
+
}();
|
|
130
|
+
/**
|
|
131
|
+
* Version of the firmware that was requested to be installed
|
|
132
|
+
* @member {String} requested_version
|
|
133
|
+
*/
|
|
134
|
+
DeviceOtaStateMachine.prototype['requested_version'] = undefined;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Version of the firmware that was installed prior to this request
|
|
138
|
+
* @member {String} current_version
|
|
139
|
+
*/
|
|
140
|
+
DeviceOtaStateMachine.prototype['current_version'] = undefined;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* RFC3339 datetime of when this update was requested
|
|
144
|
+
* @member {String} initiated
|
|
145
|
+
*/
|
|
146
|
+
DeviceOtaStateMachine.prototype['initiated'] = undefined;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* @member {Array.<module:model/DeviceOtaStateMachineNode>} updates
|
|
150
|
+
*/
|
|
151
|
+
DeviceOtaStateMachine.prototype['updates'] = undefined;
|
|
152
|
+
var _default = exports["default"] = DeviceOtaStateMachine;
|
|
@@ -0,0 +1,132 @@
|
|
|
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
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
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); }
|
|
10
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
11
|
+
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); } }
|
|
12
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
|
+
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); } /**
|
|
15
|
+
* Notehub API
|
|
16
|
+
* The OpenAPI definition for the Notehub.io API.
|
|
17
|
+
*
|
|
18
|
+
* The version of the OpenAPI document: 1.1.0
|
|
19
|
+
* Contact: engineering@blues.io
|
|
20
|
+
*
|
|
21
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
22
|
+
* https://openapi-generator.tech
|
|
23
|
+
* Do not edit the class manually.
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* The DeviceOtaStateMachineNode model module.
|
|
28
|
+
* @module model/DeviceOtaStateMachineNode
|
|
29
|
+
* @version 1.0.23-beta.7
|
|
30
|
+
*/
|
|
31
|
+
var DeviceOtaStateMachineNode = /*#__PURE__*/function () {
|
|
32
|
+
/**
|
|
33
|
+
* Constructs a new <code>DeviceOtaStateMachineNode</code>.
|
|
34
|
+
* Represents a single request to update the host or Notecard firmware
|
|
35
|
+
* @alias module:model/DeviceOtaStateMachineNode
|
|
36
|
+
*/
|
|
37
|
+
function DeviceOtaStateMachineNode() {
|
|
38
|
+
_classCallCheck(this, DeviceOtaStateMachineNode);
|
|
39
|
+
DeviceOtaStateMachineNode.initialize(this);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Initializes the fields of this object.
|
|
44
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
45
|
+
* Only for internal use.
|
|
46
|
+
*/
|
|
47
|
+
return _createClass(DeviceOtaStateMachineNode, null, [{
|
|
48
|
+
key: "initialize",
|
|
49
|
+
value: function initialize(obj) {}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Constructs a <code>DeviceOtaStateMachineNode</code> from a plain JavaScript object, optionally creating a new instance.
|
|
53
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
54
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
55
|
+
* @param {module:model/DeviceOtaStateMachineNode} obj Optional instance to populate.
|
|
56
|
+
* @return {module:model/DeviceOtaStateMachineNode} The populated <code>DeviceOtaStateMachineNode</code> instance.
|
|
57
|
+
*/
|
|
58
|
+
}, {
|
|
59
|
+
key: "constructFromObject",
|
|
60
|
+
value: function constructFromObject(data, obj) {
|
|
61
|
+
if (data) {
|
|
62
|
+
obj = obj || new DeviceOtaStateMachineNode();
|
|
63
|
+
if (data.hasOwnProperty('status')) {
|
|
64
|
+
obj['status'] = _ApiClient["default"].convertToType(data['status'], 'String');
|
|
65
|
+
}
|
|
66
|
+
if (data.hasOwnProperty('phase')) {
|
|
67
|
+
obj['phase'] = _ApiClient["default"].convertToType(data['phase'], 'String');
|
|
68
|
+
}
|
|
69
|
+
if (data.hasOwnProperty('datetime')) {
|
|
70
|
+
obj['datetime'] = _ApiClient["default"].convertToType(data['datetime'], 'String');
|
|
71
|
+
}
|
|
72
|
+
if (data.hasOwnProperty('description')) {
|
|
73
|
+
obj['description'] = _ApiClient["default"].convertToType(data['description'], 'String');
|
|
74
|
+
}
|
|
75
|
+
} else if (data === null) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
return obj;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Validates the JSON data with respect to <code>DeviceOtaStateMachineNode</code>.
|
|
83
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
84
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>DeviceOtaStateMachineNode</code>.
|
|
85
|
+
*/
|
|
86
|
+
}, {
|
|
87
|
+
key: "validateJSON",
|
|
88
|
+
value: function validateJSON(data) {
|
|
89
|
+
// ensure the json data is a string
|
|
90
|
+
if (data['status'] && !(typeof data['status'] === 'string' || data['status'] instanceof String)) {
|
|
91
|
+
throw new Error("Expected the field `status` to be a primitive type in the JSON string but got " + data['status']);
|
|
92
|
+
}
|
|
93
|
+
// ensure the json data is a string
|
|
94
|
+
if (data['phase'] && !(typeof data['phase'] === 'string' || data['phase'] instanceof String)) {
|
|
95
|
+
throw new Error("Expected the field `phase` to be a primitive type in the JSON string but got " + data['phase']);
|
|
96
|
+
}
|
|
97
|
+
// ensure the json data is a string
|
|
98
|
+
if (data['datetime'] && !(typeof data['datetime'] === 'string' || data['datetime'] instanceof String)) {
|
|
99
|
+
throw new Error("Expected the field `datetime` to be a primitive type in the JSON string but got " + data['datetime']);
|
|
100
|
+
}
|
|
101
|
+
// ensure the json data is a string
|
|
102
|
+
if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
|
|
103
|
+
throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
|
|
104
|
+
}
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
}]);
|
|
108
|
+
}();
|
|
109
|
+
/**
|
|
110
|
+
* Status for this step in the firmware update process
|
|
111
|
+
* @member {String} status
|
|
112
|
+
*/
|
|
113
|
+
DeviceOtaStateMachineNode.prototype['status'] = undefined;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Phase for this step in the firmware update process
|
|
117
|
+
* @member {String} phase
|
|
118
|
+
*/
|
|
119
|
+
DeviceOtaStateMachineNode.prototype['phase'] = undefined;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* RFC3339 compatible datetime of when this status update happened
|
|
123
|
+
* @member {String} datetime
|
|
124
|
+
*/
|
|
125
|
+
DeviceOtaStateMachineNode.prototype['datetime'] = undefined;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Additional information
|
|
129
|
+
* @member {String} description
|
|
130
|
+
*/
|
|
131
|
+
DeviceOtaStateMachineNode.prototype['description'] = undefined;
|
|
132
|
+
var _default = exports["default"] = DeviceOtaStateMachineNode;
|
|
@@ -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 _DeviceOtaStateMachine = _interopRequireDefault(require("./DeviceOtaStateMachine"));
|
|
9
|
+
var _DeviceOtaStatusCurrent = _interopRequireDefault(require("./DeviceOtaStatusCurrent"));
|
|
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.1.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 DeviceOtaStatus model module.
|
|
33
|
+
* @module model/DeviceOtaStatus
|
|
34
|
+
* @version 1.0.23-beta.7
|
|
35
|
+
*/
|
|
36
|
+
var DeviceOtaStatus = /*#__PURE__*/function () {
|
|
37
|
+
/**
|
|
38
|
+
* Constructs a new <code>DeviceOtaStatus</code>.
|
|
39
|
+
* @alias module:model/DeviceOtaStatus
|
|
40
|
+
*/
|
|
41
|
+
function DeviceOtaStatus() {
|
|
42
|
+
_classCallCheck(this, DeviceOtaStatus);
|
|
43
|
+
DeviceOtaStatus.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(DeviceOtaStatus, null, [{
|
|
52
|
+
key: "initialize",
|
|
53
|
+
value: function initialize(obj) {}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Constructs a <code>DeviceOtaStatus</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/DeviceOtaStatus} obj Optional instance to populate.
|
|
60
|
+
* @return {module:model/DeviceOtaStatus} The populated <code>DeviceOtaStatus</code> instance.
|
|
61
|
+
*/
|
|
62
|
+
}, {
|
|
63
|
+
key: "constructFromObject",
|
|
64
|
+
value: function constructFromObject(data, obj) {
|
|
65
|
+
if (data) {
|
|
66
|
+
obj = obj || new DeviceOtaStatus();
|
|
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'] = _DeviceOtaStatusCurrent["default"].constructFromObject(data['current']);
|
|
72
|
+
}
|
|
73
|
+
if (data.hasOwnProperty('history')) {
|
|
74
|
+
obj['history'] = _ApiClient["default"].convertToType(data['history'], [_DeviceOtaStateMachine["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>DeviceOtaStatus</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>DeviceOtaStatus</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
|
+
_DeviceOtaStatusCurrent["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
|
+
_DeviceOtaStateMachine["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
|
+
DeviceOtaStatus.prototype['device_uid'] = undefined;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* @member {module:model/DeviceOtaStatusCurrent} current
|
|
132
|
+
*/
|
|
133
|
+
DeviceOtaStatus.prototype['current'] = undefined;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @member {Array.<module:model/DeviceOtaStateMachine>} history
|
|
137
|
+
*/
|
|
138
|
+
DeviceOtaStatus.prototype['history'] = undefined;
|
|
139
|
+
var _default = exports["default"] = DeviceOtaStatus;
|
|
@@ -13,7 +13,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
|
|
|
13
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
14
|
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); } /**
|
|
15
15
|
* Notehub API
|
|
16
|
-
* The OpenAPI definition for the Notehub.io API.
|
|
16
|
+
* The OpenAPI definition for the Notehub.io API.
|
|
17
17
|
*
|
|
18
18
|
* The version of the OpenAPI document: 1.1.0
|
|
19
19
|
* Contact: engineering@blues.io
|
|
@@ -24,18 +24,19 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
24
24
|
*
|
|
25
25
|
*/
|
|
26
26
|
/**
|
|
27
|
-
* The
|
|
28
|
-
* @module model/
|
|
29
|
-
* @version 1.0.23-beta.
|
|
27
|
+
* The DeviceOtaStatusCurrent model module.
|
|
28
|
+
* @module model/DeviceOtaStatusCurrent
|
|
29
|
+
* @version 1.0.23-beta.7
|
|
30
30
|
*/
|
|
31
|
-
var
|
|
31
|
+
var DeviceOtaStatusCurrent = /*#__PURE__*/function () {
|
|
32
32
|
/**
|
|
33
|
-
* Constructs a new <code>
|
|
34
|
-
*
|
|
33
|
+
* Constructs a new <code>DeviceOtaStatusCurrent</code>.
|
|
34
|
+
* Description of the current firmware
|
|
35
|
+
* @alias module:model/DeviceOtaStatusCurrent
|
|
35
36
|
*/
|
|
36
|
-
function
|
|
37
|
-
_classCallCheck(this,
|
|
38
|
-
|
|
37
|
+
function DeviceOtaStatusCurrent() {
|
|
38
|
+
_classCallCheck(this, DeviceOtaStatusCurrent);
|
|
39
|
+
DeviceOtaStatusCurrent.initialize(this);
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
/**
|
|
@@ -43,22 +44,22 @@ var FirmwareStatus = /*#__PURE__*/function () {
|
|
|
43
44
|
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
44
45
|
* Only for internal use.
|
|
45
46
|
*/
|
|
46
|
-
return _createClass(
|
|
47
|
+
return _createClass(DeviceOtaStatusCurrent, null, [{
|
|
47
48
|
key: "initialize",
|
|
48
49
|
value: function initialize(obj) {}
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
|
-
* Constructs a <code>
|
|
52
|
+
* Constructs a <code>DeviceOtaStatusCurrent</code> from a plain JavaScript object, optionally creating a new instance.
|
|
52
53
|
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
53
54
|
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
54
|
-
* @param {module:model/
|
|
55
|
-
* @return {module:model/
|
|
55
|
+
* @param {module:model/DeviceOtaStatusCurrent} obj Optional instance to populate.
|
|
56
|
+
* @return {module:model/DeviceOtaStatusCurrent} The populated <code>DeviceOtaStatusCurrent</code> instance.
|
|
56
57
|
*/
|
|
57
58
|
}, {
|
|
58
59
|
key: "constructFromObject",
|
|
59
60
|
value: function constructFromObject(data, obj) {
|
|
60
61
|
if (data) {
|
|
61
|
-
obj = obj || new
|
|
62
|
+
obj = obj || new DeviceOtaStatusCurrent();
|
|
62
63
|
if (data.hasOwnProperty('version')) {
|
|
63
64
|
obj['version'] = _ApiClient["default"].convertToType(data['version'], 'String');
|
|
64
65
|
}
|
|
@@ -74,6 +75,9 @@ var FirmwareStatus = /*#__PURE__*/function () {
|
|
|
74
75
|
if (data.hasOwnProperty('built')) {
|
|
75
76
|
obj['built'] = _ApiClient["default"].convertToType(data['built'], 'String');
|
|
76
77
|
}
|
|
78
|
+
if (data.hasOwnProperty('builder')) {
|
|
79
|
+
obj['builder'] = _ApiClient["default"].convertToType(data['builder'], 'String');
|
|
80
|
+
}
|
|
77
81
|
} else if (data === null) {
|
|
78
82
|
return null;
|
|
79
83
|
}
|
|
@@ -81,9 +85,9 @@ var FirmwareStatus = /*#__PURE__*/function () {
|
|
|
81
85
|
}
|
|
82
86
|
|
|
83
87
|
/**
|
|
84
|
-
* Validates the JSON data with respect to <code>
|
|
88
|
+
* Validates the JSON data with respect to <code>DeviceOtaStatusCurrent</code>.
|
|
85
89
|
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
86
|
-
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>
|
|
90
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>DeviceOtaStatusCurrent</code>.
|
|
87
91
|
*/
|
|
88
92
|
}, {
|
|
89
93
|
key: "validateJSON",
|
|
@@ -108,37 +112,47 @@ var FirmwareStatus = /*#__PURE__*/function () {
|
|
|
108
112
|
if (data['built'] && !(typeof data['built'] === 'string' || data['built'] instanceof String)) {
|
|
109
113
|
throw new Error("Expected the field `built` to be a primitive type in the JSON string but got " + data['built']);
|
|
110
114
|
}
|
|
115
|
+
// ensure the json data is a string
|
|
116
|
+
if (data['builder'] && !(typeof data['builder'] === 'string' || data['builder'] instanceof String)) {
|
|
117
|
+
throw new Error("Expected the field `builder` to be a primitive type in the JSON string but got " + data['builder']);
|
|
118
|
+
}
|
|
111
119
|
return true;
|
|
112
120
|
}
|
|
113
121
|
}]);
|
|
114
122
|
}();
|
|
115
123
|
/**
|
|
116
|
-
*
|
|
124
|
+
* Firmware version
|
|
117
125
|
* @member {String} version
|
|
118
126
|
*/
|
|
119
|
-
|
|
127
|
+
DeviceOtaStatusCurrent.prototype['version'] = undefined;
|
|
120
128
|
|
|
121
129
|
/**
|
|
122
|
-
*
|
|
130
|
+
* Firmware organization
|
|
123
131
|
* @member {String} organization
|
|
124
132
|
*/
|
|
125
|
-
|
|
133
|
+
DeviceOtaStatusCurrent.prototype['organization'] = undefined;
|
|
126
134
|
|
|
127
135
|
/**
|
|
128
|
-
*
|
|
136
|
+
* Firmware description
|
|
129
137
|
* @member {String} description
|
|
130
138
|
*/
|
|
131
|
-
|
|
139
|
+
DeviceOtaStatusCurrent.prototype['description'] = undefined;
|
|
132
140
|
|
|
133
141
|
/**
|
|
134
|
-
*
|
|
142
|
+
* Firmware product
|
|
135
143
|
* @member {String} product
|
|
136
144
|
*/
|
|
137
|
-
|
|
145
|
+
DeviceOtaStatusCurrent.prototype['product'] = undefined;
|
|
138
146
|
|
|
139
147
|
/**
|
|
140
|
-
*
|
|
148
|
+
* Firmware build date
|
|
141
149
|
* @member {String} built
|
|
142
150
|
*/
|
|
143
|
-
|
|
144
|
-
|
|
151
|
+
DeviceOtaStatusCurrent.prototype['built'] = undefined;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Firmware author
|
|
155
|
+
* @member {String} builder
|
|
156
|
+
*/
|
|
157
|
+
DeviceOtaStatusCurrent.prototype['builder'] = undefined;
|
|
158
|
+
var _default = exports["default"] = DeviceOtaStatusCurrent;
|