@holistics/cli-core 2.3.34 → 2.3.36

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.
Files changed (2) hide show
  1. package/dist/commands.js +55 -17
  2. package/package.json +1 -1
package/dist/commands.js CHANGED
@@ -27799,7 +27799,7 @@ var require_dist3 = __commonJS((exports2) => {
27799
27799
  exports2.default = deferred;
27800
27800
  });
27801
27801
  // package.json
27802
- var version = "2.3.34";
27802
+ var version = "2.3.36";
27803
27803
 
27804
27804
  // ../../node_modules/.pnpm/@commander-js+extra-typings@13.1.0_commander@13.1.0/node_modules/@commander-js/extra-typings/esm.mjs
27805
27805
  var import__ = __toESM(require_extra_typings(), 1);
@@ -44810,7 +44810,7 @@ var import_fast_glob = __toESM(require_out4(), 1);
44810
44810
  import fs12 from "fs";
44811
44811
  import path8 from "path";
44812
44812
 
44813
- // ../../node_modules/.pnpm/@holistics+aml@8.8.0/node_modules/@holistics/aml/dist/aml.es.js
44813
+ // ../../node_modules/.pnpm/@holistics+aml@8.8.1/node_modules/@holistics/aml/dist/aml.es.js
44814
44814
  var exports_aml_es = {};
