react-semaphor 0.1.526 → 0.1.528
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/DATA_APP_SDK.md +5 -1
- package/dist/analytics-protocol/index.js +1190 -296
- package/dist/brand-studio/index.js +15 -15
- package/dist/briefings/index.js +50 -49
- package/dist/chunks/{calculated-field-identity-D1ofR4KJ.js → calculated-field-identity-DUu-tCQw.js} +66 -65
- package/dist/chunks/{card-config-utils-9sv4e-Vb.js → card-config-utils-BdPceiw8.js} +68 -65
- package/dist/chunks/{constants-DeLIHVAW.js → constants-DNWVy8Y3.js} +4 -4
- package/dist/chunks/dashboard-BkskKMck.js +14 -0
- package/dist/chunks/{dashboard-briefing-launcher-DXz1GhFZ.js → dashboard-briefing-launcher-Bb0RhGRC.js} +372 -359
- package/dist/chunks/{dashboard-controls-Df8qOSrs.js → dashboard-controls-loWTHPMi.js} +739 -686
- package/dist/chunks/{dashboard-json-Xldp0qww.js → dashboard-json-DUci_SOR.js} +10 -10
- package/dist/chunks/{edit-dashboard-visual-COHBqyic.js → edit-dashboard-visual-z9WN26w7.js} +6603 -6572
- package/dist/chunks/{editor-action-buttons-DahlP57T.js → editor-action-buttons-CGSFK9S-.js} +266 -267
- package/dist/chunks/{field-aggregations-BQjogiI1.js → field-aggregations-CdXSo1pb.js} +19 -19
- package/dist/chunks/{field-dependencies-v-lJNzC7.js → field-dependencies-CGYic38w.js} +1 -1
- package/dist/chunks/{index-CbjuruKe.js → index-CTYnXU85.js} +781 -780
- package/dist/chunks/{matrix-analytical-definition-BimC4XIV.js → matrix-analytical-definition-BJyH5-99.js} +1 -1
- package/dist/chunks/{matrix-card-CIlz0Dnp.js → matrix-card-DhykwdZs.js} +7 -6
- package/dist/chunks/{matrix-control-sources-2VAzGlt8.js → matrix-control-sources-BV9ywFtJ.js} +11 -11
- package/dist/chunks/{matrix-definition-E5gXXSTZ.js → matrix-definition-Cdn3LoxW.js} +3 -3
- package/dist/chunks/{semantic-format-Baqp8kD_.js → matrix-formatter-1Mm8x8w7.js} +655 -511
- package/dist/chunks/{matrix-member-presentation-Bw7-JCrr.js → matrix-member-presentation-BBW0n1iY.js} +1 -1
- package/dist/chunks/matrix-operation-contract-Dp7kFpVk.js +1383 -0
- package/dist/chunks/{metric-comparison-BphoJ9bq.js → metric-comparison-Crljx_XY.js} +15 -10
- package/dist/chunks/{numeric-presentation-VhMUHfrJ.js → numeric-presentation-LvnNY5Ma.js} +68 -68
- package/dist/chunks/pivot-header-presentation-CZa3556D.js +618 -0
- package/dist/chunks/{pivot-result-identity-BzUQiCEV.js → pivot-result-identity-CY__BuwI.js} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-BFO354lk.js → pivot-result-lifecycle-Bqdtknud.js} +259 -204
- package/dist/chunks/{raw-temporal-7bFbXd2a.js → raw-temporal-CdnA_OXJ.js} +10 -10
- package/dist/chunks/{raw-temporal-contract-BQZIJ1fn.js → raw-temporal-contract-Bc9z83t-.js} +1 -1
- package/dist/chunks/relative-date-DAF9J7mt.js +456 -0
- package/dist/chunks/{report-preferences-dialog-BcH-0lR-.js → report-preferences-dialog-VV0-Ro6F.js} +131 -132
- package/dist/chunks/{report-runtime-context-CxIoGyNM.js → report-runtime-context-CtaGGlit.js} +1 -1
- package/dist/chunks/{selection-reducer-NF5C07yM.js → selection-reducer-IZjBSU6Z.js} +47 -26
- package/dist/chunks/semantic-format-BBLvfwua.js +192 -0
- package/dist/chunks/{semaphor-ready-indicator-BLRDuLr4.js → semaphor-ready-indicator-DbA4mVQL.js} +49909 -46207
- package/dist/chunks/{slider-BYIH4icg.js → slider-DpiJG8lv.js} +81 -82
- package/dist/chunks/{source-entity-resolution-Bzefiive.js → source-entity-resolution-Bde29mqE.js} +25 -25
- package/dist/chunks/switch-C4YH-W1X.js +24003 -0
- package/dist/chunks/{temporal-bucket-PcLFSYWX.js → temporal-bucket-DlFuhCnT.js} +6 -6
- package/dist/chunks/{temporal-bucket-contract-DTLDRzgV.js → temporal-bucket-contract-C6lUGPS3.js} +1 -1
- package/dist/chunks/temporal-input-presentation-DyMWCZYh.js +195 -0
- package/dist/chunks/{token-types-BC6RcUY8.js → token-types-UjyNz95-.js} +1 -1
- package/dist/chunks/{validators-CsdOtZI6.js → validators-CQcG0EPN.js} +852 -731
- package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +138 -137
- package/dist/data-app-sdk/index.js +12 -12
- package/dist/data-app-sdk-adapters/index.js +23 -22
- package/dist/data-app-sdk-validation/index.js +27 -26
- package/dist/format-utils/index.js +247 -329
- package/dist/index.js +165 -168
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/briefings/index.d.ts +3 -0
- package/dist/types/components/explorer/filters/card-date-filter.d.ts +13 -5
- package/dist/types/components/explorer/filters/card-date-selection.d.ts +28 -0
- package/dist/types/components/sharing-and-management/dashboard-actions-menu.d.ts +1 -1
- package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +0 -1
- package/dist/types/components/surfboard/download-settings-dialog.d.ts +8 -0
- package/dist/types/components/surfboard/filter/types.d.ts +8 -29
- package/dist/types/components/surfboard/filter/use-dashboard-filter-mapping-popover.d.ts +5 -1
- package/dist/types/components/ui-custom/date-range-picker.d.ts +18 -2
- package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -21
- package/dist/types/components/ui-custom/report-calendar.d.ts +18 -0
- package/dist/types/components/visual/aggregated-table/utils/export-utils.d.ts +3 -5
- package/dist/types/components/visual/data-table/data-table-toolbar.d.ts +1 -1
- package/dist/types/components/visual/pivot-table/utils/pivot-table-export-utils.d.ts +3 -1
- package/dist/types/index.js +5 -5
- package/dist/types/lib/api/exports-api.d.ts +3 -0
- package/dist/types/lib/csv-download.d.ts +9 -0
- package/dist/types/lib/csv-encoding-options.d.ts +6 -0
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +2 -1
- package/dist/types/lib/dashboard-navigation/build-carried-click-context.d.ts +0 -1
- package/dist/types/lib/document/document-input-runtime.d.ts +2 -1
- package/dist/types/lib/export-utils.d.ts +17 -15
- package/dist/types/lib/hooks/explorer/use-filter-builder.d.ts +2 -2
- package/dist/types/lib/hooks/use-relative-date-summarizer.d.ts +7 -0
- package/dist/types/lib/matrix-table/matrix-application-adapter.d.ts +3 -2
- package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
- package/dist/types/lib/matrix-table/matrix-card-draft.d.ts +1 -1
- package/dist/types/lib/matrix-table/matrix-dataset-history.d.ts +47 -0
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +7 -3
- package/dist/types/lib/matrix-table/matrix-execution-context.d.ts +2 -0
- package/dist/types/lib/matrix-table/matrix-query-transport.d.ts +4 -1
- package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +105 -4
- package/dist/types/lib/matrix-table/matrix-runtime.d.ts +43 -2
- package/dist/types/lib/matrix-table/use-matrix.d.ts +6 -0
- package/dist/types/lib/query-context/build-card-query-context.d.ts +5 -1
- package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +0 -1
- package/dist/types/lib/query-context/build-global-date-comparison-context.d.ts +1 -2
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +1 -2
- package/dist/types/lib/query-context/dashboard-card-query-key.d.ts +10 -0
- package/dist/types/lib/query-context/query-auth-scope.d.ts +5 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +9 -4
- package/dist/types/lib/temporal-filter/temporal-filter-utils.d.ts +9 -2
- package/dist/types/lib/types/common-types.d.ts +5 -0
- package/dist/types/lib/types/explorer-types.d.ts +14 -0
- package/dist/types/lib/types/semantic-types.d.ts +4 -2
- package/dist/types/lib/types/token-types.d.ts +0 -1
- package/dist/types/lib/utils/aggregate-expression-utils.d.ts +0 -4
- package/dist/types/lib/utils/card-definition.d.ts +1 -1
- package/dist/types/lib/utils/date-timezone-utils.d.ts +4 -46
- package/dist/types/lib/utils/filter-default-value-utils.d.ts +8 -2
- package/dist/types/lib/utils/inline-filter-utils.d.ts +3 -2
- package/dist/types/lib/utils/relative-date-description.d.ts +38 -0
- package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +89 -0
- package/dist/types/shared/analytics-protocol/analytics-refusal.d.ts +32 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +48 -7
- package/dist/types/shared/analytics-protocol/index.d.ts +15 -1
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +20 -20
- package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +10 -10
- package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +8 -8
- package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +61 -6
- package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +63 -0
- package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +9 -3
- package/dist/types/shared/analytics-protocol/operation-temporal-state.d.ts +64 -0
- package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +61 -0
- package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +20 -0
- package/dist/types/shared/analytics-protocol/runtime-schemas.d.ts +0 -2
- package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +314 -0
- package/dist/types/shared/analytics-protocol/time-window.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +8 -4
- package/dist/types/shared/format-utils/exporters/csv-utils.d.ts +46 -15
- package/dist/types/shared/format-utils/exporters/index.d.ts +2 -3
- package/dist/types/shared/format-utils/flat-table-export-totals.d.ts +2 -1
- package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +2 -2
- package/dist/types/shared/format-utils/types/format-types.d.ts +0 -42
- package/dist/types/shared/temporal/calendar-periods.d.ts +56 -0
- package/dist/types/shared/temporal/index.d.ts +5 -0
- package/dist/types/shared/temporal/relative-date.d.ts +21 -0
- package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +73 -0
- package/dist/types/shared/temporal/time-window-periods.d.ts +21 -0
- package/dist/types/shared/temporal/zoned-wall-clock.d.ts +23 -0
- package/package.json +1 -17
- package/src/data-app-sdk/README.md +6 -3
- package/dist/chunks/code-highlight-994tgM9v.js +0 -22265
- package/dist/chunks/dashboard-CsHvEtjN.js +0 -15
- package/dist/chunks/dashboard-date-comparison-definition-BqNhECUr.js +0 -183
- package/dist/chunks/matrix-formatter-WBgtebUT.js +0 -341
- package/dist/chunks/matrix-operation-contract-D32U2CSw.js +0 -1802
- package/dist/chunks/mouse-pointer-2-BZvGk45-.js +0 -19
- package/dist/chunks/pivot-header-presentation-CGtudHo7.js +0 -661
- package/dist/chunks/pre-block-Cq1RqhZX.js +0 -3987
- package/dist/chunks/search-CJz-QQ0Q.js +0 -24
- package/dist/chunks/switch-XaAACBrJ.js +0 -2234
- package/dist/chunks/temporal-input-presentation-2RJrvmYL.js +0 -222
- package/dist/chunks/update-policy-DhAUtiC8.js +0 -913
- package/dist/data-app-builder/index.js +0 -3666
- package/dist/data-app-builder-browser-runtime/index.js +0 -8
- package/dist/data-app-codegen/index.js +0 -22
- package/dist/data-app-codegen-node/index.js +0 -1807
- package/dist/types/components/data-app-runtime/published-data-app-runtime.d.ts +0 -7
- package/dist/types/components/surfboard/json-to-csv.d.ts +0 -7
- package/dist/types/components/visual/data-table/utils/export-utils.d.ts +0 -31
- package/dist/types/data-app-builder/browser-runtime.d.ts +0 -174
- package/dist/types/data-app-builder/constants.d.ts +0 -14
- package/dist/types/data-app-builder/data-app-builder.d.ts +0 -14
- package/dist/types/data-app-builder/index.d.ts +0 -1
- package/dist/types/data-app-builder/lib/api.d.ts +0 -36
- package/dist/types/data-app-builder/lib/context-select.d.ts +0 -3
- package/dist/types/data-app-builder/lib/diagnostics.d.ts +0 -12
- package/dist/types/data-app-builder/lib/file-tree.d.ts +0 -2
- package/dist/types/data-app-builder/types.d.ts +0 -558
- package/dist/types/data-app-builder-browser-runtime.d.ts +0 -2
- package/dist/types/data-app-builder.d.ts +0 -2
- package/dist/types/data-app-codegen/generate-contract.d.ts +0 -26
- package/dist/types/data-app-codegen/generated-contract-files.d.ts +0 -7
- package/dist/types/data-app-codegen/generated-contract-validation.d.ts +0 -13
- package/dist/types/data-app-codegen/index.d.ts +0 -6
- package/dist/types/data-app-codegen/live-execution.d.ts +0 -42
- package/dist/types/data-app-codegen/node.d.ts +0 -2
- package/dist/types/data-app-codegen/update-policy.d.ts +0 -25
- package/dist/types/data-app-codegen/validation.d.ts +0 -8
- package/dist/types/data-app-codegen-node.d.ts +0 -2
- package/dist/types/data-app-codegen.d.ts +0 -2
- package/dist/types/shared/analytics-protocol/data-app-codegen-summary.d.ts +0 -418
- package/dist/types/shared/format-utils/exporters/pivot-exporter.d.ts +0 -13
- package/dist/types/shared/format-utils/exporters/table-exporter.d.ts +0 -10
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var B = Object.defineProperty;
|
|
2
2
|
var ee = (e, t, r) => t in e ? B(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var b = (e, t, r) => ee(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
-
import { i as g } from "./validators-
|
|
5
|
-
import { p as te } from "./raw-temporal-contract-
|
|
4
|
+
import { i as g } from "./validators-CQcG0EPN.js";
|
|
5
|
+
import { p as te } from "./raw-temporal-contract-Bc9z83t-.js";
|
|
6
6
|
import { canonicalizeSupportedLocale as ne } from "../value-format-preferences/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import { d as h, t as U } from "./temporal-bucket-DlFuhCnT.js";
|
|
8
8
|
function re(e) {
|
|
9
9
|
if (!e || typeof e != "object") return !1;
|
|
10
10
|
const t = e.type;
|
|
@@ -913,14 +913,14 @@ function Qe(e) {
|
|
|
913
913
|
}
|
|
914
914
|
export {
|
|
915
915
|
y as R,
|
|
916
|
-
|
|
917
|
-
|
|
916
|
+
We as a,
|
|
917
|
+
Ve as b,
|
|
918
918
|
Xe as c,
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
919
|
+
be as d,
|
|
920
|
+
Ge as e,
|
|
921
|
+
Re as f,
|
|
922
|
+
Qe as g,
|
|
923
|
+
Ne as h,
|
|
924
924
|
re as i,
|
|
925
925
|
$ as j,
|
|
926
926
|
G as p,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var d = Object.defineProperty;
|
|
2
2
|
var i = (a, e, t) => e in a ? d(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
3
3
|
var n = (a, e, t) => i(a, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { R as l } from "./validators-
|
|
4
|
+
import { R as l } from "./validators-CQcG0EPN.js";
|
|
5
5
|
class r extends Error {
|
|
6
6
|
constructor(t) {
|
|
7
7
|
super(t);
|
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
import { F } from "./validators-CQcG0EPN.js";
|
|
2
|
+
import { a as W, w as y, z as q } from "./zoned-wall-clock-BkxV9jS2.js";
|
|
3
|
+
function ut(t) {
|
|
4
|
+
return `compat-filter:${t}`;
|
|
5
|
+
}
|
|
6
|
+
function dt(t) {
|
|
7
|
+
return `compat-control:${t}`;
|
|
8
|
+
}
|
|
9
|
+
function lt(t, e) {
|
|
10
|
+
return `compat-inline-filter:${t}:${e}`;
|
|
11
|
+
}
|
|
12
|
+
function ct(t, e) {
|
|
13
|
+
return `compat-card-control:${t}:${e}`;
|
|
14
|
+
}
|
|
15
|
+
function U(t, e) {
|
|
16
|
+
const n = t.split(".").map((a) => a.trim()), o = e.split(".").map((a) => a.trim());
|
|
17
|
+
if (n.length === 0 || o.length === 0 || n.some((a) => !a) || o.some((a) => !a))
|
|
18
|
+
return !1;
|
|
19
|
+
const [s, i] = n.length <= o.length ? [n, o] : [o, n], r = i.length - s.length;
|
|
20
|
+
return s.every((a, d) => a === i[d + r]);
|
|
21
|
+
}
|
|
22
|
+
function j(t, e) {
|
|
23
|
+
const n = t.split("."), o = e.split("."), s = n.pop(), i = o.pop();
|
|
24
|
+
return !!(s && s === i && n.length > 0 && o.length > 0 && U(
|
|
25
|
+
n.join("."),
|
|
26
|
+
o.join(".")
|
|
27
|
+
));
|
|
28
|
+
}
|
|
29
|
+
function P(t) {
|
|
30
|
+
const e = t.map((o) => o.trim()).filter(Boolean);
|
|
31
|
+
if (e.every(
|
|
32
|
+
(o, s) => e.slice(s + 1).every(
|
|
33
|
+
(i) => U(o, i)
|
|
34
|
+
)
|
|
35
|
+
))
|
|
36
|
+
return [...e].sort(
|
|
37
|
+
(o, s) => s.split(".").length - o.split(".").length
|
|
38
|
+
)[0];
|
|
39
|
+
}
|
|
40
|
+
function m(t) {
|
|
41
|
+
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
42
|
+
}
|
|
43
|
+
function k(t) {
|
|
44
|
+
if (typeof t != "string") return "";
|
|
45
|
+
const e = t.split(".").map((n) => n.trim());
|
|
46
|
+
return e.length > 1 && e.every(Boolean) ? e.join(".") : "";
|
|
47
|
+
}
|
|
48
|
+
function I(t) {
|
|
49
|
+
if (typeof t != "string") return "";
|
|
50
|
+
const e = t.split(".").map((n) => n.trim());
|
|
51
|
+
return e.length > 0 && e.every(Boolean) ? e.join(".") : "";
|
|
52
|
+
}
|
|
53
|
+
function l(t) {
|
|
54
|
+
return typeof t == "string" ? t.trim() : "";
|
|
55
|
+
}
|
|
56
|
+
function O(t, e) {
|
|
57
|
+
return t.every(
|
|
58
|
+
(n, o) => t.slice(o + 1).every((s) => e(n, s))
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
function R(t, e) {
|
|
62
|
+
const n = l(t.id), o = l(t.name), s = l(e.entityId), i = l(e.entityName);
|
|
63
|
+
return !o || !s && !i ? !1 : (!s || s === n || s === o) && (!i || i === o);
|
|
64
|
+
}
|
|
65
|
+
function Q(t) {
|
|
66
|
+
const e = m(t.semanticContext) ? t.semanticContext : void 0, n = m(t.fieldMeta) ? t.fieldMeta : void 0, o = l(e == null ? void 0 : e.semanticDomainId), s = Array.isArray(e == null ? void 0 : e.selectedEntities) ? e.selectedEntities.filter(
|
|
67
|
+
(b) => m(b) && b.type === "dataset"
|
|
68
|
+
) : [];
|
|
69
|
+
if (!!!(o || s.length > 0 || (n == null ? void 0 : n.entityType) === "dataset")) return;
|
|
70
|
+
if (!o)
|
|
71
|
+
return { status: "unresolved", reason: "incomplete_source_identity" };
|
|
72
|
+
const r = l(n == null ? void 0 : n.entityId), a = l(n == null ? void 0 : n.entityName), d = !!(r || a), c = d ? s.filter(
|
|
73
|
+
(b) => R(b, {
|
|
74
|
+
entityId: r,
|
|
75
|
+
entityName: a
|
|
76
|
+
})
|
|
77
|
+
) : s;
|
|
78
|
+
if (c.length > 1)
|
|
79
|
+
return { status: "unresolved", reason: "incomplete_source_identity" };
|
|
80
|
+
if (d && s.length > 0 && c.length === 0)
|
|
81
|
+
return { status: "unresolved", reason: "divergent_source_identity" };
|
|
82
|
+
const u = c[0], f = l(u == null ? void 0 : u.domainId), _ = l(u == null ? void 0 : u.id), g = l(u == null ? void 0 : u.name);
|
|
83
|
+
if (f && f !== o)
|
|
84
|
+
return { status: "unresolved", reason: "divergent_source_identity" };
|
|
85
|
+
const $ = _, w = g || a;
|
|
86
|
+
return w ? {
|
|
87
|
+
status: "resolved",
|
|
88
|
+
source: {
|
|
89
|
+
kind: "semantic",
|
|
90
|
+
domainId: o,
|
|
91
|
+
datasetName: w,
|
|
92
|
+
...$ ? { datasetId: $ } : {}
|
|
93
|
+
}
|
|
94
|
+
} : { status: "unresolved", reason: "incomplete_source_identity" };
|
|
95
|
+
}
|
|
96
|
+
function Y(t, e) {
|
|
97
|
+
const n = l(t.connectionId), o = m(t.semanticContext) ? t.semanticContext : void 0, s = l(o == null ? void 0 : o.connectionId);
|
|
98
|
+
if (n && s && n !== s)
|
|
99
|
+
return { status: "unresolved", reason: "divergent_source_identity" };
|
|
100
|
+
const i = n || s, r = m(t.fieldMeta) ? t.fieldMeta : void 0, a = e.split(".").slice(0, -1).join("."), d = I(t.qualifiedTableName), c = I(
|
|
101
|
+
r == null ? void 0 : r.qualifiedEntityName
|
|
102
|
+
), u = [
|
|
103
|
+
d,
|
|
104
|
+
c,
|
|
105
|
+
a
|
|
106
|
+
].filter(Boolean), f = P(u);
|
|
107
|
+
return !f && u.length > 0 ? { status: "unresolved", reason: "divergent_source_identity" } : !i || !f ? { status: "unresolved", reason: "incomplete_source_identity" } : {
|
|
108
|
+
status: "resolved",
|
|
109
|
+
source: { kind: "physical", connectionId: i, tableName: f }
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function H(t, e) {
|
|
113
|
+
const n = m(t.fieldMeta) ? t.fieldMeta : void 0, o = typeof (n == null ? void 0 : n.qualifiedFieldName) == "string" ? n.qualifiedFieldName.trim() : "", s = k(
|
|
114
|
+
n == null ? void 0 : n.qualifiedFieldName
|
|
115
|
+
), i = typeof t.column == "string" ? t.column.trim() : "", r = k(i), a = typeof t.qualifiedTableName == "string" ? t.qualifiedTableName.trim() : "", d = I(
|
|
116
|
+
t.qualifiedTableName
|
|
117
|
+
);
|
|
118
|
+
if (o && !s || e && a && !d || i.includes(".") && !r)
|
|
119
|
+
return { status: "unresolved", reason: "incomplete_field_identity" };
|
|
120
|
+
const c = r.split("."), u = r ? c[c.length - 1] : i, f = e && d && u ? `${d}.${u}` : "", _ = [
|
|
121
|
+
s,
|
|
122
|
+
r,
|
|
123
|
+
f
|
|
124
|
+
].filter(Boolean);
|
|
125
|
+
if (!O(
|
|
126
|
+
_,
|
|
127
|
+
j
|
|
128
|
+
))
|
|
129
|
+
return { status: "unresolved", reason: "divergent_field_identity" };
|
|
130
|
+
const g = r || s || f;
|
|
131
|
+
return g ? { status: "resolved", qualifiedFieldName: g } : { status: "unresolved", reason: "incomplete_field_identity" };
|
|
132
|
+
}
|
|
133
|
+
function G(t) {
|
|
134
|
+
if (!m(t))
|
|
135
|
+
return { status: "ineligible", reason: "invalid_input" };
|
|
136
|
+
if (t.kind === "global-date")
|
|
137
|
+
return { status: "eligible", kind: "global_date" };
|
|
138
|
+
const e = F(t.dataType);
|
|
139
|
+
if (e !== "date" && e !== "datetime")
|
|
140
|
+
return { status: "ineligible", reason: "non_date_filter" };
|
|
141
|
+
const n = m(t.fieldMeta) ? t.fieldMeta : void 0, o = F(
|
|
142
|
+
n == null ? void 0 : n.dataType
|
|
143
|
+
);
|
|
144
|
+
if ((n == null ? void 0 : n.dataType) !== void 0 && o !== "date" && o !== "datetime")
|
|
145
|
+
return { status: "ineligible", reason: "non_date_filter" };
|
|
146
|
+
if (t.customFilterPreferences)
|
|
147
|
+
return { status: "ineligible", reason: "custom_filter" };
|
|
148
|
+
if (t.targetColumns !== void 0 && (!Array.isArray(t.targetColumns) || t.targetColumns.length > 0))
|
|
149
|
+
return { status: "ineligible", reason: "multi_target_filter" };
|
|
150
|
+
const s = Q(t), i = H(t, s === void 0);
|
|
151
|
+
if (i.status === "unresolved")
|
|
152
|
+
return { status: "ineligible", reason: i.reason };
|
|
153
|
+
const r = s || Y(t, i.qualifiedFieldName);
|
|
154
|
+
return r.status === "resolved" ? {
|
|
155
|
+
status: "eligible",
|
|
156
|
+
kind: "field_date",
|
|
157
|
+
qualifiedFieldName: i.qualifiedFieldName,
|
|
158
|
+
source: r.source
|
|
159
|
+
} : { status: "ineligible", reason: r.reason };
|
|
160
|
+
}
|
|
161
|
+
function J(t) {
|
|
162
|
+
if (!m(t) || t.kind !== "filter" || !m(t.filter))
|
|
163
|
+
return { status: "ineligible", reason: "invalid_input" };
|
|
164
|
+
const e = G(
|
|
165
|
+
t.filter
|
|
166
|
+
);
|
|
167
|
+
return e.status === "ineligible" ? e : e.kind === "field_date" && m(t.compatibility) && t.compatibility.source === "cardInlineFilter" ? { status: "ineligible", reason: "card_inline_filter" } : e;
|
|
168
|
+
}
|
|
169
|
+
function mt(t) {
|
|
170
|
+
return J(t).status === "eligible";
|
|
171
|
+
}
|
|
172
|
+
function K(t) {
|
|
173
|
+
if (!t) return null;
|
|
174
|
+
for (const [e, n] of Object.entries(tt))
|
|
175
|
+
if (Z(n, t))
|
|
176
|
+
return e;
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
const T = (t, e) => Math.abs(t) === 1 ? e : `${e}s`;
|
|
180
|
+
function x(t, e) {
|
|
181
|
+
if (t === 0)
|
|
182
|
+
return e === "day" ? "today" : `this ${e}`;
|
|
183
|
+
if (t === -1)
|
|
184
|
+
return e === "day" ? "yesterday" : `last ${e}`;
|
|
185
|
+
if (t === 1)
|
|
186
|
+
return e === "day" ? "tomorrow" : `next ${e}`;
|
|
187
|
+
const n = Math.abs(t);
|
|
188
|
+
return t < 0 ? `${n} ${T(n, e)} ago` : `${n} ${T(n, e)} ahead`;
|
|
189
|
+
}
|
|
190
|
+
const V = (t) => t.charAt(0).toUpperCase() + t.slice(1);
|
|
191
|
+
function E(t, e) {
|
|
192
|
+
return V(x(t, e));
|
|
193
|
+
}
|
|
194
|
+
function X(t) {
|
|
195
|
+
if (!t) return null;
|
|
196
|
+
if (t.mode === "last" && t.relativeTo === "latest_data") {
|
|
197
|
+
const { relativeTo: n, ...o } = t, s = X(o);
|
|
198
|
+
return s ? `${s} of data` : null;
|
|
199
|
+
}
|
|
200
|
+
const e = K(t);
|
|
201
|
+
return e || (t.mode === "this" ? t.boundary === "first_day" ? "First day of the month" : t.boundary === "last_day" ? "Last day of the month" : `This ${t.unit}${t.toDate ? " to date" : ""}` : t.mode === "previous" ? `Last ${t.unit}` : t.mode === "last" ? `Last ${t.n} ${T(t.n, t.unit)}` : t.mode === "between" ? t.from === t.to ? E(t.from, t.unit) : `${E(t.from, t.unit)} to ${x(
|
|
202
|
+
t.to,
|
|
203
|
+
t.unit
|
|
204
|
+
)}` : null);
|
|
205
|
+
}
|
|
206
|
+
function Z(t, e) {
|
|
207
|
+
return !(t.mode !== e.mode || t.unit !== e.unit || t.mode === "last" && e.mode === "last" && (t.n !== e.n || !!t.complete != !!e.complete || t.relativeTo !== e.relativeTo) || t.mode === "this" && e.mode === "this" && (!!t.toDate != !!e.toDate || t.boundary !== e.boundary) || t.mode === "between" && e.mode === "between" && (t.from !== e.from || t.to !== e.to));
|
|
208
|
+
}
|
|
209
|
+
const tt = {
|
|
210
|
+
// Sub-day presets
|
|
211
|
+
"Last 30 minutes": { mode: "last", n: 30, unit: "minute" },
|
|
212
|
+
"Last 1 hour": { mode: "last", n: 1, unit: "hour" },
|
|
213
|
+
"Last 4 hours": { mode: "last", n: 4, unit: "hour" },
|
|
214
|
+
"Last 12 hours": { mode: "last", n: 12, unit: "hour" },
|
|
215
|
+
"Last 24 hours": { mode: "last", n: 24, unit: "hour" },
|
|
216
|
+
// Day presets
|
|
217
|
+
Today: { mode: "this", unit: "day" },
|
|
218
|
+
Yesterday: { mode: "previous", unit: "day" },
|
|
219
|
+
"First day of the month": {
|
|
220
|
+
mode: "this",
|
|
221
|
+
unit: "month",
|
|
222
|
+
boundary: "first_day"
|
|
223
|
+
},
|
|
224
|
+
"Last day of the month": {
|
|
225
|
+
mode: "this",
|
|
226
|
+
unit: "month",
|
|
227
|
+
boundary: "last_day"
|
|
228
|
+
},
|
|
229
|
+
"Last 7 days": { mode: "between", unit: "day", from: -6, to: 0 },
|
|
230
|
+
"Last 30 days": { mode: "between", unit: "day", from: -29, to: 0 },
|
|
231
|
+
"Last 90 days": { mode: "between", unit: "day", from: -89, to: 0 },
|
|
232
|
+
// Week presets
|
|
233
|
+
"This week": { mode: "this", unit: "week" },
|
|
234
|
+
"Last week": { mode: "previous", unit: "week" },
|
|
235
|
+
"Last 2 weeks": { mode: "last", n: 2, unit: "week", complete: !0 },
|
|
236
|
+
// Month presets
|
|
237
|
+
"This month": { mode: "this", unit: "month" },
|
|
238
|
+
"Last month": { mode: "previous", unit: "month" },
|
|
239
|
+
"Last 3 months": { mode: "last", n: 3, unit: "month", complete: !0 },
|
|
240
|
+
"Last 6 months": { mode: "last", n: 6, unit: "month", complete: !0 },
|
|
241
|
+
"Last 9 months": { mode: "last", n: 9, unit: "month", complete: !0 },
|
|
242
|
+
"Last 12 months": { mode: "last", n: 12, unit: "month", complete: !0 },
|
|
243
|
+
// Quarter presets
|
|
244
|
+
"This quarter": { mode: "this", unit: "quarter" },
|
|
245
|
+
"Last quarter": { mode: "previous", unit: "quarter" },
|
|
246
|
+
"Last 4 quarters": { mode: "last", n: 4, unit: "quarter", complete: !0 },
|
|
247
|
+
// Year presets
|
|
248
|
+
"This year": { mode: "this", unit: "year" },
|
|
249
|
+
"Last year": { mode: "previous", unit: "year" }
|
|
250
|
+
}, L = 864e5, S = {
|
|
251
|
+
second: 1e3,
|
|
252
|
+
minute: 6e4,
|
|
253
|
+
hour: 36e5
|
|
254
|
+
};
|
|
255
|
+
function N(t, e) {
|
|
256
|
+
return {
|
|
257
|
+
...q(t, e),
|
|
258
|
+
millisecond: (t.getTime() % 1e3 + 1e3) % 1e3
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
function h(t, e) {
|
|
262
|
+
return W(t, e);
|
|
263
|
+
}
|
|
264
|
+
function C(t) {
|
|
265
|
+
const e = new Date(t);
|
|
266
|
+
return {
|
|
267
|
+
year: e.getUTCFullYear(),
|
|
268
|
+
month: e.getUTCMonth() + 1,
|
|
269
|
+
day: e.getUTCDate(),
|
|
270
|
+
hour: e.getUTCHours(),
|
|
271
|
+
minute: e.getUTCMinutes(),
|
|
272
|
+
second: e.getUTCSeconds(),
|
|
273
|
+
millisecond: e.getUTCMilliseconds()
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
function B(t, e) {
|
|
277
|
+
const n = /* @__PURE__ */ new Date(0);
|
|
278
|
+
return n.setUTCFullYear(t, e, 0), n.getUTCDate();
|
|
279
|
+
}
|
|
280
|
+
function v(t, e) {
|
|
281
|
+
const n = t.year * 12 + (t.month - 1) + e, o = Math.floor(n / 12), s = n - o * 12 + 1;
|
|
282
|
+
return { ...t, year: o, month: s, day: Math.min(t.day, B(o, s)) };
|
|
283
|
+
}
|
|
284
|
+
function p(t, e, n) {
|
|
285
|
+
if (e === 0) return t;
|
|
286
|
+
switch (n) {
|
|
287
|
+
case "second":
|
|
288
|
+
case "minute":
|
|
289
|
+
case "hour":
|
|
290
|
+
return C(
|
|
291
|
+
y(t) + e * S[n]
|
|
292
|
+
);
|
|
293
|
+
case "day":
|
|
294
|
+
return C(y(t) + e * L);
|
|
295
|
+
case "week":
|
|
296
|
+
return C(y(t) + e * 7 * L);
|
|
297
|
+
case "month":
|
|
298
|
+
return v(t, e);
|
|
299
|
+
case "quarter":
|
|
300
|
+
return v(t, e * 3);
|
|
301
|
+
case "year":
|
|
302
|
+
return v(t, e * 12);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
function et(t) {
|
|
306
|
+
return new Date(
|
|
307
|
+
y({ ...t, hour: 0, minute: 0, second: 0 })
|
|
308
|
+
).getUTCDay();
|
|
309
|
+
}
|
|
310
|
+
function M(t) {
|
|
311
|
+
var n;
|
|
312
|
+
const e = (n = t.fiscalCalendar) == null ? void 0 : n.yearStartMonth;
|
|
313
|
+
return e && e >= 1 && e <= 12 ? e : 1;
|
|
314
|
+
}
|
|
315
|
+
function nt(t, e, n) {
|
|
316
|
+
const o = { ...t, hour: 0, minute: 0, second: 0, millisecond: 0 };
|
|
317
|
+
switch (e) {
|
|
318
|
+
case "day":
|
|
319
|
+
return o;
|
|
320
|
+
case "week":
|
|
321
|
+
return p(
|
|
322
|
+
o,
|
|
323
|
+
-((et(t) - n.weekStart + 7) % 7),
|
|
324
|
+
"day"
|
|
325
|
+
);
|
|
326
|
+
case "month":
|
|
327
|
+
return { ...o, day: 1 };
|
|
328
|
+
case "quarter": {
|
|
329
|
+
const s = (t.month - M(n) + 12) % 12;
|
|
330
|
+
return v({ ...o, day: 1 }, -(s % 3));
|
|
331
|
+
}
|
|
332
|
+
case "year": {
|
|
333
|
+
const s = M(n);
|
|
334
|
+
return {
|
|
335
|
+
...o,
|
|
336
|
+
year: t.month >= s ? t.year : t.year - 1,
|
|
337
|
+
month: s,
|
|
338
|
+
day: 1
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
function D(t, e, n, o = 0) {
|
|
344
|
+
const s = S[e];
|
|
345
|
+
if (s !== void 0) {
|
|
346
|
+
const a = N(t, n.tz), d = a.millisecond + (e === "second" ? 0 : a.second * 1e3) + (e === "hour" ? a.minute * 6e4 : 0), c = t.getTime() - d + o * s;
|
|
347
|
+
return { start: new Date(c), endExclusive: new Date(c + s) };
|
|
348
|
+
}
|
|
349
|
+
const i = e, r = p(
|
|
350
|
+
nt(N(t, n.tz), i, n),
|
|
351
|
+
o,
|
|
352
|
+
e
|
|
353
|
+
);
|
|
354
|
+
return {
|
|
355
|
+
start: h(r, n.tz),
|
|
356
|
+
endExclusive: h(p(r, 1, e), n.tz)
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
function A(t, e, n) {
|
|
360
|
+
return D(t, e, n).start;
|
|
361
|
+
}
|
|
362
|
+
function z(t, e, n) {
|
|
363
|
+
return new Date(D(t, e, n).endExclusive.getTime() - 1);
|
|
364
|
+
}
|
|
365
|
+
function ot(t, e, n, o) {
|
|
366
|
+
return e === 0 ? t : h(
|
|
367
|
+
p(N(t, o.tz), e, n),
|
|
368
|
+
o.tz
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
function ft(t, e, n) {
|
|
372
|
+
const o = (s) => {
|
|
373
|
+
const { year: i, month: r, day: a } = q(s, n);
|
|
374
|
+
return y({ year: i, month: r, day: a, hour: 0, minute: 0, second: 0 });
|
|
375
|
+
};
|
|
376
|
+
return Math.round((o(e) - o(t)) / L);
|
|
377
|
+
}
|
|
378
|
+
const st = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
379
|
+
function yt(t, e) {
|
|
380
|
+
const { year: n, month: o, day: s } = q(t, e);
|
|
381
|
+
return `${String(n).padStart(4, "0")}-${String(o).padStart(2, "0")}-${String(s).padStart(2, "0")}`;
|
|
382
|
+
}
|
|
383
|
+
function it(t) {
|
|
384
|
+
const e = st.exec(t);
|
|
385
|
+
if (!e) return null;
|
|
386
|
+
const n = Number(e[1]), o = Number(e[2]), s = Number(e[3]);
|
|
387
|
+
return o < 1 || o > 12 || s < 1 || s > B(n, o) ? null : { year: n, month: o, day: s };
|
|
388
|
+
}
|
|
389
|
+
function ht(t, e) {
|
|
390
|
+
const n = it(t);
|
|
391
|
+
if (!n) return null;
|
|
392
|
+
const o = { ...n, hour: 0, minute: 0, second: 0, millisecond: 0 };
|
|
393
|
+
return {
|
|
394
|
+
start: h(o, e),
|
|
395
|
+
endExclusive: h(p(o, 1, "day"), e)
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
function pt(t, e, n) {
|
|
399
|
+
const o = (i) => new Date(D(n, t.unit, e, i).endExclusive.getTime() - 1), s = (i) => D(n, t.unit, e, i).start;
|
|
400
|
+
switch (t.mode) {
|
|
401
|
+
case "last":
|
|
402
|
+
return t.unit === "minute" || t.unit === "hour" ? {
|
|
403
|
+
start: new Date(
|
|
404
|
+
n.getTime() - t.n * S[t.unit]
|
|
405
|
+
),
|
|
406
|
+
end: n
|
|
407
|
+
} : t.complete ? { start: s(-t.n), end: o(-1) } : { start: ot(n, -t.n, t.unit, e), end: n };
|
|
408
|
+
case "this": {
|
|
409
|
+
if (t.boundary && t.unit === "month") {
|
|
410
|
+
const i = t.boundary === "first_day" ? A(n, "month", e) : z(n, "month", e);
|
|
411
|
+
return {
|
|
412
|
+
start: A(i, "day", e),
|
|
413
|
+
end: z(i, "day", e)
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
return { start: s(0), end: t.toDate ? n : o(0) };
|
|
417
|
+
}
|
|
418
|
+
case "previous":
|
|
419
|
+
return { start: s(-1), end: o(-1) };
|
|
420
|
+
case "between":
|
|
421
|
+
return { start: s(t.from), end: o(t.to) };
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
export {
|
|
425
|
+
pt as A,
|
|
426
|
+
P as B,
|
|
427
|
+
j as C,
|
|
428
|
+
U as D,
|
|
429
|
+
S as E,
|
|
430
|
+
R as a,
|
|
431
|
+
J as b,
|
|
432
|
+
dt as c,
|
|
433
|
+
lt as d,
|
|
434
|
+
ct as e,
|
|
435
|
+
K as f,
|
|
436
|
+
ut as g,
|
|
437
|
+
E as h,
|
|
438
|
+
mt as i,
|
|
439
|
+
X as j,
|
|
440
|
+
Z as k,
|
|
441
|
+
tt as l,
|
|
442
|
+
h as m,
|
|
443
|
+
B as n,
|
|
444
|
+
p as o,
|
|
445
|
+
D as p,
|
|
446
|
+
et as q,
|
|
447
|
+
G as r,
|
|
448
|
+
ot as s,
|
|
449
|
+
A as t,
|
|
450
|
+
z as u,
|
|
451
|
+
ft as v,
|
|
452
|
+
N as w,
|
|
453
|
+
yt as x,
|
|
454
|
+
it as y,
|
|
455
|
+
ht as z
|
|
456
|
+
};
|