@wix/himalaya-cli 0.1768.0 → 0.1770.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.
Files changed (109) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-config.d.ts +4 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-module.d.ts +7 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +1 -0
  4. package/dist/cli.mjs +311 -56
  5. package/guides/himi-json-output.md +3 -3
  6. package/guides/qa-builds.md +73 -84
  7. package/package.json +2 -2
  8. package/templates/beauty-salon/tier5-src/_shared/business-chat-transport.ts +20 -4
  9. package/templates/beauty-salon/tier5-src/_shared/engine-intl.ts +6 -0
  10. package/templates/beauty-salon-owner/tier5-src/_shared/engine-intl.ts +6 -0
  11. package/templates/branded-lite/config.ts +2 -1
  12. package/templates/branded-lite/dev/index.ts +2 -1
  13. package/templates/branded-lite/l10n/ar.json +120 -0
  14. package/templates/branded-lite/l10n/cs.json +120 -0
  15. package/templates/branded-lite/l10n/da.json +120 -0
  16. package/templates/branded-lite/l10n/de.json +120 -0
  17. package/templates/branded-lite/l10n/el.json +120 -0
  18. package/templates/branded-lite/l10n/es.json +120 -0
  19. package/templates/branded-lite/l10n/fi.json +120 -0
  20. package/templates/branded-lite/l10n/fr.json +120 -0
  21. package/templates/branded-lite/l10n/he.json +96 -0
  22. package/templates/branded-lite/l10n/hu.json +120 -0
  23. package/templates/branded-lite/l10n/id.json +120 -0
  24. package/templates/branded-lite/l10n/it.json +120 -0
  25. package/templates/branded-lite/l10n/ja.json +120 -0
  26. package/templates/branded-lite/l10n/ko.json +120 -0
  27. package/templates/branded-lite/l10n/lt.json +120 -0
  28. package/templates/branded-lite/l10n/nl.json +120 -0
  29. package/templates/branded-lite/l10n/no.json +120 -0
  30. package/templates/branded-lite/l10n/pl.json +120 -0
  31. package/templates/branded-lite/l10n/pt.json +120 -0
  32. package/templates/branded-lite/l10n/ru.json +120 -0
  33. package/templates/branded-lite/l10n/sv.json +120 -0
  34. package/templates/branded-lite/l10n/th.json +120 -0
  35. package/templates/branded-lite/l10n/tr.json +120 -0
  36. package/templates/branded-lite/l10n/uk.json +120 -0
  37. package/templates/branded-lite/l10n/vi.json +120 -0
  38. package/templates/branded-lite/l10n/zh.json +120 -0
  39. package/templates/branded-lite/tier5-src/_shared/business-chat-transport.ts +20 -4
  40. package/templates/branded-lite/tier5-src/_shared/engine-intl.ts +6 -0
  41. package/templates/branded-lite/tier5-src/_shared/inbox-rooms.ts +101 -11
  42. package/templates/branded-lite/tier5-src/_shared/inbox-search.ts +119 -0
  43. package/templates/branded-lite/tier5-src/_shared/member-inbox-transport.ts +64 -0
  44. package/templates/branded-lite/tier5-src/_shared/member-thread-rows.ts +233 -0
  45. package/templates/branded-lite/tier5-src/business-chat/index.ts +73 -22
  46. package/templates/branded-lite/tier5-src/himi-branded-lite-inbox/index.ts +777 -54
  47. package/templates/branded-lite/tier5-src/wix-spaces-chat-thread/index.ts +426 -143
  48. package/templates/branded-lite/tier5-src/wix-spaces-new-message/index.ts +4 -2
  49. package/templates/brandy/tier5-src/_shared/business-chat-message-model.ts +177 -0
  50. package/templates/brandy/tier5-src/_shared/business-chat-transport.ts +164 -0
  51. package/templates/brandy/tier5-src/_shared/engine-intl.ts +6 -0
  52. package/templates/brandy/tier5-src/_shared/inbox-rooms.ts +101 -11
  53. package/templates/brandy/tier5-src/_shared/inbox-search.ts +119 -0
  54. package/templates/brandy/tier5-src/_shared/member-inbox-transport.ts +64 -0
  55. package/templates/brandy/tier5-src/_shared/member-thread-rows.ts +233 -0
  56. package/templates/brandy/tier5-src/himi-branded-lite-inbox/index.ts +777 -54
  57. package/templates/brandy/tier5-src/wix-spaces-chat-thread/index.ts +426 -143
  58. package/templates/community-club/tier5-src/_shared/engine-intl.ts +6 -0
  59. package/templates/community-club-owner/tier5-src/_shared/engine-intl.ts +6 -0
  60. package/templates/conference/tier5-src/_shared/business-chat-transport.ts +20 -4
  61. package/templates/conference/tier5-src/_shared/chat-live.ts +242 -0
  62. package/templates/conference/tier5-src/_shared/engine-intl.ts +6 -0
  63. package/templates/conference/tier5-src/_shared/inbox-rooms.ts +101 -11
  64. package/templates/conference/tier5-src/business-chat/index.ts +73 -22
  65. package/templates/events-meetups/tier5-src/_shared/engine-intl.ts +6 -0
  66. package/templates/events-meetups-owner/tier5-src/_shared/engine-intl.ts +6 -0
  67. package/templates/fitness-gym/tier5-src/_shared/business-chat-transport.ts +20 -4
  68. package/templates/fitness-gym/tier5-src/_shared/chat-live.ts +242 -0
  69. package/templates/fitness-gym/tier5-src/_shared/engine-intl.ts +6 -0
  70. package/templates/fitness-gym/tier5-src/_shared/inbox-rooms.ts +101 -11
  71. package/templates/fitness-gym/tier5-src/business-chat/index.ts +73 -22
  72. package/templates/gym-fitness/tier5-src/_shared/business-chat-transport.ts +20 -4
  73. package/templates/gym-fitness/tier5-src/_shared/engine-intl.ts +6 -0
  74. package/templates/gym-fitness-owner/tier5-src/_shared/engine-intl.ts +6 -0
  75. package/templates/medical-services/tier5-src/_shared/business-chat-transport.ts +20 -4
  76. package/templates/medical-services/tier5-src/_shared/chat-live.ts +242 -0
  77. package/templates/medical-services/tier5-src/_shared/engine-intl.ts +6 -0
  78. package/templates/medical-services/tier5-src/_shared/inbox-rooms.ts +101 -11
  79. package/templates/medical-services/tier5-src/business-chat/index.ts +73 -22
  80. package/templates/nonprofit-cause/tier5-src/_shared/engine-intl.ts +6 -0
  81. package/templates/nonprofit-cause-owner/tier5-src/_shared/engine-intl.ts +6 -0
  82. package/templates/owner-lite/tier5-src/_shared/engine-intl.ts +6 -0
  83. package/templates/personal-fitness-trainer/dev/index.ts +2 -1
  84. package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-transport.ts +20 -4
  85. package/templates/personal-fitness-trainer/tier5-src/_shared/chat-live.ts +242 -0
  86. package/templates/personal-fitness-trainer/tier5-src/_shared/engine-intl.ts +6 -0
  87. package/templates/personal-fitness-trainer/tier5-src/_shared/inbox-rooms.ts +101 -11
  88. package/templates/personal-fitness-trainer/tier5-src/business-chat/index.ts +73 -22
  89. package/templates/podcast-creator/tier5-src/_shared/engine-intl.ts +6 -0
  90. package/templates/podcast-creator-owner/tier5-src/_shared/engine-intl.ts +6 -0
  91. package/templates/portfolio-creative/tier5-src/_shared/engine-intl.ts +6 -0
  92. package/templates/portfolio-creative-owner/tier5-src/_shared/engine-intl.ts +6 -0
  93. package/templates/restaurant/tier5-src/_shared/engine-intl.ts +6 -0
  94. package/templates/restaurant-owner/tier5-src/_shared/engine-intl.ts +6 -0
  95. package/templates/retail-store/tier5-src/_shared/engine-intl.ts +6 -0
  96. package/templates/retail-store-owner/tier5-src/_shared/engine-intl.ts +6 -0
  97. package/templates/salon-spa/tier5-src/_shared/business-chat-transport.ts +20 -4
  98. package/templates/salon-spa/tier5-src/_shared/chat-live.ts +242 -0
  99. package/templates/salon-spa/tier5-src/_shared/engine-intl.ts +6 -0
  100. package/templates/salon-spa/tier5-src/_shared/inbox-rooms.ts +101 -11
  101. package/templates/salon-spa/tier5-src/business-chat/index.ts +73 -22
  102. package/templates/wholesale-store/tier5-src/_shared/business-chat-transport.ts +20 -4
  103. package/templates/wholesale-store/tier5-src/_shared/chat-live.ts +242 -0
  104. package/templates/wholesale-store/tier5-src/_shared/engine-intl.ts +6 -0
  105. package/templates/wholesale-store/tier5-src/_shared/inbox-rooms.ts +101 -11
  106. package/templates/wholesale-store/tier5-src/business-chat/index.ts +73 -22
  107. package/templates/yoga-studio/tier5-src/_shared/business-chat-transport.ts +20 -4
  108. package/templates/yoga-studio/tier5-src/_shared/engine-intl.ts +6 -0
  109. package/templates/yoga-studio-owner/tier5-src/_shared/engine-intl.ts +6 -0
