@astrasyncai/verification-gateway 3.12.0 → 4.1.0
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 +106 -29
- package/dist/adapter-interface/interface.d.mts +2 -2
- package/dist/adapter-interface/interface.d.ts +2 -2
- package/dist/adapters/express.d.mts +2 -2
- package/dist/adapters/express.d.ts +2 -2
- package/dist/adapters/express.js +482 -22
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +482 -22
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/http-pdlss.d.mts +3 -3
- package/dist/adapters/http-pdlss.d.ts +3 -3
- package/dist/adapters/http-pdlss.js.map +1 -1
- package/dist/adapters/http-pdlss.mjs.map +1 -1
- package/dist/adapters/mcp.d.mts +56 -36
- package/dist/adapters/mcp.d.ts +56 -36
- package/dist/adapters/mcp.js +309 -10
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +309 -10
- package/dist/adapters/mcp.mjs.map +1 -1
- package/dist/adapters/nextjs.d.mts +2 -2
- package/dist/adapters/nextjs.d.ts +2 -2
- package/dist/adapters/nextjs.js +518 -25
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +518 -25
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.d.mts +2 -2
- package/dist/adapters/sdk.d.ts +2 -2
- package/dist/adapters/sdk.js +72 -9
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +72 -9
- package/dist/adapters/sdk.mjs.map +1 -1
- package/dist/agent/index.d.mts +2 -2
- package/dist/agent/index.d.ts +2 -2
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs.map +1 -1
- package/dist/bin/astrasync-claude-hook.js +83 -20
- package/dist/bin/astrasync-codex-hook.js +83 -20
- package/dist/bin/astrasync-guard.js +83 -20
- package/dist/bin/astrasync.js +150 -33
- package/dist/browser/background.js +83 -20
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +83 -20
- package/dist/browser/background.mjs.map +1 -1
- package/dist/browser/browser-adapter.d.mts +2 -2
- package/dist/browser/browser-adapter.d.ts +2 -2
- package/dist/claude-code/claude-code-adapter.d.mts +2 -2
- package/dist/claude-code/claude-code-adapter.d.ts +2 -2
- package/dist/cli/index.d.mts +2 -2
- package/dist/cli/index.d.ts +2 -2
- package/dist/codex/index.d.mts +3 -3
- package/dist/codex/index.d.ts +3 -3
- package/dist/codex/index.js +83 -20
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +83 -20
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/cursor-adapter.d.mts +2 -2
- package/dist/cursor/cursor-adapter.d.ts +2 -2
- package/dist/cursor/extension.d.mts +2 -2
- package/dist/cursor/extension.d.ts +2 -2
- package/dist/cursor/extension.js +83 -20
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +83 -20
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/edge-config.d.mts +22 -7
- package/dist/edge-config.d.ts +22 -7
- package/dist/edge-config.js.map +1 -1
- package/dist/edge-config.mjs.map +1 -1
- package/dist/edge-core/index.d.mts +425 -0
- package/dist/edge-core/index.d.ts +425 -0
- package/dist/edge-core/index.js +1482 -0
- package/dist/edge-core/index.js.map +1 -0
- package/dist/edge-core/index.mjs +1437 -0
- package/dist/edge-core/index.mjs.map +1 -0
- package/dist/{express-B39o89gf.d.mts → express-BVd1_3FE.d.ts} +9 -7
- package/dist/{express-BuxKNO_q.d.ts → express-D_4hTn5Z.d.mts} +9 -7
- package/dist/gateway/gateway.d.mts +2 -2
- package/dist/gateway/gateway.d.ts +2 -2
- package/dist/gateway/gateway.js +83 -20
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +83 -20
- package/dist/gateway/gateway.mjs.map +1 -1
- package/dist/git-trigger/git-hooks.d.mts +2 -2
- package/dist/git-trigger/git-hooks.d.ts +2 -2
- package/dist/{index-CLHdqs2M.d.ts → index-B0YHu_SP.d.ts} +30 -27
- package/dist/{index-DME3w3lf.d.mts → index-BPEBlOsE.d.mts} +30 -27
- package/dist/{index-CqydB4ks.d.mts → index-DQb5-_1X.d.mts} +1 -1
- package/dist/{index-BG62SXso.d.ts → index-T1aBoUcc.d.ts} +1 -1
- package/dist/index.d.mts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +595 -272
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +592 -272
- package/dist/index.mjs.map +1 -1
- package/dist/local-evaluator/evaluator.d.mts +2 -2
- package/dist/local-evaluator/evaluator.d.ts +2 -2
- package/dist/metadata-capture.d.mts +63 -4
- package/dist/metadata-capture.d.ts +63 -4
- package/dist/metadata-capture.js +67 -0
- package/dist/metadata-capture.js.map +1 -1
- package/dist/metadata-capture.mjs +64 -0
- package/dist/metadata-capture.mjs.map +1 -1
- package/dist/{nextjs-D74W7wt-.d.mts → nextjs-WyeVr2Kp.d.mts} +3 -3
- package/dist/{nextjs-Ddlw_J1J.d.ts → nextjs-w7RTbP1P.d.ts} +3 -3
- package/dist/platform-signatures.d.mts +5 -6
- package/dist/platform-signatures.d.ts +5 -6
- package/dist/platform-signatures.js.map +1 -1
- package/dist/platform-signatures.mjs.map +1 -1
- package/dist/registration/index.d.mts +10 -11
- package/dist/registration/index.d.ts +10 -11
- package/dist/registration/index.js.map +1 -1
- package/dist/registration/index.mjs.map +1 -1
- package/dist/{sdk-CT7gdkfR.d.ts → sdk-CbTNIkAa.d.mts} +4 -4
- package/dist/{sdk-Bn6bj7kt.d.mts → sdk-QeX0Z8Ho.d.ts} +4 -4
- package/dist/transport/index.d.mts +2 -2
- package/dist/transport/index.d.ts +2 -2
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/index.mjs.map +1 -1
- package/dist/{types-DHu7m9HI.d.ts → types-BLUx92FJ.d.ts} +1 -1
- package/dist/{types-Djw4GLtz.d.mts → types-DqfPU5Bl.d.mts} +1 -1
- package/dist/{types-BntuzEEn.d.mts → types-r850cOt0.d.mts} +121 -88
- package/dist/{types-SDu4Llbe.d.ts → types-sMxBT-nM.d.ts} +121 -88
- package/dist/ui/index.d.mts +11 -7
- package/dist/ui/index.d.ts +11 -7
- package/dist/ui/index.js +13 -9
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/index.mjs +10 -8
- package/dist/ui/index.mjs.map +1 -1
- package/dist/verify.d.mts +11 -8
- package/dist/verify.d.ts +11 -8
- package/dist/verify.js +76 -8
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +75 -8
- package/dist/verify.mjs.map +1 -1
- package/package.json +8 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.mjs';
|
|
2
|
-
import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-
|
|
2
|
+
import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-DqfPU5Bl.mjs';
|
|
3
3
|
import '../gateway/gateway.mjs';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-r850cOt0.mjs';
|
|
5
5
|
import '../metadata-capture.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.js';
|
|
2
|
-
import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-
|
|
2
|
+
import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-BLUx92FJ.js';
|
|
3
3
|
import '../gateway/gateway.js';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-sMxBT-nM.js';
|
|
5
5
|
import '../metadata-capture.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.mjs';
|
|
2
|
-
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-
|
|
2
|
+
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-DqfPU5Bl.mjs';
|
|
3
3
|
import '../gateway/gateway.mjs';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-r850cOt0.mjs';
|
|
5
5
|
import '../metadata-capture.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.js';
|
|
2
|
-
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-
|
|
2
|
+
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-BLUx92FJ.js';
|
|
3
3
|
import '../gateway/gateway.js';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-sMxBT-nM.js';
|
|
5
5
|
import '../metadata-capture.js';
|
|
6
6
|
|
|
7
7
|
/**
|
package/dist/cli/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as LocalPurposeRule, d as LocalScope, c as LocalRiskThresholds, L as LocalPolicy, P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-
|
|
1
|
+
import { b as LocalPurposeRule, d as LocalScope, c as LocalRiskThresholds, L as LocalPolicy, P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-DqfPU5Bl.mjs';
|
|
2
2
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.mjs';
|
|
3
|
-
import '../types-
|
|
3
|
+
import '../types-r850cOt0.mjs';
|
|
4
4
|
import '../metadata-capture.mjs';
|
|
5
5
|
import '../gateway/gateway.mjs';
|
|
6
6
|
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as LocalPurposeRule, d as LocalScope, c as LocalRiskThresholds, L as LocalPolicy, P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-
|
|
1
|
+
import { b as LocalPurposeRule, d as LocalScope, c as LocalRiskThresholds, L as LocalPolicy, P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-BLUx92FJ.js';
|
|
2
2
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.js';
|
|
3
|
-
import '../types-
|
|
3
|
+
import '../types-sMxBT-nM.js';
|
|
4
4
|
import '../metadata-capture.js';
|
|
5
5
|
import '../gateway/gateway.js';
|
|
6
6
|
|
package/dist/codex/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.mjs';
|
|
2
|
-
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-
|
|
2
|
+
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-DqfPU5Bl.mjs';
|
|
3
3
|
import { AstraSyncGateway } from '../gateway/gateway.mjs';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-r850cOt0.mjs';
|
|
5
5
|
import '../metadata-capture.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -13,7 +13,7 @@ import '../metadata-capture.mjs';
|
|
|
13
13
|
* answer with a permissionDecision on stdout.
|
|
14
14
|
*
|
|
15
15
|
* Decision mapping is strictly tightening, with two Codex-specific twists
|
|
16
|
-
* versus the Claude Code adapter
|
|
16
|
+
* versus the Claude Code adapter:
|
|
17
17
|
*
|
|
18
18
|
* - Codex has NO "ask" decision. MANUAL_REVIEW therefore emits nothing —
|
|
19
19
|
* "no matching hook decides" makes Codex fall through to its own native
|
package/dist/codex/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.js';
|
|
2
|
-
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-
|
|
2
|
+
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-BLUx92FJ.js';
|
|
3
3
|
import { AstraSyncGateway } from '../gateway/gateway.js';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-sMxBT-nM.js';
|
|
5
5
|
import '../metadata-capture.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -13,7 +13,7 @@ import '../metadata-capture.js';
|
|
|
13
13
|
* answer with a permissionDecision on stdout.
|
|
14
14
|
*
|
|
15
15
|
* Decision mapping is strictly tightening, with two Codex-specific twists
|
|
16
|
-
* versus the Claude Code adapter
|
|
16
|
+
* versus the Claude Code adapter:
|
|
17
17
|
*
|
|
18
18
|
* - Codex has NO "ask" decision. MANUAL_REVIEW therefore emits nothing —
|
|
19
19
|
* "no matching hook decides" makes Codex fall through to its own native
|
package/dist/codex/index.js
CHANGED
|
@@ -3985,7 +3985,7 @@ function getTrustLevel(score) {
|
|
|
3985
3985
|
}
|
|
3986
3986
|
|
|
3987
3987
|
// src/version.ts
|
|
3988
|
-
var SDK_VERSION = "
|
|
3988
|
+
var SDK_VERSION = "4.1.0";
|
|
3989
3989
|
|
|
3990
3990
|
// src/well-known.ts
|
|
3991
3991
|
var CACHE_TTL_MS = 60 * 60 * 1e3;
|
|
@@ -4011,7 +4011,7 @@ var DEFAULT_CONFIG = {
|
|
|
4011
4011
|
};
|
|
4012
4012
|
var initCheckPerformed = false;
|
|
4013
4013
|
var deprecationWarningShown = false;
|
|
4014
|
-
async function performInitCheck(apiBaseUrl, debug, strictInit) {
|
|
4014
|
+
async function performInitCheck(apiBaseUrl, debug, strictInit, apiKey) {
|
|
4015
4015
|
initCheckPerformed = true;
|
|
4016
4016
|
try {
|
|
4017
4017
|
const probeUrl = `${apiBaseUrl}/agents/verify-access`;
|
|
@@ -4028,6 +4028,28 @@ async function performInitCheck(apiBaseUrl, debug, strictInit) {
|
|
|
4028
4028
|
`[VerificationGateway] init check passed for ${apiBaseUrl} (content-type: ${contentType})`
|
|
4029
4029
|
);
|
|
4030
4030
|
}
|
|
4031
|
+
if (apiKey) {
|
|
4032
|
+
const selfCheck = await fetch(`${apiBaseUrl}/agents/verify-access/self-check`, {
|
|
4033
|
+
headers: { Authorization: `Bearer ${apiKey}` }
|
|
4034
|
+
});
|
|
4035
|
+
if (selfCheck.status === 401) {
|
|
4036
|
+
const body = await selfCheck.json().catch(() => ({}));
|
|
4037
|
+
const message = `[VerificationGateway] the configured AstraSync API key was REJECTED at startup (${body.code ?? "api_key_invalid"}: ${body.message ?? "invalid key"}). Every inbound agent will be turned away until the key is rotated` + (body.remediation?.manageUrl ? ` at ${body.remediation.manageUrl}` : "") + `.`;
|
|
4038
|
+
if (strictInit) {
|
|
4039
|
+
throw new Error(`${message} (strictInit=true)`);
|
|
4040
|
+
}
|
|
4041
|
+
console.error(message);
|
|
4042
|
+
} else if (selfCheck.ok) {
|
|
4043
|
+
const body = await selfCheck.json().catch(() => ({}));
|
|
4044
|
+
if (typeof body.daysToExpiry === "number" && body.daysToExpiry <= 7) {
|
|
4045
|
+
console.warn(
|
|
4046
|
+
`[VerificationGateway] the configured AstraSync API key expires in ${body.daysToExpiry} day(s) \u2014 rotate it at Settings \u2192 Developer Tools before integrations start failing.`
|
|
4047
|
+
);
|
|
4048
|
+
} else if (debug) {
|
|
4049
|
+
console.log("[VerificationGateway] API key self-check passed");
|
|
4050
|
+
}
|
|
4051
|
+
}
|
|
4052
|
+
}
|
|
4031
4053
|
} catch (err) {
|
|
4032
4054
|
if (strictInit) {
|
|
4033
4055
|
throw err;
|
|
@@ -4105,8 +4127,17 @@ function cacheResult(request, result, configuredTtl, counterpartyId) {
|
|
|
4105
4127
|
function createGuidanceResponse(_config, reason, options = {}) {
|
|
4106
4128
|
const source = options.source ?? "no_credentials";
|
|
4107
4129
|
const isApiError = source === "api_error";
|
|
4130
|
+
const isMisconfig = source === "merchant_misconfig";
|
|
4108
4131
|
const urls = options.urls;
|
|
4109
|
-
const guidance =
|
|
4132
|
+
const guidance = isMisconfig ? {
|
|
4133
|
+
message: "This site's AstraSync integration is misconfigured (its API key was revoked, expired, or rotated). Your identity and the AstraSync platform are fine \u2014 contact the site operator. Retrying will not help.",
|
|
4134
|
+
registrationUrl: urls?.registrationUrl ?? "",
|
|
4135
|
+
documentationUrl: options.remediation?.docsUrl ?? urls?.documentationUrl ?? "",
|
|
4136
|
+
steps: [
|
|
4137
|
+
"Report the failure to the site operator \u2014 their AstraSync API key needs rotating",
|
|
4138
|
+
"Do not retry: the failure is deterministic until the operator updates their key"
|
|
4139
|
+
]
|
|
4140
|
+
} : isApiError ? {
|
|
4110
4141
|
message: "Verification is temporarily unavailable. Retry with exponential backoff; if the issue persists, contact support with the correlationId.",
|
|
4111
4142
|
registrationUrl: urls?.registrationUrl ?? "",
|
|
4112
4143
|
documentationUrl: urls?.documentationUrl ?? "",
|
|
@@ -4144,13 +4175,22 @@ function createGuidanceResponse(_config, reason, options = {}) {
|
|
|
4144
4175
|
// partners (and their custom onDenied handlers) can branch on
|
|
4145
4176
|
// dimension. Without this, the synthesised stub was indistinguishable
|
|
4146
4177
|
// from a real policy deny.
|
|
4147
|
-
failures:
|
|
4178
|
+
failures: isMisconfig ? [
|
|
4179
|
+
{
|
|
4180
|
+
dimension: "verify_access.merchant_misconfigured",
|
|
4181
|
+
message: reason ?? "The integration API key was rejected by AstraSync",
|
|
4182
|
+
guidance: guidance.message
|
|
4183
|
+
}
|
|
4184
|
+
] : isApiError ? [
|
|
4148
4185
|
{
|
|
4149
4186
|
dimension: "verify_access.api_error",
|
|
4150
4187
|
message: reason ?? "Verification temporarily unavailable",
|
|
4151
4188
|
guidance: guidance.message
|
|
4152
4189
|
}
|
|
4153
4190
|
] : void 0,
|
|
4191
|
+
// 4.0.0: typed marker so adapters render the misconfig envelope (503 +
|
|
4192
|
+
// MERCHANT_VERIFICATION_MISCONFIGURED) without string-matching.
|
|
4193
|
+
...isMisconfig && { misconfigured: true },
|
|
4154
4194
|
correlationId: options.correlationId,
|
|
4155
4195
|
attemptId: options.attemptId,
|
|
4156
4196
|
verifiedAt: /* @__PURE__ */ new Date()
|
|
@@ -4205,7 +4245,8 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
4205
4245
|
const response = await fetch(`${config.apiBaseUrl}/agents/verify-access`, {
|
|
4206
4246
|
method: "POST",
|
|
4207
4247
|
headers,
|
|
4208
|
-
body: JSON.stringify(body)
|
|
4248
|
+
body: JSON.stringify(body),
|
|
4249
|
+
signal: AbortSignal.timeout(config.verifyTimeoutMs ?? 1e4)
|
|
4209
4250
|
});
|
|
4210
4251
|
const data = await response.json();
|
|
4211
4252
|
if (response.status === 410) {
|
|
@@ -4229,6 +4270,17 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
4229
4270
|
};
|
|
4230
4271
|
}
|
|
4231
4272
|
if (!response.ok) {
|
|
4273
|
+
if (response.status === 401) {
|
|
4274
|
+
return {
|
|
4275
|
+
success: false,
|
|
4276
|
+
error: data.message || data.error || "Integration API key rejected",
|
|
4277
|
+
misconfig: true,
|
|
4278
|
+
misconfigCode: typeof data?.code === "string" ? data.code : void 0,
|
|
4279
|
+
remediation: data?.remediation && typeof data.remediation === "object" ? data.remediation : void 0,
|
|
4280
|
+
correlationId: typeof data?.correlationId === "string" ? data.correlationId : void 0,
|
|
4281
|
+
attemptId: typeof data?.attemptId === "string" ? data.attemptId : void 0
|
|
4282
|
+
};
|
|
4283
|
+
}
|
|
4232
4284
|
return {
|
|
4233
4285
|
success: false,
|
|
4234
4286
|
error: data.message || data.error || `API returned ${response.status}`,
|
|
@@ -4250,9 +4302,19 @@ async function verify(config, request, options) {
|
|
|
4250
4302
|
const urls = mergedConfig.apiBaseUrl ? getCachedWellKnownUrls(mergedConfig.apiBaseUrl) : void 0;
|
|
4251
4303
|
if (!initCheckPerformed && !mergedConfig.disableInitChecks && mergedConfig.apiBaseUrl) {
|
|
4252
4304
|
if (mergedConfig.strictInit) {
|
|
4253
|
-
await performInitCheck(
|
|
4305
|
+
await performInitCheck(
|
|
4306
|
+
mergedConfig.apiBaseUrl,
|
|
4307
|
+
mergedConfig.debug,
|
|
4308
|
+
true,
|
|
4309
|
+
mergedConfig.apiKey
|
|
4310
|
+
);
|
|
4254
4311
|
} else {
|
|
4255
|
-
void performInitCheck(
|
|
4312
|
+
void performInitCheck(
|
|
4313
|
+
mergedConfig.apiBaseUrl,
|
|
4314
|
+
mergedConfig.debug,
|
|
4315
|
+
false,
|
|
4316
|
+
mergedConfig.apiKey
|
|
4317
|
+
);
|
|
4256
4318
|
}
|
|
4257
4319
|
}
|
|
4258
4320
|
if (!deprecationWarningShown && (config.minTrustScore !== void 0 || config.minTrustScoreForFull !== void 0)) {
|
|
@@ -4291,9 +4353,10 @@ async function verify(config, request, options) {
|
|
|
4291
4353
|
const serverDenialReasons = Array.isArray(rawServerDenialReasons) && rawServerDenialReasons.length > 0 ? rawServerDenialReasons : void 0;
|
|
4292
4354
|
if (!apiResponse.success) {
|
|
4293
4355
|
return createGuidanceResponse(mergedConfig, apiResponse.error, {
|
|
4294
|
-
source: "api_error",
|
|
4356
|
+
source: apiResponse.misconfig ? "merchant_misconfig" : "api_error",
|
|
4295
4357
|
correlationId: apiResponse.correlationId,
|
|
4296
4358
|
attemptId: apiResponse.attemptId,
|
|
4359
|
+
remediation: apiResponse.remediation,
|
|
4297
4360
|
urls
|
|
4298
4361
|
});
|
|
4299
4362
|
}
|
|
@@ -4423,6 +4486,18 @@ var FALLBACK_MAX_WAIT_MS = 5 * 60 * 1e3;
|
|
|
4423
4486
|
// src/metadata-capture.ts
|
|
4424
4487
|
var MAX_TOTAL_BYTES = 16 * 1024;
|
|
4425
4488
|
|
|
4489
|
+
// src/edge-config.ts
|
|
4490
|
+
var DEFAULT_EDGE_CONFIG = Object.freeze({
|
|
4491
|
+
version: 1,
|
|
4492
|
+
mode: "observe",
|
|
4493
|
+
depth: "classify",
|
|
4494
|
+
pathRules: [],
|
|
4495
|
+
sampling: Object.freeze({ anonymousBeaconRate: 0.1 }),
|
|
4496
|
+
failurePosture: "open"
|
|
4497
|
+
});
|
|
4498
|
+
var DEFAULT_TTL_MS = 60 * 1e3;
|
|
4499
|
+
var DEFAULT_MAX_STALE_MS = 24 * 60 * 60 * 1e3;
|
|
4500
|
+
|
|
4426
4501
|
// src/adapters/express.ts
|
|
4427
4502
|
var DEFAULT_ROUTES_REFRESH_MS = 5 * 60 * 1e3;
|
|
4428
4503
|
|
|
@@ -4491,18 +4566,6 @@ var import_node_crypto4 = require("crypto");
|
|
|
4491
4566
|
// src/transport/registry/visa.ts
|
|
4492
4567
|
var import_jose = require("jose");
|
|
4493
4568
|
|
|
4494
|
-
// src/edge-config.ts
|
|
4495
|
-
var DEFAULT_EDGE_CONFIG = Object.freeze({
|
|
4496
|
-
version: 1,
|
|
4497
|
-
mode: "observe",
|
|
4498
|
-
depth: "classify",
|
|
4499
|
-
pathRules: [],
|
|
4500
|
-
sampling: Object.freeze({ anonymousBeaconRate: 0.1 }),
|
|
4501
|
-
failurePosture: "open"
|
|
4502
|
-
});
|
|
4503
|
-
var DEFAULT_TTL_MS = 60 * 1e3;
|
|
4504
|
-
var DEFAULT_MAX_STALE_MS = 24 * 60 * 60 * 1e3;
|
|
4505
|
-
|
|
4506
4569
|
// src/gateway/modes/online.ts
|
|
4507
4570
|
function toGatewayConfig(config) {
|
|
4508
4571
|
return {
|