react-semaphor 0.1.583 → 0.1.584
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/analytics-protocol/index.js +183 -178
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +7 -7
- package/dist/briefings/index.js +4 -4
- package/dist/chunks/aggregate-measure-field-DsFXETpI.js +22 -0
- package/dist/chunks/{assistant-chat-D3fm5qod.js → assistant-chat-nmycV1Se.js} +12 -12
- package/dist/chunks/{bookmark-impact-Dpxl46Wd.js → bookmark-impact-CI3gmxi0.js} +2 -2
- package/dist/chunks/{bookmark-state-BEl_G9vr.js → bookmark-state-D9-RFkDg.js} +22 -22
- package/dist/chunks/{card-filter-builder-IxkFVxy2.js → card-filter-builder-C7QyPqRy.js} +145 -145
- package/dist/chunks/{comparison-window-caption-sRFtnX1q.js → comparison-window-caption-BAnsTI8y.js} +291 -305
- package/dist/chunks/{dashboard-briefing-launcher-D45YfCkm.js → dashboard-briefing-launcher-DXs0XA1O.js} +13 -13
- package/dist/chunks/{dashboard-controls-DOvZRfof.js → dashboard-controls-6Zoo8d8Y.js} +84 -84
- package/dist/chunks/{dashboard-BMqG98fc.js → dashboard-inJy_V78.js} +1 -1
- package/dist/chunks/{dashboard-json-B_4TqF_o.js → dashboard-json-D5eJhVA9.js} +4 -4
- package/dist/chunks/{dates-44_rcNj2.js → dates-B3_GWc_Y.js} +8 -8
- package/dist/chunks/{edit-dashboard-visual-BBPKJWSe.js → edit-dashboard-visual-DR03SYeW.js} +17 -17
- package/dist/chunks/{filter-reach-copy-DWPq4Swi.js → filter-reach-copy-CZwzrxBp.js} +1391 -1228
- package/dist/chunks/{filter-value-text-DXGYypEd.js → filter-value-text-DtOvqcjn.js} +8 -8
- package/dist/chunks/{index-DPRzcFp0.js → index-BgT1L0p5.js} +5 -5
- package/dist/chunks/{layout-grid-8rR-LPTk.js → layout-grid-9nSS2SL-.js} +1 -1
- package/dist/chunks/{list-filter-C1-uTgjR.js → list-filter-CfMPI6v4.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-D_HgptqZ.js → matrix-analytical-definition-Cs2v43FM.js} +2 -2
- package/dist/chunks/{matrix-member-presentation-DRa-9e6Q.js → matrix-member-presentation-BKDyxJho.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-DCVinw1o.js → matrix-operation-contract-BM5TveR3.js} +153 -147
- package/dist/chunks/{metric-comparison-n9NsIa-2.js → metric-comparison-Be4uS3Ql.js} +1 -1
- package/dist/chunks/{paintbrush-aR17Z3C9.js → paintbrush-LzAje2ff.js} +1 -1
- package/dist/chunks/{palette-a5FCZKFI.js → palette-DicJG0TC.js} +1 -1
- package/dist/chunks/{pivot-header-presentation-MvvlxtIB.js → pivot-header-presentation-uH06jiZD.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-8tuNjRvG.js → pivot-result-contract-expectations-DvZY4eJM.js} +779 -765
- package/dist/chunks/{pivot-result-identity-B89X5xjb.js → pivot-result-identity-BZexMfmL.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-B8PhISua.js → report-preferences-dialog-DWeVe2so.js} +171 -170
- package/dist/chunks/{report-runtime-context-BhPzLTbS.js → report-runtime-context-NlOXwyRB.js} +1 -1
- package/dist/chunks/{resolve-dashboard-input-context-BfT8y5xL.js → resolve-dashboard-input-context-uATCuOP7.js} +4988 -4892
- package/dist/chunks/{save-D985VvYp.js → save-0wu1Z1U7.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-DH91-2B9.js → saved-dashboard-context-DSVV9iqW.js} +6 -6
- package/dist/chunks/selection-filter-compiler-BReJy-uv.js +92 -0
- package/dist/chunks/{semaphor-ready-indicator-Cg_Z2IDc.js → semaphor-ready-indicator-B9vvRMnJ.js} +45953 -44806
- package/dist/chunks/{shelf-drop-preview-context-C7-BgcP4.js → shelf-drop-preview-context-BHOnp5Bo.js} +5 -5
- package/dist/chunks/{stored-dashboard-BpyCiE49.js → stored-dashboard-xc5iidHL.js} +210 -221
- package/dist/chunks/{style-sheet-parts-C7qGZuH1.js → style-sheet-parts-_dGSFzDi.js} +2 -2
- package/dist/chunks/{table-export-sheet-wBkk17aa.js → table-export-sheet-Cv_94obr.js} +1 -1
- package/dist/chunks/{token-types-iKMplaBL.js → token-types-DEe_FP4l.js} +1 -1
- package/dist/chunks/{upload-CiGNKJ_0.js → upload-CtyOkU_B.js} +1 -1
- package/dist/chunks/{validators-B8fpdinG.js → validators-CJ8Jh0E8.js} +2 -2
- package/dist/chunks/{variable-draft-D8GFhAkm.js → variable-draft-C3CjhsJQ.js} +4 -4
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +403 -383
- package/dist/format-utils/index.js +140 -140
- package/dist/index.js +234 -231
- package/dist/report-runtime-context/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/visual/data-table/types/data-table.d.ts +3 -0
- package/dist/types/components/visual/matrix-table/matrix-interaction-actions.d.ts +24 -3
- package/dist/types/index.js +5 -5
- package/dist/types/lib/hooks/interactions/use-drill-actions.d.ts +1 -1
- package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +9 -0
- package/dist/types/lib/matrix-table/matrix-runtime.d.ts +8 -3
- package/dist/types/lib/query-context/compile-selection-filters.d.ts +1 -5
- package/dist/types/lib/see-records/click.d.ts +79 -0
- package/dist/types/lib/see-records/see-records-offer.d.ts +25 -0
- package/dist/types/lib/see-records/use-see-records-offer.d.ts +16 -0
- package/dist/types/lib/types/common-types.d.ts +6 -0
- package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +7 -0
- package/dist/types/shared/analytics-protocol/aggregate-measure-field.d.ts +13 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +1 -0
- package/dist/types/shared/analytics-protocol/selection-filter-compiler.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/see-records/availability.d.ts +30 -0
- package/dist/types/shared/dashboard-authoring/see-records/click.d.ts +37 -0
- package/dist/types/shared/dashboard-authoring/see-records/index.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/see-records/limits.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/see-records/measure-kind.d.ts +46 -0
- package/dist/types/shared/dashboard-authoring/see-records/request.d.ts +28 -0
- package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +61 -0
- package/dist/types/shared/usage-events/envelope.d.ts +4 -4
- package/package.json +1 -1
- package/dist/chunks/selection-filter-compiler-CUDRnUxc.js +0 -80
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const SEE_RECORDS_LIMITS: {
|
|
2
|
+
readonly pageSize: 100;
|
|
3
|
+
/** Rows the sheet shows (SR-D9). */
|
|
4
|
+
readonly maxRows: 500;
|
|
5
|
+
/** Rows a download carries: the direct CSV ceiling (SR-D29). */
|
|
6
|
+
readonly maxDownloadRows: 10000;
|
|
7
|
+
/** Columns a list starts with before the viewer adds more. */
|
|
8
|
+
readonly maxInferredColumns: 12;
|
|
9
|
+
/** Steps and added columns one request may carry. */
|
|
10
|
+
readonly maxSteps: 20;
|
|
11
|
+
readonly maxAddedColumns: 20;
|
|
12
|
+
};
|
|
13
|
+
/** The last page a list shows: maxRows / pageSize. */
|
|
14
|
+
export declare const SEE_RECORDS_MAX_PAGE: number;
|
|
15
|
+
/** Card types that offer See records in this plan (SR-D14, SR-D20). */
|
|
16
|
+
export declare const SEE_RECORDS_CARD_TYPES: readonly ["table", "matrixTable", "kpi", "bar", "horizontalBar", "stackedBar", "line", "stackedLine", "area", "stackedArea", "combo", "pie", "doughnut", "funnel"];
|
|
17
|
+
export type SeeRecordsCardType = (typeof SEE_RECORDS_CARD_TYPES)[number];
|
|
18
|
+
export declare function isSeeRecordsCardType(type: unknown): type is SeeRecordsCardType;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Field, MetricField } from '../../../lib/types/explorer-types.js';
|
|
2
|
+
export type SeeRecordsRowAggregate = 'count' | 'sum' | 'avg' | 'min' | 'max' | 'median';
|
|
3
|
+
/**
|
|
4
|
+
* `valueIsTheAggregate`: the number the card shows is the aggregate call
|
|
5
|
+
* itself, nothing computed around it. `COUNT({x})` is; `COUNT({x}) + 1` and
|
|
6
|
+
* `{orders} * 2` are not. Only then can a list's count be checked against the
|
|
7
|
+
* number shown (SR-INV-2, ledger P1-11).
|
|
8
|
+
*/
|
|
9
|
+
export type SeeRecordsMeasureKind =
|
|
10
|
+
/** COUNT(*): one line per grain row; no field to test for null. */
|
|
11
|
+
{
|
|
12
|
+
kind: 'rowCount';
|
|
13
|
+
valueIsTheAggregate: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* One aggregate call over row values: one line per grain row. `rowField` is
|
|
17
|
+
* what the call reads per row: the one input field, or the row expression
|
|
18
|
+
* over several (`{field_0} * {field_1}` for SUM({a} * {b})).
|
|
19
|
+
*/
|
|
20
|
+
| {
|
|
21
|
+
kind: 'rows';
|
|
22
|
+
aggregate: SeeRecordsRowAggregate;
|
|
23
|
+
rowField: Field;
|
|
24
|
+
valueIsTheAggregate: boolean;
|
|
25
|
+
}
|
|
26
|
+
/** COUNT(DISTINCT field): one line per distinct value of `rowField`. */
|
|
27
|
+
| {
|
|
28
|
+
kind: 'distinct';
|
|
29
|
+
rowField: Field;
|
|
30
|
+
valueIsTheAggregate: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** More than one aggregate call: the viewer lists one input at a time. */
|
|
33
|
+
| {
|
|
34
|
+
kind: 'calculation';
|
|
35
|
+
inputs: readonly MetricField[];
|
|
36
|
+
} | {
|
|
37
|
+
kind: 'unlistable';
|
|
38
|
+
reason: 'table_calculation' | 'measure_not_listable';
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* A field as a plain column of a list: no aggregate, measure filters or
|
|
42
|
+
* comparison, and the detail role, so a filter on it is a row filter (WHERE),
|
|
43
|
+
* never a measure filter (HAVING), and the list never compares.
|
|
44
|
+
*/
|
|
45
|
+
export declare function seeRecordsRowField(field: Field): Field;
|
|
46
|
+
export declare function seeRecordsMeasureKind(measure: MetricField): SeeRecordsMeasureKind;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SeeRecordsClick } from './click.js';
|
|
3
|
+
/** A field of a reached dataset: `dataset` named as the join-safety owners name it, `field` the field's `name`. */
|
|
4
|
+
export type SeeRecordsColumnRef = {
|
|
5
|
+
dataset: string;
|
|
6
|
+
field: string;
|
|
7
|
+
};
|
|
8
|
+
/** Steps name a list column; the server binds the field and builds the condition. */
|
|
9
|
+
export type SeeRecordsStep = {
|
|
10
|
+
kind: 'only';
|
|
11
|
+
column: SeeRecordsColumnRef;
|
|
12
|
+
value: string | number | boolean | null;
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'groupBy';
|
|
15
|
+
column: SeeRecordsColumnRef;
|
|
16
|
+
};
|
|
17
|
+
export type SeeRecordsRequest = {
|
|
18
|
+
click: SeeRecordsClick;
|
|
19
|
+
/** For a calculation: which input to list. Absent: the first listable input. */
|
|
20
|
+
inputMeasureId?: string;
|
|
21
|
+
steps: readonly SeeRecordsStep[];
|
|
22
|
+
addedColumns: readonly SeeRecordsColumnRef[];
|
|
23
|
+
/** 1-based; 1 to maxRows / pageSize. */
|
|
24
|
+
page: number;
|
|
25
|
+
/** One page of up to maxDownloadRows, for the file (SR-D29). `page` must be 1. */
|
|
26
|
+
download?: true;
|
|
27
|
+
};
|
|
28
|
+
export declare const seeRecordsRequestSchema: z.ZodType<SeeRecordsRequest>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { OperationTemporalState } from '../../analytics-protocol/operation-temporal-state.js';
|
|
2
|
+
import { RawTemporalValueMetadata, SemaphorResultColumn } from '../../analytics-protocol/contracts.js';
|
|
3
|
+
import { SeeRecordsColumnRef } from './request.js';
|
|
4
|
+
/** One line per record of the grain dataset, or one line per value of a group column. */
|
|
5
|
+
export type SeeRecordsShape = 'rows' | 'groups';
|
|
6
|
+
/**
|
|
7
|
+
* Why a column is in the list: `date` the grain's primary date (rows lists
|
|
8
|
+
* only); `display` a dataset's display field; `card` one of the
|
|
9
|
+
* card's dimensions; `measureField` the measure's row field; `group` the
|
|
10
|
+
* group column; `added` from More columns; `count` the line's record count;
|
|
11
|
+
* `measure` the clicked measure per group.
|
|
12
|
+
*/
|
|
13
|
+
export type SeeRecordsColumnRole = 'date' | 'display' | 'card' | 'measureField' | 'group' | 'added' | 'count' | 'measure';
|
|
14
|
+
export type SeeRecordsColumn = {
|
|
15
|
+
/** The key of this column's value in each row. */
|
|
16
|
+
key: string;
|
|
17
|
+
label: string;
|
|
18
|
+
/** Absent for `count` and `measure`. */
|
|
19
|
+
ref?: SeeRecordsColumnRef;
|
|
20
|
+
role: SeeRecordsColumnRole;
|
|
21
|
+
dataType: SemaphorResultColumn['dataType'];
|
|
22
|
+
/** Offers Only this and Group by. False for `count`, `measure`, and date and time columns. */
|
|
23
|
+
narrowable: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* A date the run returned raw, in the report timezone, and the kind it is:
|
|
26
|
+
* the run's own result-column metadata, so the dialog draws it as a Detail
|
|
27
|
+
* table draws the same column. Absent on any other column.
|
|
28
|
+
*/
|
|
29
|
+
rawTemporal?: RawTemporalValueMetadata;
|
|
30
|
+
};
|
|
31
|
+
export type SeeRecordsResult = {
|
|
32
|
+
shape: SeeRecordsShape;
|
|
33
|
+
/** The listed measure's label, then the click's label when it has one. */
|
|
34
|
+
title: string;
|
|
35
|
+
columns: readonly SeeRecordsColumn[];
|
|
36
|
+
rows: readonly Record<string, unknown>[];
|
|
37
|
+
/** The list's own count. Paging and Download read this, never the shown number. */
|
|
38
|
+
totalCount: number | null;
|
|
39
|
+
page: number;
|
|
40
|
+
hasMore: boolean;
|
|
41
|
+
/** totalCount > maxRows. */
|
|
42
|
+
capped: boolean;
|
|
43
|
+
/** Download is refused above maxDownloadRows, and when totalCount is null (SR-D29). */
|
|
44
|
+
downloadable: boolean;
|
|
45
|
+
/** Only on a level whose count must equal the clicked number (SR-INV-2). */
|
|
46
|
+
countMismatch?: {
|
|
47
|
+
shown: number;
|
|
48
|
+
listed: number;
|
|
49
|
+
};
|
|
50
|
+
/** A calculation's other listable inputs; empty otherwise. */
|
|
51
|
+
inputAlternatives: readonly {
|
|
52
|
+
inputMeasureId: string;
|
|
53
|
+
label: string;
|
|
54
|
+
}[];
|
|
55
|
+
/** More columns: fields with one value per line, of datasets the card already reaches, not hidden and not shown. */
|
|
56
|
+
addableColumns: readonly (SeeRecordsColumnRef & {
|
|
57
|
+
label: string;
|
|
58
|
+
})[];
|
|
59
|
+
/** The instant and anchors this exploration keeps; sent back with every later request. */
|
|
60
|
+
temporalState: OperationTemporalState;
|
|
61
|
+
};
|
|
@@ -91,10 +91,10 @@ export declare const usageEventEnvelopeSchema: z.ZodObject<{
|
|
|
91
91
|
message: string;
|
|
92
92
|
} | null;
|
|
93
93
|
surface: "api" | "embed" | "console" | "mcp" | "public_link" | "scheduler" | "pdf_renderer";
|
|
94
|
-
category: "usage" | "runtime" | "delivery" | "agent";
|
|
95
|
-
connection_id: string | null;
|
|
96
94
|
card_id: string | null;
|
|
97
95
|
sheet_id: string | null;
|
|
96
|
+
category: "runtime" | "usage" | "delivery" | "agent";
|
|
97
|
+
connection_id: string | null;
|
|
98
98
|
outcome: "cancelled" | "failed" | "timed_out" | "succeeded" | null;
|
|
99
99
|
domain_id: string | null;
|
|
100
100
|
project_id: string | null;
|
|
@@ -120,10 +120,10 @@ export declare const usageEventEnvelopeSchema: z.ZodObject<{
|
|
|
120
120
|
message: string;
|
|
121
121
|
} | null;
|
|
122
122
|
surface: "api" | "embed" | "console" | "mcp" | "public_link" | "scheduler" | "pdf_renderer";
|
|
123
|
-
category: "usage" | "runtime" | "delivery" | "agent";
|
|
124
|
-
connection_id: string | null;
|
|
125
123
|
card_id: string | null;
|
|
126
124
|
sheet_id: string | null;
|
|
125
|
+
category: "runtime" | "usage" | "delivery" | "agent";
|
|
126
|
+
connection_id: string | null;
|
|
127
127
|
outcome: "cancelled" | "failed" | "timed_out" | "succeeded" | null;
|
|
128
128
|
domain_id: string | null;
|
|
129
129
|
project_id: string | null;
|
package/package.json
CHANGED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
function u(e) {
|
|
2
|
-
var o;
|
|
3
|
-
return JSON.stringify([
|
|
4
|
-
((o = e.field) == null ? void 0 : o.id) ?? "",
|
|
5
|
-
e.operator,
|
|
6
|
-
e.value ?? null,
|
|
7
|
-
e.temporalBucket ?? null,
|
|
8
|
-
e.rawTemporal ?? null
|
|
9
|
-
]);
|
|
10
|
-
}
|
|
11
|
-
function p(e) {
|
|
12
|
-
return JSON.stringify(e.map(u).sort());
|
|
13
|
-
}
|
|
14
|
-
function c(e) {
|
|
15
|
-
const o = /* @__PURE__ */ new Map();
|
|
16
|
-
for (const t of e)
|
|
17
|
-
for (const r of t.tuples) {
|
|
18
|
-
const n = r.conditions.filter(
|
|
19
|
-
(a) => {
|
|
20
|
-
var i;
|
|
21
|
-
return (i = a.field) == null ? void 0 : i.id;
|
|
22
|
-
}
|
|
23
|
-
);
|
|
24
|
-
if (n.length === 0) continue;
|
|
25
|
-
let s = o.get(t.sourceCardId);
|
|
26
|
-
s || (s = /* @__PURE__ */ new Map(), o.set(t.sourceCardId, s));
|
|
27
|
-
const l = [...n].sort(
|
|
28
|
-
(a, i) => u(a).localeCompare(u(i))
|
|
29
|
-
);
|
|
30
|
-
s.set(p(l), l);
|
|
31
|
-
}
|
|
32
|
-
return [...o.entries()].sort(([t], [r]) => t.localeCompare(r)).map(([t, r]) => ({
|
|
33
|
-
sourceCardId: t,
|
|
34
|
-
tuples: [...r.entries()].sort(([n], [s]) => n.localeCompare(s)).map(([, n]) => ({ conditions: n }))
|
|
35
|
-
}));
|
|
36
|
-
}
|
|
37
|
-
function d(e) {
|
|
38
|
-
const o = c(e);
|
|
39
|
-
if (o.length !== 0)
|
|
40
|
-
return {
|
|
41
|
-
id: "selection",
|
|
42
|
-
logicalOperator: "AND",
|
|
43
|
-
negate: !1,
|
|
44
|
-
conditions: [],
|
|
45
|
-
groups: o.map((t) => {
|
|
46
|
-
const r = `selection:${t.sourceCardId}`;
|
|
47
|
-
return {
|
|
48
|
-
id: r,
|
|
49
|
-
logicalOperator: "OR",
|
|
50
|
-
negate: !1,
|
|
51
|
-
conditions: [],
|
|
52
|
-
groups: t.tuples.map((n, s) => {
|
|
53
|
-
const l = `${r}:${s}`;
|
|
54
|
-
return {
|
|
55
|
-
id: l,
|
|
56
|
-
logicalOperator: "AND",
|
|
57
|
-
negate: !1,
|
|
58
|
-
conditions: n.conditions.map((a, i) => ({
|
|
59
|
-
...a,
|
|
60
|
-
id: `${l}:${i}`
|
|
61
|
-
})),
|
|
62
|
-
groups: []
|
|
63
|
-
};
|
|
64
|
-
})
|
|
65
|
-
};
|
|
66
|
-
})
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
function f(e) {
|
|
70
|
-
return JSON.stringify(
|
|
71
|
-
c(e).map((o) => [
|
|
72
|
-
o.sourceCardId,
|
|
73
|
-
o.tuples.map((t) => t.conditions.map(u))
|
|
74
|
-
])
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
export {
|
|
78
|
-
d as c,
|
|
79
|
-
f as s
|
|
80
|
-
};
|