@wix/himalaya-cli 0.1790.0 → 0.1792.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/cli.mjs CHANGED
@@ -4411,6 +4411,7 @@ var init_himi_package = __esm({
4411
4411
  var ICON_VIEW_BOX, ICON_STROKE_WIDTH, ICON_FALLBACK, ICON_CATALOG, ICON_NORMALIZED_INDEX, ICON_NAMES;
4412
4412
  var init_icon_catalog_generated = __esm({
4413
4413
  "../../core/ts/src/icon-catalog.generated.ts"() {
4414
+ "use strict";
4414
4415
  init_define_HHP_CATALOG();
4415
4416
  ICON_VIEW_BOX = 24;
4416
4417
  ICON_STROKE_WIDTH = 2;
@@ -8377,7 +8378,6 @@ function assertExternalUrl(site, value2, where) {
8377
8378
  var WIX_FREE_SITE_HOST_SUFFIXES, SITE_KINDS, SITE_LAYOUTS, SITE_PAGE_TITLES, SITE_TOP_BAR_MAX_ACTIONS, SITE_BUILTIN_NATIVE_SCREENS, SITE_PRIVATE_NATIVE_SCREENS, SITE_SHELL_MAX_TABS, SITE_SCREEN_PREFIX, SITE_PAGE_SCREEN_ID, BASE44_ORIGINS, PAGE_ID, SITE_PAGE_NODE_ID, SITE_SCREEN_FORMS, SITE_NODE_SCREEN_RENDERER, PLACEMENTS, ICONS;
8378
8379
  var init_site_shell = __esm({
8379
8380
  "../../core/ts/src/site-shell.ts"() {
8380
- "use strict";
8381
8381
  init_define_HHP_CATALOG();
8382
8382
  init_himi_package();
8383
8383
  init_icon_catalog_generated();
@@ -249561,7 +249561,7 @@ function federatedTokenNeedsRefresh(token, nowSec) {
249561
249561
  function isStoredLogin(target, token, path2) {
249562
249562
  return !!token && loadStoredLogin(target, path2 ?? defaultTargetsPath()).controlToken === token;
249563
249563
  }
249564
- async function withLock2(path2, deps, fn2) {
249564
+ async function withLock2(path2, deps, fn2, onTimeout) {
249565
249565
  const lock = `${path2}.refresh.lock`;
249566
249566
  const sleep4 = deps.sleep ?? ((ms2) => new Promise((r3) => setTimeout(r3, ms2)));
249567
249567
  const started = Date.now();
@@ -249580,7 +249580,7 @@ async function withLock2(path2, deps, fn2) {
249580
249580
  } catch {
249581
249581
  continue;
249582
249582
  }
249583
- if (Date.now() - started > LOCK_WAIT_MS) break;
249583
+ if (Date.now() - started > (deps.lockWaitMs ?? LOCK_WAIT_MS)) return onTimeout();
249584
249584
  await sleep4(100);
249585
249585
  }
249586
249586
  }
@@ -249642,7 +249642,7 @@ async function refreshStoredLogin(target, opts = {}) {
249642
249642
  return { ok: false, code: "login_expired", error: `the stored login can no longer be renewed (${code2})`, hint: `sign in again: \`himi login --browser --target ${target}\` (or \`himi login --device --target ${target}\`)` };
249643
249643
  }
249644
249644
  return { ok: false, code: "refresh_unavailable", error: `the plane could not refresh the login (${resp.status}${code2 ? ` ${code2}` : ""})`, hint: "retry in a moment; the stored login is unchanged" };
249645
- });
249645
+ }, () => ({ ok: false, code: "refresh_unavailable", error: "another himi process is renewing this login", hint: "retry in a moment; the stored login is unchanged" }));
249646
249646
  }
249647
249647
  var FEDERATED_REFRESH_PATH, EARLY_SEC, LOCK_STALE_MS, LOCK_WAIT_MS;
249648
249648
  var init_login_refresh = __esm({
@@ -253248,6 +253248,11 @@ async function runStoreHandoff(pos, flags, io2, deps = {}) {
253248
253248
  const asked = (text19(flags.scope) ?? "read").split(",").map((s5) => s5.trim()).filter(Boolean);
253249
253249
  const scope3 = handoff ? void 0 : normalizeRelopsScope(platform === "android" ? [...asked, ...RELOPS_ANDROID_SCOPES] : asked);
253250
253250
  if (!handoff && !scope3) throw new UsageError6(`--scope is "read" or "read,submit" (allowed: ${RELOPS_SCOPES.join(", ")}; every scope needs read)`);
253251
+ const poolPackage = text19(flags["pool-package"]);
253252
+ if (flags["pool-package"] !== void 0 && (handoff || platform !== "android")) throw new UsageError6("--pool-package is for `store relops request --platform android`");
253253
+ if (flags["pool-package"] !== void 0 && (!poolPackage || !isAndroidPackageName(poolPackage) || isWixPackageName(poolPackage) || hasStorePackagePrefix(poolPackage))) {
253254
+ throw new UsageError6(`--pool-package needs your own Google Play package: a valid name, outside Wix's namespaces and not ${STORE_PACKAGE_PREFIX}.* (a ${STORE_PACKAGE_PREFIX}.* package is saved with himi store app set)`);
253255
+ }
253251
253256
  const appleAppIds = (text19(flags["apple-app-id"]) ?? "").split(",").map((s5) => s5.trim()).filter(Boolean);
253252
253257
  if (appleAppIds.some((id) => !/^[0-9]{6,20}$/.test(id))) throw new UsageError6("--apple-app-id is the App Store Connect app id (digits)");
253253
253258
  if (!handoff && appleAppIds.length) throw new UsageError6("--apple-app-id is for `store handoff`");
@@ -253265,7 +253270,7 @@ async function runStoreHandoff(pos, flags, io2, deps = {}) {
253265
253270
  session = owner.session;
253266
253271
  }
253267
253272
  const fetchImpl = deps.fetchImpl ?? fetch;
253268
- if (!handoff) return await requestConsent({ app: app2, site, scope: scope3, session, flags, io: io2, deps, fetchImpl });
253273
+ if (!handoff) return await requestConsent({ app: app2, site, scope: scope3, ...poolPackage ? { poolPackage } : {}, session, flags, io: io2, deps, fetchImpl });
253269
253274
  const built = await buildLocalHandoff({ dir, file: file2, appleAppIds, deps, io: io2 });
253270
253275
  if (!built.ok) return fail9(io2, built.code, built.error, built.extra);
253271
253276
  const { bundle, summary: summary2 } = built;
@@ -253348,10 +253353,11 @@ async function requestConsent(o2) {
253348
253353
  const ask4 = o2.deps.ask === void 0 ? process.stdin.isTTY && process.stderr.isTTY ? ttyAsk2() : void 0 : o2.deps.ask ?? void 0;
253349
253354
  if (!ask4) return fail9(io2, "confirmation_required", "this grants Wix Release Operations staff access to the app; confirm at a terminal, or pass --yes", { app: app2, site, scope: scope3 });
253350
253355
  io2.error(`This lets Wix Release Operations staff ${scope3.map((s5) => SCOPE_WORDS[s5]).join(", and ")} \u2014 for app ${app2} on site ${site}.`);
253356
+ if (o2.poolPackage) io2.error(`It also names ${o2.poolPackage}, your own Google Play app, as the one Wix's closed-test pool may test for this app.`);
253351
253357
  const answer = (await ask4(`Type the app id (${app2}) or "yes" to agree:`)).trim();
253352
253358
  if (answer !== app2 && answer.toLowerCase() !== "yes") return fail9(io2, "consent_declined", "not confirmed; nothing was recorded", { app: app2, site });
253353
253359
  }
253354
- const r3 = await recordRelopsConsent({ app: app2, site, scope: scope3, session: o2.session, fetchImpl: o2.fetchImpl });
253360
+ const r3 = await recordRelopsConsent({ app: app2, site, scope: scope3, ...o2.poolPackage ? { poolPackage: o2.poolPackage } : {}, session: o2.session, fetchImpl: o2.fetchImpl });
253355
253361
  if (!r3.ok) return fail9(io2, "consent_failed", r3.error, r3.extra);
253356
253362
  io2.log(JSON.stringify({ ok: true, ...r3.consent }));
253357
253363
  return 0;
@@ -253360,13 +253366,13 @@ async function recordRelopsConsent(o2) {
253360
253366
  const { app: app2, site, scope: scope3 } = o2;
253361
253367
  let r3;
253362
253368
  try {
253363
- r3 = await postPlane(o2.session, RELOPS_CONSENT_PATH, { app: app2, site, scope: scope3 }, o2.fetchImpl);
253369
+ r3 = await postPlane(o2.session, RELOPS_CONSENT_PATH, { app: app2, site, scope: scope3, ...o2.poolPackage ? { poolPackage: o2.poolPackage } : {} }, o2.fetchImpl);
253364
253370
  } catch {
253365
253371
  return { ok: false, error: "could not reach the publishing service; nothing was recorded", extra: { next: "check your network and himi login, then run this again" } };
253366
253372
  }
253367
253373
  if (r3.status !== 201 || typeof r3.body.consentId !== "string") return { ok: false, error: "the publishing service did not record the consent", extra: planeRefusal(r3) };
253368
253374
  const b3 = r3.body;
253369
- return { ok: true, consent: { consentId: b3.consentId, msid: b3.msid ?? site, appId: b3.appId ?? app2, ...typeof b3.accountId === "string" ? { accountId: b3.accountId } : {}, at: b3.at, scope: b3.scope ?? scope3 } };
253375
+ return { ok: true, consent: { consentId: b3.consentId, msid: b3.msid ?? site, appId: b3.appId ?? app2, ...typeof b3.accountId === "string" ? { accountId: b3.accountId } : {}, at: b3.at, scope: b3.scope ?? scope3, ...typeof b3.poolPackage === "string" ? { poolPackage: b3.poolPackage } : {} } };
253370
253376
  }
253371
253377
  var STORE_HANDOFF_USAGE, STORE_HANDOFF_PATH, RELOPS_CONSENT_PATH, STORE_HANDOFF_CODES, text19, SITE_RE5, UsageError6, PARAM_ALLOW, MAX_TEXT3, MAX_LIST, isObj5, clean, num4, def, lc2, postPlane, SCOPE_WORDS;
253372
253378
  var init_store_handoff = __esm({
@@ -253375,7 +253381,8 @@ var init_store_handoff = __esm({
253375
253381
  init_store_handoff_bundle();
253376
253382
  init_store_host();
253377
253383
  init_store_google_host();
253378
- STORE_HANDOFF_USAGE = "himi store handoff [--dir <app>] [--app <id> --site <msid>] [--apple-app-id <id>[,<id>]] [--out <file> | --dry-run] | himi store relops request [--dir <app>] [--app <id> --site <msid>] [--platform ios|android] [--scope read|read,submit] [--yes]";
253384
+ init_containers_builder();
253385
+ STORE_HANDOFF_USAGE = "himi store handoff [--dir <app>] [--app <id> --site <msid>] [--apple-app-id <id>[,<id>]] [--out <file> | --dry-run] | himi store relops request [--dir <app>] [--app <id> --site <msid>] [--platform ios|android [--pool-package <package>]] [--scope read|read,submit] [--yes]";
253379
253386
  STORE_HANDOFF_PATH = "/v1/admin/site/store-handoff";
253380
253387
  RELOPS_CONSENT_PATH = "/v1/admin/site/relops-consent";
253381
253388
  STORE_HANDOFF_CODES = [
@@ -1113,7 +1113,7 @@ these codes. None of them prints a token.
1113
1113
 
1114
1114
  ## `himi store handoff` and `himi store relops request` codes
1115
1115
 
1116
- Both print one JSON envelope: the result on stdout (`ok: true`, with `handoffId` or `consentId`), or a failure on
1116
+ Both print one JSON envelope: the result on stdout (`ok: true`, with `handoffId` or `consentId`, and `poolPackage` when one was named), or a failure on
1117
1117
  stderr with one of these codes. A refusal from the publishing service keeps its own code in `planeCode` and its HTTP
1118
1118
  `status`.
1119
1119
 
@@ -1129,7 +1129,7 @@ stderr with one of these codes. A refusal from the publishing service keeps its
1129
1129
  | `bundle_contains_secret` | Something secret-shaped survived the clean-up, so the bundle was not sent. |
1130
1130
  | `confirmation_required` | `relops request` without a terminal needs `--yes`. Nothing was sent. |
1131
1131
  | `consent_declined` | You did not confirm at the terminal. Nothing was sent. |
1132
- | `handoff_failed` / `consent_failed` | The publishing service refused or could not be reached; `planeCode` and `status` say which. |
1132
+ | `handoff_failed` / `consent_failed` | The publishing service refused or could not be reached; `planeCode` and `status` say which (`invalid_pool_package`: the `--pool-package` name was refused). |
1133
1133
 
1134
1134
  ## `himi store relops request|end --platform android --seat-email` and `himi store google create-app` codes
1135
1135
 
@@ -240,7 +240,12 @@ with no deploy. Add and status need the owner's
240
240
  `play-console` consent under 90 days (403 `relops_consent_required`); **end and teardown need no consent** (they only
241
241
  cancel Himi's own entries, which reduces exposure, so RelOps can always end). Add holds at most `HIMI_POOL_MAX_ACTIVE`
242
242
  (default 5) open entries (429 `store_pool_full`), reserved atomically on the index row before the service is called.
243
- The package is always the Containers app's saved package for the site the app holds.
243
+ The package is never taken from the request: it is the Containers app's saved `himi.*` package for the site the app
244
+ holds, or, for an owner-signed app with none, the `poolPackage` the owner named in their live `play-console` consent
245
+ (`himi store relops request --platform android --pool-package <package>`; 400 `invalid_pool_package` for a Wix-reserved, `himi.*`
246
+ or malformed name, or without `play-console`). The add answers `packageSource: store-app | owner-consent`, the row keeps
247
+ both, and the audit line carries the package. End and the sweep use the row's package; the sweep cancels an
248
+ owner-consent row (`app_unclaimed`) once the owner's live consent no longer names that package.
244
249
 
245
250
  Himi's own table lives in cloudStore (`himi/store-pool/<app>/<msid>` plus the index row `himi/store-pool/index`): package,
246
251
  msid, addedBy, addedAt, deadline (addedAt + 21 days), state `adding | active | ending | archived | stuck | failed`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1790.0",
3
+ "version": "0.1792.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": "e8a4d3bab63362f012425bda486538eb97562e07690370fa1c1aa1d6"
85
+ "falconPackageHash": "347ef286dea7a0178e8043e6e914b1b59bdd9b318784260ebaf9e066"
86
86
  }