@blues-inc/notehub-js 4.0.0-beta.9 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/README.md +244 -248
  2. package/dist/ApiClient.js +150 -150
  3. package/dist/api/AlertApi.js +22 -22
  4. package/dist/api/AuthorizationApi.js +31 -31
  5. package/dist/api/BillingAccountApi.js +14 -14
  6. package/dist/api/DeviceApi.js +359 -359
  7. package/dist/api/EventApi.js +118 -118
  8. package/dist/api/ExternalDevicesApi.js +41 -41
  9. package/dist/api/MonitorApi.js +52 -52
  10. package/dist/api/ProjectApi.js +387 -381
  11. package/dist/api/RouteApi.js +83 -77
  12. package/dist/api/UsageApi.js +63 -63
  13. package/dist/api/WebhookApi.js +51 -51
  14. package/dist/index.js +7 -0
  15. package/dist/model/AddDeviceToFleetsRequest.js +8 -8
  16. package/dist/model/Alert.js +74 -76
  17. package/dist/model/AlertDataInner.js +36 -36
  18. package/dist/model/AlertNotificationsInner.js +18 -18
  19. package/dist/model/AwsRoute.js +65 -65
  20. package/dist/model/AzureRoute.js +43 -43
  21. package/dist/model/BillingAccount.js +21 -21
  22. package/dist/model/BillingAccountRole.js +9 -9
  23. package/dist/model/BlynkRoute.js +28 -28
  24. package/dist/model/Body.js +5 -5
  25. package/dist/model/CellularPlan.js +34 -34
  26. package/dist/model/CloneProjectRequest.js +20 -20
  27. package/dist/model/Contact.js +22 -22
  28. package/dist/model/CreateFleetRequest.js +20 -20
  29. package/dist/model/CreateMonitor.js +126 -127
  30. package/dist/model/CreateProductRequest.js +22 -22
  31. package/dist/model/CreateProjectRequest.js +16 -16
  32. package/dist/model/CreateUpdateRepository.js +17 -17
  33. package/dist/model/CurrentFirmware.js +12 -12
  34. package/dist/model/DFUEnv.js +12 -12
  35. package/dist/model/DFUState.js +65 -65
  36. package/dist/model/DataField.js +7 -7
  37. package/dist/model/DataSetField.js +19 -19
  38. package/dist/model/DataUsage.js +14 -14
  39. package/dist/model/DatacakeRoute.js +35 -35
  40. package/dist/model/DeleteDeviceFromFleetsRequest.js +8 -8
  41. package/dist/model/DeleteNotefilesRequest.js +7 -7
  42. package/dist/model/Device.js +106 -107
  43. package/dist/model/DeviceDfuHistory.js +19 -20
  44. package/dist/model/DeviceDfuHistoryCurrent.js +32 -32
  45. package/dist/model/DeviceDfuHistoryPage.js +12 -13
  46. package/dist/model/DeviceDfuStateMachine.js +24 -25
  47. package/dist/model/DeviceDfuStateMachineNode.js +22 -22
  48. package/dist/model/DeviceDfuStatus.js +20 -20
  49. package/dist/model/DeviceDfuStatusPage.js +12 -13
  50. package/dist/model/DeviceSession.js +221 -221
  51. package/dist/model/DeviceTowerInfo.js +14 -14
  52. package/dist/model/DeviceUsage.js +32 -32
  53. package/dist/model/DfuActionRequest.js +7 -7
  54. package/dist/model/EmailNotification.js +7 -7
  55. package/dist/model/EnvTreeJsonNode.js +67 -69
  56. package/dist/model/EnvVar.js +18 -18
  57. package/dist/model/EnvironmentVariables.js +8 -8
  58. package/dist/model/Error.js +31 -31
  59. package/dist/model/Event.js +248 -248
  60. package/dist/model/Filter.js +16 -16
  61. package/dist/model/Firmware.js +49 -49
  62. package/dist/model/FirmwareInfo.js +60 -60
  63. package/dist/model/Fleet.js +38 -38
  64. package/dist/model/FleetConnectivityAssurance.js +5 -5
  65. package/dist/model/GetAlerts200Response.js +14 -15
  66. package/dist/model/GetBillingAccounts200Response.js +9 -10
  67. package/dist/model/GetDataUsage200Response.js +9 -10
  68. package/dist/model/GetDataUsage200ResponseDataInner.js +43 -57
  69. package/dist/model/GetDbNote200Response.js +13 -13
  70. package/dist/model/GetDeviceEnvironmentVariablesByPin200Response.js +16 -16
  71. package/dist/model/GetDeviceFleets200Response.js +11 -12
  72. package/dist/model/GetDeviceHealthLog200Response.js +11 -12
  73. package/dist/model/GetDeviceHealthLog200ResponseHealthLogInner.js +19 -19
  74. package/dist/model/GetDeviceLatestEvents200Response.js +9 -10
  75. package/dist/model/GetDevicePlans200Response.js +9 -40
  76. package/dist/model/GetDevicePublicKey200Response.js +16 -16
  77. package/dist/model/GetDevicePublicKeys200Response.js +16 -17
  78. package/dist/model/GetDevicePublicKeys200ResponseDevicePublicKeysInner.js +12 -12
  79. package/dist/model/GetDeviceSessions200Response.js +16 -17
  80. package/dist/model/GetDevices200Response.js +16 -17
  81. package/dist/model/GetEvents200Response.js +20 -21
  82. package/dist/model/GetEventsByCursor200Response.js +23 -24
  83. package/dist/model/GetNotefile200Response.js +11 -11
  84. package/dist/model/GetProducts200Response.js +9 -10
  85. package/dist/model/GetProjectMembers200Response.js +11 -12
  86. package/dist/model/GetProjects200Response.js +9 -10
  87. package/dist/model/GetRouteLogsUsage200Response.js +11 -12
  88. package/dist/model/GetSessionsUsage200Response.js +11 -12
  89. package/dist/model/GetWebhooks200Response.js +9 -10
  90. package/dist/model/GoogleRoute.js +33 -33
  91. package/dist/model/HttpRoute.js +35 -35
  92. package/dist/model/Location.js +40 -40
  93. package/dist/model/Login200Response.js +7 -7
  94. package/dist/model/LoginRequest.js +12 -12
  95. package/dist/model/Monitor.js +100 -101
  96. package/dist/model/MonitorAlertRoutesInner.js +10 -9
  97. package/dist/model/MqttRoute.js +68 -68
  98. package/dist/model/Note.js +31 -31
  99. package/dist/model/NoteInput.js +9 -9
  100. package/dist/model/Notefile.js +22 -23
  101. package/dist/model/NotefileSchema.js +18 -19
  102. package/dist/model/NotehubRoute.js +103 -103
  103. package/dist/model/NotehubRouteSummary.js +23 -23
  104. package/dist/model/OAuth2Error.js +20 -20
  105. package/dist/model/OAuth2TokenResponse.js +23 -23
  106. package/dist/model/PersonalAccessToken.js +34 -34
  107. package/dist/model/PersonalAccessTokenCreatedBy.js +17 -17
  108. package/dist/model/PersonalAccessTokenInfo.js +18 -18
  109. package/dist/model/PersonalAccessTokenSecret.js +12 -12
  110. package/dist/model/Product.js +26 -26
  111. package/dist/model/Project.js +34 -34
  112. package/dist/model/ProjectMember.js +22 -22
  113. package/dist/model/ProvisionDeviceRequest.js +18 -18
  114. package/dist/model/ProxyRoute.js +29 -29
  115. package/dist/model/QubitroRoute.js +33 -33
  116. package/dist/model/RadRoute.js +31 -31
  117. package/dist/model/Repository.js +22 -22
  118. package/dist/model/Role.js +9 -9
  119. package/dist/model/RouteLog.js +38 -38
  120. package/dist/model/RouteTransformSettings.js +18 -18
  121. package/dist/model/S3ArchiveRoute.js +79 -79
  122. package/dist/model/SatelliteDataUsage.js +144 -0
  123. package/dist/model/SatellitePlan.js +39 -39
  124. package/dist/model/SchemaProperty.js +36 -38
  125. package/dist/model/SignalDevice200Response.js +5 -5
  126. package/dist/model/SimUsage.js +19 -19
  127. package/dist/model/SlackBearerNotification.js +25 -25
  128. package/dist/model/SlackRoute.js +48 -48
  129. package/dist/model/SlackWebHookNotification.js +20 -20
  130. package/dist/model/SnowflakeRoute.js +45 -45
  131. package/dist/model/SnowpipeStreamingRoute.js +60 -60
  132. package/dist/model/ThingworxRoute.js +33 -33
  133. package/dist/model/TowerLocation.js +54 -54
  134. package/dist/model/TwilioRoute.js +43 -43
  135. package/dist/model/UpdateFleetRequest.js +33 -33
  136. package/dist/model/UploadMetadata.js +64 -64
  137. package/dist/model/UsageData.js +33 -33
  138. package/dist/model/UsageEventsData.js +37 -37
  139. package/dist/model/UsageEventsResponse.js +11 -12
  140. package/dist/model/UsageRouteLogsData.js +27 -27
  141. package/dist/model/UsageSessionsData.js +32 -32
  142. package/dist/model/UserDfuStateMachine.js +20 -20
  143. package/dist/model/UserDfuStateMachineStatus.js +20 -20
  144. package/dist/model/UserFirmwareInfo.js +12 -12
  145. package/dist/model/WebhookSettings.js +15 -15
  146. package/package.json +3 -3
