@wix/himalaya-cli 0.1658.0 → 0.1660.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/attendance-classifier.d.ts +3 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/delivery-contract.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/index.d.ts +7 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments-contract.d.ts +19 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments-wire.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/apple-iap-contract.d.ts +22 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/commerce-contract.d.ts +4 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-order-backend.d.ts +5 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/attendance-orders.d.ts +10 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/attendance.d.ts +4 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/index.d.ts +13 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/online-programs-orders.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/online-programs.d.ts +2 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/pricing-plans-orders.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/pricing-plans.d.ts +4 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/shared.d.ts +3 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap-checkout.mjs +545 -166
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap.mjs +52 -8
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +423 -88
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +1 -1
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{c04dd5fc5ad48e6b19678d4313159302e9a513ada94bfe515d8dfd5a54d46f5d.bin → fcafca348b6b973cfc2eadc938ddec3c515c641874cbca1667a43b22e1bf7a39.bin} +1 -1
- package/dist/browser-plane/sw.js +1 -1
- package/dist/cli.mjs +1457 -228
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/himi-json-output.md +39 -0
- package/guides/qa-builds.md +20 -0
- package/guides/sdk-reference.json +79 -9
- package/guides/skill.md +3 -1
- package/guides/web-page-sdk-reference.md +1 -1
- package/package.json +2 -2
- package/templates/beauty-salon/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/beauty-salon/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/branded-lite/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/branded-lite/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/community-club/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/community-club/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/conference/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/conference/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/events-meetups/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/events-meetups/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/gym-fitness/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/gym-fitness/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/nonprofit-cause/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/nonprofit-cause/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/podcast-creator/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/podcast-creator/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/portfolio-creative/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/portfolio-creative/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/restaurant/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/restaurant/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/retail-store/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/salon-spa/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/salon-spa/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/wholesale-store/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/yoga-studio/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/yoga-studio/tier5-src/_shared/iap-worker.ts +2 -0
|
Binary file
|
|
@@ -33,6 +33,44 @@ 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
|
+
|
|
61
|
+
## `himi site client list|ensure` codes
|
|
62
|
+
|
|
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 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`). 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.
|
|
64
|
+
|
|
65
|
+
| Code | Meaning |
|
|
66
|
+
| --- | --- |
|
|
67
|
+
| `wix_cli_required` | No site credential: `WIX_TOKEN` and `WIX_API_KEY` are not set and the `wix` CLI is not on PATH. Export the owner's account token as `WIX_TOKEN`, install the CLI and run `wix login` on this machine, or export `WIX_API_KEY`. |
|
|
68
|
+
| `wix_cli_token_failed` | The `wix` CLI ran but printed no token: it is not logged in, or it refused to run (for example on an unsupported Node version). `error` carries the CLI's own output, credentials redacted. Run `wix token --site <msid>` to see why, then `wix login`, or export `WIX_API_KEY`. |
|
|
69
|
+
| `site_token_exchange_denied` | Wix refused to exchange `WIX_TOKEN` for the site: a `403`, a site the token's account does not own (`invalid_target`), or a token not issued to a Wix app's client (`unauthorized_client`). `error` carries Wix's code and description. Check the site id, or use the token of the account that owns the site. himi does not fall back to the `wix` CLI, which may be signed in as someone else. |
|
|
70
|
+
| `site_token_subject_not_account` | `WIX_TOKEN` holds a site-level token. Only an account-level token can be exchanged (Wix: `400 invalid_request`, "must be an account-level token"). Set `WIX_TOKEN` to the owner's account token (`wix token` without `--site`). |
|
|
71
|
+
|
|
72
|
+
This is not a whole-command migration: the command's other refusals still have no code.
|
|
73
|
+
|
|
36
74
|
## `himi sdk unverified` codes
|
|
37
75
|
|
|
38
76
|
| Code | Meaning |
|
|
@@ -218,6 +256,7 @@ target the command read, e.g. `himi login --browser --target wix`.
|
|
|
218
256
|
| `control_token_expired` | The stored control token is past its `exp`. Decided locally before any network call; run `himi login`. |
|
|
219
257
|
| `owner_login_required` | No usable owner login: the control token is missing or has no subject, or the plane answered 401/403 to the owner-apps read (`GET /v1/owner/apps`). Run `himi login`. Other failures of that read stay `app_ownership_unknown`. |
|
|
220
258
|
| `flag_not_supported_with_ping` | A local-sender flag was passed with `--provider ping`; `flag` names it. `--badge` is one: Ping has no badge field, and for a Branded app Ping sets the iOS badge itself from the member's unseen Ping feed items. |
|
|
259
|
+
| `all_members_not_supported_for_site_app` | `--all-members` with a site app's project token (a site lease). Its roster pre-check needs the account that owns the site, which the lease does not name; send to one member with `--member-email`. |
|
|
221
260
|
|
|
222
261
|
## `himi cms seed` codes
|
|
223
262
|
|
package/guides/qa-builds.md
CHANGED
|
@@ -1335,6 +1335,26 @@ himi dist --app <app> --platform android --aab --wait --target bo
|
|
|
1335
1335
|
502 (the prepared files failed Himalaya's checks, the check's code in `reason`: a fix on Wix's
|
|
1336
1336
|
side, not a retry), `store_builds_unavailable` 503. A named `--signing byo` keeps the
|
|
1337
1337
|
customer-signed path above, from the site's legacy BuildSecrets.
|
|
1338
|
+
- **mobile-apps-containers-builder can start these store builds itself, as a trusted caller.** A
|
|
1339
|
+
request with no `X-Control-Token` whose Wix identity the platform verified is a SERVICE identity
|
|
1340
|
+
(`serviceIdentity.appDefId`) listed in `HIMI_TRUSTED_STORE_BUILD_APPS` (comma-separated; empty is
|
|
1341
|
+
off, though a call to these routes without a control token still logs `Himalaya trusted caller
|
|
1342
|
+
refused` with its identity kinds and app ids, the probe for which id to list) may
|
|
1343
|
+
`POST /v1/admin/dist` a Containers app's Google Play bundle or App Store build with
|
|
1344
|
+
`storeBuild: { metaSiteId, storeId }` and its own `attemptId` (required). The service has already
|
|
1345
|
+
checked the site's owner, plan, saved store id and its store-app hold, and records the build once
|
|
1346
|
+
the plane accepts it, so the plane skips the owner check, the hold, `CheckIfBuildIsAllowed`,
|
|
1347
|
+
`CreateBuildRecordIfAllowed` and every `UpdateStoreBuild`, and builds under `storeId`. Every check of the plane's own still runs
|
|
1348
|
+
(shape, release, shell, store marker, icon, kill switch, the per-app cap; for the App Store,
|
|
1349
|
+
`PrepareAppleCertificates`, whose bundle id must equal `storeId`: `409 store_id_mismatch`). The app
|
|
1350
|
+
must be bound to `metaSiteId` (`403 store_build_site_mismatch`); only the store-build fields are
|
|
1351
|
+
accepted (`400 trusted_store_build_field_unexpected`, `trusted_store_build_only`,
|
|
1352
|
+
`store_build_invalid`, `attempt_id_required`, `store_id_invalid`); its builds count per site in the
|
|
1353
|
+
self-serve tier, and `HIMI_DIST_SELFSERVE=0` closes them too. The caller reads
|
|
1354
|
+
(`GET /v1/admin/dist/<job>`), lists (`?app=`, each job with its `attemptId`) and cancels only the
|
|
1355
|
+
jobs it started (`403 forbidden_cross_tenant` otherwise), and a settled job carries
|
|
1356
|
+
`storeBuildResult`, the result the service used to be sent. A request with a control token is the
|
|
1357
|
+
path above, unchanged, and both stay: the Containers server picks one per site. MOBPUB-1241.
|
|
1338
1358
|
- **A store build ships under the owner's App name and icon.** Both store builds above (a Containers
|
|
1339
1359
|
app's `--aab` and its TestFlight build) need `appName` and `appIconUrl` on `POST /v1/admin/dist`
|
|
1340
1360
|
(`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
|
|
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",
|
|
@@ -3503,8 +3573,8 @@
|
|
|
3503
3573
|
{
|
|
3504
3574
|
"name": "IapItemPaymentAdapter",
|
|
3505
3575
|
"kind": "interface",
|
|
3506
|
-
"jsdoc": "
|
|
3507
|
-
"decl": "export interface IapItemPaymentAdapter extends IapAdapterBase {\n /** The catalog item to order, for an item `eligibility` accepted. */\n itemPayment(item: IapOrderItem): ItemPayment
|
|
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) => void):\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
|
{
|
|
@@ -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,11 +184,13 @@ 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. 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
|
+
|
|
192
194
|
## Headless / non-interactive agents
|
|
193
195
|
|
|
194
196
|
When there is no human in the loop (QA runner, cron, dispatched agent), do not invent a turn-by-turn approval chat. Map each gate to what the invocation already supplied:
|
|
@@ -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.
|
|
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.
|
|
3
|
+
"version": "0.1660.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": "
|
|
75
|
+
"falconPackageHash": "e2336ceb2590a9a8d43c93035c296a1a7cca6730797e90393ba7d957"
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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}:`;
|