package/dist/cli.mjs CHANGED
@@ -15363,6 +15363,7 @@ function deriveAppMeta(name, m2, platforms = {}, provisioning = {}) {
15363
15363
  drawer: config.navigation?.drawer,
15364
15364
  navKind: config.navigation?.navKind,
15365
15365
  orientation: config.navigation?.orientation,
15366
+ orientationEnvelope: config.orientationEnvelope,
15366
15367
  cache: config.cache,
15367
15368
  sidebar: config.navigation?.sidebar,
15368
15369
  // RFC 0074 §3 — `app.logicBundle` (canonical) or the `navigation.navLogicBundle` alias; both
@@ -39636,6 +39637,9 @@ function deriveNavigationConfig(app2, bundleCtx) {
39636
39637
  if (app2.drawer !== void 0) config.drawer = app2.drawer;
39637
39638
  if (app2.navKind !== void 0) config.navKind = app2.navKind;
39638
39639
  if (app2.orientation !== void 0) config.orientation = app2.orientation;
39640
+ if (app2.orientationEnvelope !== void 0 && (app2.orientationEnvelope.phone?.length || app2.orientationEnvelope.tablet?.length)) {
39641
+ config.orientationEnvelope = app2.orientationEnvelope;
39642
+ }
39639
39643
  if (app2.surfaces !== void 0) {
39640
39644
  const kept = Object.fromEntries(
39641
39645
  Object.entries(app2.surfaces).filter(([id]) => {
@@ -41916,6 +41920,7 @@ function shouldRevealError(args) {
41916
41920
  var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE, AUTHORED_PATTERN_LIMIT, authoredPatterns;
41917
41921
  var init_validation = __esm({
41918
41922
  "../../core/ts/src/validation.ts"() {
41923
+ "use strict";
41919
41924
  init_define_HHP_CATALOG();
41920
41925
  EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
41921
41926
  URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
@@ -177562,13 +177567,13 @@ function newestSourceChangeMs(dir) {
177562
177567
  const roots2 = renderInputRootDirs(dir);
177563
177568
  const inRead = (hostRel) => !roots2 || roots2.has(hostRel.split(sep18)[0]);
177564
177569
  const counts = (hostRel) => !hostRel.includes(sep18) || inRead(hostRel);
177565
- let newest = 0;
177570
+ let newest2 = 0;
177566
177571
  walkSourceTree(
177567
177572
  dir,
177568
177573
  (archivePath, hostRel) => {
177569
177574
  if (/\.md$/i.test(archivePath) || !counts(hostRel)) return;
177570
177575
  const m2 = lstatSync20(join56(dir, hostRel)).mtimeMs;
177571
- if (m2 > newest) newest = m2;
177576
+ if (m2 > newest2) newest2 = m2;
177572
177577
  },
177573
177578
  () => {
177574
177579
  },
@@ -177580,10 +177585,10 @@ function newestSourceChangeMs(dir) {
177580
177585
  (hostRel) => {
177581
177586
  if (hostRel === "" || !inRead(hostRel)) return;
177582
177587
  const m2 = lstatSync20(join56(dir, hostRel)).mtimeMs;
177583
- if (m2 > newest) newest = m2;
177588
+ if (m2 > newest2) newest2 = m2;
177584
177589
  }
177585
177590
  );
177586
- return newest;
177591
+ return newest2;
177587
177592
  }
177588
177593
  function sourceFingerprint(dir) {
177589
177594
  const files = [];
@@ -179587,6 +179592,43 @@ var init_car = __esm({
179587
179592
  }
179588
179593
  });
179589
179594
 
179595
+ // ../../core/schema/frozen-renderers.json
179596
+ var frozen_renderers_default;
179597
+ var init_frozen_renderers = __esm({
179598
+ "../../core/schema/frozen-renderers.json"() {
179599
+ frozen_renderers_default = {
179600
+ description: "Renderers that are FROZEN: their code stays in the tree, but nothing runs, tests, builds or requires it \u2014 no CI lane, no pre-PR lane, no parity arm, no platforms.json opt-in. A new component or behaviour does NOT have to be implemented in a frozen renderer. Read by tools/ci/frozen-renderers.mjs (the only reader); every gate that used to require the renderer asks that module instead. To see what a revival would have to fix, run the suite with HIMALAYA_UNFREEZE=<key> \u2014 every frozen arm turns back on and its failures are the catch-up list. See docs/react-native-frozen.md.",
179601
+ frozen: {
179602
+ rn: {
179603
+ name: "React Native",
179604
+ paths: ["core/react-native/", "apps/demo-app/rn/", "samples/embed-host-rn/"],
179605
+ since: "2026-11-18",
179606
+ freezeCommit: "9625c66e6d",
179607
+ doc: "docs/react-native-frozen.md",
179608
+ rfc: "core/schema/RFC/0045-react-native-renderer.md"
179609
+ }
179610
+ }
179611
+ };
179612
+ }
179613
+ });
179614
+
179615
+ // ../ci/frozen-renderers.mjs
179616
+ function isFrozen(key4) {
179617
+ return Object.hasOwn(frozen_renderers_default.frozen, key4) && !unfrozen.has(key4);
179618
+ }
179619
+ var unfrozen, FROZEN_RECORD, RN_FROZEN;
179620
+ var init_frozen_renderers2 = __esm({
179621
+ "../ci/frozen-renderers.mjs"() {
179622
+ init_define_HHP_CATALOG();
179623
+ init_frozen_renderers();
179624
+ unfrozen = new Set(
179625
+ (process.env.HIMALAYA_UNFREEZE ?? "").split(",").map((s5) => s5.trim()).filter(Boolean)
179626
+ );
179627
+ FROZEN_RECORD = frozen_renderers_default.frozen;
179628
+ RN_FROZEN = isFrozen("rn");
179629
+ }
179630
+ });
179631
+
179590
179632
  // src/surface-lint.ts
179591
179633
  import { existsSync as existsSync67, readFileSync as readFileSync73 } from "node:fs";
179592
179634
  import { join as join63 } from "node:path";
@@ -179616,6 +179658,9 @@ function surfaceIssues(dir, surfaceNav, strict) {
179616
179658
  error(key4 === "ios" || key4 === "android" ? `platforms.json: unknown key "${key4}" \u2014 iOS and Android are always on \u2014 remove this key (valid keys: ${valid3})` : `platforms.json: unknown key "${key4}" \u2014 valid keys: ${valid3}`);
179617
179659
  } else if (typeof value2 !== "boolean") {
179618
179660
  error(`platforms.json: "${key4}" must be a boolean (got ${JSON.stringify(value2)}) \u2014 the server silently drops non-boolean values`);
179661
+ } else if (value2 && isFrozen(key4)) {
179662
+ const r3 = FROZEN_RECORD[key4];
179663
+ error(`platforms.json: "${key4}" is frozen \u2014 the ${r3.name} renderer has not been supported since ${r3.since}; remove the key or set it to false`);
179619
179664
  }
179620
179665
  }
179621
179666
  }
@@ -179670,6 +179715,7 @@ var init_surface_lint = __esm({
179670
179715
  init_define_HHP_CATALOG();
179671
179716
  init_car();
179672
179717
  init_preview_surfaces();
179718
+ init_frozen_renderers2();
179673
179719
  VALID_PLATFORM_KEYS2 = /* @__PURE__ */ new Set([
179674
179720
  ...PREVIEW_SURFACES.map((s5) => s5.platformKey).filter((k3) => k3 !== null),
179675
179721
  ...PREVIEW_EXEMPT_PLATFORM_KEYS
@@ -188072,7 +188118,7 @@ function genNativeConfig(app2, opts = {}) {
188072
188118
  return lines2(mode, watchName).map((line) => indent + line);
188073
188119
  };
188074
188120
  const tv = tvInfoPlan(parseTvConfig(configTs));
188075
- const orientation = parseOrientationEnvelope(configTs);
188121
+ const orientation = opts.orientationEnvelope ?? parseOrientationEnvelope(configTs);
188076
188122
  const carCategory = resolveCarCategory(parseCarConfig(configTs), app2);
188077
188123
  const removals = android2.removals;
188078
188124
  const removed = removals ? [...removals.permissions, ...removals.services, ...removals.receivers] : [];
@@ -207362,10 +207408,10 @@ var init_store_record = __esm({
207362
207408
  if (files.length === 0)
207363
207409
  continue;
207364
207410
  const stores = new Set(files.filter((f2) => f2.includes("/") && STORES.has(f2.split("/")[0])).map((f2) => f2.split("/")[0]));
207365
- let newest = 0;
207411
+ let newest2 = 0;
207366
207412
  for (const f2 of files)
207367
- newest = Math.max(newest, (await stat9(recordFile(this.root, app2, f2)).catch(() => void 0))?.mtimeMs ?? 0);
207368
- index.apps[app2] = { stores: [...stores].sort(), updatedAt: new Date(newest).toISOString() };
207413
+ newest2 = Math.max(newest2, (await stat9(recordFile(this.root, app2, f2)).catch(() => void 0))?.mtimeMs ?? 0);
207414
+ index.apps[app2] = { stores: [...stores].sort(), updatedAt: new Date(newest2).toISOString() };
207369
207415
  }
207370
207416
  return index;
207371
207417
  }
@@ -208387,8 +208433,8 @@ async function tracksPart(deps, record5, app2, packageName) {
208387
208433
  const releases = list5.map(liveRelease);
208388
208434
  if (!releases.length && !held.has(name))
208389
208435
  continue;
208390
- const newest = releases.filter((r3) => typeof r3.versionCode === "number").sort((a3, b3) => b3.versionCode - a3.versionCode)[0] ?? null;
208391
- writes.push({ path: trackPath(name), schema: "google.track@1", merge: true, read: "tracks", data: { track: name, release: newest, releases } });
208436
+ const newest2 = releases.filter((r3) => typeof r3.versionCode === "number").sort((a3, b3) => b3.versionCode - a3.versionCode)[0] ?? null;
208437
+ writes.push({ path: trackPath(name), schema: "google.track@1", merge: true, read: "tracks", data: { track: name, release: newest2, releases } });
208392
208438
  }
208393
208439
  return { writes, notes: [] };
208394
208440
  }
@@ -218871,8 +218917,8 @@ var init_commerce = __esm({
218871
218917
  }
218872
218918
  /** Version-scoped localizations of the group's newest version, else the legacy product-scoped list upstream's validate reads. */
218873
218919
  async groupLocalizations(groupId) {
218874
- const newest = newestVersion(await this.groupVersions(groupId));
218875
- const scoped = newest ? flatList((await this.t.list(`/v1/subscriptionGroupVersions/${encodeURIComponent(newest.id)}/localizations`)).data) : [];
218920
+ const newest2 = newestVersion(await this.groupVersions(groupId));
218921
+ const scoped = newest2 ? flatList((await this.t.list(`/v1/subscriptionGroupVersions/${encodeURIComponent(newest2.id)}/localizations`)).data) : [];
218876
218922
  return scoped.length ? scoped : flatList((await this.t.list(`/v1/subscriptionGroups/${encodeURIComponent(groupId)}/subscriptionGroupLocalizations`)).data);
218877
218923
  }
218878
218924
  /** Creates or updates a locale's text on the group's editable version, creating that version when there is none. */
@@ -218931,8 +218977,8 @@ var init_commerce = __esm({
218931
218977
  }
218932
218978
  /** Version-scoped text of the newest version, else the legacy product-scoped list upstream's validate reads. */
218933
218979
  async localizations(id) {
218934
- const newest = newestVersion(await this.versions(id));
218935
- const scoped = newest ? flatList((await this.t.list(`/v1/subscriptionVersions/${encodeURIComponent(newest.id)}/localizations`)).data) : [];
218980
+ const newest2 = newestVersion(await this.versions(id));
218981
+ const scoped = newest2 ? flatList((await this.t.list(`/v1/subscriptionVersions/${encodeURIComponent(newest2.id)}/localizations`)).data) : [];
218936
218982
  return scoped.length ? scoped : flatList((await this.t.list(`/v1/subscriptions/${encodeURIComponent(id)}/subscriptionLocalizations`)).data);
218937
218983
  }
218938
218984
  /** The legacy product-scoped write; `setLocalization` is the one Apple keeps (API 4.4.1, version-scoped). */
@@ -219385,8 +219431,8 @@ async function iapChecks(api4, appId3) {
219385
219431
  const unverified = (id, what, reason) => ({ ...base2, id: `iap.diagnostics.${id}_unverified`, severity: "info", message: `Could not verify ${what} of ${label4}`, remediation: reason });
219386
219432
  const set3 = `asc-node iap localize --app ${appId3} --iap ${iap.id} --locale en-US --name NAME --description TEXT`;
219387
219433
  const text32 = await attempt(async () => {
219388
- const newest = [...await api4.iap.versions(iap.id)].sort((a3, b3) => (b3.version ?? 0) - (a3.version ?? 0))[0];
219389
- return newest ? api4.iap.localizations(newest.id) : [];
219434
+ const newest2 = [...await api4.iap.versions(iap.id)].sort((a3, b3) => (b3.version ?? 0) - (a3.version ?? 0))[0];
219435
+ return newest2 ? api4.iap.localizations(newest2.id) : [];
219390
219436
  });
219391
219437
  checks.push(..."reason" in text32 ? [unverified("localization", "the localizations", text32.reason)] : textChecks("iap", "inAppPurchaseV2", iap.id, label4, text32.value, set3));
219392
219438
  checks.push(...screenshotChecks("iap", "inAppPurchaseV2", iap.id, label4, await attempt(() => api4.iap.reviewScreenshots.read(iap.id)), `asc-node iap review-screenshot upload --app ${appId3} --iap ${iap.id} --file review.png`, `asc-node iap review-screenshot delete --app ${appId3} --iap ${iap.id}`));
@@ -242300,18 +242346,18 @@ function noteRecordPush(root, key4, note) {
242300
242346
  }
242301
242347
  }
242302
242348
  function readRecordPushNote(root, keys2) {
242303
- let newest;
242349
+ let newest2;
242304
242350
  for (const key4 of new Set(keys2.filter((k3) => !!k3))) {
242305
242351
  try {
242306
242352
  const v2 = JSON.parse(readFileSync126(pushNoteFile(root, key4), "utf8"));
242307
242353
  if (v2.schema !== PUSH_NOTE_SCHEMA || typeof v2.at !== "string") continue;
242308
242354
  const { schema: _schema, ...note } = v2;
242309
242355
  void _schema;
242310
- if (!newest || note.at >= newest.at) newest = note;
242356
+ if (!newest2 || note.at >= newest2.at) newest2 = note;
242311
242357
  } catch {
242312
242358
  }
242313
242359
  }
242314
- return newest;
242360
+ return newest2;
242315
242361
  }
242316
242362
  async function linkStorePackage(root, identity) {
242317
242363
  if (!identity.packageName || !identity.himiAppId) return void 0;
@@ -253110,10 +253156,78 @@ stderr with a code.`;
253110
253156
  }
253111
253157
  });
253112
253158
 
253159
+ // src/store-google-pool-ready.ts
253160
+ async function planReady(runner2, input, view, actor) {
253161
+ const steps = [];
253162
+ const skipped = [];
253163
+ const countries2 = await runner2.plan("gplay.console.countries", { packageName: input.packageName, appId: input.appId, track: input.track, countries: input.countries }, actor);
253164
+ const cp = planProblem(countries2, countries2.plan.changes.map((c2) => c2.resource).filter((r3) => r3.startsWith("countries/")), /^testers in those countries can install the closed test/);
253165
+ if (cp) throw new ReadyRefusal(`countries: ${cp}`, countries2);
253166
+ if (isNoop(countries2)) skipped.push(`countries: ${countries2.plan.changes[0]?.summary ?? "already targeted"}`);
253167
+ else steps.push({ step: "countries", job: countries2 });
253168
+ const versionCode = newest(view.from);
253169
+ if (!versionCode) {
253170
+ skipped.push(`release: ${input.from} has no release to put on ${input.track}`);
253171
+ return { steps, skipped };
253172
+ }
253173
+ if (newest(view.to) >= versionCode) {
253174
+ skipped.push(`release: ${input.track} already carries version ${newest(view.to)}`);
253175
+ return { steps, skipped, versionCode };
253176
+ }
253177
+ const replace3 = (view.to ?? []).some((r3) => (r3.versionCodes ?? []).length > 0);
253178
+ const promote = await runner2.plan("gplay.release.promote", { packageName: input.packageName, versionCode, from: input.from, to: input.track, ...replace3 ? { replace: true } : {} }, actor);
253179
+ const pp = planProblem(promote, [`tracks/${input.track}`], /^$/);
253180
+ if (pp) throw new ReadyRefusal(`release: ${pp}`, promote);
253181
+ if (isNoop(promote)) skipped.push(`release: ${promote.plan.changes[0]?.summary ?? "already on the track"}`);
253182
+ else steps.push({ step: "release", job: promote });
253183
+ return { steps, skipped, versionCode };
253184
+ }
253185
+ async function applySteps(runner2, plan, person, actor, now) {
253186
+ const applied = [];
253187
+ for (const s5 of plan.steps) {
253188
+ const job = await approveAndApply(runner2, s5.job, person, actor, now);
253189
+ if (job.status !== "verified") throw new ReadyRefusal(`${s5.step}: job ${job.id} is ${job.status}: ${job.error ?? "not read back"}`, job);
253190
+ applied.push({ step: s5.step, jobId: job.id, status: job.status, ...job.result?.detail ? { detail: job.result.detail } : {} });
253191
+ }
253192
+ return applied;
253193
+ }
253194
+ async function applyReview(runner2, input, person, actor, now, planned2) {
253195
+ let review = planned2 ?? await planReview(runner2, input, actor);
253196
+ if (!isNoop(review)) {
253197
+ review = await approveAndApply(runner2, review, person, actor, now);
253198
+ if (review.status !== "verified") throw new ReadyRefusal(`review: job ${review.id} is ${review.status}: ${review.error ?? "not read back"}`, review);
253199
+ }
253200
+ return { step: "review", jobId: review.id, status: isNoop(review) ? "noop" : review.status, detail: review.result?.detail ?? review.plan.changes.map((c2) => c2.summary).join("; ") };
253201
+ }
253202
+ var POOL_DEFAULT_COUNTRIES, POOL_DEFAULT_FROM, isNoop, newest, ReadyRefusal, readyLines, planReview;
253203
+ var init_store_google_pool_ready = __esm({
253204
+ "src/store-google-pool-ready.ts"() {
253205
+ init_define_HHP_CATALOG();
253206
+ init_store_relops_google();
253207
+ POOL_DEFAULT_COUNTRIES = ["Israel", "United States"];
253208
+ POOL_DEFAULT_FROM = "alpha";
253209
+ isNoop = (job) => job.plan.changes.every((c2) => c2.op === "noop");
253210
+ newest = (releases = []) => Math.max(0, ...releases.flatMap((r3) => (r3.versionCodes ?? []).map(Number)).filter(Number.isFinite));
253211
+ ReadyRefusal = class extends Error {
253212
+ constructor(message5, job) {
253213
+ super(message5);
253214
+ this.job = job;
253215
+ }
253216
+ };
253217
+ readyLines = (plan, input) => [
253218
+ ...plan.steps.flatMap((s5) => changesOf2(s5.job)),
253219
+ `then send the app's changes on "${input.track}" to Google's review (Play Console), unless Play already sent them`
253220
+ ];
253221
+ planReview = (runner2, input, actor) => runner2.plan("gplay.console.sendReview", { packageName: input.packageName, appId: input.appId, track: input.track }, actor);
253222
+ }
253223
+ });
253224
+
253113
253225
  // src/store-google-testers.ts
253114
253226
  var store_google_testers_exports = {};
253115
253227
  __export(store_google_testers_exports, {
253228
+ POOL_CONSENT_COVERS: () => POOL_CONSENT_COVERS,
253116
253229
  POOL_CONSENT_DAYS: () => POOL_CONSENT_DAYS,
253230
+ POOL_COUNTRIES_ENV: () => POOL_COUNTRIES_ENV,
253117
253231
  POOL_DEFAULT_TRACK: () => POOL_DEFAULT_TRACK,
253118
253232
  POOL_GROUP_ENV: () => POOL_GROUP_ENV,
253119
253233
  STORE_GOOGLE_TESTERS_CODES: () => STORE_GOOGLE_TESTERS_CODES,
@@ -253149,7 +253263,28 @@ function parse7(pos, flags, cwd, env) {
253149
253263
  if (!PACKAGE_RE3.test(packageName)) throw new UsageError9(`"${packageName}" is not an Android package name`);
253150
253264
  const developer = text22(flags.developer) ?? text22(facts?.developerId);
253151
253265
  if (developer && !DEVELOPER_RE3.test(developer)) throw new UsageError9("--developer is your Play developer account id: the number in your Play Console URL");
253152
- return { op, ...consentOp ? { consentOp } : {}, track: track2, group, packageName, ...developer ? { developer } : {} };
253266
+ const groupOnly = flags["group-only"] === true || flags["group-only"] === "true";
253267
+ for (const f2 of ["countries", "from", "app-id", "group-only"]) {
253268
+ if (flags[f2] !== void 0 && op !== "pool-add") throw new UsageError9(`--${f2} is for pool-add`);
253269
+ }
253270
+ const countries2 = (text22(flags.countries) ?? text22(env[POOL_COUNTRIES_ENV]) ?? POOL_DEFAULT_COUNTRIES.join(",")).split(/[,;]/).map((c2) => c2.trim()).filter(Boolean);
253271
+ if (!countries2.length) throw new UsageError9("--countries is a comma-separated list of country names as Play Console lists them");
253272
+ const from = (text22(flags.from) ?? POOL_DEFAULT_FROM).toLowerCase();
253273
+ if (text22(flags.from) && from === track2) throw new UsageError9(`--from ${from} is the pool track itself; name the track the release comes from (default ${POOL_DEFAULT_FROM})`);
253274
+ const appId3 = text22(flags["app-id"]) ?? text22(facts?.appId);
253275
+ if (appId3 && !/^\d{6,25}$/.test(appId3)) throw new UsageError9("--app-id is the number after /app/ in the app's Play Console URL");
253276
+ return {
253277
+ op,
253278
+ ...consentOp ? { consentOp } : {},
253279
+ track: track2,
253280
+ group,
253281
+ packageName,
253282
+ ...developer ? { developer } : {},
253283
+ ready: op === "pool-add" && !groupOnly,
253284
+ countries: countries2,
253285
+ from,
253286
+ ...appId3 ? { appId: appId3 } : {}
253287
+ };
253153
253288
  }
253154
253289
  async function runStoreGoogleTesters(pos, flags, io2, deps = {}) {
253155
253290
  const env = deps.env ?? process.env;
@@ -253222,11 +253357,13 @@ async function consentCommand(p2, io2, ask4, stateDir2, now) {
253222
253357
  track: p2.track,
253223
253358
  grantedAt: at2.toISOString(),
253224
253359
  expiresAt: new Date(at2.getTime() + POOL_CONSENT_DAYS * DAY_MS6).toISOString(),
253225
- osUser: osUser2()
253360
+ osUser: osUser2(),
253361
+ covers: [...POOL_CONSENT_COVERS]
253226
253362
  };
253227
253363
  for (const line of [
253228
253364
  `This records your consent, for ${POOL_CONSENT_DAYS} days (until ${record5.expiresAt.slice(0, 10)}), for himi to add or remove Wix's closed-test pool group ${p2.group}`,
253229
- `on the testers of ${p2.packageName}${developerId ? ` (developer account ${developerId})` : ""} without asking you each time. Every change is still planned, checked and logged as a job.`,
253365
+ `on the testers of ${p2.packageName}${developerId ? ` (developer account ${developerId})` : ""} without asking you each time, and, on pool-add, to add the pool's countries to "${p2.track}",`,
253366
+ `put your newest ${POOL_DEFAULT_FROM} release on it and send the app's changes to Google's review. Every change is still planned, checked and logged as a job.`,
253230
253367
  `Withdraw it any time: himi store google testers consent revoke`
253231
253368
  ]) io2.error(line);
253232
253369
  if ((await ask4(`Type "yes" to agree:`)).trim().toLowerCase() !== "yes") return fail13(io2, "consent_declined", "not confirmed; no consent was recorded", base2);
@@ -253276,71 +253413,169 @@ async function run3(c2) {
253276
253413
  return 0;
253277
253414
  }
253278
253415
  const adding = p2.op === "pool-add";
253279
- if (adding === onTrack) {
253280
- io2.log(JSON.stringify({ ok: true, ...base2, onTrack, changed: false, groups, nothingToDo: `${p2.group} is ${onTrack ? "already" : "not"} on ${p2.track}` }));
253416
+ const groupNeeded = adding !== onTrack;
253417
+ const ready = adding && p2.ready ? await prepareReady(c2, developerId) : void 0;
253418
+ if (!groupNeeded && !ready?.input) {
253419
+ io2.log(JSON.stringify({ ok: true, ...base2, onTrack, changed: false, groups, nothingToDo: `${p2.group} is ${onTrack ? "already" : "not"} on ${p2.track}`, ...ready?.note ? { ready: { skipped: [ready.note] } } : {} }));
253281
253420
  return 0;
253282
253421
  }
253283
253422
  const wanted = adding ? [...groups, p2.group] : groups.filter((g2) => !same5(g2, p2.group));
253284
- if (!wanted.length) {
253423
+ if (groupNeeded && !wanted.length) {
253285
253424
  return fail13(io2, "pool_group_last", `${p2.group} is the only Google Group on ${p2.track}, and Google Play's API cannot set an empty list (it would leave the testers as they are). Remove it by hand: in Google Play Console, open ${p2.packageName} > Test and release > Testing > Closed testing > track "${p2.track}" > Testers, untick or remove ${p2.group} and save. Nothing was changed.`, base2);
253286
253425
  }
253287
253426
  const runner2 = await c2.google.runner(developerId);
253288
253427
  let job;
253289
- try {
253290
- job = await runner2.plan("gplay.closedTest.setup", { packageName: p2.packageName, track: p2.track, groups: wanted }, c2.actor);
253291
- const problem = planProblem(job, [`tracks/${p2.track}`, `testers/${p2.track}`], /^Google's closed-test rule/) ?? (job.plan.changes.some((ch2) => ch2.resource === `tracks/${p2.track}` && ch2.op !== (creating ? "create" : "noop")) ? creating ? `the plan does not create the missing track ${p2.track}` : `the plan also changes the track ${p2.track} itself` : void 0) ?? (JSON.stringify(job.plan.facts?.groups ?? null) !== JSON.stringify([...groups].sort()) ? `the track's groups changed since they were read (${job.plan.facts?.groups?.join(", ") ?? "unknown"})` : void 0);
253292
- if (problem) return fail13(io2, "plan_unexpected", `${problem}; nothing was approved`, { ...base2, jobId: job.id, status: job.status, changes: changesOf2(job) });
253428
+ let readyPlan;
253429
+ let review;
253430
+ let reviewSkipped;
253431
+ const readyRunner = ready?.input ? await c2.google.runner(developerId, { console: true }) : void 0;
253432
+ const readyOut = {};
253433
+ try {
253434
+ if (groupNeeded) {
253435
+ job = await runner2.plan("gplay.closedTest.setup", { packageName: p2.packageName, track: p2.track, groups: wanted }, c2.actor);
253436
+ const problem = planProblem(job, [`tracks/${p2.track}`, `testers/${p2.track}`], /^Google's closed-test rule/) ?? (job.plan.changes.some((ch2) => ch2.resource === `tracks/${p2.track}` && ch2.op !== (creating ? "create" : "noop")) ? creating ? `the plan does not create the missing track ${p2.track}` : `the plan also changes the track ${p2.track} itself` : void 0) ?? (JSON.stringify(job.plan.facts?.groups ?? null) !== JSON.stringify([...groups].sort()) ? `the track's groups changed since they were read (${job.plan.facts?.groups?.join(", ") ?? "unknown"})` : void 0);
253437
+ if (problem) return fail13(io2, "plan_unexpected", `${problem}; nothing was approved`, { ...base2, jobId: job.id, status: job.status, changes: changesOf2(job) });
253438
+ }
253439
+ if (ready?.input && readyRunner) {
253440
+ readyPlan = creating ? void 0 : await planReady(readyRunner, ready.input, ready.view, c2.actor);
253441
+ if (readyPlan) try {
253442
+ const probe2 = await planReview(readyRunner, ready.input, c2.actor);
253443
+ if (readyPlan && !job && !readyPlan.steps.length) review = probe2;
253444
+ } catch (e2) {
253445
+ const why = `${e2.message ?? ""} ${e2.job?.error ?? ""}`;
253446
+ if (!/productionOwnerApprovalId/.test(why)) throw e2;
253447
+ reviewSkipped = `review: sending for review now would also send this app's pending production or beta changes, which pool-add never does; send them yourself in Play Console (Publishing overview), then run pool-add again`;
253448
+ }
253449
+ if (readyPlan && !job && !readyPlan.steps.length && !reviewSkipped) {
253450
+ review ??= await planReview(readyRunner, ready.input, c2.actor);
253451
+ if (isNoop(review)) {
253452
+ io2.log(JSON.stringify({ ok: true, ...base2, onTrack, changed: false, groups, nothingToDo: `${p2.group} is on ${p2.track}, which targets ${ready.input.countries.join(", ")}, carries its release and is in review or published`, ready: { skipped: readyPlan.skipped, review: review.plan.changes.map((ch2) => ch2.summary).join("; ") } }));
253453
+ return 0;
253454
+ }
253455
+ }
253456
+ }
253293
253457
  for (const line of [
253294
- `${adding ? "This adds" : "This removes"} Wix's closed-test pool group ${p2.group} ${adding ? "to" : "from"} the testers of closed track "${p2.track}" on ${p2.packageName} (developer account ${developerId})${creating ? `, creating the custom closed track "${p2.track}"` : ""}:`,
253295
- ...changesOf2(job).map((l3) => ` - ${l3}`),
253296
- adding ? " - Every other group stays. The pool's phones can opt in to the closed test after this." : " - Every other group stays. The pool's phones lose access to the closed test.",
253297
- ` - Job ${job.id}, plan ${job.planHash.slice(0, 8)}.`
253458
+ job ? `${adding ? "This adds" : "This removes"} Wix's closed-test pool group ${p2.group} ${adding ? "to" : "from"} the testers of closed track "${p2.track}" on ${p2.packageName} (developer account ${developerId})${creating ? `, creating the custom closed track "${p2.track}"` : ""}:` : `${p2.group} is already on "${p2.track}" (${p2.packageName}, developer account ${developerId}). This readies the track for the pool's phones:`,
253459
+ ...(job ? changesOf2(job) : []).map((l3) => ` - ${l3}`),
253460
+ ...ready?.input ? (readyPlan ? readyLines(readyPlan, ready.input).slice(0, reviewSkipped ? -1 : void 0) : [`add ${ready.input.countries.join(", ")} to "${p2.track}", put the newest release on ${ready.input.from} onto it, then send the app's changes to Google's review`]).map((l3) => ` - ${l3}`) : [],
253461
+ ...(readyPlan?.skipped ?? []).map((l3) => ` - already done: ${l3}`),
253462
+ ...ready?.note ? [` - not done: ${ready.note}`] : [],
253463
+ ...reviewSkipped ? [` - not done: ${reviewSkipped}`] : [],
253464
+ !job ? " - The track's groups stay as they are." : adding ? " - Every other group stays. The pool's phones can opt in to the closed test after this." : " - Every other group stays. The pool's phones lose access to the closed test.",
253465
+ ...job ? [` - Job ${job.id}, plan ${job.planHash.slice(0, 8)}.`] : []
253298
253466
  ]) io2.error(line);
253299
253467
  if (c2.consent) io2.error(`consent: ${c2.consent.grantedAt} (recorded by ${c2.consent.osUser}, until ${c2.consent.expiresAt}); applying without a prompt`);
253300
- else if (!c2.ask) return fail13(io2, "confirmation_required", "no terminal and no recorded consent: run himi store google testers consent grant in your own terminal", { ...base2, jobId: job.id });
253468
+ else if (!c2.ask) return fail13(io2, "confirmation_required", "no terminal and no recorded consent: run himi store google testers consent grant in your own terminal", { ...base2, ...job ? { jobId: job.id } : {} });
253301
253469
  else {
253302
253470
  const agreed = (await c2.ask(`Type "yes" to agree:`)).trim().toLowerCase() === "yes";
253303
- if (!agreed) return fail13(io2, "consent_declined", "not confirmed; nothing was approved or changed", { ...base2, jobId: job.id });
253471
+ if (!agreed) return fail13(io2, "consent_declined", "not confirmed; nothing was approved or changed", { ...base2, ...job ? { jobId: job.id } : {} });
253304
253472
  }
253305
- const latest = await readGroups(c2, developerId);
253306
- const moved = creating ? latest !== void 0 : !latest || latest.length !== groups.length || !latest.every((g2) => groups.some((o2) => same5(o2, g2)));
253307
- if (moved) {
253308
- return fail13(io2, "groups_changed", `the track's groups changed while you were deciding (now: ${latest?.join(", ") || "none"}); nothing was approved or written. Run the command again.`, { ...base2, jobId: job.id });
253473
+ if (job) {
253474
+ const latest = await readGroups(c2, developerId);
253475
+ const moved = creating ? latest !== void 0 : !latest || latest.length !== groups.length || !latest.every((g2) => groups.some((o2) => same5(o2, g2)));
253476
+ if (moved) {
253477
+ return fail13(io2, "groups_changed", `the track's groups changed while you were deciding (now: ${latest?.join(", ") || "none"}); nothing was approved or written. Run the command again.`, { ...base2, jobId: job.id });
253478
+ }
253479
+ }
253480
+ if (readyPlan && readyRunner) readyOut.applied = await applySteps(readyRunner, readyPlan, c2.person, c2.actor, c2.now);
253481
+ if (job) {
253482
+ if (readyOut.applied) {
253483
+ const latest = await readGroups(c2, developerId);
253484
+ const moved = creating ? latest !== void 0 : !latest || latest.length !== groups.length || !latest.every((g2) => groups.some((o2) => same5(o2, g2)));
253485
+ if (moved) {
253486
+ return fail13(io2, "groups_changed", `the track's groups changed while the countries and release were applied (now: ${latest?.join(", ") || "none"}); those were applied, the pool group was not written. Run the command again.`, { ...base2, jobId: job.id, ...readyOut });
253487
+ }
253488
+ }
253489
+ job = await approveAndApply(runner2, job, c2.person, c2.actor, c2.now);
253309
253490
  }
253310
- job = await approveAndApply(runner2, job, c2.person, c2.actor, c2.now);
253311
253491
  } catch (e2) {
253312
- const failed3 = e2 instanceof JobFailure ? e2.job : e2.job;
253492
+ const failed3 = e2 instanceof JobFailure || e2 instanceof ReadyRefusal ? e2.job : e2.job;
253313
253493
  const upgraded = upgradedRefusal(io2, p2, `${e2.message ?? ""} ${failed3?.error ?? ""}`, { ...base2, ...failed3 ? { jobId: failed3.id, status: failed3.status } : {} });
253314
253494
  if (upgraded !== void 0) return upgraded;
253315
- return fail13(io2, "job_failed", e2.message ?? String(e2), { ...base2, ...failed3 ? { jobId: failed3.id, status: failed3.status, next: `gplay-node jobs show ${failed3.id}` } : {} });
253495
+ return fail13(io2, "job_failed", e2.message ?? String(e2), { ...base2, ...readyOut, ...failed3 ? { jobId: failed3.id, status: failed3.status, next: `gplay-node jobs show ${failed3.id}` } : {} });
253316
253496
  }
253317
- if (job.status !== "verified") {
253497
+ if (job && job.status !== "verified") {
253318
253498
  const upgraded = upgradedRefusal(io2, p2, String(job.error ?? ""), { ...base2, jobId: job.id, status: job.status });
253319
253499
  if (upgraded !== void 0) return upgraded;
253500
+ return fail13(io2, "job_failed", `job ${job.id} is ${job.status}: ${job.error ?? "not read back"}`, { ...base2, ...readyOut, jobId: job.id, status: job.status, next: `gplay-node jobs show ${job.id}` });
253320
253501
  }
253321
- if (job.status !== "verified") return fail13(io2, "job_failed", `job ${job.id} is ${job.status}: ${job.error ?? "not read back"}`, { ...base2, jobId: job.id, status: job.status, next: `gplay-node jobs show ${job.id}` });
253322
253502
  await rememberDeveloper(host.stateDir, p2.packageName, developerId);
253323
253503
  const readBack4 = await readGroups(c2, developerId);
253324
- if (readBack4 === void 0) return fail13(io2, "job_failed", `the job reads ${job.status}, but track ${p2.track} was not found on read-back`, { ...base2, jobId: job.id, status: job.status });
253504
+ if (readBack4 === void 0) return fail13(io2, "job_failed", `the track ${p2.track} was not found on read-back`, { ...base2, ...readyOut, ...job ? { jobId: job.id, status: job.status } : {} });
253325
253505
  const after = readBack4;
253326
253506
  const nowOn = after.some((g2) => same5(g2, p2.group));
253327
- if (nowOn !== adding) return fail13(io2, "job_failed", `the job reads verified, but ${p2.track}'s groups read back as ${after.join(", ") || "none"}`, { ...base2, jobId: job.id, status: job.status });
253507
+ if (nowOn !== adding) return fail13(io2, "job_failed", `${p2.track}'s groups read back as ${after.join(", ") || "none"}`, { ...base2, ...readyOut, ...job ? { jobId: job.id, status: job.status } : {} });
253508
+ if (ready?.input && readyRunner) {
253509
+ try {
253510
+ if (!readyPlan) {
253511
+ readyPlan = await planReady(readyRunner, ready.input, await readReleases(c2, developerId, ready.input.from), c2.actor);
253512
+ readyOut.applied = await applySteps(readyRunner, readyPlan, c2.person, c2.actor, c2.now);
253513
+ }
253514
+ readyOut.skipped = readyPlan.skipped;
253515
+ if (reviewSkipped) readyOut.skipped = [...readyPlan.skipped, reviewSkipped];
253516
+ else {
253517
+ try {
253518
+ readyOut.review = await applyReview(readyRunner, ready.input, c2.person, c2.actor, c2.now, review);
253519
+ } catch (e2) {
253520
+ if (!/productionOwnerApprovalId/.test(`${e2.message ?? ""} ${e2.job?.error ?? ""}`)) throw e2;
253521
+ readyOut.skipped = [...readyPlan.skipped, "review: sending for review now would also send this app's pending production or beta changes, which pool-add never does; send them yourself in Play Console (Publishing overview), then run pool-add again"];
253522
+ }
253523
+ }
253524
+ } catch (e2) {
253525
+ const failed3 = e2 instanceof ReadyRefusal || e2 instanceof JobFailure ? e2.job : e2.job;
253526
+ return fail13(
253527
+ io2,
253528
+ "job_failed",
253529
+ `the pool group is ${adding ? "on" : "off"} the track, but readying it stopped: ${e2.message ?? String(e2)}`,
253530
+ { ...base2, groups: after, ...readyOut, ...failed3 ? { jobId: failed3.id, status: failed3.status, next: `gplay-node jobs show ${failed3.id}` } : {} }
253531
+ );
253532
+ }
253533
+ }
253328
253534
  io2.log(JSON.stringify({
253329
253535
  ok: true,
253330
253536
  ...base2,
253331
- jobId: job.id,
253332
- status: job.status,
253537
+ ...job ? { jobId: job.id, status: job.status, changes: changesOf2(job) } : {},
253333
253538
  onTrack: nowOn,
253334
253539
  changed: true,
253335
253540
  ...creating ? { createdTrack: true } : {},
253336
253541
  groups: after,
253337
- changes: changesOf2(job),
253542
+ ...ready ? { ready: { ...readyOut, ...ready.note ? { skipped: [...readyOut.skipped ?? [], ready.note] } : {} } } : {},
253338
253543
  ...c2.consent ? { consent: c2.consent.grantedAt } : {},
253339
- next: adding ? "tell Wix RelOps the group is on; after the test, run: himi store google testers pool-remove" : "the pool's group is off the track"
253544
+ next: adding ? ready?.input ? "once Google approves the review, the pool's phones can opt in; tell Wix RelOps. After the test, run: himi store google testers pool-remove" : "tell Wix RelOps the group is on; after the test, run: himi store google testers pool-remove" : "the pool's group is off the track"
253340
253545
  }));
253341
253546
  return 0;
253342
253547
  }
253343
- var POOL_GROUP_ENV, POOL_DEFAULT_TRACK, POOL_CONSENT_DAYS, DAY_MS6, UPGRADED_RE, STORE_GOOGLE_TESTERS_USAGE, STORE_GOOGLE_TESTERS_CODES, text22, GROUP_RE, DEVELOPER_RE3, PACKAGE_RE3, NOT_CLOSED, UsageError9, consentPath, same5;
253548
+ async function readReleases(c2, developerId, from) {
253549
+ const host = c2.google.host;
253550
+ const stored = (await host.store.load())?.account;
253551
+ const account2 = { kind: "google", developerId, principal: stored ?? `the gplay-node sign-in (${host.store.id})` };
253552
+ const jobs = await Promise.resolve().then(() => (init_dist2(), dist_exports2));
253553
+ const googleFor = host.googleFor ?? jobs.googleClientsFor({ stateDir: host.stateDir, store: host.store });
253554
+ const clients = await googleFor(account2, { readOnly: true });
253555
+ return clients.api.readEdit(c2.p.packageName, async (edit) => {
253556
+ const tracks = await edit.listTracks();
253557
+ const of2 = (name) => tracks.find((t2) => t2.track === name)?.releases ?? (tracks.some((t2) => t2.track === name) ? [] : void 0);
253558
+ return { from: of2(from), to: of2(c2.p.track) };
253559
+ });
253560
+ }
253561
+ async function prepareReady(c2, developerId) {
253562
+ const { p: p2 } = c2;
253563
+ if (c2.consent && !(c2.consent.covers ?? []).includes("ready")) {
253564
+ return { note: "countries, release and review: your recorded consent covers only the pool group; run himi store google testers consent grant again in your own terminal to cover them" };
253565
+ }
253566
+ let appId3 = p2.appId;
253567
+ if (!appId3) {
253568
+ try {
253569
+ appId3 = (await (await Promise.resolve().then(() => (init_dist(), dist_exports))).readPlanRecord(c2.google.host.stateDir, p2.packageName)).appId;
253570
+ } catch {
253571
+ appId3 = void 0;
253572
+ }
253573
+ }
253574
+ if (!appId3) return { note: `countries, release and review need the app's Play Console id: pass --app-id <the number after /app/ in its Console URL> or set appId in ${GOOGLE_FACTS_FILE}` };
253575
+ const input = { packageName: p2.packageName, track: p2.track, appId: appId3, countries: p2.countries, from: p2.from };
253576
+ return { input, view: await readReleases(c2, developerId, p2.from) };
253577
+ }
253578
+ var POOL_GROUP_ENV, POOL_DEFAULT_TRACK, POOL_COUNTRIES_ENV, POOL_CONSENT_COVERS, POOL_CONSENT_DAYS, DAY_MS6, UPGRADED_RE, STORE_GOOGLE_TESTERS_USAGE, STORE_GOOGLE_TESTERS_CODES, text22, GROUP_RE, DEVELOPER_RE3, PACKAGE_RE3, NOT_CLOSED, UsageError9, consentPath, same5;
253344
253579
  var init_store_google_testers = __esm({
253345
253580
  "src/store-google-testers.ts"() {
253346
253581
  init_define_HHP_CATALOG();
@@ -253348,12 +253583,15 @@ var init_store_google_testers = __esm({
253348
253583
  init_store_host();
253349
253584
  init_store_google_host();
253350
253585
  init_store_relops_google();
253586
+ init_store_google_pool_ready();
253351
253587
  POOL_GROUP_ENV = "HIMI_POOL_TESTER_GROUP";
253352
253588
  POOL_DEFAULT_TRACK = "himi-pool";
253589
+ POOL_COUNTRIES_ENV = "HIMI_POOL_COUNTRIES";
253590
+ POOL_CONSENT_COVERS = ["group", "ready"];
253353
253591
  POOL_CONSENT_DAYS = 90;
253354
253592
  DAY_MS6 = 24 * 60 * 60 * 1e3;
253355
253593
  UPGRADED_RE = /upgraded to use open or closed testing/i;
253356
- STORE_GOOGLE_TESTERS_USAGE = "himi store google testers pool-add|pool-remove|pool-check|consent grant|consent revoke|consent status [--dir <app>] [--track himi-pool] [--android-package <package>] [--developer <id>]";
253594
+ STORE_GOOGLE_TESTERS_USAGE = "himi store google testers pool-add|pool-remove|pool-check|consent grant|consent revoke|consent status [--dir <app>] [--track himi-pool] [--android-package <package>] [--developer <id>] [--app-id <console id>] [--countries <names>] [--from alpha] [--group-only]";
253357
253595
  STORE_GOOGLE_TESTERS_CODES = [
253358
253596
  "invalid_usage",
253359
253597
  "node_too_old",
@@ -269709,7 +269947,8 @@ function generateScreens(input) {
269709
269947
  const empty2 = built === null || Array.isArray(built) && built.length === 0;
269710
269948
  const fallback = FALLBACK_TARGETS[type2];
269711
269949
  const scaffold = input.takenScreenIds;
269712
- const linkable = !fallback?.needsScreen || !scaffold || scaffold.has(fallback.screen);
269950
+ const standIn = fallback && scaffold && !scaffold.has(fallback.screen) ? TEMPLATE_FALLBACKS[fallback.screen] : void 0;
269951
+ const linkable = !fallback?.needsScreen || !scaffold || scaffold.has(fallback.screen) || standIn !== void 0 && scaffold.has(standIn);
269713
269952
  if (empty2 && unmapped.length > reported && fallback && linkable) {
269714
269953
  const reasons = unmapped.splice(reported).map((u2) => u2.reason);
269715
269954
  uses.length = registered;
@@ -269717,10 +269956,11 @@ function generateScreens(input) {
269717
269956
  out2.gaps.length = gapped;
269718
269957
  const sibling = fallback.sibling ? items.find((other) => other !== layoutItemId && arr(obj11(layoutItems[other]).elements).some((e2) => str16(obj11(sections2[str16(obj11(e2).elementId)]).sectionDefinitionId) === fallback.sibling)) : void 0;
269719
269958
  fellBack.add(`${layoutItemId}|${type2}`);
269720
- const target = `${ROUTE_PLACEHOLDER}${sibling ?? ""}|${fallback.screen}|${fallback.sibling ?? ""}`;
269959
+ const screen = standIn !== void 0 && scaffold && !scaffold.has(fallback.screen) ? standIn : fallback.screen;
269960
+ const target = `${ROUTE_PLACEHOLDER}${sibling ?? ""}|${screen}|${fallback.sibling ?? ""}`;
269721
269961
  const values = fallback.params?.(obj11(section3.settings)) ?? {};
269722
269962
  const passed = values.categoryId !== void 0 ? { ...values, categoryActivation: sectionNodeId } : values;
269723
- if (fallback.params) paramLinked.add(fallback.screen);
269963
+ if (fallback.params) paramLinked.add(screen);
269724
269964
  const title = section3.showTitle === false ? "" : str16(section3.title).trim() || label4;
269725
269965
  children2.push(vstack(`${sectionNodeId}.box`, [
269726
269966
  ...title ? [text28(`${sectionNodeId}.title`, title, "title3")] : [],
@@ -270030,6 +270270,10 @@ var init_generate2 = __esm({
270030
270270
  ...max !== void 0 ? [`the source shows at most ${max} group(s) and a "${str16(st2.expandButtonText).trim() || "View All"}" button; himi_groups lists every group`] : []
270031
270271
  ];
270032
270272
  },
270273
+ groups_feed_section: (st2) => {
270274
+ const chosen = arr(st2.groupsToShow).length;
270275
+ return chosen ? [`the source shows the feed of only its ${chosen} chosen group(s); the template screen takes no group selection and shows every group`] : [];
270276
+ },
270033
270277
  faq_list_section: (st2) => {
270034
270278
  const limit = countOf2(obj11(st2.questions).NumberOfFAQs);
270035
270279
  return [
@@ -270074,6 +270318,12 @@ var init_generate2 = __esm({
270074
270318
  // Sections the census found on the most apps with no rule at all: each opens the template screen that shows its data.
270075
270319
  vod_list_section: { screen: "himi_videos", needsScreen: true },
270076
270320
  bookings_agenda_section: { screen: "himi_agenda", needsScreen: true },
270321
+ // A loyalty or members section beside other sections (a form, a title): a page of only these opens the template screen instead.
270322
+ loyalty_status_section: { screen: "himi_loyalty", needsScreen: true },
270323
+ loyalty_offering_section: { screen: "himi_loyalty", needsScreen: true },
270324
+ platform_general_members_section: { screen: "himi_members", needsScreen: true },
270325
+ // `himi_groups_feed` is a newer template screen: a scaffold without it links `himi_groups` (`TEMPLATE_FALLBACKS`), as a page of only this section opens it.
270326
+ groups_feed_section: { screen: "himi_groups_feed", needsScreen: true },
270077
270327
  // Link only when the scaffold has the events screen: without it the link would open nothing, so the section is reported instead.
270078
270328
  events_carousel_section: { sibling: "events_list_section", screen: "himi_events", needsScreen: true }
270079
270329
  };
@@ -270635,9 +270885,13 @@ var init_generate2 = __esm({
270635
270885
  if (st2.isAddressVisible === true && address) children2.push(hstack(`${id}.address`, [node(`${id}.address.icon`, "Icon", { name: "location" }), text28(`${id}.address.text`, address, "body")], 12));
270636
270886
  return children2.length ? vstack(`${id}.box`, children2, 12, inset(16, 16)) : null;
270637
270887
  },
270638
- // The data of these two is a template screen of its own (`TEMPLATE_VERTICALS`): beside other sections the page keeps the source's title and a link to it.
270888
+ // The data of these is a template screen of its own (`TEMPLATE_VERTICALS`): beside other sections the page keeps the source's title and a link to it.
270639
270889
  vod_list_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "vod_list_section", NO_INLINE_SECTION),
270640
270890
  bookings_agenda_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "bookings_agenda_section", NO_INLINE_SECTION),
270891
+ loyalty_status_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "loyalty_status_section", NO_INLINE_SECTION),
270892
+ loyalty_offering_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "loyalty_offering_section", NO_INLINE_SECTION),
270893
+ platform_general_members_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "platform_general_members_section", NO_INLINE_SECTION),
270894
+ groups_feed_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "groups_feed_section", NO_INLINE_SECTION),
270641
270895
  // The events carousel. `filter` is the source's choice of events: 0 every event, 1 by category, "manual" chosen events (read off the 45
270642
270896
  // carousels collected from the top apps). The shared events section has no event or category filter, so a chosen selection is reported and
270643
270897
  // keeps its place as a link; an unfiltered carousel shows the next events as cards, which is the one thing it cannot lay out as a rail.
@@ -280909,6 +281163,7 @@ init_define_HHP_CATALOG();
280909
281163
  var REPEATABLE_FLAGS = /* @__PURE__ */ new Set(["data", "image", "set", "attach"]);
280910
281164
  var BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
280911
281165
  "no-network",
281166
+ "group-only",
280912
281167
  "unpin",
280913
281168
  "browser",
280914
281169
  "no-open",