react-semaphor 0.1.568 → 0.1.570
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/appearance/index.js +6 -3
- package/dist/appearance-runtime/index.js +1 -1
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +572 -436
- package/dist/briefings/index.js +4 -4
- package/dist/chunks/appearance-context-BwBp25ZG.js +162 -0
- package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +80 -0
- package/dist/chunks/assistant-chat-B-Ddyy8b.js +5940 -0
- package/dist/chunks/{bookmark-impact-CJ-65omV.js → bookmark-impact-DCYD-6Fr.js} +2 -2
- package/dist/chunks/{bookmark-state-Du3s13_V.js → bookmark-state-CflS88gq.js} +251 -250
- package/dist/chunks/brand-B4BdpAB_.js +54 -0
- package/dist/chunks/{card-filter-builder-BBuB99GZ.js → card-filter-builder-0VvKmRst.js} +992 -991
- package/dist/chunks/{comparison-window-caption-CMLb3mut.js → comparison-window-caption-PtcDWvkN.js} +252 -253
- package/dist/chunks/{dashboard-YnWZC4dK.js → dashboard-DxGIr1vZ.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-BF89TU2h.js → dashboard-briefing-launcher-B-quOOOQ.js} +253 -253
- package/dist/chunks/{dashboard-controls-atHc1EjP.js → dashboard-controls-Caodx80b.js} +288 -285
- package/dist/chunks/dashboard-json-Ct-AGDHF.js +66 -0
- package/dist/chunks/{dates-CKO05ino.js → dates-B9mL8BHE.js} +16 -15
- package/dist/chunks/edit-Bpdh_P_a.js +226 -0
- package/dist/chunks/{edit-dashboard-visual-DdmTfn-J.js → edit-dashboard-visual-DeDTuYB5.js} +2257 -2270
- package/dist/chunks/{filter-reach-copy-jZGzK_IH.js → filter-reach-copy-BSY33ro5.js} +1440 -1301
- package/dist/chunks/filter-value-text-DvvSNlho.js +146 -0
- package/dist/chunks/index-BVKzKl5d.js +90 -0
- package/dist/chunks/{index-RNaTnE3m.js → index-CV_Kzou0.js} +233 -223
- package/dist/chunks/{index-CPNZW0mu.js → index-y3HUzRNk.js} +76 -77
- package/dist/chunks/{layout-grid-0hIlqEtk.js → layout-grid-8rR-LPTk.js} +1 -1
- package/dist/chunks/{list-filter-DkgoCeBm.js → list-filter-C1-uTgjR.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/paintbrush-aR17Z3C9.js +27 -0
- package/dist/chunks/{palette-4vf2BEEg.js → palette-a5FCZKFI.js} +1 -1
- package/dist/chunks/{_commonjsHelpers-DimLPMtv.js → pickers-DkqmtnTL.js} +352 -290
- package/dist/chunks/pivot-result-contract-expectations-C-HnUKYe.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-Mbd-I0wV.js → report-preferences-dialog-Yvhv3WX2.js} +95 -97
- package/dist/chunks/{report-runtime-context-DnA_PiKo.js → report-runtime-context-BhPzLTbS.js} +1 -1
- package/dist/chunks/{resolve-dashboard-input-context-Du0fjN3h.js → resolve-dashboard-input-context-Lkbwycwe.js} +5491 -5683
- package/dist/chunks/resolver-DG_tfEpt.js +156 -0
- package/dist/chunks/{save-D6pHmSSP.js → save-D985VvYp.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-y8N6RvjS.js → saved-dashboard-context-DC_TEd6y.js} +6 -6
- package/dist/chunks/schema-C9NPiIru.js +2568 -0
- package/dist/chunks/{semaphor-ready-indicator-BSEdUq40.js → semaphor-ready-indicator-ByFvqHEO.js} +35916 -36001
- package/dist/chunks/{shelf-drop-preview-context-D7QqPl36.js → shelf-drop-preview-context-CjoVaK6J.js} +64 -66
- package/dist/chunks/{stored-dashboard-d3xQYxBD.js → stored-dashboard-C0hekXiI.js} +332 -333
- package/dist/chunks/{code-editor-DJNOsgJH.js → style-sheet-parts-C7qGZuH1.js} +2402 -2040
- package/dist/chunks/{table-export-sheet--DUKWk6o.js → table-export-sheet-CP8zSOhj.js} +1 -1
- package/dist/chunks/{temporal-input-presentation--2r9BLr0.js → temporal-input-presentation-CqbJjIuu.js} +18 -18
- package/dist/chunks/{token-types-C8JymO8s.js → token-types-iKMplaBL.js} +1 -1
- package/dist/chunks/{upload-Cf3wXZT8.js → upload-CiGNKJ_0.js} +1 -1
- package/dist/chunks/validators-B8fpdinG.js +3651 -0
- package/dist/chunks/{variable-draft-DOX03R4A.js → variable-draft-9-huI1h4.js} +4 -4
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1888 -1826
- package/dist/format-utils/index.js +230 -231
- package/dist/index.js +349 -353
- package/dist/layouts/index.js +1 -1
- 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/appearance/index.d.ts +1 -0
- package/dist/types/brand-studio/brand-studio-draft.d.ts +7 -0
- package/dist/types/brand-studio/index.d.ts +1 -1
- package/dist/types/components/briefings/briefing-author/run-model.d.ts +1 -2
- package/dist/types/components/providers/appearance-runtime-provider.d.ts +4 -1
- package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +0 -2
- package/dist/types/components/sharing-and-management/utils/types.d.ts +0 -72
- 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/components/visual/data-table/hooks/use-data-table-logic.d.ts +0 -1
- package/dist/types/components/visual/data-table/types/data-table.d.ts +0 -9
- package/dist/types/components/visual/data-table/utils/pagination-utils.d.ts +0 -19
- package/dist/types/components/visual/shared/utils/table-column-order.d.ts +0 -1
- package/dist/types/index.js +9 -9
- package/dist/types/lib/appearance/aliases.d.ts +42 -0
- package/dist/types/lib/appearance/compiler.d.ts +6 -0
- package/dist/types/lib/appearance/defaults.d.ts +6 -0
- package/dist/types/lib/appearance/index.d.ts +2 -0
- package/dist/types/lib/appearance/normalize-organization.d.ts +17 -0
- package/dist/types/lib/appearance/resolver.d.ts +2 -2
- package/dist/types/lib/appearance/types.d.ts +38 -1
- package/dist/types/lib/charts/types.d.ts +6 -2
- package/dist/types/lib/dashboard/semantic-dataset-references.d.ts +0 -1
- package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +0 -2
- package/dist/types/lib/dashboard-variables/types.d.ts +1 -6
- package/dist/types/lib/download-pdf.d.ts +0 -1
- package/dist/types/lib/hooks/use-dashboard.d.ts +3 -4
- 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/stores/dashboard-store.d.ts +15 -6
- package/dist/types/lib/stores/editor-store.d.ts +0 -1
- package/dist/types/lib/stores/table-actions.d.ts +0 -1
- package/dist/types/lib/table-formatting/table-formatting-css.d.ts +0 -5
- package/dist/types/lib/types/common-types.d.ts +3 -2
- 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/types/summary-types.d.ts +0 -5
- 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/analytics-base-schemas.d.ts +4 -4
- 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/execution-input-schemas.d.ts +10 -10
- 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 +72 -72
- 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 +30 -30
- 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 +344 -1772
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +4 -1
- package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +8 -4
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +9 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +104 -104
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +20 -20
- package/dist/types/shared/dashboard-authoring/dashboard-style/bounds.d.ts +17 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/brand.d.ts +20 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/edit-words.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/edit.d.ts +19 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/index.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/layers.d.ts +19 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/legacy.d.ts +21 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/parse.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/pickers.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/types.d.ts +122 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/view.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +23 -0
- 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 +10 -10
- 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 +7 -26
- package/DATA_APP_SDK.md +0 -339
- package/dist/chunks/appearance-context-DEYtWinQ.js +0 -126
- package/dist/chunks/appearance-runtime-provider-B-M8gwlZ.js +0 -81
- package/dist/chunks/assistant-chat-BN5I8KuN.js +0 -8849
- package/dist/chunks/color-CJvdlFM_.js +0 -2162
- package/dist/chunks/dashboard-json-Cxp3inxd.js +0 -68
- package/dist/chunks/filter-value-text-7zhmth1S.js +0 -163
- package/dist/chunks/index-CLIro-EG.js +0 -425
- 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/components/sharing-and-management/utils/group-types.d.ts +0 -105
- 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
|
@@ -1384,6 +1384,48 @@ declare const definitionInputShape: z.ZodObject<{
|
|
|
1384
1384
|
defaults: MatrixDefaultViewSchema;
|
|
1385
1385
|
session: z.ZodOptional<MatrixViewStateSchema>;
|
|
1386
1386
|
}, "strict", z.ZodTypeAny, {
|
|
1387
|
+
defaults: {
|
|
1388
|
+
columns: {
|
|
1389
|
+
depth: number;
|
|
1390
|
+
overrides: readonly {
|
|
1391
|
+
path: readonly {
|
|
1392
|
+
member: {
|
|
1393
|
+
value: string | number | boolean | {
|
|
1394
|
+
type: "integer" | "decimal";
|
|
1395
|
+
value: string;
|
|
1396
|
+
kind: "exact_number";
|
|
1397
|
+
} | null;
|
|
1398
|
+
kind: "value";
|
|
1399
|
+
} | {
|
|
1400
|
+
kind: "others";
|
|
1401
|
+
rankingId: string;
|
|
1402
|
+
};
|
|
1403
|
+
levelId: string;
|
|
1404
|
+
}[];
|
|
1405
|
+
expanded: boolean;
|
|
1406
|
+
}[];
|
|
1407
|
+
};
|
|
1408
|
+
rows: {
|
|
1409
|
+
depth: number;
|
|
1410
|
+
overrides: readonly {
|
|
1411
|
+
path: readonly {
|
|
1412
|
+
member: {
|
|
1413
|
+
value: string | number | boolean | {
|
|
1414
|
+
type: "integer" | "decimal";
|
|
1415
|
+
value: string;
|
|
1416
|
+
kind: "exact_number";
|
|
1417
|
+
} | null;
|
|
1418
|
+
kind: "value";
|
|
1419
|
+
} | {
|
|
1420
|
+
kind: "others";
|
|
1421
|
+
rankingId: string;
|
|
1422
|
+
};
|
|
1423
|
+
levelId: string;
|
|
1424
|
+
}[];
|
|
1425
|
+
expanded: boolean;
|
|
1426
|
+
}[];
|
|
1427
|
+
};
|
|
1428
|
+
};
|
|
1387
1429
|
presentation: {
|
|
1388
1430
|
totals: {
|
|
1389
1431
|
columns: {
|
|
@@ -1497,7 +1539,7 @@ declare const definitionInputShape: z.ZodObject<{
|
|
|
1497
1539
|
} | undefined;
|
|
1498
1540
|
measureFilters?: readonly MatrixMeasureFilter[] | undefined;
|
|
1499
1541
|
};
|
|
1500
|
-
|
|
1542
|
+
session?: {
|
|
1501
1543
|
columns: {
|
|
1502
1544
|
depth: number;
|
|
1503
1545
|
overrides: readonly {
|
|
@@ -1538,12 +1580,13 @@ declare const definitionInputShape: z.ZodObject<{
|
|
|
1538
1580
|
expanded: boolean;
|
|
1539
1581
|
}[];
|
|
1540
1582
|
};
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1583
|
+
sorts: readonly {
|
|
1584
|
+
target: MatrixSortTarget;
|
|
1585
|
+
scope: {
|
|
1586
|
+
kind: "level";
|
|
1587
|
+
} | {
|
|
1588
|
+
kind: "branch";
|
|
1589
|
+
parent: readonly {
|
|
1547
1590
|
member: {
|
|
1548
1591
|
value: string | number | boolean | {
|
|
1549
1592
|
type: "integer" | "decimal";
|
|
@@ -1557,10 +1600,16 @@ declare const definitionInputShape: z.ZodObject<{
|
|
|
1557
1600
|
};
|
|
1558
1601
|
levelId: string;
|
|
1559
1602
|
}[];
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1603
|
+
};
|
|
1604
|
+
levelId: string;
|
|
1605
|
+
axis: "columns" | "rows";
|
|
1606
|
+
direction: "asc" | "desc";
|
|
1607
|
+
nulls: "last" | "first";
|
|
1608
|
+
}[];
|
|
1609
|
+
} | undefined;
|
|
1610
|
+
}, {
|
|
1611
|
+
defaults: {
|
|
1612
|
+
columns: {
|
|
1564
1613
|
depth: number;
|
|
1565
1614
|
overrides: readonly {
|
|
1566
1615
|
path: readonly {
|
|
@@ -1580,13 +1629,10 @@ declare const definitionInputShape: z.ZodObject<{
|
|
|
1580
1629
|
expanded: boolean;
|
|
1581
1630
|
}[];
|
|
1582
1631
|
};
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
} | {
|
|
1588
|
-
kind: "branch";
|
|
1589
|
-
parent: readonly {
|
|
1632
|
+
rows: {
|
|
1633
|
+
depth: number;
|
|
1634
|
+
overrides: readonly {
|
|
1635
|
+
path: readonly {
|
|
1590
1636
|
member: {
|
|
1591
1637
|
value: string | number | boolean | {
|
|
1592
1638
|
type: "integer" | "decimal";
|
|
@@ -1600,14 +1646,10 @@ declare const definitionInputShape: z.ZodObject<{
|
|
|
1600
1646
|
};
|
|
1601
1647
|
levelId: string;
|
|
1602
1648
|
}[];
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
nulls: "last" | "first";
|
|
1608
|
-
}[];
|
|
1609
|
-
} | undefined;
|
|
1610
|
-
}, {
|
|
1649
|
+
expanded: boolean;
|
|
1650
|
+
}[];
|
|
1651
|
+
};
|
|
1652
|
+
};
|
|
1611
1653
|
presentation: {
|
|
1612
1654
|
totals: {
|
|
1613
1655
|
columns: {
|
|
@@ -1721,48 +1763,6 @@ declare const definitionInputShape: z.ZodObject<{
|
|
|
1721
1763
|
} | undefined;
|
|
1722
1764
|
measureFilters?: readonly MatrixMeasureFilter[] | undefined;
|
|
1723
1765
|
};
|
|
1724
|
-
defaults: {
|
|
1725
|
-
columns: {
|
|
1726
|
-
depth: number;
|
|
1727
|
-
overrides: readonly {
|
|
1728
|
-
path: readonly {
|
|
1729
|
-
member: {
|
|
1730
|
-
value: string | number | boolean | {
|
|
1731
|
-
type: "integer" | "decimal";
|
|
1732
|
-
value: string;
|
|
1733
|
-
kind: "exact_number";
|
|
1734
|
-
} | null;
|
|
1735
|
-
kind: "value";
|
|
1736
|
-
} | {
|
|
1737
|
-
kind: "others";
|
|
1738
|
-
rankingId: string;
|
|
1739
|
-
};
|
|
1740
|
-
levelId: string;
|
|
1741
|
-
}[];
|
|
1742
|
-
expanded: boolean;
|
|
1743
|
-
}[];
|
|
1744
|
-
};
|
|
1745
|
-
rows: {
|
|
1746
|
-
depth: number;
|
|
1747
|
-
overrides: readonly {
|
|
1748
|
-
path: readonly {
|
|
1749
|
-
member: {
|
|
1750
|
-
value: string | number | boolean | {
|
|
1751
|
-
type: "integer" | "decimal";
|
|
1752
|
-
value: string;
|
|
1753
|
-
kind: "exact_number";
|
|
1754
|
-
} | null;
|
|
1755
|
-
kind: "value";
|
|
1756
|
-
} | {
|
|
1757
|
-
kind: "others";
|
|
1758
|
-
rankingId: string;
|
|
1759
|
-
};
|
|
1760
|
-
levelId: string;
|
|
1761
|
-
}[];
|
|
1762
|
-
expanded: boolean;
|
|
1763
|
-
}[];
|
|
1764
|
-
};
|
|
1765
|
-
};
|
|
1766
1766
|
session?: {
|
|
1767
1767
|
columns: {
|
|
1768
1768
|
depth: number;
|
|
@@ -1885,6 +1885,7 @@ declare const configShape: z.ZodObject<{
|
|
|
1885
1885
|
levelFormats: Readonly<Record<string, import('./contracts.js').SemaphorValueFormat>>;
|
|
1886
1886
|
measureFormats: Readonly<Record<string, import('./contracts.js').SemaphorValueFormat>>;
|
|
1887
1887
|
};
|
|
1888
|
+
version: 1;
|
|
1888
1889
|
spec: {
|
|
1889
1890
|
source: {
|
|
1890
1891
|
kind: "semantic";
|
|
@@ -1954,7 +1955,6 @@ declare const configShape: z.ZodObject<{
|
|
|
1954
1955
|
} | undefined;
|
|
1955
1956
|
measureFilters?: readonly MatrixMeasureFilter[] | undefined;
|
|
1956
1957
|
};
|
|
1957
|
-
version: 1;
|
|
1958
1958
|
defaultView: {
|
|
1959
1959
|
columns: {
|
|
1960
1960
|
depth: number;
|
|
@@ -2042,6 +2042,7 @@ declare const configShape: z.ZodObject<{
|
|
|
2042
2042
|
levelFormats: Readonly<Record<string, import('./contracts.js').SemaphorValueFormat>>;
|
|
2043
2043
|
measureFormats: Readonly<Record<string, import('./contracts.js').SemaphorValueFormat>>;
|
|
2044
2044
|
};
|
|
2045
|
+
version: 1;
|
|
2045
2046
|
spec: {
|
|
2046
2047
|
source: {
|
|
2047
2048
|
kind: "semantic";
|
|
@@ -2111,7 +2112,6 @@ declare const configShape: z.ZodObject<{
|
|
|
2111
2112
|
} | undefined;
|
|
2112
2113
|
measureFilters?: readonly MatrixMeasureFilter[] | undefined;
|
|
2113
2114
|
};
|
|
2114
|
-
version: 1;
|
|
2115
2115
|
defaultView: {
|
|
2116
2116
|
columns: {
|
|
2117
2117
|
depth: number;
|
|
@@ -2209,6 +2209,7 @@ declare const authoringConfigShape: z.ZodObject<{
|
|
|
2209
2209
|
levelFormats: Readonly<Record<string, import('./contracts.js').SemaphorValueFormat>>;
|
|
2210
2210
|
measureFormats: Readonly<Record<string, import('./contracts.js').SemaphorValueFormat>>;
|
|
2211
2211
|
};
|
|
2212
|
+
version: 1;
|
|
2212
2213
|
spec: {
|
|
2213
2214
|
source: {
|
|
2214
2215
|
kind: "semantic";
|
|
@@ -2278,7 +2279,6 @@ declare const authoringConfigShape: z.ZodObject<{
|
|
|
2278
2279
|
} | undefined;
|
|
2279
2280
|
measureFilters?: readonly MatrixMeasureFilter[] | undefined;
|
|
2280
2281
|
};
|
|
2281
|
-
version: 1;
|
|
2282
2282
|
defaultView: {
|
|
2283
2283
|
columns: {
|
|
2284
2284
|
depth: number;
|
|
@@ -2366,6 +2366,7 @@ declare const authoringConfigShape: z.ZodObject<{
|
|
|
2366
2366
|
levelFormats: Readonly<Record<string, import('./contracts.js').SemaphorValueFormat>>;
|
|
2367
2367
|
measureFormats: Readonly<Record<string, import('./contracts.js').SemaphorValueFormat>>;
|
|
2368
2368
|
};
|
|
2369
|
+
version: 1;
|
|
2369
2370
|
spec: {
|
|
2370
2371
|
source: {
|
|
2371
2372
|
kind: "semantic";
|
|
@@ -2435,7 +2436,6 @@ declare const authoringConfigShape: z.ZodObject<{
|
|
|
2435
2436
|
} | undefined;
|
|
2436
2437
|
measureFilters?: readonly MatrixMeasureFilter[] | undefined;
|
|
2437
2438
|
};
|
|
2438
|
-
version: 1;
|
|
2439
2439
|
defaultView: {
|
|
2440
2440
|
columns: {
|
|
2441
2441
|
depth: number;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RelativeDatePresetId } from './presets.js';
|
|
2
|
+
import { RelativeDateWindow } from './window.js';
|
|
3
|
+
export type RelativeDateDescription = {
|
|
4
|
+
/** A preset's label, or generated wording ("Last 3 months", "Today to 2 days ahead"). */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Set when the window equals a preset's window. */
|
|
7
|
+
presetId?: RelativeDatePresetId;
|
|
8
|
+
/** What the window covers, naming its anchor ("the current month up to now"). */
|
|
9
|
+
definition: string;
|
|
10
|
+
};
|
|
11
|
+
/** The label, preset and definition of a window. */
|
|
12
|
+
export declare function describeRelativeDate(window: RelativeDateWindow): RelativeDateDescription;
|
|
13
|
+
/**
|
|
14
|
+
* Whether two stored values name the same window. Windows compare by their
|
|
15
|
+
* canonical form; two values that aren't windows (fixed defaults, unreadable
|
|
16
|
+
* values) compare as equal stored values; a window never equals a non-window.
|
|
17
|
+
*/
|
|
18
|
+
export declare function relativeDatesEqual(a: unknown, b: unknown): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { allowsRelativeDate, explainRelativeDateInput, readRelativeDate, type DateUnit, type ReadRelativeDateOptions, type RelativeDateProblem, type RelativeDateAnchor, type RelativeDateModeShape, type RelativeDateUnit, type RelativeDateWindow, type RelativeDateWindowInput, type RelativeMonthDayWindowInput, type RelativePeriodsWindowInput, type RelativeRollingWindowInput, type StoredRelativeDate, type SubDayDateUnit, } from './window.js';
|
|
2
|
+
export { RelativeDateUsageError, resolveRelativeDate, type RelativeDateInstants, type RelativeDateResolveOptions, type ResolvedRelativeDate, } from './resolve.js';
|
|
3
|
+
export { describeRelativeDate, relativeDatesEqual, type RelativeDateDescription, } from './describe.js';
|
|
4
|
+
export { relativeDateTraits, type RelativeDateTraits } from './traits.js';
|
|
5
|
+
export { RELATIVE_DATE_PRESETS, type RelativeDatePreset, type RelativeDatePresetCategory, type RelativeDatePresetId, } from './presets.js';
|
|
6
|
+
export { relativeDateWindowSchema, relativeDateWindowShapes, storedRelativeDateSchema } from './schemas.js';
|
|
7
|
+
export { SEMAPHOR_TIME_WINDOW_MAX_VALUE } from './limits.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RelativeDateWindow } from './window.js';
|
|
2
|
+
export type RelativeDatePresetCategory = 'time' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
3
|
+
export type RelativeDatePresetId = 'last_30_minutes' | 'last_1_hour' | 'last_4_hours' | 'last_12_hours' | 'last_24_hours' | 'today' | 'yesterday' | 'first_day_of_month' | 'last_day_of_month' | 'last_7_days' | 'last_30_days' | 'last_90_days' | 'this_week' | 'last_week' | 'last_2_weeks' | 'this_month' | 'last_month' | 'last_3_months' | 'last_6_months' | 'last_9_months' | 'last_12_months' | 'this_quarter' | 'last_quarter' | 'last_4_quarters' | 'this_year' | 'last_year' | 'year_to_last_completed_month';
|
|
4
|
+
export type RelativeDatePreset = {
|
|
5
|
+
id: RelativeDatePresetId;
|
|
6
|
+
label: string;
|
|
7
|
+
category: RelativeDatePresetCategory;
|
|
8
|
+
window: RelativeDateWindow;
|
|
9
|
+
};
|
|
10
|
+
/** Every preset, in picker order within each category, in canonical form. */
|
|
11
|
+
export declare const RELATIVE_DATE_PRESETS: readonly RelativeDatePreset[];
|
|
@@ -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';
|