@absolutejs/voice 0.0.22-beta.125 → 0.0.22-beta.127
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 +236 -26
- package/dist/agent.d.ts +5 -0
- package/dist/angular/index.d.ts +1 -1
- package/dist/angular/index.js +16 -16
- package/dist/angular/voice-ops-status.service.d.ts +12 -0
- package/dist/audit.d.ts +128 -0
- package/dist/auditDeliveryRoutes.d.ts +85 -0
- package/dist/auditExport.d.ts +34 -0
- package/dist/auditRoutes.d.ts +66 -0
- package/dist/auditSinks.d.ts +133 -0
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +11 -11
- package/dist/client/opsStatus.d.ts +19 -0
- package/dist/client/opsStatusWidget.d.ts +7 -7
- package/dist/dataControl.d.ts +47 -0
- package/dist/demoReadyRoutes.d.ts +98 -0
- package/dist/fileStore.d.ts +8 -2
- package/dist/index.d.ts +27 -6
- package/dist/index.js +14600 -12518
- package/dist/opsStatus.d.ts +65 -0
- package/dist/opsStatusRoutes.d.ts +33 -0
- package/dist/phoneAgent.d.ts +4 -0
- package/dist/phoneAgentProductionSmoke.d.ts +115 -0
- package/dist/postgresStore.d.ts +8 -2
- package/dist/productionReadiness.d.ts +94 -0
- package/dist/providerRoutingContract.d.ts +38 -0
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +16 -16
- package/dist/react/useVoiceOpsStatus.d.ts +8 -0
- package/dist/sqliteStore.d.ts +8 -2
- package/dist/svelte/createVoiceOpsStatus.d.ts +2 -2
- package/dist/svelte/index.d.ts +0 -1
- package/dist/svelte/index.js +72 -75
- package/dist/traceDeliveryRoutes.d.ts +86 -0
- package/dist/vue/index.d.ts +1 -1
- package/dist/vue/index.js +15 -15
- package/dist/vue/useVoiceOpsStatus.d.ts +9 -0
- package/package.json +1 -1
- package/dist/angular/voice-app-kit-status.service.d.ts +0 -12
- package/dist/appKit.d.ts +0 -100
- package/dist/client/appKitStatus.d.ts +0 -19
- package/dist/react/useVoiceAppKitStatus.d.ts +0 -8
- package/dist/svelte/createVoiceAppKitStatus.d.ts +0 -8
- package/dist/vue/useVoiceAppKitStatus.d.ts +0 -9
package/dist/audit.d.ts
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
export type VoiceAuditEventType = 'handoff' | 'operator.action' | 'provider.call' | 'retention.policy' | 'tool.call';
|
|
2
|
+
export type VoiceAuditActor = {
|
|
3
|
+
id: string;
|
|
4
|
+
kind: 'agent' | 'operator' | 'system' | 'worker';
|
|
5
|
+
name?: string;
|
|
6
|
+
};
|
|
7
|
+
export type VoiceAuditResource = {
|
|
8
|
+
id?: string;
|
|
9
|
+
type: string;
|
|
10
|
+
};
|
|
11
|
+
export type VoiceAuditOutcome = 'error' | 'skipped' | 'success';
|
|
12
|
+
export type VoiceAuditEvent<TPayload extends Record<string, unknown> = Record<string, unknown>> = {
|
|
13
|
+
action: string;
|
|
14
|
+
actor?: VoiceAuditActor;
|
|
15
|
+
at?: number;
|
|
16
|
+
id?: string;
|
|
17
|
+
metadata?: Record<string, unknown>;
|
|
18
|
+
outcome?: VoiceAuditOutcome;
|
|
19
|
+
payload?: TPayload;
|
|
20
|
+
resource?: VoiceAuditResource;
|
|
21
|
+
sessionId?: string;
|
|
22
|
+
traceId?: string;
|
|
23
|
+
type: VoiceAuditEventType;
|
|
24
|
+
};
|
|
25
|
+
export type StoredVoiceAuditEvent<TPayload extends Record<string, unknown> = Record<string, unknown>> = Omit<VoiceAuditEvent<TPayload>, 'at' | 'id'> & {
|
|
26
|
+
at: number;
|
|
27
|
+
id: string;
|
|
28
|
+
};
|
|
29
|
+
export type VoiceAuditEventFilter = {
|
|
30
|
+
actorId?: string;
|
|
31
|
+
after?: number;
|
|
32
|
+
afterOrAt?: number;
|
|
33
|
+
before?: number;
|
|
34
|
+
beforeOrAt?: number;
|
|
35
|
+
limit?: number;
|
|
36
|
+
outcome?: VoiceAuditOutcome | VoiceAuditOutcome[];
|
|
37
|
+
resourceId?: string;
|
|
38
|
+
resourceType?: string;
|
|
39
|
+
sessionId?: string;
|
|
40
|
+
traceId?: string;
|
|
41
|
+
type?: VoiceAuditEventType | VoiceAuditEventType[];
|
|
42
|
+
};
|
|
43
|
+
export type VoiceAuditEventStore<TEvent extends StoredVoiceAuditEvent = StoredVoiceAuditEvent> = {
|
|
44
|
+
append: (event: VoiceAuditEvent | TEvent) => Promise<TEvent> | TEvent;
|
|
45
|
+
get: (id: string) => Promise<TEvent | undefined> | TEvent | undefined;
|
|
46
|
+
list: (filter?: VoiceAuditEventFilter) => Promise<TEvent[]> | TEvent[];
|
|
47
|
+
};
|
|
48
|
+
export type VoiceAuditLogger = {
|
|
49
|
+
handoff: (input: Omit<VoiceHandoffAuditEventInput, 'store'>) => Promise<StoredVoiceAuditEvent> | StoredVoiceAuditEvent;
|
|
50
|
+
operatorAction: (input: Omit<VoiceOperatorAuditEventInput, 'store'>) => Promise<StoredVoiceAuditEvent> | StoredVoiceAuditEvent;
|
|
51
|
+
providerCall: (input: Omit<VoiceProviderAuditEventInput, 'store'>) => Promise<StoredVoiceAuditEvent> | StoredVoiceAuditEvent;
|
|
52
|
+
record: (event: VoiceAuditEvent) => Promise<StoredVoiceAuditEvent> | StoredVoiceAuditEvent;
|
|
53
|
+
retention: (input: Omit<VoiceRetentionAuditEventInput, 'store'>) => Promise<StoredVoiceAuditEvent> | StoredVoiceAuditEvent;
|
|
54
|
+
toolCall: (input: Omit<VoiceToolAuditEventInput, 'store'>) => Promise<StoredVoiceAuditEvent> | StoredVoiceAuditEvent;
|
|
55
|
+
};
|
|
56
|
+
export type VoiceProviderAuditEventInput = {
|
|
57
|
+
actor?: VoiceAuditActor;
|
|
58
|
+
cost?: Record<string, unknown>;
|
|
59
|
+
elapsedMs?: number;
|
|
60
|
+
error?: string;
|
|
61
|
+
kind: 'llm' | 'stt' | 'tts' | string;
|
|
62
|
+
metadata?: Record<string, unknown>;
|
|
63
|
+
model?: string;
|
|
64
|
+
outcome: VoiceAuditOutcome;
|
|
65
|
+
provider: string;
|
|
66
|
+
sessionId?: string;
|
|
67
|
+
store: VoiceAuditEventStore;
|
|
68
|
+
traceId?: string;
|
|
69
|
+
};
|
|
70
|
+
export type VoiceToolAuditEventInput = {
|
|
71
|
+
actor?: VoiceAuditActor;
|
|
72
|
+
elapsedMs?: number;
|
|
73
|
+
error?: string;
|
|
74
|
+
metadata?: Record<string, unknown>;
|
|
75
|
+
outcome: VoiceAuditOutcome;
|
|
76
|
+
sessionId?: string;
|
|
77
|
+
store: VoiceAuditEventStore;
|
|
78
|
+
toolCallId?: string;
|
|
79
|
+
toolName: string;
|
|
80
|
+
traceId?: string;
|
|
81
|
+
};
|
|
82
|
+
export type VoiceHandoffAuditEventInput = {
|
|
83
|
+
actor?: VoiceAuditActor;
|
|
84
|
+
fromAgentId?: string;
|
|
85
|
+
metadata?: Record<string, unknown>;
|
|
86
|
+
outcome: VoiceAuditOutcome;
|
|
87
|
+
reason?: string;
|
|
88
|
+
sessionId?: string;
|
|
89
|
+
store: VoiceAuditEventStore;
|
|
90
|
+
target?: string;
|
|
91
|
+
toAgentId?: string;
|
|
92
|
+
traceId?: string;
|
|
93
|
+
};
|
|
94
|
+
export type VoiceRetentionAuditEventInput = {
|
|
95
|
+
actor?: VoiceAuditActor;
|
|
96
|
+
dryRun: boolean;
|
|
97
|
+
metadata?: Record<string, unknown>;
|
|
98
|
+
report: {
|
|
99
|
+
deletedCount: number;
|
|
100
|
+
scopes: Array<{
|
|
101
|
+
deletedCount: number;
|
|
102
|
+
scope: string;
|
|
103
|
+
skippedReason?: string;
|
|
104
|
+
}>;
|
|
105
|
+
};
|
|
106
|
+
store: VoiceAuditEventStore;
|
|
107
|
+
};
|
|
108
|
+
export type VoiceOperatorAuditEventInput = {
|
|
109
|
+
action: string;
|
|
110
|
+
actor: VoiceAuditActor;
|
|
111
|
+
metadata?: Record<string, unknown>;
|
|
112
|
+
outcome?: VoiceAuditOutcome;
|
|
113
|
+
payload?: Record<string, unknown>;
|
|
114
|
+
resource?: VoiceAuditResource;
|
|
115
|
+
sessionId?: string;
|
|
116
|
+
store: VoiceAuditEventStore;
|
|
117
|
+
traceId?: string;
|
|
118
|
+
};
|
|
119
|
+
export declare const createVoiceAuditEvent: <TPayload extends Record<string, unknown> = Record<string, unknown>>(event: VoiceAuditEvent<TPayload>) => StoredVoiceAuditEvent<TPayload>;
|
|
120
|
+
export declare const filterVoiceAuditEvents: <TEvent extends StoredVoiceAuditEvent = StoredVoiceAuditEvent>(events: TEvent[], filter?: VoiceAuditEventFilter) => TEvent[];
|
|
121
|
+
export declare const createVoiceMemoryAuditEventStore: <TEvent extends StoredVoiceAuditEvent = StoredVoiceAuditEvent>() => VoiceAuditEventStore<TEvent>;
|
|
122
|
+
export declare const recordVoiceAuditEvent: (store: VoiceAuditEventStore, event: VoiceAuditEvent) => StoredVoiceAuditEvent<Record<string, unknown>> | Promise<StoredVoiceAuditEvent<Record<string, unknown>>>;
|
|
123
|
+
export declare const recordVoiceProviderAuditEvent: (input: VoiceProviderAuditEventInput) => StoredVoiceAuditEvent<Record<string, unknown>> | Promise<StoredVoiceAuditEvent<Record<string, unknown>>>;
|
|
124
|
+
export declare const recordVoiceToolAuditEvent: (input: VoiceToolAuditEventInput) => StoredVoiceAuditEvent<Record<string, unknown>> | Promise<StoredVoiceAuditEvent<Record<string, unknown>>>;
|
|
125
|
+
export declare const recordVoiceHandoffAuditEvent: (input: VoiceHandoffAuditEventInput) => StoredVoiceAuditEvent<Record<string, unknown>> | Promise<StoredVoiceAuditEvent<Record<string, unknown>>>;
|
|
126
|
+
export declare const recordVoiceRetentionAuditEvent: (input: VoiceRetentionAuditEventInput) => StoredVoiceAuditEvent<Record<string, unknown>> | Promise<StoredVoiceAuditEvent<Record<string, unknown>>>;
|
|
127
|
+
export declare const recordVoiceOperatorAuditEvent: (input: VoiceOperatorAuditEventInput) => StoredVoiceAuditEvent<Record<string, unknown>> | Promise<StoredVoiceAuditEvent<Record<string, unknown>>>;
|
|
128
|
+
export declare const createVoiceAuditLogger: (store: VoiceAuditEventStore) => VoiceAuditLogger;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import { type VoiceAuditSinkDeliveryQueueStatus, type VoiceAuditSinkDeliveryQueueSummary, type VoiceAuditSinkDeliveryRecord, type VoiceAuditSinkDeliveryStore, type VoiceAuditSinkDeliveryWorkerResult } from './auditSinks';
|
|
3
|
+
export type VoiceAuditDeliveryReport = {
|
|
4
|
+
checkedAt: number;
|
|
5
|
+
deliveries: VoiceAuditSinkDeliveryRecord[];
|
|
6
|
+
filter: VoiceAuditDeliveryFilter;
|
|
7
|
+
summary: VoiceAuditSinkDeliveryQueueSummary;
|
|
8
|
+
};
|
|
9
|
+
export type VoiceAuditDeliveryDrainWorker = {
|
|
10
|
+
drain: () => Promise<VoiceAuditSinkDeliveryWorkerResult> | VoiceAuditSinkDeliveryWorkerResult;
|
|
11
|
+
};
|
|
12
|
+
export type VoiceAuditDeliveryDrainReport = VoiceAuditSinkDeliveryWorkerResult & {
|
|
13
|
+
drainedAt: number;
|
|
14
|
+
};
|
|
15
|
+
export type VoiceAuditDeliveryFilter = {
|
|
16
|
+
limit?: number;
|
|
17
|
+
q?: string;
|
|
18
|
+
status?: VoiceAuditSinkDeliveryQueueStatus | 'all';
|
|
19
|
+
};
|
|
20
|
+
export type VoiceAuditDeliveryRoutesOptions = {
|
|
21
|
+
deadLetters?: VoiceAuditSinkDeliveryStore;
|
|
22
|
+
filter?: VoiceAuditDeliveryFilter;
|
|
23
|
+
headers?: HeadersInit;
|
|
24
|
+
htmlPath?: false | string;
|
|
25
|
+
limit?: number;
|
|
26
|
+
name?: string;
|
|
27
|
+
path?: string;
|
|
28
|
+
render?: (report: VoiceAuditDeliveryReport) => string | Promise<string>;
|
|
29
|
+
store: VoiceAuditSinkDeliveryStore;
|
|
30
|
+
title?: string;
|
|
31
|
+
worker?: VoiceAuditDeliveryDrainWorker;
|
|
32
|
+
workerPath?: false | string;
|
|
33
|
+
};
|
|
34
|
+
export declare const resolveVoiceAuditDeliveryFilter: (query?: Record<string, unknown>, base?: VoiceAuditDeliveryFilter) => VoiceAuditDeliveryFilter;
|
|
35
|
+
export declare const buildVoiceAuditDeliveryReport: (options: VoiceAuditDeliveryRoutesOptions, filter?: VoiceAuditDeliveryFilter) => Promise<VoiceAuditDeliveryReport>;
|
|
36
|
+
export declare const renderVoiceAuditDeliveryHTML: (report: VoiceAuditDeliveryReport, options?: {
|
|
37
|
+
title?: string;
|
|
38
|
+
workerPath?: false | string;
|
|
39
|
+
}) => string;
|
|
40
|
+
export declare const createVoiceAuditDeliveryJSONHandler: (options: VoiceAuditDeliveryRoutesOptions) => ({ query }: {
|
|
41
|
+
query?: Record<string, string | undefined>;
|
|
42
|
+
}) => Promise<VoiceAuditDeliveryReport>;
|
|
43
|
+
export declare const createVoiceAuditDeliveryHTMLHandler: (options: VoiceAuditDeliveryRoutesOptions) => ({ query }: {
|
|
44
|
+
query?: Record<string, string | undefined>;
|
|
45
|
+
}) => Promise<Response>;
|
|
46
|
+
export declare const createVoiceAuditDeliveryRoutes: (options: VoiceAuditDeliveryRoutesOptions) => Elysia<"", {
|
|
47
|
+
decorator: {};
|
|
48
|
+
store: {};
|
|
49
|
+
derive: {};
|
|
50
|
+
resolve: {};
|
|
51
|
+
}, {
|
|
52
|
+
typebox: {};
|
|
53
|
+
error: {};
|
|
54
|
+
}, {
|
|
55
|
+
schema: {};
|
|
56
|
+
standaloneSchema: {};
|
|
57
|
+
macro: {};
|
|
58
|
+
macroFn: {};
|
|
59
|
+
parser: {};
|
|
60
|
+
response: {};
|
|
61
|
+
}, {
|
|
62
|
+
[x: string]: {
|
|
63
|
+
get: {
|
|
64
|
+
body: unknown;
|
|
65
|
+
params: {};
|
|
66
|
+
query: unknown;
|
|
67
|
+
headers: unknown;
|
|
68
|
+
response: {
|
|
69
|
+
200: VoiceAuditDeliveryReport;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
}, {
|
|
74
|
+
derive: {};
|
|
75
|
+
resolve: {};
|
|
76
|
+
schema: {};
|
|
77
|
+
standaloneSchema: {};
|
|
78
|
+
response: {};
|
|
79
|
+
}, {
|
|
80
|
+
derive: {};
|
|
81
|
+
resolve: {};
|
|
82
|
+
schema: {};
|
|
83
|
+
standaloneSchema: {};
|
|
84
|
+
response: {};
|
|
85
|
+
}>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { StoredVoiceAuditEvent, VoiceAuditEventFilter, VoiceAuditEventStore } from './audit';
|
|
2
|
+
import { type VoiceTraceRedactionConfig } from './trace';
|
|
3
|
+
import { type VoiceAuditTrailSummary } from './auditRoutes';
|
|
4
|
+
export type VoiceAuditExport = {
|
|
5
|
+
events: StoredVoiceAuditEvent[];
|
|
6
|
+
exportedAt: number;
|
|
7
|
+
filter?: VoiceAuditEventFilter;
|
|
8
|
+
redacted: boolean;
|
|
9
|
+
summary: VoiceAuditTrailSummary;
|
|
10
|
+
};
|
|
11
|
+
export declare const redactVoiceAuditEvent: <TEvent extends StoredVoiceAuditEvent = StoredVoiceAuditEvent>(event: TEvent, options?: VoiceTraceRedactionConfig) => TEvent;
|
|
12
|
+
export declare const redactVoiceAuditEvents: <TEvent extends StoredVoiceAuditEvent = StoredVoiceAuditEvent>(events: TEvent[], options?: VoiceTraceRedactionConfig) => TEvent[];
|
|
13
|
+
export declare const exportVoiceAuditTrail: (input: {
|
|
14
|
+
filter?: VoiceAuditEventFilter;
|
|
15
|
+
redact?: VoiceTraceRedactionConfig;
|
|
16
|
+
store: VoiceAuditEventStore;
|
|
17
|
+
}) => Promise<VoiceAuditExport>;
|
|
18
|
+
export declare const renderVoiceAuditMarkdown: (events: StoredVoiceAuditEvent[], options?: {
|
|
19
|
+
redact?: VoiceTraceRedactionConfig;
|
|
20
|
+
title?: string;
|
|
21
|
+
}) => string;
|
|
22
|
+
export declare const renderVoiceAuditHTML: (events: StoredVoiceAuditEvent[], options?: {
|
|
23
|
+
redact?: VoiceTraceRedactionConfig;
|
|
24
|
+
title?: string;
|
|
25
|
+
}) => string;
|
|
26
|
+
export declare const buildVoiceAuditExport: (events: StoredVoiceAuditEvent[], options?: {
|
|
27
|
+
redact?: VoiceTraceRedactionConfig;
|
|
28
|
+
title?: string;
|
|
29
|
+
}) => {
|
|
30
|
+
events: StoredVoiceAuditEvent[];
|
|
31
|
+
html: string;
|
|
32
|
+
markdown: string;
|
|
33
|
+
summary: VoiceAuditTrailSummary;
|
|
34
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import type { StoredVoiceAuditEvent, VoiceAuditEventFilter, VoiceAuditEventStore, VoiceAuditEventType } from './audit';
|
|
3
|
+
export type VoiceAuditTrailSummary = {
|
|
4
|
+
byActor: Array<[string, number]>;
|
|
5
|
+
byOutcome: Array<[string, number]>;
|
|
6
|
+
byResourceType: Array<[string, number]>;
|
|
7
|
+
byType: Array<[VoiceAuditEventType, number]>;
|
|
8
|
+
errors: number;
|
|
9
|
+
latestAt?: number;
|
|
10
|
+
total: number;
|
|
11
|
+
};
|
|
12
|
+
export type VoiceAuditTrailReport = {
|
|
13
|
+
checkedAt: number;
|
|
14
|
+
events: StoredVoiceAuditEvent[];
|
|
15
|
+
filter: VoiceAuditEventFilter;
|
|
16
|
+
summary: VoiceAuditTrailSummary;
|
|
17
|
+
};
|
|
18
|
+
export type VoiceAuditTrailOptions = {
|
|
19
|
+
filter?: VoiceAuditEventFilter;
|
|
20
|
+
limit?: number;
|
|
21
|
+
store: VoiceAuditEventStore;
|
|
22
|
+
};
|
|
23
|
+
export type VoiceAuditTrailRoutesOptions = VoiceAuditTrailOptions & {
|
|
24
|
+
exportHtmlPath?: false | string;
|
|
25
|
+
exportPath?: false | string;
|
|
26
|
+
headers?: HeadersInit;
|
|
27
|
+
htmlPath?: false | string;
|
|
28
|
+
name?: string;
|
|
29
|
+
path?: string;
|
|
30
|
+
render?: (report: VoiceAuditTrailReport) => string | Promise<string>;
|
|
31
|
+
title?: string;
|
|
32
|
+
};
|
|
33
|
+
export declare const resolveVoiceAuditTrailFilter: (query?: Record<string, unknown>, base?: VoiceAuditEventFilter) => VoiceAuditEventFilter;
|
|
34
|
+
export declare const summarizeVoiceAuditTrail: (events: StoredVoiceAuditEvent[]) => VoiceAuditTrailSummary;
|
|
35
|
+
export declare const buildVoiceAuditTrailReport: (options: VoiceAuditTrailOptions) => Promise<VoiceAuditTrailReport>;
|
|
36
|
+
export declare const renderVoiceAuditTrailHTML: (report: VoiceAuditTrailReport, options?: {
|
|
37
|
+
title?: string;
|
|
38
|
+
}) => string;
|
|
39
|
+
export declare const createVoiceAuditTrailRoutes: (options: VoiceAuditTrailRoutesOptions) => Elysia<"", {
|
|
40
|
+
decorator: {};
|
|
41
|
+
store: {};
|
|
42
|
+
derive: {};
|
|
43
|
+
resolve: {};
|
|
44
|
+
}, {
|
|
45
|
+
typebox: {};
|
|
46
|
+
error: {};
|
|
47
|
+
}, {
|
|
48
|
+
schema: {};
|
|
49
|
+
standaloneSchema: {};
|
|
50
|
+
macro: {};
|
|
51
|
+
macroFn: {};
|
|
52
|
+
parser: {};
|
|
53
|
+
response: {};
|
|
54
|
+
}, {}, {
|
|
55
|
+
derive: {};
|
|
56
|
+
resolve: {};
|
|
57
|
+
schema: {};
|
|
58
|
+
standaloneSchema: {};
|
|
59
|
+
response: {};
|
|
60
|
+
}, {
|
|
61
|
+
derive: {};
|
|
62
|
+
resolve: {};
|
|
63
|
+
schema: {};
|
|
64
|
+
standaloneSchema: {};
|
|
65
|
+
response: {};
|
|
66
|
+
}>;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type { StoredVoiceAuditEvent, VoiceAuditEventStore, VoiceAuditEventType } from './audit';
|
|
2
|
+
import type { VoiceIdempotencyStore, VoiceRedisTaskLeaseCoordinator } from './queue';
|
|
3
|
+
import type { VoiceTraceRedactionConfig } from './trace';
|
|
4
|
+
export type VoiceAuditSinkDeliveryStatus = 'delivered' | 'failed' | 'skipped';
|
|
5
|
+
export type VoiceAuditSinkDeliveryQueueStatus = VoiceAuditSinkDeliveryStatus | 'pending';
|
|
6
|
+
export type VoiceAuditSinkDeliveryResult = {
|
|
7
|
+
attempts: number;
|
|
8
|
+
deliveredAt?: number;
|
|
9
|
+
deliveredTo?: string;
|
|
10
|
+
error?: string;
|
|
11
|
+
eventCount: number;
|
|
12
|
+
responseBody?: unknown;
|
|
13
|
+
status: VoiceAuditSinkDeliveryStatus;
|
|
14
|
+
};
|
|
15
|
+
export type VoiceAuditSink = {
|
|
16
|
+
deliver: (input: {
|
|
17
|
+
events: StoredVoiceAuditEvent[];
|
|
18
|
+
}) => Promise<VoiceAuditSinkDeliveryResult> | VoiceAuditSinkDeliveryResult;
|
|
19
|
+
eventTypes?: VoiceAuditEventType[];
|
|
20
|
+
id: string;
|
|
21
|
+
kind?: string;
|
|
22
|
+
};
|
|
23
|
+
export type VoiceAuditSinkFanoutResult = {
|
|
24
|
+
deliveredAt: number;
|
|
25
|
+
eventCount: number;
|
|
26
|
+
sinkDeliveries: Record<string, VoiceAuditSinkDeliveryResult>;
|
|
27
|
+
status: VoiceAuditSinkDeliveryStatus;
|
|
28
|
+
};
|
|
29
|
+
export type VoiceAuditSinkDeliveryRecord = {
|
|
30
|
+
createdAt: number;
|
|
31
|
+
deliveredAt?: number;
|
|
32
|
+
deliveryAttempts?: number;
|
|
33
|
+
deliveryError?: string;
|
|
34
|
+
deliveryStatus: VoiceAuditSinkDeliveryQueueStatus;
|
|
35
|
+
events: StoredVoiceAuditEvent[];
|
|
36
|
+
id: string;
|
|
37
|
+
sinkDeliveries?: Record<string, VoiceAuditSinkDeliveryResult>;
|
|
38
|
+
updatedAt: number;
|
|
39
|
+
};
|
|
40
|
+
export type VoiceAuditSinkDeliveryStore<TDelivery extends VoiceAuditSinkDeliveryRecord = VoiceAuditSinkDeliveryRecord> = {
|
|
41
|
+
get: (id: string) => Promise<TDelivery | undefined> | TDelivery | undefined;
|
|
42
|
+
list: () => Promise<TDelivery[]> | TDelivery[];
|
|
43
|
+
remove: (id: string) => Promise<void> | void;
|
|
44
|
+
set: (id: string, delivery: TDelivery) => Promise<void> | void;
|
|
45
|
+
};
|
|
46
|
+
export type VoiceAuditHTTPSinkOptions<TBody extends Record<string, unknown> = Record<string, unknown>> = {
|
|
47
|
+
backoffMs?: number;
|
|
48
|
+
body?: (input: {
|
|
49
|
+
events: StoredVoiceAuditEvent[];
|
|
50
|
+
}) => Promise<TBody> | TBody;
|
|
51
|
+
eventTypes?: VoiceAuditEventType[];
|
|
52
|
+
fetch?: typeof fetch;
|
|
53
|
+
headers?: Record<string, string>;
|
|
54
|
+
id: string;
|
|
55
|
+
kind?: string;
|
|
56
|
+
method?: 'POST' | 'PUT' | 'PATCH';
|
|
57
|
+
retries?: number;
|
|
58
|
+
signingSecret?: string;
|
|
59
|
+
timeoutMs?: number;
|
|
60
|
+
url: string;
|
|
61
|
+
};
|
|
62
|
+
export type VoiceAuditSinkStoreOptions<TEvent extends StoredVoiceAuditEvent = StoredVoiceAuditEvent> = {
|
|
63
|
+
awaitDelivery?: boolean;
|
|
64
|
+
deliveryQueue?: VoiceAuditSinkDeliveryStore;
|
|
65
|
+
onDelivery?: (result: VoiceAuditSinkFanoutResult) => Promise<void> | void;
|
|
66
|
+
onError?: (error: unknown) => Promise<void> | void;
|
|
67
|
+
redact?: VoiceTraceRedactionConfig;
|
|
68
|
+
sinks: VoiceAuditSink[];
|
|
69
|
+
store: VoiceAuditEventStore<TEvent>;
|
|
70
|
+
};
|
|
71
|
+
export type VoiceAuditSinkDeliveryWorkerOptions<TDelivery extends VoiceAuditSinkDeliveryRecord = VoiceAuditSinkDeliveryRecord> = {
|
|
72
|
+
deadLetters?: VoiceAuditSinkDeliveryStore<TDelivery>;
|
|
73
|
+
deliveries: VoiceAuditSinkDeliveryStore<TDelivery>;
|
|
74
|
+
idempotency?: VoiceIdempotencyStore;
|
|
75
|
+
idempotencyTtlSeconds?: number;
|
|
76
|
+
leaseMs?: number;
|
|
77
|
+
leases: VoiceRedisTaskLeaseCoordinator;
|
|
78
|
+
maxFailures?: number;
|
|
79
|
+
onDeadLetter?: (delivery: TDelivery) => Promise<void> | void;
|
|
80
|
+
redact?: VoiceTraceRedactionConfig;
|
|
81
|
+
sinks: VoiceAuditSink[];
|
|
82
|
+
statuses?: VoiceAuditSinkDeliveryQueueStatus[];
|
|
83
|
+
workerId: string;
|
|
84
|
+
};
|
|
85
|
+
export type VoiceAuditSinkDeliveryWorkerResult = {
|
|
86
|
+
alreadyProcessed: number;
|
|
87
|
+
attempted: number;
|
|
88
|
+
deadLettered: number;
|
|
89
|
+
delivered: number;
|
|
90
|
+
failed: number;
|
|
91
|
+
skipped: number;
|
|
92
|
+
};
|
|
93
|
+
export type VoiceAuditSinkDeliveryWorkerLoopOptions<TDelivery extends VoiceAuditSinkDeliveryRecord = VoiceAuditSinkDeliveryRecord> = {
|
|
94
|
+
onError?: (error: unknown) => Promise<void> | void;
|
|
95
|
+
pollIntervalMs?: number;
|
|
96
|
+
worker: ReturnType<typeof createVoiceAuditSinkDeliveryWorker<TDelivery>>;
|
|
97
|
+
};
|
|
98
|
+
export type VoiceAuditSinkDeliveryWorkerLoop = {
|
|
99
|
+
isRunning: () => boolean;
|
|
100
|
+
start: () => void;
|
|
101
|
+
stop: () => void;
|
|
102
|
+
tick: () => Promise<VoiceAuditSinkDeliveryWorkerResult>;
|
|
103
|
+
};
|
|
104
|
+
export type VoiceAuditSinkDeliveryQueueSummary = {
|
|
105
|
+
deadLettered: number;
|
|
106
|
+
delivered: number;
|
|
107
|
+
failed: number;
|
|
108
|
+
pending: number;
|
|
109
|
+
retryEligible: number;
|
|
110
|
+
skipped: number;
|
|
111
|
+
total: number;
|
|
112
|
+
};
|
|
113
|
+
export declare const createVoiceAuditSinkDeliveryId: (events: StoredVoiceAuditEvent[]) => string;
|
|
114
|
+
export declare const createVoiceAuditSinkDeliveryRecord: (input: {
|
|
115
|
+
createdAt?: number;
|
|
116
|
+
events: StoredVoiceAuditEvent[];
|
|
117
|
+
id?: string;
|
|
118
|
+
} & Partial<Omit<VoiceAuditSinkDeliveryRecord, "createdAt" | "events" | "id">>) => VoiceAuditSinkDeliveryRecord;
|
|
119
|
+
export declare const createVoiceAuditHTTPSink: <TBody extends Record<string, unknown> = Record<string, unknown>>(options: VoiceAuditHTTPSinkOptions<TBody>) => VoiceAuditSink;
|
|
120
|
+
export declare const deliverVoiceAuditEventsToSinks: (input: {
|
|
121
|
+
events: StoredVoiceAuditEvent[];
|
|
122
|
+
redact?: VoiceTraceRedactionConfig;
|
|
123
|
+
sinks: VoiceAuditSink[];
|
|
124
|
+
}) => Promise<VoiceAuditSinkFanoutResult>;
|
|
125
|
+
export declare const createVoiceAuditSinkStore: <TEvent extends StoredVoiceAuditEvent = StoredVoiceAuditEvent>(options: VoiceAuditSinkStoreOptions<TEvent>) => VoiceAuditEventStore<TEvent>;
|
|
126
|
+
export declare const createVoiceMemoryAuditSinkDeliveryStore: <TDelivery extends VoiceAuditSinkDeliveryRecord = VoiceAuditSinkDeliveryRecord>() => VoiceAuditSinkDeliveryStore<TDelivery>;
|
|
127
|
+
export declare const summarizeVoiceAuditSinkDeliveries: <TDelivery extends VoiceAuditSinkDeliveryRecord = VoiceAuditSinkDeliveryRecord>(deliveries: TDelivery[], input?: {
|
|
128
|
+
deadLetters?: VoiceAuditSinkDeliveryStore<TDelivery>;
|
|
129
|
+
}) => Promise<VoiceAuditSinkDeliveryQueueSummary> | VoiceAuditSinkDeliveryQueueSummary;
|
|
130
|
+
export declare const createVoiceAuditSinkDeliveryWorker: <TDelivery extends VoiceAuditSinkDeliveryRecord = VoiceAuditSinkDeliveryRecord>(options: VoiceAuditSinkDeliveryWorkerOptions<TDelivery>) => {
|
|
131
|
+
drain: () => Promise<VoiceAuditSinkDeliveryWorkerResult>;
|
|
132
|
+
};
|
|
133
|
+
export declare const createVoiceAuditSinkDeliveryWorkerLoop: <TDelivery extends VoiceAuditSinkDeliveryRecord = VoiceAuditSinkDeliveryRecord>(options: VoiceAuditSinkDeliveryWorkerLoopOptions<TDelivery>) => VoiceAuditSinkDeliveryWorkerLoop;
|
package/dist/client/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { bindVoiceHTMX } from './htmx';
|
|
|
7
7
|
export { createMicrophoneCapture } from './microphone';
|
|
8
8
|
export { createVoiceBargeInMonitor } from './bargeInMonitor';
|
|
9
9
|
export { createVoiceLiveTurnLatencyMonitor } from './liveTurnLatency';
|
|
10
|
-
export {
|
|
10
|
+
export { createVoiceOpsStatusStore, fetchVoiceOpsStatus } from './opsStatus';
|
|
11
11
|
export { createVoiceOpsStatusViewModel, defineVoiceOpsStatusElement, getVoiceOpsStatusCSS, getVoiceOpsStatusLabel, mountVoiceOpsStatus, renderVoiceOpsStatusHTML } from './opsStatusWidget';
|
|
12
12
|
export { createVoiceRoutingStatusStore, fetchVoiceRoutingStatus } from './routingStatus';
|
|
13
13
|
export { createVoiceRoutingStatusViewModel, defineVoiceRoutingStatusElement, getVoiceRoutingStatusCSS, mountVoiceRoutingStatus, renderVoiceRoutingStatusHTML } from './routingStatusWidget';
|
|
@@ -25,7 +25,7 @@ export { createVoiceTurnQualityViewModel, defineVoiceTurnQualityElement, getVoic
|
|
|
25
25
|
export { createVoiceTurnLatencyViewModel, defineVoiceTurnLatencyElement, mountVoiceTurnLatency, renderVoiceTurnLatencyHTML } from './turnLatencyWidget';
|
|
26
26
|
export { createVoiceTraceTimelineViewModel, defineVoiceTraceTimelineElement, getVoiceTraceTimelineCSS, mountVoiceTraceTimeline, renderVoiceTraceTimelineWidgetHTML } from './traceTimelineWidget';
|
|
27
27
|
export { createVoiceWorkflowStatusStore, fetchVoiceWorkflowStatus } from './workflowStatus';
|
|
28
|
-
export type {
|
|
28
|
+
export type { VoiceOpsStatusClientOptions, VoiceOpsStatusSnapshot } from './opsStatus';
|
|
29
29
|
export type { VoiceBargeInMonitorOptions } from './bargeInMonitor';
|
|
30
30
|
export type { VoiceLiveTurnLatencyEvent, VoiceLiveTurnLatencyMonitorOptions, VoiceLiveTurnLatencySnapshot, VoiceLiveTurnLatencyStatus } from './liveTurnLatency';
|
|
31
31
|
export type { VoiceOpsStatusSurfaceView, VoiceOpsStatusViewModel, VoiceOpsStatusWidgetOptions } from './opsStatusWidget';
|
package/dist/client/index.js
CHANGED
|
@@ -1852,16 +1852,16 @@ var createVoiceLiveTurnLatencyMonitor = (options = {}) => {
|
|
|
1852
1852
|
}
|
|
1853
1853
|
};
|
|
1854
1854
|
};
|
|
1855
|
-
// src/client/
|
|
1856
|
-
var
|
|
1855
|
+
// src/client/opsStatus.ts
|
|
1856
|
+
var fetchVoiceOpsStatus = async (path = "/api/voice/ops-status", options = {}) => {
|
|
1857
1857
|
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
1858
1858
|
const response = await fetchImpl(path);
|
|
1859
1859
|
if (!response.ok) {
|
|
1860
|
-
throw new Error(`Voice
|
|
1860
|
+
throw new Error(`Voice ops status failed: HTTP ${response.status}`);
|
|
1861
1861
|
}
|
|
1862
1862
|
return await response.json();
|
|
1863
1863
|
};
|
|
1864
|
-
var
|
|
1864
|
+
var createVoiceOpsStatusStore = (path = "/api/voice/ops-status", options = {}) => {
|
|
1865
1865
|
const listeners = new Set;
|
|
1866
1866
|
let closed = false;
|
|
1867
1867
|
let timer;
|
|
@@ -1885,7 +1885,7 @@ var createVoiceAppKitStatusStore = (path = "/app-kit/status", options = {}) => {
|
|
|
1885
1885
|
};
|
|
1886
1886
|
emit();
|
|
1887
1887
|
try {
|
|
1888
|
-
const report = await
|
|
1888
|
+
const report = await fetchVoiceOpsStatus(path, options);
|
|
1889
1889
|
snapshot = {
|
|
1890
1890
|
error: null,
|
|
1891
1891
|
isLoading: false,
|
|
@@ -1932,7 +1932,7 @@ var createVoiceAppKitStatusStore = (path = "/app-kit/status", options = {}) => {
|
|
|
1932
1932
|
};
|
|
1933
1933
|
// src/client/opsStatusWidget.ts
|
|
1934
1934
|
var DEFAULT_TITLE = "Voice Ops Status";
|
|
1935
|
-
var DEFAULT_DESCRIPTION = "Certified workflow, provider, and handoff readiness from
|
|
1935
|
+
var DEFAULT_DESCRIPTION = "Certified workflow, provider, and handoff readiness from your AbsoluteJS voice app.";
|
|
1936
1936
|
var SURFACE_LABELS = {
|
|
1937
1937
|
handoffs: "Handoffs",
|
|
1938
1938
|
providers: "Providers",
|
|
@@ -2017,8 +2017,8 @@ var renderVoiceOpsStatusHTML = (snapshot, options = {}) => {
|
|
|
2017
2017
|
</section>`;
|
|
2018
2018
|
};
|
|
2019
2019
|
var getVoiceOpsStatusCSS = () => `.absolute-voice-ops-status{border:1px solid #d8d2c4;border-radius:20px;background:#fffaf0;color:#16130d;padding:18px;box-shadow:0 18px 40px rgba(47,37,18,.12);font-family:inherit}.absolute-voice-ops-status--fail,.absolute-voice-ops-status--error{border-color:#f2a7a7;background:#fff5f3}.absolute-voice-ops-status__header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-ops-status__eyebrow{color:#73664f;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-ops-status__label{font-size:28px;line-height:1}.absolute-voice-ops-status__description{color:#514733;margin:12px 0 0}.absolute-voice-ops-status__summary,.absolute-voice-ops-status__links{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.absolute-voice-ops-status__summary span,.absolute-voice-ops-status__links a{border:1px solid #e6ddca;border-radius:999px;color:inherit;padding:6px 10px;text-decoration:none}.absolute-voice-ops-status__surfaces{display:grid;gap:8px;list-style:none;margin:16px 0 0;padding:0}.absolute-voice-ops-status__surface{align-items:center;background:#fff;border:1px solid #eee4d2;border-radius:14px;display:flex;gap:12px;justify-content:space-between;padding:10px 12px}.absolute-voice-ops-status__surface--fail{border-color:#f2a7a7}.absolute-voice-ops-status__surface span{color:#655944}.absolute-voice-ops-status__error{color:#9f1239;font-weight:700}`;
|
|
2020
|
-
var mountVoiceOpsStatus = (element, path = "/
|
|
2021
|
-
const store =
|
|
2020
|
+
var mountVoiceOpsStatus = (element, path = "/api/voice/ops-status", options = {}) => {
|
|
2021
|
+
const store = createVoiceOpsStatusStore(path, options);
|
|
2022
2022
|
const render = () => {
|
|
2023
2023
|
element.innerHTML = renderVoiceOpsStatusHTML(store.getSnapshot(), options);
|
|
2024
2024
|
};
|
|
@@ -2041,7 +2041,7 @@ var defineVoiceOpsStatusElement = (tagName = "absolute-voice-ops-status") => {
|
|
|
2041
2041
|
mounted;
|
|
2042
2042
|
connectedCallback() {
|
|
2043
2043
|
const intervalMs = Number(this.getAttribute("interval-ms") ?? 5000);
|
|
2044
|
-
this.mounted = mountVoiceOpsStatus(this, this.getAttribute("path") ?? "/
|
|
2044
|
+
this.mounted = mountVoiceOpsStatus(this, this.getAttribute("path") ?? "/api/voice/ops-status", {
|
|
2045
2045
|
description: this.getAttribute("description") ?? undefined,
|
|
2046
2046
|
includeLinks: this.getAttribute("include-links") !== "false",
|
|
2047
2047
|
intervalMs: Number.isFinite(intervalMs) ? intervalMs : 5000,
|
|
@@ -3571,8 +3571,8 @@ export {
|
|
|
3571
3571
|
fetchVoiceRoutingStatus,
|
|
3572
3572
|
fetchVoiceProviderStatus,
|
|
3573
3573
|
fetchVoiceProviderCapabilities,
|
|
3574
|
+
fetchVoiceOpsStatus,
|
|
3574
3575
|
fetchVoiceCampaignDialerProofStatus,
|
|
3575
|
-
fetchVoiceAppKitStatus,
|
|
3576
3576
|
defineVoiceTurnQualityElement,
|
|
3577
3577
|
defineVoiceTurnLatencyElement,
|
|
3578
3578
|
defineVoiceTraceTimelineElement,
|
|
@@ -3599,6 +3599,7 @@ export {
|
|
|
3599
3599
|
createVoiceProviderCapabilitiesViewModel,
|
|
3600
3600
|
createVoiceProviderCapabilitiesStore,
|
|
3601
3601
|
createVoiceOpsStatusViewModel,
|
|
3602
|
+
createVoiceOpsStatusStore,
|
|
3602
3603
|
createVoiceLiveTurnLatencyMonitor,
|
|
3603
3604
|
createVoiceDuplexController,
|
|
3604
3605
|
createVoiceController,
|
|
@@ -3606,7 +3607,6 @@ export {
|
|
|
3606
3607
|
createVoiceCampaignDialerProofStore,
|
|
3607
3608
|
createVoiceBargeInMonitor,
|
|
3608
3609
|
createVoiceAudioPlayer,
|
|
3609
|
-
createVoiceAppKitStatusStore,
|
|
3610
3610
|
createMicrophoneCapture,
|
|
3611
3611
|
bindVoiceProviderSimulationControls,
|
|
3612
3612
|
bindVoiceHTMX,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { VoiceOpsStatusReport } from '../opsStatus';
|
|
2
|
+
export type VoiceOpsStatusClientOptions = {
|
|
3
|
+
fetch?: typeof fetch;
|
|
4
|
+
intervalMs?: number;
|
|
5
|
+
};
|
|
6
|
+
export type VoiceOpsStatusSnapshot = {
|
|
7
|
+
error: string | null;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
report?: VoiceOpsStatusReport;
|
|
10
|
+
updatedAt?: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const fetchVoiceOpsStatus: (path?: string, options?: Pick<VoiceOpsStatusClientOptions, "fetch">) => Promise<VoiceOpsStatusReport>;
|
|
13
|
+
export declare const createVoiceOpsStatusStore: (path?: string, options?: VoiceOpsStatusClientOptions) => {
|
|
14
|
+
close: () => void;
|
|
15
|
+
getServerSnapshot: () => VoiceOpsStatusSnapshot;
|
|
16
|
+
getSnapshot: () => VoiceOpsStatusSnapshot;
|
|
17
|
+
refresh: () => Promise<VoiceOpsStatusReport | undefined>;
|
|
18
|
+
subscribe: (listener: () => void) => () => void;
|
|
19
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { type
|
|
1
|
+
import type { VoiceOpsStatusReport } from '../opsStatus';
|
|
2
|
+
import { type VoiceOpsStatusClientOptions, type VoiceOpsStatusSnapshot } from './opsStatus';
|
|
3
3
|
export type VoiceOpsStatusSurfaceView = {
|
|
4
4
|
detail: string;
|
|
5
5
|
failed: number;
|
|
@@ -24,17 +24,17 @@ export type VoiceOpsStatusViewModel = {
|
|
|
24
24
|
total: number;
|
|
25
25
|
updatedAt?: number;
|
|
26
26
|
};
|
|
27
|
-
export type VoiceOpsStatusWidgetOptions =
|
|
27
|
+
export type VoiceOpsStatusWidgetOptions = VoiceOpsStatusClientOptions & {
|
|
28
28
|
description?: string;
|
|
29
29
|
includeLinks?: boolean;
|
|
30
30
|
title?: string;
|
|
31
31
|
};
|
|
32
|
-
export declare const getVoiceOpsStatusLabel: (report?:
|
|
33
|
-
export declare const createVoiceOpsStatusViewModel: (snapshot:
|
|
34
|
-
export declare const renderVoiceOpsStatusHTML: (snapshot:
|
|
32
|
+
export declare const getVoiceOpsStatusLabel: (report?: VoiceOpsStatusReport | null, error?: string | null) => "Needs attention" | "Passing" | "Unavailable" | "Checking";
|
|
33
|
+
export declare const createVoiceOpsStatusViewModel: (snapshot: VoiceOpsStatusSnapshot, options?: VoiceOpsStatusWidgetOptions) => VoiceOpsStatusViewModel;
|
|
34
|
+
export declare const renderVoiceOpsStatusHTML: (snapshot: VoiceOpsStatusSnapshot, options?: VoiceOpsStatusWidgetOptions) => string;
|
|
35
35
|
export declare const getVoiceOpsStatusCSS: () => string;
|
|
36
36
|
export declare const mountVoiceOpsStatus: (element: Element, path?: string, options?: VoiceOpsStatusWidgetOptions) => {
|
|
37
37
|
close: () => void;
|
|
38
|
-
refresh: () => Promise<
|
|
38
|
+
refresh: () => Promise<VoiceOpsStatusReport | undefined>;
|
|
39
39
|
};
|
|
40
40
|
export declare const defineVoiceOpsStatusElement: (tagName?: string) => void;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { VoiceCampaignStore } from './campaign';
|
|
2
|
+
import { type VoiceAuditActor, type VoiceAuditEventStore } from './audit';
|
|
3
|
+
import type { VoiceAuditSinkDeliveryStore } from './auditSinks';
|
|
4
|
+
import type { VoiceIntegrationEventStore, VoiceOpsTaskStore } from './ops';
|
|
5
|
+
import type { VoiceCallReviewStore } from './testing/review';
|
|
6
|
+
import type { VoiceTraceEventStore, VoiceTracePruneFilter, VoiceTraceSinkDeliveryStore } from './trace';
|
|
7
|
+
import type { VoiceSessionStore } from './types';
|
|
8
|
+
export type VoiceDataRetentionScope = 'auditDeliveries' | 'campaigns' | 'events' | 'reviews' | 'sessions' | 'tasks' | 'traceDeliveries' | 'traces';
|
|
9
|
+
export type VoiceDataRetentionStores = {
|
|
10
|
+
campaigns?: VoiceCampaignStore;
|
|
11
|
+
events?: VoiceIntegrationEventStore;
|
|
12
|
+
reviews?: VoiceCallReviewStore;
|
|
13
|
+
session?: VoiceSessionStore;
|
|
14
|
+
sessions?: VoiceSessionStore;
|
|
15
|
+
tasks?: VoiceOpsTaskStore;
|
|
16
|
+
traceDeliveries?: VoiceTraceSinkDeliveryStore;
|
|
17
|
+
traces?: VoiceTraceEventStore;
|
|
18
|
+
};
|
|
19
|
+
export type VoiceDataRetentionPolicy = VoiceDataRetentionStores & {
|
|
20
|
+
audit?: VoiceAuditEventStore;
|
|
21
|
+
auditDeliveries?: VoiceAuditSinkDeliveryStore;
|
|
22
|
+
auditActor?: VoiceAuditActor;
|
|
23
|
+
before?: number;
|
|
24
|
+
beforeOrAt?: number;
|
|
25
|
+
dryRun?: boolean;
|
|
26
|
+
keepNewest?: Partial<Record<VoiceDataRetentionScope, number>>;
|
|
27
|
+
limit?: number;
|
|
28
|
+
scopes?: VoiceDataRetentionScope[];
|
|
29
|
+
traceFilter?: VoiceTracePruneFilter;
|
|
30
|
+
};
|
|
31
|
+
export type VoiceDataRetentionScopeReport = {
|
|
32
|
+
deletedIds: string[];
|
|
33
|
+
deletedCount: number;
|
|
34
|
+
dryRun: boolean;
|
|
35
|
+
keepNewest?: number;
|
|
36
|
+
scannedCount: number;
|
|
37
|
+
scope: VoiceDataRetentionScope;
|
|
38
|
+
skippedReason?: 'missing-store' | 'missing-selector';
|
|
39
|
+
};
|
|
40
|
+
export type VoiceDataRetentionReport = {
|
|
41
|
+
checkedAt: number;
|
|
42
|
+
deletedCount: number;
|
|
43
|
+
dryRun: boolean;
|
|
44
|
+
scopes: VoiceDataRetentionScopeReport[];
|
|
45
|
+
};
|
|
46
|
+
export declare const applyVoiceDataRetentionPolicy: (options: VoiceDataRetentionPolicy) => Promise<VoiceDataRetentionReport>;
|
|
47
|
+
export declare const buildVoiceDataRetentionPlan: (options: Omit<VoiceDataRetentionPolicy, "dryRun">) => Promise<VoiceDataRetentionReport>;
|