react-semaphor 0.1.559 → 0.1.561

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.
Files changed (168) hide show
  1. package/dist/analytics-protocol/index.js +389 -378
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +5 -5
  4. package/dist/brand-studio/index.js +9 -9
  5. package/dist/briefings/index.js +5 -5
  6. package/dist/chunks/analytics-base-schemas-CB3oFAXk.js +658 -0
  7. package/dist/chunks/{assistant-chat-B_4bVE6I.js → assistant-chat-DiVHY3Hw.js} +209 -211
  8. package/dist/chunks/bookmark-impact-CR09dpkn.js +75 -0
  9. package/dist/chunks/bookmark-state-BusLpkb7.js +743 -0
  10. package/dist/chunks/{braces-Rdxa3H-s.js → braces-u8VorWJc.js} +1 -1
  11. package/dist/chunks/{comparison-window-caption-CKzQ5LcF.js → comparison-window-caption-DDsIWJYT.js} +201 -201
  12. package/dist/chunks/{context-DVy4HOU0.js → context-TUjw9eqr.js} +1 -1
  13. package/dist/chunks/{custom-visual-inputs-zVa9wX_o.js → custom-visual-inputs-DfolidZ9.js} +1 -1
  14. package/dist/chunks/{dashboard-BziwOVpZ.js → dashboard-BRdZBPqr.js} +1 -1
  15. package/dist/chunks/{dashboard-briefing-launcher-CbeNR-YI.js → dashboard-briefing-launcher-CgvTLndW.js} +1163 -1178
  16. package/dist/chunks/{dashboard-controls-RD6UJs1r.js → dashboard-controls-B4vfSzTF.js} +877 -941
  17. package/dist/chunks/{dashboard-json-DGpv17vL.js → dashboard-json-Y3MF59g7.js} +5 -5
  18. package/dist/chunks/document-dashboard-inputs-CvBbFTUA.js +1718 -0
  19. package/dist/chunks/{edit-dashboard-visual-AQ2pQkFp.js → edit-dashboard-visual-DwjZcxj-.js} +9080 -9354
  20. package/dist/chunks/filter-reach-copy-bijwf_-b.js +3596 -0
  21. package/dist/chunks/{filter-value-text-B4l-xqJT.js → filter-value-text-DFnhwuEW.js} +3 -3
  22. package/dist/chunks/global-date-filter-utils-BXgCpvQM.js +15142 -0
  23. package/dist/chunks/{index-B1Xr7W24.js → index-ClwbY3BL.js} +648 -674
  24. package/dist/chunks/{layout-grid-Bbz3zKif.js → layout-grid-CtvCBfOm.js} +1 -1
  25. package/dist/chunks/{list-filter-3sbH0Uy1.js → list-filter-BklYgciR.js} +1 -1
  26. package/dist/chunks/{matrix-analytical-definition-CEe3PGEo.js → matrix-analytical-definition-pU51-JmY.js} +4 -4
  27. package/dist/chunks/{matrix-card-BRNGb1C4.js → matrix-card-CUorIB7Q.js} +3 -3
  28. package/dist/chunks/{matrix-member-presentation-CEegvTqg.js → matrix-member-presentation-Df5UgCGN.js} +1 -1
  29. package/dist/chunks/{matrix-operation-contract-COxrfQTS.js → matrix-operation-contract-BSiGEXVC.js} +221 -214
  30. package/dist/chunks/{metric-comparison-DQx-uX__.js → metric-comparison-95aC0uEO.js} +6 -6
  31. package/dist/chunks/{model-change-CJEj3ZD6.js → model-change-B5wQhg5G.js} +1 -1
  32. package/dist/chunks/{palette-DMJtp3Vn.js → palette-DTnMhipt.js} +1 -1
  33. package/dist/chunks/pivot-result-contract-expectations-Bo-86vwS.js +56 -0
  34. package/dist/chunks/{pivot-result-identity-CAj8SiRL.js → pivot-result-identity-olvXJoB9.js} +1 -1
  35. package/dist/chunks/{report-preferences-dialog-0sc8B1lh.js → report-preferences-dialog-C2YUIwKG.js} +55 -55
  36. package/dist/chunks/{report-runtime-context-bYoExeWr.js → report-runtime-context-DoIUr3MP.js} +2 -2
  37. package/dist/chunks/resolve-dashboard-input-context-q_iiNXE1.js +6503 -0
  38. package/dist/chunks/{save-DSb1jTtG.js → save-DH4RyrnG.js} +1 -1
  39. package/dist/chunks/{saved-dashboard-context-BQWM3ldX.js → saved-dashboard-context-8jqfI7hI.js} +59 -59
  40. package/dist/chunks/{selection-reducer-DSzMWb4x.js → selection-reducer-CV7K4FI6.js} +1 -1
  41. package/dist/chunks/{semaphor-ready-indicator-Bz14Oma5.js → semaphor-ready-indicator-E2XWyibu.js} +40105 -41658
  42. package/dist/chunks/{shelf-drop-preview-context-DBHAkgch.js → shelf-drop-preview-context-C29EUzDp.js} +570 -570
  43. package/dist/chunks/{source-entity-resolution-BOrmNCEM.js → source-entity-resolution-BXI3nQ5Z.js} +1 -1
  44. package/dist/chunks/{switch-Dq8XPFpT.js → switch-balDSHc7.js} +3 -3
  45. package/dist/chunks/{table-export-sheet-C_RvEUyO.js → table-export-sheet-CK8tvh4d.js} +1 -1
  46. package/dist/chunks/temporal-input-presentation-B77JsAzU.js +5002 -0
  47. package/dist/chunks/{token-types-LCYMJ3pa.js → token-types-DhYH5YKb.js} +1 -1
  48. package/dist/chunks/{upload-Dr_WAxHQ.js → upload-Ufj8vjyn.js} +1 -1
  49. package/dist/chunks/{use-create-flow-overlay-state-BK3YFkfc.js → use-create-flow-overlay-state-9WsnzEO5.js} +6 -6
  50. package/dist/chunks/{validators-C87JPd-_.js → validators-BtaCFIEB.js} +1206 -1579
  51. package/dist/chunks/{zoned-wall-clock-E35Frf9v.js → zoned-wall-clock-CGLVI40Q.js} +1 -1
  52. package/dist/dashboard/index.js +2 -2
  53. package/dist/dashboard-authoring/index.js +2713 -1459
  54. package/dist/data-app-sdk/index.js +20 -20
  55. package/dist/data-app-sdk-adapters/index.js +3 -3
  56. package/dist/data-app-sdk-validation/index.js +10 -10
  57. package/dist/format-utils/index.js +262 -256
  58. package/dist/index.js +214 -215
  59. package/dist/report-runtime-context/index.js +2 -2
  60. package/dist/style.css +1 -1
  61. package/dist/surfboard/index.js +2 -2
  62. package/dist/types/components/dashboard/summary-number-formatter.d.ts +6 -0
  63. package/dist/types/components/editor/editor-aside/utils.d.ts +1 -1
  64. package/dist/types/components/visual/data-table/types/data-table.d.ts +5 -20
  65. package/dist/types/index.js +50 -51
  66. package/dist/types/lib/formatters/canonical-format-adapter.d.ts +2 -29
  67. package/dist/types/lib/formatters/kpi-number-formatter.d.ts +41 -0
  68. package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +0 -2
  69. package/dist/types/lib/formatters/table-column-settings.d.ts +47 -0
  70. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +10 -188
  71. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
  72. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +16 -372
  73. package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
  74. package/dist/types/lib/stores/editor-store.d.ts +48 -10
  75. package/dist/types/lib/stores/table-actions.d.ts +9 -5
  76. package/dist/types/lib/table-formatting/index.d.ts +0 -2
  77. package/dist/types/lib/table-formatting/table-conditional-formatting-range-source.d.ts +3 -2
  78. package/dist/types/lib/table-formatting/table-conditional-formatting-range.d.ts +3 -2
  79. package/dist/types/lib/table-formatting/table-formatting-normalize.d.ts +1 -2
  80. package/dist/types/lib/table-formatting/table-formatting-render-model.d.ts +9 -0
  81. package/dist/types/lib/table-formatting/table-formatting-types.d.ts +5 -95
  82. package/dist/types/lib/table-formatting/table-presentation-fields.d.ts +35 -0
  83. package/dist/types/lib/types/common-types.d.ts +40 -47
  84. package/dist/types/lib/types/explorer-types.d.ts +11 -43
  85. package/dist/types/lib/utils/card-config-utils.d.ts +8 -0
  86. package/dist/types/lib/utils/card-definition.d.ts +9 -187
  87. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +169 -513
  88. package/dist/types/shared/analytics-protocol/contracts.d.ts +32 -9
  89. package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +108 -980
  90. package/dist/types/shared/analytics-protocol/field-validation.d.ts +1 -0
  91. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +281 -4624
  92. package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +20 -20
  93. package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +18 -18
  94. package/dist/types/shared/analytics-protocol/matrix-path-contract.d.ts +40 -40
  95. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +3 -203
  96. package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +12 -0
  97. package/dist/types/shared/analytics-protocol/scalar-value.d.ts +8 -8
  98. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -0
  99. package/dist/types/shared/assistant-protocol/context.d.ts +69 -69
  100. package/dist/types/shared/dashboard-authoring/canonical-result-keys.d.ts +13 -0
  101. package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +4 -1
  102. package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +10 -0
  103. package/dist/types/shared/dashboard-authoring/card-formats/upgrade-card-formats.d.ts +57 -0
  104. package/dist/types/shared/dashboard-authoring/card-settings/apply-card-settings.d.ts +11 -0
  105. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +52 -0
  106. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +14 -0
  107. package/dist/types/shared/dashboard-authoring/card-settings/carry-column-settings.d.ts +3 -0
  108. package/dist/types/shared/dashboard-authoring/card-settings/column-format-write.d.ts +8 -0
  109. package/dist/types/shared/dashboard-authoring/card-settings/column-names.d.ts +51 -0
  110. package/dist/types/shared/dashboard-authoring/card-settings/column-sources.d.ts +14 -0
  111. package/dist/types/shared/dashboard-authoring/card-settings/confirm-class.d.ts +9 -0
  112. package/dist/types/shared/dashboard-authoring/card-settings/highlight-inputs.d.ts +19 -0
  113. package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +15 -0
  114. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +102 -0
  115. package/dist/types/shared/dashboard-authoring/card-settings/read-card-settings.d.ts +10 -0
  116. package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-highlights.d.ts +14 -0
  117. package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-settings.d.ts +59 -0
  118. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +40 -0
  119. package/dist/types/shared/dashboard-authoring/card-settings/views.d.ts +28 -0
  120. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +6 -0
  121. package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +32 -0
  122. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +555 -38
  123. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +27 -8
  124. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +25 -1
  125. package/dist/types/shared/dashboard-authoring/conditional-formatting/editable.d.ts +14 -0
  126. package/dist/types/shared/dashboard-authoring/conditional-formatting/evaluate.d.ts +16 -0
  127. package/dist/types/shared/dashboard-authoring/conditional-formatting/index.d.ts +9 -0
  128. package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +7 -0
  129. package/dist/types/shared/dashboard-authoring/conditional-formatting/resolve-card-column-ref.d.ts +17 -0
  130. package/dist/types/shared/dashboard-authoring/conditional-formatting/retain.d.ts +14 -0
  131. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +4499 -0
  132. package/dist/types/shared/dashboard-authoring/conditional-formatting/store.d.ts +12 -0
  133. package/dist/types/shared/dashboard-authoring/conditional-formatting/types.d.ts +151 -0
  134. package/dist/types/shared/dashboard-authoring/conditional-formatting/upgrade.d.ts +35 -0
  135. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +62 -62
  136. package/dist/types/shared/dashboard-authoring/index.d.ts +8 -0
  137. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +123 -0
  138. package/dist/types/shared/dashboard-authoring/matrix-authoring.d.ts +4 -5
  139. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +24 -736
  140. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +21 -1
  141. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +10 -4
  142. package/dist/types/shared/dashboard-authoring/retired-presentation-fields.d.ts +31 -0
  143. package/dist/types/shared/dashboard-authoring/upgrade-card-presentation.d.ts +14 -0
  144. package/dist/types/shared/dashboard-viewer/bookmark-impact.d.ts +33 -0
  145. package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +13 -2
  146. package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +16 -0
  147. package/dist/types/shared/format-utils/index.d.ts +2 -0
  148. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +10 -366
  149. package/dist/types/shared/format-utils/raw-temporal.d.ts +31 -1
  150. package/dist/types/shared/format-utils/resolve-column-format.d.ts +43 -0
  151. package/dist/types/shared/format-utils/retired-format-adapters.d.ts +68 -0
  152. package/dist/types/shared/format-utils/semantic-format.d.ts +5 -1
  153. package/dist/types/shared/format-utils/stored-value-format.d.ts +16 -0
  154. package/dist/types/shared/format-utils/types/format-types.d.ts +10 -12
  155. package/package.json +2 -2
  156. package/dist/chunks/analytics-base-schemas-BUFUoO6G.js +0 -472
  157. package/dist/chunks/bookmark-state-ssqrs5oP.js +0 -111
  158. package/dist/chunks/document-dashboard-inputs-ChVkcBuu.js +0 -3010
  159. package/dist/chunks/editor-draft-sync-BN5qYHPF.js +0 -15
  160. package/dist/chunks/filter-reach-copy-B5Y7FHzg.js +0 -3411
  161. package/dist/chunks/global-date-filter-utils-DBzEOX9M.js +0 -12222
  162. package/dist/chunks/pivot-result-contract-expectations-DOYhqeZb.js +0 -1926
  163. package/dist/chunks/raw-temporal-presentation-BmT7z6NH.js +0 -584
  164. package/dist/chunks/resolve-dashboard-input-context-B_C_VAJH.js +0 -5520
  165. package/dist/chunks/table-settings-DXj_zXwS.js +0 -637
  166. package/dist/chunks/temporal-input-presentation-AhLSkGPf.js +0 -2939
  167. package/dist/types/lib/table-formatting/table-conditional-formatting-evaluator.d.ts +0 -9
  168. package/dist/types/lib/table-formatting/table-formatting-validation.d.ts +0 -12
