@blues-inc/notehub-js 6.7.0 → 7.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/README.md +156 -152
  2. package/dist/ApiClient.js +3 -3
  3. package/dist/api/AlertApi.js +17 -12
  4. package/dist/api/AuthorizationApi.js +12 -51
  5. package/dist/api/DescriptionApi.js +58 -42
  6. package/dist/api/DeviceApi.js +434 -291
  7. package/dist/api/EventApi.js +88 -221
  8. package/dist/api/ExternalDevicesApi.js +32 -26
  9. package/dist/api/JobsApi.js +76 -58
  10. package/dist/api/MonitorApi.js +38 -28
  11. package/dist/api/OrganizationApi.js +26 -20
  12. package/dist/api/ProjectApi.js +424 -330
  13. package/dist/api/RouteApi.js +69 -54
  14. package/dist/api/SkillsApi.js +279 -0
  15. package/dist/api/UsageApi.js +84 -74
  16. package/dist/api/WebhookApi.js +96 -74
  17. package/dist/index.js +91 -63
  18. package/dist/model/AWSRoleConfig.js +2 -2
  19. package/dist/model/AddDeviceToFleetsRequest.js +4 -4
  20. package/dist/model/Alert.js +17 -10
  21. package/dist/model/AlertDataInner.js +10 -5
  22. package/dist/model/AlertNotificationsInner.js +15 -5
  23. package/dist/model/ArchiveStats.js +2 -2
  24. package/dist/model/AwsRoute.js +15 -3
  25. package/dist/model/AzureRoute.js +9 -2
  26. package/dist/model/BatchJobNoteRequest.js +2 -2
  27. package/dist/model/BatchJobRequests.js +7 -6
  28. package/dist/model/BillingAccount.js +6 -4
  29. package/dist/model/BillingAccountRole.js +1 -1
  30. package/dist/model/BlynkRoute.js +7 -2
  31. package/dist/model/Body.js +3 -2
  32. package/dist/model/CancelJobRun200Response.js +2 -2
  33. package/dist/model/CellularPlan.js +4 -3
  34. package/dist/model/CloneProjectRequest.js +8 -8
  35. package/dist/model/Contact.js +6 -2
  36. package/dist/model/CreateFleetRequest.js +5 -4
  37. package/dist/model/CreateJob201Response.js +2 -2
  38. package/dist/model/CreateMonitor.js +38 -26
  39. package/dist/model/CreateProductRequest.js +8 -7
  40. package/dist/model/CreateProjectRequest.js +6 -6
  41. package/dist/model/CreateProjectSecretRequest.js +6 -6
  42. package/dist/model/CreateUpdateRepository.js +4 -2
  43. package/dist/model/CreatedRepository.js +6 -6
  44. package/dist/model/CurrentFirmware.js +2 -2
  45. package/dist/model/DFUEnv.js +2 -2
  46. package/dist/model/DFUState.js +3 -2
  47. package/dist/model/DataField.js +2 -2
  48. package/dist/model/DataSet.js +6 -5
  49. package/dist/model/DataSetField.js +3 -3
  50. package/dist/model/DataUsage.js +2 -2
  51. package/dist/model/DatacakeRoute.js +8 -2
  52. package/dist/model/DatasetReloadProgress.js +2 -2
  53. package/dist/model/DeleteDeviceFromFleetsRequest.js +4 -4
  54. package/dist/model/DeleteJob200Response.js +2 -2
  55. package/dist/model/DeleteNotefilesRequest.js +3 -3
  56. package/dist/model/DescriptionRecord.js +7 -7
  57. package/dist/model/DescriptionRecordList.js +4 -3
  58. package/dist/model/Device.js +37 -9
  59. package/dist/model/DeviceDfuHistory.js +13 -3
  60. package/dist/model/DeviceDfuHistoryCurrent.js +3 -3
  61. package/dist/model/DeviceDfuHistoryPage.js +17 -2
  62. package/dist/model/DeviceDfuStateMachine.js +3 -2
  63. package/dist/model/DeviceDfuStateMachineNode.js +3 -3
  64. package/dist/model/DeviceDfuStatus.js +13 -4
  65. package/dist/model/DeviceDfuStatusPage.js +17 -2
  66. package/dist/model/DeviceSensor.js +2 -2
  67. package/dist/model/DeviceSession.js +38 -6
  68. package/dist/model/DeviceTowerInfo.js +7 -2
  69. package/dist/model/DeviceUsage.js +8 -2
  70. package/dist/model/DfuActionRequest.js +3 -3
  71. package/dist/model/EmailNotification.js +30 -7
  72. package/dist/model/EnvTreeJsonNode.js +18 -7
  73. package/dist/model/EnvVar.js +6 -2
  74. package/dist/model/EnvironmentVariables.js +4 -3
  75. package/dist/model/Error.js +5 -2
  76. package/dist/model/Event.js +17 -8
  77. package/dist/model/Filter.js +6 -6
  78. package/dist/model/Firmware.js +2 -2
  79. package/dist/model/FirmwareInfo.js +7 -7
  80. package/dist/model/Fleet.js +12 -11
  81. package/dist/model/FleetConnectivityAssurance.js +2 -2
  82. package/dist/model/GetAlerts200Response.js +15 -2
  83. package/dist/model/GetApiUsage200Response.js +3 -3
  84. package/dist/model/GetDataUsage200Response.js +3 -3
  85. package/dist/model/GetDataUsage200ResponseDataInner.js +4 -4
  86. package/dist/model/GetDbNote200Response.js +2 -2
  87. package/dist/model/GetDeviceEnvironmentVariablesByPin200Response.js +2 -2
  88. package/dist/model/GetDeviceFleets200Response.js +2 -2
  89. package/dist/model/GetDeviceHealthLog200Response.js +2 -2
  90. package/dist/model/GetDeviceJourney200Response.js +2 -2
  91. package/dist/model/GetDeviceJourney200ResponseJourney.js +2 -2
  92. package/dist/model/GetDeviceJourneys200Response.js +2 -2
  93. package/dist/model/GetDeviceJourneys200ResponseJourneysInner.js +2 -2
  94. package/dist/model/GetDeviceLatestEvents200Response.js +3 -3
  95. package/dist/model/GetDevicePlans200Response.js +3 -2
  96. package/dist/model/GetDevicePublicKey200Response.js +6 -4
  97. package/dist/model/GetDevicePublicKeys200Response.js +15 -2
  98. package/dist/model/GetDevicePublicKeys200ResponseDevicePublicKeysInner.js +13 -2
  99. package/dist/model/GetDeviceSessions200Response.js +15 -2
  100. package/dist/model/GetDevices200Response.js +15 -2
  101. package/dist/model/GetEvents200Response.js +15 -2
  102. package/dist/model/GetJobRuns200Response.js +2 -2
  103. package/dist/model/GetJobs200Response.js +2 -2
  104. package/dist/model/GetNotefile200Response.js +2 -2
  105. package/dist/model/{GetBillingAccount200Response.js → GetOrganization200Response.js} +29 -29
  106. package/dist/model/{GetBillingAccount200ResponsePlan.js → GetOrganization200ResponsePlan.js} +25 -25
  107. package/dist/model/{GetBillingAccountBalanceHistory200Response.js → GetOrganizationBalanceHistory200Response.js} +23 -23
  108. package/dist/model/{GetBillingAccountBalanceHistory200ResponseDataInner.js → GetOrganizationBalanceHistory200ResponseDataInner.js} +23 -23
  109. package/dist/model/GetOrganizations200Response.js +2 -2
  110. package/dist/model/GetProducts200Response.js +2 -2
  111. package/dist/model/GetProjectMembers200Response.js +2 -2
  112. package/dist/model/GetProjectSecretsResponse.js +4 -3
  113. package/dist/model/GetProjects200Response.js +2 -2
  114. package/dist/model/GetRouteLogsUsage200Response.js +3 -3
  115. package/dist/model/GetSessionsUsage200Response.js +4 -4
  116. package/dist/model/GetWebhooks200Response.js +2 -2
  117. package/dist/model/GoogleRoute.js +7 -2
  118. package/dist/model/HealthLog.js +8 -5
  119. package/dist/model/HttpRoute.js +8 -3
  120. package/dist/model/Job.js +2 -2
  121. package/dist/model/JobDefinition.js +3 -3
  122. package/dist/model/JobDefinitionReportOptions.js +3 -2
  123. package/dist/model/JobDefinitionSelect.js +5 -4
  124. package/dist/model/JobDetail.js +2 -2
  125. package/dist/model/JobDetailAllOf.js +2 -2
  126. package/dist/model/JobRun.js +2 -2
  127. package/dist/model/Location.js +14 -8
  128. package/dist/model/Monitor.js +19 -13
  129. package/dist/model/MonitorAlertRoutesInner.js +61 -15
  130. package/dist/model/MqttRoute.js +15 -2
  131. package/dist/model/Note.js +3 -3
  132. package/dist/model/NoteInput.js +2 -2
  133. package/dist/model/Notefile.js +5 -3
  134. package/dist/model/NotefileSchema.js +6 -4
  135. package/dist/model/NotehubRoute.js +8 -4
  136. package/dist/model/NotehubRouteSummary.js +7 -2
  137. package/dist/model/OAuth2Error.js +2 -2
  138. package/dist/model/OAuth2TokenResponse.js +2 -2
  139. package/dist/model/Organization.js +6 -4
  140. package/dist/model/OrganizationRole.js +1 -1
  141. package/dist/model/Product.js +9 -5
  142. package/dist/model/Project.js +8 -5
  143. package/dist/model/ProjectMember.js +6 -5
  144. package/dist/model/ProjectSecret.js +8 -8
  145. package/dist/model/ProvisionDeviceRequest.js +6 -6
  146. package/dist/model/ProxyRoute.js +7 -2
  147. package/dist/model/QubitroRoute.js +8 -2
  148. package/dist/model/RadRoute.js +10 -2
  149. package/dist/model/Repository.js +4 -4
  150. package/dist/model/RepositoryListResponse.js +4 -3
  151. package/dist/model/RepositoryRecord.js +119 -0
  152. package/dist/model/RepositoryTokenRequest.js +2 -2
  153. package/dist/model/RepositoryTokenResponse.js +2 -2
  154. package/dist/model/Role.js +1 -1
  155. package/dist/model/RouteLog.js +10 -10
  156. package/dist/model/RouteTransformSettings.js +6 -6
  157. package/dist/model/RunJob200Response.js +2 -2
  158. package/dist/model/S3ArchiveRoute.js +17 -2
  159. package/dist/model/SatelliteDataUsage.js +2 -2
  160. package/dist/model/SatellitePlan.js +2 -2
  161. package/dist/model/SchemaProperty.js +7 -5
  162. package/dist/model/SignalDevice200Response.js +3 -3
  163. package/dist/model/SimUsage.js +2 -2
  164. package/dist/model/Skill.js +210 -0
  165. package/dist/model/{GetBillingAccounts200Response.js → SkillLinks.js} +60 -41
  166. package/dist/model/SkillSet.js +185 -0
  167. package/dist/model/SkillSummary.js +208 -0
  168. package/dist/model/SkillWrite.js +128 -0
  169. package/dist/model/{GetEventsByCursor200Response.js → SkillWriteResult.js} +62 -65
  170. package/dist/model/SlackBearerNotification.js +32 -9
  171. package/dist/model/SlackRoute.js +10 -2
  172. package/dist/model/SlackWebHookNotification.js +32 -9
  173. package/dist/model/SnowflakeRoute.js +10 -2
  174. package/dist/model/SnowpipeStreamingRoute.js +13 -2
  175. package/dist/model/ThingworxRoute.js +7 -2
  176. package/dist/model/TowerLocation.js +2 -2
  177. package/dist/model/TwilioNotification.js +167 -0
  178. package/dist/model/TwilioRoute.js +10 -2
  179. package/dist/model/UpdateFleetRequest.js +8 -7
  180. package/dist/model/UpdateHostFirmwareRequest.js +5 -5
  181. package/dist/model/UpdateProjectSecretRequest.js +4 -4
  182. package/dist/model/UploadMetadata.js +2 -2
  183. package/dist/model/UsageApiData.js +4 -3
  184. package/dist/model/UsageData.js +8 -4
  185. package/dist/model/UsageEventsData.js +6 -3
  186. package/dist/model/UsageEventsResponse.js +5 -4
  187. package/dist/model/UsageRouteLogsData.js +11 -7
  188. package/dist/model/UsageSessionsData.js +12 -6
  189. package/dist/model/UserDfuStateMachine.js +2 -2
  190. package/dist/model/UserDfuStateMachineStatus.js +2 -2
  191. package/dist/model/UserFirmwareInfo.js +2 -2
  192. package/dist/model/WebhookSettings.js +5 -5
  193. package/package.json +1 -1
  194. package/dist/api/BillingAccountApi.js +0 -167
  195. package/dist/model/Login200Response.js +0 -91
  196. package/dist/model/LoginRequest.js +0 -103
