@wix/himalaya-cli 0.1225.0 → 0.1227.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.
@@ -1,4 +1,5 @@
1
1
  import type { RegistryStatus } from "./app-identity.js";
2
+ export { isPlayerRequirements, normalizeServeApp, PLAYER_REQUIREMENT_KINDS } from "./registry-app-normalize.js";
2
3
  export type RegistryKind = "serve" | "control";
3
4
  /** The normalized registry entry the picker + validator consume. */
4
5
  export interface RegistryApp {
@@ -0,0 +1,9 @@
1
+ import type { RegistryApp } from "./app-registry-client.js";
2
+ /** The id lists a release's `playerRequirements` carries, and a Player's compiled claims too. */
3
+ export declare const PLAYER_REQUIREMENT_KINDS: readonly ["capabilities", "nativeComponents", "authProviders"];
4
+ /** A well-formed `playerRequirements` (or claims) value: every kind is a list of string ids. */
5
+ export declare function isPlayerRequirements(v: unknown): v is NonNullable<RegistryApp["playerRequirements"]>;
6
+ /** One `/v1/apps` (serve) entry, normalized: null without a non-empty string id, each field coerced to its type
7
+ * or dropped, and `playerRequirements` kept only when well-formed. Pure, so the Player picker's
8
+ * worker, which parses the registry body itself, normalizes entries exactly as this client does. */
9
+ export declare function normalizeServeApp(a: any): RegistryApp | null;
@@ -13042,10 +13042,16 @@ function decideSwitch(ctx) {
13042
13042
  return ctx.activeHasDirtyState ? { action: "prompt", toAppId: ctx.incomingAppId } : { action: "switch", toAppId: ctx.incomingAppId };
13043
13043
  }
13044
13044
 
13045
- // ../../core/ts/src/app-registry-client.ts
13046
- function parseServe(body) {
13047
- const apps = Array.isArray(body?.apps) ? body.apps : [];
13048
- return apps.filter((a) => typeof a?.id === "string").map((a) => ({
13045
+ // ../../core/ts/src/registry-app-normalize.ts
13046
+ var PLAYER_REQUIREMENT_KINDS = ["capabilities", "nativeComponents", "authProviders"];
13047
+ function isPlayerRequirements(v) {
13048
+ if (!v || typeof v !== "object") return false;
13049
+ const r = v;
13050
+ return PLAYER_REQUIREMENT_KINDS.every((kind) => Array.isArray(r[kind]) && r[kind].every((id) => typeof id === "string"));
13051
+ }
13052
+ function normalizeServeApp(a) {
13053
+ if (typeof a?.id !== "string" || !a.id) return null;
13054
+ return {
13049
13055
  id: a.id,
13050
13056
  name: typeof a.name === "string" ? a.name : a.id,
13051
13057
  environment: typeof a.environment === "string" ? a.environment : void 0,
@@ -13056,8 +13062,14 @@ function parseServe(body) {
13056
13062
  ...typeof a.minBinaryVersion === "string" || a.minBinaryVersion === null ? { minBinaryVersion: a.minBinaryVersion } : {},
13057
13063
  ...typeof a.publishedAt === "string" ? { publishedAt: a.publishedAt } : {},
13058
13064
  ...a.publicationKind === "build" || a.publicationKind === "patch" || a.publicationKind === "draft" ? { publicationKind: a.publicationKind } : {},
13059
- ...a.playerRequirements && Array.isArray(a.playerRequirements.capabilities) && Array.isArray(a.playerRequirements.nativeComponents) && Array.isArray(a.playerRequirements.authProviders) ? { playerRequirements: a.playerRequirements } : {}
13060
- }));
13065
+ ...isPlayerRequirements(a.playerRequirements) ? { playerRequirements: a.playerRequirements } : {}
13066
+ };
13067
+ }
13068
+
13069
+ // ../../core/ts/src/app-registry-client.ts
13070
+ function parseServe(body) {
13071
+ const apps = Array.isArray(body?.apps) ? body.apps : [];
13072
+ return apps.map(normalizeServeApp).filter((a) => a !== null);
13061
13073
  }
13062
13074
  function parseControl(body) {
13063
13075
  const apps = Array.isArray(body?.apps) ? body.apps : [];
@@ -13416,6 +13428,7 @@ export {
13416
13428
  ORIGIN_PARAM_KEYS,
13417
13429
  PACKAGE_SHARE_ID_PATTERN,
13418
13430
  PLAYER_PREVIEW_SEGMENT_PATTERN,
13431
+ PLAYER_REQUIREMENT_KINDS,
13419
13432
  PREVIEW_EXEMPT_PLATFORM_KEYS,
13420
13433
  PREVIEW_SURFACES,
13421
13434
  PROJECTION_SNAPSHOT_SIZE,
@@ -13476,6 +13489,7 @@ export {
13476
13489
  impliedKeyboard,
13477
13490
  isComponentAllowed,
13478
13491
  isComponentAllowedForFamily,
13492
+ isPlayerRequirements,
13479
13493
  isRTL,
13480
13494
  isSupportedLocale,
13481
13495
  isTargeted,
@@ -13486,6 +13500,7 @@ export {
13486
13500
  isWidgetFamilySurface,
13487
13501
  layoutDirection,
13488
13502
  mergeIdiomOverlay,
13503
+ normalizeServeApp,
13489
13504
  normalizeSiteOrigin,
13490
13505
  parseNumeric,
13491
13506
  primarySubtag,
package/dist/cli.mjs CHANGED
@@ -2286,6 +2286,12 @@ var init_command = __esm({
2286
2286
  }
2287
2287
  });
2288
2288
 
2289
+ // ../pre-pr-review/policy.mjs
2290
+ var init_policy = __esm({
2291
+ "../pre-pr-review/policy.mjs"() {
2292
+ }
2293
+ });
2294
+
2289
2295
  // ../pre-pr-review/scope.mjs
2290
2296
  import { execFileSync } from "node:child_process";
2291
2297
  import { createHash } from "node:crypto";
@@ -2324,6 +2330,8 @@ var init_scope = __esm({
2324
2330
  init_paths();
2325
2331
  init_review_diff();
2326
2332
  init_command();
2333
+ init_policy();
2334
+ init_paths();
2327
2335
  REPO_ROOT2 = resolve4(dirname4(fileURLToPath3(import.meta.url)), "../..");
2328
2336
  BASE_REF = process.env.PRE_PR_REVIEW_BASE || "origin/master";
2329
2337
  }
@@ -28369,9 +28377,17 @@ var init_app_identity = __esm({
28369
28377
  }
28370
28378
  });
28371
28379
 
28380
+ // ../../core/ts/src/registry-app-normalize.ts
28381
+ var init_registry_app_normalize = __esm({
28382
+ "../../core/ts/src/registry-app-normalize.ts"() {
28383
+ }
28384
+ });
28385
+
28372
28386
  // ../../core/ts/src/app-registry-client.ts
28373
28387
  var init_app_registry_client = __esm({
28374
28388
  "../../core/ts/src/app-registry-client.ts"() {
28389
+ init_registry_app_normalize();
28390
+ init_registry_app_normalize();
28375
28391
  }
28376
28392
  });
28377
28393
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1225.0",
3
+ "version": "0.1227.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": [
@@ -67,5 +67,5 @@
67
67
  "artifactId": "himalaya-cli"
68
68
  }
69
69
  },
70
- "falconPackageHash": "48708a362ba1e2bd4be03f0e4be363a3920a7dbf5f0e29d1c2214155"
70
+ "falconPackageHash": "c5fad462bcf43e751df34bd3ae90f50e806b056b269d776759a4c061"
71
71
  }