@agent-cards/sdk 0.23.28 → 0.24.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.
Files changed (97) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/PREFLIGHT.md +7 -1
  3. package/README.md +137 -99
  4. package/dist/aci.d.ts +52 -22
  5. package/dist/aci.js +79 -15
  6. package/dist/adyen-merchant-hosted.generated.d.ts +1 -1
  7. package/dist/adyen-merchant-hosted.generated.js +459 -21
  8. package/dist/agent-amount.generated.js +1 -1
  9. package/dist/agentcard.d.ts +4 -5
  10. package/dist/agentcard.js +4 -5
  11. package/dist/amadeus.d.ts +9 -3
  12. package/dist/amadeus.js +33 -4
  13. package/dist/api-module.d.ts +1 -7
  14. package/dist/api-module.js +3 -5
  15. package/dist/{voice-retry.js → api-retry.js} +1 -1
  16. package/dist/api-types.d.ts +53 -0
  17. package/dist/{voice-types.js → api-types.js} +7 -2
  18. package/dist/approvals.d.ts +166 -0
  19. package/dist/approvals.js +213 -0
  20. package/dist/buy.d.ts +20 -101
  21. package/dist/buy.js +19 -74
  22. package/dist/capabilities.generated.js +1 -1
  23. package/dist/card-fields.generated.js +1398 -106
  24. package/dist/cdp.d.ts +3 -13
  25. package/dist/cdp.js +231 -175
  26. package/dist/client.d.ts +104 -22
  27. package/dist/client.js +215 -40
  28. package/dist/creditguard.generated.d.ts +4 -4
  29. package/dist/datatrans.generated.js +22 -1
  30. package/dist/elavon-converge.generated.js +5 -3
  31. package/dist/hold.d.ts +8 -0
  32. package/dist/hold.js +43 -2
  33. package/dist/hosted-entry.js +2 -0
  34. package/dist/index.d.ts +9 -15
  35. package/dist/index.js +6 -10
  36. package/dist/lifecycle.d.ts +9 -61
  37. package/dist/lifecycle.js +24 -10
  38. package/dist/merchant-card-endpoints.generated.d.ts +6 -1
  39. package/dist/merchant-card-endpoints.generated.js +344 -19
  40. package/dist/merchant-hosted.d.ts +8 -1
  41. package/dist/nike-order.d.ts +51 -0
  42. package/dist/nike-order.js +81 -0
  43. package/dist/oceanpayment.d.ts +38 -0
  44. package/dist/oceanpayment.js +70 -0
  45. package/dist/paddle-tokenex.generated.js +105 -10
  46. package/dist/payplug.d.ts +41 -0
  47. package/dist/payplug.js +71 -0
  48. package/dist/payrails.generated.js +27 -7
  49. package/dist/pre-claim.d.ts +9 -0
  50. package/dist/pre-claim.js +86 -7
  51. package/dist/preflight-capabilities.generated.d.ts +0 -4
  52. package/dist/preflight-capabilities.generated.js +0 -5
  53. package/dist/preflight-catalog.json +46 -5
  54. package/dist/preflight-playwright.d.ts +2 -2
  55. package/dist/preflight-playwright.js +63 -14
  56. package/dist/preflight-schemas.json +4 -0
  57. package/dist/preflight.generated.d.ts +0 -4
  58. package/dist/preflight.generated.js +24 -1
  59. package/dist/prepared-processor.d.ts +18 -5
  60. package/dist/prepared-processor.js +48 -8
  61. package/dist/primer.generated.js +1418 -120
  62. package/dist/processout.generated.d.ts +61 -0
  63. package/dist/processout.generated.js +577 -0
  64. package/dist/requests.js +1 -1
  65. package/dist/shiji-sts.generated.js +105 -10
  66. package/dist/stripe-checkout.generated.js +1405 -234
  67. package/dist/substitutions.generated.js +460 -26
  68. package/dist/tap-payments.generated.js +105 -10
  69. package/dist/twoc2p.generated.js +105 -10
  70. package/dist/url-masks/bluesnap.d.ts +2 -0
  71. package/dist/url-masks/bluesnap.js +15 -0
  72. package/dist/url-masks/oceanpayment.d.ts +2 -0
  73. package/dist/url-masks/oceanpayment.js +13 -0
  74. package/dist/url-masks/payplug.d.ts +2 -0
  75. package/dist/url-masks/payplug.js +13 -0
  76. package/dist/url-masks/vtex_payments.d.ts +2 -0
  77. package/dist/url-masks/vtex_payments.js +12 -0
  78. package/dist/url-masks.generated.d.ts +1 -1
  79. package/dist/url-masks.generated.js +6 -2
  80. package/dist/verifone.generated.js +42 -2
  81. package/dist/vtex-payments.generated.d.ts +127 -0
  82. package/dist/vtex-payments.generated.js +544 -0
  83. package/dist/webhooks.d.ts +2 -2
  84. package/dist/webhooks.js +2 -2
  85. package/examples/preflight/kernel-native/inventory.json +1 -1
  86. package/package.json +6 -8
  87. package/dist/languages.d.ts +0 -23
  88. package/dist/languages.js +0 -76
  89. package/dist/voice-pkce.d.ts +0 -49
  90. package/dist/voice-pkce.js +0 -147
  91. package/dist/voice-stream.generated.d.ts +0 -118
  92. package/dist/voice-stream.generated.js +0 -170
  93. package/dist/voice-types.d.ts +0 -735
  94. package/dist/voice.d.ts +0 -373
  95. package/dist/voice.js +0 -815
  96. package/readme.test.mjs +0 -53
  97. /package/dist/{voice-retry.d.ts → api-retry.d.ts} +0 -0
