@absolutejs/voice 0.0.22-beta.447 → 0.0.22-beta.449
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/dist/index.js +13 -3
- package/dist/productionReadiness.d.ts +4 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -29382,7 +29382,17 @@ var resolveReconnectContracts = async (options, input) => {
|
|
|
29382
29382
|
if (options.reconnectContracts === false || options.reconnectContracts === undefined) {
|
|
29383
29383
|
return;
|
|
29384
29384
|
}
|
|
29385
|
-
|
|
29385
|
+
const reports = typeof options.reconnectContracts === "function" ? await options.reconnectContracts(input) : options.reconnectContracts;
|
|
29386
|
+
return reports.map((report) => {
|
|
29387
|
+
if ("contract" in report) {
|
|
29388
|
+
return {
|
|
29389
|
+
...report.contract,
|
|
29390
|
+
checkedAt: report.checkedAt,
|
|
29391
|
+
pass: report.ok && report.contract.pass
|
|
29392
|
+
};
|
|
29393
|
+
}
|
|
29394
|
+
return report;
|
|
29395
|
+
});
|
|
29386
29396
|
};
|
|
29387
29397
|
var resolveBargeInReports = async (options, input) => {
|
|
29388
29398
|
if (options.bargeInReports === false || options.bargeInReports === undefined) {
|
|
@@ -30369,7 +30379,7 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
30369
30379
|
if (reconnectSnapshotShortfallCount > 0) {
|
|
30370
30380
|
reconnectContractBreadthFailures.push(`${reconnectSnapshotShortfallCount} reconnect contract(s) with fewer than ${reconnectContractSnapshotsMin} snapshot(s).`);
|
|
30371
30381
|
}
|
|
30372
|
-
const failedReports = reconnectContracts.filter((report) => !report.pass || options.reconnectResumeFailAfterMs !== undefined && report.resumeLatencyP95Ms !== undefined && report.resumeLatencyP95Ms > options.reconnectResumeFailAfterMs);
|
|
30382
|
+
const failedReports = reconnectContracts.filter((report) => !report.pass || !report.summary.reconnected || !report.summary.resumed || options.reconnectResumeFailAfterMs !== undefined && report.resumeLatencyP95Ms !== undefined && report.resumeLatencyP95Ms > options.reconnectResumeFailAfterMs);
|
|
30373
30383
|
const resumeLatencies = reconnectContracts.map((report) => report.resumeLatencyP95Ms).filter((value) => typeof value === "number");
|
|
30374
30384
|
const reconnectContractBreadthFailureCount = reconnectContractBreadthFailures.length > 0 ? Math.min(reconnectContracts.length, reconnectContractBreadthFailures.length) : 0;
|
|
30375
30385
|
const passedCount = Math.max(0, reconnectContracts.length - (failedReports.length + reconnectContractBreadthFailureCount));
|
|
@@ -30647,7 +30657,7 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
30647
30657
|
}
|
|
30648
30658
|
if (reconnectContractSummary) {
|
|
30649
30659
|
checks.push({
|
|
30650
|
-
detail: reconnectContractSummary.status === "pass" ? `${reconnectContractSummary.passed} reconnect contract(s) are passing.` : reconnectContractBreadthSummary && reconnectContractBreadthSummary.length > 0 ? reconnectContractBreadthSummary.join("; ") : reconnectContractSummary.total === 0 ? "No reconnect contracts are configured." : options.reconnectResumeFailAfterMs !== undefined && reconnectContractSummary.resumeLatencyP95Ms !== undefined && reconnectContractSummary.resumeLatencyP95Ms > options.reconnectResumeFailAfterMs ? `Reconnect resume p95 ${reconnectContractSummary.resumeLatencyP95Ms}ms exceeded ${options.reconnectResumeFailAfterMs}ms.` : `${reconnectContractSummary.failed} reconnect contract(s) failed.`,
|
|
30660
|
+
detail: reconnectContractSummary.status === "pass" ? `${reconnectContractSummary.passed} reconnect contract(s) are passing.` : reconnectContractBreadthSummary && reconnectContractBreadthSummary.length > 0 ? reconnectContractBreadthSummary.join("; ") : reconnectContractSummary.total === 0 ? "No reconnect contracts are configured." : options.reconnectResumeFailAfterMs !== undefined && reconnectContractSummary.resumeLatencyP95Ms !== undefined && reconnectContractSummary.resumeLatencyP95Ms > options.reconnectResumeFailAfterMs ? `Reconnect resume p95 ${reconnectContractSummary.resumeLatencyP95Ms}ms exceeded ${options.reconnectResumeFailAfterMs}ms.` : `${reconnectContractSummary.failed} reconnect contract(s) failed or did not observe reconnect resume.`,
|
|
30651
30661
|
href: options.links?.reconnectContracts ?? options.links?.sessions ?? "/sessions",
|
|
30652
30662
|
label: "Reconnect recovery contracts",
|
|
30653
30663
|
proofSource: proofSource("reconnectContracts", "reconnect"),
|
|
@@ -10,7 +10,7 @@ import type { VoiceBargeInReport } from "./bargeInRoutes";
|
|
|
10
10
|
import type { VoiceDeliveryRuntime, VoiceDeliveryRuntimeSummary } from "./deliveryRuntime";
|
|
11
11
|
import type { VoiceProviderRoutingContractReport } from "./providerRoutingContract";
|
|
12
12
|
import type { VoicePhoneAgentProductionSmokeReport } from "./phoneAgentProductionSmoke";
|
|
13
|
-
import type { VoiceReconnectContractReport } from "./reconnectContract";
|
|
13
|
+
import type { VoiceReconnectContractReport, VoiceReconnectProofReport } from "./reconnectContract";
|
|
14
14
|
import type { VoiceAuditEventStore, VoiceAuditEventType, VoiceAuditOutcome } from "./audit";
|
|
15
15
|
import { type VoiceAuditSinkDeliveryStore } from "./auditSinks";
|
|
16
16
|
import type { VoiceProviderContractMatrixReport, VoiceProviderStackCapabilityGapReport } from "./providerStackRecommendations";
|
|
@@ -32,6 +32,7 @@ export type VoiceProductionReadinessObservabilityExportDeliveryHistoryOptions =
|
|
|
32
32
|
store?: VoiceObservabilityExportDeliveryReceiptStore;
|
|
33
33
|
};
|
|
34
34
|
export type VoiceProductionReadinessStatus = "fail" | "pass" | "warn";
|
|
35
|
+
export type VoiceProductionReconnectEvidence = VoiceReconnectContractReport | VoiceReconnectProofReport;
|
|
35
36
|
export type VoiceProductionReadinessAction = {
|
|
36
37
|
description?: string;
|
|
37
38
|
href: string;
|
|
@@ -662,10 +663,10 @@ export type VoiceProductionReadinessRoutesOptions = {
|
|
|
662
663
|
query: Record<string, unknown>;
|
|
663
664
|
request: Request;
|
|
664
665
|
}) => Promise<VoiceProviderContractMatrixReport> | VoiceProviderContractMatrixReport);
|
|
665
|
-
reconnectContracts?: false | readonly
|
|
666
|
+
reconnectContracts?: false | readonly VoiceProductionReconnectEvidence[] | ((input: {
|
|
666
667
|
query: Record<string, unknown>;
|
|
667
668
|
request: Request;
|
|
668
|
-
}) => Promise<readonly
|
|
669
|
+
}) => Promise<readonly VoiceProductionReconnectEvidence[]> | readonly VoiceProductionReconnectEvidence[]);
|
|
669
670
|
proofSources?: false | Record<string, VoiceProductionReadinessProofSource> | ((input: {
|
|
670
671
|
query: Record<string, unknown>;
|
|
671
672
|
request: Request;
|