@@ -1,4 +1,4 @@
1
- import { TemporalBucketFormat } from '../../analytics-protocol/contracts.js';
1
+ import { RawDatePreset, TemporalBucketFormat } from '../../analytics-protocol/contracts.js';
2
2
  export type NumericCanonicalFormat = {
3
3
  type: 'number' | 'currency' | 'percent' | 'scientific';
4
4
  locale?: string;
@@ -12,11 +12,15 @@ export type NumericCanonicalFormat = {
12
12
  scale?: number;
13
13
  currency?: string;
14
14
  percentValueMode?: 'fraction' | 'whole';
15
+ signDisplay?: 'auto' | 'always' | 'exceptZero' | 'never';
15
16
  };
16
17
  export type DateCanonicalFormat = {
17
18
  type: 'date';
18
19
  locale?: string;
19
20
  pattern?: string;
21
+ /** The pattern's token set; absent means Semaphor tokens. */
22
+ dialect?: RawTemporalPatternDialect;
23
+ preset?: RawDatePreset;
20
24
  relative?: boolean;
21
25
  timezone?: string;
22
26
  sourceTimezone?: string;
@@ -37,6 +41,11 @@ export type RawTemporalFormat = {
37
41
  mode: 'pattern';
38
42
  dialect: RawTemporalPatternDialect;
39
43
  pattern: string;
44
+ }
45
+ /** A named preset (column formats CF-D16). */
46
+ | {
47
+ mode: 'preset';
48
+ preset: 'short' | 'long' | 'numeric' | 'iso';
40
49
  };
41
50
  };
42
51
  export type CanonicalDurationUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
@@ -140,10 +149,6 @@ export interface ColumnSettings {
140
149
  negativeStyle?: 'minus' | 'parentheses';
141
150
  /** Duration options; read only when `style` is `duration`. */
142
151
  duration?: ColumnDurationFormat;
143
- showDataBar?: boolean;
144
- dataBarColor?: string;
145
- dataBarMinValue?: number;
146
- dataBarMaxValue?: number;
147
152
  };
148
153
  dateFormat?: {
149
154
  format: string;
@@ -160,15 +165,8 @@ export interface ColumnSettings {
160
165
  labelColumn?: string;
161
166
  openInNewTab: boolean;
162
167
  };
163
- colorRanges?: ColorRange[];
164
168
  }
165
169
  export type ColumnSettingsMap = Record<string, ColumnSettings>;
166
- export interface ColorRange {
167
- min: number;
168
- max: number;
169
- color: string;
170
- applyTo: 'cell' | 'row';
171
- }
172
170
  export interface ExportFormattingConfig {
173
171
  /** Whether to apply formatting or export raw values */
174
172
  useFormattedValues: boolean;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.559",
8
+ "version": "0.1.561",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -127,7 +127,7 @@
127
127
  "build": "node scripts/build.mjs",
128
128
  "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
129
129
  "lint:regressions": "node scripts/lint-regressions.mjs",
130
- "check:guards": "node scripts/card-config-consumers.mjs && node scripts/components-entry-imports.mjs && node scripts/types-entry-imports.mjs && node scripts/card-query-assembly-imports.mjs && node scripts/matrix-conversion-imports.mjs && node scripts/legacy-table-type-references.mjs && node scripts/assistant-chat-imports.mjs && node scripts/filter-model-reads.mjs && node scripts/layout-engine.mjs",
130
+ "check:guards": "node scripts/card-config-consumers.mjs && node scripts/components-entry-imports.mjs && node scripts/types-entry-imports.mjs && node scripts/card-query-assembly-imports.mjs && node scripts/matrix-conversion-imports.mjs && node scripts/legacy-table-type-references.mjs && node scripts/assistant-chat-imports.mjs && node scripts/filter-model-reads.mjs && node scripts/kpi-figure-reads.mjs && node scripts/layout-engine.mjs",
131
131
  "preview": "vite preview",
132
132
  "test": "vitest run",
133
133
  "test:changed": "vitest run --changed",
@@ -1,472 +0,0 @@
1
- import { z as e } from "zod";
2
- const T = [
3
- "missing_dependency",
4
- "missing_relationship",
5
- "population_required",
6
- "ambiguous_relationship"
7
- ];
8
- function $(a) {
9
- return T.includes(
10
- a
11
- );
12
- }
13
- const W = 200, b = [
14
- "second",
15
- "minute",
16
- "hour",
17
- "day",
18
- "week",
19
- "month",
20
- "quarter",
21
- "year"
22
- ];
23
- function X(a) {
24
- return typeof a == "string" && b.includes(a);
25
- }
26
- const j = [
27
- "week_of_short",
28
- "week_of_long",
29
- "quarter_short",
30
- "quarter_long",
31
- "fiscal_quarter_short",
32
- "fiscal_year"
33
- ], J = {
34
- invalidMetadata: "invalid_raw_temporal_metadata"
35
- };
36
- function v(a) {
37
- return a === "second" || a === "minute" || a === "hour" ? "datetime" : "date";
38
- }
39
- const Y = {
40
- missingMetadata: "missing_temporal_bucket_metadata",
41
- invalidMetadata: "invalid_temporal_bucket_metadata",
42
- invalidValue: "invalid_temporal_bucket_value"
43
- }, Q = "__auto_count__";
44
- function I(a) {
45
- try {
46
- return new Intl.DateTimeFormat("en-US", { timeZone: a }).format(), !0;
47
- } catch {
48
- return !1;
49
- }
50
- }
51
- const w = e.record(e.string(), e.unknown()), i = e.array(w), r = e.enum([
52
- "SUM",
53
- "COUNT",
54
- "AVG",
55
- "MIN",
56
- "MAX",
57
- "MEDIAN",
58
- "DISTINCT"
59
- ]), s = e.enum([
60
- "postgres",
61
- "mysql",
62
- "mssql",
63
- "snowflake",
64
- "clickhouse",
65
- "bigquery",
66
- "redshift",
67
- "duckdb",
68
- "sqlite",
69
- "unknown"
70
- ]), C = e.enum(b), l = e.enum([
71
- "dimension",
72
- "measure",
73
- "date",
74
- "id",
75
- "unknown"
76
- ]), p = e.enum([
77
- "string",
78
- "number",
79
- "boolean",
80
- "date",
81
- "datetime",
82
- "unknown"
83
- ]), u = e.union([e.number(), e.string(), e.null()]), d = e.enum([
84
- "millisecond",
85
- "second",
86
- "minute",
87
- "hour",
88
- "day"
89
- ]), O = e.enum(j), q = e.discriminatedUnion("mode", [
90
- e.object({ mode: e.literal("auto") }).strict(),
91
- e.object({
92
- mode: e.literal("preset"),
93
- preset: O
94
- }).strict(),
95
- e.object({
96
- mode: e.literal("pattern"),
97
- pattern: e.string().min(1)
98
- }).strict()
99
- ]), ee = e.object({
100
- type: e.literal("temporal_bucket"),
101
- presentation: q
102
- }).strict(), A = e.object({
103
- tz: e.string().min(1).refine(I, {
104
- message: "tz must be a valid IANA timezone"
105
- }),
106
- weekStart: e.number().int().min(0).max(6),
107
- fiscalCalendar: e.object({
108
- kind: e.literal("month_aligned"),
109
- yearStartMonth: e.number().int().min(1).max(12)
110
- }).strict().optional()
111
- }).strict(), g = e.object({
112
- kind: e.literal("temporal_bucket"),
113
- granularity: C,
114
- calendar: A
115
- }).strict(), D = e.object({
116
- kind: e.literal("raw_temporal"),
117
- valueKind: e.enum(["date", "wall_datetime", "instant"])
118
- }).strict(), E = e.union([
119
- e.object({
120
- type: e.enum([
121
- "number",
122
- "currency",
123
- "percent",
124
- "percentage",
125
- "scientific"
126
- ]),
127
- locale: e.string().optional(),
128
- minimumFractionDigits: e.number().optional(),
129
- maximumFractionDigits: e.number().optional(),
130
- useGrouping: e.boolean().optional(),
131
- prefix: e.string().optional(),
132
- suffix: e.string().optional(),
133
- negativeStyle: e.enum(["minus", "parentheses"]).optional(),
134
- compact: e.boolean().optional(),
135
- scale: e.number().optional(),
136
- currency: e.string().optional(),
137
- percentValueMode: e.enum(["fraction", "whole"]).optional()
138
- }).passthrough().superRefine((a, t) => {
139
- "locale" in a && t.addIssue({
140
- code: e.ZodIssueCode.custom,
141
- path: ["locale"],
142
- message: "Numeric semantic formats inherit locale from viewer preferences."
143
- });
144
- }),
145
- e.object({
146
- type: e.enum(["date", "datetime"]),
147
- locale: e.string().optional(),
148
- pattern: e.string().optional(),
149
- relative: e.boolean().optional(),
150
- timezone: e.string().optional(),
151
- sourceTimezone: e.string().optional(),
152
- prefix: e.string().optional(),
153
- suffix: e.string().optional()
154
- }).passthrough(),
155
- e.object({
156
- type: e.literal("duration"),
157
- inputUnit: d.optional(),
158
- outputStyle: e.enum(["compact", "digital", "long"]).optional(),
159
- largestUnit: d.optional(),
160
- smallestUnit: d.optional(),
161
- maxUnits: e.number().optional(),
162
- prefix: e.string().optional(),
163
- suffix: e.string().optional(),
164
- negativeStyle: e.enum(["minus", "parentheses"]).optional()
165
- }).passthrough(),
166
- e.object({
167
- type: e.literal("string"),
168
- prefix: e.string().optional(),
169
- suffix: e.string().optional()
170
- }).passthrough()
171
- ]);
172
- function M(a, t) {
173
- return e.object(a).passthrough().superRefine((o, k) => {
174
- for (const m of t)
175
- Object.prototype.hasOwnProperty.call(o, m) || k.addIssue({
176
- code: "custom",
177
- path: [m],
178
- message: `Required field "${m}" is missing.`
179
- });
180
- });
181
- }
182
- const y = e.object({
183
- kind: e.literal("semantic"),
184
- domainId: e.string(),
185
- datasetName: e.string(),
186
- datasetId: e.string().optional(),
187
- label: e.string().optional(),
188
- connectionId: e.string().optional()
189
- }).passthrough(), N = e.object({
190
- kind: e.literal("physical"),
191
- connectionId: e.string(),
192
- connectionType: e.string().optional(),
193
- tableName: e.string(),
194
- databaseName: e.string().optional(),
195
- schemaName: e.string().optional(),
196
- label: e.string().optional(),
197
- dialect: s.optional()
198
- }).passthrough(), P = e.object({
199
- kind: e.literal("sql"),
200
- connectionId: e.string(),
201
- dialect: s.optional(),
202
- label: e.string().optional()
203
- }).passthrough(), S = e.union([
204
- y,
205
- N,
206
- P
207
- ]), F = e.object({
208
- name: e.string(),
209
- label: e.string().optional(),
210
- role: l.optional(),
211
- dataType: p.optional(),
212
- source: S.optional(),
213
- aggregate: r.optional()
214
- }).passthrough(), _ = F, x = e.object({
215
- kind: e.literal("field"),
216
- field: _,
217
- aggregate: r.optional()
218
- }).passthrough(), B = e.object({
219
- kind: e.literal("derived_field"),
220
- name: e.string(),
221
- label: e.string(),
222
- description: e.string().optional(),
223
- resultRole: l,
224
- dataType: p,
225
- computeStage: e.enum(["row", "aggregate"]),
226
- expression: e.string(),
227
- expressionLanguage: e.literal("semaphor_sql_template").optional(),
228
- inputs: e.record(x),
229
- defaultAggregate: r.optional(),
230
- aggregationBehavior: e.enum([
231
- "additive",
232
- "non_additive",
233
- "ratio_of_sums",
234
- "weighted",
235
- "pre_aggregated",
236
- "snapshot"
237
- ]).optional(),
238
- aggregationStrategy: e.enum([
239
- "default",
240
- "symmetric_aggregate",
241
- "aggregate_then_join",
242
- "weighted"
243
- ]).optional(),
244
- format: E.optional(),
245
- tags: e.array(e.string()).optional()
246
- }).passthrough(), f = B, ae = _.and(
247
- e.object({
248
- derivedField: f.optional()
249
- }).passthrough()
250
- ), U = y, V = e.object({
251
- kind: e.literal("physical"),
252
- connectionId: e.string().optional(),
253
- connectionType: e.string().optional(),
254
- tableName: e.string(),
255
- databaseName: e.string().optional(),
256
- schemaName: e.string().optional(),
257
- label: e.string().optional(),
258
- dialect: s.optional()
259
- }).passthrough(), z = e.object({
260
- kind: e.literal("sql"),
261
- connectionId: e.string().optional(),
262
- dialect: s.optional(),
263
- label: e.string().optional()
264
- }).passthrough(), G = e.union([
265
- U,
266
- V,
267
- z
268
- ]), te = e.object({
269
- key: e.string().optional(),
270
- name: e.string(),
271
- label: e.string().optional(),
272
- role: l.optional(),
273
- dataType: p.optional(),
274
- source: G.optional(),
275
- aggregate: r.optional(),
276
- derivedField: e.never().optional()
277
- }).passthrough(), n = e.object({
278
- key: e.string(),
279
- name: e.string(),
280
- label: e.string(),
281
- role: l.optional(),
282
- dataType: p.optional(),
283
- aggregate: r.optional(),
284
- source: S.optional(),
285
- derivedField: f.optional(),
286
- temporalBucket: g.optional(),
287
- rawTemporal: D.optional(),
288
- pivotIdentity: e.object({
289
- metricId: e.string().min(1),
290
- metricAlias: e.string().min(1),
291
- members: e.array(
292
- e.object({
293
- fieldId: e.string().min(1),
294
- value: e.string().nullable(),
295
- temporalBucket: g.optional()
296
- }).strict()
297
- )
298
- }).strict().optional()
299
- }).passthrough().superRefine((a, t) => {
300
- if (a.temporalBucket && a.rawTemporal && t.addIssue({
301
- code: e.ZodIssueCode.custom,
302
- path: ["rawTemporal"],
303
- message: "A result column cannot carry both temporalBucket and rawTemporal metadata."
304
- }), a.temporalBucket) {
305
- const o = v(
306
- a.temporalBucket.granularity
307
- );
308
- a.dataType !== o && t.addIssue({
309
- code: e.ZodIssueCode.custom,
310
- path: ["dataType"],
311
- message: `${a.temporalBucket.granularity} temporal buckets require dataType ${o}.`
312
- });
313
- }
314
- if (a.rawTemporal) {
315
- const o = a.rawTemporal.valueKind === "date" ? "date" : "datetime";
316
- a.dataType !== o && t.addIssue({
317
- code: e.ZodIssueCode.custom,
318
- path: ["dataType"],
319
- message: `${a.rawTemporal.valueKind} raw temporal values require dataType ${o}.`
320
- });
321
- }
322
- }), oe = e.object({
323
- records: i,
324
- columns: e.array(n).optional()
325
- }).passthrough(), ne = e.object({
326
- records: i,
327
- columns: e.array(n)
328
- }).passthrough(), R = e.object({
329
- code: e.string(),
330
- message: e.string().optional(),
331
- invalidField: e.string().optional(),
332
- fieldRole: e.enum(["measure", "date", "dimension", "input", "source", "sql"]).optional(),
333
- validMeasureCandidates: e.array(e.string()).optional(),
334
- validDateCandidates: e.array(e.string()).optional(),
335
- validDimensionCandidates: e.array(e.string()).optional(),
336
- recommendedNextStep: e.string()
337
- }).passthrough(), h = e.object({
338
- code: e.string(),
339
- message: e.string(),
340
- path: e.string().optional(),
341
- fieldRole: e.enum(["measure", "date", "dimension", "input", "source", "sql"]).optional(),
342
- repairHint: R.optional()
343
- }).passthrough(), ie = e.object({
344
- ok: e.boolean(),
345
- errors: e.array(h),
346
- warnings: e.array(h),
347
- repairHints: e.array(R)
348
- }).passthrough(), L = e.object({
349
- page: e.number(),
350
- pageSize: e.number(),
351
- pageCount: e.number(),
352
- totalCount: e.number(),
353
- hasNextPage: e.boolean(),
354
- hasPrevPage: e.boolean()
355
- }).passthrough(), c = {
356
- intentId: e.string().optional(),
357
- queryPath: e.enum(["query_spec", "sql", "sql_python"]),
358
- warnings: e.array(e.string()).optional(),
359
- rowCount: e.number().optional(),
360
- rowLimitExceeded: e.boolean().optional(),
361
- limit: e.number().optional(),
362
- pagination: L.optional()
363
- }, re = e.object({
364
- ...c,
365
- kind: e.literal("metric"),
366
- primaryValue: u,
367
- measures: e.record(u).optional(),
368
- missingMeasures: e.array(e.string()).optional(),
369
- comparison: e.object({
370
- kind: e.enum(["previous_period", "previous_year", "target"]),
371
- value: u.optional(),
372
- delta: e.union([e.number(), e.null()]).optional(),
373
- deltaPercent: e.union([e.number(), e.null()]).optional()
374
- }).passthrough().optional(),
375
- records: i.optional()
376
- }).passthrough(), se = e.object({
377
- ...c,
378
- kind: e.literal("records"),
379
- columns: e.array(n),
380
- records: i,
381
- totals: e.object({
382
- mode: e.literal("server"),
383
- scope: e.literal("filtered_result"),
384
- row: e.record(e.string(), e.unknown()),
385
- columns: e.array(n).optional()
386
- }).passthrough().optional()
387
- }).passthrough(), H = e.object({
388
- inputId: e.string().min(1),
389
- status: e.enum(["applied", "inactive", "skipped", "overridden", "error"]),
390
- reason: e.enum([
391
- "unrelated",
392
- "population_required",
393
- "missing_dependency",
394
- "missing_relationship",
395
- "ambiguous_relationship",
396
- "invalid_metadata",
397
- "unsupported_dependency",
398
- "override_not_eligible"
399
- ]).optional()
400
- }), Z = e.object({
401
- complete: e.boolean(),
402
- reason: e.enum(["unsupported", "truncated"]).optional()
403
- }), le = e.object({
404
- ...c,
405
- kind: e.literal("inputOptions"),
406
- dependencyOutcomes: e.array(H).optional(),
407
- match: Z.optional(),
408
- options: e.array(
409
- M(
410
- {
411
- label: e.string(),
412
- value: e.unknown(),
413
- count: e.number().optional(),
414
- disambiguation: e.array(e.string()).optional()
415
- },
416
- ["value"]
417
- )
418
- )
419
- }).passthrough(), pe = e.object({
420
- ...c,
421
- kind: e.literal("sql"),
422
- columns: e.array(n),
423
- records: i,
424
- sqlShape: e.object({
425
- statementType: e.string().optional(),
426
- explicitLimit: e.number().optional(),
427
- hasPythonCode: e.boolean().optional()
428
- }).passthrough().optional()
429
- }).passthrough();
430
- export {
431
- oe as A,
432
- ne as B,
433
- h as C,
434
- ie as D,
435
- re as E,
436
- se as F,
437
- H as G,
438
- Z as H,
439
- le as I,
440
- pe as J,
441
- W as M,
442
- T as O,
443
- J as R,
444
- Q as S,
445
- Y as T,
446
- g as a,
447
- $ as b,
448
- b as c,
449
- X as d,
450
- j as e,
451
- i as f,
452
- r as g,
453
- C as h,
454
- I as i,
455
- ee as j,
456
- D as k,
457
- E as l,
458
- y as m,
459
- u as n,
460
- N as o,
461
- P as p,
462
- F as q,
463
- w as r,
464
- S as s,
465
- v as t,
466
- _ as u,
467
- B as v,
468
- f as w,
469
- ae as x,
470
- te as y,
471
- n as z
472
- };
@@ -1,111 +0,0 @@
1
- import { z as t } from "zod";
2
- import { b as g, d as v } from "./matrix-operation-contract-COxrfQTS.js";
3
- import { a as T } from "./metric-comparison-DQx-uX__.js";
4
- import { D as O, v as y, k as E, j as A, i as V } from "./table-settings-DXj_zXwS.js";
5
- const p = 1, $ = ["PRIVATE", "TEAM", "DASHBOARD"], R = t.object({
6
- filterId: t.string().min(1),
7
- name: t.string(),
8
- operation: t.string(),
9
- valueType: t.enum(["string", "number", "date", "boolean"]),
10
- values: t.array(t.unknown())
11
- }).passthrough().superRefine((e, o) => {
12
- const s = [];
13
- O.has(e.operation) ? y(e, e.valueType, "filterValue", s) : s.push("filterValue.operation must be a valid filter operation.");
14
- for (const i of s) o.addIssue({ code: "custom", message: i });
15
- }), S = t.unknown().superRefine((e, o) => {
16
- for (const s of T(e).errors)
17
- o.addIssue({ code: "custom", message: s.message });
18
- }), _ = t.discriminatedUnion("kind", [
19
- t.object({ kind: t.literal("filter"), filterValue: R }).strict(),
20
- t.object({ kind: t.literal("control"), value: t.unknown() }).strict(),
21
- t.object({
22
- kind: t.literal("selection"),
23
- selection: g
24
- }).strict()
25
- ]), w = t.union([
26
- t.object({
27
- status: t.literal("set"),
28
- value: _,
29
- comparisonSelection: S.optional()
30
- }).strict(),
31
- t.object({
32
- status: t.literal("cleared"),
33
- comparisonSelection: S.optional()
34
- }).strict(),
35
- t.object({ comparisonSelection: S }).strict()
36
- ]), k = ["bySheetId", "byCardId", "byDocumentSectionId"], B = /* @__PURE__ */ new Set(["version", "selectedSheetId", "inputs", "tableSettings"]), D = /* @__PURE__ */ new Set(["shared", ...k]), d = (e) => !!e && typeof e == "object" && !Array.isArray(e);
37
- function b(e, o, s) {
38
- if (e === void 0) return;
39
- if (!d(e)) {
40
- o.push({ target: "input", id: s });
41
- return;
42
- }
43
- const i = {};
44
- for (const [a, u] of Object.entries(e)) {
45
- const c = a ? w.safeParse(u) : void 0;
46
- c != null && c.success ? i[a] = c.data : o.push({
47
- target: v(a) ? "selection" : "input",
48
- id: a
49
- });
50
- }
51
- return Object.keys(i).length ? i : void 0;
52
- }
53
- function K(e, o) {
54
- if (o !== p)
55
- return { ok: !1, error: `Unsupported bookmark version ${o}.` };
56
- if (!d(e) || e.version !== p)
57
- return { ok: !1, error: "The bookmark state is invalid." };
58
- const s = [], i = Object.keys(e).filter((l) => !B.has(l));
59
- let a;
60
- typeof e.selectedSheetId == "string" && e.selectedSheetId ? a = e.selectedSheetId : e.selectedSheetId !== void 0 && s.push({ target: "sheet", id: String(e.selectedSheetId) });
61
- const u = {};
62
- if (d(e.inputs)) {
63
- i.push(
64
- ...Object.keys(e.inputs).filter((r) => !D.has(r)).map((r) => `inputs.${r}`)
65
- );
66
- const l = b(e.inputs.shared, s, "shared");
67
- l && (u.shared = l);
68
- for (const r of k) {
69
- const n = e.inputs[r];
70
- if (n === void 0) continue;
71
- if (!d(n)) {
72
- s.push({ target: "input", id: r });
73
- continue;
74
- }
75
- const f = {};
76
- for (const [h, I] of Object.entries(n)) {
77
- const m = b(I, s, `${r}.${h}`);
78
- m && (f[h] = m);
79
- }
80
- Object.keys(f).length && (u[r] = f);
81
- }
82
- } else e.inputs !== void 0 && i.push("inputs");
83
- const c = {};
84
- if (d(e.tableSettings))
85
- for (const [l, r] of Object.entries(e.tableSettings)) {
86
- const n = l ? E(r, V) : void 0;
87
- n != null && n.ok ? A(n.value) || (c[l] = n.value) : s.push({ target: "card", id: l });
88
- }
89
- else e.tableSettings !== void 0 && i.push("tableSettings");
90
- return {
91
- ok: !0,
92
- value: {
93
- version: p,
94
- ...a ? { selectedSheetId: a } : {},
95
- ...Object.keys(u).length ? { inputs: u } : {},
96
- ...Object.keys(c).length ? { tableSettings: c } : {}
97
- },
98
- issues: s,
99
- unknownKeys: i
100
- };
101
- }
102
- function j(e, o) {
103
- const s = K(e, o);
104
- return s.ok ? s.issues.some((i) => i.target === "card") ? { ok: !1, error: "The bookmark table settings are invalid." } : s.issues.length || s.unknownKeys.length ? { ok: !1, error: "The bookmark state is invalid." } : { ok: !0, value: s.value } : s;
105
- }
106
- export {
107
- p as B,
108
- $ as a,
109
- j as p,
110
- K as r
111
- };