@blues-inc/notehub-js 2.2.1 → 2.3.0-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 +247 -241
- package/dist/ApiClient.js +154 -154
- package/dist/api/AlertApi.js +22 -22
- package/dist/api/AuthorizationApi.js +31 -31
- package/dist/api/BillingAccountApi.js +14 -14
- package/dist/api/DeviceApi.js +352 -444
- package/dist/api/EventApi.js +118 -118
- package/dist/api/ExternalDevicesApi.js +41 -41
- package/dist/api/MonitorApi.js +52 -52
- package/dist/api/ProjectApi.js +381 -381
- package/dist/api/RouteApi.js +77 -77
- package/dist/api/UsageApi.js +44 -44
- package/dist/api/WebhookApi.js +51 -51
- package/dist/model/Alert.js +76 -74
- package/dist/model/AlertDataInner.js +35 -35
- package/dist/model/AlertNotificationsInner.js +18 -18
- package/dist/model/AwsRoute.js +65 -65
- package/dist/model/AzureRoute.js +43 -43
- package/dist/model/BillingAccount.js +21 -21
- package/dist/model/BillingAccountRole.js +9 -9
- package/dist/model/BlynkRoute.js +28 -28
- package/dist/model/Body.js +5 -5
- package/dist/model/CellularPlan.js +34 -34
- package/dist/model/CloneProjectRequest.js +20 -20
- package/dist/model/Contact.js +22 -22
- package/dist/model/CreateFleetRequest.js +17 -17
- package/dist/model/CreateMonitor.js +126 -125
- package/dist/model/CreateProductRequest.js +22 -22
- package/dist/model/CreateProjectRequest.js +16 -16
- package/dist/model/CreateUpdateRepository.js +17 -17
- package/dist/model/CurrentFirmware.js +12 -12
- package/dist/model/DFUEnv.js +12 -12
- package/dist/model/DFUState.js +65 -65
- package/dist/model/DataField.js +7 -7
- package/dist/model/DataSetField.js +19 -19
- package/dist/model/DataUsage.js +14 -14
- package/dist/model/DatacakeRoute.js +35 -35
- package/dist/model/DeleteDeviceFleetsRequest.js +8 -8
- package/dist/model/Device.js +102 -101
- package/dist/model/DeviceDfuHistory.js +20 -19
- package/dist/model/DeviceDfuHistoryCurrent.js +32 -32
- package/dist/model/DeviceDfuHistoryPage.js +13 -12
- package/dist/model/DeviceDfuStateMachine.js +25 -24
- package/dist/model/DeviceDfuStateMachineNode.js +22 -22
- package/dist/model/DeviceDfuStatus.js +20 -20
- package/dist/model/DeviceDfuStatusPage.js +13 -12
- package/dist/model/DeviceSession.js +221 -221
- package/dist/model/DeviceTowerInfo.js +14 -14
- package/dist/model/DeviceUsage.js +32 -32
- package/dist/model/DfuActionRequest.js +7 -7
- package/dist/model/EmailNotification.js +7 -7
- package/dist/model/EnvTreeJsonNode.js +69 -67
- package/dist/model/EnvVar.js +18 -18
- package/dist/model/EnvironmentVariables.js +8 -8
- package/dist/model/Error.js +31 -31
- package/dist/model/Event.js +248 -248
- package/dist/model/Filter.js +16 -16
- package/dist/model/Firmware.js +49 -49
- package/dist/model/FirmwareInfo.js +60 -60
- package/dist/model/Fleet.js +35 -35
- package/dist/model/FleetConnectivityAssurance.js +6 -6
- package/dist/model/GetAlerts200Response.js +15 -14
- package/dist/model/GetBillingAccounts200Response.js +10 -9
- package/dist/model/GetDataUsage200Response.js +10 -9
- package/dist/model/GetDataUsage200ResponseDataInner.js +41 -40
- package/dist/model/GetDeviceEnvironmentVariablesByPin200Response.js +16 -16
- package/dist/model/GetDeviceFleets200Response.js +12 -11
- package/dist/model/GetDeviceHealthLog200Response.js +12 -11
- package/dist/model/GetDeviceHealthLog200ResponseHealthLogInner.js +19 -19
- package/dist/model/GetDeviceLatest200Response.js +10 -9
- package/dist/model/GetDevicePlans200Response.js +10 -9
- package/dist/model/GetDevicePublicKey200Response.js +16 -16
- package/dist/model/GetDeviceSessions200Response.js +17 -16
- package/dist/model/GetProducts200Response.js +10 -9
- package/dist/model/GetProjectDevicePublicKeys200Response.js +17 -16
- package/dist/model/GetProjectDevicePublicKeys200ResponseDevicePublicKeysInner.js +12 -12
- package/dist/model/GetProjectDevices200Response.js +17 -16
- package/dist/model/GetProjectEvents200Response.js +21 -20
- package/dist/model/GetProjectEventsByCursor200Response.js +24 -23
- package/dist/model/GetProjectMembers200Response.js +12 -11
- package/dist/model/GetProjects200Response.js +10 -9
- package/dist/model/GetSessionsUsage200Response.js +12 -11
- package/dist/model/GetWebhooks200Response.js +10 -9
- package/dist/model/GoogleRoute.js +33 -33
- package/dist/model/HandleNoteChanges200Response.js +11 -11
- package/dist/model/HandleNoteGet200Response.js +13 -13
- package/dist/model/HandleNoteSignal200Response.js +5 -5
- package/dist/model/HandleNotefileChanges200Response.js +11 -11
- package/dist/model/HandleNotefileChangesPending200Response.js +14 -14
- package/dist/model/HandleNotefileDeleteRequest.js +7 -7
- package/dist/model/HttpRoute.js +35 -35
- package/dist/model/Location.js +40 -40
- package/dist/model/Login200Response.js +7 -7
- package/dist/model/LoginRequest.js +12 -12
- package/dist/model/Monitor.js +100 -99
- package/dist/model/MonitorAlertRoutesInner.js +9 -10
- package/dist/model/MqttRoute.js +68 -68
- package/dist/model/Note.js +10 -10
- package/dist/model/NotefileSchema.js +19 -18
- package/dist/model/NotehubRoute.js +98 -98
- package/dist/model/NotehubRouteSummary.js +23 -23
- package/dist/model/OAuth2Error.js +20 -20
- package/dist/model/OAuth2TokenResponse.js +23 -23
- package/dist/model/PersonalAccessToken.js +34 -34
- package/dist/model/PersonalAccessTokenCreatedBy.js +17 -17
- package/dist/model/PersonalAccessTokenInfo.js +18 -18
- package/dist/model/PersonalAccessTokenSecret.js +12 -12
- package/dist/model/PostProvisionProjectDeviceRequest.js +18 -18
- package/dist/model/Product.js +26 -26
- package/dist/model/Project.js +34 -34
- package/dist/model/ProjectMember.js +22 -22
- package/dist/model/ProxyRoute.js +38 -24
- package/dist/model/PutDeviceFleetsRequest.js +8 -8
- package/dist/model/QubitroRoute.js +33 -33
- package/dist/model/RadRoute.js +31 -31
- package/dist/model/Repository.js +22 -22
- package/dist/model/Role.js +9 -9
- package/dist/model/RouteLog.js +38 -38
- package/dist/model/RouteTransformSettings.js +27 -14
- package/dist/model/S3ArchiveRoute.js +79 -79
- package/dist/model/SatellitePlan.js +26 -26
- package/dist/model/SchemaProperty.js +38 -36
- package/dist/model/SimUsage.js +19 -19
- package/dist/model/SlackBearerNotification.js +25 -25
- package/dist/model/SlackRoute.js +48 -48
- package/dist/model/SlackWebHookNotification.js +20 -20
- package/dist/model/SnowflakeRoute.js +45 -45
- package/dist/model/ThingworxRoute.js +33 -33
- package/dist/model/TowerLocation.js +54 -54
- package/dist/model/TwilioRoute.js +43 -43
- package/dist/model/UpdateFleetRequest.js +30 -30
- package/dist/model/UploadMetadata.js +64 -64
- package/dist/model/UsageData.js +18 -18
- package/dist/model/UsageEventsData.js +29 -29
- package/dist/model/UsageEventsResponse.js +12 -11
- package/dist/model/UsageRouteLogsData.js +27 -27
- package/dist/model/UsageSessionsData.js +27 -27
- package/dist/model/UserDfuStateMachine.js +20 -20
- package/dist/model/UserDfuStateMachineStatus.js +20 -20
- package/dist/model/UserFirmwareInfo.js +12 -12
- package/dist/model/WebhookSettings.js +15 -15
- package/package.json +3 -3
package/dist/api/WebhookApi.js
CHANGED
|
@@ -16,7 +16,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
|
|
|
16
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
17
|
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); } /**
|
|
18
18
|
* Notehub API
|
|
19
|
-
* The OpenAPI definition for the Notehub.io API.
|
|
19
|
+
* The OpenAPI definition for the Notehub.io API.
|
|
20
20
|
*
|
|
21
21
|
* The version of the OpenAPI document: 1.2.0
|
|
22
22
|
* Contact: engineering@blues.io
|
|
@@ -27,18 +27,18 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
27
27
|
*
|
|
28
28
|
*/
|
|
29
29
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
* Webhook service.
|
|
31
|
+
* @module api/WebhookApi
|
|
32
|
+
* @version 2.3.0-beta.2
|
|
33
|
+
*/
|
|
34
34
|
var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
35
35
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
* Constructs a new WebhookApi.
|
|
37
|
+
* @alias module:api/WebhookApi
|
|
38
|
+
* @class
|
|
39
|
+
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
|
|
40
|
+
* default to {@link module:ApiClient#instance} if unspecified.
|
|
41
|
+
*/
|
|
42
42
|
function WebhookApi(apiClient) {
|
|
43
43
|
_classCallCheck(this, WebhookApi);
|
|
44
44
|
this.apiClient = apiClient || _ApiClient["default"].instance;
|
|
@@ -46,9 +46,9 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* Creates a webhook for the specified product with the given name. The name | must be unique within the project.
|
|
49
|
-
* @param {String} projectOrProductUID
|
|
49
|
+
* @param {String} projectOrProductUID
|
|
50
50
|
* @param {String} webhookUID Webhook UID
|
|
51
|
-
* @param {module:model/WebhookSettings} webhookSettings
|
|
51
|
+
* @param {module:model/WebhookSettings} webhookSettings
|
|
52
52
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
|
53
53
|
*/
|
|
54
54
|
return _createClass(WebhookApi, [{
|
|
@@ -68,24 +68,24 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
68
68
|
throw new _Error["default"]("Missing the required parameter 'webhookSettings' when calling createWebhook");
|
|
69
69
|
}
|
|
70
70
|
var pathParams = {
|
|
71
|
-
projectOrProductUID: projectOrProductUID,
|
|
72
|
-
webhookUID: webhookUID
|
|
71
|
+
'projectOrProductUID': projectOrProductUID,
|
|
72
|
+
'webhookUID': webhookUID
|
|
73
73
|
};
|
|
74
74
|
var queryParams = {};
|
|
75
75
|
var headerParams = {};
|
|
76
76
|
var formParams = {};
|
|
77
|
-
var authNames = [
|
|
78
|
-
var contentTypes = [
|
|
79
|
-
var accepts = [
|
|
77
|
+
var authNames = ['personalAccessToken'];
|
|
78
|
+
var contentTypes = ['application/json'];
|
|
79
|
+
var accepts = ['application/json'];
|
|
80
80
|
var returnType = null;
|
|
81
|
-
return this.apiClient.callApi(
|
|
81
|
+
return this.apiClient.callApi('/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* Creates a webhook for the specified product with the given name. The name | must be unique within the project.
|
|
86
|
-
* @param {String} projectOrProductUID
|
|
86
|
+
* @param {String} projectOrProductUID
|
|
87
87
|
* @param {String} webhookUID Webhook UID
|
|
88
|
-
* @param {module:model/WebhookSettings} webhookSettings
|
|
88
|
+
* @param {module:model/WebhookSettings} webhookSettings
|
|
89
89
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
|
90
90
|
*/
|
|
91
91
|
}, {
|
|
@@ -98,7 +98,7 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
100
|
* Deletes the specified webhook
|
|
101
|
-
* @param {String} projectOrProductUID
|
|
101
|
+
* @param {String} projectOrProductUID
|
|
102
102
|
* @param {String} webhookUID Webhook UID
|
|
103
103
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
|
104
104
|
*/
|
|
@@ -115,22 +115,22 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
115
115
|
throw new _Error["default"]("Missing the required parameter 'webhookUID' when calling deleteWebhook");
|
|
116
116
|
}
|
|
117
117
|
var pathParams = {
|
|
118
|
-
projectOrProductUID: projectOrProductUID,
|
|
119
|
-
webhookUID: webhookUID
|
|
118
|
+
'projectOrProductUID': projectOrProductUID,
|
|
119
|
+
'webhookUID': webhookUID
|
|
120
120
|
};
|
|
121
121
|
var queryParams = {};
|
|
122
122
|
var headerParams = {};
|
|
123
123
|
var formParams = {};
|
|
124
|
-
var authNames = [
|
|
124
|
+
var authNames = ['personalAccessToken'];
|
|
125
125
|
var contentTypes = [];
|
|
126
|
-
var accepts = [
|
|
126
|
+
var accepts = ['application/json'];
|
|
127
127
|
var returnType = null;
|
|
128
|
-
return this.apiClient.callApi(
|
|
128
|
+
return this.apiClient.callApi('/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
132
|
* Deletes the specified webhook
|
|
133
|
-
* @param {String} projectOrProductUID
|
|
133
|
+
* @param {String} projectOrProductUID
|
|
134
134
|
* @param {String} webhookUID Webhook UID
|
|
135
135
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
|
136
136
|
*/
|
|
@@ -144,7 +144,7 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
144
144
|
|
|
145
145
|
/**
|
|
146
146
|
* Retrieves the configuration settings for the specified webhook
|
|
147
|
-
* @param {String} projectOrProductUID
|
|
147
|
+
* @param {String} projectOrProductUID
|
|
148
148
|
* @param {String} webhookUID Webhook UID
|
|
149
149
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/WebhookSettings} and HTTP response
|
|
150
150
|
*/
|
|
@@ -161,22 +161,22 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
161
161
|
throw new _Error["default"]("Missing the required parameter 'webhookUID' when calling getWebhook");
|
|
162
162
|
}
|
|
163
163
|
var pathParams = {
|
|
164
|
-
projectOrProductUID: projectOrProductUID,
|
|
165
|
-
webhookUID: webhookUID
|
|
164
|
+
'projectOrProductUID': projectOrProductUID,
|
|
165
|
+
'webhookUID': webhookUID
|
|
166
166
|
};
|
|
167
167
|
var queryParams = {};
|
|
168
168
|
var headerParams = {};
|
|
169
169
|
var formParams = {};
|
|
170
|
-
var authNames = [
|
|
170
|
+
var authNames = ['personalAccessToken'];
|
|
171
171
|
var contentTypes = [];
|
|
172
|
-
var accepts = [
|
|
172
|
+
var accepts = ['application/json'];
|
|
173
173
|
var returnType = _WebhookSettings["default"];
|
|
174
|
-
return this.apiClient.callApi(
|
|
174
|
+
return this.apiClient.callApi('/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
/**
|
|
178
178
|
* Retrieves the configuration settings for the specified webhook
|
|
179
|
-
* @param {String} projectOrProductUID
|
|
179
|
+
* @param {String} projectOrProductUID
|
|
180
180
|
* @param {String} webhookUID Webhook UID
|
|
181
181
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/WebhookSettings}
|
|
182
182
|
*/
|
|
@@ -190,7 +190,7 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
190
190
|
|
|
191
191
|
/**
|
|
192
192
|
* Retrieves all webhooks for the specified project
|
|
193
|
-
* @param {String} projectOrProductUID
|
|
193
|
+
* @param {String} projectOrProductUID
|
|
194
194
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetWebhooks200Response} and HTTP response
|
|
195
195
|
*/
|
|
196
196
|
}, {
|
|
@@ -202,21 +202,21 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
202
202
|
throw new _Error["default"]("Missing the required parameter 'projectOrProductUID' when calling getWebhooks");
|
|
203
203
|
}
|
|
204
204
|
var pathParams = {
|
|
205
|
-
projectOrProductUID: projectOrProductUID
|
|
205
|
+
'projectOrProductUID': projectOrProductUID
|
|
206
206
|
};
|
|
207
207
|
var queryParams = {};
|
|
208
208
|
var headerParams = {};
|
|
209
209
|
var formParams = {};
|
|
210
|
-
var authNames = [
|
|
210
|
+
var authNames = ['personalAccessToken'];
|
|
211
211
|
var contentTypes = [];
|
|
212
|
-
var accepts = [
|
|
212
|
+
var accepts = ['application/json'];
|
|
213
213
|
var returnType = _GetWebhooks200Response["default"];
|
|
214
|
-
return this.apiClient.callApi(
|
|
214
|
+
return this.apiClient.callApi('/v1/projects/{projectOrProductUID}/webhooks', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
/**
|
|
218
218
|
* Retrieves all webhooks for the specified project
|
|
219
|
-
* @param {String} projectOrProductUID
|
|
219
|
+
* @param {String} projectOrProductUID
|
|
220
220
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetWebhooks200Response}
|
|
221
221
|
*/
|
|
222
222
|
}, {
|
|
@@ -229,9 +229,9 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
229
229
|
|
|
230
230
|
/**
|
|
231
231
|
* Updates the configuration settings for the specified webhook. | Webhook will be created if it does not exist. Update body will completely replace the existing settings.
|
|
232
|
-
* @param {String} projectOrProductUID
|
|
232
|
+
* @param {String} projectOrProductUID
|
|
233
233
|
* @param {String} webhookUID Webhook UID
|
|
234
|
-
* @param {module:model/WebhookSettings} webhookSettings
|
|
234
|
+
* @param {module:model/WebhookSettings} webhookSettings
|
|
235
235
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
|
236
236
|
*/
|
|
237
237
|
}, {
|
|
@@ -251,24 +251,24 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
251
251
|
throw new _Error["default"]("Missing the required parameter 'webhookSettings' when calling updateWebhook");
|
|
252
252
|
}
|
|
253
253
|
var pathParams = {
|
|
254
|
-
projectOrProductUID: projectOrProductUID,
|
|
255
|
-
webhookUID: webhookUID
|
|
254
|
+
'projectOrProductUID': projectOrProductUID,
|
|
255
|
+
'webhookUID': webhookUID
|
|
256
256
|
};
|
|
257
257
|
var queryParams = {};
|
|
258
258
|
var headerParams = {};
|
|
259
259
|
var formParams = {};
|
|
260
|
-
var authNames = [
|
|
261
|
-
var contentTypes = [
|
|
262
|
-
var accepts = [
|
|
260
|
+
var authNames = ['personalAccessToken'];
|
|
261
|
+
var contentTypes = ['application/json'];
|
|
262
|
+
var accepts = ['application/json'];
|
|
263
263
|
var returnType = null;
|
|
264
|
-
return this.apiClient.callApi(
|
|
264
|
+
return this.apiClient.callApi('/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
/**
|
|
268
268
|
* Updates the configuration settings for the specified webhook. | Webhook will be created if it does not exist. Update body will completely replace the existing settings.
|
|
269
|
-
* @param {String} projectOrProductUID
|
|
269
|
+
* @param {String} projectOrProductUID
|
|
270
270
|
* @param {String} webhookUID Webhook UID
|
|
271
|
-
* @param {module:model/WebhookSettings} webhookSettings
|
|
271
|
+
* @param {module:model/WebhookSettings} webhookSettings
|
|
272
272
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
|
273
273
|
*/
|
|
274
274
|
}, {
|
package/dist/model/Alert.js
CHANGED
|
@@ -18,7 +18,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
|
|
|
18
18
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
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
20
|
* Notehub API
|
|
21
|
-
* The OpenAPI definition for the Notehub.io API.
|
|
21
|
+
* The OpenAPI definition for the Notehub.io API.
|
|
22
22
|
*
|
|
23
23
|
* The version of the OpenAPI document: 1.2.0
|
|
24
24
|
* Contact: engineering@blues.io
|
|
@@ -31,7 +31,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
31
31
|
/**
|
|
32
32
|
* The Alert model module.
|
|
33
33
|
* @module model/Alert
|
|
34
|
-
* @version 2.2
|
|
34
|
+
* @version 2.3.0-beta.2
|
|
35
35
|
*/
|
|
36
36
|
var Alert = /*#__PURE__*/function () {
|
|
37
37
|
/**
|
|
@@ -64,47 +64,47 @@ var Alert = /*#__PURE__*/function () {
|
|
|
64
64
|
value: function constructFromObject(data, obj) {
|
|
65
65
|
if (data) {
|
|
66
66
|
obj = obj || new Alert();
|
|
67
|
-
if (data.hasOwnProperty(
|
|
68
|
-
obj[
|
|
67
|
+
if (data.hasOwnProperty('alert_source')) {
|
|
68
|
+
obj['alert_source'] = _ApiClient["default"].convertToType(data['alert_source'], 'String');
|
|
69
69
|
}
|
|
70
|
-
if (data.hasOwnProperty(
|
|
71
|
-
obj[
|
|
70
|
+
if (data.hasOwnProperty('created_at')) {
|
|
71
|
+
obj['created_at'] = _ApiClient["default"].convertToType(data['created_at'], 'Number');
|
|
72
72
|
}
|
|
73
|
-
if (data.hasOwnProperty(
|
|
74
|
-
obj[
|
|
73
|
+
if (data.hasOwnProperty('data')) {
|
|
74
|
+
obj['data'] = _ApiClient["default"].convertToType(data['data'], [_AlertDataInner["default"]]);
|
|
75
75
|
}
|
|
76
|
-
if (data.hasOwnProperty(
|
|
77
|
-
obj[
|
|
76
|
+
if (data.hasOwnProperty('device_uid')) {
|
|
77
|
+
obj['device_uid'] = _ApiClient["default"].convertToType(data['device_uid'], 'String');
|
|
78
78
|
}
|
|
79
|
-
if (data.hasOwnProperty(
|
|
80
|
-
obj[
|
|
79
|
+
if (data.hasOwnProperty('field_name')) {
|
|
80
|
+
obj['field_name'] = _ApiClient["default"].convertToType(data['field_name'], 'String');
|
|
81
81
|
}
|
|
82
|
-
if (data.hasOwnProperty(
|
|
83
|
-
obj[
|
|
82
|
+
if (data.hasOwnProperty('monitor_name')) {
|
|
83
|
+
obj['monitor_name'] = _ApiClient["default"].convertToType(data['monitor_name'], 'String');
|
|
84
84
|
}
|
|
85
|
-
if (data.hasOwnProperty(
|
|
86
|
-
obj[
|
|
85
|
+
if (data.hasOwnProperty('monitor_type')) {
|
|
86
|
+
obj['monitor_type'] = _ApiClient["default"].convertToType(data['monitor_type'], 'String');
|
|
87
87
|
}
|
|
88
|
-
if (data.hasOwnProperty(
|
|
89
|
-
obj[
|
|
88
|
+
if (data.hasOwnProperty('monitor_uid')) {
|
|
89
|
+
obj['monitor_uid'] = _ApiClient["default"].convertToType(data['monitor_uid'], 'String');
|
|
90
90
|
}
|
|
91
|
-
if (data.hasOwnProperty(
|
|
92
|
-
obj[
|
|
91
|
+
if (data.hasOwnProperty('notifications')) {
|
|
92
|
+
obj['notifications'] = _ApiClient["default"].convertToType(data['notifications'], [_AlertNotificationsInner["default"]]);
|
|
93
93
|
}
|
|
94
|
-
if (data.hasOwnProperty(
|
|
95
|
-
obj[
|
|
94
|
+
if (data.hasOwnProperty('resolved')) {
|
|
95
|
+
obj['resolved'] = _ApiClient["default"].convertToType(data['resolved'], 'Boolean');
|
|
96
96
|
}
|
|
97
|
-
if (data.hasOwnProperty(
|
|
98
|
-
obj[
|
|
97
|
+
if (data.hasOwnProperty('source')) {
|
|
98
|
+
obj['source'] = _ApiClient["default"].convertToType(data['source'], 'String');
|
|
99
99
|
}
|
|
100
|
-
if (data.hasOwnProperty(
|
|
101
|
-
obj[
|
|
100
|
+
if (data.hasOwnProperty('uid')) {
|
|
101
|
+
obj['uid'] = _ApiClient["default"].convertToType(data['uid'], 'String');
|
|
102
102
|
}
|
|
103
|
-
if (data.hasOwnProperty(
|
|
104
|
-
obj[
|
|
103
|
+
if (data.hasOwnProperty('value')) {
|
|
104
|
+
obj['value'] = _ApiClient["default"].convertToType(data['value'], 'Number');
|
|
105
105
|
}
|
|
106
|
-
if (data.hasOwnProperty(
|
|
107
|
-
obj[
|
|
106
|
+
if (data.hasOwnProperty('version')) {
|
|
107
|
+
obj['version'] = _ApiClient["default"].convertToType(data['version'], 'Number');
|
|
108
108
|
}
|
|
109
109
|
} else if (data === null) {
|
|
110
110
|
return null;
|
|
@@ -121,17 +121,17 @@ var Alert = /*#__PURE__*/function () {
|
|
|
121
121
|
key: "validateJSON",
|
|
122
122
|
value: function validateJSON(data) {
|
|
123
123
|
// ensure the json data is a string
|
|
124
|
-
if (data[
|
|
125
|
-
throw new Error("Expected the field `alert_source` to be a primitive type in the JSON string but got " + data[
|
|
124
|
+
if (data['alert_source'] && !(typeof data['alert_source'] === 'string' || data['alert_source'] instanceof String)) {
|
|
125
|
+
throw new Error("Expected the field `alert_source` to be a primitive type in the JSON string but got " + data['alert_source']);
|
|
126
126
|
}
|
|
127
|
-
if (data[
|
|
127
|
+
if (data['data']) {
|
|
128
128
|
// data not null
|
|
129
129
|
// ensure the json data is an array
|
|
130
|
-
if (!Array.isArray(data[
|
|
131
|
-
throw new Error("Expected the field `data` to be an array in the JSON data but got " + data[
|
|
130
|
+
if (!Array.isArray(data['data'])) {
|
|
131
|
+
throw new Error("Expected the field `data` to be an array in the JSON data but got " + data['data']);
|
|
132
132
|
}
|
|
133
133
|
// validate the optional field `data` (array)
|
|
134
|
-
var _iterator = _createForOfIteratorHelper(data[
|
|
134
|
+
var _iterator = _createForOfIteratorHelper(data['data']),
|
|
135
135
|
_step;
|
|
136
136
|
try {
|
|
137
137
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -143,35 +143,36 @@ var Alert = /*#__PURE__*/function () {
|
|
|
143
143
|
} finally {
|
|
144
144
|
_iterator.f();
|
|
145
145
|
}
|
|
146
|
+
;
|
|
146
147
|
}
|
|
147
148
|
// ensure the json data is a string
|
|
148
|
-
if (data[
|
|
149
|
-
throw new Error("Expected the field `device_uid` to be a primitive type in the JSON string but got " + data[
|
|
149
|
+
if (data['device_uid'] && !(typeof data['device_uid'] === 'string' || data['device_uid'] instanceof String)) {
|
|
150
|
+
throw new Error("Expected the field `device_uid` to be a primitive type in the JSON string but got " + data['device_uid']);
|
|
150
151
|
}
|
|
151
152
|
// ensure the json data is a string
|
|
152
|
-
if (data[
|
|
153
|
-
throw new Error("Expected the field `field_name` to be a primitive type in the JSON string but got " + data[
|
|
153
|
+
if (data['field_name'] && !(typeof data['field_name'] === 'string' || data['field_name'] instanceof String)) {
|
|
154
|
+
throw new Error("Expected the field `field_name` to be a primitive type in the JSON string but got " + data['field_name']);
|
|
154
155
|
}
|
|
155
156
|
// ensure the json data is a string
|
|
156
|
-
if (data[
|
|
157
|
-
throw new Error("Expected the field `monitor_name` to be a primitive type in the JSON string but got " + data[
|
|
157
|
+
if (data['monitor_name'] && !(typeof data['monitor_name'] === 'string' || data['monitor_name'] instanceof String)) {
|
|
158
|
+
throw new Error("Expected the field `monitor_name` to be a primitive type in the JSON string but got " + data['monitor_name']);
|
|
158
159
|
}
|
|
159
160
|
// ensure the json data is a string
|
|
160
|
-
if (data[
|
|
161
|
-
throw new Error("Expected the field `monitor_type` to be a primitive type in the JSON string but got " + data[
|
|
161
|
+
if (data['monitor_type'] && !(typeof data['monitor_type'] === 'string' || data['monitor_type'] instanceof String)) {
|
|
162
|
+
throw new Error("Expected the field `monitor_type` to be a primitive type in the JSON string but got " + data['monitor_type']);
|
|
162
163
|
}
|
|
163
164
|
// ensure the json data is a string
|
|
164
|
-
if (data[
|
|
165
|
-
throw new Error("Expected the field `monitor_uid` to be a primitive type in the JSON string but got " + data[
|
|
165
|
+
if (data['monitor_uid'] && !(typeof data['monitor_uid'] === 'string' || data['monitor_uid'] instanceof String)) {
|
|
166
|
+
throw new Error("Expected the field `monitor_uid` to be a primitive type in the JSON string but got " + data['monitor_uid']);
|
|
166
167
|
}
|
|
167
|
-
if (data[
|
|
168
|
+
if (data['notifications']) {
|
|
168
169
|
// data not null
|
|
169
170
|
// ensure the json data is an array
|
|
170
|
-
if (!Array.isArray(data[
|
|
171
|
-
throw new Error("Expected the field `notifications` to be an array in the JSON data but got " + data[
|
|
171
|
+
if (!Array.isArray(data['notifications'])) {
|
|
172
|
+
throw new Error("Expected the field `notifications` to be an array in the JSON data but got " + data['notifications']);
|
|
172
173
|
}
|
|
173
174
|
// validate the optional field `notifications` (array)
|
|
174
|
-
var _iterator2 = _createForOfIteratorHelper(data[
|
|
175
|
+
var _iterator2 = _createForOfIteratorHelper(data['notifications']),
|
|
175
176
|
_step2;
|
|
176
177
|
try {
|
|
177
178
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -183,14 +184,15 @@ var Alert = /*#__PURE__*/function () {
|
|
|
183
184
|
} finally {
|
|
184
185
|
_iterator2.f();
|
|
185
186
|
}
|
|
187
|
+
;
|
|
186
188
|
}
|
|
187
189
|
// ensure the json data is a string
|
|
188
|
-
if (data[
|
|
189
|
-
throw new Error("Expected the field `source` to be a primitive type in the JSON string but got " + data[
|
|
190
|
+
if (data['source'] && !(typeof data['source'] === 'string' || data['source'] instanceof String)) {
|
|
191
|
+
throw new Error("Expected the field `source` to be a primitive type in the JSON string but got " + data['source']);
|
|
190
192
|
}
|
|
191
193
|
// ensure the json data is a string
|
|
192
|
-
if (data[
|
|
193
|
-
throw new Error("Expected the field `uid` to be a primitive type in the JSON string but got " + data[
|
|
194
|
+
if (data['uid'] && !(typeof data['uid'] === 'string' || data['uid'] instanceof String)) {
|
|
195
|
+
throw new Error("Expected the field `uid` to be a primitive type in the JSON string but got " + data['uid']);
|
|
194
196
|
}
|
|
195
197
|
return true;
|
|
196
198
|
}
|
|
@@ -200,100 +202,100 @@ var Alert = /*#__PURE__*/function () {
|
|
|
200
202
|
* The source of the alert
|
|
201
203
|
* @member {module:model/Alert.AlertSourceEnum} alert_source
|
|
202
204
|
*/
|
|
203
|
-
Alert.prototype[
|
|
205
|
+
Alert.prototype['alert_source'] = undefined;
|
|
204
206
|
|
|
205
207
|
/**
|
|
206
208
|
* The time the alert was created
|
|
207
209
|
* @member {Number} created_at
|
|
208
210
|
*/
|
|
209
|
-
Alert.prototype[
|
|
211
|
+
Alert.prototype['created_at'] = undefined;
|
|
210
212
|
|
|
211
213
|
/**
|
|
212
214
|
* @member {Array.<module:model/AlertDataInner>} data
|
|
213
215
|
*/
|
|
214
|
-
Alert.prototype[
|
|
216
|
+
Alert.prototype['data'] = undefined;
|
|
215
217
|
|
|
216
218
|
/**
|
|
217
219
|
* Device UID
|
|
218
220
|
* @member {String} device_uid
|
|
219
221
|
*/
|
|
220
|
-
Alert.prototype[
|
|
222
|
+
Alert.prototype['device_uid'] = undefined;
|
|
221
223
|
|
|
222
224
|
/**
|
|
223
225
|
* The field name that triggered the alert
|
|
224
226
|
* @member {String} field_name
|
|
225
227
|
*/
|
|
226
|
-
Alert.prototype[
|
|
228
|
+
Alert.prototype['field_name'] = undefined;
|
|
227
229
|
|
|
228
230
|
/**
|
|
229
231
|
* Monitor Name
|
|
230
232
|
* @member {String} monitor_name
|
|
231
233
|
*/
|
|
232
|
-
Alert.prototype[
|
|
234
|
+
Alert.prototype['monitor_name'] = undefined;
|
|
233
235
|
|
|
234
236
|
/**
|
|
235
237
|
* The type of monitor that triggered the alert
|
|
236
238
|
* @member {module:model/Alert.MonitorTypeEnum} monitor_type
|
|
237
239
|
*/
|
|
238
|
-
Alert.prototype[
|
|
240
|
+
Alert.prototype['monitor_type'] = undefined;
|
|
239
241
|
|
|
240
242
|
/**
|
|
241
243
|
* Monitor UID
|
|
242
244
|
* @member {String} monitor_uid
|
|
243
245
|
*/
|
|
244
|
-
Alert.prototype[
|
|
246
|
+
Alert.prototype['monitor_uid'] = undefined;
|
|
245
247
|
|
|
246
248
|
/**
|
|
247
249
|
* @member {Array.<module:model/AlertNotificationsInner>} notifications
|
|
248
250
|
*/
|
|
249
|
-
Alert.prototype[
|
|
251
|
+
Alert.prototype['notifications'] = undefined;
|
|
250
252
|
|
|
251
253
|
/**
|
|
252
254
|
* If true, the alert has been resolved
|
|
253
255
|
* @member {Boolean} resolved
|
|
254
256
|
*/
|
|
255
|
-
Alert.prototype[
|
|
257
|
+
Alert.prototype['resolved'] = undefined;
|
|
256
258
|
|
|
257
259
|
/**
|
|
258
260
|
* The UID of the source of the alert
|
|
259
261
|
* @member {String} source
|
|
260
262
|
*/
|
|
261
|
-
Alert.prototype[
|
|
263
|
+
Alert.prototype['source'] = undefined;
|
|
262
264
|
|
|
263
265
|
/**
|
|
264
266
|
* Alert UID
|
|
265
267
|
* @member {String} uid
|
|
266
268
|
*/
|
|
267
|
-
Alert.prototype[
|
|
269
|
+
Alert.prototype['uid'] = undefined;
|
|
268
270
|
|
|
269
271
|
/**
|
|
270
272
|
* The value that triggered the alert
|
|
271
273
|
* @member {Number} value
|
|
272
274
|
*/
|
|
273
|
-
Alert.prototype[
|
|
275
|
+
Alert.prototype['value'] = undefined;
|
|
274
276
|
|
|
275
277
|
/**
|
|
276
278
|
* The version of the alert
|
|
277
279
|
* @member {Number} version
|
|
278
280
|
*/
|
|
279
|
-
Alert.prototype[
|
|
281
|
+
Alert.prototype['version'] = undefined;
|
|
280
282
|
|
|
281
283
|
/**
|
|
282
284
|
* Allowed values for the <code>alert_source</code> property.
|
|
283
285
|
* @enum {String}
|
|
284
286
|
* @readonly
|
|
285
287
|
*/
|
|
286
|
-
Alert[
|
|
288
|
+
Alert['AlertSourceEnum'] = {
|
|
287
289
|
/**
|
|
288
290
|
* value: "app"
|
|
289
291
|
* @const
|
|
290
292
|
*/
|
|
291
|
-
app: "app",
|
|
293
|
+
"app": "app",
|
|
292
294
|
/**
|
|
293
295
|
* value: "device"
|
|
294
296
|
* @const
|
|
295
297
|
*/
|
|
296
|
-
device: "device"
|
|
298
|
+
"device": "device"
|
|
297
299
|
};
|
|
298
300
|
|
|
299
301
|
/**
|
|
@@ -301,16 +303,16 @@ Alert["AlertSourceEnum"] = {
|
|
|
301
303
|
* @enum {String}
|
|
302
304
|
* @readonly
|
|
303
305
|
*/
|
|
304
|
-
Alert[
|
|
306
|
+
Alert['MonitorTypeEnum'] = {
|
|
305
307
|
/**
|
|
306
308
|
* value: "event"
|
|
307
309
|
* @const
|
|
308
310
|
*/
|
|
309
|
-
event: "event",
|
|
311
|
+
"event": "event",
|
|
310
312
|
/**
|
|
311
313
|
* value: "device"
|
|
312
314
|
* @const
|
|
313
315
|
*/
|
|
314
|
-
device: "device"
|
|
316
|
+
"device": "device"
|
|
315
317
|
};
|
|
316
318
|
var _default = exports["default"] = Alert;
|