@absolutejs/voice 0.0.22-beta.501 → 0.0.22-beta.502

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,80 @@
1
+ import type { StoredVoiceTraceEvent } from "../trace";
2
+ import type { VoiceCallReviewArtifact } from "../testing/review";
3
+ import { type VoiceCostDashboardBucket, type VoiceCostDashboardOptions, type VoiceCostDashboardReport } from "./costDashboard";
4
+ import { type LiveCallViewState, type LiveCallViewer } from "./liveCallViewer";
5
+ import { type ReplayTimelineReport } from "./replayTimeline";
6
+ export type VoiceDashboardHTMXAttributes = {
7
+ /** Set true to wrap the fragment in an hx-get + hx-trigger="every Ns" polling shell. */
8
+ poll?: boolean;
9
+ /** Polling cadence when poll is true. Default 5 seconds. */
10
+ pollIntervalMs?: number;
11
+ /** Route the renderer points hx-get at. Default mirrors the route the handler is mounted on. */
12
+ refreshUrl?: string;
13
+ /** hx-swap value. Default 'outerHTML'. */
14
+ swap?: string;
15
+ };
16
+ export type VoiceCostDashboardHTMXInput = {
17
+ attributes?: VoiceDashboardHTMXAttributes;
18
+ currency?: string;
19
+ emptyMessage?: string;
20
+ report: VoiceCostDashboardReport;
21
+ title?: string;
22
+ };
23
+ export type VoiceCostDashboardRenderer = (input: VoiceCostDashboardHTMXInput) => string;
24
+ export type VoiceCostDashboardCellRenderer = (bucket: VoiceCostDashboardBucket, currency: string, isTotal: boolean) => string;
25
+ export type VoiceReplayTimelineHTMXInput = {
26
+ attributes?: VoiceDashboardHTMXAttributes;
27
+ emptyMessage?: string;
28
+ report: ReplayTimelineReport;
29
+ title?: string;
30
+ };
31
+ export type VoiceReplayTimelineRenderer = (input: VoiceReplayTimelineHTMXInput) => string;
32
+ export type VoiceLiveCallViewerHTMXInput = {
33
+ attributes?: VoiceDashboardHTMXAttributes;
34
+ state: LiveCallViewState;
35
+ title?: string;
36
+ };
37
+ export type VoiceLiveCallViewerRenderer = (input: VoiceLiveCallViewerHTMXInput) => string;
38
+ export type VoiceDashboardHTMXRendererConfig = {
39
+ costDashboard?: VoiceCostDashboardRenderer;
40
+ liveCallViewer?: VoiceLiveCallViewerRenderer;
41
+ replayTimeline?: VoiceReplayTimelineRenderer;
42
+ };
43
+ export type ResolvedVoiceDashboardRenderers = Required<VoiceDashboardHTMXRendererConfig>;
44
+ export declare const resolveVoiceDashboardRenderers: (custom?: VoiceDashboardHTMXRendererConfig) => ResolvedVoiceDashboardRenderers;
45
+ export declare const renderVoiceCostDashboardHTMX: (input: VoiceCostDashboardHTMXInput & {
46
+ custom?: VoiceCostDashboardRenderer;
47
+ }) => string;
48
+ export declare const renderVoiceReplayTimelineHTMX: (input: VoiceReplayTimelineHTMXInput & {
49
+ custom?: VoiceReplayTimelineRenderer;
50
+ }) => string;
51
+ export declare const renderVoiceLiveCallViewerHTMX: (input: VoiceLiveCallViewerHTMXInput & {
52
+ custom?: VoiceLiveCallViewerRenderer;
53
+ }) => string;
54
+ export declare const renderVoiceCostDashboardFromEvents: (input: {
55
+ attributes?: VoiceDashboardHTMXAttributes;
56
+ currency?: string;
57
+ events: ReadonlyArray<StoredVoiceTraceEvent>;
58
+ options?: Omit<VoiceCostDashboardOptions, "events">;
59
+ renderer?: VoiceCostDashboardRenderer;
60
+ title?: string;
61
+ }) => string;
62
+ export declare const renderVoiceReplayTimelineFromArtifact: (input: {
63
+ artifact: VoiceCallReviewArtifact;
64
+ attributes?: VoiceDashboardHTMXAttributes;
65
+ renderer?: VoiceReplayTimelineRenderer;
66
+ title?: string;
67
+ }) => string;
68
+ export declare const renderVoiceLiveCallViewerFromViewer: (input: {
69
+ attributes?: VoiceDashboardHTMXAttributes;
70
+ renderer?: VoiceLiveCallViewerRenderer;
71
+ title?: string;
72
+ viewer: LiveCallViewer;
73
+ }) => string;
74
+ export declare const renderVoiceLiveCallViewerFromState: (input: {
75
+ attributes?: VoiceDashboardHTMXAttributes;
76
+ renderer?: VoiceLiveCallViewerRenderer;
77
+ state: LiveCallViewState;
78
+ title?: string;
79
+ }) => string;
80
+ export declare const createLiveCallViewerFromOptions: (options: import("./liveCallViewer").CreateLiveCallViewerOptions) => LiveCallViewer;
@@ -0,0 +1,249 @@
1
+ import { Elysia } from "elysia";
2
+ import type { StoredVoiceTraceEvent, VoiceTraceEventStore } from "./trace";
3
+ import type { StoredVoiceCallReviewArtifact, VoiceCallReviewStore } from "./testing/review";
4
+ import type { LiveCallViewer } from "./client/liveCallViewer";
5
+ import { type VoiceDashboardHTMXRendererConfig } from "./client/htmxDashboardRenderers";
6
+ import type { VoiceCostDashboardOptions } from "./client/costDashboard";
7
+ export type VoiceHTMXDashboardRoutesShared = {
8
+ name?: string;
9
+ render?: VoiceDashboardHTMXRendererConfig;
10
+ };
11
+ export type VoiceHTMXCostDashboardRoutesOptions = VoiceHTMXDashboardRoutesShared & {
12
+ bucketBy?: VoiceCostDashboardOptions["bucketBy"];
13
+ currency?: string;
14
+ fromMs?: () => number | undefined;
15
+ path?: string;
16
+ pollIntervalMs?: number;
17
+ resolveEvents: () => Promise<ReadonlyArray<StoredVoiceTraceEvent>> | ReadonlyArray<StoredVoiceTraceEvent>;
18
+ title?: string;
19
+ toMs?: () => number | undefined;
20
+ };
21
+ export declare const createVoiceCostDashboardHTMXRoute: (options: VoiceHTMXCostDashboardRoutesOptions) => Elysia<"", {
22
+ decorator: {};
23
+ store: {};
24
+ derive: {};
25
+ resolve: {};
26
+ }, {
27
+ typebox: {};
28
+ error: {};
29
+ }, {
30
+ schema: {};
31
+ standaloneSchema: {};
32
+ macro: {};
33
+ macroFn: {};
34
+ parser: {};
35
+ response: {};
36
+ }, {
37
+ [x: string]: {
38
+ get: {
39
+ body: unknown;
40
+ params: {};
41
+ query: unknown;
42
+ headers: unknown;
43
+ response: {
44
+ 200: Response;
45
+ };
46
+ };
47
+ };
48
+ }, {
49
+ derive: {};
50
+ resolve: {};
51
+ schema: {};
52
+ standaloneSchema: {};
53
+ response: {};
54
+ }, {
55
+ derive: {};
56
+ resolve: {};
57
+ schema: {};
58
+ standaloneSchema: {};
59
+ response: {};
60
+ }>;
61
+ export type VoiceHTMXReplayTimelineRoutesOptions = VoiceHTMXDashboardRoutesShared & {
62
+ /** The HTML route mounts at `${path}/:artifactId`. */
63
+ path?: string;
64
+ resolveArtifact: (artifactId: string) => Promise<StoredVoiceCallReviewArtifact | undefined> | StoredVoiceCallReviewArtifact | undefined;
65
+ title?: string;
66
+ };
67
+ export declare const createVoiceReplayTimelineHTMXRoute: (options: VoiceHTMXReplayTimelineRoutesOptions) => Elysia<"", {
68
+ decorator: {};
69
+ store: {};
70
+ derive: {};
71
+ resolve: {};
72
+ }, {
73
+ typebox: {};
74
+ error: {};
75
+ }, {
76
+ schema: {};
77
+ standaloneSchema: {};
78
+ macro: {};
79
+ macroFn: {};
80
+ parser: {};
81
+ response: {};
82
+ }, {
83
+ [x: string]: {
84
+ ":artifactId": {
85
+ get: {
86
+ body: unknown;
87
+ params: {
88
+ artifactId: string;
89
+ } & {};
90
+ query: unknown;
91
+ headers: unknown;
92
+ response: {
93
+ 200: Response;
94
+ 422: {
95
+ type: "validation";
96
+ on: string;
97
+ summary?: string;
98
+ message?: string;
99
+ found?: unknown;
100
+ property?: string;
101
+ expected?: string;
102
+ };
103
+ };
104
+ };
105
+ };
106
+ };
107
+ }, {
108
+ derive: {};
109
+ resolve: {};
110
+ schema: {};
111
+ standaloneSchema: {};
112
+ response: {};
113
+ }, {
114
+ derive: {};
115
+ resolve: {};
116
+ schema: {};
117
+ standaloneSchema: {};
118
+ response: {};
119
+ }>;
120
+ export type VoiceHTMXLiveCallViewerRoutesOptions = VoiceHTMXDashboardRoutesShared & {
121
+ /** Route mounts at `${path}/:sessionId`. */
122
+ path?: string;
123
+ pollIntervalMs?: number;
124
+ resolveViewer: (sessionId: string) => Promise<LiveCallViewer | undefined> | LiveCallViewer | undefined;
125
+ title?: string;
126
+ };
127
+ export declare const createVoiceLiveCallViewerHTMXRoute: (options: VoiceHTMXLiveCallViewerRoutesOptions) => Elysia<"", {
128
+ decorator: {};
129
+ store: {};
130
+ derive: {};
131
+ resolve: {};
132
+ }, {
133
+ typebox: {};
134
+ error: {};
135
+ }, {
136
+ schema: {};
137
+ standaloneSchema: {};
138
+ macro: {};
139
+ macroFn: {};
140
+ parser: {};
141
+ response: {};
142
+ }, {
143
+ [x: string]: {
144
+ ":sessionId": {
145
+ get: {
146
+ body: unknown;
147
+ params: {
148
+ sessionId: string;
149
+ } & {};
150
+ query: unknown;
151
+ headers: unknown;
152
+ response: {
153
+ 200: Response;
154
+ 422: {
155
+ type: "validation";
156
+ on: string;
157
+ summary?: string;
158
+ message?: string;
159
+ found?: unknown;
160
+ property?: string;
161
+ expected?: string;
162
+ };
163
+ };
164
+ };
165
+ };
166
+ };
167
+ }, {
168
+ derive: {};
169
+ resolve: {};
170
+ schema: {};
171
+ standaloneSchema: {};
172
+ response: {};
173
+ }, {
174
+ derive: {};
175
+ resolve: {};
176
+ schema: {};
177
+ standaloneSchema: {};
178
+ response: {};
179
+ }>;
180
+ export type VoiceHTMXDashboardRoutesOptions = {
181
+ cost?: Omit<VoiceHTMXCostDashboardRoutesOptions, keyof VoiceHTMXDashboardRoutesShared>;
182
+ liveCall?: Omit<VoiceHTMXLiveCallViewerRoutesOptions, keyof VoiceHTMXDashboardRoutesShared>;
183
+ name?: string;
184
+ render?: VoiceDashboardHTMXRendererConfig;
185
+ replay?: Omit<VoiceHTMXReplayTimelineRoutesOptions, keyof VoiceHTMXDashboardRoutesShared>;
186
+ };
187
+ export declare const createVoiceHTMXDashboardRoutes: (options: VoiceHTMXDashboardRoutesOptions) => Elysia<"", {
188
+ decorator: {};
189
+ store: {};
190
+ derive: {};
191
+ resolve: {};
192
+ }, {
193
+ typebox: {};
194
+ error: {};
195
+ }, {
196
+ schema: {};
197
+ standaloneSchema: {};
198
+ macro: {};
199
+ macroFn: {};
200
+ parser: {};
201
+ response: {};
202
+ }, {}, {
203
+ derive: {};
204
+ resolve: {};
205
+ schema: {};
206
+ standaloneSchema: {};
207
+ response: {};
208
+ }, {
209
+ derive: {};
210
+ resolve: {};
211
+ schema: {};
212
+ standaloneSchema: {};
213
+ response: {};
214
+ }>;
215
+ export type CreateVoiceHTMXDashboardRoutesFromStoresOptions = {
216
+ liveViewerByCallId?: (sessionId: string) => Promise<LiveCallViewer | undefined> | LiveCallViewer | undefined;
217
+ pollIntervalMs?: number;
218
+ render?: VoiceDashboardHTMXRendererConfig;
219
+ reviewStore?: VoiceCallReviewStore;
220
+ traceStore?: VoiceTraceEventStore;
221
+ };
222
+ export declare const createVoiceHTMXDashboardRoutesFromStores: (options: CreateVoiceHTMXDashboardRoutesFromStoresOptions) => Elysia<"", {
223
+ decorator: {};
224
+ store: {};
225
+ derive: {};
226
+ resolve: {};
227
+ }, {
228
+ typebox: {};
229
+ error: {};
230
+ }, {
231
+ schema: {};
232
+ standaloneSchema: {};
233
+ macro: {};
234
+ macroFn: {};
235
+ parser: {};
236
+ response: {};
237
+ }, {}, {
238
+ derive: {};
239
+ resolve: {};
240
+ schema: {};
241
+ standaloneSchema: {};
242
+ response: {};
243
+ }, {
244
+ derive: {};
245
+ resolve: {};
246
+ schema: {};
247
+ standaloneSchema: {};
248
+ response: {};
249
+ }>;
@@ -51,7 +51,7 @@ export declare const VoiceCostDashboard: import("vue").DefineComponent<import("v
51
51
  toMs: NumberConstructor;
52
52
  }>> & Readonly<{}>, {
53
53
  title: string;
54
- bucketBy: "day" | "hour" | "month" | undefined;
55
54
  currency: string;
56
55
  emptyMessage: string;
56
+ bucketBy: "day" | "hour" | "month" | undefined;
57
57
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.501",
3
+ "version": "0.0.22-beta.502",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",