@vivoa/plugin-sdk 0.6.7 → 0.6.9

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.
@@ -442,6 +442,8 @@ interface PaymentCard {
442
442
  interface PaymentCustomer {
443
443
  email: string;
444
444
  phone: string;
445
+ /** OPTIONAL full name of the payer, for gateways that display or require it. */
446
+ name?: string;
445
447
  address?: string;
446
448
  city?: string;
447
449
  state?: string;
@@ -478,6 +480,23 @@ interface PaymentResult {
478
480
  * - `embed` gateway-owned iframe initialised via `createPaymentSession`.
479
481
  */
480
482
  type PaymentRenderMode = 'card-in' | 'offsite-redirect' | 'embed';
483
+ /**
484
+ * Fee model a gateway charges the MERCHANT, declared statically so the host can
485
+ * project the fee before any charge exists (checkout preview, settlement
486
+ * breakdown). The fee is computed on the GROSS amount charged to the shopper.
487
+ */
488
+ interface GatewayFeeConfig {
489
+ /** Default merchant rate as a FRACTION of the gross (0.038 === 3.8%). */
490
+ defaultRate: number;
491
+ /** True when the rate already includes tax (IVA): no tax is added on top. */
492
+ ivaInclusive: boolean;
493
+ /**
494
+ * Where the rate comes from. `reported`: the gateway reports the effective
495
+ * rate per charge (webhook / pricing endpoint), so `defaultRate` is only a
496
+ * fallback. `contract`: a fixed contractual rate the gateway never reports.
497
+ */
498
+ source: 'reported' | 'contract';
499
+ }
481
500
  interface GatewayStaticConfig {
482
501
  code: PaymentGatewayCode;
483
502
  displayName: string;
@@ -490,6 +509,16 @@ interface GatewayStaticConfig {
490
509
  * Back-compat: existing card-in plugins (Wompi/Serfinsa) omit this field.
491
510
  */
492
511
  renderMode?: PaymentRenderMode;
512
+ /**
513
+ * OPTIONAL merchant fee model (see {@link GatewayFeeConfig}). Absent ⇒ the host
514
+ * assumes the gateway fee is unknown and shows no fee projection.
515
+ */
516
+ fees?: GatewayFeeConfig;
517
+ /**
518
+ * OPTIONAL ISO-4217 currencies the gateway can charge. Absent ⇒ the host does
519
+ * not restrict by currency.
520
+ */
521
+ supportedCurrencies?: string[];
493
522
  }
494
523
  /**
495
524
  * Cardless payload for creating a gateway-hosted payment session (INV-1).
@@ -532,6 +561,70 @@ interface PaymentSessionResult {
532
561
  renderMode: PaymentRenderMode;
533
562
  embedInit?: EmbedInit;
534
563
  redirectUrl?: string;
564
+ /**
565
+ * OPTIONAL merchant-fee PREVIEW the gateway computed when sealing the
566
+ * session. Informational: the settled fee arrives with the webhook
567
+ * ({@link PaymentWebhookSettlement.fees}).
568
+ */
569
+ fees?: PaymentSessionFees;
570
+ }
571
+ /**
572
+ * Merchant-fee preview attached to a created payment session. Amounts are in
573
+ * DECIMAL major units of `currency`; `rate` is a FRACTION.
574
+ */
575
+ interface PaymentSessionFees {
576
+ rate: number;
577
+ /** Free-form origin of the rate (e.g. `merchant`, `default`). */
578
+ rateSource?: string;
579
+ feeAmount: number;
580
+ netAmount: number;
581
+ currency: string;
582
+ }
583
+ /**
584
+ * Fee breakdown a gateway reports for a SETTLED charge. `feeAmount` is taken on
585
+ * the gross `amount`; `netAmount = amount - feeAmount`. Amounts are DECIMAL
586
+ * major units of `currency`; `rate` is a FRACTION.
587
+ */
588
+ interface PaymentSettlementFees {
589
+ feeAmount: number;
590
+ rate: number;
591
+ netAmount: number;
592
+ /** True when `feeAmount` already includes tax (IVA). */
593
+ ivaIncluded: boolean;
594
+ currency: string;
595
+ }
596
+ /**
597
+ * Final outcome of a charge as read from a gateway webhook, normalised by the
598
+ * plugin so the host settles every gateway through one path. Only terminal
599
+ * outcomes are expressed: intermediate events are not settlements.
600
+ */
601
+ interface PaymentWebhookSettlement {
602
+ /** Merchant reference the charge was created with (host correlation key). */
603
+ reference: string;
604
+ status: 'approved' | 'declined';
605
+ /** Gross amount charged, DECIMAL major units of `currency`. */
606
+ amount: number;
607
+ currency: string;
608
+ gatewayTransactionId: string;
609
+ /** Gateway-side transaction id, when distinct from `gatewayTransactionId`. */
610
+ transactionId?: string;
611
+ /** Gateway event id, stable across redeliveries (idempotency key). */
612
+ eventId?: string;
613
+ authorizationCode?: string;
614
+ /** Merchant fee breakdown, only when the gateway reports it. */
615
+ fees?: PaymentSettlementFees;
616
+ }
617
+ /**
618
+ * Merchant-specific pricing a gateway exposes, so the host can refresh its
619
+ * cached fee projection. `rate` is a FRACTION of the gross charged.
620
+ */
621
+ interface PaymentMerchantPricing {
622
+ rate: number;
623
+ /** Free-form origin of the rate (e.g. `merchant`, `default`). */
624
+ rateSource: string;
625
+ /** Free-form fee model identifier (e.g. `flat_gross_iva_included`). */
626
+ model: string;
627
+ currency: string;
535
628
  }
536
629
  interface PaymentPluginConfig {
537
630
  configSchema: PluginConfigField[];
@@ -540,6 +633,40 @@ interface WebhookSignatureResult {
540
633
  isValid: boolean;
541
634
  error?: string;
542
635
  }
636
+ /**
637
+ * "Connect" handshake (authorization code + PKCE) a gateway can offer so a
638
+ * merchant links their account with one click instead of pasting credentials.
639
+ * The HOST owns state, code_verifier and the callback route; the plugin only
640
+ * knows the gateway's URLs and wire format. STATELESS like every other verb.
641
+ */
642
+ interface PaymentConnectParams {
643
+ /** Opaque anti-CSRF value; echoed back on the callback. */
644
+ state: string;
645
+ /** base64url(SHA-256(code_verifier)) — S256. */
646
+ codeChallenge: string;
647
+ /** Host callback the gateway redirects the merchant to (`?code&state`). */
648
+ redirectUri: string;
649
+ /** Host webhook endpoint for this gateway, to register on the gateway side. */
650
+ webhookUrl: string;
651
+ /** Store origin (https://host) — the only origin the gateway may wire to. */
652
+ origin: string;
653
+ /** Store display name, shown on the gateway's consent screen. */
654
+ storeName: string;
655
+ }
656
+ interface PaymentConnectExchange {
657
+ code: string;
658
+ codeVerifier: string;
659
+ redirectUri: string;
660
+ }
661
+ interface PaymentConnect {
662
+ /** Where to send the merchant to log in and approve the store. */
663
+ authorizeUrl(params: PaymentConnectParams, ctx: DispatchContext): string;
664
+ /**
665
+ * Redeem the authorization code. Returns a CONFIG PATCH (credentials etc.)
666
+ * the host persists exactly like an admin save.
667
+ */
668
+ exchange(params: PaymentConnectExchange, ctx: DispatchContext): Promise<Record<string, unknown>>;
669
+ }
543
670
  interface IPaymentPlugin extends IPlugin {
544
671
  readonly gatewayCode: PaymentGatewayCode;
545
672
  readonly staticConfig: GatewayStaticConfig;
@@ -548,6 +675,20 @@ interface IPaymentPlugin extends IPlugin {
548
675
  verifyTransaction?(payload: PaymentVerifyPayload, ctx: DispatchContext): Promise<PaymentResult>;
549
676
  validateWebhookSignature?(rawBody: string | Buffer, headers: Record<string, string>, ctx: DispatchContext): WebhookSignatureResult;
550
677
  processWebhook?(payload: unknown, ctx: DispatchContext): Promise<void>;
678
+ /**
679
+ * Normalise a webhook payload into a {@link PaymentWebhookSettlement}.
680
+ * OPTIONAL — a plugin that omits it keeps the host's legacy webhook parsing.
681
+ * Called by the host only AFTER `validateWebhookSignature` passed. PURE and
682
+ * synchronous: no I/O, no state. Throw on a payload that cannot be read as a
683
+ * terminal charge outcome; the host validates whatever it returns.
684
+ */
685
+ parseWebhookSettlement?(payload: unknown, ctx: DispatchContext): PaymentWebhookSettlement;
686
+ /**
687
+ * Merchant-specific pricing for the account in `ctx.config`. OPTIONAL — used
688
+ * by the host to refresh its cached fee projection. Resolve `null` when the
689
+ * gateway exposes no per-merchant pricing or it is unavailable right now.
690
+ */
691
+ getMerchantPricing?(ctx: DispatchContext): Promise<PaymentMerchantPricing | null>;
551
692
  /**
552
693
  * Query the gateway for the current status of a previously attempted charge.
553
694
  * Called by the host when `processPayment` returns `status: Error` with a
@@ -564,6 +705,8 @@ interface IPaymentPlugin extends IPlugin {
564
705
  * call via `ctx.config` (INV-4); no card data is ever passed here (INV-1).
565
706
  */
566
707
  createPaymentSession?(payload: PaymentSessionPayload, ctx: DispatchContext): Promise<PaymentSessionResult>;
708
+ /** OPTIONAL one-click account linking (see {@link PaymentConnect}). */
709
+ readonly connect?: PaymentConnect;
567
710
  }
568
711
 
569
712
  declare enum ShippingFeature {
@@ -670,6 +813,32 @@ interface CreateShipmentParams {
670
813
  courierId?: string;
671
814
  serviceLevelToken?: string;
672
815
  }
816
+ /**
817
+ * How the carrier moves money on a shipment:
818
+ * - `normal` → nothing collected; the merchant is billed the shipping.
819
+ * - `cod` → the carrier collects from the recipient and settles to the merchant.
820
+ * - `collect` → the recipient pays only the shipping; nothing settles to the merchant.
821
+ */
822
+ type CarrierServiceMode = 'normal' | 'cod' | 'collect';
823
+ /**
824
+ * What the carrier ACTUALLY settles for a shipment, in the order currency —
825
+ * the carrier's truth, which the host shows next to what it quoted. Each
826
+ * shipping plugin translates its own provider fields into this; the host never
827
+ * reads `rawResponse`.
828
+ */
829
+ interface CarrierSettlement {
830
+ mode: CarrierServiceMode;
831
+ /** Cash the carrier collects from the recipient. */
832
+ collected: number;
833
+ /** Commission the carrier charges the merchant for collecting. */
834
+ commission: number;
835
+ /** That commission as a percent of `collected` (3 = 3%), when known. */
836
+ commissionRate?: number;
837
+ /** Shipping deducted from the settlement (0 when billed apart). */
838
+ shippingDeducted: number;
839
+ /** What the merchant receives for this shipment. */
840
+ merchantNet: number;
841
+ }
673
842
  interface ShipmentResult {
674
843
  externalId: string;
675
844
  trackingNumber: string;
@@ -679,6 +848,8 @@ interface ShipmentResult {
679
848
  courierName: string;
680
849
  status: string;
681
850
  rawResponse?: Record<string, unknown>;
851
+ /** The carrier's settlement, when the provider reports it at creation. */
852
+ settlement?: CarrierSettlement;
682
853
  }
683
854
  /**
684
855
  * Normalized, carrier-agnostic shipment status event produced by
@@ -756,9 +927,16 @@ interface SuppliersStaticConfig {
756
927
  }
757
928
  interface SupplierCatalogQuery {
758
929
  text?: string;
930
+ /** ISO-3166-1 alpha-2. A driver that cannot serve it returns an empty page. */
759
931
  country?: string;
760
932
  cursor?: string;
761
933
  limit?: number;
934
+ /** Wholesale price floor, minor units (inclusive). */
935
+ minPriceMinor?: number;
936
+ /** Wholesale price ceiling, minor units (inclusive). */
937
+ maxPriceMinor?: number;
938
+ /** Only listings the supplier reports as in stock. */
939
+ inStockOnly?: boolean;
762
940
  }
763
941
  interface SupplierListingVariant {
764
942
  externalVariantId: string;
@@ -797,12 +975,16 @@ interface SupplierListing {
797
975
  hasVariants: boolean;
798
976
  variants?: SupplierListingVariant[];
799
977
  moq?: number | null;
978
+ /** Display name of the vendor behind the listing (a marketplace may host many). */
979
+ vendorName?: string | null;
800
980
  /** Untouched supplier payload, for diagnostics. Never trusted for control flow. */
801
981
  raw?: unknown;
802
982
  }
803
983
  interface SupplierListingPage {
804
984
  items: SupplierListing[];
805
985
  nextCursor?: string | null;
986
+ /** Total listings matching the query across all pages, when the supplier reports it. */
987
+ total?: number | null;
806
988
  }
807
989
  interface SupplierOrderCustomer {
808
990
  name: string;
@@ -916,11 +1098,19 @@ declare enum AnalyticsFeature {
916
1098
  /**
917
1099
  * ISO-4217 money in minor units — mirrors the store's Money VO so the host maps
918
1100
  * 1:1 without a currency guess. Kept local so the SDK stays dependency-free.
1101
+ * The exponent is the currency's own (USD 2, CLP/JPY 0, KWD 3): encode with
1102
+ * {@link toMinorUnits}, decode with {@link toMajorUnits}, never a fixed ×100.
919
1103
  */
920
1104
  interface AnalyticsMoney {
921
1105
  amountMinor: number;
922
1106
  currency: string;
923
1107
  }
1108
+ /** ISO-4217 minor-unit exponent (USD 2, JPY 0, KWD 3); unknown → 2. */
1109
+ declare function minorUnitDigits(currency: string): number;
1110
+ /** A major-unit amount (e.g. `25.5` USD) as {@link AnalyticsMoney}. */
1111
+ declare function toMinorUnits(major: number, currency: string): AnalyticsMoney;
1112
+ /** The major-unit decimal of {@link AnalyticsMoney} (e.g. `2550` USD → `25.5`). */
1113
+ declare function toMajorUnits(money: AnalyticsMoney): number;
924
1114
  /** A single line item attached to an ecommerce event. */
925
1115
  interface AnalyticsItem {
926
1116
  /** Product id as the store knows it (Meta `content_ids`, GA4 `item_id`). */
@@ -940,7 +1130,25 @@ interface AnalyticsItem {
940
1130
  * only ever maps a domain event to one of these. An adapter that does not care
941
1131
  * about a given name simply ignores it.
942
1132
  */
943
- type AnalyticsEventName = 'page_view' | 'view_item' | 'add_to_cart' | 'remove_from_cart' | 'begin_checkout' | 'purchase';
1133
+ type AnalyticsEventName = 'page_view' | 'view_item' | 'add_to_cart' | 'remove_from_cart' | 'begin_checkout' | 'purchase' | 'order_placed';
1134
+ /**
1135
+ * When a cash-on-delivery order counts as a `purchase` for an adapter:
1136
+ * - `collected` — when the cash is collected (carrier delivery or staff
1137
+ * marking it paid). Highest signal quality; the default.
1138
+ * - `confirmed` — when staff confirms the order (e.g. after a confirmation
1139
+ * call). Faster learning and inside the ad platform's dedup/attribution
1140
+ * windows, at the cost of counting confirmed orders the shopper refuses.
1141
+ * Prepaid orders always convert when the gateway approves the payment.
1142
+ */
1143
+ type CodPurchaseTrigger = 'collected' | 'confirmed';
1144
+ /**
1145
+ * Per-store settlement policy the HOST reads from an analytics adapter's own
1146
+ * config (`DispatchContext.config`). An adapter opts in by declaring a config
1147
+ * field with this exact key; one that declares none gets the defaults.
1148
+ */
1149
+ interface AnalyticsPurchasePolicy {
1150
+ codPurchaseTrigger?: CodPurchaseTrigger;
1151
+ }
944
1152
  /**
945
1153
  * Where the action physically happened. Maps to Meta `action_source`; other
946
1154
  * providers ignore it. Defaults to `website` when the host omits it.
@@ -968,7 +1176,11 @@ interface AnalyticsUserData {
968
1176
  genderSha256?: string | null;
969
1177
  /** Date of birth, YYYYMMDD normalized then SHA256. */
970
1178
  dobSha256?: string | null;
971
- /** Store customer/user id — Meta `external_id` (not hashed by spec). */
1179
+ /**
1180
+ * Pseudonymous shopper id (user, else guest) — Meta `external_id`. Arrives
1181
+ * PLAIN: it is not PII. An adapter whose provider wants it hashed (Meta, to
1182
+ * meet the browser pixel) hashes it itself.
1183
+ */
972
1184
  externalId?: string | null;
973
1185
  /** Plain IPv4/IPv6 — never hashed (geo match). */
974
1186
  clientIpAddress?: string | null;
@@ -1530,4 +1742,4 @@ interface HostApi {
1530
1742
  registerCapability<T = unknown>(cap: Capability<T>): void;
1531
1743
  }
1532
1744
 
1533
- export { type HttpClient as $, AUTHOR_HANDLE_RE as A, type BannerBlock$1 as B, ConfigScope as C, type ConditionalBlock as D, type ConditionalEquals as E, FieldType as F, type ConditionalWhen as G, type ConfigurablePlugin as H, ContentActionVariant as I, type ContentBlock as J, ContentBlockType as K, type CopyFieldBlock$1 as L, type CreateShipmentParams as M, type DispatchContext as N, type DividerBlock$1 as O, type PluginConfigField as P, type DomainEventHandler as Q, type DomainEventName as R, type SelectOption as S, type EmbedInit as T, type FieldBlock as U, type FieldOption as V, FieldVariant as W, GatewayEnvironment as X, type GatewayStaticConfig as Y, type GroupBlock as Z, type HostApi as _, type AccordionBlock as a, StepStatusFrom as a$, type HttpRequest as a0, type HttpResponse as a1, type IAnalyticsPlugin as a2, type IInvoicingPlugin as a3, type IPaymentPlugin as a4, type IPlugin as a5, type IShippingPlugin as a6, type ISuppliersPlugin as a7, type IUiPlugin as a8, type InlineRowBlock as a9, type PaymentSessionResult as aA, type PaymentVerifyPayload as aB, type PlaceSupplierOrderInput as aC, type Plugin as aD, type PluginActionContext as aE, type PluginActionResult as aF, type PluginAuthor as aG, type PluginConfigFieldDependency as aH, type PluginFactory as aI, type PluginManifest as aJ, type RepeaterBlock as aK, RepeaterSource as aL, type SecretStore as aM, type SequenceStore as aN, type SetupAction as aO, type SetupLayout as aP, type SetupLayoutValidation as aQ, type SetupStep as aR, type ShipmentAddress as aS, type ShipmentParcel as aT, type ShipmentResult as aU, type ShippingDefaultConfig as aV, ShippingFeature as aW, type ShippingPluginConfig as aX, type ShippingQuote as aY, type ShippingQuoteParams as aZ, type ShippingStaticConfig as a_, InvoiceDocumentType as aa, type InvoiceLine as ab, type InvoiceMoney as ac, type InvoiceParty as ad, type InvoiceRequest as ae, type InvoiceResult as af, InvoiceStatus as ag, type InvoiceTax as ah, type InvoicingDefaultConfig as ai, InvoicingFeature as aj, type InvoicingPluginConfig as ak, type InvoicingStaticConfig as al, type KeyValueBlock$1 as am, type KeyValueRow$1 as an, LayoutMode as ao, type Logger as ap, type MarkdownBlock as aq, MessageVariant as ar, type PaymentCard as as, type PaymentCustomer as at, type PaymentGatewayCode as au, type PaymentPayload as av, type PaymentPluginConfig as aw, type PaymentRenderMode as ax, type PaymentResult as ay, type PaymentSessionPayload as az, type AccordionSection as b, type StepStatusFromAction as b0, type StepStatusFromFields as b1, type StepStatusSource as b2, type StorageBroker as b3, type SupplierCatalogQuery as b4, type SupplierFulfillmentEvent as b5, type SupplierListing as b6, type SupplierListingAttribute as b7, type SupplierListingPage as b8, type SupplierListingVariant as b9, isConfigurablePlugin as bA, isPluginFactory as bB, paymentCapability as bC, shippingCapability as bD, suppliersCapability as bE, uiCapability as bF, validatePluginAuthor as bG, validateSetupLayout as bH, validateUiContributions as bI, type SupplierMoney as ba, type SupplierOrderAddressLevel as bb, type SupplierOrderCustomer as bc, type SupplierOrderLine as bd, type SupplierOrderResult as be, type SupplierOrderStatus as bf, type SupplierShipTo as bg, type SupplierStock as bh, type SuppliersDefaultConfig as bi, SuppliersFeature as bj, type SuppliersPluginConfig as bk, type SuppliersStaticConfig as bl, type TabItem as bm, type TabsBlock as bn, type ToggleBlock as bo, type TrackingEvent as bp, TransactionStatus as bq, type UiContribution as br, type UiContributionsValidation as bs, type VoidInvoiceInput as bt, type WebhookSignatureResult as bu, analyticsCapability as bv, capability as bw, crossValidateSetupLayout as bx, definePlugin as by, invoicingCapability as bz, type ActionBlock$1 as c, ActionVariant as d, type AnalyticsActionSource as e, type AnalyticsConsent as f, type AnalyticsEvent as g, type AnalyticsEventName as h, AnalyticsFeature as i, type AnalyticsItem as j, type AnalyticsMoney as k, type AnalyticsPluginConfig as l, type AnalyticsStaticConfig as m, type AnalyticsUserData as n, type AnalyticsUtm as o, type AuthorValidation as p, type Block as q, type BlockBase as r, BlockType as s, type CalloutBlock as t, type Capability as u, CapabilityKind as v, type CardBlock$1 as w, type CodConfig as x, type CodFeeConfig as y, CodFeeType as z };
1745
+ export { GatewayEnvironment as $, AUTHOR_HANDLE_RE as A, type BannerBlock$1 as B, ConfigScope as C, type CodConfig as D, type CodFeeConfig as E, FieldType as F, CodFeeType as G, type CodPurchaseTrigger as H, type ConditionalBlock as I, type ConditionalEquals as J, type ConditionalWhen as K, type ConfigurablePlugin as L, ContentActionVariant as M, type ContentBlock as N, ContentBlockType as O, type PluginConfigField as P, type CopyFieldBlock$1 as Q, type CreateShipmentParams as R, type SelectOption as S, type DispatchContext as T, type DividerBlock$1 as U, type DomainEventHandler as V, type DomainEventName as W, type EmbedInit as X, type FieldBlock as Y, type FieldOption as Z, FieldVariant as _, type AccordionBlock as a, type SetupLayout as a$, type GatewayFeeConfig as a0, type GatewayStaticConfig as a1, type GroupBlock as a2, type HostApi as a3, type HttpClient as a4, type HttpRequest as a5, type HttpResponse as a6, type IAnalyticsPlugin as a7, type IInvoicingPlugin as a8, type IPaymentPlugin as a9, type PaymentConnectParams as aA, type PaymentCustomer as aB, type PaymentGatewayCode as aC, type PaymentMerchantPricing as aD, type PaymentPayload as aE, type PaymentPluginConfig as aF, type PaymentRenderMode as aG, type PaymentResult as aH, type PaymentSessionFees as aI, type PaymentSessionPayload as aJ, type PaymentSessionResult as aK, type PaymentSettlementFees as aL, type PaymentVerifyPayload as aM, type PaymentWebhookSettlement as aN, type PlaceSupplierOrderInput as aO, type Plugin as aP, type PluginActionContext as aQ, type PluginActionResult as aR, type PluginAuthor as aS, type PluginConfigFieldDependency as aT, type PluginFactory as aU, type PluginManifest as aV, type RepeaterBlock as aW, RepeaterSource as aX, type SecretStore as aY, type SequenceStore as aZ, type SetupAction as a_, type IPlugin as aa, type IShippingPlugin as ab, type ISuppliersPlugin as ac, type IUiPlugin as ad, type InlineRowBlock as ae, InvoiceDocumentType as af, type InvoiceLine as ag, type InvoiceMoney as ah, type InvoiceParty as ai, type InvoiceRequest as aj, type InvoiceResult as ak, InvoiceStatus as al, type InvoiceTax as am, type InvoicingDefaultConfig as an, InvoicingFeature as ao, type InvoicingPluginConfig as ap, type InvoicingStaticConfig as aq, type KeyValueBlock$1 as ar, type KeyValueRow$1 as as, LayoutMode as at, type Logger as au, type MarkdownBlock as av, MessageVariant as aw, type PaymentCard as ax, type PaymentConnect as ay, type PaymentConnectExchange as az, type AccordionSection as b, type SetupLayoutValidation as b0, type SetupStep as b1, type ShipmentAddress as b2, type ShipmentParcel as b3, type ShipmentResult as b4, type ShippingDefaultConfig as b5, ShippingFeature as b6, type ShippingPluginConfig as b7, type ShippingQuote as b8, type ShippingQuoteParams as b9, type ToggleBlock as bA, type TrackingEvent as bB, TransactionStatus as bC, type UiContribution as bD, type UiContributionsValidation as bE, type VoidInvoiceInput as bF, type WebhookSignatureResult as bG, analyticsCapability as bH, capability as bI, crossValidateSetupLayout as bJ, definePlugin as bK, invoicingCapability as bL, isConfigurablePlugin as bM, isPluginFactory as bN, minorUnitDigits as bO, paymentCapability as bP, shippingCapability as bQ, suppliersCapability as bR, toMajorUnits as bS, toMinorUnits as bT, uiCapability as bU, validatePluginAuthor as bV, validateSetupLayout as bW, validateUiContributions as bX, type ShippingStaticConfig as ba, StepStatusFrom as bb, type StepStatusFromAction as bc, type StepStatusFromFields as bd, type StepStatusSource as be, type StorageBroker as bf, type SupplierCatalogQuery as bg, type SupplierFulfillmentEvent as bh, type SupplierListing as bi, type SupplierListingAttribute as bj, type SupplierListingPage as bk, type SupplierListingVariant as bl, type SupplierMoney as bm, type SupplierOrderAddressLevel as bn, type SupplierOrderCustomer as bo, type SupplierOrderLine as bp, type SupplierOrderResult as bq, type SupplierOrderStatus as br, type SupplierShipTo as bs, type SupplierStock as bt, type SuppliersDefaultConfig as bu, SuppliersFeature as bv, type SuppliersPluginConfig as bw, type SuppliersStaticConfig as bx, type TabItem as by, type TabsBlock as bz, type ActionBlock$1 as c, ActionVariant as d, type AnalyticsActionSource as e, type AnalyticsConsent as f, type AnalyticsEvent as g, type AnalyticsEventName as h, AnalyticsFeature as i, type AnalyticsItem as j, type AnalyticsMoney as k, type AnalyticsPluginConfig as l, type AnalyticsPurchasePolicy as m, type AnalyticsStaticConfig as n, type AnalyticsUserData as o, type AnalyticsUtm as p, type AuthorValidation as q, type Block as r, type BlockBase as s, BlockType as t, type CalloutBlock as u, type Capability as v, CapabilityKind as w, type CardBlock$1 as x, type CarrierServiceMode as y, type CarrierSettlement as z };
@@ -442,6 +442,8 @@ interface PaymentCard {
442
442
  interface PaymentCustomer {
443
443
  email: string;
444
444
  phone: string;
445
+ /** OPTIONAL full name of the payer, for gateways that display or require it. */
446
+ name?: string;
445
447
  address?: string;
446
448
  city?: string;
447
449
  state?: string;
@@ -478,6 +480,23 @@ interface PaymentResult {
478
480
  * - `embed` gateway-owned iframe initialised via `createPaymentSession`.
479
481
  */
480
482
  type PaymentRenderMode = 'card-in' | 'offsite-redirect' | 'embed';
483
+ /**
484
+ * Fee model a gateway charges the MERCHANT, declared statically so the host can
485
+ * project the fee before any charge exists (checkout preview, settlement
486
+ * breakdown). The fee is computed on the GROSS amount charged to the shopper.
487
+ */
488
+ interface GatewayFeeConfig {
489
+ /** Default merchant rate as a FRACTION of the gross (0.038 === 3.8%). */
490
+ defaultRate: number;
491
+ /** True when the rate already includes tax (IVA): no tax is added on top. */
492
+ ivaInclusive: boolean;
493
+ /**
494
+ * Where the rate comes from. `reported`: the gateway reports the effective
495
+ * rate per charge (webhook / pricing endpoint), so `defaultRate` is only a
496
+ * fallback. `contract`: a fixed contractual rate the gateway never reports.
497
+ */
498
+ source: 'reported' | 'contract';
499
+ }
481
500
  interface GatewayStaticConfig {
482
501
  code: PaymentGatewayCode;
483
502
  displayName: string;
@@ -490,6 +509,16 @@ interface GatewayStaticConfig {
490
509
  * Back-compat: existing card-in plugins (Wompi/Serfinsa) omit this field.
491
510
  */
492
511
  renderMode?: PaymentRenderMode;
512
+ /**
513
+ * OPTIONAL merchant fee model (see {@link GatewayFeeConfig}). Absent ⇒ the host
514
+ * assumes the gateway fee is unknown and shows no fee projection.
515
+ */
516
+ fees?: GatewayFeeConfig;
517
+ /**
518
+ * OPTIONAL ISO-4217 currencies the gateway can charge. Absent ⇒ the host does
519
+ * not restrict by currency.
520
+ */
521
+ supportedCurrencies?: string[];
493
522
  }
494
523
  /**
495
524
  * Cardless payload for creating a gateway-hosted payment session (INV-1).
@@ -532,6 +561,70 @@ interface PaymentSessionResult {
532
561
  renderMode: PaymentRenderMode;
533
562
  embedInit?: EmbedInit;
534
563
  redirectUrl?: string;
564
+ /**
565
+ * OPTIONAL merchant-fee PREVIEW the gateway computed when sealing the
566
+ * session. Informational: the settled fee arrives with the webhook
567
+ * ({@link PaymentWebhookSettlement.fees}).
568
+ */
569
+ fees?: PaymentSessionFees;
570
+ }
571
+ /**
572
+ * Merchant-fee preview attached to a created payment session. Amounts are in
573
+ * DECIMAL major units of `currency`; `rate` is a FRACTION.
574
+ */
575
+ interface PaymentSessionFees {
576
+ rate: number;
577
+ /** Free-form origin of the rate (e.g. `merchant`, `default`). */
578
+ rateSource?: string;
579
+ feeAmount: number;
580
+ netAmount: number;
581
+ currency: string;
582
+ }
583
+ /**
584
+ * Fee breakdown a gateway reports for a SETTLED charge. `feeAmount` is taken on
585
+ * the gross `amount`; `netAmount = amount - feeAmount`. Amounts are DECIMAL
586
+ * major units of `currency`; `rate` is a FRACTION.
587
+ */
588
+ interface PaymentSettlementFees {
589
+ feeAmount: number;
590
+ rate: number;
591
+ netAmount: number;
592
+ /** True when `feeAmount` already includes tax (IVA). */
593
+ ivaIncluded: boolean;
594
+ currency: string;
595
+ }
596
+ /**
597
+ * Final outcome of a charge as read from a gateway webhook, normalised by the
598
+ * plugin so the host settles every gateway through one path. Only terminal
599
+ * outcomes are expressed: intermediate events are not settlements.
600
+ */
601
+ interface PaymentWebhookSettlement {
602
+ /** Merchant reference the charge was created with (host correlation key). */
603
+ reference: string;
604
+ status: 'approved' | 'declined';
605
+ /** Gross amount charged, DECIMAL major units of `currency`. */
606
+ amount: number;
607
+ currency: string;
608
+ gatewayTransactionId: string;
609
+ /** Gateway-side transaction id, when distinct from `gatewayTransactionId`. */
610
+ transactionId?: string;
611
+ /** Gateway event id, stable across redeliveries (idempotency key). */
612
+ eventId?: string;
613
+ authorizationCode?: string;
614
+ /** Merchant fee breakdown, only when the gateway reports it. */
615
+ fees?: PaymentSettlementFees;
616
+ }
617
+ /**
618
+ * Merchant-specific pricing a gateway exposes, so the host can refresh its
619
+ * cached fee projection. `rate` is a FRACTION of the gross charged.
620
+ */
621
+ interface PaymentMerchantPricing {
622
+ rate: number;
623
+ /** Free-form origin of the rate (e.g. `merchant`, `default`). */
624
+ rateSource: string;
625
+ /** Free-form fee model identifier (e.g. `flat_gross_iva_included`). */
626
+ model: string;
627
+ currency: string;
535
628
  }
536
629
  interface PaymentPluginConfig {
537
630
  configSchema: PluginConfigField[];
@@ -540,6 +633,40 @@ interface WebhookSignatureResult {
540
633
  isValid: boolean;
541
634
  error?: string;
542
635
  }
636
+ /**
637
+ * "Connect" handshake (authorization code + PKCE) a gateway can offer so a
638
+ * merchant links their account with one click instead of pasting credentials.
639
+ * The HOST owns state, code_verifier and the callback route; the plugin only
640
+ * knows the gateway's URLs and wire format. STATELESS like every other verb.
641
+ */
642
+ interface PaymentConnectParams {
643
+ /** Opaque anti-CSRF value; echoed back on the callback. */
644
+ state: string;
645
+ /** base64url(SHA-256(code_verifier)) — S256. */
646
+ codeChallenge: string;
647
+ /** Host callback the gateway redirects the merchant to (`?code&state`). */
648
+ redirectUri: string;
649
+ /** Host webhook endpoint for this gateway, to register on the gateway side. */
650
+ webhookUrl: string;
651
+ /** Store origin (https://host) — the only origin the gateway may wire to. */
652
+ origin: string;
653
+ /** Store display name, shown on the gateway's consent screen. */
654
+ storeName: string;
655
+ }
656
+ interface PaymentConnectExchange {
657
+ code: string;
658
+ codeVerifier: string;
659
+ redirectUri: string;
660
+ }
661
+ interface PaymentConnect {
662
+ /** Where to send the merchant to log in and approve the store. */
663
+ authorizeUrl(params: PaymentConnectParams, ctx: DispatchContext): string;
664
+ /**
665
+ * Redeem the authorization code. Returns a CONFIG PATCH (credentials etc.)
666
+ * the host persists exactly like an admin save.
667
+ */
668
+ exchange(params: PaymentConnectExchange, ctx: DispatchContext): Promise<Record<string, unknown>>;
669
+ }
543
670
  interface IPaymentPlugin extends IPlugin {
544
671
  readonly gatewayCode: PaymentGatewayCode;
545
672
  readonly staticConfig: GatewayStaticConfig;
@@ -548,6 +675,20 @@ interface IPaymentPlugin extends IPlugin {
548
675
  verifyTransaction?(payload: PaymentVerifyPayload, ctx: DispatchContext): Promise<PaymentResult>;
549
676
  validateWebhookSignature?(rawBody: string | Buffer, headers: Record<string, string>, ctx: DispatchContext): WebhookSignatureResult;
550
677
  processWebhook?(payload: unknown, ctx: DispatchContext): Promise<void>;
678
+ /**
679
+ * Normalise a webhook payload into a {@link PaymentWebhookSettlement}.
680
+ * OPTIONAL — a plugin that omits it keeps the host's legacy webhook parsing.
681
+ * Called by the host only AFTER `validateWebhookSignature` passed. PURE and
682
+ * synchronous: no I/O, no state. Throw on a payload that cannot be read as a
683
+ * terminal charge outcome; the host validates whatever it returns.
684
+ */
685
+ parseWebhookSettlement?(payload: unknown, ctx: DispatchContext): PaymentWebhookSettlement;
686
+ /**
687
+ * Merchant-specific pricing for the account in `ctx.config`. OPTIONAL — used
688
+ * by the host to refresh its cached fee projection. Resolve `null` when the
689
+ * gateway exposes no per-merchant pricing or it is unavailable right now.
690
+ */
691
+ getMerchantPricing?(ctx: DispatchContext): Promise<PaymentMerchantPricing | null>;
551
692
  /**
552
693
  * Query the gateway for the current status of a previously attempted charge.
553
694
  * Called by the host when `processPayment` returns `status: Error` with a
@@ -564,6 +705,8 @@ interface IPaymentPlugin extends IPlugin {
564
705
  * call via `ctx.config` (INV-4); no card data is ever passed here (INV-1).
565
706
  */
566
707
  createPaymentSession?(payload: PaymentSessionPayload, ctx: DispatchContext): Promise<PaymentSessionResult>;
708
+ /** OPTIONAL one-click account linking (see {@link PaymentConnect}). */
709
+ readonly connect?: PaymentConnect;
567
710
  }
568
711
 
569
712
  declare enum ShippingFeature {
@@ -670,6 +813,32 @@ interface CreateShipmentParams {
670
813
  courierId?: string;
671
814
  serviceLevelToken?: string;
672
815
  }
816
+ /**
817
+ * How the carrier moves money on a shipment:
818
+ * - `normal` → nothing collected; the merchant is billed the shipping.
819
+ * - `cod` → the carrier collects from the recipient and settles to the merchant.
820
+ * - `collect` → the recipient pays only the shipping; nothing settles to the merchant.
821
+ */
822
+ type CarrierServiceMode = 'normal' | 'cod' | 'collect';
823
+ /**
824
+ * What the carrier ACTUALLY settles for a shipment, in the order currency —
825
+ * the carrier's truth, which the host shows next to what it quoted. Each
826
+ * shipping plugin translates its own provider fields into this; the host never
827
+ * reads `rawResponse`.
828
+ */
829
+ interface CarrierSettlement {
830
+ mode: CarrierServiceMode;
831
+ /** Cash the carrier collects from the recipient. */
832
+ collected: number;
833
+ /** Commission the carrier charges the merchant for collecting. */
834
+ commission: number;
835
+ /** That commission as a percent of `collected` (3 = 3%), when known. */
836
+ commissionRate?: number;
837
+ /** Shipping deducted from the settlement (0 when billed apart). */
838
+ shippingDeducted: number;
839
+ /** What the merchant receives for this shipment. */
840
+ merchantNet: number;
841
+ }
673
842
  interface ShipmentResult {
674
843
  externalId: string;
675
844
  trackingNumber: string;
@@ -679,6 +848,8 @@ interface ShipmentResult {
679
848
  courierName: string;
680
849
  status: string;
681
850
  rawResponse?: Record<string, unknown>;
851
+ /** The carrier's settlement, when the provider reports it at creation. */
852
+ settlement?: CarrierSettlement;
682
853
  }
683
854
  /**
684
855
  * Normalized, carrier-agnostic shipment status event produced by
@@ -756,9 +927,16 @@ interface SuppliersStaticConfig {
756
927
  }
757
928
  interface SupplierCatalogQuery {
758
929
  text?: string;
930
+ /** ISO-3166-1 alpha-2. A driver that cannot serve it returns an empty page. */
759
931
  country?: string;
760
932
  cursor?: string;
761
933
  limit?: number;
934
+ /** Wholesale price floor, minor units (inclusive). */
935
+ minPriceMinor?: number;
936
+ /** Wholesale price ceiling, minor units (inclusive). */
937
+ maxPriceMinor?: number;
938
+ /** Only listings the supplier reports as in stock. */
939
+ inStockOnly?: boolean;
762
940
  }
763
941
  interface SupplierListingVariant {
764
942
  externalVariantId: string;
@@ -797,12 +975,16 @@ interface SupplierListing {
797
975
  hasVariants: boolean;
798
976
  variants?: SupplierListingVariant[];
799
977
  moq?: number | null;
978
+ /** Display name of the vendor behind the listing (a marketplace may host many). */
979
+ vendorName?: string | null;
800
980
  /** Untouched supplier payload, for diagnostics. Never trusted for control flow. */
801
981
  raw?: unknown;
802
982
  }
803
983
  interface SupplierListingPage {
804
984
  items: SupplierListing[];
805
985
  nextCursor?: string | null;
986
+ /** Total listings matching the query across all pages, when the supplier reports it. */
987
+ total?: number | null;
806
988
  }
807
989
  interface SupplierOrderCustomer {
808
990
  name: string;
@@ -916,11 +1098,19 @@ declare enum AnalyticsFeature {
916
1098
  /**
917
1099
  * ISO-4217 money in minor units — mirrors the store's Money VO so the host maps
918
1100
  * 1:1 without a currency guess. Kept local so the SDK stays dependency-free.
1101
+ * The exponent is the currency's own (USD 2, CLP/JPY 0, KWD 3): encode with
1102
+ * {@link toMinorUnits}, decode with {@link toMajorUnits}, never a fixed ×100.
919
1103
  */
920
1104
  interface AnalyticsMoney {
921
1105
  amountMinor: number;
922
1106
  currency: string;
923
1107
  }
1108
+ /** ISO-4217 minor-unit exponent (USD 2, JPY 0, KWD 3); unknown → 2. */
1109
+ declare function minorUnitDigits(currency: string): number;
1110
+ /** A major-unit amount (e.g. `25.5` USD) as {@link AnalyticsMoney}. */
1111
+ declare function toMinorUnits(major: number, currency: string): AnalyticsMoney;
1112
+ /** The major-unit decimal of {@link AnalyticsMoney} (e.g. `2550` USD → `25.5`). */
1113
+ declare function toMajorUnits(money: AnalyticsMoney): number;
924
1114
  /** A single line item attached to an ecommerce event. */
925
1115
  interface AnalyticsItem {
926
1116
  /** Product id as the store knows it (Meta `content_ids`, GA4 `item_id`). */
@@ -940,7 +1130,25 @@ interface AnalyticsItem {
940
1130
  * only ever maps a domain event to one of these. An adapter that does not care
941
1131
  * about a given name simply ignores it.
942
1132
  */
943
- type AnalyticsEventName = 'page_view' | 'view_item' | 'add_to_cart' | 'remove_from_cart' | 'begin_checkout' | 'purchase';
1133
+ type AnalyticsEventName = 'page_view' | 'view_item' | 'add_to_cart' | 'remove_from_cart' | 'begin_checkout' | 'purchase' | 'order_placed';
1134
+ /**
1135
+ * When a cash-on-delivery order counts as a `purchase` for an adapter:
1136
+ * - `collected` — when the cash is collected (carrier delivery or staff
1137
+ * marking it paid). Highest signal quality; the default.
1138
+ * - `confirmed` — when staff confirms the order (e.g. after a confirmation
1139
+ * call). Faster learning and inside the ad platform's dedup/attribution
1140
+ * windows, at the cost of counting confirmed orders the shopper refuses.
1141
+ * Prepaid orders always convert when the gateway approves the payment.
1142
+ */
1143
+ type CodPurchaseTrigger = 'collected' | 'confirmed';
1144
+ /**
1145
+ * Per-store settlement policy the HOST reads from an analytics adapter's own
1146
+ * config (`DispatchContext.config`). An adapter opts in by declaring a config
1147
+ * field with this exact key; one that declares none gets the defaults.
1148
+ */
1149
+ interface AnalyticsPurchasePolicy {
1150
+ codPurchaseTrigger?: CodPurchaseTrigger;
1151
+ }
944
1152
  /**
945
1153
  * Where the action physically happened. Maps to Meta `action_source`; other
946
1154
  * providers ignore it. Defaults to `website` when the host omits it.
@@ -968,7 +1176,11 @@ interface AnalyticsUserData {
968
1176
  genderSha256?: string | null;
969
1177
  /** Date of birth, YYYYMMDD normalized then SHA256. */
970
1178
  dobSha256?: string | null;
971
- /** Store customer/user id — Meta `external_id` (not hashed by spec). */
1179
+ /**
1180
+ * Pseudonymous shopper id (user, else guest) — Meta `external_id`. Arrives
1181
+ * PLAIN: it is not PII. An adapter whose provider wants it hashed (Meta, to
1182
+ * meet the browser pixel) hashes it itself.
1183
+ */
972
1184
  externalId?: string | null;
973
1185
  /** Plain IPv4/IPv6 — never hashed (geo match). */
974
1186
  clientIpAddress?: string | null;
@@ -1530,4 +1742,4 @@ interface HostApi {
1530
1742
  registerCapability<T = unknown>(cap: Capability<T>): void;
1531
1743
  }
1532
1744
 
1533
- export { type HttpClient as $, AUTHOR_HANDLE_RE as A, type BannerBlock$1 as B, ConfigScope as C, type ConditionalBlock as D, type ConditionalEquals as E, FieldType as F, type ConditionalWhen as G, type ConfigurablePlugin as H, ContentActionVariant as I, type ContentBlock as J, ContentBlockType as K, type CopyFieldBlock$1 as L, type CreateShipmentParams as M, type DispatchContext as N, type DividerBlock$1 as O, type PluginConfigField as P, type DomainEventHandler as Q, type DomainEventName as R, type SelectOption as S, type EmbedInit as T, type FieldBlock as U, type FieldOption as V, FieldVariant as W, GatewayEnvironment as X, type GatewayStaticConfig as Y, type GroupBlock as Z, type HostApi as _, type AccordionBlock as a, StepStatusFrom as a$, type HttpRequest as a0, type HttpResponse as a1, type IAnalyticsPlugin as a2, type IInvoicingPlugin as a3, type IPaymentPlugin as a4, type IPlugin as a5, type IShippingPlugin as a6, type ISuppliersPlugin as a7, type IUiPlugin as a8, type InlineRowBlock as a9, type PaymentSessionResult as aA, type PaymentVerifyPayload as aB, type PlaceSupplierOrderInput as aC, type Plugin as aD, type PluginActionContext as aE, type PluginActionResult as aF, type PluginAuthor as aG, type PluginConfigFieldDependency as aH, type PluginFactory as aI, type PluginManifest as aJ, type RepeaterBlock as aK, RepeaterSource as aL, type SecretStore as aM, type SequenceStore as aN, type SetupAction as aO, type SetupLayout as aP, type SetupLayoutValidation as aQ, type SetupStep as aR, type ShipmentAddress as aS, type ShipmentParcel as aT, type ShipmentResult as aU, type ShippingDefaultConfig as aV, ShippingFeature as aW, type ShippingPluginConfig as aX, type ShippingQuote as aY, type ShippingQuoteParams as aZ, type ShippingStaticConfig as a_, InvoiceDocumentType as aa, type InvoiceLine as ab, type InvoiceMoney as ac, type InvoiceParty as ad, type InvoiceRequest as ae, type InvoiceResult as af, InvoiceStatus as ag, type InvoiceTax as ah, type InvoicingDefaultConfig as ai, InvoicingFeature as aj, type InvoicingPluginConfig as ak, type InvoicingStaticConfig as al, type KeyValueBlock$1 as am, type KeyValueRow$1 as an, LayoutMode as ao, type Logger as ap, type MarkdownBlock as aq, MessageVariant as ar, type PaymentCard as as, type PaymentCustomer as at, type PaymentGatewayCode as au, type PaymentPayload as av, type PaymentPluginConfig as aw, type PaymentRenderMode as ax, type PaymentResult as ay, type PaymentSessionPayload as az, type AccordionSection as b, type StepStatusFromAction as b0, type StepStatusFromFields as b1, type StepStatusSource as b2, type StorageBroker as b3, type SupplierCatalogQuery as b4, type SupplierFulfillmentEvent as b5, type SupplierListing as b6, type SupplierListingAttribute as b7, type SupplierListingPage as b8, type SupplierListingVariant as b9, isConfigurablePlugin as bA, isPluginFactory as bB, paymentCapability as bC, shippingCapability as bD, suppliersCapability as bE, uiCapability as bF, validatePluginAuthor as bG, validateSetupLayout as bH, validateUiContributions as bI, type SupplierMoney as ba, type SupplierOrderAddressLevel as bb, type SupplierOrderCustomer as bc, type SupplierOrderLine as bd, type SupplierOrderResult as be, type SupplierOrderStatus as bf, type SupplierShipTo as bg, type SupplierStock as bh, type SuppliersDefaultConfig as bi, SuppliersFeature as bj, type SuppliersPluginConfig as bk, type SuppliersStaticConfig as bl, type TabItem as bm, type TabsBlock as bn, type ToggleBlock as bo, type TrackingEvent as bp, TransactionStatus as bq, type UiContribution as br, type UiContributionsValidation as bs, type VoidInvoiceInput as bt, type WebhookSignatureResult as bu, analyticsCapability as bv, capability as bw, crossValidateSetupLayout as bx, definePlugin as by, invoicingCapability as bz, type ActionBlock$1 as c, ActionVariant as d, type AnalyticsActionSource as e, type AnalyticsConsent as f, type AnalyticsEvent as g, type AnalyticsEventName as h, AnalyticsFeature as i, type AnalyticsItem as j, type AnalyticsMoney as k, type AnalyticsPluginConfig as l, type AnalyticsStaticConfig as m, type AnalyticsUserData as n, type AnalyticsUtm as o, type AuthorValidation as p, type Block as q, type BlockBase as r, BlockType as s, type CalloutBlock as t, type Capability as u, CapabilityKind as v, type CardBlock$1 as w, type CodConfig as x, type CodFeeConfig as y, CodFeeType as z };
1745
+ export { GatewayEnvironment as $, AUTHOR_HANDLE_RE as A, type BannerBlock$1 as B, ConfigScope as C, type CodConfig as D, type CodFeeConfig as E, FieldType as F, CodFeeType as G, type CodPurchaseTrigger as H, type ConditionalBlock as I, type ConditionalEquals as J, type ConditionalWhen as K, type ConfigurablePlugin as L, ContentActionVariant as M, type ContentBlock as N, ContentBlockType as O, type PluginConfigField as P, type CopyFieldBlock$1 as Q, type CreateShipmentParams as R, type SelectOption as S, type DispatchContext as T, type DividerBlock$1 as U, type DomainEventHandler as V, type DomainEventName as W, type EmbedInit as X, type FieldBlock as Y, type FieldOption as Z, FieldVariant as _, type AccordionBlock as a, type SetupLayout as a$, type GatewayFeeConfig as a0, type GatewayStaticConfig as a1, type GroupBlock as a2, type HostApi as a3, type HttpClient as a4, type HttpRequest as a5, type HttpResponse as a6, type IAnalyticsPlugin as a7, type IInvoicingPlugin as a8, type IPaymentPlugin as a9, type PaymentConnectParams as aA, type PaymentCustomer as aB, type PaymentGatewayCode as aC, type PaymentMerchantPricing as aD, type PaymentPayload as aE, type PaymentPluginConfig as aF, type PaymentRenderMode as aG, type PaymentResult as aH, type PaymentSessionFees as aI, type PaymentSessionPayload as aJ, type PaymentSessionResult as aK, type PaymentSettlementFees as aL, type PaymentVerifyPayload as aM, type PaymentWebhookSettlement as aN, type PlaceSupplierOrderInput as aO, type Plugin as aP, type PluginActionContext as aQ, type PluginActionResult as aR, type PluginAuthor as aS, type PluginConfigFieldDependency as aT, type PluginFactory as aU, type PluginManifest as aV, type RepeaterBlock as aW, RepeaterSource as aX, type SecretStore as aY, type SequenceStore as aZ, type SetupAction as a_, type IPlugin as aa, type IShippingPlugin as ab, type ISuppliersPlugin as ac, type IUiPlugin as ad, type InlineRowBlock as ae, InvoiceDocumentType as af, type InvoiceLine as ag, type InvoiceMoney as ah, type InvoiceParty as ai, type InvoiceRequest as aj, type InvoiceResult as ak, InvoiceStatus as al, type InvoiceTax as am, type InvoicingDefaultConfig as an, InvoicingFeature as ao, type InvoicingPluginConfig as ap, type InvoicingStaticConfig as aq, type KeyValueBlock$1 as ar, type KeyValueRow$1 as as, LayoutMode as at, type Logger as au, type MarkdownBlock as av, MessageVariant as aw, type PaymentCard as ax, type PaymentConnect as ay, type PaymentConnectExchange as az, type AccordionSection as b, type SetupLayoutValidation as b0, type SetupStep as b1, type ShipmentAddress as b2, type ShipmentParcel as b3, type ShipmentResult as b4, type ShippingDefaultConfig as b5, ShippingFeature as b6, type ShippingPluginConfig as b7, type ShippingQuote as b8, type ShippingQuoteParams as b9, type ToggleBlock as bA, type TrackingEvent as bB, TransactionStatus as bC, type UiContribution as bD, type UiContributionsValidation as bE, type VoidInvoiceInput as bF, type WebhookSignatureResult as bG, analyticsCapability as bH, capability as bI, crossValidateSetupLayout as bJ, definePlugin as bK, invoicingCapability as bL, isConfigurablePlugin as bM, isPluginFactory as bN, minorUnitDigits as bO, paymentCapability as bP, shippingCapability as bQ, suppliersCapability as bR, toMajorUnits as bS, toMinorUnits as bT, uiCapability as bU, validatePluginAuthor as bV, validateSetupLayout as bW, validateUiContributions as bX, type ShippingStaticConfig as ba, StepStatusFrom as bb, type StepStatusFromAction as bc, type StepStatusFromFields as bd, type StepStatusSource as be, type StorageBroker as bf, type SupplierCatalogQuery as bg, type SupplierFulfillmentEvent as bh, type SupplierListing as bi, type SupplierListingAttribute as bj, type SupplierListingPage as bk, type SupplierListingVariant as bl, type SupplierMoney as bm, type SupplierOrderAddressLevel as bn, type SupplierOrderCustomer as bo, type SupplierOrderLine as bp, type SupplierOrderResult as bq, type SupplierOrderStatus as br, type SupplierShipTo as bs, type SupplierStock as bt, type SuppliersDefaultConfig as bu, SuppliersFeature as bv, type SuppliersPluginConfig as bw, type SuppliersStaticConfig as bx, type TabItem as by, type TabsBlock as bz, type ActionBlock$1 as c, ActionVariant as d, type AnalyticsActionSource as e, type AnalyticsConsent as f, type AnalyticsEvent as g, type AnalyticsEventName as h, AnalyticsFeature as i, type AnalyticsItem as j, type AnalyticsMoney as k, type AnalyticsPluginConfig as l, type AnalyticsPurchasePolicy as m, type AnalyticsStaticConfig as n, type AnalyticsUserData as o, type AnalyticsUtm as p, type AuthorValidation as q, type Block as r, type BlockBase as s, BlockType as t, type CalloutBlock as u, type Capability as v, CapabilityKind as w, type CardBlock$1 as x, type CarrierServiceMode as y, type CarrierSettlement as z };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FieldType, C as ConfigScope, S as SelectOption, P as PluginConfigField } from './host-api-yX49e7zE.mjs';
2
- export { A as AUTHOR_HANDLE_RE, a as AccordionBlock, b as AccordionSection, c as ActionBlock, d as ActionVariant, e as AnalyticsActionSource, f as AnalyticsConsent, g as AnalyticsEvent, h as AnalyticsEventName, i as AnalyticsFeature, j as AnalyticsItem, k as AnalyticsMoney, l as AnalyticsPluginConfig, m as AnalyticsStaticConfig, n as AnalyticsUserData, o as AnalyticsUtm, p as AuthorValidation, B as BannerBlock, q as Block, r as BlockBase, s as BlockType, t as CalloutBlock, u as Capability, v as CapabilityKind, w as CardBlock, x as CodConfig, y as CodFeeConfig, z as CodFeeType, D as ConditionalBlock, E as ConditionalEquals, G as ConditionalWhen, H as ConfigurablePlugin, I as ContentActionVariant, J as ContentBlock, K as ContentBlockType, L as CopyFieldBlock, M as CreateShipmentParams, N as DispatchContext, O as DividerBlock, Q as DomainEventHandler, R as DomainEventName, T as EmbedInit, U as FieldBlock, V as FieldOption, W as FieldVariant, X as GatewayEnvironment, Y as GatewayStaticConfig, Z as GroupBlock, _ as HostApi, $ as HttpClient, a0 as HttpRequest, a1 as HttpResponse, a2 as IAnalyticsPlugin, a3 as IInvoicingPlugin, a4 as IPaymentPlugin, a5 as IPlugin, a6 as IShippingPlugin, a7 as ISuppliersPlugin, a8 as IUiPlugin, a9 as InlineRowBlock, aa as InvoiceDocumentType, ab as InvoiceLine, ac as InvoiceMoney, ad as InvoiceParty, ae as InvoiceRequest, af as InvoiceResult, ag as InvoiceStatus, ah as InvoiceTax, ai as InvoicingDefaultConfig, aj as InvoicingFeature, ak as InvoicingPluginConfig, al as InvoicingStaticConfig, am as KeyValueBlock, an as KeyValueRow, ao as LayoutMode, ap as Logger, aq as MarkdownBlock, ar as MessageVariant, as as PaymentCard, at as PaymentCustomer, au as PaymentGatewayCode, av as PaymentPayload, aw as PaymentPluginConfig, ax as PaymentRenderMode, ay as PaymentResult, az as PaymentSessionPayload, aA as PaymentSessionResult, aB as PaymentVerifyPayload, aC as PlaceSupplierOrderInput, aD as Plugin, aE as PluginActionContext, aF as PluginActionResult, aG as PluginAuthor, aH as PluginConfigFieldDependency, aI as PluginFactory, aJ as PluginManifest, aK as RepeaterBlock, aL as RepeaterSource, aM as SecretStore, aN as SequenceStore, aO as SetupAction, aP as SetupLayout, aQ as SetupLayoutValidation, aR as SetupStep, aS as ShipmentAddress, aT as ShipmentParcel, aU as ShipmentResult, aV as ShippingDefaultConfig, aW as ShippingFeature, aX as ShippingPluginConfig, aY as ShippingQuote, aZ as ShippingQuoteParams, a_ as ShippingStaticConfig, a$ as StepStatusFrom, b0 as StepStatusFromAction, b1 as StepStatusFromFields, b2 as StepStatusSource, b3 as StorageBroker, b4 as SupplierCatalogQuery, b5 as SupplierFulfillmentEvent, b6 as SupplierListing, b7 as SupplierListingAttribute, b8 as SupplierListingPage, b9 as SupplierListingVariant, ba as SupplierMoney, bb as SupplierOrderAddressLevel, bc as SupplierOrderCustomer, bd as SupplierOrderLine, be as SupplierOrderResult, bf as SupplierOrderStatus, bg as SupplierShipTo, bh as SupplierStock, bi as SuppliersDefaultConfig, bj as SuppliersFeature, bk as SuppliersPluginConfig, bl as SuppliersStaticConfig, bm as TabItem, bn as TabsBlock, bo as ToggleBlock, bp as TrackingEvent, bq as TransactionStatus, br as UiContribution, bs as UiContributionsValidation, bt as VoidInvoiceInput, bu as WebhookSignatureResult, bv as analyticsCapability, bw as capability, bx as crossValidateSetupLayout, by as definePlugin, bz as invoicingCapability, bA as isConfigurablePlugin, bB as isPluginFactory, bC as paymentCapability, bD as shippingCapability, bE as suppliersCapability, bF as uiCapability, bG as validatePluginAuthor, bH as validateSetupLayout, bI as validateUiContributions } from './host-api-yX49e7zE.mjs';
1
+ import { F as FieldType, C as ConfigScope, S as SelectOption, P as PluginConfigField } from './host-api-Eeb42fR2.mjs';
2
+ export { A as AUTHOR_HANDLE_RE, a as AccordionBlock, b as AccordionSection, c as ActionBlock, d as ActionVariant, e as AnalyticsActionSource, f as AnalyticsConsent, g as AnalyticsEvent, h as AnalyticsEventName, i as AnalyticsFeature, j as AnalyticsItem, k as AnalyticsMoney, l as AnalyticsPluginConfig, m as AnalyticsPurchasePolicy, n as AnalyticsStaticConfig, o as AnalyticsUserData, p as AnalyticsUtm, q as AuthorValidation, B as BannerBlock, r as Block, s as BlockBase, t as BlockType, u as CalloutBlock, v as Capability, w as CapabilityKind, x as CardBlock, y as CarrierServiceMode, z as CarrierSettlement, D as CodConfig, E as CodFeeConfig, G as CodFeeType, H as CodPurchaseTrigger, I as ConditionalBlock, J as ConditionalEquals, K as ConditionalWhen, L as ConfigurablePlugin, M as ContentActionVariant, N as ContentBlock, O as ContentBlockType, Q as CopyFieldBlock, R as CreateShipmentParams, T as DispatchContext, U as DividerBlock, V as DomainEventHandler, W as DomainEventName, X as EmbedInit, Y as FieldBlock, Z as FieldOption, _ as FieldVariant, $ as GatewayEnvironment, a0 as GatewayFeeConfig, a1 as GatewayStaticConfig, a2 as GroupBlock, a3 as HostApi, a4 as HttpClient, a5 as HttpRequest, a6 as HttpResponse, a7 as IAnalyticsPlugin, a8 as IInvoicingPlugin, a9 as IPaymentPlugin, aa as IPlugin, ab as IShippingPlugin, ac as ISuppliersPlugin, ad as IUiPlugin, ae as InlineRowBlock, af as InvoiceDocumentType, ag as InvoiceLine, ah as InvoiceMoney, ai as InvoiceParty, aj as InvoiceRequest, ak as InvoiceResult, al as InvoiceStatus, am as InvoiceTax, an as InvoicingDefaultConfig, ao as InvoicingFeature, ap as InvoicingPluginConfig, aq as InvoicingStaticConfig, ar as KeyValueBlock, as as KeyValueRow, at as LayoutMode, au as Logger, av as MarkdownBlock, aw as MessageVariant, ax as PaymentCard, ay as PaymentConnect, az as PaymentConnectExchange, aA as PaymentConnectParams, aB as PaymentCustomer, aC as PaymentGatewayCode, aD as PaymentMerchantPricing, aE as PaymentPayload, aF as PaymentPluginConfig, aG as PaymentRenderMode, aH as PaymentResult, aI as PaymentSessionFees, aJ as PaymentSessionPayload, aK as PaymentSessionResult, aL as PaymentSettlementFees, aM as PaymentVerifyPayload, aN as PaymentWebhookSettlement, aO as PlaceSupplierOrderInput, aP as Plugin, aQ as PluginActionContext, aR as PluginActionResult, aS as PluginAuthor, aT as PluginConfigFieldDependency, aU as PluginFactory, aV as PluginManifest, aW as RepeaterBlock, aX as RepeaterSource, aY as SecretStore, aZ as SequenceStore, a_ as SetupAction, a$ as SetupLayout, b0 as SetupLayoutValidation, b1 as SetupStep, b2 as ShipmentAddress, b3 as ShipmentParcel, b4 as ShipmentResult, b5 as ShippingDefaultConfig, b6 as ShippingFeature, b7 as ShippingPluginConfig, b8 as ShippingQuote, b9 as ShippingQuoteParams, ba as ShippingStaticConfig, bb as StepStatusFrom, bc as StepStatusFromAction, bd as StepStatusFromFields, be as StepStatusSource, bf as StorageBroker, bg as SupplierCatalogQuery, bh as SupplierFulfillmentEvent, bi as SupplierListing, bj as SupplierListingAttribute, bk as SupplierListingPage, bl as SupplierListingVariant, bm as SupplierMoney, bn as SupplierOrderAddressLevel, bo as SupplierOrderCustomer, bp as SupplierOrderLine, bq as SupplierOrderResult, br as SupplierOrderStatus, bs as SupplierShipTo, bt as SupplierStock, bu as SuppliersDefaultConfig, bv as SuppliersFeature, bw as SuppliersPluginConfig, bx as SuppliersStaticConfig, by as TabItem, bz as TabsBlock, bA as ToggleBlock, bB as TrackingEvent, bC as TransactionStatus, bD as UiContribution, bE as UiContributionsValidation, bF as VoidInvoiceInput, bG as WebhookSignatureResult, bH as analyticsCapability, bI as capability, bJ as crossValidateSetupLayout, bK as definePlugin, bL as invoicingCapability, bM as isConfigurablePlugin, bN as isPluginFactory, bO as minorUnitDigits, bP as paymentCapability, bQ as shippingCapability, bR as suppliersCapability, bS as toMajorUnits, bT as toMinorUnits, bU as uiCapability, bV as validatePluginAuthor, bW as validateSetupLayout, bX as validateUiContributions } from './host-api-Eeb42fR2.mjs';
3
3
 
4
4
  declare const PAYMENT_PLUGIN_TOKEN: "PAYMENT_PLUGINS";
5
5
  declare const SHIPPING_PLUGIN_TOKEN: "SHIPPING_PLUGINS";
@@ -74,7 +74,7 @@ declare function checkPermissions(required: string[], grantedRaw: string[]): Per
74
74
  * - MINOR: additive (new optional fields, new tokens) — backwards compatible.
75
75
  * - PATCH: docs/fixes with zero shape changes.
76
76
  */
77
- declare const SDK_VERSION = "0.6.7";
77
+ declare const SDK_VERSION = "0.6.9";
78
78
  /**
79
79
  * True when a plugin built against `pluginSdkVersion` can run on a host that
80
80
  * ships `hostSdkVersion`. Rule: same major, host minor >= plugin minor.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FieldType, C as ConfigScope, S as SelectOption, P as PluginConfigField } from './host-api-yX49e7zE.js';
2
- export { A as AUTHOR_HANDLE_RE, a as AccordionBlock, b as AccordionSection, c as ActionBlock, d as ActionVariant, e as AnalyticsActionSource, f as AnalyticsConsent, g as AnalyticsEvent, h as AnalyticsEventName, i as AnalyticsFeature, j as AnalyticsItem, k as AnalyticsMoney, l as AnalyticsPluginConfig, m as AnalyticsStaticConfig, n as AnalyticsUserData, o as AnalyticsUtm, p as AuthorValidation, B as BannerBlock, q as Block, r as BlockBase, s as BlockType, t as CalloutBlock, u as Capability, v as CapabilityKind, w as CardBlock, x as CodConfig, y as CodFeeConfig, z as CodFeeType, D as ConditionalBlock, E as ConditionalEquals, G as ConditionalWhen, H as ConfigurablePlugin, I as ContentActionVariant, J as ContentBlock, K as ContentBlockType, L as CopyFieldBlock, M as CreateShipmentParams, N as DispatchContext, O as DividerBlock, Q as DomainEventHandler, R as DomainEventName, T as EmbedInit, U as FieldBlock, V as FieldOption, W as FieldVariant, X as GatewayEnvironment, Y as GatewayStaticConfig, Z as GroupBlock, _ as HostApi, $ as HttpClient, a0 as HttpRequest, a1 as HttpResponse, a2 as IAnalyticsPlugin, a3 as IInvoicingPlugin, a4 as IPaymentPlugin, a5 as IPlugin, a6 as IShippingPlugin, a7 as ISuppliersPlugin, a8 as IUiPlugin, a9 as InlineRowBlock, aa as InvoiceDocumentType, ab as InvoiceLine, ac as InvoiceMoney, ad as InvoiceParty, ae as InvoiceRequest, af as InvoiceResult, ag as InvoiceStatus, ah as InvoiceTax, ai as InvoicingDefaultConfig, aj as InvoicingFeature, ak as InvoicingPluginConfig, al as InvoicingStaticConfig, am as KeyValueBlock, an as KeyValueRow, ao as LayoutMode, ap as Logger, aq as MarkdownBlock, ar as MessageVariant, as as PaymentCard, at as PaymentCustomer, au as PaymentGatewayCode, av as PaymentPayload, aw as PaymentPluginConfig, ax as PaymentRenderMode, ay as PaymentResult, az as PaymentSessionPayload, aA as PaymentSessionResult, aB as PaymentVerifyPayload, aC as PlaceSupplierOrderInput, aD as Plugin, aE as PluginActionContext, aF as PluginActionResult, aG as PluginAuthor, aH as PluginConfigFieldDependency, aI as PluginFactory, aJ as PluginManifest, aK as RepeaterBlock, aL as RepeaterSource, aM as SecretStore, aN as SequenceStore, aO as SetupAction, aP as SetupLayout, aQ as SetupLayoutValidation, aR as SetupStep, aS as ShipmentAddress, aT as ShipmentParcel, aU as ShipmentResult, aV as ShippingDefaultConfig, aW as ShippingFeature, aX as ShippingPluginConfig, aY as ShippingQuote, aZ as ShippingQuoteParams, a_ as ShippingStaticConfig, a$ as StepStatusFrom, b0 as StepStatusFromAction, b1 as StepStatusFromFields, b2 as StepStatusSource, b3 as StorageBroker, b4 as SupplierCatalogQuery, b5 as SupplierFulfillmentEvent, b6 as SupplierListing, b7 as SupplierListingAttribute, b8 as SupplierListingPage, b9 as SupplierListingVariant, ba as SupplierMoney, bb as SupplierOrderAddressLevel, bc as SupplierOrderCustomer, bd as SupplierOrderLine, be as SupplierOrderResult, bf as SupplierOrderStatus, bg as SupplierShipTo, bh as SupplierStock, bi as SuppliersDefaultConfig, bj as SuppliersFeature, bk as SuppliersPluginConfig, bl as SuppliersStaticConfig, bm as TabItem, bn as TabsBlock, bo as ToggleBlock, bp as TrackingEvent, bq as TransactionStatus, br as UiContribution, bs as UiContributionsValidation, bt as VoidInvoiceInput, bu as WebhookSignatureResult, bv as analyticsCapability, bw as capability, bx as crossValidateSetupLayout, by as definePlugin, bz as invoicingCapability, bA as isConfigurablePlugin, bB as isPluginFactory, bC as paymentCapability, bD as shippingCapability, bE as suppliersCapability, bF as uiCapability, bG as validatePluginAuthor, bH as validateSetupLayout, bI as validateUiContributions } from './host-api-yX49e7zE.js';
1
+ import { F as FieldType, C as ConfigScope, S as SelectOption, P as PluginConfigField } from './host-api-Eeb42fR2.js';
2
+ export { A as AUTHOR_HANDLE_RE, a as AccordionBlock, b as AccordionSection, c as ActionBlock, d as ActionVariant, e as AnalyticsActionSource, f as AnalyticsConsent, g as AnalyticsEvent, h as AnalyticsEventName, i as AnalyticsFeature, j as AnalyticsItem, k as AnalyticsMoney, l as AnalyticsPluginConfig, m as AnalyticsPurchasePolicy, n as AnalyticsStaticConfig, o as AnalyticsUserData, p as AnalyticsUtm, q as AuthorValidation, B as BannerBlock, r as Block, s as BlockBase, t as BlockType, u as CalloutBlock, v as Capability, w as CapabilityKind, x as CardBlock, y as CarrierServiceMode, z as CarrierSettlement, D as CodConfig, E as CodFeeConfig, G as CodFeeType, H as CodPurchaseTrigger, I as ConditionalBlock, J as ConditionalEquals, K as ConditionalWhen, L as ConfigurablePlugin, M as ContentActionVariant, N as ContentBlock, O as ContentBlockType, Q as CopyFieldBlock, R as CreateShipmentParams, T as DispatchContext, U as DividerBlock, V as DomainEventHandler, W as DomainEventName, X as EmbedInit, Y as FieldBlock, Z as FieldOption, _ as FieldVariant, $ as GatewayEnvironment, a0 as GatewayFeeConfig, a1 as GatewayStaticConfig, a2 as GroupBlock, a3 as HostApi, a4 as HttpClient, a5 as HttpRequest, a6 as HttpResponse, a7 as IAnalyticsPlugin, a8 as IInvoicingPlugin, a9 as IPaymentPlugin, aa as IPlugin, ab as IShippingPlugin, ac as ISuppliersPlugin, ad as IUiPlugin, ae as InlineRowBlock, af as InvoiceDocumentType, ag as InvoiceLine, ah as InvoiceMoney, ai as InvoiceParty, aj as InvoiceRequest, ak as InvoiceResult, al as InvoiceStatus, am as InvoiceTax, an as InvoicingDefaultConfig, ao as InvoicingFeature, ap as InvoicingPluginConfig, aq as InvoicingStaticConfig, ar as KeyValueBlock, as as KeyValueRow, at as LayoutMode, au as Logger, av as MarkdownBlock, aw as MessageVariant, ax as PaymentCard, ay as PaymentConnect, az as PaymentConnectExchange, aA as PaymentConnectParams, aB as PaymentCustomer, aC as PaymentGatewayCode, aD as PaymentMerchantPricing, aE as PaymentPayload, aF as PaymentPluginConfig, aG as PaymentRenderMode, aH as PaymentResult, aI as PaymentSessionFees, aJ as PaymentSessionPayload, aK as PaymentSessionResult, aL as PaymentSettlementFees, aM as PaymentVerifyPayload, aN as PaymentWebhookSettlement, aO as PlaceSupplierOrderInput, aP as Plugin, aQ as PluginActionContext, aR as PluginActionResult, aS as PluginAuthor, aT as PluginConfigFieldDependency, aU as PluginFactory, aV as PluginManifest, aW as RepeaterBlock, aX as RepeaterSource, aY as SecretStore, aZ as SequenceStore, a_ as SetupAction, a$ as SetupLayout, b0 as SetupLayoutValidation, b1 as SetupStep, b2 as ShipmentAddress, b3 as ShipmentParcel, b4 as ShipmentResult, b5 as ShippingDefaultConfig, b6 as ShippingFeature, b7 as ShippingPluginConfig, b8 as ShippingQuote, b9 as ShippingQuoteParams, ba as ShippingStaticConfig, bb as StepStatusFrom, bc as StepStatusFromAction, bd as StepStatusFromFields, be as StepStatusSource, bf as StorageBroker, bg as SupplierCatalogQuery, bh as SupplierFulfillmentEvent, bi as SupplierListing, bj as SupplierListingAttribute, bk as SupplierListingPage, bl as SupplierListingVariant, bm as SupplierMoney, bn as SupplierOrderAddressLevel, bo as SupplierOrderCustomer, bp as SupplierOrderLine, bq as SupplierOrderResult, br as SupplierOrderStatus, bs as SupplierShipTo, bt as SupplierStock, bu as SuppliersDefaultConfig, bv as SuppliersFeature, bw as SuppliersPluginConfig, bx as SuppliersStaticConfig, by as TabItem, bz as TabsBlock, bA as ToggleBlock, bB as TrackingEvent, bC as TransactionStatus, bD as UiContribution, bE as UiContributionsValidation, bF as VoidInvoiceInput, bG as WebhookSignatureResult, bH as analyticsCapability, bI as capability, bJ as crossValidateSetupLayout, bK as definePlugin, bL as invoicingCapability, bM as isConfigurablePlugin, bN as isPluginFactory, bO as minorUnitDigits, bP as paymentCapability, bQ as shippingCapability, bR as suppliersCapability, bS as toMajorUnits, bT as toMinorUnits, bU as uiCapability, bV as validatePluginAuthor, bW as validateSetupLayout, bX as validateUiContributions } from './host-api-Eeb42fR2.js';
3
3
 
4
4
  declare const PAYMENT_PLUGIN_TOKEN: "PAYMENT_PLUGINS";
5
5
  declare const SHIPPING_PLUGIN_TOKEN: "SHIPPING_PLUGINS";
@@ -74,7 +74,7 @@ declare function checkPermissions(required: string[], grantedRaw: string[]): Per
74
74
  * - MINOR: additive (new optional fields, new tokens) — backwards compatible.
75
75
  * - PATCH: docs/fixes with zero shape changes.
76
76
  */
77
- declare const SDK_VERSION = "0.6.7";
77
+ declare const SDK_VERSION = "0.6.9";
78
78
  /**
79
79
  * True when a plugin built against `pluginSdkVersion` can run on a host that
80
80
  * ships `hostSdkVersion`. Rule: same major, host minor >= plugin minor.
package/dist/index.js CHANGED
@@ -60,10 +60,13 @@ __export(index_exports, {
60
60
  isPermissionGranted: () => isPermissionGranted,
61
61
  isPluginFactory: () => isPluginFactory,
62
62
  isSdkCompatible: () => isSdkCompatible,
63
+ minorUnitDigits: () => minorUnitDigits,
63
64
  parsePermission: () => parsePermission,
64
65
  paymentCapability: () => paymentCapability,
65
66
  shippingCapability: () => shippingCapability,
66
67
  suppliersCapability: () => suppliersCapability,
68
+ toMajorUnits: () => toMajorUnits,
69
+ toMinorUnits: () => toMinorUnits,
67
70
  uiCapability: () => uiCapability,
68
71
  validatePluginAuthor: () => validatePluginAuthor,
69
72
  validateSetupLayout: () => validateSetupLayout,
@@ -214,6 +217,26 @@ var AnalyticsFeature = /* @__PURE__ */ ((AnalyticsFeature2) => {
214
217
  AnalyticsFeature2["PageViews"] = "page-views";
215
218
  return AnalyticsFeature2;
216
219
  })(AnalyticsFeature || {});
220
+ function minorUnitDigits(currency) {
221
+ try {
222
+ return new Intl.NumberFormat("en", {
223
+ style: "currency",
224
+ currency: currency.toUpperCase()
225
+ }).resolvedOptions().maximumFractionDigits;
226
+ } catch {
227
+ return 2;
228
+ }
229
+ }
230
+ function toMinorUnits(major, currency) {
231
+ return {
232
+ amountMinor: Math.round(major * 10 ** minorUnitDigits(currency)),
233
+ currency
234
+ };
235
+ }
236
+ function toMajorUnits(money) {
237
+ const digits = minorUnitDigits(money.currency);
238
+ return Number((money.amountMinor / 10 ** digits).toFixed(digits));
239
+ }
217
240
 
218
241
  // src/invoicing.ts
219
242
  var InvoicingFeature = /* @__PURE__ */ ((InvoicingFeature2) => {
@@ -717,7 +740,7 @@ function checkPermissions(required, grantedRaw) {
717
740
  }
718
741
 
719
742
  // src/version.ts
720
- var SDK_VERSION = "0.6.7";
743
+ var SDK_VERSION = "0.6.9";
721
744
  function isSdkCompatible(pluginSdkVersion, hostSdkVersion) {
722
745
  const parse = (v) => {
723
746
  const m = /^(\d+)\.(\d+)\.(\d+)/.exec(v);
@@ -774,10 +797,13 @@ function isSdkCompatible(pluginSdkVersion, hostSdkVersion) {
774
797
  isPermissionGranted,
775
798
  isPluginFactory,
776
799
  isSdkCompatible,
800
+ minorUnitDigits,
777
801
  parsePermission,
778
802
  paymentCapability,
779
803
  shippingCapability,
780
804
  suppliersCapability,
805
+ toMajorUnits,
806
+ toMinorUnits,
781
807
  uiCapability,
782
808
  validatePluginAuthor,
783
809
  validateSetupLayout,
package/dist/index.mjs CHANGED
@@ -155,6 +155,26 @@ var AnalyticsFeature = /* @__PURE__ */ ((AnalyticsFeature2) => {
155
155
  AnalyticsFeature2["PageViews"] = "page-views";
156
156
  return AnalyticsFeature2;
157
157
  })(AnalyticsFeature || {});
158
+ function minorUnitDigits(currency) {
159
+ try {
160
+ return new Intl.NumberFormat("en", {
161
+ style: "currency",
162
+ currency: currency.toUpperCase()
163
+ }).resolvedOptions().maximumFractionDigits;
164
+ } catch {
165
+ return 2;
166
+ }
167
+ }
168
+ function toMinorUnits(major, currency) {
169
+ return {
170
+ amountMinor: Math.round(major * 10 ** minorUnitDigits(currency)),
171
+ currency
172
+ };
173
+ }
174
+ function toMajorUnits(money) {
175
+ const digits = minorUnitDigits(money.currency);
176
+ return Number((money.amountMinor / 10 ** digits).toFixed(digits));
177
+ }
158
178
 
159
179
  // src/invoicing.ts
160
180
  var InvoicingFeature = /* @__PURE__ */ ((InvoicingFeature2) => {
@@ -651,7 +671,7 @@ function isPluginFactory(value) {
651
671
  }
652
672
 
653
673
  // src/version.ts
654
- var SDK_VERSION = "0.6.7";
674
+ var SDK_VERSION = "0.6.9";
655
675
  function isSdkCompatible(pluginSdkVersion, hostSdkVersion) {
656
676
  const parse = (v) => {
657
677
  const m = /^(\d+)\.(\d+)\.(\d+)/.exec(v);
@@ -707,10 +727,13 @@ export {
707
727
  isPermissionGranted,
708
728
  isPluginFactory,
709
729
  isSdkCompatible,
730
+ minorUnitDigits,
710
731
  parsePermission,
711
732
  paymentCapability,
712
733
  shippingCapability,
713
734
  suppliersCapability,
735
+ toMajorUnits,
736
+ toMinorUnits,
714
737
  uiCapability,
715
738
  validatePluginAuthor,
716
739
  validateSetupLayout,
@@ -1,4 +1,4 @@
1
- import { _ as HostApi, a0 as HttpRequest, R as DomainEventName, u as Capability, Q as DomainEventHandler, a1 as HttpResponse, N as DispatchContext } from '../host-api-yX49e7zE.mjs';
1
+ import { a3 as HostApi, a5 as HttpRequest, W as DomainEventName, v as Capability, V as DomainEventHandler, a6 as HttpResponse, T as DispatchContext } from '../host-api-Eeb42fR2.mjs';
2
2
 
3
3
  /** Every recorded interaction, keyed by `"port.method"`. */
4
4
  interface MockHostCalls {
@@ -1,4 +1,4 @@
1
- import { _ as HostApi, a0 as HttpRequest, R as DomainEventName, u as Capability, Q as DomainEventHandler, a1 as HttpResponse, N as DispatchContext } from '../host-api-yX49e7zE.js';
1
+ import { a3 as HostApi, a5 as HttpRequest, W as DomainEventName, v as Capability, V as DomainEventHandler, a6 as HttpResponse, T as DispatchContext } from '../host-api-Eeb42fR2.js';
2
2
 
3
3
  /** Every recorded interaction, keyed by `"port.method"`. */
4
4
  interface MockHostCalls {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vivoa/plugin-sdk",
3
- "version": "0.6.7",
3
+ "version": "0.6.9",
4
4
  "description": "Public contracts for Vivoa plugins (types, DI tokens, config + setup-layout validators)",
5
5
  "license": "MIT",
6
6
  "author": "Vivoa",
@@ -39,14 +39,6 @@
39
39
  "registry": "https://registry.npmjs.org",
40
40
  "access": "public"
41
41
  },
42
- "scripts": {
43
- "build": "tsup src/index.ts src/testing/index.ts --format cjs,esm --dts --clean --target node18",
44
- "dev": "tsup src/index.ts src/testing/index.ts --format cjs,esm --dts --watch --target node18",
45
- "test": "vitest run",
46
- "test:watch": "vitest",
47
- "typecheck": "tsc --noEmit -p tsconfig.json",
48
- "prepublishOnly": "pnpm run typecheck && pnpm run test && pnpm run build"
49
- },
50
42
  "dependencies": {
51
43
  "superstruct": "^2.0.2"
52
44
  },
@@ -55,5 +47,12 @@
55
47
  "tsup": "^8.3.5",
56
48
  "typescript": "^5.7.3",
57
49
  "vitest": "^2.1.8"
50
+ },
51
+ "scripts": {
52
+ "build": "tsup src/index.ts src/testing/index.ts --format cjs,esm --dts --clean --target node18",
53
+ "dev": "tsup src/index.ts src/testing/index.ts --format cjs,esm --dts --watch --target node18",
54
+ "test": "vitest run",
55
+ "test:watch": "vitest",
56
+ "typecheck": "tsc --noEmit -p tsconfig.json"
58
57
  }
59
- }
58
+ }