@wix/himalaya-cli 0.1368.0 → 0.1369.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 (39) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/mapping-source.d.ts +3 -1
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments-contract.d.ts +44 -2
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments-wire.d.ts +14 -1
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments.d.ts +9 -3
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/apple-iap-contract.d.ts +18 -5
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/apple-iap-core.d.ts +2 -0
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/checkout-source.d.ts +8 -0
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/commerce-core.d.ts +2 -0
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-order-backend.d.ts +3 -0
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/index.d.ts +1 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/order-refs.d.ts +5 -1
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap-checkout.mjs +167 -41
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap.mjs +75 -21
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +147 -30
  15. package/dist/cli.mjs +7 -6
  16. package/guides/iap-screen-adoption.md +3 -2
  17. package/guides/sdk-reference.json +57 -9
  18. package/package.json +2 -2
  19. package/templates/beauty-salon/dev/index.ts +49 -1
  20. package/templates/beauty-salon/tier5-src/_shared/iap-presentation.ts +4 -2
  21. package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +68 -5
  22. package/templates/branded-lite/dev/index.ts +49 -1
  23. package/templates/branded-lite/tier5-src/_shared/iap-presentation.ts +4 -2
  24. package/templates/branded-lite/tier5-src/himi-store-product/index.ts +68 -5
  25. package/templates/community-club/tier5-src/_shared/iap-presentation.ts +4 -2
  26. package/templates/events-meetups/tier5-src/_shared/iap-presentation.ts +4 -2
  27. package/templates/gym-fitness/dev/index.ts +49 -1
  28. package/templates/gym-fitness/tier5-src/_shared/iap-presentation.ts +4 -2
  29. package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +68 -5
  30. package/templates/nonprofit-cause/tier5-src/_shared/iap-presentation.ts +4 -2
  31. package/templates/podcast-creator/tier5-src/_shared/iap-presentation.ts +4 -2
  32. package/templates/portfolio-creative/dev/index.ts +49 -1
  33. package/templates/portfolio-creative/tier5-src/_shared/iap-presentation.ts +4 -2
  34. package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +68 -5
  35. package/templates/restaurant/tier5-src/_shared/iap-presentation.ts +4 -2
  36. package/templates/retail-store/dev/index.ts +49 -1
  37. package/templates/retail-store/tier5-src/_shared/iap-presentation.ts +4 -2
  38. package/templates/retail-store/tier5-src/himi-store-product/index.ts +68 -5
  39. package/templates/yoga-studio/tier5-src/_shared/iap-presentation.ts +4 -2
@@ -1,9 +1,11 @@
1
1
  import type { IapMappingSource } from "./catalog-pricing-contract.js";
2
- import { type AppBindingSource } from "./wix-payments-contract.js";
2
+ import { type AppBindingSource, type AppleSaleRule } from "./wix-payments-contract.js";
3
3
  export type WixBridgeCall = (method: string, path: string, body: unknown, headers?: Record<string, string>) => Promise<unknown>;
4
4
  export interface WixIapMappingSourceDependencies {
5
5
  binding: AppBindingSource;
6
6
  call: WixBridgeCall;
7
+ /** The verticals the App Store sells; the shipped `APPLE_SALE_RULES` unless given. */
8
+ rules?: Readonly<Record<string, AppleSaleRule>>;
7
9
  }
8
10
  /** The connected source. Tests substitute this module at bundle-build time (`mappingSourceSeam`). */
9
11
  export declare function iapMappingSource(): IapMappingSource | undefined;
@@ -37,11 +37,24 @@ export interface AppleSaleRule {
37
37
  appProductId(entityId: string): string;
38
38
  productType: "NON_CONSUMABLE";
39
39
  }
