@absolutejs/voice 0.0.22-beta.671 → 0.0.22-beta.673

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.
Files changed (73) hide show
  1. package/dist/core/assistantHealth.d.ts +3 -40
  2. package/dist/core/auditDeliveryRoutes.d.ts +5 -40
  3. package/dist/core/auditRoutes.d.ts +3 -27
  4. package/dist/core/bargeInRoutes.d.ts +3 -27
  5. package/dist/core/browserCallProfiles.d.ts +3 -27
  6. package/dist/core/browserMediaRoutes.d.ts +3 -27
  7. package/dist/core/callDebugger.d.ts +3 -27
  8. package/dist/core/campaign.d.ts +166 -143
  9. package/dist/core/competitiveCoverage.d.ts +3 -40
  10. package/dist/core/dataControl.d.ts +3 -27
  11. package/dist/core/deliveryRuntime.d.ts +3 -40
  12. package/dist/core/deliverySinkRoutes.d.ts +3 -40
  13. package/dist/core/demoReadyRoutes.d.ts +3 -27
  14. package/dist/core/diagnosticsRoutes.d.ts +3 -27
  15. package/dist/core/evalRoutes.d.ts +3 -27
  16. package/dist/core/guardrails.d.ts +3 -27
  17. package/dist/core/handoffHealth.d.ts +5 -40
  18. package/dist/core/htmxDashboardRoutes.d.ts +309 -195
  19. package/dist/core/incidentBundle.d.ts +3 -27
  20. package/dist/core/incidentTimeline.d.ts +3 -40
  21. package/dist/core/liveLatency.d.ts +3 -40
  22. package/dist/core/liveOps.d.ts +154 -44
  23. package/dist/core/mediaPipelineRoutes.d.ts +3 -40
  24. package/dist/core/monitor.d.ts +5 -19
  25. package/dist/core/observabilityExport.d.ts +6 -54
  26. package/dist/core/operationalStatus.d.ts +3 -40
  27. package/dist/core/operationsRecord.d.ts +3 -27
  28. package/dist/core/opsActionAuditRoutes.d.ts +160 -51
  29. package/dist/core/opsConsoleRoutes.d.ts +3 -27
  30. package/dist/core/opsRecovery.d.ts +3 -40
  31. package/dist/core/opsStatusRoutes.d.ts +3 -27
  32. package/dist/core/opsWebhook.d.ts +158 -49
  33. package/dist/core/outcomeContract.d.ts +3 -40
  34. package/dist/core/phoneAgentProductionSmoke.d.ts +6 -40
  35. package/dist/core/platformCoverage.d.ts +3 -27
  36. package/dist/core/plugin.d.ts +12 -40
  37. package/dist/core/postCallAnalysis.d.ts +3 -27
  38. package/dist/core/productionReadiness.d.ts +3 -27
  39. package/dist/core/profileSwitchRecommendation.d.ts +299 -116
  40. package/dist/core/proofPack.d.ts +3 -27
  41. package/dist/core/proofTrends.d.ts +15 -135
  42. package/dist/core/providerCapabilities.d.ts +3 -40
  43. package/dist/core/providerDecisionTraces.d.ts +3 -40
  44. package/dist/core/providerHealth.d.ts +3 -40
  45. package/dist/core/providerOrchestration.d.ts +3 -40
  46. package/dist/core/providerSlo.d.ts +3 -27
  47. package/dist/core/providerStackRecommendations.d.ts +3 -27
  48. package/dist/core/qualityRoutes.d.ts +3 -27
  49. package/dist/core/realtimeChannel.d.ts +3 -40
  50. package/dist/core/realtimeProviderContracts.d.ts +3 -40
  51. package/dist/core/reconnectContract.d.ts +153 -79
  52. package/dist/core/resilienceRoutes.d.ts +3 -40
  53. package/dist/core/routeAuth.d.ts +3 -29
  54. package/dist/core/sessionObservability.d.ts +3 -27
  55. package/dist/core/sessionReplay.d.ts +10 -79
  56. package/dist/core/sessionSnapshot.d.ts +148 -39
  57. package/dist/core/simulationSuite.d.ts +3 -40
  58. package/dist/core/sloCalibration.d.ts +6 -54
  59. package/dist/core/telephonyMediaRoutes.d.ts +3 -27
  60. package/dist/core/telephonyOutcome.d.ts +148 -39
  61. package/dist/core/toolContract.d.ts +3 -40
  62. package/dist/core/traceDeliveryRoutes.d.ts +5 -40
  63. package/dist/core/traceTimeline.d.ts +3 -27
  64. package/dist/core/turnLatency.d.ts +3 -40
  65. package/dist/core/turnQuality.d.ts +3 -40
  66. package/dist/core/voiceMonitoring.d.ts +164 -115
  67. package/dist/index.js +63 -27
  68. package/dist/telephony/matrix.d.ts +148 -39
  69. package/dist/telephony/plivo.d.ts +10 -33
  70. package/dist/telephony/security.d.ts +3 -40
  71. package/dist/telephony/telnyx.d.ts +10 -33
  72. package/dist/testing/index.js +19 -11
  73. package/package.json +7 -81
