@hpcc-js/marshaller 2.23.103 → 2.23.107
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/index.es6.js +649 -678
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +689 -716
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -3
- package/dist/index.min.js.map +1 -1
- package/package.json +33 -32
- package/src/__package__.ts +2 -2
- package/src/dashy.ts +1 -1
- package/types/__package__.d.ts +2 -2
- package/types/__package__.d.ts.map +1 -1
- package/types-3.4/__package__.d.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@hpcc-js/comms'), require('@hpcc-js/common'), require('@hpcc-js/util'), require('@hpcc-js/chart'), require('@hpcc-js/dgrid'), require('@hpcc-js/form'), require('@hpcc-js/graph'), require('@hpcc-js/map'), require('@hpcc-js/layout'), require('@hpcc-js/phosphor'), require('@hpcc-js/codemirror'), require('@hpcc-js/other')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports', '@hpcc-js/comms', '@hpcc-js/common', '@hpcc-js/util', '@hpcc-js/chart', '@hpcc-js/dgrid', '@hpcc-js/form', '@hpcc-js/graph', '@hpcc-js/map', '@hpcc-js/layout', '@hpcc-js/phosphor', '@hpcc-js/codemirror', '@hpcc-js/other'], factory) :
|
|
4
|
-
(global =
|
|
5
|
-
}
|
|
4
|
+
(global = global || self, factory(global['@hpcc-js/marshaller'] = {}, global['@hpcc-js/comms'], global['@hpcc-js/common'], global['@hpcc-js/util'], global['@hpcc-js/chart'], global['@hpcc-js/dgrid'], global['@hpcc-js/form'], global['@hpcc-js/graph'], global['@hpcc-js/map'], global['@hpcc-js/layout'], global['@hpcc-js/phosphor'], global['@hpcc-js/codemirror'], global['@hpcc-js/other']));
|
|
5
|
+
}(this, (function (exports, comms, common, util$1, chart, dgrid, form, graph, map, layout, phosphor, codemirror, other) { 'use strict';
|
|
6
6
|
|
|
7
|
-
var PKG_NAME
|
|
8
|
-
var PKG_VERSION
|
|
9
|
-
var BUILD_VERSION = "2.
|
|
7
|
+
var PKG_NAME = "@hpcc-js/marshaller";
|
|
8
|
+
var PKG_VERSION = "2.23.107";
|
|
9
|
+
var BUILD_VERSION = "2.101.0";
|
|
10
10
|
|
|
11
11
|
/*! *****************************************************************************
|
|
12
12
|
Copyright (c) Microsoft Corporation.
|
|
@@ -39,15 +39,15 @@
|
|
|
39
39
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
var __assign
|
|
43
|
-
__assign
|
|
42
|
+
var __assign = function() {
|
|
43
|
+
__assign = Object.assign || function __assign(t) {
|
|
44
44
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
45
45
|
s = arguments[i];
|
|
46
46
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
47
47
|
}
|
|
48
48
|
return t;
|
|
49
49
|
};
|
|
50
|
-
return __assign
|
|
50
|
+
return __assign.apply(this, arguments);
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
function __decorate(decorators, target, key, desc) {
|
|
@@ -99,14 +99,14 @@
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
function __spreadArray
|
|
102
|
+
function __spreadArray(to, from, pack) {
|
|
103
103
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
104
104
|
if (ar || !(i in from)) {
|
|
105
105
|
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
106
106
|
ar[i] = from[i];
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
return to.concat(ar ||
|
|
109
|
+
return to.concat(ar || from);
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
function stringify(obj_from_json) {
|
|
@@ -122,9 +122,9 @@
|
|
|
122
122
|
// but without quotes around the keys.
|
|
123
123
|
var props = Object
|
|
124
124
|
.keys(obj_from_json)
|
|
125
|
-
.map(function (key) { return
|
|
125
|
+
.map(function (key) { return key + ": " + stringify(obj_from_json[key]); })
|
|
126
126
|
.join(", ");
|
|
127
|
-
return "{ "
|
|
127
|
+
return "{ " + props + " }";
|
|
128
128
|
}
|
|
129
129
|
function schemaType2IFieldType(type) {
|
|
130
130
|
switch (type) {
|
|
@@ -223,7 +223,7 @@
|
|
|
223
223
|
};
|
|
224
224
|
Activity.prototype.hash = function (more) {
|
|
225
225
|
if (more === void 0) { more = {}; }
|
|
226
|
-
return util$
|
|
226
|
+
return util$1.hashSum(__assign({}, more));
|
|
227
227
|
};
|
|
228
228
|
Activity.prototype.refreshMeta = function () {
|
|
229
229
|
return this._sourceActivity ? this._sourceActivity.refreshMeta() : Promise.resolve();
|
|
@@ -296,7 +296,7 @@
|
|
|
296
296
|
if (this._prevDataHash !== hash || this._prevInData !== inData) {
|
|
297
297
|
this._prevDataHash = hash;
|
|
298
298
|
this._prevInData = inData;
|
|
299
|
-
this._prevData = util$
|
|
299
|
+
this._prevData = util$1.update(this._prevData, this.computeData());
|
|
300
300
|
}
|
|
301
301
|
return this._prevData;
|
|
302
302
|
};
|
|
@@ -379,7 +379,7 @@
|
|
|
379
379
|
// Activity overrides ---
|
|
380
380
|
ActivityPipeline.prototype.hash = function (more) {
|
|
381
381
|
if (more === void 0) { more = {}; }
|
|
382
|
-
return util$
|
|
382
|
+
return util$1.hashSum(__assign({ activities: [this.activities().map(function (activity) { return activity.hash(); })] }, more));
|
|
383
383
|
};
|
|
384
384
|
ActivityPipeline.prototype.refreshMeta = function () {
|
|
385
385
|
return this.last().refreshMeta();
|
|
@@ -443,7 +443,7 @@
|
|
|
443
443
|
// Activity overrides ---
|
|
444
444
|
ActivitySelection.prototype.hash = function (more) {
|
|
445
445
|
if (more === void 0) { more = {}; }
|
|
446
|
-
return util$
|
|
446
|
+
return util$1.hashSum(__assign({ selection: this.selection().hash() }, more));
|
|
447
447
|
};
|
|
448
448
|
ActivitySelection.prototype.label = function () {
|
|
449
449
|
return this.selection().label();
|
|
@@ -490,7 +490,7 @@
|
|
|
490
490
|
__extends(Datasource, _super);
|
|
491
491
|
function Datasource() {
|
|
492
492
|
var _this = _super.call(this) || this;
|
|
493
|
-
_this._id = "ds_"
|
|
493
|
+
_this._id = "ds_" + ++datasourceID;
|
|
494
494
|
return _this;
|
|
495
495
|
}
|
|
496
496
|
return Datasource;
|
|
@@ -509,7 +509,7 @@
|
|
|
509
509
|
};
|
|
510
510
|
DatasourceRef.prototype.hash = function (more) {
|
|
511
511
|
if (more === void 0) { more = {}; }
|
|
512
|
-
return _super.prototype.hash.call(this, __assign
|
|
512
|
+
return _super.prototype.hash.call(this, __assign({ datasource: this._datasource ? this._datasource.hash(more) : undefined }, more));
|
|
513
513
|
};
|
|
514
514
|
DatasourceRef.prototype.toDDL = function () {
|
|
515
515
|
return {
|
|
@@ -622,7 +622,7 @@
|
|
|
622
622
|
};
|
|
623
623
|
Form.prototype.hash = function (more) {
|
|
624
624
|
if (more === void 0) { more = {}; }
|
|
625
|
-
return _super.prototype.hash.call(this, __assign
|
|
625
|
+
return _super.prototype.hash.call(this, __assign({ ddl: this.toDDL() }, more));
|
|
626
626
|
};
|
|
627
627
|
Form.prototype.refreshMeta = function () {
|
|
628
628
|
return Promise.resolve();
|
|
@@ -657,7 +657,7 @@
|
|
|
657
657
|
Form.prototype._class += " Form";
|
|
658
658
|
|
|
659
659
|
function fieldType(field) {
|
|
660
|
-
if (util$
|
|
660
|
+
if (util$1.isArray(field)) {
|
|
661
661
|
return "dataset";
|
|
662
662
|
}
|
|
663
663
|
var type = typeof field;
|
|
@@ -767,7 +767,7 @@
|
|
|
767
767
|
}
|
|
768
768
|
};
|
|
769
769
|
Databomb.prototype.hash = function (more) {
|
|
770
|
-
return _super.prototype.hash.call(this, __assign
|
|
770
|
+
return _super.prototype.hash.call(this, __assign({ ddl: this.toDDL(true) }, more)) + this.payload();
|
|
771
771
|
};
|
|
772
772
|
Databomb.prototype.refreshMeta = function () {
|
|
773
773
|
return Promise.resolve();
|
|
@@ -874,7 +874,7 @@
|
|
|
874
874
|
_this._schema = [];
|
|
875
875
|
_this._meta = [];
|
|
876
876
|
_this._data = [];
|
|
877
|
-
_this._exec = util$
|
|
877
|
+
_this._exec = util$1.debounce(function () {
|
|
878
878
|
if (_this._prevExecHash !== _this.hash()) {
|
|
879
879
|
_this._prevExecHash = _this.hash();
|
|
880
880
|
return _super.prototype.exec.call(_this).then(function () {
|
|
@@ -889,8 +889,8 @@
|
|
|
889
889
|
return Promise.resolve();
|
|
890
890
|
}
|
|
891
891
|
});
|
|
892
|
-
_this._fetchQ = new util$
|
|
893
|
-
_this.sample = util$
|
|
892
|
+
_this._fetchQ = new util$1.AsyncOrderedQueue();
|
|
893
|
+
_this.sample = util$1.debounce(function (samples, sampleSize) {
|
|
894
894
|
if (samples === void 0) { samples = _this.samples(); }
|
|
895
895
|
if (sampleSize === void 0) { sampleSize = _this.sampleSize(); }
|
|
896
896
|
var pages = [];
|
|
@@ -919,7 +919,7 @@
|
|
|
919
919
|
}
|
|
920
920
|
ESPResult.prototype.hash = function (more) {
|
|
921
921
|
if (more === void 0) { more = {}; }
|
|
922
|
-
return util$
|
|
922
|
+
return util$1.hashSum(__assign({ samples: this.samples(), sampleSize: this.sampleSize() }, more));
|
|
923
923
|
};
|
|
924
924
|
ESPResult.prototype.refreshMeta = function () {
|
|
925
925
|
var _this = this;
|
|
@@ -1071,7 +1071,7 @@
|
|
|
1071
1071
|
});
|
|
1072
1072
|
};
|
|
1073
1073
|
WUResult.prototype.label = function () {
|
|
1074
|
-
return
|
|
1074
|
+
return this.wuid() + "\n" + this.resultName();
|
|
1075
1075
|
};
|
|
1076
1076
|
__decorate([
|
|
1077
1077
|
common.publish(null, "widget", "Workunit"),
|
|
@@ -1141,7 +1141,7 @@
|
|
|
1141
1141
|
return new WU(elementContainer).fromDDL(ddl, skipID);
|
|
1142
1142
|
};
|
|
1143
1143
|
WU.prototype.hash = function () {
|
|
1144
|
-
return util$
|
|
1144
|
+
return util$1.hashSum({
|
|
1145
1145
|
url: this.url(),
|
|
1146
1146
|
wuid: this.wuid()
|
|
1147
1147
|
});
|
|
@@ -1265,7 +1265,7 @@
|
|
|
1265
1265
|
});
|
|
1266
1266
|
};
|
|
1267
1267
|
LogicalFile.prototype.label = function () {
|
|
1268
|
-
return ""
|
|
1268
|
+
return "" + this.logicalFile();
|
|
1269
1269
|
};
|
|
1270
1270
|
__decorate([
|
|
1271
1271
|
common.publish("", "string", "ESP Url (http://x.x.x.x:8010)"),
|
|
@@ -1322,7 +1322,7 @@
|
|
|
1322
1322
|
var _this = _super.call(this) || this;
|
|
1323
1323
|
_this._ec = _ec;
|
|
1324
1324
|
_this._responseFields = {};
|
|
1325
|
-
_this._submitQ = new util$
|
|
1325
|
+
_this._submitQ = new util$1.AsyncOrderedQueue();
|
|
1326
1326
|
return _this;
|
|
1327
1327
|
}
|
|
1328
1328
|
RestService.prototype.toDDL = function () {
|
|
@@ -1354,7 +1354,7 @@
|
|
|
1354
1354
|
};
|
|
1355
1355
|
RestService.prototype.hash = function (more) {
|
|
1356
1356
|
if (more === void 0) { more = {}; }
|
|
1357
|
-
return util$
|
|
1357
|
+
return util$1.hashSum(__assign({ url: this.url(), action: this.action(), mode: this.mode() }, more));
|
|
1358
1358
|
};
|
|
1359
1359
|
RestService.prototype.label = function () {
|
|
1360
1360
|
return this.action();
|
|
@@ -1369,7 +1369,7 @@
|
|
|
1369
1369
|
return this.requestFields().filter(function (f) { return f.valid(); });
|
|
1370
1370
|
};
|
|
1371
1371
|
RestService.prototype.submit = function (request) {
|
|
1372
|
-
var requestHash = util$
|
|
1372
|
+
var requestHash = util$1.hashSum(request);
|
|
1373
1373
|
if (!this._prevPromise || this._prevRequestHash !== requestHash) {
|
|
1374
1374
|
this._prevRequestHash = requestHash;
|
|
1375
1375
|
var conn = comms.createConnection({ baseUrl: this.url(), type: this.mode() });
|
|
@@ -1441,12 +1441,12 @@
|
|
|
1441
1441
|
};
|
|
1442
1442
|
RestResult.fromDDL = function (ec, rs, resultName) {
|
|
1443
1443
|
return new RestResult(ec)
|
|
1444
|
-
.id(
|
|
1444
|
+
.id(rs.id() + "_" + resultName)
|
|
1445
1445
|
.service(rs)
|
|
1446
1446
|
.resultName(resultName);
|
|
1447
1447
|
};
|
|
1448
1448
|
RestResult.prototype.serviceID = function () {
|
|
1449
|
-
return
|
|
1449
|
+
return this.service().url() + "/" + this.service().action() + "}";
|
|
1450
1450
|
};
|
|
1451
1451
|
RestResult.prototype.sourceHash = function () {
|
|
1452
1452
|
return this.service().hash();
|
|
@@ -1462,10 +1462,10 @@
|
|
|
1462
1462
|
};
|
|
1463
1463
|
RestResult.prototype.hash = function (more) {
|
|
1464
1464
|
if (more === void 0) { more = {}; }
|
|
1465
|
-
return util$
|
|
1465
|
+
return util$1.hashSum(__assign({ source: this.sourceHash(), resultName: this.resultName() }, more));
|
|
1466
1466
|
};
|
|
1467
1467
|
RestResult.prototype.label = function () {
|
|
1468
|
-
return
|
|
1468
|
+
return this.service().label() + "\n" + this.resultName();
|
|
1469
1469
|
};
|
|
1470
1470
|
RestResult.prototype.jsonDataFields = function () {
|
|
1471
1471
|
if (!this._jsonData || !this._jsonData.length)
|
|
@@ -1526,22 +1526,22 @@
|
|
|
1526
1526
|
var retVal = [];
|
|
1527
1527
|
if (!this.source_valid()) {
|
|
1528
1528
|
retVal.push({
|
|
1529
|
-
source:
|
|
1530
|
-
msg: "Invalid source: \""
|
|
1531
|
-
hint: "expected: "
|
|
1529
|
+
source: prefix + ".source." + this.source(),
|
|
1530
|
+
msg: "Invalid source: \"" + this.source() + "\"",
|
|
1531
|
+
hint: "expected: " + JSON.stringify(this.visualizationIDs())
|
|
1532
1532
|
});
|
|
1533
1533
|
}
|
|
1534
1534
|
if (!this.remoteField_valid()) {
|
|
1535
1535
|
retVal.push({
|
|
1536
|
-
source:
|
|
1537
|
-
msg: "Invalid remoteField: \""
|
|
1538
|
-
hint: "expected: "
|
|
1536
|
+
source: prefix + ".remoteField",
|
|
1537
|
+
msg: "Invalid remoteField: \"" + this.remoteField() + "\"",
|
|
1538
|
+
hint: "expected: " + JSON.stringify(this.sourceOutFields())
|
|
1539
1539
|
});
|
|
1540
1540
|
}
|
|
1541
1541
|
if (!this.value_valid()) {
|
|
1542
1542
|
retVal.push({
|
|
1543
|
-
source:
|
|
1544
|
-
msg: "Invalid value: \""
|
|
1543
|
+
source: prefix + ".value",
|
|
1544
|
+
msg: "Invalid value: \"" + this.value() + "\"",
|
|
1545
1545
|
hint: "expected: any value."
|
|
1546
1546
|
});
|
|
1547
1547
|
}
|
|
@@ -1566,7 +1566,7 @@
|
|
|
1566
1566
|
return new Param(ec).fromDDL(ddl);
|
|
1567
1567
|
};
|
|
1568
1568
|
Param.prototype.hash = function () {
|
|
1569
|
-
return util$
|
|
1569
|
+
return util$1.hashSum({
|
|
1570
1570
|
label: this.localField(),
|
|
1571
1571
|
source: this.source(),
|
|
1572
1572
|
sourceField: this.remoteField()
|
|
@@ -1707,7 +1707,7 @@
|
|
|
1707
1707
|
});
|
|
1708
1708
|
};
|
|
1709
1709
|
RestResultRef.prototype.label = function () {
|
|
1710
|
-
return
|
|
1710
|
+
return this.datasource().label() + "\n" + this.datasource().resultName();
|
|
1711
1711
|
};
|
|
1712
1712
|
RestResultRef.prototype.elementIDs = function () {
|
|
1713
1713
|
return this._ec.elementIDs();
|
|
@@ -1736,7 +1736,7 @@
|
|
|
1736
1736
|
var _this = this;
|
|
1737
1737
|
return this.datasource().refreshMeta().then(function () {
|
|
1738
1738
|
var oldParams = _this.request();
|
|
1739
|
-
var diffs = util$
|
|
1739
|
+
var diffs = util$1.compare(oldParams.map(function (p) { return p.localField(); }), _this.datasource().validRequestFields().map(function (ff) { return ff.fieldID(); }));
|
|
1740
1740
|
var newParams = oldParams.filter(function (op) { return diffs.update.indexOf(op.localField()) >= 0; });
|
|
1741
1741
|
_this.request(newParams.concat(diffs.enter.map(function (label) { return new Param(_this._ec).localField(label); })));
|
|
1742
1742
|
});
|
|
@@ -1759,7 +1759,7 @@
|
|
|
1759
1759
|
RestResultRef.prototype.exec = function () {
|
|
1760
1760
|
var _this = this;
|
|
1761
1761
|
var request = this.formatRequest();
|
|
1762
|
-
var requestHash = util$
|
|
1762
|
+
var requestHash = util$1.hashSum({ hash: this.hash(), request: request });
|
|
1763
1763
|
if (this._prevRequestHash !== requestHash) {
|
|
1764
1764
|
this._prevRequestHash = requestHash;
|
|
1765
1765
|
this._prevRequestPromise = this.datasource().submit(request).then(function (response) {
|
|
@@ -1787,15 +1787,15 @@
|
|
|
1787
1787
|
// "http://10.241.100.157:8002/WsEcl/submit/query/roxie/carmigjx_govbisgsavi.Ins4621360_Service_00000006/json",
|
|
1788
1788
|
var parts = _.split("/WsEcl/submit/query/");
|
|
1789
1789
|
if (parts.length < 2)
|
|
1790
|
-
throw new Error("Invalid roxie URL: "
|
|
1790
|
+
throw new Error("Invalid roxie URL: " + _);
|
|
1791
1791
|
var urlParts = parts[0].split(":");
|
|
1792
1792
|
if (urlParts.length < 3)
|
|
1793
|
-
throw new Error("Invalid roxie URL: "
|
|
1793
|
+
throw new Error("Invalid roxie URL: " + _);
|
|
1794
1794
|
var roxieParts = parts[1].split("/");
|
|
1795
1795
|
if (roxieParts.length < 2)
|
|
1796
|
-
throw new Error("Invalid roxie URL: "
|
|
1796
|
+
throw new Error("Invalid roxie URL: " + _);
|
|
1797
1797
|
return {
|
|
1798
|
-
url:
|
|
1798
|
+
url: urlParts[0] + ":" + urlParts[1] + ":" + (urlParts[2] === "18002" ? "18010" : "8010"),
|
|
1799
1799
|
querySet: roxieParts[0],
|
|
1800
1800
|
queryID: roxieParts[1]
|
|
1801
1801
|
};
|
|
@@ -1814,7 +1814,7 @@
|
|
|
1814
1814
|
_this._ec = _ec;
|
|
1815
1815
|
_this._responseFields = {};
|
|
1816
1816
|
_this._type = "roxie";
|
|
1817
|
-
_this._submitQ = new util$
|
|
1817
|
+
_this._submitQ = new util$1.AsyncOrderedQueue();
|
|
1818
1818
|
return _this;
|
|
1819
1819
|
}
|
|
1820
1820
|
RoxieService.prototype.toDDL = function () {
|
|
@@ -1849,7 +1849,7 @@
|
|
|
1849
1849
|
};
|
|
1850
1850
|
RoxieService.prototype.hash = function (more) {
|
|
1851
1851
|
if (more === void 0) { more = {}; }
|
|
1852
|
-
return util$
|
|
1852
|
+
return util$1.hashSum(__assign({ url: this.url(), querySet: this.querySet(), queryId: this.queryID(), ignoreHipieRequest: this.ignoreHipieRequest(), ignoreHipieResponse: this.ignoreHipieResponse() }, more));
|
|
1853
1853
|
};
|
|
1854
1854
|
RoxieService.prototype.label = function () {
|
|
1855
1855
|
return this.queryID();
|
|
@@ -1895,7 +1895,7 @@
|
|
|
1895
1895
|
return this;
|
|
1896
1896
|
};
|
|
1897
1897
|
RoxieService.prototype.submit = function (request) {
|
|
1898
|
-
var requestHash = util$
|
|
1898
|
+
var requestHash = util$1.hashSum(request);
|
|
1899
1899
|
if (!this._prevPromise || this._prevRequestHash !== requestHash) {
|
|
1900
1900
|
this._prevRequestHash = requestHash;
|
|
1901
1901
|
this._prevPromise = this._submitQ.push(this._query.submit(request));
|
|
@@ -1966,12 +1966,12 @@
|
|
|
1966
1966
|
};
|
|
1967
1967
|
RoxieResult.fromDDL = function (ec, rs, resultName) {
|
|
1968
1968
|
return new RoxieResult(ec)
|
|
1969
|
-
.id(
|
|
1969
|
+
.id(rs.id() + "_" + resultName)
|
|
1970
1970
|
.service(rs)
|
|
1971
1971
|
.resultName(resultName);
|
|
1972
1972
|
};
|
|
1973
1973
|
RoxieResult.prototype.serviceID = function () {
|
|
1974
|
-
return
|
|
1974
|
+
return this.service().url() + "/" + this.service().querySet() + "/" + this.service().queryID();
|
|
1975
1975
|
};
|
|
1976
1976
|
RoxieResult.prototype.sourceHash = function () {
|
|
1977
1977
|
return this.service().hash();
|
|
@@ -1987,10 +1987,10 @@
|
|
|
1987
1987
|
};
|
|
1988
1988
|
RoxieResult.prototype.hash = function (more) {
|
|
1989
1989
|
if (more === void 0) { more = {}; }
|
|
1990
|
-
return util$
|
|
1990
|
+
return util$1.hashSum(__assign({ source: this.sourceHash(), resultName: this.resultName() }, more));
|
|
1991
1991
|
};
|
|
1992
1992
|
RoxieResult.prototype.label = function () {
|
|
1993
|
-
return
|
|
1993
|
+
return this.service().label() + "\n" + this.resultName();
|
|
1994
1994
|
};
|
|
1995
1995
|
RoxieResult.prototype.computeFields = function (inFields) {
|
|
1996
1996
|
var _this = this;
|
|
@@ -2093,7 +2093,7 @@
|
|
|
2093
2093
|
});
|
|
2094
2094
|
};
|
|
2095
2095
|
RoxieResultRef.prototype.label = function () {
|
|
2096
|
-
return
|
|
2096
|
+
return this.datasource().label() + "\n" + this.datasource().resultName();
|
|
2097
2097
|
};
|
|
2098
2098
|
RoxieResultRef.prototype.elementIDs = function () {
|
|
2099
2099
|
return this._ec.elementIDs();
|
|
@@ -2123,7 +2123,7 @@
|
|
|
2123
2123
|
var _this = this;
|
|
2124
2124
|
return this.datasource().refreshMeta().then(function () {
|
|
2125
2125
|
var oldParams = _this.request();
|
|
2126
|
-
var diffs = util$
|
|
2126
|
+
var diffs = util$1.compare(oldParams.map(function (p) { return p.localField(); }), _this.datasource().requestFields().map(function (ff) { return ff.id; }));
|
|
2127
2127
|
var newParams = oldParams.filter(function (op) { return diffs.update.indexOf(op.localField()) >= 0; });
|
|
2128
2128
|
_this.request(newParams.concat(diffs.enter.map(function (label) { return new Param(_this._ec).localField(label); })));
|
|
2129
2129
|
});
|
|
@@ -2169,7 +2169,7 @@
|
|
|
2169
2169
|
var _this = this;
|
|
2170
2170
|
return _super.prototype.exec.call(this).then(function () {
|
|
2171
2171
|
var request = _this.formatRequest();
|
|
2172
|
-
var requestHash = util$
|
|
2172
|
+
var requestHash = util$1.hashSum({ hash: _this.hash(), request: request });
|
|
2173
2173
|
if (_this._prevRequestHash !== requestHash) {
|
|
2174
2174
|
_this._prevRequestHash = requestHash;
|
|
2175
2175
|
_this._prevRequestPromise = _this.datasource().submit(request).then(function (response) {
|
|
@@ -2218,7 +2218,7 @@
|
|
|
2218
2218
|
var request = {};
|
|
2219
2219
|
for (var key in _request) {
|
|
2220
2220
|
request[key] = _request[key];
|
|
2221
|
-
request[
|
|
2221
|
+
request[key + "_changed"] = true;
|
|
2222
2222
|
}
|
|
2223
2223
|
return request;
|
|
2224
2224
|
};
|
|
@@ -2233,7 +2233,7 @@
|
|
|
2233
2233
|
var _this = _super.call(this) || this;
|
|
2234
2234
|
_this._ec = _ec;
|
|
2235
2235
|
_this._nullDatasource = emptyDatabomb;
|
|
2236
|
-
_this._id = "ds_"
|
|
2236
|
+
_this._id = "ds_" + ++dsPickerID;
|
|
2237
2237
|
var ds = _this._ec.datasources()[0];
|
|
2238
2238
|
_this.datasourceID(ds.id());
|
|
2239
2239
|
return _this;
|
|
@@ -2290,18 +2290,18 @@
|
|
|
2290
2290
|
return this.selection().validate();
|
|
2291
2291
|
};
|
|
2292
2292
|
DSPicker.prototype.toDDL = function () {
|
|
2293
|
-
return __assign
|
|
2293
|
+
return __assign(__assign({}, this.datasourceRef().toDDL()), { id: this.datasourceID() });
|
|
2294
2294
|
};
|
|
2295
2295
|
// Activity overrides ---
|
|
2296
2296
|
DSPicker.prototype.hash = function (more) {
|
|
2297
2297
|
if (more === void 0) { more = {}; }
|
|
2298
|
-
return _super.prototype.hash.call(this, __assign
|
|
2298
|
+
return _super.prototype.hash.call(this, __assign({}, more));
|
|
2299
2299
|
};
|
|
2300
2300
|
DSPicker.prototype.datasourceIDs = function () {
|
|
2301
2301
|
return this._ec.datasources().map(function (ds) {
|
|
2302
2302
|
return {
|
|
2303
2303
|
value: ds.id(),
|
|
2304
|
-
text:
|
|
2304
|
+
text: ds.label() + " " + (ds.id() !== ds.label() ? " (" + ds.id() + ")" : "")
|
|
2305
2305
|
};
|
|
2306
2306
|
});
|
|
2307
2307
|
};
|
|
@@ -2317,23 +2317,8 @@
|
|
|
2317
2317
|
}(ActivitySelection));
|
|
2318
2318
|
DSPicker.prototype._class += " DSPicker";
|
|
2319
2319
|
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
2323
|
-
if (k !== 'default' && !(k in n)) {
|
|
2324
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
2325
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
2326
|
-
enumerable: true,
|
|
2327
|
-
get: function () { return e[k]; }
|
|
2328
|
-
});
|
|
2329
|
-
}
|
|
2330
|
-
});
|
|
2331
|
-
});
|
|
2332
|
-
return Object.freeze(n);
|
|
2333
|
-
}
|
|
2334
|
-
|
|
2335
|
-
var PKG_NAME = "@hpcc-js/ddl-shim";
|
|
2336
|
-
var PKG_VERSION = "2.17.21";
|
|
2320
|
+
var PKG_NAME$1 = "@hpcc-js/ddl-shim";
|
|
2321
|
+
var PKG_VERSION$1 = "2.17.25";
|
|
2337
2322
|
|
|
2338
2323
|
function isWorkunitDatasource(ref) {
|
|
2339
2324
|
return ref.WUID !== undefined;
|
|
@@ -2398,7 +2383,7 @@
|
|
|
2398
2383
|
}
|
|
2399
2384
|
var VisibilitySet = ["normal", "flyout"];
|
|
2400
2385
|
|
|
2401
|
-
var v2
|
|
2386
|
+
var v2 = /*#__PURE__*/Object.freeze({
|
|
2402
2387
|
__proto__: null,
|
|
2403
2388
|
isDatabombRef: isDatabombRef,
|
|
2404
2389
|
isWUResultRef: isWUResultRef,
|
|
@@ -2428,25 +2413,25 @@
|
|
|
2428
2413
|
PERFORMANCE OF THIS SOFTWARE.
|
|
2429
2414
|
***************************************************************************** */
|
|
2430
2415
|
|
|
2431
|
-
var __assign = function() {
|
|
2432
|
-
__assign = Object.assign || function __assign(t) {
|
|
2416
|
+
var __assign$1 = function() {
|
|
2417
|
+
__assign$1 = Object.assign || function __assign(t) {
|
|
2433
2418
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2434
2419
|
s = arguments[i];
|
|
2435
2420
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
2436
2421
|
}
|
|
2437
2422
|
return t;
|
|
2438
2423
|
};
|
|
2439
|
-
return __assign.apply(this, arguments);
|
|
2424
|
+
return __assign$1.apply(this, arguments);
|
|
2440
2425
|
};
|
|
2441
2426
|
|
|
2442
|
-
function __spreadArray(to, from, pack) {
|
|
2427
|
+
function __spreadArray$1(to, from, pack) {
|
|
2443
2428
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
2444
2429
|
if (ar || !(i in from)) {
|
|
2445
2430
|
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
2446
2431
|
ar[i] = from[i];
|
|
2447
2432
|
}
|
|
2448
2433
|
}
|
|
2449
|
-
return to.concat(ar ||
|
|
2434
|
+
return to.concat(ar || from);
|
|
2450
2435
|
}
|
|
2451
2436
|
|
|
2452
2437
|
var classMappings = {
|
|
@@ -2662,7 +2647,7 @@
|
|
|
2662
2647
|
});
|
|
2663
2648
|
return retVal;
|
|
2664
2649
|
}
|
|
2665
|
-
function upgrade
|
|
2650
|
+
function upgrade(ddl2, dermObj) {
|
|
2666
2651
|
apply_to_dataviews(ddl2, dermObj);
|
|
2667
2652
|
return apply_to_properties_layout(ddl2, dermObj);
|
|
2668
2653
|
}
|
|
@@ -2882,7 +2867,7 @@
|
|
|
2882
2867
|
break;
|
|
2883
2868
|
default:
|
|
2884
2869
|
groupByColumns.push(this.toLowerCase(field.id));
|
|
2885
|
-
throw new Error("Unhandled field function: "
|
|
2870
|
+
throw new Error("Unhandled field function: " + field.properties.function);
|
|
2886
2871
|
}
|
|
2887
2872
|
}
|
|
2888
2873
|
else {
|
|
@@ -2893,7 +2878,7 @@
|
|
|
2893
2878
|
this._ddl2DataviewActivities[viz.id].project.transformations = projectTransformations;
|
|
2894
2879
|
}
|
|
2895
2880
|
if (aggrFields.length) {
|
|
2896
|
-
this._ddl2DataviewActivities[viz.id].groupBy.groupByIDs = __spreadArray([], groupByColumns
|
|
2881
|
+
this._ddl2DataviewActivities[viz.id].groupBy.groupByIDs = __spreadArray$1([], groupByColumns);
|
|
2897
2882
|
this._ddl2DataviewActivities[viz.id].groupBy.aggregates = aggrFields;
|
|
2898
2883
|
}
|
|
2899
2884
|
}
|
|
@@ -2911,7 +2896,7 @@
|
|
|
2911
2896
|
case "MAX":
|
|
2912
2897
|
return "max";
|
|
2913
2898
|
}
|
|
2914
|
-
throw new Error("Unknown DDL1 Function Type: "
|
|
2899
|
+
throw new Error("Unknown DDL1 Function Type: " + func);
|
|
2915
2900
|
};
|
|
2916
2901
|
DDLUpgrade.prototype.readMappings = function () {
|
|
2917
2902
|
for (var _i = 0, _a = this._ddl.dashboards; _i < _a.length; _i++) {
|
|
@@ -2938,7 +2923,7 @@
|
|
|
2938
2923
|
this.readSliderMappings(viz);
|
|
2939
2924
|
}
|
|
2940
2925
|
else {
|
|
2941
|
-
throw new Error("Unkown DDL1 mapping type: "
|
|
2926
|
+
throw new Error("Unkown DDL1 mapping type: " + viz.type);
|
|
2942
2927
|
}
|
|
2943
2928
|
}
|
|
2944
2929
|
}
|
|
@@ -3053,7 +3038,7 @@
|
|
|
3053
3038
|
var flag = _a[_i];
|
|
3054
3039
|
if (flag.fieldid) {
|
|
3055
3040
|
mappings.transformations.push({
|
|
3056
|
-
fieldID: "annotation_"
|
|
3041
|
+
fieldID: "annotation_" + idx++,
|
|
3057
3042
|
type: "map",
|
|
3058
3043
|
sourceFieldID: this.toLowerCase(flag.fieldid),
|
|
3059
3044
|
default: {},
|
|
@@ -3112,7 +3097,7 @@
|
|
|
3112
3097
|
var mapping = update.mappings[key];
|
|
3113
3098
|
var dsFilter = (mapping && dsFilters[mapping]) ? dsFilters[mapping].filter : undefined;
|
|
3114
3099
|
if (!dsFilter) {
|
|
3115
|
-
console.warn("Select Mapping \""
|
|
3100
|
+
console.warn("Select Mapping \"" + mapping + "\" in viz \"" + viz.id + "\" not found in filters for \"" + otherViz.id + "\"");
|
|
3116
3101
|
}
|
|
3117
3102
|
else {
|
|
3118
3103
|
condition.mappings.push({
|
|
@@ -3223,7 +3208,7 @@
|
|
|
3223
3208
|
groupBy,
|
|
3224
3209
|
limit
|
|
3225
3210
|
],
|
|
3226
|
-
visualization: __assign(__assign({ id: viz.id, title: viz.title || "", description: "", visibility: viz.properties && viz.properties.flyout === true ? "flyout" : "normal" }, this.type2chartType(viz.type)), { mappings: mappings, properties: (viz.properties || {}) })
|
|
3211
|
+
visualization: __assign$1(__assign$1({ id: viz.id, title: viz.title || "", description: "", visibility: viz.properties && viz.properties.flyout === true ? "flyout" : "normal" }, this.type2chartType(viz.type)), { mappings: mappings, properties: (viz.properties || {}) })
|
|
3227
3212
|
};
|
|
3228
3213
|
};
|
|
3229
3214
|
DDLUpgrade.prototype.type2chartType = function (chartType) {
|
|
@@ -3353,8 +3338,8 @@
|
|
|
3353
3338
|
return {
|
|
3354
3339
|
version: "2.2.1",
|
|
3355
3340
|
createdBy: {
|
|
3356
|
-
name: PKG_NAME,
|
|
3357
|
-
version: PKG_VERSION
|
|
3341
|
+
name: PKG_NAME$1,
|
|
3342
|
+
version: PKG_VERSION$1
|
|
3358
3343
|
},
|
|
3359
3344
|
datasources: this.writeDatasources(),
|
|
3360
3345
|
dataviews: this.writeDataviews(),
|
|
@@ -3363,24 +3348,43 @@
|
|
|
3363
3348
|
};
|
|
3364
3349
|
return DDLUpgrade;
|
|
3365
3350
|
}());
|
|
3366
|
-
function upgrade(ddl, baseUrl, wuid, toLowerCase, dermatologyJson) {
|
|
3351
|
+
function upgrade$1(ddl, baseUrl, wuid, toLowerCase, dermatologyJson) {
|
|
3367
3352
|
if (toLowerCase === void 0) { toLowerCase = true; }
|
|
3368
3353
|
if (dermatologyJson === void 0) { dermatologyJson = {}; }
|
|
3369
3354
|
var ddlUp = new DDLUpgrade(ddl, baseUrl, wuid, toLowerCase);
|
|
3370
3355
|
var retVal = ddlUp.write();
|
|
3371
|
-
retVal.properties = upgrade
|
|
3356
|
+
retVal.properties = upgrade(retVal, dermatologyJson);
|
|
3372
3357
|
return retVal;
|
|
3373
3358
|
}
|
|
3374
3359
|
|
|
3375
3360
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
3376
3361
|
|
|
3377
|
-
|
|
3362
|
+
function unwrapExports (x) {
|
|
3363
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
3364
|
+
}
|
|
3378
3365
|
|
|
3379
|
-
|
|
3366
|
+
function createCommonjsModule(fn, basedir, module) {
|
|
3367
|
+
return module = {
|
|
3368
|
+
path: basedir,
|
|
3369
|
+
exports: {},
|
|
3370
|
+
require: function (path, base) {
|
|
3371
|
+
return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
|
|
3372
|
+
}
|
|
3373
|
+
}, fn(module, module.exports), module.exports;
|
|
3374
|
+
}
|
|
3380
3375
|
|
|
3381
|
-
|
|
3376
|
+
function getCjsExportFromNamespace (n) {
|
|
3377
|
+
return n && n['default'] || n;
|
|
3378
|
+
}
|
|
3379
|
+
|
|
3380
|
+
function commonjsRequire () {
|
|
3381
|
+
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
3382
|
+
}
|
|
3383
|
+
|
|
3384
|
+
var uri_all = createCommonjsModule(function (module, exports) {
|
|
3385
|
+
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
|
|
3382
3386
|
(function (global, factory) {
|
|
3383
|
-
|
|
3387
|
+
factory(exports) ;
|
|
3384
3388
|
}(commonjsGlobal, (function (exports) {
|
|
3385
3389
|
function merge() {
|
|
3386
3390
|
for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -3434,10 +3438,10 @@
|
|
|
3434
3438
|
//subset, excludes bidi control characters
|
|
3435
3439
|
IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]",
|
|
3436
3440
|
//subset
|
|
3437
|
-
UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$)
|
|
3438
|
-
subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*")
|
|
3439
|
-
subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*")
|
|
3440
|
-
|
|
3441
|
+
UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$),
|
|
3442
|
+
SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"),
|
|
3443
|
+
USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"),
|
|
3444
|
+
DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$),
|
|
3441
3445
|
//relaxed parsing rules
|
|
3442
3446
|
IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$),
|
|
3443
3447
|
H16$ = subexp(HEXDIG$$ + "{1,4}"),
|
|
@@ -3461,14 +3465,14 @@
|
|
|
3461
3465
|
IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"),
|
|
3462
3466
|
//[ *6( h16 ":" ) h16 ] "::"
|
|
3463
3467
|
IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")),
|
|
3464
|
-
ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+")
|
|
3468
|
+
ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"),
|
|
3465
3469
|
//RFC 6874, with relaxed parsing rules
|
|
3466
|
-
subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+")
|
|
3470
|
+
IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"),
|
|
3467
3471
|
//RFC 6874
|
|
3468
|
-
subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*")
|
|
3469
|
-
|
|
3470
|
-
subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+")
|
|
3471
|
-
subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*");
|
|
3472
|
+
REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"),
|
|
3473
|
+
PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")),
|
|
3474
|
+
SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"),
|
|
3475
|
+
QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*");
|
|
3472
3476
|
return {
|
|
3473
3477
|
NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
|
|
3474
3478
|
NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
|
|
@@ -4582,7 +4586,7 @@
|
|
|
4582
4586
|
|
|
4583
4587
|
var O = {};
|
|
4584
4588
|
//RFC 3986
|
|
4585
|
-
var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + ("\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" ) + "]";
|
|
4589
|
+
var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + ( "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" ) + "]";
|
|
4586
4590
|
var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive
|
|
4587
4591
|
var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded
|
|
4588
4592
|
//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =
|
|
@@ -4780,23 +4784,22 @@
|
|
|
4780
4784
|
|
|
4781
4785
|
})));
|
|
4782
4786
|
|
|
4783
|
-
}
|
|
4787
|
+
});
|
|
4788
|
+
|
|
4789
|
+
unwrapExports(uri_all);
|
|
4790
|
+
|
|
4791
|
+
// do not edit .js files directly - edit src/index.jst
|
|
4792
|
+
|
|
4784
4793
|
|
|
4785
|
-
var isArray = Array.isArray;
|
|
4786
|
-
var keyList = Object.keys;
|
|
4787
|
-
var hasProp = Object.prototype.hasOwnProperty;
|
|
4788
4794
|
|
|
4789
4795
|
var fastDeepEqual = function equal(a, b) {
|
|
4790
4796
|
if (a === b) return true;
|
|
4791
4797
|
|
|
4792
4798
|
if (a && b && typeof a == 'object' && typeof b == 'object') {
|
|
4793
|
-
|
|
4794
|
-
, arrB = isArray(b)
|
|
4795
|
-
, i
|
|
4796
|
-
, length
|
|
4797
|
-
, key;
|
|
4799
|
+
if (a.constructor !== b.constructor) return false;
|
|
4798
4800
|
|
|
4799
|
-
|
|
4801
|
+
var length, i, keys;
|
|
4802
|
+
if (Array.isArray(a)) {
|
|
4800
4803
|
length = a.length;
|
|
4801
4804
|
if (length != b.length) return false;
|
|
4802
4805
|
for (i = length; i-- !== 0;)
|
|
@@ -4804,41 +4807,35 @@
|
|
|
4804
4807
|
return true;
|
|
4805
4808
|
}
|
|
4806
4809
|
|
|
4807
|
-
if (arrA != arrB) return false;
|
|
4808
4810
|
|
|
4809
|
-
var dateA = a instanceof Date
|
|
4810
|
-
, dateB = b instanceof Date;
|
|
4811
|
-
if (dateA != dateB) return false;
|
|
4812
|
-
if (dateA && dateB) return a.getTime() == b.getTime();
|
|
4813
4811
|
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
if (
|
|
4817
|
-
if (regexpA && regexpB) return a.toString() == b.toString();
|
|
4812
|
+
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
4813
|
+
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
|
4814
|
+
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
|
4818
4815
|
|
|
4819
|
-
|
|
4816
|
+
keys = Object.keys(a);
|
|
4820
4817
|
length = keys.length;
|
|
4821
|
-
|
|
4822
|
-
if (length !== keyList(b).length)
|
|
4823
|
-
return false;
|
|
4818
|
+
if (length !== Object.keys(b).length) return false;
|
|
4824
4819
|
|
|
4825
4820
|
for (i = length; i-- !== 0;)
|
|
4826
|
-
if (!
|
|
4821
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
4827
4822
|
|
|
4828
4823
|
for (i = length; i-- !== 0;) {
|
|
4829
|
-
key = keys[i];
|
|
4824
|
+
var key = keys[i];
|
|
4825
|
+
|
|
4830
4826
|
if (!equal(a[key], b[key])) return false;
|
|
4831
4827
|
}
|
|
4832
4828
|
|
|
4833
4829
|
return true;
|
|
4834
4830
|
}
|
|
4835
4831
|
|
|
4832
|
+
// true if both NaN, false otherwise
|
|
4836
4833
|
return a!==a && b!==b;
|
|
4837
4834
|
};
|
|
4838
4835
|
|
|
4839
4836
|
// https://mathiasbynens.be/notes/javascript-encoding
|
|
4840
4837
|
// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode
|
|
4841
|
-
var ucs2length
|
|
4838
|
+
var ucs2length = function ucs2length(str) {
|
|
4842
4839
|
var length = 0
|
|
4843
4840
|
, len = str.length
|
|
4844
4841
|
, pos = 0
|
|
@@ -4855,20 +4852,18 @@
|
|
|
4855
4852
|
return length;
|
|
4856
4853
|
};
|
|
4857
4854
|
|
|
4858
|
-
var util
|
|
4855
|
+
var util = {
|
|
4859
4856
|
copy: copy,
|
|
4860
4857
|
checkDataType: checkDataType,
|
|
4861
4858
|
checkDataTypes: checkDataTypes,
|
|
4862
4859
|
coerceToTypes: coerceToTypes,
|
|
4863
|
-
toHash: toHash
|
|
4860
|
+
toHash: toHash,
|
|
4864
4861
|
getProperty: getProperty,
|
|
4865
4862
|
escapeQuotes: escapeQuotes,
|
|
4866
4863
|
equal: fastDeepEqual,
|
|
4867
|
-
ucs2length: ucs2length
|
|
4864
|
+
ucs2length: ucs2length,
|
|
4868
4865
|
varOccurences: varOccurences,
|
|
4869
4866
|
varReplace: varReplace,
|
|
4870
|
-
cleanUpCode: cleanUpCode,
|
|
4871
|
-
finalCleanUpCode: finalCleanUpCode,
|
|
4872
4867
|
schemaHasRules: schemaHasRules,
|
|
4873
4868
|
schemaHasRulesExcept: schemaHasRulesExcept,
|
|
4874
4869
|
schemaUnknownRules: schemaUnknownRules,
|
|
@@ -4890,7 +4885,7 @@
|
|
|
4890
4885
|
}
|
|
4891
4886
|
|
|
4892
4887
|
|
|
4893
|
-
function checkDataType(dataType, data, negate) {
|
|
4888
|
+
function checkDataType(dataType, data, strictNumbers, negate) {
|
|
4894
4889
|
var EQUAL = negate ? ' !== ' : ' === '
|
|
4895
4890
|
, AND = negate ? ' || ' : ' && '
|
|
4896
4891
|
, OK = negate ? '!' : ''
|
|
@@ -4903,18 +4898,21 @@
|
|
|
4903
4898
|
NOT + 'Array.isArray(' + data + '))';
|
|
4904
4899
|
case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND +
|
|
4905
4900
|
NOT + '(' + data + ' % 1)' +
|
|
4906
|
-
AND + data + EQUAL + data +
|
|
4901
|
+
AND + data + EQUAL + data +
|
|
4902
|
+
(strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')';
|
|
4903
|
+
case 'number': return '(typeof ' + data + EQUAL + '"' + dataType + '"' +
|
|
4904
|
+
(strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')';
|
|
4907
4905
|
default: return 'typeof ' + data + EQUAL + '"' + dataType + '"';
|
|
4908
4906
|
}
|
|
4909
4907
|
}
|
|
4910
4908
|
|
|
4911
4909
|
|
|
4912
|
-
function checkDataTypes(dataTypes, data) {
|
|
4910
|
+
function checkDataTypes(dataTypes, data, strictNumbers) {
|
|
4913
4911
|
switch (dataTypes.length) {
|
|
4914
|
-
case 1: return checkDataType(dataTypes[0], data, true);
|
|
4912
|
+
case 1: return checkDataType(dataTypes[0], data, strictNumbers, true);
|
|
4915
4913
|
default:
|
|
4916
4914
|
var code = '';
|
|
4917
|
-
var types = toHash
|
|
4915
|
+
var types = toHash(dataTypes);
|
|
4918
4916
|
if (types.array && types.object) {
|
|
4919
4917
|
code = types.null ? '(': '(!' + data + ' || ';
|
|
4920
4918
|
code += 'typeof ' + data + ' !== "object")';
|
|
@@ -4924,14 +4922,14 @@
|
|
|
4924
4922
|
}
|
|
4925
4923
|
if (types.number) delete types.integer;
|
|
4926
4924
|
for (var t in types)
|
|
4927
|
-
code += (code ? ' && ' : '' ) + checkDataType(t, data, true);
|
|
4925
|
+
code += (code ? ' && ' : '' ) + checkDataType(t, data, strictNumbers, true);
|
|
4928
4926
|
|
|
4929
4927
|
return code;
|
|
4930
4928
|
}
|
|
4931
4929
|
}
|
|
4932
4930
|
|
|
4933
4931
|
|
|
4934
|
-
var COERCE_TO_TYPES = toHash
|
|
4932
|
+
var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]);
|
|
4935
4933
|
function coerceToTypes(optionCoerceTypes, dataTypes) {
|
|
4936
4934
|
if (Array.isArray(dataTypes)) {
|
|
4937
4935
|
var types = [];
|
|
@@ -4949,19 +4947,19 @@
|
|
|
4949
4947
|
}
|
|
4950
4948
|
|
|
4951
4949
|
|
|
4952
|
-
function toHash
|
|
4950
|
+
function toHash(arr) {
|
|
4953
4951
|
var hash = {};
|
|
4954
4952
|
for (var i=0; i<arr.length; i++) hash[arr[i]] = true;
|
|
4955
4953
|
return hash;
|
|
4956
4954
|
}
|
|
4957
4955
|
|
|
4958
4956
|
|
|
4959
|
-
var IDENTIFIER
|
|
4957
|
+
var IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
|
|
4960
4958
|
var SINGLE_QUOTE = /'|\\/g;
|
|
4961
4959
|
function getProperty(key) {
|
|
4962
4960
|
return typeof key == 'number'
|
|
4963
4961
|
? '[' + key + ']'
|
|
4964
|
-
: IDENTIFIER
|
|
4962
|
+
: IDENTIFIER.test(key)
|
|
4965
4963
|
? '.' + key
|
|
4966
4964
|
: "['" + escapeQuotes(key) + "']";
|
|
4967
4965
|
}
|
|
@@ -4990,42 +4988,6 @@
|
|
|
4990
4988
|
}
|
|
4991
4989
|
|
|
4992
4990
|
|
|
4993
|
-
var EMPTY_ELSE = /else\s*{\s*}/g
|
|
4994
|
-
, EMPTY_IF_NO_ELSE = /if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g
|
|
4995
|
-
, EMPTY_IF_WITH_ELSE = /if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g;
|
|
4996
|
-
function cleanUpCode(out) {
|
|
4997
|
-
return out.replace(EMPTY_ELSE, '')
|
|
4998
|
-
.replace(EMPTY_IF_NO_ELSE, '')
|
|
4999
|
-
.replace(EMPTY_IF_WITH_ELSE, 'if (!($1))');
|
|
5000
|
-
}
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
var ERRORS_REGEXP = /[^v.]errors/g
|
|
5004
|
-
, REMOVE_ERRORS = /var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g
|
|
5005
|
-
, REMOVE_ERRORS_ASYNC = /var errors = 0;|var vErrors = null;/g
|
|
5006
|
-
, RETURN_VALID = 'return errors === 0;'
|
|
5007
|
-
, RETURN_TRUE = 'validate.errors = null; return true;'
|
|
5008
|
-
, RETURN_ASYNC = /if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/
|
|
5009
|
-
, RETURN_DATA_ASYNC = 'return data;'
|
|
5010
|
-
, ROOTDATA_REGEXP = /[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g
|
|
5011
|
-
, REMOVE_ROOTDATA = /if \(rootData === undefined\) rootData = data;/;
|
|
5012
|
-
|
|
5013
|
-
function finalCleanUpCode(out, async) {
|
|
5014
|
-
var matches = out.match(ERRORS_REGEXP);
|
|
5015
|
-
if (matches && matches.length == 2) {
|
|
5016
|
-
out = async
|
|
5017
|
-
? out.replace(REMOVE_ERRORS_ASYNC, '')
|
|
5018
|
-
.replace(RETURN_ASYNC, RETURN_DATA_ASYNC)
|
|
5019
|
-
: out.replace(REMOVE_ERRORS, '')
|
|
5020
|
-
.replace(RETURN_VALID, RETURN_TRUE);
|
|
5021
|
-
}
|
|
5022
|
-
|
|
5023
|
-
matches = out.match(ROOTDATA_REGEXP);
|
|
5024
|
-
if (!matches || matches.length !== 3) return out;
|
|
5025
|
-
return out.replace(REMOVE_ROOTDATA, '');
|
|
5026
|
-
}
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
4991
|
function schemaHasRules(schema, rules) {
|
|
5030
4992
|
if (typeof schema == 'boolean') return !schema;
|
|
5031
4993
|
for (var key in schema) if (rules[key]) return true;
|
|
@@ -5065,17 +5027,17 @@
|
|
|
5065
5027
|
}
|
|
5066
5028
|
|
|
5067
5029
|
|
|
5068
|
-
var JSON_POINTER
|
|
5069
|
-
var RELATIVE_JSON_POINTER
|
|
5030
|
+
var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
|
|
5031
|
+
var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
|
|
5070
5032
|
function getData($data, lvl, paths) {
|
|
5071
5033
|
var up, jsonPointer, data, matches;
|
|
5072
5034
|
if ($data === '') return 'rootData';
|
|
5073
5035
|
if ($data[0] == '/') {
|
|
5074
|
-
if (!JSON_POINTER
|
|
5036
|
+
if (!JSON_POINTER.test($data)) throw new Error('Invalid JSON-pointer: ' + $data);
|
|
5075
5037
|
jsonPointer = $data;
|
|
5076
5038
|
data = 'rootData';
|
|
5077
5039
|
} else {
|
|
5078
|
-
matches = $data.match(RELATIVE_JSON_POINTER
|
|
5040
|
+
matches = $data.match(RELATIVE_JSON_POINTER);
|
|
5079
5041
|
if (!matches) throw new Error('Invalid JSON-pointer: ' + $data);
|
|
5080
5042
|
up = +matches[1];
|
|
5081
5043
|
jsonPointer = matches[2];
|
|
@@ -5104,7 +5066,7 @@
|
|
|
5104
5066
|
|
|
5105
5067
|
function joinPaths (a, b) {
|
|
5106
5068
|
if (a == '""') return b;
|
|
5107
|
-
return (a + ' + ' + b).replace(/' \+ '/g, '');
|
|
5069
|
+
return (a + ' + ' + b).replace(/([^\\])' \+ '/g, '$1');
|
|
5108
5070
|
}
|
|
5109
5071
|
|
|
5110
5072
|
|
|
@@ -5127,17 +5089,15 @@
|
|
|
5127
5089
|
return str.replace(/~1/g, '/').replace(/~0/g, '~');
|
|
5128
5090
|
}
|
|
5129
5091
|
|
|
5130
|
-
var
|
|
5092
|
+
var schema_obj = SchemaObject;
|
|
5131
5093
|
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
function SchemaObject$2(obj) {
|
|
5135
|
-
util$4.copy(obj, this);
|
|
5094
|
+
function SchemaObject(obj) {
|
|
5095
|
+
util.copy(obj, this);
|
|
5136
5096
|
}
|
|
5137
5097
|
|
|
5138
|
-
var jsonSchemaTraverse =
|
|
5098
|
+
var jsonSchemaTraverse = createCommonjsModule(function (module) {
|
|
5139
5099
|
|
|
5140
|
-
var traverse
|
|
5100
|
+
var traverse = module.exports = function (schema, opts, cb) {
|
|
5141
5101
|
// Legacy support for v0.3.1 and earlier.
|
|
5142
5102
|
if (typeof opts == 'function') {
|
|
5143
5103
|
cb = opts;
|
|
@@ -5152,7 +5112,7 @@
|
|
|
5152
5112
|
};
|
|
5153
5113
|
|
|
5154
5114
|
|
|
5155
|
-
traverse
|
|
5115
|
+
traverse.keywords = {
|
|
5156
5116
|
additionalItems: true,
|
|
5157
5117
|
items: true,
|
|
5158
5118
|
contains: true,
|
|
@@ -5161,21 +5121,21 @@
|
|
|
5161
5121
|
not: true
|
|
5162
5122
|
};
|
|
5163
5123
|
|
|
5164
|
-
traverse
|
|
5124
|
+
traverse.arrayKeywords = {
|
|
5165
5125
|
items: true,
|
|
5166
5126
|
allOf: true,
|
|
5167
5127
|
anyOf: true,
|
|
5168
5128
|
oneOf: true
|
|
5169
5129
|
};
|
|
5170
5130
|
|
|
5171
|
-
traverse
|
|
5131
|
+
traverse.propsKeywords = {
|
|
5172
5132
|
definitions: true,
|
|
5173
5133
|
properties: true,
|
|
5174
5134
|
patternProperties: true,
|
|
5175
5135
|
dependencies: true
|
|
5176
5136
|
};
|
|
5177
5137
|
|
|
5178
|
-
traverse
|
|
5138
|
+
traverse.skipKeywords = {
|
|
5179
5139
|
default: true,
|
|
5180
5140
|
enum: true,
|
|
5181
5141
|
const: true,
|
|
@@ -5203,16 +5163,16 @@
|
|
|
5203
5163
|
for (var key in schema) {
|
|
5204
5164
|
var sch = schema[key];
|
|
5205
5165
|
if (Array.isArray(sch)) {
|
|
5206
|
-
if (key in traverse
|
|
5166
|
+
if (key in traverse.arrayKeywords) {
|
|
5207
5167
|
for (var i=0; i<sch.length; i++)
|
|
5208
5168
|
_traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);
|
|
5209
5169
|
}
|
|
5210
|
-
} else if (key in traverse
|
|
5170
|
+
} else if (key in traverse.propsKeywords) {
|
|
5211
5171
|
if (sch && typeof sch == 'object') {
|
|
5212
5172
|
for (var prop in sch)
|
|
5213
5173
|
_traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);
|
|
5214
5174
|
}
|
|
5215
|
-
} else if (key in traverse
|
|
5175
|
+
} else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {
|
|
5216
5176
|
_traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);
|
|
5217
5177
|
}
|
|
5218
5178
|
}
|
|
@@ -5224,21 +5184,16 @@
|
|
|
5224
5184
|
function escapeJsonPtr(str) {
|
|
5225
5185
|
return str.replace(/~/g, '~0').replace(/\//g, '~1');
|
|
5226
5186
|
}
|
|
5187
|
+
});
|
|
5227
5188
|
|
|
5228
|
-
var
|
|
5229
|
-
, equal$1 = fastDeepEqual
|
|
5230
|
-
, util$3 = util$5
|
|
5231
|
-
, SchemaObject$1 = schema_obj
|
|
5232
|
-
, traverse = jsonSchemaTraverse.exports;
|
|
5233
|
-
|
|
5234
|
-
var resolve_1 = resolve$3;
|
|
5189
|
+
var resolve_1 = resolve;
|
|
5235
5190
|
|
|
5236
|
-
resolve
|
|
5237
|
-
resolve
|
|
5238
|
-
resolve
|
|
5239
|
-
resolve
|
|
5240
|
-
resolve
|
|
5241
|
-
resolve
|
|
5191
|
+
resolve.normalizeId = normalizeId;
|
|
5192
|
+
resolve.fullPath = getFullPath;
|
|
5193
|
+
resolve.url = resolveUrl;
|
|
5194
|
+
resolve.ids = resolveIds;
|
|
5195
|
+
resolve.inlineRef = inlineRef;
|
|
5196
|
+
resolve.schema = resolveSchema;
|
|
5242
5197
|
|
|
5243
5198
|
/**
|
|
5244
5199
|
* [resolve and compile the references ($ref)]
|
|
@@ -5248,16 +5203,16 @@
|
|
|
5248
5203
|
* @param {String} ref reference to resolve
|
|
5249
5204
|
* @return {Object|Function} schema object (if the schema can be inlined) or validation function
|
|
5250
5205
|
*/
|
|
5251
|
-
function resolve
|
|
5206
|
+
function resolve(compile, root, ref) {
|
|
5252
5207
|
/* jshint validthis: true */
|
|
5253
5208
|
var refVal = this._refs[ref];
|
|
5254
5209
|
if (typeof refVal == 'string') {
|
|
5255
5210
|
if (this._refs[refVal]) refVal = this._refs[refVal];
|
|
5256
|
-
else return resolve
|
|
5211
|
+
else return resolve.call(this, compile, root, refVal);
|
|
5257
5212
|
}
|
|
5258
5213
|
|
|
5259
5214
|
refVal = refVal || this._schemas[ref];
|
|
5260
|
-
if (refVal instanceof
|
|
5215
|
+
if (refVal instanceof schema_obj) {
|
|
5261
5216
|
return inlineRef(refVal.schema, this._opts.inlineRefs)
|
|
5262
5217
|
? refVal.schema
|
|
5263
5218
|
: refVal.validate || this._compile(refVal);
|
|
@@ -5271,7 +5226,7 @@
|
|
|
5271
5226
|
baseId = res.baseId;
|
|
5272
5227
|
}
|
|
5273
5228
|
|
|
5274
|
-
if (schema instanceof
|
|
5229
|
+
if (schema instanceof schema_obj) {
|
|
5275
5230
|
v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId);
|
|
5276
5231
|
} else if (schema !== undefined) {
|
|
5277
5232
|
v = inlineRef(schema, this._opts.inlineRefs)
|
|
@@ -5292,7 +5247,7 @@
|
|
|
5292
5247
|
*/
|
|
5293
5248
|
function resolveSchema(root, ref) {
|
|
5294
5249
|
/* jshint validthis: true */
|
|
5295
|
-
var p =
|
|
5250
|
+
var p = uri_all.parse(ref)
|
|
5296
5251
|
, refPath = _getFullPath(p)
|
|
5297
5252
|
, baseId = getFullPath(this._getId(root.schema));
|
|
5298
5253
|
if (Object.keys(root.schema).length === 0 || refPath !== baseId) {
|
|
@@ -5300,12 +5255,12 @@
|
|
|
5300
5255
|
var refVal = this._refs[id];
|
|
5301
5256
|
if (typeof refVal == 'string') {
|
|
5302
5257
|
return resolveRecursive.call(this, root, refVal, p);
|
|
5303
|
-
} else if (refVal instanceof
|
|
5258
|
+
} else if (refVal instanceof schema_obj) {
|
|
5304
5259
|
if (!refVal.validate) this._compile(refVal);
|
|
5305
5260
|
root = refVal;
|
|
5306
5261
|
} else {
|
|
5307
5262
|
refVal = this._schemas[id];
|
|
5308
|
-
if (refVal instanceof
|
|
5263
|
+
if (refVal instanceof schema_obj) {
|
|
5309
5264
|
if (!refVal.validate) this._compile(refVal);
|
|
5310
5265
|
if (id == normalizeId(ref))
|
|
5311
5266
|
return { schema: refVal, root: root, baseId: baseId };
|
|
@@ -5336,7 +5291,7 @@
|
|
|
5336
5291
|
}
|
|
5337
5292
|
|
|
5338
5293
|
|
|
5339
|
-
var PREVENT_SCOPE_CHANGE = util
|
|
5294
|
+
var PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']);
|
|
5340
5295
|
/* @this Ajv */
|
|
5341
5296
|
function getJsonPointer(parsedRef, baseId, schema, root) {
|
|
5342
5297
|
/* jshint validthis: true */
|
|
@@ -5347,7 +5302,7 @@
|
|
|
5347
5302
|
for (var i = 1; i < parts.length; i++) {
|
|
5348
5303
|
var part = parts[i];
|
|
5349
5304
|
if (part) {
|
|
5350
|
-
part = util
|
|
5305
|
+
part = util.unescapeFragment(part);
|
|
5351
5306
|
schema = schema[part];
|
|
5352
5307
|
if (schema === undefined) break;
|
|
5353
5308
|
var id;
|
|
@@ -5371,7 +5326,7 @@
|
|
|
5371
5326
|
}
|
|
5372
5327
|
|
|
5373
5328
|
|
|
5374
|
-
var SIMPLE_INLINED = util
|
|
5329
|
+
var SIMPLE_INLINED = util.toHash([
|
|
5375
5330
|
'type', 'format', 'pattern',
|
|
5376
5331
|
'maxLength', 'minLength',
|
|
5377
5332
|
'maxProperties', 'minProperties',
|
|
@@ -5431,13 +5386,13 @@
|
|
|
5431
5386
|
|
|
5432
5387
|
function getFullPath(id, normalize) {
|
|
5433
5388
|
if (normalize !== false) id = normalizeId(id);
|
|
5434
|
-
var p =
|
|
5389
|
+
var p = uri_all.parse(id);
|
|
5435
5390
|
return _getFullPath(p);
|
|
5436
5391
|
}
|
|
5437
5392
|
|
|
5438
5393
|
|
|
5439
5394
|
function _getFullPath(p) {
|
|
5440
|
-
return
|
|
5395
|
+
return uri_all.serialize(p).split('#')[0] + '#';
|
|
5441
5396
|
}
|
|
5442
5397
|
|
|
5443
5398
|
|
|
@@ -5449,7 +5404,7 @@
|
|
|
5449
5404
|
|
|
5450
5405
|
function resolveUrl(baseId, id) {
|
|
5451
5406
|
id = normalizeId(id);
|
|
5452
|
-
return
|
|
5407
|
+
return uri_all.resolve(baseId, id);
|
|
5453
5408
|
}
|
|
5454
5409
|
|
|
5455
5410
|
|
|
@@ -5461,25 +5416,25 @@
|
|
|
5461
5416
|
var localRefs = {};
|
|
5462
5417
|
var self = this;
|
|
5463
5418
|
|
|
5464
|
-
|
|
5419
|
+
jsonSchemaTraverse(schema, {allKeys: true}, function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
|
|
5465
5420
|
if (jsonPtr === '') return;
|
|
5466
5421
|
var id = self._getId(sch);
|
|
5467
5422
|
var baseId = baseIds[parentJsonPtr];
|
|
5468
5423
|
var fullPath = fullPaths[parentJsonPtr] + '/' + parentKeyword;
|
|
5469
5424
|
if (keyIndex !== undefined)
|
|
5470
|
-
fullPath += '/' + (typeof keyIndex == 'number' ? keyIndex : util
|
|
5425
|
+
fullPath += '/' + (typeof keyIndex == 'number' ? keyIndex : util.escapeFragment(keyIndex));
|
|
5471
5426
|
|
|
5472
5427
|
if (typeof id == 'string') {
|
|
5473
|
-
id = baseId = normalizeId(baseId ?
|
|
5428
|
+
id = baseId = normalizeId(baseId ? uri_all.resolve(baseId, id) : id);
|
|
5474
5429
|
|
|
5475
5430
|
var refVal = self._refs[id];
|
|
5476
5431
|
if (typeof refVal == 'string') refVal = self._refs[refVal];
|
|
5477
5432
|
if (refVal && refVal.schema) {
|
|
5478
|
-
if (!
|
|
5433
|
+
if (!fastDeepEqual(sch, refVal.schema))
|
|
5479
5434
|
throw new Error('id "' + id + '" resolves to more than one schema');
|
|
5480
5435
|
} else if (id != normalizeId(fullPath)) {
|
|
5481
5436
|
if (id[0] == '#') {
|
|
5482
|
-
if (localRefs[id] && !
|
|
5437
|
+
if (localRefs[id] && !fastDeepEqual(sch, localRefs[id]))
|
|
5483
5438
|
throw new Error('id "' + id + '" resolves to more than one schema');
|
|
5484
5439
|
localRefs[id] = sch;
|
|
5485
5440
|
} else {
|
|
@@ -5494,30 +5449,28 @@
|
|
|
5494
5449
|
return localRefs;
|
|
5495
5450
|
}
|
|
5496
5451
|
|
|
5497
|
-
var resolve$2 = resolve_1;
|
|
5498
|
-
|
|
5499
5452
|
var error_classes = {
|
|
5500
|
-
Validation: errorSubclass(ValidationError
|
|
5501
|
-
MissingRef: errorSubclass(MissingRefError
|
|
5453
|
+
Validation: errorSubclass(ValidationError),
|
|
5454
|
+
MissingRef: errorSubclass(MissingRefError)
|
|
5502
5455
|
};
|
|
5503
5456
|
|
|
5504
5457
|
|
|
5505
|
-
function ValidationError
|
|
5458
|
+
function ValidationError(errors) {
|
|
5506
5459
|
this.message = 'validation failed';
|
|
5507
5460
|
this.errors = errors;
|
|
5508
5461
|
this.ajv = this.validation = true;
|
|
5509
5462
|
}
|
|
5510
5463
|
|
|
5511
5464
|
|
|
5512
|
-
MissingRefError
|
|
5465
|
+
MissingRefError.message = function (baseId, ref) {
|
|
5513
5466
|
return 'can\'t resolve reference ' + ref + ' from id ' + baseId;
|
|
5514
5467
|
};
|
|
5515
5468
|
|
|
5516
5469
|
|
|
5517
|
-
function MissingRefError
|
|
5518
|
-
this.message = message || MissingRefError
|
|
5519
|
-
this.missingRef =
|
|
5520
|
-
this.missingSchema =
|
|
5470
|
+
function MissingRefError(baseId, ref, message) {
|
|
5471
|
+
this.message = message || MissingRefError.message(baseId, ref);
|
|
5472
|
+
this.missingRef = resolve_1.url(baseId, ref);
|
|
5473
|
+
this.missingSchema = resolve_1.normalizeId(resolve_1.fullPath(this.missingRef));
|
|
5521
5474
|
}
|
|
5522
5475
|
|
|
5523
5476
|
|
|
@@ -5585,7 +5538,7 @@
|
|
|
5585
5538
|
})(data);
|
|
5586
5539
|
};
|
|
5587
5540
|
|
|
5588
|
-
var validate
|
|
5541
|
+
var validate = function generate_validate(it, $keyword, $ruleType) {
|
|
5589
5542
|
var out = '';
|
|
5590
5543
|
var $async = it.schema.$async === true,
|
|
5591
5544
|
$refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'),
|
|
@@ -5677,7 +5630,7 @@
|
|
|
5677
5630
|
it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema));
|
|
5678
5631
|
it.baseId = it.baseId || it.rootId;
|
|
5679
5632
|
delete it.isTop;
|
|
5680
|
-
it.dataPathArr = [
|
|
5633
|
+
it.dataPathArr = [""];
|
|
5681
5634
|
if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) {
|
|
5682
5635
|
var $defaultMsg = 'default is ignored in the schema root';
|
|
5683
5636
|
if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);
|
|
@@ -5735,47 +5688,39 @@
|
|
|
5735
5688
|
var $schemaPath = it.schemaPath + '.type',
|
|
5736
5689
|
$errSchemaPath = it.errSchemaPath + '/type',
|
|
5737
5690
|
$method = $typeIsArray ? 'checkDataTypes' : 'checkDataType';
|
|
5738
|
-
out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { ';
|
|
5691
|
+
out += ' if (' + (it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true)) + ') { ';
|
|
5739
5692
|
if ($coerceToTypes) {
|
|
5740
5693
|
var $dataType = 'dataType' + $lvl,
|
|
5741
5694
|
$coerced = 'coerced' + $lvl;
|
|
5742
|
-
out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; ';
|
|
5695
|
+
out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; var ' + ($coerced) + ' = undefined; ';
|
|
5743
5696
|
if (it.opts.coerceTypes == 'array') {
|
|
5744
|
-
out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ')) ' + ($dataType) + ' =
|
|
5697
|
+
out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ') && ' + ($data) + '.length == 1) { ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; if (' + (it.util.checkDataType(it.schema.type, $data, it.opts.strictNumbers)) + ') ' + ($coerced) + ' = ' + ($data) + '; } ';
|
|
5745
5698
|
}
|
|
5746
|
-
out += '
|
|
5747
|
-
var $bracesCoercion = '';
|
|
5699
|
+
out += ' if (' + ($coerced) + ' !== undefined) ; ';
|
|
5748
5700
|
var arr1 = $coerceToTypes;
|
|
5749
5701
|
if (arr1) {
|
|
5750
5702
|
var $type, $i = -1,
|
|
5751
5703
|
l1 = arr1.length - 1;
|
|
5752
5704
|
while ($i < l1) {
|
|
5753
5705
|
$type = arr1[$i += 1];
|
|
5754
|
-
if ($i) {
|
|
5755
|
-
out += ' if (' + ($coerced) + ' === undefined) { ';
|
|
5756
|
-
$bracesCoercion += '}';
|
|
5757
|
-
}
|
|
5758
|
-
if (it.opts.coerceTypes == 'array' && $type != 'array') {
|
|
5759
|
-
out += ' if (' + ($dataType) + ' == \'array\' && ' + ($data) + '.length == 1) { ' + ($coerced) + ' = ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; } ';
|
|
5760
|
-
}
|
|
5761
5706
|
if ($type == 'string') {
|
|
5762
|
-
out += ' if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; ';
|
|
5707
|
+
out += ' else if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; ';
|
|
5763
5708
|
} else if ($type == 'number' || $type == 'integer') {
|
|
5764
|
-
out += ' if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' ';
|
|
5709
|
+
out += ' else if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' ';
|
|
5765
5710
|
if ($type == 'integer') {
|
|
5766
5711
|
out += ' && !(' + ($data) + ' % 1)';
|
|
5767
5712
|
}
|
|
5768
5713
|
out += ')) ' + ($coerced) + ' = +' + ($data) + '; ';
|
|
5769
5714
|
} else if ($type == 'boolean') {
|
|
5770
|
-
out += ' if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; ';
|
|
5715
|
+
out += ' else if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; ';
|
|
5771
5716
|
} else if ($type == 'null') {
|
|
5772
|
-
out += ' if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; ';
|
|
5717
|
+
out += ' else if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; ';
|
|
5773
5718
|
} else if (it.opts.coerceTypes == 'array' && $type == 'array') {
|
|
5774
|
-
out += ' if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; ';
|
|
5719
|
+
out += ' else if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; ';
|
|
5775
5720
|
}
|
|
5776
5721
|
}
|
|
5777
5722
|
}
|
|
5778
|
-
out += '
|
|
5723
|
+
out += ' else { ';
|
|
5779
5724
|
var $$outStack = $$outStack || [];
|
|
5780
5725
|
$$outStack.push(out);
|
|
5781
5726
|
out = ''; /* istanbul ignore else */
|
|
@@ -5815,7 +5760,7 @@
|
|
|
5815
5760
|
} else {
|
|
5816
5761
|
out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
|
|
5817
5762
|
}
|
|
5818
|
-
out += ' }
|
|
5763
|
+
out += ' } if (' + ($coerced) + ' !== undefined) { ';
|
|
5819
5764
|
var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
|
|
5820
5765
|
$parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
|
|
5821
5766
|
out += ' ' + ($data) + ' = ' + ($coerced) + '; ';
|
|
@@ -5888,7 +5833,7 @@
|
|
|
5888
5833
|
$rulesGroup = arr2[i2 += 1];
|
|
5889
5834
|
if ($shouldUseGroup($rulesGroup)) {
|
|
5890
5835
|
if ($rulesGroup.type) {
|
|
5891
|
-
out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data)) + ') { ';
|
|
5836
|
+
out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers)) + ') { ';
|
|
5892
5837
|
}
|
|
5893
5838
|
if (it.opts.useDefaults) {
|
|
5894
5839
|
if ($rulesGroup.type == 'object' && it.schema.properties) {
|
|
@@ -6056,10 +6001,6 @@
|
|
|
6056
6001
|
} else {
|
|
6057
6002
|
out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';';
|
|
6058
6003
|
}
|
|
6059
|
-
out = it.util.cleanUpCode(out);
|
|
6060
|
-
if ($top) {
|
|
6061
|
-
out = it.util.finalCleanUpCode(out, $async);
|
|
6062
|
-
}
|
|
6063
6004
|
|
|
6064
6005
|
function $shouldUseGroup($rulesGroup) {
|
|
6065
6006
|
var rules = $rulesGroup.rules;
|
|
@@ -6079,24 +6020,17 @@
|
|
|
6079
6020
|
return out;
|
|
6080
6021
|
};
|
|
6081
6022
|
|
|
6082
|
-
var resolve$1 = resolve_1
|
|
6083
|
-
, util$2 = util$5
|
|
6084
|
-
, errorClasses$1 = error_classes
|
|
6085
|
-
, stableStringify$1 = fastJsonStableStringify;
|
|
6086
|
-
|
|
6087
|
-
var validateGenerator = validate$1;
|
|
6088
|
-
|
|
6089
6023
|
/**
|
|
6090
6024
|
* Functions below are used inside compiled validations function
|
|
6091
6025
|
*/
|
|
6092
6026
|
|
|
6093
|
-
var ucs2length = util
|
|
6094
|
-
|
|
6027
|
+
var ucs2length$1 = util.ucs2length;
|
|
6028
|
+
|
|
6095
6029
|
|
|
6096
6030
|
// this error is thrown by async schemas to return validation errors via exception
|
|
6097
|
-
var ValidationError =
|
|
6031
|
+
var ValidationError$1 = error_classes.Validation;
|
|
6098
6032
|
|
|
6099
|
-
var compile_1 = compile
|
|
6033
|
+
var compile_1 = compile;
|
|
6100
6034
|
|
|
6101
6035
|
|
|
6102
6036
|
/**
|
|
@@ -6108,7 +6042,7 @@
|
|
|
6108
6042
|
* @param {String} baseId base ID for IDs in the schema
|
|
6109
6043
|
* @return {Function} validation function
|
|
6110
6044
|
*/
|
|
6111
|
-
function compile
|
|
6045
|
+
function compile(schema, root, localRefs, baseId) {
|
|
6112
6046
|
/* jshint validthis: true, evil: true */
|
|
6113
6047
|
/* eslint no-shadow: 0 */
|
|
6114
6048
|
var self = this
|
|
@@ -6160,11 +6094,11 @@
|
|
|
6160
6094
|
function localCompile(_schema, _root, localRefs, baseId) {
|
|
6161
6095
|
var isRoot = !_root || (_root && _root.schema == _schema);
|
|
6162
6096
|
if (_root.schema != root.schema)
|
|
6163
|
-
return compile
|
|
6097
|
+
return compile.call(self, _schema, _root, localRefs, baseId);
|
|
6164
6098
|
|
|
6165
6099
|
var $async = _schema.$async === true;
|
|
6166
6100
|
|
|
6167
|
-
var sourceCode =
|
|
6101
|
+
var sourceCode = validate({
|
|
6168
6102
|
isTop: true,
|
|
6169
6103
|
schema: _schema,
|
|
6170
6104
|
isRoot: isRoot,
|
|
@@ -6173,11 +6107,11 @@
|
|
|
6173
6107
|
schemaPath: '',
|
|
6174
6108
|
errSchemaPath: '#',
|
|
6175
6109
|
errorPath: '""',
|
|
6176
|
-
MissingRefError:
|
|
6110
|
+
MissingRefError: error_classes.MissingRef,
|
|
6177
6111
|
RULES: RULES,
|
|
6178
|
-
validate:
|
|
6179
|
-
util: util
|
|
6180
|
-
resolve:
|
|
6112
|
+
validate: validate,
|
|
6113
|
+
util: util,
|
|
6114
|
+
resolve: resolve_1,
|
|
6181
6115
|
resolveRef: resolveRef,
|
|
6182
6116
|
usePattern: usePattern,
|
|
6183
6117
|
useDefault: useDefault,
|
|
@@ -6189,12 +6123,12 @@
|
|
|
6189
6123
|
});
|
|
6190
6124
|
|
|
6191
6125
|
sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode)
|
|
6192
|
-
+ vars(defaults, defaultCode) + vars(customRules, customRuleCode
|
|
6126
|
+
+ vars(defaults, defaultCode) + vars(customRules, customRuleCode)
|
|
6193
6127
|
+ sourceCode;
|
|
6194
6128
|
|
|
6195
|
-
if (opts.processCode) sourceCode = opts.processCode(sourceCode);
|
|
6129
|
+
if (opts.processCode) sourceCode = opts.processCode(sourceCode, _schema);
|
|
6196
6130
|
// console.log('\n\n\n *** \n', JSON.stringify(sourceCode));
|
|
6197
|
-
var validate;
|
|
6131
|
+
var validate$1;
|
|
6198
6132
|
try {
|
|
6199
6133
|
var makeValidate = new Function(
|
|
6200
6134
|
'self',
|
|
@@ -6210,7 +6144,7 @@
|
|
|
6210
6144
|
sourceCode
|
|
6211
6145
|
);
|
|
6212
6146
|
|
|
6213
|
-
validate = makeValidate(
|
|
6147
|
+
validate$1 = makeValidate(
|
|
6214
6148
|
self,
|
|
6215
6149
|
RULES,
|
|
6216
6150
|
formats,
|
|
@@ -6218,36 +6152,36 @@
|
|
|
6218
6152
|
refVal,
|
|
6219
6153
|
defaults,
|
|
6220
6154
|
customRules,
|
|
6221
|
-
|
|
6222
|
-
ucs2length,
|
|
6223
|
-
ValidationError
|
|
6155
|
+
fastDeepEqual,
|
|
6156
|
+
ucs2length$1,
|
|
6157
|
+
ValidationError$1
|
|
6224
6158
|
);
|
|
6225
6159
|
|
|
6226
|
-
refVal[0] = validate;
|
|
6160
|
+
refVal[0] = validate$1;
|
|
6227
6161
|
} catch(e) {
|
|
6228
6162
|
self.logger.error('Error compiling schema, function code:', sourceCode);
|
|
6229
6163
|
throw e;
|
|
6230
6164
|
}
|
|
6231
6165
|
|
|
6232
|
-
validate.schema = _schema;
|
|
6233
|
-
validate.errors = null;
|
|
6234
|
-
validate.refs = refs;
|
|
6235
|
-
validate.refVal = refVal;
|
|
6236
|
-
validate.root = isRoot ? validate : _root;
|
|
6237
|
-
if ($async) validate.$async = true;
|
|
6166
|
+
validate$1.schema = _schema;
|
|
6167
|
+
validate$1.errors = null;
|
|
6168
|
+
validate$1.refs = refs;
|
|
6169
|
+
validate$1.refVal = refVal;
|
|
6170
|
+
validate$1.root = isRoot ? validate$1 : _root;
|
|
6171
|
+
if ($async) validate$1.$async = true;
|
|
6238
6172
|
if (opts.sourceCode === true) {
|
|
6239
|
-
validate.source = {
|
|
6173
|
+
validate$1.source = {
|
|
6240
6174
|
code: sourceCode,
|
|
6241
6175
|
patterns: patterns,
|
|
6242
6176
|
defaults: defaults
|
|
6243
6177
|
};
|
|
6244
6178
|
}
|
|
6245
6179
|
|
|
6246
|
-
return validate;
|
|
6180
|
+
return validate$1;
|
|
6247
6181
|
}
|
|
6248
6182
|
|
|
6249
6183
|
function resolveRef(baseId, ref, isRoot) {
|
|
6250
|
-
ref =
|
|
6184
|
+
ref = resolve_1.url(baseId, ref);
|
|
6251
6185
|
var refIndex = refs[ref];
|
|
6252
6186
|
var _refVal, refCode;
|
|
6253
6187
|
if (refIndex !== undefined) {
|
|
@@ -6265,13 +6199,13 @@
|
|
|
6265
6199
|
}
|
|
6266
6200
|
|
|
6267
6201
|
refCode = addLocalRef(ref);
|
|
6268
|
-
var v =
|
|
6202
|
+
var v = resolve_1.call(self, localCompile, root, ref);
|
|
6269
6203
|
if (v === undefined) {
|
|
6270
6204
|
var localSchema = localRefs && localRefs[ref];
|
|
6271
6205
|
if (localSchema) {
|
|
6272
|
-
v =
|
|
6206
|
+
v = resolve_1.inlineRef(localSchema, opts.inlineRefs)
|
|
6273
6207
|
? localSchema
|
|
6274
|
-
: compile
|
|
6208
|
+
: compile.call(self, localSchema, root, localRefs, baseId);
|
|
6275
6209
|
}
|
|
6276
6210
|
}
|
|
6277
6211
|
|
|
@@ -6320,10 +6254,10 @@
|
|
|
6320
6254
|
case 'number':
|
|
6321
6255
|
return '' + value;
|
|
6322
6256
|
case 'string':
|
|
6323
|
-
return util
|
|
6257
|
+
return util.toQuotedString(value);
|
|
6324
6258
|
case 'object':
|
|
6325
6259
|
if (value === null) return 'null';
|
|
6326
|
-
var valueStr =
|
|
6260
|
+
var valueStr = fastJsonStableStringify(value);
|
|
6327
6261
|
var index = defaultsHash[valueStr];
|
|
6328
6262
|
if (index === undefined) {
|
|
6329
6263
|
index = defaultsHash[valueStr] = defaults.length;
|
|
@@ -6438,7 +6372,7 @@
|
|
|
6438
6372
|
|
|
6439
6373
|
|
|
6440
6374
|
function patternCode(i, patterns) {
|
|
6441
|
-
return 'var pattern' + i + ' = new RegExp(' + util
|
|
6375
|
+
return 'var pattern' + i + ' = new RegExp(' + util.toQuotedString(patterns[i]) + ');';
|
|
6442
6376
|
}
|
|
6443
6377
|
|
|
6444
6378
|
|
|
@@ -6452,7 +6386,7 @@
|
|
|
6452
6386
|
}
|
|
6453
6387
|
|
|
6454
6388
|
|
|
6455
|
-
function customRuleCode
|
|
6389
|
+
function customRuleCode(i) {
|
|
6456
6390
|
return 'var customRule' + i + ' = customRules[' + i + '];';
|
|
6457
6391
|
}
|
|
6458
6392
|
|
|
@@ -6465,38 +6399,38 @@
|
|
|
6465
6399
|
return code;
|
|
6466
6400
|
}
|
|
6467
6401
|
|
|
6468
|
-
var cache =
|
|
6402
|
+
var cache = createCommonjsModule(function (module) {
|
|
6403
|
+
|
|
6469
6404
|
|
|
6470
|
-
var Cache
|
|
6405
|
+
var Cache = module.exports = function Cache() {
|
|
6471
6406
|
this._cache = {};
|
|
6472
6407
|
};
|
|
6473
6408
|
|
|
6474
6409
|
|
|
6475
|
-
Cache
|
|
6410
|
+
Cache.prototype.put = function Cache_put(key, value) {
|
|
6476
6411
|
this._cache[key] = value;
|
|
6477
6412
|
};
|
|
6478
6413
|
|
|
6479
6414
|
|
|
6480
|
-
Cache
|
|
6415
|
+
Cache.prototype.get = function Cache_get(key) {
|
|
6481
6416
|
return this._cache[key];
|
|
6482
6417
|
};
|
|
6483
6418
|
|
|
6484
6419
|
|
|
6485
|
-
Cache
|
|
6420
|
+
Cache.prototype.del = function Cache_del(key) {
|
|
6486
6421
|
delete this._cache[key];
|
|
6487
6422
|
};
|
|
6488
6423
|
|
|
6489
6424
|
|
|
6490
|
-
Cache
|
|
6425
|
+
Cache.prototype.clear = function Cache_clear() {
|
|
6491
6426
|
this._cache = {};
|
|
6492
6427
|
};
|
|
6493
|
-
|
|
6494
|
-
var util$1 = util$5;
|
|
6428
|
+
});
|
|
6495
6429
|
|
|
6496
6430
|
var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
|
|
6497
6431
|
var DAYS = [0,31,28,31,30,31,30,31,31,30,31,30,31];
|
|
6498
|
-
var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d
|
|
6499
|
-
var HOSTNAME = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)
|
|
6432
|
+
var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;
|
|
6433
|
+
var HOSTNAME = /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;
|
|
6500
6434
|
var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
6501
6435
|
var URIREF = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
6502
6436
|
// uri-template: https://tools.ietf.org/html/rfc6570
|
|
@@ -6504,31 +6438,31 @@
|
|
|
6504
6438
|
// For the source: https://gist.github.com/dperini/729294
|
|
6505
6439
|
// For test cases: https://mathiasbynens.be/demo/url-regex
|
|
6506
6440
|
// @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983.
|
|
6507
|
-
// var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]
|
|
6508
|
-
var URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-
|
|
6441
|
+
// var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;
|
|
6442
|
+
var URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i;
|
|
6509
6443
|
var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
|
|
6510
|
-
var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/;
|
|
6444
|
+
var JSON_POINTER$1 = /^(?:\/(?:[^~/]|~0|~1)*)*$/;
|
|
6511
6445
|
var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;
|
|
6512
|
-
var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;
|
|
6446
|
+
var RELATIVE_JSON_POINTER$1 = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;
|
|
6513
6447
|
|
|
6514
6448
|
|
|
6515
|
-
var formats_1 = formats
|
|
6449
|
+
var formats_1 = formats;
|
|
6516
6450
|
|
|
6517
|
-
function formats
|
|
6451
|
+
function formats(mode) {
|
|
6518
6452
|
mode = mode == 'full' ? 'full' : 'fast';
|
|
6519
|
-
return util
|
|
6453
|
+
return util.copy(formats[mode]);
|
|
6520
6454
|
}
|
|
6521
6455
|
|
|
6522
6456
|
|
|
6523
|
-
formats
|
|
6457
|
+
formats.fast = {
|
|
6524
6458
|
// date: http://tools.ietf.org/html/rfc3339#section-5.6
|
|
6525
6459
|
date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/,
|
|
6526
6460
|
// date-time: http://tools.ietf.org/html/rfc3339#section-5.6
|
|
6527
|
-
time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d
|
|
6528
|
-
'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d
|
|
6461
|
+
time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,
|
|
6462
|
+
'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,
|
|
6529
6463
|
// uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
|
|
6530
|
-
uri: /^(?:[a-z][a-z0-9
|
|
6531
|
-
'uri-reference': /^(?:(?:[a-z][a-z0-9
|
|
6464
|
+
uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,
|
|
6465
|
+
'uri-reference': /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
|
|
6532
6466
|
'uri-template': URITEMPLATE,
|
|
6533
6467
|
url: URL,
|
|
6534
6468
|
// email (sources from jsen validator):
|
|
@@ -6545,14 +6479,14 @@
|
|
|
6545
6479
|
uuid: UUID,
|
|
6546
6480
|
// JSON-pointer: https://tools.ietf.org/html/rfc6901
|
|
6547
6481
|
// uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A
|
|
6548
|
-
'json-pointer': JSON_POINTER,
|
|
6482
|
+
'json-pointer': JSON_POINTER$1,
|
|
6549
6483
|
'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,
|
|
6550
6484
|
// relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00
|
|
6551
|
-
'relative-json-pointer': RELATIVE_JSON_POINTER
|
|
6485
|
+
'relative-json-pointer': RELATIVE_JSON_POINTER$1
|
|
6552
6486
|
};
|
|
6553
6487
|
|
|
6554
6488
|
|
|
6555
|
-
formats
|
|
6489
|
+
formats.full = {
|
|
6556
6490
|
date: date,
|
|
6557
6491
|
time: time,
|
|
6558
6492
|
'date-time': date_time,
|
|
@@ -6561,14 +6495,14 @@
|
|
|
6561
6495
|
'uri-template': URITEMPLATE,
|
|
6562
6496
|
url: URL,
|
|
6563
6497
|
email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
|
|
6564
|
-
hostname:
|
|
6498
|
+
hostname: HOSTNAME,
|
|
6565
6499
|
ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
|
|
6566
6500
|
ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,
|
|
6567
6501
|
regex: regex,
|
|
6568
6502
|
uuid: UUID,
|
|
6569
|
-
'json-pointer': JSON_POINTER,
|
|
6503
|
+
'json-pointer': JSON_POINTER$1,
|
|
6570
6504
|
'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,
|
|
6571
|
-
'relative-json-pointer': RELATIVE_JSON_POINTER
|
|
6505
|
+
'relative-json-pointer': RELATIVE_JSON_POINTER$1
|
|
6572
6506
|
};
|
|
6573
6507
|
|
|
6574
6508
|
|
|
@@ -6614,13 +6548,6 @@
|
|
|
6614
6548
|
}
|
|
6615
6549
|
|
|
6616
6550
|
|
|
6617
|
-
function hostname(str) {
|
|
6618
|
-
// https://tools.ietf.org/html/rfc1034#section-3.5
|
|
6619
|
-
// https://tools.ietf.org/html/rfc1123#section-2
|
|
6620
|
-
return str.length <= 255 && HOSTNAME.test(str);
|
|
6621
|
-
}
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
6551
|
var NOT_URI_FRAGMENT = /\/|:/;
|
|
6625
6552
|
function uri(str) {
|
|
6626
6553
|
// http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "."
|
|
@@ -6781,7 +6708,7 @@
|
|
|
6781
6708
|
l1 = arr1.length - 1;
|
|
6782
6709
|
while ($i < l1) {
|
|
6783
6710
|
$sch = arr1[$i += 1];
|
|
6784
|
-
if (it.util.schemaHasRules($sch, it.RULES.all)) {
|
|
6711
|
+
if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
|
|
6785
6712
|
$allSchemasEmpty = false;
|
|
6786
6713
|
$it.schema = $sch;
|
|
6787
6714
|
$it.schemaPath = $schemaPath + '[' + $i + ']';
|
|
@@ -6802,7 +6729,6 @@
|
|
|
6802
6729
|
out += ' ' + ($closingBraces.slice(0, -1)) + ' ';
|
|
6803
6730
|
}
|
|
6804
6731
|
}
|
|
6805
|
-
out = it.util.cleanUpCode(out);
|
|
6806
6732
|
return out;
|
|
6807
6733
|
};
|
|
6808
6734
|
|
|
@@ -6822,7 +6748,7 @@
|
|
|
6822
6748
|
$it.level++;
|
|
6823
6749
|
var $nextValid = 'valid' + $it.level;
|
|
6824
6750
|
var $noEmptySchema = $schema.every(function($sch) {
|
|
6825
|
-
return it.util.schemaHasRules($sch, it.RULES.all);
|
|
6751
|
+
return (it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all));
|
|
6826
6752
|
});
|
|
6827
6753
|
if ($noEmptySchema) {
|
|
6828
6754
|
var $currentBaseId = $it.baseId;
|
|
@@ -6871,7 +6797,6 @@
|
|
|
6871
6797
|
if (it.opts.allErrors) {
|
|
6872
6798
|
out += ' } ';
|
|
6873
6799
|
}
|
|
6874
|
-
out = it.util.cleanUpCode(out);
|
|
6875
6800
|
} else {
|
|
6876
6801
|
if ($breakOnError) {
|
|
6877
6802
|
out += ' if (true) { ';
|
|
@@ -6884,7 +6809,7 @@
|
|
|
6884
6809
|
var out = ' ';
|
|
6885
6810
|
var $schema = it.schema[$keyword];
|
|
6886
6811
|
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
|
|
6887
|
-
!it.opts.allErrors;
|
|
6812
|
+
var $breakOnError = !it.opts.allErrors;
|
|
6888
6813
|
var $comment = it.util.toQuotedString($schema);
|
|
6889
6814
|
if (it.opts.$comment === true) {
|
|
6890
6815
|
out += ' console.log(' + ($comment) + ');';
|
|
@@ -6965,7 +6890,7 @@
|
|
|
6965
6890
|
$dataNxt = $it.dataLevel = it.dataLevel + 1,
|
|
6966
6891
|
$nextData = 'data' + $dataNxt,
|
|
6967
6892
|
$currentBaseId = it.baseId,
|
|
6968
|
-
$nonEmptySchema = it.util.schemaHasRules($schema, it.RULES.all);
|
|
6893
|
+
$nonEmptySchema = (it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all));
|
|
6969
6894
|
out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';
|
|
6970
6895
|
if ($nonEmptySchema) {
|
|
6971
6896
|
var $wasComposite = it.compositeRule;
|
|
@@ -7024,7 +6949,6 @@
|
|
|
7024
6949
|
if (it.opts.allErrors) {
|
|
7025
6950
|
out += ' } ';
|
|
7026
6951
|
}
|
|
7027
|
-
out = it.util.cleanUpCode(out);
|
|
7028
6952
|
return out;
|
|
7029
6953
|
};
|
|
7030
6954
|
|
|
@@ -7046,6 +6970,7 @@
|
|
|
7046
6970
|
$propertyDeps = {},
|
|
7047
6971
|
$ownProperties = it.opts.ownProperties;
|
|
7048
6972
|
for ($property in $schema) {
|
|
6973
|
+
if ($property == '__proto__') continue;
|
|
7049
6974
|
var $sch = $schema[$property];
|
|
7050
6975
|
var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps;
|
|
7051
6976
|
$deps[$property] = $sch;
|
|
@@ -7171,7 +7096,7 @@
|
|
|
7171
7096
|
var $currentBaseId = $it.baseId;
|
|
7172
7097
|
for (var $property in $schemaDeps) {
|
|
7173
7098
|
var $sch = $schemaDeps[$property];
|
|
7174
|
-
if (it.util.schemaHasRules($sch, it.RULES.all)) {
|
|
7099
|
+
if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
|
|
7175
7100
|
out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined ';
|
|
7176
7101
|
if ($ownProperties) {
|
|
7177
7102
|
out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') ';
|
|
@@ -7192,7 +7117,6 @@
|
|
|
7192
7117
|
if ($breakOnError) {
|
|
7193
7118
|
out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
|
|
7194
7119
|
}
|
|
7195
|
-
out = it.util.cleanUpCode(out);
|
|
7196
7120
|
return out;
|
|
7197
7121
|
};
|
|
7198
7122
|
|
|
@@ -7424,8 +7348,8 @@
|
|
|
7424
7348
|
var $nextValid = 'valid' + $it.level;
|
|
7425
7349
|
var $thenSch = it.schema['then'],
|
|
7426
7350
|
$elseSch = it.schema['else'],
|
|
7427
|
-
$thenPresent = $thenSch !== undefined && it.util.schemaHasRules($thenSch, it.RULES.all),
|
|
7428
|
-
$elsePresent = $elseSch !== undefined && it.util.schemaHasRules($elseSch, it.RULES.all),
|
|
7351
|
+
$thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? (typeof $thenSch == 'object' && Object.keys($thenSch).length > 0) || $thenSch === false : it.util.schemaHasRules($thenSch, it.RULES.all)),
|
|
7352
|
+
$elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? (typeof $elseSch == 'object' && Object.keys($elseSch).length > 0) || $elseSch === false : it.util.schemaHasRules($elseSch, it.RULES.all)),
|
|
7429
7353
|
$currentBaseId = $it.baseId;
|
|
7430
7354
|
if ($thenPresent || $elsePresent) {
|
|
7431
7355
|
var $ifClause;
|
|
@@ -7503,7 +7427,6 @@
|
|
|
7503
7427
|
if ($breakOnError) {
|
|
7504
7428
|
out += ' else { ';
|
|
7505
7429
|
}
|
|
7506
|
-
out = it.util.cleanUpCode(out);
|
|
7507
7430
|
} else {
|
|
7508
7431
|
if ($breakOnError) {
|
|
7509
7432
|
out += ' if (true) { ';
|
|
@@ -7579,7 +7502,7 @@
|
|
|
7579
7502
|
l1 = arr1.length - 1;
|
|
7580
7503
|
while ($i < l1) {
|
|
7581
7504
|
$sch = arr1[$i += 1];
|
|
7582
|
-
if (it.util.schemaHasRules($sch, it.RULES.all)) {
|
|
7505
|
+
if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
|
|
7583
7506
|
out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { ';
|
|
7584
7507
|
var $passData = $data + '[' + $i + ']';
|
|
7585
7508
|
$it.schema = $sch;
|
|
@@ -7602,7 +7525,7 @@
|
|
|
7602
7525
|
}
|
|
7603
7526
|
}
|
|
7604
7527
|
}
|
|
7605
|
-
if (typeof $additionalItems == 'object' && it.util.schemaHasRules($additionalItems, it.RULES.all)) {
|
|
7528
|
+
if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? (typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0) || $additionalItems === false : it.util.schemaHasRules($additionalItems, it.RULES.all))) {
|
|
7606
7529
|
$it.schema = $additionalItems;
|
|
7607
7530
|
$it.schemaPath = it.schemaPath + '.additionalItems';
|
|
7608
7531
|
$it.errSchemaPath = it.errSchemaPath + '/additionalItems';
|
|
@@ -7626,7 +7549,7 @@
|
|
|
7626
7549
|
$closingBraces += '}';
|
|
7627
7550
|
}
|
|
7628
7551
|
}
|
|
7629
|
-
} else if (it.util.schemaHasRules($schema, it.RULES.all)) {
|
|
7552
|
+
} else if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {
|
|
7630
7553
|
$it.schema = $schema;
|
|
7631
7554
|
$it.schemaPath = $schemaPath;
|
|
7632
7555
|
$it.errSchemaPath = $errSchemaPath;
|
|
@@ -7649,7 +7572,6 @@
|
|
|
7649
7572
|
if ($breakOnError) {
|
|
7650
7573
|
out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
|
|
7651
7574
|
}
|
|
7652
|
-
out = it.util.cleanUpCode(out);
|
|
7653
7575
|
return out;
|
|
7654
7576
|
};
|
|
7655
7577
|
|
|
@@ -7678,6 +7600,12 @@
|
|
|
7678
7600
|
$op = $isMax ? '<' : '>',
|
|
7679
7601
|
$notOp = $isMax ? '>' : '<',
|
|
7680
7602
|
$errorKeyword = undefined;
|
|
7603
|
+
if (!($isData || typeof $schema == 'number' || $schema === undefined)) {
|
|
7604
|
+
throw new Error($keyword + ' must be number');
|
|
7605
|
+
}
|
|
7606
|
+
if (!($isDataExcl || $schemaExcl === undefined || typeof $schemaExcl == 'number' || typeof $schemaExcl == 'boolean')) {
|
|
7607
|
+
throw new Error($exclusiveKeyword + ' must be number or boolean');
|
|
7608
|
+
}
|
|
7681
7609
|
if ($isDataExcl) {
|
|
7682
7610
|
var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr),
|
|
7683
7611
|
$exclusive = 'exclusive' + $lvl,
|
|
@@ -7828,6 +7756,9 @@
|
|
|
7828
7756
|
} else {
|
|
7829
7757
|
$schemaValue = $schema;
|
|
7830
7758
|
}
|
|
7759
|
+
if (!($isData || typeof $schema == 'number')) {
|
|
7760
|
+
throw new Error($keyword + ' must be number');
|
|
7761
|
+
}
|
|
7831
7762
|
var $op = $keyword == 'maxItems' ? '>' : '<';
|
|
7832
7763
|
out += 'if ( ';
|
|
7833
7764
|
if ($isData) {
|
|
@@ -7905,6 +7836,9 @@
|
|
|
7905
7836
|
} else {
|
|
7906
7837
|
$schemaValue = $schema;
|
|
7907
7838
|
}
|
|
7839
|
+
if (!($isData || typeof $schema == 'number')) {
|
|
7840
|
+
throw new Error($keyword + ' must be number');
|
|
7841
|
+
}
|
|
7908
7842
|
var $op = $keyword == 'maxLength' ? '>' : '<';
|
|
7909
7843
|
out += 'if ( ';
|
|
7910
7844
|
if ($isData) {
|
|
@@ -7987,6 +7921,9 @@
|
|
|
7987
7921
|
} else {
|
|
7988
7922
|
$schemaValue = $schema;
|
|
7989
7923
|
}
|
|
7924
|
+
if (!($isData || typeof $schema == 'number')) {
|
|
7925
|
+
throw new Error($keyword + ' must be number');
|
|
7926
|
+
}
|
|
7990
7927
|
var $op = $keyword == 'maxProperties' ? '>' : '<';
|
|
7991
7928
|
out += 'if ( ';
|
|
7992
7929
|
if ($isData) {
|
|
@@ -8063,6 +8000,9 @@
|
|
|
8063
8000
|
} else {
|
|
8064
8001
|
$schemaValue = $schema;
|
|
8065
8002
|
}
|
|
8003
|
+
if (!($isData || typeof $schema == 'number')) {
|
|
8004
|
+
throw new Error($keyword + ' must be number');
|
|
8005
|
+
}
|
|
8066
8006
|
out += 'var division' + ($lvl) + ';if (';
|
|
8067
8007
|
if ($isData) {
|
|
8068
8008
|
out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || ';
|
|
@@ -8136,7 +8076,7 @@
|
|
|
8136
8076
|
var $it = it.util.copy(it);
|
|
8137
8077
|
$it.level++;
|
|
8138
8078
|
var $nextValid = 'valid' + $it.level;
|
|
8139
|
-
if (it.util.schemaHasRules($schema, it.RULES.all)) {
|
|
8079
|
+
if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {
|
|
8140
8080
|
$it.schema = $schema;
|
|
8141
8081
|
$it.schemaPath = $schemaPath;
|
|
8142
8082
|
$it.errSchemaPath = $errSchemaPath;
|
|
@@ -8234,7 +8174,7 @@
|
|
|
8234
8174
|
l1 = arr1.length - 1;
|
|
8235
8175
|
while ($i < l1) {
|
|
8236
8176
|
$sch = arr1[$i += 1];
|
|
8237
|
-
if (it.util.schemaHasRules($sch, it.RULES.all)) {
|
|
8177
|
+
if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
|
|
8238
8178
|
$it.schema = $sch;
|
|
8239
8179
|
$it.schemaPath = $schemaPath + '[' + $i + ']';
|
|
8240
8180
|
$it.errSchemaPath = $errSchemaPath + '/' + $i;
|
|
@@ -8355,7 +8295,7 @@
|
|
|
8355
8295
|
return out;
|
|
8356
8296
|
};
|
|
8357
8297
|
|
|
8358
|
-
var properties
|
|
8298
|
+
var properties = function generate_properties(it, $keyword, $ruleType) {
|
|
8359
8299
|
var out = ' ';
|
|
8360
8300
|
var $lvl = it.level;
|
|
8361
8301
|
var $dataLvl = it.dataLevel;
|
|
@@ -8374,9 +8314,9 @@
|
|
|
8374
8314
|
$dataNxt = $it.dataLevel = it.dataLevel + 1,
|
|
8375
8315
|
$nextData = 'data' + $dataNxt,
|
|
8376
8316
|
$dataProperties = 'dataProperties' + $lvl;
|
|
8377
|
-
var $schemaKeys = Object.keys($schema || {}),
|
|
8317
|
+
var $schemaKeys = Object.keys($schema || {}).filter(notProto),
|
|
8378
8318
|
$pProperties = it.schema.patternProperties || {},
|
|
8379
|
-
$pPropertyKeys = Object.keys($pProperties),
|
|
8319
|
+
$pPropertyKeys = Object.keys($pProperties).filter(notProto),
|
|
8380
8320
|
$aProperties = it.schema.additionalProperties,
|
|
8381
8321
|
$someProperties = $schemaKeys.length || $pPropertyKeys.length,
|
|
8382
8322
|
$noAdditional = $aProperties === false,
|
|
@@ -8386,7 +8326,13 @@
|
|
|
8386
8326
|
$ownProperties = it.opts.ownProperties,
|
|
8387
8327
|
$currentBaseId = it.baseId;
|
|
8388
8328
|
var $required = it.schema.required;
|
|
8389
|
-
if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired)
|
|
8329
|
+
if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) {
|
|
8330
|
+
var $requiredHash = it.util.toHash($required);
|
|
8331
|
+
}
|
|
8332
|
+
|
|
8333
|
+
function notProto(p) {
|
|
8334
|
+
return p !== '__proto__';
|
|
8335
|
+
}
|
|
8390
8336
|
out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;';
|
|
8391
8337
|
if ($ownProperties) {
|
|
8392
8338
|
out += ' var ' + ($dataProperties) + ' = undefined;';
|
|
@@ -8539,7 +8485,7 @@
|
|
|
8539
8485
|
while (i3 < l3) {
|
|
8540
8486
|
$propertyKey = arr3[i3 += 1];
|
|
8541
8487
|
var $sch = $schema[$propertyKey];
|
|
8542
|
-
if (it.util.schemaHasRules($sch, it.RULES.all)) {
|
|
8488
|
+
if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
|
|
8543
8489
|
var $prop = it.util.getProperty($propertyKey),
|
|
8544
8490
|
$passData = $data + $prop,
|
|
8545
8491
|
$hasDefault = $useDefaults && $sch.default !== undefined;
|
|
@@ -8642,7 +8588,7 @@
|
|
|
8642
8588
|
while (i4 < l4) {
|
|
8643
8589
|
$pProperty = arr4[i4 += 1];
|
|
8644
8590
|
var $sch = $pProperties[$pProperty];
|
|
8645
|
-
if (it.util.schemaHasRules($sch, it.RULES.all)) {
|
|
8591
|
+
if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
|
|
8646
8592
|
$it.schema = $sch;
|
|
8647
8593
|
$it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty);
|
|
8648
8594
|
$it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty);
|
|
@@ -8681,7 +8627,6 @@
|
|
|
8681
8627
|
if ($breakOnError) {
|
|
8682
8628
|
out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
|
|
8683
8629
|
}
|
|
8684
|
-
out = it.util.cleanUpCode(out);
|
|
8685
8630
|
return out;
|
|
8686
8631
|
};
|
|
8687
8632
|
|
|
@@ -8700,7 +8645,7 @@
|
|
|
8700
8645
|
$it.level++;
|
|
8701
8646
|
var $nextValid = 'valid' + $it.level;
|
|
8702
8647
|
out += 'var ' + ($errs) + ' = errors;';
|
|
8703
|
-
if (it.util.schemaHasRules($schema, it.RULES.all)) {
|
|
8648
|
+
if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {
|
|
8704
8649
|
$it.schema = $schema;
|
|
8705
8650
|
$it.schemaPath = $schemaPath;
|
|
8706
8651
|
$it.errSchemaPath = $errSchemaPath;
|
|
@@ -8763,11 +8708,10 @@
|
|
|
8763
8708
|
if ($breakOnError) {
|
|
8764
8709
|
out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
|
|
8765
8710
|
}
|
|
8766
|
-
out = it.util.cleanUpCode(out);
|
|
8767
8711
|
return out;
|
|
8768
8712
|
};
|
|
8769
8713
|
|
|
8770
|
-
var required
|
|
8714
|
+
var required = function generate_required(it, $keyword, $ruleType) {
|
|
8771
8715
|
var out = ' ';
|
|
8772
8716
|
var $lvl = it.level;
|
|
8773
8717
|
var $dataLvl = it.dataLevel;
|
|
@@ -8792,7 +8736,7 @@
|
|
|
8792
8736
|
while (i1 < l1) {
|
|
8793
8737
|
$property = arr1[i1 += 1];
|
|
8794
8738
|
var $propertySch = it.schema.properties[$property];
|
|
8795
|
-
if (!($propertySch && it.util.schemaHasRules($propertySch, it.RULES.all))) {
|
|
8739
|
+
if (!($propertySch && (it.opts.strictKeywords ? (typeof $propertySch == 'object' && Object.keys($propertySch).length > 0) || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) {
|
|
8796
8740
|
$required[$required.length] = $property;
|
|
8797
8741
|
}
|
|
8798
8742
|
}
|
|
@@ -9063,7 +9007,7 @@
|
|
|
9063
9007
|
} else {
|
|
9064
9008
|
out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; ';
|
|
9065
9009
|
var $method = 'checkDataType' + ($typeIsArray ? 's' : '');
|
|
9066
|
-
out += ' if (' + (it.util[$method]($itemType, 'item', true)) + ') continue; ';
|
|
9010
|
+
out += ' if (' + (it.util[$method]($itemType, 'item', it.opts.strictNumbers, true)) + ') continue; ';
|
|
9067
9011
|
if ($typeIsArray) {
|
|
9068
9012
|
out += ' if (typeof item == \'string\') item = \'"\' + item; ';
|
|
9069
9013
|
}
|
|
@@ -9144,17 +9088,16 @@
|
|
|
9144
9088
|
not: not,
|
|
9145
9089
|
oneOf: oneOf,
|
|
9146
9090
|
pattern: pattern,
|
|
9147
|
-
properties: properties
|
|
9091
|
+
properties: properties,
|
|
9148
9092
|
propertyNames: propertyNames,
|
|
9149
|
-
required: required
|
|
9093
|
+
required: required,
|
|
9150
9094
|
uniqueItems: uniqueItems,
|
|
9151
|
-
validate: validate
|
|
9095
|
+
validate: validate
|
|
9152
9096
|
};
|
|
9153
9097
|
|
|
9154
|
-
var
|
|
9155
|
-
, toHash = util$5.toHash;
|
|
9098
|
+
var toHash$1 = util.toHash;
|
|
9156
9099
|
|
|
9157
|
-
var rules
|
|
9100
|
+
var rules = function rules() {
|
|
9158
9101
|
var RULES = [
|
|
9159
9102
|
{ type: 'number',
|
|
9160
9103
|
rules: [ { 'maximum': ['exclusiveMaximum'] },
|
|
@@ -9178,8 +9121,8 @@
|
|
|
9178
9121
|
'additionalItems', 'then', 'else'
|
|
9179
9122
|
];
|
|
9180
9123
|
var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ];
|
|
9181
|
-
RULES.all = toHash(ALL);
|
|
9182
|
-
RULES.types = toHash(TYPES);
|
|
9124
|
+
RULES.all = toHash$1(ALL);
|
|
9125
|
+
RULES.types = toHash$1(TYPES);
|
|
9183
9126
|
|
|
9184
9127
|
RULES.forEach(function (group) {
|
|
9185
9128
|
group.rules = group.rules.map(function (keyword) {
|
|
@@ -9196,7 +9139,7 @@
|
|
|
9196
9139
|
ALL.push(keyword);
|
|
9197
9140
|
var rule = RULES.all[keyword] = {
|
|
9198
9141
|
keyword: keyword,
|
|
9199
|
-
code:
|
|
9142
|
+
code: dotjs[keyword],
|
|
9200
9143
|
implements: implKeywords
|
|
9201
9144
|
};
|
|
9202
9145
|
return rule;
|
|
@@ -9204,13 +9147,13 @@
|
|
|
9204
9147
|
|
|
9205
9148
|
RULES.all.$comment = {
|
|
9206
9149
|
keyword: '$comment',
|
|
9207
|
-
code:
|
|
9150
|
+
code: dotjs.$comment
|
|
9208
9151
|
};
|
|
9209
9152
|
|
|
9210
9153
|
if (group.type) RULES.types[group.type] = group;
|
|
9211
9154
|
});
|
|
9212
9155
|
|
|
9213
|
-
RULES.keywords = toHash(ALL.concat(KEYWORDS));
|
|
9156
|
+
RULES.keywords = toHash$1(ALL.concat(KEYWORDS));
|
|
9214
9157
|
RULES.custom = {};
|
|
9215
9158
|
|
|
9216
9159
|
return RULES;
|
|
@@ -9254,7 +9197,7 @@
|
|
|
9254
9197
|
keywords[key] = {
|
|
9255
9198
|
anyOf: [
|
|
9256
9199
|
schema,
|
|
9257
|
-
{ $ref: 'https://raw.githubusercontent.com/
|
|
9200
|
+
{ $ref: 'https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#' }
|
|
9258
9201
|
]
|
|
9259
9202
|
};
|
|
9260
9203
|
}
|
|
@@ -9264,7 +9207,7 @@
|
|
|
9264
9207
|
return metaSchema;
|
|
9265
9208
|
};
|
|
9266
9209
|
|
|
9267
|
-
var MissingRefError = error_classes.MissingRef;
|
|
9210
|
+
var MissingRefError$1 = error_classes.MissingRef;
|
|
9268
9211
|
|
|
9269
9212
|
var async = compileAsync;
|
|
9270
9213
|
|
|
@@ -9317,7 +9260,7 @@
|
|
|
9317
9260
|
function _compileAsync(schemaObj) {
|
|
9318
9261
|
try { return self._compile(schemaObj); }
|
|
9319
9262
|
catch(e) {
|
|
9320
|
-
if (e instanceof MissingRefError) return loadMissingSchema(e);
|
|
9263
|
+
if (e instanceof MissingRefError$1) return loadMissingSchema(e);
|
|
9321
9264
|
throw e;
|
|
9322
9265
|
}
|
|
9323
9266
|
|
|
@@ -9581,10 +9524,10 @@
|
|
|
9581
9524
|
return out;
|
|
9582
9525
|
};
|
|
9583
9526
|
|
|
9584
|
-
var $schema
|
|
9585
|
-
var $id
|
|
9527
|
+
var $schema = "http://json-schema.org/draft-07/schema#";
|
|
9528
|
+
var $id = "http://json-schema.org/draft-07/schema#";
|
|
9586
9529
|
var title = "Core schema meta-schema";
|
|
9587
|
-
var definitions
|
|
9530
|
+
var definitions = {
|
|
9588
9531
|
schemaArray: {
|
|
9589
9532
|
type: "array",
|
|
9590
9533
|
minItems: 1,
|
|
@@ -9627,7 +9570,7 @@
|
|
|
9627
9570
|
]
|
|
9628
9571
|
}
|
|
9629
9572
|
};
|
|
9630
|
-
var type
|
|
9573
|
+
var type = [
|
|
9631
9574
|
"object",
|
|
9632
9575
|
"boolean"
|
|
9633
9576
|
];
|
|
@@ -9823,30 +9766,33 @@
|
|
|
9823
9766
|
$ref: "#"
|
|
9824
9767
|
}
|
|
9825
9768
|
};
|
|
9826
|
-
var
|
|
9827
|
-
$schema: $schema
|
|
9828
|
-
$id: $id
|
|
9769
|
+
var jsonSchemaDraft07 = {
|
|
9770
|
+
$schema: $schema,
|
|
9771
|
+
$id: $id,
|
|
9829
9772
|
title: title,
|
|
9830
|
-
definitions: definitions
|
|
9831
|
-
type: type
|
|
9773
|
+
definitions: definitions,
|
|
9774
|
+
type: type,
|
|
9832
9775
|
properties: properties$1,
|
|
9833
9776
|
"default": true
|
|
9834
9777
|
};
|
|
9835
9778
|
|
|
9836
|
-
var
|
|
9837
|
-
|
|
9838
|
-
|
|
9779
|
+
var jsonSchemaDraft07$1 = /*#__PURE__*/Object.freeze({
|
|
9780
|
+
__proto__: null,
|
|
9781
|
+
$schema: $schema,
|
|
9782
|
+
$id: $id,
|
|
9783
|
+
title: title,
|
|
9784
|
+
definitions: definitions,
|
|
9785
|
+
type: type,
|
|
9786
|
+
properties: properties$1,
|
|
9787
|
+
'default': jsonSchemaDraft07
|
|
9788
|
+
});
|
|
9839
9789
|
|
|
9840
|
-
var
|
|
9841
|
-
add: addKeyword,
|
|
9842
|
-
get: getKeyword,
|
|
9843
|
-
remove: removeKeyword,
|
|
9844
|
-
validate: validateKeyword
|
|
9845
|
-
};
|
|
9790
|
+
var require$$2 = getCjsExportFromNamespace(jsonSchemaDraft07$1);
|
|
9846
9791
|
|
|
9847
|
-
var
|
|
9792
|
+
var definition_schema = {
|
|
9793
|
+
$id: 'https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js',
|
|
9848
9794
|
definitions: {
|
|
9849
|
-
simpleTypes:
|
|
9795
|
+
simpleTypes: require$$2.definitions.simpleTypes
|
|
9850
9796
|
},
|
|
9851
9797
|
type: 'object',
|
|
9852
9798
|
dependencies: {
|
|
@@ -9856,7 +9802,7 @@
|
|
|
9856
9802
|
valid: {not: {required: ['macro']}}
|
|
9857
9803
|
},
|
|
9858
9804
|
properties: {
|
|
9859
|
-
type:
|
|
9805
|
+
type: require$$2.properties.type,
|
|
9860
9806
|
schema: {type: 'boolean'},
|
|
9861
9807
|
statements: {type: 'boolean'},
|
|
9862
9808
|
dependencies: {
|
|
@@ -9877,6 +9823,18 @@
|
|
|
9877
9823
|
}
|
|
9878
9824
|
};
|
|
9879
9825
|
|
|
9826
|
+
var IDENTIFIER$1 = /^[a-z_$][a-z0-9_$-]*$/i;
|
|
9827
|
+
|
|
9828
|
+
|
|
9829
|
+
|
|
9830
|
+
var keyword = {
|
|
9831
|
+
add: addKeyword,
|
|
9832
|
+
get: getKeyword,
|
|
9833
|
+
remove: removeKeyword,
|
|
9834
|
+
validate: validateKeyword
|
|
9835
|
+
};
|
|
9836
|
+
|
|
9837
|
+
|
|
9880
9838
|
/**
|
|
9881
9839
|
* Define custom keyword
|
|
9882
9840
|
* @this Ajv
|
|
@@ -9891,7 +9849,7 @@
|
|
|
9891
9849
|
if (RULES.keywords[keyword])
|
|
9892
9850
|
throw new Error('Keyword ' + keyword + ' is already defined');
|
|
9893
9851
|
|
|
9894
|
-
if (!IDENTIFIER.test(keyword))
|
|
9852
|
+
if (!IDENTIFIER$1.test(keyword))
|
|
9895
9853
|
throw new Error('Keyword ' + keyword + ' is not a valid identifier');
|
|
9896
9854
|
|
|
9897
9855
|
if (definition) {
|
|
@@ -9911,7 +9869,7 @@
|
|
|
9911
9869
|
metaSchema = {
|
|
9912
9870
|
anyOf: [
|
|
9913
9871
|
metaSchema,
|
|
9914
|
-
{ '$ref': 'https://raw.githubusercontent.com/
|
|
9872
|
+
{ '$ref': 'https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#' }
|
|
9915
9873
|
]
|
|
9916
9874
|
};
|
|
9917
9875
|
}
|
|
@@ -9941,7 +9899,7 @@
|
|
|
9941
9899
|
keyword: keyword,
|
|
9942
9900
|
definition: definition,
|
|
9943
9901
|
custom: true,
|
|
9944
|
-
code:
|
|
9902
|
+
code: custom,
|
|
9945
9903
|
implements: definition.implements
|
|
9946
9904
|
};
|
|
9947
9905
|
ruleGroup.rules.push(rule);
|
|
@@ -10000,7 +9958,7 @@
|
|
|
10000
9958
|
function validateKeyword(definition, throwError) {
|
|
10001
9959
|
validateKeyword.errors = null;
|
|
10002
9960
|
var v = this._validateKeyword = this._validateKeyword
|
|
10003
|
-
|| this.compile(
|
|
9961
|
+
|| this.compile(definition_schema, true);
|
|
10004
9962
|
|
|
10005
9963
|
if (v(definition)) return true;
|
|
10006
9964
|
validateKeyword.errors = v.errors;
|
|
@@ -10011,13 +9969,13 @@
|
|
|
10011
9969
|
}
|
|
10012
9970
|
|
|
10013
9971
|
var $schema$1 = "http://json-schema.org/draft-07/schema#";
|
|
10014
|
-
var $id = "https://raw.githubusercontent.com/
|
|
9972
|
+
var $id$1 = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#";
|
|
10015
9973
|
var description = "Meta-schema for $data reference (JSON Schema extension proposal)";
|
|
10016
|
-
var type = "object";
|
|
10017
|
-
var required = [
|
|
9974
|
+
var type$1 = "object";
|
|
9975
|
+
var required$1 = [
|
|
10018
9976
|
"$data"
|
|
10019
9977
|
];
|
|
10020
|
-
var properties = {
|
|
9978
|
+
var properties$2 = {
|
|
10021
9979
|
$data: {
|
|
10022
9980
|
type: "string",
|
|
10023
9981
|
anyOf: [
|
|
@@ -10031,52 +9989,56 @@
|
|
|
10031
9989
|
}
|
|
10032
9990
|
};
|
|
10033
9991
|
var additionalProperties = false;
|
|
10034
|
-
var
|
|
9992
|
+
var data$1 = {
|
|
10035
9993
|
$schema: $schema$1,
|
|
10036
|
-
$id: $id,
|
|
9994
|
+
$id: $id$1,
|
|
10037
9995
|
description: description,
|
|
10038
|
-
type: type,
|
|
10039
|
-
required: required,
|
|
10040
|
-
properties: properties,
|
|
9996
|
+
type: type$1,
|
|
9997
|
+
required: required$1,
|
|
9998
|
+
properties: properties$2,
|
|
10041
9999
|
additionalProperties: additionalProperties
|
|
10042
10000
|
};
|
|
10043
10001
|
|
|
10044
|
-
var
|
|
10045
|
-
|
|
10046
|
-
|
|
10047
|
-
|
|
10048
|
-
|
|
10049
|
-
|
|
10050
|
-
|
|
10051
|
-
|
|
10052
|
-
|
|
10053
|
-
|
|
10054
|
-
|
|
10055
|
-
|
|
10056
|
-
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10060
|
-
Ajv
|
|
10061
|
-
Ajv
|
|
10062
|
-
Ajv
|
|
10063
|
-
Ajv
|
|
10064
|
-
Ajv
|
|
10065
|
-
|
|
10066
|
-
Ajv
|
|
10067
|
-
Ajv
|
|
10068
|
-
|
|
10069
|
-
|
|
10070
|
-
|
|
10071
|
-
Ajv
|
|
10072
|
-
|
|
10073
|
-
Ajv
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
Ajv
|
|
10078
|
-
Ajv
|
|
10079
|
-
|
|
10002
|
+
var data$2 = /*#__PURE__*/Object.freeze({
|
|
10003
|
+
__proto__: null,
|
|
10004
|
+
$schema: $schema$1,
|
|
10005
|
+
$id: $id$1,
|
|
10006
|
+
description: description,
|
|
10007
|
+
type: type$1,
|
|
10008
|
+
required: required$1,
|
|
10009
|
+
properties: properties$2,
|
|
10010
|
+
additionalProperties: additionalProperties,
|
|
10011
|
+
'default': data$1
|
|
10012
|
+
});
|
|
10013
|
+
|
|
10014
|
+
var require$$1 = getCjsExportFromNamespace(data$2);
|
|
10015
|
+
|
|
10016
|
+
var ajv = Ajv;
|
|
10017
|
+
|
|
10018
|
+
Ajv.prototype.validate = validate$1;
|
|
10019
|
+
Ajv.prototype.compile = compile$1;
|
|
10020
|
+
Ajv.prototype.addSchema = addSchema;
|
|
10021
|
+
Ajv.prototype.addMetaSchema = addMetaSchema;
|
|
10022
|
+
Ajv.prototype.validateSchema = validateSchema;
|
|
10023
|
+
Ajv.prototype.getSchema = getSchema;
|
|
10024
|
+
Ajv.prototype.removeSchema = removeSchema;
|
|
10025
|
+
Ajv.prototype.addFormat = addFormat;
|
|
10026
|
+
Ajv.prototype.errorsText = errorsText;
|
|
10027
|
+
|
|
10028
|
+
Ajv.prototype._addSchema = _addSchema;
|
|
10029
|
+
Ajv.prototype._compile = _compile;
|
|
10030
|
+
|
|
10031
|
+
Ajv.prototype.compileAsync = async;
|
|
10032
|
+
|
|
10033
|
+
Ajv.prototype.addKeyword = keyword.add;
|
|
10034
|
+
Ajv.prototype.getKeyword = keyword.get;
|
|
10035
|
+
Ajv.prototype.removeKeyword = keyword.remove;
|
|
10036
|
+
Ajv.prototype.validateKeyword = keyword.validate;
|
|
10037
|
+
|
|
10038
|
+
|
|
10039
|
+
Ajv.ValidationError = error_classes.Validation;
|
|
10040
|
+
Ajv.MissingRefError = error_classes.MissingRef;
|
|
10041
|
+
Ajv.$dataMetaSchema = data;
|
|
10080
10042
|
|
|
10081
10043
|
var META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema';
|
|
10082
10044
|
|
|
@@ -10089,16 +10051,16 @@
|
|
|
10089
10051
|
* @param {Object} opts optional options
|
|
10090
10052
|
* @return {Object} ajv instance
|
|
10091
10053
|
*/
|
|
10092
|
-
function Ajv
|
|
10093
|
-
if (!(this instanceof Ajv
|
|
10054
|
+
function Ajv(opts) {
|
|
10055
|
+
if (!(this instanceof Ajv)) return new Ajv(opts);
|
|
10094
10056
|
opts = this._opts = util.copy(opts) || {};
|
|
10095
10057
|
setLogger(this);
|
|
10096
10058
|
this._schemas = {};
|
|
10097
10059
|
this._refs = {};
|
|
10098
10060
|
this._fragments = {};
|
|
10099
|
-
this._formats =
|
|
10061
|
+
this._formats = formats_1(opts.format);
|
|
10100
10062
|
|
|
10101
|
-
this._cache = opts.cache || new
|
|
10063
|
+
this._cache = opts.cache || new cache;
|
|
10102
10064
|
this._loadingSchemas = {};
|
|
10103
10065
|
this._compilations = [];
|
|
10104
10066
|
this.RULES = rules();
|
|
@@ -10106,10 +10068,11 @@
|
|
|
10106
10068
|
|
|
10107
10069
|
opts.loopRequired = opts.loopRequired || Infinity;
|
|
10108
10070
|
if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true;
|
|
10109
|
-
if (opts.serialize === undefined) opts.serialize =
|
|
10071
|
+
if (opts.serialize === undefined) opts.serialize = fastJsonStableStringify;
|
|
10110
10072
|
this._metaOpts = getMetaSchemaOptions(this);
|
|
10111
10073
|
|
|
10112
10074
|
if (opts.formats) addInitialFormats(this);
|
|
10075
|
+
if (opts.keywords) addInitialKeywords(this);
|
|
10113
10076
|
addDefaultMetaSchema(this);
|
|
10114
10077
|
if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta);
|
|
10115
10078
|
if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}});
|
|
@@ -10126,7 +10089,7 @@
|
|
|
10126
10089
|
* @param {Any} data to be validated
|
|
10127
10090
|
* @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`).
|
|
10128
10091
|
*/
|
|
10129
|
-
function validate(schemaKeyRef, data) {
|
|
10092
|
+
function validate$1(schemaKeyRef, data) {
|
|
10130
10093
|
var v;
|
|
10131
10094
|
if (typeof schemaKeyRef == 'string') {
|
|
10132
10095
|
v = this.getSchema(schemaKeyRef);
|
|
@@ -10149,7 +10112,7 @@
|
|
|
10149
10112
|
* @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords.
|
|
10150
10113
|
* @return {Function} validating function
|
|
10151
10114
|
*/
|
|
10152
|
-
function compile(schema, _meta) {
|
|
10115
|
+
function compile$1(schema, _meta) {
|
|
10153
10116
|
var schemaObj = this._addSchema(schema, undefined, _meta);
|
|
10154
10117
|
return schemaObj.validate || this._compile(schemaObj);
|
|
10155
10118
|
}
|
|
@@ -10172,7 +10135,7 @@
|
|
|
10172
10135
|
var id = this._getId(schema);
|
|
10173
10136
|
if (id !== undefined && typeof id != 'string')
|
|
10174
10137
|
throw new Error('schema id must be string');
|
|
10175
|
-
key =
|
|
10138
|
+
key = resolve_1.normalizeId(key || id);
|
|
10176
10139
|
checkUnique(this, key);
|
|
10177
10140
|
this._schemas[key] = this._addSchema(schema, _skipValidation, _meta, true);
|
|
10178
10141
|
return this;
|
|
@@ -10249,13 +10212,13 @@
|
|
|
10249
10212
|
|
|
10250
10213
|
|
|
10251
10214
|
function _getSchemaFragment(self, ref) {
|
|
10252
|
-
var res =
|
|
10215
|
+
var res = resolve_1.schema.call(self, { schema: {} }, ref);
|
|
10253
10216
|
if (res) {
|
|
10254
10217
|
var schema = res.schema
|
|
10255
10218
|
, root = res.root
|
|
10256
10219
|
, baseId = res.baseId;
|
|
10257
|
-
var v =
|
|
10258
|
-
self._fragments[ref] = new
|
|
10220
|
+
var v = compile_1.call(self, schema, root, undefined, baseId);
|
|
10221
|
+
self._fragments[ref] = new schema_obj({
|
|
10259
10222
|
ref: ref,
|
|
10260
10223
|
fragment: true,
|
|
10261
10224
|
schema: schema,
|
|
@@ -10269,7 +10232,7 @@
|
|
|
10269
10232
|
|
|
10270
10233
|
|
|
10271
10234
|
function _getSchemaObj(self, keyRef) {
|
|
10272
|
-
keyRef =
|
|
10235
|
+
keyRef = resolve_1.normalizeId(keyRef);
|
|
10273
10236
|
return self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef];
|
|
10274
10237
|
}
|
|
10275
10238
|
|
|
@@ -10307,7 +10270,7 @@
|
|
|
10307
10270
|
this._cache.del(cacheKey);
|
|
10308
10271
|
var id = this._getId(schemaKeyRef);
|
|
10309
10272
|
if (id) {
|
|
10310
|
-
id =
|
|
10273
|
+
id = resolve_1.normalizeId(id);
|
|
10311
10274
|
delete this._schemas[id];
|
|
10312
10275
|
delete this._refs[id];
|
|
10313
10276
|
}
|
|
@@ -10338,17 +10301,17 @@
|
|
|
10338
10301
|
|
|
10339
10302
|
shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false;
|
|
10340
10303
|
|
|
10341
|
-
var id =
|
|
10304
|
+
var id = resolve_1.normalizeId(this._getId(schema));
|
|
10342
10305
|
if (id && shouldAddSchema) checkUnique(this, id);
|
|
10343
10306
|
|
|
10344
10307
|
var willValidate = this._opts.validateSchema !== false && !skipValidation;
|
|
10345
10308
|
var recursiveMeta;
|
|
10346
|
-
if (willValidate && !(recursiveMeta = id && id ==
|
|
10309
|
+
if (willValidate && !(recursiveMeta = id && id == resolve_1.normalizeId(schema.$schema)))
|
|
10347
10310
|
this.validateSchema(schema, true);
|
|
10348
10311
|
|
|
10349
|
-
var localRefs =
|
|
10312
|
+
var localRefs = resolve_1.ids.call(this, schema);
|
|
10350
10313
|
|
|
10351
|
-
var schemaObj = new
|
|
10314
|
+
var schemaObj = new schema_obj({
|
|
10352
10315
|
id: id,
|
|
10353
10316
|
schema: schema,
|
|
10354
10317
|
localRefs: localRefs,
|
|
@@ -10385,7 +10348,7 @@
|
|
|
10385
10348
|
}
|
|
10386
10349
|
|
|
10387
10350
|
var v;
|
|
10388
|
-
try { v =
|
|
10351
|
+
try { v = compile_1.call(this, schemaObj.schema, root, schemaObj.localRefs); }
|
|
10389
10352
|
catch(e) {
|
|
10390
10353
|
delete schemaObj.validate;
|
|
10391
10354
|
throw e;
|
|
@@ -10481,12 +10444,12 @@
|
|
|
10481
10444
|
function addDefaultMetaSchema(self) {
|
|
10482
10445
|
var $dataSchema;
|
|
10483
10446
|
if (self._opts.$data) {
|
|
10484
|
-
$dataSchema = require$$
|
|
10447
|
+
$dataSchema = require$$1;
|
|
10485
10448
|
self.addMetaSchema($dataSchema, $dataSchema.$id, true);
|
|
10486
10449
|
}
|
|
10487
10450
|
if (self._opts.meta === false) return;
|
|
10488
|
-
var metaSchema = require$$
|
|
10489
|
-
if (self._opts.$data) metaSchema =
|
|
10451
|
+
var metaSchema = require$$2;
|
|
10452
|
+
if (self._opts.$data) metaSchema = data(metaSchema, META_SUPPORT_DATA);
|
|
10490
10453
|
self.addMetaSchema(metaSchema, META_SCHEMA_ID, true);
|
|
10491
10454
|
self._refs['http://json-schema.org/schema'] = META_SCHEMA_ID;
|
|
10492
10455
|
}
|
|
@@ -10508,6 +10471,14 @@
|
|
|
10508
10471
|
}
|
|
10509
10472
|
|
|
10510
10473
|
|
|
10474
|
+
function addInitialKeywords(self) {
|
|
10475
|
+
for (var name in self._opts.keywords) {
|
|
10476
|
+
var keyword = self._opts.keywords[name];
|
|
10477
|
+
self.addKeyword(name, keyword);
|
|
10478
|
+
}
|
|
10479
|
+
}
|
|
10480
|
+
|
|
10481
|
+
|
|
10511
10482
|
function checkUnique(self, id) {
|
|
10512
10483
|
if (self._schemas[id] || self._refs[id])
|
|
10513
10484
|
throw new Error('schema with key or id "' + id + '" already exists');
|
|
@@ -10537,14 +10508,14 @@
|
|
|
10537
10508
|
|
|
10538
10509
|
function noop() {}
|
|
10539
10510
|
|
|
10540
|
-
var _Ajv = /*#__PURE__*/Object.freeze(/*#__PURE__*/
|
|
10541
|
-
|
|
10542
|
-
|
|
10543
|
-
}
|
|
10511
|
+
var _Ajv = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), ajv, {
|
|
10512
|
+
'default': ajv,
|
|
10513
|
+
__moduleExports: ajv
|
|
10514
|
+
}));
|
|
10544
10515
|
|
|
10545
10516
|
var $ref = "#/definitions/Schema";
|
|
10546
|
-
var $schema = "http://json-schema.org/draft-07/schema#";
|
|
10547
|
-
var definitions = {
|
|
10517
|
+
var $schema$2 = "http://json-schema.org/draft-07/schema#";
|
|
10518
|
+
var definitions$1 = {
|
|
10548
10519
|
ActivityType: {
|
|
10549
10520
|
anyOf: [
|
|
10550
10521
|
{
|
|
@@ -12187,21 +12158,21 @@
|
|
|
12187
12158
|
type: "string"
|
|
12188
12159
|
}
|
|
12189
12160
|
};
|
|
12190
|
-
var v2 = {
|
|
12161
|
+
var v2$1 = {
|
|
12191
12162
|
$ref: $ref,
|
|
12192
|
-
$schema: $schema,
|
|
12193
|
-
definitions: definitions
|
|
12163
|
+
$schema: $schema$2,
|
|
12164
|
+
definitions: definitions$1
|
|
12194
12165
|
};
|
|
12195
12166
|
|
|
12196
12167
|
var _ddl2Schema = /*#__PURE__*/Object.freeze({
|
|
12197
12168
|
__proto__: null,
|
|
12198
12169
|
$ref: $ref,
|
|
12199
|
-
$schema: $schema,
|
|
12200
|
-
definitions: definitions,
|
|
12201
|
-
'default': v2
|
|
12170
|
+
$schema: $schema$2,
|
|
12171
|
+
definitions: definitions$1,
|
|
12172
|
+
'default': v2$1
|
|
12202
12173
|
});
|
|
12203
12174
|
|
|
12204
|
-
var Ajv = ajv || _Ajv;
|
|
12175
|
+
var Ajv$1 = ajv || _Ajv;
|
|
12205
12176
|
var ddl2Schema = _ddl2Schema;
|
|
12206
12177
|
var options = {
|
|
12207
12178
|
allErrors: false,
|
|
@@ -12209,7 +12180,7 @@
|
|
|
12209
12180
|
jsonPointers: false
|
|
12210
12181
|
};
|
|
12211
12182
|
function doValidate(ddl, schema) {
|
|
12212
|
-
var ajv = new Ajv(options);
|
|
12183
|
+
var ajv = new Ajv$1(options);
|
|
12213
12184
|
var validate = ajv.compile(schema);
|
|
12214
12185
|
var success = validate(ddl);
|
|
12215
12186
|
return {
|
|
@@ -12241,7 +12212,7 @@
|
|
|
12241
12212
|
case ">=":
|
|
12242
12213
|
return function (localRow) { return localRow[lf] >= val; };
|
|
12243
12214
|
default:
|
|
12244
|
-
throw new Error("Unknown filter condition: "
|
|
12215
|
+
throw new Error("Unknown filter condition: " + condition);
|
|
12245
12216
|
}
|
|
12246
12217
|
}
|
|
12247
12218
|
var ColumnMapping = /** @class */ (function (_super) {
|
|
@@ -12253,16 +12224,16 @@
|
|
|
12253
12224
|
var retVal = [];
|
|
12254
12225
|
if (!this.remoteField_valid()) {
|
|
12255
12226
|
retVal.push({
|
|
12256
|
-
source:
|
|
12257
|
-
msg: "Invalid remoteField: \""
|
|
12258
|
-
hint: "expected: "
|
|
12227
|
+
source: prefix + ".remoteField",
|
|
12228
|
+
msg: "Invalid remoteField: \"" + this.remoteField() + "\"",
|
|
12229
|
+
hint: "expected: " + JSON.stringify(this.sourceOutFields())
|
|
12259
12230
|
});
|
|
12260
12231
|
}
|
|
12261
12232
|
if (!this.localField_valid()) {
|
|
12262
12233
|
retVal.push({
|
|
12263
|
-
source:
|
|
12264
|
-
msg: "Invalid localField: \""
|
|
12265
|
-
hint: "expected: "
|
|
12234
|
+
source: prefix + ".localField",
|
|
12235
|
+
msg: "Invalid localField: \"" + this.localField() + "\"",
|
|
12236
|
+
hint: "expected: " + JSON.stringify(this.localFields())
|
|
12266
12237
|
});
|
|
12267
12238
|
}
|
|
12268
12239
|
return retVal;
|
|
@@ -12295,7 +12266,7 @@
|
|
|
12295
12266
|
return new ColumnMapping().fromDDL(ddl);
|
|
12296
12267
|
};
|
|
12297
12268
|
ColumnMapping.prototype.hash = function () {
|
|
12298
|
-
return util$
|
|
12269
|
+
return util$1.hashSum({
|
|
12299
12270
|
remoteField: this.remoteField(),
|
|
12300
12271
|
localField: this.localField(),
|
|
12301
12272
|
condition: this.condition(),
|
|
@@ -12322,9 +12293,9 @@
|
|
|
12322
12293
|
switch (this.condition()) {
|
|
12323
12294
|
case "in":
|
|
12324
12295
|
case "range":
|
|
12325
|
-
return
|
|
12296
|
+
return this.localField() + " " + this.condition() + " [" + this.remoteValues(filterSelection).join(", ") + "]";
|
|
12326
12297
|
default:
|
|
12327
|
-
return
|
|
12298
|
+
return this.localField() + " " + this.condition() + " " + this.remoteValues(filterSelection)[0];
|
|
12328
12299
|
}
|
|
12329
12300
|
};
|
|
12330
12301
|
ColumnMapping.prototype.createFilter = function (filterSelection) {
|
|
@@ -12385,21 +12356,21 @@
|
|
|
12385
12356
|
var retVal = [];
|
|
12386
12357
|
if (!this.source_valid()) {
|
|
12387
12358
|
retVal.push({
|
|
12388
|
-
source:
|
|
12389
|
-
msg: "Invalid source: \""
|
|
12390
|
-
hint: "expected: "
|
|
12359
|
+
source: prefix + ".source." + this.source(),
|
|
12360
|
+
msg: "Invalid source: \"" + this.source() + "\"",
|
|
12361
|
+
hint: "expected: " + JSON.stringify(this.visualizationIDs())
|
|
12391
12362
|
});
|
|
12392
12363
|
}
|
|
12393
12364
|
if (this.source_exists() && this.validMappings().length === 0) {
|
|
12394
12365
|
retVal.push({
|
|
12395
|
-
source:
|
|
12396
|
-
msg: "Invalid mappings: \""
|
|
12366
|
+
source: prefix + ".source." + this.source(),
|
|
12367
|
+
msg: "Invalid mappings: \"" + this.source() + "\"",
|
|
12397
12368
|
hint: "expected minimum of 1 mapping"
|
|
12398
12369
|
});
|
|
12399
12370
|
}
|
|
12400
12371
|
for (var _i = 0, _a = this.validMappings(); _i < _a.length; _i++) {
|
|
12401
12372
|
var mapping = _a[_i];
|
|
12402
|
-
retVal = retVal.concat(mapping.validate(
|
|
12373
|
+
retVal = retVal.concat(mapping.validate(prefix + "." + this.source() + ".mappings"));
|
|
12403
12374
|
}
|
|
12404
12375
|
return retVal;
|
|
12405
12376
|
};
|
|
@@ -12436,7 +12407,7 @@
|
|
|
12436
12407
|
return this._owner.visualizationIDs();
|
|
12437
12408
|
};
|
|
12438
12409
|
RemoteFilter.prototype.hash = function () {
|
|
12439
|
-
return util$
|
|
12410
|
+
return util$1.hashSum({
|
|
12440
12411
|
source: this.source(),
|
|
12441
12412
|
mappings: this.validMappings().map(function (mapping) { return mapping.hash(); }),
|
|
12442
12413
|
selection: this.sourceSelection()
|
|
@@ -12501,9 +12472,9 @@
|
|
|
12501
12472
|
var retVal = [];
|
|
12502
12473
|
if (!this.localField_valid()) {
|
|
12503
12474
|
retVal.push({
|
|
12504
|
-
source:
|
|
12505
|
-
msg: "Invalid localField: \""
|
|
12506
|
-
hint: "expected: "
|
|
12475
|
+
source: prefix + ".localField",
|
|
12476
|
+
msg: "Invalid localField: \"" + this.localField() + "\"",
|
|
12477
|
+
hint: "expected: " + JSON.stringify(this.localFields())
|
|
12507
12478
|
});
|
|
12508
12479
|
}
|
|
12509
12480
|
return retVal;
|
|
@@ -12553,7 +12524,7 @@
|
|
|
12553
12524
|
return new StaticFilter().fromDDL(ddl);
|
|
12554
12525
|
};
|
|
12555
12526
|
StaticFilter.prototype.hash = function () {
|
|
12556
|
-
return util$
|
|
12527
|
+
return util$1.hashSum({
|
|
12557
12528
|
localField: this.localField(),
|
|
12558
12529
|
condition: this.condition(),
|
|
12559
12530
|
value: this.value(),
|
|
@@ -12564,7 +12535,7 @@
|
|
|
12564
12535
|
return this._owner.inFields().map(function (field) { return field.id; });
|
|
12565
12536
|
};
|
|
12566
12537
|
StaticFilter.prototype.createFilterDescription = function () {
|
|
12567
|
-
return
|
|
12538
|
+
return this.localField() + " " + this.condition() + " " + this.coerceValue();
|
|
12568
12539
|
};
|
|
12569
12540
|
StaticFilter.prototype.createFilter = function () {
|
|
12570
12541
|
return createFilter(this.condition(), this.localField(), this.coerceValue());
|
|
@@ -12625,7 +12596,7 @@
|
|
|
12625
12596
|
var remoteFilters = [];
|
|
12626
12597
|
var staticFilters = [];
|
|
12627
12598
|
_.forEach(function (fc) {
|
|
12628
|
-
if (v2
|
|
12599
|
+
if (v2.isIFilterCondition(fc)) {
|
|
12629
12600
|
remoteFilters.push(RemoteFilter.fromDDL(fc));
|
|
12630
12601
|
}
|
|
12631
12602
|
else {
|
|
@@ -12644,7 +12615,7 @@
|
|
|
12644
12615
|
};
|
|
12645
12616
|
// Activity overrides ---
|
|
12646
12617
|
Filters.prototype.hash = function () {
|
|
12647
|
-
return util$
|
|
12618
|
+
return util$1.hashSum(this.validFilters().map(function (f) {
|
|
12648
12619
|
return {
|
|
12649
12620
|
filter: f.hash()
|
|
12650
12621
|
};
|
|
@@ -12692,7 +12663,7 @@
|
|
|
12692
12663
|
return this.staticFilter().filter(function (filter) { return filter.valid(); });
|
|
12693
12664
|
};
|
|
12694
12665
|
Filters.prototype.validFilters = function () {
|
|
12695
|
-
return __spreadArray
|
|
12666
|
+
return __spreadArray(__spreadArray([], this.validRemoteFilters()), this.validStaticFilters());
|
|
12696
12667
|
};
|
|
12697
12668
|
Filters.Filter = RemoteFilter;
|
|
12698
12669
|
Filters.Mapping = ColumnMapping;
|
|
@@ -12717,9 +12688,9 @@
|
|
|
12717
12688
|
var retVal = [];
|
|
12718
12689
|
if (!this.label_valid()) {
|
|
12719
12690
|
retVal.push({
|
|
12720
|
-
source:
|
|
12721
|
-
msg: "Invalid label: \""
|
|
12722
|
-
hint: "expected "
|
|
12691
|
+
source: prefix + ".label",
|
|
12692
|
+
msg: "Invalid label: \"" + this.label() + "\"",
|
|
12693
|
+
hint: "expected " + JSON.stringify(this.columns())
|
|
12723
12694
|
});
|
|
12724
12695
|
}
|
|
12725
12696
|
return retVal;
|
|
@@ -12744,7 +12715,7 @@
|
|
|
12744
12715
|
return new GroupByColumn().fromDDL(label);
|
|
12745
12716
|
};
|
|
12746
12717
|
GroupByColumn.prototype.hash = function () {
|
|
12747
|
-
return util$
|
|
12718
|
+
return util$1.hashSum(this.label());
|
|
12748
12719
|
};
|
|
12749
12720
|
GroupByColumn.prototype.columns = function () {
|
|
12750
12721
|
return this._owner.inFieldIDs();
|
|
@@ -12787,16 +12758,16 @@
|
|
|
12787
12758
|
var retVal = [];
|
|
12788
12759
|
if (!this.aggrColumn_valid()) {
|
|
12789
12760
|
retVal.push({
|
|
12790
|
-
source:
|
|
12791
|
-
msg: "Invalid aggrColumn: \""
|
|
12792
|
-
hint: "expected "
|
|
12761
|
+
source: prefix + "." + this.fieldID() + ".aggrColumn",
|
|
12762
|
+
msg: "Invalid aggrColumn: \"" + this.aggrColumn() + "\"",
|
|
12763
|
+
hint: "expected " + JSON.stringify(this.columns())
|
|
12793
12764
|
});
|
|
12794
12765
|
}
|
|
12795
12766
|
if (!this.baseCountColumn_valid()) {
|
|
12796
12767
|
retVal.push({
|
|
12797
|
-
source:
|
|
12798
|
-
msg: "Invalid baseCountColumn: \""
|
|
12799
|
-
hint: "expected "
|
|
12768
|
+
source: prefix + "." + this.fieldID() + ".aggrColumn",
|
|
12769
|
+
msg: "Invalid baseCountColumn: \"" + this.baseCountColumn() + "\"",
|
|
12770
|
+
hint: "expected " + JSON.stringify(this.columns())
|
|
12800
12771
|
});
|
|
12801
12772
|
}
|
|
12802
12773
|
return retVal;
|
|
@@ -12838,7 +12809,7 @@
|
|
|
12838
12809
|
return new AggregateField().fromDDL(ddl);
|
|
12839
12810
|
};
|
|
12840
12811
|
AggregateField.prototype.hash = function () {
|
|
12841
|
-
return util$
|
|
12812
|
+
return util$1.hashSum({
|
|
12842
12813
|
label: this.fieldID(),
|
|
12843
12814
|
aggrType: this.aggrType(),
|
|
12844
12815
|
aggrColumn: this.aggrColumn()
|
|
@@ -12943,7 +12914,7 @@
|
|
|
12943
12914
|
};
|
|
12944
12915
|
// Activity
|
|
12945
12916
|
GroupBy.prototype.hash = function () {
|
|
12946
|
-
return util$
|
|
12917
|
+
return util$1.hashSum({
|
|
12947
12918
|
groupBy: this.column().map(function (gb) { return gb.hash(); }),
|
|
12948
12919
|
computedFields: this.computedFields().map(function (cf) { return cf.hash(); })
|
|
12949
12920
|
});
|
|
@@ -13132,7 +13103,7 @@
|
|
|
13132
13103
|
return new Limit().fromDDL(ddl);
|
|
13133
13104
|
};
|
|
13134
13105
|
Limit.prototype.hash = function () {
|
|
13135
|
-
return util$
|
|
13106
|
+
return util$1.hashSum({
|
|
13136
13107
|
limit: this.rows()
|
|
13137
13108
|
});
|
|
13138
13109
|
};
|
|
@@ -13162,15 +13133,15 @@
|
|
|
13162
13133
|
var retVal = [];
|
|
13163
13134
|
if (!this.value_valid()) {
|
|
13164
13135
|
retVal.push({
|
|
13165
|
-
source:
|
|
13166
|
-
msg: "Invalid value: \""
|
|
13136
|
+
source: prefix + ".value",
|
|
13137
|
+
msg: "Invalid value: \"" + this.value() + "\"",
|
|
13167
13138
|
hint: 'expected: "any"'
|
|
13168
13139
|
});
|
|
13169
13140
|
}
|
|
13170
13141
|
if (!this.newValue_valid()) {
|
|
13171
13142
|
retVal.push({
|
|
13172
|
-
source:
|
|
13173
|
-
msg: "Invalid value: \""
|
|
13143
|
+
source: prefix + ".newValue",
|
|
13144
|
+
msg: "Invalid value: \"" + this.newValue() + "\"",
|
|
13174
13145
|
hint: 'expected: "any"'
|
|
13175
13146
|
});
|
|
13176
13147
|
}
|
|
@@ -13235,23 +13206,23 @@
|
|
|
13235
13206
|
var retVal = [];
|
|
13236
13207
|
if (!this.column1_valid()) {
|
|
13237
13208
|
retVal.push({
|
|
13238
|
-
source:
|
|
13239
|
-
msg: "Invalid column1: \""
|
|
13240
|
-
hint: "expected: "
|
|
13209
|
+
source: prefix + "." + this.label(),
|
|
13210
|
+
msg: "Invalid column1: \"" + this.column1() + "\"",
|
|
13211
|
+
hint: "expected: " + JSON.stringify(this.columns())
|
|
13241
13212
|
});
|
|
13242
13213
|
}
|
|
13243
13214
|
if (!this.column2_valid()) {
|
|
13244
13215
|
retVal.push({
|
|
13245
|
-
source:
|
|
13246
|
-
msg: "Invalid column2: \""
|
|
13247
|
-
hint: "expected: "
|
|
13216
|
+
source: prefix + "." + this.label(),
|
|
13217
|
+
msg: "Invalid column2: \"" + this.column2() + "\"",
|
|
13218
|
+
hint: "expected: " + JSON.stringify(this.columns())
|
|
13248
13219
|
});
|
|
13249
13220
|
}
|
|
13250
13221
|
if (!this.disableMapping()) {
|
|
13251
|
-
this.validComputedMappings().forEach(function (cm) { return cm.validate(
|
|
13222
|
+
this.validComputedMappings().forEach(function (cm) { return cm.validate(prefix + ".mapping"); });
|
|
13252
13223
|
}
|
|
13253
13224
|
if (!this.disableChildField()) {
|
|
13254
|
-
this.validChildFields().forEach(function (cf) { return cf.validate(
|
|
13225
|
+
this.validChildFields().forEach(function (cf) { return cf.validate(prefix + ".childField"); });
|
|
13255
13226
|
}
|
|
13256
13227
|
return retVal;
|
|
13257
13228
|
};
|
|
@@ -13369,7 +13340,7 @@
|
|
|
13369
13340
|
return new ComputedField().fromDDL(ddl);
|
|
13370
13341
|
};
|
|
13371
13342
|
ComputedField.prototype.hash = function () {
|
|
13372
|
-
return util$
|
|
13343
|
+
return util$1.hashSum(this.toDDL());
|
|
13373
13344
|
};
|
|
13374
13345
|
ComputedField.prototype.columns = function () {
|
|
13375
13346
|
return this._owner.fieldIDs();
|
|
@@ -13389,7 +13360,7 @@
|
|
|
13389
13360
|
.column1(child.id);
|
|
13390
13361
|
});
|
|
13391
13362
|
}
|
|
13392
|
-
return __assign
|
|
13363
|
+
return __assign(__assign({}, this._owner.field(this.column1())), { id: this.label(), children: validChildFields.length ? validChildFields.map(function (cf) { return cf.computedField(); }) : undefined });
|
|
13393
13364
|
case "*":
|
|
13394
13365
|
case "/":
|
|
13395
13366
|
case "+":
|
|
@@ -13412,7 +13383,7 @@
|
|
|
13412
13383
|
};
|
|
13413
13384
|
});
|
|
13414
13385
|
return function (row) {
|
|
13415
|
-
var retVal = trim && hasComputedFields ? {} : __assign
|
|
13386
|
+
var retVal = trim && hasComputedFields ? {} : __assign({}, row);
|
|
13416
13387
|
for (var _i = 0, computedFields_1 = computedFields; _i < computedFields_1.length; _i++) {
|
|
13417
13388
|
var cf = computedFields_1[_i];
|
|
13418
13389
|
retVal[cf.label] = cf.func(row);
|
|
@@ -13432,7 +13403,7 @@
|
|
|
13432
13403
|
if (this.hasChildFields()) {
|
|
13433
13404
|
return function (row) {
|
|
13434
13405
|
// TODO Move to function factory ---
|
|
13435
|
-
var r = row[column1].Row && util$
|
|
13406
|
+
var r = row[column1].Row && util$1.isArray(row[column1].Row) ? row[column1].Row : row[column1];
|
|
13436
13407
|
return r.map(_this.projection(trim));
|
|
13437
13408
|
};
|
|
13438
13409
|
}
|
|
@@ -13566,7 +13537,7 @@
|
|
|
13566
13537
|
return _super.call(this) || this;
|
|
13567
13538
|
}
|
|
13568
13539
|
MultiField.prototype.hash = function () {
|
|
13569
|
-
return util$
|
|
13540
|
+
return util$1.hashSum(this.toDDL());
|
|
13570
13541
|
};
|
|
13571
13542
|
MultiField.prototype.owner = function (_) {
|
|
13572
13543
|
if (!arguments.length)
|
|
@@ -13581,7 +13552,7 @@
|
|
|
13581
13552
|
var retVal = [];
|
|
13582
13553
|
for (var _i = 0, _a = this.validMultiFields(); _i < _a.length; _i++) {
|
|
13583
13554
|
var cf = _a[_i];
|
|
13584
|
-
retVal = retVal.concat(cf.validate(
|
|
13555
|
+
retVal = retVal.concat(cf.validate(prefix + ".computedFields"));
|
|
13585
13556
|
}
|
|
13586
13557
|
return retVal;
|
|
13587
13558
|
};
|
|
@@ -13640,7 +13611,7 @@
|
|
|
13640
13611
|
var retVal = [];
|
|
13641
13612
|
for (var _i = 0, _a = this.validComputedFields(); _i < _a.length; _i++) {
|
|
13642
13613
|
var cf = _a[_i];
|
|
13643
|
-
retVal = retVal.concat(cf.validate(
|
|
13614
|
+
retVal = retVal.concat(cf.validate(this.classID() + ".computedFields"));
|
|
13644
13615
|
}
|
|
13645
13616
|
return retVal;
|
|
13646
13617
|
};
|
|
@@ -13788,7 +13759,7 @@
|
|
|
13788
13759
|
}
|
|
13789
13760
|
}
|
|
13790
13761
|
return function (row) {
|
|
13791
|
-
var retVal = trim && hasComputedFields ? {} : __assign
|
|
13762
|
+
var retVal = trim && hasComputedFields ? {} : __assign({}, row);
|
|
13792
13763
|
for (var _i = 0, computedFields_3 = computedFields; _i < computedFields_3.length; _i++) {
|
|
13793
13764
|
var cf = computedFields_3[_i];
|
|
13794
13765
|
retVal[cf.label] = cf.func(row);
|
|
@@ -13833,7 +13804,7 @@
|
|
|
13833
13804
|
};
|
|
13834
13805
|
Project.prototype.hash = function (more) {
|
|
13835
13806
|
if (more === void 0) { more = {}; }
|
|
13836
|
-
return _super.prototype.hash.call(this, __assign
|
|
13807
|
+
return _super.prototype.hash.call(this, __assign({ ddl: this.toDDL() }, more));
|
|
13837
13808
|
};
|
|
13838
13809
|
return Project;
|
|
13839
13810
|
}(ProjectBase));
|
|
@@ -13862,7 +13833,7 @@
|
|
|
13862
13833
|
};
|
|
13863
13834
|
Mappings.prototype.hash = function (more) {
|
|
13864
13835
|
if (more === void 0) { more = {}; }
|
|
13865
|
-
return _super.prototype.hash.call(this, __assign
|
|
13836
|
+
return _super.prototype.hash.call(this, __assign({ ddl: this.toDDL() }, more));
|
|
13866
13837
|
};
|
|
13867
13838
|
Mappings.prototype.referencedFields = function (refs) {
|
|
13868
13839
|
if (this.hasComputedFields()) {
|
|
@@ -13883,9 +13854,9 @@
|
|
|
13883
13854
|
var retVal = [];
|
|
13884
13855
|
if (!this.fieldID_valid()) {
|
|
13885
13856
|
retVal.push({
|
|
13886
|
-
source:
|
|
13887
|
-
msg: "Invalid fieldID: "
|
|
13888
|
-
hint: "expected "
|
|
13857
|
+
source: prefix + ".fieldID",
|
|
13858
|
+
msg: "Invalid fieldID: " + this.fieldID(),
|
|
13859
|
+
hint: "expected " + JSON.stringify(this.fieldIDs())
|
|
13889
13860
|
});
|
|
13890
13861
|
}
|
|
13891
13862
|
return retVal;
|
|
@@ -13914,7 +13885,7 @@
|
|
|
13914
13885
|
return new SortColumn().fromDDL(ddl);
|
|
13915
13886
|
};
|
|
13916
13887
|
SortColumn.prototype.hash = function () {
|
|
13917
|
-
return util$
|
|
13888
|
+
return util$1.hashSum({
|
|
13918
13889
|
sortColumn: this.fieldID(),
|
|
13919
13890
|
descending: this.descending()
|
|
13920
13891
|
});
|
|
@@ -13976,7 +13947,7 @@
|
|
|
13976
13947
|
};
|
|
13977
13948
|
// Activitiy ---
|
|
13978
13949
|
Sort.prototype.hash = function () {
|
|
13979
|
-
return util$
|
|
13950
|
+
return util$1.hashSum({
|
|
13980
13951
|
Sort: this.column().map(function (sb) { return sb.hash(); })
|
|
13981
13952
|
});
|
|
13982
13953
|
};
|
|
@@ -14004,7 +13975,7 @@
|
|
|
14004
13975
|
});
|
|
14005
13976
|
}
|
|
14006
13977
|
if (sortByArr.length) {
|
|
14007
|
-
return __spreadArray
|
|
13978
|
+
return __spreadArray([], data).sort(function (l, r) {
|
|
14008
13979
|
for (var _i = 0, sortByArr_1 = sortByArr; _i < sortByArr_1.length; _i++) {
|
|
14009
13980
|
var item = sortByArr_1[_i];
|
|
14010
13981
|
var retVal2 = item.compare(l[item.id], r[item.id]);
|
|
@@ -14227,7 +14198,7 @@
|
|
|
14227
14198
|
});
|
|
14228
14199
|
});
|
|
14229
14200
|
_this._origButtons = _this.buttons();
|
|
14230
|
-
_this._filterButtons = __spreadArray
|
|
14201
|
+
_this._filterButtons = __spreadArray([_this._togglePopup, new common.Spacer()], _this._origButtons);
|
|
14231
14202
|
return _this;
|
|
14232
14203
|
}
|
|
14233
14204
|
VizChartPanel.prototype.popup = function (_) {
|
|
@@ -14449,7 +14420,7 @@
|
|
|
14449
14420
|
}
|
|
14450
14421
|
}
|
|
14451
14422
|
else {
|
|
14452
|
-
console.log("***"
|
|
14423
|
+
console.log("***" + this.id() + " Immutable Fields***");
|
|
14453
14424
|
}
|
|
14454
14425
|
var data = mappings.outData();
|
|
14455
14426
|
var dataChanged = this._prevData !== data;
|
|
@@ -14470,7 +14441,7 @@
|
|
|
14470
14441
|
}
|
|
14471
14442
|
}
|
|
14472
14443
|
else {
|
|
14473
|
-
console.log(
|
|
14444
|
+
console.log(this.id() + " Immutable Data!");
|
|
14474
14445
|
}
|
|
14475
14446
|
if (fieldsChanged || dataChanged) {
|
|
14476
14447
|
return this.chartPanel().renderPromise().then(function () { });
|
|
@@ -14509,7 +14480,7 @@
|
|
|
14509
14480
|
};
|
|
14510
14481
|
Visualization.prototype.toDBData = function (fields, data) {
|
|
14511
14482
|
var _this = this;
|
|
14512
|
-
var _data = util$
|
|
14483
|
+
var _data = util$1.isArray(data) ? data : [data];
|
|
14513
14484
|
return _data.map(function (row) {
|
|
14514
14485
|
var retVal = [];
|
|
14515
14486
|
for (var _i = 0, fields_1 = fields; _i < fields_1.length; _i++) {
|
|
@@ -14562,7 +14533,7 @@
|
|
|
14562
14533
|
__metadata("design:type", Function)
|
|
14563
14534
|
], Visualization.prototype, "description", void 0);
|
|
14564
14535
|
__decorate([
|
|
14565
|
-
common.publish(v2
|
|
14536
|
+
common.publish(v2.VisibilitySet[0], "set", "Type", v2.VisibilitySet),
|
|
14566
14537
|
__metadata("design:type", String)
|
|
14567
14538
|
], Visualization.prototype, "_visibility", void 0);
|
|
14568
14539
|
__decorate([
|
|
@@ -14593,8 +14564,8 @@
|
|
|
14593
14564
|
return _this;
|
|
14594
14565
|
}
|
|
14595
14566
|
State.prototype.set = function (_) {
|
|
14596
|
-
var currSelHash = util$
|
|
14597
|
-
var newSelHash = util$
|
|
14567
|
+
var currSelHash = util$1.hashSum(this.selection());
|
|
14568
|
+
var newSelHash = util$1.hashSum(_);
|
|
14598
14569
|
if (currSelHash !== newSelHash) {
|
|
14599
14570
|
this.selection(_);
|
|
14600
14571
|
return true;
|
|
@@ -14605,7 +14576,7 @@
|
|
|
14605
14576
|
var currSelection = this.selection();
|
|
14606
14577
|
var newSelection = [];
|
|
14607
14578
|
var _loop_1 = function (selRow) {
|
|
14608
|
-
if (util$
|
|
14579
|
+
if (util$1.find(data, function (row, index) {
|
|
14609
14580
|
for (var column in selRow) {
|
|
14610
14581
|
if (selRow[column] !== row[column]) {
|
|
14611
14582
|
return false;
|
|
@@ -14640,7 +14611,7 @@
|
|
|
14640
14611
|
_this._initialized = false;
|
|
14641
14612
|
while (true) {
|
|
14642
14613
|
vizID++;
|
|
14643
|
-
_this._id = "e_"
|
|
14614
|
+
_this._id = "e_" + vizID;
|
|
14644
14615
|
if (!_this._ec.elementExists(_this._id)) {
|
|
14645
14616
|
break;
|
|
14646
14617
|
}
|
|
@@ -14648,9 +14619,9 @@
|
|
|
14648
14619
|
var view = new HipiePipeline(_this._ec, _this._id);
|
|
14649
14620
|
_this.hipiePipeline(view);
|
|
14650
14621
|
_this._vizChartPanel = new Visualization(_this._ec, _this.hipiePipeline())
|
|
14651
|
-
.id("viz_"
|
|
14652
|
-
.title("Element "
|
|
14653
|
-
_this._vizChartPanel.chartPanel().id("cp_"
|
|
14622
|
+
.id("viz_" + vizID)
|
|
14623
|
+
.title("Element " + vizID);
|
|
14624
|
+
_this._vizChartPanel.chartPanel().id("cp_" + vizID);
|
|
14654
14625
|
_this.visualization(_this._vizChartPanel);
|
|
14655
14626
|
_this.state(new State());
|
|
14656
14627
|
return _this;
|
|
@@ -14666,12 +14637,12 @@
|
|
|
14666
14637
|
_this.selection(sel ? more.selection.map(function (r) { return r.__lparam || r; }) : []);
|
|
14667
14638
|
}
|
|
14668
14639
|
else {
|
|
14669
|
-
var row = util$
|
|
14640
|
+
var row = util$1.isArray(_row) ? _row : [_row];
|
|
14670
14641
|
_this.selection(sel ? row.map(function (r) { return r.__lparam || r; }) : []);
|
|
14671
14642
|
}
|
|
14672
14643
|
})
|
|
14673
14644
|
.on("vertex_click", function (_row, col, sel) {
|
|
14674
|
-
var row = util$
|
|
14645
|
+
var row = util$1.isArray(_row) ? _row : [_row];
|
|
14675
14646
|
_this.selection(sel ? row.map(function (r) { return r.__lparam || r; }) : []);
|
|
14676
14647
|
});
|
|
14677
14648
|
return this;
|
|
@@ -14731,11 +14702,11 @@
|
|
|
14731
14702
|
}
|
|
14732
14703
|
this._errors = [];
|
|
14733
14704
|
var pipeline = this.hipiePipeline();
|
|
14734
|
-
for (var _i = 0, _a = __spreadArray
|
|
14705
|
+
for (var _i = 0, _a = __spreadArray(__spreadArray([], pipeline.activities()), [this.mappings()]); _i < _a.length; _i++) {
|
|
14735
14706
|
var activity = _a[_i];
|
|
14736
14707
|
for (var _b = 0, _c = activity.validate(); _b < _c.length; _b++) {
|
|
14737
14708
|
var error = _c[_b];
|
|
14738
|
-
this._errors.push(__assign
|
|
14709
|
+
this._errors.push(__assign({ elementID: this.id() }, error));
|
|
14739
14710
|
}
|
|
14740
14711
|
}
|
|
14741
14712
|
return this._errors;
|
|
@@ -14749,7 +14720,7 @@
|
|
|
14749
14720
|
_this._initialized = true;
|
|
14750
14721
|
var data = _this.hipiePipeline().outData();
|
|
14751
14722
|
if (_this.visualization().chartType() === "FieldForm") {
|
|
14752
|
-
if (_this.state().set(__spreadArray
|
|
14723
|
+
if (_this.state().set(__spreadArray([], data))) {
|
|
14753
14724
|
_this.selectionChanged();
|
|
14754
14725
|
}
|
|
14755
14726
|
}
|
|
@@ -14835,7 +14806,7 @@
|
|
|
14835
14806
|
return this;
|
|
14836
14807
|
};
|
|
14837
14808
|
ElementContainer.prototype.elements = function () {
|
|
14838
|
-
return __spreadArray
|
|
14809
|
+
return __spreadArray([], this._elements);
|
|
14839
14810
|
};
|
|
14840
14811
|
ElementContainer.prototype.element = function (w) {
|
|
14841
14812
|
var retVal;
|
|
@@ -14998,7 +14969,7 @@
|
|
|
14998
14969
|
};
|
|
14999
14970
|
PopupManager.prototype.syncPopups = function () {
|
|
15000
14971
|
var prevPopups = this.popupChartPanels();
|
|
15001
|
-
var diffPopups = util$
|
|
14972
|
+
var diffPopups = util$1.compare(prevPopups, this._ec.elements()
|
|
15002
14973
|
.filter(function (e) { return e.visualization().visibility() === "flyout"; })
|
|
15003
14974
|
.map(function (elem) { return elem.visualization().chartPanel(); }));
|
|
15004
14975
|
for (var _i = 0, _a = diffPopups.exit; _i < _a.length; _i++) {
|
|
@@ -15045,7 +15016,7 @@
|
|
|
15045
15016
|
var errors = element.validate();
|
|
15046
15017
|
wa.title.label = this.tabTitle(element);
|
|
15047
15018
|
this.titleClassed(wa, "error", errors.length > 0);
|
|
15048
|
-
wa.title.caption = errors.map(function (err) { return
|
|
15019
|
+
wa.title.caption = errors.map(function (err) { return err.source + ": " + err.msg; }).join("\n");
|
|
15049
15020
|
};
|
|
15050
15021
|
DashboardDockPanel.prototype.activate = function (element) {
|
|
15051
15022
|
var wa = this.getWidgetAdapter(element.visualization().chartPanel());
|
|
@@ -15057,15 +15028,15 @@
|
|
|
15057
15028
|
if (w.minWidth_exists() || w.minHeight_exists()) {
|
|
15058
15029
|
var wa = this.getWidgetAdapter(w);
|
|
15059
15030
|
common.select(wa.node)
|
|
15060
|
-
.style("min-width",
|
|
15061
|
-
.style("min-height",
|
|
15031
|
+
.style("min-width", w.minWidth() + "px")
|
|
15032
|
+
.style("min-height", w.minHeight() + "px");
|
|
15062
15033
|
return true;
|
|
15063
15034
|
}
|
|
15064
15035
|
return false;
|
|
15065
15036
|
};
|
|
15066
15037
|
DashboardDockPanel.prototype.syncWidgets = function () {
|
|
15067
15038
|
var prevWidgets = this.widgets();
|
|
15068
|
-
var diffWidgets = util$
|
|
15039
|
+
var diffWidgets = util$1.compare(prevWidgets, this._ec.elements().filter(function (e) { return e.visualization().visibility() === "normal"; }).map(function (viz) { return viz.visualization().chartPanel(); }));
|
|
15069
15040
|
var refit = false;
|
|
15070
15041
|
for (var _i = 0, _a = diffWidgets.exit; _i < _a.length; _i++) {
|
|
15071
15042
|
var w = _a[_i];
|
|
@@ -15110,7 +15081,7 @@
|
|
|
15110
15081
|
// IClosable ---
|
|
15111
15082
|
DashboardDockPanel.prototype.canClose = function (w, wa) {
|
|
15112
15083
|
var id = this._ec.element(w).id();
|
|
15113
|
-
var retVal = window.confirm("Remove Widget \""
|
|
15084
|
+
var retVal = window.confirm("Remove Widget \"" + id + "\"?");
|
|
15114
15085
|
if (retVal) {
|
|
15115
15086
|
this._ec.clear(id);
|
|
15116
15087
|
this.syncWidgets();
|
|
@@ -15241,8 +15212,8 @@
|
|
|
15241
15212
|
if (w.minWidth_exists() || w.minHeight_exists()) {
|
|
15242
15213
|
var cell = this.getWidgetCell(w.id());
|
|
15243
15214
|
cell.element()
|
|
15244
|
-
.style("min-width",
|
|
15245
|
-
.style("min-height",
|
|
15215
|
+
.style("min-width", w.minWidth() + "px")
|
|
15216
|
+
.style("min-height", w.minHeight() + "px");
|
|
15246
15217
|
return true;
|
|
15247
15218
|
}
|
|
15248
15219
|
return false;
|
|
@@ -15250,7 +15221,7 @@
|
|
|
15250
15221
|
DashboardGrid.prototype.syncWidgets = function () {
|
|
15251
15222
|
var _this = this;
|
|
15252
15223
|
var prevWidgets = this.widgets();
|
|
15253
|
-
var diffWidgets = util$
|
|
15224
|
+
var diffWidgets = util$1.compare(prevWidgets, this._ec.elements().filter(function (e) { return e.visualization().visibility() === "normal"; }).map(function (viz) { return viz.visualization().chartPanel(); }));
|
|
15254
15225
|
for (var _i = 0, _a = diffWidgets.exit; _i < _a.length; _i++) {
|
|
15255
15226
|
var w = _a[_i];
|
|
15256
15227
|
this.removeWidget(w);
|
|
@@ -15305,7 +15276,7 @@
|
|
|
15305
15276
|
// IClosable ---
|
|
15306
15277
|
DashboardGrid.prototype.canClose = function (w, wa) {
|
|
15307
15278
|
var id = this._ec.element(w).id();
|
|
15308
|
-
var retVal = window.confirm("Remove Widget \""
|
|
15279
|
+
var retVal = window.confirm("Remove Widget \"" + id + "\"?");
|
|
15309
15280
|
if (retVal) {
|
|
15310
15281
|
this._ec.clear(id);
|
|
15311
15282
|
this.syncWidgets();
|
|
@@ -15319,7 +15290,7 @@
|
|
|
15319
15290
|
DashboardGrid.prototype._class += " marshaller_DashboardGrid";
|
|
15320
15291
|
DashboardGrid.prototype.mixin(PopupManager);
|
|
15321
15292
|
|
|
15322
|
-
var logger
|
|
15293
|
+
var logger = util$1.scopedLogger("marshaller/ddl2/ddl");
|
|
15323
15294
|
var DDLDatasourceAdapter = /** @class */ (function () {
|
|
15324
15295
|
function DDLDatasourceAdapter() {
|
|
15325
15296
|
}
|
|
@@ -15328,13 +15299,13 @@
|
|
|
15328
15299
|
};
|
|
15329
15300
|
DDLDatasourceAdapter.prototype.id = function (dsT) {
|
|
15330
15301
|
if (dsT instanceof WU) {
|
|
15331
|
-
return
|
|
15302
|
+
return dsT.url() + "/" + dsT.wuid();
|
|
15332
15303
|
}
|
|
15333
15304
|
else if (dsT instanceof RoxieService) {
|
|
15334
|
-
return
|
|
15305
|
+
return dsT.url() + "/" + dsT.querySet() + "/" + dsT.queryID();
|
|
15335
15306
|
}
|
|
15336
15307
|
else if (dsT instanceof RestService) {
|
|
15337
|
-
return
|
|
15308
|
+
return dsT.url() + "/" + dsT.action();
|
|
15338
15309
|
}
|
|
15339
15310
|
return dsT.id();
|
|
15340
15311
|
};
|
|
@@ -15492,12 +15463,12 @@
|
|
|
15492
15463
|
};
|
|
15493
15464
|
DDLAdapter.prototype.readDatasourceRef = function (ddlDSRef, dsPicker, elementContainer) {
|
|
15494
15465
|
var _this = this;
|
|
15495
|
-
if (v2
|
|
15466
|
+
if (v2.isWUResultRef(ddlDSRef)) {
|
|
15496
15467
|
var wu = this._dsReadDedup[ddlDSRef.id];
|
|
15497
15468
|
dsPicker.datasourceID(wu.output(ddlDSRef.output).id());
|
|
15498
15469
|
}
|
|
15499
|
-
else if (v2
|
|
15500
|
-
dsPicker.datasourceID(
|
|
15470
|
+
else if (v2.isRoxieServiceRef(ddlDSRef)) {
|
|
15471
|
+
dsPicker.datasourceID(ddlDSRef.id + "_" + ddlDSRef.output);
|
|
15501
15472
|
var dsRef = dsPicker.datasourceRef();
|
|
15502
15473
|
dsRef
|
|
15503
15474
|
.request(ddlDSRef.request.map(function (rf) {
|
|
@@ -15532,7 +15503,7 @@
|
|
|
15532
15503
|
}
|
|
15533
15504
|
else if (activity instanceof DSPicker) ;
|
|
15534
15505
|
else {
|
|
15535
|
-
logger
|
|
15506
|
+
logger.warning("Unknown activity type: " + activity.classID());
|
|
15536
15507
|
}
|
|
15537
15508
|
}).filter(function (activity) { return !!activity; });
|
|
15538
15509
|
};
|
|
@@ -15593,8 +15564,8 @@
|
|
|
15593
15564
|
};
|
|
15594
15565
|
DDLAdapter.prototype.writeProperties = function () {
|
|
15595
15566
|
return {
|
|
15596
|
-
name: PKG_NAME
|
|
15597
|
-
version: PKG_VERSION
|
|
15567
|
+
name: PKG_NAME,
|
|
15568
|
+
version: PKG_VERSION,
|
|
15598
15569
|
buildVersion: BUILD_VERSION,
|
|
15599
15570
|
layout: this._dashboard.layout()
|
|
15600
15571
|
};
|
|
@@ -15608,23 +15579,23 @@
|
|
|
15608
15579
|
this.readDatasourceRef(ddlView.datasource, hipiePipeline.datasource(), this._ec);
|
|
15609
15580
|
for (var _a = 0, _b = ddlView.activities; _a < _b.length; _a++) {
|
|
15610
15581
|
var activity = _b[_a];
|
|
15611
|
-
if (v2
|
|
15582
|
+
if (v2.isProjectActivity(activity)) {
|
|
15612
15583
|
var project = this.readProject(activity);
|
|
15613
15584
|
hipiePipeline.project(project);
|
|
15614
15585
|
}
|
|
15615
|
-
if (v2
|
|
15586
|
+
if (v2.isFilterActivity(activity)) {
|
|
15616
15587
|
var filters = this.readFilters(activity, this._ec);
|
|
15617
15588
|
hipiePipeline.filters(filters);
|
|
15618
15589
|
}
|
|
15619
|
-
if (v2
|
|
15590
|
+
if (v2.isGroupByActivity(activity)) {
|
|
15620
15591
|
var groupBy = this.readGroupBy(activity);
|
|
15621
15592
|
hipiePipeline.groupBy(groupBy);
|
|
15622
15593
|
}
|
|
15623
|
-
if (v2
|
|
15594
|
+
if (v2.isSortActivity(activity)) {
|
|
15624
15595
|
var sort = this.readSort(activity);
|
|
15625
15596
|
hipiePipeline.sort(sort);
|
|
15626
15597
|
}
|
|
15627
|
-
if (v2
|
|
15598
|
+
if (v2.isLimitActivity(activity)) {
|
|
15628
15599
|
var limit = this.readLimit(activity);
|
|
15629
15600
|
hipiePipeline.limit(limit);
|
|
15630
15601
|
}
|
|
@@ -15642,8 +15613,8 @@
|
|
|
15642
15613
|
var retVal = {
|
|
15643
15614
|
version: "2.2.1",
|
|
15644
15615
|
createdBy: {
|
|
15645
|
-
name: PKG_NAME
|
|
15646
|
-
version: PKG_VERSION
|
|
15616
|
+
name: PKG_NAME,
|
|
15617
|
+
version: PKG_VERSION
|
|
15647
15618
|
},
|
|
15648
15619
|
datasources: this.writeDatasources(),
|
|
15649
15620
|
dataviews: this.writeDDLViews(),
|
|
@@ -15689,7 +15660,7 @@
|
|
|
15689
15660
|
}
|
|
15690
15661
|
break;
|
|
15691
15662
|
default:
|
|
15692
|
-
logger
|
|
15663
|
+
logger.warning("Unknown ddl datasource type: " + ddlDS.type + " ");
|
|
15693
15664
|
}
|
|
15694
15665
|
}
|
|
15695
15666
|
this.readDDLViews(ddl.dataviews);
|
|
@@ -15717,7 +15688,7 @@
|
|
|
15717
15688
|
classIDs.push(classID);
|
|
15718
15689
|
}
|
|
15719
15690
|
classIDs.sort();
|
|
15720
|
-
importJS.push("import { "
|
|
15691
|
+
importJS.push("import { " + classIDs.join(", ") + " } from \"" + moduleID + "\";");
|
|
15721
15692
|
}
|
|
15722
15693
|
return importJS.join("\n");
|
|
15723
15694
|
};
|
|
@@ -15760,18 +15731,18 @@
|
|
|
15760
15731
|
switch (meta.type) {
|
|
15761
15732
|
case "string":
|
|
15762
15733
|
case "set":
|
|
15763
|
-
retVal.push(
|
|
15734
|
+
retVal.push(prefix + "." + meta.id + "(\"" + pe[meta.id]() + "\")" + postfix + ";");
|
|
15764
15735
|
break;
|
|
15765
15736
|
case "number":
|
|
15766
15737
|
case "boolean":
|
|
15767
|
-
retVal.push(
|
|
15738
|
+
retVal.push(prefix + "." + meta.id + "(" + pe[meta.id]() + ")" + postfix + ";");
|
|
15768
15739
|
break;
|
|
15769
15740
|
case "widget":
|
|
15770
|
-
retVal = retVal.concat(this.createProps(
|
|
15741
|
+
retVal = retVal.concat(this.createProps(prefix + "." + meta.id + "()", pe[meta.id]()));
|
|
15771
15742
|
break;
|
|
15772
15743
|
case "propertyArray":
|
|
15773
15744
|
if (meta.ext)
|
|
15774
|
-
retVal.push(
|
|
15745
|
+
retVal.push(prefix + "." + meta.id + "([" + pe[meta.id]() + "])" + postfix + ";");
|
|
15775
15746
|
break;
|
|
15776
15747
|
}
|
|
15777
15748
|
}
|
|
@@ -15788,13 +15759,13 @@
|
|
|
15788
15759
|
};
|
|
15789
15760
|
JavaScriptAdapter.prototype.datasourceRefID = function (view) {
|
|
15790
15761
|
var datasourceRef = view.datasource;
|
|
15791
|
-
if (v2
|
|
15792
|
-
return
|
|
15762
|
+
if (v2.isRoxieServiceRef(datasourceRef)) {
|
|
15763
|
+
return this.safeID(datasourceRef.id) + "_" + this.safeID(datasourceRef.output) + "_" + this.safeID(view.id);
|
|
15793
15764
|
}
|
|
15794
|
-
else if (v2
|
|
15795
|
-
return
|
|
15765
|
+
else if (v2.isWUResultRef(datasourceRef)) {
|
|
15766
|
+
return this.safeID(datasourceRef.id) + "_" + this.safeID(datasourceRef.output);
|
|
15796
15767
|
}
|
|
15797
|
-
return ""
|
|
15768
|
+
return "" + this.safeID(datasourceRef.id);
|
|
15798
15769
|
};
|
|
15799
15770
|
JavaScriptAdapter.prototype.writeDatasource = function (view) {
|
|
15800
15771
|
var datasourceRef = view.datasource;
|
|
@@ -15809,30 +15780,30 @@
|
|
|
15809
15780
|
var wuID = this.safeID(view.datasource.id);
|
|
15810
15781
|
if (!this._dedup[wuID]) {
|
|
15811
15782
|
this._dedup[wuID] = true;
|
|
15812
|
-
retVal.push(" export const "
|
|
15783
|
+
retVal.push(" export const " + wuID + " = new marshaller.WU()\n .url(\"" + datasource.url + "\")\n .wuid(\"" + datasource.wuid + "\")\n ;");
|
|
15813
15784
|
}
|
|
15814
|
-
retVal.push(" export const "
|
|
15785
|
+
retVal.push(" export const " + id + " = new marshaller.WUResult()\n .wu(" + wuID + ")\n .resultName(\"" + outputID + "\")\n .responseFields(" + stringify(datasource.outputs[outputID].fields) + ")\n ;");
|
|
15815
15786
|
break;
|
|
15816
15787
|
case "logicalfile":
|
|
15817
|
-
retVal.push(" export const "
|
|
15788
|
+
retVal.push(" export const " + id + " = new marshaller.LogicalFile()\n .url(\"" + datasource.url + "\")\n .logicalFile(\"" + datasource.logicalFile + "\")\n .responseFields(" + stringify(datasource.fields) + ")\n ;");
|
|
15818
15789
|
break;
|
|
15819
15790
|
case "hipie":
|
|
15820
15791
|
case "roxie":
|
|
15821
15792
|
var serviceID = this.safeID(view.datasource.id);
|
|
15822
15793
|
if (!this._dedup[serviceID]) {
|
|
15823
15794
|
this._dedup[serviceID] = true;
|
|
15824
|
-
retVal.push(" export const "
|
|
15795
|
+
retVal.push(" export const " + serviceID + " = new marshaller.RoxieService(ec)\n .url(\"" + datasource.url + "\")\n .querySet(\"" + datasource.querySet + "\")\n .queryID(\"" + datasource.queryID + "\")\n .requestFields(" + stringify(datasource.inputs) + ")\n ;");
|
|
15825
15796
|
}
|
|
15826
15797
|
var resultID = serviceID + "_" + this.safeID(outputID);
|
|
15827
15798
|
if (!this._dedup[resultID]) {
|
|
15828
15799
|
this._dedup[resultID] = true;
|
|
15829
|
-
retVal.push(" export const "
|
|
15800
|
+
retVal.push(" export const " + resultID + " = new marshaller.RoxieResult(ec)\n .service(" + serviceID + ")\n .resultName(\"" + outputID + "\")\n .responseFields(" + stringify(datasource.outputs[outputID].fields) + ")\n ;");
|
|
15830
15801
|
}
|
|
15831
|
-
retVal.push(" export const "
|
|
15802
|
+
retVal.push(" export const " + id + " = new marshaller.HipieResultRef(ec)\n .datasource(" + resultID + ")\n .requestFieldRefs(" + stringify(datasourceRef.request) + ")\n ;");
|
|
15832
15803
|
break;
|
|
15833
15804
|
case "databomb":
|
|
15834
15805
|
{
|
|
15835
|
-
retVal.push(" export const "
|
|
15806
|
+
retVal.push(" export const " + id + " = new marshaller.Databomb()\n .format(\"" + datasource.format + "\")\n .payload(" + JSON.stringify(datasource.payload) + ")\n ;");
|
|
15836
15807
|
}
|
|
15837
15808
|
break;
|
|
15838
15809
|
case "form":
|
|
@@ -15840,9 +15811,9 @@
|
|
|
15840
15811
|
var fromFields = [];
|
|
15841
15812
|
for (var _i = 0, _a = datasource.fields; _i < _a.length; _i++) {
|
|
15842
15813
|
var field = _a[_i];
|
|
15843
|
-
fromFields.push("new marshaller.FormField().fieldID(\""
|
|
15814
|
+
fromFields.push("new marshaller.FormField().fieldID(\"" + field.id + "\").default(\"" + (field.default || "") + "\")");
|
|
15844
15815
|
}
|
|
15845
|
-
retVal.push(" export const "
|
|
15816
|
+
retVal.push(" export const " + id + " = new marshaller.Form()\n .formFields([\n " + fromFields.join(",\n ") + "\n ])\n ;");
|
|
15846
15817
|
}
|
|
15847
15818
|
break;
|
|
15848
15819
|
}
|
|
@@ -15852,17 +15823,17 @@
|
|
|
15852
15823
|
JavaScriptAdapter.prototype.writeActivity = function (activity) {
|
|
15853
15824
|
switch (activity.type) {
|
|
15854
15825
|
case "filter":
|
|
15855
|
-
return "new marshaller.Filters(ec).conditions("
|
|
15826
|
+
return "new marshaller.Filters(ec).conditions(" + stringify(activity.conditions) + ")";
|
|
15856
15827
|
case "project":
|
|
15857
|
-
return "new marshaller.Project().transformations("
|
|
15828
|
+
return "new marshaller.Project().transformations(" + stringify(activity.transformations) + ")";
|
|
15858
15829
|
case "groupby":
|
|
15859
|
-
return "new marshaller.GroupBy().fieldIDs("
|
|
15830
|
+
return "new marshaller.GroupBy().fieldIDs(" + JSON.stringify(activity.groupByIDs) + ").aggregates(" + stringify(activity.aggregates) + ")";
|
|
15860
15831
|
case "sort":
|
|
15861
|
-
return "new marshaller.Sort().conditions("
|
|
15832
|
+
return "new marshaller.Sort().conditions(" + stringify(activity.conditions) + ")";
|
|
15862
15833
|
case "limit":
|
|
15863
|
-
return "new marshaller.Limit().rows("
|
|
15834
|
+
return "new marshaller.Limit().rows(" + activity.limit + ")";
|
|
15864
15835
|
case "mappings":
|
|
15865
|
-
return "new marshaller.Mappings().transformations("
|
|
15836
|
+
return "new marshaller.Mappings().transformations(" + stringify(activity.transformations) + ")";
|
|
15866
15837
|
}
|
|
15867
15838
|
};
|
|
15868
15839
|
JavaScriptAdapter.prototype.writeWidgetProps = function (pe) {
|
|
@@ -15870,7 +15841,7 @@
|
|
|
15870
15841
|
for (var _i = 0, _a = pe.publishedProperties(); _i < _a.length; _i++) {
|
|
15871
15842
|
var meta = _a[_i];
|
|
15872
15843
|
if (pe[meta.id + "_modified"]() && meta.id !== "fields") {
|
|
15873
|
-
retVal.push("."
|
|
15844
|
+
retVal.push("." + meta.id + "(" + JSON.stringify(pe[meta.id]()) + ")");
|
|
15874
15845
|
}
|
|
15875
15846
|
}
|
|
15876
15847
|
return retVal;
|
|
@@ -15880,29 +15851,29 @@
|
|
|
15880
15851
|
var retVal = "";
|
|
15881
15852
|
var meta;
|
|
15882
15853
|
if (props.__class) {
|
|
15883
|
-
meta = util$
|
|
15854
|
+
meta = util$1.classID2Meta(props.__class);
|
|
15884
15855
|
imports.append(meta);
|
|
15885
|
-
retVal += "new "
|
|
15856
|
+
retVal += "new " + meta.class + "()";
|
|
15886
15857
|
}
|
|
15887
15858
|
for (var prop in props) {
|
|
15888
15859
|
if (prop === "__class") ;
|
|
15889
|
-
else if (util$
|
|
15890
|
-
var arr = ""
|
|
15860
|
+
else if (util$1.isArray(props[prop])) {
|
|
15861
|
+
var arr = "" + props[prop].map(function (item) { return _this.joinWithPrefix(item, imports, joinStr + " ", ""); }).join("," + joinStr + " ");
|
|
15891
15862
|
if (arr) {
|
|
15892
|
-
retVal +=
|
|
15863
|
+
retVal += joinStr + " ." + prop + "([" + joinStr + " " + arr + joinStr + " ])" + postFix;
|
|
15893
15864
|
}
|
|
15894
15865
|
}
|
|
15895
15866
|
else {
|
|
15896
|
-
retVal +=
|
|
15867
|
+
retVal += joinStr + " ." + prop + "(" + JSON.stringify(props[prop]) + ")" + postFix;
|
|
15897
15868
|
}
|
|
15898
15869
|
}
|
|
15899
15870
|
return retVal;
|
|
15900
15871
|
};
|
|
15901
15872
|
JavaScriptAdapter.prototype.writeWidget = function (dataview, imports) {
|
|
15902
|
-
return " export const "
|
|
15873
|
+
return " export const " + dataview.visualization.id + " = new marshaller.VizChartPanel()\n .id(\"" + dataview.visualization.id + "\")\n .title(\"" + dataview.visualization.title + "\")\n .widget(" + this.joinWithPrefix(dataview.visualization.properties["widget"], imports, "\n ", "") + ")\n ;";
|
|
15903
15874
|
};
|
|
15904
15875
|
JavaScriptAdapter.prototype.writeElement = function (dataview) {
|
|
15905
|
-
var activities = ["data."
|
|
15876
|
+
var activities = ["data." + this.datasourceRefID(dataview)];
|
|
15906
15877
|
for (var _i = 0, _a = dataview.activities; _i < _a.length; _i++) {
|
|
15907
15878
|
var activity = _a[_i];
|
|
15908
15879
|
activities.push(this.writeActivity(activity));
|
|
@@ -15910,9 +15881,9 @@
|
|
|
15910
15881
|
var updates = [];
|
|
15911
15882
|
for (var _b = 0, _c = this._ec.filteredBy(dataview.id); _b < _c.length; _b++) {
|
|
15912
15883
|
var filteredViz = _c[_b];
|
|
15913
|
-
updates.push(
|
|
15884
|
+
updates.push(filteredViz.id() + ".refresh();");
|
|
15914
15885
|
}
|
|
15915
|
-
return "\nconst "
|
|
15886
|
+
return "\nconst " + dataview.id + " = new marshaller.Element(ec)\n .id(\"" + dataview.id + "\")\n .pipeline([\n " + activities.join(",\n ") + "\n ])\n .mappings(new marshaller.Mappings().transformations(" + stringify(dataview.visualization.mappings.transformations) + "))\n .chartPanel(viz." + dataview.visualization.id + ")\n .on(\"selectionChanged\", () => {\n " + updates.join("\n ") + "\n }, true)\n ;\n" + dataview.id + ".visualization()\n .visibility(\"" + dataview.visualization.visibility + "\")\n .secondaryDataviewID(\"" + (dataview.visualization.secondaryDataviewID || "") + "\")\n ;\nec.append(" + dataview.id + ");\n";
|
|
15916
15887
|
};
|
|
15917
15888
|
JavaScriptAdapter.prototype.writeDatasources = function () {
|
|
15918
15889
|
var retVal = [];
|
|
@@ -15944,7 +15915,7 @@
|
|
|
15944
15915
|
};
|
|
15945
15916
|
JavaScriptAdapter.prototype.createJavaScript = function () {
|
|
15946
15917
|
var widgets = this.writeWidgets();
|
|
15947
|
-
return
|
|
15918
|
+
return widgets.widgetImports + "\nimport * as marshaller from \"@hpcc-js/marshaller\";\n\n// Dashboard Element Container (Model) ---\nconst ec = new marshaller.ElementContainer();\n\nnamespace data {\n" + this.writeDatasources().join("\n") + "\n}\n\nnamespace viz {\n" + widgets.widgetDefs + "\n}\n\n// Dashboard Elements (Controller) ---\n" + this.writeElements().trim() + "\n\nec.refresh();\n\n// Optional ---\nconst errors = ec.validate();\nfor (const error of errors) {\n console.error(error.elementID + \" (\" + error.source + \"): \" + error.msg);\n}\n\nexport const dashboard = new marshaller.Dashboard(ec)\n .target(\"placeholder\")\n .titleVisible(false)\n .hideSingleTabs(true)\n .layoutObj(" + stringify(this._dashboard.layout()) + ")\n .render()\n ;\n\n// @ts-ignore\nconst ddl = " + JSON.stringify(this._ddlSchema) + ";\n";
|
|
15948
15919
|
};
|
|
15949
15920
|
return JavaScriptAdapter;
|
|
15950
15921
|
}());
|
|
@@ -15976,8 +15947,8 @@
|
|
|
15976
15947
|
}
|
|
15977
15948
|
}
|
|
15978
15949
|
|
|
15979
|
-
var css_248z
|
|
15980
|
-
styleInject(css_248z
|
|
15950
|
+
var css_248z = ".p-Widget.phosphor_WidgetAdapter.p-DockPanel-widget.active{border-color:#5589ff;box-shadow:0 -1px 0 #5589ff,1px 1px 2px rgba(0,0,0,.2)}.p-TabBar-tab.p-mod-current.active{border-color:#5589ff}.p-TabBar-tab.p-mod-current.error{background:red;background:linear-gradient(180deg,rgba(255,0,0,.5),#fff)}";
|
|
15951
|
+
styleInject(css_248z);
|
|
15981
15952
|
|
|
15982
15953
|
var Dashboard = /** @class */ (function (_super) {
|
|
15983
15954
|
__extends(Dashboard, _super);
|
|
@@ -16007,7 +15978,7 @@
|
|
|
16007
15978
|
.enabled(false)
|
|
16008
15979
|
.on("click", function () {
|
|
16009
15980
|
var elem = _this._prevActive;
|
|
16010
|
-
if (elem && window.confirm("Remove Widget \""
|
|
15981
|
+
if (elem && window.confirm("Remove Widget \"" + elem.id() + "\"?")) {
|
|
16011
15982
|
_this._ec.clear(elem.id());
|
|
16012
15983
|
_this.renderPromise().then(function () {
|
|
16013
15984
|
_this.vizActivation(undefined);
|
|
@@ -16203,7 +16174,7 @@
|
|
|
16203
16174
|
};
|
|
16204
16175
|
Dashboard.prototype.importDDL = function (ddl, baseUrl, wuid, dermatologyJson) {
|
|
16205
16176
|
if (dermatologyJson === void 0) { dermatologyJson = {}; }
|
|
16206
|
-
var ddl2 = isDDL2Schema(ddl) ? ddl : upgrade(ddl, baseUrl, wuid, true, dermatologyJson);
|
|
16177
|
+
var ddl2 = isDDL2Schema(ddl) ? ddl : upgrade$1(ddl, baseUrl, wuid, true, dermatologyJson);
|
|
16207
16178
|
return this.restore(ddl2, true);
|
|
16208
16179
|
};
|
|
16209
16180
|
Dashboard.prototype.javascript = function () {
|
|
@@ -16252,8 +16223,8 @@
|
|
|
16252
16223
|
}(layout.ChartPanel));
|
|
16253
16224
|
Dashboard.prototype._class += " dashboard_dashboard";
|
|
16254
16225
|
|
|
16255
|
-
var css_248z$
|
|
16256
|
-
styleInject(css_248z$
|
|
16226
|
+
var css_248z$1 = "";
|
|
16227
|
+
styleInject(css_248z$1);
|
|
16257
16228
|
|
|
16258
16229
|
var DDLEditor = /** @class */ (function (_super) {
|
|
16259
16230
|
__extends(DDLEditor, _super);
|
|
@@ -16339,7 +16310,7 @@
|
|
|
16339
16310
|
this.subgraphMap[id] = retVal;
|
|
16340
16311
|
}
|
|
16341
16312
|
this.vertices.push(retVal);
|
|
16342
|
-
retVal.title(""
|
|
16313
|
+
retVal.title("" + label);
|
|
16343
16314
|
retVal.getBBox(true);
|
|
16344
16315
|
return retVal;
|
|
16345
16316
|
};
|
|
@@ -16357,13 +16328,13 @@
|
|
|
16357
16328
|
this.vertices.push(retVal);
|
|
16358
16329
|
retVal
|
|
16359
16330
|
.textbox_shape_colorFill(fillColor)
|
|
16360
|
-
.text(tooltip ?
|
|
16331
|
+
.text(tooltip ? label + "\n" + tooltip : "" + label)
|
|
16361
16332
|
.tooltip(tooltip);
|
|
16362
16333
|
retVal.getBBox(true);
|
|
16363
16334
|
return retVal;
|
|
16364
16335
|
};
|
|
16365
16336
|
GraphAdapter.prototype.createEdge = function (sourceID, targetID) {
|
|
16366
|
-
var edgeID =
|
|
16337
|
+
var edgeID = sourceID + "->" + targetID;
|
|
16367
16338
|
var retVal = this.edgeMap[edgeID];
|
|
16368
16339
|
if (!retVal) {
|
|
16369
16340
|
retVal = new graph.Edge()
|
|
@@ -16379,27 +16350,27 @@
|
|
|
16379
16350
|
dsDetails = dsDetails.selection().datasource();
|
|
16380
16351
|
}
|
|
16381
16352
|
if (dsDetails instanceof WUResult) {
|
|
16382
|
-
var serverID = ""
|
|
16383
|
-
var server = this.createSubgraph(serverID, ""
|
|
16384
|
-
var wuID =
|
|
16385
|
-
var wu = this.createSubgraph(wuID, ""
|
|
16353
|
+
var serverID = "" + dsDetails.url();
|
|
16354
|
+
var server = this.createSubgraph(serverID, "" + serverID);
|
|
16355
|
+
var wuID = dsDetails.url() + "/" + dsDetails.wuid();
|
|
16356
|
+
var wu = this.createSubgraph(wuID, "" + dsDetails.wuid());
|
|
16386
16357
|
this.hierarchy.push({ parent: server, child: wu });
|
|
16387
|
-
var resultID =
|
|
16358
|
+
var resultID = wuID + "/" + dsDetails.resultName();
|
|
16388
16359
|
var result = this.createVertex(resultID, dsDetails.resultName(), { activity: dsDetails });
|
|
16389
16360
|
this.hierarchy.push({ parent: wu, child: result });
|
|
16390
16361
|
return resultID;
|
|
16391
16362
|
}
|
|
16392
16363
|
else if (dsDetails instanceof LogicalFile) {
|
|
16393
|
-
var serverID = ""
|
|
16394
|
-
var server = this.createSubgraph(serverID, ""
|
|
16395
|
-
var lfID =
|
|
16364
|
+
var serverID = "" + dsDetails.url();
|
|
16365
|
+
var server = this.createSubgraph(serverID, "" + serverID);
|
|
16366
|
+
var lfID = serverID + "/" + dsDetails.logicalFile();
|
|
16396
16367
|
var lf = this.createVertex(lfID, dsDetails.logicalFile(), { activity: dsDetails });
|
|
16397
16368
|
this.hierarchy.push({ parent: server, child: lf });
|
|
16398
16369
|
return lfID;
|
|
16399
16370
|
}
|
|
16400
16371
|
else if (dsDetails instanceof RoxieResultRef) {
|
|
16401
|
-
var serverID = ""
|
|
16402
|
-
var server = this.createSubgraph(serverID, ""
|
|
16372
|
+
var serverID = "" + dsDetails.url();
|
|
16373
|
+
var server = this.createSubgraph(serverID, "" + serverID);
|
|
16403
16374
|
var surfaceID = dsDetails.serviceID(); // `${dsDetails.url()}/${dsDetails.querySet()}`;
|
|
16404
16375
|
var surface = this.createSubgraph(surfaceID, dsDetails.querySet());
|
|
16405
16376
|
this.hierarchy.push({ parent: server, child: surface });
|
|
@@ -16408,7 +16379,7 @@
|
|
|
16408
16379
|
parent: surface,
|
|
16409
16380
|
child: this.createVertex(roxieID, dsDetails.queryID())
|
|
16410
16381
|
});
|
|
16411
|
-
var roxieResultID =
|
|
16382
|
+
var roxieResultID = surfaceID + "/" + dsDetails.resultName();
|
|
16412
16383
|
this.hierarchy.push({
|
|
16413
16384
|
parent: surface,
|
|
16414
16385
|
child: this.createVertex(roxieResultID, dsDetails.resultName(), { activity: dsDetails })
|
|
@@ -16417,15 +16388,15 @@
|
|
|
16417
16388
|
return roxieResultID;
|
|
16418
16389
|
}
|
|
16419
16390
|
else if (dsDetails instanceof RoxieResult) {
|
|
16420
|
-
var serverID = ""
|
|
16421
|
-
var server = this.createSubgraph(serverID, ""
|
|
16391
|
+
var serverID = "" + dsDetails.service().url();
|
|
16392
|
+
var server = this.createSubgraph(serverID, "" + serverID);
|
|
16422
16393
|
var querySetID = dsDetails.serviceID();
|
|
16423
16394
|
var querySet = this.createSubgraph(querySetID, dsDetails.service().querySet());
|
|
16424
16395
|
this.hierarchy.push({ parent: server, child: querySet });
|
|
16425
|
-
var queryID =
|
|
16396
|
+
var queryID = querySetID + "/" + dsDetails.service().queryID();
|
|
16426
16397
|
var query = this.createSubgraph(queryID, dsDetails.service().queryID());
|
|
16427
16398
|
this.hierarchy.push({ parent: querySet, child: query });
|
|
16428
|
-
var resultID =
|
|
16399
|
+
var resultID = queryID + "/" + dsDetails.resultName();
|
|
16429
16400
|
this.hierarchy.push({
|
|
16430
16401
|
parent: query,
|
|
16431
16402
|
child: this.createVertex(resultID, dsDetails.resultName(), { activity: dsDetails })
|
|
@@ -16434,8 +16405,8 @@
|
|
|
16434
16405
|
return resultID;
|
|
16435
16406
|
}
|
|
16436
16407
|
else if (dsDetails instanceof RestResultRef) {
|
|
16437
|
-
var serverID = ""
|
|
16438
|
-
var server = this.createSubgraph(serverID, ""
|
|
16408
|
+
var serverID = "" + dsDetails.url();
|
|
16409
|
+
var server = this.createSubgraph(serverID, "" + serverID);
|
|
16439
16410
|
var surfaceID = dsDetails.serviceID();
|
|
16440
16411
|
var surface = this.createSubgraph(surfaceID, dsDetails.action());
|
|
16441
16412
|
this.hierarchy.push({ parent: server, child: surface });
|
|
@@ -16444,7 +16415,7 @@
|
|
|
16444
16415
|
parent: surface,
|
|
16445
16416
|
child: this.createVertex(roxieID, dsDetails.action())
|
|
16446
16417
|
});
|
|
16447
|
-
var roxieResultID =
|
|
16418
|
+
var roxieResultID = surfaceID + "/" + dsDetails.resultName();
|
|
16448
16419
|
this.hierarchy.push({
|
|
16449
16420
|
parent: surface,
|
|
16450
16421
|
child: this.createVertex(roxieResultID, dsDetails.resultName(), { activity: dsDetails })
|
|
@@ -16453,13 +16424,13 @@
|
|
|
16453
16424
|
return roxieResultID;
|
|
16454
16425
|
}
|
|
16455
16426
|
else if (dsDetails instanceof RestResult) {
|
|
16456
|
-
var serverID = ""
|
|
16457
|
-
var server = this.createSubgraph(serverID, ""
|
|
16427
|
+
var serverID = "" + dsDetails.service().url();
|
|
16428
|
+
var server = this.createSubgraph(serverID, "" + serverID);
|
|
16458
16429
|
var serviceID = dsDetails.serviceID();
|
|
16459
|
-
var actionID =
|
|
16430
|
+
var actionID = serverID + "/" + dsDetails.service().action();
|
|
16460
16431
|
var action = this.createSubgraph(serviceID, dsDetails.service().action());
|
|
16461
16432
|
this.hierarchy.push({ parent: server, child: action });
|
|
16462
|
-
var resultID =
|
|
16433
|
+
var resultID = actionID + "/" + dsDetails.resultName();
|
|
16463
16434
|
this.hierarchy.push({
|
|
16464
16435
|
parent: action,
|
|
16465
16436
|
child: this.createVertex(resultID, dsDetails.resultName(), { activity: dsDetails })
|
|
@@ -16484,20 +16455,20 @@
|
|
|
16484
16455
|
}
|
|
16485
16456
|
};
|
|
16486
16457
|
GraphAdapter.prototype.createActivity = function (sourceID, view, activity, label) {
|
|
16487
|
-
var surface = this.createSubgraph(view.id(), ""
|
|
16458
|
+
var surface = this.createSubgraph(view.id(), "" + view.id(), { view: view });
|
|
16488
16459
|
var fillColor = null;
|
|
16489
16460
|
var tooltip = "";
|
|
16490
16461
|
if (activity.exists()) {
|
|
16491
16462
|
var errors = activity.validate();
|
|
16492
16463
|
if (errors.length) {
|
|
16493
16464
|
fillColor = "pink";
|
|
16494
|
-
tooltip = errors.map(function (error) { return
|
|
16465
|
+
tooltip = errors.map(function (error) { return error.source + ": " + error.msg; }).join("\n");
|
|
16495
16466
|
}
|
|
16496
16467
|
}
|
|
16497
16468
|
else {
|
|
16498
16469
|
fillColor = "lightgrey";
|
|
16499
16470
|
}
|
|
16500
|
-
var vertex = this.createVertex(activity.id(), label || ""
|
|
16471
|
+
var vertex = this.createVertex(activity.id(), label || "" + activity.classID(), { view: view, activity: activity }, tooltip, fillColor);
|
|
16501
16472
|
if (sourceID) {
|
|
16502
16473
|
this.createEdge(sourceID, activity.id());
|
|
16503
16474
|
}
|
|
@@ -16524,7 +16495,7 @@
|
|
|
16524
16495
|
var visualization = view.visualization();
|
|
16525
16496
|
var mappings = visualization.mappings();
|
|
16526
16497
|
var mappingVertexID = this.createActivity(prevID, view, mappings, "Mappings");
|
|
16527
|
-
var vizSubgraphID =
|
|
16498
|
+
var vizSubgraphID = visualization.id() + "-sg";
|
|
16528
16499
|
var surface = this.createSubgraph(vizSubgraphID, "Visualization", { visualization: visualization });
|
|
16529
16500
|
this.hierarchy.push({
|
|
16530
16501
|
parent: this.subgraphMap[view.id()],
|
|
@@ -16534,14 +16505,14 @@
|
|
|
16534
16505
|
parent: surface,
|
|
16535
16506
|
child: this.vertexMap[mappings.id()]
|
|
16536
16507
|
});
|
|
16537
|
-
var vizVertexID =
|
|
16508
|
+
var vizVertexID = visualization.id() + "-viz";
|
|
16538
16509
|
var widgetVertex = this.createVertex(vizVertexID, visualization.chartPanel().widget().classID(), { view: view, chartPanel: visualization.chartPanel() });
|
|
16539
16510
|
this.createEdge(mappingVertexID, vizVertexID);
|
|
16540
16511
|
this.hierarchy.push({
|
|
16541
16512
|
parent: surface,
|
|
16542
16513
|
child: widgetVertex
|
|
16543
16514
|
});
|
|
16544
|
-
var stateVertexID =
|
|
16515
|
+
var stateVertexID = visualization.id() + "-state";
|
|
16545
16516
|
var stateVertex = this.createVertex(stateVertexID, "Selection", { view: view, state: view.state() });
|
|
16546
16517
|
this.createEdge(vizVertexID, stateVertexID)
|
|
16547
16518
|
.weight(10)
|
|
@@ -16562,7 +16533,7 @@
|
|
|
16562
16533
|
var secondaryElement = this._ec.element(visualization.secondaryDataviewID());
|
|
16563
16534
|
if (secondaryElement) {
|
|
16564
16535
|
var mappings = secondaryElement.visualization().mappings();
|
|
16565
|
-
this.createEdge(mappings.id(),
|
|
16536
|
+
this.createEdge(mappings.id(), visualization.id() + "-viz");
|
|
16566
16537
|
}
|
|
16567
16538
|
}
|
|
16568
16539
|
for (var _f = 0, _g = this._ec.elements(); _f < _g.length; _f++) {
|
|
@@ -16803,7 +16774,7 @@
|
|
|
16803
16774
|
var data = this._ec.elements().map(function (elem) {
|
|
16804
16775
|
return [elem.id(), elem.visualization().title(), elem];
|
|
16805
16776
|
});
|
|
16806
|
-
var dataID = util$
|
|
16777
|
+
var dataID = util$1.hashSum(data.map(function (row) { return row[0]; }));
|
|
16807
16778
|
if (this._prevDataID !== dataID) {
|
|
16808
16779
|
this._prevDataID = dataID;
|
|
16809
16780
|
this.data(data);
|
|
@@ -16813,8 +16784,8 @@
|
|
|
16813
16784
|
return DVTable;
|
|
16814
16785
|
}(layout.ChartPanel));
|
|
16815
16786
|
|
|
16816
|
-
var css_248z$
|
|
16817
|
-
styleInject(css_248z$
|
|
16787
|
+
var css_248z$2 = ".common_SelectionButton.error{background:red;background:linear-gradient(180deg,rgba(255,0,0,.5),hsla(0,0%,100%,0) 80%)}";
|
|
16788
|
+
styleInject(css_248z$2);
|
|
16818
16789
|
|
|
16819
16790
|
var PipelineSelectionButton = /** @class */ (function (_super) {
|
|
16820
16791
|
__extends(PipelineSelectionButton, _super);
|
|
@@ -16840,7 +16811,7 @@
|
|
|
16840
16811
|
this.tooltip(_.map(function (err) {
|
|
16841
16812
|
var errSourceParts = err.source.split(".");
|
|
16842
16813
|
errSourceParts.splice(0, 1);
|
|
16843
|
-
return
|
|
16814
|
+
return errSourceParts.join(".") + ": " + err.msg;
|
|
16844
16815
|
}).join("\n"));
|
|
16845
16816
|
}
|
|
16846
16817
|
else {
|
|
@@ -17119,7 +17090,7 @@
|
|
|
17119
17090
|
return PipelinePanel;
|
|
17120
17091
|
}(layout.ChartPanel));
|
|
17121
17092
|
PipelinePanel.prototype._class += " marshaller_PipelinePanel";
|
|
17122
|
-
var DDLPreview
|
|
17093
|
+
var DDLPreview = /** @class */ (function (_super) {
|
|
17123
17094
|
__extends(DDLPreview, _super);
|
|
17124
17095
|
function DDLPreview() {
|
|
17125
17096
|
var _this = _super.call(this) || this;
|
|
@@ -17186,7 +17157,7 @@
|
|
|
17186
17157
|
_this.propChanged(id, newValue, oldValue, source);
|
|
17187
17158
|
});
|
|
17188
17159
|
_this._previewPanel = new phosphor.TabPanel();
|
|
17189
|
-
_this._rhsDDLPreview = new DDLPreview
|
|
17160
|
+
_this._rhsDDLPreview = new DDLPreview();
|
|
17190
17161
|
_this._rhsDataPreview = new dgrid.DatasourceTable().pagination(true);
|
|
17191
17162
|
_this._previewPanel
|
|
17192
17163
|
.addWidget(_this._rhsDataPreview, "Data")
|
|
@@ -17237,11 +17208,11 @@
|
|
|
17237
17208
|
return PipelineSplitPanel;
|
|
17238
17209
|
}(phosphor.SplitPanel));
|
|
17239
17210
|
|
|
17240
|
-
var css_248z = ".graph_Graph .graphVertex>.subgraph .title rect{fill:#dcf1ff;border-bottom-width:0}.graph_Graph .graphVertex>.subgraph .title text{fill:#000}.graph_Graph .graphVertex>.subgraph rect{fill:none}.graph_Graph .graphVertex .graph_Vertex.selected .common_Shape,.graph_Graph .graphVertex>.subgraph.selected rect{stroke:red!important}.graph_Graph .common_Surface .common_Menu{visibility:hidden}.p-MenuBar{background:#fafafa;
|
|
17241
|
-
styleInject(css_248z);
|
|
17211
|
+
var css_248z$3 = ".graph_Graph .graphVertex>.subgraph .title rect{fill:#dcf1ff;border-bottom-width:0}.graph_Graph .graphVertex>.subgraph .title text{fill:#000}.graph_Graph .graphVertex>.subgraph rect{fill:none}.graph_Graph .graphVertex .graph_Vertex.selected .common_Shape,.graph_Graph .graphVertex>.subgraph.selected rect{stroke:red!important}.graph_Graph .common_Surface .common_Menu{visibility:hidden}.p-MenuBar{padding-left:5px;background:#fafafa;color:rgba(0,0,0,.87);border-bottom:1px solid #ddd;font:13px Helvetica,Arial,sans-serif}.p-MenuBar-menu{transform:translateY(-1px)}.p-MenuBar-item{padding:4px 8px;border-left:1px solid transparent;border-right:1px solid transparent}.p-MenuBar-item.p-mod-active{background:#e5e5e5}.p-MenuBar.p-mod-active .p-MenuBar-item.p-mod-active{z-index:10001;background:#fff;border-left:1px solid silver;border-right:1px solid silver;box-shadow:0 0 6px rgba(0,0,0,.2)}.p-Menu{padding:3px 0;background:#fff;color:rgba(0,0,0,.87);border:1px solid silver;font:12px Helvetica,Arial,sans-serif;box-shadow:0 1px 6px rgba(0,0,0,.2)}.p-Menu-item.p-mod-active{background:#e5e5e5}.p-Menu-item.p-mod-disabled{color:rgba(0,0,0,.25)}.p-Menu-itemIcon{width:21px;padding:4px 2px}.p-Menu-itemLabel{padding:4px 35px 4px 2px}.p-Menu-itemMnemonic{text-decoration:underline}.p-Menu-itemShortcut{padding:4px 0}.p-Menu-itemSubmenuIcon{width:16px;padding:4px 0}.p-Menu-item[data-type=separator]>div{padding:0;height:9px}.p-Menu-item[data-type=separator]>div:after{content:\"\";display:block;position:relative;top:4px;border-top:1px solid #ddd}.p-Menu-itemIcon:before,.p-Menu-itemSubmenuIcon:before{font-family:FontAwesome}.p-Menu-item.p-mod-toggled>.p-Menu-itemIcon:before{content:\"\\f00c\"}.p-Menu-item[data-type=submenu]>.p-Menu-itemSubmenuIcon:before{content:\"\\f0da\"}.p-CommandPalette{font-family:sans-serif;background:#f5f5f5}.p-CommandPalette-search{padding:8px}.p-CommandPalette-wrapper{padding:4px 6px;background:#fff;border:1px solid #e0e0e0}.p-CommandPalette-input{width:100%;border:none;outline:none;font-size:16px}.p-CommandPalette-header{padding:4px;color:#757575;font-size:12px;font-weight:600;background:#e1e1e1;cursor:pointer}.p-CommandPalette-header:hover:before{content:\"\\2026\";float:right;margin-right:4px}.p-CommandPalette-header>mark{background-color:transparent;font-weight:700}.p-CommandPalette-item{padding:4px 8px;color:#757575;font-size:13px;font-weight:500}.p-CommandPalette-emptyMessage{padding:4px;color:#757575;font-size:12px;font-weight:600;text-align:center}.p-CommandPalette-item.p-mod-disabled{color:rgba(0,0,0,.25)}.p-CommandPalette-item.p-mod-active{background:#7fdbff}.p-CommandPalette-item:hover:not(.p-mod-active):not(.p-mod-disabled){background:#e5e5e5}.p-CommandPalette-itemLabel>mark{background-color:transparent;font-weight:700}.p-CommandPalette-item.p-mod-disabled mark{color:rgba(0,0,0,.4)}.p-CommandPalette-itemCaption{color:#9e9e9e;font-size:11px;font-weight:400}";
|
|
17212
|
+
styleInject(css_248z$3);
|
|
17242
17213
|
|
|
17243
|
-
var logger = util$
|
|
17244
|
-
var DDLPreview = /** @class */ (function (_super) {
|
|
17214
|
+
var logger$1 = util$1.scopedLogger("marshaller/dashy");
|
|
17215
|
+
var DDLPreview$1 = /** @class */ (function (_super) {
|
|
17245
17216
|
__extends(DDLPreview, _super);
|
|
17246
17217
|
function DDLPreview(_dashy) {
|
|
17247
17218
|
var _this = _super.call(this) || this;
|
|
@@ -17326,7 +17297,7 @@
|
|
|
17326
17297
|
.on("vertex_contextmenu", function (row, col, sel, ext) {
|
|
17327
17298
|
});
|
|
17328
17299
|
_this._lhsDebugSheet = new phosphor.TabPanel();
|
|
17329
|
-
_this._lhsDebugDDLEditor = new DDLPreview(_this);
|
|
17300
|
+
_this._lhsDebugDDLEditor = new DDLPreview$1(_this);
|
|
17330
17301
|
_this._lhsDebugDDLSchema = new codemirror.JSONEditor().json(ddl2Schema);
|
|
17331
17302
|
_this._lhsDebugJSEditor = new codemirror.JSEditor();
|
|
17332
17303
|
_this._lhsDebugCloneEC = new ElementContainer();
|
|
@@ -17390,7 +17361,7 @@
|
|
|
17390
17361
|
for (var _i = 0, _a = _this._elementContainer.validate(); _i < _a.length; _i++) {
|
|
17391
17362
|
var error = _a[_i];
|
|
17392
17363
|
hasError = true;
|
|
17393
|
-
logger.warning(error.elementID + " (" + error.source + "): " + error.msg);
|
|
17364
|
+
logger$1.warning(error.elementID + " (" + error.source + "): " + error.msg);
|
|
17394
17365
|
}
|
|
17395
17366
|
if (hasError) {
|
|
17396
17367
|
// Re-render to highlight errrors ---
|
|
@@ -17401,7 +17372,7 @@
|
|
|
17401
17372
|
};
|
|
17402
17373
|
Dashy.prototype.importDDL = function (ddl, baseUrl, wuid, dermatologyJson) {
|
|
17403
17374
|
if (dermatologyJson === void 0) { dermatologyJson = {}; }
|
|
17404
|
-
var ddl2 = isDDL2Schema(ddl) ? ddl : upgrade(ddl, baseUrl, wuid, true, dermatologyJson);
|
|
17375
|
+
var ddl2 = isDDL2Schema(ddl) ? ddl : upgrade$1(ddl, baseUrl, wuid, true, dermatologyJson);
|
|
17405
17376
|
var retVal = this.restore(ddl2);
|
|
17406
17377
|
if (isDDL2Schema(ddl)) {
|
|
17407
17378
|
this._lhsDebugDDLv2.json(ddl2);
|
|
@@ -17464,7 +17435,7 @@
|
|
|
17464
17435
|
};
|
|
17465
17436
|
Dashy.prototype.loadGraph = function () {
|
|
17466
17437
|
this._lhsPipeline
|
|
17467
|
-
.data(__assign
|
|
17438
|
+
.data(__assign({}, this._graphAdapter.createGraph()), true);
|
|
17468
17439
|
if (this.activeLHS() === this._lhsPipeline) {
|
|
17469
17440
|
this._lhsPipeline
|
|
17470
17441
|
.lazyRender();
|
|
@@ -17497,7 +17468,7 @@
|
|
|
17497
17468
|
}).then(function () {
|
|
17498
17469
|
for (var _i = 0, _a = _this._lhsDebugCloneEC.validate(); _i < _a.length; _i++) {
|
|
17499
17470
|
var error = _a[_i];
|
|
17500
|
-
logger.warning(error.elementID + " (" + error.source + "): " + error.msg);
|
|
17471
|
+
logger$1.warning(error.elementID + " (" + error.source + "): " + error.msg);
|
|
17501
17472
|
}
|
|
17502
17473
|
});
|
|
17503
17474
|
});
|
|
@@ -17545,11 +17516,11 @@
|
|
|
17545
17516
|
palette.addItem({ command: "remove", category: "Notebook" });
|
|
17546
17517
|
palette.id = "palette";
|
|
17547
17518
|
var contextMenu = new phosphor.ContextMenu({ commands: commands });
|
|
17548
|
-
contextMenu.addItem({ command: "dash_add", selector: "#"
|
|
17549
|
-
contextMenu.addItem({ command: "dash_clear", selector: "#"
|
|
17550
|
-
contextMenu.addItem({ type: "separator", selector: "#"
|
|
17551
|
-
contextMenu.addItem({ command: "dash_load", selector: "#"
|
|
17552
|
-
contextMenu.addItem({ command: "dash_save", selector: "#"
|
|
17519
|
+
contextMenu.addItem({ command: "dash_add", selector: "#" + this._lhsDashboard.id() });
|
|
17520
|
+
contextMenu.addItem({ command: "dash_clear", selector: "#" + this._lhsDashboard.id() });
|
|
17521
|
+
contextMenu.addItem({ type: "separator", selector: "#" + this._lhsDashboard.id() });
|
|
17522
|
+
contextMenu.addItem({ command: "dash_load", selector: "#" + this.id() });
|
|
17523
|
+
contextMenu.addItem({ command: "dash_save", selector: "#" + this.id() });
|
|
17553
17524
|
document.addEventListener("contextmenu", function (event) {
|
|
17554
17525
|
if (contextMenu.open(event)) {
|
|
17555
17526
|
event.preventDefault();
|
|
@@ -17693,7 +17664,9 @@
|
|
|
17693
17664
|
|
|
17694
17665
|
Object.defineProperty(exports, 'hookSend', {
|
|
17695
17666
|
enumerable: true,
|
|
17696
|
-
get: function () {
|
|
17667
|
+
get: function () {
|
|
17668
|
+
return comms.hookSend;
|
|
17669
|
+
}
|
|
17697
17670
|
});
|
|
17698
17671
|
exports.Activity = Activity;
|
|
17699
17672
|
exports.ActivityArray = ActivityArray;
|
|
@@ -17730,8 +17703,8 @@
|
|
|
17730
17703
|
exports.Mappings = Mappings;
|
|
17731
17704
|
exports.MultiField = MultiField;
|
|
17732
17705
|
exports.NullView = NullView;
|
|
17733
|
-
exports.PKG_NAME = PKG_NAME
|
|
17734
|
-
exports.PKG_VERSION = PKG_VERSION
|
|
17706
|
+
exports.PKG_NAME = PKG_NAME;
|
|
17707
|
+
exports.PKG_VERSION = PKG_VERSION;
|
|
17735
17708
|
exports.Project = Project;
|
|
17736
17709
|
exports.ProjectBase = ProjectBase;
|
|
17737
17710
|
exports.RemoteFilter = RemoteFilter;
|
|
@@ -17759,5 +17732,5 @@
|
|
|
17759
17732
|
|
|
17760
17733
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
17761
17734
|
|
|
17762
|
-
}));
|
|
17735
|
+
})));
|
|
17763
17736
|
//# sourceMappingURL=index.js.map
|