@wix/himalaya-cli 0.1310.0 → 0.1311.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.
@@ -10,7 +10,7 @@ export interface PurchasesAppBinding {
10
10
  siteId: string;
11
11
  }
12
12
  export interface AppBindingSource {
13
- /** Null when the app was never registered. */
13
+ /** Null when the app was never registered; rejects when the host could not say. */
14
14
  current(): Promise<PurchasesAppBinding | null>;
15
15
  }
16
16
  /** The running app's own identity; a binding for anything else is refused. */
@@ -25,6 +25,25 @@ export interface WixIapRoute {
25
25
  * was in the generated gateway metadata on 2026-10-08, so there is deliberately no default. */
26
26
  prefix: string;
27
27
  }
28
+ /**
29
+ * Serve's Apple-IAP routes on the public gateway (`www.wixapis.com/himalaya-serve/v1/iap`), where the
30
+ * native bridge sends the member's or visitor's own token. One prefix for the wix-iap payment calls, the
31
+ * cashier charge and the mapping read; Serve forwards each to the internal service that owns it.
32
+ */
33
+ export declare const HIMALAYA_SERVE_IAP_ROUTE: WixIapRoute;
34
+ /** How the App Store sells one vertical's Wix item: the purchases catalog's `appProductId` for it, and
35
+ * the only product type the purchase flow sells it as. */
36
+ export interface AppleSaleRule {
37
+ appProductId(entityId: string): string;
38
+ productType: "NON_CONSUMABLE";
39
+ }
40
+ /**
41
+ * The one definition `himi store iap connect` writes mappings by and the mapping source reads them by,
42
+ * keyed by catalog kind. wix-iap StartPayment maps the cashier order's single item id, and Online
43
+ * 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.
45
+ */
46
+ export declare const APPLE_SALE_RULES: Readonly<Record<string, AppleSaleRule>>;
28
47
  /** Captured when a protected call starts. The native bridge checks it and never puts it on
29
48
  * the HTTP request. */
30
49
  export interface HostCallExpectation {
@@ -284,6 +284,14 @@ export interface AppConfig {
284
284
  * secret. Absent ⇒ no Base44 backend.
285
285
  */
286
286
  base44?: Base44Config;
287
+ /**
288
+ * The Wix purchases-service app (mobile-apps-iap-purchases RegisterApp `app.id`) this app sells
289
+ * digital Wix items through with Apple in-app purchase (`@himalaya/iap-checkout`; requires the
290
+ * `iap` capability). A build bakes it into the binary with the app's auth site — it is never read
291
+ * over the air or by a worker — and only the binding is baked: products, mappings and prices stay
292
+ * live. Absent ⇒ the app sells nothing through the App Store. See docs/iap-wix-checkout.md.
293
+ */
294
+ wixIap?: WixIapConfig;
287
295
  /** Unified app-owned KV and Wix Data declaration. */
288
296
  data?: DataResourcesConfig;
289
297
  /**
@@ -736,6 +744,11 @@ export declare const DEFAULT_ORIENTATION_ENVELOPE: Required<OrientationEnvelope>
736
744
  /** Fill in the absent families. Total, so callers never branch on `undefined`. */
737
745
  export declare function resolveOrientationEnvelope(env?: OrientationEnvelope): Required<OrientationEnvelope>;
738
746
  export type Capability = "camera" | "barcode_scanner" | "biometrics" | "secure_storage" | "share" | "push" | "file_picker" | "files" | "open_url" | "pdf" | "clipboard" | "photos" | "presigned_upload" | "ui" | "calendar" | "contacts" | "tasks" | "audio_record" | "audio_record_background" | "calls" | "location" | "location_background" | "motion" | "health" | "media_playback" | "webview" | "browser_auth" | "haptic" | "himi_apps" | "iap" | "keyboard" | "wix_cashier" | "live_activity" | "local_database" | "speech" | "speaker_diarization" | "system_intents" | "on_device_ai" | "app_info" | "release_control" | "godot" | "base44" | "animation";
747
+ /** `defineApp({ wixIap })` — the purchases-service app a build binds this app to. */
748
+ export interface WixIapConfig {
749
+ /** The purchases service's app UUID, registered on the app's own auth site. Not a secret. */
750
+ purchasesAppId: string;
751
+ }
739
752
  /** `defineApp({ base44 })` — which Base44 app `@himalaya/base44` talks to. */
740
753
  export interface Base44Config {
741
754
  /** The Base44 app id (24 hex chars, e.g. `69725232345f461f64ad1623`). */
@@ -852,6 +852,12 @@ function onlineProgramItem(program, commerceDisplayPrice) {
852
852
  return { reference: { kind: ONLINE_PROGRAM, id }, ...commerceDisplayPrice ? { commerceDisplayPrice } : {} };
853
853
  }
854
854
 
855
+ // ../../core/sdk/iap/src/wix-payments-contract.ts
856
+ var HIMALAYA_SERVE_IAP_ROUTE = { prefix: "/himalaya-serve/v1/iap" };
857
+ var APPLE_SALE_RULES = {
858
+ onlineProgram: { appProductId: (id) => id, productType: "NON_CONSUMABLE" }
859
+ };
860
+
855
861
  // ../../core/sdk/iap/src/host-session.ts
856
862
  var SIGNED_OUT = {
857
863
  generation: 0,
@@ -1296,6 +1302,8 @@ function decodeTransaction(value) {
1296
1302
  return { store, signedTransaction, transactionId, originalTransactionId, productId, appAccountToken, environment };
1297
1303
  }
1298
1304
  export {
1305
+ APPLE_SALE_RULES,
1306
+ HIMALAYA_SERVE_IAP_ROUTE,
1299
1307
  IAP_CATALOG_KINDS,
1300
1308
  MAX_AUTOMATIC_ATTEMPTS,
1301
1309
  MAX_RETRY_DELAY_MS,