@wix/himalaya-cli 0.1372.0 → 0.1374.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.
Binary file
@@ -78,6 +78,28 @@ The `ux_evidence_*` codes map to the existing typed `uxEvidence.state`; a succes
78
78
  `recorded` state has no refusal code. Successful pushes and warnings do not gain
79
79
  failure codes. A forced push still follows the existing override rules.
80
80
 
81
+ ## `himi store iap status` codes
82
+
83
+ Status adds these stable codes to incomplete JSON results. Existing result fields and exit
84
+ statuses are preserved: incomplete status is exit 1; a failed live Wix catalog read is exit 2.
85
+
86
+ | Code | Meaning |
87
+ |---|---|
88
+ | `price_drift` | Apple differs from the price source's resolved target. |
89
+ | `price_check_unavailable` | An item's price cannot be compared, such as a missing Wix item or changed currency. |
90
+ | `status_incomplete` | Other requested provisioning is incomplete. |
91
+ | `wix_catalog_unavailable` | `--refresh-wix` could not read the site catalog or obtain owner authentication; no manifest fallback occurred. |
92
+
93
+ Item-level unavailable checks take precedence over drift in the top-level code. Detailed
94
+ `priceSource`, `priceDrift` and `priceCheckIssue` fields live in each item's `provisioning` report.
95
+ Manifest parsing failures retain their legacy envelopes; this is not a whole-command migration.
96
+
97
+ IAP provisioning refusals from `plan`, `apply` and `status` also expose their existing typed
98
+ `reason` as a top-level `code`: `target` (wrong app, bundle, team or territory), `access`
99
+ (Apple authentication/authorization), `plan` (invalid reviewed plan), `account` (changed
100
+ credential profile or key), and `drift` (Apple changed since planning). Existing `reason` and
101
+ exit statuses remain intact. Manifest parsing failures still use their legacy envelope.
102
+
81
103
  ## `himi store iap connect` codes
82
104
 
83
105
  `connect` prints one envelope with the whole report. When the setup is not complete it is
@@ -164,7 +164,7 @@ himi store iap connect --manifest ./iap-products.json --profile fit-club-owner \
164
164
  | Decision | Meaning |
165
165
  |---|---|
166
166
  | `create` | absent in Apple; apply will create it and configure it |
167
- | `update` | an editable draft exists; apply will add only what is missing |
167
+ | `update` | fills missing draft configuration, or changes an eligible `atLeast` price with a reviewed `changePrice` operation |
168
168
  | `reuse` | already configured exactly as requested; nothing to do |
169
169
  | `conflict` | differs in a way this command will not change; nothing is written |
170
170
 
@@ -172,9 +172,14 @@ A **conflict** is any of:
172
172
 
173
173
  - the same product id with another type;
174
174
  - the reference name already used by another product id;
175
- - a live or in-review product whose metadata, price or availability differs;
176
- - an existing price or availability that differs;
177
- - no exact price point for an existing product.
175
+ - a live product whose metadata or availability differs, or an in-review product needing changes;
176
+ - an existing `exact` price or availability that differs;
177
+ - a price change with a different base territory, ambiguous price, custom territory prices, or a future/temporary schedule;
178
+ - no Apple point satisfying the requested price rule, or an unknown product/review state needing changes.
179
+
180
+ `changePrice` carries `from` and `to` amounts and prints both for review. It changes only
181
+ the price: approved-product metadata and availability remain locked. The command conservatively
182
+ holds in-review changes even though Apple documents price changes as available at any time.
178
183
 
179
184
  Resolve conflicts in App Store Connect or in the manifest, then plan again.
180
185
 
@@ -196,7 +201,9 @@ created. The plan marks this in the item's `notes`.
196
201
  write. Planned work that already happened is accepted as done.
197
202
  4. For each product, it creates the product, then a draft version, then its
198
203
  localizations. Then it sets the exact initial price and the explicit territories. Then
199
- it reads everything back.
204
+ it reads everything back. A `changePrice` instead writes an immediate base-territory price
205
+ through the same price-schedule API; Apple equalizes the other territories. A changed source
206
+ price, schedule, review state or resolved target stops apply before the first write.
200
207
  5. Writes the result file, even when the run is partial.
201
208
 
202
209
  **Large catalogs.** App Store Connect allows about 3,600 API requests an hour per key.
@@ -224,6 +231,34 @@ schedule, even without the local journal. Nothing is ever deleted or rolled back
224
231
  **`status` is read-only.** It reports what Apple has for each product. Add `--out <file>`
225
232
  to save it in the same shape as the result file.
226
233
 
