@astrasyncai/verification-gateway 5.20.0 → 5.21.1
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/CHANGELOG.md +62 -3
- package/README.md +2 -2
- package/dist/adapters/express.d.mts +1 -1
- package/dist/adapters/express.d.ts +1 -1
- package/dist/adapters/express.js +1 -1
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +1 -1
- 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 +1 -1
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +1 -1
- 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 +1 -1
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +1 -1
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.d.mts +8 -31
- package/dist/adapters/sdk.d.ts +8 -31
- package/dist/adapters/sdk.js +8 -22
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +8 -22
- 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 +2 -2
- package/dist/bin/astrasync-codex-hook.js +2 -2
- package/dist/bin/astrasync-guard.js +2 -2
- package/dist/bin/astrasync.js +15 -2
- package/dist/browser/background.js +2 -2
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +2 -2
- 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 +2 -2
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +2 -2
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/extension.js +2 -2
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +2 -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 +1 -1
- package/dist/edge-core/index.js.map +1 -1
- package/dist/edge-core/index.mjs +1 -1
- package/dist/edge-core/index.mjs.map +1 -1
- package/dist/gateway/gateway.js +2 -2
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +2 -2
- 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 +156 -34
- package/dist/index.d.ts +156 -34
- package/dist/index.js +327 -40
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +319 -40
- 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-D37aSQ9c.d.mts → types-B4zhOAlq.d.mts} +5 -0
- package/dist/{types-Dn8tXnei.d.ts → types-CtBXnWuV.d.ts} +5 -0
- package/dist/{types-CxjqmPl-.d.mts → types-DHHyXtuZ.d.mts} +5 -0
- package/dist/{types-CxjqmPl-.d.ts → types-DHHyXtuZ.d.ts} +5 -0
- 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 +1 -1
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +1 -1
- package/dist/verify.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -960,6 +960,11 @@ interface CheckoutMetadata {
|
|
|
960
960
|
/** The kit's own checkout session id (`chk_…` / `cs_…`). */
|
|
961
961
|
kitSessionId?: string;
|
|
962
962
|
protocol?: 'ucp' | 'acp';
|
|
963
|
+
/**
|
|
964
|
+
* 5.21.0: the card issuer programme whose cardholder price the cart carries;
|
|
965
|
+
* AstraSync refuses the purchase unless the buyer is that programme's cardholder.
|
|
966
|
+
*/
|
|
967
|
+
issuerProgram?: string;
|
|
963
968
|
}
|
|
964
969
|
/** 5.19.0 — see {@link VerificationRequest.purposeSource}. */
|
|
965
970
|
type PurposeSource = 'route_config' | 'header' | 'body' | 'default';
|
|
@@ -2323,38 +2328,23 @@ declare class VerificationGatewayClient {
|
|
|
2323
2328
|
status: string;
|
|
2324
2329
|
alreadySettled?: boolean;
|
|
2325
2330
|
}>;
|
|
2326
|
-
/**
|
|
2327
|
-
* 5.20.0 (round 29.1): change an endpoint's OPERATIONAL URLs with this
|
|
2328
|
-
* client's API key — `PATCH /api/endpoints/:id`. Accepts the key of the
|
|
2329
|
-
* endpoint's owner, or a personal key of an individual with an active seat
|
|
2330
|
-
* in the owning organisation. Policy (rules, trust floor, challenge, edge
|
|
2331
|
-
* config) stays dashboard-only. `null` clears a field. The owner is alerted
|
|
2332
|
-
* when `eventsUrl` changes.
|
|
2333
|
-
*
|
|
2334
|
-
* @param endpointId the ASTRAE id (defaults to the client's `counterpartyId`)
|
|
2335
|
-
* @returns the endpoint as stored, plus `changed` (the fields that changed)
|
|
2336
|
-
* @throws AstraSyncError — 400 `UNKNOWN_FIELDS` / validation, 401/403, 404
|
|
2337
|
-
*/
|
|
2338
|
-
updateEndpoint(endpointId: string | undefined, patch: EndpointOperationalPatch): Promise<Record<string, unknown> & {
|
|
2339
|
-
changed: Array<keyof EndpointOperationalPatch>;
|
|
2340
|
-
}>;
|
|
2341
2331
|
/**
|
|
2342
2332
|
* 5.20.0 (round 29.1): ask AstraSync to send ONE signed step-up event to the
|
|
2343
2333
|
* endpoint's Events URL now — `POST /api/endpoints/:id/events/test`.
|
|
2344
2334
|
* Delivered synchronously, outside the event outbox (random `eventId`, no
|
|
2345
2335
|
* retries), signed with the endpoint's webhook secret like a real event.
|
|
2346
|
-
*
|
|
2347
|
-
* ignores it
|
|
2348
|
-
*
|
|
2349
|
-
*
|
|
2350
|
-
*
|
|
2336
|
+
* The payload is synthetic (`approvalId: "test_…"`); a kit acknowledges and
|
|
2337
|
+
* ignores it.
|
|
2338
|
+
*
|
|
2339
|
+
* 5.21.0 (shops' item 48): synthetic only. Sending a real held approval's
|
|
2340
|
+
* payload (which releases or re-drives that checkout) is dashboard-only, so
|
|
2341
|
+
* a leaked API key can't do it.
|
|
2351
2342
|
*
|
|
2352
2343
|
* Resolves even when your endpoint refused the event (`delivered: false`,
|
|
2353
2344
|
* with `responseCode` / `error`).
|
|
2354
2345
|
*/
|
|
2355
2346
|
sendTestEvent(endpointId: string | undefined, options: {
|
|
2356
2347
|
type: TestEventType;
|
|
2357
|
-
approvalId?: string;
|
|
2358
2348
|
}): Promise<TestEventResult>;
|
|
2359
2349
|
private endpointCall;
|
|
2360
2350
|
/**
|
|
@@ -2396,14 +2386,6 @@ declare class VerificationGatewayClient {
|
|
|
2396
2386
|
*/
|
|
2397
2387
|
private executeWithRetry;
|
|
2398
2388
|
}
|
|
2399
|
-
/** 5.20.0: the operational fields `updateEndpoint` may change (`null` clears). */
|
|
2400
|
-
interface EndpointOperationalPatch {
|
|
2401
|
-
eventsUrl?: string | null;
|
|
2402
|
-
healthCheckUrl?: string | null;
|
|
2403
|
-
skillUrl?: string | null;
|
|
2404
|
-
catalogUrl?: string | null;
|
|
2405
|
-
checkoutUrl?: string | null;
|
|
2406
|
-
}
|
|
2407
2389
|
/** 5.20.0: the step-up event types `sendTestEvent` can send. */
|
|
2408
2390
|
type TestEventType = 'step_up.approved' | 'step_up.denied' | 'step_up.expired' | 'step_up.lapsed';
|
|
2409
2391
|
/** 5.20.0: what `sendTestEvent` reports. */
|
|
@@ -2433,7 +2415,6 @@ declare function verifyOnce(options: SDKOptions & {
|
|
|
2433
2415
|
action?: string;
|
|
2434
2416
|
}): Promise<VerificationResult>;
|
|
2435
2417
|
|
|
2436
|
-
type sdk_EndpointOperationalPatch = EndpointOperationalPatch;
|
|
2437
2418
|
type sdk_TestEventResult = TestEventResult;
|
|
2438
2419
|
type sdk_TestEventType = TestEventType;
|
|
2439
2420
|
type sdk_VerificationGatewayClient = VerificationGatewayClient;
|
|
@@ -2442,7 +2423,7 @@ declare const sdk_createClient: typeof createClient;
|
|
|
2442
2423
|
declare const sdk_getTrustLevel: typeof getTrustLevel;
|
|
2443
2424
|
declare const sdk_verifyOnce: typeof verifyOnce;
|
|
2444
2425
|
declare namespace sdk {
|
|
2445
|
-
export { type
|
|
2426
|
+
export { type sdk_TestEventResult as TestEventResult, type sdk_TestEventType as TestEventType, sdk_VerificationGatewayClient as VerificationGatewayClient, sdk_createClient as createClient, sdk_getTrustLevel as getTrustLevel, sdk_verifyOnce as verifyOnce };
|
|
2446
2427
|
}
|
|
2447
2428
|
|
|
2448
2429
|
/**
|
|
@@ -5485,7 +5466,7 @@ declare function detectRuntime(userAgent: string | undefined | null): string | u
|
|
|
5485
5466
|
* silently (never throwing), so this is a no-op there — which is correct:
|
|
5486
5467
|
* in a browser the page's real UA is the honest identity.
|
|
5487
5468
|
*/
|
|
5488
|
-
declare const SDK_USER_AGENT = "astrasync-sdk/5.
|
|
5469
|
+
declare const SDK_USER_AGENT = "astrasync-sdk/5.21.1";
|
|
5489
5470
|
declare const sdkFetch: typeof fetch;
|
|
5490
5471
|
|
|
5491
5472
|
interface LocalPolicy {
|
|
@@ -5603,7 +5584,7 @@ declare function parseYaml(yamlContent: string): ParseResult;
|
|
|
5603
5584
|
* is fine — bumping both in the release-ceremony commit keeps them
|
|
5604
5585
|
* lockstep.
|
|
5605
5586
|
*/
|
|
5606
|
-
declare const SDK_VERSION = "5.
|
|
5587
|
+
declare const SDK_VERSION = "5.21.1";
|
|
5607
5588
|
|
|
5608
5589
|
/**
|
|
5609
5590
|
* 5.15.0 — the `UCP-Agent` request header (UCP 2026-08-25): an RFC 8941
|
|
@@ -5869,6 +5850,129 @@ declare function sendUcpWebhook(opts: UcpWebhookOptions): Promise<{
|
|
|
5869
5850
|
attempts: number;
|
|
5870
5851
|
}>;
|
|
5871
5852
|
|
|
5853
|
+
declare const ISSUER_PROGRAM_HEADER = "X-Astra-Issuer-Program";
|
|
5854
|
+
interface AgentCommerceProductRule {
|
|
5855
|
+
/** false hides the product from agents. */
|
|
5856
|
+
visible?: boolean;
|
|
5857
|
+
/** Price for agents, in minor units (overrides your catalogue price). */
|
|
5858
|
+
priceMinor?: number;
|
|
5859
|
+
/** The image agents get (one of the product's own image URLs). */
|
|
5860
|
+
imageUrl?: string;
|
|
5861
|
+
/** false keeps this product out of card issuer offers. */
|
|
5862
|
+
issuerEligible?: boolean;
|
|
5863
|
+
}
|
|
5864
|
+
interface AgentCommerceOffer {
|
|
5865
|
+
/** Issuer programme slug, e.g. "latitude". */
|
|
5866
|
+
program: string;
|
|
5867
|
+
pricePercentOff?: number;
|
|
5868
|
+
interestFreeMonths?: number;
|
|
5869
|
+
minSpendMinor?: number;
|
|
5870
|
+
label: string;
|
|
5871
|
+
}
|
|
5872
|
+
interface AgentCommerceRules {
|
|
5873
|
+
version: number;
|
|
5874
|
+
/** Store-wide: verified agents get this % off. */
|
|
5875
|
+
verifiedPercentOff?: number;
|
|
5876
|
+
/** Store-wide: unverified (anonymous) agents see nothing. */
|
|
5877
|
+
hideFromUnverified?: boolean;
|
|
5878
|
+
products?: Record<string, AgentCommerceProductRule>;
|
|
5879
|
+
offers?: AgentCommerceOffer[];
|
|
5880
|
+
}
|
|
5881
|
+
interface PricingContext {
|
|
5882
|
+
/** The caller presented an AstraSync identity (verified when it confirms). */
|
|
5883
|
+
verified: boolean;
|
|
5884
|
+
/** The issuer programme the bridge says the buyer belongs to. */
|
|
5885
|
+
issuerProgram?: string;
|
|
5886
|
+
}
|
|
5887
|
+
interface PricedForAgent {
|
|
5888
|
+
priceMinor: number;
|
|
5889
|
+
/** The price without the cardholder offer (only when one applied). */
|
|
5890
|
+
regularMinor?: number;
|
|
5891
|
+
/** The programme whose cardholder price applied. */
|
|
5892
|
+
issuerProgram?: string;
|
|
5893
|
+
}
|
|
5894
|
+
/**
|
|
5895
|
+
* The cardholder price: percent off, rounded half up to the minor unit and
|
|
5896
|
+
* clamped to [0, price]. The same rule as AstraSync's backend and bridge.
|
|
5897
|
+
*/
|
|
5898
|
+
declare function issuerOfferPrice(priceMinor: number, percentOff: number | undefined): number;
|
|
5899
|
+
/** Apply rules to one product's price (pure — used by the catalogue and the kits). */
|
|
5900
|
+
declare function priceForAgent(rules: AgentCommerceRules | null, sku: string, basePriceMinor: number, ctx: PricingContext): PricedForAgent;
|
|
5901
|
+
/** What your kit reports so the dashboard can suggest your URLs (it never sets them). */
|
|
5902
|
+
interface KitReport {
|
|
5903
|
+
catalogUrl?: string;
|
|
5904
|
+
checkoutUrl?: string;
|
|
5905
|
+
eventsUrl?: string;
|
|
5906
|
+
protocols?: Array<'ucp' | 'acp'>;
|
|
5907
|
+
}
|
|
5908
|
+
interface AgentCommerce {
|
|
5909
|
+
/** The current rules (null until the first fetch succeeds). */
|
|
5910
|
+
rules(): AgentCommerceRules | null;
|
|
5911
|
+
/** Fetch now (also runs every `refreshMs`). */
|
|
5912
|
+
refresh(): Promise<void>;
|
|
5913
|
+
price(sku: string, basePriceMinor: number, ctx: PricingContext): PricedForAgent;
|
|
5914
|
+
visible(sku: string, ctx: PricingContext): boolean;
|
|
5915
|
+
/** Tell AstraSync where your kit lives (shown in the dashboard as suggestions). */
|
|
5916
|
+
report(r: KitReport): void;
|
|
5917
|
+
stop(): void;
|
|
5918
|
+
}
|
|
5919
|
+
interface CreateAgentCommerceOptions {
|
|
5920
|
+
apiBaseUrl: string;
|
|
5921
|
+
apiKey: string;
|
|
5922
|
+
/** The endpoint's ASTRAE id. */
|
|
5923
|
+
counterpartyId: string;
|
|
5924
|
+
/** Default 5 minutes. 0 disables the timer (call `refresh()` yourself). */
|
|
5925
|
+
refreshMs?: number;
|
|
5926
|
+
fetch?: typeof fetch;
|
|
5927
|
+
}
|
|
5928
|
+
declare function createAgentCommerce(opts: CreateAgentCommerceOptions): AgentCommerce;
|
|
5929
|
+
/** The pricing context of an inbound agent request (headers from the AstraSync bridge). */
|
|
5930
|
+
declare function pricingContextFrom(headers: {
|
|
5931
|
+
get(name: string): string | null;
|
|
5932
|
+
}): PricingContext;
|
|
5933
|
+
interface AgentProduct {
|
|
5934
|
+
sku: string;
|
|
5935
|
+
name: string;
|
|
5936
|
+
/** Minor units. */
|
|
5937
|
+
priceMinor: number;
|
|
5938
|
+
currency: string;
|
|
5939
|
+
description?: string;
|
|
5940
|
+
/** All the product's image URLs; the studio picks which one agents get. */
|
|
5941
|
+
imageUrls?: string[];
|
|
5942
|
+
inStock?: boolean;
|
|
5943
|
+
url?: string;
|
|
5944
|
+
}
|
|
5945
|
+
type ProductSource = () => Promise<AgentProduct[]>;
|
|
5946
|
+
/**
|
|
5947
|
+
* Read products from a feed you already have: a Shopify `products.json`, a
|
|
5948
|
+
* Google Merchant feed (XML), a CSV with `id,title,price,image_link,…`, or a
|
|
5949
|
+
* JSON list. Cached for a minute.
|
|
5950
|
+
*/
|
|
5951
|
+
declare function fromFeed(url: string, options?: {
|
|
5952
|
+
currency?: string;
|
|
5953
|
+
fetch?: typeof fetch;
|
|
5954
|
+
}): ProductSource;
|
|
5955
|
+
/** Parse a product feed body (exported for tests and the dashboard preview). */
|
|
5956
|
+
declare function parseFeed(text: string, currency: string): AgentProduct[];
|
|
5957
|
+
/**
|
|
5958
|
+
* The catalogue agents fetch, priced and filtered by your studio rules:
|
|
5959
|
+
* `GET` → `{ products: [{ sku, name, price, currency, image_url, in_stock,
|
|
5960
|
+
* issuer_offer? }] }` (prices in major units). Mount it where your endpoint's
|
|
5961
|
+
* catalogue URL points (the dashboard suggests it once your kit reports it).
|
|
5962
|
+
*/
|
|
5963
|
+
declare function serveAgentCatalog(opts: {
|
|
5964
|
+
commerce: AgentCommerce;
|
|
5965
|
+
products: ProductSource;
|
|
5966
|
+
}): (req: {
|
|
5967
|
+
headers: Record<string, string | string[] | undefined>;
|
|
5968
|
+
}, res: {
|
|
5969
|
+
status(code: number): {
|
|
5970
|
+
json(body: unknown): void;
|
|
5971
|
+
};
|
|
5972
|
+
json(body: unknown): void;
|
|
5973
|
+
setHeader?(name: string, value: string): void;
|
|
5974
|
+
}) => Promise<void>;
|
|
5975
|
+
|
|
5872
5976
|
interface IdempotencyRecord {
|
|
5873
5977
|
state: 'in_progress' | 'done';
|
|
5874
5978
|
requestHash: string;
|
|
@@ -6146,6 +6250,8 @@ interface CheckoutSession {
|
|
|
6146
6250
|
_attemptId?: string;
|
|
6147
6251
|
/** The AstraSync cart id the platform sent (X-Astra-Checkout-Session). */
|
|
6148
6252
|
_astraCheckoutSessionId?: string;
|
|
6253
|
+
/** 5.21.0: the card issuer programme whose cardholder price these lines carry. */
|
|
6254
|
+
_issuerProgram?: string;
|
|
6149
6255
|
/** The attached checkout JWS behind the last merchant_authorization sent. */
|
|
6150
6256
|
_checkoutJwt?: string;
|
|
6151
6257
|
}
|
|
@@ -6266,6 +6372,14 @@ interface UcpCheckoutKitOptions {
|
|
|
6266
6372
|
* without calling AstraSync.
|
|
6267
6373
|
*/
|
|
6268
6374
|
validateCart?: (session: CheckoutSession) => Promise<KitMessage[]>;
|
|
6375
|
+
/**
|
|
6376
|
+
* 5.21.0: your agent commerce studio rules (`createAgentCommerce`). Lines
|
|
6377
|
+
* are priced with them — studio price, verified discount, card issuer
|
|
6378
|
+
* cardholder price — exactly as `serveAgentCatalog` prices your catalogue,
|
|
6379
|
+
* and a cardholder-priced checkout names its programme on the confirm so
|
|
6380
|
+
* AstraSync can check the buyer is a cardholder.
|
|
6381
|
+
*/
|
|
6382
|
+
agentCommerce?: AgentCommerce;
|
|
6269
6383
|
/** AstraSync verification of the purchase (e.g. `client.confirmCheckout`). */
|
|
6270
6384
|
verifyPurchase: (ctx: {
|
|
6271
6385
|
session: CheckoutSession;
|
|
@@ -6894,6 +7008,8 @@ interface AcpCheckoutSession {
|
|
|
6894
7008
|
/** 5.18.0: hashed caller scope (was the raw Authorization header). */
|
|
6895
7009
|
_caller?: string;
|
|
6896
7010
|
_astraCheckoutSessionId?: string;
|
|
7011
|
+
/** 5.21.0: the card issuer programme whose cardholder price these lines carry. */
|
|
7012
|
+
_issuerProgram?: string;
|
|
6897
7013
|
/** 5.18.0: a settlement the processor hasn't confirmed yet (see `resolvePending`). */
|
|
6898
7014
|
_pending?: {
|
|
6899
7015
|
orderId?: string;
|
|
@@ -6944,6 +7060,12 @@ interface AcpCheckoutKitOptions {
|
|
|
6944
7060
|
* session `not_ready_for_payment` (messages are `invalid`, with your path
|
|
6945
7061
|
* as `param`) and `complete` is refused without calling AstraSync.
|
|
6946
7062
|
*/
|
|
7063
|
+
/**
|
|
7064
|
+
* 5.21.0: your agent commerce studio rules (`createAgentCommerce`) — lines
|
|
7065
|
+
* priced exactly as `serveAgentCatalog` prices your catalogue; a
|
|
7066
|
+
* cardholder-priced checkout names its programme on the confirm.
|
|
7067
|
+
*/
|
|
7068
|
+
agentCommerce?: AgentCommerce;
|
|
6947
7069
|
validateCart?: (session: AcpCheckoutSession) => Promise<KitMessage[]>;
|
|
6948
7070
|
verifyPurchase: (ctx: {
|
|
6949
7071
|
session: AcpCheckoutSession;
|
|
@@ -7438,4 +7560,4 @@ declare function contentDigest(body: string): string;
|
|
|
7438
7560
|
*/
|
|
7439
7561
|
declare function signHttpRequest(req: SignableRequest, opts: SignHttpRequestOptions): Promise<Record<string, string>>;
|
|
7440
7562
|
|
|
7441
|
-
export { ACP_API_VERSION, ACP_SUPPORTED_API_VERSIONS, AEP_SPEC_VERSION, AP2_VCT, type AcpCheckoutKitOptions, type AcpCheckoutSession, type AcpCheckoutStatus, type AcpCheckoutStore, type AcpWellKnownOptions, type AepActorType, type AepArtifactRecord, type AepArtifactType, AepChain, type AepChainOptions, type AepChainVerification, type AepHashInput, type AgentArtifacts, AgentClient, type AgentCredentials, type AgentProtocol, type AgentProtocolIdentities, type AgentRecord, type Ap2Party, type Ap2VerifyResult, type ApprovalEvent, type ApprovalEventKit, type ApprovalEventsHandlerOptions, type ApprovalEventsResponse, AstraSync, type AstraSyncAepEvidence, type AstraSyncConfig, type AstraSyncCredentials, AstraSyncError, type AstraSyncMandates, type AttemptOutcome, type AttemptReport, AuthenticationError, type BuildGuidanceParams, CAPTURE_SCHEMA_VERSION, type CallerMetadata, ChallengeHandler, type CheckoutMetadata, type CommerceArtifactsPayload, type CommerceContext, type CommercePipelineInput, type CommerceShieldProps, type ConsiderationItem, type ConsiderationSet, type CounterpartyType, DECLARED_SOURCE_MAX, DEFAULT_EDGE_CONFIG, DEFAULT_IDEMPOTENCY_TTL_MS, type DashboardToolRule, type DynamicPlatformFingerprint, type EdgeConfig, type EdgeMode, type EdgePathRule, type EdgeVerificationDepth, type
|
|
7563
|
+
export { ACP_API_VERSION, ACP_SUPPORTED_API_VERSIONS, AEP_SPEC_VERSION, AP2_VCT, type AcpCheckoutKitOptions, type AcpCheckoutSession, type AcpCheckoutStatus, type AcpCheckoutStore, type AcpWellKnownOptions, type AepActorType, type AepArtifactRecord, type AepArtifactType, AepChain, type AepChainOptions, type AepChainVerification, type AepHashInput, type AgentArtifacts, AgentClient, type AgentCommerce, type AgentCommerceOffer, type AgentCommerceRules, type AgentCredentials, type AgentProduct, type AgentProtocol, type AgentProtocolIdentities, type AgentRecord, type Ap2Party, type Ap2VerifyResult, type ApprovalEvent, type ApprovalEventKit, type ApprovalEventsHandlerOptions, type ApprovalEventsResponse, AstraSync, type AstraSyncAepEvidence, type AstraSyncConfig, type AstraSyncCredentials, AstraSyncError, type AstraSyncMandates, type AttemptOutcome, type AttemptReport, AuthenticationError, type BuildGuidanceParams, CAPTURE_SCHEMA_VERSION, type CallerMetadata, ChallengeHandler, type CheckoutMetadata, type CommerceArtifactsPayload, type CommerceContext, type CommercePipelineInput, type CommerceShieldProps, type ConsiderationItem, type ConsiderationSet, type CounterpartyType, DECLARED_SOURCE_MAX, DEFAULT_EDGE_CONFIG, DEFAULT_IDEMPOTENCY_TTL_MS, type DashboardToolRule, type DynamicPlatformFingerprint, type EdgeConfig, type EdgeMode, type EdgePathRule, type EdgeVerificationDepth, type EnhancedVerificationResult, type ExpressHandlerOptions, type ExpressMiddlewareOptions, type FetchEdgeConfigResult, type FetchEdgeConfigSuccess, type FetchKit, type FiatSettlementBinding, type FrameworkConfig, type FulfilmentInfo, type GatewayConfig, type GuidanceEnvelope, type GuidanceInfo, type HandleApprovalEventsOptions, type HealthResponse, type HttpSignatureAlgorithm, ISSUER_PROGRAM_HEADER, type IdempotencyOptions, type IdempotencyRecord, type IdempotencyStore, KYDRequiredError, type KitExpressRequest, type KitExpressResponse, type KitMessage, type KitReport, type KitRequestContext, type KyaPayIdentity, type KyaPayResult, type KyaPayTokenType, type KyaPayVerifyOptions, type ParseResult as LocalPolicyParseResult, type ValidationError as LocalPolicyValidationError, type ValidationResult as LocalPolicyValidationResult, MAX_HEADERS, MAX_HEADER_VALUE_BYTES, MAX_TOTAL_BYTES, MCP_VERIFIED_HOP_HEADER, MCP_VERIFIED_HOP_MAX_AGE_MS, type McpMiddlewareOptions, MemoryCheckoutStore, MemoryIdempotencyStore, MemoryMppChallengeStore, MemorySeenEvents, type MerchantSettlementToken, type ModelConfig, type MppChallenge, type MppChallengeStore, type MppCredential, type MppReceipt, type MppVerifyOptions, type MppVerifyResult, type NegotiationResult, type NextJsMiddlewareOptions, type ObservedMetadata, type PDLSSConfig$1 as PDLSSConfig, type PDLSSDuration, type PDLSSInfo, type PDLSSLimits, type PDLSSPurpose, type PDLSSScope, type PDLSSSelfInstantiation, PLATFORM_AGENT_SIGNATURES, type PendingRegistrationResponse, type PendingResolution, type PlatformAgentVendor, type PlatformDetectionInput, type PlatformFingerprint, type PlatformSignatureDef, type PollRegistrationResult, type PricingContext, type ProtocolTransport, type PurposeSource, RUNTIME_SIGNATURES, RedisIdempotencyStore, type RedisLike, type RegisterOptions, type RegisterResult, RegistrationDeniedError, RegistrationExpiredError, type RegistrationResponse, RegistrationTimeoutError, type ReportAttemptOptions, type ReportRetryOptions, type ResumeOutcome, type ResumeResult, type RootKeyResolver, type RouteAccessConfig, type RoutePolicy, type RuntimeChallengeResult, type RuntimeSignature, type SDKOptions, SDK_USER_AGENT, type SanitizeHeadersResult, type SeenEvents, type SettlementArtifact, type SettlementArtifactBinding, type SettlementArtifactBindingBase, type SettlementDecision, type SettlementOutcomeInfo, SettlementReportError, type SettlementRequest, type SignHttpRequestOptions, type SignableRequest, type StablecoinSettlementBinding, type StepUpApprovalInfo, type StepUpApprovalStatus, type StepUpOutcome, TRUST_LEVEL_RANGES, type TestEventResult, type TestEventType, type TokenGuidance, type ToolGate, type ToolGateConfig, type TrustLevel, UCP_ORDER_CAPABILITY, UCP_VERSION, type UcpAgentBinding, type CatalogItem as UcpCatalogItem, type UcpCheckoutKitOptions, type CheckoutSession as UcpCheckoutSession, type CheckoutStore as UcpCheckoutStore, type UcpLink, type UcpMessage, type UcpOrder, type UcpProfile, type UcpProfileResult, type SettleResult as UcpSettleResult, type UcpSeverity, type UcpSignatureResult, VERIFICATION_STATUS_HEADER, SDK_VERSION as VERSION, type VerificationInterstitialProps, type VerificationRequest, type VerificationResult, type VerificationWarning, type VerifiedAgent, type VerifiedDeveloper, type VerifiedHopMarker, type VerifiedOrganization, type VerifyAp2Options, type VerifyOptions, type VerifyResponse, type WaitForApprovalOptions, type WellKnownAgenticCommerce, type X402PaymentPayload, type X402PaymentRequired, type X402PaymentRequirements, type X402ResourceInfo, type X402SettlementResponse, _resetEdgeConfigCache, abandonIdempotent, acpPaymentHandlers, aepCanonicalJson, aepHash, aepPrivateKeyFromSeed, aepPublicKeyDocument, aepPublicKeyFromBase64, aepRawPublicKey, aepSign, aepTimestamp, aepVerifySignature, index as agent, approvalEventsHandler, astrasyncPaymentHandlers, authorizeSettlement, awaitStepUpApproval, beginIdempotent, buildAcpWellKnown, buildGuidance, buildMpp402Response, buildMppChallenge, buildSdkObservedMetadata, buildUcpOrder, buildUcpProfile, buildVerificationUnavailableBody, buildX402Challenge, canonicalJson, checkUcpAgentBinding, checkoutHash, clearCache, closedCheckoutMandate, closedPaymentMandate, contentDigest, createAcpCheckoutKit, createAgentCommerce, createKbHop, createMcpMiddleware, createUcpCheckoutKit, decodeMppRequest, degradeToObserve, denyStatusFor, deriveConnectionFromHeaders, detectPlatformFingerprint, detectRuntime, encodeMppReceipt, encodeX402SettlementResponse, express, expressHandler, extractApiKeyFormat, extractCredentials, extractMcpCredentials, extractPlatformHeaders, fetchEdgeConfig, fetchRoutes, fetchUcpProfile, finishIdempotent, fromFeed, getCachedWellKnownUrls, getEdgeConfig, getTrustLevel, getWellKnownUrls, handleApprovalEvents, hasCredentials, idempotencyMiddleware, isEdgeConfig, isRejectedIdentityClaim, isRetryableSettlementError, isSharedVerdict, isSpecialUseIp, isVerificationUnavailable, isVerifiedHopValidFor, issueDelegateSdJwt, issuerOfferPrice, matchEdgePathRule, matchPlatformSignature, matchRoutePattern, mppBodyDigest, negotiateUcp, nextjs, normalizeDeclaredSource, onVerificationResult, openCheckoutMandate, openPaymentMandate, parseFeed, parseYaml as parseLocalPolicyYaml, parseMppCredential, parseUcpAgentHeader, parseVerifiedHop, parseX402Challenge, parseX402Payment, pollStepUpStatus, prefetchWellKnown, priceForAgent, pricingContextFrom, quickVerify, recordDecision, reportAttempt, reportUnregisteredAttempt, requestFingerprint, rootMandateDigest, routePatternToRegExp, routePolicyOf, sanitizeHeaders, sdk, sdkFetch, sendUcpWebhook, serializeVerifiedHop, serveAgentCatalog, setMcpMeta, signHttpRequest, signRootMandate, signUcpRequest, signUcpResponse, index$1 as transport, ucpError, ucpEscalation, ucpFailure, ucpProfileHandler, ucpProfileKeys, ucpRequiredComponents, unavailableRetryAfterSeconds, validatePolicy as validateLocalPolicy, verify, verifyAepChain, verifyAp2Mandate, verifyDelegateChain, verifyKyaPayTokens, verifyMppChallenge, verifyUcpRequest, withIdempotency, x402PaymentMatchesOffer };
|
package/dist/index.d.ts
CHANGED
|
@@ -960,6 +960,11 @@ interface CheckoutMetadata {
|
|
|
960
960
|
/** The kit's own checkout session id (`chk_…` / `cs_…`). */
|
|
961
961
|
kitSessionId?: string;
|
|
962
962
|
protocol?: 'ucp' | 'acp';
|
|
963
|
+
/**
|
|
964
|
+
* 5.21.0: the card issuer programme whose cardholder price the cart carries;
|
|
965
|
+
* AstraSync refuses the purchase unless the buyer is that programme's cardholder.
|
|
966
|
+
*/
|
|
967
|
+
issuerProgram?: string;
|
|
963
968
|
}
|
|
964
969
|
/** 5.19.0 — see {@link VerificationRequest.purposeSource}. */
|
|
965
970
|
type PurposeSource = 'route_config' | 'header' | 'body' | 'default';
|
|
@@ -2323,38 +2328,23 @@ declare class VerificationGatewayClient {
|
|
|
2323
2328
|
status: string;
|
|
2324
2329
|
alreadySettled?: boolean;
|
|
2325
2330
|
}>;
|
|
2326
|
-
/**
|
|
2327
|
-
* 5.20.0 (round 29.1): change an endpoint's OPERATIONAL URLs with this
|
|
2328
|
-
* client's API key — `PATCH /api/endpoints/:id`. Accepts the key of the
|
|
2329
|
-
* endpoint's owner, or a personal key of an individual with an active seat
|
|
2330
|
-
* in the owning organisation. Policy (rules, trust floor, challenge, edge
|
|
2331
|
-
* config) stays dashboard-only. `null` clears a field. The owner is alerted
|
|
2332
|
-
* when `eventsUrl` changes.
|
|
2333
|
-
*
|
|
2334
|
-
* @param endpointId the ASTRAE id (defaults to the client's `counterpartyId`)
|
|
2335
|
-
* @returns the endpoint as stored, plus `changed` (the fields that changed)
|
|
2336
|
-
* @throws AstraSyncError — 400 `UNKNOWN_FIELDS` / validation, 401/403, 404
|
|
2337
|
-
*/
|
|
2338
|
-
updateEndpoint(endpointId: string | undefined, patch: EndpointOperationalPatch): Promise<Record<string, unknown> & {
|
|
2339
|
-
changed: Array<keyof EndpointOperationalPatch>;
|
|
2340
|
-
}>;
|
|
2341
2331
|
/**
|
|
2342
2332
|
* 5.20.0 (round 29.1): ask AstraSync to send ONE signed step-up event to the
|
|
2343
2333
|
* endpoint's Events URL now — `POST /api/endpoints/:id/events/test`.
|
|
2344
2334
|
* Delivered synchronously, outside the event outbox (random `eventId`, no
|
|
2345
2335
|
* retries), signed with the endpoint's webhook secret like a real event.
|
|
2346
|
-
*
|
|
2347
|
-
* ignores it
|
|
2348
|
-
*
|
|
2349
|
-
*
|
|
2350
|
-
*
|
|
2336
|
+
* The payload is synthetic (`approvalId: "test_…"`); a kit acknowledges and
|
|
2337
|
+
* ignores it.
|
|
2338
|
+
*
|
|
2339
|
+
* 5.21.0 (shops' item 48): synthetic only. Sending a real held approval's
|
|
2340
|
+
* payload (which releases or re-drives that checkout) is dashboard-only, so
|
|
2341
|
+
* a leaked API key can't do it.
|
|
2351
2342
|
*
|
|
2352
2343
|
* Resolves even when your endpoint refused the event (`delivered: false`,
|
|
2353
2344
|
* with `responseCode` / `error`).
|
|
2354
2345
|
*/
|
|
2355
2346
|
sendTestEvent(endpointId: string | undefined, options: {
|
|
2356
2347
|
type: TestEventType;
|
|
2357
|
-
approvalId?: string;
|
|
2358
2348
|
}): Promise<TestEventResult>;
|
|
2359
2349
|
private endpointCall;
|
|
2360
2350
|
/**
|
|
@@ -2396,14 +2386,6 @@ declare class VerificationGatewayClient {
|
|
|
2396
2386
|
*/
|
|
2397
2387
|
private executeWithRetry;
|
|
2398
2388
|
}
|
|
2399
|
-
/** 5.20.0: the operational fields `updateEndpoint` may change (`null` clears). */
|
|
2400
|
-
interface EndpointOperationalPatch {
|
|
2401
|
-
eventsUrl?: string | null;
|
|
2402
|
-
healthCheckUrl?: string | null;
|
|
2403
|
-
skillUrl?: string | null;
|
|
2404
|
-
catalogUrl?: string | null;
|
|
2405
|
-
checkoutUrl?: string | null;
|
|
2406
|
-
}
|
|
2407
2389
|
/** 5.20.0: the step-up event types `sendTestEvent` can send. */
|
|
2408
2390
|
type TestEventType = 'step_up.approved' | 'step_up.denied' | 'step_up.expired' | 'step_up.lapsed';
|
|
2409
2391
|
/** 5.20.0: what `sendTestEvent` reports. */
|
|
@@ -2433,7 +2415,6 @@ declare function verifyOnce(options: SDKOptions & {
|
|
|
2433
2415
|
action?: string;
|
|
2434
2416
|
}): Promise<VerificationResult>;
|
|
2435
2417
|
|
|
2436
|
-
type sdk_EndpointOperationalPatch = EndpointOperationalPatch;
|
|
2437
2418
|
type sdk_TestEventResult = TestEventResult;
|
|
2438
2419
|
type sdk_TestEventType = TestEventType;
|
|
2439
2420
|
type sdk_VerificationGatewayClient = VerificationGatewayClient;
|
|
@@ -2442,7 +2423,7 @@ declare const sdk_createClient: typeof createClient;
|
|
|
2442
2423
|
declare const sdk_getTrustLevel: typeof getTrustLevel;
|
|
2443
2424
|
declare const sdk_verifyOnce: typeof verifyOnce;
|
|
2444
2425
|
declare namespace sdk {
|
|
2445
|
-
export { type
|
|
2426
|
+
export { type sdk_TestEventResult as TestEventResult, type sdk_TestEventType as TestEventType, sdk_VerificationGatewayClient as VerificationGatewayClient, sdk_createClient as createClient, sdk_getTrustLevel as getTrustLevel, sdk_verifyOnce as verifyOnce };
|
|
2446
2427
|
}
|
|
2447
2428
|
|
|
2448
2429
|
/**
|
|
@@ -5485,7 +5466,7 @@ declare function detectRuntime(userAgent: string | undefined | null): string | u
|
|
|
5485
5466
|
* silently (never throwing), so this is a no-op there — which is correct:
|
|
5486
5467
|
* in a browser the page's real UA is the honest identity.
|
|
5487
5468
|
*/
|
|
5488
|
-
declare const SDK_USER_AGENT = "astrasync-sdk/5.
|
|
5469
|
+
declare const SDK_USER_AGENT = "astrasync-sdk/5.21.1";
|
|
5489
5470
|
declare const sdkFetch: typeof fetch;
|
|
5490
5471
|
|
|
5491
5472
|
interface LocalPolicy {
|
|
@@ -5603,7 +5584,7 @@ declare function parseYaml(yamlContent: string): ParseResult;
|
|
|
5603
5584
|
* is fine — bumping both in the release-ceremony commit keeps them
|
|
5604
5585
|
* lockstep.
|
|
5605
5586
|
*/
|
|
5606
|
-
declare const SDK_VERSION = "5.
|
|
5587
|
+
declare const SDK_VERSION = "5.21.1";
|
|
5607
5588
|
|
|
5608
5589
|
/**
|
|
5609
5590
|
* 5.15.0 — the `UCP-Agent` request header (UCP 2026-08-25): an RFC 8941
|
|
@@ -5869,6 +5850,129 @@ declare function sendUcpWebhook(opts: UcpWebhookOptions): Promise<{
|
|
|
5869
5850
|
attempts: number;
|
|
5870
5851
|
}>;
|
|
5871
5852
|
|
|
5853
|
+
declare const ISSUER_PROGRAM_HEADER = "X-Astra-Issuer-Program";
|
|
5854
|
+
interface AgentCommerceProductRule {
|
|
5855
|
+
/** false hides the product from agents. */
|
|
5856
|
+
visible?: boolean;
|
|
5857
|
+
/** Price for agents, in minor units (overrides your catalogue price). */
|
|
5858
|
+
priceMinor?: number;
|
|
5859
|
+
/** The image agents get (one of the product's own image URLs). */
|
|
5860
|
+
imageUrl?: string;
|
|
5861
|
+
/** false keeps this product out of card issuer offers. */
|
|
5862
|
+
issuerEligible?: boolean;
|
|
5863
|
+
}
|
|
5864
|
+
interface AgentCommerceOffer {
|
|
5865
|
+
/** Issuer programme slug, e.g. "latitude". */
|
|
5866
|
+
program: string;
|
|
5867
|
+
pricePercentOff?: number;
|
|
5868
|
+
interestFreeMonths?: number;
|
|
5869
|
+
minSpendMinor?: number;
|
|
5870
|
+
label: string;
|
|
5871
|
+
}
|
|
5872
|
+
interface AgentCommerceRules {
|
|
5873
|
+
version: number;
|
|
5874
|
+
/** Store-wide: verified agents get this % off. */
|
|
5875
|
+
verifiedPercentOff?: number;
|
|
5876
|
+
/** Store-wide: unverified (anonymous) agents see nothing. */
|
|
5877
|
+
hideFromUnverified?: boolean;
|
|
5878
|
+
products?: Record<string, AgentCommerceProductRule>;
|
|
5879
|
+
offers?: AgentCommerceOffer[];
|
|
5880
|
+
}
|
|
5881
|
+
interface PricingContext {
|
|
5882
|
+
/** The caller presented an AstraSync identity (verified when it confirms). */
|
|
5883
|
+
verified: boolean;
|
|
5884
|
+
/** The issuer programme the bridge says the buyer belongs to. */
|
|
5885
|
+
issuerProgram?: string;
|
|
5886
|
+
}
|
|
5887
|
+
interface PricedForAgent {
|
|
5888
|
+
priceMinor: number;
|
|
5889
|
+
/** The price without the cardholder offer (only when one applied). */
|
|
5890
|
+
regularMinor?: number;
|
|
5891
|
+
/** The programme whose cardholder price applied. */
|
|
5892
|
+
issuerProgram?: string;
|
|
5893
|
+
}
|
|
5894
|
+
/**
|
|
5895
|
+
* The cardholder price: percent off, rounded half up to the minor unit and
|
|
5896
|
+
* clamped to [0, price]. The same rule as AstraSync's backend and bridge.
|
|
5897
|
+
*/
|
|
5898
|
+
declare function issuerOfferPrice(priceMinor: number, percentOff: number | undefined): number;
|
|
5899
|
+
/** Apply rules to one product's price (pure — used by the catalogue and the kits). */
|
|
5900
|
+
declare function priceForAgent(rules: AgentCommerceRules | null, sku: string, basePriceMinor: number, ctx: PricingContext): PricedForAgent;
|
|
5901
|
+
/** What your kit reports so the dashboard can suggest your URLs (it never sets them). */
|
|
5902
|
+
interface KitReport {
|
|
5903
|
+
catalogUrl?: string;
|
|
5904
|
+
checkoutUrl?: string;
|
|
5905
|
+
eventsUrl?: string;
|
|
5906
|
+
protocols?: Array<'ucp' | 'acp'>;
|
|
5907
|
+
}
|
|
5908
|
+
interface AgentCommerce {
|
|
5909
|
+
/** The current rules (null until the first fetch succeeds). */
|
|
5910
|
+
rules(): AgentCommerceRules | null;
|
|
5911
|
+
/** Fetch now (also runs every `refreshMs`). */
|
|
5912
|
+
refresh(): Promise<void>;
|
|
5913
|
+
price(sku: string, basePriceMinor: number, ctx: PricingContext): PricedForAgent;
|
|
5914
|
+
visible(sku: string, ctx: PricingContext): boolean;
|
|
5915
|
+
/** Tell AstraSync where your kit lives (shown in the dashboard as suggestions). */
|
|
5916
|
+
report(r: KitReport): void;
|
|
5917
|
+
stop(): void;
|
|
5918
|
+
}
|
|
5919
|
+
interface CreateAgentCommerceOptions {
|
|
5920
|
+
apiBaseUrl: string;
|
|
5921
|
+
apiKey: string;
|
|
5922
|
+
/** The endpoint's ASTRAE id. */
|
|
5923
|
+
counterpartyId: string;
|
|
5924
|
+
/** Default 5 minutes. 0 disables the timer (call `refresh()` yourself). */
|
|
5925
|
+
refreshMs?: number;
|
|
5926
|
+
fetch?: typeof fetch;
|
|
5927
|
+
}
|
|
5928
|
+
declare function createAgentCommerce(opts: CreateAgentCommerceOptions): AgentCommerce;
|
|
5929
|
+
/** The pricing context of an inbound agent request (headers from the AstraSync bridge). */
|
|
5930
|
+
declare function pricingContextFrom(headers: {
|
|
5931
|
+
get(name: string): string | null;
|
|
5932
|
+
}): PricingContext;
|
|
5933
|
+
interface AgentProduct {
|
|
5934
|
+
sku: string;
|
|
5935
|
+
name: string;
|
|
5936
|
+
/** Minor units. */
|
|
5937
|
+
priceMinor: number;
|
|
5938
|
+
currency: string;
|
|
5939
|
+
description?: string;
|
|
5940
|
+
/** All the product's image URLs; the studio picks which one agents get. */
|
|
5941
|
+
imageUrls?: string[];
|
|
5942
|
+
inStock?: boolean;
|
|
5943
|
+
url?: string;
|
|
5944
|
+
}
|
|
5945
|
+
type ProductSource = () => Promise<AgentProduct[]>;
|
|
5946
|
+
/**
|
|
5947
|
+
* Read products from a feed you already have: a Shopify `products.json`, a
|
|
5948
|
+
* Google Merchant feed (XML), a CSV with `id,title,price,image_link,…`, or a
|
|
5949
|
+
* JSON list. Cached for a minute.
|
|
5950
|
+
*/
|
|
5951
|
+
declare function fromFeed(url: string, options?: {
|
|
5952
|
+
currency?: string;
|
|
5953
|
+
fetch?: typeof fetch;
|
|
5954
|
+
}): ProductSource;
|
|
5955
|
+
/** Parse a product feed body (exported for tests and the dashboard preview). */
|
|
5956
|
+
declare function parseFeed(text: string, currency: string): AgentProduct[];
|
|
5957
|
+
/**
|
|
5958
|
+
* The catalogue agents fetch, priced and filtered by your studio rules:
|
|
5959
|
+
* `GET` → `{ products: [{ sku, name, price, currency, image_url, in_stock,
|
|
5960
|
+
* issuer_offer? }] }` (prices in major units). Mount it where your endpoint's
|
|
5961
|
+
* catalogue URL points (the dashboard suggests it once your kit reports it).
|
|
5962
|
+
*/
|
|
5963
|
+
declare function serveAgentCatalog(opts: {
|
|
5964
|
+
commerce: AgentCommerce;
|
|
5965
|
+
products: ProductSource;
|
|
5966
|
+
}): (req: {
|
|
5967
|
+
headers: Record<string, string | string[] | undefined>;
|
|
5968
|
+
}, res: {
|
|
5969
|
+
status(code: number): {
|
|
5970
|
+
json(body: unknown): void;
|
|
5971
|
+
};
|
|
5972
|
+
json(body: unknown): void;
|
|
5973
|
+
setHeader?(name: string, value: string): void;
|
|
5974
|
+
}) => Promise<void>;
|
|
5975
|
+
|
|
5872
5976
|
interface IdempotencyRecord {
|
|
5873
5977
|
state: 'in_progress' | 'done';
|
|
5874
5978
|
requestHash: string;
|
|
@@ -6146,6 +6250,8 @@ interface CheckoutSession {
|
|
|
6146
6250
|
_attemptId?: string;
|
|
6147
6251
|
/** The AstraSync cart id the platform sent (X-Astra-Checkout-Session). */
|
|
6148
6252
|
_astraCheckoutSessionId?: string;
|
|
6253
|
+
/** 5.21.0: the card issuer programme whose cardholder price these lines carry. */
|
|
6254
|
+
_issuerProgram?: string;
|
|
6149
6255
|
/** The attached checkout JWS behind the last merchant_authorization sent. */
|
|
6150
6256
|
_checkoutJwt?: string;
|
|
6151
6257
|
}
|
|
@@ -6266,6 +6372,14 @@ interface UcpCheckoutKitOptions {
|
|
|
6266
6372
|
* without calling AstraSync.
|
|
6267
6373
|
*/
|
|
6268
6374
|
validateCart?: (session: CheckoutSession) => Promise<KitMessage[]>;
|
|
6375
|
+
/**
|
|
6376
|
+
* 5.21.0: your agent commerce studio rules (`createAgentCommerce`). Lines
|
|
6377
|
+
* are priced with them — studio price, verified discount, card issuer
|
|
6378
|
+
* cardholder price — exactly as `serveAgentCatalog` prices your catalogue,
|
|
6379
|
+
* and a cardholder-priced checkout names its programme on the confirm so
|
|
6380
|
+
* AstraSync can check the buyer is a cardholder.
|
|
6381
|
+
*/
|
|
6382
|
+
agentCommerce?: AgentCommerce;
|
|
6269
6383
|
/** AstraSync verification of the purchase (e.g. `client.confirmCheckout`). */
|
|
6270
6384
|
verifyPurchase: (ctx: {
|
|
6271
6385
|
session: CheckoutSession;
|
|
@@ -6894,6 +7008,8 @@ interface AcpCheckoutSession {
|
|
|
6894
7008
|
/** 5.18.0: hashed caller scope (was the raw Authorization header). */
|
|
6895
7009
|
_caller?: string;
|
|
6896
7010
|
_astraCheckoutSessionId?: string;
|
|
7011
|
+
/** 5.21.0: the card issuer programme whose cardholder price these lines carry. */
|
|
7012
|
+
_issuerProgram?: string;
|
|
6897
7013
|
/** 5.18.0: a settlement the processor hasn't confirmed yet (see `resolvePending`). */
|
|
6898
7014
|
_pending?: {
|
|
6899
7015
|
orderId?: string;
|
|
@@ -6944,6 +7060,12 @@ interface AcpCheckoutKitOptions {
|
|
|
6944
7060
|
* session `not_ready_for_payment` (messages are `invalid`, with your path
|
|
6945
7061
|
* as `param`) and `complete` is refused without calling AstraSync.
|
|
6946
7062
|
*/
|
|
7063
|
+
/**
|
|
7064
|
+
* 5.21.0: your agent commerce studio rules (`createAgentCommerce`) — lines
|
|
7065
|
+
* priced exactly as `serveAgentCatalog` prices your catalogue; a
|
|
7066
|
+
* cardholder-priced checkout names its programme on the confirm.
|
|
7067
|
+
*/
|
|
7068
|
+
agentCommerce?: AgentCommerce;
|
|
6947
7069
|
validateCart?: (session: AcpCheckoutSession) => Promise<KitMessage[]>;
|
|
6948
7070
|
verifyPurchase: (ctx: {
|
|
6949
7071
|
session: AcpCheckoutSession;
|
|
@@ -7438,4 +7560,4 @@ declare function contentDigest(body: string): string;
|
|
|
7438
7560
|
*/
|
|
7439
7561
|
declare function signHttpRequest(req: SignableRequest, opts: SignHttpRequestOptions): Promise<Record<string, string>>;
|
|
7440
7562
|
|
|
7441
|
-
export { ACP_API_VERSION, ACP_SUPPORTED_API_VERSIONS, AEP_SPEC_VERSION, AP2_VCT, type AcpCheckoutKitOptions, type AcpCheckoutSession, type AcpCheckoutStatus, type AcpCheckoutStore, type AcpWellKnownOptions, type AepActorType, type AepArtifactRecord, type AepArtifactType, AepChain, type AepChainOptions, type AepChainVerification, type AepHashInput, type AgentArtifacts, AgentClient, type AgentCredentials, type AgentProtocol, type AgentProtocolIdentities, type AgentRecord, type Ap2Party, type Ap2VerifyResult, type ApprovalEvent, type ApprovalEventKit, type ApprovalEventsHandlerOptions, type ApprovalEventsResponse, AstraSync, type AstraSyncAepEvidence, type AstraSyncConfig, type AstraSyncCredentials, AstraSyncError, type AstraSyncMandates, type AttemptOutcome, type AttemptReport, AuthenticationError, type BuildGuidanceParams, CAPTURE_SCHEMA_VERSION, type CallerMetadata, ChallengeHandler, type CheckoutMetadata, type CommerceArtifactsPayload, type CommerceContext, type CommercePipelineInput, type CommerceShieldProps, type ConsiderationItem, type ConsiderationSet, type CounterpartyType, DECLARED_SOURCE_MAX, DEFAULT_EDGE_CONFIG, DEFAULT_IDEMPOTENCY_TTL_MS, type DashboardToolRule, type DynamicPlatformFingerprint, type EdgeConfig, type EdgeMode, type EdgePathRule, type EdgeVerificationDepth, type
|
|
7563
|
+
export { ACP_API_VERSION, ACP_SUPPORTED_API_VERSIONS, AEP_SPEC_VERSION, AP2_VCT, type AcpCheckoutKitOptions, type AcpCheckoutSession, type AcpCheckoutStatus, type AcpCheckoutStore, type AcpWellKnownOptions, type AepActorType, type AepArtifactRecord, type AepArtifactType, AepChain, type AepChainOptions, type AepChainVerification, type AepHashInput, type AgentArtifacts, AgentClient, type AgentCommerce, type AgentCommerceOffer, type AgentCommerceRules, type AgentCredentials, type AgentProduct, type AgentProtocol, type AgentProtocolIdentities, type AgentRecord, type Ap2Party, type Ap2VerifyResult, type ApprovalEvent, type ApprovalEventKit, type ApprovalEventsHandlerOptions, type ApprovalEventsResponse, AstraSync, type AstraSyncAepEvidence, type AstraSyncConfig, type AstraSyncCredentials, AstraSyncError, type AstraSyncMandates, type AttemptOutcome, type AttemptReport, AuthenticationError, type BuildGuidanceParams, CAPTURE_SCHEMA_VERSION, type CallerMetadata, ChallengeHandler, type CheckoutMetadata, type CommerceArtifactsPayload, type CommerceContext, type CommercePipelineInput, type CommerceShieldProps, type ConsiderationItem, type ConsiderationSet, type CounterpartyType, DECLARED_SOURCE_MAX, DEFAULT_EDGE_CONFIG, DEFAULT_IDEMPOTENCY_TTL_MS, type DashboardToolRule, type DynamicPlatformFingerprint, type EdgeConfig, type EdgeMode, type EdgePathRule, type EdgeVerificationDepth, type EnhancedVerificationResult, type ExpressHandlerOptions, type ExpressMiddlewareOptions, type FetchEdgeConfigResult, type FetchEdgeConfigSuccess, type FetchKit, type FiatSettlementBinding, type FrameworkConfig, type FulfilmentInfo, type GatewayConfig, type GuidanceEnvelope, type GuidanceInfo, type HandleApprovalEventsOptions, type HealthResponse, type HttpSignatureAlgorithm, ISSUER_PROGRAM_HEADER, type IdempotencyOptions, type IdempotencyRecord, type IdempotencyStore, KYDRequiredError, type KitExpressRequest, type KitExpressResponse, type KitMessage, type KitReport, type KitRequestContext, type KyaPayIdentity, type KyaPayResult, type KyaPayTokenType, type KyaPayVerifyOptions, type ParseResult as LocalPolicyParseResult, type ValidationError as LocalPolicyValidationError, type ValidationResult as LocalPolicyValidationResult, MAX_HEADERS, MAX_HEADER_VALUE_BYTES, MAX_TOTAL_BYTES, MCP_VERIFIED_HOP_HEADER, MCP_VERIFIED_HOP_MAX_AGE_MS, type McpMiddlewareOptions, MemoryCheckoutStore, MemoryIdempotencyStore, MemoryMppChallengeStore, MemorySeenEvents, type MerchantSettlementToken, type ModelConfig, type MppChallenge, type MppChallengeStore, type MppCredential, type MppReceipt, type MppVerifyOptions, type MppVerifyResult, type NegotiationResult, type NextJsMiddlewareOptions, type ObservedMetadata, type PDLSSConfig$1 as PDLSSConfig, type PDLSSDuration, type PDLSSInfo, type PDLSSLimits, type PDLSSPurpose, type PDLSSScope, type PDLSSSelfInstantiation, PLATFORM_AGENT_SIGNATURES, type PendingRegistrationResponse, type PendingResolution, type PlatformAgentVendor, type PlatformDetectionInput, type PlatformFingerprint, type PlatformSignatureDef, type PollRegistrationResult, type PricingContext, type ProtocolTransport, type PurposeSource, RUNTIME_SIGNATURES, RedisIdempotencyStore, type RedisLike, type RegisterOptions, type RegisterResult, RegistrationDeniedError, RegistrationExpiredError, type RegistrationResponse, RegistrationTimeoutError, type ReportAttemptOptions, type ReportRetryOptions, type ResumeOutcome, type ResumeResult, type RootKeyResolver, type RouteAccessConfig, type RoutePolicy, type RuntimeChallengeResult, type RuntimeSignature, type SDKOptions, SDK_USER_AGENT, type SanitizeHeadersResult, type SeenEvents, type SettlementArtifact, type SettlementArtifactBinding, type SettlementArtifactBindingBase, type SettlementDecision, type SettlementOutcomeInfo, SettlementReportError, type SettlementRequest, type SignHttpRequestOptions, type SignableRequest, type StablecoinSettlementBinding, type StepUpApprovalInfo, type StepUpApprovalStatus, type StepUpOutcome, TRUST_LEVEL_RANGES, type TestEventResult, type TestEventType, type TokenGuidance, type ToolGate, type ToolGateConfig, type TrustLevel, UCP_ORDER_CAPABILITY, UCP_VERSION, type UcpAgentBinding, type CatalogItem as UcpCatalogItem, type UcpCheckoutKitOptions, type CheckoutSession as UcpCheckoutSession, type CheckoutStore as UcpCheckoutStore, type UcpLink, type UcpMessage, type UcpOrder, type UcpProfile, type UcpProfileResult, type SettleResult as UcpSettleResult, type UcpSeverity, type UcpSignatureResult, VERIFICATION_STATUS_HEADER, SDK_VERSION as VERSION, type VerificationInterstitialProps, type VerificationRequest, type VerificationResult, type VerificationWarning, type VerifiedAgent, type VerifiedDeveloper, type VerifiedHopMarker, type VerifiedOrganization, type VerifyAp2Options, type VerifyOptions, type VerifyResponse, type WaitForApprovalOptions, type WellKnownAgenticCommerce, type X402PaymentPayload, type X402PaymentRequired, type X402PaymentRequirements, type X402ResourceInfo, type X402SettlementResponse, _resetEdgeConfigCache, abandonIdempotent, acpPaymentHandlers, aepCanonicalJson, aepHash, aepPrivateKeyFromSeed, aepPublicKeyDocument, aepPublicKeyFromBase64, aepRawPublicKey, aepSign, aepTimestamp, aepVerifySignature, index as agent, approvalEventsHandler, astrasyncPaymentHandlers, authorizeSettlement, awaitStepUpApproval, beginIdempotent, buildAcpWellKnown, buildGuidance, buildMpp402Response, buildMppChallenge, buildSdkObservedMetadata, buildUcpOrder, buildUcpProfile, buildVerificationUnavailableBody, buildX402Challenge, canonicalJson, checkUcpAgentBinding, checkoutHash, clearCache, closedCheckoutMandate, closedPaymentMandate, contentDigest, createAcpCheckoutKit, createAgentCommerce, createKbHop, createMcpMiddleware, createUcpCheckoutKit, decodeMppRequest, degradeToObserve, denyStatusFor, deriveConnectionFromHeaders, detectPlatformFingerprint, detectRuntime, encodeMppReceipt, encodeX402SettlementResponse, express, expressHandler, extractApiKeyFormat, extractCredentials, extractMcpCredentials, extractPlatformHeaders, fetchEdgeConfig, fetchRoutes, fetchUcpProfile, finishIdempotent, fromFeed, getCachedWellKnownUrls, getEdgeConfig, getTrustLevel, getWellKnownUrls, handleApprovalEvents, hasCredentials, idempotencyMiddleware, isEdgeConfig, isRejectedIdentityClaim, isRetryableSettlementError, isSharedVerdict, isSpecialUseIp, isVerificationUnavailable, isVerifiedHopValidFor, issueDelegateSdJwt, issuerOfferPrice, matchEdgePathRule, matchPlatformSignature, matchRoutePattern, mppBodyDigest, negotiateUcp, nextjs, normalizeDeclaredSource, onVerificationResult, openCheckoutMandate, openPaymentMandate, parseFeed, parseYaml as parseLocalPolicyYaml, parseMppCredential, parseUcpAgentHeader, parseVerifiedHop, parseX402Challenge, parseX402Payment, pollStepUpStatus, prefetchWellKnown, priceForAgent, pricingContextFrom, quickVerify, recordDecision, reportAttempt, reportUnregisteredAttempt, requestFingerprint, rootMandateDigest, routePatternToRegExp, routePolicyOf, sanitizeHeaders, sdk, sdkFetch, sendUcpWebhook, serializeVerifiedHop, serveAgentCatalog, setMcpMeta, signHttpRequest, signRootMandate, signUcpRequest, signUcpResponse, index$1 as transport, ucpError, ucpEscalation, ucpFailure, ucpProfileHandler, ucpProfileKeys, ucpRequiredComponents, unavailableRetryAfterSeconds, validatePolicy as validateLocalPolicy, verify, verifyAepChain, verifyAp2Mandate, verifyDelegateChain, verifyKyaPayTokens, verifyMppChallenge, verifyUcpRequest, withIdempotency, x402PaymentMatchesOffer };
|