@absolutejs/voice 0.0.22-beta.151 → 0.0.22-beta.153
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 +30 -0
- package/dist/angular/index.d.ts +2 -0
- package/dist/angular/index.js +604 -124
- package/dist/angular/voice-delivery-runtime.component.d.ts +17 -0
- package/dist/angular/voice-delivery-runtime.service.d.ts +16 -0
- package/dist/client/deliveryRuntime.d.ts +34 -0
- package/dist/client/deliveryRuntimeWidget.d.ts +37 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.js +371 -100
- package/dist/deliveryRuntime.d.ts +14 -2
- package/dist/index.js +44 -1
- package/dist/react/VoiceDeliveryRuntime.d.ts +7 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +632 -256
- package/dist/react/useVoiceDeliveryRuntime.d.ts +13 -0
- package/dist/svelte/createVoiceDeliveryRuntime.d.ts +11 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +394 -114
- package/dist/vue/VoiceDeliveryRuntime.d.ts +30 -0
- package/dist/vue/index.d.ts +2 -0
- package/dist/vue/index.js +649 -261
- package/dist/vue/useVoiceDeliveryRuntime.d.ts +13 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
2
|
import { createVoiceAuditSinkDeliveryWorker, type VoiceAuditSinkDeliveryQueueSummary, type VoiceAuditSinkDeliveryRecord, type VoiceAuditSinkDeliveryStore, type VoiceAuditSinkDeliveryWorkerOptions, type VoiceAuditSinkDeliveryWorkerResult, type VoiceS3AuditSinkClient } from './auditSinks';
|
|
3
3
|
import { createVoiceTraceSinkDeliveryWorker, type VoiceRedisTaskLeaseCoordinator, type VoiceTraceSinkDeliveryQueueSummary, type VoiceTraceSinkDeliveryWorkerOptions, type VoiceTraceSinkDeliveryWorkerResult } from './queue';
|
|
4
|
-
import { type StoredVoiceTraceEvent, type VoiceS3TraceSinkClient, VoiceTraceSinkDeliveryRecord, VoiceTraceSinkDeliveryStore } from './trace';
|
|
4
|
+
import { type StoredVoiceTraceEvent, type VoiceS3TraceSinkClient, type VoiceTraceSinkDeliveryRecord, type VoiceTraceSinkDeliveryStore } from './trace';
|
|
5
5
|
import type { StoredVoiceAuditEvent } from './audit';
|
|
6
6
|
export type VoiceDeliveryRuntimeAuditConfig<TDelivery extends VoiceAuditSinkDeliveryRecord = VoiceAuditSinkDeliveryRecord> = VoiceAuditSinkDeliveryWorkerOptions<TDelivery> & {
|
|
7
7
|
autoStart?: boolean;
|
|
@@ -21,6 +21,11 @@ export type VoiceDeliveryRuntimeTickResult = {
|
|
|
21
21
|
audit?: VoiceAuditSinkDeliveryWorkerResult;
|
|
22
22
|
trace?: VoiceTraceSinkDeliveryWorkerResult;
|
|
23
23
|
};
|
|
24
|
+
export type VoiceDeliveryRuntimeRequeueDeadLettersResult = {
|
|
25
|
+
audit: number;
|
|
26
|
+
trace: number;
|
|
27
|
+
total: number;
|
|
28
|
+
};
|
|
24
29
|
export type VoiceDeliveryRuntimeSummary = {
|
|
25
30
|
audit?: VoiceAuditSinkDeliveryQueueSummary;
|
|
26
31
|
trace?: VoiceTraceSinkDeliveryQueueSummary;
|
|
@@ -28,6 +33,7 @@ export type VoiceDeliveryRuntimeSummary = {
|
|
|
28
33
|
export type VoiceDeliveryRuntime = {
|
|
29
34
|
audit?: ReturnType<typeof createVoiceAuditSinkDeliveryWorker>;
|
|
30
35
|
isRunning: () => boolean;
|
|
36
|
+
requeueDeadLetters: () => Promise<VoiceDeliveryRuntimeRequeueDeadLettersResult>;
|
|
31
37
|
start: () => void;
|
|
32
38
|
stop: () => void;
|
|
33
39
|
summarize: () => Promise<VoiceDeliveryRuntimeSummary>;
|
|
@@ -44,8 +50,13 @@ export type VoiceDeliveryRuntimeRoutesOptions = {
|
|
|
44
50
|
htmlPath?: false | string;
|
|
45
51
|
name?: string;
|
|
46
52
|
path?: string;
|
|
47
|
-
render?: (report: VoiceDeliveryRuntimeReport
|
|
53
|
+
render?: (report: VoiceDeliveryRuntimeReport, options: {
|
|
54
|
+
requeueDeadLettersPath?: false | string;
|
|
55
|
+
tickPath?: false | string;
|
|
56
|
+
title?: string;
|
|
57
|
+
}) => string | Promise<string>;
|
|
48
58
|
runtime: VoiceDeliveryRuntime;
|
|
59
|
+
requeueDeadLettersPath?: false | string;
|
|
49
60
|
tickPath?: false | string;
|
|
50
61
|
title?: string;
|
|
51
62
|
};
|
|
@@ -101,6 +112,7 @@ export declare const createVoiceDeliveryRuntimePresetConfig: (options: VoiceDeli
|
|
|
101
112
|
export declare const createVoiceDeliveryRuntime: <TAuditDelivery extends VoiceAuditSinkDeliveryRecord = VoiceAuditSinkDeliveryRecord, TTraceDelivery extends VoiceTraceSinkDeliveryRecord = VoiceTraceSinkDeliveryRecord>(config: VoiceDeliveryRuntimeConfig<TAuditDelivery, TTraceDelivery>) => VoiceDeliveryRuntime;
|
|
102
113
|
export declare const buildVoiceDeliveryRuntimeReport: (runtime: VoiceDeliveryRuntime) => Promise<VoiceDeliveryRuntimeReport>;
|
|
103
114
|
export declare const renderVoiceDeliveryRuntimeHTML: (report: VoiceDeliveryRuntimeReport, options?: {
|
|
115
|
+
requeueDeadLettersPath?: false | string;
|
|
104
116
|
tickPath?: false | string;
|
|
105
117
|
title?: string;
|
|
106
118
|
}) => string;
|
package/dist/index.js
CHANGED
|
@@ -11579,6 +11579,15 @@ var resolvePresetLeases = (leases) => ("claim" in leases) ? {
|
|
|
11579
11579
|
audit: leases,
|
|
11580
11580
|
trace: leases
|
|
11581
11581
|
} : leases;
|
|
11582
|
+
var requeueDelivery = (delivery) => ({
|
|
11583
|
+
...delivery,
|
|
11584
|
+
deliveredAt: undefined,
|
|
11585
|
+
deliveryAttempts: 0,
|
|
11586
|
+
deliveryError: undefined,
|
|
11587
|
+
deliveryStatus: "pending",
|
|
11588
|
+
sinkDeliveries: undefined,
|
|
11589
|
+
updatedAt: Date.now()
|
|
11590
|
+
});
|
|
11582
11591
|
var createDeliveryRuntimeFileSink = (input) => ({
|
|
11583
11592
|
deliver: async ({ events }) => {
|
|
11584
11593
|
const firstEvent = events[0];
|
|
@@ -11706,6 +11715,29 @@ var createVoiceDeliveryRuntime = (config) => {
|
|
|
11706
11715
|
return {
|
|
11707
11716
|
audit,
|
|
11708
11717
|
isRunning: () => Boolean(auditLoop?.isRunning() || traceLoop?.isRunning()),
|
|
11718
|
+
requeueDeadLetters: async () => {
|
|
11719
|
+
let audit2 = 0;
|
|
11720
|
+
let trace2 = 0;
|
|
11721
|
+
if (config.audit?.deadLetters) {
|
|
11722
|
+
for (const delivery of await config.audit.deadLetters.list()) {
|
|
11723
|
+
await config.audit.deliveries.set(delivery.id, requeueDelivery(delivery));
|
|
11724
|
+
await config.audit.deadLetters.remove(delivery.id);
|
|
11725
|
+
audit2 += 1;
|
|
11726
|
+
}
|
|
11727
|
+
}
|
|
11728
|
+
if (config.trace?.deadLetters) {
|
|
11729
|
+
for (const delivery of await config.trace.deadLetters.list()) {
|
|
11730
|
+
await config.trace.deliveries.set(delivery.id, requeueDelivery(delivery));
|
|
11731
|
+
await config.trace.deadLetters.remove(delivery.id);
|
|
11732
|
+
trace2 += 1;
|
|
11733
|
+
}
|
|
11734
|
+
}
|
|
11735
|
+
return {
|
|
11736
|
+
audit: audit2,
|
|
11737
|
+
trace: trace2,
|
|
11738
|
+
total: audit2 + trace2
|
|
11739
|
+
};
|
|
11740
|
+
},
|
|
11709
11741
|
start: () => {
|
|
11710
11742
|
if (config.audit?.autoStart) {
|
|
11711
11743
|
auditLoop?.start();
|
|
@@ -11753,15 +11785,18 @@ var buildVoiceDeliveryRuntimeReport = async (runtime) => ({
|
|
|
11753
11785
|
var renderVoiceDeliveryRuntimeHTML = (report, options = {}) => {
|
|
11754
11786
|
const title = options.title ?? "AbsoluteJS Voice Delivery Runtime";
|
|
11755
11787
|
const tickForm = options.tickPath === false ? "" : `<form method="post" action="${escapeHtml15(options.tickPath ?? "/api/voice-delivery-runtime/tick")}"><button type="submit">Tick delivery workers</button></form>`;
|
|
11756
|
-
|
|
11788
|
+
const requeueForm = options.requeueDeadLettersPath === false ? "" : `<form method="post" action="${escapeHtml15(options.requeueDeadLettersPath ?? "/api/voice-delivery-runtime/requeue-dead-letters")}"><button type="submit">Requeue dead letters</button></form>`;
|
|
11789
|
+
return `<!doctype html><html lang="en"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>${escapeHtml15(title)}</title><style>body{background:#0f1411;color:#f7f2df;font-family:ui-sans-serif,system-ui,sans-serif;margin:0}main{margin:auto;max-width:1080px;padding:32px}a{color:#86efac;text-decoration:none}.hero{background:linear-gradient(135deg,rgba(34,197,94,.18),rgba(14,165,233,.13));border:1px solid #263a30;border-radius:28px;margin-bottom:18px;padding:28px}.eyebrow{color:#86efac;font-weight:900;letter-spacing:.12em;text-transform:uppercase}h1{font-size:clamp(2.2rem,5vw,4.8rem);line-height:.92;margin:.2rem 0 1rem}.status{border:1px solid #64748b;border-radius:999px;display:inline-flex;font-weight:900;padding:8px 12px}.status.running{border-color:rgba(34,197,94,.7);color:#bbf7d0}.muted{color:#b9c3b4}.grid{display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));margin:18px 0}article,.card{background:#151d18;border:1px solid #263a30;border-radius:22px;padding:18px}article span{color:#b9c3b4;display:block;font-weight:800}article strong{display:block;font-size:2.3rem;margin-top:8px}.actions{display:flex;flex-wrap:wrap;gap:10px}button{background:#86efac;border:0;border-radius:999px;color:#07120b;cursor:pointer;font-weight:900;margin-top:12px;padding:10px 14px}pre{background:#09100c;border:1px solid #263a30;border-radius:18px;color:#dcfce7;overflow:auto;padding:16px}</style></head><body><main><p><a href="/delivery-sinks">Delivery sinks</a></p><section class="hero"><p class="eyebrow">Worker control plane</p><h1>${escapeHtml15(title)}</h1><p class="muted">Inspect queue summaries, manually tick failed/pending audit and trace deliveries, and requeue dead letters after operator review.</p><p class="status ${report.isRunning ? "running" : ""}">${report.isRunning ? "Running" : "Stopped"}</p><p class="muted">Checked ${escapeHtml15(new Date(report.checkedAt).toLocaleString())}</p><div class="actions">${tickForm}${requeueForm}</div></section><section class="grid">${renderSummaryCard("Audit", report.summary.audit)}${renderSummaryCard("Trace", report.summary.trace)}</section><section class="card"><h2>Runtime shape</h2><pre>const runtime = createVoiceDeliveryRuntime({ audit, trace })
|
|
11757
11790
|
|
|
11758
11791
|
await runtime.tick()
|
|
11792
|
+
await runtime.requeueDeadLetters()
|
|
11759
11793
|
await runtime.summarize()</pre></section></main></body></html>`;
|
|
11760
11794
|
};
|
|
11761
11795
|
var createVoiceDeliveryRuntimeRoutes = (options) => {
|
|
11762
11796
|
const path = options.path ?? "/api/voice-delivery-runtime";
|
|
11763
11797
|
const htmlPath = options.htmlPath === undefined ? "/delivery-runtime" : options.htmlPath;
|
|
11764
11798
|
const tickPath = options.tickPath === undefined ? "/api/voice-delivery-runtime/tick" : options.tickPath;
|
|
11799
|
+
const requeueDeadLettersPath = options.requeueDeadLettersPath === undefined ? "/api/voice-delivery-runtime/requeue-dead-letters" : options.requeueDeadLettersPath;
|
|
11765
11800
|
const routes = new Elysia12({
|
|
11766
11801
|
name: options.name ?? "absolutejs-voice-delivery-runtime"
|
|
11767
11802
|
}).get(path, () => buildVoiceDeliveryRuntimeReport(options.runtime));
|
|
@@ -11772,11 +11807,19 @@ var createVoiceDeliveryRuntimeRoutes = (options) => {
|
|
|
11772
11807
|
summary: await options.runtime.summarize()
|
|
11773
11808
|
}));
|
|
11774
11809
|
}
|
|
11810
|
+
if (requeueDeadLettersPath !== false) {
|
|
11811
|
+
routes.post(requeueDeadLettersPath, async () => ({
|
|
11812
|
+
requeuedAt: Date.now(),
|
|
11813
|
+
result: await options.runtime.requeueDeadLetters(),
|
|
11814
|
+
summary: await options.runtime.summarize()
|
|
11815
|
+
}));
|
|
11816
|
+
}
|
|
11775
11817
|
if (htmlPath !== false) {
|
|
11776
11818
|
routes.get(htmlPath, async () => {
|
|
11777
11819
|
const report = await buildVoiceDeliveryRuntimeReport(options.runtime);
|
|
11778
11820
|
const body = await (options.render ?? renderVoiceDeliveryRuntimeHTML)(report, {
|
|
11779
11821
|
tickPath,
|
|
11822
|
+
requeueDeadLettersPath,
|
|
11780
11823
|
title: options.title
|
|
11781
11824
|
});
|
|
11782
11825
|
return new Response(body, {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type VoiceDeliveryRuntimeWidgetOptions } from '../client/deliveryRuntimeWidget';
|
|
2
|
+
export type VoiceDeliveryRuntimeProps = VoiceDeliveryRuntimeWidgetOptions & {
|
|
3
|
+
className?: string;
|
|
4
|
+
includeActions?: boolean;
|
|
5
|
+
path?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const VoiceDeliveryRuntime: ({ className, includeActions, path, ...options }: VoiceDeliveryRuntimeProps) => import("react/jsx-runtime").JSX.Element;
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { VoiceOpsStatus } from './VoiceOpsStatus';
|
|
2
|
+
export { VoiceDeliveryRuntime } from './VoiceDeliveryRuntime';
|
|
2
3
|
export { VoiceProviderSimulationControls } from './VoiceProviderSimulationControls';
|
|
3
4
|
export { VoiceProviderCapabilities } from './VoiceProviderCapabilities';
|
|
4
5
|
export { VoiceProviderStatus } from './VoiceProviderStatus';
|
|
@@ -7,6 +8,7 @@ export { VoiceTraceTimeline } from './VoiceTraceTimeline';
|
|
|
7
8
|
export { VoiceTurnLatency } from './VoiceTurnLatency';
|
|
8
9
|
export { VoiceTurnQuality } from './VoiceTurnQuality';
|
|
9
10
|
export { useVoiceOpsStatus } from './useVoiceOpsStatus';
|
|
11
|
+
export { useVoiceDeliveryRuntime } from './useVoiceDeliveryRuntime';
|
|
10
12
|
export { useVoiceCampaignDialerProof } from './useVoiceCampaignDialerProof';
|
|
11
13
|
export { useVoiceStream } from './useVoiceStream';
|
|
12
14
|
export { useVoiceController } from './useVoiceController';
|