package/dist/client.d.ts CHANGED
@@ -7,8 +7,8 @@ import { type VerifoneProfile, type VerifoneSubstitutions } from './verifone.js'
7
7
  import { type MerchantSessionCapture } from './merchant-session-probe.js';
8
8
  import { type PaddleTokenexServedFacts } from './paddle-tokenex.js';
9
9
  import type { PaddleCheckoutCapture } from './paddle-checkout-watch.js';
10
- import { VoiceModule, type VoiceOptions } from './voice.js';
11
10
  import { BuyModule } from './buy.js';
11
+ import { ApprovalsModule } from './approvals.js';
12
12
  import { RequestRegistry } from './requests.js';
13
13
  import type { ApiTransport } from './api-module.js';
14
14
  import { type MicroformField, type MicroformSidecar } from './cybersource-flex.js';
@@ -121,6 +121,15 @@ export declare const SUPPORTED_REGISTRY_FEATURES: readonly string[];
121
121
  * recognizer is never in BUILTIN_REGISTRY, so a build reaches it only through a
122
122
  * sync that declares its capability, and whether an org may pay through it
123
123
  * stays the API's decision.
124
+ * `bluesnap_hosted_payment_fields`: BlueSnap's Hosted Payment Fields, whose card
125
+ * number, expiry and code frames each PUT their own field as JSON to the
126
+ * merchant's payment-fields token. This build pauses the card number PUT, holds
127
+ * the expiry and code PUTs and answers them with its answer (aci.ts, the JSON
128
+ * split card), and the cardholder's device sends the whole card in that one PUT
129
+ * (payment-core processors/bluesnap.js). The request names no amount, so the
130
+ * agent's pair, above zero, is the one the cardholder approves. Served on the
131
+ * same terms: only to a build that lists it, for a company Agentcard turned
132
+ * BlueSnap on for.
124
133
  * `creditguard_pps_process`: CreditGuard's hosted payment page (Hyp PPS), whose
125
134
  * card submit this build pays only under a prepared checkout that names the
126
135
  * framed page (prepare({ psp: 'creditguard', environment, paymentPageUrl })). The
@@ -459,6 +468,18 @@ export declare const SUPPORTED_REGISTRY_FEATURES: readonly string[];
459
468
  * page the create names. Served on the same terms: only to a build that lists it, for a company
460
469
  * Agentcard turned Pin Payments on for.
461
470
  *
471
+ * `paymentwall_card_token`: the card request Paymentwall's card form (Brick) sends, from its number
472
+ * frame on pwgateway.com inside Paymentwall's hosted widget or from a merchant's own page: a form POST
473
+ * to https://pwgateway.com/api/token (https://api.paymentwall.com/api/brick/token for a test key)
474
+ * under the merchant's public key. This build pauses only the card form's own body at those exact
475
+ * URLs (payment-core processors/paymentwall.js); a stored card's code, a wallet's token, a brand from
476
+ * the page's select or any other body there fails in the browser before anything is created. The
477
+ * cardholder's device sends the request itself with the real card, and the page gets the token answer
478
+ * payment-core's judge rebuilt. The request names no amount, so the agent's pair, above zero, is the
479
+ * one the cardholder approves, and the API pays only a Paymentwall project payment-core pins for the
480
+ * checkout page the create names. Served on the same terms: only to a build that lists it, for a
481
+ * company Agentcard turned Paymentwall on for.
482
+ *
462
483
  * `sbps_token_jsonp`: SB Payment Service's card token request, the JSONP <script>
