autoql-fe-utils 1.10.21 → 1.10.23
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.d.mts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.global.js +171 -148
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +173 -148
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +172 -148
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1191,6 +1191,7 @@ __export(index_exports, {
|
|
|
1191
1191
|
fetchDataPreview: () => fetchDataPreview,
|
|
1192
1192
|
fetchExploreQueries: () => fetchExploreQueries,
|
|
1193
1193
|
fetchFilters: () => fetchFilters,
|
|
1194
|
+
fetchLLMSummary: () => fetchLLMSummary,
|
|
1194
1195
|
fetchNotification: () => fetchNotification,
|
|
1195
1196
|
fetchNotificationChannels: () => fetchNotificationChannels,
|
|
1196
1197
|
fetchNotificationCount: () => fetchNotificationCount,
|
|
@@ -1694,6 +1695,7 @@ var QueryErrorTypes = /* @__PURE__ */ ((QueryErrorTypes2) => {
|
|
|
1694
1695
|
QueryErrorTypes2["PARSE_ERROR"] = "Parse error";
|
|
1695
1696
|
QueryErrorTypes2["NO_QUERY_SUPPLIED"] = "No query supplied";
|
|
1696
1697
|
QueryErrorTypes2["NO_QUERY_ID_SUPPLIED"] = "No query ID supplied";
|
|
1698
|
+
QueryErrorTypes2["NO_DATA_SUPPLIED"] = "No data supplied";
|
|
1697
1699
|
return QueryErrorTypes2;
|
|
1698
1700
|
})(QueryErrorTypes || {});
|
|
1699
1701
|
var Operators = /* @__PURE__ */ ((Operators2) => {
|
|
@@ -3346,6 +3348,139 @@ var removeElementAtIndex = (array, index) => {
|
|
|
3346
3348
|
return array.slice(0, index).concat(array.slice(index + 1));
|
|
3347
3349
|
};
|
|
3348
3350
|
|
|
3351
|
+
// src/HelperFns/filterEngine.ts
|
|
3352
|
+
var FilterOperatorEnum = /* @__PURE__ */ ((FilterOperatorEnum2) => {
|
|
3353
|
+
FilterOperatorEnum2["LIKE"] = "like";
|
|
3354
|
+
FilterOperatorEnum2["NOT_LIKE"] = "not_like";
|
|
3355
|
+
FilterOperatorEnum2["EQ"] = "=";
|
|
3356
|
+
FilterOperatorEnum2["NEQ"] = "!=";
|
|
3357
|
+
FilterOperatorEnum2["LT"] = "<";
|
|
3358
|
+
FilterOperatorEnum2["GT"] = ">";
|
|
3359
|
+
FilterOperatorEnum2["LTE"] = "<=";
|
|
3360
|
+
FilterOperatorEnum2["GTE"] = ">=";
|
|
3361
|
+
FilterOperatorEnum2["REGEX"] = "regex";
|
|
3362
|
+
FilterOperatorEnum2["STARTS_WITH"] = "starts_with";
|
|
3363
|
+
FilterOperatorEnum2["ENDS_WITH"] = "ends_with";
|
|
3364
|
+
return FilterOperatorEnum2;
|
|
3365
|
+
})(FilterOperatorEnum || {});
|
|
3366
|
+
var likeMatcher = (cell, cond) => {
|
|
3367
|
+
var _a;
|
|
3368
|
+
if (cell == null) return false;
|
|
3369
|
+
const needle = String((_a = cond.value) != null ? _a : "").toLowerCase();
|
|
3370
|
+
if (needle.length === 0) return false;
|
|
3371
|
+
return String(cell).toLowerCase().includes(needle);
|
|
3372
|
+
};
|
|
3373
|
+
var notLikeMatcher = (cell, cond) => {
|
|
3374
|
+
var _a;
|
|
3375
|
+
if (cell == null) return false;
|
|
3376
|
+
const needle = String((_a = cond.value) != null ? _a : "").toLowerCase();
|
|
3377
|
+
if (needle.length === 0) return true;
|
|
3378
|
+
return !String(cell).toLowerCase().includes(needle);
|
|
3379
|
+
};
|
|
3380
|
+
var equalMatcher = (cell, cond) => {
|
|
3381
|
+
if (cond.type === "number") return Number(cell) === Number(cond.value);
|
|
3382
|
+
return String(cell) === String(cond.value);
|
|
3383
|
+
};
|
|
3384
|
+
var notEqualMatcher = (cell, cond) => {
|
|
3385
|
+
return !equalMatcher(cell, cond);
|
|
3386
|
+
};
|
|
3387
|
+
var lessThanMatcher = (cell, cond) => Number(cell) < Number(cond.value);
|
|
3388
|
+
var lessThanEqMatcher = (cell, cond) => Number(cell) <= Number(cond.value);
|
|
3389
|
+
var greaterThanMatcher = (cell, cond) => Number(cell) > Number(cond.value);
|
|
3390
|
+
var greaterThanEqMatcher = (cell, cond) => Number(cell) >= Number(cond.value);
|
|
3391
|
+
var regexMatcher = (cell, cond) => {
|
|
3392
|
+
const reg = new RegExp(String(cond.value));
|
|
3393
|
+
return reg.test(String(cell));
|
|
3394
|
+
};
|
|
3395
|
+
var FILTER_MATCHERS = {
|
|
3396
|
+
like: likeMatcher,
|
|
3397
|
+
not_like: notLikeMatcher,
|
|
3398
|
+
"=": equalMatcher,
|
|
3399
|
+
"!=": notEqualMatcher,
|
|
3400
|
+
"<": lessThanMatcher,
|
|
3401
|
+
"<=": lessThanEqMatcher,
|
|
3402
|
+
">": greaterThanMatcher,
|
|
3403
|
+
">=": greaterThanEqMatcher,
|
|
3404
|
+
regex: regexMatcher,
|
|
3405
|
+
starts_with: (cell, cond) => String(cell).startsWith(String(cond.value)),
|
|
3406
|
+
ends_with: (cell, cond) => String(cell).endsWith(String(cond.value))
|
|
3407
|
+
};
|
|
3408
|
+
function isValidOperator(op) {
|
|
3409
|
+
return Object.values(FilterOperatorEnum).includes(op);
|
|
3410
|
+
}
|
|
3411
|
+
var FILTER_TYPES = ["string", "number", "date", "boolean"];
|
|
3412
|
+
function isValidFilterType(t) {
|
|
3413
|
+
return FILTER_TYPES.includes(t);
|
|
3414
|
+
}
|
|
3415
|
+
function escapeRegExp(str) {
|
|
3416
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3417
|
+
}
|
|
3418
|
+
function parseLocaleNumber(value, locale2) {
|
|
3419
|
+
var _a, _b;
|
|
3420
|
+
if (typeof value === "number") return value;
|
|
3421
|
+
let str = String(value != null ? value : "").trim();
|
|
3422
|
+
if (str.length === 0) return NaN;
|
|
3423
|
+
str = str.replace(/\s|\u00A0/g, "");
|
|
3424
|
+
try {
|
|
3425
|
+
const parts = Intl.NumberFormat(locale2).formatToParts(12345.6);
|
|
3426
|
+
const group = (_a = parts.find((p) => p.type === "group")) == null ? void 0 : _a.value;
|
|
3427
|
+
const decimal = (_b = parts.find((p) => p.type === "decimal")) == null ? void 0 : _b.value;
|
|
3428
|
+
if (group) {
|
|
3429
|
+
str = str.replace(new RegExp(escapeRegExp(group), "g"), "");
|
|
3430
|
+
}
|
|
3431
|
+
if (decimal && decimal !== ".") {
|
|
3432
|
+
str = str.replace(new RegExp(escapeRegExp(decimal), "g"), ".");
|
|
3433
|
+
}
|
|
3434
|
+
} catch (e) {
|
|
3435
|
+
str = str.replace(/[,']/g, "");
|
|
3436
|
+
}
|
|
3437
|
+
const n = Number(str);
|
|
3438
|
+
return Number.isFinite(n) ? n : NaN;
|
|
3439
|
+
}
|
|
3440
|
+
var _logger = console;
|
|
3441
|
+
function setLogger(logger) {
|
|
3442
|
+
_logger = { ..._logger, ...logger };
|
|
3443
|
+
}
|
|
3444
|
+
function getLogger() {
|
|
3445
|
+
return _logger;
|
|
3446
|
+
}
|
|
3447
|
+
function parseFilter(raw, type, defaultOperator = "like") {
|
|
3448
|
+
var _a, _b;
|
|
3449
|
+
if (typeof raw !== "string") return { operator: defaultOperator, value: raw, type };
|
|
3450
|
+
const trimmed = raw.trim();
|
|
3451
|
+
if (trimmed.length === 0) return { operator: defaultOperator, value: "", type };
|
|
3452
|
+
const opMatch = /^([<>!=]=?|not_like)\s*(.*)$/i.exec(trimmed);
|
|
3453
|
+
if (opMatch) {
|
|
3454
|
+
let op = String((_a = opMatch[1]) != null ? _a : "").toLowerCase();
|
|
3455
|
+
const rest = (_b = opMatch[2]) != null ? _b : "";
|
|
3456
|
+
if (op === "!") op = "not_like";
|
|
3457
|
+
if (type === "string" && op === "!=") op = "not_like";
|
|
3458
|
+
if (type === "number") {
|
|
3459
|
+
const n = parseLocaleNumber(rest);
|
|
3460
|
+
if (!isValidOperator(op)) {
|
|
3461
|
+
getLogger().warn("parseFilter: unknown operator", op, "falling back to defaultOperator");
|
|
3462
|
+
return { operator: defaultOperator, value: n, type };
|
|
3463
|
+
}
|
|
3464
|
+
return { operator: op, value: n, type };
|
|
3465
|
+
}
|
|
3466
|
+
if (!isValidOperator(op)) {
|
|
3467
|
+
getLogger().warn("parseFilter: unknown operator", op, "falling back to defaultOperator");
|
|
3468
|
+
return { operator: defaultOperator, value: rest, type };
|
|
3469
|
+
}
|
|
3470
|
+
return { operator: op, value: rest, type };
|
|
3471
|
+
}
|
|
3472
|
+
if (type === "number") {
|
|
3473
|
+
const n = parseLocaleNumber(trimmed);
|
|
3474
|
+
return { operator: defaultOperator, value: n, type };
|
|
3475
|
+
}
|
|
3476
|
+
return { operator: defaultOperator, value: trimmed, type };
|
|
3477
|
+
}
|
|
3478
|
+
function matchCell(cellValue, condition) {
|
|
3479
|
+
const matcher = FILTER_MATCHERS[condition.operator];
|
|
3480
|
+
if (!matcher) throw new Error(`Unknown filter operator: ${condition.operator}`);
|
|
3481
|
+
return matcher(cellValue, condition);
|
|
3482
|
+
}
|
|
3483
|
+
|
|
3349
3484
|
// src/HelperFns/tableHelpers.ts
|
|
3350
3485
|
var normalizeOperator = (op) => op === "!" ? "not_like" : op;
|
|
3351
3486
|
function getColumnIdentifierCompat(col) {
|
|
@@ -3485,7 +3620,7 @@ var formatFiltersForAPI = (params, columns) => {
|
|
|
3485
3620
|
const isBareNumeric = typeof rawValue === "number";
|
|
3486
3621
|
const isBareString = typeof rawValue === "string" && rawStr !== "" && !rawStr.startsWith("=");
|
|
3487
3622
|
if (opStr === "=" && (isBareNumeric || isBareString && rawStr !== "")) {
|
|
3488
|
-
operator = "like"
|
|
3623
|
+
operator = "like" /* LIKE */;
|
|
3489
3624
|
} else {
|
|
3490
3625
|
operator = filter.operator;
|
|
3491
3626
|
}
|
|
@@ -3500,14 +3635,12 @@ var formatFiltersForAPI = (params, columns) => {
|
|
|
3500
3635
|
operator,
|
|
3501
3636
|
id: column.id
|
|
3502
3637
|
};
|
|
3503
|
-
if (isColumnNumberType(column)) {
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
filterObj.operator = formatted.operator;
|
|
3510
|
-
}
|
|
3638
|
+
if (isColumnNumberType(column) && !operatorExtracted) {
|
|
3639
|
+
const formatted = formatNumberFilterValue(stringValue);
|
|
3640
|
+
if (formatted.value !== "") {
|
|
3641
|
+
filterObj.value = formatted.value;
|
|
3642
|
+
if ((filter == null ? void 0 : filter.operator) === void 0) {
|
|
3643
|
+
filterObj.operator = formatted.operator;
|
|
3511
3644
|
}
|
|
3512
3645
|
}
|
|
3513
3646
|
}
|
|
@@ -3556,7 +3689,7 @@ var formatFiltersForTabulator = (apiFilters, columns) => {
|
|
|
3556
3689
|
formattedValue = `${dayjsWithPlugins_default(start).format("YYYY-MM-DD")} to ${dayjsWithPlugins_default(end).format("YYYY-MM-DD")}`;
|
|
3557
3690
|
} else if (filter.operator === "not_like") {
|
|
3558
3691
|
formattedValue = `!${filter.value}`;
|
|
3559
|
-
} else if (filter.operator === "like") {
|
|
3692
|
+
} else if (filter.operator === "like" /* LIKE */) {
|
|
3560
3693
|
formattedValue = `${filter.value}`;
|
|
3561
3694
|
} else if (filter.operator === "!" || filter.operator === "!=") {
|
|
3562
3695
|
formattedValue = `${filter.operator}${filter.value}`;
|
|
@@ -3615,139 +3748,6 @@ var onTableCellClick = ({ cell, columns, tableConfig, pivotData }) => {
|
|
|
3615
3748
|
}
|
|
3616
3749
|
};
|
|
3617
3750
|
|
|
3618
|
-
// src/HelperFns/filterEngine.ts
|
|
3619
|
-
var FilterOperatorEnum = /* @__PURE__ */ ((FilterOperatorEnum2) => {
|
|
3620
|
-
FilterOperatorEnum2["LIKE"] = "like";
|
|
3621
|
-
FilterOperatorEnum2["NOT_LIKE"] = "not_like";
|
|
3622
|
-
FilterOperatorEnum2["EQ"] = "=";
|
|
3623
|
-
FilterOperatorEnum2["NEQ"] = "!=";
|
|
3624
|
-
FilterOperatorEnum2["LT"] = "<";
|
|
3625
|
-
FilterOperatorEnum2["GT"] = ">";
|
|
3626
|
-
FilterOperatorEnum2["LTE"] = "<=";
|
|
3627
|
-
FilterOperatorEnum2["GTE"] = ">=";
|
|
3628
|
-
FilterOperatorEnum2["REGEX"] = "regex";
|
|
3629
|
-
FilterOperatorEnum2["STARTS_WITH"] = "starts_with";
|
|
3630
|
-
FilterOperatorEnum2["ENDS_WITH"] = "ends_with";
|
|
3631
|
-
return FilterOperatorEnum2;
|
|
3632
|
-
})(FilterOperatorEnum || {});
|
|
3633
|
-
var likeMatcher = (cell, cond) => {
|
|
3634
|
-
var _a;
|
|
3635
|
-
if (cell == null) return false;
|
|
3636
|
-
const needle = String((_a = cond.value) != null ? _a : "").toLowerCase();
|
|
3637
|
-
if (needle.length === 0) return false;
|
|
3638
|
-
return String(cell).toLowerCase().includes(needle);
|
|
3639
|
-
};
|
|
3640
|
-
var notLikeMatcher = (cell, cond) => {
|
|
3641
|
-
var _a;
|
|
3642
|
-
if (cell == null) return false;
|
|
3643
|
-
const needle = String((_a = cond.value) != null ? _a : "").toLowerCase();
|
|
3644
|
-
if (needle.length === 0) return true;
|
|
3645
|
-
return !String(cell).toLowerCase().includes(needle);
|
|
3646
|
-
};
|
|
3647
|
-
var equalMatcher = (cell, cond) => {
|
|
3648
|
-
if (cond.type === "number") return Number(cell) === Number(cond.value);
|
|
3649
|
-
return String(cell) === String(cond.value);
|
|
3650
|
-
};
|
|
3651
|
-
var notEqualMatcher = (cell, cond) => {
|
|
3652
|
-
return !equalMatcher(cell, cond);
|
|
3653
|
-
};
|
|
3654
|
-
var lessThanMatcher = (cell, cond) => Number(cell) < Number(cond.value);
|
|
3655
|
-
var lessThanEqMatcher = (cell, cond) => Number(cell) <= Number(cond.value);
|
|
3656
|
-
var greaterThanMatcher = (cell, cond) => Number(cell) > Number(cond.value);
|
|
3657
|
-
var greaterThanEqMatcher = (cell, cond) => Number(cell) >= Number(cond.value);
|
|
3658
|
-
var regexMatcher = (cell, cond) => {
|
|
3659
|
-
const reg = new RegExp(String(cond.value));
|
|
3660
|
-
return reg.test(String(cell));
|
|
3661
|
-
};
|
|
3662
|
-
var FILTER_MATCHERS = {
|
|
3663
|
-
like: likeMatcher,
|
|
3664
|
-
not_like: notLikeMatcher,
|
|
3665
|
-
"=": equalMatcher,
|
|
3666
|
-
"!=": notEqualMatcher,
|
|
3667
|
-
"<": lessThanMatcher,
|
|
3668
|
-
"<=": lessThanEqMatcher,
|
|
3669
|
-
">": greaterThanMatcher,
|
|
3670
|
-
">=": greaterThanEqMatcher,
|
|
3671
|
-
regex: regexMatcher,
|
|
3672
|
-
starts_with: (cell, cond) => String(cell).startsWith(String(cond.value)),
|
|
3673
|
-
ends_with: (cell, cond) => String(cell).endsWith(String(cond.value))
|
|
3674
|
-
};
|
|
3675
|
-
function isValidOperator(op) {
|
|
3676
|
-
return Object.values(FilterOperatorEnum).includes(op);
|
|
3677
|
-
}
|
|
3678
|
-
var FILTER_TYPES = ["string", "number", "date", "boolean"];
|
|
3679
|
-
function isValidFilterType(t) {
|
|
3680
|
-
return FILTER_TYPES.includes(t);
|
|
3681
|
-
}
|
|
3682
|
-
function escapeRegExp(str) {
|
|
3683
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3684
|
-
}
|
|
3685
|
-
function parseLocaleNumber(value, locale2) {
|
|
3686
|
-
var _a, _b;
|
|
3687
|
-
if (typeof value === "number") return value;
|
|
3688
|
-
let str = String(value != null ? value : "").trim();
|
|
3689
|
-
if (str.length === 0) return NaN;
|
|
3690
|
-
str = str.replace(/\s|\u00A0/g, "");
|
|
3691
|
-
try {
|
|
3692
|
-
const parts = Intl.NumberFormat(locale2).formatToParts(12345.6);
|
|
3693
|
-
const group = (_a = parts.find((p) => p.type === "group")) == null ? void 0 : _a.value;
|
|
3694
|
-
const decimal = (_b = parts.find((p) => p.type === "decimal")) == null ? void 0 : _b.value;
|
|
3695
|
-
if (group) {
|
|
3696
|
-
str = str.replace(new RegExp(escapeRegExp(group), "g"), "");
|
|
3697
|
-
}
|
|
3698
|
-
if (decimal && decimal !== ".") {
|
|
3699
|
-
str = str.replace(new RegExp(escapeRegExp(decimal), "g"), ".");
|
|
3700
|
-
}
|
|
3701
|
-
} catch (e) {
|
|
3702
|
-
str = str.replace(/[,']/g, "");
|
|
3703
|
-
}
|
|
3704
|
-
const n = Number(str);
|
|
3705
|
-
return Number.isFinite(n) ? n : NaN;
|
|
3706
|
-
}
|
|
3707
|
-
var _logger = console;
|
|
3708
|
-
function setLogger(logger) {
|
|
3709
|
-
_logger = { ..._logger, ...logger };
|
|
3710
|
-
}
|
|
3711
|
-
function getLogger() {
|
|
3712
|
-
return _logger;
|
|
3713
|
-
}
|
|
3714
|
-
function parseFilter(raw, type, defaultOperator = "like") {
|
|
3715
|
-
var _a, _b;
|
|
3716
|
-
if (typeof raw !== "string") return { operator: defaultOperator, value: raw, type };
|
|
3717
|
-
const trimmed = raw.trim();
|
|
3718
|
-
if (trimmed.length === 0) return { operator: defaultOperator, value: "", type };
|
|
3719
|
-
const opMatch = /^([<>!=]=?|not_like)\s*(.*)$/i.exec(trimmed);
|
|
3720
|
-
if (opMatch) {
|
|
3721
|
-
let op = String((_a = opMatch[1]) != null ? _a : "").toLowerCase();
|
|
3722
|
-
const rest = (_b = opMatch[2]) != null ? _b : "";
|
|
3723
|
-
if (op === "!") op = "not_like";
|
|
3724
|
-
if (type === "string" && op === "!=") op = "not_like";
|
|
3725
|
-
if (type === "number") {
|
|
3726
|
-
const n = parseLocaleNumber(rest);
|
|
3727
|
-
if (!isValidOperator(op)) {
|
|
3728
|
-
getLogger().warn("parseFilter: unknown operator", op, "falling back to defaultOperator");
|
|
3729
|
-
return { operator: defaultOperator, value: n, type };
|
|
3730
|
-
}
|
|
3731
|
-
return { operator: op, value: n, type };
|
|
3732
|
-
}
|
|
3733
|
-
if (!isValidOperator(op)) {
|
|
3734
|
-
getLogger().warn("parseFilter: unknown operator", op, "falling back to defaultOperator");
|
|
3735
|
-
return { operator: defaultOperator, value: rest, type };
|
|
3736
|
-
}
|
|
3737
|
-
return { operator: op, value: rest, type };
|
|
3738
|
-
}
|
|
3739
|
-
if (type === "number") {
|
|
3740
|
-
const n = parseLocaleNumber(trimmed);
|
|
3741
|
-
return { operator: defaultOperator, value: n, type };
|
|
3742
|
-
}
|
|
3743
|
-
return { operator: defaultOperator, value: trimmed, type };
|
|
3744
|
-
}
|
|
3745
|
-
function matchCell(cellValue, condition) {
|
|
3746
|
-
const matcher = FILTER_MATCHERS[condition.operator];
|
|
3747
|
-
if (!matcher) throw new Error(`Unknown filter operator: ${condition.operator}`);
|
|
3748
|
-
return matcher(cellValue, condition);
|
|
3749
|
-
}
|
|
3750
|
-
|
|
3751
3751
|
// src/HelperFns/columnHelpers.ts
|
|
3752
3752
|
var isColumnSummable = (col) => {
|
|
3753
3753
|
const type = col == null ? void 0 : col.type;
|
|
@@ -3946,7 +3946,7 @@ var matchesNumericFilterValue = (cell, filter) => {
|
|
|
3946
3946
|
};
|
|
3947
3947
|
var matchesStringFilter = (raw, haystack) => {
|
|
3948
3948
|
if (!raw.length) return false;
|
|
3949
|
-
const { operator = "like"
|
|
3949
|
+
const { operator = "like" /* LIKE */, cleanValue = raw.trim() } = extractOperatorFromValue(raw, "like" /* LIKE */) || {};
|
|
3950
3950
|
const needle = cleanValue.toLowerCase();
|
|
3951
3951
|
if (operator === "!" || operator === "!=") return !needle.length || !haystack.includes(needle);
|
|
3952
3952
|
return !!needle.length && haystack.includes(needle);
|
|
@@ -4031,7 +4031,7 @@ var createFilterFunction = ({
|
|
|
4031
4031
|
}
|
|
4032
4032
|
const raw = String(headerValue != null ? headerValue : "").trim();
|
|
4033
4033
|
const lowerValue = String(rowValue != null ? rowValue : "").toLowerCase();
|
|
4034
|
-
const cond = parseFilter(raw, "string", "like");
|
|
4034
|
+
const cond = parseFilter(raw, "string", "like" /* LIKE */);
|
|
4035
4035
|
return matchCell(lowerValue, { ...cond, type: "string", value: String(cond.value).toLowerCase() });
|
|
4036
4036
|
};
|
|
4037
4037
|
}
|
|
@@ -5169,7 +5169,7 @@ var filterDataByColumn = (data = [], columns = [], columnIndex, value, operator,
|
|
|
5169
5169
|
if ((filterValue === "0" || filterValue === 0) && (colType === "QUANTITY" /* QUANTITY */ || colType === "DOLLAR_AMT" /* DOLLAR_AMT */)) {
|
|
5170
5170
|
filterValue = Number(filterValue);
|
|
5171
5171
|
}
|
|
5172
|
-
const op = (operator != null ? operator : "like").toString().toLowerCase();
|
|
5172
|
+
const op = (operator != null ? operator : "like" /* LIKE */).toString().toLowerCase();
|
|
5173
5173
|
const isNil = (v) => v === void 0 || v === null;
|
|
5174
5174
|
const toStr = (v) => String(v != null ? v : "");
|
|
5175
5175
|
const ci = (v) => toStr(v).toLowerCase();
|
|
@@ -5180,7 +5180,7 @@ var filterDataByColumn = (data = [], columns = [], columnIndex, value, operator,
|
|
|
5180
5180
|
if (!/,/.test(s) && !/\s+to\s+/.test(s)) return [s];
|
|
5181
5181
|
return s.split(/\s*,\s*|\s+to\s+/);
|
|
5182
5182
|
};
|
|
5183
|
-
if (op === "like" || op === "includes" || op === "contains") {
|
|
5183
|
+
if (op === "like" /* LIKE */ || op === "includes" || op === "contains") {
|
|
5184
5184
|
if (colType === "DATE" /* DATE */) {
|
|
5185
5185
|
return data.concat().filter((row) => {
|
|
5186
5186
|
var _a;
|
|
@@ -8015,7 +8015,7 @@ var constructFilter = ({ column, value }) => {
|
|
|
8015
8015
|
const isoDateEnd = isoDate.endOf(precision).toISOString();
|
|
8016
8016
|
formattedValue = `${isoDateStart},${isoDateEnd}`;
|
|
8017
8017
|
operator = "between";
|
|
8018
|
-
columnType = "
|
|
8018
|
+
columnType = "DATE" /* DATE */;
|
|
8019
8019
|
} else if (isColumnNumberType(column)) {
|
|
8020
8020
|
formattedValue = `${value}`;
|
|
8021
8021
|
operator = "=";
|
|
@@ -11018,6 +11018,30 @@ var reportProblem = ({
|
|
|
11018
11018
|
return Promise.reject((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data);
|
|
11019
11019
|
});
|
|
11020
11020
|
};
|
|
11021
|
+
var fetchLLMSummary = ({
|
|
11022
|
+
data,
|
|
11023
|
+
queryID,
|
|
11024
|
+
domain,
|
|
11025
|
+
apiKey,
|
|
11026
|
+
token
|
|
11027
|
+
} = {}) => {
|
|
11028
|
+
if (!data) {
|
|
11029
|
+
return Promise.reject(new Error("No data supplied" /* NO_DATA_SUPPLIED */));
|
|
11030
|
+
}
|
|
11031
|
+
if (!token || !domain || !apiKey) {
|
|
11032
|
+
return Promise.reject(new Error("Unauthenticated" /* UNAUTHENTICATED */));
|
|
11033
|
+
}
|
|
11034
|
+
const url = `${domain}/autoql/api/v1/query/${queryID}/summary?key=${apiKey}`;
|
|
11035
|
+
const config = {
|
|
11036
|
+
headers: {
|
|
11037
|
+
Authorization: `Bearer ${token}`
|
|
11038
|
+
}
|
|
11039
|
+
};
|
|
11040
|
+
return import_axios.default.post(url, data, config).then((response) => Promise.resolve(response)).catch((error) => {
|
|
11041
|
+
var _a;
|
|
11042
|
+
return Promise.reject((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data);
|
|
11043
|
+
});
|
|
11044
|
+
};
|
|
11021
11045
|
|
|
11022
11046
|
// src/Api/dataExplorerService.ts
|
|
11023
11047
|
var isAggSeed = (subject) => {
|
|
@@ -13049,6 +13073,7 @@ function color() {
|
|
|
13049
13073
|
fetchDataPreview,
|
|
13050
13074
|
fetchExploreQueries,
|
|
13051
13075
|
fetchFilters,
|
|
13076
|
+
fetchLLMSummary,
|
|
13052
13077
|
fetchNotification,
|
|
13053
13078
|
fetchNotificationChannels,
|
|
13054
13079
|
fetchNotificationCount,
|