@wix/himalaya-cli 0.1536.0 → 0.1538.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/stdlib/wix-sdk/bookings-v2/src/extensions.d.ts +16 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/data-collections-v1/src/extensions.d.ts +4 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/wix-data/src/index.d.ts +497 -4
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-bookings.mjs +5 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-data-collections.mjs +1 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-data.mjs +315 -7
- package/dist/cli.mjs +852 -538
- package/dist/preview-assets.generated.bin +0 -0
- package/fixtures/wix-canned.json +1 -0
- package/guides/cms-collections.md +31 -0
- package/guides/himi-json-output.md +13 -2
- package/guides/iap-products.md +13 -5
- package/guides/release-notes.md +12 -0
- package/guides/wix-api-usage.md +53 -6
- package/package.json +2 -2
- package/templates/beauty-salon/dev/index.ts +1109 -2310
- package/templates/beauty-salon/tier5-src/_shared/himi-bookings.ts +121 -1
- package/templates/beauty-salon/tier5-src/himi-booking-service/index.ts +9 -55
- package/templates/beauty-salon/tier5-src/himi-booking-services/index.ts +264 -18
- package/templates/branded-lite/dev/index.ts +1075 -2276
- package/templates/branded-lite/tier5-src/_shared/himi-bookings.ts +121 -1
- package/templates/branded-lite/tier5-src/himi-booking-service/index.ts +9 -55
- package/templates/branded-lite/tier5-src/himi-booking-services/index.ts +264 -18
- package/templates/gym-fitness/dev/index.ts +1075 -2276
- package/templates/gym-fitness/tier5-src/_shared/himi-bookings.ts +121 -1
- package/templates/gym-fitness/tier5-src/himi-booking-service/index.ts +9 -55
- package/templates/gym-fitness/tier5-src/himi-booking-services/index.ts +264 -18
- package/templates/yoga-studio/dev/index.ts +1137 -2338
- package/templates/yoga-studio/tier5-src/_shared/himi-bookings.ts +121 -1
- package/templates/yoga-studio/tier5-src/himi-booking-service/index.ts +9 -55
- package/templates/yoga-studio/tier5-src/himi-booking-services/index.ts +264 -18
|
Binary file
|
package/fixtures/wix-canned.json
CHANGED
|
@@ -266,6 +266,12 @@ operation alone:
|
|
|
266
266
|
{ readRole: "ANYONE", writeRole: "ADMIN", insertRole: "ANYONE" }
|
|
267
267
|
```
|
|
268
268
|
|
|
269
|
+
Wix stores the `ADMIN` role as `CMS_EDITOR`: reading a collection's permissions back (the
|
|
270
|
+
`/wix-data/v1/permissions` endpoint, `getPermissions`) shows `CMS_EDITOR`, and writing them with
|
|
271
|
+
`updatePermissions` accepts `CMS_EDITOR`, not `ADMIN`. Sending `ADMIN` there fails with a misleading
|
|
272
|
+
`dataPermissions is invalid: itemUpdate value is required`. Creating a collection, which is what
|
|
273
|
+
`himi cms create` does, still takes `ADMIN`.
|
|
274
|
+
|
|
269
275
|
`ANYONE` is accepted on `insertRole`/`updateRole` and refused on `removeRole` and on the
|
|
270
276
|
`writeRole` blanket. The asymmetry is the point: an unwanted row can be removed, a removed
|
|
271
277
|
row cannot be brought back. Reach for this when the app writes as the identity it actually
|
|
@@ -386,6 +392,16 @@ seed` must not bury that under sample data again.
|
|
|
386
392
|
|
|
387
393
|
`--only <id>` scopes to one collection; `--dry-run` reports without writing.
|
|
388
394
|
|
|
395
|
+
Rows go to the site in batches of 100, one request each, in the order they appear in the
|
|
396
|
+
seed array. Wix answers a batch with HTTP 200 whatever happened to the rows, so the report
|
|
397
|
+
is built from each row's own result: `inserted` counts only the rows Wix confirmed, and a
|
|
398
|
+
row it refused appears under `failed` with its position in the seed array, its error code
|
|
399
|
+
and its reason, and the run exits 1 with `code: "seed_rows_failed"`. A request that fails
|
|
400
|
+
outright is not retried — an insert has no idempotency key, so a retry could duplicate rows
|
|
401
|
+
that already landed. It stops that collection and exits 1 with what landed under `partial`;
|
|
402
|
+
rows marked `unconfirmed` may or may not exist, so run `himi cms query` before seeding
|
|
403
|
+
again.
|
|
404
|
+
|
|
389
405
|
### `himi cms seed --ai` — generate rows to review
|
|
390
406
|
|
|
391
407
|
Writes a full row set with the correct JSON type per field into a sidecar
|
|
@@ -439,6 +455,21 @@ const rows = (res.dataItems ?? []).map((item) => ({
|
|
|
439
455
|
Do not bind `_createdDate` directly to `Text`: an object crosses the worker
|
|
440
456
|
boundary as structured data and otherwise paints as `[object Object]`.
|
|
441
457
|
|
|
458
|
+
`@himalaya/wix-data` covers more than a query: patch, save, count, bulk writes,
|
|
459
|
+
aggregation, distinct values, search and references (the full list is in
|
|
460
|
+
`himi docs wix-api-usage`). Three rules matter when your collection is one you
|
|
461
|
+
own:
|
|
462
|
+
|
|
463
|
+
- **Change fields with `patchDataItem`, not `updateDataItem`.** An update replaces the
|
|
464
|
+
whole item, so a call that sends two fields deletes the rest — including the field
|
|
465
|
+
you look the row up by.
|
|
466
|
+
- **Write a long list with a bulk call, and check the result.** One bulk call is one
|
|
467
|
+
write against the site's per-minute quota, but it answers `200` even when some
|
|
468
|
+
items failed; `bulkFailures(res)` lists them.
|
|
469
|
+
- **Do not write a multi-reference field through insert, save or update.** Wix
|
|
470
|
+
accepts the call and stores nothing. This is also why `himi cms` does not declare
|
|
471
|
+
reference fields yet.
|
|
472
|
+
|
|
442
473
|
**Bake the collection ids in as a screen `input` and read them back**, so the worker holds
|
|
443
474
|
no hardcoded ids and `config.ts` stays the single source of truth:
|
|
444
475
|
|
|
@@ -80,6 +80,15 @@ The `ux_evidence_*` codes map to the existing typed `uxEvidence.state`; a succes
|
|
|
80
80
|
`recorded` state has no refusal code. Successful pushes and warnings do not gain
|
|
81
81
|
failure codes. A forced push still follows the existing override rules.
|
|
82
82
|
|
|
83
|
+
## `himi cms seed` codes
|
|
84
|
+
|
|
85
|
+
| Code | Meaning |
|
|
86
|
+
|---|---|
|
|
87
|
+
| `seed_rows_failed` | At least one seed row did not land. Wix answers a bulk insert with HTTP 200 whatever happened to the rows, so the report lists each failure under `failed`: `collection`, `rows` (zero-based positions in the seed array), `outcome` (`rejected`: Wix refused them; `unconfirmed`: they may or may not exist; `not-sent`: never attempted), Wix's `code` when it gave one, and a `reason`. `inserted` counts only confirmed rows. Exit 1. |
|
|
88
|
+
| `seed_request_failed` | A bulk-insert request failed outright (a refused request, a server error, a timeout or a dropped connection), so the run stopped. Printed on stderr with `ok: false` beside the legacy `error`, `app`, `site` and `hint` fields; `partial` carries the report so far, with the same `failed` list (that batch as `rejected` or `unconfirmed`, the collection's later rows as `not-sent`) and `code: "seed_request_failed"` too, even when an earlier batch had rows refused. Collections after the failing one were not attempted. Exit 1. |
|
|
89
|
+
|
|
90
|
+
This is not a whole-command migration: the command's other refusals still have no code.
|
|
91
|
+
|
|
83
92
|
## `himi store iap status` codes
|
|
84
93
|
|
|
85
94
|
Status adds these stable codes to incomplete JSON results. Existing result fields and exit
|
|
@@ -116,7 +125,9 @@ An invalid manifest fails with `manifest_invalid`, like the other `store iap` co
|
|
|
116
125
|
## `himi store iap connect` codes
|
|
117
126
|
|
|
118
127
|
`connect` prints one envelope with the whole report. When the setup is not complete it is
|
|
119
|
-
`ok: false` with the first step's code; each step also carries its own `code`.
|
|
128
|
+
`ok: false` with the first step's code; each step also carries its own `code`. A dry run adds
|
|
129
|
+
`diff: { inPlace, toCreate, conflicts, unverified, blocked, skipped }` (every step in exactly one list), and reports a step whose state cannot be read
|
|
130
|
+
without writing (the appleIAP provider, once the app is registered) as `state: "unverified"`.
|
|
120
131
|
|
|
121
132
|
| Code | Meaning |
|
|
122
133
|
|---|---|
|
|
@@ -136,7 +147,7 @@ An invalid manifest fails with `manifest_invalid`, like the other `store iap` co
|
|
|
136
147
|
| `mapping_unsupported` | The purchase flow cannot map this item yet (a vertical other than Online Programs, Wix Stores or one-time Pricing Plans, a price tier, or an item declared as a consumable). |
|
|
137
148
|
| `no_purchases_app` | A step did not run because the site has no purchases app for the bundle. |
|
|
138
149
|
| `request_failed` | A Purchases or Catalog call failed for another reason; the original message is preserved. |
|
|
139
|
-
| `setup_incomplete` | Steps are only planned (a dry run) or otherwise not yet in place. |
|
|
150
|
+
| `setup_incomplete` | Steps are only planned or unverified (a dry run) or otherwise not yet in place. |
|
|
140
151
|
| `confirmation_required` | Writes were planned, but there was no terminal to ask and no `--yes`. Nothing was written. |
|
|
141
152
|
| `config_conflict` | The backend setup is complete, but the app's config names a different purchases app, site or bundle. |
|
|
142
153
|
| `config_not_applied` | `--content` was given, but the binding is not in its `config.ts` (no config file, a dynamic or symlinked config, an edit `himi validate` rolled back, or no validator); the `config` report or `note` says what to add by hand. |
|
package/guides/iap-products.md
CHANGED
|
@@ -109,8 +109,8 @@ managed submission. Other per-item failures include `catalog_screenshot_upload_f
|
|
|
109
109
|
|
|
110
110
|
`check` combines the registration, stored purchase key, Catalog mappings, Apple product and
|
|
111
111
|
screenshot readiness, vertical sales rules, app visibility, and source/build binding in one
|
|
112
|
-
read-only report.
|
|
113
|
-
|
|
112
|
+
read-only report. Like `connect --dry-run`, which reports the payment provider `unverified`, it
|
|
113
|
+
never counts the unread provider as ready. Every finding carries `state: "ok" | "missing" | "blocked"`, a
|
|
114
114
|
stable `code`, and a `fix`; overall `code` is `ok` or `setup_incomplete` (exit 0 or 1).
|
|
115
115
|
|
|
116
116
|
```sh
|
|
@@ -490,12 +490,14 @@ In order:
|
|
|
490
490
|
3. **The appleIAP payment provider** on the site, through Serve's IAP route to wix-iap
|
|
491
491
|
(`ConnectProviderAccount`). Reported as `provider_route_unavailable` only when the Serve target
|
|
492
492
|
has no IAP routes; a refusal from the service behind it is `request_failed`. There is no read
|
|
493
|
-
of the provider's state, so a rerun connects it again (the call is safe to repeat)
|
|
493
|
+
of the provider's state, so a rerun connects it again (the call is safe to repeat), and a dry
|
|
494
|
+
run for an app that is already registered reports this step `unverified` instead of planned.
|
|
494
495
|
4. **One mapping per Wix item → Apple product, through Catalog `listProducts` / `createProduct`.** Online Programs map by program id, Wix Stores
|
|
495
496
|
digital products by product id, and one-time unlimited Pricing Plans by plan id (the ids the
|
|
496
497
|
purchase flow looks up), all only as non-consumables. A plan is mapped only when the site reads it
|
|
497
498
|
as one-time unlimited (one payment, valid until cancelled); a recurring, time-limited or archived
|
|
498
|
-
plan
|
|
499
|
+
plan is skipped. When the site's plans cannot be read, each plan is `failed` (`request_failed`,
|
|
500
|
+
`unverified` in the dry-run diff) and not mapped. Other verticals, price tiers and consumable items
|
|
499
501
|
are skipped with `mapping_unsupported`. An item already mapped to another
|
|
500
502
|
product (`mapping_conflict`), a mapping of another product type (`mapping_type_mismatch`), an
|
|
501
503
|
inactive mapping (`mapping_inactive`), or an Apple product mapped to another item
|
|
@@ -509,7 +511,13 @@ In order:
|
|
|
509
511
|
otherwise `bundleId` itself or, for a dev bundle, the same without `.dev`. Whenever `--content` was given and the binding
|
|
510
512
|
did not land, the run is `ok: false` (`config_not_applied`) with what to add by hand.
|
|
511
513
|
|
|
512
|
-
**Review first.** `--dry-run` reads everything and writes nothing
|
|
514
|
+
**Review first.** `--dry-run` reads everything it can and writes nothing: the site's purchases
|
|
515
|
+
apps and the app's Catalog mappings (plus the site's plans when the manifest maps plans), never
|
|
516
|
+
the provider connection, the key write or a mapping write. It ends with a `diff` (in JSON,
|
|
517
|
+
`diff: { inPlace, toCreate, conflicts, unverified, blocked, skipped }`, each a list of `app`,
|
|
518
|
+
`key`, `provider` or `mapping <id>`, every step in exactly one): what is already in place, what
|
|
519
|
+
applying would create, what it would leave as a conflict, what could not be read (including a
|
|
520
|
+
read that failed), what is blocked, and what connect does not handle. Without `--dry-run` it prints
|
|
513
521
|
the plan and asks; a shell with no terminal (or `--json`) needs `--yes`. A rerun reuses every
|
|
514
522
|
record and writes nothing new. Adding products later means adding them to the manifest and
|
|
515
523
|
rerunning: only their mappings are added, and the purchases-app id (the one thing a build bakes)
|
package/guides/release-notes.md
CHANGED
|
@@ -14,6 +14,18 @@ areas, always in the same order, so you can skim for the one you care about.
|
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
+
## 2026-11-02
|
|
18
|
+
|
|
19
|
+
### Validate & test
|
|
20
|
+
|
|
21
|
+
- **`himi validate` now judges `textPrimary` on card surfaces.** Body text was judged only against
|
|
22
|
+
the page (`surfacePrimary`), so a navy page with white cards and white text validated clean while
|
|
23
|
+
every card title rendered white on white. `textPrimary` is now also judged against
|
|
24
|
+
`surfaceSecondary` and `surfaceElevated`: below 1.5:1 the text is invisible and validate fails
|
|
25
|
+
with an error (also for `textPrimary` on the page); below WCAG AA 4.5:1 it is a warning. The
|
|
26
|
+
finding says when the page and the card sit on opposite sides of mid-grey, so no single text
|
|
27
|
+
colour can serve both. (#4999)
|
|
28
|
+
|
|
17
29
|
## 2026-11-01
|
|
18
30
|
|
|
19
31
|
### Getting started & the CLI
|
package/guides/wix-api-usage.md
CHANGED
|
@@ -197,8 +197,9 @@ surface. Lead with it: it builds the request, calls the bridge, and decodes the
|
|
|
197
197
|
```ts
|
|
198
198
|
import { queryDataItems, insertDataItem, updateDataItem, removeDataItem } from "@himalaya/wix-data";
|
|
199
199
|
|
|
200
|
-
// queryDataItems(collectionId, limit = 50, filter?, returnTotalCount = false, offset = 0, sort?)
|
|
200
|
+
// queryDataItems(collectionId, limit = 50, filter?, returnTotalCount = false, offset = 0, sort?, options?)
|
|
201
201
|
// → { dataItems?, items?, pagingMetadata? }
|
|
202
|
+
// `options` (all optional): { consistentRead, cursorPaging, fields, includeReferences, language, includeDraftItems }
|
|
202
203
|
const res = await queryDataItems("MyCollection", 50);
|
|
203
204
|
const rows = (res.dataItems ?? res.items ?? []).map((it) => it.data); // parsed objects, not bytes
|
|
204
205
|
|
|
@@ -206,12 +207,58 @@ const rows = (res.dataItems ?? res.items ?? []).map((it) => it.data); // parse
|
|
|
206
207
|
const newest = await queryDataItems("Jobs", 1, undefined, false, 0, [{ fieldName: "postedDate", order: "DESC" }]);
|
|
207
208
|
```
|
|
208
209
|
|
|
209
|
-
The
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
(`@himalaya/wix-data-collections`), which describes a collection's *shape*, not its rows; don't conflate them.
|
|
210
|
+
The client covers the whole everyday items surface. This is **Wix CMS / Data (data *items*)** — distinct from the
|
|
211
|
+
Catalog **`data-collections-v1` schema** API (`@himalaya/wix-data-collections`), which describes a collection's
|
|
212
|
+
*shape*, not its rows; don't conflate them.
|
|
213
213
|
|
|
214
|
-
|
|
214
|
+
| You want to… | Call | Mind |
|
|
215
|
+
|---|---|---|
|
|
216
|
+
| Read one row | `getDataItem(collectionId, id)` | not a page plus `.find()` |
|
|
217
|
+
| Create a row | `insertDataItem(collectionId, data, { id? })` | create-only: a repeated `id` is a 409, not an overwrite |
|
|
218
|
+
| Insert or replace by id | `saveDataItem(collectionId, data, { id? })` | safe to retry only with an explicit `id` (without one Wix mints a new id, so a retry adds a second row); replaces the whole item |
|
|
219
|
+
| Change some fields | `patchDataItem(collectionId, id, [setField("title", "New"), incrementField("views")])` | prefer this to `updateDataItem`; increments are atomic |
|
|
220
|
+
| Replace a whole item | `updateDataItem(collectionId, id, data)` | **deletes every field you leave out** |
|
|
221
|
+
| Delete a row | `removeDataItem(collectionId, id)` | irreversible |
|
|
222
|
+
| Count rows | `countDataItems(collectionId, filter?)` | one read, no rows transferred |
|
|
223
|
+
| Write many rows | `bulkInsertDataItems`, `bulkSaveDataItems`, `bulkUpdateDataItems`, `bulkPatchDataItems`, `bulkRemoveDataItems` | up to 1000 per call (100 for patch); one write against the site quota |
|
|
224
|
+
| Group, sum, average | `aggregateDataItemsPipeline(collectionId, { stages })` | not for Wix app collections |
|
|
225
|
+
| List the values in use | `queryDistinctValues(collectionId, fieldName, { filter? })` | for filter chips and pickers |
|
|
226
|
+
| Search text | `searchDataItems(collectionId, "terms", { fuzzy? })` | always eventually consistent; offset `paging` only (Wix refuses cursor paging on search); a collection whose search is not enabled answers `428 WDE0190` |
|
|
227
|
+
| Follow relations | `queryReferencedDataItems`, `isReferencedDataItem`; write with `insertDataItemReferences`, `removeDataItemReferences`, `replaceDataItemReferences` | read back with `includeReferences` |
|
|
228
|
+
|
|
229
|
+
These catch people out:
|
|
230
|
+
|
|
231
|
+
- **A bulk call answers `200` even when items failed.** Check `bulkFailures(res)` (or
|
|
232
|
+
`res.bulkActionMetadata.totalFailures`) and match each failure to your input with
|
|
233
|
+
`itemMetadata.originalIndex`. A failed entry looks like
|
|
234
|
+
`{ itemMetadata: { id, originalIndex: 1, success: false, error: { code: "WDE0074", description } } }`
|
|
235
|
+
(`WDE0074`: the id already exists; `WDE0073`: no such item to remove). A **permission** refusal
|
|
236
|
+
(`WDE0027`) comes back both ways: a bulk insert, update or patch the caller may not make still answers
|
|
237
|
+
`200` with every item failed, while a bulk remove the caller may not make is a `403` for the whole
|
|
238
|
+
request, like a single-item write. Handle both.
|
|
239
|
+
- **Cursor paging: pass the same arguments for every page.** The cursor carries the first page's query, and Wix
|
|
240
|
+
refuses most of it beside a cursor (`400 WDE0080`): the filter, sort and `returnTotalCount` of a query, the field name
|
|
241
|
+
of distinct values, the referring item of a referenced-items read, the stages of an aggregation. The client drops
|
|
242
|
+
those on a page that carries a cursor.
|
|
243
|
+
- **A read right after your own write can miss it.** Reads come from the nearest mirror; pass
|
|
244
|
+
`{ consistentRead: true }` in the query options when you need to see what you just wrote.
|
|
245
|
+
- **Multi-reference values are silently dropped** when written through insert, save, update or any bulk write — Wix
|
|
246
|
+
answers `200` and stores nothing. Write links with the reference calls (or `setField` with an array of ids), and read
|
|
247
|
+
back with `includeReferences` to confirm. A multi-reference field is absent from query results unless you name it
|
|
248
|
+
in `includeReferences`, which takes objects, `{ includeReferences: [{ field: "authors" }] }`; a plain string array
|
|
249
|
+
is a `400 Expected an object`.
|
|
250
|
+
- **Offline and caching treat some of these reads as writes.** On iOS, Android and the web host, the offline
|
|
251
|
+
guard counts a `POST` as a read only when its path ends in `query`, `count`, `list`, `search`, `get` or `read`. So
|
|
252
|
+
`aggregateDataItemsPipeline`, `queryDistinctValues`, `queryReferencedDataItems` and `isReferencedDataItem` are
|
|
253
|
+
refused offline like writes rather than answered from cache. And in an app whose cache policy tags
|
|
254
|
+
`/wix-data/v2/items`, any non-cacheable `POST` under that prefix, `countDataItems` and `searchDataItems` included,
|
|
255
|
+
purges that family's cached queries. Until those layers learn these endpoints, keep such reads off a hot path.
|
|
256
|
+
- **Dates in filters:** compare a system date such as `_createdDate` as `{ $date: "…" }`. Wix's reference says a plain
|
|
257
|
+
ISO string is accepted, but in testing against a live site a bare string on a system date field matched nothing and
|
|
258
|
+
still answered `200` with no rows, so wrap it.
|
|
259
|
+
|
|
260
|
+
Not wrapped: the draft/publish lifecycle, filter-driven async patch and remove, `truncate`, and the single-reference
|
|
261
|
+
calls (use the bulk reference calls with one entry). For those, use the raw transport:
|
|
215
262
|
|
|
216
263
|
```ts
|
|
217
264
|
// un-codegen'd fallback ONLY — prefer the typed queryDataItems above:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1538.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": "
|
|
74
|
+
"falconPackageHash": "a1a15dbe939dfa2c63ef1cc4b38f88d026f5eda14efaf885d5c9aa84"
|
|
75
75
|
}
|