@blues-inc/notehub-js 6.2.0-beta.1 → 6.2.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 (162) hide show
  1. package/README.md +292 -288
  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 +28 -28
  6. package/dist/api/DeviceApi.js +356 -356
  7. package/dist/api/EventApi.js +118 -118
  8. package/dist/api/ExternalDevicesApi.js +41 -41
  9. package/dist/api/JobsApi.js +74 -127
  10. package/dist/api/MonitorApi.js +52 -52
  11. package/dist/api/ProjectApi.js +435 -435
  12. package/dist/api/RouteApi.js +83 -83
  13. package/dist/api/UsageApi.js +67 -67
  14. package/dist/api/WebhookApi.js +366 -53
  15. package/dist/index.js +7 -0
  16. package/dist/model/AWSRoleConfig.js +14 -14
  17. package/dist/model/AddDeviceToFleetsRequest.js +8 -8
  18. package/dist/model/Alert.js +74 -76
  19. package/dist/model/AlertDataInner.js +36 -36
  20. package/dist/model/AlertNotificationsInner.js +18 -18
  21. package/dist/model/AwsRoute.js +70 -70
  22. package/dist/model/AzureRoute.js +43 -43
  23. package/dist/model/BillingAccount.js +21 -21
  24. package/dist/model/BillingAccountRole.js +9 -9
  25. package/dist/model/BlynkRoute.js +28 -28
  26. package/dist/model/Body.js +5 -5
  27. package/dist/model/CancelJobRun200Response.js +6 -6
  28. package/dist/model/CellularPlan.js +34 -34
  29. package/dist/model/CloneProjectRequest.js +20 -20
  30. package/dist/model/Contact.js +22 -22
  31. package/dist/model/CreateFleetRequest.js +20 -20
  32. package/dist/model/CreateJob201Response.js +8 -8
  33. package/dist/model/CreateLegacyWebhookEventRequest.js +118 -0
  34. package/dist/model/CreateMonitor.js +127 -128
  35. package/dist/model/CreateProductRequest.js +22 -22
  36. package/dist/model/CreateProjectRequest.js +16 -16
  37. package/dist/model/CreateUpdateRepository.js +17 -17
  38. package/dist/model/CurrentFirmware.js +12 -12
  39. package/dist/model/DFUEnv.js +12 -12
  40. package/dist/model/DFUState.js +65 -65
  41. package/dist/model/DataField.js +7 -7
  42. package/dist/model/DataSetField.js +19 -19
  43. package/dist/model/DataUsage.js +14 -14
  44. package/dist/model/DatacakeRoute.js +35 -35
  45. package/dist/model/DeleteDeviceFromFleetsRequest.js +8 -8
  46. package/dist/model/DeleteJob200Response.js +6 -6
  47. package/dist/model/DeleteNotefilesRequest.js +7 -7
  48. package/dist/model/Device.js +106 -107
  49. package/dist/model/DeviceDfuHistory.js +19 -20
  50. package/dist/model/DeviceDfuHistoryCurrent.js +32 -32
  51. package/dist/model/DeviceDfuHistoryPage.js +12 -13
  52. package/dist/model/DeviceDfuStateMachine.js +24 -25
  53. package/dist/model/DeviceDfuStateMachineNode.js +22 -22
  54. package/dist/model/DeviceDfuStatus.js +20 -20
  55. package/dist/model/DeviceDfuStatusPage.js +12 -13
  56. package/dist/model/DeviceSession.js +221 -221
  57. package/dist/model/DeviceTowerInfo.js +14 -14
  58. package/dist/model/DeviceUsage.js +32 -32
  59. package/dist/model/DfuActionRequest.js +7 -7
  60. package/dist/model/EmailNotification.js +7 -7
  61. package/dist/model/EnvTreeJsonNode.js +67 -69
  62. package/dist/model/EnvVar.js +18 -18
  63. package/dist/model/EnvironmentVariables.js +8 -8
  64. package/dist/model/Error.js +31 -31
  65. package/dist/model/Event.js +248 -248
  66. package/dist/model/Filter.js +16 -16
  67. package/dist/model/Firmware.js +49 -49
  68. package/dist/model/FirmwareInfo.js +68 -68
  69. package/dist/model/Fleet.js +38 -38
  70. package/dist/model/FleetConnectivityAssurance.js +5 -5
  71. package/dist/model/GetAlerts200Response.js +14 -15
  72. package/dist/model/GetBillingAccount200Response.js +25 -25
  73. package/dist/model/GetBillingAccount200ResponsePlan.js +22 -22
  74. package/dist/model/GetBillingAccountBalanceHistory200Response.js +9 -10
  75. package/dist/model/GetBillingAccountBalanceHistory200ResponseDataInner.js +17 -17
  76. package/dist/model/GetBillingAccounts200Response.js +9 -10
  77. package/dist/model/GetDataUsage200Response.js +12 -13
  78. package/dist/model/GetDataUsage200ResponseDataInner.js +43 -44
  79. package/dist/model/GetDbNote200Response.js +13 -13
  80. package/dist/model/GetDeviceEnvironmentVariablesByPin200Response.js +16 -16
  81. package/dist/model/GetDeviceFleets200Response.js +11 -12
  82. package/dist/model/GetDeviceHealthLog200Response.js +11 -12
  83. package/dist/model/GetDeviceHealthLog200ResponseHealthLogInner.js +19 -19
  84. package/dist/model/GetDeviceLatestEvents200Response.js +9 -10
  85. package/dist/model/GetDevicePlans200Response.js +9 -10
  86. package/dist/model/GetDevicePublicKey200Response.js +16 -16
  87. package/dist/model/GetDevicePublicKeys200Response.js +16 -17
  88. package/dist/model/GetDevicePublicKeys200ResponseDevicePublicKeysInner.js +12 -12
  89. package/dist/model/GetDeviceSessions200Response.js +16 -17
  90. package/dist/model/GetDevices200Response.js +16 -17
  91. package/dist/model/GetEvents200Response.js +20 -21
  92. package/dist/model/GetEventsByCursor200Response.js +23 -24
  93. package/dist/model/GetJobRuns200Response.js +11 -12
  94. package/dist/model/GetJobs200Response.js +11 -12
  95. package/dist/model/GetNotefile200Response.js +11 -11
  96. package/dist/model/GetProducts200Response.js +9 -10
  97. package/dist/model/GetProjectMembers200Response.js +11 -12
  98. package/dist/model/GetProjects200Response.js +9 -10
  99. package/dist/model/GetRouteLogsUsage200Response.js +14 -15
  100. package/dist/model/GetSessionsUsage200Response.js +15 -16
  101. package/dist/model/GetWebhooks200Response.js +9 -10
  102. package/dist/model/GoogleRoute.js +33 -33
  103. package/dist/model/HttpRoute.js +35 -35
  104. package/dist/model/Job.js +28 -59
  105. package/dist/model/JobRun.js +57 -57
  106. package/dist/model/Location.js +40 -40
  107. package/dist/model/Login200Response.js +7 -7
  108. package/dist/model/LoginRequest.js +12 -12
  109. package/dist/model/Monitor.js +101 -102
  110. package/dist/model/MonitorAlertRoutesInner.js +10 -9
  111. package/dist/model/MqttRoute.js +68 -68
  112. package/dist/model/Note.js +31 -31
  113. package/dist/model/NoteInput.js +9 -9
  114. package/dist/model/Notefile.js +22 -23
  115. package/dist/model/NotefileSchema.js +18 -19
  116. package/dist/model/NotehubRoute.js +103 -103
  117. package/dist/model/NotehubRouteSummary.js +23 -23
  118. package/dist/model/OAuth2Error.js +20 -20
  119. package/dist/model/OAuth2TokenResponse.js +23 -23
  120. package/dist/model/PersonalAccessToken.js +34 -34
  121. package/dist/model/PersonalAccessTokenCreatedBy.js +17 -17
  122. package/dist/model/PersonalAccessTokenInfo.js +18 -18
  123. package/dist/model/PersonalAccessTokenSecret.js +12 -12
  124. package/dist/model/Product.js +26 -26
  125. package/dist/model/Project.js +34 -34
  126. package/dist/model/ProjectMember.js +22 -22
  127. package/dist/model/ProvisionDeviceRequest.js +18 -18
  128. package/dist/model/ProxyRoute.js +29 -29
  129. package/dist/model/QubitroRoute.js +33 -33
  130. package/dist/model/RadRoute.js +31 -31
  131. package/dist/model/Repository.js +22 -22
  132. package/dist/model/Role.js +9 -9
  133. package/dist/model/RouteLog.js +38 -38
  134. package/dist/model/RouteTransformSettings.js +18 -18
  135. package/dist/model/RunJob200Response.js +8 -8
  136. package/dist/model/S3ArchiveRoute.js +79 -79
  137. package/dist/model/SatelliteDataUsage.js +18 -18
  138. package/dist/model/SatellitePlan.js +29 -29
  139. package/dist/model/SchemaProperty.js +36 -38
  140. package/dist/model/SignalDevice200Response.js +5 -5
  141. package/dist/model/SimUsage.js +19 -19
  142. package/dist/model/SlackBearerNotification.js +25 -25
  143. package/dist/model/SlackRoute.js +48 -48
  144. package/dist/model/SlackWebHookNotification.js +20 -20
  145. package/dist/model/SnowflakeRoute.js +45 -45
  146. package/dist/model/SnowpipeStreamingRoute.js +60 -60
  147. package/dist/model/ThingworxRoute.js +33 -33
  148. package/dist/model/TowerLocation.js +54 -54
  149. package/dist/model/TwilioRoute.js +43 -43
  150. package/dist/model/UpdateFleetRequest.js +33 -33
  151. package/dist/model/UpdateHostFirmwareRequest.js +17 -17
  152. package/dist/model/UploadMetadata.js +64 -64
  153. package/dist/model/UsageData.js +33 -33
  154. package/dist/model/UsageEventsData.js +49 -49
  155. package/dist/model/UsageEventsResponse.js +14 -15
  156. package/dist/model/UsageRouteLogsData.js +30 -30
  157. package/dist/model/UsageSessionsData.js +43 -43
  158. package/dist/model/UserDfuStateMachine.js +20 -20
  159. package/dist/model/UserDfuStateMachineStatus.js +20 -20
  160. package/dist/model/UserFirmwareInfo.js +12 -12
  161. package/dist/model/WebhookSettings.js +15 -15
  162. package/package.json +3 -3
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _CreateLegacyWebhookEventRequest = _interopRequireDefault(require("../model/CreateLegacyWebhookEventRequest"));
8
9
  var _Error = _interopRequireDefault(require("../model/Error"));
