@blues-inc/notehub-js 6.7.0-beta.9 → 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.
- package/README.md +156 -153
- package/dist/ApiClient.js +2 -2
- package/dist/api/AlertApi.js +15 -13
- package/dist/api/AuthorizationApi.js +11 -50
- package/dist/api/DescriptionApi.js +57 -41
- package/dist/api/DeviceApi.js +428 -297
- package/dist/api/EventApi.js +85 -224
- package/dist/api/ExternalDevicesApi.js +31 -25
- package/dist/api/JobsApi.js +75 -57
- package/dist/api/MonitorApi.js +37 -27
- package/dist/api/OrganizationApi.js +25 -19
- package/dist/api/ProjectApi.js +421 -333
- package/dist/api/RouteApi.js +67 -55
- package/dist/api/SkillsApi.js +279 -0
- package/dist/api/UsageApi.js +83 -73
- package/dist/api/WebhookApi.js +95 -73
- package/dist/index.js +91 -63
- package/dist/model/AWSRoleConfig.js +1 -1
- package/dist/model/AddDeviceToFleetsRequest.js +3 -3
- package/dist/model/Alert.js +16 -9
- package/dist/model/AlertDataInner.js +9 -4
- package/dist/model/AlertNotificationsInner.js +14 -4
- package/dist/model/ArchiveStats.js +1 -1
- package/dist/model/AwsRoute.js +14 -2
- package/dist/model/AzureRoute.js +8 -1
- package/dist/model/BatchJobNoteRequest.js +1 -1
- package/dist/model/BatchJobRequests.js +6 -5
- package/dist/model/BillingAccount.js +5 -3
- package/dist/model/BlynkRoute.js +6 -1
- package/dist/model/Body.js +2 -1
- package/dist/model/CancelJobRun200Response.js +1 -1
- package/dist/model/CellularPlan.js +3 -2
- package/dist/model/CloneProjectRequest.js +7 -7
- package/dist/model/Contact.js +5 -1
- package/dist/model/CreateFleetRequest.js +4 -3
- package/dist/model/CreateJob201Response.js +1 -1
- package/dist/model/CreateMonitor.js +37 -25
- package/dist/model/CreateProductRequest.js +7 -6
- package/dist/model/CreateProjectRequest.js +5 -5
- package/dist/model/CreateProjectSecretRequest.js +5 -5
- package/dist/model/CreateUpdateRepository.js +3 -1
- package/dist/model/CreatedRepository.js +5 -5
- package/dist/model/CurrentFirmware.js +1 -1
- package/dist/model/DFUEnv.js +1 -1
- package/dist/model/DFUState.js +2 -1
- package/dist/model/DataField.js +1 -1
- package/dist/model/DataSet.js +5 -4
- package/dist/model/DataSetField.js +2 -2
- package/dist/model/DataUsage.js +1 -1
- package/dist/model/DatacakeRoute.js +7 -1
- package/dist/model/DatasetReloadProgress.js +1 -1
- package/dist/model/DeleteDeviceFromFleetsRequest.js +3 -3
- package/dist/model/DeleteJob200Response.js +1 -1
- package/dist/model/DeleteNotefilesRequest.js +2 -2
- package/dist/model/DescriptionRecord.js +6 -6
- package/dist/model/DescriptionRecordList.js +3 -2
- package/dist/model/Device.js +27 -8
- package/dist/model/DeviceDfuHistory.js +3 -2
- package/dist/model/DeviceDfuHistoryCurrent.js +2 -2
- package/dist/model/DeviceDfuHistoryPage.js +4 -2
- package/dist/model/DeviceDfuStateMachine.js +2 -1
- package/dist/model/DeviceDfuStateMachineNode.js +2 -2
- package/dist/model/DeviceDfuStatus.js +3 -3
- package/dist/model/DeviceDfuStatusPage.js +4 -2
- package/dist/model/DeviceSensor.js +1 -1
- package/dist/model/DeviceSession.js +37 -5
- package/dist/model/DeviceTowerInfo.js +6 -1
- package/dist/model/DeviceUsage.js +7 -1
- package/dist/model/DfuActionRequest.js +2 -2
- package/dist/model/EmailNotification.js +29 -6
- package/dist/model/EnvTreeJsonNode.js +17 -6
- package/dist/model/EnvVar.js +5 -1
- package/dist/model/EnvironmentVariables.js +3 -2
- package/dist/model/Error.js +4 -1
- package/dist/model/Event.js +7 -7
- package/dist/model/Filter.js +5 -5
- package/dist/model/Firmware.js +1 -1
- package/dist/model/FirmwareInfo.js +6 -6
- package/dist/model/Fleet.js +11 -10
- package/dist/model/FleetConnectivityAssurance.js +1 -1
- package/dist/model/GetAlerts200Response.js +2 -2
- package/dist/model/GetApiUsage200Response.js +2 -2
- package/dist/model/GetDataUsage200Response.js +2 -2
- package/dist/model/GetDataUsage200ResponseDataInner.js +3 -3
- package/dist/model/GetDbNote200Response.js +1 -1
- package/dist/model/GetDeviceEnvironmentVariablesByPin200Response.js +1 -1
- package/dist/model/GetDeviceFleets200Response.js +1 -1
- package/dist/model/GetDeviceHealthLog200Response.js +1 -1
- package/dist/model/GetDeviceJourney200Response.js +1 -1
- package/dist/model/GetDeviceJourney200ResponseJourney.js +1 -1
- package/dist/model/GetDeviceJourneys200Response.js +1 -1
- package/dist/model/GetDeviceJourneys200ResponseJourneysInner.js +1 -1
- package/dist/model/GetDeviceLatestEvents200Response.js +2 -2
- package/dist/model/GetDevicePlans200Response.js +2 -1
- package/dist/model/GetDevicePublicKey200Response.js +5 -3
- package/dist/model/GetDevicePublicKeys200Response.js +2 -2
- package/dist/model/GetDevicePublicKeys200ResponseDevicePublicKeysInner.js +3 -1
- package/dist/model/GetDeviceSessions200Response.js +2 -2
- package/dist/model/GetDevices200Response.js +2 -2
- package/dist/model/GetEvents200Response.js +1 -1
- package/dist/model/GetJobRuns200Response.js +1 -1
- package/dist/model/GetJobs200Response.js +1 -1
- package/dist/model/GetNotefile200Response.js +1 -1
- package/dist/model/{GetBillingAccount200Response.js → GetOrganization200Response.js} +28 -28
- package/dist/model/{GetBillingAccount200ResponsePlan.js → GetOrganization200ResponsePlan.js} +24 -24
- package/dist/model/{GetBillingAccountBalanceHistory200Response.js → GetOrganizationBalanceHistory200Response.js} +22 -22
- package/dist/model/{GetBillingAccountBalanceHistory200ResponseDataInner.js → GetOrganizationBalanceHistory200ResponseDataInner.js} +22 -22
- package/dist/model/GetOrganizations200Response.js +1 -1
- package/dist/model/GetProducts200Response.js +1 -1
- package/dist/model/GetProjectMembers200Response.js +1 -1
- package/dist/model/GetProjectSecretsResponse.js +3 -2
- package/dist/model/GetProjects200Response.js +1 -1
- package/dist/model/GetRouteLogsUsage200Response.js +2 -2
- package/dist/model/GetSessionsUsage200Response.js +3 -3
- package/dist/model/GetWebhooks200Response.js +1 -1
- package/dist/model/GoogleRoute.js +6 -1
- package/dist/model/HealthLog.js +7 -4
- package/dist/model/HttpRoute.js +7 -2
- package/dist/model/Job.js +1 -1
- package/dist/model/JobDefinition.js +2 -2
- package/dist/model/JobDefinitionReportOptions.js +2 -1
- package/dist/model/JobDefinitionSelect.js +4 -3
- package/dist/model/JobDetail.js +1 -1
- package/dist/model/JobDetailAllOf.js +1 -1
- package/dist/model/JobRun.js +1 -1
- package/dist/model/Location.js +13 -7
- package/dist/model/Monitor.js +18 -12
- package/dist/model/MonitorAlertRoutesInner.js +60 -14
- package/dist/model/MqttRoute.js +14 -1
- package/dist/model/Note.js +2 -2
- package/dist/model/NoteInput.js +1 -1
- package/dist/model/Notefile.js +4 -2
- package/dist/model/NotefileSchema.js +5 -3
- package/dist/model/NotehubRoute.js +7 -3
- package/dist/model/NotehubRouteSummary.js +6 -1
- package/dist/model/OAuth2Error.js +1 -1
- package/dist/model/OAuth2TokenResponse.js +1 -1
- package/dist/model/Organization.js +5 -3
- package/dist/model/Product.js +8 -4
- package/dist/model/Project.js +7 -4
- package/dist/model/ProjectMember.js +5 -4
- package/dist/model/ProjectSecret.js +7 -7
- package/dist/model/ProvisionDeviceRequest.js +5 -5
- package/dist/model/ProxyRoute.js +6 -1
- package/dist/model/QubitroRoute.js +7 -1
- package/dist/model/RadRoute.js +9 -1
- package/dist/model/Repository.js +3 -3
- package/dist/model/RepositoryListResponse.js +3 -2
- package/dist/model/{Login200Response.js → RepositoryRecord.js} +52 -24
- package/dist/model/RepositoryTokenRequest.js +1 -1
- package/dist/model/RepositoryTokenResponse.js +1 -1
- package/dist/model/RouteLog.js +9 -9
- package/dist/model/RouteTransformSettings.js +5 -5
- package/dist/model/RunJob200Response.js +1 -1
- package/dist/model/S3ArchiveRoute.js +16 -1
- package/dist/model/SatelliteDataUsage.js +1 -1
- package/dist/model/SatellitePlan.js +1 -1
- package/dist/model/SchemaProperty.js +6 -4
- package/dist/model/SignalDevice200Response.js +2 -2
- package/dist/model/SimUsage.js +1 -1
- package/dist/model/Skill.js +210 -0
- package/dist/model/{GetBillingAccounts200Response.js → SkillLinks.js} +59 -40
- package/dist/model/{GetEventsByCursor200Response.js → SkillSet.js} +79 -51
- package/dist/model/SkillSummary.js +208 -0
- package/dist/model/SkillWrite.js +128 -0
- package/dist/model/SkillWriteResult.js +154 -0
- package/dist/model/SlackBearerNotification.js +31 -8
- package/dist/model/SlackRoute.js +9 -1
- package/dist/model/SlackWebHookNotification.js +31 -8
- package/dist/model/SnowflakeRoute.js +9 -1
- package/dist/model/SnowpipeStreamingRoute.js +12 -1
- package/dist/model/ThingworxRoute.js +6 -1
- package/dist/model/TowerLocation.js +1 -1
- package/dist/model/TwilioNotification.js +167 -0
- package/dist/model/TwilioRoute.js +9 -1
- package/dist/model/UpdateFleetRequest.js +7 -6
- package/dist/model/UpdateHostFirmwareRequest.js +4 -4
- package/dist/model/UpdateProjectSecretRequest.js +3 -3
- package/dist/model/UploadMetadata.js +1 -1
- package/dist/model/UsageApiData.js +3 -2
- package/dist/model/UsageData.js +7 -3
- package/dist/model/UsageEventsData.js +5 -2
- package/dist/model/UsageEventsResponse.js +4 -3
- package/dist/model/UsageRouteLogsData.js +10 -6
- package/dist/model/UsageSessionsData.js +11 -5
- package/dist/model/UserDfuStateMachine.js +1 -1
- package/dist/model/UserDfuStateMachineStatus.js +1 -1
- package/dist/model/UserFirmwareInfo.js +1 -1
- package/dist/model/WebhookSettings.js +4 -4
- package/package.json +1 -1
- package/dist/api/BillingAccountApi.js +0 -167
- 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=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;
|
|
@@ -0,0 +1,154 @@
|
|
|
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 _Skill = _interopRequireDefault(require("./Skill"));
|
|
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 SkillWriteResult model module.
|
|
32
|
+
* @module model/SkillWriteResult
|
|
33
|
+
* @version 7.0.0-beta.1
|
|
34
|
+
*/
|
|
35
|
+
var SkillWriteResult = /*#__PURE__*/function () {
|
|
36
|
+
/**
|
|
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}
|
|
41
|
+
*/
|
|
42
|
+
function SkillWriteResult(outcome, skill) {
|
|
43
|
+
_classCallCheck(this, SkillWriteResult);
|
|
44
|
+
SkillWriteResult.initialize(this, outcome, skill);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Initializes the fields of this object.
|
|
49
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
50
|
+
* Only for internal use.
|
|
51
|
+
*/
|
|
52
|
+
return _createClass(SkillWriteResult, null, [{
|
|
53
|
+
key: "initialize",
|
|
54
|
+
value: function initialize(obj, outcome, skill) {
|
|
55
|
+
obj["outcome"] = outcome;
|
|
56
|
+
obj["skill"] = skill;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Constructs a <code>SkillWriteResult</code> from a plain JavaScript object, optionally creating a new instance.
|
|
61
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
62
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
63
|
+
* @param {module:model/SkillWriteResult} obj Optional instance to populate.
|
|
64
|
+
* @return {module:model/SkillWriteResult} The populated <code>SkillWriteResult</code> instance.
|
|
65
|
+
*/
|
|
66
|
+
}, {
|
|
67
|
+
key: "constructFromObject",
|
|
68
|
+
value: function constructFromObject(data, obj) {
|
|
69
|
+
if (data) {
|
|
70
|
+
obj = obj || new SkillWriteResult();
|
|
71
|
+
if (data.hasOwnProperty("outcome")) {
|
|
72
|
+
obj["outcome"] = _ApiClient["default"].convertToType(data["outcome"], "String");
|
|
73
|
+
}
|
|
74
|
+
if (data.hasOwnProperty("skill")) {
|
|
75
|
+
obj["skill"] = _Skill["default"].constructFromObject(data["skill"]);
|
|
76
|
+
}
|
|
77
|
+
} else if (data === null) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
return obj;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Validates the JSON data with respect to <code>SkillWriteResult</code>.
|
|
85
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
86
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>SkillWriteResult</code>.
|
|
87
|
+
*/
|
|
88
|
+
}, {
|
|
89
|
+
key: "validateJSON",
|
|
90
|
+
value: function validateJSON(data) {
|
|
91
|
+
// check to make sure all required properties are present in the JSON string
|
|
92
|
+
var _iterator = _createForOfIteratorHelper(SkillWriteResult.RequiredProperties),
|
|
93
|
+
_step;
|
|
94
|
+
try {
|
|
95
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
96
|
+
var property = _step.value;
|
|
97
|
+
if (!data[property]) {
|
|
98
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// ensure the json data is a string
|
|
102
|
+
} catch (err) {
|
|
103
|
+
_iterator.e(err);
|
|
104
|
+
} finally {
|
|
105
|
+
_iterator.f();
|
|
106
|
+
}
|
|
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"]);
|
|
109
|
+
}
|
|
110
|
+
// validate the optional field `skill`
|
|
111
|
+
if (data["skill"]) {
|
|
112
|
+
// data not null
|
|
113
|
+
_Skill["default"].validateJSON(data["skill"]);
|
|
114
|
+
}
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
}]);
|
|
118
|
+
}();
|
|
119
|
+
SkillWriteResult.RequiredProperties = ["outcome", "skill"];
|
|
120
|
+
|
|
121
|
+
/**
|
|
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
|
|
124
|
+
*/
|
|
125
|
+
SkillWriteResult.prototype["outcome"] = undefined;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @member {module:model/Skill} skill
|
|
129
|
+
*/
|
|
130
|
+
SkillWriteResult.prototype["skill"] = undefined;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Allowed values for the <code>outcome</code> property.
|
|
134
|
+
* @enum {String}
|
|
135
|
+
* @readonly
|
|
136
|
+
*/
|
|
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,6 +7,9 @@ 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; }
|
|
@@ -26,16 +29,17 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
26
29
|
/**
|
|
27
30
|
* The SlackBearerNotification model module.
|
|
28
31
|
* @module model/SlackBearerNotification
|
|
29
|
-
* @version
|
|
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
|
-
//
|
|
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
|
|
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
|
|
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;
|
package/dist/model/SlackRoute.js
CHANGED
|
@@ -28,7 +28,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
28
28
|
/**
|
|
29
29
|
* The SlackRoute model module.
|
|
30
30
|
* @module model/SlackRoute
|
|
31
|
-
* @version
|
|
31
|
+
* @version 7.0.0-beta.1
|
|
32
32
|
*/
|
|
33
33
|
var SlackRoute = /*#__PURE__*/function () {
|
|
34
34
|
/**
|
|
@@ -144,16 +144,19 @@ var SlackRoute = /*#__PURE__*/function () {
|
|
|
144
144
|
}]);
|
|
145
145
|
}();
|
|
146
146
|
/**
|
|
147
|
+
* Slack token used to call `chat.postMessage`. Required for `slack-bearer`. Returned as `(omitted)`; must be sent again on every update.
|
|
147
148
|
* @member {String} bearer
|
|
148
149
|
*/
|
|
149
150
|
SlackRoute.prototype["bearer"] = undefined;
|
|
150
151
|
|
|
151
152
|
/**
|
|
153
|
+
* Block Kit JSON: a blocks array or Block Kit Builder's `{\"blocks\": [...]}` object, with placeholders filled in.
|
|
152
154
|
* @member {String} blocks
|
|
153
155
|
*/
|
|
154
156
|
SlackRoute.prototype["blocks"] = undefined;
|
|
155
157
|
|
|
156
158
|
/**
|
|
159
|
+
* Slack channel to post to; placeholders are filled in per event. Required for `slack-bearer`; ignored by `slack-webhook`.
|
|
157
160
|
* @member {String} channel
|
|
158
161
|
*/
|
|
159
162
|
SlackRoute.prototype["channel"] = undefined;
|
|
@@ -164,21 +167,25 @@ SlackRoute.prototype["channel"] = undefined;
|
|
|
164
167
|
SlackRoute.prototype["filter"] = undefined;
|
|
165
168
|
|
|
166
169
|
/**
|
|
170
|
+
* FleetUIDs to send events from. Omit for all fleets; on create, `[]` sends none. Unknown UIDs are dropped.
|
|
167
171
|
* @member {Array.<String>} fleets
|
|
168
172
|
*/
|
|
169
173
|
SlackRoute.prototype["fleets"] = undefined;
|
|
170
174
|
|
|
171
175
|
/**
|
|
176
|
+
* Message text; placeholders such as `[.body.temp]` are filled in per event. `text` or `blocks` is required.
|
|
172
177
|
* @member {String} text
|
|
173
178
|
*/
|
|
174
179
|
SlackRoute.prototype["text"] = undefined;
|
|
175
180
|
|
|
176
181
|
/**
|
|
182
|
+
* Has no effect for this route type.
|
|
177
183
|
* @member {Number} throttle_ms
|
|
178
184
|
*/
|
|
179
185
|
SlackRoute.prototype["throttle_ms"] = undefined;
|
|
180
186
|
|
|
181
187
|
/**
|
|
188
|
+
* Seconds to wait for the destination to respond. `0` or omitted uses 15.
|
|
182
189
|
* @member {Number} timeout
|
|
183
190
|
*/
|
|
184
191
|
SlackRoute.prototype["timeout"] = undefined;
|
|
@@ -189,6 +196,7 @@ SlackRoute.prototype["timeout"] = undefined;
|
|
|
189
196
|
SlackRoute.prototype["transform"] = undefined;
|
|
190
197
|
|
|
191
198
|
/**
|
|
199
|
+
* Slack incoming webhook URL. Required for `slack-webhook`. Returned as `(omitted)`; must be sent again on every update.
|
|
192
200
|
* @member {String} webhook_url
|
|
193
201
|
*/
|
|
194
202
|
SlackRoute.prototype["webhook_url"] = undefined;
|