463
484
  * GET its token script sends to /token/generateToken on token.sps-system.com. This
464
485
  * build pauses it only as the browser writes it, aborts any other request on that
@@ -475,6 +496,28 @@ export declare const SUPPORTED_REGISTRY_FEATURES: readonly string[];
475
496
  * Served on the same terms, and the API holds the lane to Agentcard's own company
476
497
  * until a reviewed change binds the client key to the merchant.
477
498
  *
499
+ * `iyzico_checkout_form`: the card payment iyzico's Checkout Form posts as one JSON request to
500
+ * api.iyzipay.com/payment/iyzipos/checkoutform/auth/ecom, or initialize3ds/ecom for 3-D Secure
501
+ * (sandbox-api.iyzipay.com in test), under the form's X-IYZI-TOKEN. This build pauses only the
502
+ * form's own payment with a new card at those exact URLs (payment-core processors/iyzico.js); a saved
503
+ * card, a card kept on file, installments and a currency conversion fail in the browser before
504
+ * anything is created. The cardholder's device sends the payment itself, and the page gets iyzico's
505
+ * answer as payment-core's judge rebuilt it: the payment done, or the bank's 3-D Secure page, which
506
+ * the form then runs in the agent's browser. The payment names its price but not its currency, so
507
+ * authorize() needs the agent's pair, and the API holds its amount to the price. Served on the same
508
+ * terms, and the API holds the lane to Agentcard's own company.
509
+ *
510
+ * `usaepay_payment_key`: the card request USAePay's Pay.js card frame sends as one JSON request to
511
+ * www.usaepay.com/api/v2/pub/payment_keys (secure.usaepay.com alike; sandbox.usaepay.com in test), under
512
+ * the merchant's public key in its Authorization. This build pauses only the frame's own card body at
513
+ * that exact URL (payment-core processors/usaepay.js); a Google Pay or Apple Pay token and a bank
514
+ * account on the same URL fail in the browser before anything is created. The cardholder's device sends
515
+ * the card through Agentcard's checkout relay, since USAePay answers no browser origin, and the frame
516
+ * gets USAePay's single-use payment key as payment-core's judge rebuilt it; the merchant's server
517
+ * charges that key afterwards. The request names no amount, so authorize() needs the agent's pair, and
518
+ * the API pays a live key only to a merchant payment-core pins for the checkout page. Served on the same
519
+ * terms, and the API holds the lane to Agentcard's own company.
520
+ *
478
521
  * `tap_card_sdk_token`: the token request Tap Payments' card frame sends to sdk.tap.company, carrying
479
522
  * the card only as one ciphertext the frame writes under the merchant's own RSA key. This build pauses
480
523
  * it and writes over the placeholder's ciphertext the one the cardholder's device wrote under the key
@@ -502,6 +545,16 @@ export declare const SUPPORTED_REGISTRY_FEATURES: readonly string[];
502
545
  * (agent-amount-processors.json), is the one the cardholder approves. Served on the same terms: only
503
546
  * to a build that lists it, for a company Agentcard turned Openpay on for.
504
547
  *
548
+ * `processout_card_token`: the card request ProcessOut.js's card frame sends from js.processout.com to
549
+ * api.processout.com/cards under the store's project id, only through a prepared checkout: the frame
550
+ * gives the page 20 seconds from the shop's continue press, so the cardholder approves before it. The
551
+ * card URL names the project in its query, so the claim binds the request by its project's environment
552
+ * and its shape, never by the prepared URL. The cardholder's device sends the card to ProcessOut itself
553
+ * and the frame gets back ProcessOut's token alone, rebuilt by payment-core's judge. The request names
554
+ * no amount, so the agent's pair, above zero (agent-amount-processors.json), is the one the cardholder
555
+ * approves. Served on the same terms: only to a build that lists it, for a company Agentcard turned
556
+ * ProcessOut on for.
557
+ *
505
558
  * `aps_custom_merchant_page`: Amazon Payment Services' custom merchant page, whose own card form
506
559
  * posts top-level to /FortAPI/paymentPage on checkout.payfort.com (sbcheckout.payfort.com on APS's
507
560
  * sandbox) with service_command=TOKENIZATION. This build pauses that navigation; the cardholder's
@@ -522,6 +575,14 @@ export declare const SUPPORTED_REGISTRY_FEATURES: readonly string[];
522
575
  * the cardholder approves, and the API holds its amount to the body's. Served on the same terms: only to a build
523
576
  * that lists it, for a company Agentcard turned Nexi Checkout on for.
