@wix/himalaya-cli 0.1526.0 → 0.1528.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 (142) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/state/src/connectivity.d.ts +5 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/state/src/index.d.ts +1 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/state.mjs +14 -0
  4. package/dist/cli.mjs +3633 -3260
  5. package/dist/preview-assets.generated.bin +0 -0
  6. package/guides/himi-json-output.md +45 -0
  7. package/guides/himi-mcp.md +41 -0
  8. package/guides/himi-test.md +3 -3
  9. package/guides/iap-products.md +88 -23
  10. package/package.json +2 -2
  11. package/templates/beauty-salon/dev/index.ts +2027 -759
  12. package/templates/beauty-salon/tier5-src/_shared/collection-service.ts +5 -1
  13. package/templates/beauty-salon/tier5-src/_shared/online-actions.ts +76 -0
  14. package/templates/beauty-salon/tier5-src/himi-booking-bookings/index.ts +1 -0
  15. package/templates/beauty-salon/tier5-src/himi-booking-time/index.ts +803 -284
  16. package/templates/beauty-salon/tier5-src/himi-branded-lite-address/index.ts +3 -1
  17. package/templates/beauty-salon/tier5-src/himi-branded-lite-addresses/index.ts +3 -1
  18. package/templates/beauty-salon/tier5-src/himi-branded-lite-cart/index.ts +3 -0
  19. package/templates/beauty-salon/tier5-src/himi-branded-lite-order/index.ts +3 -1
  20. package/templates/beauty-salon/tier5-src/himi-branded-lite-plans/index.ts +13 -1
  21. package/templates/beauty-salon/tier5-src/himi-branded-lite-wallet/index.ts +3 -1
  22. package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +10 -4
  23. package/templates/beauty-salon-owner/tier5-src/_shared/collection-service.ts +5 -1
  24. package/templates/beauty-salon-owner/tier5-src/_shared/online-actions.ts +76 -0
  25. package/templates/branded-lite/dev/index.ts +1910 -603
  26. package/templates/branded-lite/tier5-src/_shared/collection-service.ts +5 -1
  27. package/templates/branded-lite/tier5-src/_shared/online-actions.ts +76 -0
  28. package/templates/branded-lite/tier5-src/himi-booking-bookings/index.ts +1 -0
  29. package/templates/branded-lite/tier5-src/himi-booking-time/index.ts +803 -284
  30. package/templates/branded-lite/tier5-src/himi-branded-lite-address/index.ts +3 -1
  31. package/templates/branded-lite/tier5-src/himi-branded-lite-addresses/index.ts +3 -1
  32. package/templates/branded-lite/tier5-src/himi-branded-lite-cart/index.ts +3 -0
  33. package/templates/branded-lite/tier5-src/himi-branded-lite-feed/index.ts +3 -1
  34. package/templates/branded-lite/tier5-src/himi-branded-lite-group/index.ts +3 -1
  35. package/templates/branded-lite/tier5-src/himi-branded-lite-notifications/index.ts +6 -4
  36. package/templates/branded-lite/tier5-src/himi-branded-lite-notifsettings/index.ts +6 -4
  37. package/templates/branded-lite/tier5-src/himi-branded-lite-order/index.ts +3 -1
  38. package/templates/branded-lite/tier5-src/himi-branded-lite-plans/index.ts +13 -1
  39. package/templates/branded-lite/tier5-src/himi-branded-lite-program/index.ts +3 -1
  40. package/templates/branded-lite/tier5-src/himi-branded-lite-reservations/index.ts +6 -4
  41. package/templates/branded-lite/tier5-src/himi-branded-lite-reserve/index.ts +3 -1
  42. package/templates/branded-lite/tier5-src/himi-branded-lite-wallet/index.ts +3 -1
  43. package/templates/branded-lite/tier5-src/himi-events-detail/index.ts +8 -1
  44. package/templates/branded-lite/tier5-src/himi-events-rsvp/index.ts +7 -4
  45. package/templates/branded-lite/tier5-src/himi-store-product/index.ts +10 -4
  46. package/templates/community-club/tier5-src/_shared/collection-service.ts +5 -1
  47. package/templates/community-club/tier5-src/_shared/online-actions.ts +76 -0
  48. package/templates/community-club/tier5-src/himi-branded-lite-feed/index.ts +3 -1
  49. package/templates/community-club/tier5-src/himi-branded-lite-group/index.ts +3 -1
  50. package/templates/community-club/tier5-src/himi-events-detail/index.ts +8 -1
  51. package/templates/community-club/tier5-src/himi-events-rsvp/index.ts +7 -4
  52. package/templates/community-club-owner/tier5-src/_shared/collection-service.ts +5 -1
  53. package/templates/community-club-owner/tier5-src/_shared/online-actions.ts +76 -0
  54. package/templates/events-meetups/tier5-src/_shared/collection-service.ts +5 -1
  55. package/templates/events-meetups/tier5-src/_shared/online-actions.ts +76 -0
  56. package/templates/events-meetups/tier5-src/himi-branded-lite-feed/index.ts +3 -1
  57. package/templates/events-meetups/tier5-src/himi-branded-lite-group/index.ts +3 -1
  58. package/templates/events-meetups/tier5-src/himi-events-detail/index.ts +8 -1
  59. package/templates/events-meetups/tier5-src/himi-events-rsvp/index.ts +7 -4
  60. package/templates/events-meetups-owner/tier5-src/_shared/collection-service.ts +5 -1
  61. package/templates/events-meetups-owner/tier5-src/_shared/online-actions.ts +76 -0
  62. package/templates/gym-fitness/dev/index.ts +2024 -756
  63. package/templates/gym-fitness/tier5-src/_shared/collection-service.ts +5 -1
  64. package/templates/gym-fitness/tier5-src/_shared/online-actions.ts +76 -0
  65. package/templates/gym-fitness/tier5-src/himi-booking-bookings/index.ts +1 -0
  66. package/templates/gym-fitness/tier5-src/himi-booking-time/index.ts +803 -284
  67. package/templates/gym-fitness/tier5-src/himi-branded-lite-address/index.ts +3 -1
  68. package/templates/gym-fitness/tier5-src/himi-branded-lite-addresses/index.ts +3 -1
  69. package/templates/gym-fitness/tier5-src/himi-branded-lite-cart/index.ts +3 -0
  70. package/templates/gym-fitness/tier5-src/himi-branded-lite-order/index.ts +3 -1
  71. package/templates/gym-fitness/tier5-src/himi-branded-lite-plans/index.ts +13 -1
  72. package/templates/gym-fitness/tier5-src/himi-branded-lite-wallet/index.ts +3 -1
  73. package/templates/gym-fitness/tier5-src/himi-events-detail/index.ts +8 -1
  74. package/templates/gym-fitness/tier5-src/himi-events-rsvp/index.ts +7 -4
  75. package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +10 -4
  76. package/templates/gym-fitness-owner/tier5-src/_shared/collection-service.ts +5 -1
  77. package/templates/gym-fitness-owner/tier5-src/_shared/online-actions.ts +76 -0
  78. package/templates/nonprofit-cause/tier5-src/_shared/collection-service.ts +5 -1
  79. package/templates/nonprofit-cause/tier5-src/_shared/online-actions.ts +76 -0
  80. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-feed/index.ts +3 -1
  81. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-group/index.ts +3 -1
  82. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-plans/index.ts +13 -1
  83. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-wallet/index.ts +3 -1
  84. package/templates/nonprofit-cause/tier5-src/himi-events-detail/index.ts +8 -1
  85. package/templates/nonprofit-cause/tier5-src/himi-events-rsvp/index.ts +7 -4
  86. package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-service.ts +5 -1
  87. package/templates/nonprofit-cause-owner/tier5-src/_shared/online-actions.ts +76 -0
  88. package/templates/owner-lite/tier5-src/_shared/collection-service.ts +5 -1
  89. package/templates/owner-lite/tier5-src/_shared/online-actions.ts +76 -0
  90. package/templates/podcast-creator/tier5-src/_shared/collection-service.ts +5 -1
  91. package/templates/podcast-creator/tier5-src/_shared/online-actions.ts +76 -0
  92. package/templates/podcast-creator/tier5-src/himi-branded-lite-feed/index.ts +3 -1
  93. package/templates/podcast-creator/tier5-src/himi-branded-lite-plans/index.ts +13 -1
  94. package/templates/podcast-creator/tier5-src/himi-branded-lite-wallet/index.ts +3 -1
  95. package/templates/podcast-creator/tier5-src/himi-events-detail/index.ts +8 -1
  96. package/templates/podcast-creator/tier5-src/himi-events-rsvp/index.ts +7 -4
  97. package/templates/podcast-creator-owner/tier5-src/_shared/collection-service.ts +5 -1
  98. package/templates/podcast-creator-owner/tier5-src/_shared/online-actions.ts +76 -0
  99. package/templates/portfolio-creative/tier5-src/_shared/collection-service.ts +5 -1
  100. package/templates/portfolio-creative/tier5-src/_shared/online-actions.ts +76 -0
  101. package/templates/portfolio-creative/tier5-src/himi-branded-lite-address/index.ts +3 -1
  102. package/templates/portfolio-creative/tier5-src/himi-branded-lite-addresses/index.ts +3 -1
  103. package/templates/portfolio-creative/tier5-src/himi-branded-lite-cart/index.ts +3 -0
  104. package/templates/portfolio-creative/tier5-src/himi-branded-lite-order/index.ts +3 -1
  105. package/templates/portfolio-creative/tier5-src/himi-branded-lite-wallet/index.ts +3 -1
  106. package/templates/portfolio-creative/tier5-src/himi-events-detail/index.ts +8 -1
  107. package/templates/portfolio-creative/tier5-src/himi-events-rsvp/index.ts +7 -4
  108. package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +10 -4
  109. package/templates/portfolio-creative-owner/tier5-src/_shared/collection-service.ts +5 -1
  110. package/templates/portfolio-creative-owner/tier5-src/_shared/online-actions.ts +76 -0
  111. package/templates/restaurant/tier5-src/_shared/collection-service.ts +5 -1
  112. package/templates/restaurant/tier5-src/_shared/online-actions.ts +76 -0
  113. package/templates/restaurant/tier5-src/himi-branded-lite-address/index.ts +3 -1
  114. package/templates/restaurant/tier5-src/himi-branded-lite-addresses/index.ts +3 -1
  115. package/templates/restaurant/tier5-src/himi-branded-lite-reserve/index.ts +3 -1
  116. package/templates/restaurant/tier5-src/himi-branded-lite-wallet/index.ts +3 -1
  117. package/templates/restaurant/tier5-src/himi-events-detail/index.ts +8 -1
  118. package/templates/restaurant/tier5-src/himi-events-rsvp/index.ts +7 -4
  119. package/templates/restaurant-owner/tier5-src/_shared/collection-service.ts +5 -1
  120. package/templates/restaurant-owner/tier5-src/_shared/online-actions.ts +76 -0
  121. package/templates/retail-store/tier5-src/_shared/collection-service.ts +5 -1
  122. package/templates/retail-store/tier5-src/_shared/online-actions.ts +76 -0
  123. package/templates/retail-store/tier5-src/himi-branded-lite-address/index.ts +3 -1
  124. package/templates/retail-store/tier5-src/himi-branded-lite-addresses/index.ts +3 -1
  125. package/templates/retail-store/tier5-src/himi-branded-lite-cart/index.ts +3 -0
  126. package/templates/retail-store/tier5-src/himi-branded-lite-order/index.ts +3 -1
  127. package/templates/retail-store/tier5-src/himi-branded-lite-wallet/index.ts +3 -1
  128. package/templates/retail-store/tier5-src/himi-store-product/index.ts +10 -4
  129. package/templates/retail-store-owner/tier5-src/_shared/collection-service.ts +5 -1
  130. package/templates/retail-store-owner/tier5-src/_shared/online-actions.ts +76 -0
  131. package/templates/yoga-studio/dev/index.ts +2054 -786
  132. package/templates/yoga-studio/tier5-src/_shared/collection-service.ts +5 -1
  133. package/templates/yoga-studio/tier5-src/_shared/online-actions.ts +76 -0
  134. package/templates/yoga-studio/tier5-src/himi-booking-bookings/index.ts +1 -0
  135. package/templates/yoga-studio/tier5-src/himi-booking-time/index.ts +803 -284
  136. package/templates/yoga-studio/tier5-src/himi-branded-lite-plans/index.ts +13 -1
  137. package/templates/yoga-studio/tier5-src/himi-branded-lite-program/index.ts +3 -1
  138. package/templates/yoga-studio/tier5-src/himi-branded-lite-wallet/index.ts +3 -1
  139. package/templates/yoga-studio/tier5-src/himi-events-detail/index.ts +8 -1
  140. package/templates/yoga-studio/tier5-src/himi-events-rsvp/index.ts +7 -4
  141. package/templates/yoga-studio-owner/tier5-src/_shared/collection-service.ts +5 -1
  142. package/templates/yoga-studio-owner/tier5-src/_shared/online-actions.ts +76 -0