234
+ ### When the Wix price changes
235
+
236
+ Price synchronization is explicit; there is no background writer. Refresh a per-item manifest,
237
+ review the new price, then apply:
238
+
239
+ ```bash
240
+ himi store iap draft --site <msid> --profile fit-club-owner --apple-app 6450000001 \
241
+ --bundle com.example.fitclub --base-territory USA --merge ./iap-products.json --out ./iap-products.json
242
+ himi store iap plan --manifest ./iap-products.json --profile fit-club-owner --out ./iap-plan.json
243
+ himi store iap apply --plan ./iap-plan.json --profile fit-club-owner --out ./iap-result.json
244
+ himi store iap status --manifest ./iap-products.json --profile fit-club-owner --refresh-wix --json
245
+ ```
246
+
247
+ `--merge` refreshes existing per-item `atLeast` amounts while preserving product ids, metadata,
248
+ territories and mappings. Explicit `exact` overrides and shared consumable tiers keep their prices.
249
+ Missing, hidden, free, unsupported or currency-changed Wix items retain their old entry and are
250
+ reported as retained. Review those reports before applying: retaining an entry does not disable it.
251
+
252
+ Status labels `provisioning.priceSource` as `manifest` by default. `--refresh-wix` requires Wix owner
253
+ authentication and reads the current site catalog without changing the manifest. It reports
254
+ `provisioning.priceDrift: { wix, apple, wouldBe, currency, baseTerritory, source }` when Apple's price
255
+ differs from the resolved target. Normal rounding is not drift. Missing or incomparable data is
256
+ reported as `priceCheckIssue`; a failed catalog read never falls back to the manifest. A live check
257
+ does not reprice shared tiers. Drift or unavailable checks make the overall status incomplete.
258
+
259
+ Only `atLeast` mismatches can plan a price edit. An `exact` mismatch remains a conflict even when
260
+ a live status check identifies it. Wix order and charge amounts are not changed by this workflow.
261
+
227
262
  ## Connecting the Wix site: `connect`
228
263
 
229
264
  `connect` makes the manifest's Wix site ready to sell those products, from the same manifest,
@@ -1970,11 +1970,23 @@
1970
1970
  "jsdoc": "/** StartItemPayment's CatalogReference: the purchases catalog sells a Stores product under its product\n * id (eCom's `catalogItemId`). One-time unlocks only, whatever the backend also accepts. */",
1971
1971
  "decl": "export const STORES_PRODUCT_SALE_RULE: AppleSaleRule = { appProductId: (id) => id, productType: \"NON_CONSUMABLE\" };"
1972
1972
  },
1973
+ {
1974
+ "name": "PRICING_PLAN_APPLE_SALES_ENABLED",
1975
+ "kind": "const",
1976
+ "jsdoc": "/** Off until a member's plan order, its cashier item id and Sandbox fulfillment are proven live.\n * Recurring and time-limited plans stay outside this rule; their Billing lifecycle is unfinished. */",
1977
+ "decl": "export const PRICING_PLAN_APPLE_SALES_ENABLED = false;"
1978
+ },
1979
+ {
1980
+ "name": "appleSaleRules",
1981
+ "kind": "function",
1982
+ "jsdoc": "/**\n * The one definition `himi store iap connect` writes mappings by and the mapping source reads them by,\n * keyed by catalog kind. wix-iap StartPayment maps the cashier order's single item id, and Online\n * Programs builds that order with the program id as the item id; programs are one-time unlocks.\n * Wix Stores and one-time unlimited Pricing Plans join only with their independent switches.\n */",
1983
+ "decl": "export function appleSaleRules(options: { storesItemPaymentEnabled?: boolean; pricingPlanAppleSalesEnabled?: boolean } = {}): Readonly<Record<string, AppleSaleRule>>;"
1984
+ },
1973
1985
  {
1974
1986
  "name": "APPLE_SALE_RULES",
1975
1987
  "kind": "const",
1976
- "jsdoc": "/**\n * The one definition `himi store iap connect` writes mappings by and the mapping source reads them by,\n * keyed by catalog kind. wix-iap StartPayment maps the cashier order's single item id, and Online\n * Programs builds that order with the program id as the item id; programs are one-time unlocks.\n * Wix Stores joins only with `STORES_ITEM_PAYMENT_ENABLED`. Other verticals' order item ids are not\n * established yet, so their items keep their own commerce.\n */",
1977
- "decl": "export const APPLE_SALE_RULES: Readonly<Record<string, AppleSaleRule>> = STORES_ITEM_PAYMENT_ENABLED\n ? { onlineProgram: ONLINE_PROGRAM_SALE_RULE, storesProduct: STORES_PRODUCT_SALE_RULE }\n : { onlineProgram: ONLINE_PROGRAM_SALE_RULE };"
1988
+ "jsdoc": "",
1989
+ "decl": "export const APPLE_SALE_RULES = appleSaleRules();"
1978
1990
  },
1979
1991
  {
1980
1992
  "name": "HostCallExpectation",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1372.0",
3
+ "version": "0.1374.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": "602b054ac9fad163cdfcb58bd11d8f387a7af86d300154914f8c0ef6"
74
+ "falconPackageHash": "4011e5aaa6c46a99bb61a37553ae88008ada74ac054d70c43c09d2fe"
75
75
  }