opengate-js 16.1.1 → 16.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{opengate-api-bower-16.1.1.js → opengate-api-bower-16.2.0.js} +493 -490
- package/dist/opengate-api-bower-16.2.0.js.map +6 -0
- package/dist/{opengate-api-bower-16.1.1.min.js → opengate-api-bower-16.2.0.min.js} +11 -8
- package/dist/opengate-api-bower-16.2.0.min.js.map +6 -0
- package/dist/opengate-api-npm.mjs +34 -35
- package/dist/opengate-api-npm.mjs.map +2 -2
- package/dist/src/iot/catalog/Datastream.js.map +1 -1
- package/dist/src/notebookScheduler/NotebookScheduler.js +13 -0
- package/dist/src/notebookScheduler/NotebookScheduler.js.map +1 -1
- package/dist/src/security/Certificates.js +0 -14
- package/dist/src/security/Certificates.js.map +1 -1
- package/package.json +3 -4
- package/src/iot/catalog/Datastream.js +0 -1
- package/src/notebookScheduler/NotebookScheduler.js +14 -0
- package/src/security/Certificates.js +0 -32
- package/types/src/notebookScheduler/NotebookScheduler.d.ts +7 -0
- package/types/src/security/Certificates.d.ts +0 -1
- package/dist/opengate-api-bower-16.1.1.js.map +0 -6
- package/dist/opengate-api-bower-16.1.1.min.js.map +0 -6
|
@@ -123,11 +123,11 @@ var require_check_types = __commonJS({
|
|
|
123
123
|
]);
|
|
124
124
|
}
|
|
125
125
|
},
|
|
126
|
-
_checkStringAndLength: function(parameter,
|
|
127
|
-
if (typeof parameter !== "string" || parameter.length >
|
|
126
|
+
_checkStringAndLength: function(parameter, length, name) {
|
|
127
|
+
if (typeof parameter !== "string" || parameter.length > length) {
|
|
128
128
|
throw checkError([
|
|
129
129
|
{ message: "OGAPI_STRING_PARAMETER", parameter: name },
|
|
130
|
-
{ message: "OGAPI_MAX_LENGTH", parameter:
|
|
130
|
+
{ message: "OGAPI_MAX_LENGTH", parameter: length }
|
|
131
131
|
]);
|
|
132
132
|
}
|
|
133
133
|
},
|
|
@@ -1367,8 +1367,8 @@ var BaseOperationBuilder = class {
|
|
|
1367
1367
|
_checkMandatoryParameters() {
|
|
1368
1368
|
if (this._config.parameters && this._config.parameters.schema) {
|
|
1369
1369
|
const validate = this._ajv.compile(this._config.parameters.schema);
|
|
1370
|
-
const
|
|
1371
|
-
if (!
|
|
1370
|
+
const valid = validate(this._build.parameters);
|
|
1371
|
+
if (!valid) {
|
|
1372
1372
|
throw new Error(validate.errors);
|
|
1373
1373
|
}
|
|
1374
1374
|
}
|
|
@@ -2412,19 +2412,6 @@ var Certificates = class extends Security {
|
|
|
2412
2412
|
this._usages = usages;
|
|
2413
2413
|
return this;
|
|
2414
2414
|
}
|
|
2415
|
-
_checkHardware(hardware) {
|
|
2416
|
-
if (typeof hardware === "string") {
|
|
2417
|
-
hardware = eval("(" + hardware + ")");
|
|
2418
|
-
}
|
|
2419
|
-
let length = Object.keys(hardware).length;
|
|
2420
|
-
let valid = false;
|
|
2421
|
-
if (length === 1 && hardware.hardwareId && typeof hardware.hardwareId === "string" && hardware.hardwareId.length > 0) {
|
|
2422
|
-
valid = true;
|
|
2423
|
-
} else if (length === 3 && hardware.manufacturer && hardware.model && hardware.modelVersion && typeof hardware.manufacturer === "string" && typeof hardware.model === "string" && typeof hardware.modelVersion === "string" && hardware.manufacturer.length > 0 && hardware.model.length > 0 && hardware.modelVersion.length > 0) {
|
|
2424
|
-
valid = true;
|
|
2425
|
-
}
|
|
2426
|
-
return valid;
|
|
2427
|
-
}
|
|
2428
2415
|
/**
|
|
2429
2416
|
* Set the tags attribute
|
|
2430
2417
|
* @param {Array} tags
|
|
@@ -2493,7 +2480,6 @@ var Certificates = class extends Security {
|
|
|
2493
2480
|
description: this._description || void 0,
|
|
2494
2481
|
administrativeState: this._administrativeState || void 0,
|
|
2495
2482
|
usages: this._usages || void 0,
|
|
2496
|
-
hardware: this._hardware || void 0,
|
|
2497
2483
|
tags: this._tags || void 0,
|
|
2498
2484
|
parameters: this._parameters || void 0,
|
|
2499
2485
|
domains: this._domains || void 0
|
|
@@ -13186,9 +13172,9 @@ var Bundles = class extends BaseProvision {
|
|
|
13186
13172
|
* @param {string} hardware
|
|
13187
13173
|
* @return {Bundles}
|
|
13188
13174
|
*/
|
|
13189
|
-
withHardware(
|
|
13190
|
-
if (typeof
|
|
13191
|
-
this._hardware =
|
|
13175
|
+
withHardware(hardware) {
|
|
13176
|
+
if (typeof hardware !== "string") throw new Error("Parameter hardware must be a string");
|
|
13177
|
+
this._hardware = hardware;
|
|
13192
13178
|
return this;
|
|
13193
13179
|
}
|
|
13194
13180
|
/**
|
|
@@ -14002,7 +13988,7 @@ var Hardware = class {
|
|
|
14002
13988
|
return ret;
|
|
14003
13989
|
}
|
|
14004
13990
|
composeElement() {
|
|
14005
|
-
var
|
|
13991
|
+
var hardware = {
|
|
14006
13992
|
serialnumber: this._serialnumber,
|
|
14007
13993
|
manufacturer: {
|
|
14008
13994
|
name: this._manufacturerName,
|
|
@@ -14014,7 +14000,7 @@ var Hardware = class {
|
|
|
14014
14000
|
},
|
|
14015
14001
|
clockDate: this._clockDate
|
|
14016
14002
|
};
|
|
14017
|
-
return
|
|
14003
|
+
return hardware;
|
|
14018
14004
|
}
|
|
14019
14005
|
};
|
|
14020
14006
|
|
|
@@ -14601,11 +14587,11 @@ var Subscriber = class {
|
|
|
14601
14587
|
* @param {Hardware} hardware - optionals field
|
|
14602
14588
|
* @return {Subscriber}
|
|
14603
14589
|
*/
|
|
14604
|
-
withHardware(
|
|
14605
|
-
if (!(
|
|
14590
|
+
withHardware(hardware) {
|
|
14591
|
+
if (!(hardware instanceof Hardware)) {
|
|
14606
14592
|
throw new Error("Parameter hardware must be hardware type");
|
|
14607
14593
|
}
|
|
14608
|
-
this._hardware =
|
|
14594
|
+
this._hardware = hardware;
|
|
14609
14595
|
return this;
|
|
14610
14596
|
}
|
|
14611
14597
|
composeElement() {
|
|
@@ -14825,11 +14811,11 @@ var CommsModuleMessage = class {
|
|
|
14825
14811
|
* @param {Hardware} hardware - optionals field
|
|
14826
14812
|
* @return {CommsModule}
|
|
14827
14813
|
*/
|
|
14828
|
-
withHardware(
|
|
14829
|
-
if (!(
|
|
14814
|
+
withHardware(hardware) {
|
|
14815
|
+
if (!(hardware instanceof Hardware)) {
|
|
14830
14816
|
throw new Error("Parameter hardware must be hardware type");
|
|
14831
14817
|
}
|
|
14832
|
-
this._hardware =
|
|
14818
|
+
this._hardware = hardware;
|
|
14833
14819
|
return this;
|
|
14834
14820
|
}
|
|
14835
14821
|
/**
|
|
@@ -15020,11 +15006,11 @@ var Event = class {
|
|
|
15020
15006
|
* @param {Hardware} hardware - optionals field
|
|
15021
15007
|
* @return {Event}
|
|
15022
15008
|
*/
|
|
15023
|
-
withHardware(
|
|
15024
|
-
if (!(
|
|
15009
|
+
withHardware(hardware) {
|
|
15010
|
+
if (!(hardware instanceof Hardware)) {
|
|
15025
15011
|
throw new Error("Parameter hardware must be Hardware type");
|
|
15026
15012
|
}
|
|
15027
|
-
this._hardware =
|
|
15013
|
+
this._hardware = hardware;
|
|
15028
15014
|
return this;
|
|
15029
15015
|
}
|
|
15030
15016
|
/**
|
|
@@ -22669,6 +22655,16 @@ var NotebookScheduler = class extends BaseProvision {
|
|
|
22669
22655
|
this._reportRetentionDays = reportRetentionDays;
|
|
22670
22656
|
return this;
|
|
22671
22657
|
}
|
|
22658
|
+
/**
|
|
22659
|
+
* Sets the timezone attribute
|
|
22660
|
+
* @param {string} timezone
|
|
22661
|
+
* @return {NotebookScheduler}
|
|
22662
|
+
*/
|
|
22663
|
+
withTimezone(timezone) {
|
|
22664
|
+
import_check_types11.default._checkString(timezone, "timezone");
|
|
22665
|
+
this._timezone = timezone;
|
|
22666
|
+
return this;
|
|
22667
|
+
}
|
|
22672
22668
|
withParams(params) {
|
|
22673
22669
|
import_check_types11.default._checkArray(params, "params");
|
|
22674
22670
|
this._params = params;
|
|
@@ -22683,6 +22679,9 @@ var NotebookScheduler = class extends BaseProvision {
|
|
|
22683
22679
|
generateReport: this._generateReport || false,
|
|
22684
22680
|
params: this._params || []
|
|
22685
22681
|
};
|
|
22682
|
+
if (this._timezone) {
|
|
22683
|
+
notebookData.timeZone = this._timezone;
|
|
22684
|
+
}
|
|
22686
22685
|
return notebookData;
|
|
22687
22686
|
}
|
|
22688
22687
|
create() {
|
|
@@ -25219,9 +25218,9 @@ var NorthAmpliaREST = class {
|
|
|
25219
25218
|
}
|
|
25220
25219
|
}
|
|
25221
25220
|
var relativeUrlSplit = relativeUrl.split("/");
|
|
25222
|
-
var
|
|
25221
|
+
var length = relativeUrlSplit.length;
|
|
25223
25222
|
relativeUrlSplit.forEach(function(item, index) {
|
|
25224
|
-
if (index ===
|
|
25223
|
+
if (index === length - 1 && item.indexOf("?") > 0) {
|
|
25225
25224
|
var parameters2 = item.substring(item.indexOf("?"), item.length);
|
|
25226
25225
|
var _item = item.substring(0, item.indexOf("?"));
|
|
25227
25226
|
encode.push(urlencode(_item) + parameters2);
|