@@ -0,0 +1,208 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _SkillLinks = _interopRequireDefault(require("./SkillLinks"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
12
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
16
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
+ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
19
+ * Notehub API
20
+ * The OpenAPI definition for the Notehub.io API.
21
+ *
22
+ * The version of the OpenAPI document: 1.2.0
23
+ * Contact: engineering@blues.io
24
+ *
25
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26
+ * https://openapi-generator.tech
27
+ * Do not edit the class manually.
28
+ *
29
+ */
30
+ /**
31
+ * The SkillSummary model module.
32
+ * @module model/SkillSummary
33
+ * @version 7.0.0-beta.1
34
+ */
35
+ var SkillSummary = /*#__PURE__*/function () {
36
+ /**
37
+ * Constructs a new <code>SkillSummary</code>.
38
+ * Skill metadata, with content only when includeContent&#x3D;true.
39
+ * @alias module:model/SkillSummary
40
+ * @param createdAt {Date} When the skill was created.
41
+ * @param kinds {Array.<String>} Effective stored kinds, independent of document front matter.
42
+ * @param links {module:model/SkillLinks}
43
+ * @param name {String} Skill name, a relative `.md` path such as `references/devices.md`.
44
+ * @param revision {String} Opaque concurrency token; ETag is this value wrapped in double quotes.
45
+ * @param sizeBytes {Number} UTF-8 content byte count.
46
+ * @param updatedAt {Date} When the skill was last changed.
47
+ */
48
+ function SkillSummary(createdAt, kinds, links, name, revision, sizeBytes, updatedAt) {
49
+ _classCallCheck(this, SkillSummary);
50
+ SkillSummary.initialize(this, createdAt, kinds, links, name, revision, sizeBytes, updatedAt);
51
+ }
52
+
53
+ /**
54
+ * Initializes the fields of this object.
55
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
56
+ * Only for internal use.
57
+ */
58
+ return _createClass(SkillSummary, null, [{
59
+ key: "initialize",
60
+ value: function initialize(obj, createdAt, kinds, links, name, revision, sizeBytes, updatedAt) {
61
+ obj["created_at"] = createdAt;
62
+ obj["kinds"] = kinds;
63
+ obj["links"] = links;
64
+ obj["name"] = name;
65
+ obj["revision"] = revision;
66
+ obj["size_bytes"] = sizeBytes;
67
+ obj["updated_at"] = updatedAt;
68
+ }
69
+
70
+ /**
71
+ * Constructs a <code>SkillSummary</code> from a plain JavaScript object, optionally creating a new instance.
72
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
73
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
74
+ * @param {module:model/SkillSummary} obj Optional instance to populate.
75
+ * @return {module:model/SkillSummary} The populated <code>SkillSummary</code> instance.
76
+ */
77
+ }, {
78
+ key: "constructFromObject",
79
+ value: function constructFromObject(data, obj) {
80
+ if (data) {
81
+ obj = obj || new SkillSummary();
82
+ if (data.hasOwnProperty("content")) {
83
+ obj["content"] = _ApiClient["default"].convertToType(data["content"], "String");
84
+ }
85
+ if (data.hasOwnProperty("created_at")) {
86
+ obj["created_at"] = _ApiClient["default"].convertToType(data["created_at"], "Date");
87
+ }
88
+ if (data.hasOwnProperty("kinds")) {
89
+ obj["kinds"] = _ApiClient["default"].convertToType(data["kinds"], ["String"]);
90
+ }
91
+ if (data.hasOwnProperty("links")) {
92
+ obj["links"] = _SkillLinks["default"].constructFromObject(data["links"]);
93
+ }
94
+ if (data.hasOwnProperty("name")) {
95
+ obj["name"] = _ApiClient["default"].convertToType(data["name"], "String");
96
+ }
97
+ if (data.hasOwnProperty("revision")) {
98
+ obj["revision"] = _ApiClient["default"].convertToType(data["revision"], "String");
99
+ }
100
+ if (data.hasOwnProperty("size_bytes")) {
101
+ obj["size_bytes"] = _ApiClient["default"].convertToType(data["size_bytes"], "Number");
102
+ }
103
+ if (data.hasOwnProperty("updated_at")) {
104
+ obj["updated_at"] = _ApiClient["default"].convertToType(data["updated_at"], "Date");
105
+ }
106
+ } else if (data === null) {
107
+ return null;
108
+ }
109
+ return obj;
110
+ }
111
+
112
+ /**
113
+ * Validates the JSON data with respect to <code>SkillSummary</code>.
114
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
115
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>SkillSummary</code>.
116
+ */
117
+ }, {
118
+ key: "validateJSON",
119
+ value: function validateJSON(data) {
120
+ // check to make sure all required properties are present in the JSON string
121
+ var _iterator = _createForOfIteratorHelper(SkillSummary.RequiredProperties),
122
+ _step;
123
+ try {
124
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
125
+ var property = _step.value;
126
+ if (!data[property]) {
127
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
128
+ }
129
+ }
130
+ // ensure the json data is a string
131
+ } catch (err) {
132
+ _iterator.e(err);
133
+ } finally {
134
+ _iterator.f();
135
+ }
136
+ if (data["content"] && !(typeof data["content"] === "string" || data["content"] instanceof String)) {
137
+ throw new Error("Expected the field `content` to be a primitive type in the JSON string but got " + data["content"]);
138
+ }
139
+ // ensure the json data is an array
140
+ if (!Array.isArray(data["kinds"])) {
141
+ throw new Error("Expected the field `kinds` to be an array in the JSON data but got " + data["kinds"]);
142
+ }
143
+ // validate the optional field `links`
144
+ if (data["links"]) {
145
+ // data not null
146
+ _SkillLinks["default"].validateJSON(data["links"]);
147
+ }
148
+ // ensure the json data is a string
149
+ if (data["name"] && !(typeof data["name"] === "string" || data["name"] instanceof String)) {
150
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data["name"]);
151
+ }
152
+ // ensure the json data is a string
153
+ if (data["revision"] && !(typeof data["revision"] === "string" || data["revision"] instanceof String)) {
154
+ throw new Error("Expected the field `revision` to be a primitive type in the JSON string but got " + data["revision"]);
155
+ }
156
+ return true;
157
+ }
158
+ }]);
159
+ }();
160
+ SkillSummary.RequiredProperties = ["created_at", "kinds", "links", "name", "revision", "size_bytes", "updated_at"];
161
+
162
+ /**
163
+ * Exact Markdown when includeContent=true; present even when empty. Otherwise omitted.
164
+ * @member {String} content
165
+ */
166
+ SkillSummary.prototype["content"] = undefined;
167
+
168
+ /**
169
+ * When the skill was created.
170
+ * @member {Date} created_at
171
+ */
172
+ SkillSummary.prototype["created_at"] = undefined;
173
+
174
+ /**
175
+ * Effective stored kinds, independent of document front matter.
176
+ * @member {Array.<String>} kinds
177
+ */
178
+ SkillSummary.prototype["kinds"] = undefined;
179
+
180
+ /**
181
+ * @member {module:model/SkillLinks} links
182
+ */
183
+ SkillSummary.prototype["links"] = undefined;
184
+
185
+ /**
186
+ * Skill name, a relative `.md` path such as `references/devices.md`.
187
+ * @member {String} name
188
+ */
189
+ SkillSummary.prototype["name"] = undefined;
190
+
191
+ /**
192
+ * Opaque concurrency token; ETag is this value wrapped in double quotes.
193
+ * @member {String} revision
194
+ */
195
+ SkillSummary.prototype["revision"] = undefined;
196
+
197
+ /**
198
+ * UTF-8 content byte count.
199
+ * @member {Number} size_bytes
200
+ */
201
+ SkillSummary.prototype["size_bytes"] = undefined;
202
+
203
+ /**
204
+ * When the skill was last changed.
205
+ * @member {Date} updated_at
206
+ */
207
+ SkillSummary.prototype["updated_at"] = undefined;
208
+ var _default = exports["default"] = SkillSummary;
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
11
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
15
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
+ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
18
+ * Notehub API
19
+ * The OpenAPI definition for the Notehub.io API.
20
+ *
21
+ * The version of the OpenAPI document: 1.2.0
22
+ * Contact: engineering@blues.io
23
+ *
24
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25
+ * https://openapi-generator.tech
26
+ * Do not edit the class manually.
27
+ *
28
+ */
29
+ /**
30
+ * The SkillWrite model module.
31
+ * @module model/SkillWrite
32
+ * @version 7.0.0-beta.1
33
+ */
34
+ var SkillWrite = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>SkillWrite</code>.
37
+ * @alias module:model/SkillWrite
38
+ * @param content {String} Exact UTF-8, at most 1 MiB decoded. Empty is valid; null is not. JSON request limit is 2 MiB plus 64 KiB, including escaping and metadata.
39
+ */
40
+ function SkillWrite(content) {
41
+ _classCallCheck(this, SkillWrite);
42
+ SkillWrite.initialize(this, content);
43
+ }
44
+
45
+ /**
46
+ * Initializes the fields of this object.
47
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
48
+ * Only for internal use.
49
+ */
50
+ return _createClass(SkillWrite, null, [{
51
+ key: "initialize",
52
+ value: function initialize(obj, content) {
53
+ obj["content"] = content;
54
+ }
55
+
56
+ /**
57
+ * Constructs a <code>SkillWrite</code> from a plain JavaScript object, optionally creating a new instance.
58
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
59
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
60
+ * @param {module:model/SkillWrite} obj Optional instance to populate.
61
+ * @return {module:model/SkillWrite} The populated <code>SkillWrite</code> instance.
62
+ */
63
+ }, {
64
+ key: "constructFromObject",
65
+ value: function constructFromObject(data, obj) {
66
+ if (data) {
67
+ obj = obj || new SkillWrite();
68
+ if (data.hasOwnProperty("content")) {
69
+ obj["content"] = _ApiClient["default"].convertToType(data["content"], "String");
70
+ }
71
+ if (data.hasOwnProperty("kinds")) {
72
+ obj["kinds"] = _ApiClient["default"].convertToType(data["kinds"], ["String"]);
73
+ }
74
+ } else if (data === null) {
75
+ return null;
76
+ }
77
+ return obj;
78
+ }
79
+
80
+ /**
81
+ * Validates the JSON data with respect to <code>SkillWrite</code>.
82
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
83
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>SkillWrite</code>.
84
+ */
85
+ }, {
86
+ key: "validateJSON",
87
+ value: function validateJSON(data) {
88
+ // check to make sure all required properties are present in the JSON string
89
+ var _iterator = _createForOfIteratorHelper(SkillWrite.RequiredProperties),
90
+ _step;
91
+ try {
92
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
93
+ var property = _step.value;
94
+ if (!data[property]) {
95
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
96
+ }
97
+ }
98
+ // ensure the json data is a string
99
+ } catch (err) {
100
+ _iterator.e(err);
101
+ } finally {
102
+ _iterator.f();
103
+ }
104
+ if (data["content"] && !(typeof data["content"] === "string" || data["content"] instanceof String)) {
105
+ throw new Error("Expected the field `content` to be a primitive type in the JSON string but got " + data["content"]);
106
+ }
107
+ // ensure the json data is an array
108
+ if (!Array.isArray(data["kinds"])) {
109
+ throw new Error("Expected the field `kinds` to be an array in the JSON data but got " + data["kinds"]);
110
+ }
111
+ return true;
112
+ }
113
+ }]);
114
+ }();
115
+ SkillWrite.RequiredProperties = ["content"];
116
+
117
+ /**
118
+ * Exact UTF-8, at most 1 MiB decoded. Empty is valid; null is not. JSON request limit is 2 MiB plus 64 KiB, including escaping and metadata.
119
+ * @member {String} content
120
+ */
121
+ SkillWrite.prototype["content"] = undefined;
122
+
123
+ /**
124
+ * Lowercase kinds; publish is reserved. Omit to preserve on replacement, or use [] to clear.
125
+ * @member {Array.<String>} kinds
126
+ */
127
+ SkillWrite.prototype["kinds"] = undefined;
128
+ var _default = exports["default"] = SkillWrite;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
- var _Event = _interopRequireDefault(require("./Event"));
8
+ var _Skill = _interopRequireDefault(require("./Skill"));
9
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
10
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
11
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
@@ -15,7 +15,7 @@ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Can
15
15
  function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