40
+ /**
41
+ * Whether Wix Stores items sell through the App Store, through wix-iap StartItemPayment
42
+ * (catalyst-server #24496), which places the member's eCom order for one catalog item. OFF: that RPC
43
+ * is not deployed, the member's identity across Serve → wix-iap → eCom is unproven, and a paid Stores
44
+ * order is not yet proven to deliver the download. The one switch: it adds the Stores rule to
45
+ * `APPLE_SALE_RULES`, which the mapping source and `himi store iap connect` read, and turns on the
46
+ * checkout's path (`itemPaymentEnabled` in @himalaya/iap-checkout).
47
+ */
48
+ export declare const STORES_ITEM_PAYMENT_ENABLED = false;
49
+ /** StartItemPayment's CatalogReference: the purchases catalog sells a Stores product under its product
50
+ * id (eCom's `catalogItemId`). One-time unlocks only, whatever the backend also accepts. */
51
+ export declare const STORES_PRODUCT_SALE_RULE: AppleSaleRule;
40
52
  /**
41
53
  * The one definition `himi store iap connect` writes mappings by and the mapping source reads them by,
42
54
  * keyed by catalog kind. wix-iap StartPayment maps the cashier order's single item id, and Online
43
55
  * Programs builds that order with the program id as the item id; programs are one-time unlocks.
44
- * Other verticals' order item ids are not established yet, so their items keep their own commerce.
56
+ * Wix Stores joins only with `STORES_ITEM_PAYMENT_ENABLED`. Other verticals' order item ids are not
57
+ * established yet, so their items keep their own commerce.
45
58
  */
46
59
  export declare const APPLE_SALE_RULES: Readonly<Record<string, AppleSaleRule>>;
47
60
  /** Captured when a protected call starts. The native bridge checks it and never puts it on
@@ -83,8 +96,9 @@ export interface WixIapPayment {
83
96
  canceledDate?: string;
84
97
  refundedDate?: string;
85
98
  }
86
- export type WixIapOperation = "startPayment" | "completePayment" | "getPayment";
99
+ export type WixIapOperation = "startPayment" | "startItemPayment" | "completePayment" | "getPayment";
87
100
  export type StartPaymentErrorCode = "NOT_PENDING" | "WRONG_PAYMENT_METHOD" | "NOT_ORDER_BUYER" | "UNSUPPORTED_ORDER" | "PRODUCT_NOT_AVAILABLE" | "ALREADY_OWNED";
101
+ export type StartItemPaymentErrorCode = "PRODUCT_NOT_AVAILABLE" | "ALREADY_OWNED" | "ITEM_NOT_AVAILABLE" | "SITE_NOT_ACCEPTING_PAYMENTS" | "UNSUPPORTED_ORDER";
88
102
  export type CompletePaymentErrorCode = "INVALID_PURCHASE" | "OWNED_BY_ANOTHER_CUSTOMER" | "PURCHASE_REVOKED" | "NOT_PURCHASED" | "ZERO_PRICE" | "NO_MATCHING_PAYMENT" | "PAYMENT_NOT_PENDING" | "APP_NOT_CONFIGURED";
89
103
  export type GetPaymentErrorCode = "NOT_FOUND";
90
104
  /** Why a call gave no usable answer, other than a named application error.
@@ -116,6 +130,34 @@ export type StartPaymentResult = {
116
130
  storeProductId: string;
117
131
  appAccountToken: string;
118
132
  } | WixIapFailure<StartPaymentErrorCode>;
133
+ /** One item a Wix catalog sells through eCom, as eCom's `catalogReference` names it: for Wix Stores,
134
+ * the product id and the Stores app id. The purchases catalog sells it under `catalogItemId` as its
135
+ * `appProductId`. Variants and options are not supported, and the quantity is always 1. */
136
+ export interface EcomCatalogReference {
137
+ catalogItemId: string;
138
+ catalogAppId: string;
139
+ }
140
+ /** StartItemPayment was handed to the transport and gave no answer this client can act on: an
141
+ * outage, a lost or late answer, or a 2xx it could not decode. The service may have placed an
142
+ * eCom order and started a Payment for it, and it has no idempotency key, so resending places
143
+ * another order. No token came back, so nothing can be sold against it either. */
144
+ export interface StartItemPaymentOutcomeUnknown {
145
+ status: "outcomeUnknown";
146
+ operation: "startItemPayment";
147
+ kind: WixIapFailureKind;
148
+ httpStatus?: number;
149
+ }
150
+ /** StartItemPayment places the member's eCom order for one catalog item, charges it with
151
+ * `appleIAP` and starts its Payment, all server-side. Four different ids come back: the eCom
152
+ * order (`ecomOrderId`), the Wix Payments charge (`payment.wixTransactionId`), the wix-iap
153
+ * Payment (`payment.paymentId`) and the StoreKit `appAccountToken`. Keep them out of screen state. */
154
+ export type StartItemPaymentResult = {
155
+ status: "started";
156
+ payment: WixIapPayment;
157
+ storeProductId: string;
158
+ appAccountToken: string;
159
+ ecomOrderId: string;
160
+ } | WixIapFailure<StartItemPaymentErrorCode> | StartItemPaymentOutcomeUnknown;
119
161
  /** `matched`: the server verified the proof and paid the payment whose token the Apple transaction
120
162
  * carries. Its status may still be `approving`. */
