@wix/himalaya-cli 0.1668.0 → 0.1670.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/dev-server/src/app-config.d.ts +15 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/wix-platform/src/index.d.ts +20 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-platform.mjs +21 -0
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{6eb8e06efae709dec91b845b9df5a93594d4a91d157b435e053cc7789d005253.bin → 6eef5856f65113cbc7504d7f926fe7039c48f614b3b0daf20c0e6eea0315c923.bin} +1 -1
- package/dist/browser-plane/sw.js +8 -8
- package/dist/cli.mjs +463 -45
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/sdk-reference.json +8 -1
- package/guides/web-page-sdk-reference.md +1 -1
- package/guides/wix-platform-usage.md +34 -1
- package/package.json +2 -2
|
Binary file
|
|
@@ -6766,7 +6766,14 @@
|
|
|
6766
6766
|
"name": "bi",
|
|
6767
6767
|
"kind": "const",
|
|
6768
6768
|
"jsdoc": "",
|
|
6769
|
-
"decl": "export const bi = {\n /** Fire a BI beacon with an explicit Frog `evid` + params. */\n async track(evid: number | string, params?: Record<string, string | number>): Promise<BiResult> {\n const r = await call<{ ok?: boolean; beacon?: string }>(\"biTrack\", {\n evid: String(evid),\n params: params ? JSON.stringify(params) : \"\",\n });\n return { ok: r?.ok ?? false, beacon: r?.beacon ?? \"\" };\n },\n /** Page-view beacon (Frog evid 501). */\n pageView(pageName: string): Promise<BiResult> {\n return bi.track(501, { page_name: pageName });\n },\n /** Click beacon (Frog evid 522). */\n click(buttonName: string, pageName?: string): Promise<BiResult> {\n return bi.track(522, pageName ? { button_name: buttonName, page_name: pageName } : { button_name: buttonName });\n },\n};",
|
|
6769
|
+
"decl": "export const bi = {\n /** Fire a BI beacon with an explicit Frog `evid` + params. */\n async track(evid: number | string, params?: Record<string, string | number>): Promise<BiResult> {\n const r = await call<{ ok?: boolean; beacon?: string }>(\"biTrack\", {\n evid: String(evid),\n params: params ? JSON.stringify(params) : \"\",\n });\n return { ok: r?.ok ?? false, beacon: r?.beacon ?? \"\" };\n },\n /** Page-view beacon (Frog evid 501). */\n pageView(pageName: string): Promise<BiResult> {\n return bi.track(501, { page_name: pageName });\n },\n /** Click beacon (Frog evid 522). */\n click(buttonName: string, pageName?: string): Promise<BiResult> {\n return bi.track(522, pageName ? { button_name: buttonName, page_name: pageName } : { button_name: buttonName });\n },\n /**\n * Send a typed `@wix/bi-logger-*` `/v2` event exactly as its generated function returns it:\n * `bi.log(bookingsAppointmentBookedSrc16Evid526({ ... }))`. In an app whose BI runs in\n * `commonParams: \"oneapp\"` mode (the Owner / Spaces / Branded lite apps) its own `src` and\n * `endpoint` are honored (`''`, the frog root, as `\"/\"`); a `himi`-mode app stamps its own\n * configured `src` on every beacon and sends the event's `endpoint` as a plain `endpoint` field, so\n * use it in oneapp apps. A param that is not a string, number or boolean is left out. The host still owns every common and identity field, and drops one a worker names.\n *\n * Prefer the platform maps (screen map, Wix API rules, action map, epic #4973): they send the\n * RN events without worker code. Use this only for an event whose fields exist only in the worker.\n */\n log(event: BiLogEvent): Promise<BiResult> {\n const params: Record<string, string | number> = {};\n for (const [k, v] of Object.entries(event.params ?? {})) {\n if (typeof v === \"string\" || (typeof v === \"number\" && Number.isFinite(v))) params[k] = v;\n else if (typeof v === \"boolean\") params[k] = v ? \"true\" : \"false\";\n }\n params.src = event.src;\n if (event.endpoint !== undefined) params.endpoint = event.endpoint === \"\" ? \"/\" : event.endpoint;\n return bi.track(event.evid, params);\n },\n};",
|
|
6770
|
+
"verificationChecked": true
|
|
6771
|
+
},
|
|
6772
|
+
{
|
|
6773
|
+
"name": "BiLogEvent",
|
|
6774
|
+
"kind": "interface",
|
|
6775
|
+
"jsdoc": "/** What a `@wix/bi-logger-*` `/v2` event function returns: `{ evid, src, endpoint, params }`. */",
|
|
6776
|
+
"decl": "export interface BiLogEvent {\n evid: number;\n src: number;\n /** The frog endpoint; `''` is the frog root. */\n endpoint?: string;\n params?: Record<string, unknown>;\n}",
|
|
6770
6777
|
"verificationChecked": true
|
|
6771
6778
|
},
|
|
6772
6779
|
{
|
|
@@ -57,4 +57,4 @@ the SDK sources, so it matches the shipped SDKs.
|
|
|
57
57
|
- [`ui`](https://apps.wix.com/_api/himi-serve/authoring/resource/web-sdk%2Fui?format=md) — Imperative popup capability. 2 methods · not in Brandy.
|
|
58
58
|
- [`wix_cashier`](https://apps.wix.com/_api/himi-serve/authoring/resource/web-sdk%2Fwix_cashier?format=md) — Native cashier. 2 methods.
|
|
59
59
|
- [`wix_chat`](https://apps.wix.com/_api/himi-serve/authoring/resource/web-sdk%2Fwix_chat?format=md) — Host-owned realtime Chat event subscriptions. 2 methods.
|
|
60
|
-
- [`wix_platform`](https://apps.wix.com/_api/himi-serve/authoring/resource/web-sdk%2Fwix_platform?format=md) — Wix Platform SDK, worker-facing bindings.
|
|
60
|
+
- [`wix_platform`](https://apps.wix.com/_api/himi-serve/authoring/resource/web-sdk%2Fwix_platform?format=md) — Wix Platform SDK, worker-facing bindings. 30 methods · not in Brandy.
|
|
@@ -49,7 +49,7 @@ await monitoring.captureError("thing failed", { code: "E1" });
|
|
|
49
49
|
|
|
50
50
|
| Member | Methods |
|
|
51
51
|
|---|---|
|
|
52
|
-
| `bi` | `track(evid, params?)`, `pageView(name)`, `click(name, page?)` |
|
|
52
|
+
| `bi` | `track(evid, params?)`, `pageView(name)`, `click(name, page?)`, `log(v2Event)` ([below](#bilog--a-typed-wix-bi-logger-v2-event)) |
|
|
53
53
|
| `experiments` | `conduct(spec, fallback?)`, `isEnabled(spec)`, `exposure(spec, variant)` |
|
|
54
54
|
| `flags` | `isEnabled(spec, fallback?)`, `value(spec, fallback?)`, `all()` |
|
|
55
55
|
| `i18n` | `t(key, fallback?)`, `locale()` |
|
|
@@ -61,6 +61,39 @@ await monitoring.captureError("thing failed", { code: "E1" });
|
|
|
61
61
|
| `userProps` | `get()`, `set(patch)` — the signed-in Wix user's server-side per-app preferences ([below](#userprops--server-side-per-user-preferences)) |
|
|
62
62
|
| `version` | the SDK surface version constant |
|
|
63
63
|
|
|
64
|
+
## `bi.log` — a typed `@wix/bi-logger-*` `/v2` event
|
|
65
|
+
|
|
66
|
+
**Prefer the platform maps. Use `bi.log` only when the event's fields exist only in the worker.**
|
|
67
|
+
In the Owner, Spaces and Branded lite apps (`commonParams: "oneapp"`), the host already sends the RN
|
|
68
|
+
events without worker code (epic #4973):
|
|
69
|
+
|
|
70
|
+
| Map | Sends |
|
|
71
|
+
|---|---|
|
|
72
|
+
| the screen map | the screen view and a detail screen's view event |
|
|
73
|
+
| the Wix API rules | the outcome event of a successful Wix API call |
|
|
74
|
+
| the action map | the tap event for a user's tap |
|
|
75
|
+
|
|
76
|
+
A worker is customer-editable, so BI that lives in it can be stripped or changed by an edit. That
|
|
77
|
+
is why it is the last resort.
|
|
78
|
+
|
|
79
|
+
`bi.log` takes what a generated `/v2` function returns, unchanged:
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import { bi } from "@himalaya/wix-platform";
|
|
83
|
+
import { bookingsSaveServiceX } from "@wix/bi-logger-bookings-data/v2"; // the worker's own dependency
|
|
84
|
+
|
|
85
|
+
await bi.log(bookingsSaveServiceX({ service_id: id, success: true }));
|
|
86
|
+
// → { evid: 358, src: 16, endpoint: "", params } goes to frog with src 16 at the frog root
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
- **`src` and `endpoint`.** In `commonParams: "oneapp"` mode (the lite apps) the event's own values are honored, and `''`, the frog root, is sent as `"/"`. A `himi`-mode app stamps its own configured `src` on every beacon and sends the event's `endpoint` as a plain `endpoint` field, so a typed event belongs in a oneapp app.
|
|
90
|
+
- **Params.** A string, number or boolean is sent; anything else is left out.
|
|
91
|
+
- **Host fields.** The host owns every common and identity field: `installationId`, `uuid`,
|
|
92
|
+
`msid`, `mobile_app_id`, `_lv`, `bsi`, `contactId` and the rest. It drops any a worker names, in
|
|
93
|
+
`bi.log` as in `bi.track`.
|
|
94
|
+
- **Packages.** The `@wix/bi-logger-*` packages are not bundled into the platform build. A worker
|
|
95
|
+
that wants one adds it as its own dependency.
|
|
96
|
+
|
|
64
97
|
## Real vs dev seam — and best-effort
|
|
65
98
|
|
|
66
99
|
- With no `wixPlatform.real.<member>`, a member returns the **dev seam** (deterministic
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1670.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": [
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"artifactId": "himalaya-cli"
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
|
-
"falconPackageHash": "
|
|
82
|
+
"falconPackageHash": "16d12bdc025c47b8ec3099e1920d1bee4ffcf85e2535fdc73bed17ea"
|
|
83
83
|
}
|