@wix/himalaya-cli 0.1853.0 → 0.1854.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.
@@ -35,6 +35,10 @@ These key and profile prerequisites apply to direct Apple mode. There is **no am
35
35
 
36
36
  ## Set up the owner's Apple keys
37
37
 
38
+ These are IAP setup steps (`asc-key` through `saveAscKey`, `purchases-app`, `iap-key`); the table of
39
+ every setup step is in [push-provisioning-contract.md](push-provisioning-contract.md#setup-steps), and
40
+ `himi setup check` shows them under `iapSetup` without a manifest.
41
+
38
42
  Use `himi store apple-keys setup` to upload either key independently of push setup
39
43
  and local signing profiles. The **App Store Connect API key** is stored in Branded
40
44
  BuildSecrets for Catalog. The separate **In-App Purchase key** is stored on the
@@ -221,7 +221,7 @@ carousel placement remain separate gaps; the mappings above stay Partial.
221
221
  | --- | --- | --- | --- | --- | --- |
222
222
  | `platform_general_contact_section` | `wix.platform.general.contact_section` | [Core Text/Button/Map composition](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/src/builder.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") | Inline composition | Composition | Compose the supplied business contact/address/description and source visibility/get-in-touch settings. Wire phone/email/URL/chat actions to existing target capabilities; the Structure alone may need business contact values supplied alongside it. |
223
223
  | `platform_general_upcoming_section` | `wix.platform.general.upcoming_section` | [My Bookings data](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/tier5-bundles-src/himi-booking-bookings/index.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") + [existing home modules](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/src/home-modules-screen.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") | Existing base; adaptation needed | Partial | Reuse real member upcoming-booking logic and compose the source strip/limit. Preserve visitor/access behavior and the original agenda CTA; this does not resolve the separate Bookings agenda gap. |
224
- | `platform_general_announcement_section` | `wix.platform.general.announcement_section` | `announcement-section` shared module + `announcement-card` recipe, mapped by `himi one-app generate` | Inline section; the content is read at runtime, never baked at migration time | Module | The latest announcement (title, rich body, creator, date) through the one read-only call the native app makes: `GET https://manage.wix.com/_api/mobile-apps-announcements/v1/announcements/latest?includeReaderData=false`, authorized with the app's own signed instance (Member when signed in, else Visitor). `includeReaderData` stays false (true needs the One App manage permission and answers 403); `AddCurrentMemberAsReader` is a write and is never called. Known server behaviour, shared with the native app: a site with no announcement gets its default welcome text saved once by this read, so do not call it during migration collection or validation. The section has no settings. The announcement `content` is a DraftJS raw state for announcements written in the app (shown as plain text) or a Ricos document (shown rich). Native hosts send the consumer credential to exactly this GET path only (the `isSupportedConsumerEndpoint` family in `WixApiCapability`, Android and Swift), so a phone shows the section from the first Player/app native release that carries that entry; the local web preview (`himi run`) needs nothing. |
224
+ | `platform_general_announcement_section` | `wix.platform.general.announcement_section` | `announcement-section` shared module + `announcement-card` recipe, mapped by `himi one-app generate` | Inline section; the content is read at runtime, never baked at migration time | Module | The latest announcement (title, rich body, creator, date) through the one read-only call the native app makes: `GET https://manage.wix.com/_api/mobile-apps-announcements/v1/announcements/latest?includeReaderData=false`, authorized with the app's own signed instance (Member when signed in, else Visitor). `includeReaderData` stays false (true needs the One App manage permission and answers 403); `AddCurrentMemberAsReader` is a write and is never called. Known server behaviour, shared with the native app: a site with no announcement gets its default welcome text saved once by this read, so do not call it during migration collection or validation. The section has no settings. The announcement `content` is a DraftJS raw state for announcements written in the app or a Ricos document (shown rich). A DraftJS state with pictures (an atomic block pointing at a `wix-draft-plugin-image` entity, shape read from a live site) is shown rich too, its pictures in order with the text and sized from the Wix media name; a DraftJS state without pictures is shown as plain text, and other entities (video, file, gallery) are left out. Native hosts send the consumer credential to exactly this GET path only (the `isSupportedConsumerEndpoint` family in `WixApiCapability`, Android and Swift), so a phone shows the section from the first Player/app native release that carries that entry; the local web preview (`himi run`) needs nothing. |
225
225
  | `platform_general_members_section` | `membersArea.MembersAboutWidget` | [Member data](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/tier5-bundles-src/wix-spaces-members/index.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") + [existing member avatars/home composition](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/src/home-modules-screen.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") | Inline composition | Composition | Reuse member rows/avatar presentation and the member-directory destination. Preserve source strip/title/count/privacy settings rather than copying seeded dashboard members. |
226
226
  | `platform_elements_divider_section` | `wix.platform.elements.divider_section` | [Core Divider / layout modifiers](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/src/builder.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") | Inline primitive | Primitive | Translate orientation/style/spacing from instance settings where supported and retain section margins. |
227
227
  | `platform_elements_image_section` | `wix.platform.elements.image_section` | [Core Image](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/src/builder.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") | Inline primitive | Primitive | Translate media URL, aspect/crop ratio, fill/fit, corner radius, alt text and configured click action; preserve sizing and accessibility. |
@@ -826,12 +826,15 @@ Apply these interpretation rules:
826
826
  badges (the bar then holds only the avatar). The avatar replaces the hamburger on every tab root, and the scaffold's
827
827
  Profile screen then lists the side menu's pages under "Pages" (the scaffold ships that group hidden, as it cannot know the
828
828
  app's top bar; the same command shows it by setting the load parameter `showPages: "1"` on `himi_account`, reported as
829
- `profilePages`: `set`, or `unchanged` on a rerun). Only you can say the app is new, so the command acts on
830
- `app: { newApp: true }` in `config.ts`, which `access --new-app` writes when the source locks a page. Without
831
- that declaration it writes no avatar and says so (`avatar: "skipped_not_new_app"` and an `avatarNote`): add the
832
- declaration yourself, or run `access --new-app` first when the source locks a page, then run `header-badges` (again).
833
- Order: `access --new-app` (when the source locks a page), then `header-badges`; running `header-badges` again after
834
- declaring the app new adds the avatar and changes nothing else. The avatar needs the full nav worker
829
+ `profilePages`: `set`, or `unchanged` on a rerun). A One App migration is always a new Himalaya app (it has shipped no older binary), so
830
+ the command declares `app: { newApp: true }` in `config.ts` itself when the file says nothing about it, in the same
831
+ write as the avatar (reported as `newApp: "declared"`; a rerun finds it and reports nothing). That is the same edit
832
+ `access --new-app` makes, so the page locks of a source that locks a page and the avatar compose in either order and the
833
+ declaration appears once. An app that has shipped older binaries must keep its hamburger: pass `--not-new-app`, or set
834
+ `app: { newApp: false }` in `config.ts` (the command never overwrites an author's `false`, nor an `app` that is not an
835
+ object literal). It then writes no avatar and says so (`avatar: "skipped_not_new_app"` and an `avatarNote` that names
836
+ the reason). Order: `header-badges` (it declares the app new and writes the avatar), then `access --new-app` when the
837
+ source locks a page; either order gives the same result. The avatar needs the full nav worker
835
838
  (`himi-branded-lite-nav`, or `himi-branded-lite-access-nav` after `access`); a config that names the badges-only worker is
836
839
  reported as `config_needs_manual_merge`.
837
840
 
@@ -127,6 +127,26 @@ built without Sign in with Apple hides Google on iOS too.
127
127
  social login.
128
128
  Its `iap` section runs `himi store iap check` when you pass
129
129
  `--iap-manifest <file> --catalog-route <path>`, and is `not_checked` without them.
130
+ Its `steps` section lists every server setup step and its `iapSetup` section every IAP setup step,
131
+ with no manifest needed. `steps` fails only on a step that needs attention, and `--only push` or
132
+ `--only signin` lists only that area's steps (`app-identity` is in both, `android-signin` is
133
+ sign-in's). `iapSetup` fails on a missing key or app and stays unverified while the payment provider
134
+ cannot be read. It checks the site and bundle ID of `--iap-manifest` when you pass one, else the
135
+ content package's (or `--app`, `--site` and `--bundle-id`):
136
+
137
+ | Step | Runs in | What it does | Needs | Stages it checkpoints | Run by |
138
+ |---|---|---|---|---|---|
139
+ | `app-identity` | server | Finds or creates the site's Branded record and writes the iOS bundle ID and Android package onto it (and makes a bundle or package move). Branded turns these into the site's IAM Apple and Google sign-in connections. | `bundleId`, `androidApplicationId`, `displayName` | `read_branded_record`, `create_branded_record`, `configure_branded_record`, `migrate_branded_record` | push setup; Apple sign-in (`purpose: "apple_sign_in"`) |
140
+ | `apns` | server | Saves the APNs key in the site's build secrets. Repeats every run. | APNs key | `write_build_secrets` | push setup (iOS) |
141
+ | `apple-signing` | server | Saves the App Store Connect key (in the same write as APNs) and asks Apple for certificates and profiles with `CreateAppStoreSecrets`, **once**: never again after it completes. | App Store Connect key | `create_app_store_secrets` | push setup (iOS, with that key) |
142
+ | `firebase` | server | Asks Branded to create the Firebase app and FCM credential (`SavePushNotificationsCredentials`; `forceCreate` only after an Android package move). | Android package | `save_push_credentials` | push setup (Android) |
143
+ | `android-signin` | server | Saves the Play signing SHA-1 and forces the Firebase step until Google lists the Android OAuth client. | SHA-1 | `write_certificate_fingerprint`, `sync_android_client` | `POST /v1/admin/push/android-signin`; push setup after a package move |
144
+ | `ping-readback` | server | Reads Ping and decides whether push is `ready`. | none | `read_back_ping` | push setup |
145
+ | `saveAscKey` | server helper | Saves the App Store Connect key by itself and reads it back. | App Store Connect key | none | `POST /v1/admin/store/asc-key` (`himi store apple-keys setup`) |
146
+ | `purchases-app` | CLI | Finds or registers the bundle's purchases app on the site. | site, bundle ID | none | `himi store apple-keys setup`, `himi store iap connect` |
147
+ | `iap-key` | CLI | Stores the In-App Purchase key on the purchases app: `apple-keys setup` replaces a stored one, `iap connect` keeps it. | In-App Purchase key | none | `himi store apple-keys setup`, `himi store iap connect` |
148
+ | `payment-provider` | CLI | Connects the appleIAP payment provider through Serve's wix-iap route. Nothing can read its state, so a check reports it `unverified`. | purchases app | none | `himi store iap connect` |
149
+
130
150
  `--only push,signin,iap` limits the report. Each section's `ok` is `true`, `false` or `null`
131
151
  (unverified, listed under `unverified`); the top-level `ok` is false when any section is false.
132
152
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1853.0",
3
+ "version": "0.1854.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": [
@@ -82,5 +82,5 @@
82
82
  "artifactId": "himalaya-cli"
83
83
  }
84
84
  },
85
- "falconPackageHash": "11fd6cbee7d63d429f6ce387f3bdc1231cd77948af47deb61483e19e"
85
+ "falconPackageHash": "0f738a2dd502d650d70353a02fc54e6ea2a1a0f84f1f93968fb20708"
86
86
  }
