@blues-inc/notehub-js 1.0.37 → 1.0.38-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/README.md +245 -234
  2. package/dist/ApiClient.js +154 -156
  3. package/dist/api/AlertApi.js +22 -22
  4. package/dist/api/AuthorizationApi.js +79 -16
  5. package/dist/api/BillingAccountApi.js +14 -14
  6. package/dist/api/DeviceApi.js +369 -369
  7. package/dist/api/EventApi.js +118 -118
  8. package/dist/api/ExternalDevicesApi.js +41 -41
  9. package/dist/api/MonitorApi.js +61 -61
  10. package/dist/api/ProjectApi.js +383 -383
  11. package/dist/api/RouteApi.js +77 -77
  12. package/dist/api/UsageApi.js +285 -0
  13. package/dist/api/WebhookApi.js +51 -51
  14. package/dist/index.js +106 -99
  15. package/dist/model/Alert.js +114 -112
  16. package/dist/model/AlertDataInner.js +39 -39
  17. package/dist/model/AlertNotificationsInner.js +22 -22
  18. package/dist/model/Aws.js +95 -95
  19. package/dist/model/{HttpFilter.js → AwsFilter.js} +40 -40
  20. package/dist/model/{HttpTransform.js → AwsTransform.js} +37 -37
  21. package/dist/model/Azure.js +61 -61
  22. package/dist/model/BillingAccount.js +28 -28
  23. package/dist/model/BillingAccountRole.js +9 -9
  24. package/dist/model/Body.js +5 -5
  25. package/dist/model/CloneProjectRequest.js +31 -31
  26. package/dist/model/Contact.js +26 -26
  27. package/dist/model/CreateFleetRequest.js +12 -12
  28. package/dist/model/CreateMonitor.js +216 -215
  29. package/dist/model/CreateProductRequest.js +36 -36
  30. package/dist/model/CreateProjectRequest.js +23 -23
  31. package/dist/model/CreateUpdateRepository.js +22 -22
  32. package/dist/model/CurrentFirmware.js +16 -16
  33. package/dist/model/DFUEnv.js +12 -12
  34. package/dist/model/DFUState.js +97 -97
  35. package/dist/model/DataField.js +7 -7
  36. package/dist/model/DataSetField.js +24 -24
  37. package/dist/model/DeleteDeviceFleetsRequest.js +8 -8
  38. package/dist/model/Device.js +153 -152
  39. package/dist/model/DeviceDfuHistory.js +26 -25
  40. package/dist/model/{DeviceDfuStatusCurrent.js → DeviceDfuHistoryCurrent.js} +58 -58
  41. package/dist/model/DeviceDfuHistoryPage.js +13 -12
  42. package/dist/model/DeviceDfuStateMachine.js +30 -29
  43. package/dist/model/DeviceDfuStateMachineNode.js +30 -30
  44. package/dist/model/DeviceDfuStatus.js +27 -27
  45. package/dist/model/DeviceDfuStatusPage.js +13 -12
  46. package/dist/model/DeviceSession.js +300 -300
  47. package/dist/model/DeviceTowerInfo.js +18 -18
  48. package/dist/model/DeviceUsage.js +44 -44
  49. package/dist/model/DfuActionRequest.js +7 -7
  50. package/dist/model/EmailNotification.js +7 -7
  51. package/dist/model/EnvTreeJsonNode.js +100 -98
  52. package/dist/model/EnvVar.js +20 -20
  53. package/dist/model/EnvironmentVariables.js +8 -8
  54. package/dist/model/Error.js +45 -45
  55. package/dist/model/Event.js +365 -365
  56. package/dist/model/Firmware.js +59 -59
  57. package/dist/model/FirmwareInfo.js +83 -83
  58. package/dist/model/Fleet.js +47 -47
  59. package/dist/model/GetAlerts200Response.js +15 -14
  60. package/dist/model/GetBillingAccounts200Response.js +10 -9
  61. package/dist/model/{GetDeviceEnvironmentVariables200Response.js → GetDeviceEnvironmentVariablesByPin200Response.js} +38 -38
  62. package/dist/model/{GetProjectFleets200Response.js → GetDeviceFleets200Response.js} +30 -29
  63. package/dist/model/GetDeviceHealthLog200Response.js +12 -11
  64. package/dist/model/GetDeviceHealthLog200ResponseHealthLogInner.js +26 -26
  65. package/dist/model/GetDeviceLatest200Response.js +10 -9
  66. package/dist/model/GetDevicePublicKey200Response.js +22 -22
  67. package/dist/model/GetDeviceSessions200Response.js +23 -22
  68. package/dist/model/GetProjectDevicePublicKeys200Response.js +17 -16
  69. package/dist/model/GetProjectDevicePublicKeys200ResponseDevicePublicKeysInner.js +14 -14
  70. package/dist/model/GetProjectDevices200Response.js +17 -16
  71. package/dist/model/GetProjectEvents200Response.js +21 -20
  72. package/dist/model/GetProjectEventsByCursor200Response.js +31 -30
  73. package/dist/model/GetProjectMembers200Response.js +12 -11
  74. package/dist/model/GetProjectProducts200Response.js +10 -9
  75. package/dist/model/GetProjects200Response.js +10 -9
  76. package/dist/model/GetWebhooks200Response.js +10 -9
  77. package/dist/model/Google.js +50 -50
  78. package/dist/model/HandleNoteChanges200Response.js +16 -16
  79. package/dist/model/HandleNoteGet200Response.js +13 -13
  80. package/dist/model/HandleNoteSignal200Response.js +5 -5
  81. package/dist/model/HandleNotefileChanges200Response.js +16 -16
  82. package/dist/model/HandleNotefileChangesPending200Response.js +20 -20
  83. package/dist/model/HandleNotefileDeleteRequest.js +7 -7
  84. package/dist/model/Http.js +54 -54
  85. package/dist/model/Location.js +50 -50
  86. package/dist/model/Login200Response.js +7 -7
  87. package/dist/model/LoginRequest.js +14 -14
  88. package/dist/model/Monitor.js +159 -158
  89. package/dist/model/MonitorAlertRoutesInner.js +18 -19
  90. package/dist/model/Mqtt.js +98 -98
  91. package/dist/model/Note.js +10 -10
  92. package/dist/model/NotefileSchema.js +19 -18
  93. package/dist/model/NotehubRoute.js +49 -49
  94. package/dist/model/NotehubRouteSchema.js +100 -101
  95. package/dist/model/{QuestionDataResponseMap.js → OAuth2Error.js} +66 -43
  96. package/dist/model/OAuth2TokenResponse.js +154 -0
  97. package/dist/model/PersonalAccessToken.js +49 -49
  98. package/dist/model/PersonalAccessTokenCreatedBy.js +20 -20
  99. package/dist/model/PersonalAccessTokenInfo.js +22 -22
  100. package/dist/model/PersonalAccessTokenSecret.js +16 -16
  101. package/dist/model/PostProvisionProjectDeviceRequest.js +25 -25
  102. package/dist/model/Product.js +36 -36
  103. package/dist/model/Project.js +47 -47
  104. package/dist/model/ProjectMember.js +28 -28
  105. package/dist/model/Proxy.js +34 -34
  106. package/dist/model/PutDeviceFleetsRequest.js +8 -8
  107. package/dist/model/Radresponder.js +34 -34
  108. package/dist/model/Repository.js +28 -28
  109. package/dist/model/Role.js +9 -9
  110. package/dist/model/RouteLog.js +48 -48
  111. package/dist/model/SchemaProperty.js +54 -54
  112. package/dist/model/SimUsage.js +27 -27
  113. package/dist/model/Slack.js +82 -82
  114. package/dist/model/SlackBearerNotification.js +30 -30
  115. package/dist/model/{SnowflakeTransform.js → SlackTransform.js} +28 -28
  116. package/dist/model/SlackWebHookNotification.js +25 -25
  117. package/dist/model/Snowflake.js +66 -66
  118. package/dist/model/Thingworx.js +48 -48
  119. package/dist/model/TowerLocation.js +75 -75
  120. package/dist/model/Twilio.js +65 -65
  121. package/dist/model/UpdateFleetRequest.js +31 -31
  122. package/dist/model/UploadMetadata.js +75 -75
  123. package/dist/model/{AnalyticsEventsData.js → UsageData.js} +45 -39
  124. package/dist/model/{AnalyticsRouteLogsData.js → UsageEventsData.js} +49 -45
  125. package/dist/model/{AnalyticsEventsResponse.js → UsageEventsResponse.js} +33 -32
  126. package/dist/model/UsageRouteLogsData.js +154 -0
  127. package/dist/model/{AnalyticsSessionsResponse.js → UsageRouteLogsResponse.js} +33 -32
  128. package/dist/model/{AnalyticsSessionsData.js → UsageSessionsData.js} +48 -44
  129. package/dist/model/{AnalyticsRouteLogsResponse.js → UsageSessionsResponse.js} +33 -32
  130. package/dist/model/UserDbRoute.js +33 -33
  131. package/dist/model/UserDfuStateMachine.js +27 -27
  132. package/dist/model/UserDfuStateMachineStatus.js +23 -23
  133. package/dist/model/UserFirmwareInfo.js +12 -12
  134. package/dist/model/WebhookSettings.js +15 -15
  135. package/package.json +28 -28
  136. package/dist/model/DataSet.js +0 -163
  137. package/dist/model/QuestionDataResponseLineChart.js +0 -204
