react-semaphor 0.1.567 → 0.1.569
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/README.md +0 -7
- package/dist/analytics-protocol/index.js +434 -454
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +10 -12
- package/dist/briefings/index.js +4 -4
- package/dist/chunks/{_commonjsHelpers-DimLPMtv.js → _commonjsHelpers-Bid1ZNYj.js} +271 -222
- package/dist/chunks/{assistant-chat-D-IuHHwh.js → assistant-chat-Dzf2Mbph.js} +107 -109
- package/dist/chunks/{bookmark-impact-B0estCHn.js → bookmark-impact-Czg6FGt5.js} +2 -2
- package/dist/chunks/{bookmark-state-Du3s13_V.js → bookmark-state-CflS88gq.js} +251 -250
- package/dist/chunks/{card-filter-builder-DbSmzvem.js → card-filter-builder-BS982X7x.js} +1001 -1000
- package/dist/chunks/{code-editor-DJNOsgJH.js → code-editor-BsxHzm9u.js} +43 -45
- package/dist/chunks/{comparison-window-caption-CMLb3mut.js → comparison-window-caption-lLTgzOkM.js} +252 -253
- package/dist/chunks/{dashboard-f8J9DHh5.js → dashboard-BiYSbxZv.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DunvZYsU.js → dashboard-briefing-launcher-Bdj7luOr.js} +119 -120
- package/dist/chunks/{dashboard-controls-B09cN2Dz.js → dashboard-controls-TViDsnb8.js} +17 -19
- package/dist/chunks/dashboard-json-Dg9dQd9U.js +66 -0
- package/dist/chunks/{dates-BsJcyoC_.js → dates-BsPrWZIP.js} +8 -8
- package/dist/chunks/{edit-dashboard-visual-Cwzbpty8.js → edit-dashboard-visual-C6hoIeEJ.js} +20 -21
- package/dist/chunks/{filter-reach-copy-P-kDwUpY.js → filter-reach-copy-hcQ4os0u.js} +862 -852
- package/dist/chunks/filter-value-text-CVxEEDVl.js +146 -0
- package/dist/chunks/{index-BcXw0CpM.js → index-G4q89J6O.js} +74 -76
- package/dist/chunks/{layout-grid-0hIlqEtk.js → layout-grid-BIcoFfdS.js} +1 -1
- package/dist/chunks/{list-filter-DkgoCeBm.js → list-filter-C6tYkHyv.js} +1 -1
- package/dist/chunks/matrix-analytical-definition-dkS8szLM.js +1253 -0
- package/dist/chunks/matrix-member-presentation-DRa-9e6Q.js +169 -0
- package/dist/chunks/{matrix-operation-contract-Eb6elidS.js → matrix-operation-contract-DCVinw1o.js} +122 -122
- package/dist/chunks/{metric-comparison-ChXUFaZu.js → metric-comparison-n9NsIa-2.js} +175 -128
- package/dist/chunks/{palette-4vf2BEEg.js → palette-NjHOE_6B.js} +1 -1
- package/dist/chunks/pivot-result-contract-expectations-DkmueDTW.js +55 -0
- package/dist/chunks/{pivot-result-identity-BlbLrqaC.js → pivot-result-identity-B89X5xjb.js} +1 -1
- package/dist/chunks/raw-temporal-value-DdT0s47W.js +159 -0
- package/dist/chunks/{report-preferences-dialog-CbgmdWeZ.js → report-preferences-dialog-Xc8_GFju.js} +26 -28
- package/dist/chunks/{report-runtime-context-DnA_PiKo.js → report-runtime-context-BhPzLTbS.js} +1 -1
- package/dist/chunks/{resolve-dashboard-input-context-DPKSF3qj.js → resolve-dashboard-input-context-KqvcLcTM.js} +5956 -5880
- package/dist/chunks/{save-D6pHmSSP.js → save-C6VmEJTA.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-CNudmm9U.js → saved-dashboard-context-BeXXyoD4.js} +6 -6
- package/dist/chunks/{semaphor-ready-indicator-CQd-PCCZ.js → semaphor-ready-indicator-BNkaANsG.js} +31011 -30850
- package/dist/chunks/{shelf-drop-preview-context-CWS3e20y.js → shelf-drop-preview-context-C_issPBA.js} +18 -20
- package/dist/chunks/{stored-dashboard-CrQFT27O.js → stored-dashboard-B6_StAty.js} +232 -234
- package/dist/chunks/{table-export-sheet--DUKWk6o.js → table-export-sheet-BWP2joD1.js} +1 -1
- package/dist/chunks/{temporal-input-presentation--2r9BLr0.js → temporal-input-presentation-scSWQXAB.js} +4 -4
- package/dist/chunks/{token-types-C8JymO8s.js → token-types-iKMplaBL.js} +1 -1
- package/dist/chunks/{upload-Cf3wXZT8.js → upload-BRW4Mwrd.js} +1 -1
- package/dist/chunks/validators-B8fpdinG.js +3651 -0
- package/dist/chunks/{variable-draft-BDxlD0dM.js → variable-draft-BQ3OMjvy.js} +4 -4
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1778 -1741
- package/dist/format-utils/index.js +230 -231
- package/dist/index.js +236 -237
- 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/surfboard/filter/types.d.ts +5 -4
- package/dist/types/components/ui-custom/date-range-presets.d.ts +1 -17
- package/dist/types/index.js +9 -9
- package/dist/types/lib/document/document-edits.d.ts +8 -3
- package/dist/types/lib/document/document-text-style.d.ts +54 -0
- package/dist/types/lib/hooks/use-date-filter.d.ts +3 -3
- package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
- package/dist/types/lib/types/explorer-types.d.ts +2 -2
- package/dist/types/lib/types/index.d.ts +1 -1
- package/dist/types/lib/utils/card-definition.d.ts +7 -7
- package/dist/types/shared/analytics-protocol/agent-time-window.d.ts +84 -0
- package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +2 -2
- package/dist/types/shared/analytics-protocol/contracts.d.ts +8 -17
- package/dist/types/shared/analytics-protocol/fixtures.d.ts +3 -2
- package/dist/types/shared/analytics-protocol/index.d.ts +2 -4
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +4 -4
- package/dist/types/shared/analytics-protocol/relative-date/describe.d.ts +18 -0
- package/dist/types/shared/analytics-protocol/relative-date/index.d.ts +7 -0
- package/dist/types/shared/analytics-protocol/relative-date/limits.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/relative-date/presets.d.ts +11 -0
- package/dist/types/shared/analytics-protocol/relative-date/resolve.d.ts +49 -0
- package/dist/types/shared/analytics-protocol/relative-date/schemas.d.ts +76 -0
- package/dist/types/shared/analytics-protocol/relative-date/traits.d.ts +51 -0
- package/dist/types/shared/analytics-protocol/relative-date/window.d.ts +111 -0
- package/dist/types/shared/analytics-protocol/selection-contract.d.ts +1 -1
- package/dist/types/shared/assistant-protocol/context.d.ts +12 -12
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +0 -2
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +176 -1756
- package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +8 -4
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +74 -74
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +20 -20
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +8 -2
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +10 -2
- package/dist/types/shared/format-utils/filter-detail.d.ts +2 -8
- package/dist/types/shared/format-utils/filter-line.d.ts +2 -2
- package/dist/types/shared/format-utils/matrix-continuation.d.ts +3 -3
- package/dist/types/shared/temporal/index.d.ts +0 -2
- package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +2 -2
- package/package.json +2 -24
- package/DATA_APP_SDK.md +0 -339
- package/dist/chunks/dashboard-json-BNNCaKEc.js +0 -68
- package/dist/chunks/filter-value-text-7zhmth1S.js +0 -163
- package/dist/chunks/index-CuHybtft.js +0 -51
- package/dist/chunks/matrix-analytical-definition-C9xB_T84.js +0 -717
- package/dist/chunks/matrix-card-BSUeSXpD.js +0 -42
- package/dist/chunks/matrix-member-presentation-DZNgQpUq.js +0 -105
- package/dist/chunks/operators-B3zZoskU.js +0 -66
- package/dist/chunks/pivot-result-contract-expectations-Ddh1rNz5.js +0 -56
- package/dist/chunks/raw-temporal-value-Bqz8wc7L.js +0 -242
- package/dist/chunks/selection-reducer-OaJ-N5uN.js +0 -46
- package/dist/chunks/source-entity-resolution-DF6GulDn.js +0 -607
- package/dist/chunks/validators-wtjw0aw6.js +0 -3332
- package/dist/data-app-sdk/index.js +0 -1412
- package/dist/data-app-sdk-adapters/index.js +0 -361
- package/dist/data-app-sdk-validation/index.js +0 -1031
- package/dist/types/data-app-sdk/adapters.d.ts +0 -35
- package/dist/types/data-app-sdk/builders.d.ts +0 -62
- package/dist/types/data-app-sdk/contracts.d.ts +0 -419
- package/dist/types/data-app-sdk/executor.d.ts +0 -5
- package/dist/types/data-app-sdk/field-catalog-validation.d.ts +0 -29
- package/dist/types/data-app-sdk/hooks.d.ts +0 -11
- package/dist/types/data-app-sdk/index.d.ts +0 -9
- package/dist/types/data-app-sdk/provider.d.ts +0 -8
- package/dist/types/data-app-sdk/relationship-aware-field-policy.d.ts +0 -21
- package/dist/types/data-app-sdk/selection.d.ts +0 -2
- package/dist/types/data-app-sdk/validation.d.ts +0 -58
- package/dist/types/data-app-sdk-adapters.d.ts +0 -2
- package/dist/types/data-app-sdk-validation.d.ts +0 -2
- package/dist/types/data-app-sdk.d.ts +0 -2
- package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +0 -68
- package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +0 -20
- package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +0 -314
- package/dist/types/shared/analytics-protocol/time-window.d.ts +0 -52
- package/dist/types/shared/temporal/relative-date.d.ts +0 -21
- package/dist/types/shared/temporal/time-window-periods.d.ts +0 -21
- package/src/data-app-sdk/README.md +0 -402
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { RelativeDateWindow } from './window.js';
|
|
2
|
+
import { TemporalCalendar } from '../../temporal/calendar-periods.js';
|
|
3
|
+
/** Inclusive instants: `end` is the last millisecond the window covers. */
|
|
4
|
+
export type ResolvedRelativeDate = {
|
|
5
|
+
start: Date;
|
|
6
|
+
end: Date;
|
|
7
|
+
};
|
|
8
|
+
/** What resolution needs besides the window. */
|
|
9
|
+
export type RelativeDateInstants = {
|
|
10
|
+
/** The report calendar: time zone, week start, fiscal year. */
|
|
11
|
+
calendar: TemporalCalendar;
|
|
12
|
+
/** The run instant: the clock, or a pinned instant for reproducible runs. */
|
|
13
|
+
now: Date;
|
|
14
|
+
/** The data anchor (K11); a data-anchored window counts back from it, else from `now`. */
|
|
15
|
+
latestData?: Date;
|
|
16
|
+
};
|
|
17
|
+
export type RelativeDateResolveOptions = {
|
|
18
|
+
/**
|
|
19
|
+
* Resolve the comparison window `spansBack` spans before the current one
|
|
20
|
+
* (SPEC 3.3). Only for windows whose trait `comparesBySpan` is true.
|
|
21
|
+
* Default 0, the current window.
|
|
22
|
+
*/
|
|
23
|
+
spansBack?: number;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* A programming error, never a data error: `spansBack` on a window whose
|
|
27
|
+
* `comparesBySpan` is false, or a `spansBack` that is not a whole number of
|
|
28
|
+
* spans.
|
|
29
|
+
*/
|
|
30
|
+
export declare class RelativeDateUsageError extends Error {
|
|
31
|
+
constructor(message: string);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The instants a window covers in the calendar (SPEC 3.2):
|
|
35
|
+
* - `periods`: from the start of period `from` to the end of period `to`,
|
|
36
|
+
* both counted from the period containing the anchor; with `toDate`, to
|
|
37
|
+
* the anchor itself;
|
|
38
|
+
* - `rolling`: back from the anchor by `n` units (minutes and hours count
|
|
39
|
+
* elapsed time; days and longer, the same wall-clock time `n` units earlier);
|
|
40
|
+
* - `monthDay`: the first or last day of the month containing `now`.
|
|
41
|
+
* The anchor is `now`; the data anchor for a window anchored at the latest
|
|
42
|
+
* data, when the caller passes one; or the last millisecond before the
|
|
43
|
+
* `lastComplete` period containing `now`. Weeks start on the calendar's week
|
|
44
|
+
* start; quarters and years follow its fiscal calendar when it has one.
|
|
45
|
+
*
|
|
46
|
+
* With `spansBack`, the window `spansBack` spans earlier by the comparison
|
|
47
|
+
* rule (SPEC 3.3).
|
|
48
|
+
*/
|
|
49
|
+
export declare function resolveRelativeDate(window: RelativeDateWindow, at: RelativeDateInstants, options?: RelativeDateResolveOptions): ResolvedRelativeDate;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { RelativeDateWindow, RelativeDateWindowInput, StoredRelativeDate } from './window.js';
|
|
3
|
+
/**
|
|
4
|
+
* Where stored data is parsed: exactly what was accepted before (today's mode
|
|
5
|
+
* shapes, strict, any positive `n`), plus window inputs; the output is the
|
|
6
|
+
* canonical window. Of the values accepted before, only a reversed `between`
|
|
7
|
+
* is now refused (SPEC 2.4).
|
|
8
|
+
*/
|
|
9
|
+
export declare const storedRelativeDateSchema: z.ZodType<RelativeDateWindow, z.ZodTypeDef, StoredRelativeDate>;
|
|
10
|
+
/**
|
|
11
|
+
* The strict window input shapes, one per kind, for schemas that list them
|
|
12
|
+
* (Plan B's agent time window schema). Cross-field rules (W1 to W4) and the
|
|
13
|
+
* limits are the reader's, not these shapes'.
|
|
14
|
+
*/
|
|
15
|
+
export declare const relativeDateWindowShapes: {
|
|
16
|
+
readonly periods: z.ZodObject<{
|
|
17
|
+
kind: z.ZodLiteral<"periods">;
|
|
18
|
+
unit: z.ZodEnum<["day", "week", "month", "quarter", "year"]>;
|
|
19
|
+
from: z.ZodNumber;
|
|
20
|
+
to: z.ZodNumber;
|
|
21
|
+
toDate: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
anchor: z.ZodUnion<[z.ZodEnum<["now", "latest_data"]>, z.ZodObject<{
|
|
23
|
+
lastComplete: z.ZodEnum<["day", "week", "month", "quarter", "year"]>;
|
|
24
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
25
|
+
lastComplete: "day" | "week" | "month" | "quarter" | "year";
|
|
26
|
+
}, {
|
|
27
|
+
lastComplete: "day" | "week" | "month" | "quarter" | "year";
|
|
28
|
+
}>]>;
|
|
29
|
+
}, "strict", z.ZodTypeAny, {
|
|
30
|
+
kind: "periods";
|
|
31
|
+
unit: "day" | "week" | "month" | "quarter" | "year";
|
|
32
|
+
from: number;
|
|
33
|
+
to: number;
|
|
34
|
+
anchor: "latest_data" | {
|
|
35
|
+
lastComplete: "day" | "week" | "month" | "quarter" | "year";
|
|
36
|
+
} | "now";
|
|
37
|
+
toDate?: boolean | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
kind: "periods";
|
|
40
|
+
unit: "day" | "week" | "month" | "quarter" | "year";
|
|
41
|
+
from: number;
|
|
42
|
+
to: number;
|
|
43
|
+
anchor: "latest_data" | {
|
|
44
|
+
lastComplete: "day" | "week" | "month" | "quarter" | "year";
|
|
45
|
+
} | "now";
|
|
46
|
+
toDate?: boolean | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
readonly rolling: z.ZodObject<{
|
|
49
|
+
kind: z.ZodLiteral<"rolling">;
|
|
50
|
+
unit: z.ZodEnum<["minute", "hour", "day", "week", "month", "quarter", "year"]>;
|
|
51
|
+
n: z.ZodNumber;
|
|
52
|
+
anchor: z.ZodEnum<["now", "latest_data"]>;
|
|
53
|
+
}, "strict", z.ZodTypeAny, {
|
|
54
|
+
kind: "rolling";
|
|
55
|
+
n: number;
|
|
56
|
+
unit: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year";
|
|
57
|
+
anchor: "latest_data" | "now";
|
|
58
|
+
}, {
|
|
59
|
+
kind: "rolling";
|
|
60
|
+
n: number;
|
|
61
|
+
unit: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year";
|
|
62
|
+
anchor: "latest_data" | "now";
|
|
63
|
+
}>;
|
|
64
|
+
readonly monthDay: z.ZodObject<{
|
|
65
|
+
kind: z.ZodLiteral<"monthDay">;
|
|
66
|
+
day: z.ZodEnum<["first", "last"]>;
|
|
67
|
+
}, "strict", z.ZodTypeAny, {
|
|
68
|
+
day: "last" | "first";
|
|
69
|
+
kind: "monthDay";
|
|
70
|
+
}, {
|
|
71
|
+
day: "last" | "first";
|
|
72
|
+
kind: "monthDay";
|
|
73
|
+
}>;
|
|
74
|
+
};
|
|
75
|
+
/** Canonical window inputs only, strict, with the authoring limits. */
|
|
76
|
+
export declare const relativeDateWindowSchema: z.ZodType<RelativeDateWindow, z.ZodTypeDef, RelativeDateWindowInput>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { RelativeDatePresetCategory } from './presets.js';
|
|
2
|
+
import { DateUnit, RelativeDateUnit, RelativeDateWindow } from './window.js';
|
|
3
|
+
export type RelativeDateTraits = {
|
|
4
|
+
/** A rolling minute or hour window. */
|
|
5
|
+
subDay: boolean;
|
|
6
|
+
/** Anchored at the latest data: the server must look up the data anchor (K11). */
|
|
7
|
+
dataAnchored: boolean;
|
|
8
|
+
/** "This unit to date" anchored at now: the unit K6 comparison placement aligns by. */
|
|
9
|
+
periodToDate?: DateUnit;
|
|
10
|
+
/** Whether each end is a whole day of the report calendar or an exact instant. */
|
|
11
|
+
bounds: {
|
|
12
|
+
start: 'day' | 'instant';
|
|
13
|
+
end: 'day' | 'instant';
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Its previous-period comparison comes from `resolveRelativeDate(..., { spansBack })`
|
|
17
|
+
* (SPEC 3.3): anchored at the end of the last complete period.
|
|
18
|
+
*/
|
|
19
|
+
comparesBySpan: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Shown by name, not by dates (a PDF filter line, a browser preview):
|
|
22
|
+
* windows counted from the data, whose dates are unknown until a run, and
|
|
23
|
+
* quarter and year windows, which a source's fiscal calendar may move
|
|
24
|
+
* (plan D8).
|
|
25
|
+
*/
|
|
26
|
+
printsByName: boolean;
|
|
27
|
+
/** The picker's preset category the window opens on: `time` for sub-day windows, `day` for a month's first or last day, else its unit. */
|
|
28
|
+
pickerCategory: RelativeDatePresetCategory;
|
|
29
|
+
/** The From and To offsets the picker's Relative tab edits: a `periods` window anchored at now without `toDate`. */
|
|
30
|
+
periodOffsets?: {
|
|
31
|
+
unit: DateUnit;
|
|
32
|
+
from: number;
|
|
33
|
+
to: number;
|
|
34
|
+
};
|
|
35
|
+
/** Valid as a Day Picker default: exactly one calendar day. */
|
|
36
|
+
dayPickerDefault: boolean;
|
|
37
|
+
/** Valid as a month picker default: this month or the previous one. */
|
|
38
|
+
monthPickerDefault: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The units the window covers, as a data anchor's resolution reports it:
|
|
41
|
+
* `n` units, `complete` when it ends before the anchor's own period. None
|
|
42
|
+
* for a month's first or last day.
|
|
43
|
+
*/
|
|
44
|
+
span?: {
|
|
45
|
+
unit: RelativeDateUnit;
|
|
46
|
+
n: number;
|
|
47
|
+
complete: boolean;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
/** The traits of a window (SPEC 3.5). */
|
|
51
|
+
export declare function relativeDateTraits(window: RelativeDateWindow): RelativeDateTraits;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/** Calendar units a relative date can count in. */
|
|
2
|
+
export type DateUnit = 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
3
|
+
/** Sub-day units, used only by rolling windows. */
|
|
4
|
+
export type SubDayDateUnit = 'minute' | 'hour';
|
|
5
|
+
export type RelativeDateUnit = DateUnit | SubDayDateUnit;
|
|
6
|
+
/** Where a window is measured from. */
|
|
7
|
+
export type RelativeDateAnchor =
|
|
8
|
+
/** The run instant. */
|
|
9
|
+
'now'
|
|
10
|
+
/** The data anchor of the window's own field (K11). */
|
|
11
|
+
| 'latest_data'
|
|
12
|
+
/** The last millisecond before the start of the `lastComplete` period containing the run instant. Only on `periods` (AO-D21). */
|
|
13
|
+
| {
|
|
14
|
+
lastComplete: DateUnit;
|
|
15
|
+
};
|
|
16
|
+
/** Whole calendar periods counted from the anchor's period: 0 contains the anchor, -1 is the one before. */
|
|
17
|
+
export type RelativePeriodsWindowInput = {
|
|
18
|
+
kind: 'periods';
|
|
19
|
+
unit: DateUnit;
|
|
20
|
+
from: number;
|
|
21
|
+
to: number;
|
|
22
|
+
/** Ends at the anchor instead of at the end of the `to` period; only with `to === 0`. */
|
|
23
|
+
toDate?: true;
|
|
24
|
+
anchor: RelativeDateAnchor;
|
|
25
|
+
};
|
|
26
|
+
/** Elapsed time back from the anchor. */
|
|
27
|
+
export type RelativeRollingWindowInput = {
|
|
28
|
+
kind: 'rolling';
|
|
29
|
+
unit: RelativeDateUnit;
|
|
30
|
+
n: number;
|
|
31
|
+
anchor: 'now' | 'latest_data';
|
|
32
|
+
};
|
|
33
|
+
/** The first or last day of the month containing the run instant. */
|
|
34
|
+
export type RelativeMonthDayWindowInput = {
|
|
35
|
+
kind: 'monthDay';
|
|
36
|
+
day: 'first' | 'last';
|
|
37
|
+
};
|
|
38
|
+
/** A window as a writer builds it, or as it is stored. Not yet checked. */
|
|
39
|
+
export type RelativeDateWindowInput = RelativePeriodsWindowInput | RelativeRollingWindowInput | RelativeMonthDayWindowInput;
|
|
40
|
+
declare const checked: unique symbol;
|
|
41
|
+
/**
|
|
42
|
+
* A window that passed `readRelativeDate`: valid and canonical. The brand is
|
|
43
|
+
* type-only (JSON drops it), so only the owner produces one, and every
|
|
44
|
+
* function that resolves, describes or compares takes this type.
|
|
45
|
+
*/
|
|
46
|
+
export type RelativeDateWindow = RelativeDateWindowInput & {
|
|
47
|
+
readonly [checked]: true;
|
|
48
|
+
};
|
|
49
|
+
/** Today's stored union, renamed from `RelativeDateFilter`. Only the reader reads it. */
|
|
50
|
+
export type RelativeDateModeShape = {
|
|
51
|
+
mode: 'last';
|
|
52
|
+
n: number;
|
|
53
|
+
unit: SubDayDateUnit;
|
|
54
|
+
complete?: false;
|
|
55
|
+
relativeTo?: 'latest_data';
|
|
56
|
+
} | {
|
|
57
|
+
mode: 'last';
|
|
58
|
+
n: number;
|
|
59
|
+
unit: DateUnit;
|
|
60
|
+
complete?: boolean;
|
|
61
|
+
relativeTo?: 'latest_data';
|
|
62
|
+
} | {
|
|
63
|
+
mode: 'this';
|
|
64
|
+
unit: DateUnit;
|
|
65
|
+
toDate?: boolean;
|
|
66
|
+
boundary?: 'first_day' | 'last_day';
|
|
67
|
+
} | {
|
|
68
|
+
mode: 'previous';
|
|
69
|
+
unit: DateUnit;
|
|
70
|
+
} | {
|
|
71
|
+
mode: 'between';
|
|
72
|
+
unit: DateUnit;
|
|
73
|
+
from: number;
|
|
74
|
+
to: number;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* What a persisted window field holds: `relativeMeta` everywhere, and the
|
|
78
|
+
* relative member of `defaultDateFilter`. A stored value must be read
|
|
79
|
+
* (`readRelativeDate`) before it can be resolved, described or compared.
|
|
80
|
+
*/
|
|
81
|
+
export type StoredRelativeDate = RelativeDateWindowInput | RelativeDateModeShape;
|
|
82
|
+
export type ReadRelativeDateOptions = {
|
|
83
|
+
/** Also apply the authoring limits (SPEC 3.1). Writers pass it; readers of stored values never do. */
|
|
84
|
+
authoring?: boolean;
|
|
85
|
+
};
|
|
86
|
+
/** A relative date belongs only on a range condition (plan D3). */
|
|
87
|
+
export declare function allowsRelativeDate(operator: string): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* The one reader of a relative date, and the only way to get a window: any
|
|
90
|
+
* stored form or writer input becomes its canonical window (SPEC 2.4, 2.5),
|
|
91
|
+
* unknown keys dropped; anything else is undefined, so the caller keeps the
|
|
92
|
+
* value's fixed dates. It never throws.
|
|
93
|
+
*/
|
|
94
|
+
export declare function readRelativeDate(value: unknown, options?: ReadRelativeDateOptions): RelativeDateWindow | undefined;
|
|
95
|
+
/** Why a window input breaks a rule (Plan B SPEC-B 3.1): the rule, one sentence, and the field. */
|
|
96
|
+
export type RelativeDateProblem = {
|
|
97
|
+
rule: 'W1' | 'W2' | 'W3' | 'W4' | 'limit';
|
|
98
|
+
/** One sentence, e.g. 'from (0) is after to (-2).' */
|
|
99
|
+
message: string;
|
|
100
|
+
path: 'from' | 'to' | 'toDate' | 'n';
|
|
101
|
+
/** For 'limit': the largest n for the unit. */
|
|
102
|
+
max?: number;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Why a window input breaks a rule the shapes can't check (SPEC 2.3 W1 to W4,
|
|
106
|
+
* and with `authoring` the limit), or undefined when it is a window. The one
|
|
107
|
+
* home of those rules: `readRelativeDate` refuses exactly what this explains.
|
|
108
|
+
* It never throws.
|
|
109
|
+
*/
|
|
110
|
+
export declare function explainRelativeDateInput(input: RelativeDateWindowInput, options?: ReadRelativeDateOptions): RelativeDateProblem | undefined;
|
|
111
|
+
export {};
|
|
@@ -4,7 +4,7 @@ import { RawTemporalSelection, SemaphorFieldRef, SemaphorSourceRef, TemporalBuck
|
|
|
4
4
|
* A selection is what a viewer picked by clicking marks, rows, or members on
|
|
5
5
|
* one card. It is a dashboard input value: other cards narrow to it the same
|
|
6
6
|
* way they narrow to a toolbar filter. The protocol owns these shapes so the
|
|
7
|
-
* dashboard runtime
|
|
7
|
+
* dashboard runtime and the server share one contract.
|
|
8
8
|
*/
|
|
9
9
|
export type SelectionFieldSource = Extract<SemaphorSourceRef, {
|
|
10
10
|
kind: 'semantic' | 'physical';
|
|
@@ -619,14 +619,14 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
|
|
|
619
619
|
inputId: string;
|
|
620
620
|
globalDate?: true | undefined;
|
|
621
621
|
}[];
|
|
622
|
-
|
|
622
|
+
dashboard?: {
|
|
623
623
|
id: string;
|
|
624
624
|
title: string;
|
|
625
|
+
unsavedEdits: boolean;
|
|
625
626
|
} | undefined;
|
|
626
|
-
|
|
627
|
+
sheet?: {
|
|
627
628
|
id: string;
|
|
628
629
|
title: string;
|
|
629
|
-
unsavedEdits: boolean;
|
|
630
630
|
} | undefined;
|
|
631
631
|
omitted?: {
|
|
632
632
|
cards?: number | undefined;
|
|
@@ -711,14 +711,14 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
|
|
|
711
711
|
inputId: string;
|
|
712
712
|
globalDate?: true | undefined;
|
|
713
713
|
}[];
|
|
714
|
-
|
|
714
|
+
dashboard?: {
|
|
715
715
|
id: string;
|
|
716
716
|
title: string;
|
|
717
|
+
unsavedEdits: boolean;
|
|
717
718
|
} | undefined;
|
|
718
|
-
|
|
719
|
+
sheet?: {
|
|
719
720
|
id: string;
|
|
720
721
|
title: string;
|
|
721
|
-
unsavedEdits: boolean;
|
|
722
722
|
} | undefined;
|
|
723
723
|
omitted?: {
|
|
724
724
|
cards?: number | undefined;
|
|
@@ -803,14 +803,14 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
|
|
|
803
803
|
inputId: string;
|
|
804
804
|
globalDate?: true | undefined;
|
|
805
805
|
}[];
|
|
806
|
-
|
|
806
|
+
dashboard?: {
|
|
807
807
|
id: string;
|
|
808
808
|
title: string;
|
|
809
|
+
unsavedEdits: boolean;
|
|
809
810
|
} | undefined;
|
|
810
|
-
|
|
811
|
+
sheet?: {
|
|
811
812
|
id: string;
|
|
812
813
|
title: string;
|
|
813
|
-
unsavedEdits: boolean;
|
|
814
814
|
} | undefined;
|
|
815
815
|
omitted?: {
|
|
816
816
|
cards?: number | undefined;
|
|
@@ -895,14 +895,14 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
|
|
|
895
895
|
inputId: string;
|
|
896
896
|
globalDate?: true | undefined;
|
|
897
897
|
}[];
|
|
898
|
-
|
|
898
|
+
dashboard?: {
|
|
899
899
|
id: string;
|
|
900
900
|
title: string;
|
|
901
|
+
unsavedEdits: boolean;
|
|
901
902
|
} | undefined;
|
|
902
|
-
|
|
903
|
+
sheet?: {
|
|
903
904
|
id: string;
|
|
904
905
|
title: string;
|
|
905
|
-
unsavedEdits: boolean;
|
|
906
906
|
} | undefined;
|
|
907
907
|
omitted?: {
|
|
908
908
|
cards?: number | undefined;
|
|
@@ -98,8 +98,6 @@ export declare const QUERY_CONFIG_KEY_ASPECTS: {
|
|
|
98
98
|
readonly joinPlan: "source";
|
|
99
99
|
readonly matrix: "matrix";
|
|
100
100
|
};
|
|
101
|
-
/** Deep equality of stored values, independent of key order; `undefined` and absent are equal. */
|
|
102
|
-
export declare function sameValue(left: unknown, right: unknown): boolean;
|
|
103
101
|
/** TCard: `query` keys are replaced by `requery`, `presentation` keys kept byte for byte. */
|
|
104
102
|
export declare const CARD_KEY_CLASSES: {
|
|
105
103
|
readonly id: "presentation";
|