@@ -14,6 +14,7 @@ import { defineService } from "@himalaya/state";
14
14
  import { richBody } from "./rich-body.js";
15
15
  import { formatDateMedium } from "./engine-intl.js";
16
16
  import { openRichLink } from "./rich-content-link.js";
17
+ import { draftPlainText, draftToRicos } from "./draft-content.js";
17
18
 
18
19
  /** The one call: the latest announcement, without the reader data. */
19
20
  export const LATEST_ANNOUNCEMENT_URL = "https://manage.wix.com/_api/mobile-apps-announcements/v1/announcements/latest?includeReaderData=false";
@@ -44,17 +45,6 @@ export interface AnnouncementState {
44
45
 
45
46
  const text = (value: unknown): string => (typeof value === "string" ? value.trim() : "");
46
47
 
47
- /** The plain text of a DraftJS raw state (`{ blocks: [{ text }], entityMap }`), which is what the service's `content` really is for
48
- * announcements written in the app (observed on a live site, 2026-11-11), or undefined when `content` is not one. Only the blocks' own
49
- * text is read: the entity map (links, images) is never followed. */
50
- function draftPlainText(content: unknown): string | undefined {
51
- let doc = content;
52
- if (typeof doc === "string") { try { doc = JSON.parse(doc); } catch { return undefined; } }
53
- const blocks = (doc as { blocks?: unknown } | null | undefined)?.blocks;
54
- if (!Array.isArray(blocks)) return undefined;
55
- return blocks.map((block) => text((block as { text?: unknown } | null)?.text)).filter(Boolean).join("\n\n");
56
- }
57
-
58
48
  function derive(status: AnnouncementState["status"], fields: { title?: string; bodyJson?: string; body?: string; created?: string; creator?: string; creatorImage?: string } = {}): AnnouncementState {
59
49
  const title = fields.title ?? "", bodyJson = fields.bodyJson ?? "", body = fields.body ?? "", created = fields.created ?? "";
60
50
  const creator = fields.creator ?? "", creatorImage = fields.creatorImage ?? "";
@@ -76,9 +66,11 @@ function derive(status: AnnouncementState["status"], fields: { title?: string; b
76
66
  export function announcementState(response: unknown): AnnouncementState {
77
67
  const announcement = (response as LatestAnnouncementResponse | undefined)?.announcement;
78
68
  if (!announcement || typeof announcement !== "object") return derive("ready");
79
- // A DraftJS body shows as its plain text; a Ricos body keeps its rich document.
80
- const draft = draftPlainText(announcement.content);
81
- const rich = draft !== undefined ? { bodyJson: "", bodyText: draft } : richBody(announcement.content);
69
+ // A DraftJS body with pictures becomes a Ricos document (text and images in order), so the rich viewer draws them; one without shows as
70
+ // its plain text. A Ricos body keeps its rich document.
71
+ const draftDoc = draftToRicos(announcement.content);
72
+ const draft = draftDoc ? undefined : draftPlainText(announcement.content);
73
+ const rich = draftDoc ? richBody(draftDoc) : draft !== undefined ? { bodyJson: "", bodyText: draft } : richBody(announcement.content);
82
74
  const when = typeof announcement.createdDate === "string" ? new Date(announcement.createdDate) : undefined;
83
75
  const image = text(announcement.creatorMemberProfileData?.imageUrl);
84
76
  return derive("ready", {
@@ -0,0 +1,66 @@
1
+ // A DraftJS raw state (`{ blocks, entityMap }`), which is what Wix's in-app editors (the One App announcement composer) save as `content`,
2
+ // read as plain text or, when it carries pictures, as a Ricos document the RichContent viewer already draws.
3
+ // A picture is an ATOMIC block (`type: "atomic"`, one placeholder character) whose `entityRanges[0].key` names an IMAGE entry in `entityMap`
4
+ // (`wix-draft-plugin-image`: `data.src` is `{ file_name, width, height }` for Wix media, `data.metadata.alt` its alt text). Only the blocks'
5
+ // own text and those images are read; every other entity (link, divider, video, ...) is ignored, as it always was.
6
+ // The entity's media reference stays as it came and goes through the shared Ricos encoder (`richBody`), which sizes Wix media and drops any
7
+ // reference that is not https, so nothing here fetches or trusts a URL.
8
+ import type { RicosDocument, RicosNode } from "@himalaya/wix-rich-content";
9
+
10
+ type Obj = Record<string, unknown>;
11
+ const isObj = (v: unknown): v is Obj => !!v && typeof v === "object" && !Array.isArray(v);
12
+ const text = (value: unknown): string => (typeof value === "string" ? value.trim() : "");
13
+ const size = (value: unknown): number | undefined => (typeof value === "number" && Number.isFinite(value) && value > 0 ? value : undefined);
14
+
15
+ /** The DraftJS raw state inside `content` (an object, or its JSON string), or undefined when `content` is not one. */
16
+ function draftState(content: unknown): { blocks: unknown[]; entityMap: Obj } | undefined {
17
+ let doc = content;
18
+ if (typeof doc === "string") { try { doc = JSON.parse(doc); } catch { return undefined; } }
19
+ if (!isObj(doc) || !Array.isArray(doc.blocks)) return undefined;
20
+ return { blocks: doc.blocks, entityMap: isObj(doc.entityMap) ? doc.entityMap : {} };
21
+ }
22
+
23
+ /** The plain text of a DraftJS raw state: blank blocks dropped, the rest one paragraph each. Undefined when `content` is not a DraftJS state. */
24
+ export function draftPlainText(content: unknown): string | undefined {
25
+ const state = draftState(content);
26
+ if (!state) return undefined;
27
+ return state.blocks.map((block) => text(isObj(block) ? block.text : undefined)).filter(Boolean).join("\n\n");
28
+ }
29
+
30
+ /** One image entity as a Ricos IMAGE node, or undefined when it names no picture. `data.src` is a Wix media object (`file_name`, or `url`/`id`),
31
+ * or a bare string; `data.url` is read too. A media reference that is not https or Wix media is dropped later, by the encoder. */
32
+ function imageNode(entity: unknown, id: string): RicosNode | undefined {
33
+ if (!isObj(entity) || !/image/i.test(text(entity.type))) return undefined;
34
+ const data = isObj(entity.data) ? entity.data : {};
35
+ const src = isObj(data.src) ? data.src : {};
36
+ const ref = text(typeof data.src === "string" ? data.src : src.url) || text(src.file_name) || text(src.fileName) || text(src.id) || text(data.url);
37
+ if (!ref) return undefined;
38
+ const meta = isObj(data.metadata) ? data.metadata : {};
39
+ const image: Obj = { src: { url: ref } };
40
+ const width = size(src.width), height = size(src.height);
41
+ if (width && height) { image.width = width; image.height = height; }
42
+ const alt = text(meta.alt) || text(meta.caption);
43
+ return { type: "IMAGE", id, imageData: { image, ...(alt ? { altText: alt } : {}) } };
44
+ }
45
+
46
+ /** A Ricos document of the state's text blocks and images, in order, or undefined when `content` is not a DraftJS state or has no image
47
+ * (a text-only announcement stays plain text, which draws exactly as before). */
48
+ export function draftToRicos(content: unknown): RicosDocument | undefined {
49
+ const state = draftState(content);
50
+ if (!state) return undefined;
51
+ const nodes: RicosNode[] = [];
52
+ let images = 0;
53
+ state.blocks.forEach((block, index) => {
54
+ if (!isObj(block)) return;
55
+ const id = `d${index}`;
56
+ if (block.type === "atomic") {
57
+ const range = Array.isArray(block.entityRanges) ? block.entityRanges.find(isObj) : undefined;
58
+ const node = range ? imageNode(state.entityMap[String(range.key)], id) : undefined;
59
+ if (node) { nodes.push(node); images += 1; }
60
+ return;
61
+ }
62
+ const line = text(block.text);
63
+ if (line) nodes.push({ type: "PARAGRAPH", id, nodes: [{ type: "TEXT", id: `${id}t`, textData: { text: line, decorations: [] } }], paragraphData: {} });
64
+ });
65
+ return images > 0 ? { nodes } : undefined;
66
+ }