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
package/dist/chunks/{pivot-result-lifecycle-BFO354lk.js → pivot-result-lifecycle-Bqdtknud.js}
RENAMED
|
@@ -1,16 +1,56 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var f = (e, o, t) =>
|
|
4
|
-
import { p as
|
|
5
|
-
import { b as
|
|
6
|
-
import { k as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import "./matrix-operation-contract-
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
|
|
1
|
+
var _ = Object.defineProperty;
|
|
2
|
+
var K = (e, o, t) => o in e ? _(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
|
|
3
|
+
var f = (e, o, t) => K(e, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
+
import { p as F, i as j } from "./raw-temporal-CdnA_OXJ.js";
|
|
5
|
+
import { b as M } from "./report-runtime-context-CtaGGlit.js";
|
|
6
|
+
import { k as T } from "./numeric-presentation-LvnNY5Ma.js";
|
|
7
|
+
import { d as u, b as P } from "./temporal-bucket-DlFuhCnT.js";
|
|
8
|
+
import { S as O } from "./validators-CQcG0EPN.js";
|
|
9
|
+
import "./matrix-operation-contract-Dp7kFpVk.js";
|
|
10
|
+
import { r as U } from "./metric-comparison-Crljx_XY.js";
|
|
11
|
+
import "zod";
|
|
12
|
+
import { a as q } from "./temporal-bucket-contract-C6lUGPS3.js";
|
|
13
|
+
import { d as N, P as D } from "./pivot-result-identity-CY__BuwI.js";
|
|
14
|
+
const B = ["utf-8-bom", "utf-8"], V = "utf-8-bom", z = [",", ";", " "], J = `\r
|
|
15
|
+
`, Ee = "text/csv; charset=utf-8";
|
|
16
|
+
function Ae(e) {
|
|
17
|
+
return e == null || typeof e == "string" || typeof e == "number" ? e : typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
18
|
+
}
|
|
19
|
+
const L = "\uFEFF";
|
|
20
|
+
function I(e) {
|
|
21
|
+
return B.find((o) => o === e);
|
|
22
|
+
}
|
|
23
|
+
function ke(e) {
|
|
24
|
+
return z.find((o) => o === e);
|
|
25
|
+
}
|
|
26
|
+
function $e(e) {
|
|
27
|
+
return I(e.requested) ?? I(e.dashboardDefault) ?? V;
|
|
28
|
+
}
|
|
29
|
+
function G(e) {
|
|
30
|
+
return e === "utf-8-bom" ? L : "";
|
|
31
|
+
}
|
|
32
|
+
function Se(e) {
|
|
33
|
+
const o = e.trimStart().charAt(0);
|
|
34
|
+
return ["=", "+", "-", "@"].includes(o) || [" ", "\r", `
|
|
35
|
+
`].includes(e.charAt(0)) ? `'${e}` : e;
|
|
36
|
+
}
|
|
37
|
+
function Y(e, o = ",") {
|
|
38
|
+
if (e == null)
|
|
39
|
+
return "";
|
|
40
|
+
const t = String(e);
|
|
41
|
+
return t.includes(o) || t.includes('"') || t.includes(`
|
|
42
|
+
`) || t.includes("\r") ? `"${t.replace(/"/g, '""')}"` : t;
|
|
43
|
+
}
|
|
44
|
+
function S(e, o) {
|
|
45
|
+
return e.map((t) => Y(t, o)).join(o) + J;
|
|
46
|
+
}
|
|
47
|
+
function H(e, o) {
|
|
48
|
+
return e.map((t) => S(t, o)).join("");
|
|
49
|
+
}
|
|
50
|
+
function _e(e) {
|
|
51
|
+
return G(e.encoding) + (e.header ? S(e.header, e.delimiter) : "") + H(e.rows, e.delimiter);
|
|
52
|
+
}
|
|
53
|
+
class C extends Error {
|
|
14
54
|
constructor(t) {
|
|
15
55
|
super(
|
|
16
56
|
`invalid_presentation_execution_snapshot: ${t} Resave this report before running it again.`
|
|
@@ -20,7 +60,7 @@ class I extends Error {
|
|
|
20
60
|
this.name = "PresentationExecutionSnapshotError";
|
|
21
61
|
}
|
|
22
62
|
}
|
|
23
|
-
class
|
|
63
|
+
class Ke extends Error {
|
|
24
64
|
constructor(t) {
|
|
25
65
|
super(
|
|
26
66
|
`missing_resolved_raw_temporal_format: Column "${t}" has no captured presentation. Resave this report before running it again.`
|
|
@@ -31,11 +71,11 @@ class pe extends Error {
|
|
|
31
71
|
}
|
|
32
72
|
}
|
|
33
73
|
function v(e, o, t) {
|
|
34
|
-
const
|
|
74
|
+
const n = new Set(o), r = Object.keys(e).find((s) => !n.has(s));
|
|
35
75
|
if (r)
|
|
36
76
|
throw new Error(`${t} contains unknown property "${r}"`);
|
|
37
77
|
}
|
|
38
|
-
function
|
|
78
|
+
function Q(e, o = "scope") {
|
|
39
79
|
if (!u(e))
|
|
40
80
|
throw new Error(`${o} must be an object`);
|
|
41
81
|
v(
|
|
@@ -46,8 +86,8 @@ function N(e, o = "scope") {
|
|
|
46
86
|
const t = typeof e.dashboardId == "string" ? e.dashboardId.trim() : "";
|
|
47
87
|
if (!t)
|
|
48
88
|
throw new Error(`${o}.dashboardId is required`);
|
|
49
|
-
const
|
|
50
|
-
if (e.cardId !== void 0 && !
|
|
89
|
+
const n = typeof e.cardId == "string" ? e.cardId.trim() : void 0;
|
|
90
|
+
if (e.cardId !== void 0 && !n)
|
|
51
91
|
throw new Error(`${o}.cardId must be a non-empty string`);
|
|
52
92
|
const r = e.attachmentIndex;
|
|
53
93
|
if (r !== void 0 && (typeof r != "number" || !Number.isInteger(r) || r < 0))
|
|
@@ -56,25 +96,25 @@ function N(e, o = "scope") {
|
|
|
56
96
|
);
|
|
57
97
|
return {
|
|
58
98
|
dashboardId: t,
|
|
59
|
-
...
|
|
99
|
+
...n ? { cardId: n } : {},
|
|
60
100
|
...typeof r == "number" ? { attachmentIndex: r } : {}
|
|
61
101
|
};
|
|
62
102
|
}
|
|
63
|
-
function y(e, o, t,
|
|
103
|
+
function y(e, o, t, n) {
|
|
64
104
|
if (e.kind !== o) return;
|
|
65
|
-
v(e, ["kind", t],
|
|
105
|
+
v(e, ["kind", t], n);
|
|
66
106
|
const r = typeof e[t] == "string" ? e[t].trim() : "";
|
|
67
107
|
if (!r)
|
|
68
|
-
throw new Error(`${
|
|
108
|
+
throw new Error(`${n}.${t} is required`);
|
|
69
109
|
return r;
|
|
70
110
|
}
|
|
71
|
-
function
|
|
111
|
+
function R(e, o) {
|
|
72
112
|
if (!u(e))
|
|
73
113
|
throw new Error(`${o} must be an object`);
|
|
74
114
|
const t = y(e, "metric", "metricId", o);
|
|
75
115
|
if (t) return { kind: "metric", metricId: t };
|
|
76
|
-
const
|
|
77
|
-
if (
|
|
116
|
+
const n = y(e, "column", "columnKey", o);
|
|
117
|
+
if (n) return { kind: "column", columnKey: n };
|
|
78
118
|
const r = y(
|
|
79
119
|
e,
|
|
80
120
|
"matrix_measure",
|
|
@@ -84,7 +124,7 @@ function k(e, o) {
|
|
|
84
124
|
if (r) return { kind: "matrix_measure", measureId: r };
|
|
85
125
|
throw new Error(`${o} is not a valid numeric presentation target`);
|
|
86
126
|
}
|
|
87
|
-
const
|
|
127
|
+
const W = [
|
|
88
128
|
"type",
|
|
89
129
|
"inputUnit",
|
|
90
130
|
"outputStyle",
|
|
@@ -95,23 +135,23 @@ const B = [
|
|
|
95
135
|
"suffix",
|
|
96
136
|
"negativeStyle"
|
|
97
137
|
];
|
|
98
|
-
function
|
|
138
|
+
function X(e) {
|
|
99
139
|
return e === "millisecond" || e === "second" || e === "minute" || e === "hour" || e === "day";
|
|
100
140
|
}
|
|
101
|
-
function
|
|
102
|
-
v(e,
|
|
103
|
-
for (const
|
|
104
|
-
if (e[
|
|
105
|
-
throw new Error(`${o}.${
|
|
141
|
+
function Z(e, o) {
|
|
142
|
+
v(e, W, o);
|
|
143
|
+
for (const s of ["inputUnit", "largestUnit", "smallestUnit"])
|
|
144
|
+
if (e[s] !== void 0 && !X(e[s]))
|
|
145
|
+
throw new Error(`${o}.${s} must be a duration unit`);
|
|
106
146
|
const t = e.outputStyle;
|
|
107
147
|
if (t !== void 0 && t !== "compact" && t !== "digital" && t !== "long")
|
|
108
148
|
throw new Error(`${o}.outputStyle must be compact, digital, or long`);
|
|
109
|
-
const
|
|
110
|
-
if (
|
|
149
|
+
const n = e.maxUnits;
|
|
150
|
+
if (n !== void 0 && (typeof n != "number" || !Number.isInteger(n) || n < 0 || n > 10))
|
|
111
151
|
throw new Error(`${o}.maxUnits must be an integer from 0 to 10`);
|
|
112
|
-
for (const
|
|
113
|
-
if (e[
|
|
114
|
-
throw new Error(`${o}.${
|
|
152
|
+
for (const s of ["prefix", "suffix"])
|
|
153
|
+
if (e[s] !== void 0 && typeof e[s] != "string")
|
|
154
|
+
throw new Error(`${o}.${s} must be a string`);
|
|
115
155
|
const r = e.negativeStyle;
|
|
116
156
|
if (r !== void 0 && r !== "minus" && r !== "parentheses")
|
|
117
157
|
throw new Error(`${o}.negativeStyle must be minus or parentheses`);
|
|
@@ -121,13 +161,13 @@ function z(e, o) {
|
|
|
121
161
|
...t !== void 0 ? { outputStyle: t } : {},
|
|
122
162
|
...e.largestUnit !== void 0 ? { largestUnit: e.largestUnit } : {},
|
|
123
163
|
...e.smallestUnit !== void 0 ? { smallestUnit: e.smallestUnit } : {},
|
|
124
|
-
...
|
|
164
|
+
...n !== void 0 ? { maxUnits: n } : {},
|
|
125
165
|
...e.prefix !== void 0 ? { prefix: e.prefix } : {},
|
|
126
166
|
...e.suffix !== void 0 ? { suffix: e.suffix } : {},
|
|
127
167
|
...r !== void 0 ? { negativeStyle: r } : {}
|
|
128
168
|
};
|
|
129
169
|
}
|
|
130
|
-
function
|
|
170
|
+
function ee(e, o) {
|
|
131
171
|
if (!u(e))
|
|
132
172
|
throw new Error(`${o} must be an object`);
|
|
133
173
|
if (e.kind === "field") {
|
|
@@ -135,27 +175,27 @@ function J(e, o) {
|
|
|
135
175
|
const r = typeof e.fieldId == "string" ? e.fieldId.trim() : "";
|
|
136
176
|
if (!r)
|
|
137
177
|
throw new Error(`${o}.fieldId is required`);
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
178
|
+
const s = e.role;
|
|
179
|
+
if (s !== void 0 && s !== "groupby" && s !== "pivotby")
|
|
140
180
|
throw new Error(`${o}.role must be groupby or pivotby`);
|
|
141
181
|
return {
|
|
142
182
|
kind: "field",
|
|
143
183
|
fieldId: r,
|
|
144
|
-
...
|
|
184
|
+
...s ? { role: s } : {}
|
|
145
185
|
};
|
|
146
186
|
}
|
|
147
187
|
const t = y(e, "column", "columnKey", o);
|
|
148
188
|
if (t) return { kind: "column", columnKey: t };
|
|
149
|
-
const
|
|
189
|
+
const n = y(
|
|
150
190
|
e,
|
|
151
191
|
"matrix_axis",
|
|
152
192
|
"axisInstanceId",
|
|
153
193
|
o
|
|
154
194
|
);
|
|
155
|
-
if (
|
|
195
|
+
if (n) return { kind: "matrix_axis", axisInstanceId: n };
|
|
156
196
|
throw new Error(`${o} is not a valid temporal bucket presentation target`);
|
|
157
197
|
}
|
|
158
|
-
function
|
|
198
|
+
function te(e, o) {
|
|
159
199
|
if (!u(e))
|
|
160
200
|
throw new Error(`${o} must be an object`);
|
|
161
201
|
const t = y(e, "column", "columnKey", o);
|
|
@@ -163,7 +203,7 @@ function L(e, o) {
|
|
|
163
203
|
throw new Error(`${o} must identify a column`);
|
|
164
204
|
return { kind: "column", columnKey: t };
|
|
165
205
|
}
|
|
166
|
-
function
|
|
206
|
+
function oe(e) {
|
|
167
207
|
return [
|
|
168
208
|
e.dashboardId,
|
|
169
209
|
e.cardId ?? null,
|
|
@@ -188,65 +228,65 @@ function b(e, o) {
|
|
|
188
228
|
return e.dashboardId === o.dashboardId && e.cardId === o.cardId && e.attachmentIndex === o.attachmentIndex;
|
|
189
229
|
}
|
|
190
230
|
function g(e, o) {
|
|
191
|
-
const t = h(e),
|
|
192
|
-
return t.length ===
|
|
231
|
+
const t = h(e), n = h(o);
|
|
232
|
+
return t.length === n.length && t.every((r, s) => r === n[s]);
|
|
193
233
|
}
|
|
194
|
-
function
|
|
234
|
+
function re(e) {
|
|
195
235
|
if (!Array.isArray(e))
|
|
196
236
|
throw new Error("resolvedFormats must be an array");
|
|
197
237
|
const o = /* @__PURE__ */ new Set();
|
|
198
|
-
return e.map((t,
|
|
238
|
+
return e.map((t, n) => {
|
|
199
239
|
var m, p;
|
|
200
|
-
const r = `resolvedFormats.${
|
|
240
|
+
const r = `resolvedFormats.${n}`;
|
|
201
241
|
if (!u(t))
|
|
202
242
|
throw new Error(`${r} must be an object`);
|
|
203
243
|
v(t, ["scope", "target", "format"], r);
|
|
204
|
-
const
|
|
244
|
+
const s = Q(t.scope, `${r}.scope`);
|
|
205
245
|
if (!u(t.format))
|
|
206
246
|
throw new Error(`${r}.format must be an object`);
|
|
207
|
-
let
|
|
247
|
+
let i;
|
|
208
248
|
switch (t.format.type) {
|
|
209
249
|
case "temporal_bucket": {
|
|
210
|
-
const l =
|
|
250
|
+
const l = P(t.format);
|
|
211
251
|
if (!l.ok)
|
|
212
252
|
throw new Error(
|
|
213
253
|
`${r}.format is invalid: ${((m = l.issues[0]) == null ? void 0 : m.message) ?? "invalid value"}`
|
|
214
254
|
);
|
|
215
|
-
|
|
216
|
-
scope:
|
|
217
|
-
target:
|
|
255
|
+
i = {
|
|
256
|
+
scope: s,
|
|
257
|
+
target: ee(t.target, `${r}.target`),
|
|
218
258
|
format: l.value
|
|
219
259
|
};
|
|
220
260
|
break;
|
|
221
261
|
}
|
|
222
262
|
case "raw_temporal":
|
|
223
|
-
|
|
224
|
-
scope:
|
|
225
|
-
target:
|
|
226
|
-
format:
|
|
263
|
+
i = {
|
|
264
|
+
scope: s,
|
|
265
|
+
target: te(t.target, `${r}.target`),
|
|
266
|
+
format: F(t.format)
|
|
227
267
|
};
|
|
228
268
|
break;
|
|
229
269
|
case "number":
|
|
230
270
|
case "currency":
|
|
231
271
|
case "percent":
|
|
232
272
|
case "scientific": {
|
|
233
|
-
const l =
|
|
273
|
+
const l = T(t.format);
|
|
234
274
|
if (!l.ok)
|
|
235
275
|
throw new Error(
|
|
236
276
|
`${r}.format is invalid: ${((p = l.issues[0]) == null ? void 0 : p.message) ?? "invalid value"}`
|
|
237
277
|
);
|
|
238
|
-
|
|
239
|
-
scope:
|
|
240
|
-
target:
|
|
278
|
+
i = {
|
|
279
|
+
scope: s,
|
|
280
|
+
target: R(t.target, `${r}.target`),
|
|
241
281
|
format: l.value
|
|
242
282
|
};
|
|
243
283
|
break;
|
|
244
284
|
}
|
|
245
285
|
case "duration":
|
|
246
|
-
|
|
247
|
-
scope:
|
|
248
|
-
target:
|
|
249
|
-
format:
|
|
286
|
+
i = {
|
|
287
|
+
scope: s,
|
|
288
|
+
target: R(t.target, `${r}.target`),
|
|
289
|
+
format: Z(
|
|
250
290
|
t.format,
|
|
251
291
|
`${r}.format`
|
|
252
292
|
)
|
|
@@ -256,17 +296,17 @@ function G(e) {
|
|
|
256
296
|
throw new Error(`${r}.format.type is unsupported`);
|
|
257
297
|
}
|
|
258
298
|
const c = JSON.stringify([
|
|
259
|
-
...
|
|
260
|
-
...h(
|
|
299
|
+
...oe(i.scope),
|
|
300
|
+
...h(i.target)
|
|
261
301
|
]);
|
|
262
302
|
if (o.has(c))
|
|
263
303
|
throw new Error(
|
|
264
304
|
`${r} duplicates a scoped presentation target`
|
|
265
305
|
);
|
|
266
|
-
return o.add(c),
|
|
306
|
+
return o.add(c), i;
|
|
267
307
|
});
|
|
268
308
|
}
|
|
269
|
-
function
|
|
309
|
+
function ne(e) {
|
|
270
310
|
try {
|
|
271
311
|
if (!u(e))
|
|
272
312
|
throw new Error("presentation execution snapshot must be an object");
|
|
@@ -276,7 +316,7 @@ function H(e) {
|
|
|
276
316
|
"presentation execution snapshot"
|
|
277
317
|
), e.version !== 1)
|
|
278
318
|
throw new Error("presentation execution snapshot version must be 1");
|
|
279
|
-
const o =
|
|
319
|
+
const o = M(e.reportContext);
|
|
280
320
|
if (!o.ok) {
|
|
281
321
|
const t = o.issues[0];
|
|
282
322
|
throw new Error(
|
|
@@ -286,82 +326,82 @@ function H(e) {
|
|
|
286
326
|
return {
|
|
287
327
|
version: 1,
|
|
288
328
|
reportContext: o.value,
|
|
289
|
-
resolvedFormats:
|
|
329
|
+
resolvedFormats: re(e.resolvedFormats)
|
|
290
330
|
};
|
|
291
331
|
} catch (o) {
|
|
292
|
-
throw o instanceof
|
|
332
|
+
throw o instanceof C ? o : new C(
|
|
293
333
|
o instanceof Error ? o.message : "Snapshot is invalid."
|
|
294
334
|
);
|
|
295
335
|
}
|
|
296
336
|
}
|
|
297
|
-
function
|
|
298
|
-
return
|
|
337
|
+
function Fe(e) {
|
|
338
|
+
return ne({
|
|
299
339
|
version: 1,
|
|
300
340
|
reportContext: e.reportContext,
|
|
301
341
|
resolvedFormats: [...e.resolvedFormats]
|
|
302
342
|
});
|
|
303
343
|
}
|
|
304
|
-
function
|
|
305
|
-
const o =
|
|
306
|
-
return
|
|
344
|
+
function je(e) {
|
|
345
|
+
const o = se(e);
|
|
346
|
+
return j(o) ? o : void 0;
|
|
307
347
|
}
|
|
308
|
-
function
|
|
348
|
+
function se(e) {
|
|
309
349
|
const o = e.snapshot.resolvedFormats.find(
|
|
310
350
|
(t) => t.format.type !== "temporal_bucket" && t.format.type !== "raw_temporal" && b(t.scope, e.scope) && g(t.target, e.target)
|
|
311
351
|
);
|
|
312
352
|
return o == null ? void 0 : o.format;
|
|
313
353
|
}
|
|
314
|
-
function
|
|
354
|
+
function Me(e) {
|
|
315
355
|
const o = e.snapshot.resolvedFormats.find(
|
|
316
356
|
(t) => t.format.type === "raw_temporal" && b(t.scope, e.scope) && g(t.target, e.target)
|
|
317
357
|
);
|
|
318
358
|
return o == null ? void 0 : o.format;
|
|
319
359
|
}
|
|
320
|
-
function
|
|
360
|
+
function Te(e) {
|
|
321
361
|
const o = e.snapshot.resolvedFormats.find(
|
|
322
362
|
(t) => t.format.type === "temporal_bucket" && b(t.scope, e.scope) && g(t.target, e.target)
|
|
323
363
|
);
|
|
324
364
|
return o == null ? void 0 : o.format;
|
|
325
365
|
}
|
|
326
|
-
function
|
|
366
|
+
function Pe(e) {
|
|
327
367
|
var r;
|
|
328
368
|
const o = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set();
|
|
329
|
-
if (e.snapshot.resolvedFormats.forEach((
|
|
330
|
-
if (
|
|
369
|
+
if (e.snapshot.resolvedFormats.forEach((s, i) => {
|
|
370
|
+
if (s.scope.attachmentIndex !== void 0)
|
|
331
371
|
throw new Error(
|
|
332
|
-
`resolvedFormats.${
|
|
372
|
+
`resolvedFormats.${i}.scope.attachmentIndex is not valid for a card export`
|
|
333
373
|
);
|
|
334
|
-
if (
|
|
374
|
+
if (s.scope.dashboardId !== e.expectedScope.dashboardId || s.scope.cardId !== e.expectedScope.cardId)
|
|
335
375
|
throw new Error(
|
|
336
|
-
`resolvedFormats.${
|
|
376
|
+
`resolvedFormats.${i}.scope must match the executing dashboard/card`
|
|
337
377
|
);
|
|
338
|
-
if (
|
|
339
|
-
const c = JSON.stringify(h(
|
|
378
|
+
if (s.target.kind === "field" && s.format.type === "temporal_bucket") {
|
|
379
|
+
const c = JSON.stringify(h(s.target));
|
|
340
380
|
if (t.has(c))
|
|
341
381
|
throw new Error(
|
|
342
|
-
`resolvedFormats.${
|
|
382
|
+
`resolvedFormats.${i} duplicates export field "${s.target.fieldId}"`
|
|
343
383
|
);
|
|
344
384
|
t.add(c);
|
|
345
385
|
return;
|
|
346
386
|
}
|
|
347
|
-
if (
|
|
387
|
+
if (s.target.kind !== "column")
|
|
348
388
|
throw new Error(
|
|
349
|
-
`resolvedFormats.${
|
|
389
|
+
`resolvedFormats.${i}.target must identify an export column or temporal pivot field`
|
|
350
390
|
);
|
|
351
|
-
if (o.has(
|
|
391
|
+
if (o.has(s.target.columnKey))
|
|
352
392
|
throw new Error(
|
|
353
|
-
`resolvedFormats.${
|
|
393
|
+
`resolvedFormats.${i} duplicates export column "${s.target.columnKey}"`
|
|
354
394
|
);
|
|
355
|
-
o.add(
|
|
395
|
+
o.add(s.target.columnKey);
|
|
356
396
|
}), !e.useFormattedValues) return;
|
|
357
397
|
if (!((r = e.visibleColumns) != null && r.length))
|
|
358
398
|
throw new Error("visibleColumns must identify every formatted export column");
|
|
359
|
-
const
|
|
360
|
-
(
|
|
399
|
+
const n = e.visibleColumns.find(
|
|
400
|
+
(s) => !o.has(s)
|
|
361
401
|
);
|
|
362
|
-
if (
|
|
402
|
+
if (n)
|
|
363
403
|
throw new Error(
|
|
364
|
-
`resolvedFormats is missing visible export column "${
|
|
404
|
+
`resolvedFormats is missing visible export column "${n}"`
|
|
365
405
|
);
|
|
366
406
|
}
|
|
367
407
|
function w(e) {
|
|
@@ -373,35 +413,35 @@ function w(e) {
|
|
|
373
413
|
)
|
|
374
414
|
);
|
|
375
415
|
}
|
|
376
|
-
function
|
|
416
|
+
function ie(e) {
|
|
377
417
|
const o = /* @__PURE__ */ new Map();
|
|
378
418
|
return e.forEach((t) => {
|
|
379
419
|
t.id && o.set(t.id, (o.get(t.id) ?? 0) + 1);
|
|
380
420
|
}), e.flatMap(
|
|
381
|
-
(t) => t.id && (o.get(t.id) ?? 0) > 1 ? [
|
|
421
|
+
(t) => t.id && (o.get(t.id) ?? 0) > 1 ? [U(t)] : []
|
|
382
422
|
);
|
|
383
423
|
}
|
|
384
|
-
function
|
|
424
|
+
function Oe(e) {
|
|
385
425
|
const o = e.metricFields ?? [], t = w(o);
|
|
386
426
|
return {
|
|
387
427
|
expectedRoleFieldIds: {
|
|
388
428
|
groupby: w(e.groupByFields),
|
|
389
|
-
metric: t.length > 0 ? t : [
|
|
429
|
+
metric: t.length > 0 ? t : [O],
|
|
390
430
|
pivotby: w(e.pivotByFields),
|
|
391
431
|
detail: w(e.detailFields)
|
|
392
432
|
},
|
|
393
|
-
expectedMetricAliases:
|
|
433
|
+
expectedMetricAliases: ie(o)
|
|
394
434
|
};
|
|
395
435
|
}
|
|
396
436
|
class a extends Error {
|
|
397
|
-
constructor(t,
|
|
437
|
+
constructor(t, n) {
|
|
398
438
|
super(`invalid_pivot_result_lifecycle: ${t}`);
|
|
399
439
|
f(this, "code", "invalid_pivot_result_lifecycle");
|
|
400
440
|
f(this, "deliveryBlocking", !0);
|
|
401
|
-
this.cause =
|
|
441
|
+
this.cause = n, this.name = "PivotResultLifecycleError";
|
|
402
442
|
}
|
|
403
443
|
}
|
|
404
|
-
function
|
|
444
|
+
function ae(e) {
|
|
405
445
|
if (!Array.isArray(e) || e.some(
|
|
406
446
|
(t) => !t || typeof t != "object" || Array.isArray(t) || typeof t.key != "string" || !t.key || typeof t.name != "string" || typeof t.label != "string"
|
|
407
447
|
))
|
|
@@ -414,31 +454,31 @@ function W(e) {
|
|
|
414
454
|
"Canonical pivot column keys must be unique."
|
|
415
455
|
);
|
|
416
456
|
for (const t of o) {
|
|
417
|
-
const
|
|
457
|
+
const n = q(t, {
|
|
418
458
|
metadataRequired: !1
|
|
419
459
|
});
|
|
420
|
-
if (!
|
|
460
|
+
if (!n.ok)
|
|
421
461
|
throw new a(
|
|
422
|
-
`Canonical pivot column "${t.key}" has invalid temporal metadata: ${
|
|
462
|
+
`Canonical pivot column "${t.key}" has invalid temporal metadata: ${n.error.message}`
|
|
423
463
|
);
|
|
424
464
|
}
|
|
425
465
|
return o;
|
|
426
466
|
}
|
|
427
|
-
function
|
|
467
|
+
function E(e) {
|
|
428
468
|
if (!e || typeof e != "object" || Array.isArray(e) || e.version !== 1 || e.source !== "explorer" || !e.byRole || typeof e.byRole != "object" || Array.isArray(e.byRole))
|
|
429
469
|
throw new a(
|
|
430
470
|
"A loaded canonical pivot result requires its role-scoped column key map."
|
|
431
471
|
);
|
|
432
472
|
const o = e, t = /* @__PURE__ */ new Set(["groupby", "metric", "pivotby", "detail"]);
|
|
433
|
-
for (const [
|
|
434
|
-
if (!t.has(
|
|
473
|
+
for (const [n, r] of Object.entries(o.byRole)) {
|
|
474
|
+
if (!t.has(n) || !r || typeof r != "object" || Array.isArray(r))
|
|
435
475
|
throw new a(
|
|
436
|
-
`Canonical pivot role map contains invalid "${
|
|
476
|
+
`Canonical pivot role map contains invalid "${n}" bindings.`
|
|
437
477
|
);
|
|
438
|
-
for (const [
|
|
439
|
-
if (!
|
|
478
|
+
for (const [s, i] of Object.entries(r))
|
|
479
|
+
if (!s || !i || typeof i != "object" || Array.isArray(i) || i.role !== n || typeof i.rawKey != "string" || !i.rawKey || i.outputKey !== void 0 && (typeof i.outputKey != "string" || !i.outputKey))
|
|
440
480
|
throw new a(
|
|
441
|
-
`Canonical pivot role map contains an invalid "${
|
|
481
|
+
`Canonical pivot role map contains an invalid "${n}:${s}" binding.`
|
|
442
482
|
);
|
|
443
483
|
}
|
|
444
484
|
if (o.byMetricAlias !== void 0) {
|
|
@@ -446,17 +486,17 @@ function R(e) {
|
|
|
446
486
|
throw new a(
|
|
447
487
|
"Canonical pivot metric-alias bindings must be an object."
|
|
448
488
|
);
|
|
449
|
-
for (const [
|
|
489
|
+
for (const [n, r] of Object.entries(
|
|
450
490
|
o.byMetricAlias
|
|
451
491
|
))
|
|
452
|
-
if (!
|
|
492
|
+
if (!n || !r || typeof r != "object" || Array.isArray(r) || r.role !== "metric" || typeof r.rawKey != "string" || !r.rawKey || r.outputKey !== void 0 && (typeof r.outputKey != "string" || !r.outputKey))
|
|
453
493
|
throw new a(
|
|
454
|
-
`Canonical pivot metric-alias map contains an invalid "${
|
|
494
|
+
`Canonical pivot metric-alias map contains an invalid "${n}" binding.`
|
|
455
495
|
);
|
|
456
496
|
}
|
|
457
497
|
return o;
|
|
458
498
|
}
|
|
459
|
-
function
|
|
499
|
+
function ce(e) {
|
|
460
500
|
if (e === void 0) return {};
|
|
461
501
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
462
502
|
throw new a(
|
|
@@ -467,32 +507,32 @@ function X(e) {
|
|
|
467
507
|
throw new a(
|
|
468
508
|
`Canonical pivot column metadata contains an invalid "${o}" classification.`
|
|
469
509
|
);
|
|
470
|
-
const { isSubtotal:
|
|
471
|
-
if (
|
|
510
|
+
const { isSubtotal: n, subtotalScope: r } = t;
|
|
511
|
+
if (n !== void 0 && typeof n != "boolean" || r !== void 0 && r !== "base" && r !== "pivot-value" && r !== "grand-total" || n === !0 && r !== "pivot-value" && r !== "grand-total" || (r === "pivot-value" || r === "grand-total") && n !== !0 || r === "base" && n === !0)
|
|
472
512
|
throw new a(
|
|
473
513
|
`Canonical pivot column metadata contains an incoherent "${o}" subtotal classification.`
|
|
474
514
|
);
|
|
475
515
|
}
|
|
476
516
|
return e;
|
|
477
517
|
}
|
|
478
|
-
function
|
|
518
|
+
function A(e, o) {
|
|
479
519
|
if (!Array.isArray(e) || e.some((t) => typeof t != "string" || !t) || new Set(e).size !== e.length)
|
|
480
520
|
throw new a(
|
|
481
521
|
`Canonical pivot contract ${o} must be an array of unique field identities.`
|
|
482
522
|
);
|
|
483
523
|
return e;
|
|
484
524
|
}
|
|
485
|
-
function
|
|
525
|
+
function le(e, o) {
|
|
486
526
|
if (!e || typeof e != "object" || Array.isArray(e) || e.version !== 1)
|
|
487
527
|
throw new a(
|
|
488
528
|
"A canonical pivot result requires its versioned result contract."
|
|
489
529
|
);
|
|
490
|
-
const t = e,
|
|
491
|
-
if (!
|
|
530
|
+
const t = e, n = t.expectedRoleFieldIds;
|
|
531
|
+
if (!n || typeof n != "object" || Array.isArray(n))
|
|
492
532
|
throw new a(
|
|
493
533
|
"Canonical pivot contract role identities must be an object."
|
|
494
534
|
);
|
|
495
|
-
const
|
|
535
|
+
const s = Object.fromEntries(
|
|
496
536
|
[
|
|
497
537
|
"groupby",
|
|
498
538
|
"metric",
|
|
@@ -500,12 +540,12 @@ function Z(e, o) {
|
|
|
500
540
|
"detail"
|
|
501
541
|
].map((d) => [
|
|
502
542
|
d,
|
|
503
|
-
|
|
504
|
-
|
|
543
|
+
A(
|
|
544
|
+
n[d],
|
|
505
545
|
`expectedRoleFieldIds.${d}`
|
|
506
546
|
)
|
|
507
547
|
])
|
|
508
|
-
),
|
|
548
|
+
), i = A(
|
|
509
549
|
t.expectedMetricAliases,
|
|
510
550
|
"expectedMetricAliases"
|
|
511
551
|
), c = t.columnKinds;
|
|
@@ -526,7 +566,7 @@ function Z(e, o) {
|
|
|
526
566
|
throw new a(
|
|
527
567
|
"Canonical pivot contract must classify every authoritative result column exactly once."
|
|
528
568
|
);
|
|
529
|
-
const x =
|
|
569
|
+
const x = ce(
|
|
530
570
|
t.columnClassifications
|
|
531
571
|
);
|
|
532
572
|
if (Object.keys(x).some(
|
|
@@ -537,33 +577,33 @@ function Z(e, o) {
|
|
|
537
577
|
);
|
|
538
578
|
return {
|
|
539
579
|
version: 1,
|
|
540
|
-
expectedRoleFieldIds:
|
|
541
|
-
expectedMetricAliases:
|
|
580
|
+
expectedRoleFieldIds: s,
|
|
581
|
+
expectedMetricAliases: i,
|
|
542
582
|
columnKinds: c,
|
|
543
583
|
columnClassifications: x
|
|
544
584
|
};
|
|
545
585
|
}
|
|
546
|
-
function
|
|
586
|
+
function k(e, o) {
|
|
547
587
|
const t = [
|
|
548
588
|
"groupby",
|
|
549
589
|
"metric",
|
|
550
590
|
"pivotby",
|
|
551
591
|
"detail"
|
|
552
592
|
];
|
|
553
|
-
for (const
|
|
554
|
-
const
|
|
555
|
-
if (c.length !==
|
|
593
|
+
for (const s of t) {
|
|
594
|
+
const i = new Set(o.expectedRoleFieldIds[s] ?? []), c = Object.keys(e.byRole[s] ?? {});
|
|
595
|
+
if (c.length !== i.size || c.some((m) => !i.has(m)))
|
|
556
596
|
throw new a(
|
|
557
|
-
`The role-scoped ${
|
|
597
|
+
`The role-scoped ${s} bindings do not match the authored result fields.`
|
|
558
598
|
);
|
|
559
599
|
}
|
|
560
|
-
const
|
|
561
|
-
if (r.length !==
|
|
600
|
+
const n = new Set(o.expectedMetricAliases), r = Object.keys(e.byMetricAlias ?? {});
|
|
601
|
+
if (r.length !== n.size || r.some((s) => !n.has(s)))
|
|
562
602
|
throw new a(
|
|
563
603
|
"The metric-alias bindings do not match the authored metric instances."
|
|
564
604
|
);
|
|
565
605
|
}
|
|
566
|
-
function
|
|
606
|
+
function de(e) {
|
|
567
607
|
if (!Array.isArray(e) || e.some(
|
|
568
608
|
(o) => !o || typeof o != "object" || Array.isArray(o)
|
|
569
609
|
))
|
|
@@ -572,67 +612,67 @@ function ee(e) {
|
|
|
572
612
|
);
|
|
573
613
|
return e;
|
|
574
614
|
}
|
|
575
|
-
function
|
|
576
|
-
e.forEach((t,
|
|
615
|
+
function me(e, o) {
|
|
616
|
+
e.forEach((t, n) => {
|
|
577
617
|
o.forEach((r) => {
|
|
578
618
|
if (!Object.prototype.hasOwnProperty.call(t, r.key) || t[r.key] === void 0)
|
|
579
619
|
throw new a(
|
|
580
|
-
`Canonical pivot column "${r.key}" is absent from row ${
|
|
620
|
+
`Canonical pivot column "${r.key}" is absent from row ${n}.`
|
|
581
621
|
);
|
|
582
622
|
});
|
|
583
623
|
});
|
|
584
624
|
}
|
|
585
|
-
function
|
|
586
|
-
const
|
|
625
|
+
function fe(e, o, t) {
|
|
626
|
+
const n = new Set(o.map((r) => r.key));
|
|
587
627
|
["groupby", "detail"].forEach((r) => {
|
|
588
628
|
Object.entries(e.byRole[r] ?? {}).forEach(
|
|
589
|
-
([
|
|
590
|
-
const c =
|
|
591
|
-
if (!
|
|
629
|
+
([s, i]) => {
|
|
630
|
+
const c = i.outputKey || i.rawKey;
|
|
631
|
+
if (!n.has(c) || t.columnKinds[c] !== "row")
|
|
592
632
|
throw new a(
|
|
593
|
-
`The role-scoped ${r} binding for "${
|
|
633
|
+
`The role-scoped ${r} binding for "${s}" does not name an authoritative result column.`
|
|
594
634
|
);
|
|
595
635
|
}
|
|
596
636
|
);
|
|
597
637
|
});
|
|
598
638
|
}
|
|
599
|
-
function
|
|
639
|
+
function $(e, o) {
|
|
600
640
|
o.forEach((t) => {
|
|
601
|
-
const
|
|
602
|
-
if (
|
|
641
|
+
const n = e.columnKinds[t.key];
|
|
642
|
+
if (n === "pivot_metric" && t.pivotIdentity === void 0)
|
|
603
643
|
throw new a(
|
|
604
644
|
`Physical pivot result column "${t.key}" is missing its identity.`
|
|
605
645
|
);
|
|
606
|
-
if (
|
|
646
|
+
if (n !== "pivot_metric" && t.pivotIdentity !== void 0)
|
|
607
647
|
throw new a(
|
|
608
648
|
`Canonical pivot result column "${t.key}" carries pivot identity outside the physical pivot projection.`
|
|
609
649
|
);
|
|
610
650
|
});
|
|
611
651
|
}
|
|
612
|
-
function
|
|
613
|
-
const o =
|
|
652
|
+
function ue(e) {
|
|
653
|
+
const o = de(e.records), t = ae(e.columns), n = le(
|
|
614
654
|
e.pivotResultContract,
|
|
615
655
|
t
|
|
616
|
-
), r =
|
|
656
|
+
), r = n.expectedRoleFieldIds.pivotby ?? [];
|
|
617
657
|
if (e.pivotResultState === "loaded_empty") {
|
|
618
658
|
if (o.length !== 0)
|
|
619
659
|
throw new a(
|
|
620
660
|
"A loaded_empty pivot result cannot carry records."
|
|
621
661
|
);
|
|
622
662
|
if (t.some(
|
|
623
|
-
(m) =>
|
|
663
|
+
(m) => n.columnKinds[m.key] === "pivot_metric"
|
|
624
664
|
))
|
|
625
665
|
throw new a(
|
|
626
666
|
"A loaded_empty pivot result cannot carry physical pivot columns."
|
|
627
667
|
);
|
|
628
|
-
|
|
629
|
-
const c =
|
|
630
|
-
return
|
|
668
|
+
$(n, t);
|
|
669
|
+
const c = E(e.columnKeyMap);
|
|
670
|
+
return k(c, n), {
|
|
631
671
|
pivotResultState: "loaded_empty",
|
|
632
672
|
records: [],
|
|
633
673
|
columns: t,
|
|
634
674
|
columnKeyMap: c,
|
|
635
|
-
pivotResultContract:
|
|
675
|
+
pivotResultContract: n
|
|
636
676
|
};
|
|
637
677
|
}
|
|
638
678
|
if (e.pivotResultState !== "loaded_valid")
|
|
@@ -643,40 +683,40 @@ function re(e) {
|
|
|
643
683
|
throw new a(
|
|
644
684
|
"A loaded_valid pivot result must carry at least one record."
|
|
645
685
|
);
|
|
646
|
-
const
|
|
647
|
-
|
|
648
|
-
const
|
|
649
|
-
(c) =>
|
|
686
|
+
const s = E(e.columnKeyMap);
|
|
687
|
+
k(s, n), fe(s, t, n), $(n, t);
|
|
688
|
+
const i = t.filter(
|
|
689
|
+
(c) => n.columnKinds[c.key] === "pivot_metric"
|
|
650
690
|
);
|
|
651
|
-
if (r.length > 0 &&
|
|
691
|
+
if (r.length > 0 && i.length === 0)
|
|
652
692
|
throw new a(
|
|
653
693
|
"A loaded_valid pivot result is missing its physical pivot columns."
|
|
654
694
|
);
|
|
655
695
|
try {
|
|
656
|
-
|
|
696
|
+
N(i, {
|
|
657
697
|
expectedPivotFieldIds: r,
|
|
658
|
-
columnClassifications:
|
|
698
|
+
columnClassifications: n.columnClassifications
|
|
659
699
|
});
|
|
660
700
|
} catch (c) {
|
|
661
|
-
throw c instanceof
|
|
701
|
+
throw c instanceof D ? new a(c.message, c) : c;
|
|
662
702
|
}
|
|
663
|
-
return
|
|
703
|
+
return me(o, t), {
|
|
664
704
|
pivotResultState: "loaded_valid",
|
|
665
705
|
records: o,
|
|
666
706
|
columns: t,
|
|
667
|
-
columnKeyMap:
|
|
668
|
-
pivotResultContract:
|
|
707
|
+
columnKeyMap: s,
|
|
708
|
+
pivotResultContract: n
|
|
669
709
|
};
|
|
670
710
|
}
|
|
671
|
-
function
|
|
711
|
+
function Ue(e) {
|
|
672
712
|
const o = /* @__PURE__ */ new Set();
|
|
673
|
-
["groupby", "detail"].forEach((
|
|
674
|
-
Object.values(e.columnKeyMap.byRole[
|
|
675
|
-
o.add(
|
|
713
|
+
["groupby", "detail"].forEach((s) => {
|
|
714
|
+
Object.values(e.columnKeyMap.byRole[s] ?? {}).forEach((i) => {
|
|
715
|
+
o.add(i.outputKey || i.rawKey);
|
|
676
716
|
});
|
|
677
717
|
});
|
|
678
|
-
const t = new Set(e.physicalPivotColumnKeys),
|
|
679
|
-
e.columns.map((
|
|
718
|
+
const t = new Set(e.physicalPivotColumnKeys), n = new Set(
|
|
719
|
+
e.columns.map((s) => s.key)
|
|
680
720
|
), r = {
|
|
681
721
|
version: 1,
|
|
682
722
|
expectedRoleFieldIds: {
|
|
@@ -695,18 +735,18 @@ function xe(e) {
|
|
|
695
735
|
},
|
|
696
736
|
expectedMetricAliases: [...e.expectedMetricAliases ?? []],
|
|
697
737
|
columnKinds: Object.fromEntries(
|
|
698
|
-
e.columns.map((
|
|
699
|
-
|
|
700
|
-
o.has(
|
|
738
|
+
e.columns.map((s) => [
|
|
739
|
+
s.key,
|
|
740
|
+
o.has(s.key) ? "row" : t.has(s.key) ? "pivot_metric" : "value"
|
|
701
741
|
])
|
|
702
742
|
),
|
|
703
743
|
columnClassifications: Object.fromEntries(
|
|
704
744
|
Object.entries(e.columnMetadata ?? {}).filter(
|
|
705
|
-
([
|
|
745
|
+
([s]) => n.has(s)
|
|
706
746
|
)
|
|
707
747
|
)
|
|
708
748
|
};
|
|
709
|
-
return
|
|
749
|
+
return ue({
|
|
710
750
|
pivotResultState: e.records.length === 0 ? "loaded_empty" : "loaded_valid",
|
|
711
751
|
pivotResultContract: r,
|
|
712
752
|
records: e.records,
|
|
@@ -715,20 +755,35 @@ function xe(e) {
|
|
|
715
755
|
});
|
|
716
756
|
}
|
|
717
757
|
export {
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
758
|
+
Ue as A,
|
|
759
|
+
B as C,
|
|
760
|
+
V as D,
|
|
761
|
+
Ke as M,
|
|
762
|
+
C as P,
|
|
763
|
+
z as a,
|
|
764
|
+
J as b,
|
|
765
|
+
S as c,
|
|
766
|
+
Ee as d,
|
|
767
|
+
ke as e,
|
|
768
|
+
se as f,
|
|
769
|
+
G as g,
|
|
770
|
+
Y as h,
|
|
771
|
+
Se as i,
|
|
772
|
+
H as j,
|
|
773
|
+
_e as k,
|
|
774
|
+
Q as l,
|
|
775
|
+
re as m,
|
|
776
|
+
ne as n,
|
|
777
|
+
Fe as o,
|
|
778
|
+
I as p,
|
|
779
|
+
je as q,
|
|
780
|
+
$e as r,
|
|
781
|
+
Me as s,
|
|
782
|
+
Ae as t,
|
|
783
|
+
Te as u,
|
|
784
|
+
Pe as v,
|
|
785
|
+
ie as w,
|
|
786
|
+
Oe as x,
|
|
787
|
+
a as y,
|
|
788
|
+
ue as z
|
|
734
789
|
};
|