@@ -17,7 +17,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
17
17
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
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
19
  * Notehub API
20
- * The OpenAPI definition for the Notehub.io API.
20
+ * The OpenAPI definition for the Notehub.io API.
21
21
  *
22
22
  * The version of the OpenAPI document: 1.2.0
23
23
  * Contact: engineering@blues.io
@@ -28,18 +28,18 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
28
28
  *
29
29
  */
30
30
  /**
31
- * Route service.
32
- * @module api/RouteApi
33
- * @version 1.0.37
34
- */
31
+ * Route service.
32
+ * @module api/RouteApi
33
+ * @version 1.0.38-beta.1
34
+ */
35
35
  var RouteApi = exports["default"] = /*#__PURE__*/function () {
36
36
  /**
37
- * Constructs a new RouteApi.
38
- * @alias module:api/RouteApi
39
- * @class
40
- * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
41
- * default to {@link module:ApiClient#instance} if unspecified.
42
- */
37
+ * Constructs a new RouteApi.
38
+ * @alias module:api/RouteApi
39
+ * @class
40
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
41
+ * default to {@link module:ApiClient#instance} if unspecified.
42
+ */
43
43
  function RouteApi(apiClient) {
44
44
  _classCallCheck(this, RouteApi);
45
45
  this.apiClient = apiClient || _ApiClient["default"].instance;
@@ -47,7 +47,7 @@ var RouteApi = exports["default"] = /*#__PURE__*/function () {
47
47
 
48
48
  /**
49
49
  * Create Route within a Project
50
- * @param {String} projectOrProductUID
50
+ * @param {String} projectOrProductUID
51
51
  * @param {module:model/NotehubRoute} notehubRoute Route to be Created
52
52
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/NotehubRoute} and HTTP response
53
53
  */
@@ -64,21 +64,21 @@ var RouteApi = exports["default"] = /*#__PURE__*/function () {
64
64
  throw new _Error["default"]("Missing the required parameter 'notehubRoute' when calling createRoute");
65
65
  }
66
66
  var pathParams = {
67
- projectOrProductUID: projectOrProductUID
67
+ 'projectOrProductUID': projectOrProductUID
68
68
  };
69
69
  var queryParams = {};
70
70
  var headerParams = {};
71
71
  var formParams = {};
72
- var authNames = ["api_key"];
73
- var contentTypes = ["application/json"];
74
- var accepts = ["application/json"];
72
+ var authNames = ['personalAccessToken'];
73
+ var contentTypes = ['application/json'];
74
+ var accepts = ['application/json'];
75
75
  var returnType = _NotehubRoute["default"];
76
- return this.apiClient.callApi("/v1/projects/{projectOrProductUID}/routes", "POST", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
76
+ return this.apiClient.callApi('/v1/projects/{projectOrProductUID}/routes', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
77
77
  }
78
78
 
79
79
  /**
80
80
  * Create Route within a Project
81
- * @param {String} projectOrProductUID
81
+ * @param {String} projectOrProductUID
82
82
  * @param {module:model/NotehubRoute} notehubRoute Route to be Created
83
83
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/NotehubRoute}
84
84
  */
@@ -92,8 +92,8 @@ var RouteApi = exports["default"] = /*#__PURE__*/function () {
92
92
 
93
93
  /**
94
94
  * Delete single route within a project
95
- * @param {String} projectOrProductUID
96
- * @param {String} routeUID
95
+ * @param {String} projectOrProductUID
96
+ * @param {String} routeUID
97
97
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response
98
98
  */
99
99
  }, {
@@ -109,23 +109,23 @@ var RouteApi = exports["default"] = /*#__PURE__*/function () {
109
109
  throw new _Error["default"]("Missing the required parameter 'routeUID' when calling deleteRoute");
110
110
  }
111
111
  var pathParams = {
112
- projectOrProductUID: projectOrProductUID,
113
- routeUID: routeUID
112
+ 'projectOrProductUID': projectOrProductUID,
113
+ 'routeUID': routeUID
114
114
  };
115
115
  var queryParams = {};
116
116
  var headerParams = {};
117
117
  var formParams = {};
118
- var authNames = ["api_key"];
118
+ var authNames = ['personalAccessToken'];
119
119
  var contentTypes = [];
120
- var accepts = ["application/json"];
120
+ var accepts = ['application/json'];
121
121
  var returnType = Object;
122
- return this.apiClient.callApi("/v1/projects/{projectOrProductUID}/routes/{routeUID}", "DELETE", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
122
+ return this.apiClient.callApi('/v1/projects/{projectOrProductUID}/routes/{routeUID}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
123
123
  }
124
124
 
125
125
  /**
126
126
  * Delete single route within a project
127
- * @param {String} projectOrProductUID
128
- * @param {String} routeUID
127
+ * @param {String} projectOrProductUID
128
+ * @param {String} routeUID
129
129
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object}
130
130
  */
131
131
  }, {
@@ -138,8 +138,8 @@ var RouteApi = exports["default"] = /*#__PURE__*/function () {
138
138
 
139
139
  /**
140
140
  * Get single route within a project
141
- * @param {String} projectOrProductUID
142
- * @param {String} routeUID
141
+ * @param {String} projectOrProductUID
142
+ * @param {String} routeUID
143
143
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/NotehubRoute} and HTTP response
144
144
  */
145
145
  }, {
@@ -155,23 +155,23 @@ var RouteApi = exports["default"] = /*#__PURE__*/function () {
155
155
  throw new _Error["default"]("Missing the required parameter 'routeUID' when calling getRoute");
156
156
  }
157
157
  var pathParams = {
158
- projectOrProductUID: projectOrProductUID,
159
- routeUID: routeUID
158
+ 'projectOrProductUID': projectOrProductUID,
159
+ 'routeUID': routeUID
160
160
  };
161
161
  var queryParams = {};
162
162
  var headerParams = {};
163
163
  var formParams = {};
164
- var authNames = ["api_key"];
164
+ var authNames = ['personalAccessToken'];
165
165
  var contentTypes = [];
166
- var accepts = ["application/json"];
166
+ var accepts = ['application/json'];
167
167
  var returnType = _NotehubRoute["default"];
168
- return this.apiClient.callApi("/v1/projects/{projectOrProductUID}/routes/{routeUID}", "GET", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
168
+ return this.apiClient.callApi('/v1/projects/{projectOrProductUID}/routes/{routeUID}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
169
169
  }
170
170
 
171
171
  /**
172
172
  * Get single route within a project
173
- * @param {String} projectOrProductUID
174
- * @param {String} routeUID
173
+ * @param {String} projectOrProductUID
174
+ * @param {String} routeUID
175
175
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/NotehubRoute}
176
176
  */
177
177
  }, {
@@ -184,8 +184,8 @@ var RouteApi = exports["default"] = /*#__PURE__*/function () {
184
184
 
185
185
  /**
186
186
  * Get Route Logs by Route UID
187
- * @param {String} projectOrProductUID
188
- * @param {String} routeUID
187
+ * @param {String} projectOrProductUID
188
+ * @param {String} routeUID
189
189
  * @param {Object} opts Optional parameters
190
190
  * @param {Number} opts.pageSize (default to 50)
191
191
  * @param {Number} opts.pageNum (default to 1)
@@ -194,9 +194,9 @@ var RouteApi = exports["default"] = /*#__PURE__*/function () {
194
194
  * @param {module:model/String} opts.sortOrder (default to 'desc')
195
195
  * @param {Number} opts.startDate Start date for filtering results, specified as a Unix timestamp
196
196
  * @param {Number} opts.endDate End date for filtering results, specified as a Unix timestamp
197
- * @param {Boolean} opts.systemFilesOnly
198
- * @param {Boolean} opts.mostRecentOnly
199
- * @param {String} opts.files
197
+ * @param {Boolean} opts.systemFilesOnly
198
+ * @param {Boolean} opts.mostRecentOnly
199
+ * @param {String} opts.files
200
200
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/RouteLog>} and HTTP response
201
201
  */
202
202
  }, {
@@ -213,34 +213,34 @@ var RouteApi = exports["default"] = /*#__PURE__*/function () {
213
213
  throw new _Error["default"]("Missing the required parameter 'routeUID' when calling getRouteLogsByRoute");
214
214
  }
215
215
  var pathParams = {
216
- projectOrProductUID: projectOrProductUID,
217
- routeUID: routeUID
216
+ 'projectOrProductUID': projectOrProductUID,
217
+ 'routeUID': routeUID
218
218
  };
219
219
  var queryParams = {
220
- pageSize: opts["pageSize"],
221
- pageNum: opts["pageNum"],
222
- deviceUID: this.apiClient.buildCollectionParam(opts["deviceUID"], "multi"),
223
- sortBy: opts["sortBy"],
224
- sortOrder: opts["sortOrder"],
225
- startDate: opts["startDate"],
226
- endDate: opts["endDate"],
227
- systemFilesOnly: opts["systemFilesOnly"],
228
- mostRecentOnly: opts["mostRecentOnly"],
229
- files: opts["files"]
220
+ 'pageSize': opts['pageSize'],
221
+ 'pageNum': opts['pageNum'],
222
+ 'deviceUID': this.apiClient.buildCollectionParam(opts['deviceUID'], 'multi'),
223
+ 'sortBy': opts['sortBy'],
224
+ 'sortOrder': opts['sortOrder'],
225
+ 'startDate': opts['startDate'],
226
+ 'endDate': opts['endDate'],
227
+ 'systemFilesOnly': opts['systemFilesOnly'],
228
+ 'mostRecentOnly': opts['mostRecentOnly'],
229
+ 'files': opts['files']
230
230
  };
231
231
  var headerParams = {};
232
232
  var formParams = {};
233
- var authNames = ["api_key"];
233
+ var authNames = ['personalAccessToken'];
234
234
  var contentTypes = [];
235
- var accepts = ["application/json"];
235
+ var accepts = ['application/json'];
236
236
  var returnType = [_RouteLog["default"]];
237
- return this.apiClient.callApi("/v1/projects/{projectOrProductUID}/routes/{routeUID}/route-logs", "GET", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
237
+ return this.apiClient.callApi('/v1/projects/{projectOrProductUID}/routes/{routeUID}/route-logs', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
238
238
  }
239
239
 
240
240
  /**
241
241
  * Get Route Logs by Route UID
242
- * @param {String} projectOrProductUID
243
- * @param {String} routeUID
242
+ * @param {String} projectOrProductUID
243
+ * @param {String} routeUID
244
244
  * @param {Object} opts Optional parameters
245
245
  * @param {Number} opts.pageSize (default to 50)
246
246
  * @param {Number} opts.pageNum (default to 1)
@@ -249,9 +249,9 @@ var RouteApi = exports["default"] = /*#__PURE__*/function () {
249
249
  * @param {module:model/String} opts.sortOrder (default to 'desc')
250
250
  * @param {Number} opts.startDate Start date for filtering results, specified as a Unix timestamp
251
251
  * @param {Number} opts.endDate End date for filtering results, specified as a Unix timestamp
252
- * @param {Boolean} opts.systemFilesOnly
253
- * @param {Boolean} opts.mostRecentOnly
254
- * @param {String} opts.files
252
+ * @param {Boolean} opts.systemFilesOnly
253
+ * @param {Boolean} opts.mostRecentOnly
254
+ * @param {String} opts.files
255
255
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/RouteLog>}
256
256
  */
257
257
  }, {
@@ -264,7 +264,7 @@ var RouteApi = exports["default"] = /*#__PURE__*/function () {
264
264
 
265
265
  /**
266
266
  * Get all Routes within a Project
267
- * @param {String} projectOrProductUID
267
+ * @param {String} projectOrProductUID
268
268
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/UserDbRoute>} and HTTP response
269
269
  */
270
270
  }, {
@@ -276,21 +276,21 @@ var RouteApi = exports["default"] = /*#__PURE__*/function () {
276
276
  throw new _Error["default"]("Missing the required parameter 'projectOrProductUID' when calling getRoutes");
277
277
  }
278
278
  var pathParams = {
279
- projectOrProductUID: projectOrProductUID
279
+ 'projectOrProductUID': projectOrProductUID
280
280
  };
281
281
  var queryParams = {};
282
282
  var headerParams = {};
283
283
  var formParams = {};
284
- var authNames = ["api_key"];
284
+ var authNames = ['personalAccessToken'];
285
285
  var contentTypes = [];
286
- var accepts = ["application/json"];
286
+ var accepts = ['application/json'];
287
287
  var returnType = [_UserDbRoute["default"]];
288
- return this.apiClient.callApi("/v1/projects/{projectOrProductUID}/routes", "GET", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
288
+ return this.apiClient.callApi('/v1/projects/{projectOrProductUID}/routes', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
289
289
  }
290
290
 
291
291
  /**
292
292
  * Get all Routes within a Project
293
- * @param {String} projectOrProductUID
293
+ * @param {String} projectOrProductUID
294
294
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/UserDbRoute>}
295
295
  */
296
296
  }, {
@@ -303,8 +303,8 @@ var RouteApi = exports["default"] = /*#__PURE__*/function () {
303
303
 
304
304
  /**
305
305
  * Update route by UID
306
- * @param {String} projectOrProductUID
307
- * @param {String} routeUID
306
+ * @param {String} projectOrProductUID
307
+ * @param {String} routeUID
308
308
  * @param {module:model/NotehubRoute} notehubRoute Route settings to be updated
309
309
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/NotehubRoute} and HTTP response
310
310
  */
@@ -325,23 +325,23 @@ var RouteApi = exports["default"] = /*#__PURE__*/function () {
325
325
  throw new _Error["default"]("Missing the required parameter 'notehubRoute' when calling updateRoute");
326
326
  }
327
327
  var pathParams = {
328
- projectOrProductUID: projectOrProductUID,
329
- routeUID: routeUID
328
+ 'projectOrProductUID': projectOrProductUID,
329
+ 'routeUID': routeUID
330
330
  };
331
331
  var queryParams = {};
332
332
  var headerParams = {};
333
333
  var formParams = {};
334
- var authNames = ["api_key"];
335
- var contentTypes = ["application/json"];
336
- var accepts = ["application/json"];
334
+ var authNames = ['personalAccessToken'];
335
+ var contentTypes = ['application/json'];
336
+ var accepts = ['application/json'];
337
337
  var returnType = _NotehubRoute["default"];
338
- return this.apiClient.callApi("/v1/projects/{projectOrProductUID}/routes/{routeUID}", "PUT", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
338
+ return this.apiClient.callApi('/v1/projects/{projectOrProductUID}/routes/{routeUID}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
339
339
  }
340
340
 
341
341
  /**
342
342
  * Update route by UID
343
- * @param {String} projectOrProductUID
344
- * @param {String} routeUID
343
+ * @param {String} projectOrProductUID
344
+ * @param {String} routeUID
345
345
  * @param {module:model/NotehubRoute} notehubRoute Route settings to be updated
346
346
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/NotehubRoute}
347
347
  */
@@ -0,0 +1,285 @@
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 _Error = _interopRequireDefault(require("../model/Error"));
9
+ var _UsageData = _interopRequireDefault(require("../model/UsageData"));
10
+ var _UsageEventsResponse = _interopRequireDefault(require("../model/UsageEventsResponse"));
11
+ var _UsageRouteLogsResponse = _interopRequireDefault(require("../model/UsageRouteLogsResponse"));
12
+ var _UsageSessionsResponse = _interopRequireDefault(require("../model/UsageSessionsResponse"));
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
14
+ 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); }
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
+ * Usage service.
33
+ * @module api/UsageApi
34
+ * @version 1.0.38-beta.1
35
+ */
36
+ var UsageApi = exports["default"] = /*#__PURE__*/function () {
37
+ /**
38
+ * Constructs a new UsageApi.
39
+ * @alias module:api/UsageApi
40
+ * @class
41
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
42
+ * default to {@link module:ApiClient#instance} if unspecified.
43
+ */
44
+ function UsageApi(apiClient) {
45
+ _classCallCheck(this, UsageApi);
46
+ this.apiClient = apiClient || _ApiClient["default"].instance;
47
+ }
48
+
49
+ /**
50
+ * Get data usage in bytes for a project with time range and period aggregation
51
+ * @param {String} projectOrProductUID
52
+ * @param {module:model/String} period Period type for aggregation
53
+ * @param {Object} opts Optional parameters
54
+ * @param {Number} opts.startDate Start date for filtering results, specified as a Unix timestamp
55
+ * @param {Number} opts.endDate End date for filtering results, specified as a Unix timestamp
56
+ * @param {Array.<String>} opts.deviceUID A Device UID.
57
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<Object>} and HTTP response
58
+ */
59
+ return _createClass(UsageApi, [{
60
+ key: "getProjectDataUsageWithHttpInfo",
61
+ value: function getProjectDataUsageWithHttpInfo(projectOrProductUID, period, opts) {
62
+ opts = opts || {};
63
+ var postBody = null;
64
+ // verify the required parameter 'projectOrProductUID' is set
65
+ if (projectOrProductUID === undefined || projectOrProductUID === null) {
66
+ throw new _Error["default"]("Missing the required parameter 'projectOrProductUID' when calling getProjectDataUsage");
67
+ }
68
+ // verify the required parameter 'period' is set
69
+ if (period === undefined || period === null) {
70
+ throw new _Error["default"]("Missing the required parameter 'period' when calling getProjectDataUsage");
71
+ }
72
+ var pathParams = {
73
+ 'projectOrProductUID': projectOrProductUID
74
+ };
75
+ var queryParams = {
76
+ 'startDate': opts['startDate'],
77
+ 'endDate': opts['endDate'],
78
+ 'deviceUID': this.apiClient.buildCollectionParam(opts['deviceUID'], 'multi'),
79
+ 'period': period
80
+ };
81
+ var headerParams = {};
82
+ var formParams = {};
83
+ var authNames = [];
84
+ var contentTypes = [];
85
+ var accepts = ['application/json'];
86
+ var returnType = [Object];
87
+ return this.apiClient.callApi('/v1/projects/{projectOrProductUID}/usage/data', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
88
+ }
89
+
90
+ /**
91
+ * Get data usage in bytes for a project with time range and period aggregation
92
+ * @param {String} projectOrProductUID
93
+ * @param {module:model/String} period Period type for aggregation
94
+ * @param {Object} opts Optional parameters
95
+ * @param {Number} opts.startDate Start date for filtering results, specified as a Unix timestamp
96
+ * @param {Number} opts.endDate End date for filtering results, specified as a Unix timestamp
97
+ * @param {Array.<String>} opts.deviceUID A Device UID.
98
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<Object>}
99
+ */
100
+ }, {
101
+ key: "getProjectDataUsage",
102
+ value: function getProjectDataUsage(projectOrProductUID, period, opts) {
103
+ return this.getProjectDataUsageWithHttpInfo(projectOrProductUID, period, opts).then(function (response_and_data) {
104
+ return response_and_data.data;
105
+ });
106
+ }
107
+
108
+ /**
109
+ * Get events usage for a project with time range and period aggregation
110
+ * @param {String} projectOrProductUID
111
+ * @param {module:model/String} period Period type for aggregation
112
+ * @param {Object} opts Optional parameters
113
+ * @param {Number} opts.startDate Start date for filtering results, specified as a Unix timestamp
114
+ * @param {Number} opts.endDate End date for filtering results, specified as a Unix timestamp
115
+ * @param {Array.<String>} opts.deviceUID A Device UID.
116
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UsageEventsResponse} and HTTP response
117
+ */
118
+ }, {
119
+ key: "getProjectEventsUsageWithHttpInfo",
120
+ value: function getProjectEventsUsageWithHttpInfo(projectOrProductUID, period, opts) {
121
+ opts = opts || {};
122
+ var postBody = null;
123
+ // verify the required parameter 'projectOrProductUID' is set
124
+ if (projectOrProductUID === undefined || projectOrProductUID === null) {
125
+ throw new _Error["default"]("Missing the required parameter 'projectOrProductUID' when calling getProjectEventsUsage");
126
+ }
127
+ // verify the required parameter 'period' is set
128
+ if (period === undefined || period === null) {
129
+ throw new _Error["default"]("Missing the required parameter 'period' when calling getProjectEventsUsage");
130
+ }
131
+ var pathParams = {
132
+ 'projectOrProductUID': projectOrProductUID
133
+ };
134
+ var queryParams = {
135
+ 'startDate': opts['startDate'],
136
+ 'endDate': opts['endDate'],
137
+ 'deviceUID': this.apiClient.buildCollectionParam(opts['deviceUID'], 'multi'),
138
+ 'period': period
139
+ };
140
+ var headerParams = {};
141
+ var formParams = {};
142
+ var authNames = ['personalAccessToken'];
143
+ var contentTypes = [];
144
+ var accepts = ['application/json'];
145
+ var returnType = _UsageEventsResponse["default"];
146
+ return this.apiClient.callApi('/v1/projects/{projectOrProductUID}/usage/events', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
147
+ }
148
+
149
+ /**
150
+ * Get events usage for a project with time range and period aggregation
151
+ * @param {String} projectOrProductUID
152
+ * @param {module:model/String} period Period type for aggregation
153
+ * @param {Object} opts Optional parameters
154
+ * @param {Number} opts.startDate Start date for filtering results, specified as a Unix timestamp
155
+ * @param {Number} opts.endDate End date for filtering results, specified as a Unix timestamp
156
+ * @param {Array.<String>} opts.deviceUID A Device UID.
157
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UsageEventsResponse}
158
+ */
159
+ }, {
160
+ key: "getProjectEventsUsage",
161
+ value: function getProjectEventsUsage(projectOrProductUID, period, opts) {
162
+ return this.getProjectEventsUsageWithHttpInfo(projectOrProductUID, period, opts).then(function (response_and_data) {
163
+ return response_and_data.data;
164
+ });
165
+ }
166
+
167
+ /**
168
+ * Get route logs usage for a project with time range and period aggregation
169
+ * @param {String} projectOrProductUID
170
+ * @param {module:model/String} period Period type for aggregation
171
+ * @param {Object} opts Optional parameters
172
+ * @param {Number} opts.startDate Start date for filtering results, specified as a Unix timestamp
173
+ * @param {Number} opts.endDate End date for filtering results, specified as a Unix timestamp
174
+ * @param {Array.<String>} opts.deviceUID A Device UID.
175
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UsageRouteLogsResponse} and HTTP response
176
+ */
177
+ }, {
178
+ key: "getRouteLogsUsageWithHttpInfo",
179
+ value: function getRouteLogsUsageWithHttpInfo(projectOrProductUID, period, opts) {
180
+ opts = opts || {};
181
+ var postBody = null;
182
+ // verify the required parameter 'projectOrProductUID' is set
183
+ if (projectOrProductUID === undefined || projectOrProductUID === null) {
184
+ throw new _Error["default"]("Missing the required parameter 'projectOrProductUID' when calling getRouteLogsUsage");
185
+ }
186
+ // verify the required parameter 'period' is set
187
+ if (period === undefined || period === null) {
188
+ throw new _Error["default"]("Missing the required parameter 'period' when calling getRouteLogsUsage");
189
+ }
190
+ var pathParams = {
191
+ 'projectOrProductUID': projectOrProductUID
192
+ };
193
+ var queryParams = {
194
+ 'startDate': opts['startDate'],
195
+ 'endDate': opts['endDate'],
196
+ 'deviceUID': this.apiClient.buildCollectionParam(opts['deviceUID'], 'multi'),
197
+ 'period': period
198
+ };
199
+ var headerParams = {};
200
+ var formParams = {};
201
+ var authNames = ['personalAccessToken'];
202
+ var contentTypes = [];
203
+ var accepts = ['application/json'];
204
+ var returnType = _UsageRouteLogsResponse["default"];
205
+ return this.apiClient.callApi('/v1/projects/{projectOrProductUID}/usage/route-logs', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
206
+ }
207
+
208
+ /**
209
+ * Get route logs usage for a project with time range and period aggregation
210
+ * @param {String} projectOrProductUID
211
+ * @param {module:model/String} period Period type for aggregation
212
+ * @param {Object} opts Optional parameters
213
+ * @param {Number} opts.startDate Start date for filtering results, specified as a Unix timestamp
214
+ * @param {Number} opts.endDate End date for filtering results, specified as a Unix timestamp
215
+ * @param {Array.<String>} opts.deviceUID A Device UID.
216
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UsageRouteLogsResponse}
217
+ */
218
+ }, {
219
+ key: "getRouteLogsUsage",
220
+ value: function getRouteLogsUsage(projectOrProductUID, period, opts) {
221
+ return this.getRouteLogsUsageWithHttpInfo(projectOrProductUID, period, opts).then(function (response_and_data) {
222
+ return response_and_data.data;
223
+ });
224
+ }
225
+
226
+ /**
227
+ * Get sessions usage for a project with time range and period aggregation
228
+ * @param {String} projectOrProductUID
229
+ * @param {module:model/String} period Period type for aggregation
230
+ * @param {Object} opts Optional parameters
231
+ * @param {Number} opts.startDate Start date for filtering results, specified as a Unix timestamp
232
+ * @param {Number} opts.endDate End date for filtering results, specified as a Unix timestamp
233
+ * @param {Array.<String>} opts.deviceUID A Device UID.
234
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UsageSessionsResponse} and HTTP response
235
+ */
236
+ }, {
237
+ key: "getSessionsUsageWithHttpInfo",
238
+ value: function getSessionsUsageWithHttpInfo(projectOrProductUID, period, opts) {
239
+ opts = opts || {};
240
+ var postBody = null;
241
+ // verify the required parameter 'projectOrProductUID' is set
242
+ if (projectOrProductUID === undefined || projectOrProductUID === null) {
243
+ throw new _Error["default"]("Missing the required parameter 'projectOrProductUID' when calling getSessionsUsage");
244
+ }
245
+ // verify the required parameter 'period' is set
246
+ if (period === undefined || period === null) {
247
+ throw new _Error["default"]("Missing the required parameter 'period' when calling getSessionsUsage");
248
+ }
249
+ var pathParams = {
250
+ 'projectOrProductUID': projectOrProductUID
251
+ };
252
+ var queryParams = {
253
+ 'startDate': opts['startDate'],
254
+ 'endDate': opts['endDate'],
255
+ 'deviceUID': this.apiClient.buildCollectionParam(opts['deviceUID'], 'multi'),
256
+ 'period': period
257
+ };
258
+ var headerParams = {};
259
+ var formParams = {};
260
+ var authNames = ['personalAccessToken'];
261
+ var contentTypes = [];
262
+ var accepts = ['application/json'];
263
+ var returnType = _UsageSessionsResponse["default"];
264
+ return this.apiClient.callApi('/v1/projects/{projectOrProductUID}/usage/sessions', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
265
+ }
266
+
267
+ /**
268
+ * Get sessions usage for a project with time range and period aggregation
269
+ * @param {String} projectOrProductUID
270
+ * @param {module:model/String} period Period type for aggregation
271
+ * @param {Object} opts Optional parameters
272
+ * @param {Number} opts.startDate Start date for filtering results, specified as a Unix timestamp
273
+ * @param {Number} opts.endDate End date for filtering results, specified as a Unix timestamp
274
+ * @param {Array.<String>} opts.deviceUID A Device UID.
275
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UsageSessionsResponse}
276
+ */
277
+ }, {
278
+ key: "getSessionsUsage",
279
+ value: function getSessionsUsage(projectOrProductUID, period, opts) {
280
+ return this.getSessionsUsageWithHttpInfo(projectOrProductUID, period, opts).then(function (response_and_data) {
281
+ return response_and_data.data;
282
+ });
283
+ }
284
+ }]);
285
+ }();