@hpcc-js/ddl-shim 2.17.25 → 2.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,54 +1,69 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
3
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = global || self, factory(global['@hpcc-js/ddl-shim'] = {}));
5
- }(this, (function (exports) { 'use strict';
6
-
7
- var PKG_NAME = "@hpcc-js/ddl-shim";
8
- var PKG_VERSION = "2.17.25";
9
- var BUILD_VERSION = "2.101.0";
10
-
11
- function isWorkunitDatasource(ref) {
12
- return ref.WUID !== undefined;
13
- }
14
- function isDatabombDatasource(ref) {
15
- return ref.databomb === true;
16
- }
17
- function isHipieDatasource(ref) {
18
- return ref.URL !== undefined;
19
- }
20
- function isPieVisualization(viz) {
21
- return viz.type === "PIE" || viz.type === "BAR";
22
- }
23
- function isLineVisualization(viz) {
24
- return viz.type === "LINE";
25
- }
26
- function isChoroVisualization(viz) {
27
- return viz.type === "CHORO";
28
- }
29
- function isTableVisualization(viz) {
30
- return viz.type === "TABLE";
31
- }
32
- function isSliderVisualization(viz) {
33
- return viz.type === "SLIDER";
34
- }
35
- function isGraphVisualization(viz) {
36
- return viz.type === "GRAPH";
37
- }
38
- function isHeatMapVisualization(viz) {
39
- return viz.type === "HEAT_MAP";
40
- }
41
- function isFormVisualization(viz) {
42
- return viz.type === "FORM";
43
- }
44
- function isUSStateMapping(mappings) {
45
- return mappings.state !== undefined;
46
- }
47
- function isUSCountyMapping(mappings) {
48
- return mappings.county !== undefined;
49
- }
50
- function isGeohashMapping(mappings) {
51
- return mappings.geohash !== undefined;
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@hpcc-js/ddl-shim"] = {}));
5
+ })(this, (function (exports) { 'use strict';
6
+
7
+ function _mergeNamespaces(n, m) {
8
+ m.forEach(function (e) {
9
+ e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default' && !(k in n)) {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ });
19
+ return Object.freeze(n);
20
+ }
21
+
22
+ var PKG_NAME = "@hpcc-js/ddl-shim";
23
+ var PKG_VERSION = "2.18.1";
24
+ var BUILD_VERSION = "2.102.1";
25
+
26
+ function isWorkunitDatasource(ref) {
27
+ return ref.WUID !== undefined;
28
+ }
29
+ function isDatabombDatasource(ref) {
30
+ return ref.databomb === true;
31
+ }
32
+ function isHipieDatasource(ref) {
33
+ return ref.URL !== undefined;
34
+ }
35
+ function isPieVisualization(viz) {
36
+ return viz.type === "PIE" || viz.type === "BAR";
37
+ }
38
+ function isLineVisualization(viz) {
39
+ return viz.type === "LINE";
40
+ }
41
+ function isChoroVisualization(viz) {
42
+ return viz.type === "CHORO";
43
+ }
44
+ function isTableVisualization(viz) {
45
+ return viz.type === "TABLE";
46
+ }
47
+ function isSliderVisualization(viz) {
48
+ return viz.type === "SLIDER";
49
+ }
50
+ function isGraphVisualization(viz) {
51
+ return viz.type === "GRAPH";
52
+ }
53
+ function isHeatMapVisualization(viz) {
54
+ return viz.type === "HEAT_MAP";
55
+ }
56
+ function isFormVisualization(viz) {
57
+ return viz.type === "FORM";
58
+ }
59
+ function isUSStateMapping(mappings) {
60
+ return mappings.state !== undefined;
61
+ }
62
+ function isUSCountyMapping(mappings) {
63
+ return mappings.county !== undefined;
64
+ }
65
+ function isGeohashMapping(mappings) {
66
+ return mappings.geohash !== undefined;
52
67
  }
53
68
 
54
69
  var v1 = /*#__PURE__*/Object.freeze({
@@ -69,39 +84,39 @@
69
84
  isGeohashMapping: isGeohashMapping
70
85
  });
71
86
 
72
- function isDatabombRef(ref) {
73
- return !isWUResultRef(ref) && !isRoxieServiceRef(ref);
74
- }
75
- function isWUResultRef(ref) {
76
- return ref.output !== undefined && !isRoxieServiceRef(ref);
77
- }
78
- function isRoxieServiceRef(ref) {
79
- return ref.request !== undefined;
80
- }
81
- function isIFilterCondition(fc) {
82
- return !!fc.viewID;
83
- }
84
- function isFilterActivity(activity) {
85
- return activity.type === "filter";
86
- }
87
- function isProjectActivity(activity) {
88
- return activity.type === "project";
89
- }
90
- function isMappingsActivity(activity) {
91
- return activity.type === "mappings";
92
- }
93
- function isGroupByActivity(activity) {
94
- return activity.type === "groupby";
95
- }
96
- function isSortActivity(activity) {
97
- return activity.type === "sort";
98
- }
99
- function isLimitActivity(activity) {
100
- return activity.type === "limit";
101
- }
87
+ function isDatabombRef(ref) {
88
+ return !isWUResultRef(ref) && !isRoxieServiceRef(ref);
89
+ }
90
+ function isWUResultRef(ref) {
91
+ return ref.output !== undefined && !isRoxieServiceRef(ref);
92
+ }
93
+ function isRoxieServiceRef(ref) {
94
+ return ref.request !== undefined;
95
+ }
96
+ function isIFilterCondition(fc) {
97
+ return !!fc.viewID;
98
+ }
99
+ function isFilterActivity(activity) {
100
+ return activity.type === "filter";
101
+ }
102
+ function isProjectActivity(activity) {
103
+ return activity.type === "project";
104
+ }
105
+ function isMappingsActivity(activity) {
106
+ return activity.type === "mappings";
107
+ }
108
+ function isGroupByActivity(activity) {
109
+ return activity.type === "groupby";
110
+ }
111
+ function isSortActivity(activity) {
112
+ return activity.type === "sort";
113
+ }
114
+ function isLimitActivity(activity) {
115
+ return activity.type === "limit";
116
+ }
102
117
  var VisibilitySet = ["normal", "flyout"];
103
118
 
104
- var v2 = /*#__PURE__*/Object.freeze({
119
+ var v2$1 = /*#__PURE__*/Object.freeze({
105
120
  __proto__: null,
106
121
  isDatabombRef: isDatabombRef,
107
122
  isWUResultRef: isWUResultRef,
@@ -149,960 +164,941 @@
149
164
  ar[i] = from[i];
150
165
  }
151
166
  }
152
- return to.concat(ar || from);
153
- }
154
-
155
- var classMappings = {
156
- c3chart_Bar: "chart_Bar",
157
- c3chart_Column: "chart_Column",
158
- c3chart_Pie: "chart_Pie",
159
- c3chart_Area: "chart_Area",
160
- c3chart_Line: "chart_Line",
161
- amchart_Bar: "chart_Bar",
162
- amchart_Column: "chart_Column",
163
- amchart_Pie: "chart_Pie",
164
- amchart_Area: "chart_Area",
165
- amchart_Line: "chart_Line",
166
- google_Bar: "chart_Bar",
167
- google_Column: "chart_Column",
168
- google_Pie: "chart_Pie",
169
- google_Area: "chart_Area",
170
- google_Line: "chart_Line",
171
- other_Table: "dgrid_Table"
172
- };
173
- var propertyMappings = {
174
- xAxisLabelRotation: [
175
- { name: "xAxisOverlapMode", transform: function (n) { return "rotate"; } },
176
- { name: "xAxisLabelRotation", transform: function (n) { return n; } }
177
- ],
178
- tooltipLabelColor: {
179
- name: "tooltipLabelColor"
180
- },
181
- tooltipSeriesColor: {
182
- name: "tooltipSeriesColor"
183
- },
184
- tooltipValueColor: {
185
- name: "tooltipValueColor"
186
- },
187
- tooltipValueFormat: {
188
- name: "tooltipValueFormat"
189
- },
190
- timePattern: {
191
- name: "xAxisTypeTimePattern"
192
- },
193
- smoothLines: {
194
- name: "interpolate",
195
- transform: function (n) {
196
- if (n === false)
197
- return "linear";
198
- return "catmullRom";
199
- }
200
- },
201
- holePercent: {
202
- name: "innerRadius"
203
- },
204
- flip: {
205
- name: "orientation",
206
- transform: function (n) { return n ? "vertical" : "horizontal"; }
207
- },
208
- bottomText: {
209
- name: "xAxisTitle"
210
- },
211
- xAxisTypeTimePattern: {
212
- name: "xAxisTypeTimePattern"
213
- },
214
- yAxisTypeTimePattern: {
215
- name: "yAxisTypeTimePattern"
216
- },
217
- valueFormat: {
218
- name: "tooltipValueFormat"
219
- },
220
- stacked: {
221
- name: "yAxisStacked"
222
- },
223
- showYGrid: {
224
- name: "yAxisGuideLines"
225
- },
226
- showXGrid: {
227
- name: "xAxisGuideLines"
228
- },
229
- showValueLabel: {
230
- name: "showValue"
231
- },
232
- low: {
233
- name: "yAxisDomainLow"
234
- },
235
- high: {
236
- name: "yAxisDomainHigh"
237
- },
238
- fillOpacity: {
239
- name: "interpolateFillOpacity"
240
- },
241
- areaFillOpacity: {
242
- name: "interpolateFillOpacity"
243
- },
244
- showToolbar: {
245
- name: "titleVisible"
246
- },
247
- showCSV: {
248
- name: "downloadButtonVisible"
249
- }
250
- };
251
- function findKeyVal(object, key, val) {
252
- var value;
253
- for (var k in object) {
254
- if (k === key && object[k] === val) {
255
- value = object;
256
- break;
257
- }
258
- if (object[k] && typeof object[k] === "object") {
259
- value = findKeyVal(object[k], key, val);
260
- if (value !== undefined) {
261
- break;
262
- }
263
- }
264
- }
265
- return value;
266
- }
267
- function apply_to_dataviews(ddl2, dermObj) {
268
- ddl2.dataviews.forEach(apply_to_dataview);
269
- function apply_to_dataview(dv) {
270
- var widgetId = dv.id;
271
- var dermPanelObj = findKeyVal(dermObj, "__id", widgetId);
272
- if (dermPanelObj) {
273
- var dermPanelProps = dermPanelObj.__properties;
274
- var dermWidgetObj = dermPanelObj.__properties.chart ? dermPanelObj.__properties.chart : dermPanelObj.__properties.widget;
275
- var dermWidgetProps = dermWidgetObj.__properties;
276
- apply_class_mapping(dermWidgetObj);
277
- apply_panel_property_mapping(dermPanelProps, dermWidgetProps);
278
- apply_widget_property_mapping(dermPanelProps, dermWidgetProps);
279
- if (dv.visualization.properties.chartType) {
280
- dv.visualization.properties.charttype = dv.visualization.properties.chartType;
281
- }
282
- }
283
- else {
284
- console.warn(widgetId + " not found in dermObj");
285
- }
286
- function apply_class_mapping(dermWidgetObj) {
287
- dv.visualization.__class = swap_with_supported_class(dermWidgetObj.__class);
288
- dv.visualization.properties.__class = "marshaller_VizChartPanel";
289
- if (!dv.visualization.properties.widget)
290
- dv.visualization.properties.widget = {};
291
- dv.visualization.properties.widget.__class = dv.visualization.__class;
292
- function swap_with_supported_class(_class) {
293
- return classMappings[_class] ? classMappings[_class] : _class;
294
- }
295
- }
296
- function apply_panel_property_mapping(dermPanelProps, dermWidgetProps) {
297
- dv.visualization.title = dermPanelProps.title || "";
298
- dv.visualization.description = "";
299
- dv.visualization.visibility = dv.visualization.visibility === "flyout" ? "flyout" : "normal";
300
- dv.visualization.chartType = dv.visualization.__class.split("_")[1];
301
- for (var propName in dermPanelProps) {
302
- if (typeof propertyMappings[propName] !== "undefined") {
303
- var newPropName = propertyMappings[propName].name;
304
- if (typeof propertyMappings[propName].transform === "function") {
305
- dv.visualization.properties[newPropName] = propertyMappings[propName].transform(dermPanelProps[propName]);
306
- }
307
- else {
308
- dv.visualization.properties[newPropName] = dermPanelProps[propName];
309
- }
310
- }
311
- }
312
- if (dermWidgetProps && dermWidgetProps.showLegend && dv.visualization.properties) {
313
- dv.visualization.properties.legendVisible = true;
314
- }
315
- }
316
- function apply_widget_property_mapping(dermPanelProps, dermWidgetProps) {
317
- dv.visualization.title = dv.visualization.title || dermWidgetProps.title || "";
318
- dv.visualization.description = ""; // TODO - should this map to anything?
319
- dv.visualization.visibility = dv.visualization.visibility === "flyout" ? "flyout" : "normal";
320
- dv.visualization.chartType = dv.visualization.__class.split("_")[1];
321
- var _loop_1 = function (propName) {
322
- if (typeof propertyMappings[propName] !== "undefined") {
323
- if (propertyMappings[propName] instanceof Array) {
324
- propertyMappings[propName].forEach(function (p) {
325
- var newPropName = p.name;
326
- dv.visualization.properties.widget[newPropName] = p.transform(dermWidgetProps[propName]);
327
- if (typeof propertyMappings[propName].transform === "function") {
328
- dv.visualization.properties.widget[newPropName] = propertyMappings[propName].transform(dermWidgetProps[propName]);
329
- }
330
- else {
331
- dv.visualization.properties.widget[newPropName] = dermWidgetProps[propName];
332
- }
333
- });
334
- }
335
- else {
336
- var newPropName = propertyMappings[propName].name;
337
- dv.visualization.properties.widget[newPropName] = propertyMappings[propName].transform(dermWidgetProps[propName]);
338
- }
339
- }
340
- };
341
- for (var propName in dermWidgetProps) {
342
- _loop_1(propName);
343
- }
344
- }
345
- }
346
- }
347
- function apply_to_properties_layout(ddl2, dermObj) {
348
- var retVal = {
349
- layout: []
350
- };
351
- if (!dermObj || !dermObj.__properties)
352
- return;
353
- dermObj.__properties.content.forEach(function (cell) {
354
- var cellPosition = {
355
- // TODO - if "id" could be avoided then layouts could apply to any dashboard with the same number of widgets
356
- id: cell.__properties.widget.__id,
357
- position: [
358
- cell.__properties.gridCol,
359
- cell.__properties.gridRow,
360
- cell.__properties.gridColSpan,
361
- cell.__properties.gridRowSpan
362
- ]
363
- };
364
- retVal.layout.push(cellPosition);
365
- });
366
- return retVal;
367
- }
368
- function upgrade(ddl2, dermObj) {
369
- apply_to_dataviews(ddl2, dermObj);
370
- return apply_to_properties_layout(ddl2, dermObj);
371
- }
372
-
373
- function faCharFix(faChar) {
374
- return faChar;
375
- }
376
- var DDLUpgrade = /** @class */ (function () {
377
- function DDLUpgrade(ddl, baseUrl, wuid, toLowerCase) {
378
- if (baseUrl === void 0) { baseUrl = "http://localhost:8010"; }
379
- if (wuid === void 0) { wuid = "WUID"; }
380
- if (toLowerCase === void 0) { toLowerCase = true; }
381
- this._datasources = {};
382
- this._datasourceUpdates = {};
383
- this._visualizations = {};
384
- this._ddl2Datasources = {};
385
- this._ddl2DatasourceFields = {};
386
- this._ddl2Dataviews = {};
387
- this._ddl2DataviewActivities = {};
388
- this._ddl = ddl;
389
- this._baseUrl = baseUrl;
390
- this._wuid = wuid;
391
- this._toLowerCase = toLowerCase;
392
- this.indexDDL();
393
- this.readDDL();
394
- }
395
- DDLUpgrade.prototype.toLowerCase = function (s) {
396
- return this._toLowerCase ? s.toLowerCase() : s;
397
- };
398
- DDLUpgrade.prototype.isVizDatasourceRoxie = function (viz) {
399
- if (viz.source) {
400
- var ds = this._datasources[viz.source.id];
401
- if (isHipieDatasource(ds)) {
402
- return true;
403
- }
404
- }
405
- return false;
406
- };
407
- DDLUpgrade.prototype.getDatasourceOutputs = function (dsID, vizID) {
408
- var retVal = [];
409
- var datasource = this._datasources[dsID];
410
- for (var _i = 0, _a = datasource.outputs; _i < _a.length; _i++) {
411
- var output = _a[_i];
412
- if (output.notify) {
413
- for (var _b = 0, _c = output.notify; _b < _c.length; _b++) {
414
- var notify = _c[_b];
415
- if (notify === vizID) {
416
- retVal.push({
417
- datasource: datasource,
418
- output: output
419
- });
420
- }
421
- }
422
- }
423
- }
424
- return retVal;
425
- };
426
- DDLUpgrade.prototype.getDatasourceFilters = function (dsID, vizID) {
427
- var retVal = {};
428
- for (var _i = 0, _a = this.getDatasourceOutputs(dsID, vizID); _i < _a.length; _i++) {
429
- var dsOut = _a[_i];
430
- if (dsOut.output.filter) {
431
- for (var _b = 0, _c = dsOut.output.filter; _b < _c.length; _b++) {
432
- var filter = _c[_b];
433
- retVal[filter.fieldid] = {
434
- datasource: dsOut.datasource,
435
- output: dsOut.output,
436
- filter: filter
437
- };
438
- }
439
- }
440
- }
441
- return retVal;
442
- };
443
- DDLUpgrade.prototype.indexDDL = function () {
444
- for (var _i = 0, _a = this._ddl.dashboards; _i < _a.length; _i++) {
445
- var dash = _a[_i];
446
- for (var _b = 0, _c = dash.visualizations; _b < _c.length; _b++) {
447
- var viz = _c[_b];
448
- this._visualizations[viz.id] = viz;
449
- }
450
- }
451
- for (var _d = 0, _e = this._ddl.datasources; _d < _e.length; _d++) {
452
- var ds = _e[_d];
453
- this._datasources[ds.id] = ds;
454
- for (var _f = 0, _g = ds.outputs; _f < _g.length; _f++) {
455
- var output = _g[_f];
456
- if (output.notify) {
457
- for (var _h = 0, _j = output.notify; _h < _j.length; _h++) {
458
- var notify = _j[_h];
459
- this._datasourceUpdates[notify] = {
460
- id: ds.id,
461
- output: output.from || output.id
462
- };
463
- }
464
- }
465
- }
466
- }
467
- };
468
- DDLUpgrade.prototype.readDDL = function () {
469
- for (var _i = 0, _a = this._ddl.datasources; _i < _a.length; _i++) {
470
- var ds = _a[_i];
471
- if (isWorkunitDatasource(ds)) {
472
- var ddl2DS = {
473
- type: "wuresult",
474
- id: ds.id,
475
- url: this._baseUrl,
476
- wuid: this._wuid,
477
- outputs: {}
478
- };
479
- for (var _b = 0, _c = ds.outputs; _b < _c.length; _b++) {
480
- var output = _c[_b];
481
- this.output2output(output, ddl2DS.outputs);
482
- }
483
- this._ddl2Datasources[ds.id] = ddl2DS;
484
- }
485
- else if (isDatabombDatasource(ds)) ;
486
- else {
487
- var urlParts = ds.URL.split("/WsEcl/submit/query/");
488
- var hostParts = urlParts[0];
489
- var roxieParts = urlParts[1].split("/");
490
- var ddl2DS = {
491
- type: "hipie",
492
- id: ds.id,
493
- url: hostParts,
494
- querySet: roxieParts[0],
495
- queryID: roxieParts[1],
496
- inputs: [],
497
- outputs: {}
498
- };
499
- for (var _d = 0, _e = ds.outputs; _d < _e.length; _d++) {
500
- var output = _e[_d];
501
- this.output2output(output, ddl2DS.outputs);
502
- }
503
- this._ddl2Datasources[ds.id] = ddl2DS;
504
- }
505
- }
506
- for (var _f = 0, _g = this._ddl.dashboards; _f < _g.length; _f++) {
507
- var dash = _g[_f];
508
- for (var _h = 0, _j = dash.visualizations; _h < _j.length; _h++) {
509
- var viz = _j[_h];
510
- if (viz.type === "FORM") {
511
- this._ddl2Datasources[viz.id] = {
512
- type: "form",
513
- id: viz.id,
514
- fields: this.formFields2field(viz.fields)
515
- };
516
- this._datasourceUpdates[viz.id] = { id: viz.id };
517
- }
518
- else if (viz.type === "SLIDER") {
519
- this._ddl2Datasources[viz.id] = {
520
- type: "form",
521
- id: viz.id,
522
- fields: this.formFields2field(viz.fields, true)
523
- };
524
- this._datasourceUpdates[viz.id] = { id: viz.id };
525
- }
526
- this._ddl2Dataviews[viz.id] = this.anyViz2view(viz);
527
- }
528
- }
529
- this.readGroupBy();
530
- this.readFilters();
531
- this.readSort();
532
- this.readMappings();
533
- };
534
- DDLUpgrade.prototype.readGroupBy = function () {
535
- for (var _i = 0, _a = this._ddl.dashboards; _i < _a.length; _i++) {
536
- var dash = _a[_i];
537
- for (var _b = 0, _c = dash.visualizations; _b < _c.length; _b++) {
538
- var viz = _c[_b];
539
- if (viz.fields) {
540
- var projectTransformations = [];
541
- var groupByColumns = [];
542
- var aggrFields = [];
543
- for (var _d = 0, _e = viz.fields; _d < _e.length; _d++) {
544
- var field = _e[_d];
545
- if (field.properties && field.properties.function) {
546
- switch (field.properties.function) {
547
- case "SUM":
548
- case "MIN":
549
- case "MAX":
550
- aggrFields.push({
551
- type: this.func2aggr(field.properties.function),
552
- inFieldID: this.toLowerCase(field.properties.params.param1),
553
- fieldID: this.toLowerCase(field.id)
554
- });
555
- break;
556
- case "AVE":
557
- aggrFields.push({
558
- type: this.func2aggr(field.properties.function),
559
- inFieldID: this.toLowerCase(field.properties.params.param1),
560
- baseCountFieldID: field.properties.params.param2 ? this.toLowerCase(field.properties.params.param2) : undefined,
561
- fieldID: this.toLowerCase(field.id)
562
- });
563
- break;
564
- case "SCALE":
565
- if (typeof field.properties.params.param1 === "object") {
566
- var props = field.properties.params.param1;
567
- switch (props.function) {
568
- case "SUM":
569
- case "MIN":
570
- case "MAX":
571
- aggrFields.push({
572
- type: this.func2aggr(props.function),
573
- inFieldID: this.toLowerCase(props.params.param1),
574
- fieldID: this.toLowerCase(field.id)
575
- });
576
- break;
577
- }
578
- }
579
- projectTransformations.push({
580
- type: "scale",
581
- sourceFieldID: this.toLowerCase(field.id),
582
- fieldID: this.toLowerCase(field.id),
583
- factor: +field.properties.params.param2
584
- });
585
- break;
586
- default:
587
- groupByColumns.push(this.toLowerCase(field.id));
588
- throw new Error("Unhandled field function: " + field.properties.function);
589
- }
590
- }
591
- else {
592
- groupByColumns.push(this.toLowerCase(field.id));
593
- }
594
- }
595
- if (projectTransformations.length) {
596
- this._ddl2DataviewActivities[viz.id].project.transformations = projectTransformations;
597
- }
598
- if (aggrFields.length) {
599
- this._ddl2DataviewActivities[viz.id].groupBy.groupByIDs = __spreadArray([], groupByColumns);
600
- this._ddl2DataviewActivities[viz.id].groupBy.aggregates = aggrFields;
601
- }
602
- }
603
- }
604
- }
605
- };
606
- DDLUpgrade.prototype.func2aggr = function (func) {
607
- switch (func) {
608
- case "SUM":
609
- return "sum";
610
- case "AVE":
611
- return "mean";
612
- case "MIN":
613
- return "min";
614
- case "MAX":
615
- return "max";
616
- }
617
- throw new Error("Unknown DDL1 Function Type: " + func);
618
- };
619
- DDLUpgrade.prototype.readMappings = function () {
620
- for (var _i = 0, _a = this._ddl.dashboards; _i < _a.length; _i++) {
621
- var dash = _a[_i];
622
- for (var _b = 0, _c = dash.visualizations; _b < _c.length; _b++) {
623
- var viz = _c[_b];
624
- if (isFormVisualization(viz)) ;
625
- else if (isPieVisualization(viz)) {
626
- this.readPieMappings(viz);
627
- }
628
- else if (isChoroVisualization(viz)) {
629
- this.readChoroMappings(viz);
630
- }
631
- else if (isLineVisualization(viz)) {
632
- this.readLineMappings(viz);
633
- }
634
- else if (isTableVisualization(viz)) {
635
- this.readTableMappings(viz);
636
- }
637
- else if (isGraphVisualization(viz)) {
638
- this.readGraphMappings(viz);
639
- }
640
- else if (isSliderVisualization(viz)) {
641
- this.readSliderMappings(viz);
642
- }
643
- else {
644
- throw new Error("Unkown DDL1 mapping type: " + viz.type);
645
- }
646
- }
647
- }
648
- };
649
- DDLUpgrade.prototype.readPieMappings = function (viz) {
650
- var mappings = this._ddl2DataviewActivities[viz.id].mappings;
651
- mappings.transformations.push({
652
- fieldID: "label",
653
- type: "=",
654
- sourceFieldID: this.toLowerCase(viz.source.mappings.label)
655
- });
656
- mappings.transformations.push({
657
- fieldID: "weight",
658
- type: "=",
659
- sourceFieldID: this.toLowerCase(viz.source.mappings.weight[0])
660
- });
661
- };
662
- DDLUpgrade.prototype.readChoroMappings = function (viz) {
663
- var mappings = this._ddl2DataviewActivities[viz.id].mappings;
664
- mappings.transformations.push({
665
- fieldID: "label",
666
- type: "=",
667
- sourceFieldID: this.toLowerCase(this.anyChoroMapping2label(viz.source.mappings))
668
- });
669
- mappings.transformations.push({
670
- fieldID: "weight",
671
- type: "=",
672
- sourceFieldID: this.toLowerCase(viz.source.mappings.weight[0])
673
- });
674
- };
675
- DDLUpgrade.prototype.anyChoroMapping2label = function (mapping) {
676
- return mapping.state || mapping.county || mapping.geohash;
677
- };
678
- DDLUpgrade.prototype.readLineMappings = function (viz) {
679
- var mappings = this._ddl2DataviewActivities[viz.id].mappings;
680
- mappings.transformations.push({
681
- fieldID: viz.source.mappings.x[0],
682
- type: "=",
683
- sourceFieldID: this.toLowerCase(viz.source.mappings.x[0])
684
- });
685
- for (var i = 0; i < viz.source.mappings.y.length; ++i) {
686
- mappings.transformations.push({
687
- fieldID: viz.source.mappings.y[i],
688
- type: "=",
689
- sourceFieldID: this.toLowerCase(viz.source.mappings.y[i])
690
- });
691
- }
692
- };
693
- DDLUpgrade.prototype.readTableMappings = function (viz) {
694
- var mappings = this._ddl2DataviewActivities[viz.id].mappings;
695
- for (var i = 0; i < viz.label.length; ++i) {
696
- mappings.transformations.push({
697
- fieldID: viz.label[i],
698
- type: "=",
699
- sourceFieldID: this.toLowerCase(viz.source.mappings.value[i])
700
- });
701
- }
702
- };
703
- DDLUpgrade.prototype.readGraphEnums = function (valueMappings, annotation) {
704
- if (annotation === void 0) { annotation = false; }
705
- var retVal = [];
706
- if (valueMappings) {
707
- for (var value in valueMappings) {
708
- var newValue = {};
709
- for (var key in valueMappings[value]) {
710
- if (key === "faChar") {
711
- newValue[key] = faCharFix(valueMappings[value][key]);
712
- }
713
- else if (annotation && key.indexOf("icon_") === 0) {
714
- console.log("Deprecated flag property: " + key);
715
- newValue[key.split("icon_")[1]] = valueMappings[value][key];
716
- }
717
- else {
718
- newValue[key] = valueMappings[value][key];
719
- }
720
- }
721
- // remove v1.x "0" annotations as they equated to "nothing" ---
722
- if (!annotation || value !== "0") {
723
- retVal.push({
724
- value: value,
725
- newValue: newValue
726
- });
727
- }
728
- }
729
- }
730
- return retVal;
731
- };
732
- DDLUpgrade.prototype.readGraphMappings = function (viz) {
733
- var mappings = this._ddl2DataviewActivities[viz.id].mappings;
734
- mappings.transformations.push({
735
- fieldID: "uid",
736
- type: "=",
737
- sourceFieldID: this.toLowerCase(viz.source.mappings.uid)
738
- });
739
- mappings.transformations.push({
740
- fieldID: "label",
741
- type: "=",
742
- sourceFieldID: this.toLowerCase(viz.source.mappings.label)
743
- });
744
- if (viz.icon.fieldid) {
745
- mappings.transformations.push({
746
- fieldID: "icon",
747
- type: "map",
748
- sourceFieldID: this.toLowerCase(viz.icon.fieldid),
749
- default: { fachar: faCharFix(viz.icon.faChar) },
750
- mappings: this.readGraphEnums(viz.icon.valuemappings)
751
- });
752
- }
753
- var idx = 0;
754
- if (viz.flag) {
755
- for (var _i = 0, _a = viz.flag; _i < _a.length; _i++) {
756
- var flag = _a[_i];
757
- if (flag.fieldid) {
758
- mappings.transformations.push({
759
- fieldID: "annotation_" + idx++,
760
- type: "map",
761
- sourceFieldID: this.toLowerCase(flag.fieldid),
762
- default: {},
763
- mappings: this.readGraphEnums(flag.valuemappings, true)
764
- });
765
- }
766
- }
767
- }
768
- mappings.transformations.push({
769
- fieldID: "links",
770
- type: "=",
771
- sourceFieldID: this.toLowerCase(viz.source.link.childfile),
772
- transformations: [{
773
- fieldID: "uid",
774
- type: "=",
775
- sourceFieldID: this.toLowerCase(viz.source.link.mappings.uid)
776
- }]
777
- });
778
- };
779
- DDLUpgrade.prototype.readSliderMappings = function (viz) {
780
- var mappings = this._ddl2DataviewActivities[viz.id].mappings;
781
- mappings.transformations.push({
782
- fieldID: "label",
783
- type: "=",
784
- sourceFieldID: this.toLowerCase(viz.source.mappings.label)
785
- });
786
- };
787
- DDLUpgrade.prototype.readFilters = function () {
788
- for (var _i = 0, _a = this._ddl.dashboards; _i < _a.length; _i++) {
789
- var dash = _a[_i];
790
- for (var _b = 0, _c = dash.visualizations; _b < _c.length; _b++) {
791
- var viz = _c[_b];
792
- if (viz.events) {
793
- for (var eventID in viz.events) {
794
- var event_1 = viz.events[eventID];
795
- for (var _d = 0, _e = event_1.updates; _d < _e.length; _d++) {
796
- var update = _e[_d];
797
- var otherViz = this._ddl2Dataviews[update.visualization];
798
- var dsFilters = this.getDatasourceFilters(update.datasource, otherViz.id);
799
- if (update.mappings) {
800
- if (isRoxieServiceRef(otherViz.datasource)) {
801
- for (var key in update.mappings) {
802
- otherViz.datasource.request.push({
803
- source: viz.id,
804
- remoteFieldID: this.toLowerCase(key),
805
- localFieldID: this.toLowerCase(update.mappings[key])
806
- });
807
- }
808
- }
809
- else {
810
- var condition = {
811
- viewID: viz.id,
812
- mappings: []
813
- };
814
- for (var key in update.mappings) {
815
- var mapping = update.mappings[key];
816
- var dsFilter = (mapping && dsFilters[mapping]) ? dsFilters[mapping].filter : undefined;
817
- if (!dsFilter) {
818
- console.warn("Select Mapping \"" + mapping + "\" in viz \"" + viz.id + "\" not found in filters for \"" + otherViz.id + "\"");
819
- }
820
- else {
821
- condition.mappings.push({
822
- remoteFieldID: this.toLowerCase(key),
823
- localFieldID: this.toLowerCase(update.mappings[key]),
824
- condition: this.rule2condition(dsFilter.rule),
825
- nullable: dsFilter.nullable
826
- });
827
- }
828
- }
829
- this._ddl2DataviewActivities[otherViz.id].filters.conditions.push(condition);
830
- }
831
- }
832
- }
833
- }
834
- }
835
- }
836
- }
837
- };
838
- DDLUpgrade.prototype.rule2condition = function (_) {
839
- switch (_) {
840
- case "set":
841
- return "in";
842
- case "notequals":
843
- return "!=";
844
- }
845
- return _;
846
- };
847
- DDLUpgrade.prototype.readSort = function () {
848
- var _this = this;
849
- for (var _i = 0, _a = this._ddl.dashboards; _i < _a.length; _i++) {
850
- var dash = _a[_i];
851
- for (var _b = 0, _c = dash.visualizations; _b < _c.length; _b++) {
852
- var viz = _c[_b];
853
- if (viz.source) {
854
- if (viz.source.sort) {
855
- var vizSort = this._ddl2DataviewActivities[viz.id].sort;
856
- vizSort.conditions = viz.source.sort.map(function (s) {
857
- if (s.indexOf("-") === 0) {
858
- return {
859
- fieldID: _this.toLowerCase(s.substr(1)),
860
- descending: true
861
- };
862
- }
863
- return {
864
- fieldID: _this.toLowerCase(s),
865
- descending: false
866
- };
867
- });
868
- }
869
- if (viz.source.first) {
870
- var vizLimit = this._ddl2DataviewActivities[viz.id].limit;
871
- vizLimit.limit = +viz.source.first;
872
- }
873
- }
874
- }
875
- }
876
- };
877
- DDLUpgrade.prototype.anyViz2view = function (viz) {
878
- var project = {
879
- type: "project",
880
- transformations: []
881
- };
882
- var filters = {
883
- type: "filter",
884
- conditions: []
885
- };
886
- var groupBy = {
887
- type: "groupby",
888
- groupByIDs: [],
889
- aggregates: []
890
- };
891
- var sort = {
892
- type: "sort",
893
- conditions: []
894
- };
895
- var limit = {
896
- type: "limit",
897
- limit: 0
898
- };
899
- var mappings = {
900
- type: "mappings",
901
- transformations: []
902
- };
903
- this._ddl2DataviewActivities[viz.id] = {
904
- project: project,
905
- filters: filters,
906
- sort: sort,
907
- groupBy: groupBy,
908
- limit: limit,
909
- mappings: mappings
910
- };
911
- var datasourceRef = this.isVizDatasourceRoxie(viz) ? {
912
- id: this._datasourceUpdates[viz.id].id,
913
- request: [],
914
- output: this._datasourceUpdates[viz.id].output
915
- } : {
916
- id: this._datasourceUpdates[viz.id].id,
917
- output: this._datasourceUpdates[viz.id].output
918
- };
919
- return {
920
- id: viz.id,
921
- datasource: datasourceRef,
922
- activities: [
923
- project,
924
- filters,
925
- sort,
926
- groupBy,
927
- limit
928
- ],
929
- 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 || {}) })
930
- };
931
- };
932
- DDLUpgrade.prototype.type2chartType = function (chartType) {
933
- switch (chartType) {
934
- case "LINE":
935
- return { chartType: "Line", __class: "chart_Line" };
936
- case "BUBBLE":
937
- return { chartType: "Bubble", __class: "chart_Bubble" };
938
- case "PIE":
939
- return { chartType: "Pie", __class: "chart_Pie" };
940
- case "BAR":
941
- return { chartType: "Column", __class: "chart_Column" };
942
- case "FORM":
943
- return { chartType: "FieldForm", __class: "form_FieldForm" };
944
- case "WORD_CLOUD":
945
- return { chartType: "WordCloud", __class: "chart_WordCloud" };
946
- case "CHORO":
947
- return { chartType: "ChoroplethStates", __class: "map_ChoroplethStates" };
948
- case "SUMMARY":
949
- return { chartType: "Summary", __class: "chart_Summary" };
950
- case "SLIDER":
951
- return { chartType: "FieldForm", __class: "form_FieldForm" };
952
- case "HEAT_MAP":
953
- return { chartType: "HeatMap", __class: "other_HeatMap" };
954
- case "2DCHART":
955
- return { chartType: "Column", __class: "chart_Column" };
956
- case "GRAPH":
957
- return { chartType: "AdjacencyGraph", __class: "graph_AdjacencyGraph" };
958
- case "TABLE":
959
- default:
960
- return { chartType: "Table", __class: "dgrid_Table" };
961
- }
962
- };
963
- DDLUpgrade.prototype.formFields2field = function (fields, slider) {
964
- var _this = this;
965
- if (slider === void 0) { slider = false; }
966
- if (!fields)
967
- return [];
968
- return fields.map(function (field) {
969
- switch (field.properties.type) {
970
- case "range":
971
- return {
972
- type: "range",
973
- id: field.id,
974
- default: (field.properties.default ? field.properties.default : undefined)
975
- };
976
- case "dataset":
977
- return {
978
- type: "dataset",
979
- id: field.id,
980
- default: [],
981
- children: []
982
- };
983
- default:
984
- return {
985
- type: _this.formFieldType2fieldType(field.properties.datatype, slider),
986
- id: field.id,
987
- default: field.properties.default ? field.properties.default[0] : undefined
988
- };
989
- }
990
- });
991
- };
992
- DDLUpgrade.prototype.formFieldType2fieldType = function (fieldType, slider) {
993
- switch (fieldType) {
994
- case "bool":
995
- case "boolean":
996
- return "boolean";
997
- case "integer":
998
- case "unsigned":
999
- case "float":
1000
- case "double":
1001
- case "real":
1002
- return "number";
1003
- case "string":
1004
- return "string";
1005
- default:
1006
- return slider ? "number" : "string";
1007
- }
1008
- };
1009
- DDLUpgrade.prototype.output2output = function (output, target) {
1010
- target[output.from || output.id] = {
1011
- fields: this.filters2fields(output.filter)
1012
- };
1013
- };
1014
- DDLUpgrade.prototype.filters2fields = function (filters) {
1015
- if (!filters)
1016
- return [];
1017
- return filters.filter(function (filter) {
1018
- var idParts = filter.fieldid.split("-");
1019
- return idParts.length === 1 || idParts[1] === "range";
1020
- }).map(function (filter) {
1021
- var idParts = filter.fieldid.split("-");
1022
- var retVal = {
1023
- type: "string",
1024
- id: idParts[0]
1025
- };
1026
- return retVal;
1027
- });
1028
- };
1029
- DDLUpgrade.prototype.getVizField = function (vizID, fieldID) {
1030
- return {
1031
- type: "string",
1032
- id: "",
1033
- default: ""
1034
- };
1035
- };
1036
- DDLUpgrade.prototype.writeDatasources = function () {
1037
- var retVal = [];
1038
- for (var id in this._ddl2Datasources) {
1039
- retVal.push(this._ddl2Datasources[id]);
1040
- }
1041
- return retVal;
1042
- };
1043
- DDLUpgrade.prototype.writeDataviews = function () {
1044
- var retVal = [];
1045
- for (var id in this._ddl2Dataviews) {
1046
- retVal.push(this._ddl2Dataviews[id]);
1047
- }
1048
- return retVal;
1049
- };
1050
- DDLUpgrade.prototype.writeProperties = function () {
1051
- return {
1052
- // TODO
1053
- };
1054
- };
1055
- DDLUpgrade.prototype.write = function () {
1056
- return {
1057
- version: "2.2.1",
1058
- createdBy: {
1059
- name: PKG_NAME,
1060
- version: PKG_VERSION
1061
- },
1062
- datasources: this.writeDatasources(),
1063
- dataviews: this.writeDataviews(),
1064
- properties: this.writeProperties()
1065
- };
1066
- };
1067
- return DDLUpgrade;
1068
- }());
1069
- function upgrade$1(ddl, baseUrl, wuid, toLowerCase, dermatologyJson) {
1070
- if (toLowerCase === void 0) { toLowerCase = true; }
1071
- if (dermatologyJson === void 0) { dermatologyJson = {}; }
1072
- var ddlUp = new DDLUpgrade(ddl, baseUrl, wuid, toLowerCase);
1073
- var retVal = ddlUp.write();
1074
- retVal.properties = upgrade(retVal, dermatologyJson);
1075
- return retVal;
167
+ return to.concat(ar || Array.prototype.slice.call(from));
168
+ }
169
+
170
+ var classMappings = {
171
+ c3chart_Bar: "chart_Bar",
172
+ c3chart_Column: "chart_Column",
173
+ c3chart_Pie: "chart_Pie",
174
+ c3chart_Area: "chart_Area",
175
+ c3chart_Line: "chart_Line",
176
+ amchart_Bar: "chart_Bar",
177
+ amchart_Column: "chart_Column",
178
+ amchart_Pie: "chart_Pie",
179
+ amchart_Area: "chart_Area",
180
+ amchart_Line: "chart_Line",
181
+ google_Bar: "chart_Bar",
182
+ google_Column: "chart_Column",
183
+ google_Pie: "chart_Pie",
184
+ google_Area: "chart_Area",
185
+ google_Line: "chart_Line",
186
+ other_Table: "dgrid_Table"
187
+ };
188
+ var propertyMappings = {
189
+ xAxisLabelRotation: [
190
+ { name: "xAxisOverlapMode", transform: function (n) { return "rotate"; } },
191
+ { name: "xAxisLabelRotation", transform: function (n) { return n; } }
192
+ ],
193
+ tooltipLabelColor: {
194
+ name: "tooltipLabelColor"
195
+ },
196
+ tooltipSeriesColor: {
197
+ name: "tooltipSeriesColor"
198
+ },
199
+ tooltipValueColor: {
200
+ name: "tooltipValueColor"
201
+ },
202
+ tooltipValueFormat: {
203
+ name: "tooltipValueFormat"
204
+ },
205
+ timePattern: {
206
+ name: "xAxisTypeTimePattern"
207
+ },
208
+ smoothLines: {
209
+ name: "interpolate",
210
+ transform: function (n) {
211
+ if (n === false)
212
+ return "linear";
213
+ return "catmullRom";
214
+ }
215
+ },
216
+ holePercent: {
217
+ name: "innerRadius"
218
+ },
219
+ flip: {
220
+ name: "orientation",
221
+ transform: function (n) { return n ? "vertical" : "horizontal"; }
222
+ },
223
+ bottomText: {
224
+ name: "xAxisTitle"
225
+ },
226
+ xAxisTypeTimePattern: {
227
+ name: "xAxisTypeTimePattern"
228
+ },
229
+ yAxisTypeTimePattern: {
230
+ name: "yAxisTypeTimePattern"
231
+ },
232
+ valueFormat: {
233
+ name: "tooltipValueFormat"
234
+ },
235
+ stacked: {
236
+ name: "yAxisStacked"
237
+ },
238
+ showYGrid: {
239
+ name: "yAxisGuideLines"
240
+ },
241
+ showXGrid: {
242
+ name: "xAxisGuideLines"
243
+ },
244
+ showValueLabel: {
245
+ name: "showValue"
246
+ },
247
+ low: {
248
+ name: "yAxisDomainLow"
249
+ },
250
+ high: {
251
+ name: "yAxisDomainHigh"
252
+ },
253
+ fillOpacity: {
254
+ name: "interpolateFillOpacity"
255
+ },
256
+ areaFillOpacity: {
257
+ name: "interpolateFillOpacity"
258
+ },
259
+ showToolbar: {
260
+ name: "titleVisible"
261
+ },
262
+ showCSV: {
263
+ name: "downloadButtonVisible"
264
+ }
265
+ };
266
+ function findKeyVal(object, key, val) {
267
+ var value;
268
+ for (var k in object) {
269
+ if (k === key && object[k] === val) {
270
+ value = object;
271
+ break;
272
+ }
273
+ if (object[k] && typeof object[k] === "object") {
274
+ value = findKeyVal(object[k], key, val);
275
+ if (value !== undefined) {
276
+ break;
277
+ }
278
+ }
279
+ }
280
+ return value;
281
+ }
282
+ function apply_to_dataviews(ddl2, dermObj) {
283
+ ddl2.dataviews.forEach(apply_to_dataview);
284
+ function apply_to_dataview(dv) {
285
+ var widgetId = dv.id;
286
+ var dermPanelObj = findKeyVal(dermObj, "__id", widgetId);
287
+ if (dermPanelObj) {
288
+ var dermPanelProps = dermPanelObj.__properties;
289
+ var dermWidgetObj = dermPanelObj.__properties.chart ? dermPanelObj.__properties.chart : dermPanelObj.__properties.widget;
290
+ var dermWidgetProps = dermWidgetObj.__properties;
291
+ apply_class_mapping(dermWidgetObj);
292
+ apply_panel_property_mapping(dermPanelProps, dermWidgetProps);
293
+ apply_widget_property_mapping(dermPanelProps, dermWidgetProps);
294
+ if (dv.visualization.properties.chartType) {
295
+ dv.visualization.properties.charttype = dv.visualization.properties.chartType;
296
+ }
297
+ }
298
+ else {
299
+ console.warn(widgetId + " not found in dermObj");
300
+ }
301
+ function apply_class_mapping(dermWidgetObj) {
302
+ dv.visualization.__class = swap_with_supported_class(dermWidgetObj.__class);
303
+ dv.visualization.properties.__class = "marshaller_VizChartPanel";
304
+ if (!dv.visualization.properties.widget)
305
+ dv.visualization.properties.widget = {};
306
+ dv.visualization.properties.widget.__class = dv.visualization.__class;
307
+ function swap_with_supported_class(_class) {
308
+ return classMappings[_class] ? classMappings[_class] : _class;
309
+ }
310
+ }
311
+ function apply_panel_property_mapping(dermPanelProps, dermWidgetProps) {
312
+ dv.visualization.title = dermPanelProps.title || "";
313
+ dv.visualization.description = "";
314
+ dv.visualization.visibility = dv.visualization.visibility === "flyout" ? "flyout" : "normal";
315
+ dv.visualization.chartType = dv.visualization.__class.split("_")[1];
316
+ for (var propName in dermPanelProps) {
317
+ if (typeof propertyMappings[propName] !== "undefined") {
318
+ var newPropName = propertyMappings[propName].name;
319
+ if (typeof propertyMappings[propName].transform === "function") {
320
+ dv.visualization.properties[newPropName] = propertyMappings[propName].transform(dermPanelProps[propName]);
321
+ }
322
+ else {
323
+ dv.visualization.properties[newPropName] = dermPanelProps[propName];
324
+ }
325
+ }
326
+ }
327
+ if (dermWidgetProps && dermWidgetProps.showLegend && dv.visualization.properties) {
328
+ dv.visualization.properties.legendVisible = true;
329
+ }
330
+ }
331
+ function apply_widget_property_mapping(dermPanelProps, dermWidgetProps) {
332
+ dv.visualization.title = dv.visualization.title || dermWidgetProps.title || "";
333
+ dv.visualization.description = ""; // TODO - should this map to anything?
334
+ dv.visualization.visibility = dv.visualization.visibility === "flyout" ? "flyout" : "normal";
335
+ dv.visualization.chartType = dv.visualization.__class.split("_")[1];
336
+ var _loop_1 = function (propName) {
337
+ if (typeof propertyMappings[propName] !== "undefined") {
338
+ if (propertyMappings[propName] instanceof Array) {
339
+ propertyMappings[propName].forEach(function (p) {
340
+ var newPropName = p.name;
341
+ dv.visualization.properties.widget[newPropName] = p.transform(dermWidgetProps[propName]);
342
+ if (typeof propertyMappings[propName].transform === "function") {
343
+ dv.visualization.properties.widget[newPropName] = propertyMappings[propName].transform(dermWidgetProps[propName]);
344
+ }
345
+ else {
346
+ dv.visualization.properties.widget[newPropName] = dermWidgetProps[propName];
347
+ }
348
+ });
349
+ }
350
+ else {
351
+ var newPropName = propertyMappings[propName].name;
352
+ dv.visualization.properties.widget[newPropName] = propertyMappings[propName].transform(dermWidgetProps[propName]);
353
+ }
354
+ }
355
+ };
356
+ for (var propName in dermWidgetProps) {
357
+ _loop_1(propName);
358
+ }
359
+ }
360
+ }
361
+ }
362
+ function apply_to_properties_layout(ddl2, dermObj) {
363
+ var retVal = {
364
+ layout: []
365
+ };
366
+ if (!dermObj || !dermObj.__properties)
367
+ return;
368
+ dermObj.__properties.content.forEach(function (cell) {
369
+ var cellPosition = {
370
+ // TODO - if "id" could be avoided then layouts could apply to any dashboard with the same number of widgets
371
+ id: cell.__properties.widget.__id,
372
+ position: [
373
+ cell.__properties.gridCol,
374
+ cell.__properties.gridRow,
375
+ cell.__properties.gridColSpan,
376
+ cell.__properties.gridRowSpan
377
+ ]
378
+ };
379
+ retVal.layout.push(cellPosition);
380
+ });
381
+ return retVal;
382
+ }
383
+ function upgrade$1(ddl2, dermObj) {
384
+ apply_to_dataviews(ddl2, dermObj);
385
+ return apply_to_properties_layout(ddl2, dermObj);
386
+ }
387
+
388
+ function faCharFix(faChar) {
389
+ return faChar;
390
+ }
391
+ var DDLUpgrade = /** @class */ (function () {
392
+ function DDLUpgrade(ddl, baseUrl, wuid, toLowerCase) {
393
+ if (baseUrl === void 0) { baseUrl = "http://localhost:8010"; }
394
+ if (wuid === void 0) { wuid = "WUID"; }
395
+ if (toLowerCase === void 0) { toLowerCase = true; }
396
+ this._datasources = {};
397
+ this._datasourceUpdates = {};
398
+ this._visualizations = {};
399
+ this._ddl2Datasources = {};
400
+ this._ddl2DatasourceFields = {};
401
+ this._ddl2Dataviews = {};
402
+ this._ddl2DataviewActivities = {};
403
+ this._ddl = ddl;
404
+ this._baseUrl = baseUrl;
405
+ this._wuid = wuid;
406
+ this._toLowerCase = toLowerCase;
407
+ this.indexDDL();
408
+ this.readDDL();
409
+ }
410
+ DDLUpgrade.prototype.toLowerCase = function (s) {
411
+ return this._toLowerCase ? s.toLowerCase() : s;
412
+ };
413
+ DDLUpgrade.prototype.isVizDatasourceRoxie = function (viz) {
414
+ if (viz.source) {
415
+ var ds = this._datasources[viz.source.id];
416
+ if (isHipieDatasource(ds)) {
417
+ return true;
418
+ }
419
+ }
420
+ return false;
421
+ };
422
+ DDLUpgrade.prototype.getDatasourceOutputs = function (dsID, vizID) {
423
+ var retVal = [];
424
+ var datasource = this._datasources[dsID];
425
+ for (var _i = 0, _a = datasource.outputs; _i < _a.length; _i++) {
426
+ var output = _a[_i];
427
+ if (output.notify) {
428
+ for (var _b = 0, _c = output.notify; _b < _c.length; _b++) {
429
+ var notify = _c[_b];
430
+ if (notify === vizID) {
431
+ retVal.push({
432
+ datasource: datasource,
433
+ output: output
434
+ });
435
+ }
436
+ }
437
+ }
438
+ }
439
+ return retVal;
440
+ };
441
+ DDLUpgrade.prototype.getDatasourceFilters = function (dsID, vizID) {
442
+ var retVal = {};
443
+ for (var _i = 0, _a = this.getDatasourceOutputs(dsID, vizID); _i < _a.length; _i++) {
444
+ var dsOut = _a[_i];
445
+ if (dsOut.output.filter) {
446
+ for (var _b = 0, _c = dsOut.output.filter; _b < _c.length; _b++) {
447
+ var filter = _c[_b];
448
+ retVal[filter.fieldid] = {
449
+ datasource: dsOut.datasource,
450
+ output: dsOut.output,
451
+ filter: filter
452
+ };
453
+ }
454
+ }
455
+ }
456
+ return retVal;
457
+ };
458
+ DDLUpgrade.prototype.indexDDL = function () {
459
+ for (var _i = 0, _a = this._ddl.dashboards; _i < _a.length; _i++) {
460
+ var dash = _a[_i];
461
+ for (var _b = 0, _c = dash.visualizations; _b < _c.length; _b++) {
462
+ var viz = _c[_b];
463
+ this._visualizations[viz.id] = viz;
464
+ }
465
+ }
466
+ for (var _d = 0, _e = this._ddl.datasources; _d < _e.length; _d++) {
467
+ var ds = _e[_d];
468
+ this._datasources[ds.id] = ds;
469
+ for (var _f = 0, _g = ds.outputs; _f < _g.length; _f++) {
470
+ var output = _g[_f];
471
+ if (output.notify) {
472
+ for (var _h = 0, _j = output.notify; _h < _j.length; _h++) {
473
+ var notify = _j[_h];
474
+ this._datasourceUpdates[notify] = {
475
+ id: ds.id,
476
+ output: output.from || output.id
477
+ };
478
+ }
479
+ }
480
+ }
481
+ }
482
+ };
483
+ DDLUpgrade.prototype.readDDL = function () {
484
+ for (var _i = 0, _a = this._ddl.datasources; _i < _a.length; _i++) {
485
+ var ds = _a[_i];
486
+ if (isWorkunitDatasource(ds)) {
487
+ var ddl2DS = {
488
+ type: "wuresult",
489
+ id: ds.id,
490
+ url: this._baseUrl,
491
+ wuid: this._wuid,
492
+ outputs: {}
493
+ };
494
+ for (var _b = 0, _c = ds.outputs; _b < _c.length; _b++) {
495
+ var output = _c[_b];
496
+ this.output2output(output, ddl2DS.outputs);
497
+ }
498
+ this._ddl2Datasources[ds.id] = ddl2DS;
499
+ }
500
+ else if (isDatabombDatasource(ds)) ;
501
+ else {
502
+ var urlParts = ds.URL.split("/WsEcl/submit/query/");
503
+ var hostParts = urlParts[0];
504
+ var roxieParts = urlParts[1].split("/");
505
+ var ddl2DS = {
506
+ type: "hipie",
507
+ id: ds.id,
508
+ url: hostParts,
509
+ querySet: roxieParts[0],
510
+ queryID: roxieParts[1],
511
+ inputs: [],
512
+ outputs: {}
513
+ };
514
+ for (var _d = 0, _e = ds.outputs; _d < _e.length; _d++) {
515
+ var output = _e[_d];
516
+ this.output2output(output, ddl2DS.outputs);
517
+ }
518
+ this._ddl2Datasources[ds.id] = ddl2DS;
519
+ }
520
+ }
521
+ for (var _f = 0, _g = this._ddl.dashboards; _f < _g.length; _f++) {
522
+ var dash = _g[_f];
523
+ for (var _h = 0, _j = dash.visualizations; _h < _j.length; _h++) {
524
+ var viz = _j[_h];
525
+ if (viz.type === "FORM") {
526
+ this._ddl2Datasources[viz.id] = {
527
+ type: "form",
528
+ id: viz.id,
529
+ fields: this.formFields2field(viz.fields)
530
+ };
531
+ this._datasourceUpdates[viz.id] = { id: viz.id };
532
+ }
533
+ else if (viz.type === "SLIDER") {
534
+ this._ddl2Datasources[viz.id] = {
535
+ type: "form",
536
+ id: viz.id,
537
+ fields: this.formFields2field(viz.fields, true)
538
+ };
539
+ this._datasourceUpdates[viz.id] = { id: viz.id };
540
+ }
541
+ this._ddl2Dataviews[viz.id] = this.anyViz2view(viz);
542
+ }
543
+ }
544
+ this.readGroupBy();
545
+ this.readFilters();
546
+ this.readSort();
547
+ this.readMappings();
548
+ };
549
+ DDLUpgrade.prototype.readGroupBy = function () {
550
+ for (var _i = 0, _a = this._ddl.dashboards; _i < _a.length; _i++) {
551
+ var dash = _a[_i];
552
+ for (var _b = 0, _c = dash.visualizations; _b < _c.length; _b++) {
553
+ var viz = _c[_b];
554
+ if (viz.fields) {
555
+ var projectTransformations = [];
556
+ var groupByColumns = [];
557
+ var aggrFields = [];
558
+ for (var _d = 0, _e = viz.fields; _d < _e.length; _d++) {
559
+ var field = _e[_d];
560
+ if (field.properties && field.properties.function) {
561
+ switch (field.properties.function) {
562
+ case "SUM":
563
+ case "MIN":
564
+ case "MAX":
565
+ aggrFields.push({
566
+ type: this.func2aggr(field.properties.function),
567
+ inFieldID: this.toLowerCase(field.properties.params.param1),
568
+ fieldID: this.toLowerCase(field.id)
569
+ });
570
+ break;
571
+ case "AVE":
572
+ aggrFields.push({
573
+ type: this.func2aggr(field.properties.function),
574
+ inFieldID: this.toLowerCase(field.properties.params.param1),
575
+ baseCountFieldID: field.properties.params.param2 ? this.toLowerCase(field.properties.params.param2) : undefined,
576
+ fieldID: this.toLowerCase(field.id)
577
+ });
578
+ break;
579
+ case "SCALE":
580
+ if (typeof field.properties.params.param1 === "object") {
581
+ var props = field.properties.params.param1;
582
+ switch (props.function) {
583
+ case "SUM":
584
+ case "MIN":
585
+ case "MAX":
586
+ aggrFields.push({
587
+ type: this.func2aggr(props.function),
588
+ inFieldID: this.toLowerCase(props.params.param1),
589
+ fieldID: this.toLowerCase(field.id)
590
+ });
591
+ break;
592
+ }
593
+ }
594
+ projectTransformations.push({
595
+ type: "scale",
596
+ sourceFieldID: this.toLowerCase(field.id),
597
+ fieldID: this.toLowerCase(field.id),
598
+ factor: +field.properties.params.param2
599
+ });
600
+ break;
601
+ default:
602
+ groupByColumns.push(this.toLowerCase(field.id));
603
+ throw new Error("Unhandled field function: ".concat(field.properties.function));
604
+ }
605
+ }
606
+ else {
607
+ groupByColumns.push(this.toLowerCase(field.id));
608
+ }
609
+ }
610
+ if (projectTransformations.length) {
611
+ this._ddl2DataviewActivities[viz.id].project.transformations = projectTransformations;
612
+ }
613
+ if (aggrFields.length) {
614
+ this._ddl2DataviewActivities[viz.id].groupBy.groupByIDs = __spreadArray([], groupByColumns, true);
615
+ this._ddl2DataviewActivities[viz.id].groupBy.aggregates = aggrFields;
616
+ }
617
+ }
618
+ }
619
+ }
620
+ };
621
+ DDLUpgrade.prototype.func2aggr = function (func) {
622
+ switch (func) {
623
+ case "SUM":
624
+ return "sum";
625
+ case "AVE":
626
+ return "mean";
627
+ case "MIN":
628
+ return "min";
629
+ case "MAX":
630
+ return "max";
631
+ }
632
+ throw new Error("Unknown DDL1 Function Type: ".concat(func));
633
+ };
634
+ DDLUpgrade.prototype.readMappings = function () {
635
+ for (var _i = 0, _a = this._ddl.dashboards; _i < _a.length; _i++) {
636
+ var dash = _a[_i];
637
+ for (var _b = 0, _c = dash.visualizations; _b < _c.length; _b++) {
638
+ var viz = _c[_b];
639
+ if (isFormVisualization(viz)) ;
640
+ else if (isPieVisualization(viz)) {
641
+ this.readPieMappings(viz);
642
+ }
643
+ else if (isChoroVisualization(viz)) {
644
+ this.readChoroMappings(viz);
645
+ }
646
+ else if (isLineVisualization(viz)) {
647
+ this.readLineMappings(viz);
648
+ }
649
+ else if (isTableVisualization(viz)) {
650
+ this.readTableMappings(viz);
651
+ }
652
+ else if (isGraphVisualization(viz)) {
653
+ this.readGraphMappings(viz);
654
+ }
655
+ else if (isSliderVisualization(viz)) {
656
+ this.readSliderMappings(viz);
657
+ }
658
+ else {
659
+ throw new Error("Unkown DDL1 mapping type: ".concat(viz.type));
660
+ }
661
+ }
662
+ }
663
+ };
664
+ DDLUpgrade.prototype.readPieMappings = function (viz) {
665
+ var mappings = this._ddl2DataviewActivities[viz.id].mappings;
666
+ mappings.transformations.push({
667
+ fieldID: "label",
668
+ type: "=",
669
+ sourceFieldID: this.toLowerCase(viz.source.mappings.label)
670
+ });
671
+ mappings.transformations.push({
672
+ fieldID: "weight",
673
+ type: "=",
674
+ sourceFieldID: this.toLowerCase(viz.source.mappings.weight[0])
675
+ });
676
+ };
677
+ DDLUpgrade.prototype.readChoroMappings = function (viz) {
678
+ var mappings = this._ddl2DataviewActivities[viz.id].mappings;
679
+ mappings.transformations.push({
680
+ fieldID: "label",
681
+ type: "=",
682
+ sourceFieldID: this.toLowerCase(this.anyChoroMapping2label(viz.source.mappings))
683
+ });
684
+ mappings.transformations.push({
685
+ fieldID: "weight",
686
+ type: "=",
687
+ sourceFieldID: this.toLowerCase(viz.source.mappings.weight[0])
688
+ });
689
+ };
690
+ DDLUpgrade.prototype.anyChoroMapping2label = function (mapping) {
691
+ return mapping.state || mapping.county || mapping.geohash;
692
+ };
693
+ DDLUpgrade.prototype.readLineMappings = function (viz) {
694
+ var mappings = this._ddl2DataviewActivities[viz.id].mappings;
695
+ mappings.transformations.push({
696
+ fieldID: viz.source.mappings.x[0],
697
+ type: "=",
698
+ sourceFieldID: this.toLowerCase(viz.source.mappings.x[0])
699
+ });
700
+ for (var i = 0; i < viz.source.mappings.y.length; ++i) {
701
+ mappings.transformations.push({
702
+ fieldID: viz.source.mappings.y[i],
703
+ type: "=",
704
+ sourceFieldID: this.toLowerCase(viz.source.mappings.y[i])
705
+ });
706
+ }
707
+ };
708
+ DDLUpgrade.prototype.readTableMappings = function (viz) {
709
+ var mappings = this._ddl2DataviewActivities[viz.id].mappings;
710
+ for (var i = 0; i < viz.label.length; ++i) {
711
+ mappings.transformations.push({
712
+ fieldID: viz.label[i],
713
+ type: "=",
714
+ sourceFieldID: this.toLowerCase(viz.source.mappings.value[i])
715
+ });
716
+ }
717
+ };
718
+ DDLUpgrade.prototype.readGraphEnums = function (valueMappings, annotation) {
719
+ if (annotation === void 0) { annotation = false; }
720
+ var retVal = [];
721
+ if (valueMappings) {
722
+ for (var value in valueMappings) {
723
+ var newValue = {};
724
+ for (var key in valueMappings[value]) {
725
+ if (key === "faChar") {
726
+ newValue[key] = faCharFix(valueMappings[value][key]);
727
+ }
728
+ else if (annotation && key.indexOf("icon_") === 0) {
729
+ console.log("Deprecated flag property: " + key);
730
+ newValue[key.split("icon_")[1]] = valueMappings[value][key];
731
+ }
732
+ else {
733
+ newValue[key] = valueMappings[value][key];
734
+ }
735
+ }
736
+ // remove v1.x "0" annotations as they equated to "nothing" ---
737
+ if (!annotation || value !== "0") {
738
+ retVal.push({
739
+ value: value,
740
+ newValue: newValue
741
+ });
742
+ }
743
+ }
744
+ }
745
+ return retVal;
746
+ };
747
+ DDLUpgrade.prototype.readGraphMappings = function (viz) {
748
+ var mappings = this._ddl2DataviewActivities[viz.id].mappings;
749
+ mappings.transformations.push({
750
+ fieldID: "uid",
751
+ type: "=",
752
+ sourceFieldID: this.toLowerCase(viz.source.mappings.uid)
753
+ });
754
+ mappings.transformations.push({
755
+ fieldID: "label",
756
+ type: "=",
757
+ sourceFieldID: this.toLowerCase(viz.source.mappings.label)
758
+ });
759
+ if (viz.icon.fieldid) {
760
+ mappings.transformations.push({
761
+ fieldID: "icon",
762
+ type: "map",
763
+ sourceFieldID: this.toLowerCase(viz.icon.fieldid),
764
+ default: { fachar: faCharFix(viz.icon.faChar) },
765
+ mappings: this.readGraphEnums(viz.icon.valuemappings)
766
+ });
767
+ }
768
+ var idx = 0;
769
+ if (viz.flag) {
770
+ for (var _i = 0, _a = viz.flag; _i < _a.length; _i++) {
771
+ var flag = _a[_i];
772
+ if (flag.fieldid) {
773
+ mappings.transformations.push({
774
+ fieldID: "annotation_".concat(idx++),
775
+ type: "map",
776
+ sourceFieldID: this.toLowerCase(flag.fieldid),
777
+ default: {},
778
+ mappings: this.readGraphEnums(flag.valuemappings, true)
779
+ });
780
+ }
781
+ }
782
+ }
783
+ mappings.transformations.push({
784
+ fieldID: "links",
785
+ type: "=",
786
+ sourceFieldID: this.toLowerCase(viz.source.link.childfile),
787
+ transformations: [{
788
+ fieldID: "uid",
789
+ type: "=",
790
+ sourceFieldID: this.toLowerCase(viz.source.link.mappings.uid)
791
+ }]
792
+ });
793
+ };
794
+ DDLUpgrade.prototype.readSliderMappings = function (viz) {
795
+ var mappings = this._ddl2DataviewActivities[viz.id].mappings;
796
+ mappings.transformations.push({
797
+ fieldID: "label",
798
+ type: "=",
799
+ sourceFieldID: this.toLowerCase(viz.source.mappings.label)
800
+ });
801
+ };
802
+ DDLUpgrade.prototype.readFilters = function () {
803
+ for (var _i = 0, _a = this._ddl.dashboards; _i < _a.length; _i++) {
804
+ var dash = _a[_i];
805
+ for (var _b = 0, _c = dash.visualizations; _b < _c.length; _b++) {
806
+ var viz = _c[_b];
807
+ if (viz.events) {
808
+ for (var eventID in viz.events) {
809
+ var event_1 = viz.events[eventID];
810
+ for (var _d = 0, _e = event_1.updates; _d < _e.length; _d++) {
811
+ var update = _e[_d];
812
+ var otherViz = this._ddl2Dataviews[update.visualization];
813
+ var dsFilters = this.getDatasourceFilters(update.datasource, otherViz.id);
814
+ if (update.mappings) {
815
+ if (isRoxieServiceRef(otherViz.datasource)) {
816
+ for (var key in update.mappings) {
817
+ otherViz.datasource.request.push({
818
+ source: viz.id,
819
+ remoteFieldID: this.toLowerCase(key),
820
+ localFieldID: this.toLowerCase(update.mappings[key])
821
+ });
822
+ }
823
+ }
824
+ else {
825
+ var condition = {
826
+ viewID: viz.id,
827
+ mappings: []
828
+ };
829
+ for (var key in update.mappings) {
830
+ var mapping = update.mappings[key];
831
+ var dsFilter = (mapping && dsFilters[mapping]) ? dsFilters[mapping].filter : undefined;
832
+ if (!dsFilter) {
833
+ console.warn("Select Mapping \"".concat(mapping, "\" in viz \"").concat(viz.id, "\" not found in filters for \"").concat(otherViz.id, "\""));
834
+ }
835
+ else {
836
+ condition.mappings.push({
837
+ remoteFieldID: this.toLowerCase(key),
838
+ localFieldID: this.toLowerCase(update.mappings[key]),
839
+ condition: this.rule2condition(dsFilter.rule),
840
+ nullable: dsFilter.nullable
841
+ });
842
+ }
843
+ }
844
+ this._ddl2DataviewActivities[otherViz.id].filters.conditions.push(condition);
845
+ }
846
+ }
847
+ }
848
+ }
849
+ }
850
+ }
851
+ }
852
+ };
853
+ DDLUpgrade.prototype.rule2condition = function (_) {
854
+ switch (_) {
855
+ case "set":
856
+ return "in";
857
+ case "notequals":
858
+ return "!=";
859
+ }
860
+ return _;
861
+ };
862
+ DDLUpgrade.prototype.readSort = function () {
863
+ var _this = this;
864
+ for (var _i = 0, _a = this._ddl.dashboards; _i < _a.length; _i++) {
865
+ var dash = _a[_i];
866
+ for (var _b = 0, _c = dash.visualizations; _b < _c.length; _b++) {
867
+ var viz = _c[_b];
868
+ if (viz.source) {
869
+ if (viz.source.sort) {
870
+ var vizSort = this._ddl2DataviewActivities[viz.id].sort;
871
+ vizSort.conditions = viz.source.sort.map(function (s) {
872
+ if (s.indexOf("-") === 0) {
873
+ return {
874
+ fieldID: _this.toLowerCase(s.substr(1)),
875
+ descending: true
876
+ };
877
+ }
878
+ return {
879
+ fieldID: _this.toLowerCase(s),
880
+ descending: false
881
+ };
882
+ });
883
+ }
884
+ if (viz.source.first) {
885
+ var vizLimit = this._ddl2DataviewActivities[viz.id].limit;
886
+ vizLimit.limit = +viz.source.first;
887
+ }
888
+ }
889
+ }
890
+ }
891
+ };
892
+ DDLUpgrade.prototype.anyViz2view = function (viz) {
893
+ var project = {
894
+ type: "project",
895
+ transformations: []
896
+ };
897
+ var filters = {
898
+ type: "filter",
899
+ conditions: []
900
+ };
901
+ var groupBy = {
902
+ type: "groupby",
903
+ groupByIDs: [],
904
+ aggregates: []
905
+ };
906
+ var sort = {
907
+ type: "sort",
908
+ conditions: []
909
+ };
910
+ var limit = {
911
+ type: "limit",
912
+ limit: 0
913
+ };
914
+ var mappings = {
915
+ type: "mappings",
916
+ transformations: []
917
+ };
918
+ this._ddl2DataviewActivities[viz.id] = {
919
+ project: project,
920
+ filters: filters,
921
+ sort: sort,
922
+ groupBy: groupBy,
923
+ limit: limit,
924
+ mappings: mappings
925
+ };
926
+ var datasourceRef = this.isVizDatasourceRoxie(viz) ? {
927
+ id: this._datasourceUpdates[viz.id].id,
928
+ request: [],
929
+ output: this._datasourceUpdates[viz.id].output
930
+ } : {
931
+ id: this._datasourceUpdates[viz.id].id,
932
+ output: this._datasourceUpdates[viz.id].output
933
+ };
934
+ return {
935
+ id: viz.id,
936
+ datasource: datasourceRef,
937
+ activities: [
938
+ project,
939
+ filters,
940
+ sort,
941
+ groupBy,
942
+ limit
943
+ ],
944
+ 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 || {}) })
945
+ };
946
+ };
947
+ DDLUpgrade.prototype.type2chartType = function (chartType) {
948
+ switch (chartType) {
949
+ case "LINE":
950
+ return { chartType: "Line", __class: "chart_Line" };
951
+ case "BUBBLE":
952
+ return { chartType: "Bubble", __class: "chart_Bubble" };
953
+ case "PIE":
954
+ return { chartType: "Pie", __class: "chart_Pie" };
955
+ case "BAR":
956
+ return { chartType: "Column", __class: "chart_Column" };
957
+ case "FORM":
958
+ return { chartType: "FieldForm", __class: "form_FieldForm" };
959
+ case "WORD_CLOUD":
960
+ return { chartType: "WordCloud", __class: "chart_WordCloud" };
961
+ case "CHORO":
962
+ return { chartType: "ChoroplethStates", __class: "map_ChoroplethStates" };
963
+ case "SUMMARY":
964
+ return { chartType: "Summary", __class: "chart_Summary" };
965
+ case "SLIDER":
966
+ return { chartType: "FieldForm", __class: "form_FieldForm" };
967
+ case "HEAT_MAP":
968
+ return { chartType: "HeatMap", __class: "other_HeatMap" };
969
+ case "2DCHART":
970
+ return { chartType: "Column", __class: "chart_Column" };
971
+ case "GRAPH":
972
+ return { chartType: "AdjacencyGraph", __class: "graph_AdjacencyGraph" };
973
+ case "TABLE":
974
+ default:
975
+ return { chartType: "Table", __class: "dgrid_Table" };
976
+ }
977
+ };
978
+ DDLUpgrade.prototype.formFields2field = function (fields, slider) {
979
+ var _this = this;
980
+ if (slider === void 0) { slider = false; }
981
+ if (!fields)
982
+ return [];
983
+ return fields.map(function (field) {
984
+ switch (field.properties.type) {
985
+ case "range":
986
+ return {
987
+ type: "range",
988
+ id: field.id,
989
+ default: (field.properties.default ? field.properties.default : undefined)
990
+ };
991
+ case "dataset":
992
+ return {
993
+ type: "dataset",
994
+ id: field.id,
995
+ default: [],
996
+ children: []
997
+ };
998
+ default:
999
+ return {
1000
+ type: _this.formFieldType2fieldType(field.properties.datatype, slider),
1001
+ id: field.id,
1002
+ default: field.properties.default ? field.properties.default[0] : undefined
1003
+ };
1004
+ }
1005
+ });
1006
+ };
1007
+ DDLUpgrade.prototype.formFieldType2fieldType = function (fieldType, slider) {
1008
+ switch (fieldType) {
1009
+ case "bool":
1010
+ case "boolean":
1011
+ return "boolean";
1012
+ case "integer":
1013
+ case "unsigned":
1014
+ case "float":
1015
+ case "double":
1016
+ case "real":
1017
+ return "number";
1018
+ case "string":
1019
+ return "string";
1020
+ default:
1021
+ return slider ? "number" : "string";
1022
+ }
1023
+ };
1024
+ DDLUpgrade.prototype.output2output = function (output, target) {
1025
+ target[output.from || output.id] = {
1026
+ fields: this.filters2fields(output.filter)
1027
+ };
1028
+ };
1029
+ DDLUpgrade.prototype.filters2fields = function (filters) {
1030
+ if (!filters)
1031
+ return [];
1032
+ return filters.filter(function (filter) {
1033
+ var idParts = filter.fieldid.split("-");
1034
+ return idParts.length === 1 || idParts[1] === "range";
1035
+ }).map(function (filter) {
1036
+ var idParts = filter.fieldid.split("-");
1037
+ var retVal = {
1038
+ type: "string",
1039
+ id: idParts[0]
1040
+ };
1041
+ return retVal;
1042
+ });
1043
+ };
1044
+ DDLUpgrade.prototype.getVizField = function (vizID, fieldID) {
1045
+ return {
1046
+ type: "string",
1047
+ id: "",
1048
+ default: ""
1049
+ };
1050
+ };
1051
+ DDLUpgrade.prototype.writeDatasources = function () {
1052
+ var retVal = [];
1053
+ for (var id in this._ddl2Datasources) {
1054
+ retVal.push(this._ddl2Datasources[id]);
1055
+ }
1056
+ return retVal;
1057
+ };
1058
+ DDLUpgrade.prototype.writeDataviews = function () {
1059
+ var retVal = [];
1060
+ for (var id in this._ddl2Dataviews) {
1061
+ retVal.push(this._ddl2Dataviews[id]);
1062
+ }
1063
+ return retVal;
1064
+ };
1065
+ DDLUpgrade.prototype.writeProperties = function () {
1066
+ return {
1067
+ // TODO
1068
+ };
1069
+ };
1070
+ DDLUpgrade.prototype.write = function () {
1071
+ return {
1072
+ version: "2.2.1",
1073
+ createdBy: {
1074
+ name: PKG_NAME,
1075
+ version: PKG_VERSION
1076
+ },
1077
+ datasources: this.writeDatasources(),
1078
+ dataviews: this.writeDataviews(),
1079
+ properties: this.writeProperties()
1080
+ };
1081
+ };
1082
+ return DDLUpgrade;
1083
+ }());
1084
+ function upgrade(ddl, baseUrl, wuid, toLowerCase, dermatologyJson) {
1085
+ if (toLowerCase === void 0) { toLowerCase = true; }
1086
+ if (dermatologyJson === void 0) { dermatologyJson = {}; }
1087
+ var ddlUp = new DDLUpgrade(ddl, baseUrl, wuid, toLowerCase);
1088
+ var retVal = ddlUp.write();
1089
+ retVal.properties = upgrade$1(retVal, dermatologyJson);
1090
+ return retVal;
1076
1091
  }
1077
1092
 
1078
1093
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1079
1094
 
1080
- function unwrapExports (x) {
1081
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
1082
- }
1083
-
1084
- function createCommonjsModule(fn, basedir, module) {
1085
- return module = {
1086
- path: basedir,
1087
- exports: {},
1088
- require: function (path, base) {
1089
- return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
1090
- }
1091
- }, fn(module, module.exports), module.exports;
1092
- }
1093
-
1094
- function getCjsExportFromNamespace (n) {
1095
- return n && n['default'] || n;
1096
- }
1095
+ var uri_all = {exports: {}};
1097
1096
 
1098
- function commonjsRequire () {
1099
- throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
1100
- }
1101
-
1102
- var uri_all = createCommonjsModule(function (module, exports) {
1103
1097
  /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
1098
+
1099
+ (function (module, exports) {
1104
1100
  (function (global, factory) {
1105
- factory(exports) ;
1101
+ factory(exports) ;
1106
1102
  }(commonjsGlobal, (function (exports) {
1107
1103
  function merge() {
1108
1104
  for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) {
@@ -1156,10 +1152,10 @@
1156
1152
  //subset, excludes bidi control characters
1157
1153
  IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]",
1158
1154
  //subset
1159
- UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$),
1160
- SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"),
1161
- USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"),
1162
- 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$$),
1155
+ UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$);
1156
+ subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*");
1157
+ subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*");
1158
+ var 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$$),
1163
1159
  //relaxed parsing rules
1164
1160
  IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$),
1165
1161
  H16$ = subexp(HEXDIG$$ + "{1,4}"),
@@ -1183,14 +1179,14 @@
1183
1179
  IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"),
1184
1180
  //[ *6( h16 ":" ) h16 ] "::"
1185
1181
  IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")),
1186
- ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"),
1182
+ ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+");
1187
1183
  //RFC 6874, with relaxed parsing rules
1188
- IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"),
1184
+ subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+");
1189
1185
  //RFC 6874
1190
- REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"),
1191
- PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")),
1192
- SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"),
1193
- QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*");
1186
+ subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*");
1187
+ var PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]"));
1188
+ subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+");
1189
+ subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*");
1194
1190
  return {
1195
1191
  NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
1196
1192
  NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
@@ -2304,7 +2300,7 @@
2304
2300
 
2305
2301
  var O = {};
2306
2302
  //RFC 3986
2307
- var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + ( "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" ) + "]";
2303
+ var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + ("\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" ) + "]";
2308
2304
  var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive
2309
2305
  var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded
2310
2306
  //RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =
@@ -2502,9 +2498,7 @@
2502
2498
 
2503
2499
  })));
2504
2500
 
2505
- });
2506
-
2507
- unwrapExports(uri_all);
2501
+ }(uri_all, uri_all.exports));
2508
2502
 
