@blues-inc/notehub-js 1.0.38 → 2.0.0-beta.10

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 (134) hide show
  1. package/README.md +245 -239
  2. package/dist/ApiClient.js +154 -156
  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 +362 -362
  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 +384 -374
  11. package/dist/api/RouteApi.js +77 -77
  12. package/dist/api/UsageApi.js +51 -51
  13. package/dist/api/WebhookApi.js +51 -51
  14. package/dist/model/Alert.js +76 -74
  15. package/dist/model/AlertDataInner.js +35 -35
  16. package/dist/model/AlertNotificationsInner.js +18 -18
  17. package/dist/model/Aws.js +65 -65
  18. package/dist/model/AwsFilter.js +19 -19
  19. package/dist/model/AwsTransform.js +20 -20
  20. package/dist/model/Azure.js +43 -43
  21. package/dist/model/BillingAccount.js +21 -21
  22. package/dist/model/BillingAccountRole.js +9 -9
  23. package/dist/model/Body.js +5 -5
  24. package/dist/model/CloneProjectRequest.js +20 -20
  25. package/dist/model/Contact.js +22 -22
  26. package/dist/model/CreateFleetRequest.js +12 -12
  27. package/dist/model/CreateMonitor.js +126 -125
  28. package/dist/model/CreateProductRequest.js +22 -22
  29. package/dist/model/CreateProjectRequest.js +16 -16
  30. package/dist/model/CreateUpdateRepository.js +17 -17
  31. package/dist/model/CurrentFirmware.js +12 -12
  32. package/dist/model/DFUEnv.js +12 -12
  33. package/dist/model/DFUState.js +65 -65
  34. package/dist/model/DataField.js +7 -7
  35. package/dist/model/DataSetField.js +19 -19
  36. package/dist/model/DeleteDeviceFleetsRequest.js +8 -8
  37. package/dist/model/Device.js +102 -101
  38. package/dist/model/DeviceDfuHistory.js +20 -19
  39. package/dist/model/DeviceDfuHistoryCurrent.js +32 -32
  40. package/dist/model/DeviceDfuHistoryPage.js +13 -12
  41. package/dist/model/DeviceDfuStateMachine.js +25 -24
  42. package/dist/model/DeviceDfuStateMachineNode.js +22 -22
  43. package/dist/model/DeviceDfuStatus.js +20 -20
  44. package/dist/model/DeviceDfuStatusPage.js +13 -12
  45. package/dist/model/DeviceSession.js +221 -221
  46. package/dist/model/DeviceTowerInfo.js +14 -14
  47. package/dist/model/DeviceUsage.js +32 -32
  48. package/dist/model/DfuActionRequest.js +7 -7
  49. package/dist/model/EmailNotification.js +7 -7
  50. package/dist/model/EnvTreeJsonNode.js +69 -67
  51. package/dist/model/EnvVar.js +18 -18
  52. package/dist/model/EnvironmentVariables.js +8 -8
  53. package/dist/model/Error.js +31 -31
  54. package/dist/model/Event.js +248 -248
  55. package/dist/model/Firmware.js +49 -49
  56. package/dist/model/FirmwareInfo.js +60 -60
  57. package/dist/model/Fleet.js +30 -30
  58. package/dist/model/GetAlerts200Response.js +15 -14
  59. package/dist/model/GetBillingAccounts200Response.js +10 -9
  60. package/dist/model/GetDeviceEnvironmentVariablesByPin200Response.js +16 -16
  61. package/dist/model/GetDeviceFleets200Response.js +12 -11
  62. package/dist/model/GetDeviceHealthLog200Response.js +12 -11
  63. package/dist/model/GetDeviceHealthLog200ResponseHealthLogInner.js +19 -19
  64. package/dist/model/GetDeviceLatest200Response.js +10 -9
  65. package/dist/model/GetDevicePublicKey200Response.js +16 -16
  66. package/dist/model/GetDeviceSessions200Response.js +17 -16
  67. package/dist/model/GetProjectDevicePublicKeys200Response.js +17 -16
  68. package/dist/model/GetProjectDevicePublicKeys200ResponseDevicePublicKeysInner.js +12 -12
  69. package/dist/model/GetProjectDevices200Response.js +17 -16
  70. package/dist/model/GetProjectEvents200Response.js +21 -20
  71. package/dist/model/GetProjectEventsByCursor200Response.js +24 -23
  72. package/dist/model/GetProjectMembers200Response.js +12 -11
  73. package/dist/model/GetProjectProducts200Response.js +10 -9
  74. package/dist/model/GetProjects200Response.js +10 -9
  75. package/dist/model/GetWebhooks200Response.js +10 -9
  76. package/dist/model/Google.js +33 -33
  77. package/dist/model/HandleNoteChanges200Response.js +11 -11
  78. package/dist/model/HandleNoteGet200Response.js +13 -13
  79. package/dist/model/HandleNoteSignal200Response.js +5 -5
  80. package/dist/model/HandleNotefileChanges200Response.js +11 -11
  81. package/dist/model/HandleNotefileChangesPending200Response.js +14 -14
  82. package/dist/model/HandleNotefileDeleteRequest.js +7 -7
  83. package/dist/model/Http.js +35 -35
  84. package/dist/model/Location.js +40 -40
  85. package/dist/model/Login200Response.js +7 -7
  86. package/dist/model/LoginRequest.js +12 -12
  87. package/dist/model/Monitor.js +100 -99
  88. package/dist/model/MonitorAlertRoutesInner.js +9 -10
  89. package/dist/model/Mqtt.js +66 -66
  90. package/dist/model/Note.js +10 -10
  91. package/dist/model/NotefileSchema.js +19 -18
  92. package/dist/model/NotehubRoute.js +36 -36
  93. package/dist/model/NotehubRouteSchema.js +45 -46
  94. package/dist/model/OAuth2Error.js +20 -20
  95. package/dist/model/OAuth2TokenResponse.js +23 -23
  96. package/dist/model/PersonalAccessToken.js +34 -34
  97. package/dist/model/PersonalAccessTokenCreatedBy.js +17 -17
  98. package/dist/model/PersonalAccessTokenInfo.js +18 -18
  99. package/dist/model/PersonalAccessTokenSecret.js +12 -12
  100. package/dist/model/PostProvisionProjectDeviceRequest.js +18 -18
  101. package/dist/model/Product.js +26 -26
  102. package/dist/model/Project.js +34 -34
  103. package/dist/model/ProjectMember.js +22 -22
  104. package/dist/model/Proxy.js +24 -24
  105. package/dist/model/PutDeviceFleetsRequest.js +8 -8
  106. package/dist/model/Radresponder.js +25 -25
  107. package/dist/model/Repository.js +22 -22
  108. package/dist/model/Role.js +9 -9
  109. package/dist/model/RouteLog.js +38 -38
  110. package/dist/model/SchemaProperty.js +38 -36
  111. package/dist/model/SimUsage.js +19 -19
  112. package/dist/model/Slack.js +53 -53
  113. package/dist/model/SlackBearerNotification.js +25 -25
  114. package/dist/model/SlackTransform.js +12 -12
  115. package/dist/model/SlackWebHookNotification.js +20 -20
  116. package/dist/model/Snowflake.js +45 -45
  117. package/dist/model/Thingworx.js +33 -33
  118. package/dist/model/TowerLocation.js +54 -54
  119. package/dist/model/Twilio.js +43 -43
  120. package/dist/model/UpdateFleetRequest.js +25 -25
  121. package/dist/model/UploadMetadata.js +72 -59
  122. package/dist/model/UsageData.js +18 -18
  123. package/dist/model/UsageEventsData.js +24 -24
  124. package/dist/model/UsageEventsResponse.js +12 -11
  125. package/dist/model/UsageRouteLogsData.js +29 -29
  126. package/dist/model/UsageRouteLogsResponse.js +12 -11
  127. package/dist/model/UsageSessionsData.js +24 -24
  128. package/dist/model/UsageSessionsResponse.js +12 -11
  129. package/dist/model/UserDbRoute.js +25 -25
  130. package/dist/model/UserDfuStateMachine.js +20 -20
  131. package/dist/model/UserDfuStateMachineStatus.js +20 -20
  132. package/dist/model/UserFirmwareInfo.js +12 -12
  133. package/dist/model/WebhookSettings.js +15 -15
  134. 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 1.0.38