Binary file
@@ -399,3 +399,48 @@ generated files for entities no longer declared. They are never deleted.
399
399
  - Migrate failure envelopes in subcommands other than `push`, keeping this contract.
400
400
  - Review/reword human messages separately; no message rewrite is part of this change.
401
401
  - Review exit-code conventions separately; no exit code changes are part of this change.
402
+
403
+
404
+ ## IAP setup and mapping controls
405
+
406
+ `himi store iap check --json` (also local MCP `himi_iap_status`) returns one read-only
407
+ report. Its top-level `code` is `ok` or `setup_incomplete`; exit status is 0 or 1. The report
408
+ contains `checks` and per-product `items[].checks`. Each check has an `id`, `state`
409
+ (`ok`, `missing`, `blocked`), stable `code`, and human-readable `fix`.
410
+
411
+ The setup checker uses the stable code vocabulary below. Consumers branch on
412
+ codes, never the fix text. Codes include:
413
+
414
+ - Registration/key: `purchases_app_missing`, `purchases_app_mismatch`, `iap_key_missing`.
415
+ - Provider/access: `provider_check_unavailable`, `provider_not_connected`, `apple_access_blocked`,
416
+ `apple_app_mismatch`, `setup_read_failed`.
417
+ - Mappings: `mapping_missing`, `mapping_inactive`, `mapping_type_mismatch`, `mapping_conflict`,
418
+ `mapping_visibility_unverified`, `mapping_not_visible`.
419
+ - Apple readiness: `apple_product_missing`, `apple_product_not_ready`, `review_screenshot_missing`,
420
+ `apple_readiness_blocked`.
421
+ - Vertical: `sale_disabled`, `item_unsupported`, `vertical_check_unavailable`.
422
+ - Binding: `config_binding_missing`, `config_binding_conflict`, `build_binding_unverified`,
423
+ `build_binding_conflict`.
424
+ - Notifications: `notification_check_unavailable`, `notification_url_mismatch`.
425
+
426
+ `ok: false` with `setup_incomplete` can contain successful findings too; a failed read does not
427
+ suppress the remaining checks. Unavailable provider/notification reads are blocked evidence,
428
+ not evidence of an absent configuration.
429
+
430
+ `himi store iap mappings` lists without writes. Changes require both `--product` (Catalog mapping
431
+ id) and `--active true|false`, plus confirmation. Missing confirmation is
432
+ `confirmation_required`; malformed inputs are `invalid_usage`. Catalog errors preserve the
433
+ existing managed failure codes. `--profile` remains the explicit legacy Apple mode for the
434
+ provisioning commands; `--managed` is optional when no profile is supplied. `--no-submit` on
435
+ managed apply still uploads the review screenshot but skips submit-for-review.
436
+
437
+ A managed-only manifest used with explicit legacy `--profile` mode returns
438
+ `credentials_unavailable` before reading any profile or key, with guidance to add
439
+ `target.profile` and `target.teamId` or continue through Catalog. Apple products whose setup
440
+ is complete remain configured while their review submission progresses; an ok setup finding
441
+ is not App Store approval.
442
+
443
+ Apple provisioning commands (`draft`, `plan`, `apply`, `status`, `screenshots`) reject explicit
444
+ legacy `--profile` combined with Catalog registration/route selectors as `invalid_usage`,
445
+ before reading inputs or credentials. `connect` retains its intentional legacy profile plus
446
+ Catalog mapping route and registration check.
@@ -4,6 +4,47 @@
4
4
  Claude Code, Cursor, Codex, VS Code — calls them as tools instead of remembering commands. Every
