@absolutejs/voice 0.0.22-beta.394 → 0.0.22-beta.396
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.d.ts +2 -0
- package/dist/index.js +236 -18
- package/dist/proofRunner.d.ts +79 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -33,6 +33,8 @@ export type { VoicePlatformCoverageAssertionInput, VoicePlatformCoverageAssertio
|
|
|
33
33
|
export { assertVoiceProofTrendEvidence, appendVoiceRealCallProfileRecoveryEvidence, buildEmptyVoiceProofTrendReport, buildVoiceProofTrendProfileSummaries, buildVoiceProofTrendRecommendationReport, buildVoiceProofTrendReportFromRealCallProfiles, buildVoiceProofTrendReport, buildVoiceRealCallProfileEvidenceFromTraceEvents, buildVoiceRealCallProfileDefaults, buildVoiceRealCallProfileHistoryReport, buildVoiceRealCallProfileReadinessCheck, buildVoiceRealCallProfileRecoveryJobHistoryCheck, buildVoiceRealCallProfileRecoveryActions, createVoiceInMemoryRealCallProfileRecoveryJobStore, createVoiceRealCallProfileTraceCollector, createVoiceSQLiteRealCallProfileRecoveryJobStore, createVoiceProofTrendRecommendationRoutes, createVoiceProofTrendRoutes, createVoiceRealCallProfileHistoryRoutes, createVoiceRealCallProfileRecoveryActionRoutes, DEFAULT_VOICE_PROOF_TREND_PROFILE_DEFINITIONS, DEFAULT_VOICE_PROOF_TRENDS_MAX_AGE_MS, evaluateVoiceProofTrendEvidence, formatVoiceProofTrendAge, loadVoiceRealCallProfileEvidenceFromTraceStore, normalizeVoiceProofTrendReport, readVoiceProofTrendReportFile, renderVoiceProofTrendRecommendationHTML, renderVoiceProofTrendRecommendationMarkdown, renderVoiceRealCallProfileHistoryHTML, renderVoiceRealCallProfileHistoryMarkdown, runVoiceRealCallProfileRecoveryLoop, resolveVoiceRealCallProfileProviderRoute } from './proofTrends';
|
|
34
34
|
export { createVoiceEvidenceAssertion, createVoiceProofAssertion, summarizeVoiceProofAssertions } from './proofAssertions';
|
|
35
35
|
export type { VoiceEvidenceAssertionInput, VoiceProofAssertionInput, VoiceProofAssertionResult, VoiceProofAssertionSummary } from './proofAssertions';
|
|
36
|
+
export { fetchVoiceProofTarget, getVoiceProofTargetLogicalFailure, mapVoiceProofTargetsWithConcurrency, runVoiceCommandProofTarget, runVoiceCommandProofTargets, runVoiceProofTargets } from './proofRunner';
|
|
37
|
+
export type { VoiceCommandProofExecutionResult, VoiceCommandProofTarget, VoiceCommandProofTargetResult, VoiceCommandProofTargetRunnerOptions, VoiceCommandProofTargetRunOptions, VoiceProofTarget, VoiceProofTargetMethod, VoiceProofTargetResult, VoiceProofTargetRunnerOptions, VoiceProofTargetRunOptions } from './proofRunner';
|
|
36
38
|
export { applyVoiceProfileSwitchGuard, buildVoiceProfileSwitchReadinessReport, buildVoiceProfileSwitchLiveDecisionReport, createVoiceProfileSwitchLiveDecisionRoutes, createVoiceProfileSwitchPolicyProofRoutes, createVoiceProfileSwitchReadinessRoutes, recommendVoiceProfileSwitch, renderVoiceProfileSwitchLiveDecisionHTML, renderVoiceProfileSwitchPolicyProofHTML, renderVoiceProfileSwitchReadinessHTML, runVoiceProfileSwitchPolicyProof } from './profileSwitchRecommendation';
|
|
37
39
|
export type { VoiceProfileSwitchGuardAction, VoiceProfileSwitchGuardDecision, VoiceProfileSwitchGuardMode, VoiceProfileSwitchGuardOptions, VoiceProfileSwitchObservedSignals, VoiceProfileSwitchLiveDecisionEvidence, VoiceProfileSwitchLiveDecisionReport, VoiceProfileSwitchLiveDecisionReportOptions, VoiceProfileSwitchLiveDecisionRoutesOptions, VoiceProfileSwitchLiveDecisionSession, VoiceProfileSwitchPolicyProofCase, VoiceProfileSwitchPolicyProofCaseResult, VoiceProfileSwitchPolicyProofOptions, VoiceProfileSwitchPolicyProofReport, VoiceProfileSwitchPolicyProofRoutesOptions, VoiceProfileSwitchReadinessIssue, VoiceProfileSwitchReadinessOptions, VoiceProfileSwitchReadinessReport, VoiceProfileSwitchReadinessRoutesOptions, VoiceProfileSwitchReadinessStatus, VoiceProfileSwitchRecommendation, VoiceProfileSwitchRecommendationOptions } from './profileSwitchRecommendation';
|
|
38
40
|
export { buildVoiceProviderDecisionTraceReport, createVoiceProviderDecisionTraceEvent, createVoiceProviderDecisionTraceRoutes, listVoiceProviderDecisionTraces, renderVoiceProviderDecisionTraceHTML, renderVoiceProviderDecisionTraceMarkdown } from './providerDecisionTraces';
|
package/dist/index.js
CHANGED
|
@@ -18385,6 +18385,218 @@ var summarizeVoiceProofAssertions = (assertions) => {
|
|
|
18385
18385
|
total: assertions.length
|
|
18386
18386
|
};
|
|
18387
18387
|
};
|
|
18388
|
+
// src/proofRunner.ts
|
|
18389
|
+
var encoder = new TextEncoder;
|
|
18390
|
+
var trimBaseUrl = (baseUrl) => baseUrl.replace(/\/$/, "");
|
|
18391
|
+
var safeArtifactName = (name) => name.replace(/[^a-z0-9_.-]/gi, "-");
|
|
18392
|
+
var summarizeValue = (value) => {
|
|
18393
|
+
if (Array.isArray(value)) {
|
|
18394
|
+
return { count: value.length };
|
|
18395
|
+
}
|
|
18396
|
+
if (!value || typeof value !== "object") {
|
|
18397
|
+
return value;
|
|
18398
|
+
}
|
|
18399
|
+
const record = value;
|
|
18400
|
+
const preferredKeys = [
|
|
18401
|
+
"status",
|
|
18402
|
+
"ok",
|
|
18403
|
+
"pass",
|
|
18404
|
+
"ready",
|
|
18405
|
+
"proof",
|
|
18406
|
+
"total",
|
|
18407
|
+
"passed",
|
|
18408
|
+
"failed",
|
|
18409
|
+
"issues",
|
|
18410
|
+
"summary",
|
|
18411
|
+
"links",
|
|
18412
|
+
"actions",
|
|
18413
|
+
"checks",
|
|
18414
|
+
"campaigns",
|
|
18415
|
+
"recipients",
|
|
18416
|
+
"attempts",
|
|
18417
|
+
"telephonyMedia",
|
|
18418
|
+
"operationsRecordHref",
|
|
18419
|
+
"sentEvents",
|
|
18420
|
+
"tasks",
|
|
18421
|
+
"reviews",
|
|
18422
|
+
"events",
|
|
18423
|
+
"eventsWithLatency",
|
|
18424
|
+
"observabilityExportReplay",
|
|
18425
|
+
"validationIssues",
|
|
18426
|
+
"deliveryDestinations",
|
|
18427
|
+
"failedDeliveryDestinations",
|
|
18428
|
+
"failedArtifacts",
|
|
18429
|
+
"artifacts",
|
|
18430
|
+
"kinds",
|
|
18431
|
+
"redaction",
|
|
18432
|
+
"retentionPlan",
|
|
18433
|
+
"zeroRetentionAvailable"
|
|
18434
|
+
];
|
|
18435
|
+
const summary = {};
|
|
18436
|
+
for (const key of preferredKeys) {
|
|
18437
|
+
if (key in record) {
|
|
18438
|
+
summary[key] = summarizeValue(record[key]);
|
|
18439
|
+
}
|
|
18440
|
+
}
|
|
18441
|
+
return Object.keys(summary).length > 0 ? summary : {
|
|
18442
|
+
keys: Object.keys(record).slice(0, 12)
|
|
18443
|
+
};
|
|
18444
|
+
};
|
|
18445
|
+
var getVoiceProofTargetLogicalFailure = (value) => {
|
|
18446
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
18447
|
+
return;
|
|
18448
|
+
}
|
|
18449
|
+
const record = value;
|
|
18450
|
+
if (record.status === "fail") {
|
|
18451
|
+
return 'Response status is "fail".';
|
|
18452
|
+
}
|
|
18453
|
+
if (record.pass === false) {
|
|
18454
|
+
return "Response pass is false.";
|
|
18455
|
+
}
|
|
18456
|
+
if (record.ok === false) {
|
|
18457
|
+
return "Response ok is false.";
|
|
18458
|
+
}
|
|
18459
|
+
return;
|
|
18460
|
+
};
|
|
18461
|
+
var mapVoiceProofTargetsWithConcurrency = async (items, limit, mapper) => {
|
|
18462
|
+
const results = new Array(items.length);
|
|
18463
|
+
let nextIndex = 0;
|
|
18464
|
+
const workerCount = Math.min(Math.max(1, limit), items.length);
|
|
18465
|
+
const workers = Array.from({ length: workerCount }, async () => {
|
|
18466
|
+
while (nextIndex < items.length) {
|
|
18467
|
+
const index = nextIndex;
|
|
18468
|
+
nextIndex += 1;
|
|
18469
|
+
const item = items[index];
|
|
18470
|
+
if (item !== undefined) {
|
|
18471
|
+
results[index] = await mapper(item);
|
|
18472
|
+
}
|
|
18473
|
+
}
|
|
18474
|
+
});
|
|
18475
|
+
await Promise.all(workers);
|
|
18476
|
+
return results;
|
|
18477
|
+
};
|
|
18478
|
+
var fetchVoiceProofTarget = async (target, options) => {
|
|
18479
|
+
const method = target.method ?? "GET";
|
|
18480
|
+
const baseUrl = trimBaseUrl(options.baseUrl);
|
|
18481
|
+
const url = `${baseUrl}${target.path}`;
|
|
18482
|
+
const fetcher = options.fetch ?? globalThis.fetch;
|
|
18483
|
+
const now = options.now ?? performance.now.bind(performance);
|
|
18484
|
+
const startedAt = now();
|
|
18485
|
+
const controller = new AbortController;
|
|
18486
|
+
const timeout = options.timeoutMs && options.timeoutMs > 0 ? setTimeout(() => controller.abort(), options.timeoutMs) : undefined;
|
|
18487
|
+
try {
|
|
18488
|
+
const response = await fetcher(url, {
|
|
18489
|
+
body: target.body === undefined ? undefined : JSON.stringify(target.body),
|
|
18490
|
+
headers: {
|
|
18491
|
+
accept: target.accept ?? (target.kind === "json" ? "application/json" : "text/markdown,text/plain,*/*"),
|
|
18492
|
+
...target.body === undefined ? {} : { "content-type": "application/json" }
|
|
18493
|
+
},
|
|
18494
|
+
method,
|
|
18495
|
+
signal: controller.signal
|
|
18496
|
+
});
|
|
18497
|
+
const text = await response.text();
|
|
18498
|
+
const bytes = encoder.encode(text).byteLength;
|
|
18499
|
+
let body = text;
|
|
18500
|
+
let parseError;
|
|
18501
|
+
if (target.kind === "json" && text.trim()) {
|
|
18502
|
+
try {
|
|
18503
|
+
body = JSON.parse(text);
|
|
18504
|
+
} catch (error) {
|
|
18505
|
+
parseError = error instanceof Error ? error.message : String(error);
|
|
18506
|
+
}
|
|
18507
|
+
}
|
|
18508
|
+
const missingText = target.kind === "text" ? (target.requiredText ?? []).filter((item) => !text.includes(item)) : [];
|
|
18509
|
+
const logicalFailure = target.kind === "json" && !parseError && !target.allowLogicalFail ? getVoiceProofTargetLogicalFailure(body) : undefined;
|
|
18510
|
+
await options.writeArtifact?.({
|
|
18511
|
+
content: target.kind === "json" ? `${JSON.stringify(parseError ? { parseError, text } : body, null, 2)}
|
|
18512
|
+
` : text,
|
|
18513
|
+
name: `${safeArtifactName(target.name)}.${target.kind === "json" ? "json" : "md"}`,
|
|
18514
|
+
target
|
|
18515
|
+
});
|
|
18516
|
+
return {
|
|
18517
|
+
body,
|
|
18518
|
+
bytes,
|
|
18519
|
+
elapsedMs: Math.round(now() - startedAt),
|
|
18520
|
+
error: parseError ?? logicalFailure ?? (missingText.length > 0 ? `Missing required text: ${missingText.join(", ")}` : undefined),
|
|
18521
|
+
kind: target.kind,
|
|
18522
|
+
method,
|
|
18523
|
+
name: target.name,
|
|
18524
|
+
ok: response.ok && !parseError && !logicalFailure && missingText.length === 0,
|
|
18525
|
+
path: target.path,
|
|
18526
|
+
status: response.status,
|
|
18527
|
+
summary: parseError ? { bytes, parseError } : target.kind === "json" ? summarizeValue(body) : {
|
|
18528
|
+
bytes,
|
|
18529
|
+
requiredTextFound: missingText.length === 0
|
|
18530
|
+
},
|
|
18531
|
+
url
|
|
18532
|
+
};
|
|
18533
|
+
} catch (error) {
|
|
18534
|
+
return {
|
|
18535
|
+
bytes: 0,
|
|
18536
|
+
elapsedMs: Math.round(now() - startedAt),
|
|
18537
|
+
error: error instanceof Error ? error.message : String(error),
|
|
18538
|
+
kind: target.kind,
|
|
18539
|
+
method,
|
|
18540
|
+
name: target.name,
|
|
18541
|
+
ok: false,
|
|
18542
|
+
path: target.path,
|
|
18543
|
+
url
|
|
18544
|
+
};
|
|
18545
|
+
} finally {
|
|
18546
|
+
if (timeout) {
|
|
18547
|
+
clearTimeout(timeout);
|
|
18548
|
+
}
|
|
18549
|
+
}
|
|
18550
|
+
};
|
|
18551
|
+
var runVoiceProofTargets = (targets, options) => mapVoiceProofTargetsWithConcurrency(targets, options.concurrency ?? 2, (target) => fetchVoiceProofTarget(target, options));
|
|
18552
|
+
var runVoiceCommandProofTarget = async (target, options) => {
|
|
18553
|
+
const now = options.now ?? performance.now.bind(performance);
|
|
18554
|
+
const startedAt = now();
|
|
18555
|
+
const execution = await options.execute(target);
|
|
18556
|
+
const stdout = execution.stdout ?? "";
|
|
18557
|
+
const stderr = execution.stderr ?? "";
|
|
18558
|
+
const status = execution.status;
|
|
18559
|
+
const text = stdout.trim();
|
|
18560
|
+
const bytes = encoder.encode(`${stdout}${stderr}`).byteLength;
|
|
18561
|
+
let body = text;
|
|
18562
|
+
let parseError;
|
|
18563
|
+
if (text) {
|
|
18564
|
+
const jsonStart = text.indexOf("{");
|
|
18565
|
+
const jsonText = jsonStart >= 0 ? text.slice(jsonStart) : text;
|
|
18566
|
+
try {
|
|
18567
|
+
body = JSON.parse(jsonText);
|
|
18568
|
+
} catch (error) {
|
|
18569
|
+
parseError = error instanceof Error ? error.message : String(error);
|
|
18570
|
+
}
|
|
18571
|
+
}
|
|
18572
|
+
await options.writeArtifact?.({
|
|
18573
|
+
content: `${JSON.stringify({
|
|
18574
|
+
command: target.command,
|
|
18575
|
+
parseError,
|
|
18576
|
+
stderr,
|
|
18577
|
+
stdout,
|
|
18578
|
+
status,
|
|
18579
|
+
summary: parseError ? undefined : body
|
|
18580
|
+
}, null, 2)}
|
|
18581
|
+
`,
|
|
18582
|
+
name: `${safeArtifactName(target.name)}.json`,
|
|
18583
|
+
target
|
|
18584
|
+
});
|
|
18585
|
+
const logicalFailure = !parseError ? getVoiceProofTargetLogicalFailure(body) : undefined;
|
|
18586
|
+
return {
|
|
18587
|
+
body,
|
|
18588
|
+
bytes,
|
|
18589
|
+
command: target.command,
|
|
18590
|
+
elapsedMs: Math.round(now() - startedAt),
|
|
18591
|
+
error: parseError ?? logicalFailure ?? (status === 0 ? undefined : stderr.trim() || `Command exited ${status}`),
|
|
18592
|
+
kind: "command",
|
|
18593
|
+
name: target.name,
|
|
18594
|
+
ok: status === 0 && !parseError && !logicalFailure,
|
|
18595
|
+
status,
|
|
18596
|
+
summary: parseError ? { bytes, parseError } : summarizeValue(body)
|
|
18597
|
+
};
|
|
18598
|
+
};
|
|
18599
|
+
var runVoiceCommandProofTargets = (targets, options) => mapVoiceProofTargetsWithConcurrency(targets, options.concurrency ?? targets.length, (target) => runVoiceCommandProofTarget(target, options));
|
|
18388
18600
|
// src/providerRouterTraces.ts
|
|
18389
18601
|
var buildVoiceProviderRouterTraceEvent = (options) => ({
|
|
18390
18602
|
at: options.at ?? options.event.at,
|
|
@@ -23690,9 +23902,9 @@ var flattenPayload = (value) => {
|
|
|
23690
23902
|
};
|
|
23691
23903
|
var toBase64 = (bytes) => Buffer.from(new Uint8Array(bytes)).toString("base64");
|
|
23692
23904
|
var timingSafeEqual = (left, right) => {
|
|
23693
|
-
const
|
|
23694
|
-
const leftBytes =
|
|
23695
|
-
const rightBytes =
|
|
23905
|
+
const encoder2 = new TextEncoder;
|
|
23906
|
+
const leftBytes = encoder2.encode(left);
|
|
23907
|
+
const rightBytes = encoder2.encode(right);
|
|
23696
23908
|
if (leftBytes.length !== rightBytes.length) {
|
|
23697
23909
|
return false;
|
|
23698
23910
|
}
|
|
@@ -23703,12 +23915,12 @@ var timingSafeEqual = (left, right) => {
|
|
|
23703
23915
|
return diff === 0;
|
|
23704
23916
|
};
|
|
23705
23917
|
var signHmacSHA1Base64 = async (secret, payload) => {
|
|
23706
|
-
const
|
|
23707
|
-
const key = await crypto.subtle.importKey("raw",
|
|
23918
|
+
const encoder2 = new TextEncoder;
|
|
23919
|
+
const key = await crypto.subtle.importKey("raw", encoder2.encode(secret), {
|
|
23708
23920
|
hash: "SHA-1",
|
|
23709
23921
|
name: "HMAC"
|
|
23710
23922
|
}, false, ["sign"]);
|
|
23711
|
-
const signature = await crypto.subtle.sign("HMAC", key,
|
|
23923
|
+
const signature = await crypto.subtle.sign("HMAC", key, encoder2.encode(payload));
|
|
23712
23924
|
return toBase64(signature);
|
|
23713
23925
|
};
|
|
23714
23926
|
var sortedParamsForSignature = (body) => Object.entries(flattenPayload(body)).filter(([, value]) => value !== undefined && value !== null).sort(([left], [right]) => left.localeCompare(right)).map(([key, value]) => `${key}${String(value)}`).join("");
|
|
@@ -25308,9 +25520,9 @@ var createPlivoMediaStreamBridge = (socket, options) => {
|
|
|
25308
25520
|
};
|
|
25309
25521
|
var toBase642 = (bytes) => Buffer5.from(new Uint8Array(bytes)).toString("base64");
|
|
25310
25522
|
var timingSafeEqual2 = (left, right) => {
|
|
25311
|
-
const
|
|
25312
|
-
const leftBytes =
|
|
25313
|
-
const rightBytes =
|
|
25523
|
+
const encoder2 = new TextEncoder;
|
|
25524
|
+
const leftBytes = encoder2.encode(left);
|
|
25525
|
+
const rightBytes = encoder2.encode(right);
|
|
25314
25526
|
if (leftBytes.length !== rightBytes.length) {
|
|
25315
25527
|
return false;
|
|
25316
25528
|
}
|
|
@@ -25321,12 +25533,12 @@ var timingSafeEqual2 = (left, right) => {
|
|
|
25321
25533
|
return diff === 0;
|
|
25322
25534
|
};
|
|
25323
25535
|
var signHmacSHA256Base64 = async (secret, payload) => {
|
|
25324
|
-
const
|
|
25325
|
-
const key = await crypto.subtle.importKey("raw",
|
|
25536
|
+
const encoder2 = new TextEncoder;
|
|
25537
|
+
const key = await crypto.subtle.importKey("raw", encoder2.encode(secret), {
|
|
25326
25538
|
hash: "SHA-256",
|
|
25327
25539
|
name: "HMAC"
|
|
25328
25540
|
}, false, ["sign"]);
|
|
25329
|
-
const signature = await crypto.subtle.sign("HMAC", key,
|
|
25541
|
+
const signature = await crypto.subtle.sign("HMAC", key, encoder2.encode(payload));
|
|
25330
25542
|
return toBase642(signature);
|
|
25331
25543
|
};
|
|
25332
25544
|
var sortedParamsForSignature2 = (body) => {
|
|
@@ -37449,18 +37661,18 @@ var createVoiceMemoryStore = () => {
|
|
|
37449
37661
|
import { Elysia as Elysia61 } from "elysia";
|
|
37450
37662
|
var toHex6 = (bytes) => Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
37451
37663
|
var signVoiceOpsWebhookBody = async (input) => {
|
|
37452
|
-
const
|
|
37453
|
-
const key = await crypto.subtle.importKey("raw",
|
|
37664
|
+
const encoder2 = new TextEncoder;
|
|
37665
|
+
const key = await crypto.subtle.importKey("raw", encoder2.encode(input.secret), {
|
|
37454
37666
|
hash: "SHA-256",
|
|
37455
37667
|
name: "HMAC"
|
|
37456
37668
|
}, false, ["sign"]);
|
|
37457
|
-
const signature = await crypto.subtle.sign("HMAC", key,
|
|
37669
|
+
const signature = await crypto.subtle.sign("HMAC", key, encoder2.encode(`${input.timestamp}.${input.body}`));
|
|
37458
37670
|
return `sha256=${toHex6(new Uint8Array(signature))}`;
|
|
37459
37671
|
};
|
|
37460
37672
|
var timingSafeEqual3 = (left, right) => {
|
|
37461
|
-
const
|
|
37462
|
-
const leftBytes =
|
|
37463
|
-
const rightBytes =
|
|
37673
|
+
const encoder2 = new TextEncoder;
|
|
37674
|
+
const leftBytes = encoder2.encode(left);
|
|
37675
|
+
const rightBytes = encoder2.encode(right);
|
|
37464
37676
|
if (leftBytes.length !== rightBytes.length) {
|
|
37465
37677
|
return false;
|
|
37466
37678
|
}
|
|
@@ -39384,9 +39596,12 @@ export {
|
|
|
39384
39596
|
runVoiceReconnectContract,
|
|
39385
39597
|
runVoiceRealCallProfileRecoveryLoop,
|
|
39386
39598
|
runVoiceProviderRoutingContract,
|
|
39599
|
+
runVoiceProofTargets,
|
|
39387
39600
|
runVoiceProfileSwitchPolicyProof,
|
|
39388
39601
|
runVoicePhoneAgentProductionSmokeContract,
|
|
39389
39602
|
runVoiceOutcomeContractSuite,
|
|
39603
|
+
runVoiceCommandProofTargets,
|
|
39604
|
+
runVoiceCommandProofTarget,
|
|
39390
39605
|
runVoiceCampaignReadinessProof,
|
|
39391
39606
|
runVoiceCampaignProof,
|
|
39392
39607
|
runVoiceCampaignDialerProof,
|
|
@@ -39522,6 +39737,7 @@ export {
|
|
|
39522
39737
|
muteVoiceMonitorIssue,
|
|
39523
39738
|
matchesVoiceOpsTaskAssignmentRule,
|
|
39524
39739
|
markVoiceOpsTaskSLABreached,
|
|
39740
|
+
mapVoiceProofTargetsWithConcurrency,
|
|
39525
39741
|
loadVoiceRealCallProfileEvidenceFromTraceStore,
|
|
39526
39742
|
loadVoiceObservabilityExportReplaySource,
|
|
39527
39743
|
listVoiceRoutingEvents,
|
|
@@ -39531,6 +39747,7 @@ export {
|
|
|
39531
39747
|
importVoiceCampaignRecipients,
|
|
39532
39748
|
heartbeatVoiceOpsTask,
|
|
39533
39749
|
hasVoiceOpsTaskSLABreach,
|
|
39750
|
+
getVoiceProofTargetLogicalFailure,
|
|
39534
39751
|
getVoiceLiveOpsControlStatus,
|
|
39535
39752
|
getVoiceCampaignDialerProofStatus,
|
|
39536
39753
|
getLatestVoiceTelephonyMediaReport,
|
|
@@ -39539,6 +39756,7 @@ export {
|
|
|
39539
39756
|
formatVoiceProofTrendAge,
|
|
39540
39757
|
filterVoiceTraceEvents,
|
|
39541
39758
|
filterVoiceAuditEvents,
|
|
39759
|
+
fetchVoiceProofTarget,
|
|
39542
39760
|
failVoiceOpsTask,
|
|
39543
39761
|
exportVoiceTrace,
|
|
39544
39762
|
exportVoiceAuditTrail,
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export type VoiceProofTargetMethod = 'GET' | 'POST';
|
|
2
|
+
export type VoiceProofTarget = {
|
|
3
|
+
accept?: string;
|
|
4
|
+
allowLogicalFail?: boolean;
|
|
5
|
+
body?: unknown;
|
|
6
|
+
kind: 'json' | 'text';
|
|
7
|
+
method?: VoiceProofTargetMethod;
|
|
8
|
+
name: string;
|
|
9
|
+
path: string;
|
|
10
|
+
requiredText?: string[];
|
|
11
|
+
};
|
|
12
|
+
export type VoiceProofTargetResult = {
|
|
13
|
+
body?: unknown;
|
|
14
|
+
bytes: number;
|
|
15
|
+
elapsedMs: number;
|
|
16
|
+
error?: string;
|
|
17
|
+
kind: VoiceProofTarget['kind'];
|
|
18
|
+
method: VoiceProofTargetMethod;
|
|
19
|
+
name: string;
|
|
20
|
+
ok: boolean;
|
|
21
|
+
path: string;
|
|
22
|
+
status?: number;
|
|
23
|
+
summary?: Record<string, unknown>;
|
|
24
|
+
url: string;
|
|
25
|
+
};
|
|
26
|
+
export type VoiceCommandProofTarget = {
|
|
27
|
+
command: string[];
|
|
28
|
+
kind: 'command';
|
|
29
|
+
name: string;
|
|
30
|
+
};
|
|
31
|
+
export type VoiceCommandProofExecutionResult = {
|
|
32
|
+
status: number;
|
|
33
|
+
stderr?: string;
|
|
34
|
+
stdout?: string;
|
|
35
|
+
};
|
|
36
|
+
export type VoiceCommandProofTargetResult = {
|
|
37
|
+
body?: unknown;
|
|
38
|
+
bytes: number;
|
|
39
|
+
command: string[];
|
|
40
|
+
elapsedMs: number;
|
|
41
|
+
error?: string;
|
|
42
|
+
kind: 'command';
|
|
43
|
+
name: string;
|
|
44
|
+
ok: boolean;
|
|
45
|
+
status?: number;
|
|
46
|
+
summary?: Record<string, unknown>;
|
|
47
|
+
};
|
|
48
|
+
export type VoiceProofTargetRunnerOptions = {
|
|
49
|
+
baseUrl: string;
|
|
50
|
+
fetch?: typeof fetch;
|
|
51
|
+
now?: () => number;
|
|
52
|
+
timeoutMs?: number;
|
|
53
|
+
writeArtifact?: (input: {
|
|
54
|
+
content: string;
|
|
55
|
+
name: string;
|
|
56
|
+
target: VoiceProofTarget;
|
|
57
|
+
}) => Promise<void> | void;
|
|
58
|
+
};
|
|
59
|
+
export type VoiceProofTargetRunOptions = VoiceProofTargetRunnerOptions & {
|
|
60
|
+
concurrency?: number;
|
|
61
|
+
};
|
|
62
|
+
export type VoiceCommandProofTargetRunnerOptions = {
|
|
63
|
+
execute: (target: VoiceCommandProofTarget) => Promise<VoiceCommandProofExecutionResult> | VoiceCommandProofExecutionResult;
|
|
64
|
+
now?: () => number;
|
|
65
|
+
writeArtifact?: (input: {
|
|
66
|
+
content: string;
|
|
67
|
+
name: string;
|
|
68
|
+
target: VoiceCommandProofTarget;
|
|
69
|
+
}) => Promise<void> | void;
|
|
70
|
+
};
|
|
71
|
+
export type VoiceCommandProofTargetRunOptions = VoiceCommandProofTargetRunnerOptions & {
|
|
72
|
+
concurrency?: number;
|
|
73
|
+
};
|
|
74
|
+
export declare const getVoiceProofTargetLogicalFailure: (value: unknown) => "Response status is \"fail\"." | "Response pass is false." | "Response ok is false." | undefined;
|
|
75
|
+
export declare const mapVoiceProofTargetsWithConcurrency: <TInput, TOutput>(items: TInput[], limit: number, mapper: (item: TInput) => Promise<TOutput>) => Promise<TOutput[]>;
|
|
76
|
+
export declare const fetchVoiceProofTarget: (target: VoiceProofTarget, options: VoiceProofTargetRunnerOptions) => Promise<VoiceProofTargetResult>;
|
|
77
|
+
export declare const runVoiceProofTargets: (targets: VoiceProofTarget[], options: VoiceProofTargetRunOptions) => Promise<VoiceProofTargetResult[]>;
|
|
78
|
+
export declare const runVoiceCommandProofTarget: (target: VoiceCommandProofTarget, options: VoiceCommandProofTargetRunnerOptions) => Promise<VoiceCommandProofTargetResult>;
|
|
79
|
+
export declare const runVoiceCommandProofTargets: (targets: VoiceCommandProofTarget[], options: VoiceCommandProofTargetRunOptions) => Promise<VoiceCommandProofTargetResult[]>;
|