@wix/himalaya-cli 0.977.0 → 0.978.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/ts/src/define-app.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DesignTokens } from "./tokens.js";
|
|
2
|
+
import type { PushRoute, PushPayloadAdapter } from "./push-routes.js";
|
|
2
3
|
import type { NavigationConfig, SplashConfig } from "./schema.js";
|
|
3
4
|
import { type LocaleConfig } from "./locale.js";
|
|
4
5
|
import { type DistributionConfig } from "./distribution.js";
|
|
@@ -6,6 +7,7 @@ import type { CmsConfig } from "./cms.js";
|
|
|
6
7
|
import { type DataResourcesConfig } from "@wix/himalaya/data-resources";
|
|
7
8
|
import type { FunctionDefinition, FunctionScheduleRecord } from "@himalaya/functions";
|
|
8
9
|
export type { CmsConfig, CmsCollectionSpec, CmsFieldSpec, WixFieldType } from "./cms.js";
|
|
10
|
+
export type { PushRoute, PushPayloadAdapter };
|
|
9
11
|
export type { DataResourcesConfig, KvSpec, ResourceEnvironment, ResourceScope } from "@wix/himalaya/data-resources";
|
|
10
12
|
export { WIX_FIELD_TYPES } from "./cms.js";
|
|
11
13
|
/** Wix site/environment binding used by the server-function surface. */
|
|
@@ -445,6 +447,16 @@ export interface PushConfig {
|
|
|
445
447
|
richTemplates?: RichTemplate[];
|
|
446
448
|
/** Prompt for the OS notification permission on first launch. */
|
|
447
449
|
requestPermissionOnLaunch?: boolean;
|
|
450
|
+
/** Notification route table. Derive these from the app's own contract rather than
|
|
451
|
+
* hand-listing them, so a route can never target a screen the provisioned app
|
|
452
|
+
* does not have. Honoured by iOS + Android; the web host has no push transport. */
|
|
453
|
+
routes?: PushRoute[];
|
|
454
|
+
payloadAdapter?: PushPayloadAdapter;
|
|
455
|
+
/** A `tier5.<service>.<action>` dispatched on EVERY notification — receipt or tap
|
|
456
|
+
* — so a worker can keep a badge count or refresh a feed without navigating. It
|
|
457
|
+
* receives `templateId`, `topic`, `metaSiteId`, `notificationId`, `link`,
|
|
458
|
+
* `resolvedLink` and `tapped` (all as strings, the dispatch bridge's contract). */
|
|
459
|
+
observerAction?: string;
|
|
448
460
|
}
|
|
449
461
|
export type IapProductType = "subscription" | "nonConsumable" | "consumable";
|
|
450
462
|
export interface IapProduct {
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/push-routes.d.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a payload link is stripped down to the residual path+query `routes` match
|
|
3
|
+
* against. An UNKNOWN value passes the link through unchanged rather than failing, so
|
|
4
|
+
* an older binary served a newer adapter degrades instead of dropping every
|
|
5
|
+
* notification (invariants 6/8).
|
|
6
|
+
*/
|
|
7
|
+
export type PushPayloadAdapter = "" | "wix-ping";
|
|
8
|
+
/**
|
|
9
|
+
* One notification-routing rule. Mirrors `PushRoute` in core.proto / Schema.swift /
|
|
10
|
+
* Schema.kt, and is re-exported from `define-app` as part of the authoring surface —
|
|
11
|
+
* defined HERE, once, next to the matcher that consumes it.
|
|
12
|
+
*
|
|
13
|
+
* Routes translate a FOREIGN link space (the Wix mobile links Ping delivers) into this
|
|
14
|
+
* app's own, in front of the existing resolver — never beside it. No match leaves the
|
|
15
|
+
* link untouched, which is why an app declaring no routes behaves exactly as it did
|
|
16
|
+
* before they existed.
|
|
17
|
+
*/
|
|
18
|
+
export interface PushRoute {
|
|
19
|
+
/** WIX-link-space pattern over the residual path+query, in the same grammar as
|
|
20
|
+
* `deepLinkPatterns`: `"orders/?orderId=:orderId"`. */
|
|
21
|
+
match: string;
|
|
22
|
+
/** The himi link to resolve instead, with `{name}` placeholders filled from the
|
|
23
|
+
* captured params: `"<scheme>://screen/himi_order?id={orderId}"`. May instead name
|
|
24
|
+
* a `tier5.*` action, which dispatches to a worker rather than navigating. */
|
|
25
|
+
link: string;
|
|
26
|
+
/** Optional EXTRA conditions on the Ping payload. Omitted ⇒ unconstrained, so one
|
|
27
|
+
* link space can fan out by template or topic. */
|
|
28
|
+
templateId?: string;
|
|
29
|
+
topic?: string;
|
|
30
|
+
}
|
|
31
|
+
/** The payload facts a route may additionally condition on. */
|
|
32
|
+
export interface PushPayloadContext {
|
|
33
|
+
templateId?: string;
|
|
34
|
+
topic?: string;
|
|
35
|
+
}
|
|
36
|
+
/** What an adapter made of a payload link. */
|
|
37
|
+
export interface AdaptedLink {
|
|
38
|
+
/** Residual path+query the routes match against, with no leading slash. */
|
|
39
|
+
residual: string;
|
|
40
|
+
/** The site the payload named, when it named one. */
|
|
41
|
+
metaSiteId?: string;
|
|
42
|
+
/** False when the adapter did not recognize the link and passed it through. */
|
|
43
|
+
adapted: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Strip a payload link down to the residual path+query a route matches against.
|
|
47
|
+
*
|
|
48
|
+
* `adapter` is `""` (pass through) or `"wix-ping"`. An UNKNOWN adapter passes the
|
|
49
|
+
* link through unchanged rather than failing, so an older binary served a config
|
|
50
|
+
* naming an adapter it has never heard of degrades to today's behavior instead of
|
|
51
|
+
* dropping every notification (invariants 6/8).
|
|
52
|
+
*/
|
|
53
|
+
export declare function adaptPayloadLink(link: string, adapter?: string): AdaptedLink;
|
|
54
|
+
/**
|
|
55
|
+
* The himi link the first matching route produces, or null when nothing matches.
|
|
56
|
+
*
|
|
57
|
+
* Null means "resolve the input unchanged" to the caller — never "give up" — which
|
|
58
|
+
* is what keeps an app that declares no routes behaving exactly as it did before.
|
|
59
|
+
* Rules are tried in declaration order, so a more specific rule goes first.
|
|
60
|
+
*/
|
|
61
|
+
export declare function matchPushRoute(residual: string, routes: readonly PushRoute[] | undefined, payload?: PushPayloadContext): string | null;
|
|
62
|
+
/**
|
|
63
|
+
* Adapt + match in one step: the himi link to resolve instead of `link`, the params
|
|
64
|
+
* the route captured, and the site the payload named. `link` is null when no route
|
|
65
|
+
* matched.
|
|
66
|
+
*/
|
|
67
|
+
export declare function resolvePushRoute(link: string, config: {
|
|
68
|
+
routes?: readonly PushRoute[];
|
|
69
|
+
payloadAdapter?: string;
|
|
70
|
+
} | undefined, payload?: PushPayloadContext): {
|
|
71
|
+
link: string | null;
|
|
72
|
+
params: Record<string, string>;
|
|
73
|
+
metaSiteId?: string;
|
|
74
|
+
};
|
package/dist/cli.mjs
CHANGED
|
@@ -5290,7 +5290,6 @@ function resolveTranslation(value, catalog, sourceCatalog) {
|
|
|
5290
5290
|
var BINDING_SIGILS, BINDING_SIGIL_RE, TRANSLATION_PREFIX, TRANSLATION_KEY_RE;
|
|
5291
5291
|
var init_bindings = __esm({
|
|
5292
5292
|
"../../core/ts/src/bindings.ts"() {
|
|
5293
|
-
"use strict";
|
|
5294
5293
|
BINDING_SIGILS = ["service", "flag", "item", "t"];
|
|
5295
5294
|
BINDING_SIGIL_RE = new RegExp(
|
|
5296
5295
|
`^\\$(?:${BINDING_SIGILS.filter((s) => s !== "t").join("|")})\\b|^\\$t:`
|
|
@@ -37481,6 +37480,7 @@ async function navIssues(dir, strict) {
|
|
|
37481
37480
|
}
|
|
37482
37481
|
}
|
|
37483
37482
|
const nav = cfg.navigation;
|
|
37483
|
+
pushRouteIssues(cfg.push, nav, warn);
|
|
37484
37484
|
if (nav === void 0 || nav === null) return issues;
|
|
37485
37485
|
if (!isPlainObject(nav)) {
|
|
37486
37486
|
error("nav-not-an-object", `navigation must be an object (got ${Array.isArray(nav) ? "array" : typeof nav}).`);
|
|
@@ -37548,6 +37548,31 @@ async function navIssues(dir, strict) {
|
|
|
37548
37548
|
}
|
|
37549
37549
|
return issues;
|
|
37550
37550
|
}
|
|
37551
|
+
function pushRouteIssues(push, nav, warn) {
|
|
37552
|
+
if (!isPlainObject(push) || push.payloadAdapter !== "wix-ping") return;
|
|
37553
|
+
const routes = Array.isArray(push.routes) ? push.routes.filter(isPlainObject) : [];
|
|
37554
|
+
if (routes.length === 0) {
|
|
37555
|
+
warn(
|
|
37556
|
+
"push-routes-missing",
|
|
37557
|
+
`push.payloadAdapter is "wix-ping" but push.routes is empty \u2014 Wix business-event links cannot map to app screens. Direct Himi screen links still work. Declare a route per business-event link the site sends, e.g. { match: "my-account/:site/stores/orders/:orderId", link: "<scheme>://screen/<order screen>?id={orderId}" }.`
|
|
37558
|
+
);
|
|
37559
|
+
return;
|
|
37560
|
+
}
|
|
37561
|
+
const linkables = isPlainObject(nav) ? nav.linkableScreens : void 0;
|
|
37562
|
+
if (!Array.isArray(linkables)) return;
|
|
37563
|
+
const declared = new Set(
|
|
37564
|
+
linkables.filter(isPlainObject).map((s) => String(s.screenId ?? ""))
|
|
37565
|
+
);
|
|
37566
|
+
for (const route of routes) {
|
|
37567
|
+
const screenId = /:\/\/screen\/([^?]+)/.exec(String(route.link ?? ""))?.[1];
|
|
37568
|
+
if (screenId && !declared.has(screenId)) {
|
|
37569
|
+
warn(
|
|
37570
|
+
"push-route-unknown-screen",
|
|
37571
|
+
`push.routes: "${String(route.match)}" opens "${screenId}", which navigation.linkableScreens does not declare \u2014 the device cannot resolve it, so the notification opens nothing.`
|
|
37572
|
+
);
|
|
37573
|
+
}
|
|
37574
|
+
}
|
|
37575
|
+
}
|
|
37551
37576
|
var NAVIGATION_KEYS, NAV_KINDS, ITEMS_BLOCKS, SERVED_ONLY_NAV_KEYS, MISPLACED_TOP_LEVEL_KEYS, isPlainObject, itemCount;
|
|
37552
37577
|
var init_nav_lint = __esm({
|
|
37553
37578
|
"src/nav-lint.ts"() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.978.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": [
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"artifactId": "himalaya-cli"
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
-
"falconPackageHash": "
|
|
67
|
+
"falconPackageHash": "88b2cfb0f2d75cce7fa6a3681bfbfd1b227e95d24d266ba8ca8e722a"
|
|
68
68
|
}
|