@hpcc-js/ddl-shim 2.17.21 → 2.17.25

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/cli.js CHANGED
@@ -4,26 +4,6 @@
4
4
 
5
5
  var fs = require('fs');
6
6
 
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () { return e[k]; }
17
- });
18
- }
19
- });
20
- }
21
- n["default"] = e;
22
- return Object.freeze(n);
23
- }
24
-
25
- var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
26
-
27
7
  var $ref = "#/definitions/Schema";
28
8
  var $schema = "http://json-schema.org/draft-07/schema#";
29
9
  var definitions = {
@@ -1716,11 +1696,11 @@ function __spreadArray(to, from, pack) {
1716
1696
  ar[i] = from[i];
1717
1697
  }
1718
1698
  }
1719
- return to.concat(ar || Array.prototype.slice.call(from));
1699
+ return to.concat(ar || from);
1720
1700
  }
1721
1701
 
1722
1702
  var PKG_NAME = "@hpcc-js/ddl-shim";
1723
- var PKG_VERSION = "2.17.21";
1703
+ var PKG_VERSION = "2.17.25";
1724
1704
 
1725
1705
  function isWorkunitDatasource(ref) {
1726
1706
  return ref.WUID !== undefined;
@@ -1970,7 +1950,7 @@ function apply_to_properties_layout(ddl2, dermObj) {
1970
1950
  });
1971
1951
  return retVal;
1972
1952
  }
1973
- function upgrade$1(ddl2, dermObj) {
1953
+ function upgrade(ddl2, dermObj) {
1974
1954
  apply_to_dataviews(ddl2, dermObj);
1975
1955
  return apply_to_properties_layout(ddl2, dermObj);
1976
1956
  }
@@ -2190,7 +2170,7 @@ var DDLUpgrade = /** @class */ (function () {
2190
2170
  break;
2191
2171
  default:
2192
2172
  groupByColumns.push(this.toLowerCase(field.id));
2193
- throw new Error("Unhandled field function: ".concat(field.properties.function));
2173
+ throw new Error("Unhandled field function: " + field.properties.function);
2194
2174
  }
2195
2175
  }
2196
2176
  else {
@@ -2201,7 +2181,7 @@ var DDLUpgrade = /** @class */ (function () {
2201
2181
  this._ddl2DataviewActivities[viz.id].project.transformations = projectTransformations;
2202
2182
  }
2203
2183
  if (aggrFields.length) {
2204
- this._ddl2DataviewActivities[viz.id].groupBy.groupByIDs = __spreadArray([], groupByColumns, true);
2184
+ this._ddl2DataviewActivities[viz.id].groupBy.groupByIDs = __spreadArray([], groupByColumns);
2205
2185
  this._ddl2DataviewActivities[viz.id].groupBy.aggregates = aggrFields;
2206
2186
  }
2207
2187
  }
@@ -2219,7 +2199,7 @@ var DDLUpgrade = /** @class */ (function () {
2219
2199
  case "MAX":
2220
2200
  return "max";
2221
2201
  }
2222
- throw new Error("Unknown DDL1 Function Type: ".concat(func));
2202
+ throw new Error("Unknown DDL1 Function Type: " + func);
2223
2203
  };
2224
2204
  DDLUpgrade.prototype.readMappings = function () {
2225
2205
  for (var _i = 0, _a = this._ddl.dashboards; _i < _a.length; _i++) {
@@ -2246,7 +2226,7 @@ var DDLUpgrade = /** @class */ (function () {
2246
2226
  this.readSliderMappings(viz);
2247
2227
  }
2248
2228
  else {
2249
- throw new Error("Unkown DDL1 mapping type: ".concat(viz.type));
2229
+ throw new Error("Unkown DDL1 mapping type: " + viz.type);
2250
2230
  }
2251
2231
  }
2252
2232
  }
@@ -2361,7 +2341,7 @@ var DDLUpgrade = /** @class */ (function () {
2361
2341
  var flag = _a[_i];
2362
2342
  if (flag.fieldid) {
2363
2343
  mappings.transformations.push({
2364
- fieldID: "annotation_".concat(idx++),
2344
+ fieldID: "annotation_" + idx++,
2365
2345
  type: "map",
2366
2346
  sourceFieldID: this.toLowerCase(flag.fieldid),
2367
2347
  default: {},
@@ -2420,7 +2400,7 @@ var DDLUpgrade = /** @class */ (function () {
2420
2400
  var mapping = update.mappings[key];
2421
2401
  var dsFilter = (mapping && dsFilters[mapping]) ? dsFilters[mapping].filter : undefined;
2422
2402
  if (!dsFilter) {
2423
- console.warn("Select Mapping \"".concat(mapping, "\" in viz \"").concat(viz.id, "\" not found in filters for \"").concat(otherViz.id, "\""));
2403
+ console.warn("Select Mapping \"" + mapping + "\" in viz \"" + viz.id + "\" not found in filters for \"" + otherViz.id + "\"");
2424
2404
  }
2425
2405
  else {
2426
2406
  condition.mappings.push({
@@ -2671,12 +2651,12 @@ var DDLUpgrade = /** @class */ (function () {
2671
2651
  };
2672
2652
  return DDLUpgrade;
2673
2653
  }());
2674
- function upgrade(ddl, baseUrl, wuid, toLowerCase, dermatologyJson) {
2654
+ function upgrade$1(ddl, baseUrl, wuid, toLowerCase, dermatologyJson) {
2675
2655
  if (toLowerCase === void 0) { toLowerCase = true; }
2676
2656
  if (dermatologyJson === void 0) { dermatologyJson = {}; }
2677
2657
  var ddlUp = new DDLUpgrade(ddl, baseUrl, wuid, toLowerCase);
2678
2658
  var retVal = ddlUp.write();
2679
- retVal.properties = upgrade$1(retVal, dermatologyJson);
2659
+ retVal.properties = upgrade(retVal, dermatologyJson);
2680
2660
  return retVal;
2681
2661
  }
2682
2662
 
@@ -2699,17 +2679,17 @@ switch (args[0]) {
2699
2679
  var layoutJson_1 = {};
2700
2680
  if (layoutPath) {
2701
2681
  try {
2702
- layoutJson_1 = JSON.parse(fs__namespace.readFileSync(layoutPath).toString());
2682
+ layoutJson_1 = JSON.parse(fs.readFileSync(layoutPath).toString());
2703
2683
  }
2704
2684
  catch (e) {
2705
2685
  console.error(e);
2706
2686
  }
2707
2687
  }
2708
- fs__namespace.readFile(srcPath, "utf8", function (err, data) {
2688
+ fs.readFile(srcPath, "utf8", function (err, data) {
2709
2689
  if (err)
2710
2690
  throw err;
2711
- var ddl2 = upgrade(JSON.parse(data), baseUrl_1 || "http://localhost:8010", wuid_1 || "WUID", args[0] === "--upgrade", layoutJson_1);
2712
- fs__namespace.writeFile(destPath_1, JSON.stringify(ddl2), function (err) {
2691
+ var ddl2 = upgrade$1(JSON.parse(data), baseUrl_1 || "http://localhost:8010", wuid_1 || "WUID", args[0] === "--upgrade", layoutJson_1);
2692
+ fs.writeFile(destPath_1, JSON.stringify(ddl2), function (err) {
2713
2693
  if (err)
2714
2694
  throw err;
2715
2695
  console.log("complete");