@speakai/shared 1.24.0 → 2.1.0
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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/dashboard.d.ts +6 -81
- package/dist/interfaces/dashboard.d.ts.map +1 -1
- package/dist/interfaces/dashboard.js +8 -2
- package/dist/interfaces/dashboard.js.map +1 -1
- package/dist/schemas/dashboard-spec.schema.d.ts +50979 -0
- package/dist/schemas/dashboard-spec.schema.d.ts.map +1 -0
- package/dist/schemas/dashboard-spec.schema.js +649 -0
- package/dist/schemas/dashboard-spec.schema.js.map +1 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/utils/dashboard-spec.d.ts +78 -0
- package/dist/utils/dashboard-spec.d.ts.map +1 -0
- package/dist/utils/dashboard-spec.js +91 -0
- package/dist/utils/dashboard-spec.js.map +1 -0
- package/package.json +9 -1
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AAGjC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AAGjC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAG1C,cAAc,2BAA2B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,11 @@ export * from './enums/index.js';
|
|
|
4
4
|
export * from './interfaces/index.js';
|
|
5
5
|
// Utils
|
|
6
6
|
export * from './utils/transcript.js';
|
|
7
|
+
export * from './utils/dashboard-spec.js';
|
|
7
8
|
// LLM model pricing
|
|
8
9
|
export * from './pricing/modelPricing.js';
|
|
10
|
+
// NOTE: './schemas/index.js' is intentionally NOT exported here. It has a
|
|
11
|
+
// runtime zod dependency, and speak-media-library imports runtime enums from
|
|
12
|
+
// this barrel while pinning zod v3. Import schemas via '@speakai/shared/schemas'.
|
|
13
|
+
// Enforced by tests/no-zod-in-root-barrel.test.ts.
|
|
9
14
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,kBAAkB,CAAC;AAEjC,aAAa;AACb,cAAc,uBAAuB,CAAC;AAEtC,QAAQ;AACR,cAAc,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,kBAAkB,CAAC;AAEjC,aAAa;AACb,cAAc,uBAAuB,CAAC;AAEtC,QAAQ;AACR,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAE1C,oBAAoB;AACpB,cAAc,2BAA2B,CAAC;AAE1C,0EAA0E;AAC1E,6EAA6E;AAC7E,kFAAkF;AAClF,mDAAmD"}
|
|
@@ -5,90 +5,15 @@
|
|
|
5
5
|
* (builder + queries) and speak-server (@speak-dashboards). The server's Mongoose
|
|
6
6
|
* document type may extend these; the client imports them directly.
|
|
7
7
|
*/
|
|
8
|
+
export type { Agg, BaseMetric, Binding, BuiltinMetric, Column, DashboardSpec, DashboardSpecInput, DateRange, DateRangePreset, Expr, FieldTypeMap, Filter, FilterOp, Granularity, GroupBy, Metric, Section, Source, SpecFieldType, Threshold, ThresholdStatus, Widget, WidgetLayout, WidgetOf, WidgetType, } from '../schemas/dashboard-spec.schema.js';
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
-
* builder (speak-client) and the public view (speak-media-library).
|
|
10
|
+
* react-grid-layout column count the dashboard grid is laid out on.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* extra literals is safe because `IDashboardWidget.type` is `… | string`.
|
|
12
|
+
* Defined in `utils/dashboard-spec.ts` (which must stay zod-free, and which the
|
|
13
|
+
* schema's `layout` bounds import) and re-exported here so existing consumers
|
|
14
|
+
* keep compiling unchanged. One grid width, one name — do not add a second.
|
|
16
15
|
*/
|
|
17
|
-
export
|
|
18
|
-
/** Grid placement for a widget (react-grid-layout geometry; legacy order/colSpan optional). */
|
|
19
|
-
export interface IDashboardWidgetLayout {
|
|
20
|
-
x?: number;
|
|
21
|
-
y?: number;
|
|
22
|
-
w?: number;
|
|
23
|
-
h?: number;
|
|
24
|
-
minW?: number;
|
|
25
|
-
minH?: number;
|
|
26
|
-
/** @deprecated legacy linear ordering — superseded by x/y. */
|
|
27
|
-
order?: number;
|
|
28
|
-
/** @deprecated legacy column span — superseded by w. */
|
|
29
|
-
colSpan?: number;
|
|
30
|
-
}
|
|
31
|
-
/** A single configured widget on a dashboard. */
|
|
32
|
-
export interface IDashboardWidget {
|
|
33
|
-
id: string;
|
|
34
|
-
type: DashboardWidgetType | string;
|
|
35
|
-
title: string;
|
|
36
|
-
/** Render-only, widget-type-specific settings (chartType, fieldId, accentColor, …). */
|
|
37
|
-
config: Record<string, unknown>;
|
|
38
|
-
layout: IDashboardWidgetLayout;
|
|
39
|
-
}
|
|
40
|
-
/** Date scope for a dashboard (preset key, with optional explicit bounds). */
|
|
41
|
-
export interface IDashboardDateRange {
|
|
42
|
-
preset?: string;
|
|
43
|
-
startDate?: string | Date;
|
|
44
|
-
endDate?: string | Date;
|
|
45
|
-
}
|
|
46
|
-
/** Full dashboard wire shape (owner/authed view). */
|
|
47
|
-
export interface IDashboard {
|
|
48
|
-
dashboardId: string;
|
|
49
|
-
title: string;
|
|
50
|
-
description?: string;
|
|
51
|
-
icon?: string;
|
|
52
|
-
/** Folder ids the dashboard is scoped to (empty = all accessible). */
|
|
53
|
-
folderScope: string[];
|
|
54
|
-
dateRange?: IDashboardDateRange;
|
|
55
|
-
filters?: Record<string, unknown>;
|
|
56
|
-
widgets: IDashboardWidget[];
|
|
57
|
-
/** Public share token — present only to the owner when sharing is enabled. */
|
|
58
|
-
shareToken?: string;
|
|
59
|
-
isShareEnabled?: boolean;
|
|
60
|
-
/** Team/group ids the dashboard is shared with ("<id> (G)" convention). */
|
|
61
|
-
sharedWithGroups?: string[];
|
|
62
|
-
isDefault?: boolean;
|
|
63
|
-
schemaVersion?: number;
|
|
64
|
-
createdAt?: string | Date;
|
|
65
|
-
updatedAt?: string | Date;
|
|
66
|
-
}
|
|
67
|
-
/** Public (token-resolved, unauthenticated) projection — secret/internal fields stripped. */
|
|
68
|
-
export interface IPublicDashboard {
|
|
69
|
-
title: string;
|
|
70
|
-
description?: string;
|
|
71
|
-
icon?: string;
|
|
72
|
-
widgets: IDashboardWidget[];
|
|
73
|
-
folderScope: string[];
|
|
74
|
-
dateRange?: IDashboardDateRange;
|
|
75
|
-
}
|
|
76
|
-
/** Create payload. */
|
|
77
|
-
export interface ICreateDashboardPayload {
|
|
78
|
-
title: string;
|
|
79
|
-
description?: string;
|
|
80
|
-
icon?: string;
|
|
81
|
-
folderScope?: string[];
|
|
82
|
-
dateRange?: IDashboardDateRange;
|
|
83
|
-
filters?: Record<string, unknown>;
|
|
84
|
-
widgets?: IDashboardWidget[];
|
|
85
|
-
sharedWithGroups?: string[];
|
|
86
|
-
isDefault?: boolean;
|
|
87
|
-
}
|
|
88
|
-
/** Update payload (partial). */
|
|
89
|
-
export type IUpdateDashboardPayload = Partial<ICreateDashboardPayload>;
|
|
90
|
-
/** react-grid-layout column count the dashboard grid is laid out on. */
|
|
91
|
-
export declare const DASHBOARD_GRID_COLS = 12;
|
|
16
|
+
export { DASHBOARD_GRID_COLS } from '../utils/dashboard-spec.js';
|
|
92
17
|
/**
|
|
93
18
|
* Per-widget-type presentation metadata: default title, default grid geometry,
|
|
94
19
|
* minimum geometry, and which config affordances apply. The single source of
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/interfaces/dashboard.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/interfaces/dashboard.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH,YAAY,EACV,GAAG,EACH,UAAU,EACV,OAAO,EACP,aAAa,EACb,MAAM,EACN,aAAa,EACb,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,IAAI,EACJ,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,WAAW,EACX,OAAO,EACP,MAAM,EACN,OAAO,EACP,MAAM,EACN,aAAa,EACb,SAAS,EACT,eAAe,EACf,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,UAAU,GACX,MAAM,qCAAqC,CAAC;AAM7C;;;;;;GAMG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,qCAAqC;IACrC,CAAC,EAAE,MAAM,CAAC;IACV,mCAAmC;IACnC,CAAC,EAAE,MAAM,CAAC;IACV,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,iBAAiB,EAAE,OAAO,CAAC;IAC3B,uDAAuD;IACvD,eAAe,EAAE,OAAO,CAAC;CAC1B;AAaD,0EAA0E;AAC1E,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AA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8,12 @@
|
|
|
8
8
|
/* ===================================================================
|
|
9
9
|
* Widget metadata + sizing (builder layout contract)
|
|
10
10
|
* =================================================================== */
|
|
11
|
-
/**
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* react-grid-layout column count the dashboard grid is laid out on.
|
|
13
|
+
*
|
|
14
|
+
* Defined in `utils/dashboard-spec.ts` (which must stay zod-free, and which the
|
|
15
|
+
* schema's `layout` bounds import) and re-exported here so existing consumers
|
|
16
|
+
* keep compiling unchanged. One grid width, one name — do not add a second.
|
|
17
|
+
*/
|
|
18
|
+
export { DASHBOARD_GRID_COLS } from '../utils/dashboard-spec.js';
|
|
13
19
|
//# sourceMappingURL=dashboard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../src/interfaces/dashboard.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../src/interfaces/dashboard.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAuCH;;yEAEyE;AAEzE;;;;;;GAMG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
|