@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.es6.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Result, Workunit, createConnection, Query } from '@hpcc-js/comms';
|
|
2
2
|
export { hookSend } from '@hpcc-js/comms';
|
|
3
3
|
import { PropertyExt, publish, tsvParse, csvParse, nest, min, max, mean, median, variance, deviation, sum, Utility, descending, ascending, ToggleButton, Spacer, EntityRectList, Database, publishProxy, Widget, select, Button, SelectionButton, SelectionBar } from '@hpcc-js/common';
|
|
4
|
-
import { hashSum, update, isArray
|
|
4
|
+
import { hashSum, update, isArray, debounce, AsyncOrderedQueue, compare, find, scopedLogger, classID2Meta } from '@hpcc-js/util';
|
|
5
5
|
import { Area, Bubble, Bar, Column, Contour, HexBin, Line, Pie, Radar, RadialBar, Scatter, Step, WordCloud } from '@hpcc-js/chart';
|
|
6
6
|
import { Table, DatasourceTable } from '@hpcc-js/dgrid';
|
|
7
7
|
import { FieldForm } from '@hpcc-js/form';
|
|
@@ -12,9 +12,9 @@ import { DockPanel, SplitPanel, CommandRegistry, ContextMenu, TabPanel, CommandP
|
|
|
12
12
|
import { JSONEditor, JSEditor } from '@hpcc-js/codemirror';
|
|
13
13
|
import { PropertyEditor } from '@hpcc-js/other';
|
|
14
14
|
|
|
15
|
-
var PKG_NAME
|
|
16
|
-
var PKG_VERSION
|
|
17
|
-
var BUILD_VERSION = "2.
|
|
15
|
+
var PKG_NAME = "@hpcc-js/marshaller";
|
|
16
|
+
var PKG_VERSION = "2.23.107";
|
|
17
|
+
var BUILD_VERSION = "2.101.0";
|
|
18
18
|
|
|
19
19
|
/*! *****************************************************************************
|
|
20
20
|
Copyright (c) Microsoft Corporation.
|
|
@@ -47,15 +47,15 @@ function __extends(d, b) {
|
|
|
47
47
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
var __assign
|
|
51
|
-
__assign
|
|
50
|
+
var __assign = function() {
|
|
51
|
+
__assign = Object.assign || function __assign(t) {
|
|
52
52
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
53
53
|
s = arguments[i];
|
|
54
54
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
55
55
|
}
|
|
56
56
|
return t;
|
|
57
57
|
};
|
|
58
|
-
return __assign
|
|
58
|
+
return __assign.apply(this, arguments);
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
function __decorate(decorators, target, key, desc) {
|
|
@@ -107,14 +107,14 @@ function __generator(thisArg, body) {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
function __spreadArray
|
|
110
|
+
function __spreadArray(to, from, pack) {
|
|
111
111
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
112
112
|
if (ar || !(i in from)) {
|
|
113
113
|
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
114
114
|
ar[i] = from[i];
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
return to.concat(ar ||
|
|
117
|
+
return to.concat(ar || from);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
function stringify(obj_from_json) {
|
|
@@ -130,9 +130,9 @@ function stringify(obj_from_json) {
|
|
|
130
130
|
// but without quotes around the keys.
|
|
131
131
|
var props = Object
|
|
132
132
|
.keys(obj_from_json)
|
|
133
|
-
.map(function (key) { return
|
|
133
|
+
.map(function (key) { return key + ": " + stringify(obj_from_json[key]); })
|
|
134
134
|
.join(", ");
|
|
135
|
-
return "{ "
|
|
135
|
+
return "{ " + props + " }";
|
|
136
136
|
}
|
|
137
137
|
function schemaType2IFieldType(type) {
|
|
138
138
|
switch (type) {
|
|
@@ -231,7 +231,7 @@ var Activity = /** @class */ (function (_super) {
|
|
|
231
231
|
};
|
|
232
232
|
Activity.prototype.hash = function (more) {
|
|
233
233
|
if (more === void 0) { more = {}; }
|
|
234
|
-
return hashSum(__assign
|
|
234
|
+
return hashSum(__assign({}, more));
|
|
235
235
|
};
|
|
236
236
|
Activity.prototype.refreshMeta = function () {
|
|
237
237
|
return this._sourceActivity ? this._sourceActivity.refreshMeta() : Promise.resolve();
|
|
@@ -387,7 +387,7 @@ var ActivityPipeline = /** @class */ (function (_super) {
|
|
|
387
387
|
// Activity overrides ---
|
|
388
388
|
ActivityPipeline.prototype.hash = function (more) {
|
|
389
389
|
if (more === void 0) { more = {}; }
|
|
390
|
-
return hashSum(__assign
|
|
390
|
+
return hashSum(__assign({ activities: [this.activities().map(function (activity) { return activity.hash(); })] }, more));
|
|
391
391
|
};
|
|
392
392
|
ActivityPipeline.prototype.refreshMeta = function () {
|
|
393
393
|
return this.last().refreshMeta();
|
|
@@ -451,7 +451,7 @@ var ActivitySelection = /** @class */ (function (_super) {
|
|
|
451
451
|
// Activity overrides ---
|
|
452
452
|
ActivitySelection.prototype.hash = function (more) {
|
|
453
453
|
if (more === void 0) { more = {}; }
|
|
454
|
-
return hashSum(__assign
|
|
454
|
+
return hashSum(__assign({ selection: this.selection().hash() }, more));
|
|
455
455
|
};
|
|
456
456
|
ActivitySelection.prototype.label = function () {
|
|
457
457
|
return this.selection().label();
|
|
@@ -498,7 +498,7 @@ var Datasource = /** @class */ (function (_super) {
|
|
|
498
498
|
__extends(Datasource, _super);
|
|
499
499
|
function Datasource() {
|
|
500
500
|
var _this = _super.call(this) || this;
|
|
501
|
-
_this._id = "ds_"
|
|
501
|
+
_this._id = "ds_" + ++datasourceID;
|
|
502
502
|
return _this;
|
|
503
503
|
}
|
|
504
504
|
return Datasource;
|
|
@@ -517,7 +517,7 @@ var DatasourceRef = /** @class */ (function (_super) {
|
|
|
517
517
|
};
|
|
518
518
|
DatasourceRef.prototype.hash = function (more) {
|
|
519
519
|
if (more === void 0) { more = {}; }
|
|
520
|
-
return _super.prototype.hash.call(this, __assign
|
|
520
|
+
return _super.prototype.hash.call(this, __assign({ datasource: this._datasource ? this._datasource.hash(more) : undefined }, more));
|
|
521
521
|
};
|
|
522
522
|
DatasourceRef.prototype.toDDL = function () {
|
|
523
523
|
return {
|
|
@@ -630,7 +630,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
630
630
|
};
|
|
631
631
|
Form.prototype.hash = function (more) {
|
|
632
632
|
if (more === void 0) { more = {}; }
|
|
633
|
-
return _super.prototype.hash.call(this, __assign
|
|
633
|
+
return _super.prototype.hash.call(this, __assign({ ddl: this.toDDL() }, more));
|
|
634
634
|
};
|
|
635
635
|
Form.prototype.refreshMeta = function () {
|
|
636
636
|
return Promise.resolve();
|
|
@@ -665,7 +665,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
665
665
|
Form.prototype._class += " Form";
|
|
666
666
|
|
|
667
667
|
function fieldType(field) {
|
|
668
|
-
if (isArray
|
|
668
|
+
if (isArray(field)) {
|
|
669
669
|
return "dataset";
|
|
670
670
|
}
|
|
671
671
|
var type = typeof field;
|
|
@@ -775,7 +775,7 @@ var Databomb = /** @class */ (function (_super) {
|
|
|
775
775
|
}
|
|
776
776
|
};
|
|
777
777
|
Databomb.prototype.hash = function (more) {
|
|
778
|
-
return _super.prototype.hash.call(this, __assign
|
|
778
|
+
return _super.prototype.hash.call(this, __assign({ ddl: this.toDDL(true) }, more)) + this.payload();
|
|
779
779
|
};
|
|
780
780
|
Databomb.prototype.refreshMeta = function () {
|
|
781
781
|
return Promise.resolve();
|
|
@@ -927,7 +927,7 @@ var ESPResult = /** @class */ (function (_super) {
|
|
|
927
927
|
}
|
|
928
928
|
ESPResult.prototype.hash = function (more) {
|
|
929
929
|
if (more === void 0) { more = {}; }
|
|
930
|
-
return hashSum(__assign
|
|
930
|
+
return hashSum(__assign({ samples: this.samples(), sampleSize: this.sampleSize() }, more));
|
|
931
931
|
};
|
|
932
932
|
ESPResult.prototype.refreshMeta = function () {
|
|
933
933
|
var _this = this;
|
|
@@ -1079,7 +1079,7 @@ var WUResult = /** @class */ (function (_super) {
|
|
|
1079
1079
|
});
|
|
1080
1080
|
};
|
|
1081
1081
|
WUResult.prototype.label = function () {
|
|
1082
|
-
return
|
|
1082
|
+
return this.wuid() + "\n" + this.resultName();
|
|
1083
1083
|
};
|
|
1084
1084
|
__decorate([
|
|
1085
1085
|
publish(null, "widget", "Workunit"),
|
|
@@ -1273,7 +1273,7 @@ var LogicalFile = /** @class */ (function (_super) {
|
|
|
1273
1273
|
});
|
|
1274
1274
|
};
|
|
1275
1275
|
LogicalFile.prototype.label = function () {
|
|
1276
|
-
return ""
|
|
1276
|
+
return "" + this.logicalFile();
|
|
1277
1277
|
};
|
|
1278
1278
|
__decorate([
|
|
1279
1279
|
publish("", "string", "ESP Url (http://x.x.x.x:8010)"),
|
|
@@ -1362,7 +1362,7 @@ var RestService = /** @class */ (function (_super) {
|
|
|
1362
1362
|
};
|
|
1363
1363
|
RestService.prototype.hash = function (more) {
|
|
1364
1364
|
if (more === void 0) { more = {}; }
|
|
1365
|
-
return hashSum(__assign
|
|
1365
|
+
return hashSum(__assign({ url: this.url(), action: this.action(), mode: this.mode() }, more));
|
|
1366
1366
|
};
|
|
1367
1367
|
RestService.prototype.label = function () {
|
|
1368
1368
|
return this.action();
|
|
@@ -1449,12 +1449,12 @@ var RestResult = /** @class */ (function (_super) {
|
|
|
1449
1449
|
};
|
|
1450
1450
|
RestResult.fromDDL = function (ec, rs, resultName) {
|
|
1451
1451
|
return new RestResult(ec)
|
|
1452
|
-
.id(
|
|
1452
|
+
.id(rs.id() + "_" + resultName)
|
|
1453
1453
|
.service(rs)
|
|
1454
1454
|
.resultName(resultName);
|
|
1455
1455
|
};
|
|
1456
1456
|
RestResult.prototype.serviceID = function () {
|
|
1457
|
-
return
|
|
1457
|
+
return this.service().url() + "/" + this.service().action() + "}";
|
|
1458
1458
|
};
|
|
1459
1459
|
RestResult.prototype.sourceHash = function () {
|
|
1460
1460
|
return this.service().hash();
|
|
@@ -1470,10 +1470,10 @@ var RestResult = /** @class */ (function (_super) {
|
|
|
1470
1470
|
};
|
|
1471
1471
|
RestResult.prototype.hash = function (more) {
|
|
1472
1472
|
if (more === void 0) { more = {}; }
|
|
1473
|
-
return hashSum(__assign
|
|
1473
|
+
return hashSum(__assign({ source: this.sourceHash(), resultName: this.resultName() }, more));
|
|
1474
1474
|
};
|
|
1475
1475
|
RestResult.prototype.label = function () {
|
|
1476
|
-
return
|
|
1476
|
+
return this.service().label() + "\n" + this.resultName();
|
|
1477
1477
|
};
|
|
1478
1478
|
RestResult.prototype.jsonDataFields = function () {
|
|
1479
1479
|
if (!this._jsonData || !this._jsonData.length)
|
|
@@ -1534,22 +1534,22 @@ var Param = /** @class */ (function (_super) {
|
|
|
1534
1534
|
var retVal = [];
|
|
1535
1535
|
if (!this.source_valid()) {
|
|
1536
1536
|
retVal.push({
|
|
1537
|
-
source:
|
|
1538
|
-
msg: "Invalid source: \""
|
|
1539
|
-
hint: "expected: "
|
|
1537
|
+
source: prefix + ".source." + this.source(),
|
|
1538
|
+
msg: "Invalid source: \"" + this.source() + "\"",
|
|
1539
|
+
hint: "expected: " + JSON.stringify(this.visualizationIDs())
|
|
1540
1540
|
});
|
|
1541
1541
|
}
|
|
1542
1542
|
if (!this.remoteField_valid()) {
|
|
1543
1543
|
retVal.push({
|
|
1544
|
-
source:
|
|
1545
|
-
msg: "Invalid remoteField: \""
|
|
1546
|
-
hint: "expected: "
|
|
1544
|
+
source: prefix + ".remoteField",
|
|
1545
|
+
msg: "Invalid remoteField: \"" + this.remoteField() + "\"",
|
|
1546
|
+
hint: "expected: " + JSON.stringify(this.sourceOutFields())
|
|
1547
1547
|
});
|
|
1548
1548
|
}
|
|
1549
1549
|
if (!this.value_valid()) {
|
|
1550
1550
|
retVal.push({
|
|
1551
|
-
source:
|
|
1552
|
-
msg: "Invalid value: \""
|
|
1551
|
+
source: prefix + ".value",
|
|
1552
|
+
msg: "Invalid value: \"" + this.value() + "\"",
|
|
1553
1553
|
hint: "expected: any value."
|
|
1554
1554
|
});
|
|
1555
1555
|
}
|
|
@@ -1715,7 +1715,7 @@ var RestResultRef = /** @class */ (function (_super) {
|
|
|
1715
1715
|
});
|
|
1716
1716
|
};
|
|
1717
1717
|
RestResultRef.prototype.label = function () {
|
|
1718
|
-
return
|
|
1718
|
+
return this.datasource().label() + "\n" + this.datasource().resultName();
|
|
1719
1719
|
};
|
|
1720
1720
|
RestResultRef.prototype.elementIDs = function () {
|
|
1721
1721
|
return this._ec.elementIDs();
|
|
@@ -1795,15 +1795,15 @@ function parseUrl(_) {
|
|
|
1795
1795
|
// "http://10.241.100.157:8002/WsEcl/submit/query/roxie/carmigjx_govbisgsavi.Ins4621360_Service_00000006/json",
|
|
1796
1796
|
var parts = _.split("/WsEcl/submit/query/");
|
|
1797
1797
|
if (parts.length < 2)
|
|
1798
|
-
throw new Error("Invalid roxie URL: "
|
|
1798
|
+
throw new Error("Invalid roxie URL: " + _);
|
|
1799
1799
|
var urlParts = parts[0].split(":");
|
|
1800
1800
|
if (urlParts.length < 3)
|
|
1801
|
-
throw new Error("Invalid roxie URL: "
|
|
1801
|
+
throw new Error("Invalid roxie URL: " + _);
|
|
1802
1802
|
var roxieParts = parts[1].split("/");
|
|
1803
1803
|
if (roxieParts.length < 2)
|
|
1804
|
-
throw new Error("Invalid roxie URL: "
|
|
1804
|
+
throw new Error("Invalid roxie URL: " + _);
|
|
1805
1805
|
return {
|
|
1806
|
-
url:
|
|
1806
|
+
url: urlParts[0] + ":" + urlParts[1] + ":" + (urlParts[2] === "18002" ? "18010" : "8010"),
|
|
1807
1807
|
querySet: roxieParts[0],
|
|
1808
1808
|
queryID: roxieParts[1]
|
|
1809
1809
|
};
|
|
@@ -1857,7 +1857,7 @@ var RoxieService = /** @class */ (function (_super) {
|
|
|
1857
1857
|
};
|
|
1858
1858
|
RoxieService.prototype.hash = function (more) {
|
|
1859
1859
|
if (more === void 0) { more = {}; }
|
|
1860
|
-
return hashSum(__assign
|
|
1860
|
+
return hashSum(__assign({ url: this.url(), querySet: this.querySet(), queryId: this.queryID(), ignoreHipieRequest: this.ignoreHipieRequest(), ignoreHipieResponse: this.ignoreHipieResponse() }, more));
|
|
1861
1861
|
};
|
|
1862
1862
|
RoxieService.prototype.label = function () {
|
|
1863
1863
|
return this.queryID();
|
|
@@ -1974,12 +1974,12 @@ var RoxieResult = /** @class */ (function (_super) {
|
|
|
1974
1974
|
};
|
|
1975
1975
|
RoxieResult.fromDDL = function (ec, rs, resultName) {
|
|
1976
1976
|
return new RoxieResult(ec)
|
|
1977
|
-
.id(
|
|
1977
|
+
.id(rs.id() + "_" + resultName)
|
|
1978
1978
|
.service(rs)
|
|
1979
1979
|
.resultName(resultName);
|
|
1980
1980
|
};
|
|
1981
1981
|
RoxieResult.prototype.serviceID = function () {
|
|
1982
|
-
return
|
|
1982
|
+
return this.service().url() + "/" + this.service().querySet() + "/" + this.service().queryID();
|
|
1983
1983
|
};
|
|
1984
1984
|
RoxieResult.prototype.sourceHash = function () {
|
|
1985
1985
|
return this.service().hash();
|
|
@@ -1995,10 +1995,10 @@ var RoxieResult = /** @class */ (function (_super) {
|
|
|
1995
1995
|
};
|
|
1996
1996
|
RoxieResult.prototype.hash = function (more) {
|
|
1997
1997
|
if (more === void 0) { more = {}; }
|
|
1998
|
-
return hashSum(__assign
|
|
1998
|
+
return hashSum(__assign({ source: this.sourceHash(), resultName: this.resultName() }, more));
|
|
1999
1999
|
};
|
|
2000
2000
|
RoxieResult.prototype.label = function () {
|
|
2001
|
-
return
|
|
2001
|
+
return this.service().label() + "\n" + this.resultName();
|
|
2002
2002
|
};
|
|
2003
2003
|
RoxieResult.prototype.computeFields = function (inFields) {
|
|
2004
2004
|
var _this = this;
|
|
@@ -2101,7 +2101,7 @@ var RoxieResultRef = /** @class */ (function (_super) {
|
|
|
2101
2101
|
});
|
|
2102
2102
|
};
|
|
2103
2103
|
RoxieResultRef.prototype.label = function () {
|
|
2104
|
-
return
|
|
2104
|
+
return this.datasource().label() + "\n" + this.datasource().resultName();
|
|
2105
2105
|
};
|
|
2106
2106
|
RoxieResultRef.prototype.elementIDs = function () {
|
|
2107
2107
|
return this._ec.elementIDs();
|
|
@@ -2226,7 +2226,7 @@ var HipieResultRef = /** @class */ (function (_super) {
|
|
|
2226
2226
|
var request = {};
|
|
2227
2227
|
for (var key in _request) {
|
|
2228
2228
|
request[key] = _request[key];
|
|
2229
|
-
request[
|
|
2229
|
+
request[key + "_changed"] = true;
|
|
2230
2230
|
}
|
|
2231
2231
|
return request;
|
|
2232
2232
|
};
|
|
@@ -2241,7 +2241,7 @@ var DSPicker = /** @class */ (function (_super) {
|
|
|
2241
2241
|
var _this = _super.call(this) || this;
|
|
2242
2242
|
_this._ec = _ec;
|
|
2243
2243
|
_this._nullDatasource = emptyDatabomb;
|
|
2244
|
-
_this._id = "ds_"
|
|
2244
|
+
_this._id = "ds_" + ++dsPickerID;
|
|
2245
2245
|
var ds = _this._ec.datasources()[0];
|
|
2246
2246
|
_this.datasourceID(ds.id());
|
|
2247
2247
|
return _this;
|
|
@@ -2298,18 +2298,18 @@ var DSPicker = /** @class */ (function (_super) {
|
|
|
2298
2298
|
return this.selection().validate();
|
|
2299
2299
|
};
|
|
2300
2300
|
DSPicker.prototype.toDDL = function () {
|
|
2301
|
-
return __assign
|
|
2301
|
+
return __assign(__assign({}, this.datasourceRef().toDDL()), { id: this.datasourceID() });
|
|
2302
2302
|
};
|
|
2303
2303
|
// Activity overrides ---
|
|
2304
2304
|
DSPicker.prototype.hash = function (more) {
|
|
2305
2305
|
if (more === void 0) { more = {}; }
|
|
2306
|
-
return _super.prototype.hash.call(this, __assign
|
|
2306
|
+
return _super.prototype.hash.call(this, __assign({}, more));
|
|
2307
2307
|
};
|
|
2308
2308
|
DSPicker.prototype.datasourceIDs = function () {
|
|
2309
2309
|
return this._ec.datasources().map(function (ds) {
|
|
2310
2310
|
return {
|
|
2311
2311
|
value: ds.id(),
|
|
2312
|
-
text:
|
|
2312
|
+
text: ds.label() + " " + (ds.id() !== ds.label() ? " (" + ds.id() + ")" : "")
|
|
2313
2313
|
};
|
|
2314
2314
|
});
|
|
2315
2315
|
};
|
|
@@ -2325,23 +2325,8 @@ var DSPicker = /** @class */ (function (_super) {
|
|
|
2325
2325
|
}(ActivitySelection));
|
|
2326
2326
|
DSPicker.prototype._class += " DSPicker";
|
|
2327
2327
|
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
2331
|
-
if (k !== 'default' && !(k in n)) {
|
|
2332
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
2333
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
2334
|
-
enumerable: true,
|
|
2335
|
-
get: function () { return e[k]; }
|
|
2336
|
-
});
|
|
2337
|
-
}
|
|
2338
|
-
});
|
|
2339
|
-
});
|
|
2340
|
-
return Object.freeze(n);
|
|
2341
|
-
}
|
|
2342
|
-
|
|
2343
|
-
var PKG_NAME = "@hpcc-js/ddl-shim";
|
|
2344
|
-
var PKG_VERSION = "2.17.21";
|
|
2328
|
+
var PKG_NAME$1 = "@hpcc-js/ddl-shim";
|
|
2329
|
+
var PKG_VERSION$1 = "2.17.25";
|
|
2345
2330
|
|
|
2346
2331
|
function isWorkunitDatasource(ref) {
|
|
2347
2332
|
return ref.WUID !== undefined;
|
|
@@ -2406,7 +2391,7 @@ function isLimitActivity(activity) {
|
|
|
2406
2391
|
}
|
|
2407
2392
|
var VisibilitySet = ["normal", "flyout"];
|
|
2408
2393
|
|
|
2409
|
-
var v2
|
|
2394
|
+
var v2 = /*#__PURE__*/Object.freeze({
|
|
2410
2395
|
__proto__: null,
|
|
2411
2396
|
isDatabombRef: isDatabombRef,
|
|
2412
2397
|
isWUResultRef: isWUResultRef,
|
|
@@ -2436,25 +2421,25 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
2436
2421
|
PERFORMANCE OF THIS SOFTWARE.
|
|
2437
2422
|
***************************************************************************** */
|
|
2438
2423
|
|
|
2439
|
-
var __assign = function() {
|
|
2440
|
-
__assign = Object.assign || function __assign(t) {
|
|
2424
|
+
var __assign$1 = function() {
|
|
2425
|
+
__assign$1 = Object.assign || function __assign(t) {
|
|
2441
2426
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2442
2427
|
s = arguments[i];
|
|
2443
2428
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
2444
2429
|
}
|
|
2445
2430
|
return t;
|
|
2446
2431
|
};
|
|
2447
|
-
return __assign.apply(this, arguments);
|
|
2432
|
+
return __assign$1.apply(this, arguments);
|
|
2448
2433
|
};
|
|
2449
2434
|
|
|
2450
|
-
function __spreadArray(to, from, pack) {
|
|
2435
|
+
function __spreadArray$1(to, from, pack) {
|
|
2451
2436
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
2452
2437
|
if (ar || !(i in from)) {
|
|
2453
2438
|
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
2454
2439
|
ar[i] = from[i];
|
|
2455
2440
|
}
|
|
2456
2441
|
}
|
|
2457
|
-
return to.concat(ar ||
|
|
2442
|
+
return to.concat(ar || from);
|
|
2458
2443
|
}
|
|
2459
2444
|
|
|
2460
2445
|
var classMappings = {
|
|
@@ -2670,7 +2655,7 @@ function apply_to_properties_layout(ddl2, dermObj) {
|
|
|
2670
2655
|
});
|
|
2671
2656
|
return retVal;
|
|
2672
2657
|
}
|
|
2673
|
-
function upgrade
|
|
2658
|
+
function upgrade(ddl2, dermObj) {
|
|
2674
2659
|
apply_to_dataviews(ddl2, dermObj);
|
|
2675
2660
|
return apply_to_properties_layout(ddl2, dermObj);
|
|
2676
2661
|
}
|
|
@@ -2890,7 +2875,7 @@ var DDLUpgrade = /** @class */ (function () {
|
|
|
2890
2875
|
break;
|
|
2891
2876
|
default:
|
|
2892
2877
|
groupByColumns.push(this.toLowerCase(field.id));
|
|
2893
|
-
throw new Error("Unhandled field function: "
|
|
2878
|
+
throw new Error("Unhandled field function: " + field.properties.function);
|
|
2894
2879
|
}
|
|
2895
2880
|
}
|
|
2896
2881
|
else {
|
|
@@ -2901,7 +2886,7 @@ var DDLUpgrade = /** @class */ (function () {
|
|
|
2901
2886
|
this._ddl2DataviewActivities[viz.id].project.transformations = projectTransformations;
|
|
2902
2887
|
}
|
|
2903
2888
|
if (aggrFields.length) {
|
|
2904
|
-
this._ddl2DataviewActivities[viz.id].groupBy.groupByIDs = __spreadArray([], groupByColumns
|
|
2889
|
+
this._ddl2DataviewActivities[viz.id].groupBy.groupByIDs = __spreadArray$1([], groupByColumns);
|
|
2905
2890
|
this._ddl2DataviewActivities[viz.id].groupBy.aggregates = aggrFields;
|
|
2906
2891
|
}
|
|
2907
2892
|
}
|
|
@@ -2919,7 +2904,7 @@ var DDLUpgrade = /** @class */ (function () {
|
|
|
2919
2904
|
case "MAX":
|
|
2920
2905
|
return "max";
|
|
2921
2906
|
}
|
|
2922
|
-
throw new Error("Unknown DDL1 Function Type: "
|
|
2907
|
+
throw new Error("Unknown DDL1 Function Type: " + func);
|
|
2923
2908
|
};
|
|
2924
2909
|
DDLUpgrade.prototype.readMappings = function () {
|
|
2925
2910
|
for (var _i = 0, _a = this._ddl.dashboards; _i < _a.length; _i++) {
|
|
@@ -2946,7 +2931,7 @@ var DDLUpgrade = /** @class */ (function () {
|
|
|
2946
2931
|
this.readSliderMappings(viz);
|
|
2947
2932
|
}
|
|
2948
2933
|
else {
|
|
2949
|
-
throw new Error("Unkown DDL1 mapping type: "
|
|
2934
|
+
throw new Error("Unkown DDL1 mapping type: " + viz.type);
|
|
2950
2935
|
}
|
|
2951
2936
|
}
|
|
2952
2937
|
}
|
|
@@ -3061,7 +3046,7 @@ var DDLUpgrade = /** @class */ (function () {
|
|
|
3061
3046
|
var flag = _a[_i];
|
|
3062
3047
|
if (flag.fieldid) {
|
|
3063
3048
|
mappings.transformations.push({
|
|
3064
|
-
fieldID: "annotation_"
|
|
3049
|
+
fieldID: "annotation_" + idx++,
|
|
3065
3050
|
type: "map",
|
|
3066
3051
|
sourceFieldID: this.toLowerCase(flag.fieldid),
|
|
3067
3052
|
default: {},
|
|
@@ -3120,7 +3105,7 @@ var DDLUpgrade = /** @class */ (function () {
|
|
|
3120
3105
|
var mapping = update.mappings[key];
|
|
3121
3106
|
var dsFilter = (mapping && dsFilters[mapping]) ? dsFilters[mapping].filter : undefined;
|
|
3122
3107
|
if (!dsFilter) {
|
|
3123
|
-
console.warn("Select Mapping \""
|
|
3108
|
+
console.warn("Select Mapping \"" + mapping + "\" in viz \"" + viz.id + "\" not found in filters for \"" + otherViz.id + "\"");
|
|
3124
3109
|
}
|
|
3125
3110
|
else {
|
|
3126
3111
|
condition.mappings.push({
|
|
@@ -3231,7 +3216,7 @@ var DDLUpgrade = /** @class */ (function () {
|
|
|
3231
3216
|
groupBy,
|
|
3232
3217
|
limit
|
|
3233
3218
|
],
|
|
3234
|
-
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 || {}) })
|
|
3219
|
+
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 || {}) })
|
|
3235
3220
|
};
|
|
3236
3221
|
};
|
|
3237
3222
|
DDLUpgrade.prototype.type2chartType = function (chartType) {
|
|
@@ -3361,8 +3346,8 @@ var DDLUpgrade = /** @class */ (function () {
|
|
|
3361
3346
|
return {
|
|
3362
3347
|
version: "2.2.1",
|
|
3363
3348
|
createdBy: {
|
|
3364
|
-
name: PKG_NAME,
|
|
3365
|
-
version: PKG_VERSION
|
|
3349
|
+
name: PKG_NAME$1,
|
|
3350
|
+
version: PKG_VERSION$1
|
|
3366
3351
|
},
|
|
3367
3352
|
datasources: this.writeDatasources(),
|
|
3368
3353
|
dataviews: this.writeDataviews(),
|
|
@@ -3371,24 +3356,43 @@ var DDLUpgrade = /** @class */ (function () {
|
|
|
3371
3356
|
};
|
|
3372
3357
|
return DDLUpgrade;
|
|
3373
3358
|
}());
|
|
3374
|
-
function upgrade(ddl, baseUrl, wuid, toLowerCase, dermatologyJson) {
|
|
3359
|
+
function upgrade$1(ddl, baseUrl, wuid, toLowerCase, dermatologyJson) {
|
|
3375
3360
|
if (toLowerCase === void 0) { toLowerCase = true; }
|
|
3376
3361
|
if (dermatologyJson === void 0) { dermatologyJson = {}; }
|
|
3377
3362
|
var ddlUp = new DDLUpgrade(ddl, baseUrl, wuid, toLowerCase);
|
|
3378
3363
|
var retVal = ddlUp.write();
|
|
3379
|
-
retVal.properties = upgrade
|
|
3364
|
+
retVal.properties = upgrade(retVal, dermatologyJson);
|
|
3380
3365
|
return retVal;
|
|
3381
3366
|
}
|
|
3382
3367
|
|
|
3383
3368
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
3384
3369
|
|
|
3385
|
-
|
|
3370
|
+
function unwrapExports (x) {
|
|
3371
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
3372
|
+
}
|
|
3386
3373
|
|
|
3387
|
-
|
|
3374
|
+
function createCommonjsModule(fn, basedir, module) {
|
|
3375
|
+
return module = {
|
|
3376
|
+
path: basedir,
|
|
3377
|
+
exports: {},
|
|
3378
|
+
require: function (path, base) {
|
|
3379
|
+
return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
|
|
3380
|
+
}
|
|
3381
|
+
}, fn(module, module.exports), module.exports;
|
|
3382
|
+
}
|
|
3388
3383
|
|
|
3389
|
-
|
|
3384
|
+
function getCjsExportFromNamespace (n) {
|
|
3385
|
+
return n && n['default'] || n;
|
|
3386
|
+
}
|
|
3387
|
+
|
|
3388
|
+
function commonjsRequire () {
|
|
3389
|
+
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
3390
|
+
}
|
|
3391
|
+
|
|
3392
|
+
var uri_all = createCommonjsModule(function (module, exports) {
|
|
3393
|
+
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
|
|
3390
3394
|
(function (global, factory) {
|
|
3391
|
-
|
|
3395
|
+
factory(exports) ;
|
|
3392
3396
|
}(commonjsGlobal, (function (exports) {
|
|
3393
3397
|
function merge() {
|
|
3394
3398
|
for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -3442,10 +3446,10 @@ function buildExps(isIRI) {
|
|
|
3442
3446
|
//subset, excludes bidi control characters
|
|
3443
3447
|
IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]",
|
|
3444
3448
|
//subset
|
|
3445
|
-
UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$)
|
|
3446
|
-
subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*")
|
|
3447
|
-
subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*")
|
|
3448
|
-
|
|
3449
|
+
UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$),
|
|
3450
|
+
SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"),
|
|
3451
|
+
USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"),
|
|
3452
|
+
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$$),
|
|
3449
3453
|
//relaxed parsing rules
|
|
3450
3454
|
IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$),
|
|
3451
3455
|
H16$ = subexp(HEXDIG$$ + "{1,4}"),
|
|
@@ -3469,14 +3473,14 @@ function buildExps(isIRI) {
|
|
|
3469
3473
|
IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"),
|
|
3470
3474
|
//[ *6( h16 ":" ) h16 ] "::"
|
|
3471
3475
|
IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")),
|
|
3472
|
-
ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+")
|
|
3476
|
+
ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"),
|
|
3473
3477
|
//RFC 6874, with relaxed parsing rules
|
|
3474
|
-
subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+")
|
|
3478
|
+
IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"),
|
|
3475
3479
|
//RFC 6874
|
|
3476
|
-
subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*")
|
|
3477
|
-
|
|
3478
|
-
subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+")
|
|
3479
|
-
subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*");
|
|
3480
|
+
REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"),
|
|
3481
|
+
PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")),
|
|
3482
|
+
SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"),
|
|
3483
|
+
QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*");
|
|
3480
3484
|
return {
|
|
3481
3485
|
NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
|
|
3482
3486
|
NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
|
|
@@ -4590,7 +4594,7 @@ var handler$3 = {
|
|
|
4590
4594
|
|
|
4591
4595
|
var O = {};
|
|
4592
4596
|
//RFC 3986
|
|
4593
|
-
var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + ("\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" ) + "]";
|
|
4597
|
+
var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + ( "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" ) + "]";
|
|
4594
4598
|
var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive
|
|
4595
4599
|
var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded
|
|
4596
4600
|
//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =
|
|
@@ -4788,23 +4792,22 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4788
4792
|
|
|
4789
4793
|
})));
|
|
4790
4794
|
|
|
4791
|
-
}
|
|
4795
|
+
});
|
|
4796
|
+
|
|
4797
|
+
unwrapExports(uri_all);
|
|
4798
|
+
|
|
4799
|
+
// do not edit .js files directly - edit src/index.jst
|
|
4800
|
+
|
|
4792
4801
|
|
|
4793
|
-
var isArray = Array.isArray;
|
|
4794
|
-
var keyList = Object.keys;
|
|
4795
|
-
var hasProp = Object.prototype.hasOwnProperty;
|
|
4796
4802
|
|
|
4797
4803
|
var fastDeepEqual = function equal(a, b) {
|
|
4798
4804
|
if (a === b) return true;
|
|
4799
4805
|
|
|
4800
4806
|
if (a && b && typeof a == 'object' && typeof b == 'object') {
|
|
4801
|
-
|
|
4802
|
-
, arrB = isArray(b)
|
|
4803
|
-
, i
|
|
4804
|
-
, length
|
|
4805
|
-
, key;
|
|
4807
|
+
if (a.constructor !== b.constructor) return false;
|
|
4806
4808
|
|
|
4807
|
-
|
|
4809
|
+
var length, i, keys;
|
|
4810
|
+
if (Array.isArray(a)) {
|
|
4808
4811
|
length = a.length;
|
|
4809
4812
|
if (length != b.length) return false;
|
|
4810
4813
|
for (i = length; i-- !== 0;)
|
|
@@ -4812,41 +4815,35 @@ var fastDeepEqual = function equal(a, b) {
|
|
|
4812
4815
|
return true;
|
|
4813
4816
|
}
|
|
4814
4817
|
|
|
4815
|
-
if (arrA != arrB) return false;
|
|
4816
4818
|
|
|
4817
|
-
var dateA = a instanceof Date
|
|
4818
|
-
, dateB = b instanceof Date;
|
|
4819
|
-
if (dateA != dateB) return false;
|
|
4820
|
-
if (dateA && dateB) return a.getTime() == b.getTime();
|
|
4821
4819
|
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
if (
|
|
4825
|
-
if (regexpA && regexpB) return a.toString() == b.toString();
|
|
4820
|
+
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
4821
|
+
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
|
4822
|
+
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
|
4826
4823
|
|
|
4827
|
-
|
|
4824
|
+
keys = Object.keys(a);
|
|
4828
4825
|
length = keys.length;
|
|
4829
|
-
|
|
4830
|
-
if (length !== keyList(b).length)
|
|
4831
|
-
return false;
|
|
4826
|
+
if (length !== Object.keys(b).length) return false;
|
|
4832
4827
|
|
|
4833
4828
|
for (i = length; i-- !== 0;)
|
|
4834
|
-
if (!
|
|
4829
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
4835
4830
|
|
|
4836
4831
|
for (i = length; i-- !== 0;) {
|
|
4837
|
-
key = keys[i];
|
|
4832
|
+
var key = keys[i];
|
|
4833
|
+
|
|
4838
4834
|
if (!equal(a[key], b[key])) return false;
|
|
4839
4835
|
}
|
|
4840
4836
|
|
|
4841
4837
|
return true;
|
|
4842
4838
|
}
|
|
4843
4839
|
|
|
4840
|
+
// true if both NaN, false otherwise
|
|
4844
4841
|
return a!==a && b!==b;
|
|
4845
4842
|
};
|
|
4846
4843
|
|
|
4847
4844
|
// https://mathiasbynens.be/notes/javascript-encoding
|
|
4848
4845
|
// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode
|
|
4849
|
-
var ucs2length
|
|
4846
|
+
var ucs2length = function ucs2length(str) {
|
|
4850
4847
|
var length = 0
|
|
4851
4848
|
, len = str.length
|
|
4852
4849
|
, pos = 0
|
|
@@ -4863,20 +4860,18 @@ var ucs2length$1 = function ucs2length(str) {
|
|
|
4863
4860
|
return length;
|
|
4864
4861
|
};
|
|
4865
4862
|
|
|
4866
|
-
var util
|
|
4863
|
+
var util = {
|
|
4867
4864
|
copy: copy,
|
|
4868
4865
|
checkDataType: checkDataType,
|
|
4869
4866
|
checkDataTypes: checkDataTypes,
|
|
4870
4867
|
coerceToTypes: coerceToTypes,
|
|
4871
|
-
toHash: toHash
|
|
4868
|
+
toHash: toHash,
|
|
4872
4869
|
getProperty: getProperty,
|
|
4873
4870
|
escapeQuotes: escapeQuotes,
|
|
4874
4871
|
equal: fastDeepEqual,
|
|
4875
|
-
ucs2length: ucs2length
|
|
4872
|
+
ucs2length: ucs2length,
|
|
4876
4873
|
varOccurences: varOccurences,
|
|
4877
4874
|
varReplace: varReplace,
|
|
4878
|
-
cleanUpCode: cleanUpCode,
|
|
4879
|
-
finalCleanUpCode: finalCleanUpCode,
|
|
4880
4875
|
schemaHasRules: schemaHasRules,
|
|
4881
4876
|
schemaHasRulesExcept: schemaHasRulesExcept,
|
|
4882
4877
|
schemaUnknownRules: schemaUnknownRules,
|
|
@@ -4898,7 +4893,7 @@ function copy(o, to) {
|
|
|
4898
4893
|
}
|
|
4899
4894
|
|
|
4900
4895
|
|
|
4901
|
-
function checkDataType(dataType, data, negate) {
|
|
4896
|
+
function checkDataType(dataType, data, strictNumbers, negate) {
|
|
4902
4897
|
var EQUAL = negate ? ' !== ' : ' === '
|
|
4903
4898
|
, AND = negate ? ' || ' : ' && '
|
|
4904
4899
|
, OK = negate ? '!' : ''
|
|
@@ -4911,18 +4906,21 @@ function checkDataType(dataType, data, negate) {
|
|
|
4911
4906
|
NOT + 'Array.isArray(' + data + '))';
|
|
4912
4907
|
case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND +
|
|
4913
4908
|
NOT + '(' + data + ' % 1)' +
|
|
4914
|
-
AND + data + EQUAL + data +
|
|
4909
|
+
AND + data + EQUAL + data +
|
|
4910
|
+
(strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')';
|
|
4911
|
+
case 'number': return '(typeof ' + data + EQUAL + '"' + dataType + '"' +
|
|
4912
|
+
(strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')';
|
|
4915
4913
|
default: return 'typeof ' + data + EQUAL + '"' + dataType + '"';
|
|
4916
4914
|
}
|
|
4917
4915
|
}
|
|
4918
4916
|
|
|
4919
4917
|
|
|
4920
|
-
function checkDataTypes(dataTypes, data) {
|
|
4918
|
+
function checkDataTypes(dataTypes, data, strictNumbers) {
|
|
4921
4919
|
switch (dataTypes.length) {
|
|
4922
|
-
case 1: return checkDataType(dataTypes[0], data, true);
|
|
4920
|
+
case 1: return checkDataType(dataTypes[0], data, strictNumbers, true);
|
|
4923
4921
|
default:
|
|
4924
4922
|
var code = '';
|
|
4925
|
-
var types = toHash
|
|
4923
|
+
var types = toHash(dataTypes);
|
|
4926
4924
|
if (types.array && types.object) {
|
|
4927
4925
|
code = types.null ? '(': '(!' + data + ' || ';
|
|
4928
4926
|
code += 'typeof ' + data + ' !== "object")';
|
|
@@ -4932,14 +4930,14 @@ function checkDataTypes(dataTypes, data) {
|
|
|
4932
4930
|
}
|
|
4933
4931
|
if (types.number) delete types.integer;
|
|
4934
4932
|
for (var t in types)
|
|
4935
|
-
code += (code ? ' && ' : '' ) + checkDataType(t, data, true);
|
|
4933
|
+
code += (code ? ' && ' : '' ) + checkDataType(t, data, strictNumbers, true);
|
|
4936
4934
|
|
|
4937
4935
|
return code;
|
|
4938
4936
|
}
|
|
4939
4937
|
}
|
|
4940
4938
|
|
|
4941
4939
|
|
|
4942
|
-
var COERCE_TO_TYPES = toHash
|
|
4940
|
+
var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]);
|
|
4943
4941
|
function coerceToTypes(optionCoerceTypes, dataTypes) {
|
|
4944
4942
|
if (Array.isArray(dataTypes)) {
|
|
4945
4943
|
var types = [];
|
|
@@ -4957,19 +4955,19 @@ function coerceToTypes(optionCoerceTypes, dataTypes) {
|
|
|
4957
4955
|
}
|
|
4958
4956
|
|
|
4959
4957
|
|
|
4960
|
-
function toHash
|
|
4958
|
+
function toHash(arr) {
|
|
4961
4959
|
var hash = {};
|
|
4962
4960
|
for (var i=0; i<arr.length; i++) hash[arr[i]] = true;
|
|
4963
4961
|
return hash;
|
|
4964
4962
|
}
|
|
4965
4963
|
|
|
4966
4964
|
|
|
4967
|
-
var IDENTIFIER
|
|
4965
|
+
var IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
|
|
4968
4966
|
var SINGLE_QUOTE = /'|\\/g;
|
|
4969
4967
|
function getProperty(key) {
|
|
4970
4968
|
return typeof key == 'number'
|
|
4971
4969
|
? '[' + key + ']'
|
|
4972
|
-
: IDENTIFIER
|
|
4970
|
+
: IDENTIFIER.test(key)
|
|
4973
4971
|
? '.' + key
|
|
4974
4972
|
: "['" + escapeQuotes(key) + "']";
|
|
4975
4973
|
}
|
|
@@ -4998,42 +4996,6 @@ function varReplace(str, dataVar, expr) {
|
|
|
4998
4996
|
}
|
|
4999
4997
|
|
|
5000
4998
|
|
|
5001
|
-
var EMPTY_ELSE = /else\s*{\s*}/g
|
|
5002
|
-
, EMPTY_IF_NO_ELSE = /if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g
|
|
5003
|
-
, EMPTY_IF_WITH_ELSE = /if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g;
|
|
5004
|
-
function cleanUpCode(out) {
|
|
5005
|
-
return out.replace(EMPTY_ELSE, '')
|
|
5006
|
-
.replace(EMPTY_IF_NO_ELSE, '')
|
|
5007
|
-
.replace(EMPTY_IF_WITH_ELSE, 'if (!($1))');
|
|
5008
|
-
}
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
var ERRORS_REGEXP = /[^v.]errors/g
|
|
5012
|
-
, REMOVE_ERRORS = /var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g
|
|
5013
|
-
, REMOVE_ERRORS_ASYNC = /var errors = 0;|var vErrors = null;/g
|
|
5014
|
-
, RETURN_VALID = 'return errors === 0;'
|
|
5015
|
-
, RETURN_TRUE = 'validate.errors = null; return true;'
|
|
5016
|
-
, RETURN_ASYNC = /if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/
|
|
5017
|
-
, RETURN_DATA_ASYNC = 'return data;'
|
|
5018
|
-
, ROOTDATA_REGEXP = /[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g
|
|
5019
|
-
, REMOVE_ROOTDATA = /if \(rootData === undefined\) rootData = data;/;
|
|
5020
|
-
|
|
5021
|
-
function finalCleanUpCode(out, async) {
|
|
5022
|
-
var matches = out.match(ERRORS_REGEXP);
|
|
5023
|
-
if (matches && matches.length == 2) {
|
|
5024
|
-
out = async
|
|
5025
|
-
? out.replace(REMOVE_ERRORS_ASYNC, '')
|
|
5026
|
-
.replace(RETURN_ASYNC, RETURN_DATA_ASYNC)
|
|
5027
|
-
: out.replace(REMOVE_ERRORS, '')
|
|
5028
|
-
.replace(RETURN_VALID, RETURN_TRUE);
|
|
5029
|
-
}
|
|
5030
|
-
|
|
5031
|
-
matches = out.match(ROOTDATA_REGEXP);
|
|
5032
|
-
if (!matches || matches.length !== 3) return out;
|
|
5033
|
-
return out.replace(REMOVE_ROOTDATA, '');
|
|
5034
|
-
}
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
4999
|
function schemaHasRules(schema, rules) {
|
|
5038
5000
|
if (typeof schema == 'boolean') return !schema;
|
|
5039
5001
|
for (var key in schema) if (rules[key]) return true;
|
|
@@ -5073,17 +5035,17 @@ function getPath(currentPath, prop, jsonPointers) {
|
|
|
5073
5035
|
}
|
|
5074
5036
|
|
|
5075
5037
|
|
|
5076
|
-
var JSON_POINTER
|
|
5077
|
-
var RELATIVE_JSON_POINTER
|
|
5038
|
+
var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
|
|
5039
|
+
var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
|
|
5078
5040
|
function getData($data, lvl, paths) {
|
|
5079
5041
|
var up, jsonPointer, data, matches;
|
|
5080
5042
|
if ($data === '') return 'rootData';
|
|
5081
5043
|
if ($data[0] == '/') {
|
|
5082
|
-
if (!JSON_POINTER
|
|
5044
|
+
if (!JSON_POINTER.test($data)) throw new Error('Invalid JSON-pointer: ' + $data);
|
|
5083
5045
|
jsonPointer = $data;
|
|
5084
5046
|
data = 'rootData';
|
|
5085
5047
|
} else {
|
|
5086
|
-
matches = $data.match(RELATIVE_JSON_POINTER
|
|
5048
|
+
matches = $data.match(RELATIVE_JSON_POINTER);
|
|
5087
5049
|
if (!matches) throw new Error('Invalid JSON-pointer: ' + $data);
|
|
5088
5050
|
up = +matches[1];
|
|
5089
5051
|
jsonPointer = matches[2];
|
|
@@ -5112,7 +5074,7 @@ function getData($data, lvl, paths) {
|
|
|
5112
5074
|
|
|
5113
5075
|
function joinPaths (a, b) {
|
|
5114
5076
|
if (a == '""') return b;
|
|
5115
|
-
return (a + ' + ' + b).replace(/' \+ '/g, '');
|
|
5077
|
+
return (a + ' + ' + b).replace(/([^\\])' \+ '/g, '$1');
|
|
5116
5078
|
}
|
|
5117
5079
|
|
|
5118
5080
|
|
|
@@ -5135,17 +5097,15 @@ function unescapeJsonPointer(str) {
|
|
|
5135
5097
|
return str.replace(/~1/g, '/').replace(/~0/g, '~');
|
|
5136
5098
|
}
|
|
5137
5099
|
|
|
5138
|
-
var
|
|
5100
|
+
var schema_obj = SchemaObject;
|
|
5139
5101
|
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
function SchemaObject$2(obj) {
|
|
5143
|
-
util$4.copy(obj, this);
|
|
5102
|
+
function SchemaObject(obj) {
|
|
5103
|
+
util.copy(obj, this);
|
|
5144
5104
|
}
|
|
5145
5105
|
|
|
5146
|
-
var jsonSchemaTraverse =
|
|
5106
|
+
var jsonSchemaTraverse = createCommonjsModule(function (module) {
|
|
5147
5107
|
|
|
5148
|
-
var traverse
|
|
5108
|
+
var traverse = module.exports = function (schema, opts, cb) {
|
|
5149
5109
|
// Legacy support for v0.3.1 and earlier.
|
|
5150
5110
|
if (typeof opts == 'function') {
|
|
5151
5111
|
cb = opts;
|
|
@@ -5160,7 +5120,7 @@ var traverse$1 = jsonSchemaTraverse.exports = function (schema, opts, cb) {
|
|
|
5160
5120
|
};
|
|
5161
5121
|
|
|
5162
5122
|
|
|
5163
|
-
traverse
|
|
5123
|
+
traverse.keywords = {
|
|
5164
5124
|
additionalItems: true,
|
|
5165
5125
|
items: true,
|
|
5166
5126
|
contains: true,
|
|
@@ -5169,21 +5129,21 @@ traverse$1.keywords = {
|
|
|
5169
5129
|
not: true
|
|
5170
5130
|
};
|
|
5171
5131
|
|
|
5172
|
-
traverse
|
|
5132
|
+
traverse.arrayKeywords = {
|
|
5173
5133
|
items: true,
|
|
5174
5134
|
allOf: true,
|
|
5175
5135
|
anyOf: true,
|
|
5176
5136
|
oneOf: true
|
|
5177
5137
|
};
|
|
5178
5138
|
|
|
5179
|
-
traverse
|
|
5139
|
+
traverse.propsKeywords = {
|
|
5180
5140
|
definitions: true,
|
|
5181
5141
|
properties: true,
|
|
5182
5142
|
patternProperties: true,
|
|
5183
5143
|
dependencies: true
|
|
5184
5144
|
};
|
|
5185
5145
|
|
|
5186
|
-
traverse
|
|
5146
|
+
traverse.skipKeywords = {
|
|
5187
5147
|
default: true,
|
|
5188
5148
|
enum: true,
|
|
5189
5149
|
const: true,
|
|
@@ -5211,16 +5171,16 @@ function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr,
|
|
|
5211
5171
|
for (var key in schema) {
|
|
5212
5172
|
var sch = schema[key];
|
|
5213
5173
|
if (Array.isArray(sch)) {
|
|
5214
|
-
if (key in traverse
|
|
5174
|
+
if (key in traverse.arrayKeywords) {
|
|
5215
5175
|
for (var i=0; i<sch.length; i++)
|
|
5216
5176
|
_traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);
|
|
5217
5177
|
}
|
|
5218
|
-
} else if (key in traverse
|
|
5178
|
+
} else if (key in traverse.propsKeywords) {
|
|
5219
5179
|
if (sch && typeof sch == 'object') {
|
|
5220
5180
|
for (var prop in sch)
|
|
5221
5181
|
_traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);
|
|
5222
5182
|
}
|
|
5223
|
-
} else if (key in traverse
|
|
5183
|
+
} else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {
|
|
5224
5184
|
_traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);
|
|
5225
5185
|
}
|
|
5226
5186
|
}
|
|
@@ -5232,21 +5192,16 @@ function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr,
|
|
|
5232
5192
|
function escapeJsonPtr(str) {
|
|
5233
5193
|
return str.replace(/~/g, '~0').replace(/\//g, '~1');
|
|
5234
5194
|
}
|
|
5195
|
+
});
|
|
5235
5196
|
|
|
5236
|
-
var
|
|
5237
|
-
, equal$1 = fastDeepEqual
|
|
5238
|
-
, util$3 = util$5
|
|
5239
|
-
, SchemaObject$1 = schema_obj
|
|
5240
|
-
, traverse = jsonSchemaTraverse.exports;
|
|
5241
|
-
|
|
5242
|
-
var resolve_1 = resolve$3;
|
|
5197
|
+
var resolve_1 = resolve;
|
|
5243
5198
|
|
|
5244
|
-
resolve
|
|
5245
|
-
resolve
|
|
5246
|
-
resolve
|
|
5247
|
-
resolve
|
|
5248
|
-
resolve
|
|
5249
|
-
resolve
|
|
5199
|
+
resolve.normalizeId = normalizeId;
|
|
5200
|
+
resolve.fullPath = getFullPath;
|
|
5201
|
+
resolve.url = resolveUrl;
|
|
5202
|
+
resolve.ids = resolveIds;
|
|
5203
|
+
resolve.inlineRef = inlineRef;
|
|
5204
|
+
resolve.schema = resolveSchema;
|
|
5250
5205
|
|
|
5251
5206
|
/**
|
|
5252
5207
|
* [resolve and compile the references ($ref)]
|
|
@@ -5256,16 +5211,16 @@ resolve$3.schema = resolveSchema;
|
|
|
5256
5211
|
* @param {String} ref reference to resolve
|
|
5257
5212
|
* @return {Object|Function} schema object (if the schema can be inlined) or validation function
|
|
5258
5213
|
*/
|
|
5259
|
-
function resolve
|
|
5214
|
+
function resolve(compile, root, ref) {
|
|
5260
5215
|
/* jshint validthis: true */
|
|
5261
5216
|
var refVal = this._refs[ref];
|
|
5262
5217
|
if (typeof refVal == 'string') {
|
|
5263
5218
|
if (this._refs[refVal]) refVal = this._refs[refVal];
|
|
5264
|
-
else return resolve
|
|
5219
|
+
else return resolve.call(this, compile, root, refVal);
|
|
5265
5220
|
}
|
|
5266
5221
|
|
|
5267
5222
|
refVal = refVal || this._schemas[ref];
|
|
5268
|
-
if (refVal instanceof
|
|
5223
|
+
if (refVal instanceof schema_obj) {
|
|
5269
5224
|
return inlineRef(refVal.schema, this._opts.inlineRefs)
|
|
5270
5225
|
? refVal.schema
|
|
5271
5226
|
: refVal.validate || this._compile(refVal);
|
|
@@ -5279,7 +5234,7 @@ function resolve$3(compile, root, ref) {
|
|
|
5279
5234
|
baseId = res.baseId;
|
|
5280
5235
|
}
|
|
5281
5236
|
|
|
5282
|
-
if (schema instanceof
|
|
5237
|
+
if (schema instanceof schema_obj) {
|
|
5283
5238
|
v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId);
|
|
5284
5239
|
} else if (schema !== undefined) {
|
|
5285
5240
|
v = inlineRef(schema, this._opts.inlineRefs)
|
|
@@ -5300,7 +5255,7 @@ function resolve$3(compile, root, ref) {
|
|
|
5300
5255
|
*/
|
|
5301
5256
|
function resolveSchema(root, ref) {
|
|
5302
5257
|
/* jshint validthis: true */
|
|
5303
|
-
var p =
|
|
5258
|
+
var p = uri_all.parse(ref)
|
|
5304
5259
|
, refPath = _getFullPath(p)
|
|
5305
5260
|
, baseId = getFullPath(this._getId(root.schema));
|
|
5306
5261
|
if (Object.keys(root.schema).length === 0 || refPath !== baseId) {
|
|
@@ -5308,12 +5263,12 @@ function resolveSchema(root, ref) {
|
|
|
5308
5263
|
var refVal = this._refs[id];
|
|
5309
5264
|
if (typeof refVal == 'string') {
|
|
5310
5265
|
return resolveRecursive.call(this, root, refVal, p);
|
|
5311
|
-
} else if (refVal instanceof
|
|
5266
|
+
} else if (refVal instanceof schema_obj) {
|
|
5312
5267
|
if (!refVal.validate) this._compile(refVal);
|
|
5313
5268
|
root = refVal;
|
|
5314
5269
|
} else {
|
|
5315
5270
|
refVal = this._schemas[id];
|
|
5316
|
-
if (refVal instanceof
|
|
5271
|
+
if (refVal instanceof schema_obj) {
|
|
5317
5272
|
if (!refVal.validate) this._compile(refVal);
|
|
5318
5273
|
if (id == normalizeId(ref))
|
|
5319
5274
|
return { schema: refVal, root: root, baseId: baseId };
|
|
@@ -5344,7 +5299,7 @@ function resolveRecursive(root, ref, parsedRef) {
|
|
|
5344
5299
|
}
|
|
5345
5300
|
|
|
5346
5301
|
|
|
5347
|
-
var PREVENT_SCOPE_CHANGE = util
|
|
5302
|
+
var PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']);
|
|
5348
5303
|
/* @this Ajv */
|
|
5349
5304
|
function getJsonPointer(parsedRef, baseId, schema, root) {
|
|
5350
5305
|
/* jshint validthis: true */
|
|
@@ -5355,7 +5310,7 @@ function getJsonPointer(parsedRef, baseId, schema, root) {
|
|
|
5355
5310
|
for (var i = 1; i < parts.length; i++) {
|
|
5356
5311
|
var part = parts[i];
|
|
5357
5312
|
if (part) {
|
|
5358
|
-
part = util
|
|
5313
|
+
part = util.unescapeFragment(part);
|
|
5359
5314
|
schema = schema[part];
|
|
5360
5315
|
if (schema === undefined) break;
|
|
5361
5316
|
var id;
|
|
@@ -5379,7 +5334,7 @@ function getJsonPointer(parsedRef, baseId, schema, root) {
|
|
|
5379
5334
|
}
|
|
5380
5335
|
|
|
5381
5336
|
|
|
5382
|
-
var SIMPLE_INLINED = util
|
|
5337
|
+
var SIMPLE_INLINED = util.toHash([
|
|
5383
5338
|
'type', 'format', 'pattern',
|
|
5384
5339
|
'maxLength', 'minLength',
|
|
5385
5340
|
'maxProperties', 'minProperties',
|
|
@@ -5439,13 +5394,13 @@ function countKeys(schema) {
|
|
|
5439
5394
|
|
|
5440
5395
|
function getFullPath(id, normalize) {
|
|
5441
5396
|
if (normalize !== false) id = normalizeId(id);
|
|
5442
|
-
var p =
|
|
5397
|
+
var p = uri_all.parse(id);
|
|
5443
5398
|
return _getFullPath(p);
|
|
5444
5399
|
}
|
|
5445
5400
|
|
|
5446
5401
|
|
|
5447
5402
|
function _getFullPath(p) {
|
|
5448
|
-
return
|
|
5403
|
+
return uri_all.serialize(p).split('#')[0] + '#';
|
|
5449
5404
|
}
|
|
5450
5405
|
|
|
5451
5406
|
|
|
@@ -5457,7 +5412,7 @@ function normalizeId(id) {
|
|
|
5457
5412
|
|
|
5458
5413
|
function resolveUrl(baseId, id) {
|
|
5459
5414
|
id = normalizeId(id);
|
|
5460
|
-
return
|
|
5415
|
+
return uri_all.resolve(baseId, id);
|
|
5461
5416
|
}
|
|
5462
5417
|
|
|
5463
5418
|
|
|
@@ -5469,25 +5424,25 @@ function resolveIds(schema) {
|
|
|
5469
5424
|
var localRefs = {};
|
|
5470
5425
|
var self = this;
|
|
5471
5426
|
|
|
5472
|
-
|
|
5427
|
+
jsonSchemaTraverse(schema, {allKeys: true}, function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
|
|
5473
5428
|
if (jsonPtr === '') return;
|
|
5474
5429
|
var id = self._getId(sch);
|
|
5475
5430
|
var baseId = baseIds[parentJsonPtr];
|
|
5476
5431
|
var fullPath = fullPaths[parentJsonPtr] + '/' + parentKeyword;
|
|
5477
5432
|
if (keyIndex !== undefined)
|
|
5478
|
-
fullPath += '/' + (typeof keyIndex == 'number' ? keyIndex : util
|
|
5433
|
+
fullPath += '/' + (typeof keyIndex == 'number' ? keyIndex : util.escapeFragment(keyIndex));
|
|
5479
5434
|
|
|
5480
5435
|
if (typeof id == 'string') {
|
|
5481
|
-
id = baseId = normalizeId(baseId ?
|
|
5436
|
+
id = baseId = normalizeId(baseId ? uri_all.resolve(baseId, id) : id);
|
|
5482
5437
|
|
|
5483
5438
|
var refVal = self._refs[id];
|
|
5484
5439
|
if (typeof refVal == 'string') refVal = self._refs[refVal];
|
|
5485
5440
|
if (refVal && refVal.schema) {
|
|
5486
|
-
if (!
|
|
5441
|
+
if (!fastDeepEqual(sch, refVal.schema))
|
|
5487
5442
|
throw new Error('id "' + id + '" resolves to more than one schema');
|
|
5488
5443
|
} else if (id != normalizeId(fullPath)) {
|
|
5489
5444
|
if (id[0] == '#') {
|
|
5490
|
-
if (localRefs[id] && !
|
|
5445
|
+
if (localRefs[id] && !fastDeepEqual(sch, localRefs[id]))
|
|
5491
5446
|
throw new Error('id "' + id + '" resolves to more than one schema');
|
|
5492
5447
|
localRefs[id] = sch;
|
|
5493
5448
|
} else {
|
|
@@ -5502,30 +5457,28 @@ function resolveIds(schema) {
|
|
|
5502
5457
|
return localRefs;
|
|
5503
5458
|
}
|
|
5504
5459
|
|
|
5505
|
-
var resolve$2 = resolve_1;
|
|
5506
|
-
|
|
5507
5460
|
var error_classes = {
|
|
5508
|
-
Validation: errorSubclass(ValidationError
|
|
5509
|
-
MissingRef: errorSubclass(MissingRefError
|
|
5461
|
+
Validation: errorSubclass(ValidationError),
|
|
5462
|
+
MissingRef: errorSubclass(MissingRefError)
|
|
5510
5463
|
};
|
|
5511
5464
|
|
|
5512
5465
|
|
|
5513
|
-
function ValidationError
|
|
5466
|
+
function ValidationError(errors) {
|
|
5514
5467
|
this.message = 'validation failed';
|
|
5515
5468
|
this.errors = errors;
|
|
5516
5469
|
this.ajv = this.validation = true;
|
|
5517
5470
|
}
|
|
5518
5471
|
|
|
5519
5472
|
|
|
5520
|
-
MissingRefError
|
|
5473
|
+
MissingRefError.message = function (baseId, ref) {
|
|
5521
5474
|
return 'can\'t resolve reference ' + ref + ' from id ' + baseId;
|
|
5522
5475
|
};
|
|
5523
5476
|
|
|
5524
5477
|
|
|
5525
|
-
function MissingRefError
|
|
5526
|
-
this.message = message || MissingRefError
|
|
5527
|
-
this.missingRef =
|
|
5528
|
-
this.missingSchema =
|
|
5478
|
+
function MissingRefError(baseId, ref, message) {
|
|
5479
|
+
this.message = message || MissingRefError.message(baseId, ref);
|
|
5480
|
+
this.missingRef = resolve_1.url(baseId, ref);
|
|
5481
|
+
this.missingSchema = resolve_1.normalizeId(resolve_1.fullPath(this.missingRef));
|
|
5529
5482
|
}
|
|
5530
5483
|
|
|
5531
5484
|
|
|
@@ -5593,7 +5546,7 @@ var fastJsonStableStringify = function (data, opts) {
|
|
|
5593
5546
|
})(data);
|
|
5594
5547
|
};
|
|
5595
5548
|
|
|
5596
|
-
var validate
|
|
5549
|
+
var validate = function generate_validate(it, $keyword, $ruleType) {
|
|
5597
5550
|
var out = '';
|
|
5598
5551
|
var $async = it.schema.$async === true,
|
|
5599
5552
|
$refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'),
|
|
@@ -5685,7 +5638,7 @@ var validate$1 = function generate_validate(it, $keyword, $ruleType) {
|
|
|
5685
5638
|
it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema));
|
|
5686
5639
|
it.baseId = it.baseId || it.rootId;
|
|
5687
5640
|
delete it.isTop;
|
|
5688
|
-
it.dataPathArr = [
|
|
5641
|
+
it.dataPathArr = [""];
|
|
5689
5642
|
if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) {
|
|
5690
5643
|
var $defaultMsg = 'default is ignored in the schema root';
|
|
5691
5644
|
if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);
|
|
@@ -5743,47 +5696,39 @@ var validate$1 = function generate_validate(it, $keyword, $ruleType) {
|
|
|
5743
5696
|
var $schemaPath = it.schemaPath + '.type',
|
|
5744
5697
|
$errSchemaPath = it.errSchemaPath + '/type',
|
|
5745
5698
|
$method = $typeIsArray ? 'checkDataTypes' : 'checkDataType';
|
|
5746
|
-
out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { ';
|
|
5699
|
+
out += ' if (' + (it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true)) + ') { ';
|
|
5747
5700
|
if ($coerceToTypes) {
|
|
5748
5701
|
var $dataType = 'dataType' + $lvl,
|
|
5749
5702
|
$coerced = 'coerced' + $lvl;
|
|
5750
|
-
out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; ';
|
|
5703
|
+
out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; var ' + ($coerced) + ' = undefined; ';
|
|
5751
5704
|
if (it.opts.coerceTypes == 'array') {
|
|
5752
|
-
out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ')) ' + ($dataType) + ' =
|
|
5705
|
+
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) + '; } ';
|
|
5753
5706
|
}
|
|
5754
|
-
out += '
|
|
5755
|
-
var $bracesCoercion = '';
|
|
5707
|
+
out += ' if (' + ($coerced) + ' !== undefined) ; ';
|
|
5756
5708
|
var arr1 = $coerceToTypes;
|
|
5757
5709
|
if (arr1) {
|
|
5758
5710
|
var $type, $i = -1,
|
|
5759
5711
|
l1 = arr1.length - 1;
|
|
5760
5712
|
while ($i < l1) {
|
|
5761
5713
|
$type = arr1[$i += 1];
|
|
5762
|
-
if ($i) {
|
|
5763
|
-
out += ' if (' + ($coerced) + ' === undefined) { ';
|
|
5764
|
-
$bracesCoercion += '}';
|
|
5765
|
-
}
|
|
5766
|
-
if (it.opts.coerceTypes == 'array' && $type != 'array') {
|
|
5767
|
-
out += ' if (' + ($dataType) + ' == \'array\' && ' + ($data) + '.length == 1) { ' + ($coerced) + ' = ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; } ';
|
|
5768
|
-
}
|
|
5769
5714
|
if ($type == 'string') {
|
|
5770
|
-
out += ' if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; ';
|
|
5715
|
+
out += ' else if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; ';
|
|
5771
5716
|
} else if ($type == 'number' || $type == 'integer') {
|
|
5772
|
-
out += ' if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' ';
|
|
5717
|
+
out += ' else if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' ';
|
|
5773
5718
|
if ($type == 'integer') {
|
|
5774
5719
|
out += ' && !(' + ($data) + ' % 1)';
|
|
5775
5720
|
}
|
|
5776
5721
|
out += ')) ' + ($coerced) + ' = +' + ($data) + '; ';
|
|
5777
5722
|
} else if ($type == 'boolean') {
|
|
5778
|
-
out += ' if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; ';
|
|
5723
|
+
out += ' else if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; ';
|
|
5779
5724
|
} else if ($type == 'null') {
|
|
5780
|
-
out += ' if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; ';
|
|
5725
|
+
out += ' else if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; ';
|
|
5781
5726
|
} else if (it.opts.coerceTypes == 'array' && $type == 'array') {
|
|
5782
|
-
out += ' if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; ';
|
|
5727
|
+
out += ' else if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; ';
|
|
5783
5728
|
}
|
|
5784
5729
|
}
|
|
5785
5730
|
}
|
|
5786
|
-
out += '
|
|
5731
|
+
out += ' else { ';
|
|
5787
5732
|
var $$outStack = $$outStack || [];
|
|
5788
5733
|
$$outStack.push(out);
|
|
5789
5734
|
out = ''; /* istanbul ignore else */
|
|
@@ -5823,7 +5768,7 @@ var validate$1 = function generate_validate(it, $keyword, $ruleType) {
|
|
|
5823
5768
|
} else {
|
|
5824
5769
|
out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
|
|
5825
5770
|
}
|
|
5826
|
-
out += ' }
|
|
5771
|
+
out += ' } if (' + ($coerced) + ' !== undefined) { ';
|
|
5827
5772
|
var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
|
|
5828
5773
|
$parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
|
|
5829
5774
|
out += ' ' + ($data) + ' = ' + ($coerced) + '; ';
|
|
@@ -5896,7 +5841,7 @@ var validate$1 = function generate_validate(it, $keyword, $ruleType) {
|
|
|
5896
5841
|
$rulesGroup = arr2[i2 += 1];
|
|
5897
5842
|
if ($shouldUseGroup($rulesGroup)) {
|
|
5898
5843
|
if ($rulesGroup.type) {
|
|
5899
|
-
out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data)) + ') { ';
|
|
5844
|
+
out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers)) + ') { ';
|
|
5900
5845
|
}
|
|
5901
5846
|
if (it.opts.useDefaults) {
|
|
5902
5847
|
if ($rulesGroup.type == 'object' && it.schema.properties) {
|
|
@@ -6064,10 +6009,6 @@ var validate$1 = function generate_validate(it, $keyword, $ruleType) {
|
|
|
6064
6009
|
} else {
|
|
6065
6010
|
out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';';
|
|
6066
6011
|
}
|
|
6067
|
-
out = it.util.cleanUpCode(out);
|
|
6068
|
-
if ($top) {
|
|
6069
|
-
out = it.util.finalCleanUpCode(out, $async);
|
|
6070
|
-
}
|
|
6071
6012
|
|
|
6072
6013
|
function $shouldUseGroup($rulesGroup) {
|
|
6073
6014
|
var rules = $rulesGroup.rules;
|
|
@@ -6087,24 +6028,17 @@ var validate$1 = function generate_validate(it, $keyword, $ruleType) {
|
|
|
6087
6028
|
return out;
|
|
6088
6029
|
};
|
|
6089
6030
|
|
|
6090
|
-
var resolve$1 = resolve_1
|
|
6091
|
-
, util$2 = util$5
|
|
6092
|
-
, errorClasses$1 = error_classes
|
|
6093
|
-
, stableStringify$1 = fastJsonStableStringify;
|
|
6094
|
-
|
|
6095
|
-
var validateGenerator = validate$1;
|
|
6096
|
-
|
|
6097
6031
|
/**
|
|
6098
6032
|
* Functions below are used inside compiled validations function
|
|
6099
6033
|
*/
|
|
6100
6034
|
|
|
6101
|
-
var ucs2length = util
|
|
6102
|
-
|
|
6035
|
+
var ucs2length$1 = util.ucs2length;
|
|
6036
|
+
|
|
6103
6037
|
|
|
6104
6038
|
// this error is thrown by async schemas to return validation errors via exception
|
|
6105
|
-
var ValidationError =
|
|
6039
|
+
var ValidationError$1 = error_classes.Validation;
|
|
6106
6040
|
|
|
6107
|
-
var compile_1 = compile
|
|
6041
|
+
var compile_1 = compile;
|
|
6108
6042
|
|
|
6109
6043
|
|
|
6110
6044
|
/**
|
|
@@ -6116,7 +6050,7 @@ var compile_1 = compile$1;
|
|
|
6116
6050
|
* @param {String} baseId base ID for IDs in the schema
|
|
6117
6051
|
* @return {Function} validation function
|
|
6118
6052
|
*/
|
|
6119
|
-
function compile
|
|
6053
|
+
function compile(schema, root, localRefs, baseId) {
|
|
6120
6054
|
/* jshint validthis: true, evil: true */
|
|
6121
6055
|
/* eslint no-shadow: 0 */
|
|
6122
6056
|
var self = this
|
|
@@ -6168,11 +6102,11 @@ function compile$1(schema, root, localRefs, baseId) {
|
|
|
6168
6102
|
function localCompile(_schema, _root, localRefs, baseId) {
|
|
6169
6103
|
var isRoot = !_root || (_root && _root.schema == _schema);
|
|
6170
6104
|
if (_root.schema != root.schema)
|
|
6171
|
-
return compile
|
|
6105
|
+
return compile.call(self, _schema, _root, localRefs, baseId);
|
|
6172
6106
|
|
|
6173
6107
|
var $async = _schema.$async === true;
|
|
6174
6108
|
|
|
6175
|
-
var sourceCode =
|
|
6109
|
+
var sourceCode = validate({
|
|
6176
6110
|
isTop: true,
|
|
6177
6111
|
schema: _schema,
|
|
6178
6112
|
isRoot: isRoot,
|
|
@@ -6181,11 +6115,11 @@ function compile$1(schema, root, localRefs, baseId) {
|
|
|
6181
6115
|
schemaPath: '',
|
|
6182
6116
|
errSchemaPath: '#',
|
|
6183
6117
|
errorPath: '""',
|
|
6184
|
-
MissingRefError:
|
|
6118
|
+
MissingRefError: error_classes.MissingRef,
|
|
6185
6119
|
RULES: RULES,
|
|
6186
|
-
validate:
|
|
6187
|
-
util: util
|
|
6188
|
-
resolve:
|
|
6120
|
+
validate: validate,
|
|
6121
|
+
util: util,
|
|
6122
|
+
resolve: resolve_1,
|
|
6189
6123
|
resolveRef: resolveRef,
|
|
6190
6124
|
usePattern: usePattern,
|
|
6191
6125
|
useDefault: useDefault,
|
|
@@ -6197,12 +6131,12 @@ function compile$1(schema, root, localRefs, baseId) {
|
|
|
6197
6131
|
});
|
|
6198
6132
|
|
|
6199
6133
|
sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode)
|
|
6200
|
-
+ vars(defaults, defaultCode) + vars(customRules, customRuleCode
|
|
6134
|
+
+ vars(defaults, defaultCode) + vars(customRules, customRuleCode)
|
|
6201
6135
|
+ sourceCode;
|
|
6202
6136
|
|
|
6203
|
-
if (opts.processCode) sourceCode = opts.processCode(sourceCode);
|
|
6137
|
+
if (opts.processCode) sourceCode = opts.processCode(sourceCode, _schema);
|
|
6204
6138
|
// console.log('\n\n\n *** \n', JSON.stringify(sourceCode));
|
|
6205
|
-
var validate;
|
|
6139
|
+
var validate$1;
|
|
6206
6140
|
try {
|
|
6207
6141
|
var makeValidate = new Function(
|
|
6208
6142
|
'self',
|
|
@@ -6218,7 +6152,7 @@ function compile$1(schema, root, localRefs, baseId) {
|
|
|
6218
6152
|
sourceCode
|
|
6219
6153
|
);
|
|
6220
6154
|
|
|
6221
|
-
validate = makeValidate(
|
|
6155
|
+
validate$1 = makeValidate(
|
|
6222
6156
|
self,
|
|
6223
6157
|
RULES,
|
|
6224
6158
|
formats,
|
|
@@ -6226,36 +6160,36 @@ function compile$1(schema, root, localRefs, baseId) {
|
|
|
6226
6160
|
refVal,
|
|
6227
6161
|
defaults,
|
|
6228
6162
|
customRules,
|
|
6229
|
-
|
|
6230
|
-
ucs2length,
|
|
6231
|
-
ValidationError
|
|
6163
|
+
fastDeepEqual,
|
|
6164
|
+
ucs2length$1,
|
|
6165
|
+
ValidationError$1
|
|
6232
6166
|
);
|
|
6233
6167
|
|
|
6234
|
-
refVal[0] = validate;
|
|
6168
|
+
refVal[0] = validate$1;
|
|
6235
6169
|
} catch(e) {
|
|
6236
6170
|
self.logger.error('Error compiling schema, function code:', sourceCode);
|
|
6237
6171
|
throw e;
|
|
6238
6172
|
}
|
|
6239
6173
|
|
|
6240
|
-
validate.schema = _schema;
|
|
6241
|
-
validate.errors = null;
|
|
6242
|
-
validate.refs = refs;
|
|
6243
|
-
validate.refVal = refVal;
|
|
6244
|
-
validate.root = isRoot ? validate : _root;
|
|
6245
|
-
if ($async) validate.$async = true;
|
|
6174
|
+
validate$1.schema = _schema;
|
|
6175
|
+
validate$1.errors = null;
|
|
6176
|
+
validate$1.refs = refs;
|
|
6177
|
+
validate$1.refVal = refVal;
|
|
6178
|
+
validate$1.root = isRoot ? validate$1 : _root;
|
|
6179
|
+
if ($async) validate$1.$async = true;
|
|
6246
6180
|
if (opts.sourceCode === true) {
|
|
6247
|
-
validate.source = {
|
|
6181
|
+
validate$1.source = {
|
|
6248
6182
|
code: sourceCode,
|
|
6249
6183
|
patterns: patterns,
|
|
6250
6184
|
defaults: defaults
|
|
6251
6185
|
};
|
|
6252
6186
|
}
|
|
6253
6187
|
|
|
6254
|
-
return validate;
|
|
6188
|
+
return validate$1;
|
|
6255
6189
|
}
|
|
6256
6190
|
|
|
6257
6191
|
function resolveRef(baseId, ref, isRoot) {
|
|
6258
|
-
ref =
|
|
6192
|
+
ref = resolve_1.url(baseId, ref);
|
|
6259
6193
|
var refIndex = refs[ref];
|
|
6260
6194
|
var _refVal, refCode;
|
|
6261
6195
|
if (refIndex !== undefined) {
|
|
@@ -6273,13 +6207,13 @@ function compile$1(schema, root, localRefs, baseId) {
|
|
|
6273
6207
|
}
|
|
6274
6208
|
|
|
6275
6209
|
refCode = addLocalRef(ref);
|
|
6276
|
-
var v =
|
|
6210
|
+
var v = resolve_1.call(self, localCompile, root, ref);
|
|
6277
6211
|
if (v === undefined) {
|
|
6278
6212
|
var localSchema = localRefs && localRefs[ref];
|
|
6279
6213
|
if (localSchema) {
|
|
6280
|
-
v =
|
|
6214
|
+
v = resolve_1.inlineRef(localSchema, opts.inlineRefs)
|
|
6281
6215
|
? localSchema
|
|
6282
|
-
: compile
|
|
6216
|
+
: compile.call(self, localSchema, root, localRefs, baseId);
|
|
6283
6217
|
}
|
|
6284
6218
|
}
|
|
6285
6219
|
|
|
@@ -6328,10 +6262,10 @@ function compile$1(schema, root, localRefs, baseId) {
|
|
|
6328
6262
|
case 'number':
|
|
6329
6263
|
return '' + value;
|
|
6330
6264
|
case 'string':
|
|
6331
|
-
return util
|
|
6265
|
+
return util.toQuotedString(value);
|
|
6332
6266
|
case 'object':
|
|
6333
6267
|
if (value === null) return 'null';
|
|
6334
|
-
var valueStr =
|
|
6268
|
+
var valueStr = fastJsonStableStringify(value);
|
|
6335
6269
|
var index = defaultsHash[valueStr];
|
|
6336
6270
|
if (index === undefined) {
|
|
6337
6271
|
index = defaultsHash[valueStr] = defaults.length;
|
|
@@ -6446,7 +6380,7 @@ function compIndex(schema, root, baseId) {
|
|
|
6446
6380
|
|
|
6447
6381
|
|
|
6448
6382
|
function patternCode(i, patterns) {
|
|
6449
|
-
return 'var pattern' + i + ' = new RegExp(' + util
|
|
6383
|
+
return 'var pattern' + i + ' = new RegExp(' + util.toQuotedString(patterns[i]) + ');';
|
|
6450
6384
|
}
|
|
6451
6385
|
|
|
6452
6386
|
|
|
@@ -6460,7 +6394,7 @@ function refValCode(i, refVal) {
|
|
|
6460
6394
|
}
|
|
6461
6395
|
|
|
6462
6396
|
|
|
6463
|
-
function customRuleCode
|
|
6397
|
+
function customRuleCode(i) {
|
|
6464
6398
|
return 'var customRule' + i + ' = customRules[' + i + '];';
|
|
6465
6399
|
}
|
|
6466
6400
|
|
|
@@ -6473,38 +6407,38 @@ function vars(arr, statement) {
|
|
|
6473
6407
|
return code;
|
|
6474
6408
|
}
|
|
6475
6409
|
|
|
6476
|
-
var cache =
|
|
6410
|
+
var cache = createCommonjsModule(function (module) {
|
|
6411
|
+
|
|
6477
6412
|
|
|
6478
|
-
var Cache
|
|
6413
|
+
var Cache = module.exports = function Cache() {
|
|
6479
6414
|
this._cache = {};
|
|
6480
6415
|
};
|
|
6481
6416
|
|
|
6482
6417
|
|
|
6483
|
-
Cache
|
|
6418
|
+
Cache.prototype.put = function Cache_put(key, value) {
|
|
6484
6419
|
this._cache[key] = value;
|
|
6485
6420
|
};
|
|
6486
6421
|
|
|
6487
6422
|
|
|
6488
|
-
Cache
|
|
6423
|
+
Cache.prototype.get = function Cache_get(key) {
|
|
6489
6424
|
return this._cache[key];
|
|
6490
6425
|
};
|
|
6491
6426
|
|
|
6492
6427
|
|
|
6493
|
-
Cache
|
|
6428
|
+
Cache.prototype.del = function Cache_del(key) {
|
|
6494
6429
|
delete this._cache[key];
|
|
6495
6430
|
};
|
|
6496
6431
|
|
|
6497
6432
|
|
|
6498
|
-
Cache
|
|
6433
|
+
Cache.prototype.clear = function Cache_clear() {
|
|
6499
6434
|
this._cache = {};
|
|
6500
6435
|
};
|
|
6501
|
-
|
|
6502
|
-
var util$1 = util$5;
|
|
6436
|
+
});
|
|
6503
6437
|
|
|
6504
6438
|
var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
|
|
6505
6439
|
var DAYS = [0,31,28,31,30,31,30,31,31,30,31,30,31];
|
|
6506
|
-
var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d
|
|
6507
|
-
var HOSTNAME = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)
|
|
6440
|
+
var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;
|
|
6441
|
+
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;
|
|
6508
6442
|
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;
|
|
6509
6443
|
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;
|
|
6510
6444
|
// uri-template: https://tools.ietf.org/html/rfc6570
|
|
@@ -6512,31 +6446,31 @@ var URITEMPLATE = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|
|
|
|
6512
6446
|
// For the source: https://gist.github.com/dperini/729294
|
|
6513
6447
|
// For test cases: https://mathiasbynens.be/demo/url-regex
|
|
6514
6448
|
// @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983.
|
|
6515
|
-
// 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]
|
|
6516
|
-
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-
|
|
6449
|
+
// 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;
|
|
6450
|
+
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;
|
|
6517
6451
|
var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
|
|
6518
|
-
var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/;
|
|
6452
|
+
var JSON_POINTER$1 = /^(?:\/(?:[^~/]|~0|~1)*)*$/;
|
|
6519
6453
|
var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;
|
|
6520
|
-
var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;
|
|
6454
|
+
var RELATIVE_JSON_POINTER$1 = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;
|
|
6521
6455
|
|
|
6522
6456
|
|
|
6523
|
-
var formats_1 = formats
|
|
6457
|
+
var formats_1 = formats;
|
|
6524
6458
|
|
|
6525
|
-
function formats
|
|
6459
|
+
function formats(mode) {
|
|
6526
6460
|
mode = mode == 'full' ? 'full' : 'fast';
|
|
6527
|
-
return util
|
|
6461
|
+
return util.copy(formats[mode]);
|
|
6528
6462
|
}
|
|
6529
6463
|
|
|
6530
6464
|
|
|
6531
|
-
formats
|
|
6465
|
+
formats.fast = {
|
|
6532
6466
|
// date: http://tools.ietf.org/html/rfc3339#section-5.6
|
|
6533
6467
|
date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/,
|
|
6534
6468
|
// date-time: http://tools.ietf.org/html/rfc3339#section-5.6
|
|
6535
|
-
time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d
|
|
6536
|
-
'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
|
|
6469
|
+
time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,
|
|
6470
|
+
'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,
|
|
6537
6471
|
// uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
|
|
6538
|
-
uri: /^(?:[a-z][a-z0-9
|
|
6539
|
-
'uri-reference': /^(?:(?:[a-z][a-z0-9
|
|
6472
|
+
uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,
|
|
6473
|
+
'uri-reference': /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
|
|
6540
6474
|
'uri-template': URITEMPLATE,
|
|
6541
6475
|
url: URL,
|
|
6542
6476
|
// email (sources from jsen validator):
|
|
@@ -6553,14 +6487,14 @@ formats$1.fast = {
|
|
|
6553
6487
|
uuid: UUID,
|
|
6554
6488
|
// JSON-pointer: https://tools.ietf.org/html/rfc6901
|
|
6555
6489
|
// uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A
|
|
6556
|
-
'json-pointer': JSON_POINTER,
|
|
6490
|
+
'json-pointer': JSON_POINTER$1,
|
|
6557
6491
|
'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,
|
|
6558
6492
|
// relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00
|
|
6559
|
-
'relative-json-pointer': RELATIVE_JSON_POINTER
|
|
6493
|
+
'relative-json-pointer': RELATIVE_JSON_POINTER$1
|
|
6560
6494
|
};
|
|
6561
6495
|
|
|
6562
6496
|
|
|
6563
|
-
formats
|
|
6497
|
+
formats.full = {
|
|
6564
6498
|
date: date,
|
|
6565
6499
|
time: time,
|
|
6566
6500
|
'date-time': date_time,
|
|
@@ -6569,14 +6503,14 @@ formats$1.full = {
|
|
|
6569
6503
|
'uri-template': URITEMPLATE,
|
|
6570
6504
|
url: URL,
|
|
6571
6505
|
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,
|
|
6572
|
-
hostname:
|
|
6506
|
+
hostname: HOSTNAME,
|
|
6573
6507
|
ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
|
|
6574
6508
|
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,
|
|
6575
6509
|
regex: regex,
|
|
6576
6510
|
uuid: UUID,
|
|
6577
|
-
'json-pointer': JSON_POINTER,
|
|
6511
|
+
'json-pointer': JSON_POINTER$1,
|
|
6578
6512
|
'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,
|
|
6579
|
-
'relative-json-pointer': RELATIVE_JSON_POINTER
|
|
6513
|
+
'relative-json-pointer': RELATIVE_JSON_POINTER$1
|
|
6580
6514
|
};
|
|
6581
6515
|
|
|
6582
6516
|
|
|
@@ -6622,13 +6556,6 @@ function date_time(str) {
|
|
|
6622
6556
|
}
|
|
6623
6557
|
|
|
6624
6558
|
|
|
6625
|
-
function hostname(str) {
|
|
6626
|
-
// https://tools.ietf.org/html/rfc1034#section-3.5
|
|
6627
|
-
// https://tools.ietf.org/html/rfc1123#section-2
|
|
6628
|
-
return str.length <= 255 && HOSTNAME.test(str);
|
|
6629
|
-
}
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
6559
|
var NOT_URI_FRAGMENT = /\/|:/;
|
|
6633
6560
|
function uri(str) {
|
|
6634
6561
|
// http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "."
|
|
@@ -6789,7 +6716,7 @@ var allOf = function generate_allOf(it, $keyword, $ruleType) {
|
|
|
6789
6716
|
l1 = arr1.length - 1;
|
|
6790
6717
|
while ($i < l1) {
|
|
6791
6718
|
$sch = arr1[$i += 1];
|
|
6792
|
-
if (it.util.schemaHasRules($sch, it.RULES.all)) {
|
|
6719
|
+
if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
|
|
6793
6720
|
$allSchemasEmpty = false;
|
|
6794
6721
|
$it.schema = $sch;
|
|
6795
6722
|
$it.schemaPath = $schemaPath + '[' + $i + ']';
|
|
@@ -6810,7 +6737,6 @@ var allOf = function generate_allOf(it, $keyword, $ruleType) {
|
|
|
6810
6737
|
out += ' ' + ($closingBraces.slice(0, -1)) + ' ';
|
|
6811
6738
|
}
|
|
6812
6739
|
}
|
|
6813
|
-
out = it.util.cleanUpCode(out);
|
|
6814
6740
|
return out;
|
|
6815
6741
|
};
|
|
6816
6742
|
|
|
@@ -6830,7 +6756,7 @@ var anyOf = function generate_anyOf(it, $keyword, $ruleType) {
|
|
|
6830
6756
|
$it.level++;
|
|
6831
6757
|
var $nextValid = 'valid' + $it.level;
|
|
6832
6758
|
var $noEmptySchema = $schema.every(function($sch) {
|
|
6833
|
-
return it.util.schemaHasRules($sch, it.RULES.all);
|
|
6759
|
+
return (it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all));
|
|
6834
6760
|
});
|
|
6835
6761
|
if ($noEmptySchema) {
|
|
6836
6762
|
var $currentBaseId = $it.baseId;
|
|
@@ -6879,7 +6805,6 @@ var anyOf = function generate_anyOf(it, $keyword, $ruleType) {
|
|
|
6879
6805
|
if (it.opts.allErrors) {
|
|
6880
6806
|
out += ' } ';
|
|
6881
6807
|
}
|
|
6882
|
-
out = it.util.cleanUpCode(out);
|
|
6883
6808
|
} else {
|
|
6884
6809
|
if ($breakOnError) {
|
|
6885
6810
|
out += ' if (true) { ';
|
|
@@ -6892,7 +6817,7 @@ var comment = function generate_comment(it, $keyword, $ruleType) {
|
|
|
6892
6817
|
var out = ' ';
|
|
6893
6818
|
var $schema = it.schema[$keyword];
|
|
6894
6819
|
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
|
|
6895
|
-
!it.opts.allErrors;
|
|
6820
|
+
var $breakOnError = !it.opts.allErrors;
|
|
6896
6821
|
var $comment = it.util.toQuotedString($schema);
|
|
6897
6822
|
if (it.opts.$comment === true) {
|
|
6898
6823
|
out += ' console.log(' + ($comment) + ');';
|
|
@@ -6973,7 +6898,7 @@ var contains = function generate_contains(it, $keyword, $ruleType) {
|
|
|
6973
6898
|
$dataNxt = $it.dataLevel = it.dataLevel + 1,
|
|
6974
6899
|
$nextData = 'data' + $dataNxt,
|
|
6975
6900
|
$currentBaseId = it.baseId,
|
|
6976
|
-
$nonEmptySchema = it.util.schemaHasRules($schema, it.RULES.all);
|
|
6901
|
+
$nonEmptySchema = (it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all));
|
|
6977
6902
|
out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';
|
|
6978
6903
|
if ($nonEmptySchema) {
|
|
6979
6904
|
var $wasComposite = it.compositeRule;
|
|
@@ -7032,7 +6957,6 @@ var contains = function generate_contains(it, $keyword, $ruleType) {
|
|
|
7032
6957
|
if (it.opts.allErrors) {
|
|
7033
6958
|
out += ' } ';
|
|
7034
6959
|
}
|
|
7035
|
-
out = it.util.cleanUpCode(out);
|
|
7036
6960
|
return out;
|
|
7037
6961
|
};
|
|
7038
6962
|
|
|
@@ -7054,6 +6978,7 @@ var dependencies = function generate_dependencies(it, $keyword, $ruleType) {
|
|
|
7054
6978
|
$propertyDeps = {},
|
|
7055
6979
|
$ownProperties = it.opts.ownProperties;
|
|
7056
6980
|
for ($property in $schema) {
|
|
6981
|
+
if ($property == '__proto__') continue;
|
|
7057
6982
|
var $sch = $schema[$property];
|
|
7058
6983
|
var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps;
|
|
7059
6984
|
$deps[$property] = $sch;
|
|
@@ -7179,7 +7104,7 @@ var dependencies = function generate_dependencies(it, $keyword, $ruleType) {
|
|
|
7179
7104
|
var $currentBaseId = $it.baseId;
|
|
7180
7105
|
for (var $property in $schemaDeps) {
|
|
7181
7106
|
var $sch = $schemaDeps[$property];
|
|
7182
|
-
if (it.util.schemaHasRules($sch, it.RULES.all)) {
|
|
7107
|
+
if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
|
|
7183
7108
|
out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined ';
|
|
7184
7109
|
if ($ownProperties) {
|
|
7185
7110
|
out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') ';
|
|
@@ -7200,7 +7125,6 @@ var dependencies = function generate_dependencies(it, $keyword, $ruleType) {
|
|
|
7200
7125
|
if ($breakOnError) {
|
|
7201
7126
|
out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
|
|
7202
7127
|
}
|
|
7203
|
-
out = it.util.cleanUpCode(out);
|
|
7204
7128
|
return out;
|
|
7205
7129
|
};
|
|
7206
7130
|
|
|
@@ -7432,8 +7356,8 @@ var _if = function generate_if(it, $keyword, $ruleType) {
|
|
|
7432
7356
|
var $nextValid = 'valid' + $it.level;
|
|
7433
7357
|
var $thenSch = it.schema['then'],
|
|
7434
7358
|
$elseSch = it.schema['else'],
|
|
7435
|
-
$thenPresent = $thenSch !== undefined && it.util.schemaHasRules($thenSch, it.RULES.all),
|
|
7436
|
-
$elsePresent = $elseSch !== undefined && it.util.schemaHasRules($elseSch, it.RULES.all),
|
|
7359
|
+
$thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? (typeof $thenSch == 'object' && Object.keys($thenSch).length > 0) || $thenSch === false : it.util.schemaHasRules($thenSch, it.RULES.all)),
|
|
7360
|
+
$elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? (typeof $elseSch == 'object' && Object.keys($elseSch).length > 0) || $elseSch === false : it.util.schemaHasRules($elseSch, it.RULES.all)),
|
|
7437
7361
|
$currentBaseId = $it.baseId;
|
|
7438
7362
|
if ($thenPresent || $elsePresent) {
|
|
7439
7363
|
var $ifClause;
|
|
@@ -7511,7 +7435,6 @@ var _if = function generate_if(it, $keyword, $ruleType) {
|
|
|
7511
7435
|
if ($breakOnError) {
|
|
7512
7436
|
out += ' else { ';
|
|
7513
7437
|
}
|
|
7514
|
-
out = it.util.cleanUpCode(out);
|
|
7515
7438
|
} else {
|
|
7516
7439
|
if ($breakOnError) {
|
|
7517
7440
|
out += ' if (true) { ';
|
|
@@ -7587,7 +7510,7 @@ var items = function generate_items(it, $keyword, $ruleType) {
|
|
|
7587
7510
|
l1 = arr1.length - 1;
|
|
7588
7511
|
while ($i < l1) {
|
|
7589
7512
|
$sch = arr1[$i += 1];
|
|
7590
|
-
if (it.util.schemaHasRules($sch, it.RULES.all)) {
|
|
7513
|
+
if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
|
|
7591
7514
|
out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { ';
|
|
7592
7515
|
var $passData = $data + '[' + $i + ']';
|
|
7593
7516
|
$it.schema = $sch;
|
|
@@ -7610,7 +7533,7 @@ var items = function generate_items(it, $keyword, $ruleType) {
|
|
|
7610
7533
|
}
|
|
7611
7534
|
}
|
|
7612
7535
|
}
|
|
7613
|
-
if (typeof $additionalItems == 'object' && it.util.schemaHasRules($additionalItems, it.RULES.all)) {
|
|
7536
|
+
if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? (typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0) || $additionalItems === false : it.util.schemaHasRules($additionalItems, it.RULES.all))) {
|
|
7614
7537
|
$it.schema = $additionalItems;
|
|
7615
7538
|
$it.schemaPath = it.schemaPath + '.additionalItems';
|
|
7616
7539
|
$it.errSchemaPath = it.errSchemaPath + '/additionalItems';
|
|
@@ -7634,7 +7557,7 @@ var items = function generate_items(it, $keyword, $ruleType) {
|
|
|
7634
7557
|
$closingBraces += '}';
|
|
7635
7558
|
}
|
|
7636
7559
|
}
|
|
7637
|
-
} else if (it.util.schemaHasRules($schema, it.RULES.all)) {
|
|
7560
|
+
} else if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {
|
|
7638
7561
|
$it.schema = $schema;
|
|
7639
7562
|
$it.schemaPath = $schemaPath;
|
|
7640
7563
|
$it.errSchemaPath = $errSchemaPath;
|
|
@@ -7657,7 +7580,6 @@ var items = function generate_items(it, $keyword, $ruleType) {
|
|
|
7657
7580
|
if ($breakOnError) {
|
|
7658
7581
|
out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
|
|
7659
7582
|
}
|
|
7660
|
-
out = it.util.cleanUpCode(out);
|
|
7661
7583
|
return out;
|
|
7662
7584
|
};
|
|
7663
7585
|
|
|
@@ -7686,6 +7608,12 @@ var _limit = function generate__limit(it, $keyword, $ruleType) {
|
|
|
7686
7608
|
$op = $isMax ? '<' : '>',
|
|
7687
7609
|
$notOp = $isMax ? '>' : '<',
|
|
7688
7610
|
$errorKeyword = undefined;
|
|
7611
|
+
if (!($isData || typeof $schema == 'number' || $schema === undefined)) {
|
|
7612
|
+
throw new Error($keyword + ' must be number');
|
|
7613
|
+
}
|
|
7614
|
+
if (!($isDataExcl || $schemaExcl === undefined || typeof $schemaExcl == 'number' || typeof $schemaExcl == 'boolean')) {
|
|
7615
|
+
throw new Error($exclusiveKeyword + ' must be number or boolean');
|
|
7616
|
+
}
|
|
7689
7617
|
if ($isDataExcl) {
|
|
7690
7618
|
var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr),
|
|
7691
7619
|
$exclusive = 'exclusive' + $lvl,
|
|
@@ -7836,6 +7764,9 @@ var _limitItems = function generate__limitItems(it, $keyword, $ruleType) {
|
|
|
7836
7764
|
} else {
|
|
7837
7765
|
$schemaValue = $schema;
|
|
7838
7766
|
}
|
|
7767
|
+
if (!($isData || typeof $schema == 'number')) {
|
|
7768
|
+
throw new Error($keyword + ' must be number');
|
|
7769
|
+
}
|
|
7839
7770
|
var $op = $keyword == 'maxItems' ? '>' : '<';
|
|
7840
7771
|
out += 'if ( ';
|
|
7841
7772
|
if ($isData) {
|
|
@@ -7913,6 +7844,9 @@ var _limitLength = function generate__limitLength(it, $keyword, $ruleType) {
|
|
|
7913
7844
|
} else {
|
|
7914
7845
|
$schemaValue = $schema;
|
|
7915
7846
|
}
|
|
7847
|
+
if (!($isData || typeof $schema == 'number')) {
|
|
7848
|
+
throw new Error($keyword + ' must be number');
|
|
7849
|
+
}
|
|
7916
7850
|
var $op = $keyword == 'maxLength' ? '>' : '<';
|
|
7917
7851
|
out += 'if ( ';
|
|
7918
7852
|
if ($isData) {
|
|
@@ -7995,6 +7929,9 @@ var _limitProperties = function generate__limitProperties(it, $keyword, $ruleTyp
|
|
|
7995
7929
|
} else {
|
|
7996
7930
|
$schemaValue = $schema;
|
|
7997
7931
|
}
|
|
7932
|
+
if (!($isData || typeof $schema == 'number')) {
|
|
7933
|
+
throw new Error($keyword + ' must be number');
|
|
7934
|
+
}
|
|
7998
7935
|
var $op = $keyword == 'maxProperties' ? '>' : '<';
|
|
7999
7936
|
out += 'if ( ';
|
|
8000
7937
|
if ($isData) {
|
|
@@ -8071,6 +8008,9 @@ var multipleOf = function generate_multipleOf(it, $keyword, $ruleType) {
|
|
|
8071
8008
|
} else {
|
|
8072
8009
|
$schemaValue = $schema;
|
|
8073
8010
|
}
|
|
8011
|
+
if (!($isData || typeof $schema == 'number')) {
|
|
8012
|
+
throw new Error($keyword + ' must be number');
|
|
8013
|
+
}
|
|
8074
8014
|
out += 'var division' + ($lvl) + ';if (';
|
|
8075
8015
|
if ($isData) {
|
|
8076
8016
|
out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || ';
|
|
@@ -8144,7 +8084,7 @@ var not = function generate_not(it, $keyword, $ruleType) {
|
|
|
8144
8084
|
var $it = it.util.copy(it);
|
|
8145
8085
|
$it.level++;
|
|
8146
8086
|
var $nextValid = 'valid' + $it.level;
|
|
8147
|
-
if (it.util.schemaHasRules($schema, it.RULES.all)) {
|
|
8087
|
+
if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {
|
|
8148
8088
|
$it.schema = $schema;
|
|
8149
8089
|
$it.schemaPath = $schemaPath;
|
|
8150
8090
|
$it.errSchemaPath = $errSchemaPath;
|
|
@@ -8242,7 +8182,7 @@ var oneOf = function generate_oneOf(it, $keyword, $ruleType) {
|
|
|
8242
8182
|
l1 = arr1.length - 1;
|
|
8243
8183
|
while ($i < l1) {
|
|
8244
8184
|
$sch = arr1[$i += 1];
|
|
8245
|
-
if (it.util.schemaHasRules($sch, it.RULES.all)) {
|
|
8185
|
+
if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
|
|
8246
8186
|
$it.schema = $sch;
|
|
8247
8187
|
$it.schemaPath = $schemaPath + '[' + $i + ']';
|
|
8248
8188
|
$it.errSchemaPath = $errSchemaPath + '/' + $i;
|
|
@@ -8363,7 +8303,7 @@ var pattern = function generate_pattern(it, $keyword, $ruleType) {
|
|
|
8363
8303
|
return out;
|
|
8364
8304
|
};
|
|
8365
8305
|
|
|
8366
|
-
var properties
|
|
8306
|
+
var properties = function generate_properties(it, $keyword, $ruleType) {
|
|
8367
8307
|
var out = ' ';
|
|
8368
8308
|
var $lvl = it.level;
|
|
8369
8309
|
var $dataLvl = it.dataLevel;
|
|
@@ -8382,9 +8322,9 @@ var properties$2 = function generate_properties(it, $keyword, $ruleType) {
|
|
|
8382
8322
|
$dataNxt = $it.dataLevel = it.dataLevel + 1,
|
|
8383
8323
|
$nextData = 'data' + $dataNxt,
|
|
8384
8324
|
$dataProperties = 'dataProperties' + $lvl;
|
|
8385
|
-
var $schemaKeys = Object.keys($schema || {}),
|
|
8325
|
+
var $schemaKeys = Object.keys($schema || {}).filter(notProto),
|
|
8386
8326
|
$pProperties = it.schema.patternProperties || {},
|
|
8387
|
-
$pPropertyKeys = Object.keys($pProperties),
|
|
8327
|
+
$pPropertyKeys = Object.keys($pProperties).filter(notProto),
|
|
8388
8328
|
$aProperties = it.schema.additionalProperties,
|
|
8389
8329
|
$someProperties = $schemaKeys.length || $pPropertyKeys.length,
|
|
8390
8330
|
$noAdditional = $aProperties === false,
|
|
@@ -8394,7 +8334,13 @@ var properties$2 = function generate_properties(it, $keyword, $ruleType) {
|
|
|
8394
8334
|
$ownProperties = it.opts.ownProperties,
|
|
8395
8335
|
$currentBaseId = it.baseId;
|
|
8396
8336
|
var $required = it.schema.required;
|
|
8397
|
-
if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired)
|
|
8337
|
+
if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) {
|
|
8338
|
+
var $requiredHash = it.util.toHash($required);
|
|
8339
|
+
}
|
|
8340
|
+
|
|
8341
|
+
function notProto(p) {
|
|
8342
|
+
return p !== '__proto__';
|
|
8343
|
+
}
|
|
8398
8344
|
out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;';
|
|
8399
8345
|
if ($ownProperties) {
|
|
8400
8346
|
out += ' var ' + ($dataProperties) + ' = undefined;';
|
|
@@ -8547,7 +8493,7 @@ var properties$2 = function generate_properties(it, $keyword, $ruleType) {
|
|
|
8547
8493
|
while (i3 < l3) {
|
|
8548
8494
|
$propertyKey = arr3[i3 += 1];
|
|
8549
8495
|
var $sch = $schema[$propertyKey];
|
|
8550
|
-
if (it.util.schemaHasRules($sch, it.RULES.all)) {
|
|
8496
|
+
if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
|
|
8551
8497
|
var $prop = it.util.getProperty($propertyKey),
|
|
8552
8498
|
$passData = $data + $prop,
|
|
8553
8499
|
$hasDefault = $useDefaults && $sch.default !== undefined;
|
|
@@ -8650,7 +8596,7 @@ var properties$2 = function generate_properties(it, $keyword, $ruleType) {
|
|
|
8650
8596
|
while (i4 < l4) {
|
|
8651
8597
|
$pProperty = arr4[i4 += 1];
|
|
8652
8598
|
var $sch = $pProperties[$pProperty];
|
|
8653
|
-
if (it.util.schemaHasRules($sch, it.RULES.all)) {
|
|
8599
|
+
if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
|
|
8654
8600
|
$it.schema = $sch;
|
|
8655
8601
|
$it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty);
|
|
8656
8602
|
$it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty);
|
|
@@ -8689,7 +8635,6 @@ var properties$2 = function generate_properties(it, $keyword, $ruleType) {
|
|
|
8689
8635
|
if ($breakOnError) {
|
|
8690
8636
|
out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
|
|
8691
8637
|
}
|
|
8692
|
-
out = it.util.cleanUpCode(out);
|
|
8693
8638
|
return out;
|
|
8694
8639
|
};
|
|
8695
8640
|
|
|
@@ -8708,7 +8653,7 @@ var propertyNames = function generate_propertyNames(it, $keyword, $ruleType) {
|
|
|
8708
8653
|
$it.level++;
|
|
8709
8654
|
var $nextValid = 'valid' + $it.level;
|
|
8710
8655
|
out += 'var ' + ($errs) + ' = errors;';
|
|
8711
|
-
if (it.util.schemaHasRules($schema, it.RULES.all)) {
|
|
8656
|
+
if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {
|
|
8712
8657
|
$it.schema = $schema;
|
|
8713
8658
|
$it.schemaPath = $schemaPath;
|
|
8714
8659
|
$it.errSchemaPath = $errSchemaPath;
|
|
@@ -8771,11 +8716,10 @@ var propertyNames = function generate_propertyNames(it, $keyword, $ruleType) {
|
|
|
8771
8716
|
if ($breakOnError) {
|
|
8772
8717
|
out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
|
|
8773
8718
|
}
|
|
8774
|
-
out = it.util.cleanUpCode(out);
|
|
8775
8719
|
return out;
|
|
8776
8720
|
};
|
|
8777
8721
|
|
|
8778
|
-
var required
|
|
8722
|
+
var required = function generate_required(it, $keyword, $ruleType) {
|
|
8779
8723
|
var out = ' ';
|
|
8780
8724
|
var $lvl = it.level;
|
|
8781
8725
|
var $dataLvl = it.dataLevel;
|
|
@@ -8800,7 +8744,7 @@ var required$1 = function generate_required(it, $keyword, $ruleType) {
|
|
|
8800
8744
|
while (i1 < l1) {
|
|
8801
8745
|
$property = arr1[i1 += 1];
|
|
8802
8746
|
var $propertySch = it.schema.properties[$property];
|
|
8803
|
-
if (!($propertySch && it.util.schemaHasRules($propertySch, it.RULES.all))) {
|
|
8747
|
+
if (!($propertySch && (it.opts.strictKeywords ? (typeof $propertySch == 'object' && Object.keys($propertySch).length > 0) || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) {
|
|
8804
8748
|
$required[$required.length] = $property;
|
|
8805
8749
|
}
|
|
8806
8750
|
}
|
|
@@ -9071,7 +9015,7 @@ var uniqueItems = function generate_uniqueItems(it, $keyword, $ruleType) {
|
|
|
9071
9015
|
} else {
|
|
9072
9016
|
out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; ';
|
|
9073
9017
|
var $method = 'checkDataType' + ($typeIsArray ? 's' : '');
|
|
9074
|
-
out += ' if (' + (it.util[$method]($itemType, 'item', true)) + ') continue; ';
|
|
9018
|
+
out += ' if (' + (it.util[$method]($itemType, 'item', it.opts.strictNumbers, true)) + ') continue; ';
|
|
9075
9019
|
if ($typeIsArray) {
|
|
9076
9020
|
out += ' if (typeof item == \'string\') item = \'"\' + item; ';
|
|
9077
9021
|
}
|
|
@@ -9152,17 +9096,16 @@ var dotjs = {
|
|
|
9152
9096
|
not: not,
|
|
9153
9097
|
oneOf: oneOf,
|
|
9154
9098
|
pattern: pattern,
|
|
9155
|
-
properties: properties
|
|
9099
|
+
properties: properties,
|
|
9156
9100
|
propertyNames: propertyNames,
|
|
9157
|
-
required: required
|
|
9101
|
+
required: required,
|
|
9158
9102
|
uniqueItems: uniqueItems,
|
|
9159
|
-
validate: validate
|
|
9103
|
+
validate: validate
|
|
9160
9104
|
};
|
|
9161
9105
|
|
|
9162
|
-
var
|
|
9163
|
-
, toHash = util$5.toHash;
|
|
9106
|
+
var toHash$1 = util.toHash;
|
|
9164
9107
|
|
|
9165
|
-
var rules
|
|
9108
|
+
var rules = function rules() {
|
|
9166
9109
|
var RULES = [
|
|
9167
9110
|
{ type: 'number',
|
|
9168
9111
|
rules: [ { 'maximum': ['exclusiveMaximum'] },
|
|
@@ -9186,8 +9129,8 @@ var rules$1 = function rules() {
|
|
|
9186
9129
|
'additionalItems', 'then', 'else'
|
|
9187
9130
|
];
|
|
9188
9131
|
var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ];
|
|
9189
|
-
RULES.all = toHash(ALL);
|
|
9190
|
-
RULES.types = toHash(TYPES);
|
|
9132
|
+
RULES.all = toHash$1(ALL);
|
|
9133
|
+
RULES.types = toHash$1(TYPES);
|
|
9191
9134
|
|
|
9192
9135
|
RULES.forEach(function (group) {
|
|
9193
9136
|
group.rules = group.rules.map(function (keyword) {
|
|
@@ -9204,7 +9147,7 @@ var rules$1 = function rules() {
|
|
|
9204
9147
|
ALL.push(keyword);
|
|
9205
9148
|
var rule = RULES.all[keyword] = {
|
|
9206
9149
|
keyword: keyword,
|
|
9207
|
-
code:
|
|
9150
|
+
code: dotjs[keyword],
|
|
9208
9151
|
implements: implKeywords
|
|
9209
9152
|
};
|
|
9210
9153
|
return rule;
|
|
@@ -9212,13 +9155,13 @@ var rules$1 = function rules() {
|
|
|
9212
9155
|
|
|
9213
9156
|
RULES.all.$comment = {
|
|
9214
9157
|
keyword: '$comment',
|
|
9215
|
-
code:
|
|
9158
|
+
code: dotjs.$comment
|
|
9216
9159
|
};
|
|
9217
9160
|
|
|
9218
9161
|
if (group.type) RULES.types[group.type] = group;
|
|
9219
9162
|
});
|
|
9220
9163
|
|
|
9221
|
-
RULES.keywords = toHash(ALL.concat(KEYWORDS));
|
|
9164
|
+
RULES.keywords = toHash$1(ALL.concat(KEYWORDS));
|
|
9222
9165
|
RULES.custom = {};
|
|
9223
9166
|
|
|
9224
9167
|
return RULES;
|
|
@@ -9262,7 +9205,7 @@ var data = function (metaSchema, keywordsJsonPointers) {
|
|
|
9262
9205
|
keywords[key] = {
|
|
9263
9206
|
anyOf: [
|
|
9264
9207
|
schema,
|
|
9265
|
-
{ $ref: 'https://raw.githubusercontent.com/
|
|
9208
|
+
{ $ref: 'https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#' }
|
|
9266
9209
|
]
|
|
9267
9210
|
};
|
|
9268
9211
|
}
|
|
@@ -9272,7 +9215,7 @@ var data = function (metaSchema, keywordsJsonPointers) {
|
|
|
9272
9215
|
return metaSchema;
|
|
9273
9216
|
};
|
|
9274
9217
|
|
|
9275
|
-
var MissingRefError = error_classes.MissingRef;
|
|
9218
|
+
var MissingRefError$1 = error_classes.MissingRef;
|
|
9276
9219
|
|
|
9277
9220
|
var async = compileAsync;
|
|
9278
9221
|
|
|
@@ -9325,7 +9268,7 @@ function compileAsync(schema, meta, callback) {
|
|
|
9325
9268
|
function _compileAsync(schemaObj) {
|
|
9326
9269
|
try { return self._compile(schemaObj); }
|
|
9327
9270
|
catch(e) {
|
|
9328
|
-
if (e instanceof MissingRefError) return loadMissingSchema(e);
|
|
9271
|
+
if (e instanceof MissingRefError$1) return loadMissingSchema(e);
|
|
9329
9272
|
throw e;
|
|
9330
9273
|
}
|
|
9331
9274
|
|
|
@@ -9589,10 +9532,10 @@ var custom = function generate_custom(it, $keyword, $ruleType) {
|
|
|
9589
9532
|
return out;
|
|
9590
9533
|
};
|
|
9591
9534
|
|
|
9592
|
-
var $schema
|
|
9593
|
-
var $id
|
|
9535
|
+
var $schema = "http://json-schema.org/draft-07/schema#";
|
|
9536
|
+
var $id = "http://json-schema.org/draft-07/schema#";
|
|
9594
9537
|
var title = "Core schema meta-schema";
|
|
9595
|
-
var definitions
|
|
9538
|
+
var definitions = {
|
|
9596
9539
|
schemaArray: {
|
|
9597
9540
|
type: "array",
|
|
9598
9541
|
minItems: 1,
|
|
@@ -9635,7 +9578,7 @@ var definitions$1 = {
|
|
|
9635
9578
|
]
|
|
9636
9579
|
}
|
|
9637
9580
|
};
|
|
9638
|
-
var type
|
|
9581
|
+
var type = [
|
|
9639
9582
|
"object",
|
|
9640
9583
|
"boolean"
|
|
9641
9584
|
];
|
|
@@ -9831,30 +9774,33 @@ var properties$1 = {
|
|
|
9831
9774
|
$ref: "#"
|
|
9832
9775
|
}
|
|
9833
9776
|
};
|
|
9834
|
-
var
|
|
9835
|
-
$schema: $schema
|
|
9836
|
-
$id: $id
|
|
9777
|
+
var jsonSchemaDraft07 = {
|
|
9778
|
+
$schema: $schema,
|
|
9779
|
+
$id: $id,
|
|
9837
9780
|
title: title,
|
|
9838
|
-
definitions: definitions
|
|
9839
|
-
type: type
|
|
9781
|
+
definitions: definitions,
|
|
9782
|
+
type: type,
|
|
9840
9783
|
properties: properties$1,
|
|
9841
9784
|
"default": true
|
|
9842
9785
|
};
|
|
9843
9786
|
|
|
9844
|
-
var
|
|
9845
|
-
|
|
9846
|
-
|
|
9787
|
+
var jsonSchemaDraft07$1 = /*#__PURE__*/Object.freeze({
|
|
9788
|
+
__proto__: null,
|
|
9789
|
+
$schema: $schema,
|
|
9790
|
+
$id: $id,
|
|
9791
|
+
title: title,
|
|
9792
|
+
definitions: definitions,
|
|
9793
|
+
type: type,
|
|
9794
|
+
properties: properties$1,
|
|
9795
|
+
'default': jsonSchemaDraft07
|
|
9796
|
+
});
|
|
9847
9797
|
|
|
9848
|
-
var
|
|
9849
|
-
add: addKeyword,
|
|
9850
|
-
get: getKeyword,
|
|
9851
|
-
remove: removeKeyword,
|
|
9852
|
-
validate: validateKeyword
|
|
9853
|
-
};
|
|
9798
|
+
var require$$2 = getCjsExportFromNamespace(jsonSchemaDraft07$1);
|
|
9854
9799
|
|
|
9855
|
-
var
|
|
9800
|
+
var definition_schema = {
|
|
9801
|
+
$id: 'https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js',
|
|
9856
9802
|
definitions: {
|
|
9857
|
-
simpleTypes:
|
|
9803
|
+
simpleTypes: require$$2.definitions.simpleTypes
|
|
9858
9804
|
},
|
|
9859
9805
|
type: 'object',
|
|
9860
9806
|
dependencies: {
|
|
@@ -9864,7 +9810,7 @@ var definitionSchema = {
|
|
|
9864
9810
|
valid: {not: {required: ['macro']}}
|
|
9865
9811
|
},
|
|
9866
9812
|
properties: {
|
|
9867
|
-
type:
|
|
9813
|
+
type: require$$2.properties.type,
|
|
9868
9814
|
schema: {type: 'boolean'},
|
|
9869
9815
|
statements: {type: 'boolean'},
|
|
9870
9816
|
dependencies: {
|
|
@@ -9885,6 +9831,18 @@ var definitionSchema = {
|
|
|
9885
9831
|
}
|
|
9886
9832
|
};
|
|
9887
9833
|
|
|
9834
|
+
var IDENTIFIER$1 = /^[a-z_$][a-z0-9_$-]*$/i;
|
|
9835
|
+
|
|
9836
|
+
|
|
9837
|
+
|
|
9838
|
+
var keyword = {
|
|
9839
|
+
add: addKeyword,
|
|
9840
|
+
get: getKeyword,
|
|
9841
|
+
remove: removeKeyword,
|
|
9842
|
+
validate: validateKeyword
|
|
9843
|
+
};
|
|
9844
|
+
|
|
9845
|
+
|
|
9888
9846
|
/**
|
|
9889
9847
|
* Define custom keyword
|
|
9890
9848
|
* @this Ajv
|
|
@@ -9899,7 +9857,7 @@ function addKeyword(keyword, definition) {
|
|
|
9899
9857
|
if (RULES.keywords[keyword])
|
|
9900
9858
|
throw new Error('Keyword ' + keyword + ' is already defined');
|
|
9901
9859
|
|
|
9902
|
-
if (!IDENTIFIER.test(keyword))
|
|
9860
|
+
if (!IDENTIFIER$1.test(keyword))
|
|
9903
9861
|
throw new Error('Keyword ' + keyword + ' is not a valid identifier');
|
|
9904
9862
|
|
|
9905
9863
|
if (definition) {
|
|
@@ -9919,7 +9877,7 @@ function addKeyword(keyword, definition) {
|
|
|
9919
9877
|
metaSchema = {
|
|
9920
9878
|
anyOf: [
|
|
9921
9879
|
metaSchema,
|
|
9922
|
-
{ '$ref': 'https://raw.githubusercontent.com/
|
|
9880
|
+
{ '$ref': 'https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#' }
|
|
9923
9881
|
]
|
|
9924
9882
|
};
|
|
9925
9883
|
}
|
|
@@ -9949,7 +9907,7 @@ function addKeyword(keyword, definition) {
|
|
|
9949
9907
|
keyword: keyword,
|
|
9950
9908
|
definition: definition,
|
|
9951
9909
|
custom: true,
|
|
9952
|
-
code:
|
|
9910
|
+
code: custom,
|
|
9953
9911
|
implements: definition.implements
|
|
9954
9912
|
};
|
|
9955
9913
|
ruleGroup.rules.push(rule);
|
|
@@ -10008,7 +9966,7 @@ function removeKeyword(keyword) {
|
|
|
10008
9966
|
function validateKeyword(definition, throwError) {
|
|
10009
9967
|
validateKeyword.errors = null;
|
|
10010
9968
|
var v = this._validateKeyword = this._validateKeyword
|
|
10011
|
-
|| this.compile(
|
|
9969
|
+
|| this.compile(definition_schema, true);
|
|
10012
9970
|
|
|
10013
9971
|
if (v(definition)) return true;
|
|
10014
9972
|
validateKeyword.errors = v.errors;
|
|
@@ -10019,13 +9977,13 @@ function validateKeyword(definition, throwError) {
|
|
|
10019
9977
|
}
|
|
10020
9978
|
|
|
10021
9979
|
var $schema$1 = "http://json-schema.org/draft-07/schema#";
|
|
10022
|
-
var $id = "https://raw.githubusercontent.com/
|
|
9980
|
+
var $id$1 = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#";
|
|
10023
9981
|
var description = "Meta-schema for $data reference (JSON Schema extension proposal)";
|
|
10024
|
-
var type = "object";
|
|
10025
|
-
var required = [
|
|
9982
|
+
var type$1 = "object";
|
|
9983
|
+
var required$1 = [
|
|
10026
9984
|
"$data"
|
|
10027
9985
|
];
|
|
10028
|
-
var properties = {
|
|
9986
|
+
var properties$2 = {
|
|
10029
9987
|
$data: {
|
|
10030
9988
|
type: "string",
|
|
10031
9989
|
anyOf: [
|
|
@@ -10039,52 +9997,56 @@ var properties = {
|
|
|
10039
9997
|
}
|
|
10040
9998
|
};
|
|
10041
9999
|
var additionalProperties = false;
|
|
10042
|
-
var
|
|
10000
|
+
var data$1 = {
|
|
10043
10001
|
$schema: $schema$1,
|
|
10044
|
-
$id: $id,
|
|
10002
|
+
$id: $id$1,
|
|
10045
10003
|
description: description,
|
|
10046
|
-
type: type,
|
|
10047
|
-
required: required,
|
|
10048
|
-
properties: properties,
|
|
10004
|
+
type: type$1,
|
|
10005
|
+
required: required$1,
|
|
10006
|
+
properties: properties$2,
|
|
10049
10007
|
additionalProperties: additionalProperties
|
|
10050
10008
|
};
|
|
10051
10009
|
|
|
10052
|
-
var
|
|
10053
|
-
|
|
10054
|
-
|
|
10055
|
-
|
|
10056
|
-
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10060
|
-
|
|
10061
|
-
|
|
10062
|
-
|
|
10063
|
-
|
|
10064
|
-
|
|
10065
|
-
|
|
10066
|
-
|
|
10067
|
-
|
|
10068
|
-
Ajv
|
|
10069
|
-
Ajv
|
|
10070
|
-
Ajv
|
|
10071
|
-
Ajv
|
|
10072
|
-
Ajv
|
|
10073
|
-
|
|
10074
|
-
Ajv
|
|
10075
|
-
Ajv
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
Ajv
|
|
10080
|
-
|
|
10081
|
-
Ajv
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
Ajv
|
|
10086
|
-
Ajv
|
|
10087
|
-
|
|
10010
|
+
var data$2 = /*#__PURE__*/Object.freeze({
|
|
10011
|
+
__proto__: null,
|
|
10012
|
+
$schema: $schema$1,
|
|
10013
|
+
$id: $id$1,
|
|
10014
|
+
description: description,
|
|
10015
|
+
type: type$1,
|
|
10016
|
+
required: required$1,
|
|
10017
|
+
properties: properties$2,
|
|
10018
|
+
additionalProperties: additionalProperties,
|
|
10019
|
+
'default': data$1
|
|
10020
|
+
});
|
|
10021
|
+
|
|
10022
|
+
var require$$1 = getCjsExportFromNamespace(data$2);
|
|
10023
|
+
|
|
10024
|
+
var ajv = Ajv;
|
|
10025
|
+
|
|
10026
|
+
Ajv.prototype.validate = validate$1;
|
|
10027
|
+
Ajv.prototype.compile = compile$1;
|
|
10028
|
+
Ajv.prototype.addSchema = addSchema;
|
|
10029
|
+
Ajv.prototype.addMetaSchema = addMetaSchema;
|
|
10030
|
+
Ajv.prototype.validateSchema = validateSchema;
|
|
10031
|
+
Ajv.prototype.getSchema = getSchema;
|
|
10032
|
+
Ajv.prototype.removeSchema = removeSchema;
|
|
10033
|
+
Ajv.prototype.addFormat = addFormat;
|
|
10034
|
+
Ajv.prototype.errorsText = errorsText;
|
|
10035
|
+
|
|
10036
|
+
Ajv.prototype._addSchema = _addSchema;
|
|
10037
|
+
Ajv.prototype._compile = _compile;
|
|
10038
|
+
|
|
10039
|
+
Ajv.prototype.compileAsync = async;
|
|
10040
|
+
|
|
10041
|
+
Ajv.prototype.addKeyword = keyword.add;
|
|
10042
|
+
Ajv.prototype.getKeyword = keyword.get;
|
|
10043
|
+
Ajv.prototype.removeKeyword = keyword.remove;
|
|
10044
|
+
Ajv.prototype.validateKeyword = keyword.validate;
|
|
10045
|
+
|
|
10046
|
+
|
|
10047
|
+
Ajv.ValidationError = error_classes.Validation;
|
|
10048
|
+
Ajv.MissingRefError = error_classes.MissingRef;
|
|
10049
|
+
Ajv.$dataMetaSchema = data;
|
|
10088
10050
|
|
|
10089
10051
|
var META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema';
|
|
10090
10052
|
|
|
@@ -10097,16 +10059,16 @@ var META_SUPPORT_DATA = ['/properties'];
|
|
|
10097
10059
|
* @param {Object} opts optional options
|
|
10098
10060
|
* @return {Object} ajv instance
|
|
10099
10061
|
*/
|
|
10100
|
-
function Ajv
|
|
10101
|
-
if (!(this instanceof Ajv
|
|
10062
|
+
function Ajv(opts) {
|
|
10063
|
+
if (!(this instanceof Ajv)) return new Ajv(opts);
|
|
10102
10064
|
opts = this._opts = util.copy(opts) || {};
|
|
10103
10065
|
setLogger(this);
|
|
10104
10066
|
this._schemas = {};
|
|
10105
10067
|
this._refs = {};
|
|
10106
10068
|
this._fragments = {};
|
|
10107
|
-
this._formats =
|
|
10069
|
+
this._formats = formats_1(opts.format);
|
|
10108
10070
|
|
|
10109
|
-
this._cache = opts.cache || new
|
|
10071
|
+
this._cache = opts.cache || new cache;
|
|
10110
10072
|
this._loadingSchemas = {};
|
|
10111
10073
|
this._compilations = [];
|
|
10112
10074
|
this.RULES = rules();
|
|
@@ -10114,10 +10076,11 @@ function Ajv$1(opts) {
|
|
|
10114
10076
|
|
|
10115
10077
|
opts.loopRequired = opts.loopRequired || Infinity;
|
|
10116
10078
|
if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true;
|
|
10117
|
-
if (opts.serialize === undefined) opts.serialize =
|
|
10079
|
+
if (opts.serialize === undefined) opts.serialize = fastJsonStableStringify;
|
|
10118
10080
|
this._metaOpts = getMetaSchemaOptions(this);
|
|
10119
10081
|
|
|
10120
10082
|
if (opts.formats) addInitialFormats(this);
|
|
10083
|
+
if (opts.keywords) addInitialKeywords(this);
|
|
10121
10084
|
addDefaultMetaSchema(this);
|
|
10122
10085
|
if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta);
|
|
10123
10086
|
if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}});
|
|
@@ -10134,7 +10097,7 @@ function Ajv$1(opts) {
|
|
|
10134
10097
|
* @param {Any} data to be validated
|
|
10135
10098
|
* @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`).
|
|
10136
10099
|
*/
|
|
10137
|
-
function validate(schemaKeyRef, data) {
|
|
10100
|
+
function validate$1(schemaKeyRef, data) {
|
|
10138
10101
|
var v;
|
|
10139
10102
|
if (typeof schemaKeyRef == 'string') {
|
|
10140
10103
|
v = this.getSchema(schemaKeyRef);
|
|
@@ -10157,7 +10120,7 @@ function validate(schemaKeyRef, data) {
|
|
|
10157
10120
|
* @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords.
|
|
10158
10121
|
* @return {Function} validating function
|
|
10159
10122
|
*/
|
|
10160
|
-
function compile(schema, _meta) {
|
|
10123
|
+
function compile$1(schema, _meta) {
|
|
10161
10124
|
var schemaObj = this._addSchema(schema, undefined, _meta);
|
|
10162
10125
|
return schemaObj.validate || this._compile(schemaObj);
|
|
10163
10126
|
}
|
|
@@ -10180,7 +10143,7 @@ function addSchema(schema, key, _skipValidation, _meta) {
|
|
|
10180
10143
|
var id = this._getId(schema);
|
|
10181
10144
|
if (id !== undefined && typeof id != 'string')
|
|
10182
10145
|
throw new Error('schema id must be string');
|
|
10183
|
-
key =
|
|
10146
|
+
key = resolve_1.normalizeId(key || id);
|
|
10184
10147
|
checkUnique(this, key);
|
|
10185
10148
|
this._schemas[key] = this._addSchema(schema, _skipValidation, _meta, true);
|
|
10186
10149
|
return this;
|
|
@@ -10257,13 +10220,13 @@ function getSchema(keyRef) {
|
|
|
10257
10220
|
|
|
10258
10221
|
|
|
10259
10222
|
function _getSchemaFragment(self, ref) {
|
|
10260
|
-
var res =
|
|
10223
|
+
var res = resolve_1.schema.call(self, { schema: {} }, ref);
|
|
10261
10224
|
if (res) {
|
|
10262
10225
|
var schema = res.schema
|
|
10263
10226
|
, root = res.root
|
|
10264
10227
|
, baseId = res.baseId;
|
|
10265
|
-
var v =
|
|
10266
|
-
self._fragments[ref] = new
|
|
10228
|
+
var v = compile_1.call(self, schema, root, undefined, baseId);
|
|
10229
|
+
self._fragments[ref] = new schema_obj({
|
|
10267
10230
|
ref: ref,
|
|
10268
10231
|
fragment: true,
|
|
10269
10232
|
schema: schema,
|
|
@@ -10277,7 +10240,7 @@ function _getSchemaFragment(self, ref) {
|
|
|
10277
10240
|
|
|
10278
10241
|
|
|
10279
10242
|
function _getSchemaObj(self, keyRef) {
|
|
10280
|
-
keyRef =
|
|
10243
|
+
keyRef = resolve_1.normalizeId(keyRef);
|
|
10281
10244
|
return self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef];
|
|
10282
10245
|
}
|
|
10283
10246
|
|
|
@@ -10315,7 +10278,7 @@ function removeSchema(schemaKeyRef) {
|
|
|
10315
10278
|
this._cache.del(cacheKey);
|
|
10316
10279
|
var id = this._getId(schemaKeyRef);
|
|
10317
10280
|
if (id) {
|
|
10318
|
-
id =
|
|
10281
|
+
id = resolve_1.normalizeId(id);
|
|
10319
10282
|
delete this._schemas[id];
|
|
10320
10283
|
delete this._refs[id];
|
|
10321
10284
|
}
|
|
@@ -10346,17 +10309,17 @@ function _addSchema(schema, skipValidation, meta, shouldAddSchema) {
|
|
|
10346
10309
|
|
|
10347
10310
|
shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false;
|
|
10348
10311
|
|
|
10349
|
-
var id =
|
|
10312
|
+
var id = resolve_1.normalizeId(this._getId(schema));
|
|
10350
10313
|
if (id && shouldAddSchema) checkUnique(this, id);
|
|
10351
10314
|
|
|
10352
10315
|
var willValidate = this._opts.validateSchema !== false && !skipValidation;
|
|
10353
10316
|
var recursiveMeta;
|
|
10354
|
-
if (willValidate && !(recursiveMeta = id && id ==
|
|
10317
|
+
if (willValidate && !(recursiveMeta = id && id == resolve_1.normalizeId(schema.$schema)))
|
|
10355
10318
|
this.validateSchema(schema, true);
|
|
10356
10319
|
|
|
10357
|
-
var localRefs =
|
|
10320
|
+
var localRefs = resolve_1.ids.call(this, schema);
|
|
10358
10321
|
|
|
10359
|
-
var schemaObj = new
|
|
10322
|
+
var schemaObj = new schema_obj({
|
|
10360
10323
|
id: id,
|
|
10361
10324
|
schema: schema,
|
|
10362
10325
|
localRefs: localRefs,
|
|
@@ -10393,7 +10356,7 @@ function _compile(schemaObj, root) {
|
|
|
10393
10356
|
}
|
|
10394
10357
|
|
|
10395
10358
|
var v;
|
|
10396
|
-
try { v =
|
|
10359
|
+
try { v = compile_1.call(this, schemaObj.schema, root, schemaObj.localRefs); }
|
|
10397
10360
|
catch(e) {
|
|
10398
10361
|
delete schemaObj.validate;
|
|
10399
10362
|
throw e;
|
|
@@ -10489,12 +10452,12 @@ function addFormat(name, format) {
|
|
|
10489
10452
|
function addDefaultMetaSchema(self) {
|
|
10490
10453
|
var $dataSchema;
|
|
10491
10454
|
if (self._opts.$data) {
|
|
10492
|
-
$dataSchema = require$$
|
|
10455
|
+
$dataSchema = require$$1;
|
|
10493
10456
|
self.addMetaSchema($dataSchema, $dataSchema.$id, true);
|
|
10494
10457
|
}
|
|
10495
10458
|
if (self._opts.meta === false) return;
|
|
10496
|
-
var metaSchema = require$$
|
|
10497
|
-
if (self._opts.$data) metaSchema =
|
|
10459
|
+
var metaSchema = require$$2;
|
|
10460
|
+
if (self._opts.$data) metaSchema = data(metaSchema, META_SUPPORT_DATA);
|
|
10498
10461
|
self.addMetaSchema(metaSchema, META_SCHEMA_ID, true);
|
|
10499
10462
|
self._refs['http://json-schema.org/schema'] = META_SCHEMA_ID;
|
|
10500
10463
|
}
|
|
@@ -10516,6 +10479,14 @@ function addInitialFormats(self) {
|
|
|
10516
10479
|
}
|
|
10517
10480
|
|
|
10518
10481
|
|
|
10482
|
+
function addInitialKeywords(self) {
|
|
10483
|
+
for (var name in self._opts.keywords) {
|
|
10484
|
+
var keyword = self._opts.keywords[name];
|
|
10485
|
+
self.addKeyword(name, keyword);
|
|
10486
|
+
}
|
|
10487
|
+
}
|
|
10488
|
+
|
|
10489
|
+
|
|
10519
10490
|
function checkUnique(self, id) {
|
|
10520
10491
|
if (self._schemas[id] || self._refs[id])
|
|
10521
10492
|
throw new Error('schema with key or id "' + id + '" already exists');
|
|
@@ -10545,14 +10516,14 @@ function setLogger(self) {
|
|
|
10545
10516
|
|
|
10546
10517
|
function noop() {}
|
|
10547
10518
|
|
|
10548
|
-
var _Ajv = /*#__PURE__*/Object.freeze(/*#__PURE__*/
|
|
10549
|
-
|
|
10550
|
-
|
|
10551
|
-
}
|
|
10519
|
+
var _Ajv = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), ajv, {
|
|
10520
|
+
'default': ajv,
|
|
10521
|
+
__moduleExports: ajv
|
|
10522
|
+
}));
|
|
10552
10523
|
|
|
10553
10524
|
var $ref = "#/definitions/Schema";
|
|
10554
|
-
var $schema = "http://json-schema.org/draft-07/schema#";
|
|
10555
|
-
var definitions = {
|
|
10525
|
+
var $schema$2 = "http://json-schema.org/draft-07/schema#";
|
|
10526
|
+
var definitions$1 = {
|
|
10556
10527
|
ActivityType: {
|
|
10557
10528
|
anyOf: [
|
|
10558
10529
|
{
|
|
@@ -12195,21 +12166,21 @@ var definitions = {
|
|
|
12195
12166
|
type: "string"
|
|
12196
12167
|
}
|
|
12197
12168
|
};
|
|
12198
|
-
var v2 = {
|
|
12169
|
+
var v2$1 = {
|
|
12199
12170
|
$ref: $ref,
|
|
12200
|
-
$schema: $schema,
|
|
12201
|
-
definitions: definitions
|
|
12171
|
+
$schema: $schema$2,
|
|
12172
|
+
definitions: definitions$1
|
|
12202
12173
|
};
|
|
12203
12174
|
|
|
12204
12175
|
var _ddl2Schema = /*#__PURE__*/Object.freeze({
|
|
12205
12176
|
__proto__: null,
|
|
12206
12177
|
$ref: $ref,
|
|
12207
|
-
$schema: $schema,
|
|
12208
|
-
definitions: definitions,
|
|
12209
|
-
'default': v2
|
|
12178
|
+
$schema: $schema$2,
|
|
12179
|
+
definitions: definitions$1,
|
|
12180
|
+
'default': v2$1
|
|
12210
12181
|
});
|
|
12211
12182
|
|
|
12212
|
-
var Ajv = ajv || _Ajv;
|
|
12183
|
+
var Ajv$1 = ajv || _Ajv;
|
|
12213
12184
|
var ddl2Schema = _ddl2Schema;
|
|
12214
12185
|
var options = {
|
|
12215
12186
|
allErrors: false,
|
|
@@ -12217,7 +12188,7 @@ var options = {
|
|
|
12217
12188
|
jsonPointers: false
|
|
12218
12189
|
};
|
|
12219
12190
|
function doValidate(ddl, schema) {
|
|
12220
|
-
var ajv = new Ajv(options);
|
|
12191
|
+
var ajv = new Ajv$1(options);
|
|
12221
12192
|
var validate = ajv.compile(schema);
|
|
12222
12193
|
var success = validate(ddl);
|
|
12223
12194
|
return {
|
|
@@ -12249,7 +12220,7 @@ function createFilter(condition, lf, val) {
|
|
|
12249
12220
|
case ">=":
|
|
12250
12221
|
return function (localRow) { return localRow[lf] >= val; };
|
|
12251
12222
|
default:
|
|
12252
|
-
throw new Error("Unknown filter condition: "
|
|
12223
|
+
throw new Error("Unknown filter condition: " + condition);
|
|
12253
12224
|
}
|
|
12254
12225
|
}
|
|
12255
12226
|
var ColumnMapping = /** @class */ (function (_super) {
|
|
@@ -12261,16 +12232,16 @@ var ColumnMapping = /** @class */ (function (_super) {
|
|
|
12261
12232
|
var retVal = [];
|
|
12262
12233
|
if (!this.remoteField_valid()) {
|
|
12263
12234
|
retVal.push({
|
|
12264
|
-
source:
|
|
12265
|
-
msg: "Invalid remoteField: \""
|
|
12266
|
-
hint: "expected: "
|
|
12235
|
+
source: prefix + ".remoteField",
|
|
12236
|
+
msg: "Invalid remoteField: \"" + this.remoteField() + "\"",
|
|
12237
|
+
hint: "expected: " + JSON.stringify(this.sourceOutFields())
|
|
12267
12238
|
});
|
|
12268
12239
|
}
|
|
12269
12240
|
if (!this.localField_valid()) {
|
|
12270
12241
|
retVal.push({
|
|
12271
|
-
source:
|
|
12272
|
-
msg: "Invalid localField: \""
|
|
12273
|
-
hint: "expected: "
|
|
12242
|
+
source: prefix + ".localField",
|
|
12243
|
+
msg: "Invalid localField: \"" + this.localField() + "\"",
|
|
12244
|
+
hint: "expected: " + JSON.stringify(this.localFields())
|
|
12274
12245
|
});
|
|
12275
12246
|
}
|
|
12276
12247
|
return retVal;
|
|
@@ -12330,9 +12301,9 @@ var ColumnMapping = /** @class */ (function (_super) {
|
|
|
12330
12301
|
switch (this.condition()) {
|
|
12331
12302
|
case "in":
|
|
12332
12303
|
case "range":
|
|
12333
|
-
return
|
|
12304
|
+
return this.localField() + " " + this.condition() + " [" + this.remoteValues(filterSelection).join(", ") + "]";
|
|
12334
12305
|
default:
|
|
12335
|
-
return
|
|
12306
|
+
return this.localField() + " " + this.condition() + " " + this.remoteValues(filterSelection)[0];
|
|
12336
12307
|
}
|
|
12337
12308
|
};
|
|
12338
12309
|
ColumnMapping.prototype.createFilter = function (filterSelection) {
|
|
@@ -12393,21 +12364,21 @@ var RemoteFilter = /** @class */ (function (_super) {
|
|
|
12393
12364
|
var retVal = [];
|
|
12394
12365
|
if (!this.source_valid()) {
|
|
12395
12366
|
retVal.push({
|
|
12396
|
-
source:
|
|
12397
|
-
msg: "Invalid source: \""
|
|
12398
|
-
hint: "expected: "
|
|
12367
|
+
source: prefix + ".source." + this.source(),
|
|
12368
|
+
msg: "Invalid source: \"" + this.source() + "\"",
|
|
12369
|
+
hint: "expected: " + JSON.stringify(this.visualizationIDs())
|
|
12399
12370
|
});
|
|
12400
12371
|
}
|
|
12401
12372
|
if (this.source_exists() && this.validMappings().length === 0) {
|
|
12402
12373
|
retVal.push({
|
|
12403
|
-
source:
|
|
12404
|
-
msg: "Invalid mappings: \""
|
|
12374
|
+
source: prefix + ".source." + this.source(),
|
|
12375
|
+
msg: "Invalid mappings: \"" + this.source() + "\"",
|
|
12405
12376
|
hint: "expected minimum of 1 mapping"
|
|
12406
12377
|
});
|
|
12407
12378
|
}
|
|
12408
12379
|
for (var _i = 0, _a = this.validMappings(); _i < _a.length; _i++) {
|
|
12409
12380
|
var mapping = _a[_i];
|
|
12410
|
-
retVal = retVal.concat(mapping.validate(
|
|
12381
|
+
retVal = retVal.concat(mapping.validate(prefix + "." + this.source() + ".mappings"));
|
|
12411
12382
|
}
|
|
12412
12383
|
return retVal;
|
|
12413
12384
|
};
|
|
@@ -12509,9 +12480,9 @@ var StaticFilter = /** @class */ (function (_super) {
|
|
|
12509
12480
|
var retVal = [];
|
|
12510
12481
|
if (!this.localField_valid()) {
|
|
12511
12482
|
retVal.push({
|
|
12512
|
-
source:
|
|
12513
|
-
msg: "Invalid localField: \""
|
|
12514
|
-
hint: "expected: "
|
|
12483
|
+
source: prefix + ".localField",
|
|
12484
|
+
msg: "Invalid localField: \"" + this.localField() + "\"",
|
|
12485
|
+
hint: "expected: " + JSON.stringify(this.localFields())
|
|
12515
12486
|
});
|
|
12516
12487
|
}
|
|
12517
12488
|
return retVal;
|
|
@@ -12572,7 +12543,7 @@ var StaticFilter = /** @class */ (function (_super) {
|
|
|
12572
12543
|
return this._owner.inFields().map(function (field) { return field.id; });
|
|
12573
12544
|
};
|
|
12574
12545
|
StaticFilter.prototype.createFilterDescription = function () {
|
|
12575
|
-
return
|
|
12546
|
+
return this.localField() + " " + this.condition() + " " + this.coerceValue();
|
|
12576
12547
|
};
|
|
12577
12548
|
StaticFilter.prototype.createFilter = function () {
|
|
12578
12549
|
return createFilter(this.condition(), this.localField(), this.coerceValue());
|
|
@@ -12633,7 +12604,7 @@ var Filters = /** @class */ (function (_super) {
|
|
|
12633
12604
|
var remoteFilters = [];
|
|
12634
12605
|
var staticFilters = [];
|
|
12635
12606
|
_.forEach(function (fc) {
|
|
12636
|
-
if (v2
|
|
12607
|
+
if (v2.isIFilterCondition(fc)) {
|
|
12637
12608
|
remoteFilters.push(RemoteFilter.fromDDL(fc));
|
|
12638
12609
|
}
|
|
12639
12610
|
else {
|
|
@@ -12700,7 +12671,7 @@ var Filters = /** @class */ (function (_super) {
|
|
|
12700
12671
|
return this.staticFilter().filter(function (filter) { return filter.valid(); });
|
|
12701
12672
|
};
|
|
12702
12673
|
Filters.prototype.validFilters = function () {
|
|
12703
|
-
return __spreadArray
|
|
12674
|
+
return __spreadArray(__spreadArray([], this.validRemoteFilters()), this.validStaticFilters());
|
|
12704
12675
|
};
|
|
12705
12676
|
Filters.Filter = RemoteFilter;
|
|
12706
12677
|
Filters.Mapping = ColumnMapping;
|
|
@@ -12725,9 +12696,9 @@ var GroupByColumn = /** @class */ (function (_super) {
|
|
|
12725
12696
|
var retVal = [];
|
|
12726
12697
|
if (!this.label_valid()) {
|
|
12727
12698
|
retVal.push({
|
|
12728
|
-
source:
|
|
12729
|
-
msg: "Invalid label: \""
|
|
12730
|
-
hint: "expected "
|
|
12699
|
+
source: prefix + ".label",
|
|
12700
|
+
msg: "Invalid label: \"" + this.label() + "\"",
|
|
12701
|
+
hint: "expected " + JSON.stringify(this.columns())
|
|
12731
12702
|
});
|
|
12732
12703
|
}
|
|
12733
12704
|
return retVal;
|
|
@@ -12795,16 +12766,16 @@ var AggregateField = /** @class */ (function (_super) {
|
|
|
12795
12766
|
var retVal = [];
|
|
12796
12767
|
if (!this.aggrColumn_valid()) {
|
|
12797
12768
|
retVal.push({
|
|
12798
|
-
source:
|
|
12799
|
-
msg: "Invalid aggrColumn: \""
|
|
12800
|
-
hint: "expected "
|
|
12769
|
+
source: prefix + "." + this.fieldID() + ".aggrColumn",
|
|
12770
|
+
msg: "Invalid aggrColumn: \"" + this.aggrColumn() + "\"",
|
|
12771
|
+
hint: "expected " + JSON.stringify(this.columns())
|
|
12801
12772
|
});
|
|
12802
12773
|
}
|
|
12803
12774
|
if (!this.baseCountColumn_valid()) {
|
|
12804
12775
|
retVal.push({
|
|
12805
|
-
source:
|
|
12806
|
-
msg: "Invalid baseCountColumn: \""
|
|
12807
|
-
hint: "expected "
|
|
12776
|
+
source: prefix + "." + this.fieldID() + ".aggrColumn",
|
|
12777
|
+
msg: "Invalid baseCountColumn: \"" + this.baseCountColumn() + "\"",
|
|
12778
|
+
hint: "expected " + JSON.stringify(this.columns())
|
|
12808
12779
|
});
|
|
12809
12780
|
}
|
|
12810
12781
|
return retVal;
|
|
@@ -13170,15 +13141,15 @@ var ComputedMapping = /** @class */ (function (_super) {
|
|
|
13170
13141
|
var retVal = [];
|
|
13171
13142
|
if (!this.value_valid()) {
|
|
13172
13143
|
retVal.push({
|
|
13173
|
-
source:
|
|
13174
|
-
msg: "Invalid value: \""
|
|
13144
|
+
source: prefix + ".value",
|
|
13145
|
+
msg: "Invalid value: \"" + this.value() + "\"",
|
|
13175
13146
|
hint: 'expected: "any"'
|
|
13176
13147
|
});
|
|
13177
13148
|
}
|
|
13178
13149
|
if (!this.newValue_valid()) {
|
|
13179
13150
|
retVal.push({
|
|
13180
|
-
source:
|
|
13181
|
-
msg: "Invalid value: \""
|
|
13151
|
+
source: prefix + ".newValue",
|
|
13152
|
+
msg: "Invalid value: \"" + this.newValue() + "\"",
|
|
13182
13153
|
hint: 'expected: "any"'
|
|
13183
13154
|
});
|
|
13184
13155
|
}
|
|
@@ -13243,23 +13214,23 @@ var ComputedField = /** @class */ (function (_super) {
|
|
|
13243
13214
|
var retVal = [];
|
|
13244
13215
|
if (!this.column1_valid()) {
|
|
13245
13216
|
retVal.push({
|
|
13246
|
-
source:
|
|
13247
|
-
msg: "Invalid column1: \""
|
|
13248
|
-
hint: "expected: "
|
|
13217
|
+
source: prefix + "." + this.label(),
|
|
13218
|
+
msg: "Invalid column1: \"" + this.column1() + "\"",
|
|
13219
|
+
hint: "expected: " + JSON.stringify(this.columns())
|
|
13249
13220
|
});
|
|
13250
13221
|
}
|
|
13251
13222
|
if (!this.column2_valid()) {
|
|
13252
13223
|
retVal.push({
|
|
13253
|
-
source:
|
|
13254
|
-
msg: "Invalid column2: \""
|
|
13255
|
-
hint: "expected: "
|
|
13224
|
+
source: prefix + "." + this.label(),
|
|
13225
|
+
msg: "Invalid column2: \"" + this.column2() + "\"",
|
|
13226
|
+
hint: "expected: " + JSON.stringify(this.columns())
|
|
13256
13227
|
});
|
|
13257
13228
|
}
|
|
13258
13229
|
if (!this.disableMapping()) {
|
|
13259
|
-
this.validComputedMappings().forEach(function (cm) { return cm.validate(
|
|
13230
|
+
this.validComputedMappings().forEach(function (cm) { return cm.validate(prefix + ".mapping"); });
|
|
13260
13231
|
}
|
|
13261
13232
|
if (!this.disableChildField()) {
|
|
13262
|
-
this.validChildFields().forEach(function (cf) { return cf.validate(
|
|
13233
|
+
this.validChildFields().forEach(function (cf) { return cf.validate(prefix + ".childField"); });
|
|
13263
13234
|
}
|
|
13264
13235
|
return retVal;
|
|
13265
13236
|
};
|
|
@@ -13397,7 +13368,7 @@ var ComputedField = /** @class */ (function (_super) {
|
|
|
13397
13368
|
.column1(child.id);
|
|
13398
13369
|
});
|
|
13399
13370
|
}
|
|
13400
|
-
return __assign
|
|
13371
|
+
return __assign(__assign({}, this._owner.field(this.column1())), { id: this.label(), children: validChildFields.length ? validChildFields.map(function (cf) { return cf.computedField(); }) : undefined });
|
|
13401
13372
|
case "*":
|
|
13402
13373
|
case "/":
|
|
13403
13374
|
case "+":
|
|
@@ -13420,7 +13391,7 @@ var ComputedField = /** @class */ (function (_super) {
|
|
|
13420
13391
|
};
|
|
13421
13392
|
});
|
|
13422
13393
|
return function (row) {
|
|
13423
|
-
var retVal = trim && hasComputedFields ? {} : __assign
|
|
13394
|
+
var retVal = trim && hasComputedFields ? {} : __assign({}, row);
|
|
13424
13395
|
for (var _i = 0, computedFields_1 = computedFields; _i < computedFields_1.length; _i++) {
|
|
13425
13396
|
var cf = computedFields_1[_i];
|
|
13426
13397
|
retVal[cf.label] = cf.func(row);
|
|
@@ -13440,7 +13411,7 @@ var ComputedField = /** @class */ (function (_super) {
|
|
|
13440
13411
|
if (this.hasChildFields()) {
|
|
13441
13412
|
return function (row) {
|
|
13442
13413
|
// TODO Move to function factory ---
|
|
13443
|
-
var r = row[column1].Row && isArray
|
|
13414
|
+
var r = row[column1].Row && isArray(row[column1].Row) ? row[column1].Row : row[column1];
|
|
13444
13415
|
return r.map(_this.projection(trim));
|
|
13445
13416
|
};
|
|
13446
13417
|
}
|
|
@@ -13589,7 +13560,7 @@ var MultiField = /** @class */ (function (_super) {
|
|
|
13589
13560
|
var retVal = [];
|
|
13590
13561
|
for (var _i = 0, _a = this.validMultiFields(); _i < _a.length; _i++) {
|
|
13591
13562
|
var cf = _a[_i];
|
|
13592
|
-
retVal = retVal.concat(cf.validate(
|
|
13563
|
+
retVal = retVal.concat(cf.validate(prefix + ".computedFields"));
|
|
13593
13564
|
}
|
|
13594
13565
|
return retVal;
|
|
13595
13566
|
};
|
|
@@ -13648,7 +13619,7 @@ var ProjectBase = /** @class */ (function (_super) {
|
|
|
13648
13619
|
var retVal = [];
|
|
13649
13620
|
for (var _i = 0, _a = this.validComputedFields(); _i < _a.length; _i++) {
|
|
13650
13621
|
var cf = _a[_i];
|
|
13651
|
-
retVal = retVal.concat(cf.validate(
|
|
13622
|
+
retVal = retVal.concat(cf.validate(this.classID() + ".computedFields"));
|
|
13652
13623
|
}
|
|
13653
13624
|
return retVal;
|
|
13654
13625
|
};
|
|
@@ -13796,7 +13767,7 @@ var ProjectBase = /** @class */ (function (_super) {
|
|
|
13796
13767
|
}
|
|
13797
13768
|
}
|
|
13798
13769
|
return function (row) {
|
|
13799
|
-
var retVal = trim && hasComputedFields ? {} : __assign
|
|
13770
|
+
var retVal = trim && hasComputedFields ? {} : __assign({}, row);
|
|
13800
13771
|
for (var _i = 0, computedFields_3 = computedFields; _i < computedFields_3.length; _i++) {
|
|
13801
13772
|
var cf = computedFields_3[_i];
|
|
13802
13773
|
retVal[cf.label] = cf.func(row);
|
|
@@ -13841,7 +13812,7 @@ var Project = /** @class */ (function (_super) {
|
|
|
13841
13812
|
};
|
|
13842
13813
|
Project.prototype.hash = function (more) {
|
|
13843
13814
|
if (more === void 0) { more = {}; }
|
|
13844
|
-
return _super.prototype.hash.call(this, __assign
|
|
13815
|
+
return _super.prototype.hash.call(this, __assign({ ddl: this.toDDL() }, more));
|
|
13845
13816
|
};
|
|
13846
13817
|
return Project;
|
|
13847
13818
|
}(ProjectBase));
|
|
@@ -13870,7 +13841,7 @@ var Mappings = /** @class */ (function (_super) {
|
|
|
13870
13841
|
};
|
|
13871
13842
|
Mappings.prototype.hash = function (more) {
|
|
13872
13843
|
if (more === void 0) { more = {}; }
|
|
13873
|
-
return _super.prototype.hash.call(this, __assign
|
|
13844
|
+
return _super.prototype.hash.call(this, __assign({ ddl: this.toDDL() }, more));
|
|
13874
13845
|
};
|
|
13875
13846
|
Mappings.prototype.referencedFields = function (refs) {
|
|
13876
13847
|
if (this.hasComputedFields()) {
|
|
@@ -13891,9 +13862,9 @@ var SortColumn = /** @class */ (function (_super) {
|
|
|
13891
13862
|
var retVal = [];
|
|
13892
13863
|
if (!this.fieldID_valid()) {
|
|
13893
13864
|
retVal.push({
|
|
13894
|
-
source:
|
|
13895
|
-
msg: "Invalid fieldID: "
|
|
13896
|
-
hint: "expected "
|
|
13865
|
+
source: prefix + ".fieldID",
|
|
13866
|
+
msg: "Invalid fieldID: " + this.fieldID(),
|
|
13867
|
+
hint: "expected " + JSON.stringify(this.fieldIDs())
|
|
13897
13868
|
});
|
|
13898
13869
|
}
|
|
13899
13870
|
return retVal;
|
|
@@ -14012,7 +13983,7 @@ var Sort = /** @class */ (function (_super) {
|
|
|
14012
13983
|
});
|
|
14013
13984
|
}
|
|
14014
13985
|
if (sortByArr.length) {
|
|
14015
|
-
return __spreadArray
|
|
13986
|
+
return __spreadArray([], data).sort(function (l, r) {
|
|
14016
13987
|
for (var _i = 0, sortByArr_1 = sortByArr; _i < sortByArr_1.length; _i++) {
|
|
14017
13988
|
var item = sortByArr_1[_i];
|
|
14018
13989
|
var retVal2 = item.compare(l[item.id], r[item.id]);
|
|
@@ -14235,7 +14206,7 @@ var VizChartPanel = /** @class */ (function (_super) {
|
|
|
14235
14206
|
});
|
|
14236
14207
|
});
|
|
14237
14208
|
_this._origButtons = _this.buttons();
|
|
14238
|
-
_this._filterButtons = __spreadArray
|
|
14209
|
+
_this._filterButtons = __spreadArray([_this._togglePopup, new Spacer()], _this._origButtons);
|
|
14239
14210
|
return _this;
|
|
14240
14211
|
}
|
|
14241
14212
|
VizChartPanel.prototype.popup = function (_) {
|
|
@@ -14457,7 +14428,7 @@ var Visualization = /** @class */ (function (_super) {
|
|
|
14457
14428
|
}
|
|
14458
14429
|
}
|
|
14459
14430
|
else {
|
|
14460
|
-
console.log("***"
|
|
14431
|
+
console.log("***" + this.id() + " Immutable Fields***");
|
|
14461
14432
|
}
|
|
14462
14433
|
var data = mappings.outData();
|
|
14463
14434
|
var dataChanged = this._prevData !== data;
|
|
@@ -14478,7 +14449,7 @@ var Visualization = /** @class */ (function (_super) {
|
|
|
14478
14449
|
}
|
|
14479
14450
|
}
|
|
14480
14451
|
else {
|
|
14481
|
-
console.log(
|
|
14452
|
+
console.log(this.id() + " Immutable Data!");
|
|
14482
14453
|
}
|
|
14483
14454
|
if (fieldsChanged || dataChanged) {
|
|
14484
14455
|
return this.chartPanel().renderPromise().then(function () { });
|
|
@@ -14517,7 +14488,7 @@ var Visualization = /** @class */ (function (_super) {
|
|
|
14517
14488
|
};
|
|
14518
14489
|
Visualization.prototype.toDBData = function (fields, data) {
|
|
14519
14490
|
var _this = this;
|
|
14520
|
-
var _data = isArray
|
|
14491
|
+
var _data = isArray(data) ? data : [data];
|
|
14521
14492
|
return _data.map(function (row) {
|
|
14522
14493
|
var retVal = [];
|
|
14523
14494
|
for (var _i = 0, fields_1 = fields; _i < fields_1.length; _i++) {
|
|
@@ -14570,7 +14541,7 @@ var Visualization = /** @class */ (function (_super) {
|
|
|
14570
14541
|
__metadata("design:type", Function)
|
|
14571
14542
|
], Visualization.prototype, "description", void 0);
|
|
14572
14543
|
__decorate([
|
|
14573
|
-
publish(v2
|
|
14544
|
+
publish(v2.VisibilitySet[0], "set", "Type", v2.VisibilitySet),
|
|
14574
14545
|
__metadata("design:type", String)
|
|
14575
14546
|
], Visualization.prototype, "_visibility", void 0);
|
|
14576
14547
|
__decorate([
|
|
@@ -14648,7 +14619,7 @@ var Element = /** @class */ (function (_super) {
|
|
|
14648
14619
|
_this._initialized = false;
|
|
14649
14620
|
while (true) {
|
|
14650
14621
|
vizID++;
|
|
14651
|
-
_this._id = "e_"
|
|
14622
|
+
_this._id = "e_" + vizID;
|
|
14652
14623
|
if (!_this._ec.elementExists(_this._id)) {
|
|
14653
14624
|
break;
|
|
14654
14625
|
}
|
|
@@ -14656,9 +14627,9 @@ var Element = /** @class */ (function (_super) {
|
|
|
14656
14627
|
var view = new HipiePipeline(_this._ec, _this._id);
|
|
14657
14628
|
_this.hipiePipeline(view);
|
|
14658
14629
|
_this._vizChartPanel = new Visualization(_this._ec, _this.hipiePipeline())
|
|
14659
|
-
.id("viz_"
|
|
14660
|
-
.title("Element "
|
|
14661
|
-
_this._vizChartPanel.chartPanel().id("cp_"
|
|
14630
|
+
.id("viz_" + vizID)
|
|
14631
|
+
.title("Element " + vizID);
|
|
14632
|
+
_this._vizChartPanel.chartPanel().id("cp_" + vizID);
|
|
14662
14633
|
_this.visualization(_this._vizChartPanel);
|
|
14663
14634
|
_this.state(new State());
|
|
14664
14635
|
return _this;
|
|
@@ -14674,12 +14645,12 @@ var Element = /** @class */ (function (_super) {
|
|
|
14674
14645
|
_this.selection(sel ? more.selection.map(function (r) { return r.__lparam || r; }) : []);
|
|
14675
14646
|
}
|
|
14676
14647
|
else {
|
|
14677
|
-
var row = isArray
|
|
14648
|
+
var row = isArray(_row) ? _row : [_row];
|
|
14678
14649
|
_this.selection(sel ? row.map(function (r) { return r.__lparam || r; }) : []);
|
|
14679
14650
|
}
|
|
14680
14651
|
})
|
|
14681
14652
|
.on("vertex_click", function (_row, col, sel) {
|
|
14682
|
-
var row = isArray
|
|
14653
|
+
var row = isArray(_row) ? _row : [_row];
|
|
14683
14654
|
_this.selection(sel ? row.map(function (r) { return r.__lparam || r; }) : []);
|
|
14684
14655
|
});
|
|
14685
14656
|
return this;
|
|
@@ -14739,11 +14710,11 @@ var Element = /** @class */ (function (_super) {
|
|
|
14739
14710
|
}
|
|
14740
14711
|
this._errors = [];
|
|
14741
14712
|
var pipeline = this.hipiePipeline();
|
|
14742
|
-
for (var _i = 0, _a = __spreadArray
|
|
14713
|
+
for (var _i = 0, _a = __spreadArray(__spreadArray([], pipeline.activities()), [this.mappings()]); _i < _a.length; _i++) {
|
|
14743
14714
|
var activity = _a[_i];
|
|
14744
14715
|
for (var _b = 0, _c = activity.validate(); _b < _c.length; _b++) {
|
|
14745
14716
|
var error = _c[_b];
|
|
14746
|
-
this._errors.push(__assign
|
|
14717
|
+
this._errors.push(__assign({ elementID: this.id() }, error));
|
|
14747
14718
|
}
|
|
14748
14719
|
}
|
|
14749
14720
|
return this._errors;
|
|
@@ -14757,7 +14728,7 @@ var Element = /** @class */ (function (_super) {
|
|
|
14757
14728
|
_this._initialized = true;
|
|
14758
14729
|
var data = _this.hipiePipeline().outData();
|
|
14759
14730
|
if (_this.visualization().chartType() === "FieldForm") {
|
|
14760
|
-
if (_this.state().set(__spreadArray
|
|
14731
|
+
if (_this.state().set(__spreadArray([], data))) {
|
|
14761
14732
|
_this.selectionChanged();
|
|
14762
14733
|
}
|
|
14763
14734
|
}
|
|
@@ -14843,7 +14814,7 @@ var ElementContainer = /** @class */ (function (_super) {
|
|
|
14843
14814
|
return this;
|
|
14844
14815
|
};
|
|
14845
14816
|
ElementContainer.prototype.elements = function () {
|
|
14846
|
-
return __spreadArray
|
|
14817
|
+
return __spreadArray([], this._elements);
|
|
14847
14818
|
};
|
|
14848
14819
|
ElementContainer.prototype.element = function (w) {
|
|
14849
14820
|
var retVal;
|
|
@@ -15053,7 +15024,7 @@ var DashboardDockPanel = /** @class */ (function (_super) {
|
|
|
15053
15024
|
var errors = element.validate();
|
|
15054
15025
|
wa.title.label = this.tabTitle(element);
|
|
15055
15026
|
this.titleClassed(wa, "error", errors.length > 0);
|
|
15056
|
-
wa.title.caption = errors.map(function (err) { return
|
|
15027
|
+
wa.title.caption = errors.map(function (err) { return err.source + ": " + err.msg; }).join("\n");
|
|
15057
15028
|
};
|
|
15058
15029
|
DashboardDockPanel.prototype.activate = function (element) {
|
|
15059
15030
|
var wa = this.getWidgetAdapter(element.visualization().chartPanel());
|
|
@@ -15065,8 +15036,8 @@ var DashboardDockPanel = /** @class */ (function (_super) {
|
|
|
15065
15036
|
if (w.minWidth_exists() || w.minHeight_exists()) {
|
|
15066
15037
|
var wa = this.getWidgetAdapter(w);
|
|
15067
15038
|
select(wa.node)
|
|
15068
|
-
.style("min-width",
|
|
15069
|
-
.style("min-height",
|
|
15039
|
+
.style("min-width", w.minWidth() + "px")
|
|
15040
|
+
.style("min-height", w.minHeight() + "px");
|
|
15070
15041
|
return true;
|
|
15071
15042
|
}
|
|
15072
15043
|
return false;
|
|
@@ -15118,7 +15089,7 @@ var DashboardDockPanel = /** @class */ (function (_super) {
|
|
|
15118
15089
|
// IClosable ---
|
|
15119
15090
|
DashboardDockPanel.prototype.canClose = function (w, wa) {
|
|
15120
15091
|
var id = this._ec.element(w).id();
|
|
15121
|
-
var retVal = window.confirm("Remove Widget \""
|
|
15092
|
+
var retVal = window.confirm("Remove Widget \"" + id + "\"?");
|
|
15122
15093
|
if (retVal) {
|
|
15123
15094
|
this._ec.clear(id);
|
|
15124
15095
|
this.syncWidgets();
|
|
@@ -15249,8 +15220,8 @@ var DashboardGrid = /** @class */ (function (_super) {
|
|
|
15249
15220
|
if (w.minWidth_exists() || w.minHeight_exists()) {
|
|
15250
15221
|
var cell = this.getWidgetCell(w.id());
|
|
15251
15222
|
cell.element()
|
|
15252
|
-
.style("min-width",
|
|
15253
|
-
.style("min-height",
|
|
15223
|
+
.style("min-width", w.minWidth() + "px")
|
|
15224
|
+
.style("min-height", w.minHeight() + "px");
|
|
15254
15225
|
return true;
|
|
15255
15226
|
}
|
|
15256
15227
|
return false;
|
|
@@ -15313,7 +15284,7 @@ var DashboardGrid = /** @class */ (function (_super) {
|
|
|
15313
15284
|
// IClosable ---
|
|
15314
15285
|
DashboardGrid.prototype.canClose = function (w, wa) {
|
|
15315
15286
|
var id = this._ec.element(w).id();
|
|
15316
|
-
var retVal = window.confirm("Remove Widget \""
|
|
15287
|
+
var retVal = window.confirm("Remove Widget \"" + id + "\"?");
|
|
15317
15288
|
if (retVal) {
|
|
15318
15289
|
this._ec.clear(id);
|
|
15319
15290
|
this.syncWidgets();
|
|
@@ -15327,7 +15298,7 @@ var DashboardGrid = /** @class */ (function (_super) {
|
|
|
15327
15298
|
DashboardGrid.prototype._class += " marshaller_DashboardGrid";
|
|
15328
15299
|
DashboardGrid.prototype.mixin(PopupManager);
|
|
15329
15300
|
|
|
15330
|
-
var logger
|
|
15301
|
+
var logger = scopedLogger("marshaller/ddl2/ddl");
|
|
15331
15302
|
var DDLDatasourceAdapter = /** @class */ (function () {
|
|
15332
15303
|
function DDLDatasourceAdapter() {
|
|
15333
15304
|
}
|
|
@@ -15336,13 +15307,13 @@ var DDLDatasourceAdapter = /** @class */ (function () {
|
|
|
15336
15307
|
};
|
|
15337
15308
|
DDLDatasourceAdapter.prototype.id = function (dsT) {
|
|
15338
15309
|
if (dsT instanceof WU) {
|
|
15339
|
-
return
|
|
15310
|
+
return dsT.url() + "/" + dsT.wuid();
|
|
15340
15311
|
}
|
|
15341
15312
|
else if (dsT instanceof RoxieService) {
|
|
15342
|
-
return
|
|
15313
|
+
return dsT.url() + "/" + dsT.querySet() + "/" + dsT.queryID();
|
|
15343
15314
|
}
|
|
15344
15315
|
else if (dsT instanceof RestService) {
|
|
15345
|
-
return
|
|
15316
|
+
return dsT.url() + "/" + dsT.action();
|
|
15346
15317
|
}
|
|
15347
15318
|
return dsT.id();
|
|
15348
15319
|
};
|
|
@@ -15500,12 +15471,12 @@ var DDLAdapter = /** @class */ (function () {
|
|
|
15500
15471
|
};
|
|
15501
15472
|
DDLAdapter.prototype.readDatasourceRef = function (ddlDSRef, dsPicker, elementContainer) {
|
|
15502
15473
|
var _this = this;
|
|
15503
|
-
if (v2
|
|
15474
|
+
if (v2.isWUResultRef(ddlDSRef)) {
|
|
15504
15475
|
var wu = this._dsReadDedup[ddlDSRef.id];
|
|
15505
15476
|
dsPicker.datasourceID(wu.output(ddlDSRef.output).id());
|
|
15506
15477
|
}
|
|
15507
|
-
else if (v2
|
|
15508
|
-
dsPicker.datasourceID(
|
|
15478
|
+
else if (v2.isRoxieServiceRef(ddlDSRef)) {
|
|
15479
|
+
dsPicker.datasourceID(ddlDSRef.id + "_" + ddlDSRef.output);
|
|
15509
15480
|
var dsRef = dsPicker.datasourceRef();
|
|
15510
15481
|
dsRef
|
|
15511
15482
|
.request(ddlDSRef.request.map(function (rf) {
|
|
@@ -15540,7 +15511,7 @@ var DDLAdapter = /** @class */ (function () {
|
|
|
15540
15511
|
}
|
|
15541
15512
|
else if (activity instanceof DSPicker) ;
|
|
15542
15513
|
else {
|
|
15543
|
-
logger
|
|
15514
|
+
logger.warning("Unknown activity type: " + activity.classID());
|
|
15544
15515
|
}
|
|
15545
15516
|
}).filter(function (activity) { return !!activity; });
|
|
15546
15517
|
};
|
|
@@ -15601,8 +15572,8 @@ var DDLAdapter = /** @class */ (function () {
|
|
|
15601
15572
|
};
|
|
15602
15573
|
DDLAdapter.prototype.writeProperties = function () {
|
|
15603
15574
|
return {
|
|
15604
|
-
name: PKG_NAME
|
|
15605
|
-
version: PKG_VERSION
|
|
15575
|
+
name: PKG_NAME,
|
|
15576
|
+
version: PKG_VERSION,
|
|
15606
15577
|
buildVersion: BUILD_VERSION,
|
|
15607
15578
|
layout: this._dashboard.layout()
|
|
15608
15579
|
};
|
|
@@ -15616,23 +15587,23 @@ var DDLAdapter = /** @class */ (function () {
|
|
|
15616
15587
|
this.readDatasourceRef(ddlView.datasource, hipiePipeline.datasource(), this._ec);
|
|
15617
15588
|
for (var _a = 0, _b = ddlView.activities; _a < _b.length; _a++) {
|
|
15618
15589
|
var activity = _b[_a];
|
|
15619
|
-
if (v2
|
|
15590
|
+
if (v2.isProjectActivity(activity)) {
|
|
15620
15591
|
var project = this.readProject(activity);
|
|
15621
15592
|
hipiePipeline.project(project);
|
|
15622
15593
|
}
|
|
15623
|
-
if (v2
|
|
15594
|
+
if (v2.isFilterActivity(activity)) {
|
|
15624
15595
|
var filters = this.readFilters(activity, this._ec);
|
|
15625
15596
|
hipiePipeline.filters(filters);
|
|
15626
15597
|
}
|
|
15627
|
-
if (v2
|
|
15598
|
+
if (v2.isGroupByActivity(activity)) {
|
|
15628
15599
|
var groupBy = this.readGroupBy(activity);
|
|
15629
15600
|
hipiePipeline.groupBy(groupBy);
|
|
15630
15601
|
}
|
|
15631
|
-
if (v2
|
|
15602
|
+
if (v2.isSortActivity(activity)) {
|
|
15632
15603
|
var sort = this.readSort(activity);
|
|
15633
15604
|
hipiePipeline.sort(sort);
|
|
15634
15605
|
}
|
|
15635
|
-
if (v2
|
|
15606
|
+
if (v2.isLimitActivity(activity)) {
|
|
15636
15607
|
var limit = this.readLimit(activity);
|
|
15637
15608
|
hipiePipeline.limit(limit);
|
|
15638
15609
|
}
|
|
@@ -15650,8 +15621,8 @@ var DDLAdapter = /** @class */ (function () {
|
|
|
15650
15621
|
var retVal = {
|
|
15651
15622
|
version: "2.2.1",
|
|
15652
15623
|
createdBy: {
|
|
15653
|
-
name: PKG_NAME
|
|
15654
|
-
version: PKG_VERSION
|
|
15624
|
+
name: PKG_NAME,
|
|
15625
|
+
version: PKG_VERSION
|
|
15655
15626
|
},
|
|
15656
15627
|
datasources: this.writeDatasources(),
|
|
15657
15628
|
dataviews: this.writeDDLViews(),
|
|
@@ -15697,7 +15668,7 @@ var DDLAdapter = /** @class */ (function () {
|
|
|
15697
15668
|
}
|
|
15698
15669
|
break;
|
|
15699
15670
|
default:
|
|
15700
|
-
logger
|
|
15671
|
+
logger.warning("Unknown ddl datasource type: " + ddlDS.type + " ");
|
|
15701
15672
|
}
|
|
15702
15673
|
}
|
|
15703
15674
|
this.readDDLViews(ddl.dataviews);
|
|
@@ -15725,7 +15696,7 @@ var Imports = /** @class */ (function () {
|
|
|
15725
15696
|
classIDs.push(classID);
|
|
15726
15697
|
}
|
|
15727
15698
|
classIDs.sort();
|
|
15728
|
-
importJS.push("import { "
|
|
15699
|
+
importJS.push("import { " + classIDs.join(", ") + " } from \"" + moduleID + "\";");
|
|
15729
15700
|
}
|
|
15730
15701
|
return importJS.join("\n");
|
|
15731
15702
|
};
|
|
@@ -15768,18 +15739,18 @@ var JavaScriptAdapter = /** @class */ (function () {
|
|
|
15768
15739
|
switch (meta.type) {
|
|
15769
15740
|
case "string":
|
|
15770
15741
|
case "set":
|
|
15771
|
-
retVal.push(
|
|
15742
|
+
retVal.push(prefix + "." + meta.id + "(\"" + pe[meta.id]() + "\")" + postfix + ";");
|
|
15772
15743
|
break;
|
|
15773
15744
|
case "number":
|
|
15774
15745
|
case "boolean":
|
|
15775
|
-
retVal.push(
|
|
15746
|
+
retVal.push(prefix + "." + meta.id + "(" + pe[meta.id]() + ")" + postfix + ";");
|
|
15776
15747
|
break;
|
|
15777
15748
|
case "widget":
|
|
15778
|
-
retVal = retVal.concat(this.createProps(
|
|
15749
|
+
retVal = retVal.concat(this.createProps(prefix + "." + meta.id + "()", pe[meta.id]()));
|
|
15779
15750
|
break;
|
|
15780
15751
|
case "propertyArray":
|
|
15781
15752
|
if (meta.ext)
|
|
15782
|
-
retVal.push(
|
|
15753
|
+
retVal.push(prefix + "." + meta.id + "([" + pe[meta.id]() + "])" + postfix + ";");
|
|
15783
15754
|
break;
|
|
15784
15755
|
}
|
|
15785
15756
|
}
|
|
@@ -15796,13 +15767,13 @@ var JavaScriptAdapter = /** @class */ (function () {
|
|
|
15796
15767
|
};
|
|
15797
15768
|
JavaScriptAdapter.prototype.datasourceRefID = function (view) {
|
|
15798
15769
|
var datasourceRef = view.datasource;
|
|
15799
|
-
if (v2
|
|
15800
|
-
return
|
|
15770
|
+
if (v2.isRoxieServiceRef(datasourceRef)) {
|
|
15771
|
+
return this.safeID(datasourceRef.id) + "_" + this.safeID(datasourceRef.output) + "_" + this.safeID(view.id);
|
|
15801
15772
|
}
|
|
15802
|
-
else if (v2
|
|
15803
|
-
return
|
|
15773
|
+
else if (v2.isWUResultRef(datasourceRef)) {
|
|
15774
|
+
return this.safeID(datasourceRef.id) + "_" + this.safeID(datasourceRef.output);
|
|
15804
15775
|
}
|
|
15805
|
-
return ""
|
|
15776
|
+
return "" + this.safeID(datasourceRef.id);
|
|
15806
15777
|
};
|
|
15807
15778
|
JavaScriptAdapter.prototype.writeDatasource = function (view) {
|
|
15808
15779
|
var datasourceRef = view.datasource;
|
|
@@ -15817,30 +15788,30 @@ var JavaScriptAdapter = /** @class */ (function () {
|
|
|
15817
15788
|
var wuID = this.safeID(view.datasource.id);
|
|
15818
15789
|
if (!this._dedup[wuID]) {
|
|
15819
15790
|
this._dedup[wuID] = true;
|
|
15820
|
-
retVal.push(" export const "
|
|
15791
|
+
retVal.push(" export const " + wuID + " = new marshaller.WU()\n .url(\"" + datasource.url + "\")\n .wuid(\"" + datasource.wuid + "\")\n ;");
|
|
15821
15792
|
}
|
|
15822
|
-
retVal.push(" export const "
|
|
15793
|
+
retVal.push(" export const " + id + " = new marshaller.WUResult()\n .wu(" + wuID + ")\n .resultName(\"" + outputID + "\")\n .responseFields(" + stringify(datasource.outputs[outputID].fields) + ")\n ;");
|
|
15823
15794
|
break;
|
|
15824
15795
|
case "logicalfile":
|
|
15825
|
-
retVal.push(" export const "
|
|
15796
|
+
retVal.push(" export const " + id + " = new marshaller.LogicalFile()\n .url(\"" + datasource.url + "\")\n .logicalFile(\"" + datasource.logicalFile + "\")\n .responseFields(" + stringify(datasource.fields) + ")\n ;");
|
|
15826
15797
|
break;
|
|
15827
15798
|
case "hipie":
|
|
15828
15799
|
case "roxie":
|
|
15829
15800
|
var serviceID = this.safeID(view.datasource.id);
|
|
15830
15801
|
if (!this._dedup[serviceID]) {
|
|
15831
15802
|
this._dedup[serviceID] = true;
|
|
15832
|
-
retVal.push(" export const "
|
|
15803
|
+
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 ;");
|
|
15833
15804
|
}
|
|
15834
15805
|
var resultID = serviceID + "_" + this.safeID(outputID);
|
|
15835
15806
|
if (!this._dedup[resultID]) {
|
|
15836
15807
|
this._dedup[resultID] = true;
|
|
15837
|
-
retVal.push(" export const "
|
|
15808
|
+
retVal.push(" export const " + resultID + " = new marshaller.RoxieResult(ec)\n .service(" + serviceID + ")\n .resultName(\"" + outputID + "\")\n .responseFields(" + stringify(datasource.outputs[outputID].fields) + ")\n ;");
|
|
15838
15809
|
}
|
|
15839
|
-
retVal.push(" export const "
|
|
15810
|
+
retVal.push(" export const " + id + " = new marshaller.HipieResultRef(ec)\n .datasource(" + resultID + ")\n .requestFieldRefs(" + stringify(datasourceRef.request) + ")\n ;");
|
|
15840
15811
|
break;
|
|
15841
15812
|
case "databomb":
|
|
15842
15813
|
{
|
|
15843
|
-
retVal.push(" export const "
|
|
15814
|
+
retVal.push(" export const " + id + " = new marshaller.Databomb()\n .format(\"" + datasource.format + "\")\n .payload(" + JSON.stringify(datasource.payload) + ")\n ;");
|
|
15844
15815
|
}
|
|
15845
15816
|
break;
|
|
15846
15817
|
case "form":
|
|
@@ -15848,9 +15819,9 @@ var JavaScriptAdapter = /** @class */ (function () {
|
|
|
15848
15819
|
var fromFields = [];
|
|
15849
15820
|
for (var _i = 0, _a = datasource.fields; _i < _a.length; _i++) {
|
|
15850
15821
|
var field = _a[_i];
|
|
15851
|
-
fromFields.push("new marshaller.FormField().fieldID(\""
|
|
15822
|
+
fromFields.push("new marshaller.FormField().fieldID(\"" + field.id + "\").default(\"" + (field.default || "") + "\")");
|
|
15852
15823
|
}
|
|
15853
|
-
retVal.push(" export const "
|
|
15824
|
+
retVal.push(" export const " + id + " = new marshaller.Form()\n .formFields([\n " + fromFields.join(",\n ") + "\n ])\n ;");
|
|
15854
15825
|
}
|
|
15855
15826
|
break;
|
|
15856
15827
|
}
|
|
@@ -15860,17 +15831,17 @@ var JavaScriptAdapter = /** @class */ (function () {
|
|
|
15860
15831
|
JavaScriptAdapter.prototype.writeActivity = function (activity) {
|
|
15861
15832
|
switch (activity.type) {
|
|
15862
15833
|
case "filter":
|
|
15863
|
-
return "new marshaller.Filters(ec).conditions("
|
|
15834
|
+
return "new marshaller.Filters(ec).conditions(" + stringify(activity.conditions) + ")";
|
|
15864
15835
|
case "project":
|
|
15865
|
-
return "new marshaller.Project().transformations("
|
|
15836
|
+
return "new marshaller.Project().transformations(" + stringify(activity.transformations) + ")";
|
|
15866
15837
|
case "groupby":
|
|
15867
|
-
return "new marshaller.GroupBy().fieldIDs("
|
|
15838
|
+
return "new marshaller.GroupBy().fieldIDs(" + JSON.stringify(activity.groupByIDs) + ").aggregates(" + stringify(activity.aggregates) + ")";
|
|
15868
15839
|
case "sort":
|
|
15869
|
-
return "new marshaller.Sort().conditions("
|
|
15840
|
+
return "new marshaller.Sort().conditions(" + stringify(activity.conditions) + ")";
|
|
15870
15841
|
case "limit":
|
|
15871
|
-
return "new marshaller.Limit().rows("
|
|
15842
|
+
return "new marshaller.Limit().rows(" + activity.limit + ")";
|
|
15872
15843
|
case "mappings":
|
|
15873
|
-
return "new marshaller.Mappings().transformations("
|
|
15844
|
+
return "new marshaller.Mappings().transformations(" + stringify(activity.transformations) + ")";
|
|
15874
15845
|
}
|
|
15875
15846
|
};
|
|
15876
15847
|
JavaScriptAdapter.prototype.writeWidgetProps = function (pe) {
|
|
@@ -15878,7 +15849,7 @@ var JavaScriptAdapter = /** @class */ (function () {
|
|
|
15878
15849
|
for (var _i = 0, _a = pe.publishedProperties(); _i < _a.length; _i++) {
|
|
15879
15850
|
var meta = _a[_i];
|
|
15880
15851
|
if (pe[meta.id + "_modified"]() && meta.id !== "fields") {
|
|
15881
|
-
retVal.push("."
|
|
15852
|
+
retVal.push("." + meta.id + "(" + JSON.stringify(pe[meta.id]()) + ")");
|
|
15882
15853
|
}
|
|
15883
15854
|
}
|
|
15884
15855
|
return retVal;
|
|
@@ -15890,27 +15861,27 @@ var JavaScriptAdapter = /** @class */ (function () {
|
|
|
15890
15861
|
if (props.__class) {
|
|
15891
15862
|
meta = classID2Meta(props.__class);
|
|
15892
15863
|
imports.append(meta);
|
|
15893
|
-
retVal += "new "
|
|
15864
|
+
retVal += "new " + meta.class + "()";
|
|
15894
15865
|
}
|
|
15895
15866
|
for (var prop in props) {
|
|
15896
15867
|
if (prop === "__class") ;
|
|
15897
|
-
else if (isArray
|
|
15898
|
-
var arr = ""
|
|
15868
|
+
else if (isArray(props[prop])) {
|
|
15869
|
+
var arr = "" + props[prop].map(function (item) { return _this.joinWithPrefix(item, imports, joinStr + " ", ""); }).join("," + joinStr + " ");
|
|
15899
15870
|
if (arr) {
|
|
15900
|
-
retVal +=
|
|
15871
|
+
retVal += joinStr + " ." + prop + "([" + joinStr + " " + arr + joinStr + " ])" + postFix;
|
|
15901
15872
|
}
|
|
15902
15873
|
}
|
|
15903
15874
|
else {
|
|
15904
|
-
retVal +=
|
|
15875
|
+
retVal += joinStr + " ." + prop + "(" + JSON.stringify(props[prop]) + ")" + postFix;
|
|
15905
15876
|
}
|
|
15906
15877
|
}
|
|
15907
15878
|
return retVal;
|
|
15908
15879
|
};
|
|
15909
15880
|
JavaScriptAdapter.prototype.writeWidget = function (dataview, imports) {
|
|
15910
|
-
return " export const "
|
|
15881
|
+
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 ;";
|
|
15911
15882
|
};
|
|
15912
15883
|
JavaScriptAdapter.prototype.writeElement = function (dataview) {
|
|
15913
|
-
var activities = ["data."
|
|
15884
|
+
var activities = ["data." + this.datasourceRefID(dataview)];
|
|
15914
15885
|
for (var _i = 0, _a = dataview.activities; _i < _a.length; _i++) {
|
|
15915
15886
|
var activity = _a[_i];
|
|
15916
15887
|
activities.push(this.writeActivity(activity));
|
|
@@ -15918,9 +15889,9 @@ var JavaScriptAdapter = /** @class */ (function () {
|
|
|
15918
15889
|
var updates = [];
|
|
15919
15890
|
for (var _b = 0, _c = this._ec.filteredBy(dataview.id); _b < _c.length; _b++) {
|
|
15920
15891
|
var filteredViz = _c[_b];
|
|
15921
|
-
updates.push(
|
|
15892
|
+
updates.push(filteredViz.id() + ".refresh();");
|
|
15922
15893
|
}
|
|
15923
|
-
return "\nconst "
|
|
15894
|
+
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";
|
|
15924
15895
|
};
|
|
15925
15896
|
JavaScriptAdapter.prototype.writeDatasources = function () {
|
|
15926
15897
|
var retVal = [];
|
|
@@ -15952,7 +15923,7 @@ var JavaScriptAdapter = /** @class */ (function () {
|
|
|
15952
15923
|
};
|
|
15953
15924
|
JavaScriptAdapter.prototype.createJavaScript = function () {
|
|
15954
15925
|
var widgets = this.writeWidgets();
|
|
15955
|
-
return
|
|
15926
|
+
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";
|
|
15956
15927
|
};
|
|
15957
15928
|
return JavaScriptAdapter;
|
|
15958
15929
|
}());
|
|
@@ -15984,8 +15955,8 @@ function styleInject(css, ref) {
|
|
|
15984
15955
|
}
|
|
15985
15956
|
}
|
|
15986
15957
|
|
|
15987
|
-
var css_248z
|
|
15988
|
-
styleInject(css_248z
|
|
15958
|
+
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)}";
|
|
15959
|
+
styleInject(css_248z);
|
|
15989
15960
|
|
|
15990
15961
|
var Dashboard = /** @class */ (function (_super) {
|
|
15991
15962
|
__extends(Dashboard, _super);
|
|
@@ -16015,7 +15986,7 @@ var Dashboard = /** @class */ (function (_super) {
|
|
|
16015
15986
|
.enabled(false)
|
|
16016
15987
|
.on("click", function () {
|
|
16017
15988
|
var elem = _this._prevActive;
|
|
16018
|
-
if (elem && window.confirm("Remove Widget \""
|
|
15989
|
+
if (elem && window.confirm("Remove Widget \"" + elem.id() + "\"?")) {
|
|
16019
15990
|
_this._ec.clear(elem.id());
|
|
16020
15991
|
_this.renderPromise().then(function () {
|
|
16021
15992
|
_this.vizActivation(undefined);
|
|
@@ -16211,7 +16182,7 @@ var Dashboard = /** @class */ (function (_super) {
|
|
|
16211
16182
|
};
|
|
16212
16183
|
Dashboard.prototype.importDDL = function (ddl, baseUrl, wuid, dermatologyJson) {
|
|
16213
16184
|
if (dermatologyJson === void 0) { dermatologyJson = {}; }
|
|
16214
|
-
var ddl2 = isDDL2Schema(ddl) ? ddl : upgrade(ddl, baseUrl, wuid, true, dermatologyJson);
|
|
16185
|
+
var ddl2 = isDDL2Schema(ddl) ? ddl : upgrade$1(ddl, baseUrl, wuid, true, dermatologyJson);
|
|
16215
16186
|
return this.restore(ddl2, true);
|
|
16216
16187
|
};
|
|
16217
16188
|
Dashboard.prototype.javascript = function () {
|
|
@@ -16260,8 +16231,8 @@ var Dashboard = /** @class */ (function (_super) {
|
|
|
16260
16231
|
}(ChartPanel));
|
|
16261
16232
|
Dashboard.prototype._class += " dashboard_dashboard";
|
|
16262
16233
|
|
|
16263
|
-
var css_248z$
|
|
16264
|
-
styleInject(css_248z$
|
|
16234
|
+
var css_248z$1 = "";
|
|
16235
|
+
styleInject(css_248z$1);
|
|
16265
16236
|
|
|
16266
16237
|
var DDLEditor = /** @class */ (function (_super) {
|
|
16267
16238
|
__extends(DDLEditor, _super);
|
|
@@ -16347,7 +16318,7 @@ var GraphAdapter = /** @class */ (function () {
|
|
|
16347
16318
|
this.subgraphMap[id] = retVal;
|
|
16348
16319
|
}
|
|
16349
16320
|
this.vertices.push(retVal);
|
|
16350
|
-
retVal.title(""
|
|
16321
|
+
retVal.title("" + label);
|
|
16351
16322
|
retVal.getBBox(true);
|
|
16352
16323
|
return retVal;
|
|
16353
16324
|
};
|
|
@@ -16365,13 +16336,13 @@ var GraphAdapter = /** @class */ (function () {
|
|
|
16365
16336
|
this.vertices.push(retVal);
|
|
16366
16337
|
retVal
|
|
16367
16338
|
.textbox_shape_colorFill(fillColor)
|
|
16368
|
-
.text(tooltip ?
|
|
16339
|
+
.text(tooltip ? label + "\n" + tooltip : "" + label)
|
|
16369
16340
|
.tooltip(tooltip);
|
|
16370
16341
|
retVal.getBBox(true);
|
|
16371
16342
|
return retVal;
|
|
16372
16343
|
};
|
|
16373
16344
|
GraphAdapter.prototype.createEdge = function (sourceID, targetID) {
|
|
16374
|
-
var edgeID =
|
|
16345
|
+
var edgeID = sourceID + "->" + targetID;
|
|
16375
16346
|
var retVal = this.edgeMap[edgeID];
|
|
16376
16347
|
if (!retVal) {
|
|
16377
16348
|
retVal = new Edge()
|
|
@@ -16387,27 +16358,27 @@ var GraphAdapter = /** @class */ (function () {
|
|
|
16387
16358
|
dsDetails = dsDetails.selection().datasource();
|
|
16388
16359
|
}
|
|
16389
16360
|
if (dsDetails instanceof WUResult) {
|
|
16390
|
-
var serverID = ""
|
|
16391
|
-
var server = this.createSubgraph(serverID, ""
|
|
16392
|
-
var wuID =
|
|
16393
|
-
var wu = this.createSubgraph(wuID, ""
|
|
16361
|
+
var serverID = "" + dsDetails.url();
|
|
16362
|
+
var server = this.createSubgraph(serverID, "" + serverID);
|
|
16363
|
+
var wuID = dsDetails.url() + "/" + dsDetails.wuid();
|
|
16364
|
+
var wu = this.createSubgraph(wuID, "" + dsDetails.wuid());
|
|
16394
16365
|
this.hierarchy.push({ parent: server, child: wu });
|
|
16395
|
-
var resultID =
|
|
16366
|
+
var resultID = wuID + "/" + dsDetails.resultName();
|
|
16396
16367
|
var result = this.createVertex(resultID, dsDetails.resultName(), { activity: dsDetails });
|
|
16397
16368
|
this.hierarchy.push({ parent: wu, child: result });
|
|
16398
16369
|
return resultID;
|
|
16399
16370
|
}
|
|
16400
16371
|
else if (dsDetails instanceof LogicalFile) {
|
|
16401
|
-
var serverID = ""
|
|
16402
|
-
var server = this.createSubgraph(serverID, ""
|
|
16403
|
-
var lfID =
|
|
16372
|
+
var serverID = "" + dsDetails.url();
|
|
16373
|
+
var server = this.createSubgraph(serverID, "" + serverID);
|
|
16374
|
+
var lfID = serverID + "/" + dsDetails.logicalFile();
|
|
16404
16375
|
var lf = this.createVertex(lfID, dsDetails.logicalFile(), { activity: dsDetails });
|
|
16405
16376
|
this.hierarchy.push({ parent: server, child: lf });
|
|
16406
16377
|
return lfID;
|
|
16407
16378
|
}
|
|
16408
16379
|
else if (dsDetails instanceof RoxieResultRef) {
|
|
16409
|
-
var serverID = ""
|
|
16410
|
-
var server = this.createSubgraph(serverID, ""
|
|
16380
|
+
var serverID = "" + dsDetails.url();
|
|
16381
|
+
var server = this.createSubgraph(serverID, "" + serverID);
|
|
16411
16382
|
var surfaceID = dsDetails.serviceID(); // `${dsDetails.url()}/${dsDetails.querySet()}`;
|
|
16412
16383
|
var surface = this.createSubgraph(surfaceID, dsDetails.querySet());
|
|
16413
16384
|
this.hierarchy.push({ parent: server, child: surface });
|
|
@@ -16416,7 +16387,7 @@ var GraphAdapter = /** @class */ (function () {
|
|
|
16416
16387
|
parent: surface,
|
|
16417
16388
|
child: this.createVertex(roxieID, dsDetails.queryID())
|
|
16418
16389
|
});
|
|
16419
|
-
var roxieResultID =
|
|
16390
|
+
var roxieResultID = surfaceID + "/" + dsDetails.resultName();
|
|
16420
16391
|
this.hierarchy.push({
|
|
16421
16392
|
parent: surface,
|
|
16422
16393
|
child: this.createVertex(roxieResultID, dsDetails.resultName(), { activity: dsDetails })
|
|
@@ -16425,15 +16396,15 @@ var GraphAdapter = /** @class */ (function () {
|
|
|
16425
16396
|
return roxieResultID;
|
|
16426
16397
|
}
|
|
16427
16398
|
else if (dsDetails instanceof RoxieResult) {
|
|
16428
|
-
var serverID = ""
|
|
16429
|
-
var server = this.createSubgraph(serverID, ""
|
|
16399
|
+
var serverID = "" + dsDetails.service().url();
|
|
16400
|
+
var server = this.createSubgraph(serverID, "" + serverID);
|
|
16430
16401
|
var querySetID = dsDetails.serviceID();
|
|
16431
16402
|
var querySet = this.createSubgraph(querySetID, dsDetails.service().querySet());
|
|
16432
16403
|
this.hierarchy.push({ parent: server, child: querySet });
|
|
16433
|
-
var queryID =
|
|
16404
|
+
var queryID = querySetID + "/" + dsDetails.service().queryID();
|
|
16434
16405
|
var query = this.createSubgraph(queryID, dsDetails.service().queryID());
|
|
16435
16406
|
this.hierarchy.push({ parent: querySet, child: query });
|
|
16436
|
-
var resultID =
|
|
16407
|
+
var resultID = queryID + "/" + dsDetails.resultName();
|
|
16437
16408
|
this.hierarchy.push({
|
|
16438
16409
|
parent: query,
|
|
16439
16410
|
child: this.createVertex(resultID, dsDetails.resultName(), { activity: dsDetails })
|
|
@@ -16442,8 +16413,8 @@ var GraphAdapter = /** @class */ (function () {
|
|
|
16442
16413
|
return resultID;
|
|
16443
16414
|
}
|
|
16444
16415
|
else if (dsDetails instanceof RestResultRef) {
|
|
16445
|
-
var serverID = ""
|
|
16446
|
-
var server = this.createSubgraph(serverID, ""
|
|
16416
|
+
var serverID = "" + dsDetails.url();
|
|
16417
|
+
var server = this.createSubgraph(serverID, "" + serverID);
|
|
16447
16418
|
var surfaceID = dsDetails.serviceID();
|
|
16448
16419
|
var surface = this.createSubgraph(surfaceID, dsDetails.action());
|
|
16449
16420
|
this.hierarchy.push({ parent: server, child: surface });
|
|
@@ -16452,7 +16423,7 @@ var GraphAdapter = /** @class */ (function () {
|
|
|
16452
16423
|
parent: surface,
|
|
16453
16424
|
child: this.createVertex(roxieID, dsDetails.action())
|
|
16454
16425
|
});
|
|
16455
|
-
var roxieResultID =
|
|
16426
|
+
var roxieResultID = surfaceID + "/" + dsDetails.resultName();
|
|
16456
16427
|
this.hierarchy.push({
|
|
16457
16428
|
parent: surface,
|
|
16458
16429
|
child: this.createVertex(roxieResultID, dsDetails.resultName(), { activity: dsDetails })
|
|
@@ -16461,13 +16432,13 @@ var GraphAdapter = /** @class */ (function () {
|
|
|
16461
16432
|
return roxieResultID;
|
|
16462
16433
|
}
|
|
16463
16434
|
else if (dsDetails instanceof RestResult) {
|
|
16464
|
-
var serverID = ""
|
|
16465
|
-
var server = this.createSubgraph(serverID, ""
|
|
16435
|
+
var serverID = "" + dsDetails.service().url();
|
|
16436
|
+
var server = this.createSubgraph(serverID, "" + serverID);
|
|
16466
16437
|
var serviceID = dsDetails.serviceID();
|
|
16467
|
-
var actionID =
|
|
16438
|
+
var actionID = serverID + "/" + dsDetails.service().action();
|
|
16468
16439
|
var action = this.createSubgraph(serviceID, dsDetails.service().action());
|
|
16469
16440
|
this.hierarchy.push({ parent: server, child: action });
|
|
16470
|
-
var resultID =
|
|
16441
|
+
var resultID = actionID + "/" + dsDetails.resultName();
|
|
16471
16442
|
this.hierarchy.push({
|
|
16472
16443
|
parent: action,
|
|
16473
16444
|
child: this.createVertex(resultID, dsDetails.resultName(), { activity: dsDetails })
|
|
@@ -16492,20 +16463,20 @@ var GraphAdapter = /** @class */ (function () {
|
|
|
16492
16463
|
}
|
|
16493
16464
|
};
|
|
16494
16465
|
GraphAdapter.prototype.createActivity = function (sourceID, view, activity, label) {
|
|
16495
|
-
var surface = this.createSubgraph(view.id(), ""
|
|
16466
|
+
var surface = this.createSubgraph(view.id(), "" + view.id(), { view: view });
|
|
16496
16467
|
var fillColor = null;
|
|
16497
16468
|
var tooltip = "";
|
|
16498
16469
|
if (activity.exists()) {
|
|
16499
16470
|
var errors = activity.validate();
|
|
16500
16471
|
if (errors.length) {
|
|
16501
16472
|
fillColor = "pink";
|
|
16502
|
-
tooltip = errors.map(function (error) { return
|
|
16473
|
+
tooltip = errors.map(function (error) { return error.source + ": " + error.msg; }).join("\n");
|
|
16503
16474
|
}
|
|
16504
16475
|
}
|
|
16505
16476
|
else {
|
|
16506
16477
|
fillColor = "lightgrey";
|
|
16507
16478
|
}
|
|
16508
|
-
var vertex = this.createVertex(activity.id(), label || ""
|
|
16479
|
+
var vertex = this.createVertex(activity.id(), label || "" + activity.classID(), { view: view, activity: activity }, tooltip, fillColor);
|
|
16509
16480
|
if (sourceID) {
|
|
16510
16481
|
this.createEdge(sourceID, activity.id());
|
|
16511
16482
|
}
|
|
@@ -16532,7 +16503,7 @@ var GraphAdapter = /** @class */ (function () {
|
|
|
16532
16503
|
var visualization = view.visualization();
|
|
16533
16504
|
var mappings = visualization.mappings();
|
|
16534
16505
|
var mappingVertexID = this.createActivity(prevID, view, mappings, "Mappings");
|
|
16535
|
-
var vizSubgraphID =
|
|
16506
|
+
var vizSubgraphID = visualization.id() + "-sg";
|
|
16536
16507
|
var surface = this.createSubgraph(vizSubgraphID, "Visualization", { visualization: visualization });
|
|
16537
16508
|
this.hierarchy.push({
|
|
16538
16509
|
parent: this.subgraphMap[view.id()],
|
|
@@ -16542,14 +16513,14 @@ var GraphAdapter = /** @class */ (function () {
|
|
|
16542
16513
|
parent: surface,
|
|
16543
16514
|
child: this.vertexMap[mappings.id()]
|
|
16544
16515
|
});
|
|
16545
|
-
var vizVertexID =
|
|
16516
|
+
var vizVertexID = visualization.id() + "-viz";
|
|
16546
16517
|
var widgetVertex = this.createVertex(vizVertexID, visualization.chartPanel().widget().classID(), { view: view, chartPanel: visualization.chartPanel() });
|
|
16547
16518
|
this.createEdge(mappingVertexID, vizVertexID);
|
|
16548
16519
|
this.hierarchy.push({
|
|
16549
16520
|
parent: surface,
|
|
16550
16521
|
child: widgetVertex
|
|
16551
16522
|
});
|
|
16552
|
-
var stateVertexID =
|
|
16523
|
+
var stateVertexID = visualization.id() + "-state";
|
|
16553
16524
|
var stateVertex = this.createVertex(stateVertexID, "Selection", { view: view, state: view.state() });
|
|
16554
16525
|
this.createEdge(vizVertexID, stateVertexID)
|
|
16555
16526
|
.weight(10)
|
|
@@ -16570,7 +16541,7 @@ var GraphAdapter = /** @class */ (function () {
|
|
|
16570
16541
|
var secondaryElement = this._ec.element(visualization.secondaryDataviewID());
|
|
16571
16542
|
if (secondaryElement) {
|
|
16572
16543
|
var mappings = secondaryElement.visualization().mappings();
|
|
16573
|
-
this.createEdge(mappings.id(),
|
|
16544
|
+
this.createEdge(mappings.id(), visualization.id() + "-viz");
|
|
16574
16545
|
}
|
|
16575
16546
|
}
|
|
16576
16547
|
for (var _f = 0, _g = this._ec.elements(); _f < _g.length; _f++) {
|
|
@@ -16821,8 +16792,8 @@ var DVTable = /** @class */ (function (_super) {
|
|
|
16821
16792
|
return DVTable;
|
|
16822
16793
|
}(ChartPanel));
|
|
16823
16794
|
|
|
16824
|
-
var css_248z$
|
|
16825
|
-
styleInject(css_248z$
|
|
16795
|
+
var css_248z$2 = ".common_SelectionButton.error{background:red;background:linear-gradient(180deg,rgba(255,0,0,.5),hsla(0,0%,100%,0) 80%)}";
|
|
16796
|
+
styleInject(css_248z$2);
|
|
16826
16797
|
|
|
16827
16798
|
var PipelineSelectionButton = /** @class */ (function (_super) {
|
|
16828
16799
|
__extends(PipelineSelectionButton, _super);
|
|
@@ -16848,7 +16819,7 @@ var PipelineSelectionButton = /** @class */ (function (_super) {
|
|
|
16848
16819
|
this.tooltip(_.map(function (err) {
|
|
16849
16820
|
var errSourceParts = err.source.split(".");
|
|
16850
16821
|
errSourceParts.splice(0, 1);
|
|
16851
|
-
return
|
|
16822
|
+
return errSourceParts.join(".") + ": " + err.msg;
|
|
16852
16823
|
}).join("\n"));
|
|
16853
16824
|
}
|
|
16854
16825
|
else {
|
|
@@ -17127,7 +17098,7 @@ var PipelinePanel = /** @class */ (function (_super) {
|
|
|
17127
17098
|
return PipelinePanel;
|
|
17128
17099
|
}(ChartPanel));
|
|
17129
17100
|
PipelinePanel.prototype._class += " marshaller_PipelinePanel";
|
|
17130
|
-
var DDLPreview
|
|
17101
|
+
var DDLPreview = /** @class */ (function (_super) {
|
|
17131
17102
|
__extends(DDLPreview, _super);
|
|
17132
17103
|
function DDLPreview() {
|
|
17133
17104
|
var _this = _super.call(this) || this;
|
|
@@ -17194,7 +17165,7 @@ var PipelineSplitPanel = /** @class */ (function (_super) {
|
|
|
17194
17165
|
_this.propChanged(id, newValue, oldValue, source);
|
|
17195
17166
|
});
|
|
17196
17167
|
_this._previewPanel = new TabPanel();
|
|
17197
|
-
_this._rhsDDLPreview = new DDLPreview
|
|
17168
|
+
_this._rhsDDLPreview = new DDLPreview();
|
|
17198
17169
|
_this._rhsDataPreview = new DatasourceTable().pagination(true);
|
|
17199
17170
|
_this._previewPanel
|
|
17200
17171
|
.addWidget(_this._rhsDataPreview, "Data")
|
|
@@ -17245,11 +17216,11 @@ var PipelineSplitPanel = /** @class */ (function (_super) {
|
|
|
17245
17216
|
return PipelineSplitPanel;
|
|
17246
17217
|
}(SplitPanel));
|
|
17247
17218
|
|
|
17248
|
-
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;
|
|
17249
|
-
styleInject(css_248z);
|
|
17219
|
+
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}";
|
|
17220
|
+
styleInject(css_248z$3);
|
|
17250
17221
|
|
|
17251
|
-
var logger = scopedLogger("marshaller/dashy");
|
|
17252
|
-
var DDLPreview = /** @class */ (function (_super) {
|
|
17222
|
+
var logger$1 = scopedLogger("marshaller/dashy");
|
|
17223
|
+
var DDLPreview$1 = /** @class */ (function (_super) {
|
|
17253
17224
|
__extends(DDLPreview, _super);
|
|
17254
17225
|
function DDLPreview(_dashy) {
|
|
17255
17226
|
var _this = _super.call(this) || this;
|
|
@@ -17334,7 +17305,7 @@ var Dashy = /** @class */ (function (_super) {
|
|
|
17334
17305
|
.on("vertex_contextmenu", function (row, col, sel, ext) {
|
|
17335
17306
|
});
|
|
17336
17307
|
_this._lhsDebugSheet = new TabPanel();
|
|
17337
|
-
_this._lhsDebugDDLEditor = new DDLPreview(_this);
|
|
17308
|
+
_this._lhsDebugDDLEditor = new DDLPreview$1(_this);
|
|
17338
17309
|
_this._lhsDebugDDLSchema = new JSONEditor().json(ddl2Schema);
|
|
17339
17310
|
_this._lhsDebugJSEditor = new JSEditor();
|
|
17340
17311
|
_this._lhsDebugCloneEC = new ElementContainer();
|
|
@@ -17398,7 +17369,7 @@ var Dashy = /** @class */ (function (_super) {
|
|
|
17398
17369
|
for (var _i = 0, _a = _this._elementContainer.validate(); _i < _a.length; _i++) {
|
|
17399
17370
|
var error = _a[_i];
|
|
17400
17371
|
hasError = true;
|
|
17401
|
-
logger.warning(error.elementID + " (" + error.source + "): " + error.msg);
|
|
17372
|
+
logger$1.warning(error.elementID + " (" + error.source + "): " + error.msg);
|
|
17402
17373
|
}
|
|
17403
17374
|
if (hasError) {
|
|
17404
17375
|
// Re-render to highlight errrors ---
|
|
@@ -17409,7 +17380,7 @@ var Dashy = /** @class */ (function (_super) {
|
|
|
17409
17380
|
};
|
|
17410
17381
|
Dashy.prototype.importDDL = function (ddl, baseUrl, wuid, dermatologyJson) {
|
|
17411
17382
|
if (dermatologyJson === void 0) { dermatologyJson = {}; }
|
|
17412
|
-
var ddl2 = isDDL2Schema(ddl) ? ddl : upgrade(ddl, baseUrl, wuid, true, dermatologyJson);
|
|
17383
|
+
var ddl2 = isDDL2Schema(ddl) ? ddl : upgrade$1(ddl, baseUrl, wuid, true, dermatologyJson);
|
|
17413
17384
|
var retVal = this.restore(ddl2);
|
|
17414
17385
|
if (isDDL2Schema(ddl)) {
|
|
17415
17386
|
this._lhsDebugDDLv2.json(ddl2);
|
|
@@ -17472,7 +17443,7 @@ var Dashy = /** @class */ (function (_super) {
|
|
|
17472
17443
|
};
|
|
17473
17444
|
Dashy.prototype.loadGraph = function () {
|
|
17474
17445
|
this._lhsPipeline
|
|
17475
|
-
.data(__assign
|
|
17446
|
+
.data(__assign({}, this._graphAdapter.createGraph()), true);
|
|
17476
17447
|
if (this.activeLHS() === this._lhsPipeline) {
|
|
17477
17448
|
this._lhsPipeline
|
|
17478
17449
|
.lazyRender();
|
|
@@ -17505,7 +17476,7 @@ var Dashy = /** @class */ (function (_super) {
|
|
|
17505
17476
|
}).then(function () {
|
|
17506
17477
|
for (var _i = 0, _a = _this._lhsDebugCloneEC.validate(); _i < _a.length; _i++) {
|
|
17507
17478
|
var error = _a[_i];
|
|
17508
|
-
logger.warning(error.elementID + " (" + error.source + "): " + error.msg);
|
|
17479
|
+
logger$1.warning(error.elementID + " (" + error.source + "): " + error.msg);
|
|
17509
17480
|
}
|
|
17510
17481
|
});
|
|
17511
17482
|
});
|
|
@@ -17553,11 +17524,11 @@ var Dashy = /** @class */ (function (_super) {
|
|
|
17553
17524
|
palette.addItem({ command: "remove", category: "Notebook" });
|
|
17554
17525
|
palette.id = "palette";
|
|
17555
17526
|
var contextMenu = new ContextMenu({ commands: commands });
|
|
17556
|
-
contextMenu.addItem({ command: "dash_add", selector: "#"
|
|
17557
|
-
contextMenu.addItem({ command: "dash_clear", selector: "#"
|
|
17558
|
-
contextMenu.addItem({ type: "separator", selector: "#"
|
|
17559
|
-
contextMenu.addItem({ command: "dash_load", selector: "#"
|
|
17560
|
-
contextMenu.addItem({ command: "dash_save", selector: "#"
|
|
17527
|
+
contextMenu.addItem({ command: "dash_add", selector: "#" + this._lhsDashboard.id() });
|
|
17528
|
+
contextMenu.addItem({ command: "dash_clear", selector: "#" + this._lhsDashboard.id() });
|
|
17529
|
+
contextMenu.addItem({ type: "separator", selector: "#" + this._lhsDashboard.id() });
|
|
17530
|
+
contextMenu.addItem({ command: "dash_load", selector: "#" + this.id() });
|
|
17531
|
+
contextMenu.addItem({ command: "dash_save", selector: "#" + this.id() });
|
|
17561
17532
|
document.addEventListener("contextmenu", function (event) {
|
|
17562
17533
|
if (contextMenu.open(event)) {
|
|
17563
17534
|
event.preventDefault();
|
|
@@ -17699,5 +17670,5 @@ var Dashy = /** @class */ (function (_super) {
|
|
|
17699
17670
|
}(SplitPanel));
|
|
17700
17671
|
Dashy.prototype._class += " composite_Dashy";
|
|
17701
17672
|
|
|
17702
|
-
export { Activity, ActivityArray, ActivityPipeline, ActivitySelection, AggregateField, BUILD_VERSION, ColumnMapping, ComputedField, ComputedMapping, DDLAdapter, DDLEditor, DSPicker, Dashboard, Dashy, Databomb, Datasource, DatasourceAdapt, DatasourceRef, ESPResult, Element, ElementContainer, Filters, Form, FormField, GraphAdapter, GroupBy, GroupByColumn, HipiePipeline, HipieResultRef, JavaScriptAdapter, Limit, LogicalFile, Mappings, MultiField, NullView, PKG_NAME
|
|
17673
|
+
export { Activity, ActivityArray, ActivityPipeline, ActivitySelection, AggregateField, BUILD_VERSION, ColumnMapping, ComputedField, ComputedMapping, DDLAdapter, DDLEditor, DSPicker, Dashboard, Dashy, Databomb, Datasource, DatasourceAdapt, DatasourceRef, ESPResult, Element, ElementContainer, Filters, Form, FormField, GraphAdapter, GroupBy, GroupByColumn, HipiePipeline, HipieResultRef, JavaScriptAdapter, Limit, LogicalFile, Mappings, MultiField, NullView, PKG_NAME, PKG_VERSION, Project, ProjectBase, RemoteFilter, RoxieResult, RoxieResultRef, RoxieService, Sort, SortColumn, State, StaticFilter, Visualization, VizChartPanel, VizPopupPanel, VizTypeSet, WU, WUResult, WUResultRef, createProps, emptyDatabomb, rowToFields, schemaRow2IField, schemaType2IFieldType, stringify, wsEclSchemaRow2IField };
|
|
17703
17674
|
//# sourceMappingURL=index.es6.js.map
|