9
10
  var _GetWebhooks200Response = _interopRequireDefault(require("../model/GetWebhooks200Response"));
10
11
  var _WebhookSettings = _interopRequireDefault(require("../model/WebhookSettings"));
@@ -16,7 +17,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
16
17
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
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); } /**
18
19
  * Notehub API
19
- * The OpenAPI definition for the Notehub.io API.
20
+ * The OpenAPI definition for the Notehub.io API.
20
21
  *
21
22
  * The version of the OpenAPI document: 1.2.0
22
23
  * Contact: engineering@blues.io
@@ -27,31 +28,83 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
27
28
  *
28
29
  */
29
30
  /**
30
- * Webhook service.
31
- * @module api/WebhookApi
32
- * @version 6.2.0-beta.1
33
- */
31
+ * Webhook service.
32
+ * @module api/WebhookApi
33
+ * @version 6.2.0-beta.10
34
+ */
34
35
  var WebhookApi = exports["default"] = /*#__PURE__*/function () {
35
36
  /**
36
- * Constructs a new WebhookApi.
37
- * @alias module:api/WebhookApi
38
- * @class
39
- * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
40
- * default to {@link module:ApiClient#instance} if unspecified.
41
- */
37
+ * Constructs a new WebhookApi.
38
+ * @alias module:api/WebhookApi
39
+ * @class
40
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
41
+ * default to {@link module:ApiClient#instance} if unspecified.
42
+ */
42
43
  function WebhookApi(apiClient) {
43
44
  _classCallCheck(this, WebhookApi);
44
45
  this.apiClient = apiClient || _ApiClient["default"].instance;
45
46
  }
46
47
 
47
48
  /**
48
- * Creates a webhook for the specified product with the given name. The name | must be unique within the project.
49
- * @param {String} projectOrProductUID
50
- * @param {String} webhookUID Webhook UID
51
- * @param {module:model/WebhookSettings} webhookSettings
49
+ * Legacy endpoint for sending an event from a webhook, associated with the given device (provisioning it if necessary). The request body is a Note-shaped object containing the notefile name, body, and optional payload.
50
+ * @param {String} productUID
51
+ * @param {String} deviceUID
52
+ * @param {Object.<String, {String: Object}>} requestBody A Note-shaped event with notefile name, JSON body, and optional base64-encoded payload.
52
53
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
53
54
  */
54
55
  return _createClass(WebhookApi, [{
56
+ key: "createLegacyWebhookEventWithHttpInfo",
57
+ value: function createLegacyWebhookEventWithHttpInfo(productUID, deviceUID, requestBody) {
58
+ var postBody = requestBody;
59
+ // verify the required parameter 'productUID' is set
60
+ if (productUID === undefined || productUID === null) {
61
+ throw new _Error["default"]("Missing the required parameter 'productUID' when calling createLegacyWebhookEvent");
62
+ }
63
+ // verify the required parameter 'deviceUID' is set
64
+ if (deviceUID === undefined || deviceUID === null) {
65
+ throw new _Error["default"]("Missing the required parameter 'deviceUID' when calling createLegacyWebhookEvent");
66
+ }
67
+ // verify the required parameter 'requestBody' is set
68
+ if (requestBody === undefined || requestBody === null) {
69
+ throw new _Error["default"]("Missing the required parameter 'requestBody' when calling createLegacyWebhookEvent");
70
+ }
71
+ var pathParams = {
72
+ productUID: productUID,
73
+ deviceUID: deviceUID
74
+ };
75
+ var queryParams = {};
76
+ var headerParams = {};
77
+ var formParams = {};
78
+ var authNames = ["personalAccessToken"];
79
+ var contentTypes = ["application/json"];
80
+ var accepts = ["application/json"];
81
+ var returnType = null;
82
+ return this.apiClient.callApi("/v1/products/{productUID}/devices/{deviceUID}/webhook-event", "POST", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
83
+ }
84
+
85
+ /**
86
+ * Legacy endpoint for sending an event from a webhook, associated with the given device (provisioning it if necessary). The request body is a Note-shaped object containing the notefile name, body, and optional payload.
87
+ * @param {String} productUID
88
+ * @param {String} deviceUID
89
+ * @param {Object.<String, {String: Object}>} requestBody A Note-shaped event with notefile name, JSON body, and optional base64-encoded payload.
90
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}
91
+ */
92
+ }, {
93
+ key: "createLegacyWebhookEvent",
94
+ value: function createLegacyWebhookEvent(productUID, deviceUID, requestBody) {
95
+ return this.createLegacyWebhookEventWithHttpInfo(productUID, deviceUID, requestBody).then(function (response_and_data) {
96
+ return response_and_data.data;
97
+ });
98
+ }
99
+
100
+ /**
101
+ * Creates a webhook for the specified product with the given name. The name | must be unique within the project.
102
+ * @param {String} projectOrProductUID
103
+ * @param {String} webhookUID Webhook UID
104
+ * @param {module:model/WebhookSettings} webhookSettings
105
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
106
+ */
107
+ }, {
55
108
  key: "createWebhookWithHttpInfo",
56
109
  value: function createWebhookWithHttpInfo(projectOrProductUID, webhookUID, webhookSettings) {
57
110
  var postBody = webhookSettings;
@@ -68,24 +121,24 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
68
121
  throw new _Error["default"]("Missing the required parameter 'webhookSettings' when calling createWebhook");
69
122
  }
70
123
  var pathParams = {
71
- 'projectOrProductUID': projectOrProductUID,
72
- 'webhookUID': webhookUID
124
+ projectOrProductUID: projectOrProductUID,
125
+ webhookUID: webhookUID
73
126
  };
74
127
  var queryParams = {};
75
128
  var headerParams = {};
76
129
  var formParams = {};
77
- var authNames = ['personalAccessToken'];
78
- var contentTypes = ['application/json'];
79
- var accepts = ['application/json'];
130
+ var authNames = ["personalAccessToken"];
131
+ var contentTypes = ["application/json"];
132
+ var accepts = ["application/json"];
80
133
  var returnType = null;
81
- return this.apiClient.callApi('/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
134
+ return this.apiClient.callApi("/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}", "POST", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
82
135
  }
83
136
 
84
137
  /**
85
138
  * Creates a webhook for the specified product with the given name. The name | must be unique within the project.
86
- * @param {String} projectOrProductUID
139
+ * @param {String} projectOrProductUID
87
140
  * @param {String} webhookUID Webhook UID
88
- * @param {module:model/WebhookSettings} webhookSettings
141
+ * @param {module:model/WebhookSettings} webhookSettings
89
142
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}
90
143
  */
91
144
  }, {
@@ -96,9 +149,120 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
96
149
  });
97
150
  }
98
151
 
152
+ /**
153
+ * Sends an event to be processed by the specified webhook, addressed by productUID, associated with the given device (provisioning it if necessary). The entire request body becomes the event body. The webhook's configured JSONata transform, if any, is applied before routing.
154
+ * @param {String} productUID
155
+ * @param {String} webhookUID Webhook UID
156
+ * @param {String} deviceUID
157
+ * @param {Object.<String, {String: Object}>} requestBody The event body (arbitrary JSON)
158
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
159
+ */
160
+ }, {
161
+ key: "createWebhookDeviceEventByProductWithHttpInfo",
162
+ value: function createWebhookDeviceEventByProductWithHttpInfo(productUID, webhookUID, deviceUID, requestBody) {
163
+ var postBody = requestBody;
164
+ // verify the required parameter 'productUID' is set
165
+ if (productUID === undefined || productUID === null) {
166
+ throw new _Error["default"]("Missing the required parameter 'productUID' when calling createWebhookDeviceEventByProduct");
167
+ }
168
+ // verify the required parameter 'webhookUID' is set
169
+ if (webhookUID === undefined || webhookUID === null) {
170
+ throw new _Error["default"]("Missing the required parameter 'webhookUID' when calling createWebhookDeviceEventByProduct");
171
+ }
172
+ // verify the required parameter 'deviceUID' is set
173
+ if (deviceUID === undefined || deviceUID === null) {
174
+ throw new _Error["default"]("Missing the required parameter 'deviceUID' when calling createWebhookDeviceEventByProduct");
175
+ }
176
+ // verify the required parameter 'requestBody' is set
177
+ if (requestBody === undefined || requestBody === null) {
178
+ throw new _Error["default"]("Missing the required parameter 'requestBody' when calling createWebhookDeviceEventByProduct");
179
+ }
180
+ var pathParams = {
181
+ productUID: productUID,
182
+ webhookUID: webhookUID,
183
+ deviceUID: deviceUID
184
+ };
185
+ var queryParams = {};
186
+ var headerParams = {};
187
+ var formParams = {};
188
+ var authNames = ["personalAccessToken"];
189
+ var contentTypes = ["application/json"];
190
+ var accepts = ["application/json"];
191
+ var returnType = null;
192
+ return this.apiClient.callApi("/v1/products/{productUID}/webhooks/{webhookUID}/devices/{deviceUID}/event", "POST", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
193
+ }
194
+
195
+ /**
196
+ * Sends an event to be processed by the specified webhook, addressed by productUID, associated with the given device (provisioning it if necessary). The entire request body becomes the event body. The webhook's configured JSONata transform, if any, is applied before routing.
197
+ * @param {String} productUID
198
+ * @param {String} webhookUID Webhook UID
199
+ * @param {String} deviceUID
200
+ * @param {Object.<String, {String: Object}>} requestBody The event body (arbitrary JSON)
201
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}
202
+ */
203
+ }, {
204
+ key: "createWebhookDeviceEventByProduct",
205
+ value: function createWebhookDeviceEventByProduct(productUID, webhookUID, deviceUID, requestBody) {
206
+ return this.createWebhookDeviceEventByProductWithHttpInfo(productUID, webhookUID, deviceUID, requestBody).then(function (response_and_data) {
207
+ return response_and_data.data;
208
+ });
209
+ }
210
+
211
+ /**
212
+ * Sends an event to be processed by the specified webhook, addressed by productUID. The entire request body becomes the event body. The webhook's configured JSONata transform, if any, is applied before routing. The event is not associated with a specific device.
213
+ * @param {String} productUID
214
+ * @param {String} webhookUID Webhook UID
215
+ * @param {Object.<String, {String: Object}>} requestBody The event body (arbitrary JSON)
216
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
217
+ */
218
+ }, {
219
+ key: "createWebhookEventByProductWithHttpInfo",
220
+ value: function createWebhookEventByProductWithHttpInfo(productUID, webhookUID, requestBody) {
221
+ var postBody = requestBody;
222
+ // verify the required parameter 'productUID' is set
223
+ if (productUID === undefined || productUID === null) {
224
+ throw new _Error["default"]("Missing the required parameter 'productUID' when calling createWebhookEventByProduct");
225
+ }
226
+ // verify the required parameter 'webhookUID' is set
227
+ if (webhookUID === undefined || webhookUID === null) {
228
+ throw new _Error["default"]("Missing the required parameter 'webhookUID' when calling createWebhookEventByProduct");
229
+ }
230
+ // verify the required parameter 'requestBody' is set
231
+ if (requestBody === undefined || requestBody === null) {
232
+ throw new _Error["default"]("Missing the required parameter 'requestBody' when calling createWebhookEventByProduct");
233
+ }
234
+ var pathParams = {
235
+ productUID: productUID,
236
+ webhookUID: webhookUID
237
+ };
238
+ var queryParams = {};
239
+ var headerParams = {};
240
+ var formParams = {};
241
+ var authNames = ["personalAccessToken"];
242
+ var contentTypes = ["application/json"];
243
+ var accepts = ["application/json"];
244
+ var returnType = null;
245
+ return this.apiClient.callApi("/v1/products/{productUID}/webhooks/{webhookUID}/event", "POST", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
246
+ }
247
+
248
+ /**
249
+ * Sends an event to be processed by the specified webhook, addressed by productUID. The entire request body becomes the event body. The webhook's configured JSONata transform, if any, is applied before routing. The event is not associated with a specific device.
250
+ * @param {String} productUID
251
+ * @param {String} webhookUID Webhook UID
252
+ * @param {Object.<String, {String: Object}>} requestBody The event body (arbitrary JSON)
253
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}
254
+ */
255
+ }, {
256
+ key: "createWebhookEventByProduct",
257
+ value: function createWebhookEventByProduct(productUID, webhookUID, requestBody) {
258
+ return this.createWebhookEventByProductWithHttpInfo(productUID, webhookUID, requestBody).then(function (response_and_data) {
259
+ return response_and_data.data;
260
+ });
261
+ }
262
+
99
263
  /**
100
264
  * Deletes the specified webhook
101
- * @param {String} projectOrProductUID
265
+ * @param {String} projectOrProductUID
102
266
  * @param {String} webhookUID Webhook UID
103
267
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
104
268
  */
@@ -115,22 +279,22 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
115
279
  throw new _Error["default"]("Missing the required parameter 'webhookUID' when calling deleteWebhook");
116
280
  }
117
281
  var pathParams = {
118
- 'projectOrProductUID': projectOrProductUID,
119
- 'webhookUID': webhookUID
282
+ projectOrProductUID: projectOrProductUID,
283
+ webhookUID: webhookUID
120
284
  };
121
285
  var queryParams = {};
122
286
  var headerParams = {};
123
287
  var formParams = {};
124
- var authNames = ['personalAccessToken'];
288
+ var authNames = ["personalAccessToken"];
125
289
  var contentTypes = [];
126
- var accepts = ['application/json'];
290
+ var accepts = ["application/json"];
127
291
  var returnType = null;
128
- return this.apiClient.callApi('/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
292
+ return this.apiClient.callApi("/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}", "DELETE", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
129
293
  }
130
294
 
131
295
  /**
132
296
  * Deletes the specified webhook
133
- * @param {String} projectOrProductUID
297
+ * @param {String} projectOrProductUID
134
298
  * @param {String} webhookUID Webhook UID
135
299
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}
136
300
  */
@@ -144,7 +308,7 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
144
308
 
145
309
  /**
146
310
  * Retrieves the configuration settings for the specified webhook
147
- * @param {String} projectOrProductUID
311
+ * @param {String} projectOrProductUID
148
312
  * @param {String} webhookUID Webhook UID
149
313
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/WebhookSettings} and HTTP response
150
314
  */
@@ -161,22 +325,22 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
161
325
  throw new _Error["default"]("Missing the required parameter 'webhookUID' when calling getWebhook");
162
326
  }
163
327
  var pathParams = {
164
- 'projectOrProductUID': projectOrProductUID,
165
- 'webhookUID': webhookUID
328
+ projectOrProductUID: projectOrProductUID,
329
+ webhookUID: webhookUID
166
330
  };
167
331
  var queryParams = {};
168
332
  var headerParams = {};
169
333
  var formParams = {};
170
- var authNames = ['personalAccessToken'];
334
+ var authNames = ["personalAccessToken"];
171
335
  var contentTypes = [];
172
- var accepts = ['application/json'];
336
+ var accepts = ["application/json"];
173
337
  var returnType = _WebhookSettings["default"];
174
- return this.apiClient.callApi('/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
338
+ return this.apiClient.callApi("/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}", "GET", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
175
339
  }
176
340
 
177
341
  /**
178
342
  * Retrieves the configuration settings for the specified webhook
179
- * @param {String} projectOrProductUID
343
+ * @param {String} projectOrProductUID
180
344
  * @param {String} webhookUID Webhook UID
181
345
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/WebhookSettings}
182
346
  */
@@ -188,9 +352,55 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
188
352
  });
189
353
  }
190
354
 
355
+ /**
356
+ * Retrieves the configuration settings for the specified webhook, addressed by productUID.
357
+ * @param {String} productUID
358
+ * @param {String} webhookUID Webhook UID
359
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/WebhookSettings} and HTTP response
360
+ */
361
+ }, {
362
+ key: "getWebhookSettingsByProductWithHttpInfo",
363
+ value: function getWebhookSettingsByProductWithHttpInfo(productUID, webhookUID) {
364
+ var postBody = null;
365
+ // verify the required parameter 'productUID' is set
366
+ if (productUID === undefined || productUID === null) {
367
+ throw new _Error["default"]("Missing the required parameter 'productUID' when calling getWebhookSettingsByProduct");
368
+ }
369
+ // verify the required parameter 'webhookUID' is set
370
+ if (webhookUID === undefined || webhookUID === null) {
371
+ throw new _Error["default"]("Missing the required parameter 'webhookUID' when calling getWebhookSettingsByProduct");
372
+ }
373
+ var pathParams = {
374
+ productUID: productUID,
375
+ webhookUID: webhookUID
376
+ };
377
+ var queryParams = {};
378
+ var headerParams = {};
379
+ var formParams = {};
380
+ var authNames = ["personalAccessToken"];
381
+ var contentTypes = [];
382
+ var accepts = ["application/json"];
383
+ var returnType = _WebhookSettings["default"];
384
+ return this.apiClient.callApi("/v1/products/{productUID}/webhooks/{webhookUID}/settings", "GET", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
385
+ }
386
+
387
+ /**
388
+ * Retrieves the configuration settings for the specified webhook, addressed by productUID.
389
+ * @param {String} productUID
390
+ * @param {String} webhookUID Webhook UID
391
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/WebhookSettings}
392
+ */
393
+ }, {
394
+ key: "getWebhookSettingsByProduct",
395
+ value: function getWebhookSettingsByProduct(productUID, webhookUID) {
396
+ return this.getWebhookSettingsByProductWithHttpInfo(productUID, webhookUID).then(function (response_and_data) {
397
+ return response_and_data.data;
398
+ });
399
+ }
400
+
191
401
  /**
192
402
  * Retrieves all webhooks for the specified project
193
- * @param {String} projectOrProductUID
403
+ * @param {String} projectOrProductUID
194
404
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetWebhooks200Response} and HTTP response
195
405
  */
196
406
  }, {
@@ -202,21 +412,21 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
202
412
  throw new _Error["default"]("Missing the required parameter 'projectOrProductUID' when calling getWebhooks");
203
413
  }
204
414
  var pathParams = {
205
- 'projectOrProductUID': projectOrProductUID
415
+ projectOrProductUID: projectOrProductUID
206
416
  };
207
417
  var queryParams = {};
208
418
  var headerParams = {};
209
419
  var formParams = {};
210
- var authNames = ['personalAccessToken'];
420
+ var authNames = ["personalAccessToken"];
211
421
  var contentTypes = [];
212
- var accepts = ['application/json'];
422
+ var accepts = ["application/json"];
213
423
  var returnType = _GetWebhooks200Response["default"];
214
- return this.apiClient.callApi('/v1/projects/{projectOrProductUID}/webhooks', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
424
+ return this.apiClient.callApi("/v1/projects/{projectOrProductUID}/webhooks", "GET", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
215
425
  }
216
426
 
217
427
  /**
218
428
  * Retrieves all webhooks for the specified project
219
- * @param {String} projectOrProductUID
429
+ * @param {String} projectOrProductUID
220
430
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetWebhooks200Response}
221
431
  */
222
432
  }, {
@@ -227,11 +437,62 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
227
437
  });
228
438
  }
229
439
 
440
+ /**
441
+ * Legacy endpoint for opening or updating a webhook session for the given device (provisioning the device if necessary). Used by external services that need to maintain a callable session against a device behind a webhook.
442
+ * @param {String} productUID
443
+ * @param {String} deviceUID
444
+ * @param {Object} opts Optional parameters
445
+ * @param {Object.<String, {String: Object}>} opts.requestBody Optional session metadata.
446
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
447
+ */
448
+ }, {
449
+ key: "updateLegacyWebhookSessionWithHttpInfo",
450
+ value: function updateLegacyWebhookSessionWithHttpInfo(productUID, deviceUID, opts) {
451
+ opts = opts || {};
452
+ var postBody = opts["requestBody"];
453
+ // verify the required parameter 'productUID' is set
454
+ if (productUID === undefined || productUID === null) {
455
+ throw new _Error["default"]("Missing the required parameter 'productUID' when calling updateLegacyWebhookSession");
456
+ }
457
+ // verify the required parameter 'deviceUID' is set
458
+ if (deviceUID === undefined || deviceUID === null) {
459
+ throw new _Error["default"]("Missing the required parameter 'deviceUID' when calling updateLegacyWebhookSession");
460
+ }
461
+ var pathParams = {
462
+ productUID: productUID,
463
+ deviceUID: deviceUID
464
+ };
465
+ var queryParams = {};
466
+ var headerParams = {};
467
+ var formParams = {};
468
+ var authNames = ["personalAccessToken"];
469
+ var contentTypes = ["application/json"];
470
+ var accepts = ["application/json"];
471
+ var returnType = null;
472
+ return this.apiClient.callApi("/v1/products/{productUID}/devices/{deviceUID}/webhook-session", "PUT", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
473
+ }
474
+
475
+ /**
476
+ * Legacy endpoint for opening or updating a webhook session for the given device (provisioning the device if necessary). Used by external services that need to maintain a callable session against a device behind a webhook.
477
+ * @param {String} productUID
478
+ * @param {String} deviceUID
479
+ * @param {Object} opts Optional parameters
480
+ * @param {Object.<String, {String: Object}>} opts.requestBody Optional session metadata.
481
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}
482
+ */
483
+ }, {
484
+ key: "updateLegacyWebhookSession",
485
+ value: function updateLegacyWebhookSession(productUID, deviceUID, opts) {
486
+ return this.updateLegacyWebhookSessionWithHttpInfo(productUID, deviceUID, opts).then(function (response_and_data) {
487
+ return response_and_data.data;
488
+ });
489
+ }
490
+
230
491
  /**
231
492
  * Updates the configuration settings for the specified webhook. | Webhook will be created if it does not exist. Update body will completely replace the existing settings.
232
- * @param {String} projectOrProductUID
493
+ * @param {String} projectOrProductUID
233
494
  * @param {String} webhookUID Webhook UID
234
- * @param {module:model/WebhookSettings} webhookSettings
495
+ * @param {module:model/WebhookSettings} webhookSettings
235
496
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
236
497
  */
237
498
  }, {
@@ -251,24 +512,24 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
251
512
  throw new _Error["default"]("Missing the required parameter 'webhookSettings' when calling updateWebhook");
252
513
  }
253
514
  var pathParams = {
254
- 'projectOrProductUID': projectOrProductUID,
255
- 'webhookUID': webhookUID
515
+ projectOrProductUID: projectOrProductUID,
516
+ webhookUID: webhookUID
256
517
  };
257
518
  var queryParams = {};
258
519
  var headerParams = {};
259
520
  var formParams = {};
260
- var authNames = ['personalAccessToken'];
261
- var contentTypes = ['application/json'];
262
- var accepts = ['application/json'];
521
+ var authNames = ["personalAccessToken"];
522
+ var contentTypes = ["application/json"];
523
+ var accepts = ["application/json"];
263
524
  var returnType = null;
264
- return this.apiClient.callApi('/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
525
+ return this.apiClient.callApi("/v1/projects/{projectOrProductUID}/webhooks/{webhookUID}", "PUT", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
265
526
  }
266
527
 
267
528
  /**
268
529
  * Updates the configuration settings for the specified webhook. | Webhook will be created if it does not exist. Update body will completely replace the existing settings.
269
- * @param {String} projectOrProductUID
530
+ * @param {String} projectOrProductUID
270
531
  * @param {String} webhookUID Webhook UID
271
- * @param {module:model/WebhookSettings} webhookSettings
532
+ * @param {module:model/WebhookSettings} webhookSettings
272
533
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}
273
534
  */
274
535
  }, {
@@ -278,5 +539,57 @@ var WebhookApi = exports["default"] = /*#__PURE__*/function () {
278
539
  return response_and_data.data;
279
540
  });
280
541
  }