524
577
  *
578
+ * `oceanpayment_hosted_payment_page`: the card post of Oceanpayment's hosted payment page (secure.oceanpayment.com, where
579
+ * Oceanpayment's Shopify redirect app sends the buyer), a native form post to /gateway/sendPay;jsessionid=<session> with
580
+ * the card in clear (test-secure.oceanpayment.com for a test row). This build pauses only that post, exactly as the page's
581
+ * form action writes it, and aborts every other post to Oceanpayment's two hosts (oceanpayment.ts), so the agent's
582
+ * placeholder never reaches Oceanpayment; the cardholder's device writes the real card into the paused post and sends it
583
+ * through the checkout relay. The post names no amount, so the agent's pair, above zero, is the one the cardholder
584
+ * approves. Served on the same terms: only to a build that lists it, for a company Agentcard turned Oceanpayment on for.
585
+ *
525
586
  * `barion_hosted_payment_page`: Barion's Smart Gateway, whose card-free link
526
587
  * (secure.barion.com/Pay?Id=<payment id>, a plain GET the merchant's redirect or script sends
527
588
  * the buyer to) this build pauses for the cardholder's device by its exact link (hosted-entry.ts),
@@ -529,6 +590,14 @@ export declare const SUPPORTED_REGISTRY_FEATURES: readonly string[];
529
590
  * send (pre-claim.ts, barion.ts). Served on the same terms as Przelewy24's: only to a build that
530
591
  * lists it, for a company Agentcard turned Barion on for.
531
592
  *
593
+ * `payplug_hosted_payment_page`: PayPlug's payment page, whose card-free link
594
+ * (secure.payplug.com/pay/<payment id>, or /pay/test/<payment id>, a plain GET the merchant's
595
+ * redirect or script sends the buyer to) this build pauses for the cardholder's device by its exact
596
+ * link (hosted-entry.ts), and whose card post this build never lets the agent's browser send
597
+ * (pre-claim.ts, payplug.ts). The link names no amount, so authorize() asks for the agent's, above
598
+ * zero. Served only to a build that lists it, and the API turns PayPlug on for Agentcard's own
599
+ * company alone.
600
+ *
532
601
  * `paymob_checkout_pay`: the card payment Paymob's own checkout sends, from Unified Checkout
533
602
  * (<country>.checkout.paymob.com) or from the Pixel card frame a merchant's page embeds, as JSON to
534
603
  * https://<accept|uae|ksa|oman>.paymob.com/api/acceptance/payments/pay. This build pauses only the
@@ -789,6 +858,14 @@ export interface CardEndpointReplay extends ExecutionMetadata {
789
858
  body: string;
790
859
  withheld: 'card_in_response' | 'unreadable_in_response' | 'refused_step_in_response' | null;
791
860
  amountAuthority?: AmountAuthority;
861
+ /**
862
+ * The amount the cardholder approved, an integer in the currency's smallest unit with its code, as the API's read
863
+ * names it; absent when it names none. Nike's order after its card is held to it (nike-order.ts).
864
+ */
865
+ approved?: {
866
+ amount: number;
867
+ currency: string;
868
+ };
792
869
  }
793
870
  /**
794
871
  * The device_encrypt flow (Payrails): the cardholder's device encrypted the
@@ -1019,6 +1096,12 @@ export interface AuthorizeInput extends ExecutionMetadata {
1019
1096
  };
1020
1097
  /** Milliseconds from the caller's pay click until the SDK caught the card request, measured on one clock. */
1021
1098
  payToInterceptMs?: number;
1099
+ /**
1100
+ * When the card request paused, in epoch milliseconds on this machine's clock; the adapters fill it. A VTEX Payments
1101
+ * card post, whose checkout gives the post 12 seconds, sends how long ago that was (`paused_ms`), and the API counts
1102
+ * the row's send-by from it.
1103
+ */
1104
+ pausedAt?: number;
1022
1105
  /**
1023
1106
  * WHICH stored card should pay — a vault card id from
1024
1107
  * GET /api/v2/vault_cards. The approval page preselects it (the human can
@@ -1562,13 +1645,6 @@ export interface VaultClientOptions {
1562
1645
  * the error is thrown. Default [500, 1500]; [] disables retries.
1563
1646
  */
1564
1647
  unverifiableRetryDelaysMs?: number[];
