@astrasyncai/verification-gateway 5.2.0 → 5.4.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/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 +8 -3
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +8 -3
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/mcp.d.mts +2 -2
- package/dist/adapters/mcp.d.ts +2 -2
- package/dist/adapters/mcp.js +8 -3
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +8 -3
- 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 +8 -3
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +8 -3
- 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 +47 -3
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +47 -3
- 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 +1 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/agent/index.mjs.map +1 -1
- package/dist/bin/astrasync-claude-hook.js +8 -3
- package/dist/bin/astrasync-codex-hook.js +8 -3
- package/dist/bin/astrasync-guard.js +8 -3
- package/dist/bin/astrasync.js +8 -3
- package/dist/browser/background.js +8 -3
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +8 -3
- 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/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/cli/index.mjs.map +1 -1
- package/dist/codex/index.d.mts +2 -2
- package/dist/codex/index.d.ts +2 -2
- package/dist/codex/index.js +8 -3
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +8 -3
- 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 +8 -3
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +8 -3
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/edge-config.d.mts +1 -1
- package/dist/edge-config.d.ts +1 -1
- package/dist/edge-config.js +1 -1
- package/dist/edge-config.js.map +1 -1
- package/dist/edge-config.mjs +1 -1
- package/dist/edge-config.mjs.map +1 -1
- package/dist/edge-core/index.d.mts +1 -1
- package/dist/edge-core/index.d.ts +1 -1
- package/dist/edge-core/index.js +8 -3
- package/dist/edge-core/index.js.map +1 -1
- package/dist/edge-core/index.mjs +8 -3
- package/dist/edge-core/index.mjs.map +1 -1
- package/dist/{express-KkBZBMqi.d.mts → express-BIAT2pe0.d.mts} +1 -1
- package/dist/{express-xK8pRrmj.d.ts → express-D3Tf-b23.d.ts} +1 -1
- package/dist/gateway/gateway.d.mts +2 -2
- package/dist/gateway/gateway.d.ts +2 -2
- package/dist/gateway/gateway.js +8 -3
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +8 -3
- 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-GPDn_EGI.d.mts → index-BVJkTyIF.d.mts} +1 -1
- package/dist/{index-DIRzR5IS.d.mts → index-By021oSN.d.mts} +1 -1
- package/dist/{index-Hnz5VyMR.d.ts → index-DaMXZabg.d.ts} +1 -1
- package/dist/{index-DLQ4Rcuc.d.ts → index-iJ9_DdLk.d.ts} +1 -1
- package/dist/index.d.mts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.js +47 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +47 -3
- 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/{mcp-Dju_Sr1o.d.mts → mcp-BqfTDZLh.d.mts} +1 -1
- package/dist/{mcp-DPpu4xQz.d.ts → mcp-OrVOrH-s.d.ts} +1 -1
- package/dist/{nextjs-BuoDBN4g.d.mts → nextjs-DGJXzWst.d.mts} +1 -1
- package/dist/{nextjs-rZKzY_8o.d.ts → nextjs-xM-jdNrX.d.ts} +1 -1
- package/dist/registration/index.js +1 -1
- package/dist/registration/index.js.map +1 -1
- package/dist/registration/index.mjs +1 -1
- package/dist/registration/index.mjs.map +1 -1
- package/dist/{sdk-CdO6TIEf.d.mts → sdk-C1IOA5LE.d.ts} +32 -1
- package/dist/{sdk-DxHuIJBm.d.ts → sdk-C6_-6D-9.d.mts} +32 -1
- package/dist/transport/index.d.mts +2 -2
- package/dist/transport/index.d.ts +2 -2
- package/dist/transport/index.js +1 -1
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/index.mjs +1 -1
- package/dist/transport/index.mjs.map +1 -1
- package/dist/{types-CNBaZKxY.d.ts → types-76TB0fxW.d.ts} +52 -1
- package/dist/{types-CSHcByFX.d.mts → types-CD1F9fmp.d.mts} +52 -1
- package/dist/{types-3UV7IZx7.d.ts → types-DGh2akuh.d.ts} +1 -1
- package/dist/{types-CoDjpbVY.d.mts → types-z_RNjHWm.d.mts} +1 -1
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/verify.d.mts +1 -1
- package/dist/verify.d.ts +1 -1
- package/dist/verify.js +8 -3
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +8 -3
- package/dist/verify.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -19,7 +19,7 @@ function getTrustLevel(score) {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
// src/version.ts
|
|
22
|
-
var SDK_VERSION = "5.
|
|
22
|
+
var SDK_VERSION = "5.4.0";
|
|
23
23
|
|
|
24
24
|
// src/http.ts
|
|
25
25
|
var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
|
|
@@ -372,6 +372,9 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
372
372
|
if (requestData.runtimeChallengeOptions)
|
|
373
373
|
body.runtimeChallengeOptions = requestData.runtimeChallengeOptions;
|
|
374
374
|
if (requestData.invocationProtocol) body.invocationProtocol = requestData.invocationProtocol;
|
|
375
|
+
if (requestData.commercePhase) body.commercePhase = requestData.commercePhase;
|
|
376
|
+
if (requestData.checkoutSessionId) body.checkoutSessionId = requestData.checkoutSessionId;
|
|
377
|
+
if (requestData.checkoutItems) body.checkoutItems = requestData.checkoutItems;
|
|
375
378
|
if (requestData.commerceArtifacts) body.commerceArtifacts = requestData.commerceArtifacts;
|
|
376
379
|
if (requestData.attemptId) body.attemptId = requestData.attemptId;
|
|
377
380
|
if (requestData.considerationSet) body.considerationSet = requestData.considerationSet;
|
|
@@ -543,7 +546,8 @@ async function verify(config, request, options) {
|
|
|
543
546
|
recommendation: apiResponse.recommendation,
|
|
544
547
|
recommendationReasons: apiResponse.recommendationReasons,
|
|
545
548
|
stepUpApproval: apiResponse.stepUpApproval,
|
|
546
|
-
settlement: apiResponse.settlement
|
|
549
|
+
settlement: apiResponse.settlement,
|
|
550
|
+
settlementOutcome: apiResponse.settlementOutcome
|
|
547
551
|
};
|
|
548
552
|
return result2;
|
|
549
553
|
}
|
|
@@ -600,7 +604,8 @@ async function verify(config, request, options) {
|
|
|
600
604
|
recommendationReasons: apiResponse.recommendationReasons,
|
|
601
605
|
warningHeader: apiResponse.warningHeader,
|
|
602
606
|
stepUpApproval: apiResponse.stepUpApproval,
|
|
603
|
-
settlement: apiResponse.settlement
|
|
607
|
+
settlement: apiResponse.settlement,
|
|
608
|
+
settlementOutcome: apiResponse.settlementOutcome
|
|
604
609
|
};
|
|
605
610
|
if (result.recommendation === "deny") {
|
|
606
611
|
result.policyAllowed = false;
|
|
@@ -2609,6 +2614,45 @@ var VerificationGatewayClient = class {
|
|
|
2609
2614
|
})
|
|
2610
2615
|
);
|
|
2611
2616
|
}
|
|
2617
|
+
/**
|
|
2618
|
+
* 5.4.0 (astra-pay): confirm-leg of a checkout — the ONLY call that may fire
|
|
2619
|
+
* first-party charge-at-redeem (server-side settlement on the owner's saved
|
|
2620
|
+
* instrument). This is the supported public surface for the confirm leg;
|
|
2621
|
+
* `verify()` deliberately does not expose the checkout fields, so settlement
|
|
2622
|
+
* can never fire by accident from a generic verify.
|
|
2623
|
+
*
|
|
2624
|
+
* Sends `commercePhase: 'confirm'` plus the checkout session id (per-cart
|
|
2625
|
+
* idempotency) and line items (order/receipt plane), and identifies the
|
|
2626
|
+
* merchant via `counterpartyUrl`/`counterpartyType` (required — the backend
|
|
2627
|
+
* only settles a merchant-mediated grant against a first-party storefront).
|
|
2628
|
+
* `purpose`/`action` default to the canonical shopping pair.
|
|
2629
|
+
*
|
|
2630
|
+
* Returns the full `VerificationResult`: read `.settlementOutcome` for the
|
|
2631
|
+
* settled/failed/requires_action/no_instrument outcome (+ `orderId`), and the
|
|
2632
|
+
* identity/policy/`failures` fields for a denial. On any non-`confirm`/first-
|
|
2633
|
+
* party path `settlementOutcome` is simply absent — no money moves.
|
|
2634
|
+
*/
|
|
2635
|
+
async confirmCheckout(options) {
|
|
2636
|
+
const credentials = {
|
|
2637
|
+
astraId: options.astraId,
|
|
2638
|
+
apiKey: options.apiKey,
|
|
2639
|
+
jwt: options.jwt
|
|
2640
|
+
};
|
|
2641
|
+
return this.executeWithRetry(
|
|
2642
|
+
() => verify(this.config, {
|
|
2643
|
+
credentials,
|
|
2644
|
+
purpose: options.purpose ?? "shopping",
|
|
2645
|
+
action: options.action ?? "shopping.purchase",
|
|
2646
|
+
transactionValue: options.transactionValue,
|
|
2647
|
+
currency: options.currency,
|
|
2648
|
+
commercePhase: "confirm",
|
|
2649
|
+
checkoutSessionId: options.checkoutSessionId,
|
|
2650
|
+
checkoutItems: options.checkoutItems,
|
|
2651
|
+
counterpartyUrl: options.counterpartyUrl,
|
|
2652
|
+
counterpartyType: options.counterpartyType
|
|
2653
|
+
})
|
|
2654
|
+
);
|
|
2655
|
+
}
|
|
2612
2656
|
/**
|
|
2613
2657
|
* Quick verification — checks credentials and policy in one call.
|
|
2614
2658
|
*
|