@astrasyncai/verification-gateway 5.4.2 → 5.5.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 +65 -21
- package/dist/adapters/express.d.mts +1 -1
- package/dist/adapters/express.d.ts +1 -1
- package/dist/adapters/express.js +7 -3
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +7 -3
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.d.ts +1 -1
- package/dist/adapters/mcp.js +7 -3
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +7 -3
- package/dist/adapters/mcp.mjs.map +1 -1
- package/dist/adapters/nextjs.d.mts +1 -1
- package/dist/adapters/nextjs.d.ts +1 -1
- package/dist/adapters/nextjs.js +7 -3
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +7 -3
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.d.mts +30 -1
- package/dist/adapters/sdk.d.ts +30 -1
- package/dist/adapters/sdk.js +40 -3
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +40 -3
- package/dist/adapters/sdk.mjs.map +1 -1
- 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 +7 -3
- package/dist/bin/astrasync-codex-hook.js +7 -3
- package/dist/bin/astrasync-guard.js +7 -3
- package/dist/bin/astrasync.js +8 -3
- package/dist/browser/background.js +7 -3
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +7 -3
- package/dist/browser/background.mjs.map +1 -1
- 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.js +7 -3
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +7 -3
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/extension.js +7 -3
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +7 -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 +7 -3
- package/dist/edge-core/index.js.map +1 -1
- package/dist/edge-core/index.mjs +7 -3
- package/dist/edge-core/index.mjs.map +1 -1
- package/dist/gateway/gateway.js +7 -3
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +7 -3
- package/dist/gateway/gateway.mjs.map +1 -1
- package/dist/git-trigger/git-hooks.d.mts +1 -1
- package/dist/git-trigger/git-hooks.d.ts +1 -1
- package/dist/index.d.mts +77 -4
- package/dist/index.d.ts +77 -4
- package/dist/index.js +40 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -3
- package/dist/index.mjs.map +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/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-Bd2O3eX1.d.mts → types-C-hPsi9M.d.mts} +45 -1
- package/dist/{types-DMChboN_.d.ts → types-CKouL1Tv.d.ts} +45 -1
- package/dist/{types-BU04qAAR.d.mts → types-D8DDG-qK.d.mts} +45 -1
- package/dist/{types-BU04qAAR.d.ts → types-D8DDG-qK.d.ts} +45 -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 +7 -3
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +7 -3
- package/dist/verify.mjs.map +1 -1
- package/package.json +1 -1
package/dist/adapters/sdk.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TrustLevel, S as SDKOptions, d as VerificationResult, c as VerificationRequest } from '../types-
|
|
1
|
+
import { T as TrustLevel, S as SDKOptions, d as VerificationResult, c as VerificationRequest } from '../types-D8DDG-qK.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* AstraSync Universal Verification Gateway — Trust Level helpers.
|
|
@@ -86,6 +86,13 @@ declare class VerificationGatewayClient {
|
|
|
86
86
|
* settled/failed/requires_action/no_instrument outcome (+ `orderId`), and the
|
|
87
87
|
* identity/policy/`failures` fields for a denial. On any non-`confirm`/first-
|
|
88
88
|
* party path `settlementOutcome` is simply absent — no money moves.
|
|
89
|
+
*
|
|
90
|
+
* 5.5.0 self-settling merchants (settlement_mode='self_settle'): the result
|
|
91
|
+
* carries `.settlementToken` instead of a completed charge. Charge on your
|
|
92
|
+
* own integration with Stripe idempotency key `voucher:<token.jti>` and
|
|
93
|
+
* `metadata: { jti: token.jti, sessionId: token.sessionId }`, then call
|
|
94
|
+
* `reportSettlement()` with the outcome. Treat any `settlementOutcome.status`
|
|
95
|
+
* you don't recognize (e.g. `pending_merchant`) as PENDING, never failed.
|
|
89
96
|
*/
|
|
90
97
|
confirmCheckout(options: {
|
|
91
98
|
astraId?: string;
|
|
@@ -100,6 +107,28 @@ declare class VerificationGatewayClient {
|
|
|
100
107
|
counterpartyUrl?: string;
|
|
101
108
|
counterpartyType?: string;
|
|
102
109
|
}): Promise<VerificationResult>;
|
|
110
|
+
/**
|
|
111
|
+
* 5.5.0 (astra-pay): report a self-settled charge outcome back to the
|
|
112
|
+
* platform — the other half of the `settlementToken` contract. Call after
|
|
113
|
+
* your PaymentIntent reaches a terminal state so the buyer's dashboard,
|
|
114
|
+
* /orders and the agent's poll surface reconcile. Authenticated with this
|
|
115
|
+
* client's api key (must be the merchant's own). Amounts must match the
|
|
116
|
+
* order EXACTLY (integer minor units) or the report is rejected whole
|
|
117
|
+
* (409 amount_mismatch). Replays of the same terminal state are safe.
|
|
118
|
+
*/
|
|
119
|
+
reportSettlement(options: {
|
|
120
|
+
sessionId: string;
|
|
121
|
+
status: 'settled' | 'declined' | 'failed';
|
|
122
|
+
amountMinor: number;
|
|
123
|
+
currency: string;
|
|
124
|
+
/** Stripe PaymentIntent id — REQUIRED when status is 'settled'. */
|
|
125
|
+
processorRef?: string;
|
|
126
|
+
failureCode?: string;
|
|
127
|
+
}): Promise<{
|
|
128
|
+
orderId: string;
|
|
129
|
+
status: string;
|
|
130
|
+
alreadySettled?: boolean;
|
|
131
|
+
}>;
|
|
103
132
|
/**
|
|
104
133
|
* Quick verification — checks credentials and policy in one call.
|
|
105
134
|
*
|
package/dist/adapters/sdk.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TrustLevel, S as SDKOptions, d as VerificationResult, c as VerificationRequest } from '../types-
|
|
1
|
+
import { T as TrustLevel, S as SDKOptions, d as VerificationResult, c as VerificationRequest } from '../types-D8DDG-qK.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* AstraSync Universal Verification Gateway — Trust Level helpers.
|
|
@@ -86,6 +86,13 @@ declare class VerificationGatewayClient {
|
|
|
86
86
|
* settled/failed/requires_action/no_instrument outcome (+ `orderId`), and the
|
|
87
87
|
* identity/policy/`failures` fields for a denial. On any non-`confirm`/first-
|
|
88
88
|
* party path `settlementOutcome` is simply absent — no money moves.
|
|
89
|
+
*
|
|
90
|
+
* 5.5.0 self-settling merchants (settlement_mode='self_settle'): the result
|
|
91
|
+
* carries `.settlementToken` instead of a completed charge. Charge on your
|
|
92
|
+
* own integration with Stripe idempotency key `voucher:<token.jti>` and
|
|
93
|
+
* `metadata: { jti: token.jti, sessionId: token.sessionId }`, then call
|
|
94
|
+
* `reportSettlement()` with the outcome. Treat any `settlementOutcome.status`
|
|
95
|
+
* you don't recognize (e.g. `pending_merchant`) as PENDING, never failed.
|
|
89
96
|
*/
|
|
90
97
|
confirmCheckout(options: {
|
|
91
98
|
astraId?: string;
|
|
@@ -100,6 +107,28 @@ declare class VerificationGatewayClient {
|
|
|
100
107
|
counterpartyUrl?: string;
|
|
101
108
|
counterpartyType?: string;
|
|
102
109
|
}): Promise<VerificationResult>;
|
|
110
|
+
/**
|
|
111
|
+
* 5.5.0 (astra-pay): report a self-settled charge outcome back to the
|
|
112
|
+
* platform — the other half of the `settlementToken` contract. Call after
|
|
113
|
+
* your PaymentIntent reaches a terminal state so the buyer's dashboard,
|
|
114
|
+
* /orders and the agent's poll surface reconcile. Authenticated with this
|
|
115
|
+
* client's api key (must be the merchant's own). Amounts must match the
|
|
116
|
+
* order EXACTLY (integer minor units) or the report is rejected whole
|
|
117
|
+
* (409 amount_mismatch). Replays of the same terminal state are safe.
|
|
118
|
+
*/
|
|
119
|
+
reportSettlement(options: {
|
|
120
|
+
sessionId: string;
|
|
121
|
+
status: 'settled' | 'declined' | 'failed';
|
|
122
|
+
amountMinor: number;
|
|
123
|
+
currency: string;
|
|
124
|
+
/** Stripe PaymentIntent id — REQUIRED when status is 'settled'. */
|
|
125
|
+
processorRef?: string;
|
|
126
|
+
failureCode?: string;
|
|
127
|
+
}): Promise<{
|
|
128
|
+
orderId: string;
|
|
129
|
+
status: string;
|
|
130
|
+
alreadySettled?: boolean;
|
|
131
|
+
}>;
|
|
103
132
|
/**
|
|
104
133
|
* Quick verification — checks credentials and policy in one call.
|
|
105
134
|
*
|
package/dist/adapters/sdk.js
CHANGED
|
@@ -28,7 +28,7 @@ __export(sdk_exports, {
|
|
|
28
28
|
module.exports = __toCommonJS(sdk_exports);
|
|
29
29
|
|
|
30
30
|
// src/version.ts
|
|
31
|
-
var SDK_VERSION = "5.
|
|
31
|
+
var SDK_VERSION = "5.5.0";
|
|
32
32
|
|
|
33
33
|
// src/http.ts
|
|
34
34
|
var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
|
|
@@ -482,7 +482,10 @@ async function verify(config, request, options) {
|
|
|
482
482
|
recommendationReasons: apiResponse.recommendationReasons,
|
|
483
483
|
stepUpApproval: apiResponse.stepUpApproval,
|
|
484
484
|
settlement: apiResponse.settlement,
|
|
485
|
-
settlementOutcome: apiResponse.settlementOutcome
|
|
485
|
+
settlementOutcome: apiResponse.settlementOutcome,
|
|
486
|
+
// 5.5.0 self-settlement: merchant-only material — passes through to the
|
|
487
|
+
// MERCHANT caller only (bridge callers strip it before the agent plane).
|
|
488
|
+
settlementToken: apiResponse.settlementToken
|
|
486
489
|
};
|
|
487
490
|
return result2;
|
|
488
491
|
}
|
|
@@ -540,7 +543,8 @@ async function verify(config, request, options) {
|
|
|
540
543
|
warningHeader: apiResponse.warningHeader,
|
|
541
544
|
stepUpApproval: apiResponse.stepUpApproval,
|
|
542
545
|
settlement: apiResponse.settlement,
|
|
543
|
-
settlementOutcome: apiResponse.settlementOutcome
|
|
546
|
+
settlementOutcome: apiResponse.settlementOutcome,
|
|
547
|
+
settlementToken: apiResponse.settlementToken
|
|
544
548
|
};
|
|
545
549
|
if (result.recommendation === "deny") {
|
|
546
550
|
result.policyAllowed = false;
|
|
@@ -643,6 +647,13 @@ var VerificationGatewayClient = class {
|
|
|
643
647
|
* settled/failed/requires_action/no_instrument outcome (+ `orderId`), and the
|
|
644
648
|
* identity/policy/`failures` fields for a denial. On any non-`confirm`/first-
|
|
645
649
|
* party path `settlementOutcome` is simply absent — no money moves.
|
|
650
|
+
*
|
|
651
|
+
* 5.5.0 self-settling merchants (settlement_mode='self_settle'): the result
|
|
652
|
+
* carries `.settlementToken` instead of a completed charge. Charge on your
|
|
653
|
+
* own integration with Stripe idempotency key `voucher:<token.jti>` and
|
|
654
|
+
* `metadata: { jti: token.jti, sessionId: token.sessionId }`, then call
|
|
655
|
+
* `reportSettlement()` with the outcome. Treat any `settlementOutcome.status`
|
|
656
|
+
* you don't recognize (e.g. `pending_merchant`) as PENDING, never failed.
|
|
646
657
|
*/
|
|
647
658
|
async confirmCheckout(options) {
|
|
648
659
|
const credentials = {
|
|
@@ -672,6 +683,32 @@ var VerificationGatewayClient = class {
|
|
|
672
683
|
)
|
|
673
684
|
);
|
|
674
685
|
}
|
|
686
|
+
/**
|
|
687
|
+
* 5.5.0 (astra-pay): report a self-settled charge outcome back to the
|
|
688
|
+
* platform — the other half of the `settlementToken` contract. Call after
|
|
689
|
+
* your PaymentIntent reaches a terminal state so the buyer's dashboard,
|
|
690
|
+
* /orders and the agent's poll surface reconcile. Authenticated with this
|
|
691
|
+
* client's api key (must be the merchant's own). Amounts must match the
|
|
692
|
+
* order EXACTLY (integer minor units) or the report is rejected whole
|
|
693
|
+
* (409 amount_mismatch). Replays of the same terminal state are safe.
|
|
694
|
+
*/
|
|
695
|
+
async reportSettlement(options) {
|
|
696
|
+
const base = this.config.apiBaseUrl.replace(/\/+$/, "");
|
|
697
|
+
const res = await sdkFetch(`${base}/merchant/settlements/report`, {
|
|
698
|
+
method: "POST",
|
|
699
|
+
headers: {
|
|
700
|
+
"Content-Type": "application/json",
|
|
701
|
+
// Same auth pair as every backend call the SDK makes (verify.ts).
|
|
702
|
+
...this.config.apiKey ? { Authorization: `Bearer ${this.config.apiKey}`, "X-API-Key": this.config.apiKey } : {}
|
|
703
|
+
},
|
|
704
|
+
body: JSON.stringify(options)
|
|
705
|
+
});
|
|
706
|
+
const json = await res.json().catch(() => ({}));
|
|
707
|
+
if (!res.ok || !json.success || !json.data) {
|
|
708
|
+
throw new Error(`reportSettlement failed (${res.status}): ${json.error ?? "unknown error"}`);
|
|
709
|
+
}
|
|
710
|
+
return json.data;
|
|
711
|
+
}
|
|
675
712
|
/**
|
|
676
713
|
* Quick verification — checks credentials and policy in one call.
|
|
677
714
|
*
|