@wix/himalaya-cli 0.816.0 → 0.817.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 (2) hide show
  1. package/dist/cli.mjs +37 -8
  2. package/package.json +2 -2
package/dist/cli.mjs CHANGED
@@ -25084,7 +25084,6 @@ function shouldRevealError(args) {
25084
25084
  var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE;
25085
25085
  var init_validation = __esm({
25086
25086
  "../../core/ts/src/validation.ts"() {
25087
- "use strict";
25088
25087
  EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
25089
25088
  URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
25090
25089
  INTEGER_RE = /^[+-]?[0-9]+$/;
@@ -28430,7 +28429,6 @@ function validateWorkerSubtree(raw, slotId, policy, actionCatalog) {
28430
28429
  var WORKER_SUBTREE_CEILINGS, ID_PART, ACTION_ID;
28431
28430
  var init_worker_subtree = __esm({
28432
28431
  "../../core/ts/src/worker-subtree.ts"() {
28433
- "use strict";
28434
28432
  init_worker_subtree_safe_types_generated();
28435
28433
  WORKER_SUBTREE_CEILINGS = Object.freeze({
28436
28434
  maxEncodedBytes: 65536,
@@ -54327,6 +54325,13 @@ import { join as join49, resolve as resolve40, basename as basename9, dirname as
54327
54325
  import { fileURLToPath as fileURLToPath21 } from "node:url";
54328
54326
 
54329
54327
  // ../serve-cli/src/client.ts
54328
+ var MAX_PUBLISH_BODY_BYTES = 8 * 1024 * 1024;
54329
+ function publishReleaseBody(payload, meta, draft = false) {
54330
+ return { ...payload, ...meta ?? {}, ...draft ? { draft: true } : {} };
54331
+ }
54332
+ function publishReleaseBodyBytes(payload, meta, draft = false) {
54333
+ return Buffer.byteLength(JSON.stringify(publishReleaseBody(payload, meta, draft)), "utf8");
54334
+ }
54330
54335
  var ServeCliClient = class {
54331
54336
  constructor(target, fetchImpl = fetch) {
54332
54337
  this.target = target;
@@ -54532,7 +54537,7 @@ var ServeCliClient = class {
54532
54537
  /** Publish a built release into the store (POST /v1/admin/release), with optional label/notes/gitSha.
54533
54538
  * `draft: true` stores it fully servable (pinned reads) WITHOUT moving the live release. */
54534
54539
  publishRelease(payload, meta, draft = false) {
54535
- return this.request("control", "POST", "/v1/admin/release", { body: { ...payload, ...meta ?? {}, ...draft ? { draft: true } : {} }, headers: this.ctrlHeaders() });
54540
+ return this.request("control", "POST", "/v1/admin/release", { body: publishReleaseBody(payload, meta, draft), headers: this.ctrlHeaders() });
54536
54541
  }
54537
54542
  /** The app's own source archive for one release (GET /v1/owner/source) — what `himi pull`
54538
54543
  * restores from.
@@ -60381,6 +60386,29 @@ default (no --glyph): ${DEFAULT_GLYPH2} \u2014 a mark that claims nothing, so th
60381
60386
  ...attestation ? { attestation } : {},
60382
60387
  ...forcedPastErrors ? { forcedPastErrors: true } : {}
60383
60388
  };
60389
+ const publishBodyFor = (slug) => ({
60390
+ ...payload,
60391
+ ...appSourceB64 ? { appSource: appSourceB64 } : {},
60392
+ app: slug,
60393
+ manifest: { ...payload.manifest, app: slug }
60394
+ });
60395
+ const publishBodyBytesFor = (slug) => publishReleaseBodyBytes(publishBodyFor(slug), meta, draft);
60396
+ const refuseOversizedBody = (slug, bodyBytes) => {
60397
+ const withoutSource = appSourceB64 ? bodyBytes - appSourceB64.length : bodyBytes;
60398
+ io.error(JSON.stringify({
60399
+ ok: false,
60400
+ app: slug,
60401
+ pushed: false,
60402
+ error: "publish_body_too_large",
60403
+ bodyBytes,
60404
+ limit: MAX_PUBLISH_BODY_BYTES,
60405
+ ...appSourceB64 ? { appSourceBytes: appSourceB64.length } : {},
60406
+ hint: appSourceB64 && withoutSource <= MAX_PUBLISH_BODY_BYTES ? "push with --no-source to publish without the source archive (this release then cannot be restored with `himi pull`), or trim the app's assets and bundles" : "trim the app's assets and bundles \u2014 this release is over the limit even without the source archive, so --no-source would not help"
60407
+ }));
60408
+ return 1;
60409
+ };
60410
+ const composedBodyBytes = publishBodyBytesFor(app);
60411
+ if (composedBodyBytes > MAX_PUBLISH_BODY_BYTES) return refuseOversizedBody(app, composedBodyBytes);
60384
60412
  let autoClaimed = false;
60385
60413
  let adoptedSlug;
60386
60414
  if (flags["no-claim"] !== true) {
@@ -60404,13 +60432,14 @@ default (no --glyph): ${DEFAULT_GLYPH2} \u2014 a mark that claims nothing, so th
60404
60432
  }
60405
60433
  }
60406
60434
  }
60435
+ if (adoptedSlug) {
60436
+ const adoptedBodyBytes = publishBodyBytesFor(app);
60437
+ if (adoptedBodyBytes > MAX_PUBLISH_BODY_BYTES) return refuseOversizedBody(app, adoptedBodyBytes);
60438
+ }
60439
+ const publishPayload = publishBodyFor(app);
60407
60440
  let r;
60408
60441
  try {
60409
- r = await client3().publishRelease(
60410
- { ...payload, ...appSourceB64 ? { appSource: appSourceB64 } : {}, app, manifest: { ...payload.manifest, app } },
60411
- meta,
60412
- draft
60413
- );
60442
+ r = await client3().publishRelease(publishPayload, meta, draft);
60414
60443
  } catch (e) {
60415
60444
  const target = targetName();
60416
60445
  io.error(JSON.stringify({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.816.0",
3
+ "version": "0.817.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": [
@@ -63,5 +63,5 @@
63
63
  "artifactId": "himalaya-cli"
64
64
  }
65
65
  },
66
- "falconPackageHash": "34aa32350d84ef30c9554bc14e8a83ed1ad3564dd645010a87e1aada"
66
+ "falconPackageHash": "3430293fac4a0ff201e5e98c94a4b4b9a36b7579a8ad6b2d225bc424"
67
67
  }