16
16
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
17
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
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
+ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
19
19
  * Notehub API
20
20
  * The OpenAPI definition for the Notehub.io API.
21
21
  *
@@ -28,21 +28,20 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
28
28
  *
29
29
  */
30
30
  /**
31
- * The GetEventsByCursor200Response model module.
32
- * @module model/GetEventsByCursor200Response
33
- * @version 6.7.0
31
+ * The SkillWriteResult model module.
32
+ * @module model/SkillWriteResult
33
+ * @version 7.0.0-beta.1
34
34
  */
35
- var GetEventsByCursor200Response = /*#__PURE__*/function () {
35
+ var SkillWriteResult = /*#__PURE__*/function () {
36
36
  /**
37
- * Constructs a new <code>GetEventsByCursor200Response</code>.
38
- * @alias module:model/GetEventsByCursor200Response
39
- * @param events {Array.<module:model/Event>}
40
- * @param hasMore {Boolean} True if there are more events
41
- * @param nextCursor {String} The cursor value of the next result, which is intended to be used as the \"cursor\" parameter value of the next call to this method. An empty string is returned if there are no more results after this results set.
37
+ * Constructs a new <code>SkillWriteResult</code>.
38
+ * @alias module:model/SkillWriteResult
39
+ * @param outcome {module:model/SkillWriteResult.OutcomeEnum} What the write did. - `created`: a new skill was created - `updated`: an existing skill was replaced - `unchanged`: the skill already had this content and kinds
40
+ * @param skill {module:model/Skill}
42
41
  */
43
- function GetEventsByCursor200Response(events, hasMore, nextCursor) {
44
- _classCallCheck(this, GetEventsByCursor200Response);
45
- GetEventsByCursor200Response.initialize(this, events, hasMore, nextCursor);
42
+ function SkillWriteResult(outcome, skill) {
43
+ _classCallCheck(this, SkillWriteResult);
44
+ SkillWriteResult.initialize(this, outcome, skill);
46
45
  }
47
46
 
48
47
  /**
@@ -50,34 +49,30 @@ var GetEventsByCursor200Response = /*#__PURE__*/function () {
50
49
  * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
51
50
  * Only for internal use.
52
51
  */
53
- return _createClass(GetEventsByCursor200Response, null, [{
52
+ return _createClass(SkillWriteResult, null, [{
54
53
  key: "initialize",
55
- value: function initialize(obj, events, hasMore, nextCursor) {
56
- obj["events"] = events;
57
- obj["has_more"] = hasMore;
58
- obj["next_cursor"] = nextCursor;
54
+ value: function initialize(obj, outcome, skill) {
55
+ obj["outcome"] = outcome;
56
+ obj["skill"] = skill;
59
57
  }
60
58
 
61
59
  /**
62
- * Constructs a <code>GetEventsByCursor200Response</code> from a plain JavaScript object, optionally creating a new instance.
60
+ * Constructs a <code>SkillWriteResult</code> from a plain JavaScript object, optionally creating a new instance.
63
61
  * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
64
62
  * @param {Object} data The plain JavaScript object bearing properties of interest.
65
- * @param {module:model/GetEventsByCursor200Response} obj Optional instance to populate.
66
- * @return {module:model/GetEventsByCursor200Response} The populated <code>GetEventsByCursor200Response</code> instance.
63
+ * @param {module:model/SkillWriteResult} obj Optional instance to populate.
64
+ * @return {module:model/SkillWriteResult} The populated <code>SkillWriteResult</code> instance.
67
65
  */
68
66
  }, {
69
67
  key: "constructFromObject",
70
68
  value: function constructFromObject(data, obj) {
71
69
  if (data) {
72
- obj = obj || new GetEventsByCursor200Response();
73
- if (data.hasOwnProperty("events")) {
74
- obj["events"] = _ApiClient["default"].convertToType(data["events"], [_Event["default"]]);
70
+ obj = obj || new SkillWriteResult();
71
+ if (data.hasOwnProperty("outcome")) {
72
+ obj["outcome"] = _ApiClient["default"].convertToType(data["outcome"], "String");
75
73
  }
76
- if (data.hasOwnProperty("has_more")) {
77
- obj["has_more"] = _ApiClient["default"].convertToType(data["has_more"], "Boolean");
78
- }
79
- if (data.hasOwnProperty("next_cursor")) {
80
- obj["next_cursor"] = _ApiClient["default"].convertToType(data["next_cursor"], "String");
74
+ if (data.hasOwnProperty("skill")) {
75
+ obj["skill"] = _Skill["default"].constructFromObject(data["skill"]);
81
76
  }
82
77
  } else if (data === null) {
83
78
  return null;
@@ -86,15 +81,15 @@ var GetEventsByCursor200Response = /*#__PURE__*/function () {
86
81
  }
87
82
 
88
83
  /**
89
- * Validates the JSON data with respect to <code>GetEventsByCursor200Response</code>.
84
+ * Validates the JSON data with respect to <code>SkillWriteResult</code>.
90
85
  * @param {Object} data The plain JavaScript object bearing properties of interest.
91
- * @return {boolean} to indicate whether the JSON data is valid with respect to <code>GetEventsByCursor200Response</code>.
86
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>SkillWriteResult</code>.
92
87
  */
93
88
  }, {
94
89
  key: "validateJSON",
95
90
  value: function validateJSON(data) {
96
91
  // check to make sure all required properties are present in the JSON string
97
- var _iterator = _createForOfIteratorHelper(GetEventsByCursor200Response.RequiredProperties),
92
+ var _iterator = _createForOfIteratorHelper(SkillWriteResult.RequiredProperties),
98
93
  _step;
99
94
  try {
100
95
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -103,55 +98,57 @@ var GetEventsByCursor200Response = /*#__PURE__*/function () {
103
98
  throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
104
99
  }
105
100
  }
101
+ // ensure the json data is a string
106
102
  } catch (err) {
107
103
  _iterator.e(err);
108
104
  } finally {
109
105
  _iterator.f();
110
106
  }
111
- if (data["events"]) {
112
- // data not null
113
- // ensure the json data is an array
114
- if (!Array.isArray(data["events"])) {
115
- throw new Error("Expected the field `events` to be an array in the JSON data but got " + data["events"]);
116
- }
117
- // validate the optional field `events` (array)
118
- var _iterator2 = _createForOfIteratorHelper(data["events"]),
119
- _step2;
120
- try {
121
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
122
- var item = _step2.value;
123
- _Event["default"].validateJsonObject(item);
124
- }
125
- } catch (err) {
126
- _iterator2.e(err);
127
- } finally {
128
- _iterator2.f();
129
- }
107
+ if (data["outcome"] && !(typeof data["outcome"] === "string" || data["outcome"] instanceof String)) {
108
+ throw new Error("Expected the field `outcome` to be a primitive type in the JSON string but got " + data["outcome"]);
130
109
  }
131
- // ensure the json data is a string
132
- if (data["next_cursor"] && !(typeof data["next_cursor"] === "string" || data["next_cursor"] instanceof String)) {
133
- throw new Error("Expected the field `next_cursor` to be a primitive type in the JSON string but got " + data["next_cursor"]);
110
+ // validate the optional field `skill`
111
+ if (data["skill"]) {
112
+ // data not null
113
+ _Skill["default"].validateJSON(data["skill"]);
134
114
  }
135
115
  return true;
136
116
  }
137
117
  }]);
138
118
  }();
139
- GetEventsByCursor200Response.RequiredProperties = ["events", "has_more", "next_cursor"];
119
+ SkillWriteResult.RequiredProperties = ["outcome", "skill"];
140
120
 
141
121
  /**
142
- * @member {Array.<module:model/Event>} events
122
+ * What the write did. - `created`: a new skill was created - `updated`: an existing skill was replaced - `unchanged`: the skill already had this content and kinds
123
+ * @member {module:model/SkillWriteResult.OutcomeEnum} outcome
143
124
  */
144
- GetEventsByCursor200Response.prototype["events"] = undefined;
125
+ SkillWriteResult.prototype["outcome"] = undefined;
145
126
 
146
127
  /**
147
- * True if there are more events
148
- * @member {Boolean} has_more
128
+ * @member {module:model/Skill} skill
149
129
  */
150
- GetEventsByCursor200Response.prototype["has_more"] = undefined;
130
+ SkillWriteResult.prototype["skill"] = undefined;
151
131
 
152
132
  /**
153
- * The cursor value of the next result, which is intended to be used as the \"cursor\" parameter value of the next call to this method. An empty string is returned if there are no more results after this results set.
154
- * @member {String} next_cursor
133
+ * Allowed values for the <code>outcome</code> property.
134
+ * @enum {String}
135
+ * @readonly
155
136
  */
156
- GetEventsByCursor200Response.prototype["next_cursor"] = undefined;
157
- var _default = exports["default"] = GetEventsByCursor200Response;
137
+ SkillWriteResult["OutcomeEnum"] = {
138
+ /**
139
+ * value: "created"
140
+ * @const
141
+ */
142
+ created: "created",
143
+ /**
144
+ * value: "updated"
145
+ * @const
146
+ */
147
+ updated: "updated",
148
+ /**
149
+ * value: "unchanged"
150
+ * @const
151
+ */
152
+ unchanged: "unchanged"
153
+ };
154
+ var _default = exports["default"] = SkillWriteResult;
@@ -7,11 +7,14 @@ exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
9
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
11
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
10
13
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11
14
  function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12
15
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
16
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
- 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); } /**
17
+ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
15
18
  * Notehub API
16
19
  * The OpenAPI definition for the Notehub.io API.
17
20
  *
@@ -26,16 +29,17 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
26
29
  /**
27
30
  * The SlackBearerNotification model module.
28
31
  * @module model/SlackBearerNotification
29
- * @version 6.7.0
32
+ * @version 7.0.0-beta.1
30
33
  */
31
34
  var SlackBearerNotification = /*#__PURE__*/function () {
32
35
  /**
33
36
  * Constructs a new <code>SlackBearerNotification</code>.
34
37
  * @alias module:model/SlackBearerNotification
38
+ * @param token {String} The bearer token for the Slack app. Returned as `(omitted)`. Sending it back keeps the stored token if the monitor has only one Slack bearer route.
35
39
  */
36
- function SlackBearerNotification() {
40
+ function SlackBearerNotification(token) {
37
41
  _classCallCheck(this, SlackBearerNotification);
38
- SlackBearerNotification.initialize(this);
42
+ SlackBearerNotification.initialize(this, token);
39
43
  }
40
44
 
41
45
  /**
@@ -45,7 +49,9 @@ var SlackBearerNotification = /*#__PURE__*/function () {
45
49
  */
46
50
  return _createClass(SlackBearerNotification, null, [{
47
51
  key: "initialize",
48
- value: function initialize(obj) {}
52
+ value: function initialize(obj, token) {
53
+ obj["token"] = token;
54
+ }
49
55
 
50
56
  /**
51
57
  * Constructs a <code>SlackBearerNotification</code> from a plain JavaScript object, optionally creating a new instance.
@@ -85,7 +91,22 @@ var SlackBearerNotification = /*#__PURE__*/function () {
85
91
  }, {
86
92
  key: "validateJSON",
87
93
  value: function validateJSON(data) {
88
- // ensure the json data is a string
94
+ // check to make sure all required properties are present in the JSON string
95
+ var _iterator = _createForOfIteratorHelper(SlackBearerNotification.RequiredProperties),
96
+ _step;
97
+ try {
98
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
99
+ var property = _step.value;
100
+ if (!data[property]) {
101
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
102
+ }
103
+ }
104
+ // ensure the json data is a string
105
+ } catch (err) {
106
+ _iterator.e(err);
107
+ } finally {
108
+ _iterator.f();
109
+ }
89
110
  if (data["channel"] && !(typeof data["channel"] === "string" || data["channel"] instanceof String)) {
90
111
  throw new Error("Expected the field `channel` to be a primitive type in the JSON string but got " + data["channel"]);
91
112
  }
@@ -105,6 +126,8 @@ var SlackBearerNotification = /*#__PURE__*/function () {
105
126
  }
106
127
  }]);
107
128
  }();
129
+ SlackBearerNotification.RequiredProperties = ["token"];
130
+
108
131
  /**
109
132
  * The channel to send the message to.
110
133
  * @member {String} channel
@@ -112,19 +135,19 @@ var SlackBearerNotification = /*#__PURE__*/function () {
112
135
  SlackBearerNotification.prototype["channel"] = undefined;
113
136
 
114
137
  /**
115
- * text or blocks
138
+ * How `text` is read. - `text`: plain message text - `blocks`: a Slack Block Kit JSON definition
116
139
  * @member {module:model/SlackBearerNotification.MessageTypeEnum} message_type
117
140
  */
118
141
  SlackBearerNotification.prototype["message_type"] = undefined;
119
142
 
120
143
  /**
121
- * The text of the message, or the blocks definition
144
+ * The message, or Block Kit JSON. Event placeholders such as `[.body.temp]` aren't allowed.
122
145
  * @member {String} text
123
146
  */
124
147
  SlackBearerNotification.prototype["text"] = undefined;
125
148
 
126
149
  /**
127
- * The bearer token for the Slack app.
150
+ * The bearer token for the Slack app. Returned as `(omitted)`. Sending it back keeps the stored token if the monitor has only one Slack bearer route.
128
151
  * @member {String} token
129
152
  */
130
153
  SlackBearerNotification.prototype["token"] = undefined;