44815
44815
  __export(exports_aml_es, {
44816
44816
  voidType: () => Zr,
@@ -45177,10 +45177,10 @@ __export(exports_aml_es, {
45177
45177
  AbstractSyntaxNode: () => fe
45178
45178
  });
45179
45179
 
45180
- // ../../node_modules/.pnpm/@holistics+aml@8.8.0/node_modules/@holistics/aml/dist/nativeAddon-EkCmNRMc.mjs
45180
+ // ../../node_modules/.pnpm/@holistics+aml@8.8.1/node_modules/@holistics/aml/dist/nativeAddon-EkCmNRMc.mjs
45181
45181
  import s from "node:path";
45182
45182
  import c2 from "node:fs";
45183
- var __dirname = "/home/circleci/holistics/node_modules/.pnpm/@holistics+aml@8.8.0/node_modules/@holistics/aml/dist";
45183
+ var __dirname = "/home/circleci/holistics/node_modules/.pnpm/@holistics+aml@8.8.1/node_modules/@holistics/aml/dist";
45184
45184
  var d = {
45185
45185
  globalModuleName: "::",
45186
45186
  languageExtension: "aml"
@@ -45314,10 +45314,10 @@ function j() {
45314
45314
  }
45315
45315
  }
45316
45316
 
45317
- // ../../node_modules/.pnpm/@holistics+aml@8.8.0/node_modules/@holistics/aml/dist/aml.es.js
45317
+ // ../../node_modules/.pnpm/@holistics+aml@8.8.1/node_modules/@holistics/aml/dist/aml.es.js
45318
45318
  import Rn from "fs";
45319
45319
  import _r from "path";
45320
- var Rd = "8.8.0";
45320
+ var Rd = "8.8.1";
45321
45321
  var gl = typeof global == "object" && global && global.Object === Object && global;
45322
45322
  var _d = typeof self == "object" && self && self.Object === Object && self;
45323
45323
  var Kt = gl || _d || Function("return this")();
@@ -148640,12 +148640,8 @@ function literalFor(e16, t, n) {
148640
148640
  if (t === null)
148641
148641
  return createNullLiteral();
148642
148642
  switch (e16.type) {
148643
- case SqlType.NUMBER: {
148644
- let r3 = typeof t == "number" ? t : Number(t);
148645
- if (typeof t == "boolean" || t === "" || !Number.isFinite(r3))
148646
- throw createQueryInputError(n, `Expected a number for \`${e16.name}\`, got ${JSON.stringify(t)}.`);
148647
- return createNumberLiteral(String(r3));
148648
- }
148643
+ case SqlType.NUMBER:
148644
+ return createNumberLiteral(numberDigits(e16, t, n));
148649
148645
  case SqlType.TRUEFALSE:
148650
148646
  if (t === true || t === "true")
148651
148647
  return createTruefalseLiteral(true);
@@ -148661,6 +148657,33 @@ function literalFor(e16, t, n) {
148661
148657
  return createTextLiteral(String(t));
148662
148658
  }
148663
148659
  }
148660
+ var JSON_NUMBER = /^(-?)(0|[1-9]\d*)(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/;
148661
+ function numberLiteralDigits(e16) {
148662
+ let t = JSON_NUMBER.exec(e16);
148663
+ if (!t)
148664
+ return;
148665
+ let [, n, r3, i = "", a] = t;
148666
+ if (a === undefined)
148667
+ return e16;
148668
+ let s3 = r3 + i;
148669
+ if (!/[1-9]/.test(s3))
148670
+ return "0";
148671
+ let c3 = Math.abs(Number(e16));
148672
+ if (c3 === Infinity || c3 === 0)
148673
+ return "out of range";
148674
+ let l3 = Number(a), u = r3.length + l3, f3, p3;
148675
+ return u <= 0 ? (f3 = "0", p3 = "0".repeat(-u) + s3) : u >= s3.length ? (f3 = s3 + "0".repeat(u - s3.length), p3 = "") : (f3 = s3.slice(0, u), p3 = s3.slice(u)), f3 = f3.replace(/^0+(?=\d)/, ""), p3 = p3.replace(/0+$/, ""), `${n}${f3}${p3 ? `.${p3}` : ""}`;
148676
+ }
148677
+ function numberDigits(e16, t, n) {
148678
+ if (typeof t == "number")
148679
+ throw createQueryInputError(n, `Expected a number for \`${e16.name}\` as a string, so it keeps every digit: send ${JSON.stringify(String(t))}, not ${t}.`);
148680
+ let r3 = typeof t == "string" ? numberLiteralDigits(t) : undefined;
148681
+ if (r3 === "out of range")
148682
+ throw createQueryInputError(n, `Expected a number for \`${e16.name}\` within a float's range, got ${JSON.stringify(t)}: write a number past it in full, without an exponent.`);
148683
+ if (r3 === undefined)
148684
+ throw createQueryInputError(n, `Expected a number for \`${e16.name}\`, got ${JSON.stringify(t)}.`);
148685
+ return r3;
148686
+ }
148664
148687
  var DATE_GRAINS = new Set([
148665
148688
  "year",
148666
148689
  "quarter",
@@ -148787,20 +148810,35 @@ function aliasOf(e16) {
148787
148810
  expr: e16
148788
148811
  };
148789
148812
  }
148813
+ function checkedType(e16, t) {
148814
+ let n = e16.getTypeFromNode(t);
148815
+ if (!(!n || isErrType(n))) {
148816
+ if (isFieldType(n))
148817
+ return n.type.sqlType;
148818
+ if (isScalarType(n))
148819
+ return n.sqlType;
148820
+ }
148821
+ }
148790
148822
  function describeColumns(e16, t) {
148791
- let n = parse(e16).exprs.filter((e17) => e17.kind === Kind.DYNAMIC_EXPLORE);
148823
+ let n = (typeof e16 == "string" ? parse(e16) : e16).exprs.filter((e17) => e17.kind === Kind.DYNAMIC_EXPLORE);
148792
148824
  if (n.length !== 1)
148793
148825
  return;
148794
- let [r3] = n, i = Array.isArray(r3.dimensions) ? r3.dimensions : [...r3.dimensions.rows, ...r3.dimensions.columns], a = [];
148826
+ let [r3] = n, i = Array.isArray(r3.dimensions) ? r3.dimensions : [...r3.dimensions.rows, ...r3.dimensions.columns], { checker: a } = t, s3 = (e17, t3) => {
148827
+ let n3 = a && checkedType(a, t3);
148828
+ return n3 ? {
148829
+ ...e17,
148830
+ type: n3
148831
+ } : e17;
148832
+ }, c3 = [];
148795
148833
  for (let e17 of i) {
148796
148834
  let n3 = aliasOf(e17);
148797
- n3 && a.push(describeDimension(n3.name, n3.expr, t.store));
148835
+ n3 && c3.push(s3(describeDimension(n3.name, n3.expr, t.store), e17));
148798
148836
  }
148799
148837
  for (let e17 of r3.measures) {
148800
148838
  let n3 = aliasOf(e17);
148801
- n3 && a.push(describeMeasure(n3.name, n3.expr, t.store));
148839
+ n3 && c3.push(s3(describeMeasure(n3.name, n3.expr, t.store), e17));
148802
148840
  }
148803
- return a;
148841
+ return c3;
148804
148842
  }
148805
148843
  var RUBY_SQL_GEN_URL = "http://localhost:6341";
148806
148844
  var rubySqlBackend = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@holistics/cli-core",
3
3
  "type": "module",
4
- "version": "2.3.34",
4
+ "version": "2.3.36",
5
5
  "bin": {
6
6
  "holistics": "./bin/holistics.js"
7
7
  },