@wix/himalaya-cli 0.1632.0 → 0.1634.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.
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments-contract.d.ts +4 -14
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments-wire.d.ts +2 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments.d.ts +1 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/apple-iap-contract.d.ts +26 -13
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/apple-iap-core.d.ts +0 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/checkout-source.d.ts +3 -10
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/commerce-core.d.ts +0 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-order-backend.d.ts +0 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/stores.d.ts +2 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/index.d.ts +2 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/loyalty/src/index.d.ts +64 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/members-feed-viewer/src/index.d.ts +10 -6
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/members-v1/src/index.d.ts +36 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap-checkout.mjs +13 -45
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap.mjs +2 -4
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +7 -11
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-loyalty.mjs +39 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-members-feed-viewer.mjs +8 -7
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-members.mjs +29 -0
- package/dist/browser-plane/assets.json +166 -0
- package/dist/browser-plane/host.html +156 -0
- package/dist/browser-plane/package-reader.js +4 -0
- package/dist/browser-plane/preview-deferred/368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5.bin +0 -0
- package/dist/browser-plane/preview-deferred/37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29.bin +0 -0
- package/dist/browser-plane/preview-deferred/4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02.bin +0 -0
- package/dist/browser-plane/preview-deferred/521a0e528916d678d7588b2cddf3dadd3bb959a6d62426382f61c77a82017e35.bin +1 -0
- package/dist/browser-plane/preview-deferred/62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9.bin +0 -0
- package/dist/browser-plane/preview-deferred/642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e.bin +0 -0
- package/dist/browser-plane/preview-deferred/97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1.bin +0 -0
- package/dist/browser-plane/preview-deferred/a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e.bin +28 -0
- package/dist/browser-plane/preview-deferred/bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa.bin +0 -0
- package/dist/browser-plane/preview-deferred/c3457ce58c96b65f303fec0ddf5f06733004eaf9e21e62302b155ec63a7765f7.bin +56 -0
- package/dist/browser-plane/preview-deferred/d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134.bin +0 -0
- package/dist/browser-plane/preview-deferred/dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b.bin +0 -0
- package/dist/browser-plane/preview-deferred/dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5.bin +0 -0
- package/dist/browser-plane/preview-deferred/ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf.bin +0 -0
- package/dist/browser-plane/sw.js +13 -0
- package/dist/browser-plane/t5-frame.html +350 -0
- package/dist/browser-plane/t5-worker-frame.html +350 -0
- package/dist/cli.mjs +6499 -5089
- package/dist/preview-assets.generated.bin +0 -0
- package/fixtures/wix-canned.json +34 -1
- package/guides/getting-started.md +2 -1
- package/guides/himi-json-output.md +8 -0
- package/guides/himi-skill.md +2 -1
- package/guides/iap-screen-adoption.md +4 -4
- package/guides/importable-sdks.md +1 -1
- package/guides/one-app-section-mappings.md +3 -3
- package/guides/one-app-to-himi-app.md +81 -5
- package/guides/sdk-reference.json +8862 -4388
- package/guides/skill.md +11 -1
- package/package.json +3 -3
- package/templates/beauty-salon/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +1 -1
- package/templates/branded-lite/config.ts +7 -0
- package/templates/branded-lite/dev/index.ts +3340 -1890
- package/templates/branded-lite/himalaya.content.json +3 -0
- package/templates/branded-lite/l10n/en.json +8 -4
- package/templates/branded-lite/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/branded-lite/tier5-src/_shared/business-chat-history.ts +4 -1
- package/templates/branded-lite/tier5-src/_shared/business-chat-presenter.ts +2 -7
- package/templates/branded-lite/tier5-src/_shared/header-badges.ts +1 -1
- package/templates/branded-lite/tier5-src/_shared/inbox-rooms.ts +68 -0
- package/templates/branded-lite/tier5-src/_shared/loyalty-offerings.ts +73 -0
- package/templates/branded-lite/tier5-src/_shared/member-activity.ts +34 -0
- package/templates/branded-lite/tier5-src/_shared/member-row-extras.ts +167 -0
- package/templates/branded-lite/tier5-src/_shared/notification-target.ts +141 -0
- package/templates/branded-lite/tier5-src/_shared/source-badges.ts +6 -4
- package/templates/branded-lite/tier5-src/_shared/wix-member-links.ts +114 -0
- package/templates/branded-lite/tier5-src/business-chat/index.ts +114 -59
- package/templates/branded-lite/tier5-src/himi-branded-lite-inbox/index.ts +83 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-loyalty/earning.ts +148 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-loyalty/index.ts +57 -31
- package/templates/branded-lite/tier5-src/himi-branded-lite-loyalty-rewards/index.ts +208 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-notifications/index.ts +62 -7
- package/templates/branded-lite/tier5-src/himi-store-product/index.ts +1 -1
- package/templates/branded-lite/tier5-src/wix-spaces-members/index.ts +60 -12
- package/templates/community-club/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/events-meetups/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/gym-fitness/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +1 -1
- package/templates/nonprofit-cause/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/podcast-creator/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/portfolio-creative/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +1 -1
- package/templates/restaurant/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/retail-store/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/retail-store/tier5-src/himi-store-product/index.ts +1 -1
- package/templates/salon-spa/dev/index.ts +112 -70
- package/templates/salon-spa/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/salon-spa/tier5-src/_shared/business-chat-history.ts +4 -1
- package/templates/salon-spa/tier5-src/_shared/business-chat-presenter.ts +2 -7
- package/templates/salon-spa/tier5-src/_shared/inbox-rooms.ts +68 -0
- package/templates/salon-spa/tier5-src/business-chat/index.ts +114 -59
- package/templates/yoga-studio/tier5-src/_shared/branded-lite-hosted.ts +1 -0
|
@@ -40,19 +40,10 @@ export interface AppleSaleRule {
|
|
|
40
40
|
export declare const BOOKINGS_APPLE_SALES_ENABLED = true;
|
|
41
41
|
export declare const EVENTS_APPLE_SALES_ENABLED = true;
|
|
42
42
|
/**
|
|
43
|
-
* Whether Wix Stores items sell through the App Store
|
|
44
|
-
* (catalyst-server #24496), which places
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* `APPLE_SALE_RULES` and selects `itemPaymentEnabled` in @himalaya/iap-checkout.
|
|
48
|
-
*/
|
|
49
|
-
export declare const STORES_ITEM_PAYMENT_ENABLED = false;
|
|
50
|
-
/**
|
|
51
|
-
* Whether Wix Stores items sell through the App Store at all: the Stores rule in `APPLE_SALE_RULES`
|
|
52
|
-
* and the product screen's Buy. With StartItemPayment off, a sale uses the app's own order: an eCom
|
|
53
|
-
* checkout and order, its `appleIAP` cashier charge, then StartPayment. ON for mapped digital
|
|
54
|
-
* products. Member checkout, the eCom IAP flag, cashier item identity and digital fulfillment
|
|
55
|
-
* remain unverified in Sandbox.
|
|
43
|
+
* Whether Wix Stores items sell through the App Store: the Stores rule in `APPLE_SALE_RULES` and the
|
|
44
|
+
* product screen's Buy. A sale is wix-iap StartItemPayment (catalyst-server #24496), which places and
|
|
45
|
+
* charges the member's eCom order for one catalog item server-side; the device never opens an eCom
|
|
46
|
+
* checkout or a cashier charge for it. ON for mapped digital products.
|
|
56
47
|
*/
|
|
57
48
|
export declare const STORES_APPLE_SALES_ENABLED = true;
|
|
58
49
|
/** StartItemPayment's CatalogReference: the purchases catalog sells a Stores product under its product
|
|
@@ -78,7 +69,6 @@ export declare const VIDEOS_APPLE_SALES_ENABLED = false;
|
|
|
78
69
|
*/
|
|
79
70
|
export interface AppleSaleOptions {
|
|
80
71
|
storesAppleSalesEnabled?: boolean;
|
|
81
|
-
storesItemPaymentEnabled?: boolean;
|
|
82
72
|
pricingPlanAppleSalesEnabled?: boolean;
|
|
83
73
|
bookingsAppleSalesEnabled?: boolean;
|
|
84
74
|
eventsAppleSalesEnabled?: boolean;
|
|
@@ -10,7 +10,8 @@ export interface CallScope {
|
|
|
10
10
|
prefix: string;
|
|
11
11
|
}
|
|
12
12
|
export declare function startPaymentCall(scope: CallScope, wixTransactionId: string): WixIapCall;
|
|
13
|
-
/**
|
|
13
|
+
/** The app by its bundle, like every device call (catalyst-server #24546), and only the two ids
|
|
14
|
+
* StartItemPaymentRequest.item has: no quantity, options or member. */
|
|
14
15
|
export declare function startItemPaymentCall(scope: CallScope, item: EcomCatalogReference): WixIapCall;
|
|
15
16
|
/** CatalogReference's limits: `catalog_item_id` 1–36 characters, `catalog_app_id` a GUID. */
|
|
16
17
|
export declare function catalogItemOf(raw: unknown): EcomCatalogReference | null;
|
|
@@ -38,8 +38,7 @@ export interface WixIapClient {
|
|
|
38
38
|
*
|
|
39
39
|
* The shared checkout (`createIapCommerce`) builds it with Serve's IAP route for an app whose binary
|
|
40
40
|
* carries a purchases-app binding; `route` stays a parameter with no default. It calls
|
|
41
|
-
* StartPayment (`POST …/payments/start`), StartItemPayment (`POST …/payments/start-item
|
|
42
|
-
* deployed), CompletePayment (`POST …/payments/complete`) and GetPayment (`GET …/payments/{id}`) through the
|
|
41
|
+
* StartPayment (`POST …/payments/start`), StartItemPayment (`POST …/payments/start-item`), CompletePayment (`POST …/payments/complete`) and GetPayment (`GET …/payments/{id}`) through the
|
|
43
42
|
* `wix_api` bridge. A matched or approved Payment is not durable access and never finishes the
|
|
44
43
|
* store transaction.
|
|
45
44
|
*
|
|
@@ -107,20 +107,28 @@ export interface OpeningGuard {
|
|
|
107
107
|
* `held`: still unknown, and it blocks this sale. `unrelated`: still unknown, but it targets other
|
|
108
108
|
* inventory than this sale's. */
|
|
109
109
|
export type OpeningResolution = "released" | "held" | "unrelated" | "unavailable" | "sessionChanged";
|
|
110
|
-
/** An item wix-iap
|
|
111
|
-
*
|
|
110
|
+
/** An item wix-iap orders itself (StartItemPayment): the item as eCom's catalog reference, and how
|
|
111
|
+
* the adapter finds the eCom order that call placed. */
|
|
112
112
|
export interface ItemPayment {
|
|
113
113
|
catalogItem: EcomCatalogReference;
|
|
114
114
|
/** The reference `readAccess` reads for the eCom order StartItemPayment placed. */
|
|
115
115
|
verticalRefOf(ecomOrderId: string): VerticalRef;
|
|
116
116
|
}
|
|
117
|
-
/**
|
|
118
|
-
export interface
|
|
117
|
+
/** What every vertical answers. Every call goes through the session-bound bridge it is given. */
|
|
118
|
+
export interface IapAdapterBase {
|
|
119
119
|
/** The catalog kind it sells (`onlineProgram`, `pricingPlan`, `storesProduct`, or a custom one). */
|
|
120
120
|
readonly kind: string;
|
|
121
|
-
readonly repeatable?: boolean;
|
|
122
121
|
/** Structural check before any call: one item, quantity 1, a supported shape. */
|
|
123
122
|
eligibility(item: IapOrderItem): IapEligibility;
|
|
123
|
+
/** The vertical's authoritative answer for the order's item and the signed-in member. */
|
|
124
|
+
readAccess(verticalRef: VerticalRef, bridge: SessionBoundBridge): Promise<AccessRead>;
|
|
125
|
+
/** The member's access to an item before any order exists (bought through Wix, say). Read-only:
|
|
126
|
+
* never opens or prepares an order. An adapter without it shows Get access until a sale says otherwise. */
|
|
127
|
+
currentAccess?(item: IapOrderItem, bridge: SessionBoundBridge): Promise<AccessRead>;
|
|
128
|
+
}
|
|
129
|
+
/** A vertical whose order the device opens; it is charged through cashier and paid with StartPayment. */
|
|
130
|
+
export interface IapVerticalOrderAdapter extends IapAdapterBase {
|
|
131
|
+
readonly repeatable?: boolean;
|
|
124
132
|
/** Opens, or reuses the vertical's own open, order for the signed-in member. */
|
|
125
133
|
/** Repeatable adapters call beforeCreate immediately before their first inventory write,
|
|
126
134
|
* after read-only checks, and abort without writing if it returns false. They call afterCreate
|
|
@@ -140,15 +148,20 @@ export interface IapOrderAdapter {
|
|
|
140
148
|
cashierOrderId: string;
|
|
141
149
|
verticalRef: VerticalRef;
|
|
142
150
|
}, bridge: SessionBoundBridge): Promise<OrderAttempt>;
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
|
|
150
|
-
|
|
151
|
+
itemPayment?: never;
|
|
152
|
+
}
|
|
153
|
+
/** A vertical whose order wix-iap places and charges server-side (StartItemPayment): the device
|
|
154
|
+
* never opens, charges or reopens one. */
|
|
155
|
+
export interface IapItemPaymentAdapter extends IapAdapterBase {
|
|
156
|
+
/** The catalog item to order, for an item `eligibility` accepted. */
|
|
157
|
+
itemPayment(item: IapOrderItem): ItemPayment;
|
|
158
|
+
openOrder?: never;
|
|
159
|
+
reopenOrder?: never;
|
|
160
|
+
repeatable?: never;
|
|
161
|
+
resolveOpening?: never;
|
|
151
162
|
}
|
|
163
|
+
/** The only per-vertical code. */
|
|
164
|
+
export type IapOrderAdapter = IapVerticalOrderAdapter | IapItemPaymentAdapter;
|
|
152
165
|
/** Durable, member-partitioned purchase references. Ids only: never a proof or a credential, and
|
|
153
166
|
* the member id is stored only as a one-way hash in the key. */
|
|
154
167
|
export interface OrderPartitionKey {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { AppleIapCheckout, AppleIapCheckoutDependencies, AppleIapCheckoutState } from "./apple-iap-contract.js";
|
|
2
|
-
/** `itemPaymentEnabled`: platform configuration (checkout-source.ts), never a screen's. */
|
|
3
2
|
export declare function createAppleIapCheckoutWith(deps: AppleIapCheckoutDependencies & {
|
|
4
3
|
enabled: boolean;
|
|
5
|
-
itemPaymentEnabled?: boolean;
|
|
6
4
|
}): AppleIapCheckout;
|
|
7
5
|
/** What a checkout that is not enabled answers: nothing sold, nothing tracked. */
|
|
8
6
|
export declare function notEnabledState(): AppleIapCheckoutState;
|
|
@@ -3,14 +3,7 @@ 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
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `STORES_ITEM_PAYMENT_ENABLED` in @himalaya/iap; otherwise an enabled Stores sale uses the app's
|
|
10
|
-
* own order. 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
|
-
/** Whether Wix Stores items sell through the App Store, by either path: StartItemPayment when
|
|
15
|
-
* `itemPaymentEnabled`, otherwise the app's own eCom order (`STORES_APPLE_SALES_ENABLED`). */
|
|
6
|
+
/** Whether Wix Stores items sell through the App Store: wix-iap StartItemPayment places and charges
|
|
7
|
+
* the member's eCom order (`STORES_APPLE_SALES_ENABLED` in @himalaya/iap). Turning it off stops only
|
|
8
|
+
* new attempts: stored ones are still held, completed and tracked (docs/iap-wix-checkout.md). */
|
|
16
9
|
export declare function storesAppleSalesEnabled(): boolean;
|
|
@@ -14,8 +14,6 @@ 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;
|
|
19
17
|
pricing: IapCatalogPricing;
|
|
20
18
|
binding: AppBindingSource;
|
|
21
19
|
/** One provider for the wix-iap client and the checkout: every step compares its generations. */
|
|
@@ -29,9 +29,6 @@ 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;
|
|
35
32
|
report(event: OrderEvent): void;
|
|
36
33
|
}
|
|
37
34
|
export declare function createWixOrderBackend(deps: WixOrderBackendDependencies): DeliveryBackend;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IapItemPaymentAdapter } from "../apple-iap-contract.js";
|
|
2
2
|
import type { IapPaymentRoute } from "@wix/himalaya/iap";
|
|
3
|
-
export declare const storesProductOrders:
|
|
3
|
+
export declare const storesProductOrders: IapItemPaymentAdapter;
|
|
4
4
|
/** How a cart may be paid: a single Apple-routed line of quantity 1 is an Apple sale; regular or
|
|
5
5
|
* disabled lines keep the existing checkout; any mix is refused; an unsettled route blocks. */
|
|
6
6
|
export declare function classifyCart(lines: ReadonlyArray<{
|
|
@@ -3,6 +3,6 @@ export { iapPurchaseFields } from "./purchase-fields.js";
|
|
|
3
3
|
export { createAppleIapCheckout } from "./apple-iap.js";
|
|
4
4
|
export { onlineProgramOrders, pricingPlanOrders, storesProductOrders, bookingOrders, eventTicketOrders, wixVideoOrders, classifyCart } from "./iap-verticals/index.js";
|
|
5
5
|
export { createWorkerOrderRefStore } from "./order-refs.js";
|
|
6
|
-
export {
|
|
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";
|
|
6
|
+
export { storesAppleSalesEnabled } from "./checkout-source.js";
|
|
7
|
+
export type { AccessRead, AppleIapCheckout, AppleIapCheckoutDependencies, AppleIapCheckoutPhase, AppleIapCheckoutState, BridgeOutcome, BridgeRefusal, CashierRoute, IapAdapterBase, IapEligibility, IapItemPaymentAdapter, IapOrderAdapter, IapOrderItem, IapVerticalOrderAdapter, OrderAttempt, OrderFailureCode, OrderPartitionKey, OrderRef, OrderRefPartition, OrderRefStage, OrderRefStore, PaymentAccess, PaymentProgress, SessionBoundBridge, VerticalRef, WixBridge, } from "./apple-iap-contract.js";
|
|
8
8
|
export type { AppleIapCheckoutRoutes, IapCommerce, IapCommerceOptions, IapPurchaseCopy, IapPurchaseFields, IapPurchaseGap, IapPurchaseReadiness, IapRestoreResult, } from "./commerce-contract.js";
|
|
@@ -67,6 +67,15 @@ export interface WixLoyaltyProgram {
|
|
|
67
67
|
monthsOfInactivity?: number;
|
|
68
68
|
expiringPointsPercentage?: number;
|
|
69
69
|
};
|
|
70
|
+
/** Mobile program settings (wix-loyalty-mobile viewer getOffering). */
|
|
71
|
+
socialMediaSettings?: {
|
|
72
|
+
channels?: {
|
|
73
|
+
type?: string;
|
|
74
|
+
enabled?: boolean;
|
|
75
|
+
id?: string;
|
|
76
|
+
url?: string;
|
|
77
|
+
}[];
|
|
78
|
+
};
|
|
70
79
|
}
|
|
71
80
|
export interface WixLoyaltyReward {
|
|
72
81
|
id: string;
|
|
@@ -78,6 +87,9 @@ export interface WixLoyaltyReward {
|
|
|
78
87
|
discountAmount?: {
|
|
79
88
|
configsByTier?: WixLoyaltyRewardConfig[];
|
|
80
89
|
};
|
|
90
|
+
spiDiscountAmount?: {
|
|
91
|
+
description?: string;
|
|
92
|
+
};
|
|
81
93
|
couponReward?: {
|
|
82
94
|
fixedAmount?: {
|
|
83
95
|
configsByTier?: WixLoyaltyRewardConfig[];
|
|
@@ -145,6 +157,7 @@ export interface WixLoyaltyTier {
|
|
|
145
157
|
id?: string;
|
|
146
158
|
tierDefinition?: {
|
|
147
159
|
name?: string;
|
|
160
|
+
description?: string;
|
|
148
161
|
icon?: WixLoyaltyImage;
|
|
149
162
|
};
|
|
150
163
|
requiredPoints?: number;
|
|
@@ -154,6 +167,12 @@ export interface WixLoyaltyEarningRule {
|
|
|
154
167
|
title?: string;
|
|
155
168
|
status?: string;
|
|
156
169
|
triggerActivityType?: string;
|
|
170
|
+
metadata?: {
|
|
171
|
+
canBeDeleted?: boolean;
|
|
172
|
+
ruleTypeTag?: {
|
|
173
|
+
ruleType?: string;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
157
176
|
fixedAmount?: {
|
|
158
177
|
configs?: {
|
|
159
178
|
tierId?: string;
|
|
@@ -200,4 +219,49 @@ export declare function getLoyaltyTiersProgram(readOptions?: WixCallOptions): Pr
|
|
|
200
219
|
export declare function listMyLoyaltyCoupons(readOptions?: WixCallOptions): Promise<{
|
|
201
220
|
loyaltyCoupons?: WixLoyaltyCoupon[];
|
|
202
221
|
}>;
|
|
222
|
+
/** Current-member mutation: the server chooses the account and checks reward cost.
|
|
223
|
+
* Never cache or queue this write; ambiguous failures require reconciliation.
|
|
224
|
+
* @scope member */
|
|
225
|
+
export declare function redeemMyLoyaltyReward(rewardId: string, options?: Pick<WixCallOptions, "site">): Promise<{
|
|
226
|
+
coupon?: WixLoyaltyCoupon;
|
|
227
|
+
}>;
|
|
228
|
+
export interface WixLoyaltyFollowedChannel {
|
|
229
|
+
id?: string;
|
|
230
|
+
accountId?: string;
|
|
231
|
+
channel?: string;
|
|
232
|
+
createdDate?: string;
|
|
233
|
+
}
|
|
234
|
+
/** Read the current member's registered social-follow channels. The caller cannot
|
|
235
|
+
* select another member or loyalty account.
|
|
236
|
+
* @scope member */
|
|
237
|
+
export declare function listMyLoyaltyFollowedChannels(options?: WixCallOptions): Promise<{
|
|
238
|
+
followedChannels?: WixLoyaltyFollowedChannel[];
|
|
239
|
+
}>;
|
|
240
|
+
/** Register a configured channel for the current member. This records the loyalty
|
|
241
|
+
* action; it neither opens the external URL nor verifies a third-party follow.
|
|
242
|
+
* @scope member — no caller-supplied account identifier. */
|
|
243
|
+
export declare function followMyLoyaltyChannel(channel: string, options?: Pick<WixCallOptions, "site">): Promise<{
|
|
244
|
+
followedChannel?: WixLoyaltyFollowedChannel;
|
|
245
|
+
}>;
|
|
246
|
+
export interface WixReferralReward {
|
|
247
|
+
id?: string;
|
|
248
|
+
rewardType?: string;
|
|
249
|
+
coupon?: {
|
|
250
|
+
id?: string;
|
|
251
|
+
code?: string;
|
|
252
|
+
status?: string;
|
|
253
|
+
couponSpecification?: {
|
|
254
|
+
name?: string;
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
/** Member-owned referral coupons. Source: ambassador-loyalty-referral-v1-referral-reward
|
|
259
|
+
* 1.0.63 http.impl.js and wix-loyalty-mobile viewer/helpers.ts at faa624c.
|
|
260
|
+
* The public-looking /referral-rewards mount is 404; /_api is the REST mount.
|
|
261
|
+
* Query is read-only; contactId is always "me". An uninstalled app is known empty,
|
|
262
|
+
* whereas permission/network errors must remain unknown to the consumer.
|
|
263
|
+
* @scope member */
|
|
264
|
+
export declare function listMyReferralRewards(options?: WixCallOptions): Promise<{
|
|
265
|
+
referralRewards: WixReferralReward[];
|
|
266
|
+
}>;
|
|
203
267
|
export * from "./extensions.js";
|
|
@@ -64,13 +64,17 @@ export interface MfvNotification {
|
|
|
64
64
|
}
|
|
65
65
|
/** Reset the learned route. Tests only — there is no runtime caller. */
|
|
66
66
|
export declare function __resetMfvRouteForTests(): void;
|
|
67
|
-
/** List the signed-in member's notifications, newest first. MOBILE channel.
|
|
67
|
+
/** List the signed-in member's notifications, newest first. MOBILE channel. Needs a Member
|
|
68
|
+
* transport: a Visitor is refused (403) and an old native build refuses the route, so both
|
|
69
|
+
* reject. The bound site is stamped by the host, so no site argument is needed. */
|
|
68
70
|
export declare function queryNotifications(limit?: number, options?: WixCallOptions): Promise<MfvNotification[]>;
|
|
69
|
-
/** Source member-app MOBILE/UNSEEN aggregate, capped at 100.
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
/** Source member-app MOBILE/UNSEEN aggregate, capped at 100. Needs a Member transport; old native
|
|
72
|
+
* binaries and web reject. A missing, malformed or failed result is unavailable, never an
|
|
73
|
+
* authoritative zero. The host fixes the business: a bound capability sends its own site, and the
|
|
74
|
+
* multi-tenant Player (no bound site) lets the Member credential decide. `site` is optional and only
|
|
75
|
+
* ever names the bound site: native refuses any other, and an unbound host refuses every named one. */
|
|
76
|
+
export declare function countUnseenNotifications(options?: {
|
|
77
|
+
site?: string;
|
|
74
78
|
}): Promise<number>;
|
|
75
79
|
/** Mark the given notification ids as READ (bulk, by-filter). */
|
|
76
80
|
export declare function markRead(ids: string[]): Promise<void>;
|
|
@@ -59,6 +59,8 @@ export interface WixMemberContact {
|
|
|
59
59
|
lastName?: string;
|
|
60
60
|
phones?: string[];
|
|
61
61
|
emails?: string[];
|
|
62
|
+
/** Local calendar date (YYYY-MM-DD), returned by getMyMember with FULL fieldsets. */
|
|
63
|
+
birthdate?: string;
|
|
62
64
|
}
|
|
63
65
|
export interface WixMember {
|
|
64
66
|
id: string;
|
|
@@ -224,3 +226,37 @@ export declare function getFollowCounts(memberId: string, options?: WixCallOptio
|
|
|
224
226
|
* /members/v3/followers/my/connections. Returns false on any miss. May 403 →
|
|
225
227
|
* caller should default to false. */
|
|
226
228
|
export declare function isFollowingMember(targetId: string): Promise<boolean>;
|
|
229
|
+
/** When a member last opened the app, as the One App computes it: `unit` is "min", "hour" or "day", and `ts`
|
|
230
|
+
* (epoch milliseconds, as a string) is there for a day count the One App prints as a date. */
|
|
231
|
+
export interface WixMemberLastOpenApp {
|
|
232
|
+
amount?: number;
|
|
233
|
+
unit?: string;
|
|
234
|
+
ts?: string;
|
|
235
|
+
}
|
|
236
|
+
/** One member's activity from the One App members service. */
|
|
237
|
+
export interface WixMemberActivity {
|
|
238
|
+
id: string;
|
|
239
|
+
/** Server role, e.g. "MEMBER". */
|
|
240
|
+
role?: string;
|
|
241
|
+
online: boolean;
|
|
242
|
+
/** `null` for a member who never opened the app. */
|
|
243
|
+
lastOpenApp: WixMemberLastOpenApp | null;
|
|
244
|
+
}
|
|
245
|
+
/** Role and last-active for up to 100 members by id — POST apps.wix.com/_api/members-one-app/api/members.
|
|
246
|
+
* Public Members v1 carries neither: `lastLoginDate` is a login time and needs the owner-only FULL field
|
|
247
|
+
* set. The One App service answers a Visitor with this, so a members list can show "Active 11h ago".
|
|
248
|
+
* A member id the service does not know is left out of the answer.
|
|
249
|
+
*
|
|
250
|
+
* Pinned One App member source, like the notification count: it needs a native runtime that allows this
|
|
251
|
+
* one route for the bound business. Older native builds and web reject, so callers treat a rejection as
|
|
252
|
+
* "no activity to show", never as an error in their own list.
|
|
253
|
+
*
|
|
254
|
+
* @scope visitor — a Visitor reads it as well as a signed-in member; the native runtime allows only the bound business's route. */
|
|
255
|
+
export declare function queryMemberActivity(ids: string[]): Promise<WixMemberActivity[]>;
|
|
256
|
+
/** Which of `targetIds` the signed-in member follows, in ONE call — POST
|
|
257
|
+
* /members/v3/followers/my/connections. For a members list that shows a Follow control per row.
|
|
258
|
+
* A Visitor gets an empty answer (no connections), so nothing here needs a sign-in; callers still
|
|
259
|
+
* skip the call for a Visitor.
|
|
260
|
+
*
|
|
261
|
+
* @scope visitor — an anonymous visitor session is enough; it answers an empty list when nobody is signed in. */
|
|
262
|
+
export declare function listFollowedMembers(targetIds: string[]): Promise<string[]>;
|
|
@@ -707,7 +707,6 @@ var HIMALAYA_SERVE_IAP_ROUTE = { prefix: "/himalaya-serve/v1/iap" };
|
|
|
707
707
|
var BOOKINGS_APPLE_SALES_ENABLED = true;
|
|
708
708
|
var EVENTS_APPLE_SALES_ENABLED = true;
|
|
709
709
|
var ATTENDANCE_SALE_RULE = { appProductId: (id) => id, productType: "CONSUMABLE" };
|
|
710
|
-
var STORES_ITEM_PAYMENT_ENABLED = false;
|
|
711
710
|
var STORES_APPLE_SALES_ENABLED = true;
|
|
712
711
|
var STORES_PRODUCT_SALE_RULE = { appProductId: (id) => id, productType: "NON_CONSUMABLE" };
|
|
713
712
|
var ONLINE_PROGRAM_SALE_RULE = { appProductId: (id) => id, productType: "NON_CONSUMABLE" };
|
|
@@ -718,7 +717,7 @@ var VIDEO_SALE_RULE = { appProductId: (id) => id, productType: "NON_CONSUMABLE"
|
|
|
718
717
|
function appleSaleRules(options = {}) {
|
|
719
718
|
return {
|
|
720
719
|
onlineProgram: ONLINE_PROGRAM_SALE_RULE,
|
|
721
|
-
...
|
|
720
|
+
...options.storesAppleSalesEnabled ?? STORES_APPLE_SALES_ENABLED ? { storesProduct: STORES_PRODUCT_SALE_RULE } : {},
|
|
722
721
|
...options.pricingPlanAppleSalesEnabled ?? PRICING_PLAN_APPLE_SALES_ENABLED ? { pricingPlan: PRICING_PLAN_SALE_RULE } : {},
|
|
723
722
|
...options.bookingsAppleSalesEnabled ?? BOOKINGS_APPLE_SALES_ENABLED ? { bookingsService: ATTENDANCE_SALE_RULE } : {},
|
|
724
723
|
...options.eventsAppleSalesEnabled ?? EVENTS_APPLE_SALES_ENABLED ? { eventsTicket: ATTENDANCE_SALE_RULE } : {},
|
|
@@ -1068,7 +1067,7 @@ function startPaymentCall(scope, wixTransactionId) {
|
|
|
1068
1067
|
return post(scope, "/payments/start", { appleBundleId: scope.binding.bundleId, wixTransactionId });
|
|
1069
1068
|
}
|
|
1070
1069
|
function startItemPaymentCall(scope, item) {
|
|
1071
|
-
return post(scope, "/payments/start-item", {
|
|
1070
|
+
return post(scope, "/payments/start-item", { appleBundleId: scope.binding.bundleId, item: { catalogItemId: item.catalogItemId, catalogAppId: item.catalogAppId } });
|
|
1072
1071
|
}
|
|
1073
1072
|
function catalogItemOf(raw) {
|
|
1074
1073
|
const item = isObject3(raw) ? raw : {};
|
|
@@ -1615,11 +1614,8 @@ function appleIapCheckoutRoutes() {
|
|
|
1615
1614
|
function appleIapCheckoutEnabled() {
|
|
1616
1615
|
return appleIapCheckoutRoutes() !== null;
|
|
1617
1616
|
}
|
|
1618
|
-
function itemPaymentEnabled() {
|
|
1619
|
-
return STORES_ITEM_PAYMENT_ENABLED;
|
|
1620
|
-
}
|
|
1621
1617
|
function storesAppleSalesEnabled() {
|
|
1622
|
-
return STORES_APPLE_SALES_ENABLED
|
|
1618
|
+
return STORES_APPLE_SALES_ENABLED;
|
|
1623
1619
|
}
|
|
1624
1620
|
|
|
1625
1621
|
// ../../stdlib/flows/iap-checkout/src/cashier-charges.ts
|
|
@@ -1977,8 +1973,8 @@ function createWixOrderBackend(deps) {
|
|
|
1977
1973
|
if (unresolved) return contextResult(catalogRef, unresolved);
|
|
1978
1974
|
const blocked = saleBlocked(sale);
|
|
1979
1975
|
if (blocked) return contextResult(catalogRef, blocked);
|
|
1980
|
-
const
|
|
1981
|
-
return
|
|
1976
|
+
const { adapter } = sale;
|
|
1977
|
+
return paidByItem(adapter) ? startItemFor(sale, adapter.itemPayment(sale.item)) : startOrderFor({ ...sale, adapter });
|
|
1982
1978
|
}
|
|
1983
1979
|
async function startOrderFor(sale) {
|
|
1984
1980
|
const ordered = await orderFor(sale);
|
|
@@ -2298,6 +2294,9 @@ function createWixOrderBackend(deps) {
|
|
|
2298
2294
|
}
|
|
2299
2295
|
return { getPurchaseContext, getMemberContext, submitProof };
|
|
2300
2296
|
}
|
|
2297
|
+
function paidByItem(adapter) {
|
|
2298
|
+
return typeof adapter.itemPayment === "function";
|
|
2299
|
+
}
|
|
2301
2300
|
var RETRYABLE = { status: "retryable" };
|
|
2302
2301
|
var STALE2 = { stop: true, result: "retryable" };
|
|
2303
2302
|
function stopWith(result, failure3) {
|
|
@@ -2416,7 +2415,6 @@ function enabledCheckout(deps) {
|
|
|
2416
2415
|
bridge,
|
|
2417
2416
|
itemFor: (key) => sales.get(key),
|
|
2418
2417
|
productBusy,
|
|
2419
|
-
itemPaymentEnabled: deps.itemPaymentEnabled,
|
|
2420
2418
|
report: onEvent
|
|
2421
2419
|
});
|
|
2422
2420
|
const coordinator = createPurchaseCoordinator({
|
|
@@ -2947,7 +2945,6 @@ function createIapCommerceWith(deps) {
|
|
|
2947
2945
|
stopWatchingSession = void 0;
|
|
2948
2946
|
checkout = createAppleIapCheckoutWith({
|
|
2949
2947
|
enabled: true,
|
|
2950
|
-
itemPaymentEnabled: deps.itemPaymentEnabled,
|
|
2951
2948
|
wixIap: deps.wixIapClient({ host, route: routes.wixIap }),
|
|
2952
2949
|
binding: deps.binding,
|
|
2953
2950
|
session: deps.session,
|
|
@@ -3085,7 +3082,6 @@ function createIapCommerce(options = {}) {
|
|
|
3085
3082
|
const binding = sharedHostAppBindingSource();
|
|
3086
3083
|
return createIapCommerceWith({
|
|
3087
3084
|
routes: appleIapCheckoutRoutes(),
|
|
3088
|
-
itemPaymentEnabled: itemPaymentEnabled(),
|
|
3089
3085
|
pricing: createIapCatalogPricing({ onChange: options.onChange }),
|
|
3090
3086
|
binding,
|
|
3091
3087
|
session,
|
|
@@ -3123,7 +3119,7 @@ function preferenceSite() {
|
|
|
3123
3119
|
|
|
3124
3120
|
// ../../stdlib/flows/iap-checkout/src/apple-iap.ts
|
|
3125
3121
|
function createAppleIapCheckout(deps) {
|
|
3126
|
-
return createAppleIapCheckoutWith({ ...deps, enabled: appleIapCheckoutEnabled()
|
|
3122
|
+
return createAppleIapCheckoutWith({ ...deps, enabled: appleIapCheckoutEnabled() });
|
|
3127
3123
|
}
|
|
3128
3124
|
|
|
3129
3125
|
// ../../stdlib/flows/iap-checkout/src/iap-verticals/shared.ts
|
|
@@ -3353,22 +3349,18 @@ var WIX_STORES_APP = "215238eb-22a5-4c36-9e7b-e7c08025e04e";
|
|
|
3353
3349
|
var storesProductOrders = {
|
|
3354
3350
|
kind: KIND3,
|
|
3355
3351
|
eligibility,
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
readAccess: readAccess3,
|
|
3359
|
-
itemPayment
|
|
3352
|
+
itemPayment,
|
|
3353
|
+
readAccess: readAccess3
|
|
3360
3354
|
};
|
|
3361
3355
|
function eligibility(item) {
|
|
3362
3356
|
const single = singleUnitOf(KIND3, item);
|
|
3363
3357
|
if (!single.eligible) return single;
|
|
3364
3358
|
const catalog = item.catalogReference;
|
|
3365
3359
|
const variant = catalog?.options && Object.keys(catalog.options).length > 0;
|
|
3366
|
-
return catalog && !variant && isNonEmpty3(catalog.appId) && catalog.catalogItemId === item.reference.id ? single : UNSUPPORTED;
|
|
3360
|
+
return catalog && !variant && isNonEmpty3(catalog.appId) && catalog.appId.toLowerCase() === WIX_STORES_APP && catalog.catalogItemId === item.reference.id ? single : UNSUPPORTED;
|
|
3367
3361
|
}
|
|
3368
3362
|
function itemPayment(item) {
|
|
3369
|
-
|
|
3370
|
-
if (!eligibility(item).eligible || catalog?.appId.toLowerCase() !== WIX_STORES_APP) return null;
|
|
3371
|
-
return { catalogItem: { catalogItemId: catalog.catalogItemId, catalogAppId: WIX_STORES_APP }, verticalRefOf: (orderId) => ({ orderId }) };
|
|
3363
|
+
return { catalogItem: { catalogItemId: item.reference.id, catalogAppId: WIX_STORES_APP }, verticalRefOf: (orderId) => ({ orderId }) };
|
|
3372
3364
|
}
|
|
3373
3365
|
function classifyCart(lines) {
|
|
3374
3366
|
if (lines.length === 0 || lines.some((line) => line.route === "resolving" || line.route === "unavailable")) return "blocked";
|
|
@@ -3376,21 +3368,6 @@ function classifyCart(lines) {
|
|
|
3376
3368
|
if (apple.length === 0) return "regular";
|
|
3377
3369
|
return lines.length === 1 && apple[0].quantity === 1 ? "appleIap" : "mixedRefused";
|
|
3378
3370
|
}
|
|
3379
|
-
async function openOrder3(item, bridge) {
|
|
3380
|
-
const checkout = await bridge.call("POST", "/ecom/v1/checkouts", { lineItems: [{ quantity: 1, catalogReference: item.catalogReference }], channelType: "OTHER_PLATFORM" });
|
|
3381
|
-
if (isRefusal(checkout)) return attemptRefused(checkout);
|
|
3382
|
-
const checkoutId = bodyObject(checkout, "checkout")?.id;
|
|
3383
|
-
if (!isNonEmpty3(checkoutId)) return ORDER_REFUSED;
|
|
3384
|
-
const placed = await bridge.call("POST", `/ecom/v1/checkouts/${encodeURIComponent(checkoutId)}/create-order`, {});
|
|
3385
|
-
if (isRefusal(placed)) return attemptRefused(placed);
|
|
3386
|
-
return placedOrder(placed.body, bridge);
|
|
3387
|
-
}
|
|
3388
|
-
async function reopenOrder3(order, bridge) {
|
|
3389
|
-
const access = await readAccess3(order.verticalRef, bridge);
|
|
3390
|
-
if (access === "granted") return GRANTED;
|
|
3391
|
-
if (access === "pending") return { status: "open", cashierOrderId: order.cashierOrderId, verticalRef: order.verticalRef };
|
|
3392
|
-
return access === "sessionChanged" || access === "unavailable" ? { status: access } : ORDER_CLOSED;
|
|
3393
|
-
}
|
|
3394
3371
|
async function readAccess3(verticalRef, bridge) {
|
|
3395
3372
|
if (!isNonEmpty3(verticalRef.orderId)) return "unavailable";
|
|
3396
3373
|
const answer = await bridge.call("GET", `/ecom/v1/orders/${encodeURIComponent(verticalRef.orderId)}`);
|
|
@@ -3400,14 +3377,6 @@ async function readAccess3(verticalRef, bridge) {
|
|
|
3400
3377
|
if (PAYMENT_UNDER_WAY2.has(status)) return "pending";
|
|
3401
3378
|
return NO_ACCESS2.has(status) ? "none" : "unavailable";
|
|
3402
3379
|
}
|
|
3403
|
-
async function placedOrder(body, bridge) {
|
|
3404
|
-
if (!isObject7(body) || !isNonEmpty3(body.orderId)) return ORDER_REFUSED;
|
|
3405
|
-
const verticalRef = { orderId: body.orderId };
|
|
3406
|
-
if (isNonEmpty3(body.paymentGatewayOrderId)) return { status: "open", cashierOrderId: body.paymentGatewayOrderId, verticalRef, placed: true };
|
|
3407
|
-
const access = await readAccess3(verticalRef, bridge);
|
|
3408
|
-
if (access === "granted") return GRANTED;
|
|
3409
|
-
return access === "sessionChanged" || access === "unavailable" ? { status: access } : ORDER_REFUSED;
|
|
3410
|
-
}
|
|
3411
3380
|
var PAYMENT_UNDER_WAY2 = /* @__PURE__ */ new Set(["NOT_PAID", "PENDING", "PENDING_MERCHANT", "PARTIALLY_PAID"]);
|
|
3412
3381
|
var NO_ACCESS2 = /* @__PURE__ */ new Set(["FULLY_REFUNDED", "PARTIALLY_REFUNDED", "CANCELED", "DECLINED", "VOIDED"]);
|
|
3413
3382
|
|
|
@@ -3639,7 +3608,6 @@ export {
|
|
|
3639
3608
|
createWorkerOrderRefStore,
|
|
3640
3609
|
eventTicketOrders,
|
|
3641
3610
|
iapPurchaseFields,
|
|
3642
|
-
itemPaymentEnabled,
|
|
3643
3611
|
onlineProgramOrders,
|
|
3644
3612
|
pricingPlanOrders,
|
|
3645
3613
|
storesAppleSalesEnabled,
|
|
@@ -667,7 +667,6 @@ var HIMALAYA_SERVE_IAP_ROUTE = { prefix: "/himalaya-serve/v1/iap" };
|
|
|
667
667
|
var BOOKINGS_APPLE_SALES_ENABLED = true;
|
|
668
668
|
var EVENTS_APPLE_SALES_ENABLED = true;
|
|
669
669
|
var ATTENDANCE_SALE_RULE = { appProductId: (id) => id, productType: "CONSUMABLE" };
|
|
670
|
-
var STORES_ITEM_PAYMENT_ENABLED = false;
|
|
671
670
|
var STORES_APPLE_SALES_ENABLED = true;
|
|
672
671
|
var STORES_PRODUCT_SALE_RULE = { appProductId: (id) => id, productType: "NON_CONSUMABLE" };
|
|
673
672
|
var ONLINE_PROGRAM_SALE_RULE = { appProductId: (id) => id, productType: "NON_CONSUMABLE" };
|
|
@@ -678,7 +677,7 @@ var VIDEO_SALE_RULE = { appProductId: (id) => id, productType: "NON_CONSUMABLE"
|
|
|
678
677
|
function appleSaleRules(options = {}) {
|
|
679
678
|
return {
|
|
680
679
|
onlineProgram: ONLINE_PROGRAM_SALE_RULE,
|
|
681
|
-
...
|
|
680
|
+
...options.storesAppleSalesEnabled ?? STORES_APPLE_SALES_ENABLED ? { storesProduct: STORES_PRODUCT_SALE_RULE } : {},
|
|
682
681
|
...options.pricingPlanAppleSalesEnabled ?? PRICING_PLAN_APPLE_SALES_ENABLED ? { pricingPlan: PRICING_PLAN_SALE_RULE } : {},
|
|
683
682
|
...options.bookingsAppleSalesEnabled ?? BOOKINGS_APPLE_SALES_ENABLED ? { bookingsService: ATTENDANCE_SALE_RULE } : {},
|
|
684
683
|
...options.eventsAppleSalesEnabled ?? EVENTS_APPLE_SALES_ENABLED ? { eventsTicket: ATTENDANCE_SALE_RULE } : {},
|
|
@@ -1072,7 +1071,7 @@ function startPaymentCall(scope, wixTransactionId) {
|
|
|
1072
1071
|
return post(scope, "/payments/start", { appleBundleId: scope.binding.bundleId, wixTransactionId });
|
|
1073
1072
|
}
|
|
1074
1073
|
function startItemPaymentCall(scope, item) {
|
|
1075
|
-
return post(scope, "/payments/start-item", {
|
|
1074
|
+
return post(scope, "/payments/start-item", { appleBundleId: scope.binding.bundleId, item: { catalogItemId: item.catalogItemId, catalogAppId: item.catalogAppId } });
|
|
1076
1075
|
}
|
|
1077
1076
|
function catalogItemOf(raw) {
|
|
1078
1077
|
const item = isObject3(raw) ? raw : {};
|
|
@@ -1658,7 +1657,6 @@ export {
|
|
|
1658
1657
|
MAX_RETRY_DELAY_MS,
|
|
1659
1658
|
PRICING_PLAN_APPLE_SALES_ENABLED,
|
|
1660
1659
|
STORES_APPLE_SALES_ENABLED,
|
|
1661
|
-
STORES_ITEM_PAYMENT_ENABLED,
|
|
1662
1660
|
STORES_PRODUCT_SALE_RULE,
|
|
1663
1661
|
VIDEOS_APPLE_SALES_ENABLED,
|
|
1664
1662
|
appleManagedStore,
|
|
@@ -2351,7 +2351,6 @@ var HIMALAYA_SERVE_IAP_ROUTE = { prefix: "/himalaya-serve/v1/iap" };
|
|
|
2351
2351
|
var BOOKINGS_APPLE_SALES_ENABLED = true;
|
|
2352
2352
|
var EVENTS_APPLE_SALES_ENABLED = true;
|
|
2353
2353
|
var ATTENDANCE_SALE_RULE = { appProductId: (id2) => id2, productType: "CONSUMABLE" };
|
|
2354
|
-
var STORES_ITEM_PAYMENT_ENABLED = false;
|
|
2355
2354
|
var STORES_APPLE_SALES_ENABLED = true;
|
|
2356
2355
|
var STORES_PRODUCT_SALE_RULE = { appProductId: (id2) => id2, productType: "NON_CONSUMABLE" };
|
|
2357
2356
|
var ONLINE_PROGRAM_SALE_RULE = { appProductId: (id2) => id2, productType: "NON_CONSUMABLE" };
|
|
@@ -2362,7 +2361,7 @@ var VIDEO_SALE_RULE = { appProductId: (id2) => id2, productType: "NON_CONSUMABLE
|
|
|
2362
2361
|
function appleSaleRules(options = {}) {
|
|
2363
2362
|
return {
|
|
2364
2363
|
onlineProgram: ONLINE_PROGRAM_SALE_RULE,
|
|
2365
|
-
...
|
|
2364
|
+
...options.storesAppleSalesEnabled ?? STORES_APPLE_SALES_ENABLED ? { storesProduct: STORES_PRODUCT_SALE_RULE } : {},
|
|
2366
2365
|
...options.pricingPlanAppleSalesEnabled ?? PRICING_PLAN_APPLE_SALES_ENABLED ? { pricingPlan: PRICING_PLAN_SALE_RULE } : {},
|
|
2367
2366
|
...options.bookingsAppleSalesEnabled ?? BOOKINGS_APPLE_SALES_ENABLED ? { bookingsService: ATTENDANCE_SALE_RULE } : {},
|
|
2368
2367
|
...options.eventsAppleSalesEnabled ?? EVENTS_APPLE_SALES_ENABLED ? { eventsTicket: ATTENDANCE_SALE_RULE } : {},
|
|
@@ -2736,7 +2735,7 @@ function startPaymentCall(scope, wixTransactionId) {
|
|
|
2736
2735
|
return post(scope, "/payments/start", { appleBundleId: scope.binding.bundleId, wixTransactionId });
|
|
2737
2736
|
}
|
|
2738
2737
|
function startItemPaymentCall(scope, item) {
|
|
2739
|
-
return post(scope, "/payments/start-item", {
|
|
2738
|
+
return post(scope, "/payments/start-item", { appleBundleId: scope.binding.bundleId, item: { catalogItemId: item.catalogItemId, catalogAppId: item.catalogAppId } });
|
|
2740
2739
|
}
|
|
2741
2740
|
function catalogItemOf(raw) {
|
|
2742
2741
|
const item = isObject3(raw) ? raw : {};
|
|
@@ -3280,9 +3279,6 @@ var HIMALAYA_SERVE_CHECKOUT_ROUTES = {
|
|
|
3280
3279
|
function appleIapCheckoutRoutes() {
|
|
3281
3280
|
return HIMALAYA_SERVE_CHECKOUT_ROUTES;
|
|
3282
3281
|
}
|
|
3283
|
-
function itemPaymentEnabled() {
|
|
3284
|
-
return STORES_ITEM_PAYMENT_ENABLED;
|
|
3285
|
-
}
|
|
3286
3282
|
|
|
3287
3283
|
// ../../stdlib/flows/iap-checkout/src/cashier-charges.ts
|
|
3288
3284
|
async function ensureAppleIapCharge(bridge, route, orderId) {
|
|
@@ -3639,8 +3635,8 @@ function createWixOrderBackend(deps) {
|
|
|
3639
3635
|
if (unresolved) return contextResult(catalogRef, unresolved);
|
|
3640
3636
|
const blocked = saleBlocked(sale);
|
|
3641
3637
|
if (blocked) return contextResult(catalogRef, blocked);
|
|
3642
|
-
const
|
|
3643
|
-
return
|
|
3638
|
+
const { adapter } = sale;
|
|
3639
|
+
return paidByItem(adapter) ? startItemFor(sale, adapter.itemPayment(sale.item)) : startOrderFor({ ...sale, adapter });
|
|
3644
3640
|
}
|
|
3645
3641
|
async function startOrderFor(sale) {
|
|
3646
3642
|
const ordered = await orderFor(sale);
|
|
@@ -3960,6 +3956,9 @@ function createWixOrderBackend(deps) {
|
|
|
3960
3956
|
}
|
|
3961
3957
|
return { getPurchaseContext, getMemberContext, submitProof };
|
|
3962
3958
|
}
|
|
3959
|
+
function paidByItem(adapter) {
|
|
3960
|
+
return typeof adapter.itemPayment === "function";
|
|
3961
|
+
}
|
|
3963
3962
|
var RETRYABLE = { status: "retryable" };
|
|
3964
3963
|
var STALE2 = { stop: true, result: "retryable" };
|
|
3965
3964
|
function stopWith(result, failure4) {
|
|
@@ -4078,7 +4077,6 @@ function enabledCheckout(deps) {
|
|
|
4078
4077
|
bridge,
|
|
4079
4078
|
itemFor: (key) => sales.get(key),
|
|
4080
4079
|
productBusy,
|
|
4081
|
-
itemPaymentEnabled: deps.itemPaymentEnabled,
|
|
4082
4080
|
report: onEvent
|
|
4083
4081
|
});
|
|
4084
4082
|
const coordinator = createPurchaseCoordinator({
|
|
@@ -4609,7 +4607,6 @@ function createIapCommerceWith(deps) {
|
|
|
4609
4607
|
stopWatchingSession = void 0;
|
|
4610
4608
|
checkout = createAppleIapCheckoutWith({
|
|
4611
4609
|
enabled: true,
|
|
4612
|
-
itemPaymentEnabled: deps.itemPaymentEnabled,
|
|
4613
4610
|
wixIap: deps.wixIapClient({ host, route: routes.wixIap }),
|
|
4614
4611
|
binding: deps.binding,
|
|
4615
4612
|
session: deps.session,
|
|
@@ -4747,7 +4744,6 @@ function createIapCommerce(options = {}) {
|
|
|
4747
4744
|
const binding = sharedHostAppBindingSource();
|
|
4748
4745
|
return createIapCommerceWith({
|
|
4749
4746
|
routes: appleIapCheckoutRoutes(),
|
|
4750
|
-
itemPaymentEnabled: itemPaymentEnabled(),
|
|
4751
4747
|
pricing: createIapCatalogPricing({ onChange: options.onChange }),
|
|
4752
4748
|
binding,
|
|
4753
4749
|
session,
|