@wix/himalaya-cli 0.1550.0 → 0.1551.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
@@ -2382,6 +2382,8 @@ var init_app_link = __esm({
2382
2382
  // ../../core/serve-control/src/dist-jobs.ts
2383
2383
  var dist_jobs_exports = {};
2384
2384
  __export(dist_jobs_exports, {
2385
+ ANDROID_BUILD_TYPES: () => ANDROID_BUILD_TYPES,
2386
+ ANDROID_BUILD_TYPE_NOT_BUILT: () => ANDROID_BUILD_TYPE_NOT_BUILT,
2385
2387
  ANDROID_FORMATS: () => ANDROID_FORMATS,
2386
2388
  ANDROID_FORMAT_NOT_BUILT: () => ANDROID_FORMAT_NOT_BUILT,
2387
2389
  ANDROID_FORMAT_NOT_REQUESTED: () => ANDROID_FORMAT_NOT_REQUESTED,
@@ -2389,6 +2391,7 @@ __export(dist_jobs_exports, {
2389
2391
  ANDROID_SIGNING_ALIASES: () => ANDROID_SIGNING_ALIASES,
2390
2392
  ANDROID_SIGNING_POLICIES: () => ANDROID_SIGNING_POLICIES,
2391
2393
  CUSTOMER_UPLOAD_LEASE_MS: () => CUSTOMER_UPLOAD_LEASE_MS,
2394
+ DEFAULT_ANDROID_BUILD_TYPE: () => DEFAULT_ANDROID_BUILD_TYPE,
2392
2395
  DEFAULT_ANDROID_FORMAT: () => DEFAULT_ANDROID_FORMAT,
2393
2396
  DEFAULT_ANDROID_SIGNING: () => DEFAULT_ANDROID_SIGNING,
2394
2397
  DEFAULT_BORROWABLE_IOS_IDS: () => DEFAULT_BORROWABLE_IOS_IDS,
@@ -2418,6 +2421,7 @@ __export(dist_jobs_exports, {
2418
2421
  isValidDistAttemptId: () => isValidDistAttemptId,
2419
2422
  nextCustomerUploadClaim: () => nextCustomerUploadClaim,
2420
2423
  nextCustomerUploadSettlement: () => nextCustomerUploadSettlement,
2424
+ resolveAndroidBuildType: () => resolveAndroidBuildType,
2421
2425
  resolveAndroidFormat: () => resolveAndroidFormat,
2422
2426
  resolveAndroidSigning: () => resolveAndroidSigning,
2423
2427
  resolveBorrowedIosId: () => resolveBorrowedIosId,
@@ -2507,7 +2511,7 @@ function isBorrowableIosId(id, allowed2 = DEFAULT_BORROWABLE_IOS_IDS) {
2507
2511
  function resolveBorrowedIosId(opts) {
2508
2512
  const { requested, platform } = opts;
2509
2513
  if (requested === void 0 || requested === null || requested === "") return {};
2510
- if (opts.selfServe || opts.role === "owner") {
2514
+ if (opts.selfServe && !opts.wixStaff || opts.role === "owner") {
2511
2515
  return {
2512
2516
  error: {
2513
2517
  error: "operator_only_borrow_id",
@@ -2586,13 +2590,13 @@ function resolveAndroidSigning(requested) {
2586
2590
  body: {
2587
2591
  error: "invalid_android_signing",
2588
2592
  message: `androidSigning "${requested}" is not a known policy`,
2589
- supported: ["qa-keystore", "wix-keystore", "debug"]
2593
+ supported: [...ANDROID_SIGNING_POLICIES]
2590
2594
  }
2591
2595
  }
2592
2596
  };
2593
2597
  }
2594
2598
  function androidFormatSkewFailed(record3) {
2595
- return record3.platform === "android" && typeof record3.error === "string" && [ANDROID_FORMAT_NOT_BUILT, ANDROID_FORMAT_WRONG_SIGNER, ANDROID_FORMAT_NOT_REQUESTED].some((code) => record3.error.includes(`${code}:`));
2599
+ return record3.platform === "android" && typeof record3.error === "string" && [ANDROID_FORMAT_NOT_BUILT, ANDROID_FORMAT_WRONG_SIGNER, ANDROID_FORMAT_NOT_REQUESTED, ANDROID_BUILD_TYPE_NOT_BUILT].some((code) => record3.error.includes(`${code}:`));
2596
2600
  }
2597
2601
  function resolveAndroidFormat(requested) {
2598
2602
  if (requested === void 0 || requested === null || requested === "") return { format: DEFAULT_ANDROID_FORMAT };
@@ -2610,6 +2614,22 @@ function resolveAndroidFormat(requested) {
2610
2614
  }
2611
2615
  };
2612
2616
  }
2617
+ function resolveAndroidBuildType(requested) {
2618
+ if (requested === void 0 || requested === null || requested === "") return { buildType: DEFAULT_ANDROID_BUILD_TYPE };
2619
+ if (typeof requested === "string" && ANDROID_BUILD_TYPES.includes(requested)) {
2620
+ return { buildType: requested };
2621
+ }
2622
+ return {
2623
+ error: {
2624
+ status: 400,
2625
+ body: {
2626
+ error: "invalid_android_build_type",
2627
+ message: `androidBuildType ${typeof requested === "string" ? `"${requested.slice(0, 40)}"` : `of type ${typeof requested}`} is not a known build type`,
2628
+ supported: [...ANDROID_BUILD_TYPES]
2629
+ }
2630
+ }
2631
+ };
2632
+ }
2613
2633
  function encodeDistParams(env) {
2614
2634
  return Buffer.from(JSON.stringify(env), "utf8").toString("base64url");
2615
2635
  }
@@ -2653,6 +2673,8 @@ function distJobSpec(req) {
2653
2673
  // A Play bundle instead of an APK. Only when asked: the APK default needs no parameter, and a
2654
2674
  // runner that predates the variable ignores it — which the result callback catches.
2655
2675
  ...req.platform === "android" && req.androidFormat === "aab" ? { DIST_ANDROID_FORMAT: "aab" } : {},
2676
+ // A debuggable APK instead of a release one. Only when asked, for the same reason as the format.
2677
+ ...req.platform === "android" && req.androidBuildType === "debug" ? { DIST_ANDROID_BUILD_TYPE: "debug" } : {},
2656
2678
  ...req.previewRoute ? { HIMI_DIST_PREVIEW_ROUTE: req.previewRoute } : {},
2657
2679
  ...req.callbackUrl ? { HIMI_DIST_CALLBACK_URL: req.callbackUrl } : {},
2658
2680
  ...req.callbackToken ? { HIMI_DIST_CALLBACK_TOKEN: req.callbackToken } : {},
@@ -2691,7 +2713,7 @@ function distJobSpec(req) {
2691
2713
  ...req.xcodeVersion ? { xcodeVersion: req.xcodeVersion } : {}
2692
2714
  };
2693
2715
  }
2694
- var IN_FLIGHT, SCOPE_CREATE, SCOPE_READ, SCOPE_CANCEL, DEFAULT_BASE_URL, DEFAULT_OAUTH_URL, TOKEN_TTL_MS, JobServiceError, JobServiceBroker, CUSTOMER_UPLOAD_LEASE_MS, MAX_MEASURABLE_IDENTITY_WINDOW, DIST_SHELLS, DEFAULT_DIST_SHELL, DEFAULT_BORROWABLE_IOS_IDS, BUNDLE_ID_RE, DEFAULT_DIST_SIGNING, WIX_MANAGED_SIGNING_ALIASES, DEFAULT_ANDROID_SIGNING, ANDROID_SIGNING_POLICIES, ANDROID_SIGNING_ALIASES, DEFAULT_ANDROID_FORMAT, ANDROID_FORMATS, ANDROID_FORMAT_NOT_BUILT, ANDROID_FORMAT_WRONG_SIGNER, ANDROID_FORMAT_NOT_REQUESTED, DEFAULT_GIT_URL, DIST_PACKAGE_NAME, DIST_PARAMS_FLAG, MAX_COMMAND_CHARS;
2716
+ var IN_FLIGHT, SCOPE_CREATE, SCOPE_READ, SCOPE_CANCEL, DEFAULT_BASE_URL, DEFAULT_OAUTH_URL, TOKEN_TTL_MS, JobServiceError, JobServiceBroker, CUSTOMER_UPLOAD_LEASE_MS, MAX_MEASURABLE_IDENTITY_WINDOW, DIST_SHELLS, DEFAULT_DIST_SHELL, DEFAULT_BORROWABLE_IOS_IDS, BUNDLE_ID_RE, DEFAULT_DIST_SIGNING, WIX_MANAGED_SIGNING_ALIASES, DEFAULT_ANDROID_SIGNING, ANDROID_SIGNING_POLICIES, ANDROID_SIGNING_ALIASES, DEFAULT_ANDROID_FORMAT, ANDROID_FORMATS, ANDROID_FORMAT_NOT_BUILT, ANDROID_FORMAT_WRONG_SIGNER, ANDROID_FORMAT_NOT_REQUESTED, DEFAULT_ANDROID_BUILD_TYPE, ANDROID_BUILD_TYPES, ANDROID_BUILD_TYPE_NOT_BUILT, DEFAULT_GIT_URL, DIST_PACKAGE_NAME, DIST_PARAMS_FLAG, MAX_COMMAND_CHARS;
2695
2717
  var init_dist_jobs = __esm({
2696
2718
  "../../core/serve-control/src/dist-jobs.ts"() {
2697
2719
  IN_FLIGHT = /* @__PURE__ */ new Set(["CREATED", "QUEUED", "WORKING"]);
@@ -2877,20 +2899,25 @@ var init_dist_jobs = __esm({
2877
2899
  DEFAULT_DIST_SIGNING = "wix-managed";
2878
2900
  WIX_MANAGED_SIGNING_ALIASES = ["wix-managed", "wix", "pool-enterprise"];
2879
2901
  DEFAULT_ANDROID_SIGNING = "qa-keystore";
2880
- ANDROID_SIGNING_POLICIES = ["qa-keystore", "wix-keystore", "debug"];
2902
+ ANDROID_SIGNING_POLICIES = ["qa-keystore", "wix-keystore", "debug", "oneapp-debug"];
2881
2903
  ANDROID_SIGNING_ALIASES = {
2882
2904
  // The canonical spellings, derived so the two lists cannot drift apart.
2883
2905
  ...Object.fromEntries(ANDROID_SIGNING_POLICIES.map((p2) => [p2, p2])),
2884
2906
  qa: "qa-keystore",
2885
2907
  himi: "qa-keystore",
2886
2908
  wix: "wix-keystore",
2887
- oneapp: "wix-keystore"
2909
+ oneapp: "wix-keystore",
2910
+ "one-app-debug": "oneapp-debug",
2911
+ oneappdebug: "oneapp-debug"
2888
2912
  };
2889
2913
  DEFAULT_ANDROID_FORMAT = "apk";
2890
2914
  ANDROID_FORMATS = ["apk", "aab"];
2891
2915
  ANDROID_FORMAT_NOT_BUILT = "android_format_not_built";
2892
2916
  ANDROID_FORMAT_WRONG_SIGNER = "android_format_wrong_signer";
2893
2917
  ANDROID_FORMAT_NOT_REQUESTED = "android_format_not_requested";
2918
+ DEFAULT_ANDROID_BUILD_TYPE = "release";
2919
+ ANDROID_BUILD_TYPES = ["release", "debug"];
2920
+ ANDROID_BUILD_TYPE_NOT_BUILT = "android_build_type_not_built";
2894
2921
  DEFAULT_GIT_URL = "https://github.com/wix-private/himalaya";
2895
2922
  DIST_PACKAGE_NAME = "@himalaya/native-ci";
2896
2923
  DIST_PARAMS_FLAG = "--himi-dist";
@@ -12845,6 +12872,7 @@ function webViewOriginAllowed(url, origins) {
12845
12872
  }
12846
12873
  var init_webview_origin = __esm({
12847
12874
  "../../core/ts/src/webview-origin.ts"() {
12875
+ "use strict";
12848
12876
  }
12849
12877
  });
12850
12878
 
@@ -23587,7 +23615,6 @@ function resolveIdiom(tokens2, ctx = {}) {
23587
23615
  var IDIOM_CONTEXTS, UNSAFE_KEYS;
23588
23616
  var init_idiom = __esm({
23589
23617
  "../../core/ts/src/idiom.ts"() {
23590
- "use strict";
23591
23618
  IDIOM_CONTEXTS = {
23592
23619
  ios: { native: ["ios"] },
23593
23620
  android: { native: ["material"] },
@@ -155,7 +155,9 @@ plane that only exists in a monorepo checkout, so a bare `himi dist` there fails
155
155
  > still gets `403 operator_only_dist` (a credential that may not publish content has no business
156
156
  > spending a Mac pool), and **`--borrow-ios-id` is refused for a self-serve caller** at the
157
157
  > decision itself — a borrowed id displaces whatever owns it on every device the build reaches.
158
- > Self-serve builds sign `wix-managed` instead, minting the app its own id (next section).
158
+ > Self-serve builds sign `wix-managed` instead, minting the app its own id (next section). The one
159
+ > exception is a **Wix staff member** proven by their own Wix credential — see
160
+ > [Wix-staff debug builds](#wix-staff-debug-builds).
159
161
  >
160
162
  > **Two switches, not one.** `/v1/admin/*` is 404'd on a public gateway host unless
161
163
  > `HIMI_PUBLIC_DEV_LOOP` is on — the same curtain self-serve `himi push` already lives behind, so
@@ -933,6 +935,7 @@ himi dist --app <app> --platform android --android-signing debug --target bo
933
935
  | `qa-keystore` *(default)* | **`tools/mobile-dist/himi-qa.keystore`** — committed, non-store, alias `himiQa`, password `123456` | same bytes on every pool machine, so a QA build installs over yesterday's and the cert-derived features have a stable SHA-1 to be registered against |
934
936
  | `wix-keystore` | `~/.signing/oneapp-production.keystore` on the pool machine | the real Wix key — see below |
935
937
  | `debug` | a machine-local `~/.android/debug.keystore`, minted if absent | the old behaviour. QA must uninstall a previous build first |
938
+ | `oneapp-debug` | **the committed `oneAppDebug.keystore`** — the shared One App debug key, alias `oneAppDebug`, store and key password `123456` | byte-identical to the file `wix-private/mobile-apps-engine` and `wix-private/ai-scheduling-assistant` commit, SHA-1 `42:8D:0A:62:86:61:E3:01:34:9E:FA:3E:9F:06:5A:3E:FD:3B:64:97`. The default for an `androidBuildType: "debug"` build. Self-serve: Wix staff only |
936
939
 
937
940
  `wix` / `qa` are accepted short spellings. It is a **separate axis from `--signing`**, which names
938
941
  the *Apple* account, so `--platform ios,android` can take both and each leg gets the one that
@@ -952,6 +955,58 @@ self-serve door refuses it with `403 android_signing_not_allowed` and names `qa-
952
955
  as what remains open. The gate keys on the **self-serve** claim rather than the role, because
953
956
  self-serve mints `role: "publisher"` — the same role internal CI uses.
954
957
 
958
+ ### Wix-staff debug builds
959
+
960
+ AppSmith's **Debug build · Wix only** download (Containers → `POST /v1/admin/dist`) asks for a
961
+ build that only Wix staff may get:
962
+
963
+ | Request field | Value | What it builds |
964
+ |---|---|---|
965
+ | `androidBuildType` | `"debug"` (default `"release"`) | a **debuggable** APK (`:<shell>-app:assembleDebug`; an operator `DIST_ANDROID_TASK` still wins), the way the release manager's `DEV_RELEASE` Android builds are (`assembleDevDebug` in `ai-scheduling-assistant`'s `ci-android.sh`) |
966
+ | `androidSigning` | `"oneapp-debug"` (the default for a debug build) | signed with the shared One App debug key — the key `DEV_RELEASE` builds sign with, alias `oneAppDebug`, key password `123456`, the same as the `development` signingConfig of `mobile-apps-engine` and `ai-scheduling-assistant`. There, gradle signs; here `apksigner` re-signs the gradle output with it, because a named key always outranks the app's own signingConfig |
967
+ | `borrowIosBundleId` | `"ent.wix.admin.dev"` | the iOS build signs under the One App enterprise dev identity: MRE maps the Wix owner app (`AppType.OWNER` = `admin`) dev builds to it (`iosDevReleaseAppNameToBundleIdentifier` in `wix-private/mre`). Still only the `ent.*` allow-list |
968
+
969
+ Every field is validated on every request: an unknown `androidBuildType` is `400
970
+ invalid_android_build_type` (iOS-only included), a debug Play bundle is `400
971
+ android_build_type_requires_apk`, and a debug build with `wix-keystore` is `400
972
+ android_debug_build_wix_keystore` — the Wix production key never goes on a debuggable app.
973
+
974
+ **Who may ask.** An internal (operator, CI, employee) credential may ask for any of them. A
975
+ **self-serve** credential — the site control token Containers holds — gets them only when the
976
+ request also carries the caller's own Wix account token as `Authorization: Bearer …` and that token
977
+ is a Wix staff member's. Proof, both from Wix:
978
+
979
+ 1. Wix accepts the token: the Wix CLI userinfo service answers `200` with a `userId`. A token
980
+ whose payload was edited is refused there (`401`), so its claims are what Wix signed.
981
+ 2. The token's instance claims carry `ws: true` — `wixStaff` in Wix's `TPAInstance`, the same
982
+ rule as catalyst's `RequestContext.isWixStaff` (a verified email on a Wix domain) — and their
983
+ `uid` is the `userId` userinfo returned.
984
+
985
+ Otherwise the request is refused before anything reaches the pool:
986
+
987
+ | Status | `error` / `code` | When |
988
+ |---|---|---|
989
+ | `403` | `internal_debug_staff_only` | no Wix credential, a credential with no staff claim, or one Wix refuses. `reason` says which (`no_credential` / `not_staff` / `credential_refused`), `options` names the fields that need staff |
990
+ | `503` | `internal_debug_staff_check_unavailable` | Wix could not answer; retry |
991
+
992
+ The exception lifts only these refusals. `wix-keystore` stays `403 android_signing_not_allowed` and
993
+ the `ent.*` allow-list still applies (`400 borrow_id_not_allowed`). A job built under it records
994
+ `wixStaff: true`; every Android record echoes `androidBuildType` and `androidSigning`, and an iOS
995
+ one `borrowedIosBundleId`.
996
+
997
+ **The record reports what was built.** The pool reports `androidBuildType` on the result, like
998
+ `androidFormat`. A debug job that comes back as anything else — a release published before this
999
+ field runs a `run-dist` that builds a release APK — is `FAILURE` with
1000
+ `android_build_type_not_built:` and keeps no link, and so is a release job that comes back debug.
1001
+ An older runner also refuses `oneapp-debug` itself, so it fails before gradle.
1002
+
1003
+ **A debug APK talks to the public Himi servers.** A shell's `debug` build type is the developer's
1004
+ emulator build: branded-lite points it at `http://10.0.2.2:8114` and routes Wix calls through a local
1005
+ proxy on the developer's machine. A debug dist build passes `HIMI_DIST_DEBUG_SERVE_BASE_URL` (default
1006
+ `https://www.wixapis.com/himalaya-serve`, the origin a release APK bakes; operator override
1007
+ `DIST_DEBUG_SERVE_BASE_URL`), which branded-lite's debug build type reads in place of the loopback,
1008
+ turning `HIMI_DEV_GATEWAY` off. Other shells' debug builds do not change the serve origin.
1009
+
955
1010
  ### Why the QA key is committed, and what it would take to change
956
1011
 
957
1012
  `tools/mobile-dist/himi-qa.keystore` is a **private key in the repository**, with its password in
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1550.0",
3
+ "version": "0.1551.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": [
@@ -71,5 +71,5 @@
71
71
  "artifactId": "himalaya-cli"
72
72
  }
73
73
  },
74
- "falconPackageHash": "9a87baae6e742bf463b9aca4b2c132475e6cef51f18e15512e545aab"
74
+ "falconPackageHash": "63639ddfe8f10381f8bcdfc3f2380ac6f84f9f6b2a0ea1442760faaa"
75
75
  }