2509
2503
  // do not edit .js files directly - edit src/index.jst
2510
2504
 
@@ -2553,7 +2547,7 @@
2553
2547
 
2554
2548
  // https://mathiasbynens.be/notes/javascript-encoding
2555
2549
  // https://github.com/bestiejs/punycode.js - punycode.ucs2.decode
2556
- var ucs2length = function ucs2length(str) {
2550
+ var ucs2length$1 = function ucs2length(str) {
2557
2551
  var length = 0
2558
2552
  , len = str.length
2559
2553
  , pos = 0
@@ -2570,16 +2564,16 @@
2570
2564
  return length;
2571
2565
  };
2572
2566
 
2573
- var util = {
2567
+ var util$5 = {
2574
2568
  copy: copy,
2575
2569
  checkDataType: checkDataType,
2576
2570
  checkDataTypes: checkDataTypes,
2577
2571
  coerceToTypes: coerceToTypes,
2578
- toHash: toHash,
2572
+ toHash: toHash$1,
2579
2573
  getProperty: getProperty,
2580
2574
  escapeQuotes: escapeQuotes,
2581
2575
  equal: fastDeepEqual,
2582
- ucs2length: ucs2length,
2576
+ ucs2length: ucs2length$1,
2583
2577
  varOccurences: varOccurences,
2584
2578
  varReplace: varReplace,
2585
2579
  schemaHasRules: schemaHasRules,
@@ -2630,7 +2624,7 @@
2630
2624
  case 1: return checkDataType(dataTypes[0], data, strictNumbers, true);
2631
2625
  default:
2632
2626
  var code = '';
2633
- var types = toHash(dataTypes);
2627
+ var types = toHash$1(dataTypes);
2634
2628
  if (types.array && types.object) {
2635
2629
  code = types.null ? '(': '(!' + data + ' || ';
2636
2630
  code += 'typeof ' + data + ' !== "object")';
@@ -2647,7 +2641,7 @@
2647
2641
  }
2648
2642
 
2649
2643
 
2650
- var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]);
2644
+ var COERCE_TO_TYPES = toHash$1([ 'string', 'number', 'integer', 'boolean', 'null' ]);
2651
2645
  function coerceToTypes(optionCoerceTypes, dataTypes) {
2652
2646
  if (Array.isArray(dataTypes)) {
2653
2647
  var types = [];
@@ -2665,19 +2659,19 @@
2665
2659
  }
2666
2660
 
2667
2661
 
2668
- function toHash(arr) {
2662
+ function toHash$1(arr) {
2669
2663
  var hash = {};
2670
2664
  for (var i=0; i<arr.length; i++) hash[arr[i]] = true;
2671
2665
  return hash;
2672
2666
  }
2673
2667
 
2674
2668
 
2675
- var IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
2669
+ var IDENTIFIER$1 = /^[a-z$_][a-z$_0-9]*$/i;
2676
2670
  var SINGLE_QUOTE = /'|\\/g;
2677
2671
  function getProperty(key) {
2678
2672
  return typeof key == 'number'
2679
2673
  ? '[' + key + ']'
2680
- : IDENTIFIER.test(key)
2674
+ : IDENTIFIER$1.test(key)
2681
2675
  ? '.' + key
2682
2676
  : "['" + escapeQuotes(key) + "']";
2683
2677
  }
@@ -2745,17 +2739,17 @@
2745
2739
  }
2746
2740
 
2747
2741
 
2748
- var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
2749
- var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
2742
+ var JSON_POINTER$1 = /^\/(?:[^~]|~0|~1)*$/;
2743
+ var RELATIVE_JSON_POINTER$1 = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
2750
2744
  function getData($data, lvl, paths) {
2751
2745
  var up, jsonPointer, data, matches;
2752
2746
  if ($data === '') return 'rootData';
2753
2747
  if ($data[0] == '/') {
2754
- if (!JSON_POINTER.test($data)) throw new Error('Invalid JSON-pointer: ' + $data);
2748
+ if (!JSON_POINTER$1.test($data)) throw new Error('Invalid JSON-pointer: ' + $data);
2755
2749
  jsonPointer = $data;
2756
2750
  data = 'rootData';
2757
2751
  } else {
2758
- matches = $data.match(RELATIVE_JSON_POINTER);
2752
+ matches = $data.match(RELATIVE_JSON_POINTER$1);
2759
2753
  if (!matches) throw new Error('Invalid JSON-pointer: ' + $data);
2760
2754
  up = +matches[1];
2761
2755
  jsonPointer = matches[2];
@@ -2807,15 +2801,17 @@
2807
2801
  return str.replace(/~1/g, '/').replace(/~0/g, '~');
2808
2802
  }
2809
2803
 
2810
- var schema_obj = SchemaObject;
2804
+ var util$4 = util$5;
2805
+
2806
+ var schema_obj = SchemaObject$2;
2811
2807
 
2812
- function SchemaObject(obj) {
2813
- util.copy(obj, this);
2808
+ function SchemaObject$2(obj) {
2809
+ util$4.copy(obj, this);
2814
2810
  }
2815
2811
 
2816
- var jsonSchemaTraverse = createCommonjsModule(function (module) {
2812
+ var jsonSchemaTraverse = {exports: {}};
2817
2813
 
2818
- var traverse = module.exports = function (schema, opts, cb) {
2814
+ var traverse$1 = jsonSchemaTraverse.exports = function (schema, opts, cb) {
2819
2815
  // Legacy support for v0.3.1 and earlier.
2820
2816
  if (typeof opts == 'function') {
2821
2817
  cb = opts;
@@ -2830,7 +2826,7 @@
2830
2826
  };
2831
2827
 
2832
2828
 
2833
- traverse.keywords = {
2829
+ traverse$1.keywords = {
2834
2830
  additionalItems: true,
2835
2831
  items: true,
2836
2832
  contains: true,
@@ -2839,21 +2835,21 @@
2839
2835
  not: true
2840
2836
  };
2841
2837
 
2842
- traverse.arrayKeywords = {
2838
+ traverse$1.arrayKeywords = {
2843
2839
  items: true,
2844
2840
  allOf: true,
2845
2841
  anyOf: true,
2846
2842
  oneOf: true
2847
2843
  };
2848
2844
 
2849
- traverse.propsKeywords = {
2845
+ traverse$1.propsKeywords = {
2850
2846
  definitions: true,
2851
2847
  properties: true,
2852
2848
  patternProperties: true,
2853
2849
  dependencies: true
2854
2850
  };
2855
2851
 
2856
- traverse.skipKeywords = {
2852
+ traverse$1.skipKeywords = {
2857
2853
  default: true,
2858
2854
  enum: true,
2859
2855
  const: true,
@@ -2881,16 +2877,16 @@
2881
2877
  for (var key in schema) {
2882
2878
  var sch = schema[key];
2883
2879
  if (Array.isArray(sch)) {
2884
- if (key in traverse.arrayKeywords) {
2880
+ if (key in traverse$1.arrayKeywords) {
2885
2881
  for (var i=0; i<sch.length; i++)
2886
2882
  _traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);
2887
2883
  }
2888
- } else if (key in traverse.propsKeywords) {
2884
+ } else if (key in traverse$1.propsKeywords) {
2889
2885
  if (sch && typeof sch == 'object') {
2890
2886
  for (var prop in sch)
2891
2887
  _traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);
2892
2888
  }
2893
- } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {
2889
+ } else if (key in traverse$1.keywords || (opts.allKeys && !(key in traverse$1.skipKeywords))) {
2894
2890
  _traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);
2895
2891
  }
2896
2892
  }
@@ -2902,16 +2898,21 @@
2902
2898
  function escapeJsonPtr(str) {
2903
2899
  return str.replace(/~/g, '~0').replace(/\//g, '~1');
2904
2900
  }
2905
- });
2906
2901
 
2907
- var resolve_1 = resolve;
2902
+ var URI$1 = uri_all.exports
2903
+ , equal$1 = fastDeepEqual
2904
+ , util$3 = util$5
2905
+ , SchemaObject$1 = schema_obj
2906
+ , traverse = jsonSchemaTraverse.exports;
2907
+
2908
+ var resolve_1 = resolve$3;
2908
2909
 
2909
- resolve.normalizeId = normalizeId;
2910
- resolve.fullPath = getFullPath;
2911
- resolve.url = resolveUrl;
2912
- resolve.ids = resolveIds;
2913
- resolve.inlineRef = inlineRef;
2914
- resolve.schema = resolveSchema;
2910
+ resolve$3.normalizeId = normalizeId;
2911
+ resolve$3.fullPath = getFullPath;
2912
+ resolve$3.url = resolveUrl;
2913
+ resolve$3.ids = resolveIds;
2914
+ resolve$3.inlineRef = inlineRef;
2915
+ resolve$3.schema = resolveSchema;
2915
2916
 
2916
2917
  /**
2917
2918
  * [resolve and compile the references ($ref)]
@@ -2921,16 +2922,16 @@
2921
2922
  * @param {String} ref reference to resolve
2922
2923
  * @return {Object|Function} schema object (if the schema can be inlined) or validation function
2923
2924
  */
2924
- function resolve(compile, root, ref) {
2925
+ function resolve$3(compile, root, ref) {
2925
2926
  /* jshint validthis: true */
2926
2927
  var refVal = this._refs[ref];
2927
2928
  if (typeof refVal == 'string') {
2928
2929
  if (this._refs[refVal]) refVal = this._refs[refVal];
2929
- else return resolve.call(this, compile, root, refVal);
2930
+ else return resolve$3.call(this, compile, root, refVal);
2930
2931
  }
2931
2932
 
2932
2933
  refVal = refVal || this._schemas[ref];
2933
- if (refVal instanceof schema_obj) {
2934
+ if (refVal instanceof SchemaObject$1) {
2934
2935
  return inlineRef(refVal.schema, this._opts.inlineRefs)
2935
2936
  ? refVal.schema
2936
2937
  : refVal.validate || this._compile(refVal);
@@ -2944,7 +2945,7 @@
2944
2945
  baseId = res.baseId;
2945
2946
  }
2946
2947
 
2947
- if (schema instanceof schema_obj) {
2948
+ if (schema instanceof SchemaObject$1) {
2948
2949
  v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId);
2949
2950
  } else if (schema !== undefined) {
2950
2951
  v = inlineRef(schema, this._opts.inlineRefs)
@@ -2965,7 +2966,7 @@
2965
2966
  */
2966
2967
  function resolveSchema(root, ref) {
2967
2968
  /* jshint validthis: true */
2968
- var p = uri_all.parse(ref)
2969
+ var p = URI$1.parse(ref)
2969
2970
  , refPath = _getFullPath(p)
2970
2971
  , baseId = getFullPath(this._getId(root.schema));
2971
2972
  if (Object.keys(root.schema).length === 0 || refPath !== baseId) {
@@ -2973,12 +2974,12 @@
2973
2974
  var refVal = this._refs[id];
2974
2975
  if (typeof refVal == 'string') {
2975
2976
  return resolveRecursive.call(this, root, refVal, p);
2976
- } else if (refVal instanceof schema_obj) {
2977
+ } else if (refVal instanceof SchemaObject$1) {
2977
2978
  if (!refVal.validate) this._compile(refVal);
2978
2979
  root = refVal;
2979
2980
  } else {
2980
2981
  refVal = this._schemas[id];
2981
- if (refVal instanceof schema_obj) {
2982
+ if (refVal instanceof SchemaObject$1) {
2982
2983
  if (!refVal.validate) this._compile(refVal);
2983
2984
  if (id == normalizeId(ref))
2984
2985
  return { schema: refVal, root: root, baseId: baseId };
@@ -3009,7 +3010,7 @@
3009
3010
  }
3010
3011
 
3011
3012
 
3012
- var PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']);
3013
+ var PREVENT_SCOPE_CHANGE = util$3.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']);
3013
3014
  /* @this Ajv */
3014
3015
  function getJsonPointer(parsedRef, baseId, schema, root) {
3015
3016
  /* jshint validthis: true */
@@ -3020,7 +3021,7 @@
3020
3021
  for (var i = 1; i < parts.length; i++) {
3021
3022
  var part = parts[i];
3022
3023
  if (part) {
3023
- part = util.unescapeFragment(part);
3024
+ part = util$3.unescapeFragment(part);
3024
3025
  schema = schema[part];
3025
3026
  if (schema === undefined) break;
3026
3027
  var id;
@@ -3044,7 +3045,7 @@
3044
3045
  }
3045
3046
 
3046
3047
 
3047
- var SIMPLE_INLINED = util.toHash([
3048
+ var SIMPLE_INLINED = util$3.toHash([
3048
3049
  'type', 'format', 'pattern',
3049
3050
  'maxLength', 'minLength',
3050
3051
  'maxProperties', 'minProperties',
@@ -3104,13 +3105,13 @@
3104
3105
 
3105
3106
  function getFullPath(id, normalize) {
3106
3107
  if (normalize !== false) id = normalizeId(id);
3107
- var p = uri_all.parse(id);
3108
+ var p = URI$1.parse(id);
3108
3109
  return _getFullPath(p);
3109
3110
  }
3110
3111
 
3111
3112
 
3112
3113
  function _getFullPath(p) {
3113
- return uri_all.serialize(p).split('#')[0] + '#';
3114
+ return URI$1.serialize(p).split('#')[0] + '#';
3114
3115
  }
3115
3116
 
3116
3117
 
@@ -3122,7 +3123,7 @@
3122
3123
 
3123
3124
  function resolveUrl(baseId, id) {
3124
3125
  id = normalizeId(id);
3125
- return uri_all.resolve(baseId, id);
3126
+ return URI$1.resolve(baseId, id);
3126
3127
  }
3127
3128
 
3128
3129
 
@@ -3134,25 +3135,25 @@
3134
3135
  var localRefs = {};
3135
3136
  var self = this;
3136
3137
 
3137
- jsonSchemaTraverse(schema, {allKeys: true}, function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
3138
+ traverse(schema, {allKeys: true}, function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
3138
3139
  if (jsonPtr === '') return;
3139
3140
  var id = self._getId(sch);
3140
3141
  var baseId = baseIds[parentJsonPtr];
3141
3142
  var fullPath = fullPaths[parentJsonPtr] + '/' + parentKeyword;
3142
3143
  if (keyIndex !== undefined)
3143
- fullPath += '/' + (typeof keyIndex == 'number' ? keyIndex : util.escapeFragment(keyIndex));
3144
+ fullPath += '/' + (typeof keyIndex == 'number' ? keyIndex : util$3.escapeFragment(keyIndex));
3144
3145
 
3145
3146
  if (typeof id == 'string') {
3146
- id = baseId = normalizeId(baseId ? uri_all.resolve(baseId, id) : id);
3147
+ id = baseId = normalizeId(baseId ? URI$1.resolve(baseId, id) : id);
3147
3148
 
3148
3149
  var refVal = self._refs[id];
3149
3150
  if (typeof refVal == 'string') refVal = self._refs[refVal];
3150
3151
  if (refVal && refVal.schema) {
3151
- if (!fastDeepEqual(sch, refVal.schema))
3152
+ if (!equal$1(sch, refVal.schema))
3152
3153
  throw new Error('id "' + id + '" resolves to more than one schema');
3153
3154
  } else if (id != normalizeId(fullPath)) {
3154
3155
  if (id[0] == '#') {
3155
- if (localRefs[id] && !fastDeepEqual(sch, localRefs[id]))
3156
+ if (localRefs[id] && !equal$1(sch, localRefs[id]))
3156
3157
  throw new Error('id "' + id + '" resolves to more than one schema');
3157
3158
  localRefs[id] = sch;
3158
3159
  } else {
@@ -3167,28 +3168,30 @@
3167
3168
  return localRefs;
3168
3169
  }
3169
3170
 
3171
+ var resolve$2 = resolve_1;
3172
+
3170
3173
  var error_classes = {
3171
- Validation: errorSubclass(ValidationError),
3172
- MissingRef: errorSubclass(MissingRefError)
3174
+ Validation: errorSubclass(ValidationError$1),
3175
+ MissingRef: errorSubclass(MissingRefError$1)
3173
3176
  };
3174
3177
 
3175
3178
 
3176
- function ValidationError(errors) {
3179
+ function ValidationError$1(errors) {
3177
3180
  this.message = 'validation failed';
3178
3181
  this.errors = errors;
3179
3182
  this.ajv = this.validation = true;
3180
3183
  }
3181
3184
 
3182
3185
 
3183
- MissingRefError.message = function (baseId, ref) {
3186
+ MissingRefError$1.message = function (baseId, ref) {
3184
3187
  return 'can\'t resolve reference ' + ref + ' from id ' + baseId;
3185
3188
  };
3186
3189
 
3187
3190
 
3188
- function MissingRefError(baseId, ref, message) {
3189
- this.message = message || MissingRefError.message(baseId, ref);
3190
- this.missingRef = resolve_1.url(baseId, ref);
3191
- this.missingSchema = resolve_1.normalizeId(resolve_1.fullPath(this.missingRef));
3191
+ function MissingRefError$1(baseId, ref, message) {
3192
+ this.message = message || MissingRefError$1.message(baseId, ref);
3193
+ this.missingRef = resolve$2.url(baseId, ref);
3194
+ this.missingSchema = resolve$2.normalizeId(resolve$2.fullPath(this.missingRef));
3192
3195
  }
3193
3196
 
3194
3197
 
@@ -3256,7 +3259,7 @@
3256
3259
  })(data);
3257
3260
  };
3258
3261
 
3259
- var validate = function generate_validate(it, $keyword, $ruleType) {
3262
+ var validate$1 = function generate_validate(it, $keyword, $ruleType) {
3260
3263
  var out = '';
3261
3264
  var $async = it.schema.$async === true,
3262
3265
  $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'),
@@ -3738,17 +3741,24 @@
3738
3741
  return out;
3739
3742
  };
3740
3743
 
3744
+ var resolve$1 = resolve_1
3745
+ , util$2 = util$5
3746
+ , errorClasses$1 = error_classes
3747
+ , stableStringify$1 = fastJsonStableStringify;
3748
+
3749
+ var validateGenerator = validate$1;
3750
+
3741
3751
  /**
3742
3752
  * Functions below are used inside compiled validations function
3743
3753
  */
3744
3754
 
3745
- var ucs2length$1 = util.ucs2length;
3746
-
3755
+ var ucs2length = util$2.ucs2length;
3756
+ var equal = fastDeepEqual;
3747
3757
 
3748
3758
  // this error is thrown by async schemas to return validation errors via exception
3749
- var ValidationError$1 = error_classes.Validation;
3759
+ var ValidationError = errorClasses$1.Validation;
3750
3760
 
3751
- var compile_1 = compile;
3761
+ var compile_1 = compile$1;
3752
3762
 
3753
3763
 
3754
3764
  /**
@@ -3760,7 +3770,7 @@
3760
3770
  * @param {String} baseId base ID for IDs in the schema
3761
3771
  * @return {Function} validation function
3762
3772
  */
3763
- function compile(schema, root, localRefs, baseId) {
3773
+ function compile$1(schema, root, localRefs, baseId) {
3764
3774
  /* jshint validthis: true, evil: true */
3765
3775
  /* eslint no-shadow: 0 */
3766
3776
  var self = this
@@ -3812,11 +3822,11 @@
3812
3822
  function localCompile(_schema, _root, localRefs, baseId) {
3813
3823
  var isRoot = !_root || (_root && _root.schema == _schema);
3814
3824
  if (_root.schema != root.schema)
3815
- return compile.call(self, _schema, _root, localRefs, baseId);
3825
+ return compile$1.call(self, _schema, _root, localRefs, baseId);
3816
3826
 
3817
3827
  var $async = _schema.$async === true;
3818
3828
 
3819
- var sourceCode = validate({
3829
+ var sourceCode = validateGenerator({
3820
3830
  isTop: true,
3821
3831
  schema: _schema,
3822
3832
  isRoot: isRoot,
@@ -3825,11 +3835,11 @@
3825
3835
  schemaPath: '',
3826
3836
  errSchemaPath: '#',
3827
3837
  errorPath: '""',
3828
- MissingRefError: error_classes.MissingRef,
3838
+ MissingRefError: errorClasses$1.MissingRef,
3829
3839
  RULES: RULES,
3830
- validate: validate,
3831
- util: util,
3832
- resolve: resolve_1,
3840
+ validate: validateGenerator,
3841
+ util: util$2,
3842
+ resolve: resolve$1,
3833
3843
  resolveRef: resolveRef,
3834
3844
  usePattern: usePattern,
3835
3845
  useDefault: useDefault,
@@ -3841,12 +3851,12 @@
3841
3851
  });
3842
3852
 
3843
3853
  sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode)
3844
- + vars(defaults, defaultCode) + vars(customRules, customRuleCode)
3854
+ + vars(defaults, defaultCode) + vars(customRules, customRuleCode$1)
3845
3855
  + sourceCode;
3846
3856
 
3847
3857
  if (opts.processCode) sourceCode = opts.processCode(sourceCode, _schema);
3848
3858
  // console.log('\n\n\n *** \n', JSON.stringify(sourceCode));
3849
- var validate$1;
3859
+ var validate;
3850
3860
  try {
3851
3861
  var makeValidate = new Function(
3852
3862
  'self',
@@ -3862,7 +3872,7 @@
3862
3872
  sourceCode
3863
3873
  );
3864
3874
 
3865
- validate$1 = makeValidate(
3875
+ validate = makeValidate(
3866
3876
  self,
3867
3877
  RULES,
3868
3878
  formats,
@@ -3870,36 +3880,36 @@
3870
3880
  refVal,
3871
3881
  defaults,
3872
3882
  customRules,
3873
- fastDeepEqual,
3874
- ucs2length$1,
3875
- ValidationError$1
3883
+ equal,
3884
+ ucs2length,
3885
+ ValidationError
3876
3886
  );
3877
3887
 
3878
- refVal[0] = validate$1;
3888
+ refVal[0] = validate;
3879
3889
  } catch(e) {
3880
3890
  self.logger.error('Error compiling schema, function code:', sourceCode);
3881
3891
  throw e;
3882
3892
  }
3883
3893
 
3884
- validate$1.schema = _schema;
3885
- validate$1.errors = null;
3886
- validate$1.refs = refs;
3887
- validate$1.refVal = refVal;
3888
- validate$1.root = isRoot ? validate$1 : _root;
3889
- if ($async) validate$1.$async = true;
3894
+ validate.schema = _schema;
3895
+ validate.errors = null;
3896
+ validate.refs = refs;
3897
+ validate.refVal = refVal;
3898
+ validate.root = isRoot ? validate : _root;
3899
+ if ($async) validate.$async = true;
3890
3900
  if (opts.sourceCode === true) {
3891
- validate$1.source = {
3901
+ validate.source = {
3892
3902
  code: sourceCode,
3893
3903
  patterns: patterns,
3894
3904
  defaults: defaults
3895
3905
  };
3896
3906
  }
3897
3907
 
3898
- return validate$1;
3908
+ return validate;
3899
3909
  }
3900
3910
 
3901
3911
  function resolveRef(baseId, ref, isRoot) {
3902
- ref = resolve_1.url(baseId, ref);
3912
+ ref = resolve$1.url(baseId, ref);
3903
3913
  var refIndex = refs[ref];
3904
3914
  var _refVal, refCode;
3905
3915
  if (refIndex !== undefined) {
@@ -3917,13 +3927,13 @@
3917
3927
  }
3918
3928
 
3919
3929
  refCode = addLocalRef(ref);
3920
- var v = resolve_1.call(self, localCompile, root, ref);
3930
+ var v = resolve$1.call(self, localCompile, root, ref);
3921
3931
  if (v === undefined) {
3922
3932
  var localSchema = localRefs && localRefs[ref];
3923
3933
  if (localSchema) {
3924
- v = resolve_1.inlineRef(localSchema, opts.inlineRefs)
3934
+ v = resolve$1.inlineRef(localSchema, opts.inlineRefs)
3925
3935
  ? localSchema
3926
- : compile.call(self, localSchema, root, localRefs, baseId);
3936
+ : compile$1.call(self, localSchema, root, localRefs, baseId);
3927
3937
  }
3928
3938
  }
3929
3939
 
@@ -3972,10 +3982,10 @@
3972
3982
  case 'number':
3973
3983
  return '' + value;
3974
3984
  case 'string':
3975
- return util.toQuotedString(value);
3985
+ return util$2.toQuotedString(value);
3976
3986
  case 'object':
3977
3987
  if (value === null) return 'null';
3978
- var valueStr = fastJsonStableStringify(value);
3988
+ var valueStr = stableStringify$1(value);
3979
3989
  var index = defaultsHash[valueStr];
3980
3990
  if (index === undefined) {
3981
3991
  index = defaultsHash[valueStr] = defaults.length;
@@ -4090,7 +4100,7 @@
4090
4100
 
4091
4101
 
4092
4102
  function patternCode(i, patterns) {
4093
- return 'var pattern' + i + ' = new RegExp(' + util.toQuotedString(patterns[i]) + ');';
4103
+ return 'var pattern' + i + ' = new RegExp(' + util$2.toQuotedString(patterns[i]) + ');';
4094
4104
  }
4095
4105
 
4096
4106
 
@@ -4104,7 +4114,7 @@
4104
4114
  }
4105
4115
 
4106
4116
 
4107
- function customRuleCode(i) {
4117
+ function customRuleCode$1(i) {
4108
4118
  return 'var customRule' + i + ' = customRules[' + i + '];';
4109
4119
  }
4110
4120
 
@@ -4117,33 +4127,33 @@
4117
4127
  return code;
4118
4128
  }
4119
4129
 
4120
- var cache = createCommonjsModule(function (module) {
4130
+ var cache = {exports: {}};
4121
4131
 
4122
-
4123
- var Cache = module.exports = function Cache() {
4132
+ var Cache$1 = cache.exports = function Cache() {
4124
4133
  this._cache = {};
4125
4134
  };
4126
4135
 
4127
4136
 
4128
- Cache.prototype.put = function Cache_put(key, value) {
4137
+ Cache$1.prototype.put = function Cache_put(key, value) {
4129
4138
  this._cache[key] = value;
4130
4139
  };
4131
4140
 
4132
4141
 
4133
- Cache.prototype.get = function Cache_get(key) {
4142
+ Cache$1.prototype.get = function Cache_get(key) {
4134
4143
  return this._cache[key];
4135
4144
  };
4136
4145
 
4137
4146
 
4138
- Cache.prototype.del = function Cache_del(key) {
4147
+ Cache$1.prototype.del = function Cache_del(key) {
4139
4148
  delete this._cache[key];
4140
4149
  };
4141
4150
 
4142
4151
 
4143
- Cache.prototype.clear = function Cache_clear() {
4152
+ Cache$1.prototype.clear = function Cache_clear() {
4144
4153
  this._cache = {};
4145
4154
  };
4146
- });
4155
+
4156
+ var util$1 = util$5;
4147
4157
 
4148
4158
  var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
4149
4159
  var DAYS = [0,31,28,31,30,31,30,31,31,30,31,30,31];
@@ -4159,20 +4169,20 @@
4159
4169
  // 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;
4160
4170
  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;
4161
4171
  var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
4162
- var JSON_POINTER$1 = /^(?:\/(?:[^~/]|~0|~1)*)*$/;
4172
+ var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/;
4163
4173
  var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;
4164
- var RELATIVE_JSON_POINTER$1 = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;
4174
+ var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;
4165
4175
 
4166
4176
 
4167
- var formats_1 = formats;
4177
+ var formats_1 = formats$1;
4168
4178
 
4169
- function formats(mode) {
4179
+ function formats$1(mode) {
4170
4180
  mode = mode == 'full' ? 'full' : 'fast';
4171
- return util.copy(formats[mode]);
4181
+ return util$1.copy(formats$1[mode]);
4172
4182
  }
4173
4183
 
4174
4184
 
4175
- formats.fast = {
4185
+ formats$1.fast = {
4176
4186
  // date: http://tools.ietf.org/html/rfc3339#section-5.6
4177
4187
  date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/,
4178
4188
  // date-time: http://tools.ietf.org/html/rfc3339#section-5.6
@@ -4197,14 +4207,14 @@
4197
4207
  uuid: UUID,
4198
4208
  // JSON-pointer: https://tools.ietf.org/html/rfc6901
4199
4209
  // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A
4200
- 'json-pointer': JSON_POINTER$1,
4210
+ 'json-pointer': JSON_POINTER,
4201
4211
  'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,
4202
4212
  // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00
4203
- 'relative-json-pointer': RELATIVE_JSON_POINTER$1
4213
+ 'relative-json-pointer': RELATIVE_JSON_POINTER
4204
4214
  };
4205
4215
 
4206
4216
 
4207
- formats.full = {
4217
+ formats$1.full = {
4208
4218
  date: date,
4209
4219
  time: time,
4210
4220
  'date-time': date_time,
@@ -4218,9 +4228,9 @@
4218
4228
  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,
4219
4229
  regex: regex,
4220
4230
  uuid: UUID,
4221
- 'json-pointer': JSON_POINTER$1,
4231
+ 'json-pointer': JSON_POINTER,
4222
4232
  'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,
4223
- 'relative-json-pointer': RELATIVE_JSON_POINTER$1
4233
+ 'relative-json-pointer': RELATIVE_JSON_POINTER
4224
4234
  };
4225
4235
 
4226
4236
 
@@ -4527,7 +4537,7 @@
4527
4537
  var out = ' ';
4528
4538
  var $schema = it.schema[$keyword];
4529
4539
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
4530
- var $breakOnError = !it.opts.allErrors;
4540
+ !it.opts.allErrors;
4531
4541
  var $comment = it.util.toQuotedString($schema);
4532
4542
  if (it.opts.$comment === true) {
4533
4543
  out += ' console.log(' + ($comment) + ');';
@@ -6013,7 +6023,7 @@
6013
6023
  return out;
6014
6024
  };
6015
6025
 
6016
- var properties = function generate_properties(it, $keyword, $ruleType) {
6026
+ var properties$2 = function generate_properties(it, $keyword, $ruleType) {
6017
6027
  var out = ' ';
6018
6028
  var $lvl = it.level;
6019
6029
  var $dataLvl = it.dataLevel;
@@ -6429,7 +6439,7 @@
6429
6439
  return out;
6430
6440
  };
6431
6441
 
6432
- var required = function generate_required(it, $keyword, $ruleType) {
6442
+ var required$1 = function generate_required(it, $keyword, $ruleType) {
6433
6443
  var out = ' ';
6434
6444
  var $lvl = it.level;
6435
6445
  var $dataLvl = it.dataLevel;
@@ -6806,16 +6816,17 @@
6806
6816
  not: not,
6807
6817
  oneOf: oneOf,
6808
6818
  pattern: pattern,
6809
- properties: properties,
6819
+ properties: properties$2,
6810
6820
  propertyNames: propertyNames,
6811
- required: required,
6821
+ required: required$1,
6812
6822
  uniqueItems: uniqueItems,
6813
- validate: validate
6823
+ validate: validate$1
6814
6824
  };
6815
6825
 
6816
- var toHash$1 = util.toHash;
6826
+ var ruleModules = dotjs
6827
+ , toHash = util$5.toHash;
6817
6828
 
6818
- var rules = function rules() {
6829
+ var rules$1 = function rules() {
6819
6830
  var RULES = [
6820
6831
  { type: 'number',
6821
6832
  rules: [ { 'maximum': ['exclusiveMaximum'] },
@@ -6839,8 +6850,8 @@
6839
6850
  'additionalItems', 'then', 'else'
6840
6851
  ];
6841
6852
  var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ];
6842
- RULES.all = toHash$1(ALL);
6843
- RULES.types = toHash$1(TYPES);
6853
+ RULES.all = toHash(ALL);
6854
+ RULES.types = toHash(TYPES);
6844
6855
 
6845
6856
  RULES.forEach(function (group) {
6846
6857
  group.rules = group.rules.map(function (keyword) {
@@ -6857,7 +6868,7 @@
6857
6868
  ALL.push(keyword);
6858
6869
  var rule = RULES.all[keyword] = {
6859
6870
  keyword: keyword,
6860
- code: dotjs[keyword],
6871
+ code: ruleModules[keyword],
6861
6872
  implements: implKeywords
6862
6873
  };
6863
6874
  return rule;
@@ -6865,13 +6876,13 @@
6865
6876
 
6866
6877
  RULES.all.$comment = {
6867
6878
  keyword: '$comment',
6868
- code: dotjs.$comment
6879
+ code: ruleModules.$comment
6869
6880
  };
6870
6881
 
6871
6882
  if (group.type) RULES.types[group.type] = group;
6872
6883
  });
6873
6884
 
6874
- RULES.keywords = toHash$1(ALL.concat(KEYWORDS));
6885
+ RULES.keywords = toHash(ALL.concat(KEYWORDS));
6875
6886
  RULES.custom = {};
6876
6887
 
6877
6888
  return RULES;
@@ -6925,7 +6936,7 @@
6925
6936
  return metaSchema;
6926
6937
  };
6927
6938
 
6928
- var MissingRefError$1 = error_classes.MissingRef;
6939
+ var MissingRefError = error_classes.MissingRef;
6929
6940
 
6930
6941
  var async = compileAsync;
6931
6942
 
@@ -6978,7 +6989,7 @@
6978
6989
  function _compileAsync(schemaObj) {
6979
6990
  try { return self._compile(schemaObj); }
6980
6991
  catch(e) {
6981
- if (e instanceof MissingRefError$1) return loadMissingSchema(e);
6992
+ if (e instanceof MissingRefError) return loadMissingSchema(e);
6982
6993
  throw e;
6983
6994
  }
6984
6995
 
@@ -7242,10 +7253,10 @@
7242
7253
  return out;
7243
7254
  };
7244
7255
 
7245
- var $schema = "http://json-schema.org/draft-07/schema#";
7246
- var $id = "http://json-schema.org/draft-07/schema#";
7256
+ var $schema$2 = "http://json-schema.org/draft-07/schema#";
7257
+ var $id$1 = "http://json-schema.org/draft-07/schema#";
7247
7258
  var title = "Core schema meta-schema";
7248
- var definitions = {
7259
+ var definitions$1 = {
7249
7260
  schemaArray: {
7250
7261
  type: "array",
7251
7262
  minItems: 1,
@@ -7288,7 +7299,7 @@
7288
7299
  ]
7289
7300
  }
7290
7301
  };
7291
- var type = [
7302
+ var type$1 = [
7292
7303
  "object",
7293
7304
  "boolean"
7294
7305
  ];
@@ -7484,33 +7495,22 @@
7484
7495
  $ref: "#"
7485
7496
  }
7486
7497
  };
7487
- var jsonSchemaDraft07 = {
7488
- $schema: $schema,
7489
- $id: $id,
7498
+ var require$$13 = {
7499
+ $schema: $schema$2,
7500
+ $id: $id$1,
7490
7501
  title: title,
7491
- definitions: definitions,
7492
- type: type,
7502
+ definitions: definitions$1,
7503
+ type: type$1,
7493
7504
  properties: properties$1,
7494
7505
  "default": true
7495
7506
  };
7496
7507
 
7497
- var jsonSchemaDraft07$1 = /*#__PURE__*/Object.freeze({
7498
- __proto__: null,
7499
- $schema: $schema,
7500
- $id: $id,
7501
- title: title,
7502
- definitions: definitions,
7503
- type: type,
7504
- properties: properties$1,
7505
- 'default': jsonSchemaDraft07
7506
- });
7507
-
7508
- var require$$2 = getCjsExportFromNamespace(jsonSchemaDraft07$1);
7508
+ var metaSchema = require$$13;
7509
7509
 
7510
7510
  var definition_schema = {
7511
7511
  $id: 'https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js',
7512
7512
  definitions: {
7513
- simpleTypes: require$$2.definitions.simpleTypes
7513
+ simpleTypes: metaSchema.definitions.simpleTypes
7514
7514
  },
7515
7515
  type: 'object',
7516
7516
  dependencies: {
@@ -7520,7 +7520,7 @@
7520
7520
  valid: {not: {required: ['macro']}}
7521
7521
  },
7522
7522
  properties: {
7523
- type: require$$2.properties.type,
7523
+ type: metaSchema.properties.type,
7524
7524
  schema: {type: 'boolean'},
7525
7525
  statements: {type: 'boolean'},
7526
7526
  dependencies: {
@@ -7541,9 +7541,9 @@
7541
7541
  }
7542
7542
  };
7543
7543
 
7544
- var IDENTIFIER$1 = /^[a-z_$][a-z0-9_$-]*$/i;
7545
-
7546
-
7544
+ var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i;
7545
+ var customRuleCode = custom;
7546
+ var definitionSchema = definition_schema;
7547
7547
 
7548
7548
  var keyword = {
7549
7549
  add: addKeyword,
@@ -7567,7 +7567,7 @@
7567
7567
  if (RULES.keywords[keyword])
7568
7568
  throw new Error('Keyword ' + keyword + ' is already defined');
7569
7569
 
7570
- if (!IDENTIFIER$1.test(keyword))
7570
+ if (!IDENTIFIER.test(keyword))
7571
7571
  throw new Error('Keyword ' + keyword + ' is not a valid identifier');
7572
7572
 
7573
7573
  if (definition) {
@@ -7617,7 +7617,7 @@
7617
7617
  keyword: keyword,
7618
7618
  definition: definition,
7619
7619
  custom: true,
7620
- code: custom,
7620
+ code: customRuleCode,
7621
7621
  implements: definition.implements
7622
7622
  };
7623
7623
  ruleGroup.rules.push(rule);
@@ -7676,7 +7676,7 @@
7676
7676
  function validateKeyword(definition, throwError) {
7677
7677
  validateKeyword.errors = null;
7678
7678
  var v = this._validateKeyword = this._validateKeyword
7679
- || this.compile(definition_schema, true);
7679
+ || this.compile(definitionSchema, true);
7680
7680
 
7681
7681
  if (v(definition)) return true;
7682
7682
  validateKeyword.errors = v.errors;
@@ -7687,13 +7687,13 @@
7687
7687
  }
7688
7688
 
7689
7689
  var $schema$1 = "http://json-schema.org/draft-07/schema#";
7690
- var $id$1 = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#";
7690
+ var $id = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#";
7691
7691
  var description = "Meta-schema for $data reference (JSON Schema extension proposal)";
7692
- var type$1 = "object";
7693
- var required$1 = [
7692
+ var type = "object";
7693
+ var required = [
7694
7694
  "$data"
7695
7695
  ];
7696
- var properties$2 = {
7696
+ var properties = {
7697
7697
  $data: {
7698
7698
  type: "string",
7699
7699
  anyOf: [
@@ -7707,56 +7707,52 @@
7707
7707
  }
7708
7708
  };
7709
7709
  var additionalProperties = false;
7710
- var data$1 = {
7710
+ var require$$12 = {
7711
7711
  $schema: $schema$1,
7712
- $id: $id$1,
7712
+ $id: $id,
7713
7713
  description: description,
7714
- type: type$1,
7715
- required: required$1,
7716
- properties: properties$2,
7714
+ type: type,
7715
+ required: required,
7716
+ properties: properties,
7717
7717
  additionalProperties: additionalProperties
7718
7718
  };
7719
7719
 
7720
- var data$2 = /*#__PURE__*/Object.freeze({
7721
- __proto__: null,
7722
- $schema: $schema$1,
7723
- $id: $id$1,
7724
- description: description,
7725
- type: type$1,
7726
- required: required$1,
7727
- properties: properties$2,
7728
- additionalProperties: additionalProperties,
7729
- 'default': data$1
7730
- });
7731
-
7732
- var require$$1 = getCjsExportFromNamespace(data$2);
7733
-
7734
- var ajv = Ajv;
7735
-
7736
- Ajv.prototype.validate = validate$1;
7737
- Ajv.prototype.compile = compile$1;
7738
- Ajv.prototype.addSchema = addSchema;
7739
- Ajv.prototype.addMetaSchema = addMetaSchema;
7740
- Ajv.prototype.validateSchema = validateSchema;
7741
- Ajv.prototype.getSchema = getSchema;
7742
- Ajv.prototype.removeSchema = removeSchema;
7743
- Ajv.prototype.addFormat = addFormat;
7744
- Ajv.prototype.errorsText = errorsText;
7745
-
7746
- Ajv.prototype._addSchema = _addSchema;
7747
- Ajv.prototype._compile = _compile;
7748
-
7749
- Ajv.prototype.compileAsync = async;
7750
-
7751
- Ajv.prototype.addKeyword = keyword.add;
7752
- Ajv.prototype.getKeyword = keyword.get;
7753
- Ajv.prototype.removeKeyword = keyword.remove;
7754
- Ajv.prototype.validateKeyword = keyword.validate;
7755
-
7756
-
7757
- Ajv.ValidationError = error_classes.Validation;
7758
- Ajv.MissingRefError = error_classes.MissingRef;
7759
- Ajv.$dataMetaSchema = data;
7720
+ var compileSchema = compile_1
7721
+ , resolve = resolve_1
7722
+ , Cache = cache.exports
7723
+ , SchemaObject = schema_obj
7724
+ , stableStringify = fastJsonStableStringify
7725
+ , formats = formats_1
7726
+ , rules = rules$1
7727
+ , $dataMetaSchema = data
7728
+ , util = util$5;
7729
+
7730
+ var ajv = Ajv$1;
7731
+
7732
+ Ajv$1.prototype.validate = validate;
7733
+ Ajv$1.prototype.compile = compile;
7734
+ Ajv$1.prototype.addSchema = addSchema;
7735
+ Ajv$1.prototype.addMetaSchema = addMetaSchema;
7736
+ Ajv$1.prototype.validateSchema = validateSchema;
7737
+ Ajv$1.prototype.getSchema = getSchema;
7738
+ Ajv$1.prototype.removeSchema = removeSchema;
7739
+ Ajv$1.prototype.addFormat = addFormat;
7740
+ Ajv$1.prototype.errorsText = errorsText;
7741
+
7742
+ Ajv$1.prototype._addSchema = _addSchema;
7743
+ Ajv$1.prototype._compile = _compile;
7744
+
7745
+ Ajv$1.prototype.compileAsync = async;
7746
+ var customKeyword = keyword;
7747
+ Ajv$1.prototype.addKeyword = customKeyword.add;
7748
+ Ajv$1.prototype.getKeyword = customKeyword.get;
7749
+ Ajv$1.prototype.removeKeyword = customKeyword.remove;
7750
+ Ajv$1.prototype.validateKeyword = customKeyword.validate;
7751
+
7752
+ var errorClasses = error_classes;
7753
+ Ajv$1.ValidationError = errorClasses.Validation;
7754
+ Ajv$1.MissingRefError = errorClasses.MissingRef;
7755
+ Ajv$1.$dataMetaSchema = $dataMetaSchema;
7760
7756
 
7761
7757
  var META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema';
7762
7758
 
@@ -7769,16 +7765,16 @@
7769
7765
  * @param {Object} opts optional options
7770
7766
  * @return {Object} ajv instance
7771
7767
  */
7772
- function Ajv(opts) {
7773
- if (!(this instanceof Ajv)) return new Ajv(opts);
7768
+ function Ajv$1(opts) {
7769
+ if (!(this instanceof Ajv$1)) return new Ajv$1(opts);
7774
7770
  opts = this._opts = util.copy(opts) || {};
7775
7771
  setLogger(this);
7776
7772
  this._schemas = {};
7777
7773
  this._refs = {};
7778
7774
  this._fragments = {};
7779
- this._formats = formats_1(opts.format);
7775
+ this._formats = formats(opts.format);
7780
7776
 
7781
- this._cache = opts.cache || new cache;
7777
+ this._cache = opts.cache || new Cache;
7782
7778
  this._loadingSchemas = {};
7783
7779
  this._compilations = [];
7784
7780
  this.RULES = rules();
@@ -7786,7 +7782,7 @@
7786
7782
 
7787
7783
  opts.loopRequired = opts.loopRequired || Infinity;
7788
7784
  if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true;
7789
- if (opts.serialize === undefined) opts.serialize = fastJsonStableStringify;
7785
+ if (opts.serialize === undefined) opts.serialize = stableStringify;
7790
7786
  this._metaOpts = getMetaSchemaOptions(this);
7791
7787
 
7792
7788
  if (opts.formats) addInitialFormats(this);
@@ -7807,7 +7803,7 @@
7807
7803
  * @param {Any} data to be validated
7808
7804
  * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`).
7809
7805
  */
7810
- function validate$1(schemaKeyRef, data) {
7806
+ function validate(schemaKeyRef, data) {
7811
7807
  var v;
7812
7808
  if (typeof schemaKeyRef == 'string') {
7813
7809
  v = this.getSchema(schemaKeyRef);
@@ -7830,7 +7826,7 @@
7830
7826
  * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords.
7831
7827
  * @return {Function} validating function
7832
7828
  */
7833
- function compile$1(schema, _meta) {
7829
+ function compile(schema, _meta) {
7834
7830
  var schemaObj = this._addSchema(schema, undefined, _meta);
7835
7831
  return schemaObj.validate || this._compile(schemaObj);
7836
7832
  }
@@ -7853,7 +7849,7 @@
7853
7849
  var id = this._getId(schema);
7854
7850
  if (id !== undefined && typeof id != 'string')
7855
7851
  throw new Error('schema id must be string');
7856
- key = resolve_1.normalizeId(key || id);
7852
+ key = resolve.normalizeId(key || id);
7857
7853
  checkUnique(this, key);
7858
7854
  this._schemas[key] = this._addSchema(schema, _skipValidation, _meta, true);
7859
7855
  return this;
@@ -7930,13 +7926,13 @@
7930
7926
 
7931
7927
 
7932
7928
  function _getSchemaFragment(self, ref) {
7933
- var res = resolve_1.schema.call(self, { schema: {} }, ref);
7929
+ var res = resolve.schema.call(self, { schema: {} }, ref);
7934
7930
  if (res) {
7935
7931
  var schema = res.schema
7936
7932
  , root = res.root
7937
7933
  , baseId = res.baseId;
7938
- var v = compile_1.call(self, schema, root, undefined, baseId);
7939
- self._fragments[ref] = new schema_obj({
7934
+ var v = compileSchema.call(self, schema, root, undefined, baseId);
7935
+ self._fragments[ref] = new SchemaObject({
7940
7936
  ref: ref,
7941
7937
  fragment: true,
7942
7938
  schema: schema,
@@ -7950,7 +7946,7 @@
7950
7946
 
7951
7947
 
7952
7948
  function _getSchemaObj(self, keyRef) {
7953
- keyRef = resolve_1.normalizeId(keyRef);
7949
+ keyRef = resolve.normalizeId(keyRef);
7954
7950
  return self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef];
7955
7951
  }
7956
7952
 
@@ -7988,7 +7984,7 @@
7988
7984
  this._cache.del(cacheKey);
7989
7985
  var id = this._getId(schemaKeyRef);
7990
7986
  if (id) {
7991
- id = resolve_1.normalizeId(id);
7987
+ id = resolve.normalizeId(id);
7992
7988
  delete this._schemas[id];
7993
7989
  delete this._refs[id];
7994
7990
  }
@@ -8019,17 +8015,17 @@
8019
8015
 
8020
8016
  shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false;
8021
8017
 
8022
- var id = resolve_1.normalizeId(this._getId(schema));
8018
+ var id = resolve.normalizeId(this._getId(schema));
8023
8019
  if (id && shouldAddSchema) checkUnique(this, id);
8024
8020
 
8025
8021
  var willValidate = this._opts.validateSchema !== false && !skipValidation;
8026
8022
  var recursiveMeta;
8027
- if (willValidate && !(recursiveMeta = id && id == resolve_1.normalizeId(schema.$schema)))
8023
+ if (willValidate && !(recursiveMeta = id && id == resolve.normalizeId(schema.$schema)))
8028
8024
  this.validateSchema(schema, true);
8029
8025
 
8030
- var localRefs = resolve_1.ids.call(this, schema);
8026
+ var localRefs = resolve.ids.call(this, schema);
8031
8027
 
8032
- var schemaObj = new schema_obj({
8028
+ var schemaObj = new SchemaObject({
8033
8029
  id: id,
8034
8030
  schema: schema,
8035
8031
  localRefs: localRefs,
@@ -8066,7 +8062,7 @@
8066
8062
  }
8067
8063
 
8068
8064
  var v;
8069
- try { v = compile_1.call(this, schemaObj.schema, root, schemaObj.localRefs); }
8065
+ try { v = compileSchema.call(this, schemaObj.schema, root, schemaObj.localRefs); }
8070
8066
  catch(e) {
8071
8067
  delete schemaObj.validate;
8072
8068
  throw e;
@@ -8162,12 +8158,12 @@
8162
8158
  function addDefaultMetaSchema(self) {
8163
8159
  var $dataSchema;
8164
8160
  if (self._opts.$data) {
8165
- $dataSchema = require$$1;
8161
+ $dataSchema = require$$12;
8166
8162
  self.addMetaSchema($dataSchema, $dataSchema.$id, true);
8167
8163
  }
8168
8164
  if (self._opts.meta === false) return;
8169
- var metaSchema = require$$2;
8170
- if (self._opts.$data) metaSchema = data(metaSchema, META_SUPPORT_DATA);
8165
+ var metaSchema = require$$13;
8166
+ if (self._opts.$data) metaSchema = $dataMetaSchema(metaSchema, META_SUPPORT_DATA);
8171
8167
  self.addMetaSchema(metaSchema, META_SCHEMA_ID, true);
8172
8168
  self._refs['http://json-schema.org/schema'] = META_SCHEMA_ID;
8173
8169
  }
@@ -8226,14 +8222,14 @@
8226
8222
 
8227
8223
  function noop() {}
8228
8224
 
8229
- var _Ajv = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), ajv, {
8230
- 'default': ajv,
8231
- __moduleExports: ajv
8232
- }));
8225
+ var _Ajv = /*#__PURE__*/_mergeNamespaces({
8226
+ __proto__: null,
8227
+ 'default': ajv
8228
+ }, [ajv]);
8233
8229
 
8234
8230
  var $ref = "#/definitions/Schema";
8235
- var $schema$2 = "http://json-schema.org/draft-07/schema#";
8236
- var definitions$1 = {
8231
+ var $schema = "http://json-schema.org/draft-07/schema#";
8232
+ var definitions = {
8237
8233
  ActivityType: {
8238
8234
  anyOf: [
8239
8235
  {
@@ -8306,17 +8302,6 @@
8306
8302
  }
8307
8303
  ]
8308
8304
  },
8309
- IActivityType: {
8310
- "enum": [
8311
- "filter",
8312
- "project",
8313
- "groupby",
8314
- "sort",
8315
- "limit",
8316
- "mappings"
8317
- ],
8318
- type: "string"
8319
- },
8320
8305
  IAggregate: {
8321
8306
  additionalProperties: false,
8322
8307
  properties: {
@@ -8391,9 +8376,7 @@
8391
8376
  type: "string"
8392
8377
  },
8393
8378
  type: {
8394
- "enum": [
8395
- "count"
8396
- ],
8379
+ "const": "count",
8397
8380
  type: "string"
8398
8381
  }
8399
8382
  },
@@ -8422,9 +8405,7 @@
8422
8405
  type: "string"
8423
8406
  },
8424
8407
  type: {
8425
- "enum": [
8426
- "databomb"
8427
- ],
8408
+ "const": "databomb",
8428
8409
  type: "string"
8429
8410
  }
8430
8411
  },
@@ -8516,9 +8497,7 @@
8516
8497
  type: "array"
8517
8498
  },
8518
8499
  type: {
8519
- "enum": [
8520
- "="
8521
- ],
8500
+ "const": "=",
8522
8501
  type: "string"
8523
8502
  }
8524
8503
  },
@@ -8567,9 +8546,7 @@
8567
8546
  type: "string"
8568
8547
  },
8569
8548
  type: {
8570
- "enum": [
8571
- "boolean"
8572
- ],
8549
+ "const": "boolean",
8573
8550
  type: "string"
8574
8551
  }
8575
8552
  },
@@ -8595,9 +8572,7 @@
8595
8572
  type: "string"
8596
8573
  },
8597
8574
  type: {
8598
- "enum": [
8599
- "dataset"
8600
- ],
8575
+ "const": "dataset",
8601
8576
  type: "string"
8602
8577
  }
8603
8578
  },
@@ -8618,9 +8593,7 @@
8618
8593
  type: "string"
8619
8594
  },
8620
8595
  type: {
8621
- "enum": [
8622
- "number"
8623
- ],
8596
+ "const": "number",
8624
8597
  type: "string"
8625
8598
  }
8626
8599
  },
@@ -8640,9 +8613,7 @@
8640
8613
  type: "string"
8641
8614
  },
8642
8615
  type: {
8643
- "enum": [
8644
- "number64"
8645
- ],
8616
+ "const": "number64",
8646
8617
  type: "string"
8647
8618
  }
8648
8619
  },
@@ -8668,9 +8639,7 @@
8668
8639
  type: "string"
8669
8640
  },
8670
8641
  type: {
8671
- "enum": [
8672
- "object"
8673
- ],
8642
+ "const": "object",
8674
8643
  type: "string"
8675
8644
  }
8676
8645
  },
@@ -8691,9 +8660,7 @@
8691
8660
  type: "string"
8692
8661
  },
8693
8662
  type: {
8694
- "enum": [
8695
- "range"
8696
- ],
8663
+ "const": "range",
8697
8664
  type: "string"
8698
8665
  }
8699
8666
  },
@@ -8726,9 +8693,7 @@
8726
8693
  type: "string"
8727
8694
  },
8728
8695
  type: {
8729
- "enum": [
8730
- "set"
8731
- ],
8696
+ "const": "set",
8732
8697
  type: "string"
8733
8698
  }
8734
8699
  },
@@ -8749,9 +8714,7 @@
8749
8714
  type: "string"
8750
8715
  },
8751
8716
  type: {
8752
- "enum": [
8753
- "string"
8754
- ],
8717
+ "const": "string",
8755
8718
  type: "string"
8756
8719
  }
8757
8720
  },
@@ -8784,9 +8747,7 @@
8784
8747
  type: "array"
8785
8748
  },
8786
8749
  type: {
8787
- "enum": [
8788
- "filter"
8789
- ],
8750
+ "const": "filter",
8790
8751
  type: "string"
8791
8752
  }
8792
8753
  },
@@ -8851,9 +8812,7 @@
8851
8812
  type: "string"
8852
8813
  },
8853
8814
  type: {
8854
- "enum": [
8855
- "form"
8856
- ],
8815
+ "const": "form",
8857
8816
  type: "string"
8858
8817
  }
8859
8818
  },
@@ -8880,9 +8839,7 @@
8880
8839
  type: "array"
8881
8840
  },
8882
8841
  type: {
8883
- "enum": [
8884
- "groupby"
8885
- ],
8842
+ "const": "groupby",
8886
8843
  type: "string"
8887
8844
  }
8888
8845
  },
@@ -8915,9 +8872,7 @@
8915
8872
  type: "string"
8916
8873
  },
8917
8874
  type: {
8918
- "enum": [
8919
- "hipie"
8920
- ],
8875
+ "const": "hipie",
8921
8876
  type: "string"
8922
8877
  },
8923
8878
  url: {
@@ -8954,9 +8909,7 @@
8954
8909
  type: "number"
8955
8910
  },
8956
8911
  type: {
8957
- "enum": [
8958
- "limit"
8959
- ],
8912
+ "const": "limit",
8960
8913
  type: "string"
8961
8914
  }
8962
8915
  },
@@ -8982,9 +8935,7 @@
8982
8935
  type: "string"
8983
8936
  },
8984
8937
  type: {
8985
- "enum": [
8986
- "logicalfile"
8987
- ],
8938
+ "const": "logicalfile",
8988
8939
  type: "string"
8989
8940
  },
8990
8941
  url: {
@@ -9018,9 +8969,7 @@
9018
8969
  type: "string"
9019
8970
  },
9020
8971
  type: {
9021
- "enum": [
9022
- "map"
9023
- ],
8972
+ "const": "map",
9024
8973
  type: "string"
9025
8974
  }
9026
8975
  },
@@ -9094,9 +9043,7 @@
9094
9043
  type: "array"
9095
9044
  },
9096
9045
  type: {
9097
- "enum": [
9098
- "mappings"
9099
- ],
9046
+ "const": "mappings",
9100
9047
  type: "string"
9101
9048
  }
9102
9049
  },
@@ -9119,9 +9066,7 @@
9119
9066
  type: "array"
9120
9067
  },
9121
9068
  type: {
9122
- "enum": [
9123
- "multi"
9124
- ],
9069
+ "const": "multi",
9125
9070
  type: "string"
9126
9071
  }
9127
9072
  },
@@ -9157,9 +9102,7 @@
9157
9102
  type: "array"
9158
9103
  },
9159
9104
  type: {
9160
- "enum": [
9161
- "project"
9162
- ],
9105
+ "const": "project",
9163
9106
  type: "string"
9164
9107
  }
9165
9108
  },
@@ -9222,9 +9165,7 @@
9222
9165
  $ref: "#/definitions/OutputDict"
9223
9166
  },
9224
9167
  type: {
9225
- "enum": [
9226
- "rest"
9227
- ],
9168
+ "const": "rest",
9228
9169
  type: "string"
9229
9170
  },
9230
9171
  url: {
@@ -9263,9 +9204,7 @@
9263
9204
  type: "string"
9264
9205
  },
9265
9206
  type: {
9266
- "enum": [
9267
- "roxie"
9268
- ],
9207
+ "const": "roxie",
9269
9208
  type: "string"
9270
9209
  },
9271
9210
  url: {
@@ -9319,9 +9258,7 @@
9319
9258
  type: "string"
9320
9259
  },
9321
9260
  type: {
9322
- "enum": [
9323
- "scale"
9324
- ],
9261
+ "const": "scale",
9325
9262
  type: "string"
9326
9263
  }
9327
9264
  },
@@ -9343,9 +9280,7 @@
9343
9280
  type: "array"
9344
9281
  },
9345
9282
  type: {
9346
- "enum": [
9347
- "sort"
9348
- ],
9283
+ "const": "sort",
9349
9284
  type: "string"
9350
9285
  }
9351
9286
  },
@@ -9381,9 +9316,7 @@
9381
9316
  type: "string"
9382
9317
  },
9383
9318
  type: {
9384
- "enum": [
9385
- "template"
9386
- ],
9319
+ "const": "template",
9387
9320
  type: "string"
9388
9321
  }
9389
9322
  },
@@ -9473,9 +9406,7 @@
9473
9406
  $ref: "#/definitions/OutputDict"
9474
9407
  },
9475
9408
  type: {
9476
- "enum": [
9477
- "wuresult"
9478
- ],
9409
+ "const": "wuresult",
9479
9410
  type: "string"
9480
9411
  },
9481
9412
  url: {
@@ -9592,20 +9523,12 @@
9592
9523
  ]
9593
9524
  },
9594
9525
  Range: {
9595
- items: [
9596
- {
9597
- type: [
9598
- "number",
9599
- "string"
9600
- ]
9601
- },
9602
- {
9603
- type: [
9604
- "number",
9605
- "string"
9606
- ]
9607
- }
9608
- ],
9526
+ items: {
9527
+ type: [
9528
+ "number",
9529
+ "string"
9530
+ ]
9531
+ },
9609
9532
  maxItems: 2,
9610
9533
  minItems: 2,
9611
9534
  type: "array"
@@ -9854,9 +9777,7 @@
9854
9777
  $ref: "#/definitions/IProperties"
9855
9778
  },
9856
9779
  version: {
9857
- "enum": [
9858
- "2.2.1"
9859
- ],
9780
+ "const": "2.2.1",
9860
9781
  type: "string"
9861
9782
  }
9862
9783
  },
@@ -9876,55 +9797,55 @@
9876
9797
  type: "string"
9877
9798
  }
9878
9799
  };
9879
- var v2$1 = {
9800
+ var v2 = {
9880
9801
  $ref: $ref,
9881
- $schema: $schema$2,
9882
- definitions: definitions$1
9802
+ $schema: $schema,
9803
+ definitions: definitions
9883
9804
  };
9884
9805
 
9885
9806
  var _ddl2Schema = /*#__PURE__*/Object.freeze({
9886
9807
  __proto__: null,
9887
9808
  $ref: $ref,
9888
- $schema: $schema$2,
9889
- definitions: definitions$1,
9890
- 'default': v2$1
9809
+ $schema: $schema,
9810
+ definitions: definitions,
9811
+ 'default': v2
9891
9812
  });
9892
9813
 
9893
- var Ajv$1 = ajv || _Ajv;
9894
- var ddl2Schema = _ddl2Schema;
9895
- var options = {
9896
- allErrors: false,
9897
- verbose: true,
9898
- jsonPointers: false
9899
- };
9900
- function doValidate(ddl, schema) {
9901
- var ajv = new Ajv$1(options);
9902
- var validate = ajv.compile(schema);
9903
- var success = validate(ddl);
9904
- return {
9905
- success: success,
9906
- errors: validate.errors
9907
- };
9908
- }
9909
- function validate2(ddl) {
9910
- return doValidate(ddl, _ddl2Schema);
9814
+ var Ajv = ajv || _Ajv;
9815
+ var ddl2Schema = _ddl2Schema;
9816
+ var options = {
9817
+ allErrors: false,
9818
+ verbose: true,
9819
+ jsonPointers: false
9820
+ };
9821
+ function doValidate(ddl, schema) {
9822
+ var ajv = new Ajv(options);
9823
+ var validate = ajv.compile(schema);
9824
+ var success = validate(ddl);
9825
+ return {
9826
+ success: success,
9827
+ errors: validate.errors
9828
+ };
9829
+ }
9830
+ function validate2(ddl) {
9831
+ return doValidate(ddl, _ddl2Schema);
9911
9832
  }
9912
9833
 
9913
- function isDDL2Schema(ref) {
9914
- return ref.version !== undefined && ref.datasources !== undefined && ref.dataviews !== undefined;
9834
+ function isDDL2Schema(ref) {
9835
+ return ref.version !== undefined && ref.datasources !== undefined && ref.dataviews !== undefined;
9915
9836
  }
9916
9837
 
9917
9838
  exports.BUILD_VERSION = BUILD_VERSION;
9918
9839
  exports.DDL1 = v1;
9919
- exports.DDL2 = v2;
9840
+ exports.DDL2 = v2$1;
9920
9841
  exports.PKG_NAME = PKG_NAME;
9921
9842
  exports.PKG_VERSION = PKG_VERSION;
9922
9843
  exports.ddl2Schema = ddl2Schema;
9923
9844
  exports.isDDL2Schema = isDDL2Schema;
9924
- exports.upgrade = upgrade$1;
9845
+ exports.upgrade = upgrade;
9925
9846
  exports.validate2 = validate2;
9926
9847
 
9927
9848
  Object.defineProperty(exports, '__esModule', { value: true });
9928
9849
 
9929
- })));
9850
+ }));
9930
9851
  //# sourceMappingURL=index.js.map