@accurix/centrinfo-widget 5.1.2 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -8
- package/dist/cdn/centrinfo-widget-charts.js +5352 -4683
- package/dist/cdn/centrinfo-widget.js +169 -137
- package/dist/cdn/manifest.json +9 -9
- package/dist/echarts-runtime-CoBDVO7m.mjs +18 -0
- package/dist/echarts-runtime-w0DrsYLy.cjs +24 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/runtime.cjs +2 -2
- package/dist/runtime.d.cts +48 -140
- package/dist/runtime.d.mts +42 -5
- package/dist/runtime.mjs +2 -2
- package/dist/styles-CCw1cP6m.cjs +3543 -0
- package/dist/styles-CiqV_OsG.mjs +3543 -0
- package/dist/{types-BuoTcoZu.d.cts → types-95uGbSpk.d.mts} +341 -16
- package/dist/{types-3zpBBhPI.d.mts → types-DAYxNBhI.d.cts} +201 -166
- package/package.json +2 -2
- package/dist/echarts-runtime-BfpVL8xu.cjs +0 -24
- package/dist/echarts-runtime-Bu1uy4oO.mjs +0 -18
- package/dist/styles-CwxqspIz.cjs +0 -3516
- package/dist/styles-yhqxR2ty.mjs +0 -3516
|
@@ -1,7 +1,26 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as preact2 from "preact";
|
|
2
|
+
import { JSX } from "preact";
|
|
2
3
|
|
|
4
|
+
//#region ../centrinfo-results/src/answer.d.ts
|
|
5
|
+
interface CentrinfoAnswer<Visualization = unknown, Source$1 = unknown, Artifact = unknown, Presentation = unknown> {
|
|
6
|
+
version: number;
|
|
7
|
+
kind: string;
|
|
8
|
+
status: string;
|
|
9
|
+
text: string;
|
|
10
|
+
explanation?: Record<string, unknown>;
|
|
11
|
+
visualization?: Visualization;
|
|
12
|
+
sources?: Source$1[];
|
|
13
|
+
artifacts?: Artifact[];
|
|
14
|
+
presentation?: Presentation;
|
|
15
|
+
feedbackId?: string;
|
|
16
|
+
generatedAt?: string;
|
|
17
|
+
timezone?: string;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region ../centrinfo-results/src/analytics-chart-catalog.d.ts
|
|
21
|
+
type AnalyticsChartCatalogType = 'kpi' | 'table' | 'line' | 'bar' | 'pie' | 'scatter' | 'effectScatter' | 'map' | 'candlestick' | 'boxplot' | 'graph' | 'lines' | 'tree' | 'treemap' | 'sunburst' | 'parallel' | 'sankey' | 'funnel' | 'heatmap' | 'radar' | 'gauge' | 'pictorialBar' | 'themeRiver' | 'matrix' | 'chord' | 'custom' | 'dataset' | 'dataZoom' | 'graphic' | 'richText' | 'globe' | 'bar3D' | 'scatter3D' | 'surface' | 'map3D' | 'lines3D' | 'line3D' | 'scatterGL' | 'linesGL' | 'flowGL' | 'graphGL' | 'polygons3D';
|
|
22
|
+
//#endregion
|
|
3
23
|
//#region ../centrinfo-results/src/analytics-explanation.d.ts
|
|
4
|
-
|
|
5
24
|
/**
|
|
6
25
|
* Framework-agnostic analytics explanation core.
|
|
7
26
|
*
|
|
@@ -169,6 +188,7 @@ interface AnalyticsAIExplanationInput {
|
|
|
169
188
|
status: AnalyticsAIExplanationStatus | string;
|
|
170
189
|
explanationId?: string;
|
|
171
190
|
retryAvailable?: boolean;
|
|
191
|
+
retryAfterSeconds?: number;
|
|
172
192
|
/** Pending only: when the backend job's budget ends (ISO time). */
|
|
173
193
|
deadlineAt?: string;
|
|
174
194
|
/** Pending only: seconds left in the job's budget at response time (clock-skew safe). */
|
|
@@ -222,10 +242,12 @@ declare const ANALYTICS_EXPLANATION_COPY: {
|
|
|
222
242
|
readonly basicExplanation: "Basic explanation";
|
|
223
243
|
readonly preparingDetailed: "Preparing a detailed explanation…";
|
|
224
244
|
readonly stillWorkingDetailed: "Still working on the detailed explanation…";
|
|
245
|
+
readonly waitingToRetry: "Waiting briefly before retrying the detailed explanation…";
|
|
225
246
|
readonly detailedReady: "Detailed explanation ready.";
|
|
226
247
|
readonly detailedUnavailable: "A detailed explanation is not available right now.";
|
|
227
248
|
readonly detailedRetry: "Try again";
|
|
228
249
|
readonly region: "Explanation";
|
|
250
|
+
readonly details: "What this means";
|
|
229
251
|
readonly drivers: "What is driving it";
|
|
230
252
|
readonly driversHint: "Measured association, not proof of cause";
|
|
231
253
|
readonly anomalies: "Unusual values";
|
|
@@ -313,6 +335,7 @@ interface AnalyticsAIExplanationJob<E extends AnalyticsExplanationInput> {
|
|
|
313
335
|
status: AnalyticsAIExplanationStatus | string;
|
|
314
336
|
explanationId?: string;
|
|
315
337
|
retryAvailable?: boolean;
|
|
338
|
+
retryAfterSeconds?: number;
|
|
316
339
|
/** Pending only: the job's deadline (ISO) and seconds left (see AnalyticsAIExplanationInput). */
|
|
317
340
|
deadlineAt?: string;
|
|
318
341
|
waitSeconds?: number;
|
|
@@ -329,14 +352,194 @@ interface AnalyticsAIExplanationTransport<E extends AnalyticsExplanationInput> {
|
|
|
329
352
|
poll: (explanationId: string, signal?: AbortSignal) => Promise<AnalyticsAIExplanationJob<E>>;
|
|
330
353
|
/** "Try again": re-request with the retry flag. Omit when retry is impossible. */
|
|
331
354
|
retry?: (explanationId: string, signal?: AbortSignal) => Promise<AnalyticsAIExplanationJob<E>>;
|
|
332
|
-
/**
|
|
333
|
-
settled?: (explanationId: string, status: 'ready' | 'failed' | 'not_requested') => void;
|
|
355
|
+
/** Remember the checked explanation alongside its final status. */
|
|
356
|
+
settled?: (explanationId: string, status: 'ready' | 'failed' | 'not_requested', explanation?: E) => void;
|
|
357
|
+
}
|
|
358
|
+
//#endregion
|
|
359
|
+
//#region ../centrinfo-results/src/format.d.ts
|
|
360
|
+
/**
|
|
361
|
+
* The one place numbers, currency, percentages and dates are formatted, so the
|
|
362
|
+
* chart axis, tooltip, table and KPI show the same value the same way.
|
|
363
|
+
*
|
|
364
|
+
* Rules:
|
|
365
|
+
* - Currency comes from column metadata (`currencyCode`) or the result's fixed
|
|
366
|
+
* currency. With no known code the amount is shown as a plain number.
|
|
367
|
+
* - A `percent` column is read as percentage points (0.5 is "0.5%") unless its
|
|
368
|
+
* `formatPattern` contains `%` (Excel style), which marks a fraction (0.5 is
|
|
369
|
+
* "50%"). Magnitude is never used to guess.
|
|
370
|
+
* - Date-only values (`2024-03-05`) are calendar dates: they are formatted in
|
|
371
|
+
* UTC so they never shift a day. Instants are formatted in the result
|
|
372
|
+
* timezone. Granularity follows column metadata, the result's comparison
|
|
373
|
+
* grain, or the shape of the values — a daily series is never "Mar 2024".
|
|
374
|
+
*/
|
|
375
|
+
type ResultGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
376
|
+
interface ResultFormatContext {
|
|
377
|
+
locale?: string;
|
|
378
|
+
/** IANA zone of the result; used for instants, never for date-only values. */
|
|
379
|
+
timezone?: string;
|
|
380
|
+
grain?: ResultGrain;
|
|
381
|
+
/** Result-level fixed currency, used when the column has none. */
|
|
382
|
+
currencyCode?: string;
|
|
383
|
+
yes?: string;
|
|
384
|
+
no?: string;
|
|
385
|
+
}
|
|
386
|
+
//#endregion
|
|
387
|
+
//#region ../centrinfo-results/src/types.d.ts
|
|
388
|
+
interface AnalyticsVisualizationColumn$1 {
|
|
389
|
+
key: string;
|
|
390
|
+
label: string;
|
|
391
|
+
dataType: 'text' | 'number' | 'currency' | 'percent' | 'boolean' | 'date' | 'datetime';
|
|
392
|
+
semanticRole: 'identifier' | 'dimension' | 'measure' | 'date' | 'geography' | 'boolean';
|
|
393
|
+
aggregation?: 'none' | 'sum' | 'avg' | 'count' | 'count_distinct' | 'min' | 'max';
|
|
394
|
+
allowedAggregations?: Array<'none' | 'sum' | 'avg' | 'count' | 'count_distinct' | 'min' | 'max'>;
|
|
395
|
+
formatPattern?: string;
|
|
396
|
+
currencyCode?: string;
|
|
397
|
+
/** Time granularity of a date column; drives how its values are labelled. */
|
|
398
|
+
grain?: ResultGrain;
|
|
399
|
+
timeGrain?: string;
|
|
400
|
+
description?: string;
|
|
401
|
+
priority?: 'primary' | 'secondary' | 'detail';
|
|
402
|
+
sortable?: boolean;
|
|
403
|
+
filterable?: boolean;
|
|
404
|
+
groupable?: boolean;
|
|
405
|
+
}
|
|
406
|
+
interface AnalyticsVisualizationRecommendation$1 {
|
|
407
|
+
layers?: AnalyticsChartLayer[];
|
|
408
|
+
type: AnalyticsChartCatalogType | 'area' | 'stacked_bar';
|
|
409
|
+
mode: string;
|
|
410
|
+
categoryField?: string;
|
|
411
|
+
latitudeField?: string;
|
|
412
|
+
longitudeField?: string;
|
|
413
|
+
geometryField?: string;
|
|
414
|
+
valueFields?: string[];
|
|
415
|
+
seriesField?: string;
|
|
416
|
+
reason?: string;
|
|
417
|
+
confidence?: number;
|
|
418
|
+
}
|
|
419
|
+
interface AnalyticsVisualization$1 {
|
|
420
|
+
truncated?: boolean;
|
|
421
|
+
maxSeries?: number;
|
|
422
|
+
valueProvenance?: Array<{
|
|
423
|
+
rowIndex: number;
|
|
424
|
+
field: string;
|
|
425
|
+
status?: string;
|
|
426
|
+
filled?: string;
|
|
427
|
+
}>;
|
|
428
|
+
panels?: Array<{
|
|
429
|
+
id: string;
|
|
430
|
+
title: string;
|
|
431
|
+
status: string;
|
|
432
|
+
visualization?: AnalyticsVisualization$1;
|
|
433
|
+
}>;
|
|
434
|
+
/** The latest time bucket is still in progress (drawn dashed). */
|
|
435
|
+
lastPeriodInProgress?: boolean;
|
|
436
|
+
/** Like-for-like comparison basis (reader-safe). */
|
|
437
|
+
periodComparison?: AnalyticsPeriodComparison;
|
|
438
|
+
version?: number;
|
|
439
|
+
presentation?: 'kpi' | 'chart' | 'table';
|
|
440
|
+
type: AnalyticsChartCatalogType | 'area' | 'stacked_bar';
|
|
441
|
+
title?: string;
|
|
442
|
+
label?: string;
|
|
443
|
+
value?: string;
|
|
444
|
+
latitudeField?: string;
|
|
445
|
+
longitudeField?: string;
|
|
446
|
+
geometryField?: string;
|
|
447
|
+
valueFields?: string[];
|
|
448
|
+
series?: string;
|
|
449
|
+
seriesField?: string;
|
|
450
|
+
columns?: string[];
|
|
451
|
+
rows?: Array<Record<string, unknown>>;
|
|
452
|
+
rowCount?: number;
|
|
453
|
+
timezone?: string;
|
|
454
|
+
freshness?: {
|
|
455
|
+
status?: string;
|
|
456
|
+
answeredAt?: string;
|
|
457
|
+
};
|
|
458
|
+
reportingPeriod?: {
|
|
459
|
+
label?: string;
|
|
460
|
+
start?: string;
|
|
461
|
+
end?: string;
|
|
462
|
+
timezone?: string;
|
|
463
|
+
};
|
|
464
|
+
appliedFilters?: Array<{
|
|
465
|
+
field: string;
|
|
466
|
+
operator: string;
|
|
467
|
+
value: unknown;
|
|
468
|
+
}>;
|
|
469
|
+
explanation?: {
|
|
470
|
+
checkedAt?: string;
|
|
471
|
+
timezone?: string;
|
|
472
|
+
dataFreshness?: {
|
|
473
|
+
status?: string;
|
|
474
|
+
};
|
|
475
|
+
};
|
|
476
|
+
expandable?: boolean;
|
|
477
|
+
tableAvailable?: boolean;
|
|
478
|
+
downloadAvailable?: boolean;
|
|
479
|
+
columnMetadata?: AnalyticsVisualizationColumn$1[];
|
|
480
|
+
currency?: {
|
|
481
|
+
code?: string;
|
|
482
|
+
field?: string;
|
|
483
|
+
source?: 'fixed_metadata' | 'source_field';
|
|
484
|
+
isMixed: boolean;
|
|
485
|
+
};
|
|
486
|
+
chartRecommendation?: AnalyticsVisualizationRecommendation$1;
|
|
487
|
+
}
|
|
488
|
+
interface ResultColumn {
|
|
489
|
+
key: string;
|
|
490
|
+
label?: string;
|
|
491
|
+
dataType?: AnalyticsVisualizationColumn$1['dataType'];
|
|
492
|
+
currencyCode?: string;
|
|
493
|
+
formatPattern?: string;
|
|
494
|
+
grain?: ResultGrain;
|
|
495
|
+
semanticRole?: AnalyticsVisualizationColumn$1['semanticRole'];
|
|
496
|
+
}
|
|
497
|
+
interface ResultTableClassNames {
|
|
498
|
+
wrap?: string;
|
|
499
|
+
table?: string;
|
|
500
|
+
note?: string;
|
|
501
|
+
}
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region ../centrinfo-results/src/combo-chart.d.ts
|
|
504
|
+
/** References governed result columns. Layers never contain queries or data. */
|
|
505
|
+
interface AnalyticsChartLayer {
|
|
506
|
+
sourceTitle?: string;
|
|
507
|
+
categorySourceTitle?: string;
|
|
508
|
+
type: 'line' | 'bar';
|
|
509
|
+
mode: string;
|
|
510
|
+
categoryField: string;
|
|
511
|
+
valueField: string;
|
|
512
|
+
seriesField?: string;
|
|
513
|
+
axis: 'y1' | 'y2';
|
|
514
|
+
}
|
|
515
|
+
interface AnalyticsComboModel {
|
|
516
|
+
categories: string[];
|
|
517
|
+
categoryLabel: string;
|
|
518
|
+
series: Array<{
|
|
519
|
+
layer: number;
|
|
520
|
+
name: string;
|
|
521
|
+
type: 'line' | 'bar';
|
|
522
|
+
area: boolean;
|
|
523
|
+
stack?: string;
|
|
524
|
+
axis: number;
|
|
525
|
+
column: AnalyticsVisualizationColumn$1;
|
|
526
|
+
values: Array<number | null>;
|
|
527
|
+
reference?: boolean;
|
|
528
|
+
}>;
|
|
529
|
+
axes: Array<{
|
|
530
|
+
label: string;
|
|
531
|
+
column: AnalyticsVisualizationColumn$1;
|
|
532
|
+
}>;
|
|
533
|
+
omittedSeriesCount: number;
|
|
534
|
+
partial: boolean;
|
|
535
|
+
locale?: string;
|
|
334
536
|
}
|
|
335
537
|
//#endregion
|
|
336
538
|
//#region ../centrinfo-results/src/labels.d.ts
|
|
337
539
|
type AnalyticsExplanationCopy = Required<AnalyticsExplanationCopyOverrides>;
|
|
338
540
|
/** Every string the shared result renderer shows. Hosts override any subset. */
|
|
339
541
|
interface ResultLabels {
|
|
542
|
+
analysisUnavailable: string;
|
|
340
543
|
resultDetails: string;
|
|
341
544
|
liveMetric: string;
|
|
342
545
|
currentValue: string;
|
|
@@ -349,6 +552,10 @@ interface ResultLabels {
|
|
|
349
552
|
aggregateCharge: string;
|
|
350
553
|
chartFallback: string;
|
|
351
554
|
chartLine: string;
|
|
555
|
+
chartArea: string;
|
|
556
|
+
chartCombo: string;
|
|
557
|
+
chartAreaHint: string;
|
|
558
|
+
chartComboHint: string;
|
|
352
559
|
chartBar: string;
|
|
353
560
|
chartStackedBar: string;
|
|
354
561
|
chartLineHint: string;
|
|
@@ -386,6 +593,7 @@ interface ResultLabels {
|
|
|
386
593
|
/** `{measure}`, `{dimension}`. */
|
|
387
594
|
chartTitle: string;
|
|
388
595
|
seriesLimited: string;
|
|
596
|
+
partialChart: string;
|
|
389
597
|
summaryLatest: string;
|
|
390
598
|
summaryNoTrend: string;
|
|
391
599
|
summaryHighest: string;
|
|
@@ -411,6 +619,86 @@ interface ResultLabels {
|
|
|
411
619
|
governedResult: string;
|
|
412
620
|
}
|
|
413
621
|
//#endregion
|
|
622
|
+
//#region ../centrinfo-results/src/chart.d.ts
|
|
623
|
+
type WidgetAnalyticsSeries = {
|
|
624
|
+
field: string;
|
|
625
|
+
name: string;
|
|
626
|
+
values: Array<number | null>;
|
|
627
|
+
valueColumn?: AnalyticsVisualizationColumn$1;
|
|
628
|
+
/** Like-for-like breakdown: per-point comparison (tooltip detail). */
|
|
629
|
+
points?: Array<AnalyticsGroupComparisonPoint | undefined>;
|
|
630
|
+
};
|
|
631
|
+
type WidgetAnalyticsChartType = 'line' | 'area' | 'bar' | 'stacked_bar' | 'combo';
|
|
632
|
+
type WidgetAnalyticsChartModel = {
|
|
633
|
+
combo?: AnalyticsComboModel;
|
|
634
|
+
type: WidgetAnalyticsChartType;
|
|
635
|
+
title: string;
|
|
636
|
+
xAxisTitle: string;
|
|
637
|
+
yAxisTitle: string;
|
|
638
|
+
categories: string[];
|
|
639
|
+
series: WidgetAnalyticsSeries[];
|
|
640
|
+
summary: string;
|
|
641
|
+
omittedSeriesCount: number;
|
|
642
|
+
/** Index of the in-progress (latest) time bucket, drawn dashed / faded. */
|
|
643
|
+
inProgressIndex?: number;
|
|
644
|
+
/** Like-for-like breakdown: the comparison drawn (previous-to-date bars). */
|
|
645
|
+
comparison?: AnalyticsPeriodComparison;
|
|
646
|
+
/** "Today so far, compared with yesterday at this time". */
|
|
647
|
+
comparisonNote?: string;
|
|
648
|
+
locale?: string;
|
|
649
|
+
/** Resolved copy used by the chart's tooltips, summary and zoom controls. */
|
|
650
|
+
labels: ResultLabels;
|
|
651
|
+
};
|
|
652
|
+
type WidgetAnalyticsChartOptions = {
|
|
653
|
+
maxSeries?: number;
|
|
654
|
+
locale?: string;
|
|
655
|
+
labels?: Partial<ResultLabels>;
|
|
656
|
+
};
|
|
657
|
+
declare const buildWidgetAnalyticsChartModel: (visualization: AnalyticsVisualization$1, overrideType?: WidgetAnalyticsChartType, options?: WidgetAnalyticsChartOptions) => WidgetAnalyticsChartModel | null;
|
|
658
|
+
declare const WidgetAnalyticsChart: ({
|
|
659
|
+
model,
|
|
660
|
+
expanded,
|
|
661
|
+
classPrefix: p
|
|
662
|
+
}: {
|
|
663
|
+
model: WidgetAnalyticsChartModel;
|
|
664
|
+
expanded?: boolean;
|
|
665
|
+
/** Class prefix of the surface (`cf` widget, `ca` chat app). */
|
|
666
|
+
classPrefix?: string;
|
|
667
|
+
}) => preact2.JSX.Element;
|
|
668
|
+
//#endregion
|
|
669
|
+
//#region ../centrinfo-results/src/result.d.ts
|
|
670
|
+
declare const formatResultCell: (value: unknown, locale?: string, column?: ResultColumn, context?: ResultFormatContext) => string;
|
|
671
|
+
declare const serializeResultCsv: (rows: Array<Record<string, unknown>>, columns?: Array<string | ResultColumn>) => string;
|
|
672
|
+
//#endregion
|
|
673
|
+
//#region ../centrinfo-results/src/table.d.ts
|
|
674
|
+
interface ResultTableProps {
|
|
675
|
+
rows: Array<Record<string, unknown>>;
|
|
676
|
+
columns?: Array<string | ResultColumn>;
|
|
677
|
+
maxRows?: number;
|
|
678
|
+
locale?: string;
|
|
679
|
+
/** Timezone / grain / currency context so cells format like the chart. */
|
|
680
|
+
format?: ResultFormatContext;
|
|
681
|
+
expanded?: boolean;
|
|
682
|
+
classNames?: ResultTableClassNames;
|
|
683
|
+
emptyLabel?: string;
|
|
684
|
+
}
|
|
685
|
+
declare const ResultTable: ({
|
|
686
|
+
rows,
|
|
687
|
+
columns,
|
|
688
|
+
maxRows,
|
|
689
|
+
locale,
|
|
690
|
+
format,
|
|
691
|
+
expanded,
|
|
692
|
+
classNames,
|
|
693
|
+
emptyLabel
|
|
694
|
+
}: ResultTableProps) => preact2.JSX.Element;
|
|
695
|
+
//#endregion
|
|
696
|
+
//#region ../centrinfo-results/src/result-details.d.ts
|
|
697
|
+
interface AnalyticsResultDetail {
|
|
698
|
+
label: string;
|
|
699
|
+
value: string;
|
|
700
|
+
}
|
|
701
|
+
//#endregion
|
|
414
702
|
//#region src/i18n.d.ts
|
|
415
703
|
/**
|
|
416
704
|
* Every user-visible chrome string in one place. The widget ships English
|
|
@@ -421,6 +709,10 @@ interface ResultLabels {
|
|
|
421
709
|
* never produces.
|
|
422
710
|
*/
|
|
423
711
|
interface WidgetStrings {
|
|
712
|
+
analyticsModelLabel: string;
|
|
713
|
+
analyticsModelAutomatic: string;
|
|
714
|
+
analyticsModelUnavailable: string;
|
|
715
|
+
testMode?: string;
|
|
424
716
|
/**
|
|
425
717
|
* Labels for analytics answers (KPI, chart, table, details, explanation).
|
|
426
718
|
* Any subset overrides the English defaults; `explanation` holds the
|
|
@@ -497,6 +789,8 @@ interface WidgetStrings {
|
|
|
497
789
|
stop: string;
|
|
498
790
|
copy: string;
|
|
499
791
|
copied: string;
|
|
792
|
+
doubleCheckResponse: string;
|
|
793
|
+
retryResponse: string;
|
|
500
794
|
retry: string;
|
|
501
795
|
clearChat: string;
|
|
502
796
|
clearChatConfirm: string;
|
|
@@ -626,7 +920,7 @@ interface WidgetStrings {
|
|
|
626
920
|
previewActionNote: string;
|
|
627
921
|
previewBanner: string;
|
|
628
922
|
}
|
|
629
|
-
declare const StringsProvider:
|
|
923
|
+
declare const StringsProvider: preact2.Provider<WidgetStrings>;
|
|
630
924
|
//#endregion
|
|
631
925
|
//#region src/api/types.d.ts
|
|
632
926
|
/** The result metadata that arrives with (or after) an answer. */
|
|
@@ -684,6 +978,7 @@ interface LiveAudioSegment {
|
|
|
684
978
|
text?: string;
|
|
685
979
|
}
|
|
686
980
|
interface TurnResult {
|
|
981
|
+
answerResult?: CentrinfoAnswer<AnalyticsVisualization, Source, ChatArtifact>;
|
|
687
982
|
/** True when the reply was spoken in live pieces (onAudioSegment). */
|
|
688
983
|
liveAudio?: boolean;
|
|
689
984
|
answer: string;
|
|
@@ -715,6 +1010,7 @@ interface AnalyticsVisualizationColumn {
|
|
|
715
1010
|
label: string;
|
|
716
1011
|
dataType: 'text' | 'number' | 'currency' | 'percent' | 'boolean' | 'date' | 'datetime';
|
|
717
1012
|
semanticRole: 'identifier' | 'dimension' | 'measure' | 'date' | 'geography' | 'boolean';
|
|
1013
|
+
timeGrain?: string;
|
|
718
1014
|
aggregation?: 'none' | 'sum' | 'avg' | 'count' | 'count_distinct' | 'min' | 'max';
|
|
719
1015
|
allowedAggregations?: Array<'none' | 'sum' | 'avg' | 'count' | 'count_distinct' | 'min' | 'max'>;
|
|
720
1016
|
formatPattern?: string;
|
|
@@ -726,6 +1022,7 @@ interface AnalyticsVisualizationColumn {
|
|
|
726
1022
|
groupable?: boolean;
|
|
727
1023
|
}
|
|
728
1024
|
interface AnalyticsVisualizationRecommendation {
|
|
1025
|
+
layers?: AnalyticsChartLayer[];
|
|
729
1026
|
type: 'kpi' | 'table' | 'line' | 'area' | 'bar' | 'stacked_bar' | 'pie' | 'scatter' | 'funnel' | 'heatmap' | 'radar';
|
|
730
1027
|
mode: string;
|
|
731
1028
|
categoryField?: string;
|
|
@@ -841,11 +1138,7 @@ interface AnalyticsVisualizationExplanation {
|
|
|
841
1138
|
followUps?: string[];
|
|
842
1139
|
source: 'governed_result' | 'ai_grounded' | 'rag_deterministic_analysis' | 'analysis_contract' | string;
|
|
843
1140
|
/** The detailed AI explanation that loads separately (poll by explanationId). */
|
|
844
|
-
aiExplanation?:
|
|
845
|
-
status: string;
|
|
846
|
-
explanationId?: string;
|
|
847
|
-
retryAvailable?: boolean;
|
|
848
|
-
} | null;
|
|
1141
|
+
aiExplanation?: AnalyticsAIExplanationInput | null;
|
|
849
1142
|
}
|
|
850
1143
|
interface AnalyticsVisualizationAnalysis {
|
|
851
1144
|
summary: string;
|
|
@@ -921,6 +1214,12 @@ interface AnalyticsVisualizationBusinessAnalysis {
|
|
|
921
1214
|
coverage?: AnalyticsVisualizationAnalysisCoverage;
|
|
922
1215
|
}
|
|
923
1216
|
interface AnalyticsVisualization {
|
|
1217
|
+
panels?: Array<{
|
|
1218
|
+
id: string;
|
|
1219
|
+
title: string;
|
|
1220
|
+
status: string;
|
|
1221
|
+
visualization?: AnalyticsVisualization;
|
|
1222
|
+
}>;
|
|
924
1223
|
version?: number;
|
|
925
1224
|
presentation?: 'kpi' | 'chart' | 'table';
|
|
926
1225
|
type: 'kpi' | 'table' | 'bar' | 'line' | 'area' | 'stacked_bar' | 'pie' | 'scatter' | 'funnel' | 'heatmap' | 'radar';
|
|
@@ -1003,6 +1302,10 @@ interface LiveEventsResult {
|
|
|
1003
1302
|
events: LiveEvent[];
|
|
1004
1303
|
}
|
|
1005
1304
|
interface AuthenticatedHistoryMessage {
|
|
1305
|
+
answerResult?: CentrinfoAnswer<AnalyticsVisualization, {
|
|
1306
|
+
title?: string;
|
|
1307
|
+
url?: string;
|
|
1308
|
+
}, ChatArtifact>;
|
|
1006
1309
|
id: string;
|
|
1007
1310
|
role: 'user' | 'assistant' | 'system';
|
|
1008
1311
|
content: string;
|
|
@@ -1030,6 +1333,7 @@ interface AuthenticatedHistoryResult {
|
|
|
1030
1333
|
conversations: AuthenticatedHistoryConversation[];
|
|
1031
1334
|
}
|
|
1032
1335
|
interface StreamCallbacks {
|
|
1336
|
+
analyticsModelId?: string;
|
|
1033
1337
|
/** Called with each incremental text chunk. */
|
|
1034
1338
|
onChunk: (text: string) => void;
|
|
1035
1339
|
/** The answer text and metadata have arrived; optional reply audio may follow. */
|
|
@@ -1123,10 +1427,7 @@ interface ExplanationFeedbackInput {
|
|
|
1123
1427
|
/** Detailed AI explanation job for an analytics answer
|
|
1124
1428
|
* (GET /public-chat/analytics-explanations/:id). `explanation` is set only
|
|
1125
1429
|
* when ready and is the checked, public-safe explanation. */
|
|
1126
|
-
interface ExplanationJob {
|
|
1127
|
-
status: 'pending' | 'ready' | 'failed' | 'not_requested' | string;
|
|
1128
|
-
explanationId?: string;
|
|
1129
|
-
retryAvailable?: boolean;
|
|
1430
|
+
interface ExplanationJob extends AnalyticsAIExplanationInput {
|
|
1130
1431
|
explanation?: Record<string, unknown> | null;
|
|
1131
1432
|
/** The free basic explanation as updated by the job (gains the baseline sentence). */
|
|
1132
1433
|
basic?: Record<string, unknown> | null;
|
|
@@ -1162,9 +1463,11 @@ interface GifResult {
|
|
|
1162
1463
|
* backend (`ApiClient`) or the in-memory demo (`MockTransport`).
|
|
1163
1464
|
*/
|
|
1164
1465
|
interface Transport {
|
|
1466
|
+
analyticsModels?(): Promise<AnalyticsModelOption[]>;
|
|
1165
1467
|
bootstrap(): Promise<BootstrapInfo>;
|
|
1166
1468
|
/** Server-backed history for the verified SDK customer. Anonymous returns empty. */
|
|
1167
1469
|
history(): Promise<AuthenticatedHistoryResult>;
|
|
1470
|
+
updateHistory?(sessionId: string, action: 'rename' | 'delete', title?: string): Promise<void>;
|
|
1168
1471
|
/** Stream a turn; resolves with final metadata once `done`. */
|
|
1169
1472
|
stream(question: string, sessionId: string, cb: StreamCallbacks): Promise<TurnResult>;
|
|
1170
1473
|
/** Poll for staff/system events after a timestamp during live handoff. */
|
|
@@ -1216,6 +1519,10 @@ interface Transport {
|
|
|
1216
1519
|
/** "Try again" on a failed detailed AI explanation. Optional. */
|
|
1217
1520
|
retryExplanation?(explanationId: string, sessionId: string, surface?: 'widget' | 'chat_app'): Promise<ExplanationJob>;
|
|
1218
1521
|
}
|
|
1522
|
+
interface AnalyticsModelOption {
|
|
1523
|
+
id: string;
|
|
1524
|
+
name: string;
|
|
1525
|
+
}
|
|
1219
1526
|
//#endregion
|
|
1220
1527
|
//#region src/types.d.ts
|
|
1221
1528
|
type ChatSurface = 'floating' | 'full-page';
|
|
@@ -1240,6 +1547,23 @@ interface WidgetTranslationBundle {
|
|
|
1240
1547
|
}
|
|
1241
1548
|
/** Public configuration surface passed to `Centrinfo.init()` / <CentrinfoWidget>. */
|
|
1242
1549
|
interface WidgetConfig {
|
|
1550
|
+
/** Simple brand settings shared by the floating widget and full-page chat. */
|
|
1551
|
+
branding?: {
|
|
1552
|
+
name?: string;
|
|
1553
|
+
logo?: string;
|
|
1554
|
+
color?: string;
|
|
1555
|
+
};
|
|
1556
|
+
/** Simple composer options. Hiding a control does not change backend permissions. */
|
|
1557
|
+
composer?: {
|
|
1558
|
+
placeholder?: string;
|
|
1559
|
+
attachments?: boolean;
|
|
1560
|
+
voice?: boolean;
|
|
1561
|
+
modelSelector?: boolean;
|
|
1562
|
+
};
|
|
1563
|
+
/** Show the permitted analytics data models in chat. Defaults to true. */
|
|
1564
|
+
showAnalyticsModelSelector?: boolean;
|
|
1565
|
+
/** Initial analytics data model; backend permissions are always enforced. */
|
|
1566
|
+
analyticsModelId?: string;
|
|
1243
1567
|
/** The org's public chat token (`pub_*`). Required. It IS the org identity. */
|
|
1244
1568
|
token: string;
|
|
1245
1569
|
/** Conversation namespace. Set by the SDK surface mounting the chat. */
|
|
@@ -1364,7 +1688,7 @@ interface WidgetConfig {
|
|
|
1364
1688
|
/**
|
|
1365
1689
|
* How often the open widget refreshes its public token configuration
|
|
1366
1690
|
* (branding, greeting, starter questions, allowed actions, pause/offline
|
|
1367
|
-
* state) from `/public-chat/bootstrap`. Default
|
|
1691
|
+
* state) from `/public-chat/bootstrap`. Default 300 seconds; set 0 to
|
|
1368
1692
|
* disable live config refresh for strict traffic budgets.
|
|
1369
1693
|
*/
|
|
1370
1694
|
configRefreshSeconds?: number;
|
|
@@ -1583,6 +1907,7 @@ interface Visitor {
|
|
|
1583
1907
|
}
|
|
1584
1908
|
/** Persona + capabilities returned by `GET /public-chat/bootstrap`. */
|
|
1585
1909
|
interface BootstrapInfo {
|
|
1910
|
+
testMode?: boolean;
|
|
1586
1911
|
agentName: string;
|
|
1587
1912
|
agentAvatarUrl?: string;
|
|
1588
1913
|
greeting: string;
|
|
@@ -1654,4 +1979,4 @@ interface SchedulerInfo {
|
|
|
1654
1979
|
};
|
|
1655
1980
|
}
|
|
1656
1981
|
//#endregion
|
|
1657
|
-
export {
|
|
1982
|
+
export { WidgetAnalyticsChart as A, Transport as C, ResultTable as D, AnalyticsResultDetail as E, ResultLabels as M, AnalyticsAIExplanationTransport as N, formatResultCell as O, AnalyticsExplanationInput as P, PublicChatActionField as S, WidgetStrings as T, DemoBooking as _, MessageAttachment as a, GifResult as b, Visitor as c, WidgetHandle as d, WidgetThemeTokens as f, AnalyticsVisualization as g, AnalyticsModelOption as h, FeaturedLink as i, buildWidgetAnalyticsChartModel as j, serializeResultCsv as k, WidgetActionTranslation as l, ActionResult as m, ChatArtifact as n, SchedulerInfo as o, WidgetUser as p, ChatMessage as r, Source as s, BootstrapInfo as t, WidgetConfig as u, DemoSlotsResult as v, StringsProvider as w, PublicChatAction as x, ExplanationFeedbackInput as y };
|