@absolutejs/voice 0.0.22-beta.268 → 0.0.22-beta.269

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 CHANGED
@@ -17411,6 +17411,8 @@ var evaluateVoiceTelephonyWebhookNormalizationEvidence = (input = {}) => {
17411
17411
  const missingSessionIds = decisions.filter((decision) => !decision.sessionId).length;
17412
17412
  const rejectedVerificationAttempts = verificationAttempts.filter((attempt) => attempt.rejected === true || attempt.status === 401 || attempt.verification?.ok === false && attempt.verification.reason === "invalid-signature");
17413
17413
  const rejectedVerificationProviders = uniqueSorted3(rejectedVerificationAttempts.map((attempt) => attempt.provider).filter(isTelephonyWebhookProvider));
17414
+ const replayRejectedVerificationAttempts = rejectedVerificationAttempts.filter((attempt) => attempt.replayRejected === true);
17415
+ const replayRejectedVerificationProviders = uniqueSorted3(replayRejectedVerificationAttempts.map((attempt) => attempt.provider).filter(isTelephonyWebhookProvider));
17414
17416
  const rejectedVerificationSideEffects = rejectedVerificationAttempts.reduce((total, attempt) => total + Math.max(0, attempt.sideEffects ?? 0), 0);
17415
17417
  if (input.minDecisions !== undefined && decisions.length < input.minDecisions) {
17416
17418
  issues.push(`Expected at least ${String(input.minDecisions)} telephony webhook decision(s), found ${String(decisions.length)}.`);
@@ -17433,6 +17435,9 @@ var evaluateVoiceTelephonyWebhookNormalizationEvidence = (input = {}) => {
17433
17435
  if (input.maxRejectedVerificationSideEffects !== undefined && rejectedVerificationSideEffects > input.maxRejectedVerificationSideEffects) {
17434
17436
  issues.push(`Expected at most ${String(input.maxRejectedVerificationSideEffects)} rejected telephony webhook side effect(s), found ${String(rejectedVerificationSideEffects)}.`);
17435
17437
  }
17438
+ if (input.minReplayRejectedVerificationAttempts !== undefined && replayRejectedVerificationAttempts.length < input.minReplayRejectedVerificationAttempts) {
17439
+ issues.push(`Expected at least ${String(input.minReplayRejectedVerificationAttempts)} replay-rejected telephony webhook verification attempt(s), found ${String(replayRejectedVerificationAttempts.length)}.`);
17440
+ }
17436
17441
  if (input.maxMissingSessionIds !== undefined && missingSessionIds > input.maxMissingSessionIds) {
17437
17442
  issues.push(`Expected at most ${String(input.maxMissingSessionIds)} telephony webhook decision(s) without sessionId, found ${String(missingSessionIds)}.`);
17438
17443
  }
@@ -17448,6 +17453,9 @@ var evaluateVoiceTelephonyWebhookNormalizationEvidence = (input = {}) => {
17448
17453
  for (const provider of findMissing3(rejectedVerificationProviders, input.requiredRejectedVerificationProviders)) {
17449
17454
  issues.push(`Missing rejected telephony webhook verification provider: ${provider}.`);
17450
17455
  }
17456
+ for (const provider of findMissing3(replayRejectedVerificationProviders, input.requiredReplayRejectedVerificationProviders)) {
17457
+ issues.push(`Missing replay-rejected telephony webhook verification provider: ${provider}.`);
17458
+ }
17451
17459
  for (const action of findMissing3(actions, input.requiredActions)) {
17452
17460
  issues.push(`Missing telephony webhook action: ${action}.`);
17453
17461
  }
@@ -17471,6 +17479,8 @@ var evaluateVoiceTelephonyWebhookNormalizationEvidence = (input = {}) => {
17471
17479
  rejectedVerificationAttempts: rejectedVerificationAttempts.length,
17472
17480
  rejectedVerificationProviders,
17473
17481
  rejectedVerificationSideEffects,
17482
+ replayRejectedVerificationAttempts: replayRejectedVerificationAttempts.length,
17483
+ replayRejectedVerificationProviders,
17474
17484
  routeResults,
17475
17485
  sources,
17476
17486
  verificationAttempts: verificationAttempts.length
@@ -87,6 +87,7 @@ export type VoiceTelephonyWebhookVerificationEvidenceAttempt = {
87
87
  decisions?: number;
88
88
  provider?: VoiceTelephonyWebhookProvider | string;
89
89
  rejected?: boolean;
90
+ replayRejected?: boolean;
90
91
  sideEffects?: number;
91
92
  status?: number;
92
93
  verification?: VoiceTelephonyWebhookVerificationResult;
@@ -101,10 +102,12 @@ export type VoiceTelephonyWebhookNormalizationEvidenceInput = {
101
102
  maxDuplicateCampaignOutcomesApplied?: number;
102
103
  maxRejectedVerificationSideEffects?: number;
103
104
  minRejectedVerificationAttempts?: number;
105
+ minReplayRejectedVerificationAttempts?: number;
104
106
  requiredActions?: VoiceTelephonyOutcomeAction[];
105
107
  requiredDispositions?: VoiceCallDisposition[];
106
108
  requiredDuplicateProviders?: VoiceTelephonyWebhookProvider[];
107
109
  requiredProviders?: VoiceTelephonyWebhookProvider[];
110
+ requiredReplayRejectedVerificationProviders?: VoiceTelephonyWebhookProvider[];
108
111
  requiredRejectedVerificationProviders?: VoiceTelephonyWebhookProvider[];
109
112
  requireRouteResults?: boolean;
110
113
  verificationAttempts?: VoiceTelephonyWebhookVerificationEvidenceAttempt[];
@@ -126,6 +129,8 @@ export type VoiceTelephonyWebhookNormalizationEvidenceReport = {
126
129
  rejectedVerificationAttempts: number;
127
130
  rejectedVerificationProviders: VoiceTelephonyWebhookProvider[];
128
131
  rejectedVerificationSideEffects: number;
132
+ replayRejectedVerificationAttempts: number;
133
+ replayRejectedVerificationProviders: VoiceTelephonyWebhookProvider[];
129
134
  routeResults: number;
130
135
  sources: string[];
131
136
  verificationAttempts: number;
@@ -8266,6 +8266,8 @@ var evaluateVoiceTelephonyWebhookNormalizationEvidence = (input = {}) => {
8266
8266
  const missingSessionIds = decisions.filter((decision) => !decision.sessionId).length;
8267
8267
  const rejectedVerificationAttempts = verificationAttempts.filter((attempt) => attempt.rejected === true || attempt.status === 401 || attempt.verification?.ok === false && attempt.verification.reason === "invalid-signature");
8268
8268
  const rejectedVerificationProviders = uniqueSorted(rejectedVerificationAttempts.map((attempt) => attempt.provider).filter(isTelephonyWebhookProvider));
8269
+ const replayRejectedVerificationAttempts = rejectedVerificationAttempts.filter((attempt) => attempt.replayRejected === true);
8270
+ const replayRejectedVerificationProviders = uniqueSorted(replayRejectedVerificationAttempts.map((attempt) => attempt.provider).filter(isTelephonyWebhookProvider));
8269
8271
  const rejectedVerificationSideEffects = rejectedVerificationAttempts.reduce((total, attempt) => total + Math.max(0, attempt.sideEffects ?? 0), 0);
8270
8272
  if (input.minDecisions !== undefined && decisions.length < input.minDecisions) {
8271
8273
  issues.push(`Expected at least ${String(input.minDecisions)} telephony webhook decision(s), found ${String(decisions.length)}.`);
@@ -8288,6 +8290,9 @@ var evaluateVoiceTelephonyWebhookNormalizationEvidence = (input = {}) => {
8288
8290
  if (input.maxRejectedVerificationSideEffects !== undefined && rejectedVerificationSideEffects > input.maxRejectedVerificationSideEffects) {
8289
8291
  issues.push(`Expected at most ${String(input.maxRejectedVerificationSideEffects)} rejected telephony webhook side effect(s), found ${String(rejectedVerificationSideEffects)}.`);
8290
8292
  }
8293
+ if (input.minReplayRejectedVerificationAttempts !== undefined && replayRejectedVerificationAttempts.length < input.minReplayRejectedVerificationAttempts) {
8294
+ issues.push(`Expected at least ${String(input.minReplayRejectedVerificationAttempts)} replay-rejected telephony webhook verification attempt(s), found ${String(replayRejectedVerificationAttempts.length)}.`);
8295
+ }
8291
8296
  if (input.maxMissingSessionIds !== undefined && missingSessionIds > input.maxMissingSessionIds) {
8292
8297
  issues.push(`Expected at most ${String(input.maxMissingSessionIds)} telephony webhook decision(s) without sessionId, found ${String(missingSessionIds)}.`);
8293
8298
  }
@@ -8303,6 +8308,9 @@ var evaluateVoiceTelephonyWebhookNormalizationEvidence = (input = {}) => {
8303
8308
  for (const provider of findMissing(rejectedVerificationProviders, input.requiredRejectedVerificationProviders)) {
8304
8309
  issues.push(`Missing rejected telephony webhook verification provider: ${provider}.`);
8305
8310
  }
8311
+ for (const provider of findMissing(replayRejectedVerificationProviders, input.requiredReplayRejectedVerificationProviders)) {
8312
+ issues.push(`Missing replay-rejected telephony webhook verification provider: ${provider}.`);
8313
+ }
8306
8314
  for (const action of findMissing(actions, input.requiredActions)) {
8307
8315
  issues.push(`Missing telephony webhook action: ${action}.`);
8308
8316
  }
@@ -8326,6 +8334,8 @@ var evaluateVoiceTelephonyWebhookNormalizationEvidence = (input = {}) => {
8326
8334
  rejectedVerificationAttempts: rejectedVerificationAttempts.length,
8327
8335
  rejectedVerificationProviders,
8328
8336
  rejectedVerificationSideEffects,
8337
+ replayRejectedVerificationAttempts: replayRejectedVerificationAttempts.length,
8338
+ replayRejectedVerificationProviders,
8329
8339
  routeResults,
8330
8340
  sources,
8331
8341
  verificationAttempts: verificationAttempts.length
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.268",
3
+ "version": "0.0.22-beta.269",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",