@wix/himalaya-cli 0.1659.0 → 0.1661.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 (67) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/attendance-classifier.d.ts +3 -1
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/delivery-contract.d.ts +3 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/index.d.ts +7 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments-contract.d.ts +19 -1
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments-wire.d.ts +2 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +1 -1
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/apple-iap-contract.d.ts +33 -7
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/commerce-contract.d.ts +4 -0
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-order-backend.d.ts +5 -0
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/attendance-orders.d.ts +10 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/attendance.d.ts +4 -5
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/index.d.ts +13 -3
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/online-programs-orders.d.ts +2 -0
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/online-programs.d.ts +2 -2
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/pricing-plans-orders.d.ts +2 -0
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/pricing-plans.d.ts +4 -2
  17. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/shared.d.ts +3 -1
  18. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/order-refs.d.ts +8 -4
  19. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +1 -1
  20. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +1 -1
  21. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +1 -1
  22. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +1 -1
  23. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap-checkout.mjs +622 -197
  24. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap.mjs +52 -8
  25. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +1 -1
  26. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +1 -1
  27. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +1 -1
  28. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +500 -119
  29. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +1 -1
  30. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +1 -1
  31. package/dist/browser-plane/assets.json +5 -5
  32. package/dist/browser-plane/preview-deferred/{c04dd5fc5ad48e6b19678d4313159302e9a513ada94bfe515d8dfd5a54d46f5d.bin → fcafca348b6b973cfc2eadc938ddec3c515c641874cbca1667a43b22e1bf7a39.bin} +1 -1
  33. package/dist/browser-plane/sw.js +1 -1
  34. package/dist/cli.mjs +203 -56
  35. package/dist/preview-assets.generated.bin +0 -0
  36. package/guides/himi-json-output.md +26 -1
  37. package/guides/qa-builds.md +27 -4
  38. package/guides/sdk-reference.json +82 -12
  39. package/guides/skill.md +2 -2
  40. package/guides/web-page-sdk-reference.md +1 -1
  41. package/package.json +2 -2
  42. package/templates/beauty-salon/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  43. package/templates/beauty-salon/tier5-src/_shared/iap-worker.ts +2 -0
  44. package/templates/branded-lite/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  45. package/templates/branded-lite/tier5-src/_shared/iap-worker.ts +2 -0
  46. package/templates/community-club/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  47. package/templates/community-club/tier5-src/_shared/iap-worker.ts +2 -0
  48. package/templates/conference/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  49. package/templates/conference/tier5-src/_shared/iap-worker.ts +2 -0
  50. package/templates/events-meetups/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  51. package/templates/events-meetups/tier5-src/_shared/iap-worker.ts +2 -0
  52. package/templates/gym-fitness/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  53. package/templates/gym-fitness/tier5-src/_shared/iap-worker.ts +2 -0
  54. package/templates/nonprofit-cause/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  55. package/templates/nonprofit-cause/tier5-src/_shared/iap-worker.ts +2 -0
  56. package/templates/podcast-creator/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  57. package/templates/podcast-creator/tier5-src/_shared/iap-worker.ts +2 -0
  58. package/templates/portfolio-creative/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  59. package/templates/portfolio-creative/tier5-src/_shared/iap-worker.ts +2 -0
  60. package/templates/restaurant/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  61. package/templates/restaurant/tier5-src/_shared/iap-worker.ts +2 -0
  62. package/templates/retail-store/tier5-src/_shared/iap-worker.ts +2 -0
  63. package/templates/salon-spa/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  64. package/templates/salon-spa/tier5-src/_shared/iap-worker.ts +2 -0
  65. package/templates/wholesale-store/tier5-src/_shared/iap-worker.ts +2 -0
  66. package/templates/yoga-studio/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  67. package/templates/yoga-studio/tier5-src/_shared/iap-worker.ts +2 -0
Binary file
@@ -33,9 +33,34 @@ stdout and stderr; progress/warnings are not failure envelopes.
33
33
 
34
34
  A `429` while polling is not a failure: the CLI backs off by the plane's `retryAfterSec` and keeps waiting.
35
35
 
36
+ ### `himi login --device --site`: `site.error` codes
37
+
38
+ With `--site <msid>`, the success envelope (exit 0) carries a `site` block. On success it is
39
+ `{ msid, action, clientId, redirectUri, storedAt, nextSteps }`, `action` one of `reused`, `patched`,
40
+ `created`; the client id is kept per site for `himi site client list|ensure`. When the owner chose
41
+ "Don't connect a site" it is `{ msid, action: "none" }`. When the site could not be connected the
42
+ sign-in still succeeded, and `site` is `{ msid, error, fallbackUrl }`; `fallbackUrl` is the site's
43
+ OAuth-apps dashboard page, where the owner can copy or create the client id. Never retried by the
44
+ CLI: run the login again or use `fallbackUrl`.
45
+
46
+ | Code | Meaning |
47
+ | --- | --- |
48
+ | `site_not_owned` | The site is not one the approving session's accounts own. No instance was minted and nothing was sent to the site. No `fallbackUrl`. |
49
+ | `site_ownership_unavailable` | Site List did not answer (5xx, 429, unreachable), so ownership could not be checked. |
50
+ | `site_client_mint_refused` | Wix refused the site's User signed instance for the owner's session. |
51
+ | `site_client_query_refused` | Wix refused the OAuth-client query (4xx), or answered without a client list. |
52
+ | `site_client_list_truncated` | Wix reported more clients than it returned, so reusing or creating one could pick the wrong client or make a duplicate. |
53
+ | `site_client_patch_refused` | Adding the redirect to the existing `himi client` was refused, or Wix did not keep it. |
54
+ | `site_client_create_refused` | Creating the client was refused, or Wix returned no id. |
55
+ | `site_client_unavailable` | Any Wix 5xx, 429, timeout or unreadable reply during the mint, query, patch or create. |
56
+
57
+ `/v1/owner/device/code` refuses a `site` that is not an msid, or a `redirect_uri` with no scheme
58
+ (or a `javascript:`, `data:`, `vbscript:` or `file:` one), with `400 invalid_request`; the CLI checks
59
+ `--site` itself first (exit 2).
60
+
36
61
  ## `himi site client list|ensure` codes
37
62
 
38
- These commands need a site-scoped Wix credential. They take, in order: `WIX_API_KEY`; the owner's Wix **account** token in `WIX_TOKEN`, exchanged for a 900-second token on that site (OAuth2-NG token exchange, `POST https://www.wixapis.com/oauth2/token`); or a logged-in `wix` CLI (`wix token --site <msid>`). With `WIX_TOKEN` set, no `wix` CLI is needed. The exchanged token is kept in memory for that run only, re-exchanged a minute before it expires or on a `401`, and never written, logged or printed. A himi login alone is not a site credential: `--device` holds no Wix token, and a token piped to `--wix-token-stdin` is not kept after the login. The credential is checked before anything is sent to the site. A failed check prints `{ ok: false, code, error, fix, dashboardUrl, usage }` on stderr, exit 1. `fix` is one line to act on; `dashboardUrl` is the site's OAuth-apps page, where the owner can copy a client id by hand; `usage` is the usage of the subcommand that ran. None of these codes is retried. A network failure or a `5xx` from the exchange is retried like any other Wix call, and is never given one of these codes.
63
+ These commands need a site-scoped Wix credential. They take, in order: `WIX_API_KEY`; the owner's Wix **account** token in `WIX_TOKEN`, exchanged for a 900-second token on that site (OAuth2-NG token exchange, `POST https://www.wixapis.com/oauth2/token`); or a logged-in `wix` CLI (`wix token --site <msid>`). With `WIX_TOKEN` set, no `wix` CLI is needed. The exchanged token is kept in memory for that run only, re-exchanged a minute before it expires or on a `401`, and never written, logged or printed. A himi login alone is not a site credential: `--device` holds no Wix token, and a token piped to `--wix-token-stdin` is not kept after the login. With no explicit site credential, a client id kept by `himi login --device --site` answers instead (`source: "device-login"`; `ensure` only for the default name and the stored redirect, and never with `--new`). A `wix` CLI on PATH is tried first; when its `wix token --site` fails (`wix_cli_token_failed`: not logged in, unsupported Node), the stored id still answers, with a `warning` naming the failure. A refused `WIX_API_KEY` or `WIX_TOKEN` is never replaced by the stored id. The credential is checked before anything is sent to the site. A failed check prints `{ ok: false, code, error, fix, dashboardUrl, usage }` on stderr, exit 1. `fix` is one line to act on; `dashboardUrl` is the site's OAuth-apps page, where the owner can copy a client id by hand; `usage` is the usage of the subcommand that ran. None of these codes is retried. A network failure or a `5xx` from the exchange is retried like any other Wix call, and is never given one of these codes.
39
64
 
