@speakai/shared 1.12.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.
@@ -1,12 +1,41 @@
1
1
  export declare enum AutomationTrigger {
2
2
  FOLDERS = "folders",
3
3
  TAGS = "tags",
4
- KEYWORDS = "keywords"
4
+ KEYWORDS = "keywords",
5
+ COMPOSIO = "composio"
5
6
  }
6
7
  export declare enum AutomationAction {
7
8
  MAGIC_PROMPT = "magic-prompt",
8
9
  TRANSLATION = "translation"
9
10
  }
11
+ /**
12
+ * The kinds of step a graph automation (schemaVersion >= 2) can contain. Legacy
13
+ * single-action rows are projected to a one-step graph at read/execution time.
14
+ */
15
+ export declare enum AutomationStepType {
16
+ MAGIC_PROMPT = "magic-prompt",
17
+ TRANSLATION = "translation",
18
+ COMPOSIO_ACTION = "composio-action",
19
+ FILTER = "filter"
20
+ }
21
+ /** Lifecycle status of an automation run and of each step within it. */
22
+ export declare enum AutomationRunStatus {
23
+ PENDING = "pending",
24
+ RUNNING = "running",
25
+ COMPLETED = "completed",
26
+ FAILED = "failed",
27
+ KILLED = "killed"
28
+ }
29
+ /**
30
+ * The data type flowing between trigger and steps in a graph. Used by the catalog
31
+ * to validate that each step accepts what the previous one emits.
32
+ */
33
+ export declare enum AutomationIOType {
34
+ FILE = "file",
35
+ MEDIA = "media",
36
+ INSIGHT = "insight",
37
+ NOTIFY = "notify"
38
+ }
10
39
  export declare enum AutomationRunType {
11
40
  INSTANT = "instant",
12
41
  SCHEDULE = "schedule"
@@ -1 +1 @@
1
- {"version":3,"file":"automation.d.ts","sourceRoot":"","sources":["../../src/enums/automation.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,QAAQ,aAAa;CACtB;AAED,oBAAY,gBAAgB;IAC1B,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;CAC5B;AAED,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAED,oBAAY,4BAA4B;IACtC,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,WAAW,cAAc;IACzB,YAAY,eAAe;IAC3B,SAAS,aAAa;CACvB;AAED,oBAAY,aAAa;IACvB,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,MAAM,WAAW;CAClB"}
1
+ {"version":3,"file":"automation.d.ts","sourceRoot":"","sources":["../../src/enums/automation.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,QAAQ,aAAa;IAErB,QAAQ,aAAa;CACtB;AAED,oBAAY,gBAAgB;IAC1B,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;CAC5B;AAED;;;GAGG;AACH,oBAAY,kBAAkB;IAC5B,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;IAC3B,eAAe,oBAAoB;IACnC,MAAM,WAAW;CAClB;AAED,wEAAwE;AACxE,oBAAY,mBAAmB;IAC7B,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,MAAM,WAAW;IAEjB,MAAM,WAAW;CAClB;AAED;;;GAGG;AACH,oBAAY,gBAAgB;IAC1B,IAAI,SAAS;IACb,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB;AAED,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAED,oBAAY,4BAA4B;IACtC,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,WAAW,cAAc;IACzB,YAAY,eAAe;IAC3B,SAAS,aAAa;CACvB;AAED,oBAAY,aAAa;IACvB,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,MAAM,WAAW;CAClB"}
@@ -3,12 +3,46 @@ export var AutomationTrigger;
3
3
  AutomationTrigger["FOLDERS"] = "folders";
4
4
  AutomationTrigger["TAGS"] = "tags";
5
5
  AutomationTrigger["KEYWORDS"] = "keywords";
6
+ // Reserved for the Composio integration slice; native execution ignores it for now.
7
+ AutomationTrigger["COMPOSIO"] = "composio";
6
8
  })(AutomationTrigger || (AutomationTrigger = {}));
7
9
  export var AutomationAction;
8
10
  (function (AutomationAction) {
9
11
  AutomationAction["MAGIC_PROMPT"] = "magic-prompt";
10
12
  AutomationAction["TRANSLATION"] = "translation";
11
13
  })(AutomationAction || (AutomationAction = {}));
14
+ /**
15
+ * The kinds of step a graph automation (schemaVersion >= 2) can contain. Legacy
16
+ * single-action rows are projected to a one-step graph at read/execution time.
17
+ */
18
+ export var AutomationStepType;
19
+ (function (AutomationStepType) {
20
+ AutomationStepType["MAGIC_PROMPT"] = "magic-prompt";
21
+ AutomationStepType["TRANSLATION"] = "translation";
22
+ AutomationStepType["COMPOSIO_ACTION"] = "composio-action";
23
+ AutomationStepType["FILTER"] = "filter";
24
+ })(AutomationStepType || (AutomationStepType = {}));
25
+ /** Lifecycle status of an automation run and of each step within it. */
26
+ export var AutomationRunStatus;
27
+ (function (AutomationRunStatus) {
28
+ AutomationRunStatus["PENDING"] = "pending";
29
+ AutomationRunStatus["RUNNING"] = "running";
30
+ AutomationRunStatus["COMPLETED"] = "completed";
31
+ AutomationRunStatus["FAILED"] = "failed";
32
+ // Filter step did not match: the run stops here without being an error.
33
+ AutomationRunStatus["KILLED"] = "killed";
34
+ })(AutomationRunStatus || (AutomationRunStatus = {}));
35
+ /**
36
+ * The data type flowing between trigger and steps in a graph. Used by the catalog
37
+ * to validate that each step accepts what the previous one emits.
38
+ */
39
+ export var AutomationIOType;
40
+ (function (AutomationIOType) {
41
+ AutomationIOType["FILE"] = "file";
42
+ AutomationIOType["MEDIA"] = "media";
43
+ AutomationIOType["INSIGHT"] = "insight";
44
+ AutomationIOType["NOTIFY"] = "notify";
45
+ })(AutomationIOType || (AutomationIOType = {}));
12
46
  export var AutomationRunType;
13
47
  (function (AutomationRunType) {
14
48
  AutomationRunType["INSTANT"] = "instant";
@@ -1 +1 @@
1
- {"version":3,"file":"automation.js","sourceRoot":"","sources":["../../src/enums/automation.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,kCAAa,CAAA;IACb,0CAAqB,CAAA;AACvB,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AAED,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,iDAA6B,CAAA;IAC7B,+CAA2B,CAAA;AAC7B,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B;AAED,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,0CAAqB,CAAA;AACvB,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAED,MAAM,CAAN,IAAY,4BAMX;AAND,WAAY,4BAA4B;IACtC,+CAAe,CAAA;IACf,uDAAuB,CAAA;IACvB,yDAAyB,CAAA;IACzB,2DAA2B,CAAA;IAC3B,sDAAsB,CAAA;AACxB,CAAC,EANW,4BAA4B,KAA5B,4BAA4B,QAMvC;AAED,MAAM,CAAN,IAAY,aAOX;AAPD,WAAY,aAAa;IACvB,0CAAyB,CAAA;IACzB,sCAAqB,CAAA;IACrB,gCAAe,CAAA;IACf,oCAAmB,CAAA;IACnB,wCAAuB,CAAA;IACvB,kCAAiB,CAAA;AACnB,CAAC,EAPW,aAAa,KAAb,aAAa,QAOxB"}
1
+ {"version":3,"file":"automation.js","sourceRoot":"","sources":["../../src/enums/automation.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,iBAMX;AAND,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,kCAAa,CAAA;IACb,0CAAqB,CAAA;IACrB,oFAAoF;IACpF,0CAAqB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CAAqB,CAAA;IACrB,gCAAe,CAAA;IACf,oCAAmB,CAAA;IACnB,wCAAuB,CAAA;IACvB,kCAAiB,CAAA;AACnB,CAAC,EAPW,aAAa,KAAb,aAAa,QAOxB"}
@@ -1,27 +1,61 @@
1
- import { AutomationTrigger, AutomationAction, AutomationRunType, AutomationScheduleTimePeriod, AssistantType, AllowedValuesMode } from '../enums/index.js';
1
+ import { AutomationTrigger, AutomationAction, AutomationRunType, AutomationScheduleTimePeriod, AutomationStepType, AutomationRunStatus, AssistantType, AllowedValuesMode } from '../enums/index.js';
2
+ /** Configuration of a magic-prompt action/step. Shared by the legacy action body and graph steps. */
3
+ export interface IAutomationMagicPromptConfig {
4
+ title: string;
5
+ assistantType: AssistantType;
6
+ assistantTemplateId: string;
7
+ prompt: string;
8
+ fieldId?: string;
9
+ fieldIds?: string[];
10
+ isIndividualFolder?: boolean;
11
+ allowedValues?: string[];
12
+ allowedValuesMode?: AllowedValuesMode;
13
+ otherValues?: boolean;
14
+ notApplicableValues?: string;
15
+ }
16
+ /** Configuration of a translation action/step. */
17
+ export interface IAutomationTranslationConfig {
18
+ targetLanguage: string;
19
+ }
2
20
  export interface IAutomationAction {
3
21
  type: AutomationAction;
4
- magicPrompt: {
5
- title: string;
6
- assistantType: AssistantType;
7
- assistantTemplateId: string;
8
- prompt: string;
9
- fieldId?: string;
10
- isIndividualFolder?: boolean;
11
- allowedValues?: string[];
12
- allowedValuesMode?: AllowedValuesMode;
13
- otherValues?: boolean;
14
- notApplicableValues?: string;
15
- };
16
- translation: {
17
- targetLanguage: string;
22
+ magicPrompt: IAutomationMagicPromptConfig;
23
+ translation: IAutomationTranslationConfig;
24
+ }
25
+ /** Configuration of a Composio integration step (reserved for the Composio slice). */
26
+ export interface IAutomationComposioConfig {
27
+ app: string;
28
+ action: string;
29
+ connectedAccountId?: string;
30
+ argsTemplate?: Record<string, unknown>;
31
+ destructive?: boolean;
32
+ acknowledged?: boolean;
33
+ }
34
+ /** A single condition inside a filter step. */
35
+ export interface IAutomationFilterRule {
36
+ field: string;
37
+ op: string;
38
+ value?: string | number;
39
+ }
40
+ /** A node in a graph automation (schemaVersion >= 2). */
41
+ export interface IAutomationStep {
42
+ stepId: string;
43
+ stepType: AutomationStepType;
44
+ magicPrompt?: IAutomationMagicPromptConfig;
45
+ translation?: IAutomationTranslationConfig;
46
+ composio?: IAutomationComposioConfig;
47
+ filter?: {
48
+ logic: 'AND' | 'OR';
49
+ rules: IAutomationFilterRule[];
18
50
  };
51
+ dependsOn?: string[];
19
52
  }
20
53
  export interface IAutomation {
21
54
  _id: string;
22
55
  automationId: string;
23
56
  name: string;
24
57
  description: string;
58
+ schemaVersion?: number;
25
59
  isActive: boolean;
26
60
  isUpdated: boolean;
27
61
  isDeleted: boolean;
@@ -30,8 +64,12 @@ export interface IAutomation {
30
64
  type: AutomationTrigger;
31
65
  folderIds: string[];
32
66
  values: string[];
67
+ provider?: 'speak' | 'composio';
68
+ app?: string;
69
+ triggerSlug?: string;
33
70
  };
34
71
  action: IAutomationAction;
72
+ steps?: IAutomationStep[];
35
73
  schedule: {
36
74
  timePeriod: AutomationScheduleTimePeriod;
37
75
  repeatAt: string;
@@ -43,4 +81,45 @@ export interface IAutomation {
43
81
  createdAt: Date;
44
82
  updatedAt: Date;
45
83
  }
84
+ /** Per-step execution record on a run. */
85
+ export interface IAutomationRunStep {
86
+ stepId: string;
87
+ stepType: AutomationStepType;
88
+ status: AutomationRunStatus;
89
+ startedAt?: Date;
90
+ finishedAt?: Date;
91
+ attemptCount?: number;
92
+ /**
93
+ * Executor config (magicPrompt/translation/filter/composio block) snapshotted at
94
+ * run creation, so resuming a deferred step cannot be misaligned by a mid-flight
95
+ * edit to the automation. Absent on runs created before snapshots shipped.
96
+ */
97
+ config?: Record<string, unknown>;
98
+ output?: Record<string, unknown>;
99
+ error?: string;
100
+ }
101
+ /** One document per automation execution (graph engine run ledger). */
102
+ export interface IAutomationRun {
103
+ _id: string;
104
+ runId: string;
105
+ automationId: string;
106
+ companyId: string;
107
+ userId: string;
108
+ schemaVersion: number;
109
+ externalEventId?: string;
110
+ status: AutomationRunStatus;
111
+ trigger: {
112
+ source: string;
113
+ mediaId?: string;
114
+ folderId?: string;
115
+ payload?: Record<string, unknown>;
116
+ };
117
+ awaitingMediaId?: string;
118
+ nextStepId?: string;
119
+ /** Run-level failure reason (deferred-seam failures, stale-run sweep). */
120
+ error?: string;
121
+ steps: IAutomationRunStep[];
122
+ createdAt: Date;
123
+ updatedAt: Date;
124
+ }
46
125
  //# sourceMappingURL=automation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"automation.d.ts","sourceRoot":"","sources":["../../src/interfaces/automation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,4BAA4B,EAC5B,aAAa,EACb,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,gBAAgB,CAAC;IACvB,WAAW,EAAE;QACX,KAAK,EAAE,MAAM,CAAC;QACd,aAAa,EAAE,aAAa,CAAC;QAC7B,mBAAmB,EAAE,MAAM,CAAC;QAC5B,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;QACzB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;QACtC,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,mBAAmB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;IACF,WAAW,EAAE;QACX,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;CACH;AAED,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,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AE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IAEtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC,CAAC;IACF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB"}
@@ -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;;;;;;GAM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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.12.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",