react-semaphor 0.1.324 → 0.1.326
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 -0
- package/dist/analytics-protocol/index.js +274 -0
- package/dist/brand-studio/index.cjs +2 -2
- package/dist/brand-studio/index.js +7 -6
- package/dist/chunks/{braces-C7BeIXvM.js → braces-DVaMJoCd.js} +1 -1
- package/dist/chunks/{braces-ZjRH2Kl7.js → braces-dHeaioTd.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-B9Hz3pTH.js → calendar-preferences-dialog--2jD-eKu.js} +6 -5
- package/dist/chunks/calendar-preferences-dialog-mqU_uOmY.js +1 -0
- package/dist/chunks/{chevrons-up-down-CA-XvN1o.js → chevrons-up-down-CLbzBHoI.js} +1 -1
- package/dist/chunks/{chevrons-up-down-Cuilz9aY.js → chevrons-up-down-DNQE-uEp.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-COLpvReF.js → dashboard-briefing-launcher-DguNfFr8.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CUEn7cr6.js → dashboard-briefing-launcher-DsjXUPFq.js} +29 -28
- package/dist/chunks/{dashboard-controls-CLShFyUq.js → dashboard-controls-DgNkM1yT.js} +10 -9
- package/dist/chunks/{dashboard-controls-DH8gdpOc.js → dashboard-controls-XCa9PZuU.js} +1 -1
- package/dist/chunks/dashboard-json-DiBd65Xf.js +1 -0
- package/dist/chunks/{dashboard-json-Db0DpTMw.js → dashboard-json-DkA6Bf0Y.js} +7 -6
- package/dist/chunks/{edit-dashboard-visual-Cc3xpTNQ.js → edit-dashboard-visual-BC9eOc4U.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-DmMKWtln.js → edit-dashboard-visual-Q5hW5MXk.js} +11 -9
- package/dist/chunks/index-B1-46PoR.js +1303 -0
- package/dist/chunks/index-BxM99sFL.js +1 -0
- package/dist/chunks/index-CuHybtft.js +51 -0
- package/dist/chunks/{index-PTx7430W.js → index-DwfDwtv2.js} +33456 -32921
- package/dist/chunks/{palette-CanPG11m.js → palette-DpcvHAiY.js} +1 -1
- package/dist/chunks/{palette-D96DOM7E.js → palette-DtmNws9a.js} +1 -1
- package/dist/chunks/{resource-management-panel-DR7Ku6sa.js → resource-management-panel-CGwWKZOP.js} +1 -1
- package/dist/chunks/{resource-management-panel-C1mbF-2a.js → resource-management-panel-D2oAQkKi.js} +6 -5
- package/dist/chunks/{save-DxkSzUTZ.js → save-BY7WF62U.js} +1 -1
- package/dist/chunks/{save-CqrBQKG6.js → save-Cv_XRb94.js} +1 -1
- package/dist/chunks/{switch-BXICAlvS.js → switch-5aQ_jcLH.js} +39 -39
- package/dist/chunks/{switch-Deo2Ltmj.js → switch-j3AThLFk.js} +2580 -2628
- package/dist/chunks/{use-create-flow-overlay-state-CmxTpqeg.js → use-create-flow-overlay-state-BQPXP0AM.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-B65gg2oB.js → use-create-flow-overlay-state-CP6GDQAX.js} +29 -28
- package/dist/chunks/{use-visual-utils-Diuguy3D.js → use-visual-utils-CSXU-96k.js} +2 -2
- package/dist/chunks/{use-visual-utils-51Nsy8cj.js → use-visual-utils-NpOW5uZ1.js} +1 -1
- package/dist/chunks/validators-DJUMR5An.js +2 -0
- package/dist/chunks/validators-DvTxl9i0.js +352 -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 +857 -310
- package/dist/data-app-sdk/index.cjs +1 -0
- package/dist/data-app-sdk/index.js +512 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +141 -140
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/analytics-protocol.d.ts +495 -0
- package/dist/types/dashboard-authoring.d.ts +183 -0
- package/dist/types/dashboard.d.ts +6 -1
- package/dist/types/data-app-sdk.d.ts +378 -0
- package/dist/types/main.d.ts +118 -2
- package/dist/types/shared.d.ts +1 -0
- package/dist/types/surfboard.d.ts +6 -1
- package/dist/types/types.d.ts +6 -1
- package/package.json +11 -1
- package/dist/chunks/calendar-preferences-dialog-CLXaVo3h.js +0 -1
- package/dist/chunks/dashboard-json-eGBWfSN1.js +0 -1
- package/dist/chunks/index-CMS4bp9G.js +0 -1303
|
@@ -0,0 +1,495 @@
|
|
|
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
|
+
|
|
222
|
+
export declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent;
|
|
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
|
+
|
|
263
|
+
export declare type SemaphorDashboardIntent = {
|
|
264
|
+
version: SemaphorProtocolVersion;
|
|
265
|
+
kind: 'dashboard';
|
|
266
|
+
title: string;
|
|
267
|
+
description?: string;
|
|
268
|
+
inputs?: SemaphorInputSpec[];
|
|
269
|
+
sections: SemaphorDashboardSectionIntent[];
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
export declare type SemaphorDashboardSectionIntent = {
|
|
273
|
+
id?: string;
|
|
274
|
+
title: string;
|
|
275
|
+
description?: string;
|
|
276
|
+
views: SemaphorDashboardViewIntent[];
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
export declare type SemaphorDashboardViewIntent = {
|
|
280
|
+
id?: string;
|
|
281
|
+
title: string;
|
|
282
|
+
description?: string;
|
|
283
|
+
presentation: SemaphorViewPresentation;
|
|
284
|
+
analytics?: SemaphorAnalyticsIntent;
|
|
285
|
+
text?: string;
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
export declare type SemaphorDialect = 'semantic' | 'postgres' | 'mysql' | 'snowflake' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
|
|
289
|
+
|
|
290
|
+
export declare type SemaphorExperienceIntent = SemaphorDashboardIntent;
|
|
291
|
+
|
|
292
|
+
export declare type SemaphorFieldRef = {
|
|
293
|
+
name: string;
|
|
294
|
+
label?: string;
|
|
295
|
+
role?: 'dimension' | 'measure' | 'date' | 'id' | 'unknown';
|
|
296
|
+
dataType?: 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'unknown';
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
export declare type SemaphorInputBinding = {
|
|
300
|
+
inputId: string;
|
|
301
|
+
field?: SemaphorFieldRef;
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
export declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'between' | '>' | '>=' | '<' | '<=';
|
|
305
|
+
|
|
306
|
+
export declare type SemaphorInputOptionsIntent = {
|
|
307
|
+
kind: 'inputOptions';
|
|
308
|
+
version?: SemaphorProtocolVersion;
|
|
309
|
+
id?: string;
|
|
310
|
+
label?: string;
|
|
311
|
+
source: SemaphorSourceRef;
|
|
312
|
+
field: SemaphorFieldRef;
|
|
313
|
+
search?: string;
|
|
314
|
+
limit?: number;
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
export declare type SemaphorInputOptionsResult = SemaphorAnalyticsResultBase & {
|
|
318
|
+
kind: 'inputOptions';
|
|
319
|
+
options: Array<{
|
|
320
|
+
label: string;
|
|
321
|
+
value: unknown;
|
|
322
|
+
count?: number;
|
|
323
|
+
}>;
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
export declare type SemaphorInputScope = {
|
|
327
|
+
level: 'dashboard';
|
|
328
|
+
excludeViewIds?: string[];
|
|
329
|
+
} | {
|
|
330
|
+
level: 'section';
|
|
331
|
+
sectionId: string;
|
|
332
|
+
excludeViewIds?: string[];
|
|
333
|
+
} | {
|
|
334
|
+
level: 'view';
|
|
335
|
+
viewIds: string[];
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
export declare type SemaphorInputSpec = {
|
|
339
|
+
id: string;
|
|
340
|
+
kind: 'filter' | 'control';
|
|
341
|
+
label: string;
|
|
342
|
+
field: SemaphorFieldRef;
|
|
343
|
+
operator?: SemaphorInputOperator;
|
|
344
|
+
multi?: boolean;
|
|
345
|
+
defaultValue?: unknown;
|
|
346
|
+
source?: SemaphorSourceRef;
|
|
347
|
+
scope?: SemaphorInputScope;
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
export declare type SemaphorMetricIntent = {
|
|
351
|
+
kind: 'metric';
|
|
352
|
+
version?: SemaphorProtocolVersion;
|
|
353
|
+
id?: string;
|
|
354
|
+
source: SemaphorSourceRef;
|
|
355
|
+
metric: string;
|
|
356
|
+
metrics?: string[];
|
|
357
|
+
label?: string;
|
|
358
|
+
dateField?: SemaphorFieldRef;
|
|
359
|
+
timeGrain?: SemaphorTimeGrain;
|
|
360
|
+
dimensions?: SemaphorFieldRef[];
|
|
361
|
+
comparison?: {
|
|
362
|
+
kind: 'previous_period' | 'previous_year' | 'target';
|
|
363
|
+
targetValue?: number;
|
|
364
|
+
};
|
|
365
|
+
inputs?: SemaphorInputBinding[];
|
|
366
|
+
limit?: number;
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
export declare type SemaphorMetricResult = SemaphorAnalyticsResultBase & {
|
|
370
|
+
kind: 'metric';
|
|
371
|
+
value: number | string | null;
|
|
372
|
+
comparison?: {
|
|
373
|
+
kind: NonNullable<SemaphorMetricIntent['comparison']>['kind'];
|
|
374
|
+
value?: number | string | null;
|
|
375
|
+
delta?: number | null;
|
|
376
|
+
deltaPercent?: number | null;
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
export declare type SemaphorProtocolIssue = {
|
|
381
|
+
code: string;
|
|
382
|
+
message: string;
|
|
383
|
+
path?: string;
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
export declare type SemaphorProtocolVersion = 1;
|
|
387
|
+
|
|
388
|
+
export declare type SemaphorQueryPath = 'query_spec' | 'sql' | 'sql_python';
|
|
389
|
+
|
|
390
|
+
export declare type SemaphorRecordsIntent = {
|
|
391
|
+
kind: 'records';
|
|
392
|
+
version?: SemaphorProtocolVersion;
|
|
393
|
+
source: SemaphorSourceRef;
|
|
394
|
+
id?: string;
|
|
395
|
+
label?: string;
|
|
396
|
+
fields: SemaphorFieldRef[];
|
|
397
|
+
measures?: string[];
|
|
398
|
+
dateField?: SemaphorFieldRef;
|
|
399
|
+
timeGrain?: SemaphorTimeGrain;
|
|
400
|
+
limit?: number;
|
|
401
|
+
orderBy?: {
|
|
402
|
+
field: string;
|
|
403
|
+
direction: 'asc' | 'desc';
|
|
404
|
+
};
|
|
405
|
+
inputs?: SemaphorInputBinding[];
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
export declare type SemaphorRecordsResult = SemaphorAnalyticsResultBase & {
|
|
409
|
+
kind: 'records';
|
|
410
|
+
columns: Array<{
|
|
411
|
+
name: string;
|
|
412
|
+
label?: string;
|
|
413
|
+
dataType?: SemaphorFieldRef['dataType'];
|
|
414
|
+
}>;
|
|
415
|
+
records: Array<Record<string, unknown>>;
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
export declare type SemaphorSourceRef = {
|
|
419
|
+
kind: 'semantic';
|
|
420
|
+
domainId: string;
|
|
421
|
+
datasetName: string;
|
|
422
|
+
datasetId?: string;
|
|
423
|
+
label?: string;
|
|
424
|
+
connectionId?: string;
|
|
425
|
+
} | {
|
|
426
|
+
kind: 'physical';
|
|
427
|
+
connectionId: string;
|
|
428
|
+
tableName: string;
|
|
429
|
+
databaseName?: string;
|
|
430
|
+
schemaName?: string;
|
|
431
|
+
label?: string;
|
|
432
|
+
dialect?: SemaphorDialect;
|
|
433
|
+
} | {
|
|
434
|
+
kind: 'sql';
|
|
435
|
+
connectionId: string;
|
|
436
|
+
sql: string;
|
|
437
|
+
dialect?: SemaphorDialect;
|
|
438
|
+
label?: string;
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
export declare type SemaphorSqlIntent = {
|
|
442
|
+
kind: 'sql';
|
|
443
|
+
version?: SemaphorProtocolVersion;
|
|
444
|
+
id?: string;
|
|
445
|
+
label?: string;
|
|
446
|
+
source: Extract<SemaphorSourceRef, {
|
|
447
|
+
kind: 'sql' | 'physical';
|
|
448
|
+
}>;
|
|
449
|
+
sql?: string;
|
|
450
|
+
parameters?: Record<string, unknown>;
|
|
451
|
+
pythonCode?: string;
|
|
452
|
+
limit?: number;
|
|
453
|
+
rationale?: string;
|
|
454
|
+
fields?: SemaphorFieldRef[];
|
|
455
|
+
inputs?: SemaphorInputBinding[];
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
export declare type SemaphorSqlResult = SemaphorAnalyticsResultBase & {
|
|
459
|
+
kind: 'sql';
|
|
460
|
+
columns: SemaphorRecordsResult['columns'];
|
|
461
|
+
records: SemaphorRecordsResult['records'];
|
|
462
|
+
sqlShape?: {
|
|
463
|
+
statementType?: string;
|
|
464
|
+
explicitLimit?: number;
|
|
465
|
+
hasPythonCode?: boolean;
|
|
466
|
+
};
|
|
467
|
+
};
|
|
468
|
+
|
|
469
|
+
export declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
470
|
+
|
|
471
|
+
export declare type SemaphorValidationResult = {
|
|
472
|
+
ok: boolean;
|
|
473
|
+
errors: SemaphorProtocolIssue[];
|
|
474
|
+
warnings: SemaphorProtocolIssue[];
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
export declare type SemaphorViewPresentation = {
|
|
478
|
+
kind: 'kpi';
|
|
479
|
+
format?: 'number' | 'currency' | 'percent' | 'duration';
|
|
480
|
+
} | {
|
|
481
|
+
kind: 'lineChart' | 'barChart' | 'areaChart';
|
|
482
|
+
x?: string;
|
|
483
|
+
y?: string[];
|
|
484
|
+
} | {
|
|
485
|
+
kind: 'table';
|
|
486
|
+
columns?: string[];
|
|
487
|
+
} | {
|
|
488
|
+
kind: 'text';
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
export declare function validateSemaphorAnalyticsIntent(intent: SemaphorAnalyticsIntent): SemaphorAnalyticsValidationResult;
|
|
492
|
+
|
|
493
|
+
export declare function validateSemaphorDashboardIntent(intent: SemaphorDashboardIntent): SemaphorValidationResult;
|
|
494
|
+
|
|
495
|
+
export { }
|
|
@@ -732,6 +732,7 @@ export declare type DashboardPlanCard = {
|
|
|
732
732
|
priority: number;
|
|
733
733
|
section?: string;
|
|
734
734
|
query?: DashboardCardQueryIntent;
|
|
735
|
+
analyticsIntent?: SemaphorAnalyticsIntent;
|
|
735
736
|
text?: string;
|
|
736
737
|
};
|
|
737
738
|
|
|
@@ -739,10 +740,18 @@ export declare type DashboardPlanFilterInput = {
|
|
|
739
740
|
id: string;
|
|
740
741
|
label: string;
|
|
741
742
|
variableName: string;
|
|
743
|
+
scope?: DashboardInputScope;
|
|
742
744
|
filter: TFilter;
|
|
743
745
|
defaultValue?: unknown;
|
|
744
746
|
};
|
|
745
747
|
|
|
748
|
+
export declare type DashboardPlanFromProtocolResult = {
|
|
749
|
+
plan: DashboardPlan;
|
|
750
|
+
warnings: DashboardPlanWarning[];
|
|
751
|
+
};
|
|
752
|
+
|
|
753
|
+
export declare function dashboardPlanFromSemaphorDashboardIntent(intent: SemaphorDashboardIntent): DashboardPlanFromProtocolResult;
|
|
754
|
+
|
|
746
755
|
export declare type DashboardPlanSheet = {
|
|
747
756
|
id: string;
|
|
748
757
|
title: string;
|
|
@@ -792,6 +801,7 @@ declare interface DataModelEntityReference extends DatabaseEntityReference {
|
|
|
792
801
|
declare interface DatasetEntityReference extends DatabaseEntityReference {
|
|
793
802
|
type: 'dataset';
|
|
794
803
|
datasetType: 'physical' | 'virtual';
|
|
804
|
+
table?: string | null;
|
|
795
805
|
datamodelId?: string | null;
|
|
796
806
|
sql?: string | null;
|
|
797
807
|
id: string;
|
|
@@ -1751,6 +1761,179 @@ declare type SelectedEntities = SelectedEntity[];
|
|
|
1751
1761
|
|
|
1752
1762
|
declare type SelectedEntity = DatabaseEntityReference | DataModelEntityReference | DatasetEntityReference | FileEntityReference;
|
|
1753
1763
|
|
|
1764
|
+
declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent;
|
|
1765
|
+
|
|
1766
|
+
declare type SemaphorDashboardIntent = {
|
|
1767
|
+
version: SemaphorProtocolVersion;
|
|
1768
|
+
kind: 'dashboard';
|
|
1769
|
+
title: string;
|
|
1770
|
+
description?: string;
|
|
1771
|
+
inputs?: SemaphorInputSpec[];
|
|
1772
|
+
sections: SemaphorDashboardSectionIntent[];
|
|
1773
|
+
};
|
|
1774
|
+
|
|
1775
|
+
declare type SemaphorDashboardSectionIntent = {
|
|
1776
|
+
id?: string;
|
|
1777
|
+
title: string;
|
|
1778
|
+
description?: string;
|
|
1779
|
+
views: SemaphorDashboardViewIntent[];
|
|
1780
|
+
};
|
|
1781
|
+
|
|
1782
|
+
declare type SemaphorDashboardViewIntent = {
|
|
1783
|
+
id?: string;
|
|
1784
|
+
title: string;
|
|
1785
|
+
description?: string;
|
|
1786
|
+
presentation: SemaphorViewPresentation;
|
|
1787
|
+
analytics?: SemaphorAnalyticsIntent;
|
|
1788
|
+
text?: string;
|
|
1789
|
+
};
|
|
1790
|
+
|
|
1791
|
+
declare type SemaphorDialect = 'semantic' | 'postgres' | 'mysql' | 'snowflake' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
|
|
1792
|
+
|
|
1793
|
+
declare type SemaphorFieldRef = {
|
|
1794
|
+
name: string;
|
|
1795
|
+
label?: string;
|
|
1796
|
+
role?: 'dimension' | 'measure' | 'date' | 'id' | 'unknown';
|
|
1797
|
+
dataType?: 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'unknown';
|
|
1798
|
+
};
|
|
1799
|
+
|
|
1800
|
+
declare type SemaphorInputBinding = {
|
|
1801
|
+
inputId: string;
|
|
1802
|
+
field?: SemaphorFieldRef;
|
|
1803
|
+
};
|
|
1804
|
+
|
|
1805
|
+
declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'between' | '>' | '>=' | '<' | '<=';
|
|
1806
|
+
|
|
1807
|
+
declare type SemaphorInputOptionsIntent = {
|
|
1808
|
+
kind: 'inputOptions';
|
|
1809
|
+
version?: SemaphorProtocolVersion;
|
|
1810
|
+
id?: string;
|
|
1811
|
+
label?: string;
|
|
1812
|
+
source: SemaphorSourceRef;
|
|
1813
|
+
field: SemaphorFieldRef;
|
|
1814
|
+
search?: string;
|
|
1815
|
+
limit?: number;
|
|
1816
|
+
};
|
|
1817
|
+
|
|
1818
|
+
declare type SemaphorInputScope = {
|
|
1819
|
+
level: 'dashboard';
|
|
1820
|
+
excludeViewIds?: string[];
|
|
1821
|
+
} | {
|
|
1822
|
+
level: 'section';
|
|
1823
|
+
sectionId: string;
|
|
1824
|
+
excludeViewIds?: string[];
|
|
1825
|
+
} | {
|
|
1826
|
+
level: 'view';
|
|
1827
|
+
viewIds: string[];
|
|
1828
|
+
};
|
|
1829
|
+
|
|
1830
|
+
declare type SemaphorInputSpec = {
|
|
1831
|
+
id: string;
|
|
1832
|
+
kind: 'filter' | 'control';
|
|
1833
|
+
label: string;
|
|
1834
|
+
field: SemaphorFieldRef;
|
|
1835
|
+
operator?: SemaphorInputOperator;
|
|
1836
|
+
multi?: boolean;
|
|
1837
|
+
defaultValue?: unknown;
|
|
1838
|
+
source?: SemaphorSourceRef;
|
|
1839
|
+
scope?: SemaphorInputScope;
|
|
1840
|
+
};
|
|
1841
|
+
|
|
1842
|
+
declare type SemaphorMetricIntent = {
|
|
1843
|
+
kind: 'metric';
|
|
1844
|
+
version?: SemaphorProtocolVersion;
|
|
1845
|
+
id?: string;
|
|
1846
|
+
source: SemaphorSourceRef;
|
|
1847
|
+
metric: string;
|
|
1848
|
+
metrics?: string[];
|
|
1849
|
+
label?: string;
|
|
1850
|
+
dateField?: SemaphorFieldRef;
|
|
1851
|
+
timeGrain?: SemaphorTimeGrain;
|
|
1852
|
+
dimensions?: SemaphorFieldRef[];
|
|
1853
|
+
comparison?: {
|
|
1854
|
+
kind: 'previous_period' | 'previous_year' | 'target';
|
|
1855
|
+
targetValue?: number;
|
|
1856
|
+
};
|
|
1857
|
+
inputs?: SemaphorInputBinding[];
|
|
1858
|
+
limit?: number;
|
|
1859
|
+
};
|
|
1860
|
+
|
|
1861
|
+
declare type SemaphorProtocolVersion = 1;
|
|
1862
|
+
|
|
1863
|
+
declare type SemaphorRecordsIntent = {
|
|
1864
|
+
kind: 'records';
|
|
1865
|
+
version?: SemaphorProtocolVersion;
|
|
1866
|
+
source: SemaphorSourceRef;
|
|
1867
|
+
id?: string;
|
|
1868
|
+
label?: string;
|
|
1869
|
+
fields: SemaphorFieldRef[];
|
|
1870
|
+
measures?: string[];
|
|
1871
|
+
dateField?: SemaphorFieldRef;
|
|
1872
|
+
timeGrain?: SemaphorTimeGrain;
|
|
1873
|
+
limit?: number;
|
|
1874
|
+
orderBy?: {
|
|
1875
|
+
field: string;
|
|
1876
|
+
direction: 'asc' | 'desc';
|
|
1877
|
+
};
|
|
1878
|
+
inputs?: SemaphorInputBinding[];
|
|
1879
|
+
};
|
|
1880
|
+
|
|
1881
|
+
declare type SemaphorSourceRef = {
|
|
1882
|
+
kind: 'semantic';
|
|
1883
|
+
domainId: string;
|
|
1884
|
+
datasetName: string;
|
|
1885
|
+
datasetId?: string;
|
|
1886
|
+
label?: string;
|
|
1887
|
+
connectionId?: string;
|
|
1888
|
+
} | {
|
|
1889
|
+
kind: 'physical';
|
|
1890
|
+
connectionId: string;
|
|
1891
|
+
tableName: string;
|
|
1892
|
+
databaseName?: string;
|
|
1893
|
+
schemaName?: string;
|
|
1894
|
+
label?: string;
|
|
1895
|
+
dialect?: SemaphorDialect;
|
|
1896
|
+
} | {
|
|
1897
|
+
kind: 'sql';
|
|
1898
|
+
connectionId: string;
|
|
1899
|
+
sql: string;
|
|
1900
|
+
dialect?: SemaphorDialect;
|
|
1901
|
+
label?: string;
|
|
1902
|
+
};
|
|
1903
|
+
|
|
1904
|
+
declare type SemaphorSqlIntent = {
|
|
1905
|
+
kind: 'sql';
|
|
1906
|
+
version?: SemaphorProtocolVersion;
|
|
1907
|
+
id?: string;
|
|
1908
|
+
label?: string;
|
|
1909
|
+
source: Extract<SemaphorSourceRef, {
|
|
1910
|
+
kind: 'sql' | 'physical';
|
|
1911
|
+
}>;
|
|
1912
|
+
sql?: string;
|
|
1913
|
+
parameters?: Record<string, unknown>;
|
|
1914
|
+
pythonCode?: string;
|
|
1915
|
+
limit?: number;
|
|
1916
|
+
rationale?: string;
|
|
1917
|
+
fields?: SemaphorFieldRef[];
|
|
1918
|
+
inputs?: SemaphorInputBinding[];
|
|
1919
|
+
};
|
|
1920
|
+
|
|
1921
|
+
declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
1922
|
+
|
|
1923
|
+
declare type SemaphorViewPresentation = {
|
|
1924
|
+
kind: 'kpi';
|
|
1925
|
+
format?: 'number' | 'currency' | 'percent' | 'duration';
|
|
1926
|
+
} | {
|
|
1927
|
+
kind: 'lineChart' | 'barChart' | 'areaChart';
|
|
1928
|
+
x?: string;
|
|
1929
|
+
y?: string[];
|
|
1930
|
+
} | {
|
|
1931
|
+
kind: 'table';
|
|
1932
|
+
columns?: string[];
|
|
1933
|
+
} | {
|
|
1934
|
+
kind: 'text';
|
|
1935
|
+
};
|
|
1936
|
+
|
|
1754
1937
|
declare interface SortByField extends Field {
|
|
1755
1938
|
role: 'sortby';
|
|
1756
1939
|
direction: 'asc' | 'desc';
|