40
65
  | Code | Meaning |
41
66
  | --- | --- |
@@ -14,7 +14,7 @@ install link or QR. These paths are distinct from the CI gates (`test:*`,
14
14
  > `himi dist` request returns an installable QA artifact and install link. A customer
15
15
  > iOS request may instead use `--signing byo --destination testflight --site <id>
16
16
  > --version <x.y.z>`; the build validates the App Store IPA, and an authorized
17
- > `himi dist status <jobId>` read uploads it to the customer's App Store Connect account.
17
+ > `himi dist status <jobId>` read starts its upload to the customer's App Store Connect account.
18
18
  > The customer path is not Himi Player's Wix Mobile Release route and does not use MRE.
19
19
 
20
20
  > **Customer request gate.** Do not dispatch `himi dist` merely because a draft preview is ready.
@@ -56,8 +56,10 @@ himi dist status <jobId> --target wix
56
56
  ```
57
57
 
58
58
  The pool records `READY_FOR_UPLOAD` after validating the IPA. The status read proves site
59
- ownership with the Wix credential, then claims and uploads the IPA once; repeat reads are
60
- safe. Without that authorization, status reports the waiting state and does not upload.
59
+ ownership with the Wix credential, then starts the upload in the background (claimed once) and
60
+ answers without waiting for it, so it shows `READY_FOR_UPLOAD` or `UPLOADING`: read again until
61
+ `UPLOADED` or `FAILED`. Without `--no-wait`, `himi dist` reads on until then. Repeat reads are
62
+ safe. Without that authorization, status reports the waiting state and starts nothing.
61
63
  The upload also requires customer App Store upload to be enabled on the Himi backend
62
64
  (`HIMI_DIST_CUSTOMER_APP_STORE_UPLOAD=1`); where that switch is off, the job stays at `READY_FOR_UPLOAD` with a validated IPA that is
63
65
  never uploaded.
@@ -1313,7 +1315,8 @@ himi dist --app <app> --platform android --aab --wait --target bo
1313
1315
  their hashes. The upload starts on its own once the pool reports the validated IPA: the pool's
1314
1316
  callback starts it in the background, and so does every list read of the app's builds (the owner
1315
1317
  card's poll) while it can be claimed, which also picks up one a stopped serve pod left. A status
1316
- read still uploads too; any read the caller may make of the app moves it on, since the owner was
1318
+ read starts it the same way and answers without waiting for it (it never waits on Apple, so a
1319
+ read answers in seconds); any read the caller may make of the app moves it on, since the owner was
1317
1320
  proven when the build started (the Containers server's reads carry a project token, not the
1318
1321
  owner's Wix login). A caller reads the job until `customerAppStore.status` is `UPLOADED` or
1319
1322
  `FAILED` to learn how it ended; it no longer has to read for the upload to happen. An attempt that
@@ -1335,6 +1338,26 @@ himi dist --app <app> --platform android --aab --wait --target bo
1335
1338
  502 (the prepared files failed Himalaya's checks, the check's code in `reason`: a fix on Wix's
1336
1339
  side, not a retry), `store_builds_unavailable` 503. A named `--signing byo` keeps the
1337
1340
  customer-signed path above, from the site's legacy BuildSecrets.
1341
+ - **mobile-apps-containers-builder can start these store builds itself, as a trusted caller.** A
1342
+ request with no `X-Control-Token` whose Wix identity the platform verified is a SERVICE identity
1343
+ (`serviceIdentity.appDefId`) listed in `HIMI_TRUSTED_STORE_BUILD_APPS` (comma-separated; empty is
1344
+ off, though a call to these routes without a control token still logs `Himalaya trusted caller
1345
+ refused` with its identity kinds and app ids, the probe for which id to list) may
1346
+ `POST /v1/admin/dist` a Containers app's Google Play bundle or App Store build with
1347
+ `storeBuild: { metaSiteId, storeId }` and its own `attemptId` (required). The service has already
1348
+ checked the site's owner, plan, saved store id and its store-app hold, and records the build once
1349
+ the plane accepts it, so the plane skips the owner check, the hold, `CheckIfBuildIsAllowed`,
1350
+ `CreateBuildRecordIfAllowed` and every `UpdateStoreBuild`, and builds under `storeId`. Every check of the plane's own still runs
1351
+ (shape, release, shell, store marker, icon, kill switch, the per-app cap; for the App Store,
1352
+ `PrepareAppleCertificates`, whose bundle id must equal `storeId`: `409 store_id_mismatch`). The app
1353
+ must be bound to `metaSiteId` (`403 store_build_site_mismatch`); only the store-build fields are
1354
+ accepted (`400 trusted_store_build_field_unexpected`, `trusted_store_build_only`,
1355
+ `store_build_invalid`, `attempt_id_required`, `store_id_invalid`); its builds count per site in the
1356
+ self-serve tier, and `HIMI_DIST_SELFSERVE=0` closes them too. The caller reads
1357
+ (`GET /v1/admin/dist/<job>`), lists (`?app=`, each job with its `attemptId`) and cancels only the
1358
+ jobs it started (`403 forbidden_cross_tenant` otherwise), and a settled job carries
1359
+ `storeBuildResult`, the result the service used to be sent. A request with a control token is the
1360
+ path above, unchanged, and both stay: the Containers server picks one per site. MOBPUB-1241.
1338
1361
  - **A store build ships under the owner's App name and icon.** Both store builds above (a Containers
1339
1362
  app's `--aab` and its TestFlight build) need `appName` and `appIconUrl` on `POST /v1/admin/dist`
1340
1363
  (`himi dist --app-name <name> --app-icon-url <url>`): the App name and App icon the owner set in
@@ -2451,7 +2451,7 @@
2451
2451
  "name": "DeliveryBackend",
2452
2452
  "kind": "interface",
2453
2453
  "jsdoc": "/** PROPOSED backend agreement. Every call carries the session captured when the work\n * started, never whichever session is current when the request is sent. Responses are\n * decoded strictly; anything unrecognised is treated as invalid, never as success. */",
2454
- "decl": "export interface DeliveryBackend {\n getPurchaseContext(session: SessionSnapshot, catalogRef: string): Promise<ContextResult<PurchaseContext>>;\n getMemberContext(session: SessionSnapshot): Promise<ContextResult<MemberContext>>;\n /** Must be idempotent per store/environment/transaction id; delivery is at-least-once. */\n submitProof(session: SessionSnapshot, transaction: AppleTransaction): Promise<SubmitProofResult>;\n}",
2454
+ "decl": "export interface DeliveryBackend {\n getPurchaseContext(session: SessionSnapshot, catalogRef: string): Promise<ContextResult<PurchaseContext>>;\n getMemberContext(session: SessionSnapshot): Promise<ContextResult<MemberContext>>;\n /** Must be idempotent per store/environment/transaction id; delivery is at-least-once. */\n submitProof(session: SessionSnapshot, transaction: AppleTransaction): Promise<SubmitProofResult>;\n /** The member closed the store sheet for this sale: nothing was bought. Optional, best effort:\n * the coordinator never waits on its outcome, and a sale nobody pays expires anyway. */\n abandonPurchase?(session: SessionSnapshot, catalogRef: string): Promise<void>;\n}",
2455
2455
  "verificationChecked": true
2456
2456
  },
2457
2457
  {
@@ -2839,6 +2839,41 @@
2839
2839
  "decl": "export const VIDEOS_APPLE_SALES_ENABLED = false;",
2840
2840
  "verificationChecked": true
2841
2841
  },
2842
+ {
2843
+ "name": "PRICING_PLAN_ITEM_PAYMENT_ENABLED",
2844
+ "kind": "const",
2845
+ "jsdoc": "/**\n * Which verticals order through wix-iap StartItemPayment (catalyst-server #24878 Plans, #24880 Online\n * Programs, #24881 Bookings, #24882 Events) instead of the device's own checkout and StartPayment. The\n * server places the order as the member, charges it with appleIAP and names the App Store product. Each\n * OFF: that vertical keeps its client checkout. Turn one on only once production wix-iap and Serve's\n * generated client carry its fields; each flips on its own.\n */",
2846
+ "decl": "export const PRICING_PLAN_ITEM_PAYMENT_ENABLED = false;",
2847
+ "verificationChecked": true
2848
+ },
2849
+ {
2850
+ "name": "ONLINE_PROGRAM_ITEM_PAYMENT_ENABLED",
2851
+ "kind": "const",
2852
+ "jsdoc": "",
2853
+ "decl": "export const ONLINE_PROGRAM_ITEM_PAYMENT_ENABLED = false;",
2854
+ "verificationChecked": true
2855
+ },
2856
+ {
2857
+ "name": "BOOKINGS_ITEM_PAYMENT_ENABLED",
2858
+ "kind": "const",
2859
+ "jsdoc": "",
2860
+ "decl": "export const BOOKINGS_ITEM_PAYMENT_ENABLED = false;",
2861
+ "verificationChecked": true
2862
+ },
2863
+ {
2864
+ "name": "EVENTS_ITEM_PAYMENT_ENABLED",
2865
+ "kind": "const",
2866
+ "jsdoc": "",
2867
+ "decl": "export const EVENTS_ITEM_PAYMENT_ENABLED = false;",
2868
+ "verificationChecked": true
2869
+ },
2870
+ {
2871
+ "name": "CANCEL_PAYMENT_ENABLED",
2872
+ "kind": "const",
2873
+ "jsdoc": "/**\n * CancelPayment (catalyst-server #24894, not deployed) when the member closes the Apple sheet: it cancels\n * the pending Payment and releases the ticket reservation or booking it held. OFF: nothing is sent, and the\n * Payment expires on its own in about an hour.\n */",
2874
+ "decl": "export const CANCEL_PAYMENT_ENABLED = false;",
2875
+ "verificationChecked": true
2876
+ },
2842
2877
  {
2843
2878
  "name": "AppleSaleOptions",
2844
2879
  "kind": "interface",
@@ -2927,7 +2962,7 @@
2927
2962
  "name": "StartItemPaymentErrorCode",
2928
2963
  "kind": "type",
2929
2964
  "jsdoc": "",
2930
- "decl": "export type StartItemPaymentErrorCode = \"PRODUCT_NOT_AVAILABLE\" | \"ALREADY_OWNED\" | \"ITEM_NOT_AVAILABLE\"\n | \"SITE_NOT_ACCEPTING_PAYMENTS\" | \"UNSUPPORTED_ORDER\" | \"CATALOG_NOT_SUPPORTED\" | \"VERTICAL_ACCESS_DENIED\"\n | \"EVENT_CHECKOUT_NOT_ECOM\" | \"ALREADY_SUBSCRIBED\" | \"SUBSCRIPTION_NOT_IN_APP\" | \"BILLING_COUNTRY_REQUIRED\"\n | \"APP_NOT_CONFIGURED\" | \"NOT_BOOKING_OWNER\" | \"BOOKING_PAYMENT_PENDING\";",
2965
+ "decl": "export type StartItemPaymentErrorCode = \"PRODUCT_NOT_AVAILABLE\" | \"ALREADY_OWNED\" | \"ITEM_NOT_AVAILABLE\"\n | \"SITE_NOT_ACCEPTING_PAYMENTS\" | \"UNSUPPORTED_ORDER\" | \"CATALOG_NOT_SUPPORTED\" | \"VERTICAL_ACCESS_DENIED\"\n | \"EVENT_CHECKOUT_NOT_ECOM\" | \"ALREADY_SUBSCRIBED\" | \"SUBSCRIPTION_NOT_IN_APP\" | \"BILLING_COUNTRY_REQUIRED\"\n | \"APP_NOT_CONFIGURED\" | \"NOT_BOOKING_OWNER\" | \"BOOKING_PAYMENT_PENDING\" | \"MEMBER_DETAILS_REQUIRED\";",
2931
2966
  "verificationChecked": true
2932
2967
  },
2933
2968
  {
@@ -2990,7 +3025,7 @@
2990
3025
  "name": "StartItemPaymentResult",
2991
3026
  "kind": "type",
2992
3027
  "jsdoc": "/** StartItemPayment places the member's order for one catalog item, charges it with `appleIAP` and\n * starts its Payment, all server-side. Four different ids come back: the vertical's record (the eCom\n * order, `ecomOrderId`; for Online Programs the join application, `joinApplicationId`, and no eCom\n * order), the Wix Payments charge (`payment.wixTransactionId`), the wix-iap Payment\n * (`payment.paymentId`) and the StoreKit `appAccountToken`. Keep them out of screen state. */",
2993
- "decl": "export type StartItemPaymentResult =\n | { status: \"started\"; payment: WixIapPayment; storeProductId: string; appAccountToken: string; ecomOrderId?: string; joinApplicationId?: string }\n | WixIapFailure<StartItemPaymentErrorCode>\n | StartItemPaymentOutcomeUnknown;",
3028
+ "decl": "export type StartItemPaymentResult =\n | { status: \"started\"; payment: WixIapPayment; storeProductId: string; appAccountToken: string; ecomOrderId?: string; joinApplicationId?: string; eventsOrderNumber?: string }\n | WixIapFailure<StartItemPaymentErrorCode>\n | StartItemPaymentOutcomeUnknown;",
2994
3029
  "verificationChecked": true
2995
3030
  },
2996
3031
  {
@@ -3139,7 +3174,7 @@
3139
3174
  {
3140
3175
  "name": "availableTicketAttendanceOf",
3141
3176
  "kind": "function",
3142
- "jsdoc": "/** Reads the buyer-visible checkout projection; hidden/off-sale inclusions and unknown pricing stay unresolved. */",
3177
+ "jsdoc": "/** Reads the buyer-visible ticket projection; hidden/off-sale inclusions and unknown pricing stay unresolved.\n * Accepts both the v1 checkout row (`state`, `pricing.fixedPrice.amount`) and the v3 available\n * ticket-definition row (`hidden`, `pricingMethod.fixedPrice.value`) that `queryAvailableTickets` returns. */",
3143
3178
  "decl": "export function availableTicketAttendanceOf(event: unknown, ticket: unknown): TicketAttendance;",
3144
3179
  "verificationChecked": true
3145
3180
  },
@@ -3192,6 +3227,13 @@
3192
3227
  "decl": "export async function getPaywallConfig(): Promise<PaywallConfig>;",
3193
3228
  "verificationChecked": true
3194
3229
  },
3230
+ {
3231
+ "name": "storefrontCountryCode",
3232
+ "kind": "function",
3233
+ "jsdoc": "/**\n * The App Store storefront the signed-in Apple account buys in: StoreKit's\n * `Storefront.current.countryCode`, ISO 3166-1 alpha-3 such as `USA`. wix-iap bills\n * a Pricing Plans order in this country. `null` where the store has no storefront\n * (Android, the web) or cannot say; the server then falls back to the member's address.\n */",
3234
+ "decl": "export async function storefrontCountryCode(): Promise<string | null>;",
3235
+ "verificationChecked": true
3236
+ },
3195
3237
  {
3196
3238
  "name": "getProducts",
3197
3239
  "kind": "function",
@@ -3402,6 +3444,34 @@
3402
3444
  "decl": "export function createAppleIapCheckout(deps: AppleIapCheckoutDependencies): AppleIapCheckout;",
3403
3445
  "verificationChecked": true
3404
3446
  },
3447
+ {
3448
+ "name": "onlineProgramOrders",
3449
+ "kind": "const",
3450
+ "jsdoc": "",
3451
+ "decl": "export const onlineProgramOrders: IapOrderAdapter = ONLINE_PROGRAM_ITEM_PAYMENT_ENABLED ? onlineProgramItemPayments : onlineProgramClientOrders;",
3452
+ "verificationChecked": true
3453
+ },
3454
+ {
3455
+ "name": "pricingPlanOrders",
3456
+ "kind": "const",
3457
+ "jsdoc": "",
3458
+ "decl": "export const pricingPlanOrders: IapOrderAdapter = PRICING_PLAN_ITEM_PAYMENT_ENABLED ? pricingPlanItemPayments : pricingPlanClientOrders;",
3459
+ "verificationChecked": true
3460
+ },
3461
+ {
3462
+ "name": "bookingOrders",
3463
+ "kind": "const",
3464
+ "jsdoc": "",
3465
+ "decl": "export const bookingOrders: IapOrderAdapter = BOOKINGS_ITEM_PAYMENT_ENABLED ? bookingItemPayments : bookingClientOrders;",
3466
+ "verificationChecked": true
3467
+ },
3468
+ {
3469
+ "name": "eventTicketOrders",
3470
+ "kind": "const",
3471
+ "jsdoc": "",
3472
+ "decl": "export const eventTicketOrders: IapOrderAdapter = EVENTS_ITEM_PAYMENT_ENABLED ? eventTicketItemPayments : eventTicketClientOrders;",
3473
+ "verificationChecked": true
3474
+ },
3405
3475
  {
3406
3476
  "name": "createWorkerOrderRefStore",
3407
3477
  "kind": "function",
@@ -3497,14 +3567,14 @@
3497
3567
  "name": "IapVerticalOrderAdapter",
3498
3568
  "kind": "interface",
3499
3569
  "jsdoc": "/** A vertical whose order the device opens; it is charged through cashier and paid with StartPayment. */",
3500
- "decl": "export interface IapVerticalOrderAdapter extends IapAdapterBase {\n readonly repeatable?: boolean;\n /** Opens, or reuses the vertical's own open, order for the signed-in member. */\n /** Repeatable adapters call beforeCreate immediately before their first inventory write,\n * after read-only checks, and abort without writing if it returns false. They call afterCreate\n * with the ids of each inventory write as soon as it answers, so a later failure can be undone. */\n openOrder(item: IapOrderItem, bridge: SessionBoundBridge, beforeCreate?: (guard: OpeningGuard) => boolean, afterCreate?: (guard: OpeningGuard) => void): Promise<OrderAttempt>;\n /** Settles an earlier attempt's guard before a new sale of the same item. `settled`: the attempt\n * that wrote it has had time to finish, so what it created may be undone; before then it may be\n * another screen's sale still in flight. `claim` must answer true immediately before anything\n * is undone: it takes the guard from that sale, which is then never charged. With no item (on\n * entry, not a sale) only `released` matters. Without it, a guard holds its item until its `releaseAt`. */\n resolveOpening?(guard: OpeningGuard, item: IapOrderItem | undefined, bridge: SessionBoundBridge, options: { settled: boolean; claim(): boolean }): Promise<OpeningResolution>;\n /** Re-reads an order opened earlier; `open` only while it can still be paid. */\n reopenOrder(order: { cashierOrderId: string; verticalRef: VerticalRef }, bridge: SessionBoundBridge): Promise<OrderAttempt>;\n itemPayment?: never;\n}",
3570
+ "decl": "export interface IapVerticalOrderAdapter extends IapAdapterBase {\n readonly repeatable?: boolean;\n /** Opens, or reuses the vertical's own open, order for the signed-in member. */\n /** Repeatable adapters call beforeCreate immediately before their first inventory write,\n * after read-only checks, and abort without writing if it returns false. They call afterCreate\n * with the ids of each inventory write as soon as it answers; on false they answer `unavailable`. */\n openOrder(item: IapOrderItem, bridge: SessionBoundBridge, beforeCreate?: (guard: OpeningGuard) => boolean, afterCreate?: (guard: OpeningGuard) => boolean): Promise<OrderAttempt>;\n /** Settles an earlier attempt's guard before a new sale of the same item. `settled`: the attempt\n * that wrote it has had time to finish, so what it created may be undone; before then it may be\n * another screen's sale still in flight. `claim` must answer true immediately before anything\n * is undone: it takes the guard from that sale, which is then never charged. With no item (on\n * entry, not a sale) only `released` matters. Without it, a guard holds its item until its `releaseAt`. */\n resolveOpening?(guard: OpeningGuard, item: IapOrderItem | undefined, bridge: SessionBoundBridge, options: { settled: boolean; claim(): boolean }): Promise<OpeningResolution>;\n /** Re-reads an order opened earlier; `open` only while it can still be paid. */\n reopenOrder(order: { cashierOrderId: string; verticalRef: VerticalRef }, bridge: SessionBoundBridge): Promise<OrderAttempt>;\n itemPayment?: never;\n}",
3501
3571
  "verificationChecked": true
3502
3572
  },
3503
3573
  {
3504
3574
  "name": "IapItemPaymentAdapter",
3505
3575
  "kind": "interface",
3506
- "jsdoc": "/** A vertical whose order wix-iap places and charges server-side (StartItemPayment): the device\n * never opens, charges or reopens one. */",
3507
- "decl": "export interface IapItemPaymentAdapter extends IapAdapterBase {\n /** The catalog item to order, for an item `eligibility` accepted. */\n itemPayment(item: IapOrderItem): ItemPayment;\n openOrder?: never;\n reopenOrder?: never;\n repeatable?: never;\n resolveOpening?: never;\n}",
3576
+ "jsdoc": "",
3577
+ "decl": "export interface IapItemPaymentAdapter extends IapAdapterBase {\n /** The catalog item to order, for an item `eligibility` accepted. A vertical that must read or\n * make something first (a plan's pricing variant, the member's booking) does it here, through\n * the session-bound bridge, before anything is ordered. */\n itemPayment(item: IapOrderItem, bridge: SessionBoundBridge, beforeCreate?: (guard: OpeningGuard) => boolean, afterCreate?: (guard: OpeningGuard) => boolean):\n ItemPayment | ItemPaymentRefusal | Promise<ItemPayment | ItemPaymentRefusal>;\n openOrder?: never;\n reopenOrder?: never;\n /** Each sale is its own attempt (a ticket, a booking): the item carries an `attemptId`. */\n repeatable?: boolean;\n /** A repeatable adapter whose `itemPayment` makes something first (the member's booking) guards it\n * as an order adapter does: `beforeCreate` before that write, `afterCreate` with what it made, and\n * `resolveOpening` settles one a later attempt finds unpaid. */\n resolveOpening?: IapVerticalOrderAdapter[\"resolveOpening\"];\n /** StartItemPayment answers a re-tap with the same pending Payment (Online Programs), so a closed\n * sheet's CancelPayment could cancel the sale being paid: none is sent. */\n reusesPayment?: boolean;\n}",
3508
3578
  "verificationChecked": true
3509
3579
  },
3510
3580
  {
@@ -3532,14 +3602,14 @@
3532
3602
  "name": "OrderRef",
3533
3603
  "kind": "interface",
3534
3604
  "jsdoc": "",
3535
- "decl": "export interface OrderRef {\n /** `<kind>:<id>` of the item, or `payment:<paymentId>` for a payment with no local order. */\n key: string;\n stage: OrderRefStage;\n kind?: string;\n verticalRef?: VerticalRef;\n cashierOrderId?: string;\n wixTransactionId?: string;\n paymentId?: string;\n storeProductId?: string;\n appProductId?: string;\n appleTransactionId?: string;\n /** The StoreKit token StartPayment minted for this payment (D61): recovery finds the order by it. */\n appAccountToken?: string;\n /** For `openingOrder`: when anything its write created has been released by Wix. */\n releaseAt?: number;\n updatedAt: number;\n}",
3605
+ "decl": "export interface OrderRef {\n /** `<kind>:<id>` of the item, or `payment:<paymentId>` for a payment with no local order. */\n key: string;\n stage: OrderRefStage;\n kind?: string;\n verticalRef?: VerticalRef;\n cashierOrderId?: string;\n wixTransactionId?: string;\n paymentId?: string;\n storeProductId?: string;\n appProductId?: string;\n appleTransactionId?: string;\n /** The StoreKit token StartPayment minted for this payment (D61): recovery finds the order by it. */\n appAccountToken?: string;\n /** For `openingOrder`: when anything its write created has been released by Wix. */\n releaseAt?: number;\n /** For `openingOrder`: the attempt that owns the guard. Ownership is checked by it, never by\n * `updatedAt`, which two workers can write in the same millisecond. Absent on guards stored before it. */\n guardToken?: string;\n updatedAt: number;\n}",
3536
3606
  "verificationChecked": true
3537
3607
  },
3538
3608
  {
3539
3609
  "name": "OrderRefPartition",
3540
3610
  "kind": "interface",
3541
3611
  "jsdoc": "",
3542
- "decl": "export interface OrderRefPartition {\n refs(): readonly OrderRef[];\n /** False when the write could not be verified as durable; the caller must not proceed. */\n put(ref: OrderRef): boolean;\n remove(key: string): boolean;\n}",
3612
+ "decl": "export interface OrderRefPartition {\n refs(): readonly OrderRef[];\n /** False when the write could not be verified as durable; the caller must not proceed. */\n put(ref: OrderRef): boolean;\n remove(key: string): boolean;\n /** Writes `next` only while the key still holds `expected`'s creation guard (the same token). */\n replaceGuard(expected: OrderRef, next: OrderRef): GuardWrite;\n /** Removes the key only while it still holds `expected`'s creation guard. */\n removeGuard(expected: OrderRef): GuardWrite;\n}",
3543
3613
  "verificationChecked": true
3544
3614
  },
3545
3615
  {
@@ -3553,7 +3623,7 @@
3553
3623
  "name": "OrderFailureCode",
3554
3624
  "kind": "type",
3555
3625
  "jsdoc": "",
3556
- "decl": "export type OrderFailureCode =\n | \"notEnabled\" | \"notConfigured\" | \"signInRequired\" | \"unsupportedItem\" | \"notAppleRoute\"\n | \"storageUnavailable\" | \"approvalRequired\" | \"orderClosed\" | \"orderRefused\" | \"chargeFailed\"\n | \"paymentRefused\" | \"paymentHeld\" | \"alreadyOwned\" | \"paymentInProgress\" | \"productChanged\"\n | \"sitePaymentUnavailable\" | \"invalidAssociation\" | \"needsSupport\" | \"unavailable\" | \"sessionChanged\" | \"outcomeUnknown\";",
3626
+ "decl": "export type OrderFailureCode =\n | \"notEnabled\" | \"notConfigured\" | \"signInRequired\" | \"unsupportedItem\" | \"notAppleRoute\"\n | \"storageUnavailable\" | \"approvalRequired\" | \"orderClosed\" | \"orderRefused\" | \"chargeFailed\"\n | \"paymentRefused\" | \"paymentHeld\" | \"alreadyOwned\" | \"paymentInProgress\" | \"productChanged\"\n | \"sitePaymentUnavailable\" | \"invalidAssociation\" | \"needsSupport\" | \"unavailable\" | \"sessionChanged\" | \"outcomeUnknown\"\n | \"memberDetailsRequired\" | \"alreadySubscribed\" | \"bookingNotOwned\";",
3557
3627
  "verificationChecked": true
3558
3628
  },
3559
3629
  {
@@ -3588,7 +3658,7 @@
3588
3658
  "name": "AppleIapCheckoutDependencies",
3589
3659
  "kind": "interface",
3590
3660
  "jsdoc": "",
3591
- "decl": "export interface AppleIapCheckoutDependencies {\n wixIap: WixIapClient;\n /** The member signed in for a captured session, from the trusted host (`memberIdentityOf` over the\n * host session). It partitions the references and scopes acknowledgements: wix-iap has no\n * customer ids any more (D61). */\n identity: MemberIdentitySource;\n /** The same trusted binding the wix-iap client uses; it partitions the stored references. */\n binding: AppBindingSource;\n /** The same host provider the wix-iap client was given: every step compares generations. */\n session: SessionProvider;\n clock: Clock;\n cashier: CashierRoute;\n adapters: readonly IapOrderAdapter[];\n /** The screen's catalog pricing: the route and the App Store product a sale must match. */\n pricing: Pick<IapCatalogPricing, \"view\" | \"appleProduct\">;\n store?: TransactionStore;\n refs?: OrderRefStore;\n bridge?: WixBridge;\n jitter?: (baseDelayMs: number) => number;\n onState?: (state: AppleIapCheckoutState) => void;\n}",
3661
+ "decl": "export interface AppleIapCheckoutDependencies {\n wixIap: WixIapClient;\n /** The member signed in for a captured session, from the trusted host (`memberIdentityOf` over the\n * host session). It partitions the references and scopes acknowledgements: wix-iap has no\n * customer ids any more (D61). */\n identity: MemberIdentitySource;\n /** The same trusted binding the wix-iap client uses; it partitions the stored references. */\n binding: AppBindingSource;\n /** The same host provider the wix-iap client was given: every step compares generations. */\n session: SessionProvider;\n clock: Clock;\n cashier: CashierRoute;\n adapters: readonly IapOrderAdapter[];\n /** The screen's catalog pricing: the route and the App Store product a sale must match. */\n pricing: Pick<IapCatalogPricing, \"view\" | \"appleProduct\">;\n store?: TransactionStore;\n /** StoreKit's storefront country for StartItemPayment; defaults to `@himalaya/iap`'s native read. */\n storeCountry?: () => Promise<string | null>;\n refs?: OrderRefStore;\n bridge?: WixBridge;\n jitter?: (baseDelayMs: number) => number;\n onState?: (state: AppleIapCheckoutState) => void;\n}",
3592
3662
  "verificationChecked": true
3593
3663
  },
3594
3664
  {
@@ -3644,7 +3714,7 @@
3644
3714
  "name": "IapPurchaseCopy",
3645
3715
  "kind": "interface",
3646
3716
  "jsdoc": "/** Labels from the screen's copy pack; the shared layer only chooses between them. */",
3647
- "decl": "export interface IapPurchaseCopy {\n buy: string;\n buyAnother?: string;\n processing: string;\n awaitingApproval: string;\n unavailable: string;\n signInRequired: string;\n retry: string;\n /** Optional for existing SDK consumers; the app supplies a localized recovery message. */\n sitePaymentUnavailable?: string;\n priceChanged: string;\n support: string;\n}",
3717
+ "decl": "export interface IapPurchaseCopy {\n buy: string;\n buyAnother?: string;\n processing: string;\n awaitingApproval: string;\n unavailable: string;\n signInRequired: string;\n retry: string;\n /** Optional for existing SDK consumers; the app supplies a localized recovery message. */\n sitePaymentUnavailable?: string;\n /** Optional: the order needs the member's first name, last name and email on their profile. */\n memberDetailsRequired?: string;\n /** Optional: the member already holds a subscription in this app. */\n alreadySubscribed?: string;\n priceChanged: string;\n support: string;\n}",
3648
3718
  "verificationChecked": true
3649
3719
  },
3650
3720
  {
package/guides/skill.md CHANGED
@@ -184,12 +184,12 @@ and is also served at the public URL above. No repository access is required.
184
184
 
185
185
  - **Your platform already holds the owner's Wix session or token** (they connected their Wix account to it): that token **is** the owner. Any valid Wix token can manage that account's apps, publishing included. Pipe it in — `printf '%s' "$TOKEN" | himi login --wix --wix-token-stdin --target wix` — or set `WIX_TOKEN` and run `himi login --wix --target wix`. Never put a token on the command line (argv shows in `ps` and transcripts) or in a file you commit, and never print it.
186
186
  - **A server or CI job** with an account API key: `WIX_API_KEY` + `himi login --wix --target wix`.
187
- - **You hold no token at all:** run `himi login --device --target wix`. It prints a link and a short code. Show the owner both, ask them to open the link on any device where they are signed in to wix.com, check the code matches and approve, then wait: the command returns once they approve (up to 10 minutes).
187
+ - **You hold no token at all:** run `himi login --device --target wix`. It prints a link and a short code. Show the owner both, ask them to open the link on any device where they are signed in to wix.com, check the code matches and approve, then wait: the command returns once they approve (up to 10 minutes). **If the app needs the owner's live site data, add `--site <msid>`** (and `--redirect-uri <uri>` when the app signs members in with its own redirect): the owner picks or confirms that site on the same approve page, and the result's `site` block carries the site's Headless client id (`site.clientId`, a public value — no Wix token reaches you). It is kept per site, so `himi site client list --site <msid>` answers with it afterwards. If `site` carries an `error` instead, the sign-in still worked: give the owner `site.fallbackUrl` to copy the client id from their dashboard.
188
188
  - **None of these:** stop and say exactly what is missing. Do not improvise another route to a himi token.
189
189
 
190
190
  This replaces only the sign-in. The approval gates above still apply to every side effect.
191
191
 
192
- **Live site data needs a site credential.** `himi site client list|ensure` (the site's `WIX_CLIENT_ID`), `himi cms` and `himi data`'s Wix collections call the owner's site directly. They accept, in order: `WIX_API_KEY`; the owner's Wix **account** token in `WIX_TOKEN`, which himi exchanges for a short-lived token on that site (it must be the account that owns the site); or a logged-in `wix` CLI. So if your platform holds the owner's token, keep it in `WIX_TOKEN` for these commands too: piping it to `--wix-token-stdin` signs in to Himi but is not kept afterwards. `--device` alone holds no Wix token and cannot do this. Run `himi site client list --site <msid> --json` once to check. If it fails with `code: "wix_cli_required"`, `"wix_cli_token_failed"`, `"site_token_exchange_denied"` (the token's account does not own that site) or `"site_token_subject_not_account"` (a site token was given where the account token belongs), do not retry it. Ask the owner for one of these: their account token as `WIX_TOKEN` (through the platform, never pasted into chat), `wix login` where you run, an account API key to export as `WIX_API_KEY`, or the client id copied from the `dashboardUrl` in the error. If none of these is possible, tell the owner plainly that the app will show a snapshot of the public site, with no live catalog or booking.
192
+ **Live site data needs a site credential.** `himi site client list|ensure` (the site's `WIX_CLIENT_ID`), `himi cms` and `himi data`'s Wix collections call the owner's site directly. They accept, in order: `WIX_API_KEY`; the owner's Wix **account** token in `WIX_TOKEN`, which himi exchanges for a short-lived token on that site (it must be the account that owns the site); or a logged-in `wix` CLI. So if your platform holds the owner's token, keep it in `WIX_TOKEN` for these commands too: piping it to `--wix-token-stdin` signs in to Himi but is not kept afterwards. A `--device` agent gets the site's client id from `himi login --device --site <msid>` (above) instead, with no Wix token; it still cannot run `himi cms` or `himi data` against the site. Run `himi site client list --site <msid> --json` once to check. If it fails with `code: "wix_cli_required"`, `"wix_cli_token_failed"`, `"site_token_exchange_denied"` (the token's account does not own that site) or `"site_token_subject_not_account"` (a site token was given where the account token belongs), do not retry it. Ask the owner for one of these: their account token as `WIX_TOKEN` (through the platform, never pasted into chat), `wix login` where you run, an account API key to export as `WIX_API_KEY`, or the client id copied from the `dashboardUrl` in the error. If none of these is possible, tell the owner plainly that the app will show a snapshot of the public site, with no live catalog or booking.
193
193
 
194
194
  ## Headless / non-interactive agents
195
195
 
@@ -30,7 +30,7 @@ the SDK sources, so it matches the shipped SDKs.
30
30
  - [`haptic`](https://apps.wix.com/_api/himi-serve/authoring/resource/web-sdk%2Fhaptic?format=md) — Haptic capability. 3 methods.
31
31
  - [`health`](https://apps.wix.com/_api/himi-serve/authoring/resource/web-sdk%2Fhealth?format=md) — Platform HEALTH store. 5 methods.
32
32
  - [`himi_apps`](https://apps.wix.com/_api/himi-serve/authoring/resource/web-sdk%2Fhimi_apps?format=md) — Cross-app open / host queries. 4 methods · not in Brandy.
33
- - [`iap`](https://apps.wix.com/_api/himi-serve/authoring/resource/web-sdk%2Fiap?format=md) — In-app-purchase capability. 9 methods.
33
+ - [`iap`](https://apps.wix.com/_api/himi-serve/authoring/resource/web-sdk%2Fiap?format=md) — In-app-purchase capability. 10 methods.
34
34
  - [`keyboard`](https://apps.wix.com/_api/himi-serve/authoring/resource/web-sdk%2Fkeyboard?format=md) — Keyboard capability. 1 method.
35
35
  - [`legacy_import`](https://apps.wix.com/_api/himi-serve/authoring/resource/web-sdk%2Flegacy_import?format=md) — One-time legacy import report. 2 methods · not in Brandy.
36
36
  - [`live_activity`](https://apps.wix.com/_api/himi-serve/authoring/resource/web-sdk%2Flive_activity?format=md) — Live Activity capability. 3 methods · not in Brandy.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1659.0",
3
+ "version": "0.1661.0",
4
4
  "type": "module",
5
5
  "description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
6
6
  "keywords": [
@@ -72,5 +72,5 @@
72
72
  "artifactId": "himalaya-cli"
73
73
  }
74
74
  },
75
- "falconPackageHash": "6beaebe228d4dbcf442f259fa073ca5ee769cdf4adb902a1a270d6c0"
75
+ "falconPackageHash": "545eb57867cfae3959c869789a561c017b67c8a66d6a9c5f69cdee90"
76
76
  }
@@ -26,6 +26,8 @@ export const ATTENDANCE_INITIAL: AttendancePurchaseFields = {
26
26
  };
27
27
  export const ATTENDANCE_NOT_HYDRATED = [...Object.keys(ATTENDANCE_INITIAL), "_poll"] as (keyof AttendancePurchaseFields & string)[];
28
28
 
29
+ const CORRECTABLE = new Set(["orderRefused", "productChanged", "memberDetailsRequired", "bookingNotOwned"]);
30
+
29
31
  export function createAttendancePurchase(options: { kind: "bookingsService" | "eventsTicket"; prefix: string; pollAction: string; onChange(): void }) {
30
32
  const { prefix } = options;
31
33
  let form = createAttendanceForm(prefix);
@@ -187,7 +189,10 @@ export function createAttendancePurchase(options: { kind: "bookingsService" | "e
187
189
  if (reference) {
188
190
  for (const [target, attempt] of attempts) {
189
191
  const item = `${reference.kind}:${reference.id}#${encodeURIComponent(attempt)}`;
190
- const canCorrect = state.phase === "cancelled" || (state.phase === "refused" && (state.failure === "orderRefused" || state.failure === "productChanged"));
192
+ // Refusals that leave nothing to pay: the member may fix the details (a profile, a booking the
193
+ // server did not attribute to them) and start a fresh attempt. A transient failure keeps the
194
+ // attempt, so its next tap reopens the same order instead of booking twice.
195
+ const canCorrect = state.phase === "cancelled" || (state.phase === "refused" && CORRECTABLE.has(state.failure ?? ""));
191
196
  if (canCorrect && state.item === item) { attempts.delete(target); submittedForms.delete(`${reference.kind}:${reference.id}`); }
192
197
  }