package/dist/ApiClient.js CHANGED
@@ -14,7 +14,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
14
14
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
15
  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); } /**
16
16
  * Notehub API
17
- * The OpenAPI definition for the Notehub.io API.
17
+ * The OpenAPI definition for the Notehub.io API.
18
18
  *
19
19
  * The version of the OpenAPI document: 1.2.0
20
20
  * Contact: engineering@blues.io
@@ -25,16 +25,16 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
25
25
  *
26
26
  */
27
27
  /**
28
- * @module ApiClient
29
- * @version 4.0.0-beta.9
30
- */
28
+ * @module ApiClient
29
+ * @version 5.0.0
30
+ */
31
31
  /**
32
- * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an
33
- * application to use this class directly - the *Api and model classes provide the public API for the service. The
34
- * contents of this file should be regarded as internal but are documented for completeness.
35
- * @alias module:ApiClient
36
- * @class
37
- */
32
+ * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an
33
+ * application to use this class directly - the *Api and model classes provide the public API for the service. The
34
+ * contents of this file should be regarded as internal but are documented for completeness.
35
+ * @alias module:ApiClient
36
+ * @class
37
+ */
38
38
  var ApiClient = /*#__PURE__*/function () {
39
39
  /**
40
40
  * The base URL against which to resolve every API call's (relative) path.
@@ -42,22 +42,22 @@ var ApiClient = /*#__PURE__*/function () {
42
42
  * @param {String} basePath
43
43
  */
44
44
  function ApiClient() {
45
- var basePath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'https://api.notefile.net';
45
+ var basePath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "https://api.notefile.net";
46
46
  _classCallCheck(this, ApiClient);
47
47
  /**
48
48
  * The base URL against which to resolve every API call's (relative) path.
49
49
  * @type {String}
50
50
  * @default https://api.notefile.net
51
51
  */
52
- this.basePath = basePath.replace(/\/+$/, '');
52
+ this.basePath = basePath.replace(/\/+$/, "");
53
53
 
54
54
  /**
55
55
  * The authentication methods to be included for all API calls.
56
56
  * @type {Array.<String>}
57
57
  */
58
58
  this.authentications = {
59
- 'personalAccessToken': {
60
- type: 'bearer'
59
+ personalAccessToken: {
60
+ type: "bearer"
61
61
  }
62
62
  };
63
63
 
@@ -67,8 +67,8 @@ var ApiClient = /*#__PURE__*/function () {
67
67
  * @default {}
68
68
  */
69
69
  this.defaultHeaders = {};
70
- if (typeof window === 'undefined') {
71
- this.defaultHeaders['User-Agent'] = 'OpenAPI-Generator/4.0.0-beta.9/Javascript';
70
+ if (typeof window === "undefined") {
71
+ this.defaultHeaders["User-Agent"] = "OpenAPI-Generator/5.0.0/Javascript";
72
72
  }
73
73
 
74
74
  /**
@@ -97,7 +97,7 @@ var ApiClient = /*#__PURE__*/function () {
97
97
  * Used to save and return cookies in a node.js (non-browser) setting,
98
98
  * if this.enableCookies is set to true.
99
99
  */
100
- if (typeof window === 'undefined') {
100
+ if (typeof window === "undefined") {
101
101
  this.agent = new _superagent["default"].agent();
102
102
  }
103
103
 
@@ -113,15 +113,15 @@ var ApiClient = /*#__PURE__*/function () {
113
113
  }
114
114
 
115
115
  /**
116
- * Returns a string representation for an actual parameter.
117
- * @param param The actual parameter.
118
- * @returns {String} The string representation of <code>param</code>.
119
- */
116
+ * Returns a string representation for an actual parameter.
117
+ * @param param The actual parameter.
118
+ * @returns {String} The string representation of <code>param</code>.
119
+ */
120
120
  return _createClass(ApiClient, [{
121
121
  key: "paramToString",
122
122
  value: function paramToString(param) {
123
123
  if (param == undefined || param == null) {
124
- return '';
124
+ return "";
125
125
  }
126
126
  if (param instanceof Date) {
127
127
  return param.toJSON();
@@ -133,10 +133,10 @@ var ApiClient = /*#__PURE__*/function () {
133
133
  }
134
134
 
135
135
  /**
136
- * Returns a boolean indicating if the parameter could be JSON.stringified
137
- * @param param The actual parameter
138
- * @returns {Boolean} Flag indicating if <code>param</code> can be JSON.stringified
139
- */
136
+ * Returns a boolean indicating if the parameter could be JSON.stringified
137
+ * @param param The actual parameter
138
+ * @returns {Boolean} Flag indicating if <code>param</code> can be JSON.stringified
139
+ */
140
140
  }, {
141
141
  key: "buildUrl",
142
142
  value:
@@ -151,7 +151,7 @@ var ApiClient = /*#__PURE__*/function () {
151
151
  function buildUrl(path, pathParams, apiBasePath) {
152
152
  var _this = this;
153
153
  if (!path.match(/^\//)) {
154
- path = '/' + path;
154
+ path = "/" + path;
155
155
  }
156
156
  var url = this.basePath + path;
157
157
 
@@ -172,16 +172,16 @@ var ApiClient = /*#__PURE__*/function () {
172
172
  }
173
173
 
174
174
  /**
175
- * Checks whether the given content type represents JSON.<br>
176
- * JSON content type examples:<br>
177
- * <ul>
178
- * <li>application/json</li>
179
- * <li>application/json; charset=UTF8</li>
180
- * <li>APPLICATION/JSON</li>
181
- * </ul>
182
- * @param {String} contentType The MIME content type to check.
183
- * @returns {Boolean} <code>true</code> if <code>contentType</code> represents JSON, otherwise <code>false</code>.
184
- */
175
+ * Checks whether the given content type represents JSON.<br>
176
+ * JSON content type examples:<br>
177
+ * <ul>
178
+ * <li>application/json</li>
179
+ * <li>application/json; charset=UTF8</li>
180
+ * <li>APPLICATION/JSON</li>
181
+ * </ul>
182
+ * @param {String} contentType The MIME content type to check.
183
+ * @returns {Boolean} <code>true</code> if <code>contentType</code> represents JSON, otherwise <code>false</code>.
184
+ */
185
185
  }, {
186
186
  key: "isJsonMime",
187
187
  value: function isJsonMime(contentType) {
@@ -189,10 +189,10 @@ var ApiClient = /*#__PURE__*/function () {
189
189
  }
190
190
 
191
191
  /**
192
- * Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first.
193
- * @param {Array.<String>} contentTypes
194
- * @returns {String} The chosen content type, preferring JSON.
195
- */
192
+ * Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first.
193
+ * @param {Array.<String>} contentTypes
194
+ * @returns {String} The chosen content type, preferring JSON.
195
+ */
196
196
  }, {
197
197
  key: "jsonPreferredMime",
198
198
  value: function jsonPreferredMime(contentTypes) {
@@ -205,18 +205,18 @@ var ApiClient = /*#__PURE__*/function () {
205
205
  }
206
206
 
207
207
  /**
208
- * Checks whether the given parameter value represents file-like content.
209
- * @param param The parameter to check.
210
- * @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
211
- */
208
+ * Checks whether the given parameter value represents file-like content.
209
+ * @param param The parameter to check.
210
+ * @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
211
+ */
212
212
  }, {
213
213
  key: "isFileParam",
214
214
  value: function isFileParam(param) {
215
215
  // fs.ReadStream in Node.js and Electron (but not in runtime like browserify)
216
- if (typeof require === 'function') {
216
+ if (typeof require === "function") {
217
217
  var fs;
218
218
  try {
219
- fs = require('fs');
219
+ fs = require("fs");
220
220
  } catch (err) {}
221
221
  if (fs && fs.ReadStream && param instanceof fs.ReadStream) {
222
222
  return true;
@@ -224,32 +224,32 @@ var ApiClient = /*#__PURE__*/function () {
224
224
  }
225
225
 
226
226
  // Buffer in Node.js
227
- if (typeof Buffer === 'function' && param instanceof Buffer) {
227
+ if (typeof Buffer === "function" && param instanceof Buffer) {
228
228
  return true;
229
229
  }
230
230
 
231
231
  // Blob in browser
232
- if (typeof Blob === 'function' && param instanceof Blob) {
232
+ if (typeof Blob === "function" && param instanceof Blob) {
233
233
  return true;
234
234
  }
235
235
 
236
236
  // File in browser (it seems File object is also instance of Blob, but keep this for safe)
237
- if (typeof File === 'function' && param instanceof File) {
237
+ if (typeof File === "function" && param instanceof File) {
238
238
  return true;
239
239
  }
240
240
  return false;
241
241
  }
242
242
 
243
243
  /**
244
- * Normalizes parameter values:
245
- * <ul>
246
- * <li>remove nils</li>
247
- * <li>keep files and arrays</li>
248
- * <li>format to string with `paramToString` for other cases</li>
249
- * </ul>
250
- * @param {Object.<String, Object>} params The parameters as object properties.
251
- * @returns {Object.<String, Object>} normalized parameters.
252
- */
244
+ * Normalizes parameter values:
245
+ * <ul>
246
+ * <li>remove nils</li>
247
+ * <li>keep files and arrays</li>
248
+ * <li>format to string with `paramToString` for other cases</li>
249
+ * </ul>
250
+ * @param {Object.<String, Object>} params The parameters as object properties.
251
+ * @returns {Object.<String, Object>} normalized parameters.
252
+ */
253
253
  }, {
254
254
  key: "normalizeParams",
255
255
  value: function normalizeParams(params) {
@@ -268,12 +268,12 @@ var ApiClient = /*#__PURE__*/function () {
268
268
  }
269
269
 
270
270
  /**
271
- * Builds a string representation of an array-type actual parameter, according to the given collection format.
272
- * @param {Array} param An array parameter.
273
- * @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy.
274
- * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns
275
- * <code>param</code> as is if <code>collectionFormat</code> is <code>multi</code>.
276
- */
271
+ * Builds a string representation of an array-type actual parameter, according to the given collection format.
272
+ * @param {Array} param An array parameter.
273
+ * @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy.
274
+ * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns
275
+ * <code>param</code> as is if <code>collectionFormat</code> is <code>multi</code>.
276
+ */
277
277
  }, {
278
278
  key: "buildCollectionParam",
279
279
  value: function buildCollectionParam(param, collectionFormat) {
@@ -281,29 +281,29 @@ var ApiClient = /*#__PURE__*/function () {
281
281
  return null;
282
282
  }
283
283
  switch (collectionFormat) {
284
- case 'csv':
285
- return param.map(this.paramToString, this).join(',');
286
- case 'ssv':
287
- return param.map(this.paramToString, this).join(' ');
288
- case 'tsv':
289
- return param.map(this.paramToString, this).join('\t');
290
- case 'pipes':
291
- return param.map(this.paramToString, this).join('|');
292
- case 'multi':
284
+ case "csv":
285
+ return param.map(this.paramToString, this).join(",");
286
+ case "ssv":
287
+ return param.map(this.paramToString, this).join(" ");
288
+ case "tsv":
289
+ return param.map(this.paramToString, this).join("\t");
290
+ case "pipes":
291
+ return param.map(this.paramToString, this).join("|");
292
+ case "multi":
293
293
  //return the array directly as SuperAgent will handle it as expected
294
294
  return param.map(this.paramToString, this);
295
- case 'passthrough':
295
+ case "passthrough":
296
296
  return param;
297
297
  default:
298
- throw new Error('Unknown collection format: ' + collectionFormat);
298
+ throw new Error("Unknown collection format: " + collectionFormat);
299
299
  }
300
300
  }
301
301
 
302
302
  /**
303
- * Applies authentication headers to the request.
304
- * @param {Object} request The request object created by a <code>superagent()</code> call.
305
- * @param {Array.<String>} authNames An array of authentication method names.
306
- */
303
+ * Applies authentication headers to the request.
304
+ * @param {Object} request The request object created by a <code>superagent()</code> call.
305
+ * @param {Array.<String>} authNames An array of authentication method names.
306
+ */
307
307
  }, {
308
308
  key: "applyAuthToRequest",
309
309
  value: function applyAuthToRequest(request, authNames) {
@@ -311,39 +311,39 @@ var ApiClient = /*#__PURE__*/function () {
311
311
  authNames.forEach(function (authName) {
312
312
  var auth = _this2.authentications[authName];
313
313
  switch (auth.type) {
314
- case 'basic':
314
+ case "basic":
315
315
  if (auth.username || auth.password) {
316
- request.auth(auth.username || '', auth.password || '');
316
+ request.auth(auth.username || "", auth.password || "");
317
317
  }
318
318
  break;
319
- case 'bearer':
319
+ case "bearer":
320
320
  if (auth.accessToken) {
321
- var localVarBearerToken = typeof auth.accessToken === 'function' ? auth.accessToken() : auth.accessToken;
321
+ var localVarBearerToken = typeof auth.accessToken === "function" ? auth.accessToken() : auth.accessToken;
322
322
  request.set({
323
- 'Authorization': 'Bearer ' + localVarBearerToken
323
+ Authorization: "Bearer " + localVarBearerToken
324
324
  });
325
325
  }
326
326
  break;
327
- case 'apiKey':
327
+ case "apiKey":
328
328
  if (auth.apiKey) {
329
329
  var data = {};
330
330
  data[auth.name] = auth.apiKey;
331
- if (auth['in'] === 'header') {
331
+ if (auth["in"] === "header") {
332
332
  request.set(data);
333
333
  } else {
334
334
  request.query(data);
335
335
  }
336
336
  }
337
337
  break;
338
- case 'oauth2':
338
+ case "oauth2":
339
339
  if (auth.accessToken) {
340
340
  request.set({
341
- 'Authorization': 'Bearer ' + auth.accessToken
341
+ Authorization: "Bearer " + auth.accessToken
342
342
  });
343
343
  }
344
344
  break;
345
345
  default:
346
- throw new Error('Unknown authentication type: ' + auth.type);
346
+ throw new Error("Unknown authentication type: " + auth.type);
347
347
  }
348
348
  });
349
349
  }
@@ -367,7 +367,7 @@ var ApiClient = /*#__PURE__*/function () {
367
367
  // Rely on SuperAgent for parsing response body.
368
368
  // See http://visionmedia.github.io/superagent/#parsing-response-bodies
369
369
  var data = response.body;
370
- if (data == null || _typeof(data) === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length) {
370
+ if (data == null || _typeof(data) === "object" && typeof data.length === "undefined" && !Object.keys(data).length) {
371
371
  // SuperAgent does not always produce a body; use the unparsed response as a fallback
372
372
  data = response.text;
373
373
  }
@@ -409,8 +409,8 @@ var ApiClient = /*#__PURE__*/function () {
409
409
  this.applyAuthToRequest(request, authNames);
410
410
 
411
411
  // set query parameters
412
- if (httpMethod.toUpperCase() === 'GET' && this.cache === false) {
413
- queryParams['_'] = new Date().getTime();
412
+ if (httpMethod.toUpperCase() === "GET" && this.cache === false) {
413
+ queryParams["_"] = new Date().getTime();
414
414
  }
415
415
  request.query(this.normalizeParams(queryParams));
416
416
 
@@ -427,13 +427,13 @@ var ApiClient = /*#__PURE__*/function () {
427
427
  var contentType = this.jsonPreferredMime(contentTypes);
428
428
  if (contentType) {
429
429
  // Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746)
430
- if (contentType != 'multipart/form-data') {
430
+ if (contentType != "multipart/form-data") {
431
431
  request.type(contentType);
432
432
  }
433
433
  }
434
- if (contentType === 'application/x-www-form-urlencoded') {
434
+ if (contentType === "application/x-www-form-urlencoded") {
435
435
  request.send(_querystring["default"].stringify(this.normalizeParams(formParams)));
436
- } else if (contentType == 'multipart/form-data') {
436
+ } else if (contentType == "multipart/form-data") {
437
437
  var _formParams = this.normalizeParams(formParams);
438
438
  for (var key in _formParams) {
439
439
  if (_formParams.hasOwnProperty(key)) {
@@ -452,8 +452,8 @@ var ApiClient = /*#__PURE__*/function () {
452
452
  }
453
453
  }
454
454
  } else if (bodyParam !== null && bodyParam !== undefined) {
455
- if (!request.header['Content-Type']) {
456
- request.type('application/json');
455
+ if (!request.header["Content-Type"]) {
456
+ request.type("application/json");
457
457
  }
458
458
  request.send(bodyParam);
459
459
  }
@@ -461,15 +461,15 @@ var ApiClient = /*#__PURE__*/function () {
461
461
  if (accept) {
462
462
  request.accept(accept);
463
463
  }
464
- if (returnType === 'Blob') {
465
- request.responseType('blob');
466
- } else if (returnType === 'String') {
467
- request.responseType('text');
464
+ if (returnType === "Blob") {
465
+ request.responseType("blob");
466
+ } else if (returnType === "String") {
467
+ request.responseType("text");
468
468
  }
469
469
 
470
470
  // Attach previously saved cookies, if enabled
471
471
  if (this.enableCookies) {
472
- if (typeof window === 'undefined') {
472
+ if (typeof window === "undefined") {
473
473
  this.agent._attachCookies(request);
474
474
  } else {
475
475
  request.withCredentials(); // Allows credentials to be sent with cross-origin requests in the browser
@@ -490,7 +490,7 @@ var ApiClient = /*#__PURE__*/function () {
490
490
  } else {
491
491
  try {
492
492
  var data = _this3.deserialize(response, returnType);
493
- if (_this3.enableCookies && typeof window === 'undefined') {
493
+ if (_this3.enableCookies && typeof window === "undefined") {
494
494
  _this3.agent._saveCookies(response);
495
495
  }
496
496
  resolve({
@@ -506,21 +506,21 @@ var ApiClient = /*#__PURE__*/function () {
506
506
  }
507
507
 
508
508
  /**
509
- * Parses an ISO-8601 string representation or epoch representation of a date value.
510
- * @param {String} str The date value as a string.
511
- * @returns {Date} The parsed date object.
512
- */
509
+ * Parses an ISO-8601 string representation or epoch representation of a date value.
510
+ * @param {String} str The date value as a string.
511
+ * @returns {Date} The parsed date object.
512
+ */
513
513
  }, {
514
514
  key: "hostSettings",
515
515
  value:
516
516
  /**
517
- * Gets an array of host settings
518
- * @returns An array of host settings
519
- */
517
+ * Gets an array of host settings
518
+ * @returns An array of host settings
519
+ */
520
520
  function hostSettings() {
521
521
  return [{
522
- 'url': "https://api.notefile.net",
523
- 'description': "Production server"
522
+ url: "https://api.notefile.net",
523
+ description: "Production server"
524
524
  }];
525
525
  }
526
526
  }, {
@@ -534,37 +534,37 @@ var ApiClient = /*#__PURE__*/function () {
534
534
  throw new Error("Invalid index " + index + " when selecting the host settings. Must be less than " + servers.length);
535
535
  }
536
536
  var server = servers[index];
537
- var url = server['url'];
537
+ var url = server["url"];
538
538
 
539
539
  // go through variable and assign a value
540
- for (var variable_name in server['variables']) {
540
+ for (var variable_name in server["variables"]) {
541
541
  if (variable_name in variables) {
542
- var variable = server['variables'][variable_name];
543
- if (!('enum_values' in variable) || variable['enum_values'].includes(variables[variable_name])) {
542
+ var variable = server["variables"][variable_name];
543
+ if (!("enum_values" in variable) || variable["enum_values"].includes(variables[variable_name])) {
544
544
  url = url.replace("{" + variable_name + "}", variables[variable_name]);
545
545
  } else {
546
- throw new Error("The variable `" + variable_name + "` in the host URL has invalid value " + variables[variable_name] + ". Must be " + server['variables'][variable_name]['enum_values'] + ".");
546
+ throw new Error("The variable `" + variable_name + "` in the host URL has invalid value " + variables[variable_name] + ". Must be " + server["variables"][variable_name]["enum_values"] + ".");
547
547
  }
548
548
  } else {
549
549
  // use default value
550
- url = url.replace("{" + variable_name + "}", server['variables'][variable_name]['default_value']);
550
+ url = url.replace("{" + variable_name + "}", server["variables"][variable_name]["default_value"]);
551
551
  }
552
552
  }
553
553
  return url;
554
554
  }
555
555
 
556
556
  /**
557
- * Constructs a new map or array model from REST data.
558
- * @param data {Object|Array} The REST data.
559
- * @param obj {Object|Array} The target object or array.
560
- */
557
+ * Constructs a new map or array model from REST data.
558
+ * @param data {Object|Array} The REST data.
559
+ * @param obj {Object|Array} The target object or array.
560
+ */
561
561
  }], [{
562
562
  key: "canBeJsonified",
563
563
  value: function canBeJsonified(str) {
564
- if (typeof str !== 'string' && _typeof(str) !== 'object') return false;
564
+ if (typeof str !== "string" && _typeof(str) !== "object") return false;
565
565
  try {
566
566
  var type = str.toString();
567
- return type === '[object Object]' || type === '[object Array]';
567
+ return type === "[object Object]" || type === "[object Array]";
568
568
  } catch (err) {
569
569
  return false;
570
570
  }
@@ -573,42 +573,42 @@ var ApiClient = /*#__PURE__*/function () {
573
573
  key: "parseDate",
574
574
  value: function parseDate(str) {
575
575
  if (isNaN(str)) {
576
- return new Date(str.replace(/(\d)(T)(\d)/i, '$1 $3'));
576
+ return new Date(str.replace(/(\d)(T)(\d)/i, "$1 $3"));
577
577
  }
578
578
  return new Date(+str);
579
579
  }
580
580
 
581
581
  /**
582
- * Converts a value to the specified type.
583
- * @param {(String|Object)} data The data to convert, as a string or object.
584
- * @param {(String|Array.<String>|Object.<String, Object>|Function)} type The type to return. Pass a string for simple types
585
- * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To
586
- * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type:
587
- * all properties on <code>data<code> will be converted to this type.
588
- * @returns An instance of the specified type or null or undefined if data is null or undefined.
589
- */
582
+ * Converts a value to the specified type.
583
+ * @param {(String|Object)} data The data to convert, as a string or object.
584
+ * @param {(String|Array.<String>|Object.<String, Object>|Function)} type The type to return. Pass a string for simple types
585
+ * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To
586
+ * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type:
587
+ * all properties on <code>data<code> will be converted to this type.
588
+ * @returns An instance of the specified type or null or undefined if data is null or undefined.
589
+ */
590
590
  }, {
591
591
  key: "convertToType",
592
592
  value: function convertToType(data, type) {
593
593
  if (data === null || data === undefined) return data;
594
594
  switch (type) {
595
- case 'Boolean':
595
+ case "Boolean":
596
596
  return Boolean(data);
597
- case 'Integer':
597
+ case "Integer":
598
598
  return parseInt(data, 10);
599
- case 'Number':
599
+ case "Number":
600
600
  return parseFloat(data);
601
- case 'String':
601
+ case "String":
602
602
  return String(data);
603
- case 'Date':
603
+ case "Date":
604
604
  return String(data);
605
- case 'Blob':
605
+ case "Blob":
606
606
  return data;
607
607
  default:
608
608
  if (type === Object) {
609
609
  // generic object, return directly
610
610
  return data;
611
- } else if (typeof type.constructFromObject === 'function') {
611
+ } else if (typeof type.constructFromObject === "function") {
612
612
  // for model type like User and enum class
613
613
  return type.constructFromObject(data);
614
614
  } else if (Array.isArray(type)) {
@@ -617,7 +617,7 @@ var ApiClient = /*#__PURE__*/function () {
617
617
  return data.map(function (item) {
618
618
  return ApiClient.convertToType(item, itemType);
619
619
  });
620
- } else if (_typeof(type) === 'object') {
620
+ } else if (_typeof(type) === "object") {
621
621
  // for plain object type like: {'String': 'Integer'}
622
622
  var keyType, valueType;
623
623
  for (var k in type) {
@@ -667,32 +667,32 @@ ApiClient.CollectionFormatEnum = {
667
667
  * Comma-separated values. Value: <code>csv</code>
668
668
  * @const
669
669
  */
670
- CSV: ',',
670
+ CSV: ",",
671
671
  /**
672
672
  * Space-separated values. Value: <code>ssv</code>
673
673
  * @const
674
674
  */
675
- SSV: ' ',
675
+ SSV: " ",
676
676
  /**
677
677
  * Tab-separated values. Value: <code>tsv</code>
678
678
  * @const
679
679
  */
680
- TSV: '\t',
680
+ TSV: "\t",
681
681
  /**
682
682
  * Pipe(|)-separated values. Value: <code>pipes</code>
683
683
  * @const
684
684
  */
685
- PIPES: '|',
685
+ PIPES: "|",
686
686
  /**
687
687
  * Native array. Value: <code>multi</code>
688
688
  * @const
689
689
  */
690
- MULTI: 'multi'
690
+ MULTI: "multi"
691
691
  };
692
692
 
693
693
  /**
694
- * The default API client implementation.
695
- * @type {module:ApiClient}
696
- */
694
+ * The default API client implementation.
695
+ * @type {module:ApiClient}
696
+ */
697
697
  ApiClient.instance = new ApiClient();
698
698
  var _default = exports["default"] = ApiClient;