5
5
  tool runs the same `himi` command you would type, on the app folder already on your disk.
6
6
 
7
+ ## Apple in-app purchases
8
+
9
+ The local server exposes typed tools using the same IAP command implementations through
10
+ Catalog, with the site's owner authentication and server-held Apple keys. No tool accepts a
11
+ local Apple profile, key path, or private key. Supply the assigned `catalogRoute`; the Apple
12
+ provisioning tools also require the registered `purchasesApp` id.
13
+
14
+ | Tool | Operation | Confirmation |
15
+ | --- | --- | --- |
16
+ | `himi_iap_status` | Combined setup check: coded `ok`, `missing`, or `blocked` findings and fixes. Optional `dir`, built `plist`, and `visitorClient` provide binding and app-visibility evidence. | Read-only |
17
+ | `himi_iap_draft` | Read Wix items and Apple pricing; write a draft manifest. | No server writes |
18
+ | `himi_iap_plan` | Read Apple state; write a sealed plan for review. | No server writes |
19
+ | `himi_iap_apply` | Create/update products, have Catalog generate review screenshots, and by default submit for review. `noSubmit: true` skips submission. | `confirm: true` after user approval |
20
+ | `himi_iap_connect` | Preview registration, provider connection, mappings and optional config binding. Apply the reviewed setup with `confirm: true`. | Dry run by default |
21
+ | `himi_iap_mappings` | List mappings; supply `product` and `active` to turn one on/off. | Updates require `confirm: true` |
22
+
23
+ Draft/plan write local artifacts, so their MCP `readOnlyHint` is false. Mapping tools also
24
+ use false because they can update a mapping. Every tool that can replace files or external
25
+ state advertises `destructiveHint: true`, including mixed tools whose default is a list or dry
26
+ run. The host must obtain its own user consent; a model-supplied `confirm` is not proof of it.
27
+
28
+ Catalog generates review screenshots on the server; MCP has no local screenshot capture tool.
29
+ Managed plan/apply never read or upload local images.
30
+
31
+ IAP paths, including references inside a manifest/plan, always stay inside the
32
+ trusted workspace root. `HIMI_WORKSPACE` takes precedence; otherwise the host's workspace root
33
+ (or the server's working directory) is the boundary. Absolute paths, parent traversal and
34
+ symlinks that leave that boundary are refused before invoking the command. The hosted connector does
35
+ not gain these local tools.
36
+
37
+ Status never treats an unverified provider or Apple notification destination as ready. The
38
+ current provider contract lacks a read-only readiness method, and notification-destination
39
+ verification is not yet wired into the checker, so it reports `provider_check_unavailable` and
40
+ `notification_check_unavailable`. Managed connect can reuse a purchase key stored on the server;
41
+ if it is missing, it reports the onboarding blocker instead of opening a local key. See
42
+ [IAP products](iap-products.md#one-setup-check-and-mapping-controls).
43
+
44
+ Owner Wix authentication is separate from the publishing token minted by
45
+ `himi_login`. IAP uses the owner's Wix CLI session (`wix login`); that prerequisite is not
46
+ satisfied by signing in for draft publishing alone.
47
+
7
48
  ## Set it up
8
49
 
9
50
  **Nothing to do for a new app.** `himi init` (and `himi agent-init` in an existing app) writes the
@@ -320,7 +320,7 @@ pretty report:
320
320
  "writes": [
321
321
  { "screen": "himi_blog_post", "action": "tier5.himiBlogPost.like", "via": "wix", "method": "POST", "path": "/blog/v3/posts/post-0001/like" },
322
322
  { "screen": "himi_time", "action": "tier5.himiBookingTime.register", "via": "native", "capability": "himi.wix.registerDirect", "kind": "member-signup", "what": "creates a site member" },
323
- { "screen": "himi_time", "action": "tier5.himiBookingTime.bookSelected", "via": "wix", "method": "POST", "path": "/ecom/v1/checkouts" }
323
+ { "screen": "himi_time", "action": "tier5.himiBookingTime.pickSlot", "via": "wix", "method": "POST", "path": "/ecom/v1/checkouts" }
324
324
  ],
325
325
  "unreachedWrites": [
326
326
  { "screen": "himi_time", "action": "unreached", "via": "native", "capability": "capability.wix_cashier.proceedToPayment", "kind": "payment" }
@@ -354,12 +354,12 @@ Put the owner-approved data-access matrix in `SPEC.md` (or `MOBILE-UX.md`) as a
354
354
  | Screen | Role | Reads | Wix writes | Prohibited |
355
355
  | --- | --- | --- | --- | --- |
356
356
  | himi_blog_post | visitor | posts, comments | none | like, comment |
357
- | himi_time | visitor | services, slots | `bookSelected`, `POST /bookings/v2/bookings` | signup, payment |
357
+ | himi_time | visitor | services, slots | `pickSlot`, `POST /bookings/v2/bookings` | signup, payment |
358
358
  | * | visitor | published content | none | |
359
359
  ```
360
360
 
361
361
  A `Wix writes` cell is `none` (or empty, `-`, `read-only`), or a comma list naming each approved
362
- write by its **action** (`bookSelected` or `tier5.himiBookingTime.bookSelected`), its **endpoint**
362
+ write by its **action** (`pickSlot` or `tier5.himiBookingTime.pickSlot`), its **endpoint**
363
363
  (`POST /bookings/v2/bookings` — exact, with `*` for one path segment such as an id:
364
364
  `POST /blog/v3/posts/*/like`), its **capability** (`registerDirect`) or its
365
365
  **kind** (`payment`, `signup`). Prose such as "create a booking" approves nothing: it cannot say
@@ -6,8 +6,8 @@ initial price and explicit territories. It then exports a Wix→Apple mapping fo
6
6
  backend import.
7
7
 
8
8
  It is an administration workflow, not a build: it never builds, signs or bumps a version,
9
- and it runs anywhere `himi` is installed. Choose an explicit local credential profile, or
10
- managed Catalog provisioning with the site's existing Branded Apple connection. It does not run during an app build or
9
+ and it runs anywhere `himi` is installed. Catalog provisioning with the site's existing
10
+ Branded Apple connection is the default. `--profile` explicitly selects legacy local-key mode. It does not run during an app build or
11
11
  a customer checkout.
12
12
 
13
13
  It registers one-time **non-consumables**, and **consumable price tiers** for large
@@ -17,10 +17,10 @@ catalogs. Subscriptions are refused before anything reaches Apple.
17
17
 
18
18
  - **The Apple app record already exists.** This command never creates apps or accounts,
19
19
  and never accepts agreements.
20
- - **You have an App Store Connect API key for the account that owns the app.** Managing
20
+ - **For explicit legacy mode, an App Store Connect API key for the account that owns the app.** Managing
21
21
  in-app purchases needs the **Admin** or **App Manager** role (or Account Holder). A
22
22
  user's role in the web UI does not grant it to a key.
23
- - **You have a credential profile for that key** at
23
+ - **For explicit legacy mode, a credential profile for that key** at
24
24
  `~/.himalaya/store-credentials/<name>.json`. It holds identifiers plus a path to the
25
25
  `.p8`, never the key itself:
26
26
 
@@ -35,16 +35,27 @@ These key and profile prerequisites apply to direct Apple mode. There is **no am
35
35
 
36
36
  ## Managed provisioning through Catalog
37
37
 
38
- `plan`, `apply`, and `status` accept `--managed --purchases-app <registration-id>`.
38
+ Provisioning commands use managed mode when `--profile` is absent; `--managed`
39
+ remains an optional explicit spelling. `draft`, `plan`, `apply`, and `status`
40
+ read Apple through Catalog with `--purchases-app <registration-id>`. Wix catalog reads,
41
+ registration, provider connection, and mapping writes keep their existing owner-scoped services.
39
42
  They use the manifest's Wix site and the site's existing Branded Apple connection. No local
40
43
  credential profile or `.p8` is opened. `--profile` and `--managed` cannot be combined, and a
41
- Catalog refusal never falls back to direct Apple mode. Existing manifests retain their
42
- `target.profile` and `target.teamId` fields for compatibility; those fields do not select
43
- managed credentials or identify a managed plan.
44
+ Catalog refusal never falls back to direct Apple mode. For `draft`, `plan`, `apply`, `status`
45
+ and `screenshots`, `--profile` also cannot be combined with explicit `--purchases-app` or
46
+ `--catalog-route` selectors: choose one mode. Legacy `connect` intentionally accepts a Catalog
47
+ route for its Wix mappings and an optional registration id to verify. Existing manifests retain their
48
+ `target.profile` and `target.teamId` fields for compatibility; new managed drafts omit them.
49
+ Those fields do not select managed credentials or identify a managed plan. Legacy mode still
50
+ requires both fields to match its explicit profile. A managed-only target returns
51
+ `credentials_unavailable` with instructions to use Catalog or add the matching legacy identity
52
+ before any profile or key is read.
44
53
 
45
54
  Supply the assigned Catalog gateway prefix, including its
46
55
  version segment, through `--catalog-route <assigned-prefix>` or `HIMI_IAP_CATALOG_ROUTE`.
47
- There is no default. During rollout some gateway nodes can return an empty 404. The CLI
56
+ Managed Catalog and purchases setup calls require the owner’s Wix user session. Standalone
57
+ Wix catalog reads and explicit legacy profile mode retain account API-key authentication.
58
+ There is no default route. During rollout some gateway nodes can return an empty 404. The CLI
48
59
  does not retry it automatically; the owner reruns. Reads are safe to rerun, and writes
49
60
  read state before creating resources.
50
61
 
@@ -61,12 +72,18 @@ send the requested amount, currency, territory and `EXACT`/`AT_LEAST` rule, neve
61
72
  price-point id. Catalog reports `APPLIED` or `ALREADY_APPLIED`. Existing product locks,
62
73
  read-before-write checks, plan review, confirmation and local apply locking still apply.
63
74
 
64
- Managed apply finishes each configured item by uploading its App Review screenshot and calling
65
- Catalog's Product `submit-for-review`. Without `reviewScreenshot`, Catalog generates an image
66
- from the first localization's display name; no `imageUrl` is sent. If the manifest names a PNG
67
- or JPEG, the CLI uploads the checked bytes to the site's Wix Media and sends its
68
- `https://static.wixstatic.com/media/…` URL. An already complete screenshot is **reused**,
69
- even when a different image is requested; the CLI never replaces it.
75
+ For the setup check, an Apple product whose metadata is complete remains configured while its
76
+ submission is waiting for review, in review, or waiting on an app version. This reports completed
77
+ setup, not Apple approval; Catalog readiness blockers still prevent an ok finding.
78
+
79
+ Managed apply finishes each configured item by asking Catalog to generate its App Review screenshot and, by
80
+ default, calling Catalog's Product `submit-for-review`. Pass `--no-submit` to provision and generate
81
+ the screenshot on the server without submitting for review. Catalog generates the image from the first
82
+ localization's display name. Managed plan and apply ignore local `reviewScreenshot` paths:
83
+ no image is read, rendered, or uploaded from the agent's machine. An already complete
84
+ screenshot is reused without replacement. Local capture is available only through the
85
+ explicit legacy `screenshots --profile` workflow. Older managed plans that sealed a local
86
+ image are refused before requests; generate and review a new plan for server generation.
70
87
 
71
88
  Before any managed apply writes for an item, Catalog must have one active mapping for its
72
89
  expected Wix item, SKU and type. Conflicts use the existing connect codes (`sku_in_use`,
@@ -88,6 +105,52 @@ mapping reports `catalog_mapping_missing`; create/reconcile mappings with `conne
88
105
  managed submission. Other per-item failures include `catalog_screenshot_upload_failed` and
89
106
  `catalog_submit_blocked` (see [JSON codes](himi-json-output.md)).
90
107
 
108
+ ## One setup check and mapping controls
109
+
110
+ `check` combines the registration, stored purchase key, Catalog mappings, Apple product and
111
+ screenshot readiness, vertical sales rules, app visibility, and source/build binding in one
112
+ read-only report. Unlike `connect --dry-run`, it never reports the payment provider as planned
113
+ and counts that as readiness. Every finding carries `state: "ok" | "missing" | "blocked"`, a
114
+ stable `code`, and a `fix`; overall `code` is `ok` or `setup_incomplete` (exit 0 or 1).
115
+
116
+ ```sh
117
+ himi store iap check --manifest ./iap-products.json --catalog-route <assigned-prefix> \
118
+ --content . --plist /path/to/Built.app/Info.plist --visitor-client <headless-client-id> --json
119
+ himi store iap mappings --site <msid> --purchases-app <registration-id> --catalog-route <assigned-prefix> --json
120
+ himi store iap mappings --site <msid> --purchases-app <registration-id> --catalog-route <assigned-prefix> \
121
+ --product <catalog-mapping-id> --active false --yes --json
122
+ ```
123
+
124
+ `check` discovers the registration for the manifest's bundle on its site. An optional
125
+ `--purchases-app` must agree. `--content` inspects the authored config without executing it;
126
+ `--plist` checks the built Apple binding using macOS `plutil`; `--visitor-client` checks Serve
127
+ mapping visibility with a fresh anonymous visitor, not the owner's token. Missing evidence
128
+ stays blocked. A visitor check does not prove a particular signed-in member's checkout.
129
+
130
+ The current wix-iap contract exposes provider connection but no read-only provider-readiness
131
+ method, so `provider_check_unavailable` asks for verification in payment settings. Apple exposes notification URL attributes on its App resource, but this checker does not yet
132
+ compare them with a verified purchases-service destination. `notification_check_unavailable`
133
+ therefore asks for App Store Connect verification. These blockers prevent an unproven all-ready verdict. The checker is
134
+ shared with local MCP; it does not add a Serve GET route for these unavailable reads.
135
+
136
+ Mapping lists make no writes. On/off updates require confirmation and send only `active`
137
+ with Catalog's current revision, preserving the SKU, item identity, and metadata.
138
+
139
+ Managed `connect` never opens an Apple key on the Mac. It reuses an In-App Purchase key
140
+ already stored by purchases. If there is none, it reports `apple_key_missing`; an App Store
141
+ Connect API key is a different credential and cannot replace it. The purchases contract
142
+ supports encrypted key writes but not reading a key back, and Branded does not currently
143
+ provide a dedicated In-App Purchase key bridge. Provisioning that missing server key remains
144
+ a backend prerequisite. Explicit legacy `--profile` plus `--iap-key` remains available for
145
+ owner-driven onboarding. Supplying local key flags in managed mode is refused.
146
+
147
+ For a managed draft, pass the Catalog registration and route:
148
+
149
+ ```sh
150
+ himi store iap draft --site <msid> --purchases-app <registration-id> --catalog-route <assigned-prefix> \
151
+ --apple-app <apple-id> --bundle <bundle-id> --base-territory USA --out ./iap-products.json
152
+ ```
153
+
91
154
  ## Drafting the manifest from your Wix catalog
92
155
 
93
156
  You don't have to write the manifest by hand. `draft` reads the site's whole catalog —
@@ -95,7 +158,7 @@ every page of Wix Stores (Catalog V3 or V1), Online Programs and Pricing Plans
95
158
  a manifest of everything that can be sold:
96
159
 
97
160
  ```bash
98
- himi store iap draft --site <msid> --profile fit-club-owner --apple-app 6450000001 \
161
+ himi store iap draft --site <msid> --purchases-app <registration-id> --catalog-route <assigned-prefix> --apple-app 6450000001 \
99
162
  --bundle com.example.fitclub --base-territory USA --territories USA,CAN --out ./iap-products.json
100
163
  ```
101
164
 
@@ -210,7 +273,9 @@ Rules, all checked locally before any request:
210
273
  used twice, including a Wix entity mapped both directly and through a tier.
211
274
  - **Unknown keys are refused, at every level.** So is any string that looks like a key or a token.
212
275
 
213
- ## The workflow
276
+ ## Legacy workflow with a local profile
277
+
278
+ These examples explicitly select local-key mode. The managed examples above need no local Apple key.
214
279
 
215
280
  ```bash
216
281
  himi store iap draft --site <msid> --profile fit-club-owner --apple-app 6450000001 --bundle com.example.fitclub --base-territory USA --out ./iap-products.json
@@ -294,9 +359,9 @@ hosts only ever get the file's bytes, never the API key's token.
294
359
  the result. A refused image (`FAILED`) fails the step with Apple's reason. An image still
295
360
  processing (`UPLOAD_COMPLETE`) counts as uploaded.
296
361
 
297
- ### Making the review screenshots: `screenshots`
362
+ ### Legacy local review screenshots: `screenshots --profile`
298
363
 
299
- `himi store iap screenshots --manifest <file> --content <app dir> [--profile <name>]` makes each
364
+ `himi store iap screenshots --manifest <file> --content <app dir> --profile <name>` makes each
300
365
  product's review screenshot from the app's own purchase screen, so nobody has to take them on a phone:
301
366
 
302
367
  **One-time setup.** The screenshots are taken in a headless Chromium on your machine, so no phone,
@@ -327,12 +392,11 @@ before rendering anything and says so (`browser_unavailable`). A `--dry-run` doe
327
392
  (the largest-iPhone App Store size). It then sets each item's `reviewScreenshot` to that file,
328
393
  leaving the rest of the manifest as it was.
329
394
 
330
- **Apple's price** comes from App Store Connect when you pass `--profile`, a read-only call. Otherwise it is
331
- the manifest's `exact` amount. An `atLeast` item that Apple has no price for yet is skipped: run `apply`
395
+ **Apple's price** is read directly from App Store Connect with the explicit legacy `--profile`. If Apple has no observed price, the manifest's `exact` amount can be used. An `atLeast` item that Apple has no price for yet is skipped: run `apply`
332
396
  first. A price tier has no single purchase screen and is skipped too.
333
397
 
334
398
  **Other options:**
335
- - With `--profile`, a product that is live or in review keeps its screenshot: changing it there is a
399
+ - A product that is live or in review keeps its screenshot: changing it there is a
336
400
  conflict anyway.
337
401
  - An item that already names a screenshot is kept unless you pass `--force`.
338
402
  - `--only <productId,…>` limits the run; an id the manifest doesn't have is reported.
@@ -418,7 +482,8 @@ In order:
418
482
  app platform-wide: if another app holds it (another site's, or another account's), that is a
419
483
  `bundle_registered_elsewhere` conflict. Only that registration's owner can remove it; `connect`
420
484
  never does.
421
- 2. **The In-App Purchase key.** It stores `--iap-key` / `--iap-key-id` once, server-side. This is
485
+ 2. **The In-App Purchase key.** Managed mode reuses the server key, or reports `apple_key_missing`.
486
+ Legacy `--profile` mode stores `--iap-key` / `--iap-key-id` once, server-side. This is
422
487
  an App Store Connect **In-App Purchase** key (Users and Access → Integrations → In-App
423
488
  Purchase), not the App Store Connect API key `--profile` names; the service rejects that kind.
424
489
  The issuer comes from the profile. Skipped when a key is already stored.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1526.0",
3
+ "version": "0.1528.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": [
@@ -71,5 +71,5 @@
71
71
  "artifactId": "himalaya-cli"
72
72
  }
73
73
  },
74
- "falconPackageHash": "78420cfba501244cd7abb4a48357db143350fcae0d24d8cf3027b161"
74
+ "falconPackageHash": "977ce0e45046b28615366bb368c7ceb90d7a1f9404024a58bee20404"
75
75
  }