193
198
  const referencePrefix = `${reference.kind}:${reference.id}:`;
@@ -27,6 +27,8 @@ export function iapPurchaseCopy(prefix: string): IapPurchaseCopy {
27
27
  unavailable: copyParam(`${prefix}.purchaseTemporarilyUnavailableText`, "Purchasing is temporarily unavailable."),
28
28
  signInRequired: copyParam(`${prefix}.purchaseSignInText`, "Sign in to buy."),
29
29
  sitePaymentUnavailable: paymentSetupMessage(prefix),
30
+ memberDetailsRequired: copyParam(`${prefix}.purchaseMemberDetailsText`, "Add your first name, last name and email to your profile, then try again."),
31
+ alreadySubscribed: copyParam(`${prefix}.purchaseAlreadySubscribedText`, "You already have a subscription in this app."),
30
32
  retry: copyParam(`${prefix}.purchaseRetryText`, "Something went wrong. Try again."),
31
33
  priceChanged: copyParam(`${prefix}.purchasePriceChangedText`, "The price changed. Check it and try again."),
32
34
  support: copyParam(`${prefix}.purchaseSupportText`, "We couldn't finish this purchase. Contact support."),
@@ -26,6 +26,8 @@ export const ATTENDANCE_INITIAL: AttendancePurchaseFields = {
26
26
  };
27
27
  export const ATTENDANCE_NOT_HYDRATED = [...Object.keys(ATTENDANCE_INITIAL), "_poll"] as (keyof AttendancePurchaseFields & string)[];
28
28
 
29
+ const CORRECTABLE = new Set(["orderRefused", "productChanged", "memberDetailsRequired", "bookingNotOwned"]);
30
+
29
31
  export function createAttendancePurchase(options: { kind: "bookingsService" | "eventsTicket"; prefix: string; pollAction: string; onChange(): void }) {
30
32
  const { prefix } = options;
31
33
  let form = createAttendanceForm(prefix);
@@ -187,7 +189,10 @@ export function createAttendancePurchase(options: { kind: "bookingsService" | "e
187
189
  if (reference) {
188
190
  for (const [target, attempt] of attempts) {
189
191
  const item = `${reference.kind}:${reference.id}#${encodeURIComponent(attempt)}`;
190
- const canCorrect = state.phase === "cancelled" || (state.phase === "refused" && (state.failure === "orderRefused" || state.failure === "productChanged"));
192
+ // Refusals that leave nothing to pay: the member may fix the details (a profile, a booking the
193
+ // server did not attribute to them) and start a fresh attempt. A transient failure keeps the
194
+ // attempt, so its next tap reopens the same order instead of booking twice.
195
+ const canCorrect = state.phase === "cancelled" || (state.phase === "refused" && CORRECTABLE.has(state.failure ?? ""));
191
196
  if (canCorrect && state.item === item) { attempts.delete(target); submittedForms.delete(`${reference.kind}:${reference.id}`); }
192
197
  }
193
198
  const referencePrefix = `${reference.kind}:${reference.id}:`;
@@ -27,6 +27,8 @@ export function iapPurchaseCopy(prefix: string): IapPurchaseCopy {
27
27
  unavailable: copyParam(`${prefix}.purchaseTemporarilyUnavailableText`, "Purchasing is temporarily unavailable."),
28
28
  signInRequired: copyParam(`${prefix}.purchaseSignInText`, "Sign in to buy."),
29
29
  sitePaymentUnavailable: paymentSetupMessage(prefix),
30
+ memberDetailsRequired: copyParam(`${prefix}.purchaseMemberDetailsText`, "Add your first name, last name and email to your profile, then try again."),
31
+ alreadySubscribed: copyParam(`${prefix}.purchaseAlreadySubscribedText`, "You already have a subscription in this app."),
30
32
  retry: copyParam(`${prefix}.purchaseRetryText`, "Something went wrong. Try again."),
31
33
  priceChanged: copyParam(`${prefix}.purchasePriceChangedText`, "The price changed. Check it and try again."),
32
34
  support: copyParam(`${prefix}.purchaseSupportText`, "We couldn't finish this purchase. Contact support."),
@@ -26,6 +26,8 @@ export const ATTENDANCE_INITIAL: AttendancePurchaseFields = {
26
26
  };
27
27
  export const ATTENDANCE_NOT_HYDRATED = [...Object.keys(ATTENDANCE_INITIAL), "_poll"] as (keyof AttendancePurchaseFields & string)[];
28
28
 
29
+ const CORRECTABLE = new Set(["orderRefused", "productChanged", "memberDetailsRequired", "bookingNotOwned"]);
30
+
29
31
  export function createAttendancePurchase(options: { kind: "bookingsService" | "eventsTicket"; prefix: string; pollAction: string; onChange(): void }) {
30
32
  const { prefix } = options;
31
33
  let form = createAttendanceForm(prefix);
@@ -187,7 +189,10 @@ export function createAttendancePurchase(options: { kind: "bookingsService" | "e
187
189
  if (reference) {
188
190
  for (const [target, attempt] of attempts) {
189
191
  const item = `${reference.kind}:${reference.id}#${encodeURIComponent(attempt)}`;
190
- const canCorrect = state.phase === "cancelled" || (state.phase === "refused" && (state.failure === "orderRefused" || state.failure === "productChanged"));
192
+ // Refusals that leave nothing to pay: the member may fix the details (a profile, a booking the
193
+ // server did not attribute to them) and start a fresh attempt. A transient failure keeps the
194
+ // attempt, so its next tap reopens the same order instead of booking twice.
195
+ const canCorrect = state.phase === "cancelled" || (state.phase === "refused" && CORRECTABLE.has(state.failure ?? ""));
191
196
  if (canCorrect && state.item === item) { attempts.delete(target); submittedForms.delete(`${reference.kind}:${reference.id}`); }
192
197
  }
193
198
  const referencePrefix = `${reference.kind}:${reference.id}:`;
@@ -27,6 +27,8 @@ export function iapPurchaseCopy(prefix: string): IapPurchaseCopy {
27
27
  unavailable: copyParam(`${prefix}.purchaseTemporarilyUnavailableText`, "Purchasing is temporarily unavailable."),
28
28
  signInRequired: copyParam(`${prefix}.purchaseSignInText`, "Sign in to buy."),
29
29
  sitePaymentUnavailable: paymentSetupMessage(prefix),
30
+ memberDetailsRequired: copyParam(`${prefix}.purchaseMemberDetailsText`, "Add your first name, last name and email to your profile, then try again."),
31
+ alreadySubscribed: copyParam(`${prefix}.purchaseAlreadySubscribedText`, "You already have a subscription in this app."),
30
32
  retry: copyParam(`${prefix}.purchaseRetryText`, "Something went wrong. Try again."),
31
33
  priceChanged: copyParam(`${prefix}.purchasePriceChangedText`, "The price changed. Check it and try again."),
32
34
  support: copyParam(`${prefix}.purchaseSupportText`, "We couldn't finish this purchase. Contact support."),
@@ -26,6 +26,8 @@ export const ATTENDANCE_INITIAL: AttendancePurchaseFields = {
26
26
  };
27
27
  export const ATTENDANCE_NOT_HYDRATED = [...Object.keys(ATTENDANCE_INITIAL), "_poll"] as (keyof AttendancePurchaseFields & string)[];
28
28
 
29
+ const CORRECTABLE = new Set(["orderRefused", "productChanged", "memberDetailsRequired", "bookingNotOwned"]);
30
+
29
31
  export function createAttendancePurchase(options: { kind: "bookingsService" | "eventsTicket"; prefix: string; pollAction: string; onChange(): void }) {
30
32
  const { prefix } = options;
31
33
  let form = createAttendanceForm(prefix);
@@ -187,7 +189,10 @@ export function createAttendancePurchase(options: { kind: "bookingsService" | "e
187
189
  if (reference) {
188
190
  for (const [target, attempt] of attempts) {
189
191
  const item = `${reference.kind}:${reference.id}#${encodeURIComponent(attempt)}`;
190
- const canCorrect = state.phase === "cancelled" || (state.phase === "refused" && (state.failure === "orderRefused" || state.failure === "productChanged"));
192
+ // Refusals that leave nothing to pay: the member may fix the details (a profile, a booking the
193
+ // server did not attribute to them) and start a fresh attempt. A transient failure keeps the
194
+ // attempt, so its next tap reopens the same order instead of booking twice.
195
+ const canCorrect = state.phase === "cancelled" || (state.phase === "refused" && CORRECTABLE.has(state.failure ?? ""));
191
196
  if (canCorrect && state.item === item) { attempts.delete(target); submittedForms.delete(`${reference.kind}:${reference.id}`); }
192
197
  }
193
198
  const referencePrefix = `${reference.kind}:${reference.id}:`;
@@ -27,6 +27,8 @@ export function iapPurchaseCopy(prefix: string): IapPurchaseCopy {
27
27
  unavailable: copyParam(`${prefix}.purchaseTemporarilyUnavailableText`, "Purchasing is temporarily unavailable."),
28
28
  signInRequired: copyParam(`${prefix}.purchaseSignInText`, "Sign in to buy."),
29
29
  sitePaymentUnavailable: paymentSetupMessage(prefix),
30
+ memberDetailsRequired: copyParam(`${prefix}.purchaseMemberDetailsText`, "Add your first name, last name and email to your profile, then try again."),
31
+ alreadySubscribed: copyParam(`${prefix}.purchaseAlreadySubscribedText`, "You already have a subscription in this app."),
30
32
  retry: copyParam(`${prefix}.purchaseRetryText`, "Something went wrong. Try again."),
31
33
  priceChanged: copyParam(`${prefix}.purchasePriceChangedText`, "The price changed. Check it and try again."),
32
34
  support: copyParam(`${prefix}.purchaseSupportText`, "We couldn't finish this purchase. Contact support."),
@@ -26,6 +26,8 @@ export const ATTENDANCE_INITIAL: AttendancePurchaseFields = {
26
26
  };
27
27
  export const ATTENDANCE_NOT_HYDRATED = [...Object.keys(ATTENDANCE_INITIAL), "_poll"] as (keyof AttendancePurchaseFields & string)[];
28
28
 
29
+ const CORRECTABLE = new Set(["orderRefused", "productChanged", "memberDetailsRequired", "bookingNotOwned"]);
30
+
29
31
  export function createAttendancePurchase(options: { kind: "bookingsService" | "eventsTicket"; prefix: string; pollAction: string; onChange(): void }) {
30
32
  const { prefix } = options;
31
33
  let form = createAttendanceForm(prefix);
@@ -187,7 +189,10 @@ export function createAttendancePurchase(options: { kind: "bookingsService" | "e
187
189
  if (reference) {
188
190
  for (const [target, attempt] of attempts) {
189
191
  const item = `${reference.kind}:${reference.id}#${encodeURIComponent(attempt)}`;
190
- const canCorrect = state.phase === "cancelled" || (state.phase === "refused" && (state.failure === "orderRefused" || state.failure === "productChanged"));
192
+ // Refusals that leave nothing to pay: the member may fix the details (a profile, a booking the
193
+ // server did not attribute to them) and start a fresh attempt. A transient failure keeps the
194
+ // attempt, so its next tap reopens the same order instead of booking twice.
195
+ const canCorrect = state.phase === "cancelled" || (state.phase === "refused" && CORRECTABLE.has(state.failure ?? ""));
191
196
  if (canCorrect && state.item === item) { attempts.delete(target); submittedForms.delete(`${reference.kind}:${reference.id}`); }
192
197
  }
193
198
  const referencePrefix = `${reference.kind}:${reference.id}:`;
@@ -27,6 +27,8 @@ export function iapPurchaseCopy(prefix: string): IapPurchaseCopy {
27
27
  unavailable: copyParam(`${prefix}.purchaseTemporarilyUnavailableText`, "Purchasing is temporarily unavailable."),
28
28
  signInRequired: copyParam(`${prefix}.purchaseSignInText`, "Sign in to buy."),
29
29
  sitePaymentUnavailable: paymentSetupMessage(prefix),
30
+ memberDetailsRequired: copyParam(`${prefix}.purchaseMemberDetailsText`, "Add your first name, last name and email to your profile, then try again."),
31
+ alreadySubscribed: copyParam(`${prefix}.purchaseAlreadySubscribedText`, "You already have a subscription in this app."),
30
32
  retry: copyParam(`${prefix}.purchaseRetryText`, "Something went wrong. Try again."),
31
33
  priceChanged: copyParam(`${prefix}.purchasePriceChangedText`, "The price changed. Check it and try again."),
32
34
  support: copyParam(`${prefix}.purchaseSupportText`, "We couldn't finish this purchase. Contact support."),
@@ -26,6 +26,8 @@ export const ATTENDANCE_INITIAL: AttendancePurchaseFields = {
26
26
  };
27
27
  export const ATTENDANCE_NOT_HYDRATED = [...Object.keys(ATTENDANCE_INITIAL), "_poll"] as (keyof AttendancePurchaseFields & string)[];
28
28
 
29
+ const CORRECTABLE = new Set(["orderRefused", "productChanged", "memberDetailsRequired", "bookingNotOwned"]);
30
+
29
31
  export function createAttendancePurchase(options: { kind: "bookingsService" | "eventsTicket"; prefix: string; pollAction: string; onChange(): void }) {
30
32
  const { prefix } = options;
31
33
  let form = createAttendanceForm(prefix);
@@ -187,7 +189,10 @@ export function createAttendancePurchase(options: { kind: "bookingsService" | "e
187
189
  if (reference) {
188
190
  for (const [target, attempt] of attempts) {
189
191
  const item = `${reference.kind}:${reference.id}#${encodeURIComponent(attempt)}`;
190
- const canCorrect = state.phase === "cancelled" || (state.phase === "refused" && (state.failure === "orderRefused" || state.failure === "productChanged"));
192
+ // Refusals that leave nothing to pay: the member may fix the details (a profile, a booking the
193
+ // server did not attribute to them) and start a fresh attempt. A transient failure keeps the
194
+ // attempt, so its next tap reopens the same order instead of booking twice.
195
+ const canCorrect = state.phase === "cancelled" || (state.phase === "refused" && CORRECTABLE.has(state.failure ?? ""));
191
196
  if (canCorrect && state.item === item) { attempts.delete(target); submittedForms.delete(`${reference.kind}:${reference.id}`); }
192
197
  }
193
198
  const referencePrefix = `${reference.kind}:${reference.id}:`;
@@ -27,6 +27,8 @@ export function iapPurchaseCopy(prefix: string): IapPurchaseCopy {
27
27
  unavailable: copyParam(`${prefix}.purchaseTemporarilyUnavailableText`, "Purchasing is temporarily unavailable."),
28
28
  signInRequired: copyParam(`${prefix}.purchaseSignInText`, "Sign in to buy."),
29
29
  sitePaymentUnavailable: paymentSetupMessage(prefix),
30
+ memberDetailsRequired: copyParam(`${prefix}.purchaseMemberDetailsText`, "Add your first name, last name and email to your profile, then try again."),
31
+ alreadySubscribed: copyParam(`${prefix}.purchaseAlreadySubscribedText`, "You already have a subscription in this app."),
30
32
  retry: copyParam(`${prefix}.purchaseRetryText`, "Something went wrong. Try again."),
31
33
  priceChanged: copyParam(`${prefix}.purchasePriceChangedText`, "The price changed. Check it and try again."),
32
34
  support: copyParam(`${prefix}.purchaseSupportText`, "We couldn't finish this purchase. Contact support."),
@@ -26,6 +26,8 @@ export const ATTENDANCE_INITIAL: AttendancePurchaseFields = {
26
26
  };
27
27
  export const ATTENDANCE_NOT_HYDRATED = [...Object.keys(ATTENDANCE_INITIAL), "_poll"] as (keyof AttendancePurchaseFields & string)[];
28
28
 
29
+ const CORRECTABLE = new Set(["orderRefused", "productChanged", "memberDetailsRequired", "bookingNotOwned"]);
30
+
29
31
  export function createAttendancePurchase(options: { kind: "bookingsService" | "eventsTicket"; prefix: string; pollAction: string; onChange(): void }) {
30
32
  const { prefix } = options;
31
33
  let form = createAttendanceForm(prefix);
@@ -187,7 +189,10 @@ export function createAttendancePurchase(options: { kind: "bookingsService" | "e
187
189
  if (reference) {
188
190
  for (const [target, attempt] of attempts) {
189
191
  const item = `${reference.kind}:${reference.id}#${encodeURIComponent(attempt)}`;
190
- const canCorrect = state.phase === "cancelled" || (state.phase === "refused" && (state.failure === "orderRefused" || state.failure === "productChanged"));
192
+ // Refusals that leave nothing to pay: the member may fix the details (a profile, a booking the
193
+ // server did not attribute to them) and start a fresh attempt. A transient failure keeps the
194
+ // attempt, so its next tap reopens the same order instead of booking twice.
195
+ const canCorrect = state.phase === "cancelled" || (state.phase === "refused" && CORRECTABLE.has(state.failure ?? ""));
191
196
  if (canCorrect && state.item === item) { attempts.delete(target); submittedForms.delete(`${reference.kind}:${reference.id}`); }
192
197
  }
193
198
  const referencePrefix = `${reference.kind}:${reference.id}:`;
@@ -27,6 +27,8 @@ export function iapPurchaseCopy(prefix: string): IapPurchaseCopy {
27
27
  unavailable: copyParam(`${prefix}.purchaseTemporarilyUnavailableText`, "Purchasing is temporarily unavailable."),
28
28
  signInRequired: copyParam(`${prefix}.purchaseSignInText`, "Sign in to buy."),
29
29
  sitePaymentUnavailable: paymentSetupMessage(prefix),
30
+ memberDetailsRequired: copyParam(`${prefix}.purchaseMemberDetailsText`, "Add your first name, last name and email to your profile, then try again."),
31
+ alreadySubscribed: copyParam(`${prefix}.purchaseAlreadySubscribedText`, "You already have a subscription in this app."),
30
32
  retry: copyParam(`${prefix}.purchaseRetryText`, "Something went wrong. Try again."),
31
33
  priceChanged: copyParam(`${prefix}.purchasePriceChangedText`, "The price changed. Check it and try again."),
32
34
  support: copyParam(`${prefix}.purchaseSupportText`, "We couldn't finish this purchase. Contact support."),