1565
- /**
1566
- * The voice module: how this product approves purchases by voice, named
1567
- * once per business, with the Vault return link and the verifier address
1568
- * beside it. Leave it out and the client approves on Agentcard's page
1569
- * (`approval: 'sheet'`). See `VoiceOptions`.
1570
- */
1571
- voice?: VoiceOptions;
1572
1648
  /**
1573
1649
  * Test mode only: run a merchant-hosted checkout against your own Adyen TEST
1574
1650
  * account. Each entry arms your own endpoint as taking the card request of a
@@ -1626,22 +1702,22 @@ export declare class VaultClient {
1626
1702
  * false: a live client.
1627
1703
  */
1628
1704
  get sandbox(): boolean;
1629
- /** What every module shares: the token, the HTTP path, the poll settings and the language list. */
1705
+ /** What every module shares: the token, the HTTP path and the poll settings. */
1630
1706
  protected readonly transport: ApiTransport;
1631
- /**
1632
- * Approve purchases by voice inside your own product: connect a person once,
1633
- * create the purchase, ask for the key word, read the result. Same
1634
- * credentials, same token as the checkout calls. Approves on Agentcard's
1635
- * page unless `voice: { approval: 'in_app' }` was named at construction.
1636
- */
1637
- readonly voice: VoiceModule;
1638
1707
  /**
1639
1708
  * The Purchase API from the same client: ask for a cart on behalf of a
1640
1709
  * person you connected, confirm it by its hash, and name an approval the
1641
- * person already gave by voice so the API places against it and asks for
1642
- * nothing a second time. Same credentials, same token as the voice calls.
1710
+ * person already gave so the API places against it and asks for
1711
+ * nothing a second time. Same credentials, same token as the checkout calls.
1643
1712
  */
1644
1713
  readonly buy: BuyModule;
1714
+ /**
1715
+ * Purchases your server creates for a person, approved on Agentcard's page:
1716
+ * create one (`request: 'sandbox'` under a sandbox client), send the person
1717
+ * its `approval_url`, then read the decision or wait for it. Same
1718
+ * credentials, same token as the checkout calls.
1719
+ */
1720
+ readonly approvals: ApprovalsModule;
1645
1721
  /**
1646
1722
  * The request builders: the processor requests a purchase pauses on, the
1647
1723
  * shipped ones and yours (`requests.register`, `requests.build`).
@@ -1865,9 +1941,9 @@ export declare class VaultClient {
1865
1941
  * exactly the approved payment method (the page's own, or written by the
1866
1942
  * adapters in place of a card the confirm carries again).
1867
1943
  * The API allows a card save for any company, for an approval given on the
1868
- * Vault page, not by voice, with no amount, and a SetupIntent Stripe reports
1869
- * still confirmable on the same Stripe account; any other answer rejects with
1870
- * a CheckoutApiError whose code says why (for example `amount_mismatch`, or
1944
+ * Vault page, with no amount, and a SetupIntent Stripe reports still
1945
+ * confirmable on the same Stripe account; any other answer rejects with a
1946
+ * CheckoutApiError whose code says why (for example `amount_mismatch`, or
1871
1947
  * `continuation_invalid` for a confirm that is not a card-free SetupIntent
1872
1948
  * confirm). Nothing
1873
1949
  * is charged: the adapters continue the page's request once this resolves.
@@ -1983,7 +2059,9 @@ export declare class VaultClient {
1983
2059
  * (Stripe did not answer the read-back) is retried on a short backoff
1984
2060
  * instead of being left to the page's own retry loop, and a 409
1985
2061
  * `amount_mismatch` becomes an AmountMismatchError at stage 'create' so the
1986
- * adapters treat it as an answered request, not a dead page.
2062
+ * adapters treat it as an answered request, not a dead page. `atSend` adds
2063
+ * fields counted as each request leaves, after any token wait, 401 refresh or
2064
+ * backoff, so a field that measures time (VTEX's paused_ms) measures it then.
1987
2065
  */
1988
2066
  private createAuthorization;
1989
2067
  private token;
@@ -2000,9 +2078,13 @@ export declare class VaultClient {
2000
2078
  * Only fetch and a successful response's body read belong to that retry:
2001
2079
  * OAuth, HTTP errors, invalid JSON and every mutation remain outside it.
2002
2080
  * The existing one-time 401 refresh carries the remaining read budget.
2081
+ * `bodyAt`, when given, builds the body as each request leaves, after the
2082
+ * token and on the 401 refresh's resend, in place of `init.body`.
2003
2083
  */
2004
2084
  private call;
2005
2085
  private post;
2086
+ /** A POST whose body is built as each request leaves (call's `bodyAt`), for a body that counts time. */
2087
+ private postAtSend;
2006
2088
  private get;
2007
2089
  private readPreparation;
2008
2090
  }