542
+
543
+ /**
544
+ * Updates the configuration settings for the specified webhook, addressed by productUID. Update body will completely replace the existing settings.
545
+ * @param {String} productUID
546
+ * @param {String} webhookUID Webhook UID
547
+ * @param {module:model/WebhookSettings} webhookSettings
548
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
549
+ */
550
+ }, {
551
+ key: "updateWebhookSettingsByProductWithHttpInfo",
552
+ value: function updateWebhookSettingsByProductWithHttpInfo(productUID, webhookUID, webhookSettings) {
553
+ var postBody = webhookSettings;
554
+ // verify the required parameter 'productUID' is set
555
+ if (productUID === undefined || productUID === null) {
556
+ throw new _Error["default"]("Missing the required parameter 'productUID' when calling updateWebhookSettingsByProduct");
557
+ }
558
+ // verify the required parameter 'webhookUID' is set
559
+ if (webhookUID === undefined || webhookUID === null) {
560
+ throw new _Error["default"]("Missing the required parameter 'webhookUID' when calling updateWebhookSettingsByProduct");
561
+ }
562
+ // verify the required parameter 'webhookSettings' is set
563
+ if (webhookSettings === undefined || webhookSettings === null) {
564
+ throw new _Error["default"]("Missing the required parameter 'webhookSettings' when calling updateWebhookSettingsByProduct");
565
+ }
566
+ var pathParams = {
567
+ productUID: productUID,
568
+ webhookUID: webhookUID
569
+ };
570
+ var queryParams = {};
571
+ var headerParams = {};
572
+ var formParams = {};
573
+ var authNames = ["personalAccessToken"];
574
+ var contentTypes = ["application/json"];
575
+ var accepts = ["application/json"];
576
+ var returnType = null;
577
+ return this.apiClient.callApi("/v1/products/{productUID}/webhooks/{webhookUID}/settings", "PUT", pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
578
+ }
579
+
580
+ /**
581
+ * Updates the configuration settings for the specified webhook, addressed by productUID. Update body will completely replace the existing settings.
582
+ * @param {String} productUID
583
+ * @param {String} webhookUID Webhook UID
584
+ * @param {module:model/WebhookSettings} webhookSettings
585
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}
586
+ */
587
+ }, {
588
+ key: "updateWebhookSettingsByProduct",
589
+ value: function updateWebhookSettingsByProduct(productUID, webhookUID, webhookSettings) {
590
+ return this.updateWebhookSettingsByProductWithHttpInfo(productUID, webhookUID, webhookSettings).then(function (response_and_data) {
591
+ return response_and_data.data;
592
+ });
593
+ }
281
594
  }]);
