react-semaphor 0.1.325 → 0.1.327
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +260 -226
- package/dist/brand-studio/index.cjs +2 -2
- package/dist/brand-studio/index.js +7 -6
- package/dist/chunks/{braces-ZjRH2Kl7.js → braces-B6qRDu1H.js} +1 -1
- package/dist/chunks/{braces-C7BeIXvM.js → braces-BGWZEnQJ.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-DHhT6Sja.js → calendar-preferences-dialog-CjwbE_82.js} +6 -5
- package/dist/chunks/calendar-preferences-dialog-fkLUMJyR.js +1 -0
- package/dist/chunks/{chevrons-up-down-CA-XvN1o.js → chevrons-up-down-BpsogQvv.js} +1 -1
- package/dist/chunks/{chevrons-up-down-Cuilz9aY.js → chevrons-up-down-xG-bVFD9.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DZiFMK8I.js → dashboard-briefing-launcher-Co57xBfS.js} +2 -2
- package/dist/chunks/{dashboard-briefing-launcher-BzIxRlzW.js → dashboard-briefing-launcher-Cy1nWZRW.js} +714 -719
- package/dist/chunks/{dashboard-controls-DVwsWny9.js → dashboard-controls-BWnVEFJq.js} +10 -9
- package/dist/chunks/{dashboard-controls-BX693lE0.js → dashboard-controls-C7rOGZO-.js} +1 -1
- package/dist/chunks/{dashboard-json-D15C_I9e.js → dashboard-json-BpRNSsF3.js} +7 -6
- package/dist/chunks/dashboard-json-DBPMknGo.js +1 -0
- package/dist/chunks/date-formatter-B4EBSe9C.js +1 -0
- package/dist/chunks/date-formatter-CzcPZx39.js +416 -0
- package/dist/chunks/edit-dashboard-visual-B2vkIKEa.js +178 -0
- package/dist/chunks/{edit-dashboard-visual-wQyJEcVH.js → edit-dashboard-visual-CYf26co_.js} +8243 -7784
- package/dist/chunks/index-BD90s-wf.js +1309 -0
- package/dist/chunks/index-BxM99sFL.js +1 -0
- package/dist/chunks/index-CuHybtft.js +51 -0
- package/dist/chunks/{index-CffvIaZO.js → index-DTlbYpxd.js} +29440 -28968
- package/dist/chunks/{palette-D96DOM7E.js → palette-CSF7IVJn.js} +1 -1
- package/dist/chunks/{palette-CanPG11m.js → palette-CWgEPBoG.js} +1 -1
- package/dist/chunks/{resource-management-panel-DlnrD0y-.js → resource-management-panel-D6nbfJY3.js} +1 -1
- package/dist/chunks/{resource-management-panel-CLoO2DL3.js → resource-management-panel-D893Onv8.js} +6 -5
- package/dist/chunks/{save-CqrBQKG6.js → save-CtQbSub2.js} +1 -1
- package/dist/chunks/{save-DxkSzUTZ.js → save-DRdFKF57.js} +1 -1
- package/dist/chunks/switch-DJJJD_g1.js +168 -0
- package/dist/chunks/{switch-Deo2Ltmj.js → switch-DKf6vHfP.js} +2222 -2228
- package/dist/chunks/{use-create-flow-overlay-state-DocFanjO.js → use-create-flow-overlay-state-C4LgoK8q.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-DsPoCfMu.js → use-create-flow-overlay-state-p21zs2p6.js} +29 -28
- package/dist/chunks/{use-visual-utils-BdO22fQZ.js → use-visual-utils-BKBua6o4.js} +2 -2
- package/dist/chunks/{use-visual-utils-DSbXQQD1.js → use-visual-utils-BqWm0QeW.js} +1 -1
- package/dist/chunks/validators-DDAweCzB.js +371 -0
- package/dist/chunks/validators-odlRJblR.js +2 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +919 -507
- package/dist/data-app-sdk/index.cjs +1 -0
- package/dist/data-app-sdk/index.js +512 -0
- package/dist/format-utils/index.cjs +4 -4
- package/dist/format-utils/index.js +22 -21
- package/dist/index.cjs +1 -1
- package/dist/index.js +141 -140
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/analytics-protocol.d.ts +326 -2
- package/dist/types/dashboard-authoring.d.ts +102 -3
- package/dist/types/dashboard.d.ts +23 -3
- package/dist/types/data-app-sdk.d.ts +379 -0
- package/dist/types/format-utils.d.ts +25 -0
- package/dist/types/main.d.ts +182 -12
- package/dist/types/shared.d.ts +18 -2
- package/dist/types/surfboard.d.ts +23 -3
- package/dist/types/types.d.ts +38 -4
- package/package.json +6 -1
- package/dist/chunks/calendar-preferences-dialog-BxeROxyq.js +0 -1
- package/dist/chunks/dashboard-json-DxNEFM-p.js +0 -1
- package/dist/chunks/date-formatter-D9Bvw5Qk.js +0 -1
- package/dist/chunks/date-formatter-DyIOb6uC.js +0 -333
- package/dist/chunks/edit-dashboard-visual-90_qEgRc.js +0 -178
- package/dist/chunks/index-YTk9Hab2.js +0 -1303
- package/dist/chunks/switch-BXICAlvS.js +0 -168
package/dist/surfboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/index-BD90s-wf.js"),e=require("../chunks/common-types-C73-Ud1-.js"),a=require("../chunks/calendar-preferences-dialog-fkLUMJyR.js");exports.Surfboard=r.DashboardPlus;exports.CONTROL_CARD_DEFAULT_VALUE=e.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=e.EMPTY_SELECTION;exports.CalendarPreferencesDialog=a.CalendarPreferencesDialog;
|
package/dist/surfboard/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as e } from "../chunks/index-
|
|
1
|
+
import { a as e } from "../chunks/index-DTlbYpxd.js";
|
|
2
2
|
import { C, E } from "../chunks/common-types-4bjoIgvm.js";
|
|
3
|
-
import { C as s } from "../chunks/calendar-preferences-dialog-
|
|
3
|
+
import { C as s } from "../chunks/calendar-preferences-dialog-CjwbE_82.js";
|
|
4
4
|
export {
|
|
5
5
|
C as CONTROL_CARD_DEFAULT_VALUE,
|
|
6
6
|
s as CalendarPreferencesDialog,
|
|
@@ -1,5 +1,265 @@
|
|
|
1
|
+
export declare type AnalyticsCatalogDataType = 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'unknown';
|
|
2
|
+
|
|
3
|
+
export declare type AnalyticsCatalogField = {
|
|
4
|
+
id?: unknown;
|
|
5
|
+
column_name?: unknown;
|
|
6
|
+
name?: unknown;
|
|
7
|
+
label?: unknown;
|
|
8
|
+
alias?: unknown;
|
|
9
|
+
qualifiedFieldName?: unknown;
|
|
10
|
+
data_type?: unknown;
|
|
11
|
+
dataType?: unknown;
|
|
12
|
+
role?: unknown;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export declare type AnalyticsCatalogFieldSummary = {
|
|
16
|
+
validMetricCandidates: string[];
|
|
17
|
+
validDateCandidates: string[];
|
|
18
|
+
validDimensionCandidates: string[];
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export declare type AnalyticsMetricFormat = {
|
|
22
|
+
type: 'number' | 'currency' | 'percent' | 'scientific';
|
|
23
|
+
locale?: string;
|
|
24
|
+
minimumFractionDigits?: number;
|
|
25
|
+
maximumFractionDigits?: number;
|
|
26
|
+
useGrouping?: boolean;
|
|
27
|
+
prefix?: string;
|
|
28
|
+
suffix?: string;
|
|
29
|
+
negativeStyle?: 'minus' | 'parentheses';
|
|
30
|
+
compact?: boolean;
|
|
31
|
+
scale?: number;
|
|
32
|
+
currency?: string;
|
|
33
|
+
percentValueMode?: 'fraction' | 'whole';
|
|
34
|
+
} | {
|
|
35
|
+
type: 'date';
|
|
36
|
+
locale?: string;
|
|
37
|
+
pattern?: string;
|
|
38
|
+
relative?: boolean;
|
|
39
|
+
timezone?: string;
|
|
40
|
+
sourceTimezone?: string;
|
|
41
|
+
prefix?: string;
|
|
42
|
+
suffix?: string;
|
|
43
|
+
} | {
|
|
44
|
+
type: 'string';
|
|
45
|
+
prefix?: string;
|
|
46
|
+
suffix?: string;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export declare function buildAnalyticsCatalogFieldSummary(fields: AnalyticsCatalogField[]): AnalyticsCatalogFieldSummary;
|
|
50
|
+
|
|
51
|
+
export declare function getAnalyticsCatalogFieldCandidates(field: AnalyticsCatalogField): string[];
|
|
52
|
+
|
|
53
|
+
export declare function getAnalyticsCatalogFieldName(field: AnalyticsCatalogField): string;
|
|
54
|
+
|
|
55
|
+
export declare function inferAnalyticsMetricFormat(field: AnalyticsCatalogField): AnalyticsMetricFormat | undefined;
|
|
56
|
+
|
|
57
|
+
export declare function isAnalyticsCatalogDateField(field: AnalyticsCatalogField): boolean;
|
|
58
|
+
|
|
59
|
+
export declare function isAnalyticsCatalogDimensionField(field: AnalyticsCatalogField): boolean;
|
|
60
|
+
|
|
61
|
+
export declare function isAnalyticsCatalogMetricField(field: AnalyticsCatalogField, options?: {
|
|
62
|
+
excludeIdentifiers?: boolean;
|
|
63
|
+
}): boolean;
|
|
64
|
+
|
|
65
|
+
export declare function isAnalyticsDateLikeDataType(value: unknown): boolean;
|
|
66
|
+
|
|
67
|
+
export declare function isAnalyticsMetricIdentifierField(field: AnalyticsCatalogField): boolean;
|
|
68
|
+
|
|
69
|
+
export declare function isAnalyticsTechnicalIdentifierField(field: AnalyticsCatalogField): boolean;
|
|
70
|
+
|
|
71
|
+
export declare function normalizeAnalyticsCatalogDataType(value: unknown): AnalyticsCatalogDataType;
|
|
72
|
+
|
|
73
|
+
export declare function normalizeAnalyticsCatalogName(value: unknown): string;
|
|
74
|
+
|
|
75
|
+
export declare const SEMAPHOR_ANALYTICS_INTENT_FIXTURES: {
|
|
76
|
+
revenueKpi: {
|
|
77
|
+
version: 1;
|
|
78
|
+
kind: "metric";
|
|
79
|
+
id: string;
|
|
80
|
+
label: string;
|
|
81
|
+
source: {
|
|
82
|
+
readonly kind: "semantic";
|
|
83
|
+
readonly domainId: "domain_sales";
|
|
84
|
+
readonly datasetName: "orders";
|
|
85
|
+
readonly connectionId: "conn_sales";
|
|
86
|
+
readonly label: "Orders";
|
|
87
|
+
};
|
|
88
|
+
metric: string;
|
|
89
|
+
comparison: {
|
|
90
|
+
kind: "previous_period";
|
|
91
|
+
};
|
|
92
|
+
limit: number;
|
|
93
|
+
};
|
|
94
|
+
revenueTrend: {
|
|
95
|
+
version: 1;
|
|
96
|
+
kind: "records";
|
|
97
|
+
id: string;
|
|
98
|
+
label: string;
|
|
99
|
+
source: {
|
|
100
|
+
readonly kind: "semantic";
|
|
101
|
+
readonly domainId: "domain_sales";
|
|
102
|
+
readonly datasetName: "orders";
|
|
103
|
+
readonly connectionId: "conn_sales";
|
|
104
|
+
readonly label: "Orders";
|
|
105
|
+
};
|
|
106
|
+
fields: {
|
|
107
|
+
name: string;
|
|
108
|
+
role: "date";
|
|
109
|
+
dataType: "date";
|
|
110
|
+
label: string;
|
|
111
|
+
}[];
|
|
112
|
+
measures: string[];
|
|
113
|
+
dateField: {
|
|
114
|
+
name: string;
|
|
115
|
+
role: "date";
|
|
116
|
+
dataType: "date";
|
|
117
|
+
};
|
|
118
|
+
timeGrain: "month";
|
|
119
|
+
limit: number;
|
|
120
|
+
};
|
|
121
|
+
topCustomersRecords: {
|
|
122
|
+
version: 1;
|
|
123
|
+
kind: "records";
|
|
124
|
+
id: string;
|
|
125
|
+
label: string;
|
|
126
|
+
source: {
|
|
127
|
+
readonly kind: "semantic";
|
|
128
|
+
readonly domainId: "domain_sales";
|
|
129
|
+
readonly datasetName: "orders";
|
|
130
|
+
readonly connectionId: "conn_sales";
|
|
131
|
+
readonly label: "Orders";
|
|
132
|
+
};
|
|
133
|
+
fields: ({
|
|
134
|
+
name: string;
|
|
135
|
+
role: "dimension";
|
|
136
|
+
dataType: "string";
|
|
137
|
+
} | {
|
|
138
|
+
name: string;
|
|
139
|
+
role: "measure";
|
|
140
|
+
dataType: "number";
|
|
141
|
+
})[];
|
|
142
|
+
measures: string[];
|
|
143
|
+
orderBy: {
|
|
144
|
+
field: string;
|
|
145
|
+
direction: "desc";
|
|
146
|
+
};
|
|
147
|
+
limit: number;
|
|
148
|
+
};
|
|
149
|
+
regionInputOptions: {
|
|
150
|
+
version: 1;
|
|
151
|
+
kind: "inputOptions";
|
|
152
|
+
id: string;
|
|
153
|
+
label: string;
|
|
154
|
+
source: {
|
|
155
|
+
readonly kind: "semantic";
|
|
156
|
+
readonly domainId: "domain_sales";
|
|
157
|
+
readonly datasetName: "orders";
|
|
158
|
+
readonly connectionId: "conn_sales";
|
|
159
|
+
readonly label: "Orders";
|
|
160
|
+
};
|
|
161
|
+
field: {
|
|
162
|
+
name: string;
|
|
163
|
+
role: "dimension";
|
|
164
|
+
dataType: "string";
|
|
165
|
+
};
|
|
166
|
+
limit: number;
|
|
167
|
+
};
|
|
168
|
+
previousPeriodRevenueComparison: {
|
|
169
|
+
version: 1;
|
|
170
|
+
kind: "metric";
|
|
171
|
+
id: string;
|
|
172
|
+
label: string;
|
|
173
|
+
source: {
|
|
174
|
+
readonly kind: "semantic";
|
|
175
|
+
readonly domainId: "domain_sales";
|
|
176
|
+
readonly datasetName: "orders";
|
|
177
|
+
readonly connectionId: "conn_sales";
|
|
178
|
+
readonly label: "Orders";
|
|
179
|
+
};
|
|
180
|
+
metric: string;
|
|
181
|
+
dateField: {
|
|
182
|
+
name: string;
|
|
183
|
+
role: "date";
|
|
184
|
+
dataType: "date";
|
|
185
|
+
};
|
|
186
|
+
timeGrain: "week";
|
|
187
|
+
comparison: {
|
|
188
|
+
kind: "previous_period";
|
|
189
|
+
};
|
|
190
|
+
limit: number;
|
|
191
|
+
};
|
|
192
|
+
boundedSqlRanking: {
|
|
193
|
+
version: 1;
|
|
194
|
+
kind: "sql";
|
|
195
|
+
id: string;
|
|
196
|
+
label: string;
|
|
197
|
+
source: {
|
|
198
|
+
kind: "physical";
|
|
199
|
+
connectionId: string;
|
|
200
|
+
databaseName: string;
|
|
201
|
+
schemaName: string;
|
|
202
|
+
tableName: string;
|
|
203
|
+
dialect: "postgres";
|
|
204
|
+
};
|
|
205
|
+
sql: string;
|
|
206
|
+
limit: number;
|
|
207
|
+
rationale: string;
|
|
208
|
+
fields: ({
|
|
209
|
+
name: string;
|
|
210
|
+
role: "dimension";
|
|
211
|
+
dataType: "string";
|
|
212
|
+
} | {
|
|
213
|
+
name: string;
|
|
214
|
+
role: "measure";
|
|
215
|
+
dataType: "number";
|
|
216
|
+
})[];
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
export declare type SemaphorAnalyticsFieldRole = 'metric' | 'dateField' | 'dimension' | 'input' | 'source' | 'sql';
|
|
221
|
+
|
|
1
222
|
export declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent;
|
|
2
223
|
|
|
224
|
+
export declare type SemaphorAnalyticsIntentFixtureName = keyof typeof SEMAPHOR_ANALYTICS_INTENT_FIXTURES;
|
|
225
|
+
|
|
226
|
+
export declare type SemaphorAnalyticsRepairHint = {
|
|
227
|
+
code: SemaphorAnalyticsValidationCode | string;
|
|
228
|
+
message?: string;
|
|
229
|
+
invalidField?: string;
|
|
230
|
+
fieldRole?: SemaphorAnalyticsFieldRole;
|
|
231
|
+
validMetricCandidates?: string[];
|
|
232
|
+
validDateCandidates?: string[];
|
|
233
|
+
validDimensionCandidates?: string[];
|
|
234
|
+
recommendedNextStep: string;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
export declare type SemaphorAnalyticsResult = SemaphorMetricResult | SemaphorRecordsResult | SemaphorInputOptionsResult | SemaphorSqlResult;
|
|
238
|
+
|
|
239
|
+
export declare type SemaphorAnalyticsResultBase = {
|
|
240
|
+
intentId?: string;
|
|
241
|
+
queryPath: SemaphorQueryPath;
|
|
242
|
+
warnings?: string[];
|
|
243
|
+
rowCount?: number;
|
|
244
|
+
rowLimitExceeded?: boolean;
|
|
245
|
+
limit?: number;
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
export declare type SemaphorAnalyticsValidationCode = 'missing_source' | 'invalid_source_kind' | 'missing_semantic_domain' | 'missing_dataset_name' | 'missing_connection_id' | 'missing_table_name' | 'missing_sql' | 'missing_metric' | 'missing_record_fields' | 'missing_input_options_field' | 'invalid_metric' | 'invalid_metric_list' | 'invalid_date_field' | 'invalid_dimension' | 'invalid_metric_dimensions' | 'conflicting_sql' | 'sql_policy_violation' | 'unsupported_intent_for_adapter' | 'invalid_analytics_kind' | 'invalid_analytics_intent';
|
|
249
|
+
|
|
250
|
+
export declare type SemaphorAnalyticsValidationIssue = SemaphorProtocolIssue & {
|
|
251
|
+
code: SemaphorAnalyticsValidationCode | string;
|
|
252
|
+
fieldRole?: SemaphorAnalyticsFieldRole;
|
|
253
|
+
repairHint?: SemaphorAnalyticsRepairHint;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
export declare type SemaphorAnalyticsValidationResult = {
|
|
257
|
+
ok: boolean;
|
|
258
|
+
errors: SemaphorAnalyticsValidationIssue[];
|
|
259
|
+
warnings: SemaphorAnalyticsValidationIssue[];
|
|
260
|
+
repairHints: SemaphorAnalyticsRepairHint[];
|
|
261
|
+
};
|
|
262
|
+
|
|
3
263
|
export declare type SemaphorDashboardIntent = {
|
|
4
264
|
version: SemaphorProtocolVersion;
|
|
5
265
|
kind: 'dashboard';
|
|
@@ -34,6 +294,7 @@ export declare type SemaphorFieldRef = {
|
|
|
34
294
|
label?: string;
|
|
35
295
|
role?: 'dimension' | 'measure' | 'date' | 'id' | 'unknown';
|
|
36
296
|
dataType?: 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'unknown';
|
|
297
|
+
source?: SemaphorSourceRef;
|
|
37
298
|
};
|
|
38
299
|
|
|
39
300
|
export declare type SemaphorInputBinding = {
|
|
@@ -45,12 +306,24 @@ export declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'cont
|
|
|
45
306
|
|
|
46
307
|
export declare type SemaphorInputOptionsIntent = {
|
|
47
308
|
kind: 'inputOptions';
|
|
309
|
+
version?: SemaphorProtocolVersion;
|
|
310
|
+
id?: string;
|
|
311
|
+
label?: string;
|
|
48
312
|
source: SemaphorSourceRef;
|
|
49
313
|
field: SemaphorFieldRef;
|
|
50
314
|
search?: string;
|
|
51
315
|
limit?: number;
|
|
52
316
|
};
|
|
53
317
|
|
|
318
|
+
export declare type SemaphorInputOptionsResult = SemaphorAnalyticsResultBase & {
|
|
319
|
+
kind: 'inputOptions';
|
|
320
|
+
options: Array<{
|
|
321
|
+
label: string;
|
|
322
|
+
value: unknown;
|
|
323
|
+
count?: number;
|
|
324
|
+
}>;
|
|
325
|
+
};
|
|
326
|
+
|
|
54
327
|
export declare type SemaphorInputScope = {
|
|
55
328
|
level: 'dashboard';
|
|
56
329
|
excludeViewIds?: string[];
|
|
@@ -77,15 +350,32 @@ export declare type SemaphorInputSpec = {
|
|
|
77
350
|
|
|
78
351
|
export declare type SemaphorMetricIntent = {
|
|
79
352
|
kind: 'metric';
|
|
353
|
+
version?: SemaphorProtocolVersion;
|
|
354
|
+
id?: string;
|
|
80
355
|
source: SemaphorSourceRef;
|
|
81
356
|
metric: string;
|
|
357
|
+
metrics?: string[];
|
|
82
358
|
label?: string;
|
|
83
359
|
dateField?: SemaphorFieldRef;
|
|
360
|
+
timeGrain?: SemaphorTimeGrain;
|
|
361
|
+
dimensions?: SemaphorFieldRef[];
|
|
84
362
|
comparison?: {
|
|
85
363
|
kind: 'previous_period' | 'previous_year' | 'target';
|
|
86
364
|
targetValue?: number;
|
|
87
365
|
};
|
|
88
366
|
inputs?: SemaphorInputBinding[];
|
|
367
|
+
limit?: number;
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
export declare type SemaphorMetricResult = SemaphorAnalyticsResultBase & {
|
|
371
|
+
kind: 'metric';
|
|
372
|
+
value: number | string | null;
|
|
373
|
+
comparison?: {
|
|
374
|
+
kind: NonNullable<SemaphorMetricIntent['comparison']>['kind'];
|
|
375
|
+
value?: number | string | null;
|
|
376
|
+
delta?: number | null;
|
|
377
|
+
deltaPercent?: number | null;
|
|
378
|
+
};
|
|
89
379
|
};
|
|
90
380
|
|
|
91
381
|
export declare type SemaphorProtocolIssue = {
|
|
@@ -96,9 +386,14 @@ export declare type SemaphorProtocolIssue = {
|
|
|
96
386
|
|
|
97
387
|
export declare type SemaphorProtocolVersion = 1;
|
|
98
388
|
|
|
389
|
+
export declare type SemaphorQueryPath = 'query_spec' | 'sql' | 'sql_python';
|
|
390
|
+
|
|
99
391
|
export declare type SemaphorRecordsIntent = {
|
|
100
392
|
kind: 'records';
|
|
393
|
+
version?: SemaphorProtocolVersion;
|
|
101
394
|
source: SemaphorSourceRef;
|
|
395
|
+
id?: string;
|
|
396
|
+
label?: string;
|
|
102
397
|
fields: SemaphorFieldRef[];
|
|
103
398
|
measures?: string[];
|
|
104
399
|
dateField?: SemaphorFieldRef;
|
|
@@ -111,6 +406,16 @@ export declare type SemaphorRecordsIntent = {
|
|
|
111
406
|
inputs?: SemaphorInputBinding[];
|
|
112
407
|
};
|
|
113
408
|
|
|
409
|
+
export declare type SemaphorRecordsResult = SemaphorAnalyticsResultBase & {
|
|
410
|
+
kind: 'records';
|
|
411
|
+
columns: Array<{
|
|
412
|
+
name: string;
|
|
413
|
+
label?: string;
|
|
414
|
+
dataType?: SemaphorFieldRef['dataType'];
|
|
415
|
+
}>;
|
|
416
|
+
records: Array<Record<string, unknown>>;
|
|
417
|
+
};
|
|
418
|
+
|
|
114
419
|
export declare type SemaphorSourceRef = {
|
|
115
420
|
kind: 'semantic';
|
|
116
421
|
domainId: string;
|
|
@@ -136,13 +441,32 @@ export declare type SemaphorSourceRef = {
|
|
|
136
441
|
|
|
137
442
|
export declare type SemaphorSqlIntent = {
|
|
138
443
|
kind: 'sql';
|
|
444
|
+
version?: SemaphorProtocolVersion;
|
|
445
|
+
id?: string;
|
|
446
|
+
label?: string;
|
|
139
447
|
source: Extract<SemaphorSourceRef, {
|
|
140
|
-
kind: 'sql';
|
|
448
|
+
kind: 'sql' | 'physical';
|
|
141
449
|
}>;
|
|
450
|
+
sql?: string;
|
|
451
|
+
parameters?: Record<string, unknown>;
|
|
452
|
+
pythonCode?: string;
|
|
453
|
+
limit?: number;
|
|
454
|
+
rationale?: string;
|
|
142
455
|
fields?: SemaphorFieldRef[];
|
|
143
456
|
inputs?: SemaphorInputBinding[];
|
|
144
457
|
};
|
|
145
458
|
|
|
459
|
+
export declare type SemaphorSqlResult = SemaphorAnalyticsResultBase & {
|
|
460
|
+
kind: 'sql';
|
|
461
|
+
columns: SemaphorRecordsResult['columns'];
|
|
462
|
+
records: SemaphorRecordsResult['records'];
|
|
463
|
+
sqlShape?: {
|
|
464
|
+
statementType?: string;
|
|
465
|
+
explicitLimit?: number;
|
|
466
|
+
hasPythonCode?: boolean;
|
|
467
|
+
};
|
|
468
|
+
};
|
|
469
|
+
|
|
146
470
|
export declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
147
471
|
|
|
148
472
|
export declare type SemaphorValidationResult = {
|
|
@@ -165,7 +489,7 @@ export declare type SemaphorViewPresentation = {
|
|
|
165
489
|
kind: 'text';
|
|
166
490
|
};
|
|
167
491
|
|
|
168
|
-
export declare function validateSemaphorAnalyticsIntent(intent: SemaphorAnalyticsIntent):
|
|
492
|
+
export declare function validateSemaphorAnalyticsIntent(intent: SemaphorAnalyticsIntent): SemaphorAnalyticsValidationResult;
|
|
169
493
|
|
|
170
494
|
export declare function validateSemaphorDashboardIntent(intent: SemaphorDashboardIntent): SemaphorValidationResult;
|
|
171
495
|
|
|
@@ -496,6 +496,8 @@ declare type DashboardAIContextMode = 'auto' | 'fixed';
|
|
|
496
496
|
|
|
497
497
|
export declare type DashboardAuthoringBreakpoint = (typeof DASHBOARD_AUTHORING_BREAKPOINTS)[number];
|
|
498
498
|
|
|
499
|
+
export declare function dashboardAuthoringDatasetMatchesSource(dataset: unknown, source: SemaphorSourceRef | undefined): boolean;
|
|
500
|
+
|
|
499
501
|
export declare type DashboardAuthoringDatasetRef = {
|
|
500
502
|
kind: 'semantic';
|
|
501
503
|
domainId: string;
|
|
@@ -512,6 +514,17 @@ export declare type DashboardAuthoringDatasetRef = {
|
|
|
512
514
|
label?: string;
|
|
513
515
|
};
|
|
514
516
|
|
|
517
|
+
export declare type DashboardAuthoringDatasetScopeIssue = 'invalid_dataset_count' | 'invalid_multi_dataset_scope';
|
|
518
|
+
|
|
519
|
+
export declare type DashboardAuthoringDatasetScopeResult = {
|
|
520
|
+
ok: true;
|
|
521
|
+
} | {
|
|
522
|
+
ok: false;
|
|
523
|
+
issue: DashboardAuthoringDatasetScopeIssue;
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
export declare function dashboardAuthoringFieldsReferToSameTarget(left: SemaphorFieldRef | undefined, right: SemaphorFieldRef | undefined): boolean;
|
|
527
|
+
|
|
515
528
|
export declare type DashboardAuthoringIdFactory = {
|
|
516
529
|
dashboardId?: () => string;
|
|
517
530
|
sheetId?: () => string;
|
|
@@ -519,18 +532,31 @@ export declare type DashboardAuthoringIdFactory = {
|
|
|
519
532
|
cardId: (seed?: string) => string;
|
|
520
533
|
};
|
|
521
534
|
|
|
535
|
+
export declare function dashboardAuthoringSourceFromField(field: SemaphorFieldRef | undefined, fallback?: SemaphorSourceRef): MaterializableDashboardAuthoringSource | undefined;
|
|
536
|
+
|
|
537
|
+
export declare function dashboardAuthoringSourceKey(source: SemaphorSourceRef): string;
|
|
538
|
+
|
|
539
|
+
export declare function dashboardAuthoringSourcesReferToSameDataset(left: SemaphorSourceRef, right: SemaphorSourceRef): boolean;
|
|
540
|
+
|
|
522
541
|
export declare type DashboardAuthoringValidationResult = {
|
|
523
542
|
ok: boolean;
|
|
524
543
|
errors: DashboardPlanWarning[];
|
|
525
544
|
warnings: DashboardPlanWarning[];
|
|
526
545
|
};
|
|
527
546
|
|
|
547
|
+
export declare type DashboardCardQueryFieldRef = {
|
|
548
|
+
name: string;
|
|
549
|
+
source?: DashboardAuthoringDatasetRef;
|
|
550
|
+
};
|
|
551
|
+
|
|
528
552
|
export declare type DashboardCardQueryIntent = {
|
|
529
553
|
metric?: string;
|
|
530
554
|
metrics?: string[];
|
|
531
555
|
dateField?: string;
|
|
556
|
+
dateFieldRef?: DashboardCardQueryFieldRef;
|
|
532
557
|
timeGrain?: 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
533
558
|
dimensions?: string[];
|
|
559
|
+
dimensionRefs?: DashboardCardQueryFieldRef[];
|
|
534
560
|
limit?: number;
|
|
535
561
|
};
|
|
536
562
|
|
|
@@ -732,6 +758,7 @@ export declare type DashboardPlanCard = {
|
|
|
732
758
|
priority: number;
|
|
733
759
|
section?: string;
|
|
734
760
|
query?: DashboardCardQueryIntent;
|
|
761
|
+
analyticsIntent?: SemaphorAnalyticsIntent;
|
|
735
762
|
text?: string;
|
|
736
763
|
};
|
|
737
764
|
|
|
@@ -773,6 +800,11 @@ export declare type DashboardSuggestion = {
|
|
|
773
800
|
cardCount: number;
|
|
774
801
|
filterCount: number;
|
|
775
802
|
prompt: string;
|
|
803
|
+
datasets?: Array<{
|
|
804
|
+
name: string;
|
|
805
|
+
label?: string;
|
|
806
|
+
}>;
|
|
807
|
+
relationshipHints?: string[];
|
|
776
808
|
};
|
|
777
809
|
|
|
778
810
|
export declare type DashboardSuggestionPreviewKind = 'kpi' | 'line' | 'bar' | 'donut' | 'table';
|
|
@@ -800,6 +832,7 @@ declare interface DataModelEntityReference extends DatabaseEntityReference {
|
|
|
800
832
|
declare interface DatasetEntityReference extends DatabaseEntityReference {
|
|
801
833
|
type: 'dataset';
|
|
802
834
|
datasetType: 'physical' | 'virtual';
|
|
835
|
+
table?: string | null;
|
|
803
836
|
datamodelId?: string | null;
|
|
804
837
|
sql?: string | null;
|
|
805
838
|
id: string;
|
|
@@ -1399,6 +1432,8 @@ declare type FilterSemanticContext = {
|
|
|
1399
1432
|
|
|
1400
1433
|
declare type FilterValue = string | number | boolean | Date | null | [number, number] | [string, string] | string[] | number[];
|
|
1401
1434
|
|
|
1435
|
+
export declare function findDashboardAuthoringDatasetForSource(datasets: readonly DashboardAuthoringDatasetRef[], source: SemaphorSourceRef | undefined): DashboardAuthoringDatasetRef | undefined;
|
|
1436
|
+
|
|
1402
1437
|
/**
|
|
1403
1438
|
* Absolute fixed month/year default used by Month Picker defaults.
|
|
1404
1439
|
* - `month` is 0-indexed (0=January, 11=December) to align with MonthPicker.
|
|
@@ -1432,6 +1467,16 @@ declare type FormatSpec = {
|
|
|
1432
1467
|
sourceTimezone?: string;
|
|
1433
1468
|
prefix?: string;
|
|
1434
1469
|
suffix?: string;
|
|
1470
|
+
} | {
|
|
1471
|
+
type: 'duration';
|
|
1472
|
+
inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
|
|
1473
|
+
outputStyle?: 'compact' | 'digital' | 'long';
|
|
1474
|
+
largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
|
|
1475
|
+
smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
|
|
1476
|
+
maxUnits?: number;
|
|
1477
|
+
prefix?: string;
|
|
1478
|
+
suffix?: string;
|
|
1479
|
+
negativeStyle?: 'minus' | 'parentheses';
|
|
1435
1480
|
} | {
|
|
1436
1481
|
type: 'string';
|
|
1437
1482
|
prefix?: string;
|
|
@@ -1446,6 +1491,8 @@ export declare type GeneratedDashboardCardArtifact = {
|
|
|
1446
1491
|
warnings?: DashboardPlanWarning[];
|
|
1447
1492
|
};
|
|
1448
1493
|
|
|
1494
|
+
export declare function getDashboardAuthoringCardSource(card: Pick<DashboardPlanCard, 'analyticsIntent'>): SemaphorSourceRef | undefined;
|
|
1495
|
+
|
|
1449
1496
|
declare type Granularity = 'day' | 'week' | 'month' | 'quarter' | 'year' | 'hour' | 'minute' | 'second';
|
|
1450
1497
|
|
|
1451
1498
|
declare interface GroupByColumn extends BaseColumn {
|
|
@@ -1543,6 +1590,10 @@ declare interface InteractionTrigger {
|
|
|
1543
1590
|
field: Field;
|
|
1544
1591
|
}
|
|
1545
1592
|
|
|
1593
|
+
export declare function isMaterializableDashboardAuthoringSource(value: unknown): value is MaterializableDashboardAuthoringSource;
|
|
1594
|
+
|
|
1595
|
+
export declare function isSemaphorSourceRef(value: unknown): value is SemaphorSourceRef;
|
|
1596
|
+
|
|
1546
1597
|
declare interface Join {
|
|
1547
1598
|
id: string;
|
|
1548
1599
|
source: DatabaseEntityReference;
|
|
@@ -1583,6 +1634,12 @@ declare interface LinkFormat {
|
|
|
1583
1634
|
|
|
1584
1635
|
declare type LogicalOperator = 'AND' | 'OR';
|
|
1585
1636
|
|
|
1637
|
+
export declare type MaterializableDashboardAuthoringSource = Extract<SemaphorSourceRef, {
|
|
1638
|
+
kind: 'semantic' | 'physical';
|
|
1639
|
+
}>;
|
|
1640
|
+
|
|
1641
|
+
export declare function mergeDashboardAuthoringSources(sources: readonly SemaphorSourceRef[]): SemaphorSourceRef[];
|
|
1642
|
+
|
|
1586
1643
|
declare interface MetricColumn extends BaseColumn {
|
|
1587
1644
|
role: 'metric';
|
|
1588
1645
|
aggregate: AggregateFunction;
|
|
@@ -1714,6 +1771,10 @@ declare interface PivotByField extends Field {
|
|
|
1714
1771
|
role: 'pivotby';
|
|
1715
1772
|
}
|
|
1716
1773
|
|
|
1774
|
+
export declare function preferDashboardAuthoringSourceMetadata(current: SemaphorSourceRef, next: SemaphorSourceRef): SemaphorSourceRef;
|
|
1775
|
+
|
|
1776
|
+
export declare function preferredDashboardAuthoringSource(sources: readonly SemaphorSourceRef[]): SemaphorSourceRef | undefined;
|
|
1777
|
+
|
|
1717
1778
|
declare interface QueryConfig {
|
|
1718
1779
|
groupByColumns?: GroupByColumn[];
|
|
1719
1780
|
pivotColumns?: GroupByColumn[];
|
|
@@ -1755,6 +1816,13 @@ declare type RelativeDateFilter = {
|
|
|
1755
1816
|
to: number;
|
|
1756
1817
|
};
|
|
1757
1818
|
|
|
1819
|
+
export declare function resolveDashboardAuthoringSource({ explicitSource, field, defaultSource, fallbackSources, }: {
|
|
1820
|
+
explicitSource?: unknown;
|
|
1821
|
+
field?: SemaphorFieldRef;
|
|
1822
|
+
defaultSource?: SemaphorSourceRef;
|
|
1823
|
+
fallbackSources?: readonly SemaphorSourceRef[];
|
|
1824
|
+
}): MaterializableDashboardAuthoringSource | undefined;
|
|
1825
|
+
|
|
1758
1826
|
declare type SelectedEntities = SelectedEntity[];
|
|
1759
1827
|
|
|
1760
1828
|
declare type SelectedEntity = DatabaseEntityReference | DataModelEntityReference | DatasetEntityReference | FileEntityReference;
|
|
@@ -1793,6 +1861,7 @@ declare type SemaphorFieldRef = {
|
|
|
1793
1861
|
label?: string;
|
|
1794
1862
|
role?: 'dimension' | 'measure' | 'date' | 'id' | 'unknown';
|
|
1795
1863
|
dataType?: 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'unknown';
|
|
1864
|
+
source?: SemaphorSourceRef;
|
|
1796
1865
|
};
|
|
1797
1866
|
|
|
1798
1867
|
declare type SemaphorInputBinding = {
|
|
@@ -1804,6 +1873,9 @@ declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' |
|
|
|
1804
1873
|
|
|
1805
1874
|
declare type SemaphorInputOptionsIntent = {
|
|
1806
1875
|
kind: 'inputOptions';
|
|
1876
|
+
version?: SemaphorProtocolVersion;
|
|
1877
|
+
id?: string;
|
|
1878
|
+
label?: string;
|
|
1807
1879
|
source: SemaphorSourceRef;
|
|
1808
1880
|
field: SemaphorFieldRef;
|
|
1809
1881
|
search?: string;
|
|
@@ -1836,22 +1908,31 @@ declare type SemaphorInputSpec = {
|
|
|
1836
1908
|
|
|
1837
1909
|
declare type SemaphorMetricIntent = {
|
|
1838
1910
|
kind: 'metric';
|
|
1911
|
+
version?: SemaphorProtocolVersion;
|
|
1912
|
+
id?: string;
|
|
1839
1913
|
source: SemaphorSourceRef;
|
|
1840
1914
|
metric: string;
|
|
1915
|
+
metrics?: string[];
|
|
1841
1916
|
label?: string;
|
|
1842
1917
|
dateField?: SemaphorFieldRef;
|
|
1918
|
+
timeGrain?: SemaphorTimeGrain;
|
|
1919
|
+
dimensions?: SemaphorFieldRef[];
|
|
1843
1920
|
comparison?: {
|
|
1844
1921
|
kind: 'previous_period' | 'previous_year' | 'target';
|
|
1845
1922
|
targetValue?: number;
|
|
1846
1923
|
};
|
|
1847
1924
|
inputs?: SemaphorInputBinding[];
|
|
1925
|
+
limit?: number;
|
|
1848
1926
|
};
|
|
1849
1927
|
|
|
1850
1928
|
declare type SemaphorProtocolVersion = 1;
|
|
1851
1929
|
|
|
1852
1930
|
declare type SemaphorRecordsIntent = {
|
|
1853
1931
|
kind: 'records';
|
|
1932
|
+
version?: SemaphorProtocolVersion;
|
|
1854
1933
|
source: SemaphorSourceRef;
|
|
1934
|
+
id?: string;
|
|
1935
|
+
label?: string;
|
|
1855
1936
|
fields: SemaphorFieldRef[];
|
|
1856
1937
|
measures?: string[];
|
|
1857
1938
|
dateField?: SemaphorFieldRef;
|
|
@@ -1889,9 +1970,17 @@ declare type SemaphorSourceRef = {
|
|
|
1889
1970
|
|
|
1890
1971
|
declare type SemaphorSqlIntent = {
|
|
1891
1972
|
kind: 'sql';
|
|
1973
|
+
version?: SemaphorProtocolVersion;
|
|
1974
|
+
id?: string;
|
|
1975
|
+
label?: string;
|
|
1892
1976
|
source: Extract<SemaphorSourceRef, {
|
|
1893
|
-
kind: 'sql';
|
|
1977
|
+
kind: 'sql' | 'physical';
|
|
1894
1978
|
}>;
|
|
1979
|
+
sql?: string;
|
|
1980
|
+
parameters?: Record<string, unknown>;
|
|
1981
|
+
pythonCode?: string;
|
|
1982
|
+
limit?: number;
|
|
1983
|
+
rationale?: string;
|
|
1895
1984
|
fields?: SemaphorFieldRef[];
|
|
1896
1985
|
inputs?: SemaphorInputBinding[];
|
|
1897
1986
|
};
|
|
@@ -2463,7 +2552,7 @@ declare type TDataLabelsConfig = {
|
|
|
2463
2552
|
display?: 'auto' | boolean;
|
|
2464
2553
|
formatMode?: 'inherit' | 'override';
|
|
2465
2554
|
/** @deprecated Use formatMode + formatOptions.type */
|
|
2466
|
-
format?: 'auto' | 'number' | 'currency' | 'percent' | 'date' | 'scientific' | 'none';
|
|
2555
|
+
format?: 'auto' | 'number' | 'currency' | 'percent' | 'date' | 'scientific' | 'duration' | 'none';
|
|
2467
2556
|
formatOptions?: TFormatOptions;
|
|
2468
2557
|
font?: {
|
|
2469
2558
|
size?: number;
|
|
@@ -2601,7 +2690,7 @@ declare type TFilter = {
|
|
|
2601
2690
|
declare type TFilterValue = FilterForString | FilterForEqual | FilterForCompare | FilterForBetween | FilterForIn | FilterForNull | FilterForDate;
|
|
2602
2691
|
|
|
2603
2692
|
declare type TFormatOptions = {
|
|
2604
|
-
type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date';
|
|
2693
|
+
type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date' | 'duration';
|
|
2605
2694
|
decimalPlaces?: number;
|
|
2606
2695
|
minimumFractionDigits?: number;
|
|
2607
2696
|
maximumFractionDigits?: number;
|
|
@@ -2618,6 +2707,11 @@ declare type TFormatOptions = {
|
|
|
2618
2707
|
timezone?: string;
|
|
2619
2708
|
sourceTimezone?: string;
|
|
2620
2709
|
relative?: boolean;
|
|
2710
|
+
durationInputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
|
|
2711
|
+
durationDisplayStyle?: 'compact' | 'digital' | 'long';
|
|
2712
|
+
durationLargestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
|
|
2713
|
+
durationSmallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
|
|
2714
|
+
durationMaxUnits?: number;
|
|
2621
2715
|
};
|
|
2622
2716
|
|
|
2623
2717
|
declare type TFrame = {
|
|
@@ -2798,6 +2892,11 @@ declare interface URLParameter {
|
|
|
2798
2892
|
field?: Field;
|
|
2799
2893
|
}
|
|
2800
2894
|
|
|
2895
|
+
export declare function validateDashboardAuthoringDatasetScope({ datasets, requireAtLeastOne, }: {
|
|
2896
|
+
datasets: readonly unknown[];
|
|
2897
|
+
requireAtLeastOne: boolean;
|
|
2898
|
+
}): DashboardAuthoringDatasetScopeResult;
|
|
2899
|
+
|
|
2801
2900
|
export declare function validateDashboardChangePlan(plan: DashboardChangePlan): DashboardAuthoringValidationResult;
|
|
2802
2901
|
|
|
2803
2902
|
export declare function validateDashboardPlan(plan: DashboardPlan): DashboardAuthoringValidationResult;
|