@speakai/shared 1.14.0 → 1.15.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.
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Dashboard feature — shared wire contract.
3
+ *
4
+ * Single source of truth for the Dashboards API shape, consumed by speak-client
5
+ * (builder + queries) and speak-server (@speak-dashboards). The server's Mongoose
6
+ * document type may extend these; the client imports them directly.
7
+ */
8
+ /** Built-in dashboard widget types. */
9
+ export type DashboardWidgetType = 'stat-cards' | 'sentiment' | 'media-list' | 'field-distribution' | 'upload-timeline' | 'themes' | 'team-activity' | 'kpi-trend';
10
+ /** Grid placement for a widget (react-grid-layout geometry; legacy order/colSpan optional). */
11
+ export interface IDashboardWidgetLayout {
12
+ x?: number;
13
+ y?: number;
14
+ w?: number;
15
+ h?: number;
16
+ minW?: number;
17
+ minH?: number;
18
+ /** @deprecated legacy linear ordering — superseded by x/y. */
19
+ order?: number;
20
+ /** @deprecated legacy column span — superseded by w. */
21
+ colSpan?: number;
22
+ }
23
+ /** A single configured widget on a dashboard. */
24
+ export interface IDashboardWidget {
25
+ id: string;
26
+ type: DashboardWidgetType | string;
27
+ title: string;
28
+ /** Render-only, widget-type-specific settings (chartType, fieldId, accentColor, …). */
29
+ config: Record<string, unknown>;
30
+ layout: IDashboardWidgetLayout;
31
+ }
32
+ /** Date scope for a dashboard (preset key, with optional explicit bounds). */
33
+ export interface IDashboardDateRange {
34
+ preset?: string;
35
+ startDate?: string | Date;
36
+ endDate?: string | Date;
37
+ }
38
+ /** Full dashboard wire shape (owner/authed view). */
39
+ export interface IDashboard {
40
+ dashboardId: string;
41
+ title: string;
42
+ description?: string;
43
+ icon?: string;
44
+ /** Folder ids the dashboard is scoped to (empty = all accessible). */
45
+ folderScope: string[];
46
+ dateRange?: IDashboardDateRange;
47
+ filters?: Record<string, unknown>;
48
+ widgets: IDashboardWidget[];
49
+ /** Public share token — present only to the owner when sharing is enabled. */
50
+ shareToken?: string;
51
+ isShareEnabled?: boolean;
52
+ /** Team/group ids the dashboard is shared with ("<id> (G)" convention). */
53
+ sharedWithGroups?: string[];
54
+ isDefault?: boolean;
55
+ schemaVersion?: number;
56
+ createdAt?: string | Date;
57
+ updatedAt?: string | Date;
58
+ }
59
+ /** Public (token-resolved, unauthenticated) projection — secret/internal fields stripped. */
60
+ export interface IPublicDashboard {
61
+ title: string;
62
+ description?: string;
63
+ icon?: string;
64
+ widgets: IDashboardWidget[];
65
+ folderScope: string[];
66
+ dateRange?: IDashboardDateRange;
67
+ }
68
+ /** Create payload. */
69
+ export interface ICreateDashboardPayload {
70
+ title: string;
71
+ description?: string;
72
+ icon?: string;
73
+ folderScope?: string[];
74
+ dateRange?: IDashboardDateRange;
75
+ filters?: Record<string, unknown>;
76
+ widgets?: IDashboardWidget[];
77
+ sharedWithGroups?: string[];
78
+ isDefault?: boolean;
79
+ }
80
+ /** Update payload (partial). */
81
+ export type IUpdateDashboardPayload = Partial<ICreateDashboardPayload>;
82
+ //# sourceMappingURL=dashboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/interfaces/dashboard.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,uCAAuC;AACvC,MAAM,MAAM,mBAAmB,GAC3B,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,oBAAoB,GACpB,iBAAiB,GACjB,QAAQ,GACR,eAAe,GACf,WAAW,CAAC;AAEhB,+FAA+F;AAC/F,MAAM,WAAW,sBAAsB;IACrC,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wDAA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AAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,mBAAmB,CAAC;CACjC;AAED,sBAAsB;AACtB,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,gCAAgC;AAChC,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Dashboard feature — shared wire contract.
3
+ *
4
+ * Single source of truth for the Dashboards API shape, consumed by speak-client
5
+ * (builder + queries) and speak-server (@speak-dashboards). The server's Mongoose
6
+ * document type may extend these; the client imports them directly.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=dashboard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../src/interfaces/dashboard.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -17,4 +17,5 @@ export * from './subscription.js';
17
17
  export * from './calendar.js';
18
18
  export * from './category.js';
19
19
  export * from './clip.js';
20
+ export * from './dashboard.js';
20
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC"}
@@ -17,4 +17,5 @@ export * from './subscription.js';
17
17
  export * from './calendar.js';
18
18
  export * from './category.js';
19
19
  export * from './clip.js';
20
+ export * from './dashboard.js';
20
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@speakai/shared",
3
- "version": "1.14.0",
3
+ "version": "1.15.0",
4
4
  "description": "Shared types, enums and interfaces for Speak AI platform",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",