package/dist/index.js CHANGED
@@ -249,6 +249,7 @@ var resolveAudioConditioningConfig = (config) => {
249
249
 
250
250
  // src/core/plugin.ts
251
251
  import { Elysia as Elysia70 } from "elysia";
252
+ import { websocket as websocket5 } from "elysia/websocket";
252
253
  import { resolve } from "path";
253
254
 
254
255
  // src/internal/html.ts
@@ -4434,9 +4435,13 @@ var createVoiceSession = (options) => {
4434
4435
  if (snapshot.status === "completed" || snapshot.status === "failed" || snapshot.call?.endedAt) {
4435
4436
  return;
4436
4437
  }
4438
+ const { lastSpeechAt, lastTranscriptAt } = snapshot.currentTurn;
4439
+ if (lastTranscriptAt !== undefined && stuckCloseAfterMs !== undefined && Date.now() - lastTranscriptAt < stuckCloseAfterMs) {
4440
+ kickStuckCloseWatchdog();
4441
+ return;
4442
+ }
4437
4443
  stuckCloseFired = true;
4438
4444
  const reason = `no caller progress for ${stuckCloseAfterMs}ms`;
4439
- const { lastSpeechAt, lastTranscriptAt } = snapshot.currentTurn;
4440
4445
  const sttDeafConfirmed = sttDeafConfirmedAt > 0 && (lastTranscriptAt === undefined || sttDeafConfirmedAt > lastTranscriptAt);
4441
4446
  const diagnostic = {
4442
4447
  action: "stuck-call-close",
@@ -21385,6 +21390,7 @@ var summarizeVoiceMediaPipelineReport = (report, options = {}) => {
21385
21390
 
21386
21391
  // src/core/monitor.ts
21387
21392
  import { Elysia as Elysia32 } from "elysia";
21393
+ import { websocket } from "elysia/websocket";
21388
21394
  var buildAudioFanout = () => {
21389
21395
  const handlers = new Set;
21390
21396
  return {
@@ -21673,7 +21679,7 @@ var createVoiceLiveMonitorRoutes = (options) => {
21673
21679
  transfer: options.controlHandlers?.transfer ?? buildDefaultControlHandler("transfer"),
21674
21680
  voicemail: options.controlHandlers?.voicemail ?? buildDefaultControlHandler("voicemail")
21675
21681
  };
21676
- const app = new Elysia32({ name: "absolutejs-voice-monitor" });
21682
+ const app = new Elysia32({ name: "absolutejs-voice-monitor" }).use(websocket());
21677
21683
  const unsubscribers = new WeakMap;
21678
21684
  if (listenPath !== false && listenPath.length > 0) {
21679
21685
  app.ws(`/${listenPath.replace(/^\/+/, "")}`, {
@@ -24884,7 +24890,9 @@ var createVoiceTelephonyWebhookRoutes = (options = {}) => {
24884
24890
  const handler = createVoiceTelephonyWebhookHandler(options);
24885
24891
  return new Elysia36({
24886
24892
  name: options.name ?? "absolutejs-voice-telephony-webhooks"
24887
- }).post(path, async ({ query, request }) => {
24893
+ }).post(path, {
24894
+ parse: "none"
24895
+ }, async ({ query, request }) => {
24888
24896
  try {
24889
24897
  return await handler({ query, request });
24890
24898
  } catch (error) {
@@ -24898,8 +24906,6 @@ var createVoiceTelephonyWebhookRoutes = (options = {}) => {
24898
24906
  }
24899
24907
  throw error;
24900
24908
  }
24901
- }, {
24902
- parse: "none"
24903
24909
  });
24904
24910
  };
24905
24911
 
@@ -25439,10 +25445,12 @@ var createVoiceSQLiteTraceSinkDeliveryStore = (options) => createSQLiteTraceSink
25439
25445
  import { Buffer as Buffer4 } from "buffer";
25440
25446
  import { Database as Database3 } from "bun:sqlite";
25441
25447
  import { Elysia as Elysia38 } from "elysia";
25448
+ import { websocket as websocket3 } from "elysia/websocket";
25442
25449
 
25443
25450
  // src/telephony/twilio.ts
25444
25451
  import { Buffer as Buffer3 } from "buffer";
25445
25452
  import { Elysia as Elysia37 } from "elysia";
25453
+ import { websocket as websocket2 } from "elysia/websocket";
25446
25454
  var TWILIO_MULAW_SAMPLE_RATE = 8000;
25447
25455
  var VOICE_PCM_SAMPLE_RATE = 16000;
25448
25456
  var escapeXml2 = (value) => value.replaceAll("&", "&amp;").replaceAll('"', "&quot;").replaceAll("'", "&apos;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
@@ -25477,10 +25485,12 @@ var resolveTrustedTwilioRequestUrl = (security, request) => {
25477
25485
  return `${resolveTwilioPublicOrigin(security)}${requestUrl.pathname}${requestUrl.search}`;
25478
25486
  };
25479
25487
  var resolveTwilioSocketHeaders = (socket) => {
25480
- if (!socket.data || typeof socket.data !== "object")
25481
- return new Headers;
25482
- const data = socket.data;
25483
- for (const candidate of [data.request?.headers, data.headers]) {
25488
+ const data = socket.data && typeof socket.data === "object" ? socket.data : {
25489
+ headers: socket.headers,
25490
+ request: socket.request && typeof socket.request === "object" ? socket.request : undefined
25491
+ };
25492
+ const candidates = [data.request?.headers, data.headers];
25493
+ for (const candidate of candidates) {
25484
25494
  if (!candidate)
25485
25495
  continue;
25486
25496
  if (typeof candidate === "object" && "get" in candidate && typeof candidate.get === "function") {
@@ -25492,6 +25502,7 @@ var resolveTwilioSocketHeaders = (socket) => {
25492
25502
  }
25493
25503
  return new Headers;
25494
25504
  };
25505
+ var socketKey = (socket) => ("raw" in socket) && socket.raw && typeof socket.raw === "object" ? socket.raw : socket;
25495
25506
  var readTwilioVoiceForm = async (request) => {
25496
25507
  const declaredLength = Number(request.headers.get("content-length"));
25497
25508
  if (Number.isFinite(declaredLength) && declaredLength > MAX_TWILIO_VOICE_BODY_BYTES) {
@@ -26259,9 +26270,9 @@ var createTwilioVoiceRoutes = (options) => {
26259
26270
  const streamVerificationUrl = options.security.streamVerificationUrl ?? `${resolveTwilioPublicOrigin(options.security).replace(/^https:/, "wss:")}${streamPath}`;
26260
26271
  const app = new Elysia37({
26261
26272
  name: options.name ?? "absolutejs-voice-twilio"
26262
- }).get(twimlPath, renderTwiml).post(twimlPath, renderTwiml, { parse: "none" }).ws(streamPath, {
26273
+ }).use(websocket2()).get(twimlPath, renderTwiml).post(twimlPath, { parse: "none" }, renderTwiml).ws(streamPath, {
26263
26274
  close: async (ws, _code, reason) => {
26264
- const key = ws.raw ?? ws;
26275
+ const key = socketKey(ws);
26265
26276
  const bridge = bridges.get(key);
26266
26277
  bridges.delete(key);
26267
26278
  admittedSockets.delete(key);
@@ -26269,7 +26280,7 @@ var createTwilioVoiceRoutes = (options) => {
26269
26280
  await bridge?.close(reason);
26270
26281
  },
26271
26282
  message: async (ws, raw) => {
26272
- const key = ws.raw ?? ws;
26283
+ const key = socketKey(ws);
26273
26284
  if (!admittedSockets.has(key)) {
26274
26285
  const verification = await verifyVoiceTwilioWebhookSignature({
26275
26286
  authToken: options.security.authToken,
@@ -26876,6 +26887,7 @@ var createPlivoVoiceRoutes = (options = {}) => {
26876
26887
  const setupPath = options.setup?.path === false ? false : options.setup?.path ?? "/api/voice/plivo/setup";
26877
26888
  const smokePath = options.smoke?.path === false ? false : options.smoke?.path ?? "/api/voice/plivo/smoke";
26878
26889
  const bridges = new WeakMap;
26890
+ const socketKey2 = (socket) => ("raw" in socket) && socket.raw && typeof socket.raw === "object" ? socket.raw : socket;
26879
26891
  const webhookPolicy = options.webhook?.policy ?? options.outcomePolicy ?? createVoiceTelephonyOutcomePolicy();
26880
26892
  const verify = options.webhook?.verify ?? (options.webhook?.authToken ? createVoicePlivoWebhookVerifier({
26881
26893
  authToken: options.webhook.authToken,
@@ -26884,7 +26896,7 @@ var createPlivoVoiceRoutes = (options = {}) => {
26884
26896
  }) : undefined);
26885
26897
  const app = new Elysia38({
26886
26898
  name: options.name ?? "absolutejs-voice-plivo"
26887
- }).get(answerPath, async ({ query, request }) => {
26899
+ }).use(websocket3()).get(answerPath, async ({ query, request }) => {
26888
26900
  const streamUrl = await resolvePlivoStreamUrl(options, {
26889
26901
  query,
26890
26902
  request,
@@ -26914,7 +26926,7 @@ var createPlivoVoiceRoutes = (options = {}) => {
26914
26926
  });
26915
26927
  }).ws(streamPath, {
26916
26928
  close: async (ws, _code, reason) => {
26917
- const key = ws.raw ?? ws;
26929
+ const key = socketKey2(ws);
26918
26930
  const bridge = bridges.get(key);
26919
26931
  bridges.delete(key);
26920
26932
  await bridge?.close(reason);
@@ -26924,7 +26936,7 @@ var createPlivoVoiceRoutes = (options = {}) => {
26924
26936
  ws.close(1011, "Plivo media bridge is not configured.");
26925
26937
  return;
26926
26938
  }
26927
- const key = ws.raw ?? ws;
26939
+ const key = socketKey2(ws);
26928
26940
  let bridge = bridges.get(key);
26929
26941
  if (!bridge) {
26930
26942
  bridge = createPlivoMediaStreamBridge({
@@ -26997,6 +27009,7 @@ var createPlivoVoiceRoutes = (options = {}) => {
26997
27009
  import { Buffer as Buffer5 } from "buffer";
26998
27010
  import { Database as Database4 } from "bun:sqlite";
26999
27011
  import { Elysia as Elysia39 } from "elysia";
27012
+ import { websocket as websocket4 } from "elysia/websocket";
27000
27013
  var escapeXml4 = (value) => value.replaceAll("&", "&amp;").replaceAll('"', "&quot;").replaceAll("'", "&apos;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
27001
27014
  var joinUrlPath3 = (origin, path) => `${origin.replace(/\/$/, "")}${path.startsWith("/") ? path : `/${path}`}`;
27002
27015
  var resolveRequestOrigin2 = (request) => {
@@ -27455,6 +27468,7 @@ var createTelnyxVoiceRoutes = (options = {}) => {
27455
27468
  const setupPath = options.setup?.path === false ? false : options.setup?.path ?? "/api/voice/telnyx/setup";
27456
27469
  const smokePath = options.smoke?.path === false ? false : options.smoke?.path ?? "/api/voice/telnyx/smoke";
27457
27470
  const bridges = new WeakMap;
27471
+ const socketKey2 = (socket) => ("raw" in socket) && socket.raw && typeof socket.raw === "object" ? socket.raw : socket;
27458
27472
  const webhookPolicy = options.webhook?.policy ?? options.outcomePolicy ?? createVoiceTelephonyOutcomePolicy();
27459
27473
  const verify = options.webhook?.verify ?? (options.webhook?.publicKey ? createVoiceTelnyxWebhookVerifier({
27460
27474
  eventStore: options.webhook.eventStore,
@@ -27463,7 +27477,7 @@ var createTelnyxVoiceRoutes = (options = {}) => {
27463
27477
  }) : undefined);
27464
27478
  const app = new Elysia39({
27465
27479
  name: options.name ?? "absolutejs-voice-telnyx"
27466
- }).get(texmlPath, async ({ query, request }) => {
27480
+ }).use(websocket4()).get(texmlPath, async ({ query, request }) => {
27467
27481
  const streamUrl = await resolveTelnyxStreamUrl(options, {
27468
27482
  query,
27469
27483
  request,
@@ -27493,7 +27507,7 @@ var createTelnyxVoiceRoutes = (options = {}) => {
27493
27507
  });
27494
27508
  }).ws(streamPath, {
27495
27509
  close: async (ws, _code, reason) => {
27496
- const key = ws.raw ?? ws;
27510
+ const key = socketKey2(ws);
27497
27511
  const bridge = bridges.get(key);
27498
27512
  bridges.delete(key);
27499
27513
  await bridge?.close(reason);
@@ -27503,7 +27517,7 @@ var createTelnyxVoiceRoutes = (options = {}) => {
27503
27517
  ws.close(1011, "Telnyx media bridge is not configured.");
27504
27518
  return;
27505
27519
  }
27506
- const key = ws.raw ?? ws;
27520
+ const key = socketKey2(ws);
27507
27521
  let bridge = bridges.get(key);
27508
27522
  if (!bridge) {
27509
27523
  bridge = createTelnyxMediaStreamBridge({
@@ -31808,7 +31822,9 @@ var createVoiceOpsWebhookEnvelope = async (input) => {
31808
31822
  };
31809
31823
  var createVoiceOpsWebhookReceiverRoutes = (options = {}) => {
31810
31824
  const path = options.path ?? "/api/voice-ops/webhook";
31811
- return new Elysia48().post(path, async ({ body, request, set }) => {
31825
+ return new Elysia48().post(path, {
31826
+ parse: "text"
31827
+ }, async ({ body, request, set }) => {
31812
31828
  const bodyText = typeof body === "string" ? body : JSON.stringify(body);
31813
31829
  if (options.signingSecret) {
31814
31830
  const verification = await verifyVoiceOpsWebhookSignature({
@@ -31836,8 +31852,6 @@ var createVoiceOpsWebhookReceiverRoutes = (options = {}) => {
31836
31852
  ok: true,
31837
31853
  type: envelope.event?.type
31838
31854
  };
31839
- }, {
31840
- parse: "text"
31841
31855
  });
31842
31856
  };
31843
31857
  var createVoiceOpsWebhookSink = (options) => createVoiceIntegrationHTTPSink({
@@ -40107,7 +40121,7 @@ var parseClientMessage = (raw) => {
40107
40121
  return null;
40108
40122
  };
40109
40123
  var resolveSessionId3 = (runtime, ws) => {
40110
- const query = ws.data && typeof ws.data === "object" && "query" in ws.data ? ws.data.query : undefined;
40124
+ const query = resolveSocketQuery(ws);
40111
40125
  const identity = socketIdentity(ws);
40112
40126
  const existing = runtime.socketSessions.get(identity);
40113
40127
  const providedSessionId = typeof query?.sessionId === "string" && query.sessionId.trim() ? query.sessionId.trim() : existing?.sessionId ?? createId();
@@ -40119,7 +40133,21 @@ var resolveSessionId3 = (runtime, ws) => {
40119
40133
  runtime.socketSessions.set(identity, resolved);
40120
40134
  return resolved;
40121
40135
  };
40122
- var resolveSocketQuery = (ws) => ws.data && typeof ws.data === "object" && ("query" in ws.data) ? ws.data.query ?? {} : {};
40136
+ var resolveSocketQuery = (ws) => {
40137
+ if (ws.query && typeof ws.query === "object") {
40138
+ return ws.query;
40139
+ }
40140
+ if (ws.data && typeof ws.data === "object" && "query" in ws.data) {
40141
+ return ws.data.query ?? {};
40142
+ }
40143
+ return {};
40144
+ };
40145
+ var resolveSocketContext = (ws) => {
40146
+ if (ws.data && typeof ws.data === "object" && (("headers" in ws.data) || ("query" in ws.data) || ("request" in ws.data))) {
40147
+ return ws.data;
40148
+ }
40149
+ return ws;
40150
+ };
40123
40151
  var normalizeSocketHeaders = (value) => {
40124
40152
  if (!value || typeof value !== "object")
40125
40153
  return null;
@@ -40133,6 +40161,14 @@ var normalizeSocketHeaders = (value) => {
40133
40161
  }
40134
40162
  };
40135
40163
  var resolveSocketHeaders = (ws) => {
40164
+ if (ws.request && typeof ws.request === "object" && "headers" in ws.request) {
40165
+ const requestHeaders = normalizeSocketHeaders(ws.request.headers);
40166
+ if (requestHeaders)
40167
+ return requestHeaders;
40168
+ }
40169
+ const directContextHeaders = normalizeSocketHeaders(ws.headers);
40170
+ if (directContextHeaders)
40171
+ return directContextHeaders;
40136
40172
  if (!ws.data || typeof ws.data !== "object")
40137
40173
  return new Headers;
40138
40174
  if ("request" in ws.data && ws.data.request && typeof ws.data.request === "object" && "headers" in ws.data.request) {
@@ -40339,7 +40375,7 @@ var voice = (config) => {
40339
40375
  let authorized = false;
40340
40376
  try {
40341
40377
  authorized = await config.authorizeConnection({
40342
- context: ws.data,
40378
+ context: resolveSocketContext(ws),
40343
40379
  headers: resolveSocketHeaders(ws),
40344
40380
  path: config.path,
40345
40381
  query: resolveSocketQuery(ws),
@@ -40431,7 +40467,7 @@ var voice = (config) => {
40431
40467
  const htmxRenderers = resolveVoiceHTMXRenderers(config.htmx && config.htmx !== true ? config.htmx : undefined);
40432
40468
  const htmxTargets = resolveVoiceHTMXTargets(htmxOptions?.targets);
40433
40469
  const createManagedSession = async (ws, sessionId, scenarioId) => {
40434
- const context = ws.data;
40470
+ const context = resolveSocketContext(ws);
40435
40471
  const profileSwitchDecision = await resolveProfileSwitchGuard(config, runtime, {
40436
40472
  context,
40437
40473
  scenarioId,
@@ -40720,7 +40756,7 @@ var voice = (config) => {
40720
40756
  }
40721
40757
  }));
40722
40758
  };
40723
- return new Elysia70({ name: "absolutejs-voice" }).ws(config.path, {
40759
+ return new Elysia70({ name: "absolutejs-voice" }).use(websocket5()).ws(config.path, {
40724
40760
  close: async (ws, code, reason) => {
40725
40761
  const identity = socketIdentity(ws);
40726
40762
  closedSockets.add(identity);
@@ -44087,7 +44123,7 @@ var isBypassed = (bypassPaths, url) => {
44087
44123
  };
44088
44124
  var createVoiceRouteAuth = (options) => {
44089
44125
  const bypassPaths = options.bypassPaths ?? [];
44090
- return new Elysia71({ name: options.name ?? "voice-route-auth" }).onRequest(async ({ request, set }) => {
44126
+ return new Elysia71({ name: options.name ?? "voice-route-auth" }).request(async ({ request, set }) => {
44091
44127
  const { url } = request;
44092
44128
  if (isBypassed(bypassPaths, url))
44093
44129
  return;
@@ -1,4 +1,3 @@
1
- import { Elysia } from "elysia";
2
1
  import { type VoiceTelephonyContractOptions, type VoiceTelephonyContractReport, type VoiceTelephonyProvider, type VoiceTelephonySetupStatus, type VoiceTelephonySmokeReport } from "./contract";
3
2
  export type VoiceTelephonyCarrierMatrixStatus = "fail" | "pass" | "warn";
4
3
  export type VoiceTelephonyCarrierMatrixInput<TProvider extends VoiceTelephonyProvider = VoiceTelephonyProvider> = {
@@ -52,46 +51,156 @@ export type VoiceTelephonyCarrierMatrixRoutesOptions = {
52
51
  contract?: VoiceTelephonyContractOptions;
53
52
  };
54
53
  export declare const createVoiceTelephonyCarrierMatrix: (options: VoiceTelephonyCarrierMatrixOptions) => VoiceTelephonyCarrierMatrix;
55
- export declare const createVoiceTelephonyCarrierMatrixRoutes: (options: VoiceTelephonyCarrierMatrixRoutesOptions) => Elysia<"", {
56
- decorator: {};
57
- store: {};
58
- derive: {};
59
- resolve: {};
60
- }, {
54
+ export declare const createVoiceTelephonyCarrierMatrixRoutes: (options: VoiceTelephonyCarrierMatrixRoutesOptions) => import("elysia/types").AddRoute<"", "local", import("elysia/types").DefaultSingleton, {
61
55
  typebox: {};
62
- error: {};
63
- }, {
64
- schema: {};
65
- standaloneSchema: {};
66
- macro: {};
67
- macroFn: {};
68
- parser: {};
69
- response: {};
70
- }, {
71
- [x: string]: {
72
- get: {
73
- body: unknown;
74
- params: {};
75
- query: unknown;
76
- headers: unknown;
77
- response: {
78
- 200: Response | VoiceTelephonyCarrierMatrix;
79
- };
80
- };
56
+ error: [];
57
+ }, import("elysia/types").DefaultMetadata, {}, import("elysia/types").DefaultEphemeral, import("elysia/types").DefaultEphemeral, "get", string, import("elysia/types").IntersectIfObjectSchema<import("elysia").UnwrapRoute<{}, {}, `/${string}`>, import("elysia/types").MergeScopedSchemas<{}, {}, {}>>, {}, ({ query, request }: {
58
+ body: unknown;
59
+ query: Record<string, string | undefined>;
60
+ params: {};
61
+ headers: Record<string, string | undefined>;
62
+ cookie: Record<string, import("elysia").Cookie<unknown>>;
63
+ server: import("elysia").Server | null;
64
+ redirect: import("elysia").redirect;
65
+ set: {
66
+ headers: import("elysia").HTTPHeaders;
67
+ status?: number | keyof import("elysia").StatusMap;
68
+ cookie?: Record<string, import("elysia").BaseCookie>;
81
69
  };
82
- }, {
83
- derive: {};
84
- resolve: {};
85
- schema: {};
86
- standaloneSchema: {};
87
- response: {};
88
- }, {
89
- derive: {};
90
- resolve: {};
91
- schema: {};
92
- standaloneSchema: {};
93
- response: {};
94
- }>;
70
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 100 | 404 | 400 | 408 | 401 | 503 | 200 | 429 | 500 | 300 | 420 | 413 | 415 | 403 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 409 | 410 | 411 | 412 | 414 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
71
+ readonly 100: "Continue";
72
+ readonly 101: "Switching Protocols";
73
+ readonly 102: "Processing";
74
+ readonly 103: "Early Hints";
75
+ readonly 200: "OK";
76
+ readonly 201: "Created";
77
+ readonly 202: "Accepted";
78
+ readonly 203: "Non-Authoritative Information";
79
+ readonly 204: "No Content";
80
+ readonly 205: "Reset Content";
81
+ readonly 206: "Partial Content";
82
+ readonly 207: "Multi-Status";
83
+ readonly 208: "Already Reported";
84
+ readonly 300: "Multiple Choices";
85
+ readonly 301: "Moved Permanently";
86
+ readonly 302: "Found";
87
+ readonly 303: "See Other";
88
+ readonly 304: "Not Modified";
89
+ readonly 307: "Temporary Redirect";
90
+ readonly 308: "Permanent Redirect";
91
+ readonly 400: "Bad Request";
92
+ readonly 401: "Unauthorized";
93
+ readonly 402: "Payment Required";
94
+ readonly 403: "Forbidden";
95
+ readonly 404: "Not Found";
96
+ readonly 405: "Method Not Allowed";
97
+ readonly 406: "Not Acceptable";
98
+ readonly 407: "Proxy Authentication Required";
99
+ readonly 408: "Request Timeout";
100
+ readonly 409: "Conflict";
101
+ readonly 410: "Gone";
102
+ readonly 411: "Length Required";
103
+ readonly 412: "Precondition Failed";
104
+ readonly 413: "Payload Too Large";
105
+ readonly 414: "URI Too Long";
106
+ readonly 415: "Unsupported Media Type";
107
+ readonly 416: "Range Not Satisfiable";
108
+ readonly 417: "Expectation Failed";
109
+ readonly 418: "I'm a teapot";
110
+ readonly 420: "Enhance Your Calm";
111
+ readonly 421: "Misdirected Request";
112
+ readonly 422: "Unprocessable Content";
113
+ readonly 423: "Locked";
114
+ readonly 424: "Failed Dependency";
115
+ readonly 425: "Too Early";
116
+ readonly 426: "Upgrade Required";
117
+ readonly 428: "Precondition Required";
118
+ readonly 429: "Too Many Requests";
119
+ readonly 431: "Request Header Fields Too Large";
120
+ readonly 451: "Unavailable For Legal Reasons";
121
+ readonly 500: "Internal Server Error";
122
+ readonly 501: "Not Implemented";
123
+ readonly 502: "Bad Gateway";
124
+ readonly 503: "Service Unavailable";
125
+ readonly 504: "Gateway Timeout";
126
+ readonly 505: "HTTP Version Not Supported";
127
+ readonly 506: "Variant Also Negotiates";
128
+ readonly 507: "Insufficient Storage";
129
+ readonly 508: "Loop Detected";
130
+ readonly 510: "Not Extended";
131
+ readonly 511: "Network Authentication Required";
132
+ }[Code] : Code>(code: Code, response?: T) => import("elysia").ElysiaStatus<Code, T, Code extends "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | "Partial Content" | "Multi-Status" | "Already Reported" | "Multiple Choices" | "Moved Permanently" | "Found" | "See Other" | "Not Modified" | "Temporary Redirect" | "Permanent Redirect" | "Bad Request" | "Unauthorized" | "Payment Required" | "Forbidden" | "Not Found" | "Method Not Allowed" | "Not Acceptable" | "Proxy Authentication Required" | "Request Timeout" | "Conflict" | "Gone" | "Length Required" | "Precondition Failed" | "Payload Too Large" | "URI Too Long" | "Unsupported Media Type" | "Range Not Satisfiable" | "Expectation Failed" | "I'm a teapot" | "Enhance Your Calm" | "Misdirected Request" | "Unprocessable Content" | "Locked" | "Failed Dependency" | "Too Early" | "Upgrade Required" | "Precondition Required" | "Too Many Requests" | "Request Header Fields Too Large" | "Unavailable For Legal Reasons" | "Internal Server Error" | "Not Implemented" | "Bad Gateway" | "Service Unavailable" | "Gateway Timeout" | "HTTP Version Not Supported" | "Variant Also Negotiates" | "Insufficient Storage" | "Loop Detected" | "Not Extended" | "Network Authentication Required" ? {
133
+ readonly Continue: 100;
134
+ readonly "Switching Protocols": 101;
135
+ readonly Processing: 102;
136
+ readonly "Early Hints": 103;
137
+ readonly OK: 200;
138
+ readonly Created: 201;
139
+ readonly Accepted: 202;
140
+ readonly "Non-Authoritative Information": 203;
141
+ readonly "No Content": 204;
142
+ readonly "Reset Content": 205;
143
+ readonly "Partial Content": 206;
144
+ readonly "Multi-Status": 207;
145
+ readonly "Already Reported": 208;
146
+ readonly "Multiple Choices": 300;
147
+ readonly "Moved Permanently": 301;
148
+ readonly Found: 302;
149
+ readonly "See Other": 303;
150
+ readonly "Not Modified": 304;
151
+ readonly "Temporary Redirect": 307;
152
+ readonly "Permanent Redirect": 308;
153
+ readonly "Bad Request": 400;
154
+ readonly Unauthorized: 401;
155
+ readonly "Payment Required": 402;
156
+ readonly Forbidden: 403;
157
+ readonly "Not Found": 404;
158
+ readonly "Method Not Allowed": 405;
159
+ readonly "Not Acceptable": 406;
160
+ readonly "Proxy Authentication Required": 407;
161
+ readonly "Request Timeout": 408;
162
+ readonly Conflict: 409;
163
+ readonly Gone: 410;
164
+ readonly "Length Required": 411;
165
+ readonly "Precondition Failed": 412;
166
+ readonly "Payload Too Large": 413;
167
+ readonly "URI Too Long": 414;
168
+ readonly "Unsupported Media Type": 415;
169
+ readonly "Range Not Satisfiable": 416;
170
+ readonly "Expectation Failed": 417;
171
+ readonly "I'm a teapot": 418;
172
+ readonly "Enhance Your Calm": 420;
173
+ readonly "Misdirected Request": 421;
174
+ readonly "Unprocessable Content": 422;
175
+ readonly Locked: 423;
176
+ readonly "Failed Dependency": 424;
177
+ readonly "Too Early": 425;
178
+ readonly "Upgrade Required": 426;
179
+ readonly "Precondition Required": 428;
180
+ readonly "Too Many Requests": 429;
181
+ readonly "Request Header Fields Too Large": 431;
182
+ readonly "Unavailable For Legal Reasons": 451;
183
+ readonly "Internal Server Error": 500;
184
+ readonly "Not Implemented": 501;
185
+ readonly "Bad Gateway": 502;
186
+ readonly "Service Unavailable": 503;
187
+ readonly "Gateway Timeout": 504;
188
+ readonly "HTTP Version Not Supported": 505;
189
+ readonly "Variant Also Negotiates": 506;
190
+ readonly "Insufficient Storage": 507;
191
+ readonly "Loop Detected": 508;
192
+ readonly "Not Extended": 510;
193
+ readonly "Network Authentication Required": 511;
194
+ }[Code] : Code>;
195
+ defer: (fn: import("elysia/types").AfterResponseHandler<NoInfer<import("elysia/types").IntersectIfObjectSchema<import("elysia").UnwrapRoute<{}, {}, `/${string}`>, import("elysia/types").MergeScopedSchemas<{}, {}, {}>>>, NoInfer<import("elysia/types").DefaultSingleton & {
196
+ derive: {};
197
+ }>>) => import("elysia/types").MaybePromise<void>;
198
+ readonly path: string;
199
+ route?: string | undefined;
200
+ rid?: string | undefined;
201
+ request: Request;
202
+ store: {};
203
+ }) => Promise<Response | VoiceTelephonyCarrierMatrix>>;
95
204
  export declare const renderVoiceTelephonyCarrierMatrixHTML: (matrix: VoiceTelephonyCarrierMatrix, options?: {
96
205
  title?: string;
97
206
  }) => string;
@@ -220,22 +220,14 @@ export declare const createVoicePlivoWebhookVerifier: (options: VoicePlivoWebhoo
220
220
  request: Request;
221
221
  }) => Promise<VoiceTelephonyWebhookVerificationResult>;
222
222
  export declare const createVoiceRedisPlivoWebhookNonceStore: (options?: VoiceRedisPlivoWebhookNonceStoreOptions) => VoicePlivoWebhookNonceStore;
223
- export declare const createPlivoVoiceRoutes: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options?: PlivoVoiceRoutesOptions<TContext, TSession, TResult>) => Elysia<"", {
223
+ export declare const createPlivoVoiceRoutes: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options?: PlivoVoiceRoutesOptions<TContext, TSession, TResult>) => Elysia<"", "local", {
224
224
  decorator: {};
225
225
  store: {};
226
226
  derive: {};
227
- resolve: {};
228
227
  }, {
229
228
  typebox: {};
230
- error: {};
231
- }, {
232
- schema: {};
233
- standaloneSchema: {};
234
- macro: {};
235
- macroFn: {};
236
- parser: {};
237
- response: {};
238
- }, {
229
+ error: [];
230
+ }, import("elysia/types").DefaultMetadata, {
239
231
  [x: string]: {
240
232
  get: {
241
233
  body: unknown;
@@ -245,6 +237,7 @@ export declare const createPlivoVoiceRoutes: <TContext = unknown, TSession exten
245
237
  response: {
246
238
  200: Response;
247
239
  };
240
+ error: never;
248
241
  };
249
242
  };
250
243
  } & {
@@ -257,17 +250,12 @@ export declare const createPlivoVoiceRoutes: <TContext = unknown, TSession exten
257
250
  response: {
258
251
  200: Response;
259
252
  };
253
+ error: never;
260
254
  };
261
255
  };
262
256
  } & {
263
257
  [x: string]: {
264
- subscribe: {
265
- body: {};
266
- params: {};
267
- query: {};
268
- headers: {};
269
- response: {};
270
- };
258
+ subscribe: import("elysia/types").CreateWSEdenResponse<string, import("elysia/types").IntersectIfObjectSchema<import("elysia").UnwrapRoute<import("elysia").InputSchema<never>, {}, `/${string}`>, import("elysia/types").MergeScopedSchemas<{}, {}, {}>>, {}, import("elysia/types").ComposeElysiaResponse<import("elysia/types").IntersectIfObjectSchema<import("elysia").UnwrapRoute<import("elysia").InputSchema<never>, {}, `/${string}`>, import("elysia/types").MergeScopedSchemas<{}, {}, {}>>, void, {}, [], string>>;
271
259
  };
272
260
  } & {
273
261
  [x: string]: {
@@ -279,24 +267,13 @@ export declare const createPlivoVoiceRoutes: <TContext = unknown, TSession exten
279
267
  response: {
280
268
  200: Response | import("..").VoiceTelephonyWebhookDecision<TResult>;
281
269
  };
270
+ error: never;
282
271
  };
283
272
  };
284
- }, {
285
- derive: {};
286
- resolve: {};
287
- schema: {};
288
- standaloneSchema: {};
289
- response: {};
290
- }, {
291
- derive: {};
292
- resolve: {};
293
- schema: {};
294
- standaloneSchema: {};
295
- response: {};
296
- } & {
273
+ }, import("elysia/types").DefaultEphemeral, {
297
274
  derive: {};
298
- resolve: {};
299
275
  schema: {};
300
- standaloneSchema: {};
276
+ schemas: {};
301
277
  response: {};
278
+ error: [];
302
279
  }>;
@@ -1,5 +1,4 @@
1
1
  import { type VoiceTelephonyWebhookIdempotencyStore, type VoiceTelephonyWebhookProvider, type VoiceTelephonyWebhookVerificationResult } from "../core/telephonyOutcome";
2
- import { Elysia } from "elysia";
3
2
  import { type VoicePostgresClient } from "../core/postgresStore";
4
3
  import { type VoiceRedisTelephonyWebhookIdempotencyClient } from "../core/queue";
5
4
  import { type VoicePlivoWebhookNonceStore, type VoiceRedisPlivoWebhookNonceClient } from "./plivo";
@@ -139,44 +138,8 @@ export type VoiceTelephonyWebhookSecurityRoutesOptions<TResult = unknown> = {
139
138
  export declare const assertVoiceTelephonyWebhookSecurityEvidence: (report: VoiceTelephonyWebhookSecurityReport, input?: VoiceTelephonyWebhookSecurityAssertionInput) => VoiceTelephonyWebhookSecurityAssertionReport;
140
139
  export declare const buildVoiceTelephonyWebhookSecurityReport: <TResult = unknown>(options?: VoiceTelephonyWebhookSecurityOptions<TResult>) => VoiceTelephonyWebhookSecurityReport;
141
140
  export declare const createVoiceTelephonyWebhookSecurityPreset: <TResult = unknown>(options?: VoiceTelephonyWebhookSecurityOptions<TResult>) => VoiceTelephonyWebhookSecurityPreset<TResult>;
142
- export declare const createVoiceTelephonyWebhookSecurityRoutes: <TResult = unknown>(options: VoiceTelephonyWebhookSecurityRoutesOptions<TResult>) => Elysia<"", {
143
- decorator: {};
144
- store: {};
145
- derive: {};
146
- resolve: {};
147
- }, {
141
+ export declare const createVoiceTelephonyWebhookSecurityRoutes: <TResult = unknown>(options: VoiceTelephonyWebhookSecurityRoutesOptions<TResult>) => import("elysia/types").AddRoute<"", "local", import("elysia/types").DefaultSingleton, {
148
142
  typebox: {};
149
- error: {};
150
- }, {
151
- schema: {};
152
- standaloneSchema: {};
153
- macro: {};
154
- macroFn: {};
155
- parser: {};
156
- response: {};
157
- }, {
158
- [x: string]: {
159
- get: {
160
- body: unknown;
161
- params: {};
162
- query: unknown;
163
- headers: unknown;
164
- response: {
165
- 200: VoiceTelephonyWebhookSecurityReport;
166
- };
167
- };
168
- };
169
- }, {
170
- derive: {};
171
- resolve: {};
172
- schema: {};
173
- standaloneSchema: {};
174
- response: {};
175
- }, {
176
- derive: {};
177
- resolve: {};
178
- schema: {};
179
- standaloneSchema: {};
180
- response: {};
181
- }>;
143
+ error: [];
144
+ }, import("elysia/types").DefaultMetadata, {}, import("elysia/types").DefaultEphemeral, import("elysia/types").DefaultEphemeral, "get", string, import("elysia/types").IntersectIfObjectSchema<import("elysia").UnwrapRoute<{}, {}, `/${string}`>, import("elysia/types").MergeScopedSchemas<{}, {}, {}>>, {}, () => VoiceTelephonyWebhookSecurityReport>;
182
145
  export declare const evaluateVoiceTelephonyWebhookSecurityEvidence: (report: VoiceTelephonyWebhookSecurityReport, input?: VoiceTelephonyWebhookSecurityAssertionInput) => VoiceTelephonyWebhookSecurityAssertionReport;