@holistics/cli-core 2.3.30 → 2.3.31
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/commands.js +915 -81
- 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.
|
|
27802
|
+
var version = "2.3.31";
|
|
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);
|
|
@@ -147904,6 +147904,840 @@ function _transform(e16, t) {
|
|
|
147904
147904
|
}
|
|
147905
147905
|
}
|
|
147906
147906
|
var transform = Rr3.wrapFuncWithinActiveSpan(_transform);
|
|
147907
|
+
var DEFAULT_WIDTH = 80;
|
|
147908
|
+
var NIL = { t: "nil" };
|
|
147909
|
+
var text = (e16) => ({
|
|
147910
|
+
t: "text",
|
|
147911
|
+
s: e16
|
|
147912
|
+
});
|
|
147913
|
+
var line = {
|
|
147914
|
+
t: "line",
|
|
147915
|
+
flat: " "
|
|
147916
|
+
};
|
|
147917
|
+
var softline = {
|
|
147918
|
+
t: "line",
|
|
147919
|
+
flat: ""
|
|
147920
|
+
};
|
|
147921
|
+
var hardline = { t: "hard" };
|
|
147922
|
+
var nest = (e16, t) => ({
|
|
147923
|
+
t: "nest",
|
|
147924
|
+
n: e16,
|
|
147925
|
+
d: t
|
|
147926
|
+
});
|
|
147927
|
+
var group = (e16) => ({
|
|
147928
|
+
t: "group",
|
|
147929
|
+
d: e16
|
|
147930
|
+
});
|
|
147931
|
+
function cat(...e16) {
|
|
147932
|
+
return e16.reduce((e17, t) => ({
|
|
147933
|
+
t: "cat",
|
|
147934
|
+
a: e17,
|
|
147935
|
+
b: t
|
|
147936
|
+
}), NIL);
|
|
147937
|
+
}
|
|
147938
|
+
function join(e16, t) {
|
|
147939
|
+
return t.length === 0 ? NIL : t.reduce((t3, n, r3) => r3 === 0 ? n : cat(t3, e16, n));
|
|
147940
|
+
}
|
|
147941
|
+
function fits(e16, t) {
|
|
147942
|
+
let n = e16, r3 = t.slice();
|
|
147943
|
+
for (;n >= 0; ) {
|
|
147944
|
+
let e17 = r3.pop();
|
|
147945
|
+
if (!e17)
|
|
147946
|
+
return true;
|
|
147947
|
+
let [t3, i, a] = e17;
|
|
147948
|
+
switch (a.t) {
|
|
147949
|
+
case "nil":
|
|
147950
|
+
break;
|
|
147951
|
+
case "text":
|
|
147952
|
+
n -= a.s.length;
|
|
147953
|
+
break;
|
|
147954
|
+
case "cat":
|
|
147955
|
+
r3.push([
|
|
147956
|
+
t3,
|
|
147957
|
+
i,
|
|
147958
|
+
a.b
|
|
147959
|
+
], [
|
|
147960
|
+
t3,
|
|
147961
|
+
i,
|
|
147962
|
+
a.a
|
|
147963
|
+
]);
|
|
147964
|
+
break;
|
|
147965
|
+
case "nest":
|
|
147966
|
+
r3.push([
|
|
147967
|
+
t3 + a.n,
|
|
147968
|
+
i,
|
|
147969
|
+
a.d
|
|
147970
|
+
]);
|
|
147971
|
+
break;
|
|
147972
|
+
case "group":
|
|
147973
|
+
r3.push([
|
|
147974
|
+
t3,
|
|
147975
|
+
"flat",
|
|
147976
|
+
a.d
|
|
147977
|
+
]);
|
|
147978
|
+
break;
|
|
147979
|
+
case "hard":
|
|
147980
|
+
return false;
|
|
147981
|
+
case "line":
|
|
147982
|
+
if (i === "flat") {
|
|
147983
|
+
n -= a.flat.length;
|
|
147984
|
+
break;
|
|
147985
|
+
}
|
|
147986
|
+
return true;
|
|
147987
|
+
default:
|
|
147988
|
+
break;
|
|
147989
|
+
}
|
|
147990
|
+
}
|
|
147991
|
+
return false;
|
|
147992
|
+
}
|
|
147993
|
+
function render(e16, t) {
|
|
147994
|
+
let n = "", r3 = 0, i = [[
|
|
147995
|
+
0,
|
|
147996
|
+
"break",
|
|
147997
|
+
t
|
|
147998
|
+
]];
|
|
147999
|
+
for (;i.length; ) {
|
|
148000
|
+
let [t3, a, s3] = i.pop();
|
|
148001
|
+
switch (s3.t) {
|
|
148002
|
+
case "nil":
|
|
148003
|
+
break;
|
|
148004
|
+
case "text":
|
|
148005
|
+
n += s3.s, r3 += s3.s.length;
|
|
148006
|
+
break;
|
|
148007
|
+
case "cat":
|
|
148008
|
+
i.push([
|
|
148009
|
+
t3,
|
|
148010
|
+
a,
|
|
148011
|
+
s3.b
|
|
148012
|
+
], [
|
|
148013
|
+
t3,
|
|
148014
|
+
a,
|
|
148015
|
+
s3.a
|
|
148016
|
+
]);
|
|
148017
|
+
break;
|
|
148018
|
+
case "nest":
|
|
148019
|
+
i.push([
|
|
148020
|
+
t3 + s3.n,
|
|
148021
|
+
a,
|
|
148022
|
+
s3.d
|
|
148023
|
+
]);
|
|
148024
|
+
break;
|
|
148025
|
+
case "hard":
|
|
148026
|
+
n += `
|
|
148027
|
+
${" ".repeat(t3)}`, r3 = t3;
|
|
148028
|
+
break;
|
|
148029
|
+
case "line":
|
|
148030
|
+
a === "flat" ? (n += s3.flat, r3 += s3.flat.length) : (n += `
|
|
148031
|
+
${" ".repeat(t3)}`, r3 = t3);
|
|
148032
|
+
break;
|
|
148033
|
+
case "group": {
|
|
148034
|
+
let n3 = [
|
|
148035
|
+
t3,
|
|
148036
|
+
"flat",
|
|
148037
|
+
s3.d
|
|
148038
|
+
];
|
|
148039
|
+
i.push(fits(e16 - r3, [n3]) ? n3 : [
|
|
148040
|
+
t3,
|
|
148041
|
+
"break",
|
|
148042
|
+
s3.d
|
|
148043
|
+
]);
|
|
148044
|
+
break;
|
|
148045
|
+
}
|
|
148046
|
+
default:
|
|
148047
|
+
break;
|
|
148048
|
+
}
|
|
148049
|
+
}
|
|
148050
|
+
return n;
|
|
148051
|
+
}
|
|
148052
|
+
var INFIX_PREC = {
|
|
148053
|
+
[Kind.OR_KEYWORD]: 3,
|
|
148054
|
+
[Kind.AND_KEYWORD]: 4,
|
|
148055
|
+
[Kind.EQUAL_EQUAL]: 5,
|
|
148056
|
+
[Kind.EXCLAMATION_EQUAL]: 5,
|
|
148057
|
+
[Kind.IS_KEYWORD]: 5,
|
|
148058
|
+
[Kind.IN_KEYWORD]: 5,
|
|
148059
|
+
[Kind.MATCH_KEYWORD]: 5,
|
|
148060
|
+
[Kind.MATCHES_KEYWORD]: 5,
|
|
148061
|
+
[Kind.LIKE_KEYWORD]: 5,
|
|
148062
|
+
[Kind.ILIKE_KEYWORD]: 5,
|
|
148063
|
+
[Kind.LESS_THAN]: 7,
|
|
148064
|
+
[Kind.LESS_THAN_EQUAL]: 7,
|
|
148065
|
+
[Kind.GREATER_THAN]: 7,
|
|
148066
|
+
[Kind.GREATER_THAN_EQUAL]: 7,
|
|
148067
|
+
[Kind.BAR]: 9,
|
|
148068
|
+
[Kind.PLUS]: 10,
|
|
148069
|
+
[Kind.MINUS]: 10,
|
|
148070
|
+
[Kind.STAR]: 12,
|
|
148071
|
+
[Kind.SLASH]: 12
|
|
148072
|
+
};
|
|
148073
|
+
var PREFIX_PREC = 14;
|
|
148074
|
+
function precOf(e16) {
|
|
148075
|
+
switch (e16.kind) {
|
|
148076
|
+
case Kind.INFIX_EXPRESSION:
|
|
148077
|
+
return INFIX_PREC[e16.operator.kind] ?? 0;
|
|
148078
|
+
case Kind.PIPE_EXPRESSION:
|
|
148079
|
+
return INFIX_PREC[Kind.BAR];
|
|
148080
|
+
case Kind.PREFIX_EXPRESSION:
|
|
148081
|
+
return PREFIX_PREC;
|
|
148082
|
+
default:
|
|
148083
|
+
return Infinity;
|
|
148084
|
+
}
|
|
148085
|
+
}
|
|
148086
|
+
function opNot(e16) {
|
|
148087
|
+
return e16.not === true;
|
|
148088
|
+
}
|
|
148089
|
+
function infixOpText(e16) {
|
|
148090
|
+
let t = opNot(e16);
|
|
148091
|
+
switch (e16.kind) {
|
|
148092
|
+
case Kind.PLUS:
|
|
148093
|
+
return "+";
|
|
148094
|
+
case Kind.MINUS:
|
|
148095
|
+
return "-";
|
|
148096
|
+
case Kind.STAR:
|
|
148097
|
+
return "*";
|
|
148098
|
+
case Kind.SLASH:
|
|
148099
|
+
return "/";
|
|
148100
|
+
case Kind.EQUAL_EQUAL:
|
|
148101
|
+
return "==";
|
|
148102
|
+
case Kind.EXCLAMATION_EQUAL:
|
|
148103
|
+
return "!=";
|
|
148104
|
+
case Kind.GREATER_THAN:
|
|
148105
|
+
return ">";
|
|
148106
|
+
case Kind.GREATER_THAN_EQUAL:
|
|
148107
|
+
return ">=";
|
|
148108
|
+
case Kind.LESS_THAN:
|
|
148109
|
+
return "<";
|
|
148110
|
+
case Kind.LESS_THAN_EQUAL:
|
|
148111
|
+
return "<=";
|
|
148112
|
+
case Kind.AND_KEYWORD:
|
|
148113
|
+
return "and";
|
|
148114
|
+
case Kind.OR_KEYWORD:
|
|
148115
|
+
return "or";
|
|
148116
|
+
case Kind.IS_KEYWORD:
|
|
148117
|
+
return t ? "is not" : "is";
|
|
148118
|
+
case Kind.IN_KEYWORD:
|
|
148119
|
+
return t ? "not in" : "in";
|
|
148120
|
+
case Kind.LIKE_KEYWORD:
|
|
148121
|
+
return t ? "not like" : "like";
|
|
148122
|
+
case Kind.ILIKE_KEYWORD:
|
|
148123
|
+
return t ? "not ilike" : "ilike";
|
|
148124
|
+
case Kind.MATCH_KEYWORD:
|
|
148125
|
+
return "match";
|
|
148126
|
+
case Kind.MATCHES_KEYWORD:
|
|
148127
|
+
return "matches";
|
|
148128
|
+
case Kind.BAR:
|
|
148129
|
+
return "|";
|
|
148130
|
+
default:
|
|
148131
|
+
return String(e16.kind);
|
|
148132
|
+
}
|
|
148133
|
+
}
|
|
148134
|
+
var parens = (e16) => group(cat(text("("), nest(2, cat(softline, e16)), softline, text(")")));
|
|
148135
|
+
function operandDoc(e16, t, n) {
|
|
148136
|
+
let r3 = precOf(e16), i = n ? r3 <= t : r3 < t, a = docOf(e16);
|
|
148137
|
+
return i ? parens(a) : a;
|
|
148138
|
+
}
|
|
148139
|
+
function flattenLogical(e16, t) {
|
|
148140
|
+
if (e16.kind === Kind.INFIX_EXPRESSION) {
|
|
148141
|
+
let n = e16;
|
|
148142
|
+
if (n.operator.kind === t && !opNot(n.operator))
|
|
148143
|
+
return [...flattenLogical(n.left, t), n.right];
|
|
148144
|
+
}
|
|
148145
|
+
return [e16];
|
|
148146
|
+
}
|
|
148147
|
+
function infixDoc(e16) {
|
|
148148
|
+
let t = e16.operator.kind, n = INFIX_PREC[t] ?? 0;
|
|
148149
|
+
if ((t === Kind.AND_KEYWORD || t === Kind.OR_KEYWORD) && !opNot(e16.operator)) {
|
|
148150
|
+
let r4 = infixOpText(e16.operator), i3 = flattenLogical(e16, t), a = operandDoc(i3[0], n, false);
|
|
148151
|
+
for (let e17 = 1;e17 < i3.length; e17++)
|
|
148152
|
+
a = cat(a, line, text(`${r4} `), operandDoc(i3[e17], n, true));
|
|
148153
|
+
return group(a);
|
|
148154
|
+
}
|
|
148155
|
+
let r3 = operandDoc(e16.left, n, false), i = operandDoc(e16.right, n, true);
|
|
148156
|
+
return group(cat(r3, text(` ${infixOpText(e16.operator)}`), nest(2, cat(line, i))));
|
|
148157
|
+
}
|
|
148158
|
+
function prefixDoc(e16) {
|
|
148159
|
+
let t = precOf(e16.right) < PREFIX_PREC || e16.right.kind === Kind.PREFIX_EXPRESSION ? parens(docOf(e16.right)) : docOf(e16.right);
|
|
148160
|
+
return e16.operator.kind === Kind.NOT_KEYWORD ? cat(text("not "), t) : cat(text(e16.operator.kind === Kind.MINUS ? "-" : "!"), t);
|
|
148161
|
+
}
|
|
148162
|
+
function collectPipe(e16) {
|
|
148163
|
+
if (e16.kind === Kind.PIPE_EXPRESSION) {
|
|
148164
|
+
let t = e16, n = collectPipe(t.left);
|
|
148165
|
+
return {
|
|
148166
|
+
head: n.head,
|
|
148167
|
+
stages: [...n.stages, t.right]
|
|
148168
|
+
};
|
|
148169
|
+
}
|
|
148170
|
+
return {
|
|
148171
|
+
head: e16,
|
|
148172
|
+
stages: []
|
|
148173
|
+
};
|
|
148174
|
+
}
|
|
148175
|
+
function pipeDoc(e16) {
|
|
148176
|
+
let { head: t, stages: n } = collectPipe(e16), r3 = INFIX_PREC[Kind.BAR], i = precOf(t) < r3 ? parens(docOf(t)) : docOf(t);
|
|
148177
|
+
for (let e17 of n)
|
|
148178
|
+
i = cat(i, text(" |"), line, docOf(e17));
|
|
148179
|
+
return group(i);
|
|
148180
|
+
}
|
|
148181
|
+
function identDoc(e16) {
|
|
148182
|
+
return text((e16.fromGlobal ? "::" : "") + e16.value);
|
|
148183
|
+
}
|
|
148184
|
+
function callDoc(e16, t) {
|
|
148185
|
+
return t.length === 0 ? text(`${e16}()`) : group(cat(text(`${e16}(`), nest(2, cat(softline, join(cat(text(","), line), t))), softline, text(")")));
|
|
148186
|
+
}
|
|
148187
|
+
function listDoc(e16, t, n) {
|
|
148188
|
+
return n.length === 0 ? text(e16 + t) : group(cat(text(e16), nest(2, cat(softline, join(cat(text(","), line), n))), softline, text(t)));
|
|
148189
|
+
}
|
|
148190
|
+
function sectionBlock(e16, t) {
|
|
148191
|
+
return t.length === 0 ? text(`${e16} {}`) : group(cat(text(`${e16} {`), nest(2, cat(line, join(cat(text(","), line), t))), line, text("}")));
|
|
148192
|
+
}
|
|
148193
|
+
function nestedBlock(e16, t) {
|
|
148194
|
+
return group(cat(text(`${e16} {`), nest(2, cat(line, join(line, t))), line, text("}")));
|
|
148195
|
+
}
|
|
148196
|
+
function exploreDoc(e16) {
|
|
148197
|
+
let t = [], n = e16.dimensions;
|
|
148198
|
+
if (Array.isArray(n))
|
|
148199
|
+
n.length && t.push(sectionBlock("dimensions", n.map(docOf)));
|
|
148200
|
+
else {
|
|
148201
|
+
let e17 = n;
|
|
148202
|
+
t.push(nestedBlock("dimensions", [sectionBlock("rows", e17.rows.map(docOf)), sectionBlock("columns", e17.columns.map(docOf))]));
|
|
148203
|
+
}
|
|
148204
|
+
return e16.measures.length && t.push(sectionBlock("measures", e16.measures.map(docOf))), e16.filters.length && t.push(sectionBlock("filters", e16.filters.map(docOf))), e16.having.length && t.push(sectionBlock("having", e16.having.map(docOf))), e16.relationships.length && t.push(sectionBlock("relationships", e16.relationships.map(docOf))), e16.options.length && t.push(sectionBlock("options", e16.options.map(docOf))), e16.params.length && t.push(sectionBlock("params", e16.params.map(docOf))), e16.sorts.length && t.push(sectionBlock("sorts", e16.sorts.map(sortDoc))), t.length === 0 && t.push(text("dimensions {}")), group(cat(text("explore {"), nest(2, cat(line, join(line, t))), line, text("}")));
|
|
148205
|
+
}
|
|
148206
|
+
function sortDoc([e16, t]) {
|
|
148207
|
+
return text(`${e16.value} ${t.toLowerCase()}`);
|
|
148208
|
+
}
|
|
148209
|
+
function paramInputDoc(e16) {
|
|
148210
|
+
let t = [docOf(e16.field), text(e16.operator.value)];
|
|
148211
|
+
return e16.values && t.push(docOf(e16.values)), e16.modifier && t.push(docOf(e16.modifier)), group(join(line, t));
|
|
148212
|
+
}
|
|
148213
|
+
function quote(e16) {
|
|
148214
|
+
return `'${e16.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t").replace(/\f/g, "\\f").replace(/[\b]/g, "\\b")}'`;
|
|
148215
|
+
}
|
|
148216
|
+
var BARE_WORD = /^[a-zA-Z]+$/;
|
|
148217
|
+
var BARE_DATETIME = /^\d{4}(-\d{2}){0,2}( \d{2}:\d{2}(:\d{2})?)?( - \d{4}(-\d{2}){0,2}( \d{2}:\d{2}(:\d{2})?)?)?$/;
|
|
148218
|
+
function datetimeText(e16) {
|
|
148219
|
+
return BARE_WORD.test(e16) || BARE_DATETIME.test(e16) ? `@${e16}` : `@(${e16})`;
|
|
148220
|
+
}
|
|
148221
|
+
function deriveBlockDoc(e16) {
|
|
148222
|
+
let t = e16.exprs.map(docOf);
|
|
148223
|
+
return group(cat(text("derive {"), nest(2, cat(line, join(cat(text(";"), line), t))), line, text("}")));
|
|
148224
|
+
}
|
|
148225
|
+
function docOf(e16) {
|
|
148226
|
+
switch (e16.kind) {
|
|
148227
|
+
case Kind.PROGRAM:
|
|
148228
|
+
return deriveBlockDoc(e16);
|
|
148229
|
+
case Kind.IDENTIFIER:
|
|
148230
|
+
return identDoc(e16);
|
|
148231
|
+
case Kind.DOT_EXPRESSION: {
|
|
148232
|
+
let t = e16;
|
|
148233
|
+
return cat(docOf(t.left), text("."), identDoc(t.right));
|
|
148234
|
+
}
|
|
148235
|
+
case Kind.FUNCTION_CALL: {
|
|
148236
|
+
let t = e16;
|
|
148237
|
+
return callDoc(t.name.value, t.args.map(docOf));
|
|
148238
|
+
}
|
|
148239
|
+
case Kind.PIPE_EXPRESSION:
|
|
148240
|
+
return pipeDoc(e16);
|
|
148241
|
+
case Kind.NAMED_EXPRESSION: {
|
|
148242
|
+
let t = e16;
|
|
148243
|
+
return cat(text(`${t.name.value}: `), docOf(t.expr));
|
|
148244
|
+
}
|
|
148245
|
+
case Kind.INFIX_EXPRESSION:
|
|
148246
|
+
return infixDoc(e16);
|
|
148247
|
+
case Kind.PREFIX_EXPRESSION:
|
|
148248
|
+
return prefixDoc(e16);
|
|
148249
|
+
case Kind.BIZ_CAL: {
|
|
148250
|
+
let t = e16;
|
|
148251
|
+
return cat(text(`[${t.name.value}]: `), docOf(t.expr));
|
|
148252
|
+
}
|
|
148253
|
+
case Kind.BIZ_CAL_REF:
|
|
148254
|
+
return text(`[${e16.value}]`);
|
|
148255
|
+
case Kind.GROUPING_SET:
|
|
148256
|
+
return listDoc("(", ")", e16.groupingSet.map(docOf));
|
|
148257
|
+
case Kind.ROW:
|
|
148258
|
+
return listDoc("{", "}", e16.columns.map(docOf));
|
|
148259
|
+
case Kind.FIELD_DECLARATION: {
|
|
148260
|
+
let t = e16;
|
|
148261
|
+
return group(cat(text(`${t.type} `), docOf(t.name), text(" ="), nest(2, cat(line, docOf(t.expr)))));
|
|
148262
|
+
}
|
|
148263
|
+
case Kind.DYNAMIC_EXPLORE:
|
|
148264
|
+
return exploreDoc(e16);
|
|
148265
|
+
case Kind.PARAM_INPUT:
|
|
148266
|
+
return paramInputDoc(e16);
|
|
148267
|
+
case Kind.NUMBER_LITERAL:
|
|
148268
|
+
return text(e16.value);
|
|
148269
|
+
case Kind.TEXT_LITERAL:
|
|
148270
|
+
return text(quote(e16.value));
|
|
148271
|
+
case Kind.TRUEFALSE_LITERAL:
|
|
148272
|
+
return text(e16.value ? "true" : "false");
|
|
148273
|
+
case Kind.NULL_LITERAL:
|
|
148274
|
+
return text("null");
|
|
148275
|
+
case Kind.DATETIME_LITERAL:
|
|
148276
|
+
return text(datetimeText(e16.value));
|
|
148277
|
+
case Kind.INTERVAL: {
|
|
148278
|
+
let t = e16;
|
|
148279
|
+
return cat(text("interval("), docOf(t.value), text(` ${t.unit})`));
|
|
148280
|
+
}
|
|
148281
|
+
case Kind.RANGE_LITERAL: {
|
|
148282
|
+
let t = e16;
|
|
148283
|
+
return text(`${t.start ?? ""}..${t.end ?? ""}`);
|
|
148284
|
+
}
|
|
148285
|
+
case Kind.TABLE_LITERAL:
|
|
148286
|
+
return listDoc("[", "]", e16.rows.map((e17) => docOf(e17[0])));
|
|
148287
|
+
default:
|
|
148288
|
+
return text(e16.loc?.source ?? "");
|
|
148289
|
+
}
|
|
148290
|
+
}
|
|
148291
|
+
function printProgram(e16, t = DEFAULT_WIDTH) {
|
|
148292
|
+
return render(t, join(cat(text(";"), hardline), e16.exprs.map(docOf)));
|
|
148293
|
+
}
|
|
148294
|
+
function formatAql(e16, t = DEFAULT_WIDTH) {
|
|
148295
|
+
if (!e16.trim())
|
|
148296
|
+
return e16;
|
|
148297
|
+
try {
|
|
148298
|
+
return printProgram(parse(e16), t);
|
|
148299
|
+
} catch {
|
|
148300
|
+
return e16;
|
|
148301
|
+
}
|
|
148302
|
+
}
|
|
148303
|
+
function createQueryInputError(e16, t) {
|
|
148304
|
+
let n = Error(e16 ? `${e16}: ${t}` : t);
|
|
148305
|
+
return n.name = "QueryInputError", n.path = e16, n;
|
|
148306
|
+
}
|
|
148307
|
+
function isQueryInputError(e16) {
|
|
148308
|
+
return e16 instanceof Error && e16.name === "QueryInputError";
|
|
148309
|
+
}
|
|
148310
|
+
function applyQueryInput(e16, t, n) {
|
|
148311
|
+
return printProgram(applyQueryInputToProgram(parse(e16), t, n));
|
|
148312
|
+
}
|
|
148313
|
+
function isEmpty$1(e16) {
|
|
148314
|
+
return !e16.filters?.length && !e16.conditions?.length && !e16.sorts?.length && !e16.dateDrills?.length;
|
|
148315
|
+
}
|
|
148316
|
+
function applyQueryInputToProgram(e16, t, n) {
|
|
148317
|
+
if (isEmpty$1(t))
|
|
148318
|
+
return e16;
|
|
148319
|
+
let r3 = e16.exprs.filter((e17) => e17.kind === Kind.DYNAMIC_EXPLORE);
|
|
148320
|
+
if (r3.length !== 1)
|
|
148321
|
+
throw createQueryInputError("", "Query Input can only be applied to a query with exactly one `explore { }` block.");
|
|
148322
|
+
let [i] = r3, a = [], s3 = [];
|
|
148323
|
+
(t.filters ?? []).forEach((e17, t3) => {
|
|
148324
|
+
let { conditions: r4, aggregate: i3 } = filterToConditions(e17, `filters[${t3}]`, n);
|
|
148325
|
+
(i3 ? s3 : a).push(...r4);
|
|
148326
|
+
}), (t.conditions ?? []).forEach((e17, t3) => a.push(parseCondition(e17, `conditions[${t3}]`)));
|
|
148327
|
+
let c3 = createDynamicExplore((t.dateDrills ?? []).reduce((e17, t3, n3) => applyDateDrill(e17, t3, `dateDrills[${n3}]`), i.dimensions), i.measures, [...i.filters, ...a], [...i.having, ...s3], i.relationships, i.options, i.params, t.sorts?.length ? toSorts(t.sorts, i) : i.sorts, i.loc);
|
|
148328
|
+
return createProgram(e16.exprs.map((e17) => e17 === i ? c3 : e17), e16.loc);
|
|
148329
|
+
}
|
|
148330
|
+
function parseCondition(e16, t) {
|
|
148331
|
+
let n = e16?.expr;
|
|
148332
|
+
if (typeof n != "string" || !n.trim())
|
|
148333
|
+
throw createQueryInputError(`${t}.expr`, "Expected an AQL condition.");
|
|
148334
|
+
let r3;
|
|
148335
|
+
try {
|
|
148336
|
+
r3 = parse(n);
|
|
148337
|
+
} catch (e17) {
|
|
148338
|
+
throw createQueryInputError(`${t}.expr`, `Invalid AQL condition: ${e17.message}`);
|
|
148339
|
+
}
|
|
148340
|
+
let [i] = r3.exprs;
|
|
148341
|
+
if (r3.exprs.length !== 1 || i.kind === Kind.DYNAMIC_EXPLORE || i.kind === Kind.FIELD_DECLARATION)
|
|
148342
|
+
throw createQueryInputError(`${t}.expr`, "Expected a single AQL condition, not a query or declaration.");
|
|
148343
|
+
return i;
|
|
148344
|
+
}
|
|
148345
|
+
function outputAliases(e16) {
|
|
148346
|
+
let t = Array.isArray(e16.dimensions) ? e16.dimensions : [...e16.dimensions.rows, ...e16.dimensions.columns], n = /* @__PURE__ */ new Set;
|
|
148347
|
+
for (let r3 of [...t, ...e16.measures])
|
|
148348
|
+
r3.kind === Kind.NAMED_EXPRESSION && n.add(r3.name.value);
|
|
148349
|
+
return n;
|
|
148350
|
+
}
|
|
148351
|
+
function toSorts(e16, t) {
|
|
148352
|
+
let n = outputAliases(t);
|
|
148353
|
+
return e16.map(({ field: e17, direction: t3 }, r3) => {
|
|
148354
|
+
if (!n.has(e17)) {
|
|
148355
|
+
let t4 = [...n].map((e18) => `\`${e18}\``).join(", ") || "none";
|
|
148356
|
+
throw createQueryInputError(`sorts[${r3}].field`, `Unknown sort field \`${e17}\`: expected an output alias of the query (${t4}).`);
|
|
148357
|
+
}
|
|
148358
|
+
let i = typeof t3 == "string" ? t3.toLowerCase() : t3;
|
|
148359
|
+
if (i !== "asc" && i !== "desc")
|
|
148360
|
+
throw createQueryInputError(`sorts[${r3}].direction`, `Expected \`asc\` or \`desc\`, got ${JSON.stringify(t3)}.`);
|
|
148361
|
+
return [createIdentifier(e17), i === "asc" ? OrderDirection.ASC : OrderDirection.DESC];
|
|
148362
|
+
});
|
|
148363
|
+
}
|
|
148364
|
+
var DRILL_GRAINS = new Set([
|
|
148365
|
+
"year",
|
|
148366
|
+
"quarter",
|
|
148367
|
+
"month",
|
|
148368
|
+
"week",
|
|
148369
|
+
"day",
|
|
148370
|
+
"hour",
|
|
148371
|
+
"minute"
|
|
148372
|
+
]);
|
|
148373
|
+
function dottedName$1(e16) {
|
|
148374
|
+
if (e16.kind === Kind.IDENTIFIER)
|
|
148375
|
+
return e16.value;
|
|
148376
|
+
if (e16.kind !== Kind.DOT_EXPRESSION)
|
|
148377
|
+
return;
|
|
148378
|
+
let t = e16, n = dottedName$1(t.left);
|
|
148379
|
+
return n === undefined ? undefined : `${n}.${t.right.value}`;
|
|
148380
|
+
}
|
|
148381
|
+
function drilledField(e16) {
|
|
148382
|
+
if (e16.kind === Kind.DOT_EXPRESSION)
|
|
148383
|
+
return e16;
|
|
148384
|
+
if (e16.kind === Kind.FUNCTION_CALL) {
|
|
148385
|
+
let t = e16;
|
|
148386
|
+
if (t.name.value === "date_trunc" && t.args.length === 2 && t.args[0].kind === Kind.DOT_EXPRESSION)
|
|
148387
|
+
return t.args[0];
|
|
148388
|
+
}
|
|
148389
|
+
if (e16.kind === Kind.PIPE_EXPRESSION) {
|
|
148390
|
+
let t = e16;
|
|
148391
|
+
if (t.left.kind === Kind.DOT_EXPRESSION && DRILL_GRAINS.has(t.right.name.value) && t.right.args.length === 0)
|
|
148392
|
+
return t.left;
|
|
148393
|
+
}
|
|
148394
|
+
}
|
|
148395
|
+
function applyDateDrill(e16, t, n) {
|
|
148396
|
+
let r3 = typeof t?.grain == "string" ? t.grain.trim().toLowerCase() : "";
|
|
148397
|
+
if (!DRILL_GRAINS.has(r3))
|
|
148398
|
+
throw createQueryInputError(`${n}.grain`, `Expected a grain (${[...DRILL_GRAINS].join(", ")}), got ${JSON.stringify(t?.grain)}.`);
|
|
148399
|
+
let i = 0, a = (e17) => {
|
|
148400
|
+
if (e17.kind !== Kind.NAMED_EXPRESSION)
|
|
148401
|
+
return e17;
|
|
148402
|
+
let n3 = e17, a3 = drilledField(n3.expr);
|
|
148403
|
+
if (!a3 || dottedName$1(a3) !== t.field)
|
|
148404
|
+
return e17;
|
|
148405
|
+
i += 1;
|
|
148406
|
+
let s4 = createFunctionCallExpression(createIdentifier("date_trunc"), [a3, createTextLiteral(r3)]);
|
|
148407
|
+
return {
|
|
148408
|
+
...n3,
|
|
148409
|
+
expr: s4
|
|
148410
|
+
};
|
|
148411
|
+
}, s3 = Array.isArray(e16) ? e16.map(a) : {
|
|
148412
|
+
...e16,
|
|
148413
|
+
rows: e16.rows.map(a),
|
|
148414
|
+
columns: e16.columns.map(a)
|
|
148415
|
+
};
|
|
148416
|
+
if (i === 0)
|
|
148417
|
+
throw createQueryInputError(`${n}.field`, `No aliased dimension of the query is built directly on \`${t.field}\` to drill.`);
|
|
148418
|
+
return s3;
|
|
148419
|
+
}
|
|
148420
|
+
var DATE_UNITS = new Set([
|
|
148421
|
+
"year",
|
|
148422
|
+
"quarter",
|
|
148423
|
+
"month",
|
|
148424
|
+
"week",
|
|
148425
|
+
"day",
|
|
148426
|
+
"hour",
|
|
148427
|
+
"minute"
|
|
148428
|
+
]);
|
|
148429
|
+
var UNSUPPORTED_OPERATORS = {
|
|
148430
|
+
matches_user_attribute: "there are no user attributes to match against",
|
|
148431
|
+
transform_pop_relative: "period-over-period comparison is not supported",
|
|
148432
|
+
transform_pop_absolute: "period-over-period comparison is not supported",
|
|
148433
|
+
transform_pop_none: "period-over-period comparison is not supported",
|
|
148434
|
+
transform_date_drill: "send date drills as `dateDrills`, not as a filter"
|
|
148435
|
+
};
|
|
148436
|
+
var infix = (e16, t, n, r3 = false) => createInfixExpression(e16, createInfixOperatorToken(t, undefined, r3), n);
|
|
148437
|
+
function filterToConditions(e16, t, n) {
|
|
148438
|
+
if (e16.operator === "none")
|
|
148439
|
+
return {
|
|
148440
|
+
conditions: [],
|
|
148441
|
+
aggregate: false
|
|
148442
|
+
};
|
|
148443
|
+
if (e16.operator in UNSUPPORTED_OPERATORS)
|
|
148444
|
+
throw createQueryInputError(`${t}.operator`, `Unsupported operator \`${e16.operator}\`: ${UNSUPPORTED_OPERATORS[e16.operator]}.`);
|
|
148445
|
+
let r3, i = () => (r3 ??= resolveTarget(e16, t, n), r3), a = operatorToConditions(e16, t, i);
|
|
148446
|
+
return {
|
|
148447
|
+
conditions: a,
|
|
148448
|
+
aggregate: a.length > 0 && i().aggregate
|
|
148449
|
+
};
|
|
148450
|
+
}
|
|
148451
|
+
function operatorToConditions(e16, t, n) {
|
|
148452
|
+
let { operator: r3 } = e16, i = e16.values ?? [], a = `${t}.values`, s3 = (e17) => {
|
|
148453
|
+
if (i.length !== e17)
|
|
148454
|
+
throw createQueryInputError(a, `Operator \`${r3}\` expects ${e17} value${e17 === 1 ? "" : "s"}, got ${i.length}.`);
|
|
148455
|
+
}, c3 = (e17, t3) => literalFor(e17, i[t3], `${a}[${t3}]`), l3 = (e17, t3) => createTextLiteral(t3(String(i[e17]))), u = (e17, t3) => {
|
|
148456
|
+
if (typeof e17 != "string" || !e17.trim())
|
|
148457
|
+
throw createQueryInputError(t3, `Expected a date or date range, got ${JSON.stringify(e17)}.`);
|
|
148458
|
+
return createDatetimeLiteral(e17.trim());
|
|
148459
|
+
};
|
|
148460
|
+
switch (r3) {
|
|
148461
|
+
case "is":
|
|
148462
|
+
case "is_not": {
|
|
148463
|
+
if (i.length === 0)
|
|
148464
|
+
throw createQueryInputError(a, `Operator \`${r3}\` expects at least 1 value.`);
|
|
148465
|
+
let e17 = n(), t3 = r3 === "is_not";
|
|
148466
|
+
return i.length === 1 ? [infix(e17.expr, Kind.IS_KEYWORD, c3(e17, 0), t3)] : [infix(e17.expr, Kind.IN_KEYWORD, createTableLiteral(i.map((t4, n3) => [c3(e17, n3)])), t3)];
|
|
148467
|
+
}
|
|
148468
|
+
case "is_null":
|
|
148469
|
+
case "not_null":
|
|
148470
|
+
return [infix(n().expr, Kind.IS_KEYWORD, createNullLiteral(), r3 === "not_null")];
|
|
148471
|
+
case "is_true":
|
|
148472
|
+
case "is_false":
|
|
148473
|
+
return [infix(n().expr, Kind.IS_KEYWORD, createTruefalseLiteral(r3 === "is_true"))];
|
|
148474
|
+
case "greater_than":
|
|
148475
|
+
case "less_than": {
|
|
148476
|
+
s3(1);
|
|
148477
|
+
let e17 = n();
|
|
148478
|
+
return [infix(e17.expr, r3 === "greater_than" ? Kind.GREATER_THAN : Kind.LESS_THAN, c3(e17, 0))];
|
|
148479
|
+
}
|
|
148480
|
+
case "between": {
|
|
148481
|
+
s3(2);
|
|
148482
|
+
let e17 = n();
|
|
148483
|
+
if (e17.type === SqlType.DATE || e17.type === SqlType.DATETIME) {
|
|
148484
|
+
let [t3, n3] = i.map((e18, t4) => {
|
|
148485
|
+
if (typeof e18 != "string" || !e18.trim())
|
|
148486
|
+
throw createQueryInputError(`${a}[${t4}]`, `Expected a date, got ${JSON.stringify(e18)}.`);
|
|
148487
|
+
return e18.trim();
|
|
148488
|
+
});
|
|
148489
|
+
return [infix(e17.expr, Kind.MATCHES_KEYWORD, createDatetimeLiteral(`${t3} - ${n3}`))];
|
|
148490
|
+
}
|
|
148491
|
+
return [infix(e17.expr, Kind.GREATER_THAN_EQUAL, c3(e17, 0)), infix(e17.expr, Kind.LESS_THAN_EQUAL, c3(e17, 1))];
|
|
148492
|
+
}
|
|
148493
|
+
case "contains":
|
|
148494
|
+
case "does_not_contain":
|
|
148495
|
+
return s3(1), [infix(n().expr, Kind.ILIKE_KEYWORD, l3(0, (e17) => `%${e17}%`), r3 === "does_not_contain")];
|
|
148496
|
+
case "starts_with":
|
|
148497
|
+
return s3(1), [infix(n().expr, Kind.ILIKE_KEYWORD, l3(0, (e17) => `${e17}%`))];
|
|
148498
|
+
case "ends_with":
|
|
148499
|
+
return s3(1), [infix(n().expr, Kind.ILIKE_KEYWORD, l3(0, (e17) => `%${e17}`))];
|
|
148500
|
+
case "matches":
|
|
148501
|
+
return s3(1), [infix(n().expr, Kind.MATCHES_KEYWORD, u(i[0], `${a}[0]`))];
|
|
148502
|
+
case "last":
|
|
148503
|
+
case "next": {
|
|
148504
|
+
s3(1);
|
|
148505
|
+
let c4 = Number(i[0]);
|
|
148506
|
+
if (!Number.isInteger(c4) || c4 < 0 || typeof i[0] == "boolean")
|
|
148507
|
+
throw createQueryInputError(`${a}[0]`, `Expected a whole number of periods, got ${JSON.stringify(i[0])}.`);
|
|
148508
|
+
let l4 = e16.modifier?.trim().toLowerCase().replace(/s$/, "");
|
|
148509
|
+
if (!l4 || !DATE_UNITS.has(l4))
|
|
148510
|
+
throw createQueryInputError(`${t}.modifier`, `Operator \`${r3}\` needs a date unit (${[...DATE_UNITS].join(", ")}), got ${JSON.stringify(e16.modifier)}.`);
|
|
148511
|
+
return [infix(n().expr, Kind.MATCHES_KEYWORD, createDatetimeLiteral(`${r3} ${c4} ${l4}${c4 === 1 ? "" : "s"}`))];
|
|
148512
|
+
}
|
|
148513
|
+
case "before":
|
|
148514
|
+
case "after":
|
|
148515
|
+
return s3(1), [infix(n().expr, r3 === "before" ? Kind.LESS_THAN : Kind.GREATER_THAN, u(i[0], `${a}[0]`))];
|
|
148516
|
+
default:
|
|
148517
|
+
throw createQueryInputError(`${t}.operator`, `Unsupported operator \`${r3}\`.`);
|
|
148518
|
+
}
|
|
148519
|
+
}
|
|
148520
|
+
function resolveTarget(e16, t, n) {
|
|
148521
|
+
let r3 = `${t}.field`;
|
|
148522
|
+
if (!e16.field?.includes(".")) {
|
|
148523
|
+
if (e16.aggregation)
|
|
148524
|
+
throw createQueryInputError(`${t}.aggregation`, "An aggregation applies to a dataset field (`model.field`), not to a metric.");
|
|
148525
|
+
let i3 = e16.field ? n.store.getMayBeMetric(e16.field) : undefined;
|
|
148526
|
+
if (!i3)
|
|
148527
|
+
throw createQueryInputError(r3, `Unknown field \`${e16.field}\`: expected a dataset field as \`model.field\` or a dataset metric.`);
|
|
148528
|
+
return {
|
|
148529
|
+
expr: createIdentifier(i3.name),
|
|
148530
|
+
type: i3.type,
|
|
148531
|
+
name: i3.name,
|
|
148532
|
+
aggregate: true
|
|
148533
|
+
};
|
|
148534
|
+
}
|
|
148535
|
+
let { ref: i, field: a } = resolveField(e16.field, r3, n);
|
|
148536
|
+
if (!e16.aggregation)
|
|
148537
|
+
return {
|
|
148538
|
+
expr: i,
|
|
148539
|
+
type: a.type,
|
|
148540
|
+
name: e16.field,
|
|
148541
|
+
aggregate: false
|
|
148542
|
+
};
|
|
148543
|
+
let s3 = aggregationFunctionName(e16.aggregation);
|
|
148544
|
+
if (!s3)
|
|
148545
|
+
throw createQueryInputError(`${t}.aggregation`, `Unknown aggregation \`${e16.aggregation}\`.`);
|
|
148546
|
+
let c3 = s3 === "min" || s3 === "max" ? a.type : SqlType.NUMBER;
|
|
148547
|
+
return {
|
|
148548
|
+
expr: createFunctionCallExpression(createIdentifier(s3), [i]),
|
|
148549
|
+
type: c3,
|
|
148550
|
+
name: `${s3}(${e16.field})`,
|
|
148551
|
+
aggregate: true
|
|
148552
|
+
};
|
|
148553
|
+
}
|
|
148554
|
+
function aggregationFunctionName(e16) {
|
|
148555
|
+
let t = Object.entries(AggregationType).find(([, t3]) => t3 === e16.trim().toLowerCase());
|
|
148556
|
+
if (!(!t || t[1] === AggregationType.CUSTOM))
|
|
148557
|
+
return t[0].toLowerCase();
|
|
148558
|
+
}
|
|
148559
|
+
function resolveField(e16, t, n) {
|
|
148560
|
+
let r3 = e16.lastIndexOf(".");
|
|
148561
|
+
if (r3 <= 0 || r3 === e16.length - 1)
|
|
148562
|
+
throw createQueryInputError(t, `Expected a dataset field as \`model.field\`, got \`${e16}\`.`);
|
|
148563
|
+
let i = e16.slice(0, r3), a = e16.slice(r3 + 1), s3 = n.store.getMayBeModelField({
|
|
148564
|
+
modelName: i,
|
|
148565
|
+
fieldName: a
|
|
148566
|
+
});
|
|
148567
|
+
if (!s3)
|
|
148568
|
+
throw createQueryInputError(t, `Unknown field \`${e16}\` in this dataset.`);
|
|
148569
|
+
let c3 = i.split(".").map((e17) => createIdentifier(e17));
|
|
148570
|
+
return {
|
|
148571
|
+
ref: createDotExpression(c3.slice(1).reduce((e17, t3) => createDotExpression(e17, t3), c3[0]), createIdentifier(a)),
|
|
148572
|
+
field: s3
|
|
148573
|
+
};
|
|
148574
|
+
}
|
|
148575
|
+
function literalFor(e16, t, n) {
|
|
148576
|
+
if (t === null)
|
|
148577
|
+
return createNullLiteral();
|
|
148578
|
+
switch (e16.type) {
|
|
148579
|
+
case SqlType.NUMBER: {
|
|
148580
|
+
let r3 = typeof t == "number" ? t : Number(t);
|
|
148581
|
+
if (typeof t == "boolean" || t === "" || !Number.isFinite(r3))
|
|
148582
|
+
throw createQueryInputError(n, `Expected a number for \`${e16.name}\`, got ${JSON.stringify(t)}.`);
|
|
148583
|
+
return createNumberLiteral(String(r3));
|
|
148584
|
+
}
|
|
148585
|
+
case SqlType.TRUEFALSE:
|
|
148586
|
+
if (t === true || t === "true")
|
|
148587
|
+
return createTruefalseLiteral(true);
|
|
148588
|
+
if (t === false || t === "false")
|
|
148589
|
+
return createTruefalseLiteral(false);
|
|
148590
|
+
throw createQueryInputError(n, `Expected true or false for \`${e16.name}\`, got ${JSON.stringify(t)}.`);
|
|
148591
|
+
case SqlType.DATE:
|
|
148592
|
+
case SqlType.DATETIME:
|
|
148593
|
+
if (typeof t != "string" || !t.trim())
|
|
148594
|
+
throw createQueryInputError(n, `Expected a date for \`${e16.name}\`, got ${JSON.stringify(t)}.`);
|
|
148595
|
+
return createDatetimeLiteral(t.trim());
|
|
148596
|
+
default:
|
|
148597
|
+
return createTextLiteral(String(t));
|
|
148598
|
+
}
|
|
148599
|
+
}
|
|
148600
|
+
var DATE_GRAINS = new Set([
|
|
148601
|
+
"year",
|
|
148602
|
+
"quarter",
|
|
148603
|
+
"month",
|
|
148604
|
+
"week",
|
|
148605
|
+
"day",
|
|
148606
|
+
"hour",
|
|
148607
|
+
"minute"
|
|
148608
|
+
]);
|
|
148609
|
+
function dottedName(e16) {
|
|
148610
|
+
if (e16.kind === Kind.IDENTIFIER)
|
|
148611
|
+
return e16.value;
|
|
148612
|
+
if (e16.kind !== Kind.DOT_EXPRESSION)
|
|
148613
|
+
return;
|
|
148614
|
+
let t = e16, n = dottedName(t.left);
|
|
148615
|
+
return n === undefined ? undefined : `${n}.${t.right.value}`;
|
|
148616
|
+
}
|
|
148617
|
+
function lookup(e16, t) {
|
|
148618
|
+
let n = t.kind === Kind.DOT_EXPRESSION ? dottedName(t) : undefined;
|
|
148619
|
+
if (!n)
|
|
148620
|
+
return;
|
|
148621
|
+
let r3 = n.lastIndexOf("."), i = n.slice(0, r3), a = n.slice(r3 + 1), s3 = e16.getMayBeModelField({
|
|
148622
|
+
modelName: i,
|
|
148623
|
+
fieldName: a
|
|
148624
|
+
});
|
|
148625
|
+
return s3 ? {
|
|
148626
|
+
modelName: i,
|
|
148627
|
+
fieldName: a,
|
|
148628
|
+
field: s3
|
|
148629
|
+
} : undefined;
|
|
148630
|
+
}
|
|
148631
|
+
function underlyingField(e16) {
|
|
148632
|
+
if (e16.kind === Kind.FUNCTION_CALL) {
|
|
148633
|
+
let t = e16;
|
|
148634
|
+
if (t.name.value === "date_trunc" && t.args.length >= 1)
|
|
148635
|
+
return t.args[0];
|
|
148636
|
+
}
|
|
148637
|
+
if (e16.kind === Kind.PIPE_EXPRESSION) {
|
|
148638
|
+
let t = e16;
|
|
148639
|
+
if (t.right.kind === Kind.FUNCTION_CALL && DATE_GRAINS.has(t.right.name.value) && t.right.args.length === 0)
|
|
148640
|
+
return t.left;
|
|
148641
|
+
}
|
|
148642
|
+
return e16;
|
|
148643
|
+
}
|
|
148644
|
+
function aggregationName(e16) {
|
|
148645
|
+
let t = AggregationType[e16.toUpperCase()];
|
|
148646
|
+
return t && t !== AggregationType.CUSTOM ? t : undefined;
|
|
148647
|
+
}
|
|
148648
|
+
function aggregatedField(e16) {
|
|
148649
|
+
let t = e16.kind === Kind.PIPE_EXPRESSION ? e16.right : e16;
|
|
148650
|
+
if (t.kind !== Kind.FUNCTION_CALL)
|
|
148651
|
+
return;
|
|
148652
|
+
let n = t, r3 = aggregationName(n.name.value);
|
|
148653
|
+
if (!(!r3 || n.args.length !== 1))
|
|
148654
|
+
return {
|
|
148655
|
+
aggregation: r3,
|
|
148656
|
+
arg: n.args[0]
|
|
148657
|
+
};
|
|
148658
|
+
}
|
|
148659
|
+
function adhoc(e16, t) {
|
|
148660
|
+
return {
|
|
148661
|
+
name: e16,
|
|
148662
|
+
fieldName: e16,
|
|
148663
|
+
label: e16,
|
|
148664
|
+
adhoc: true,
|
|
148665
|
+
isMeasure: t
|
|
148666
|
+
};
|
|
148667
|
+
}
|
|
148668
|
+
function describeDimension(e16, t, n) {
|
|
148669
|
+
let r3 = lookup(n, underlyingField(t));
|
|
148670
|
+
return r3 ? {
|
|
148671
|
+
name: e16,
|
|
148672
|
+
fieldName: r3.fieldName,
|
|
148673
|
+
modelId: r3.modelName,
|
|
148674
|
+
label: r3.field.label ?? e16,
|
|
148675
|
+
adhoc: false,
|
|
148676
|
+
isMeasure: !!r3.field.aggregationType
|
|
148677
|
+
} : adhoc(e16, false);
|
|
148678
|
+
}
|
|
148679
|
+
function describeMeasure(e16, t, n) {
|
|
148680
|
+
if (t.kind === Kind.IDENTIFIER) {
|
|
148681
|
+
let r4 = n.getMayBeMetric(t.value);
|
|
148682
|
+
return r4 ? {
|
|
148683
|
+
name: e16,
|
|
148684
|
+
fieldName: r4.name,
|
|
148685
|
+
label: r4.label ?? e16,
|
|
148686
|
+
adhoc: false,
|
|
148687
|
+
isMeasure: true
|
|
148688
|
+
} : adhoc(e16, true);
|
|
148689
|
+
}
|
|
148690
|
+
let r3 = lookup(n, t);
|
|
148691
|
+
if (r3)
|
|
148692
|
+
return {
|
|
148693
|
+
name: e16,
|
|
148694
|
+
fieldName: r3.fieldName,
|
|
148695
|
+
modelId: r3.modelName,
|
|
148696
|
+
label: r3.field.label ?? e16,
|
|
148697
|
+
adhoc: false,
|
|
148698
|
+
isMeasure: true,
|
|
148699
|
+
...r3.field.aggregationType ? { aggregation: r3.field.aggregationType } : {}
|
|
148700
|
+
};
|
|
148701
|
+
let i = aggregatedField(t), a = i && lookup(n, i.arg);
|
|
148702
|
+
return i && a ? {
|
|
148703
|
+
name: e16,
|
|
148704
|
+
fieldName: a.fieldName,
|
|
148705
|
+
modelId: a.modelName,
|
|
148706
|
+
label: e16,
|
|
148707
|
+
adhoc: false,
|
|
148708
|
+
isMeasure: true,
|
|
148709
|
+
aggregation: i.aggregation
|
|
148710
|
+
} : adhoc(e16, true);
|
|
148711
|
+
}
|
|
148712
|
+
function aliasOf(e16) {
|
|
148713
|
+
if (e16.kind === Kind.NAMED_EXPRESSION) {
|
|
148714
|
+
let t = e16;
|
|
148715
|
+
return {
|
|
148716
|
+
name: t.name.value,
|
|
148717
|
+
expr: t.expr
|
|
148718
|
+
};
|
|
148719
|
+
}
|
|
148720
|
+
if (e16.kind === Kind.DOT_EXPRESSION)
|
|
148721
|
+
return {
|
|
148722
|
+
name: e16.right.value,
|
|
148723
|
+
expr: e16
|
|
148724
|
+
};
|
|
148725
|
+
}
|
|
148726
|
+
function describeColumns(e16, t) {
|
|
148727
|
+
let n = parse(e16).exprs.filter((e17) => e17.kind === Kind.DYNAMIC_EXPLORE);
|
|
148728
|
+
if (n.length !== 1)
|
|
148729
|
+
return;
|
|
148730
|
+
let [r3] = n, i = Array.isArray(r3.dimensions) ? r3.dimensions : [...r3.dimensions.rows, ...r3.dimensions.columns], a = [];
|
|
148731
|
+
for (let e17 of i) {
|
|
148732
|
+
let n3 = aliasOf(e17);
|
|
148733
|
+
n3 && a.push(describeDimension(n3.name, n3.expr, t.store));
|
|
148734
|
+
}
|
|
148735
|
+
for (let e17 of r3.measures) {
|
|
148736
|
+
let n3 = aliasOf(e17);
|
|
148737
|
+
n3 && a.push(describeMeasure(n3.name, n3.expr, t.store));
|
|
148738
|
+
}
|
|
148739
|
+
return a;
|
|
148740
|
+
}
|
|
147907
148741
|
var RUBY_SQL_GEN_URL = "http://localhost:6341";
|
|
147908
148742
|
var rubySqlBackend = {
|
|
147909
148743
|
name: "ruby",
|
|
@@ -154492,17 +155326,17 @@ var import_lodash3 = __toESM(require_lodash(), 1);
|
|
|
154492
155326
|
|
|
154493
155327
|
// src/commands/aml/validators/report.ts
|
|
154494
155328
|
function offsetToLineColumn(content, offset) {
|
|
154495
|
-
let
|
|
155329
|
+
let line2 = 1;
|
|
154496
155330
|
let lineStart = 0;
|
|
154497
155331
|
const end = Math.min(offset, content.length);
|
|
154498
155332
|
for (let i = 0;i < end; i += 1) {
|
|
154499
155333
|
if (content[i] === `
|
|
154500
155334
|
`) {
|
|
154501
|
-
|
|
155335
|
+
line2 += 1;
|
|
154502
155336
|
lineStart = i + 1;
|
|
154503
155337
|
}
|
|
154504
155338
|
}
|
|
154505
|
-
return { line, column: offset - lineStart + 1 };
|
|
155339
|
+
return { line: line2, column: offset - lineStart + 1 };
|
|
154506
155340
|
}
|
|
154507
155341
|
function errorToMessage(e16) {
|
|
154508
155342
|
return { message: e16.message, code: e16.code, severity: "error" };
|
|
@@ -156169,7 +157003,7 @@ function parseGitignore(repoPath) {
|
|
|
156169
157003
|
try {
|
|
156170
157004
|
const content = fs19.readFileSync(gitignorePath, "utf-8");
|
|
156171
157005
|
return content.split(`
|
|
156172
|
-
`).map((
|
|
157006
|
+
`).map((line2) => line2.trim()).filter((line2) => line2.length > 0 && !line2.startsWith("#"));
|
|
156173
157007
|
} catch {
|
|
156174
157008
|
return [];
|
|
156175
157009
|
}
|
|
@@ -156779,8 +157613,8 @@ function isArrayLike(input) {
|
|
|
156779
157613
|
}
|
|
156780
157614
|
function toLinesWithContent(input = "", trimmed2 = true, separator2 = `
|
|
156781
157615
|
`) {
|
|
156782
|
-
return input.split(separator2).reduce((output,
|
|
156783
|
-
const lineContent = trimmed2 ?
|
|
157616
|
+
return input.split(separator2).reduce((output, line2) => {
|
|
157617
|
+
const lineContent = trimmed2 ? line2.trim() : line2;
|
|
156784
157618
|
if (lineContent) {
|
|
156785
157619
|
output.push(lineContent);
|
|
156786
157620
|
}
|
|
@@ -156788,7 +157622,7 @@ function toLinesWithContent(input = "", trimmed2 = true, separator2 = `
|
|
|
156788
157622
|
}, []);
|
|
156789
157623
|
}
|
|
156790
157624
|
function forEachLineWithContent(input, callback) {
|
|
156791
|
-
return toLinesWithContent(input, true).map((
|
|
157625
|
+
return toLinesWithContent(input, true).map((line2) => callback(line2));
|
|
156792
157626
|
}
|
|
156793
157627
|
function folderExists(path17) {
|
|
156794
157628
|
return import_file_exists.exists(path17, import_file_exists.FOLDER);
|
|
@@ -156960,9 +157794,9 @@ var init_line_parser = __esm({
|
|
|
156960
157794
|
constructor(regExp, useMatches) {
|
|
156961
157795
|
this.matches = [];
|
|
156962
157796
|
this.useMatches = useMatchesDefault;
|
|
156963
|
-
this.parse = (
|
|
157797
|
+
this.parse = (line2, target) => {
|
|
156964
157798
|
this.resetMatches();
|
|
156965
|
-
if (!this._regExp.every((reg, index) => this.addMatch(reg, index,
|
|
157799
|
+
if (!this._regExp.every((reg, index) => this.addMatch(reg, index, line2(index)))) {
|
|
156966
157800
|
return false;
|
|
156967
157801
|
}
|
|
156968
157802
|
return this.useMatches(target, this.prepareMatches()) !== false;
|
|
@@ -156978,8 +157812,8 @@ var init_line_parser = __esm({
|
|
|
156978
157812
|
prepareMatches() {
|
|
156979
157813
|
return this.matches;
|
|
156980
157814
|
}
|
|
156981
|
-
addMatch(reg, index,
|
|
156982
|
-
const matched =
|
|
157815
|
+
addMatch(reg, index, line2) {
|
|
157816
|
+
const matched = line2 && reg.exec(line2);
|
|
156983
157817
|
if (matched) {
|
|
156984
157818
|
this.pushMatch(index, matched);
|
|
156985
157819
|
}
|
|
@@ -156990,8 +157824,8 @@ var init_line_parser = __esm({
|
|
|
156990
157824
|
}
|
|
156991
157825
|
};
|
|
156992
157826
|
RemoteLineParser = class extends LineParser {
|
|
156993
|
-
addMatch(reg, index,
|
|
156994
|
-
return /^remote:\s/.test(String(
|
|
157827
|
+
addMatch(reg, index, line2) {
|
|
157828
|
+
return /^remote:\s/.test(String(line2)) && super.addMatch(reg, index, line2);
|
|
156995
157829
|
}
|
|
156996
157830
|
pushMatch(index, matched) {
|
|
156997
157831
|
if (index > 0 || matched.length > 1) {
|
|
@@ -157076,15 +157910,15 @@ function callTaskParser(parser4, streams) {
|
|
|
157076
157910
|
return parser4(streams.stdOut, streams.stdErr);
|
|
157077
157911
|
}
|
|
157078
157912
|
function parseStringResponse(result, parsers12, texts, trim2 = true) {
|
|
157079
|
-
asArray(texts).forEach((
|
|
157080
|
-
for (let lines = toLinesWithContent(
|
|
157081
|
-
const
|
|
157913
|
+
asArray(texts).forEach((text2) => {
|
|
157914
|
+
for (let lines = toLinesWithContent(text2, trim2), i3 = 0, max = lines.length;i3 < max; i3++) {
|
|
157915
|
+
const line2 = (offset = 0) => {
|
|
157082
157916
|
if (i3 + offset >= max) {
|
|
157083
157917
|
return;
|
|
157084
157918
|
}
|
|
157085
157919
|
return lines[i3 + offset];
|
|
157086
157920
|
};
|
|
157087
|
-
parsers12.some(({ parse: parse2 }) => parse2(
|
|
157921
|
+
parsers12.some(({ parse: parse2 }) => parse2(line2, result));
|
|
157088
157922
|
}
|
|
157089
157923
|
});
|
|
157090
157924
|
return result;
|
|
@@ -157215,16 +158049,16 @@ var init_check_is_repo = __esm({
|
|
|
157215
158049
|
}
|
|
157216
158050
|
fail(error);
|
|
157217
158051
|
};
|
|
157218
|
-
parser = (
|
|
157219
|
-
return
|
|
158052
|
+
parser = (text2) => {
|
|
158053
|
+
return text2.trim() === "true";
|
|
157220
158054
|
};
|
|
157221
158055
|
}
|
|
157222
158056
|
});
|
|
157223
|
-
function cleanSummaryParser(dryRun,
|
|
158057
|
+
function cleanSummaryParser(dryRun, text2) {
|
|
157224
158058
|
const summary = new CleanResponse(dryRun);
|
|
157225
158059
|
const regexp = dryRun ? dryRunRemovalRegexp : removalRegexp;
|
|
157226
|
-
toLinesWithContent(
|
|
157227
|
-
const removed =
|
|
158060
|
+
toLinesWithContent(text2).forEach((line2) => {
|
|
158061
|
+
const removed = line2.replace(regexp, "");
|
|
157228
158062
|
summary.paths.push(removed);
|
|
157229
158063
|
(isFolderRegexp.test(removed) ? summary.folders : summary.files).push(removed);
|
|
157230
158064
|
});
|
|
@@ -157280,8 +158114,8 @@ function straightThroughStringTask(commands, trimmed2 = false) {
|
|
|
157280
158114
|
return {
|
|
157281
158115
|
commands,
|
|
157282
158116
|
format: "utf-8",
|
|
157283
|
-
parser(
|
|
157284
|
-
return trimmed2 ? String(
|
|
158117
|
+
parser(text2) {
|
|
158118
|
+
return trimmed2 ? String(text2).trim() : text2;
|
|
157285
158119
|
}
|
|
157286
158120
|
};
|
|
157287
158121
|
}
|
|
@@ -157336,8 +158170,8 @@ function cleanTask(mode, customArgs) {
|
|
|
157336
158170
|
return {
|
|
157337
158171
|
commands,
|
|
157338
158172
|
format: "utf-8",
|
|
157339
|
-
parser(
|
|
157340
|
-
return cleanSummaryParser(mode === "n",
|
|
158173
|
+
parser(text2) {
|
|
158174
|
+
return cleanSummaryParser(mode === "n", text2);
|
|
157341
158175
|
}
|
|
157342
158176
|
};
|
|
157343
158177
|
}
|
|
@@ -157403,18 +158237,18 @@ var init_clean = __esm({
|
|
|
157403
158237
|
]);
|
|
157404
158238
|
}
|
|
157405
158239
|
});
|
|
157406
|
-
function configListParser(
|
|
158240
|
+
function configListParser(text2) {
|
|
157407
158241
|
const config = new ConfigList;
|
|
157408
|
-
for (const item of configParser(
|
|
158242
|
+
for (const item of configParser(text2)) {
|
|
157409
158243
|
config.addValue(item.file, String(item.key), item.value);
|
|
157410
158244
|
}
|
|
157411
158245
|
return config;
|
|
157412
158246
|
}
|
|
157413
|
-
function configGetParser(
|
|
158247
|
+
function configGetParser(text2, key) {
|
|
157414
158248
|
let value = null;
|
|
157415
158249
|
const values2 = [];
|
|
157416
158250
|
const scopes = /* @__PURE__ */ new Map;
|
|
157417
|
-
for (const item of configParser(
|
|
158251
|
+
for (const item of configParser(text2, key)) {
|
|
157418
158252
|
if (item.key !== key) {
|
|
157419
158253
|
continue;
|
|
157420
158254
|
}
|
|
@@ -157435,18 +158269,18 @@ function configGetParser(text, key) {
|
|
|
157435
158269
|
function configFilePath(filePath) {
|
|
157436
158270
|
return filePath.replace(/^(file):/, "");
|
|
157437
158271
|
}
|
|
157438
|
-
function* configParser(
|
|
157439
|
-
const lines =
|
|
158272
|
+
function* configParser(text2, requestedKey = null) {
|
|
158273
|
+
const lines = text2.split("\x00");
|
|
157440
158274
|
for (let i3 = 0, max = lines.length - 1;i3 < max; ) {
|
|
157441
158275
|
const file = configFilePath(lines[i3++]);
|
|
157442
158276
|
let value = lines[i3++];
|
|
157443
158277
|
let key = requestedKey;
|
|
157444
158278
|
if (value.includes(`
|
|
157445
158279
|
`)) {
|
|
157446
|
-
const
|
|
158280
|
+
const line2 = splitOn(value, `
|
|
157447
158281
|
`);
|
|
157448
|
-
key =
|
|
157449
|
-
value =
|
|
158282
|
+
key = line2[0];
|
|
158283
|
+
value = line2[1];
|
|
157450
158284
|
}
|
|
157451
158285
|
yield { file, key, value };
|
|
157452
158286
|
}
|
|
@@ -157505,8 +158339,8 @@ function addConfigTask(key, value, append22, scope) {
|
|
|
157505
158339
|
return {
|
|
157506
158340
|
commands,
|
|
157507
158341
|
format: "utf-8",
|
|
157508
|
-
parser(
|
|
157509
|
-
return
|
|
158342
|
+
parser(text2) {
|
|
158343
|
+
return text2;
|
|
157510
158344
|
}
|
|
157511
158345
|
};
|
|
157512
158346
|
}
|
|
@@ -157518,8 +158352,8 @@ function getConfigTask(key, scope) {
|
|
|
157518
158352
|
return {
|
|
157519
158353
|
commands,
|
|
157520
158354
|
format: "utf-8",
|
|
157521
|
-
parser(
|
|
157522
|
-
return configGetParser(
|
|
158355
|
+
parser(text2) {
|
|
158356
|
+
return configGetParser(text2, key);
|
|
157523
158357
|
}
|
|
157524
158358
|
};
|
|
157525
158359
|
}
|
|
@@ -157531,8 +158365,8 @@ function listConfigTask(scope) {
|
|
|
157531
158365
|
return {
|
|
157532
158366
|
commands,
|
|
157533
158367
|
format: "utf-8",
|
|
157534
|
-
parser(
|
|
157535
|
-
return configListParser(
|
|
158368
|
+
parser(text2) {
|
|
158369
|
+
return configListParser(text2);
|
|
157536
158370
|
}
|
|
157537
158371
|
};
|
|
157538
158372
|
}
|
|
@@ -157592,10 +158426,10 @@ function parseGrep(grep) {
|
|
|
157592
158426
|
const paths = /* @__PURE__ */ new Set;
|
|
157593
158427
|
const results = {};
|
|
157594
158428
|
forEachLineWithContent(grep, (input) => {
|
|
157595
|
-
const [path17,
|
|
158429
|
+
const [path17, line2, preview] = input.split(NULL);
|
|
157596
158430
|
paths.add(path17);
|
|
157597
158431
|
(results[path17] = results[path17] || []).push({
|
|
157598
|
-
line: asNumber(
|
|
158432
|
+
line: asNumber(line2),
|
|
157599
158433
|
path: path17,
|
|
157600
158434
|
preview
|
|
157601
158435
|
});
|
|
@@ -158265,8 +159099,8 @@ var init_hash_object = __esm({
|
|
|
158265
159099
|
init_task();
|
|
158266
159100
|
}
|
|
158267
159101
|
});
|
|
158268
|
-
function parseInit(bare, path17,
|
|
158269
|
-
const response = String(
|
|
159102
|
+
function parseInit(bare, path17, text2) {
|
|
159103
|
+
const response = String(text2).trim();
|
|
158270
159104
|
let result;
|
|
158271
159105
|
if (result = initResponseRegex.exec(response)) {
|
|
158272
159106
|
return new InitSummary(bare, path17, false, result[1]);
|
|
@@ -158313,8 +159147,8 @@ function initTask(bare = false, path17, customArgs) {
|
|
|
158313
159147
|
return {
|
|
158314
159148
|
commands,
|
|
158315
159149
|
format: "utf-8",
|
|
158316
|
-
parser(
|
|
158317
|
-
return parseInit(commands.includes("--bare"), path17,
|
|
159150
|
+
parser(text2) {
|
|
159151
|
+
return parseInit(commands.includes("--bare"), path17, text2);
|
|
158318
159152
|
}
|
|
158319
159153
|
};
|
|
158320
159154
|
}
|
|
@@ -158459,9 +159293,9 @@ var init_parse_diff_summary = __esm({
|
|
|
158459
159293
|
}
|
|
158460
159294
|
});
|
|
158461
159295
|
function lineBuilder(tokens, fields) {
|
|
158462
|
-
return fields.reduce((
|
|
158463
|
-
|
|
158464
|
-
return
|
|
159296
|
+
return fields.reduce((line2, field, index) => {
|
|
159297
|
+
line2[field] = tokens[index] || "";
|
|
159298
|
+
return line2;
|
|
158465
159299
|
}, /* @__PURE__ */ Object.create({ diff: null }));
|
|
158466
159300
|
}
|
|
158467
159301
|
function createListLogSummaryParser(splitter = SPLITTER, fields = defaultFieldNames, logFormat = "") {
|
|
@@ -158761,8 +159595,8 @@ var init_parse_remote_messages = __esm({
|
|
|
158761
159595
|
init_utils();
|
|
158762
159596
|
init_parse_remote_objects();
|
|
158763
159597
|
parsers2 = [
|
|
158764
|
-
new RemoteLineParser(/^remote:\s*(.+)$/, (result, [
|
|
158765
|
-
result.remoteMessages.all.push(
|
|
159598
|
+
new RemoteLineParser(/^remote:\s*(.+)$/, (result, [text2]) => {
|
|
159599
|
+
result.remoteMessages.all.push(text2.trim());
|
|
158766
159600
|
return false;
|
|
158767
159601
|
}),
|
|
158768
159602
|
...remoteMessagesObjectParsers,
|
|
@@ -159041,8 +159875,8 @@ var init_FileStatusSummary = __esm({
|
|
|
159041
159875
|
};
|
|
159042
159876
|
}
|
|
159043
159877
|
});
|
|
159044
|
-
function renamedFile(
|
|
159045
|
-
const [to4, from] =
|
|
159878
|
+
function renamedFile(line2) {
|
|
159879
|
+
const [to4, from] = line2.split(NULL);
|
|
159046
159880
|
return {
|
|
159047
159881
|
from: from || to4,
|
|
159048
159882
|
to: to4
|
|
@@ -159145,40 +159979,40 @@ var init_StatusSummary = __esm({
|
|
|
159145
159979
|
...conflicts("U", "A", "D", "U"),
|
|
159146
159980
|
[
|
|
159147
159981
|
"##",
|
|
159148
|
-
(result,
|
|
159982
|
+
(result, line2) => {
|
|
159149
159983
|
const aheadReg = /ahead (\d+)/;
|
|
159150
159984
|
const behindReg = /behind (\d+)/;
|
|
159151
159985
|
const currentReg = /^(.+?(?=(?:\.{3}|\s|$)))/;
|
|
159152
159986
|
const trackingReg = /\.{3}(\S*)/;
|
|
159153
159987
|
const onEmptyBranchReg = /\son\s(\S+?)(?=\.{3}|$)/;
|
|
159154
|
-
let regexResult = aheadReg.exec(
|
|
159988
|
+
let regexResult = aheadReg.exec(line2);
|
|
159155
159989
|
result.ahead = regexResult && +regexResult[1] || 0;
|
|
159156
|
-
regexResult = behindReg.exec(
|
|
159990
|
+
regexResult = behindReg.exec(line2);
|
|
159157
159991
|
result.behind = regexResult && +regexResult[1] || 0;
|
|
159158
|
-
regexResult = currentReg.exec(
|
|
159992
|
+
regexResult = currentReg.exec(line2);
|
|
159159
159993
|
result.current = filterType(regexResult?.[1], filterString, null);
|
|
159160
|
-
regexResult = trackingReg.exec(
|
|
159994
|
+
regexResult = trackingReg.exec(line2);
|
|
159161
159995
|
result.tracking = filterType(regexResult?.[1], filterString, null);
|
|
159162
|
-
regexResult = onEmptyBranchReg.exec(
|
|
159996
|
+
regexResult = onEmptyBranchReg.exec(line2);
|
|
159163
159997
|
if (regexResult) {
|
|
159164
159998
|
result.current = filterType(regexResult?.[1], filterString, result.current);
|
|
159165
159999
|
}
|
|
159166
|
-
result.detached = /\(no branch\)/.test(
|
|
160000
|
+
result.detached = /\(no branch\)/.test(line2);
|
|
159167
160001
|
}
|
|
159168
160002
|
]
|
|
159169
160003
|
]);
|
|
159170
|
-
parseStatusSummary = function(
|
|
159171
|
-
const lines =
|
|
160004
|
+
parseStatusSummary = function(text2) {
|
|
160005
|
+
const lines = text2.split(NULL);
|
|
159172
160006
|
const status = new StatusSummary;
|
|
159173
160007
|
for (let i3 = 0, l3 = lines.length;i3 < l3; ) {
|
|
159174
|
-
let
|
|
159175
|
-
if (!
|
|
160008
|
+
let line2 = lines[i3++].trim();
|
|
160009
|
+
if (!line2) {
|
|
159176
160010
|
continue;
|
|
159177
160011
|
}
|
|
159178
|
-
if (
|
|
159179
|
-
|
|
160012
|
+
if (line2.charAt(0) === "R") {
|
|
160013
|
+
line2 += NULL + (lines[i3++] || "");
|
|
159180
160014
|
}
|
|
159181
|
-
splitLine(status,
|
|
160015
|
+
splitLine(status, line2);
|
|
159182
160016
|
}
|
|
159183
160017
|
return status;
|
|
159184
160018
|
};
|
|
@@ -159196,8 +160030,8 @@ function statusTask(customArgs) {
|
|
|
159196
160030
|
return {
|
|
159197
160031
|
format: "utf-8",
|
|
159198
160032
|
commands,
|
|
159199
|
-
parser(
|
|
159200
|
-
return parseStatusSummary(
|
|
160033
|
+
parser(text2) {
|
|
160034
|
+
return parseStatusSummary(text2);
|
|
159201
160035
|
}
|
|
159202
160036
|
};
|
|
159203
160037
|
}
|
|
@@ -159654,8 +160488,8 @@ function toPath(input) {
|
|
|
159654
160488
|
var parseCheckIgnore;
|
|
159655
160489
|
var init_CheckIgnore = __esm({
|
|
159656
160490
|
"src/lib/responses/CheckIgnore.ts"() {
|
|
159657
|
-
parseCheckIgnore = (
|
|
159658
|
-
return
|
|
160491
|
+
parseCheckIgnore = (text2) => {
|
|
160492
|
+
return text2.split(/\n/g).map(toPath).filter(Boolean);
|
|
159659
160493
|
};
|
|
159660
160494
|
}
|
|
159661
160495
|
});
|
|
@@ -159812,14 +160646,14 @@ var init_pull = __esm({
|
|
|
159812
160646
|
init_utils();
|
|
159813
160647
|
}
|
|
159814
160648
|
});
|
|
159815
|
-
function parseGetRemotes(
|
|
160649
|
+
function parseGetRemotes(text2) {
|
|
159816
160650
|
const remotes = {};
|
|
159817
|
-
forEach2(
|
|
160651
|
+
forEach2(text2, ([name]) => remotes[name] = { name });
|
|
159818
160652
|
return Object.values(remotes);
|
|
159819
160653
|
}
|
|
159820
|
-
function parseGetRemotesVerbose(
|
|
160654
|
+
function parseGetRemotesVerbose(text2) {
|
|
159821
160655
|
const remotes = {};
|
|
159822
|
-
forEach2(
|
|
160656
|
+
forEach2(text2, ([name, url2, purpose]) => {
|
|
159823
160657
|
if (!Object.hasOwn(remotes, name)) {
|
|
159824
160658
|
remotes[name] = {
|
|
159825
160659
|
name,
|
|
@@ -159832,8 +160666,8 @@ function parseGetRemotesVerbose(text) {
|
|
|
159832
160666
|
});
|
|
159833
160667
|
return Object.values(remotes);
|
|
159834
160668
|
}
|
|
159835
|
-
function forEach2(
|
|
159836
|
-
forEachLineWithContent(
|
|
160669
|
+
function forEach2(text2, handler) {
|
|
160670
|
+
forEachLineWithContent(text2, (line2) => handler(line2.split(/\s+/)));
|
|
159837
160671
|
}
|
|
159838
160672
|
var init_GetRemoteSummary = __esm({
|
|
159839
160673
|
"src/lib/responses/GetRemoteSummary.ts"() {
|
|
@@ -160000,8 +160834,8 @@ function tagListTask(customArgs = []) {
|
|
|
160000
160834
|
return {
|
|
160001
160835
|
format: "utf-8",
|
|
160002
160836
|
commands: ["tag", "-l", ...customArgs],
|
|
160003
|
-
parser(
|
|
160004
|
-
return parseTagList(
|
|
160837
|
+
parser(text2) {
|
|
160838
|
+
return parseTagList(text2, hasCustomSort);
|
|
160005
160839
|
}
|
|
160006
160840
|
};
|
|
160007
160841
|
}
|