121
163
  export type CompletePaymentResult = {
@@ -1,4 +1,4 @@
1
- import type { PurchasesAppBinding, WixIapFailure, WixIapFailureKind, WixIapOperation, WixIapPayment } from "./wix-payments-contract.js";
1
+ import type { EcomCatalogReference, PurchasesAppBinding, WixIapFailure, WixIapFailureKind, WixIapOperation, WixIapPayment } from "./wix-payments-contract.js";
2
2
  export interface WixIapCall {
3
3
  method: "GET" | "POST";
4
4
  path: string;
@@ -10,6 +10,10 @@ export interface CallScope {
10
10
  prefix: string;
11
11
  }
12
12
  export declare function startPaymentCall(scope: CallScope, wixTransactionId: string): WixIapCall;
13
+ /** Only the two ids StartItemPaymentRequest.item has: no quantity, options or member. */
14
+ export declare function startItemPaymentCall(scope: CallScope, item: EcomCatalogReference): WixIapCall;
15
+ /** CatalogReference's limits: `catalog_item_id` 1–36 characters, `catalog_app_id` a GUID. */
16
+ export declare function catalogItemOf(raw: unknown): EcomCatalogReference | null;
13
17
  /** The JWS goes byte-for-byte: the server derives the member, and the proof names the product. */
14
18
  export declare function completePaymentCall(scope: CallScope, signedTransaction: string): WixIapCall;
15
19
  export declare function paymentCall(scope: CallScope, paymentId: string): WixIapCall;
@@ -29,6 +33,15 @@ export interface StartedPayment {
29
33
  }
30
34
  /** D61: the token is this payment's purchase intent; no other field may stand in for it. */
31
35
  export declare function decodeStarted(raw: unknown, expected: PaymentExpectation): StartedPayment | null;
36
+ export interface StartedItemPayment extends StartedPayment {
37
+ ecomOrderId: string;
38
+ }
39
+ /** As StartPayment's answer, plus the member's eCom order. The Payment must name the requested
40
+ * item: StartItemPayment builds it from the catalog entry it looked up, whose `appProductId` is
41
+ * the catalog item id, so a Payment that names none is not known to be this item's. */
42
+ export declare function decodeStartedItem(raw: unknown, expected: PaymentExpectation & {
43
+ catalogItemId: string;
44
+ }): StartedItemPayment | null;
32
45
  /** CompletePayment's and GetPayment's answer: `{payment}`. */
33
46
  export declare function decodePaymentAnswer(raw: unknown, expected: PaymentExpectation): WixIapPayment | null;
34
47
  /** Maps a bridge rejection to a failure. The message itself is never kept: the bridge copies up
@@ -1,6 +1,6 @@
1
1
  import type { AppleTransaction } from "./index.js";
2
2
  import type { SessionProvider } from "./delivery-contract.js";
3
- import type { AppBindingSource, CompletePaymentResult, GetPaymentResult, IapAppHost, MemberIdentitySource, StartPaymentResult, WixIapRoute, WixTransport } from "./wix-payments-contract.js";
3
+ import type { AppBindingSource, EcomCatalogReference, StartItemPaymentResult, CompletePaymentResult, GetPaymentResult, IapAppHost, MemberIdentitySource, StartPaymentResult, WixIapRoute, WixTransport } from "./wix-payments-contract.js";
4
4
  export interface WixIapClientDependencies {
5
5
  /** The trusted host session; each call is bound to the generation current when it starts. */
6
6
  session: SessionProvider;
@@ -18,6 +18,12 @@ export interface WixIapClient {
18
18
  startPayment(input: {
19
19
  wixTransactionId: string;
20
20
  }): Promise<StartPaymentResult>;
21
+ /** StartItemPayment for one catalog item: the service places the member's eCom order, charges it
22
+ * and starts its Payment. Every call places a new order, so `outcomeUnknown` must never be
23
+ * resent as if nothing happened. Returns the store product, the token and the eCom order. */
24
+ startItemPayment(input: {
25
+ item: EcomCatalogReference;
26
+ }): Promise<StartItemPaymentResult>;
21
27
  /** CompletePayment with held Apple proof, sent unchanged: the service pays the payment whose
22
28
  * token the transaction carries. Success can still be `approving`. */
23
29
  completePayment(transaction: AppleTransaction): Promise<CompletePaymentResult>;
@@ -32,8 +38,8 @@ export interface WixIapClient {
32
38
  *
33
39
  * The shared checkout (`createIapCommerce`) builds it with Serve's IAP route for an app whose binary
34
40
  * carries a purchases-app binding; `route` stays a parameter with no default. It calls
35
- * StartPayment (`POST …/payments/start`), CompletePayment (`POST …/payments/complete`)
36
- * and GetPayment (`GET …/payments/{id}`) through the
41
+ * StartPayment (`POST …/payments/start`), StartItemPayment (`POST …/payments/start-item`, not yet
42
+ * deployed), CompletePayment (`POST …/payments/complete`) and GetPayment (`GET …/payments/{id}`) through the
37
43
  * `wix_api` bridge. A matched or approved Payment is not durable access and never finishes the
38
44
  * store transaction.
39
45
  *
@@ -1,4 +1,4 @@
1
- import type { AppBindingSource, CatalogReference, Clock, DeliveryState, HostCallExpectation, IapCatalogPricing, MemberIdentitySource, SessionProvider, TransactionStore, WixIapClient } from "@wix/himalaya/iap";
1
+ import type { AppBindingSource, CatalogReference, Clock, DeliveryState, EcomCatalogReference, HostCallExpectation, IapCatalogPricing, MemberIdentitySource, SessionProvider, TransactionStore, WixIapClient } from "@wix/himalaya/iap";
2
2
  /** The host's Wix REST bridge (`himalaya.wixApi`). Resolves a 2xx body; rejects with
3
3
  * `HTTP <status> [<code>]: <message>` otherwise. Credentials are attached natively.
4
4
  * Same positional shape as the runtime's `wixApiCall`: `expectation` is bridge metadata for a
@@ -72,6 +72,13 @@ export type OrderAttempt = {
72
72
  status: "sessionChanged";
73
73
  };
74
74
  export type AccessRead = "granted" | "pending" | "none" | "unavailable" | "sessionChanged";
75
+ /** An item wix-iap can order itself (StartItemPayment): the item as eCom's catalog reference, and
76
+ * how the adapter finds the eCom order that call places again. */
77
+ export interface ItemPayment {
78
+ catalogItem: EcomCatalogReference;
79
+ /** The reference `readAccess` reads for the eCom order StartItemPayment placed. */
80
+ verticalRefOf(ecomOrderId: string): VerticalRef;
81
+ }
75
82
  /** The only per-vertical code. Every call goes through the session-bound bridge it is given. */
76
83
  export interface IapOrderAdapter {
77
84
  /** The catalog kind it sells (`onlineProgram`, `pricingPlan`, `storesProduct`, or a custom one). */
@@ -90,6 +97,9 @@ export interface IapOrderAdapter {
90
97
  /** The member's access to an item before any order exists (bought through Wix, say). Read-only:
91
98
  * never opens or prepares an order. An adapter without it shows Get access until a sale says otherwise. */
92
99
  currentAccess?(item: IapOrderItem, bridge: SessionBoundBridge): Promise<AccessRead>;
100
+ /** When the platform enables StartItemPayment, an eligible item whose order wix-iap places itself
101
+ * instead of `openOrder`. Null for an item outside that shape, which keeps `openOrder`. */
102
+ itemPayment?(item: IapOrderItem): ItemPayment | null;
93
103
  }
94
104
  /** Durable, member-partitioned purchase references. Ids only: never a proof or a credential, and
95
105
  * the member id is stored only as a one-way hash in the key. */
@@ -99,9 +109,12 @@ export interface OrderPartitionKey {
99
109
  /** The signed-in member's Wix id, from the host session (wix-iap records purchases against it). */
100
110
  memberId: string;
101
111
  }
102
- /** `held`: Apple charged, and CompletePayment refused the proof without recording it, so the
103
- * transaction stays unfinished and is retried. `needsSupport`: recorded and refused for good. */
104
- export type OrderRefStage = "ordered" | "charged" | "started" | "submitted" | "held" | "needsSupport";
112
+ /** `startingItem`: a StartItemPayment was or is about to be sent and its answer is not stored, so
113
+ * the service may have placed an order this device knows nothing of; nothing else is sold for the
114
+ * item until it expires. `held`: Apple charged, and CompletePayment refused the proof without
115
+ * recording it, so the transaction stays unfinished and is retried. `needsSupport`: recorded and
116
+ * refused for good. */
117
+ export type OrderRefStage = "startingItem" | "ordered" | "charged" | "started" | "submitted" | "held" | "needsSupport";
105
118
  export interface OrderRef {
106
119
  /** `<kind>:<id>` of the item, or `payment:<paymentId>` for a payment with no local order. */
107
120
  key: string;
@@ -135,7 +148,7 @@ export interface OrderRefStore {
135
148
  siteId: string;
136
149
  }): boolean | null;
137
150
  }
138
- export type OrderFailureCode = "notEnabled" | "notConfigured" | "signInRequired" | "unsupportedItem" | "notAppleRoute" | "storageUnavailable" | "approvalRequired" | "orderClosed" | "orderRefused" | "chargeFailed" | "paymentRefused" | "paymentHeld" | "alreadyOwned" | "paymentInProgress" | "productChanged" | "invalidAssociation" | "needsSupport" | "unavailable" | "sessionChanged";
151
+ export type OrderFailureCode = "notEnabled" | "notConfigured" | "signInRequired" | "unsupportedItem" | "notAppleRoute" | "storageUnavailable" | "approvalRequired" | "orderClosed" | "orderRefused" | "chargeFailed" | "paymentRefused" | "paymentHeld" | "alreadyOwned" | "paymentInProgress" | "productChanged" | "invalidAssociation" | "needsSupport" | "unavailable" | "sessionChanged" | "outcomeUnknown";
139
152
  /** Progress of a payment this device handed to wix-iap, tracked from its durable reference. */
140
153
  export type PaymentAccess = "processing" | "granted" | "accessUnknown" | "needsSupport";
141
154
  export interface PaymentProgress {
@@ -1,6 +1,8 @@
1
1
  import type { AppleIapCheckout, AppleIapCheckoutDependencies, AppleIapCheckoutState } from "./apple-iap-contract.js";
2
+ /** `itemPaymentEnabled`: platform configuration (checkout-source.ts), never a screen's. */
2
3
  export declare function createAppleIapCheckoutWith(deps: AppleIapCheckoutDependencies & {
3
4
  enabled: boolean;
5
+ itemPaymentEnabled?: boolean;
4
6
  }): AppleIapCheckout;
5
7
  /** What a checkout that is not enabled answers: nothing sold, nothing tracked. */
6
8
  export declare function notEnabledState(): AppleIapCheckoutState;
@@ -3,3 +3,11 @@ export declare const HIMALAYA_SERVE_CHECKOUT_ROUTES: AppleIapCheckoutRoutes;
3
3
  export declare function appleIapCheckoutRoutes(): AppleIapCheckoutRoutes | null;
4
4
  /** The low-level factory's switch: on whenever the production routes exist. */
5
5
  export declare function appleIapCheckoutEnabled(): boolean;
6
+ /**
7
+ * Whether an item whose adapter names it in eCom's catalog (a Wix Stores product) is paid through
8
+ * wix-iap StartItemPayment, which places the member's eCom order server-side. The same switch as
9
+ * the Stores sale rule (`STORES_ITEM_PAYMENT_ENABLED`, @himalaya/iap), so Stores items reach an App
10
+ * Store route only when this path sells them. Turning it off again stops only new attempts: stored
11
+ * ones are still held, completed and tracked (docs/iap-wix-checkout.md).
12
+ */
13
+ export declare function itemPaymentEnabled(): boolean;
@@ -14,6 +14,8 @@ export interface CommerceHost {
14
14
  }
15
15
  export interface IapCommerceDependencies {
16
16
  routes: AppleIapCheckoutRoutes | null;
17
+ /** StartItemPayment for items whose adapter names them in eCom's catalog (checkout-source.ts). */
18
+ itemPaymentEnabled?: boolean;
17
19
  pricing: IapCatalogPricing;
18
20
  binding: AppBindingSource;
19
21
  /** One provider for the wix-iap client and the checkout: every step compares its generations. */
@@ -29,6 +29,9 @@ export interface WixOrderBackendDependencies {
29
29
  /** Whether Apple may already be charging for this product: an unfinished transaction, or an Ask
30
30
  * to Buy request awaiting approval. Asked inside the purchase job, after any reconcile. */
31
31
  productBusy?(productId: string): boolean;
32
+ /** Pay for an item its adapter names in eCom's catalog with StartItemPayment. Off: every item
33
+ * goes through its adapter's own order. Platform configuration (checkout-source.ts). */
34
+ itemPaymentEnabled?: boolean;
32
35
  report(event: OrderEvent): void;
33
36
  }
34
37
  export declare function createWixOrderBackend(deps: WixOrderBackendDependencies): DeliveryBackend;
@@ -3,5 +3,6 @@ export { iapPurchaseFields } from "./purchase-fields.js";
3
3
  export { createAppleIapCheckout } from "./apple-iap.js";
4
4
  export { onlineProgramOrders, pricingPlanOrders, storesProductOrders, classifyCart } from "./iap-verticals/index.js";
5
5
  export { createWorkerOrderRefStore } from "./order-refs.js";
6
+ export { itemPaymentEnabled } from "./checkout-source.js";
6
7
  export type { AccessRead, AppleIapCheckout, AppleIapCheckoutDependencies, AppleIapCheckoutPhase, AppleIapCheckoutState, BridgeOutcome, BridgeRefusal, CashierRoute, IapEligibility, IapOrderAdapter, IapOrderItem, OrderAttempt, OrderFailureCode, OrderPartitionKey, OrderRef, OrderRefPartition, OrderRefStage, OrderRefStore, PaymentAccess, PaymentProgress, SessionBoundBridge, VerticalRef, WixBridge, } from "./apple-iap-contract.js";
7
8
  export type { AppleIapCheckoutRoutes, IapCommerce, IapCommerceOptions, IapPurchaseCopy, IapPurchaseFields, IapPurchaseGap, IapPurchaseReadiness, } from "./commerce-contract.js";
@@ -6,7 +6,11 @@ export interface KeyValueStorage {
6
6
  /** How long (7 days) a payment Apple charged but Wix did not take keeps a support hold: its item
7
7
  * is not sold again meanwhile. A literal: an expression at module scope is kept in every bundle. */
8
8
  export declare const NEEDS_SUPPORT_HOLD_MS = 604800000;
9
- /** Drops every hold older than NEEDS_SUPPORT_HOLD_MS, whatever its key (an item, or a `payment:`
9
+ /** How long (1 hour) a StartItemPayment whose answer was never stored blocks its item: wix-iap's
10
+ * `PENDING_TTL`. By then a Payment that answer may have started is canceled, and its token never
11
+ * reached StoreKit, so nothing can pay the order it placed. A literal, as above. */
12
+ export declare const ITEM_START_HOLD_MS = 3600000;
13
+ /** Drops every hold older than its stage's hold time, whatever its key (an item, or a `payment:`
10
14
  * with no local order), so holds never accumulate and lock the member out. A held proof still
11
15
  * unfinished renews its hold on every retry, so only one Apple no longer delivers expires. Returns
12
16
  * the keys it removed. */