282
595
  }();
package/dist/index.js CHANGED
@@ -129,6 +129,12 @@ Object.defineProperty(exports, "CreateJob201Response", {
129
129
  return _CreateJob201Response["default"];
130
130
  }
131
131
  });
132
+ Object.defineProperty(exports, "CreateLegacyWebhookEventRequest", {
133
+ enumerable: true,
134
+ get: function get() {
135
+ return _CreateLegacyWebhookEventRequest["default"];
136
+ }
137
+ });
132
138
  Object.defineProperty(exports, "CreateMonitor", {
133
139
  enumerable: true,
134
140
  get: function get() {
@@ -969,6 +975,7 @@ var _CloneProjectRequest = _interopRequireDefault(require("./model/CloneProjectR
969
975
  var _Contact = _interopRequireDefault(require("./model/Contact"));
970
976
  var _CreateFleetRequest = _interopRequireDefault(require("./model/CreateFleetRequest"));
971
977
  var _CreateJob201Response = _interopRequireDefault(require("./model/CreateJob201Response"));
978
+ var _CreateLegacyWebhookEventRequest = _interopRequireDefault(require("./model/CreateLegacyWebhookEventRequest"));
972
979
  var _CreateMonitor = _interopRequireDefault(require("./model/CreateMonitor"));
973
980
  var _CreateProductRequest = _interopRequireDefault(require("./model/CreateProductRequest"));
974
981
  var _CreateProjectRequest = _interopRequireDefault(require("./model/CreateProjectRequest"));