@astrasyncai/verification-gateway 5.4.0 → 5.4.2
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 -3
- package/dist/adapter-interface/interface.d.ts +2 -3
- package/dist/adapters/express.d.mts +63 -4
- package/dist/adapters/express.d.ts +63 -4
- package/dist/adapters/express.js +9 -2
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +9 -2
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/mcp.d.mts +396 -4
- package/dist/adapters/mcp.d.ts +396 -4
- package/dist/adapters/mcp.js +9 -2
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +9 -2
- package/dist/adapters/mcp.mjs.map +1 -1
- package/dist/adapters/nextjs.d.mts +22 -4
- package/dist/adapters/nextjs.d.ts +22 -4
- package/dist/adapters/nextjs.js +9 -2
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +9 -2
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.d.mts +157 -3
- package/dist/adapters/sdk.d.ts +157 -3
- package/dist/adapters/sdk.js +35 -15
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +35 -15
- package/dist/adapters/sdk.mjs.map +1 -1
- package/dist/agent/index.d.mts +224 -3
- package/dist/agent/index.d.ts +224 -3
- 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 +9 -2
- package/dist/bin/astrasync-codex-hook.js +9 -2
- package/dist/bin/astrasync-guard.js +9 -2
- package/dist/bin/astrasync.js +9 -2
- package/dist/browser/background.js +9 -2
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +9 -2
- package/dist/browser/background.mjs.map +1 -1
- package/dist/browser/browser-adapter.d.mts +1 -5
- package/dist/browser/browser-adapter.d.ts +1 -5
- package/dist/claude-code/claude-code-adapter.d.mts +1 -5
- package/dist/claude-code/claude-code-adapter.d.ts +1 -5
- package/dist/cli/index.d.mts +1 -5
- package/dist/cli/index.d.ts +1 -5
- 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 +1 -5
- package/dist/codex/index.d.ts +1 -5
- package/dist/codex/index.js +9 -2
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +9 -2
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/cursor-adapter.d.mts +1 -5
- package/dist/cursor/cursor-adapter.d.ts +1 -5
- package/dist/cursor/extension.d.mts +1 -5
- package/dist/cursor/extension.d.ts +1 -5
- package/dist/cursor/extension.js +9 -2
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +9 -2
- 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 +9 -2
- package/dist/edge-core/index.js.map +1 -1
- package/dist/edge-core/index.mjs +9 -2
- package/dist/edge-core/index.mjs.map +1 -1
- package/dist/gateway/gateway.d.mts +2 -3
- package/dist/gateway/gateway.d.ts +2 -3
- package/dist/gateway/gateway.js +9 -2
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +9 -2
- package/dist/gateway/gateway.mjs.map +1 -1
- package/dist/git-trigger/git-hooks.d.mts +253 -3
- package/dist/git-trigger/git-hooks.d.ts +253 -3
- package/dist/index.d.mts +4506 -42
- package/dist/index.d.ts +4506 -42
- package/dist/index.js +35 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -15
- package/dist/index.mjs.map +1 -1
- package/dist/interface-q1WrMsB1.d.mts +365 -0
- package/dist/interface-q1WrMsB1.d.ts +365 -0
- package/dist/local-evaluator/evaluator.d.mts +2 -3
- package/dist/local-evaluator/evaluator.d.ts +2 -3
- 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.d.mts +1324 -4
- package/dist/transport/index.d.ts +1324 -4
- 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-DGh2akuh.d.ts → types-BRz2U0Pn.d.ts} +2 -2
- package/dist/{types-76TB0fxW.d.ts → types-BU04qAAR.d.mts} +59 -213
- package/dist/{types-CD1F9fmp.d.mts → types-BU04qAAR.d.ts} +59 -213
- package/dist/types-Bd2O3eX1.d.mts +769 -0
- package/dist/types-BfILnheI.d.mts +189 -0
- package/dist/types-BfILnheI.d.ts +189 -0
- package/dist/{types-z_RNjHWm.d.mts → types-CfBpm3w5.d.mts} +2 -2
- package/dist/types-DMChboN_.d.ts +769 -0
- package/dist/ui/index.d.mts +1 -2
- package/dist/ui/index.d.ts +1 -2
- package/dist/verify.d.mts +1 -1
- package/dist/verify.d.ts +1 -1
- package/dist/verify.js +9 -2
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +9 -2
- package/dist/verify.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/express-BIAT2pe0.d.mts +0 -69
- package/dist/express-D3Tf-b23.d.ts +0 -69
- package/dist/index-BVJkTyIF.d.mts +0 -248
- package/dist/index-By021oSN.d.mts +0 -1469
- package/dist/index-DaMXZabg.d.ts +0 -248
- package/dist/index-iJ9_DdLk.d.ts +0 -1469
- package/dist/mcp-BqfTDZLh.d.mts +0 -397
- package/dist/mcp-OrVOrH-s.d.ts +0 -397
- package/dist/nextjs-DGJXzWst.d.mts +0 -28
- package/dist/nextjs-xM-jdNrX.d.ts +0 -28
- package/dist/sdk-C1IOA5LE.d.ts +0 -173
- package/dist/sdk-C6_-6D-9.d.mts +0 -173
package/dist/adapters/sdk.d.mts
CHANGED
|
@@ -1,3 +1,157 @@
|
|
|
1
|
-
import '../types-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { T as TrustLevel, S as SDKOptions, d as VerificationResult, c as VerificationRequest } from '../types-BU04qAAR.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AstraSync Universal Verification Gateway — Trust Level helpers.
|
|
5
|
+
*
|
|
6
|
+
* SDK 5.0.0: the `accessLevel` band (`none`/`restricted`/`read-only`/`standard`/
|
|
7
|
+
* `full`/`internal`) was removed entirely — it never gated the access decision
|
|
8
|
+
* (the server does, from a verified ID + runtime challenge + PDLSS match + trust
|
|
9
|
+
* score). What remains here is the coarse trust-level badge derived from the
|
|
10
|
+
* numeric trust score, used only for display.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Determine trust level from score
|
|
15
|
+
*/
|
|
16
|
+
declare function getTrustLevel(score: number): TrustLevel;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* AstraSync Universal Verification Gateway - SDK Adapter
|
|
20
|
+
*
|
|
21
|
+
* Direct SDK for verifying agents in any JavaScript/TypeScript environment.
|
|
22
|
+
* Useful for agent-to-agent verification, serverless functions, or custom integrations.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* import { createClient } from '@astrasyncai/verification-gateway/sdk';
|
|
27
|
+
*
|
|
28
|
+
* const gateway = createClient({
|
|
29
|
+
* apiBaseUrl: 'https://astrasync.ai/api',
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* // Verify another agent before interacting
|
|
33
|
+
* const result = await gateway.verify({
|
|
34
|
+
* astraId: 'ASTRA-abc123',
|
|
35
|
+
* purpose: 'data-exchange',
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* if (result.identityVerified && result.policyAllowed) {
|
|
39
|
+
* // Safe to interact with this agent
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Verification Gateway SDK Client
|
|
46
|
+
*/
|
|
47
|
+
declare class VerificationGatewayClient {
|
|
48
|
+
private config;
|
|
49
|
+
private timeout;
|
|
50
|
+
private retryConfig;
|
|
51
|
+
constructor(options: SDKOptions);
|
|
52
|
+
/**
|
|
53
|
+
* Full verification with all details
|
|
54
|
+
*/
|
|
55
|
+
verify(options: {
|
|
56
|
+
astraId?: string;
|
|
57
|
+
apiKey?: string;
|
|
58
|
+
jwt?: string;
|
|
59
|
+
purpose?: string;
|
|
60
|
+
action?: string;
|
|
61
|
+
resourceType?: string;
|
|
62
|
+
resource?: string;
|
|
63
|
+
jurisdiction?: string;
|
|
64
|
+
transactionValue?: number;
|
|
65
|
+
currency?: string;
|
|
66
|
+
isSubAgentRequest?: boolean;
|
|
67
|
+
parentAgentId?: string;
|
|
68
|
+
subAgentDepth?: number;
|
|
69
|
+
counterpartyUrl?: string;
|
|
70
|
+
counterpartyType?: string;
|
|
71
|
+
}): Promise<VerificationResult>;
|
|
72
|
+
/**
|
|
73
|
+
* 5.4.0 (astra-pay): confirm-leg of a checkout — the ONLY call that may fire
|
|
74
|
+
* first-party charge-at-redeem (server-side settlement on the owner's saved
|
|
75
|
+
* instrument). This is the supported public surface for the confirm leg;
|
|
76
|
+
* `verify()` deliberately does not expose the checkout fields, so settlement
|
|
77
|
+
* can never fire by accident from a generic verify.
|
|
78
|
+
*
|
|
79
|
+
* Sends `commercePhase: 'confirm'` plus the checkout session id (per-cart
|
|
80
|
+
* idempotency) and line items (order/receipt plane), and identifies the
|
|
81
|
+
* merchant via `counterpartyUrl`/`counterpartyType` (required — the backend
|
|
82
|
+
* only settles a merchant-mediated grant against a first-party storefront).
|
|
83
|
+
* `purpose`/`action` default to the canonical shopping pair.
|
|
84
|
+
*
|
|
85
|
+
* Returns the full `VerificationResult`: read `.settlementOutcome` for the
|
|
86
|
+
* settled/failed/requires_action/no_instrument outcome (+ `orderId`), and the
|
|
87
|
+
* identity/policy/`failures` fields for a denial. On any non-`confirm`/first-
|
|
88
|
+
* party path `settlementOutcome` is simply absent — no money moves.
|
|
89
|
+
*/
|
|
90
|
+
confirmCheckout(options: {
|
|
91
|
+
astraId?: string;
|
|
92
|
+
apiKey?: string;
|
|
93
|
+
jwt?: string;
|
|
94
|
+
purpose?: string;
|
|
95
|
+
action?: string;
|
|
96
|
+
transactionValue?: number;
|
|
97
|
+
currency?: string;
|
|
98
|
+
checkoutSessionId?: string;
|
|
99
|
+
checkoutItems?: VerificationRequest['checkoutItems'];
|
|
100
|
+
counterpartyUrl?: string;
|
|
101
|
+
counterpartyType?: string;
|
|
102
|
+
}): Promise<VerificationResult>;
|
|
103
|
+
/**
|
|
104
|
+
* Quick verification — checks credentials and policy in one call.
|
|
105
|
+
*
|
|
106
|
+
* The return shape mirrors `VerificationResult`'s identity/policy
|
|
107
|
+
* split. Map to HTTP status the same way: `!identityVerified` → 401,
|
|
108
|
+
* `identityVerified && !policyAllowed` → 403.
|
|
109
|
+
*/
|
|
110
|
+
quickVerify(credentials: {
|
|
111
|
+
astraId?: string;
|
|
112
|
+
apiKey?: string;
|
|
113
|
+
jwt?: string;
|
|
114
|
+
}): Promise<{
|
|
115
|
+
identityVerified: boolean;
|
|
116
|
+
policyAllowed: boolean;
|
|
117
|
+
reason?: string;
|
|
118
|
+
}>;
|
|
119
|
+
/**
|
|
120
|
+
* Verify a specific ASTRA-ID
|
|
121
|
+
*/
|
|
122
|
+
verifyAstraId(astraId: string, options?: {
|
|
123
|
+
purpose?: string;
|
|
124
|
+
action?: string;
|
|
125
|
+
}): Promise<VerificationResult>;
|
|
126
|
+
/**
|
|
127
|
+
* Verify using an API key
|
|
128
|
+
*/
|
|
129
|
+
verifyApiKey(apiKey: string, options?: {
|
|
130
|
+
purpose?: string;
|
|
131
|
+
action?: string;
|
|
132
|
+
}): Promise<VerificationResult>;
|
|
133
|
+
/**
|
|
134
|
+
* Clear the verification cache
|
|
135
|
+
*/
|
|
136
|
+
clearCache(): void;
|
|
137
|
+
/**
|
|
138
|
+
* Execute a function with retry logic
|
|
139
|
+
*/
|
|
140
|
+
private executeWithRetry;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Create a new SDK client
|
|
144
|
+
*/
|
|
145
|
+
declare function createClient(options: SDKOptions): VerificationGatewayClient;
|
|
146
|
+
/**
|
|
147
|
+
* One-shot verification without creating a client
|
|
148
|
+
*/
|
|
149
|
+
declare function verifyOnce(options: SDKOptions & {
|
|
150
|
+
astraId?: string;
|
|
151
|
+
apiKey?: string;
|
|
152
|
+
jwt?: string;
|
|
153
|
+
purpose?: string;
|
|
154
|
+
action?: string;
|
|
155
|
+
}): Promise<VerificationResult>;
|
|
156
|
+
|
|
157
|
+
export { VerificationGatewayClient, createClient, getTrustLevel, verifyOnce };
|
package/dist/adapters/sdk.d.ts
CHANGED
|
@@ -1,3 +1,157 @@
|
|
|
1
|
-
import '../types-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { T as TrustLevel, S as SDKOptions, d as VerificationResult, c as VerificationRequest } from '../types-BU04qAAR.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AstraSync Universal Verification Gateway — Trust Level helpers.
|
|
5
|
+
*
|
|
6
|
+
* SDK 5.0.0: the `accessLevel` band (`none`/`restricted`/`read-only`/`standard`/
|
|
7
|
+
* `full`/`internal`) was removed entirely — it never gated the access decision
|
|
8
|
+
* (the server does, from a verified ID + runtime challenge + PDLSS match + trust
|
|
9
|
+
* score). What remains here is the coarse trust-level badge derived from the
|
|
10
|
+
* numeric trust score, used only for display.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Determine trust level from score
|
|
15
|
+
*/
|
|
16
|
+
declare function getTrustLevel(score: number): TrustLevel;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* AstraSync Universal Verification Gateway - SDK Adapter
|
|
20
|
+
*
|
|
21
|
+
* Direct SDK for verifying agents in any JavaScript/TypeScript environment.
|
|
22
|
+
* Useful for agent-to-agent verification, serverless functions, or custom integrations.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* import { createClient } from '@astrasyncai/verification-gateway/sdk';
|
|
27
|
+
*
|
|
28
|
+
* const gateway = createClient({
|
|
29
|
+
* apiBaseUrl: 'https://astrasync.ai/api',
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* // Verify another agent before interacting
|
|
33
|
+
* const result = await gateway.verify({
|
|
34
|
+
* astraId: 'ASTRA-abc123',
|
|
35
|
+
* purpose: 'data-exchange',
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* if (result.identityVerified && result.policyAllowed) {
|
|
39
|
+
* // Safe to interact with this agent
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Verification Gateway SDK Client
|
|
46
|
+
*/
|
|
47
|
+
declare class VerificationGatewayClient {
|
|
48
|
+
private config;
|
|
49
|
+
private timeout;
|
|
50
|
+
private retryConfig;
|
|
51
|
+
constructor(options: SDKOptions);
|
|
52
|
+
/**
|
|
53
|
+
* Full verification with all details
|
|
54
|
+
*/
|
|
55
|
+
verify(options: {
|
|
56
|
+
astraId?: string;
|
|
57
|
+
apiKey?: string;
|
|
58
|
+
jwt?: string;
|
|
59
|
+
purpose?: string;
|
|
60
|
+
action?: string;
|
|
61
|
+
resourceType?: string;
|
|
62
|
+
resource?: string;
|
|
63
|
+
jurisdiction?: string;
|
|
64
|
+
transactionValue?: number;
|
|
65
|
+
currency?: string;
|
|
66
|
+
isSubAgentRequest?: boolean;
|
|
67
|
+
parentAgentId?: string;
|
|
68
|
+
subAgentDepth?: number;
|
|
69
|
+
counterpartyUrl?: string;
|
|
70
|
+
counterpartyType?: string;
|
|
71
|
+
}): Promise<VerificationResult>;
|
|
72
|
+
/**
|
|
73
|
+
* 5.4.0 (astra-pay): confirm-leg of a checkout — the ONLY call that may fire
|
|
74
|
+
* first-party charge-at-redeem (server-side settlement on the owner's saved
|
|
75
|
+
* instrument). This is the supported public surface for the confirm leg;
|
|
76
|
+
* `verify()` deliberately does not expose the checkout fields, so settlement
|
|
77
|
+
* can never fire by accident from a generic verify.
|
|
78
|
+
*
|
|
79
|
+
* Sends `commercePhase: 'confirm'` plus the checkout session id (per-cart
|
|
80
|
+
* idempotency) and line items (order/receipt plane), and identifies the
|
|
81
|
+
* merchant via `counterpartyUrl`/`counterpartyType` (required — the backend
|
|
82
|
+
* only settles a merchant-mediated grant against a first-party storefront).
|
|
83
|
+
* `purpose`/`action` default to the canonical shopping pair.
|
|
84
|
+
*
|
|
85
|
+
* Returns the full `VerificationResult`: read `.settlementOutcome` for the
|
|
86
|
+
* settled/failed/requires_action/no_instrument outcome (+ `orderId`), and the
|
|
87
|
+
* identity/policy/`failures` fields for a denial. On any non-`confirm`/first-
|
|
88
|
+
* party path `settlementOutcome` is simply absent — no money moves.
|
|
89
|
+
*/
|
|
90
|
+
confirmCheckout(options: {
|
|
91
|
+
astraId?: string;
|
|
92
|
+
apiKey?: string;
|
|
93
|
+
jwt?: string;
|
|
94
|
+
purpose?: string;
|
|
95
|
+
action?: string;
|
|
96
|
+
transactionValue?: number;
|
|
97
|
+
currency?: string;
|
|
98
|
+
checkoutSessionId?: string;
|
|
99
|
+
checkoutItems?: VerificationRequest['checkoutItems'];
|
|
100
|
+
counterpartyUrl?: string;
|
|
101
|
+
counterpartyType?: string;
|
|
102
|
+
}): Promise<VerificationResult>;
|
|
103
|
+
/**
|
|
104
|
+
* Quick verification — checks credentials and policy in one call.
|
|
105
|
+
*
|
|
106
|
+
* The return shape mirrors `VerificationResult`'s identity/policy
|
|
107
|
+
* split. Map to HTTP status the same way: `!identityVerified` → 401,
|
|
108
|
+
* `identityVerified && !policyAllowed` → 403.
|
|
109
|
+
*/
|
|
110
|
+
quickVerify(credentials: {
|
|
111
|
+
astraId?: string;
|
|
112
|
+
apiKey?: string;
|
|
113
|
+
jwt?: string;
|
|
114
|
+
}): Promise<{
|
|
115
|
+
identityVerified: boolean;
|
|
116
|
+
policyAllowed: boolean;
|
|
117
|
+
reason?: string;
|
|
118
|
+
}>;
|
|
119
|
+
/**
|
|
120
|
+
* Verify a specific ASTRA-ID
|
|
121
|
+
*/
|
|
122
|
+
verifyAstraId(astraId: string, options?: {
|
|
123
|
+
purpose?: string;
|
|
124
|
+
action?: string;
|
|
125
|
+
}): Promise<VerificationResult>;
|
|
126
|
+
/**
|
|
127
|
+
* Verify using an API key
|
|
128
|
+
*/
|
|
129
|
+
verifyApiKey(apiKey: string, options?: {
|
|
130
|
+
purpose?: string;
|
|
131
|
+
action?: string;
|
|
132
|
+
}): Promise<VerificationResult>;
|
|
133
|
+
/**
|
|
134
|
+
* Clear the verification cache
|
|
135
|
+
*/
|
|
136
|
+
clearCache(): void;
|
|
137
|
+
/**
|
|
138
|
+
* Execute a function with retry logic
|
|
139
|
+
*/
|
|
140
|
+
private executeWithRetry;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Create a new SDK client
|
|
144
|
+
*/
|
|
145
|
+
declare function createClient(options: SDKOptions): VerificationGatewayClient;
|
|
146
|
+
/**
|
|
147
|
+
* One-shot verification without creating a client
|
|
148
|
+
*/
|
|
149
|
+
declare function verifyOnce(options: SDKOptions & {
|
|
150
|
+
astraId?: string;
|
|
151
|
+
apiKey?: string;
|
|
152
|
+
jwt?: string;
|
|
153
|
+
purpose?: string;
|
|
154
|
+
action?: string;
|
|
155
|
+
}): Promise<VerificationResult>;
|
|
156
|
+
|
|
157
|
+
export { VerificationGatewayClient, createClient, getTrustLevel, verifyOnce };
|
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.4.
|
|
31
|
+
var SDK_VERSION = "5.4.1";
|
|
32
32
|
|
|
33
33
|
// src/http.ts
|
|
34
34
|
var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
|
|
@@ -165,7 +165,14 @@ function getCacheKey(request, counterpartyId) {
|
|
|
165
165
|
request.callerMetadata?.sourceIp || "",
|
|
166
166
|
request.callerMetadata?.userAgent || "",
|
|
167
167
|
request.callerMetadata?.forwardedFor || "",
|
|
168
|
-
request.callerMetadata?.agentCardUrl || ""
|
|
168
|
+
request.callerMetadata?.agentCardUrl || "",
|
|
169
|
+
// UAT2 Bug B (5.4.1): the commerce phase and cart identity DO affect the
|
|
170
|
+
// backend verdict — the confirm leg is the ONLY leg that may execute
|
|
171
|
+
// first-party settlement. Without these, a confirm within the cache TTL of
|
|
172
|
+
// its start_checkout quote was served the cached quote-leg grant (no
|
|
173
|
+
// settlementOutcome) and never reached the backend. Same F-A1-07 bug class.
|
|
174
|
+
request.commercePhase || "",
|
|
175
|
+
request.checkoutSessionId || ""
|
|
169
176
|
].join("|");
|
|
170
177
|
}
|
|
171
178
|
function getCachedResult(request, counterpartyId) {
|
|
@@ -581,7 +588,13 @@ var VerificationGatewayClient = class {
|
|
|
581
588
|
debug: options.debug,
|
|
582
589
|
customHeaders: options.customHeaders,
|
|
583
590
|
counterpartyUrl: options.counterpartyUrl,
|
|
584
|
-
counterpartyType: options.counterpartyType
|
|
591
|
+
counterpartyType: options.counterpartyType,
|
|
592
|
+
// 5.4.1 (UAT2): previously dropped here despite being a typed, documented
|
|
593
|
+
// GatewayConfig field — a client-driven confirmCheckout() could never
|
|
594
|
+
// identify its endpoint by ASTRAE id, so merchants with multiple
|
|
595
|
+
// endpoints on one origin (or a stale row sharing the URL) resolved
|
|
596
|
+
// non-deterministically by URL and could miss the first-party gate.
|
|
597
|
+
counterpartyId: options.counterpartyId
|
|
585
598
|
};
|
|
586
599
|
this.timeout = options.timeout || 1e4;
|
|
587
600
|
this.retryConfig = options.retry || { maxRetries: 3, backoffMs: 1e3 };
|
|
@@ -638,18 +651,25 @@ var VerificationGatewayClient = class {
|
|
|
638
651
|
jwt: options.jwt
|
|
639
652
|
};
|
|
640
653
|
return this.executeWithRetry(
|
|
641
|
-
() => verify(
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
654
|
+
() => verify(
|
|
655
|
+
this.config,
|
|
656
|
+
{
|
|
657
|
+
credentials,
|
|
658
|
+
purpose: options.purpose ?? "shopping",
|
|
659
|
+
action: options.action ?? "shopping.purchase",
|
|
660
|
+
transactionValue: options.transactionValue,
|
|
661
|
+
currency: options.currency,
|
|
662
|
+
commercePhase: "confirm",
|
|
663
|
+
checkoutSessionId: options.checkoutSessionId,
|
|
664
|
+
checkoutItems: options.checkoutItems,
|
|
665
|
+
counterpartyUrl: options.counterpartyUrl,
|
|
666
|
+
counterpartyType: options.counterpartyType
|
|
667
|
+
},
|
|
668
|
+
// 5.4.1 (UAT2 Bug B): the confirm leg must always reach the backend —
|
|
669
|
+
// a cached quote-leg grant carries no settlementOutcome and would
|
|
670
|
+
// silently skip settlement.
|
|
671
|
+
{ bypassCache: true }
|
|
672
|
+
)
|
|
653
673
|
);
|
|
654
674
|
}
|
|
655
675
|
/**
|