30
- */
28
+ * @module ApiClient
29
+ * @version 2.0.0-beta.10
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,29 +42,27 @@ 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
- api_key: {
60
- type: "apiKey",
61
- "in": "header",
62
- name: "X-Session-Token"
59
+ 'personalAccessToken': {
60
+ type: 'bearer'
63
61
  },
64
- pin: {
65
- type: "apiKey",
66
- "in": "header",
67
- name: "X-Auth-Token"
62
+ 'pin': {
63
+ type: 'apiKey',
64
+ 'in': 'header',
65
+ name: 'X-Auth-Token'
68
66
  }
69
67
  };
70
68
 
@@ -74,8 +72,8 @@ var ApiClient = /*#__PURE__*/function () {
74
72
  * @default {}
75
73
  */
76
74
  this.defaultHeaders = {};
77
- if (typeof window === "undefined") {
78
- this.defaultHeaders["User-Agent"] = "OpenAPI-Generator/1.0.38/Javascript";
75
+ if (typeof window === 'undefined') {
76
+ this.defaultHeaders['User-Agent'] = 'OpenAPI-Generator/2.0.0-beta.10/Javascript';
79
77
  }
80
78
 
81
79
  /**
@@ -104,7 +102,7 @@ var ApiClient = /*#__PURE__*/function () {
104
102
  * Used to save and return cookies in a node.js (non-browser) setting,
105
103
  * if this.enableCookies is set to true.
106
104
  */
107
- if (typeof window === "undefined") {
105
+ if (typeof window === 'undefined') {
108
106
  this.agent = new _superagent["default"].agent();
109
107
  }
110
108
 
@@ -120,15 +118,15 @@ var ApiClient = /*#__PURE__*/function () {
120
118
  }
121
119
 
122
120
  /**
123
- * Returns a string representation for an actual parameter.
124
- * @param param The actual parameter.
125
- * @returns {String} The string representation of <code>param</code>.
126
- */
121
+ * Returns a string representation for an actual parameter.
122
+ * @param param The actual parameter.
123
+ * @returns {String} The string representation of <code>param</code>.
124
+ */
127
125
  return _createClass(ApiClient, [{
128
126
  key: "paramToString",
129
127
  value: function paramToString(param) {
130
128
  if (param == undefined || param == null) {
131
- return "";
129
+ return '';
132
130
  }
133
131
  if (param instanceof Date) {
134
132
  return param.toJSON();
@@ -140,10 +138,10 @@ var ApiClient = /*#__PURE__*/function () {
140
138
  }
141
139
 
142
140
  /**
143
- * Returns a boolean indicating if the parameter could be JSON.stringified
144
- * @param param The actual parameter
145
- * @returns {Boolean} Flag indicating if <code>param</code> can be JSON.stringified
146
- */
141
+ * Returns a boolean indicating if the parameter could be JSON.stringified
142
+ * @param param The actual parameter
143
+ * @returns {Boolean} Flag indicating if <code>param</code> can be JSON.stringified
144
+ */
147
145
  }, {
148
146
  key: "buildUrl",
149
147
  value:
@@ -158,7 +156,7 @@ var ApiClient = /*#__PURE__*/function () {
158
156
  function buildUrl(path, pathParams, apiBasePath) {
159
157
  var _this = this;
160
158
  if (!path.match(/^\//)) {
161
- path = "/" + path;
159
+ path = '/' + path;
162
160
  }
163
161
  var url = this.basePath + path;
164
162
 
@@ -179,16 +177,16 @@ var ApiClient = /*#__PURE__*/function () {
179
177
  }
180
178
 
181
179
  /**
182
- * Checks whether the given content type represents JSON.<br>
183
- * JSON content type examples:<br>
184
- * <ul>
185
- * <li>application/json</li>
186
- * <li>application/json; charset=UTF8</li>
187
- * <li>APPLICATION/JSON</li>
188
- * </ul>
189
- * @param {String} contentType The MIME content type to check.
190
- * @returns {Boolean} <code>true</code> if <code>contentType</code> represents JSON, otherwise <code>false</code>.
191
- */
180
+ * Checks whether the given content type represents JSON.<br>
181
+ * JSON content type examples:<br>
182
+ * <ul>
183
+ * <li>application/json</li>
184
+ * <li>application/json; charset=UTF8</li>
185
+ * <li>APPLICATION/JSON</li>
186
+ * </ul>
187
+ * @param {String} contentType The MIME content type to check.
188
+ * @returns {Boolean} <code>true</code> if <code>contentType</code> represents JSON, otherwise <code>false</code>.
189
+ */
192
190
  }, {
193
191
  key: "isJsonMime",
194
192
  value: function isJsonMime(contentType) {
@@ -196,10 +194,10 @@ var ApiClient = /*#__PURE__*/function () {
196
194
  }
197
195
 
198
196
  /**
199
- * Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first.
200
- * @param {Array.<String>} contentTypes
201
- * @returns {String} The chosen content type, preferring JSON.
202
- */
197
+ * Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first.
198
+ * @param {Array.<String>} contentTypes
199
+ * @returns {String} The chosen content type, preferring JSON.
200
+ */
203
201
  }, {
204
202
  key: "jsonPreferredMime",
205
203
  value: function jsonPreferredMime(contentTypes) {
@@ -212,18 +210,18 @@ var ApiClient = /*#__PURE__*/function () {
212
210
  }
213
211
 
214
212
  /**
215
- * Checks whether the given parameter value represents file-like content.
216
- * @param param The parameter to check.
217
- * @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
218
- */
213
+ * Checks whether the given parameter value represents file-like content.
214
+ * @param param The parameter to check.
215
+ * @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
216
+ */
219
217
  }, {
220
218
  key: "isFileParam",
221
219
  value: function isFileParam(param) {
222
220
  // fs.ReadStream in Node.js and Electron (but not in runtime like browserify)
223
- if (typeof require === "function") {
221
+ if (typeof require === 'function') {
224
222
  var fs;
225
223
  try {
226
- fs = require("fs");
224
+ fs = require('fs');
227
225
  } catch (err) {}
228
226
  if (fs && fs.ReadStream && param instanceof fs.ReadStream) {
229
227
  return true;
@@ -231,32 +229,32 @@ var ApiClient = /*#__PURE__*/function () {
231
229
  }
232
230
 
233
231
  // Buffer in Node.js
234
- if (typeof Buffer === "function" && param instanceof Buffer) {
232
+ if (typeof Buffer === 'function' && param instanceof Buffer) {
235
233
  return true;
236
234
  }
237
235
 
238
236
  // Blob in browser
239
- if (typeof Blob === "function" && param instanceof Blob) {
237
+ if (typeof Blob === 'function' && param instanceof Blob) {
240
238
  return true;
241
239
  }
242
240
 
243
241
  // File in browser (it seems File object is also instance of Blob, but keep this for safe)
244
- if (typeof File === "function" && param instanceof File) {
242
+ if (typeof File === 'function' && param instanceof File) {
245
243
  return true;
246
244
  }
247
245
  return false;
248
246
  }
249
247
 
250
248
  /**
251
- * Normalizes parameter values:
252
- * <ul>
253
- * <li>remove nils</li>
254
- * <li>keep files and arrays</li>
255
- * <li>format to string with `paramToString` for other cases</li>
256
- * </ul>
257
- * @param {Object.<String, Object>} params The parameters as object properties.
258
- * @returns {Object.<String, Object>} normalized parameters.
259
- */
249
+ * Normalizes parameter values:
250
+ * <ul>
251
+ * <li>remove nils</li>
252
+ * <li>keep files and arrays</li>
253
+ * <li>format to string with `paramToString` for other cases</li>
254
+ * </ul>
255
+ * @param {Object.<String, Object>} params The parameters as object properties.
256
+ * @returns {Object.<String, Object>} normalized parameters.
257
+ */
260
258
  }, {
261
259
  key: "normalizeParams",
262
260
  value: function normalizeParams(params) {
@@ -275,12 +273,12 @@ var ApiClient = /*#__PURE__*/function () {
275
273
  }
276
274
 
277
275
  /**
278
- * Builds a string representation of an array-type actual parameter, according to the given collection format.
279
- * @param {Array} param An array parameter.
280
- * @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy.
281
- * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns
282
- * <code>param</code> as is if <code>collectionFormat</code> is <code>multi</code>.
283
- */
276
+ * Builds a string representation of an array-type actual parameter, according to the given collection format.
277
+ * @param {Array} param An array parameter.
278
+ * @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy.
279
+ * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns
280
+ * <code>param</code> as is if <code>collectionFormat</code> is <code>multi</code>.
281
+ */
284
282
  }, {
285
283
  key: "buildCollectionParam",
286
284
  value: function buildCollectionParam(param, collectionFormat) {
@@ -288,29 +286,29 @@ var ApiClient = /*#__PURE__*/function () {
288
286
  return null;
289
287
  }
290
288
  switch (collectionFormat) {
291
- case "csv":
292
- return param.map(this.paramToString, this).join(",");
293
- case "ssv":
294
- return param.map(this.paramToString, this).join(" ");
295
- case "tsv":
296
- return param.map(this.paramToString, this).join("\t");
297
- case "pipes":
298
- return param.map(this.paramToString, this).join("|");
299
- case "multi":
289
+ case 'csv':
290
+ return param.map(this.paramToString, this).join(',');
291
+ case 'ssv':
292
+ return param.map(this.paramToString, this).join(' ');
293
+ case 'tsv':
294
+ return param.map(this.paramToString, this).join('\t');
295
+ case 'pipes':
296
+ return param.map(this.paramToString, this).join('|');
297
+ case 'multi':
300
298
  //return the array directly as SuperAgent will handle it as expected
301
299
  return param.map(this.paramToString, this);
302
- case "passthrough":
300
+ case 'passthrough':
303
301
  return param;
304
302
  default:
305
- throw new Error("Unknown collection format: " + collectionFormat);
303
+ throw new Error('Unknown collection format: ' + collectionFormat);
306
304
  }
307
305
  }
308
306
 
309
307
  /**
310
- * Applies authentication headers to the request.
311
- * @param {Object} request The request object created by a <code>superagent()</code> call.
312
- * @param {Array.<String>} authNames An array of authentication method names.
313
- */
308
+ * Applies authentication headers to the request.
309
+ * @param {Object} request The request object created by a <code>superagent()</code> call.
310
+ * @param {Array.<String>} authNames An array of authentication method names.
311
+ */
314
312
  }, {
315
313
  key: "applyAuthToRequest",
316
314
  value: function applyAuthToRequest(request, authNames) {
@@ -318,39 +316,39 @@ var ApiClient = /*#__PURE__*/function () {
318
316
  authNames.forEach(function (authName) {
319
317
  var auth = _this2.authentications[authName];
320
318
  switch (auth.type) {
321
- case "basic":
319
+ case 'basic':
322
320
  if (auth.username || auth.password) {
323
- request.auth(auth.username || "", auth.password || "");
321
+ request.auth(auth.username || '', auth.password || '');
324
322
  }
325
323
  break;
326
- case "bearer":
324
+ case 'bearer':
327
325
  if (auth.accessToken) {
328
- var localVarBearerToken = typeof auth.accessToken === "function" ? auth.accessToken() : auth.accessToken;
326
+ var localVarBearerToken = typeof auth.accessToken === 'function' ? auth.accessToken() : auth.accessToken;
329
327
  request.set({
330
- Authorization: "Bearer " + localVarBearerToken
328
+ 'Authorization': 'Bearer ' + localVarBearerToken
331
329
  });
332
330
  }
333
331
  break;
334
- case "apiKey":
332
+ case 'apiKey':
335
333
  if (auth.apiKey) {
336
334
  var data = {};
337
335
  data[auth.name] = auth.apiKey;
338
- if (auth["in"] === "header") {
336
+ if (auth['in'] === 'header') {
339
337
  request.set(data);
340
338
  } else {
341
339
  request.query(data);
342
340
  }
343
341
  }
344
342
  break;
345
- case "oauth2":
343
+ case 'oauth2':
346
344
  if (auth.accessToken) {
347
345
  request.set({
348
- Authorization: "Bearer " + auth.accessToken
346
+ 'Authorization': 'Bearer ' + auth.accessToken
349
347
  });
350
348
  }
351
349
  break;
352
350
  default:
353
- throw new Error("Unknown authentication type: " + auth.type);
351
+ throw new Error('Unknown authentication type: ' + auth.type);
354
352
  }
355
353
  });
356
354
  }
@@ -374,7 +372,7 @@ var ApiClient = /*#__PURE__*/function () {
374
372
  // Rely on SuperAgent for parsing response body.
375
373
  // See http://visionmedia.github.io/superagent/#parsing-response-bodies
376
374
  var data = response.body;
377
- if (data == null || _typeof(data) === "object" && typeof data.length === "undefined" && !Object.keys(data).length) {
375
+ if (data == null || _typeof(data) === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length) {
378
376
  // SuperAgent does not always produce a body; use the unparsed response as a fallback
379
377
  data = response.text;
380
378
  }
@@ -416,8 +414,8 @@ var ApiClient = /*#__PURE__*/function () {
416
414
  this.applyAuthToRequest(request, authNames);
417
415
 
418
416
  // set query parameters
419
- if (httpMethod.toUpperCase() === "GET" && this.cache === false) {
420
- queryParams["_"] = new Date().getTime();
417
+ if (httpMethod.toUpperCase() === 'GET' && this.cache === false) {
418
+ queryParams['_'] = new Date().getTime();
421
419
  }
422
420
  request.query(this.normalizeParams(queryParams));
423
421
 
@@ -434,13 +432,13 @@ var ApiClient = /*#__PURE__*/function () {
434
432
  var contentType = this.jsonPreferredMime(contentTypes);
435
433
  if (contentType) {
436
434
  // Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746)
437
- if (contentType != "multipart/form-data") {
435
+ if (contentType != 'multipart/form-data') {
438
436
  request.type(contentType);
439
437
  }
440
438
  }
441
- if (contentType === "application/x-www-form-urlencoded") {
439
+ if (contentType === 'application/x-www-form-urlencoded') {
442
440
  request.send(_querystring["default"].stringify(this.normalizeParams(formParams)));
443
- } else if (contentType == "multipart/form-data") {
441
+ } else if (contentType == 'multipart/form-data') {
444
442
  var _formParams = this.normalizeParams(formParams);
445
443
  for (var key in _formParams) {
446
444
  if (_formParams.hasOwnProperty(key)) {
@@ -459,8 +457,8 @@ var ApiClient = /*#__PURE__*/function () {
459
457
  }
460
458
  }
461
459
  } else if (bodyParam !== null && bodyParam !== undefined) {
462
- if (!request.header["Content-Type"]) {
463
- request.type("application/json");
460
+ if (!request.header['Content-Type']) {
461
+ request.type('application/json');
464
462
  }
465
463
  request.send(bodyParam);
466
464
  }
@@ -468,15 +466,15 @@ var ApiClient = /*#__PURE__*/function () {
468
466
  if (accept) {
469
467
  request.accept(accept);
470
468
  }
471
- if (returnType === "Blob") {
472
- request.responseType("blob");
473
- } else if (returnType === "String") {
474
- request.responseType("text");
469
+ if (returnType === 'Blob') {
470
+ request.responseType('blob');
471
+ } else if (returnType === 'String') {
472
+ request.responseType('text');
475
473
  }
476
474
 
477
475
  // Attach previously saved cookies, if enabled
478
476
  if (this.enableCookies) {
479
- if (typeof window === "undefined") {
477
+ if (typeof window === 'undefined') {
480
478
  this.agent._attachCookies(request);
481
479
  } else {
482
480
  request.withCredentials(); // Allows credentials to be sent with cross-origin requests in the browser
@@ -497,7 +495,7 @@ var ApiClient = /*#__PURE__*/function () {
497
495
  } else {
498
496
  try {
499
497
  var data = _this3.deserialize(response, returnType);
500
- if (_this3.enableCookies && typeof window === "undefined") {
498
+ if (_this3.enableCookies && typeof window === 'undefined') {
501
499
  _this3.agent._saveCookies(response);
502
500
  }
503
501
  resolve({
@@ -513,21 +511,21 @@ var ApiClient = /*#__PURE__*/function () {
513
511
  }
514
512
 
515
513
  /**
516
- * Parses an ISO-8601 string representation or epoch representation of a date value.
517
- * @param {String} str The date value as a string.
518
- * @returns {Date} The parsed date object.
519
- */
514
+ * Parses an ISO-8601 string representation or epoch representation of a date value.
515
+ * @param {String} str The date value as a string.
516
+ * @returns {Date} The parsed date object.
517
+ */
520
518
  }, {
521
519
  key: "hostSettings",
522
520
  value:
523
521
  /**
524
- * Gets an array of host settings
525
- * @returns An array of host settings
526
- */
522
+ * Gets an array of host settings
523
+ * @returns An array of host settings
524
+ */
527
525
  function hostSettings() {
528
526
  return [{
529
- url: "https://api.notefile.net",
530
- description: "Production server"
527
+ 'url': "https://api.notefile.net",
528
+ 'description': "Production server"
531
529
  }];
532
530
  }
533
531
  }, {
@@ -541,37 +539,37 @@ var ApiClient = /*#__PURE__*/function () {
541
539
  throw new Error("Invalid index " + index + " when selecting the host settings. Must be less than " + servers.length);
542
540
  }
543
541
  var server = servers[index];
544
- var url = server["url"];
542
+ var url = server['url'];
545
543
 
546
544
  // go through variable and assign a value
547
- for (var variable_name in server["variables"]) {
545
+ for (var variable_name in server['variables']) {
548
546
  if (variable_name in variables) {
549
- var variable = server["variables"][variable_name];
550
- if (!("enum_values" in variable) || variable["enum_values"].includes(variables[variable_name])) {
547
+ var variable = server['variables'][variable_name];
548
+ if (!('enum_values' in variable) || variable['enum_values'].includes(variables[variable_name])) {
551
549
  url = url.replace("{" + variable_name + "}", variables[variable_name]);
552
550
  } else {
553
- 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"] + ".");
551
+ 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'] + ".");
554
552
  }
555
553
  } else {
556
554
  // use default value
557
- url = url.replace("{" + variable_name + "}", server["variables"][variable_name]["default_value"]);
555
+ url = url.replace("{" + variable_name + "}", server['variables'][variable_name]['default_value']);
558
556
  }
559
557
  }
560
558
  return url;
561
559
  }
562
560
 
563
561
  /**
564
- * Constructs a new map or array model from REST data.
565
- * @param data {Object|Array} The REST data.
566
- * @param obj {Object|Array} The target object or array.
567
- */
562
+ * Constructs a new map or array model from REST data.
563
+ * @param data {Object|Array} The REST data.
564
+ * @param obj {Object|Array} The target object or array.
565
+ */
568
566
  }], [{
569
567
  key: "canBeJsonified",
570
568
  value: function canBeJsonified(str) {
571
- if (typeof str !== "string" && _typeof(str) !== "object") return false;
569
+ if (typeof str !== 'string' && _typeof(str) !== 'object') return false;
572
570
  try {
573
571
  var type = str.toString();
574
- return type === "[object Object]" || type === "[object Array]";
572
+ return type === '[object Object]' || type === '[object Array]';
575
573
  } catch (err) {
576
574
  return false;
577
575
  }
@@ -580,42 +578,42 @@ var ApiClient = /*#__PURE__*/function () {
580
578
  key: "parseDate",
581
579
  value: function parseDate(str) {
582
580
  if (isNaN(str)) {
583
- return new Date(str.replace(/(\d)(T)(\d)/i, "$1 $3"));
581
+ return new Date(str.replace(/(\d)(T)(\d)/i, '$1 $3'));
584
582
  }
585
583
  return new Date(+str);
586
584
  }
587
585
 
588
586
  /**
589
- * Converts a value to the specified type.
590
- * @param {(String|Object)} data The data to convert, as a string or object.
591
- * @param {(String|Array.<String>|Object.<String, Object>|Function)} type The type to return. Pass a string for simple types
592
- * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To
593
- * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type:
594
- * all properties on <code>data<code> will be converted to this type.
595
- * @returns An instance of the specified type or null or undefined if data is null or undefined.
596
- */
587
+ * Converts a value to the specified type.
588
+ * @param {(String|Object)} data The data to convert, as a string or object.
589
+ * @param {(String|Array.<String>|Object.<String, Object>|Function)} type The type to return. Pass a string for simple types
590
+ * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To
591
+ * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type:
592
+ * all properties on <code>data<code> will be converted to this type.
593
+ * @returns An instance of the specified type or null or undefined if data is null or undefined.
594
+ */
597
595
  }, {
598
596
  key: "convertToType",
599
597
  value: function convertToType(data, type) {
600
598
  if (data === null || data === undefined) return data;
601
599
  switch (type) {
602
- case "Boolean":
600
+ case 'Boolean':
603
601
  return Boolean(data);
604
- case "Integer":
602
+ case 'Integer':
605
603
  return parseInt(data, 10);
606
- case "Number":
604
+ case 'Number':
607
605
  return parseFloat(data);
608
- case "String":
606
+ case 'String':
609
607
  return String(data);
610
- case "Date":
608
+ case 'Date':
611
609
  return String(data);
612
- case "Blob":
610
+ case 'Blob':
613
611
  return data;
614
612
  default:
615
613
  if (type === Object) {
616
614
  // generic object, return directly
617
615
  return data;
618
- } else if (typeof type.constructFromObject === "function") {
616
+ } else if (typeof type.constructFromObject === 'function') {
619
617
  // for model type like User and enum class
620
618
  return type.constructFromObject(data);
621
619
  } else if (Array.isArray(type)) {
@@ -624,7 +622,7 @@ var ApiClient = /*#__PURE__*/function () {
624
622
  return data.map(function (item) {
625
623
  return ApiClient.convertToType(item, itemType);
626
624
  });
627
- } else if (_typeof(type) === "object") {
625
+ } else if (_typeof(type) === 'object') {
628
626
  // for plain object type like: {'String': 'Integer'}
629
627
  var keyType, valueType;
630
628
  for (var k in type) {
@@ -674,32 +672,32 @@ ApiClient.CollectionFormatEnum = {
674
672
  * Comma-separated values. Value: <code>csv</code>
675
673
  * @const
676
674
  */
677
- CSV: ",",
675
+ CSV: ',',
678
676
  /**
679
677
  * Space-separated values. Value: <code>ssv</code>
680
678
  * @const
681
679
  */
682
- SSV: " ",
680
+ SSV: ' ',
683
681
  /**
684
682
  * Tab-separated values. Value: <code>tsv</code>
685
683
  * @const
686
684
  */
687
- TSV: "\t",
685
+ TSV: '\t',
688
686
  /**
689
687
  * Pipe(|)-separated values. Value: <code>pipes</code>
690
688
  * @const
691
689
  */
692
- PIPES: "|",
690
+ PIPES: '|',
693
691
  /**
694
692
  * Native array. Value: <code>multi</code>
695
693
  * @const
696
694
  */
697
- MULTI: "multi"
695
+ MULTI: 'multi'
698
696
  };
699
697
 
700
698
  /**
701
- * The default API client implementation.
702
- * @type {module:ApiClient}
703
- */
699
+ * The default API client implementation.
700
+ * @type {module:ApiClient}
701
+ */
704
702
  ApiClient.instance = new ApiClient();
705
703
  var _default = exports["default"] = ApiClient;