@wix/himalaya-cli 0.1003.0 → 0.1005.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.
@@ -263,8 +263,22 @@ export interface WixBookSlotOptions {
263
263
  * for an OFFLINE booking, so do not read one as "charge now" and send a
264
264
  * pay-in-person customer into the cashier.
265
265
  *
266
- * Wix documents `selectedPaymentOption` as REQUIRED whenever the booking is paid
267
- * through an eCommerce checkout, and it must be an option the service offers.
266
+ * Wix's Create Booking reference says to specify `selectedPaymentOption` when the
267
+ * customer pays through a Wix eCommerce checkout, and that the call fails
268
+ * otherwise. That failure has not been observed. The member paid flow in the
269
+ * `himi-booking-time` worker calls `bookSlot` with no option and then checks
270
+ * out, and a live run of it created the booking, the checkout and the order.
271
+ * That run never completed payment, though, so whether a booking made without
272
+ * an option confirms once its order is paid is still unverified, and Wix does
273
+ * not document what an omitted option defaults to. Pass it when you know how
274
+ * the customer means to pay.
275
+ *
276
+ * Any value you pass must be one the service offers. Wix exposes that on the
277
+ * Services V2 service as `payment.options` (booleans `online`, `inPerson`,
278
+ * `deposit`, `pricingPlan`). The `WixService` type here does not declare it
279
+ * yet, so read it from the service response with a cast.
280
+ * Do not hard-code `ONLINE`: a service can be set up for in-person payment
281
+ * only, and then `ONLINE` is not one of its options.
268
282
  * Leave `options` out and the request is the one this function always sent. */
269
283
  export declare function bookSlot(slot: WixBookingSlotFull, firstName: string, lastName: string, email: string, options?: WixBookSlotOptions): Promise<WixCreateBookingResponse>;
270
284
  export interface WixBookingAdditionalField {
package/dist/cli.mjs CHANGED
@@ -5318,6 +5318,7 @@ function walk(node, registry, path2, out) {
5318
5318
  var SYSTEM_FONT_FAMILY;
5319
5319
  var init_tokens = __esm({
5320
5320
  "../../core/ts/src/tokens.ts"() {
5321
+ "use strict";
5321
5322
  SYSTEM_FONT_FAMILY = "$system";
5322
5323
  }
5323
5324
  });
@@ -12399,6 +12400,11 @@ function springStep(response, zeta) {
12399
12400
  const r1 = -w0 * (zeta - root), r2 = -w0 * (zeta + root);
12400
12401
  return (t) => 1 - (r2 * Math.exp(r1 * t) - r1 * Math.exp(r2 * t)) / (r2 - r1);
12401
12402
  }
12403
+ function springEnvelope(response, zeta, x) {
12404
+ if (zeta >= 1) return (t) => Math.abs(1 - x(t));
12405
+ const decay = zeta * 2 * Math.PI / response, peak = 1 / Math.sqrt(1 - zeta * zeta);
12406
+ return (t) => peak * Math.exp(-decay * t);
12407
+ }
12402
12408
  function springCurve(spring, durationMs) {
12403
12409
  const { response, dampingFraction: zeta } = normalizeSpring(spring, durationMs);
12404
12410
  const key2 = `${response}|${zeta}`;
@@ -12406,8 +12412,9 @@ function springCurve(spring, durationMs) {
12406
12412
  if (cached3) return cached3;
12407
12413
  const x = springStep(response, zeta);
12408
12414
  const step = response / 64;
12415
+ const envelope = springEnvelope(response, zeta, x);
12409
12416
  let settle = 0;
12410
- for (let t = 0; t <= SPRING_MAX_SECS; t += step) if (Math.abs(1 - x(t)) > SPRING_SETTLE_TOLERANCE) settle = t;
12417
+ for (let t = 0; t <= SPRING_MAX_SECS && envelope(t) > SPRING_SETTLE_TOLERANCE; t += step) if (Math.abs(1 - x(t)) > SPRING_SETTLE_TOLERANCE) settle = t;
12411
12418
  const secs = Math.min(settle + step, SPRING_MAX_SECS);
12412
12419
  const samples = Math.min(200, Math.max(24, Math.ceil(12 * secs / response)));
12413
12420
  const points = [];
@@ -12686,7 +12693,7 @@ var init_tokens2 = __esm({
12686
12693
  clampTo = (v, lo, hi) => Math.min(hi, Math.max(lo, v));
12687
12694
  finite = (v) => typeof v === "number" && Number.isFinite(v) ? v : void 0;
12688
12695
  SPRING_SETTLE_TOLERANCE = 1e-3;
12689
- SPRING_MAX_SECS = 10;
12696
+ SPRING_MAX_SECS = 120;
12690
12697
  springCurves = /* @__PURE__ */ new Map();
12691
12698
  WEB_IDIOM_CONTEXT = { surface: "desktop" };
12692
12699
  }
@@ -41107,6 +41114,15 @@ var init_mobile_ux_lint = __esm({
41107
41114
  }
41108
41115
  });
41109
41116
 
41117
+ // ../../core/serve-runtime/src/site-lease.ts
41118
+ var SITE_CONTROL_TTL_SECONDS, SITE_AUTHORIZATION_TTL_SECONDS;
41119
+ var init_site_lease = __esm({
41120
+ "../../core/serve-runtime/src/site-lease.ts"() {
41121
+ SITE_CONTROL_TTL_SECONDS = 15 * 60;
41122
+ SITE_AUTHORIZATION_TTL_SECONDS = SITE_CONTROL_TTL_SECONDS + 45 * 60;
41123
+ }
41124
+ });
41125
+
41110
41126
  // ../../core/serve-runtime/src/preview-token.ts
41111
41127
  async function hmacKey(secret) {
41112
41128
  return crypto.subtle.importKey("raw", new TextEncoder().encode(secret), SUBTLE_ALGO, false, ["sign"]);
@@ -41147,6 +41163,7 @@ async function verifyPreviewToken(input) {
41147
41163
  var SUBTLE_ALGO, PREVIEW_TOKEN_VERSION, DEFAULT_PREVIEW_TOKEN_TTL_SECONDS, WEB_PREVIEW_TOKEN_TTL_SECONDS;
41148
41164
  var init_preview_token = __esm({
41149
41165
  "../../core/serve-runtime/src/preview-token.ts"() {
41166
+ init_site_lease();
41150
41167
  init_base64();
41151
41168
  SUBTLE_ALGO = { name: "HMAC", hash: "SHA-256" };
41152
41169
  PREVIEW_TOKEN_VERSION = 1;
@@ -42496,6 +42513,7 @@ function makeFunctionsHandler(options) {
42496
42513
  const token = request.headers.get("x-himalaya-preview-token") || new URL(request.url).searchParams.get("pvt");
42497
42514
  const verified = token ? await verifyPreviewToken({ token, secret: options.previewTokenSecret, app: target.app, releaseId: pin, nowSeconds: options.nowSeconds }) : { ok: false, error: "malformed" };
42498
42515
  if (!verified.ok || verified.claims.source !== "functions") return errorResponse(401, `preview_token_${verified.ok ? "scope_mismatch" : verified.error}`, "a valid function preview token is required", id);
42516
+ if (options.authorizePreview ? !await options.authorizePreview(verified.claims) : !!verified.claims.siteLease) return errorResponse(403, "site_preview_forbidden", "site authorization expired or changed", id);
42499
42517
  previewClaims = verified.claims;
42500
42518
  }
42501
42519
  if (pin) selected = options.store.getManifestById ? await options.store.getManifestById(target.app, pin) : null;
@@ -44242,13 +44260,16 @@ ${releaseId}`;
44242
44260
  }
44243
44261
  async function authorizePinnedRead(request, url, app, releaseId, screenId) {
44244
44262
  const secret = opts.previewTokenSecret;
44245
- if (!secret) return null;
44263
+ if (!secret) return opts.authorizePreview ? json3(503, { error: "preview_token_unavailable" }) : null;
44246
44264
  const token = resolvePreviewToken(request, url);
44247
44265
  const live2 = await manifest(app);
44248
44266
  const isLive = live2?.releaseId === releaseId;
44249
44267
  if (!token) return isLive ? null : json3(401, { error: "preview_token_required", app, releaseId });
44250
44268
  const verified = await verifyPreviewToken({ token, secret, app, releaseId, screenId });
44251
- if (verified.ok) return null;
44269
+ if (verified.ok) {
44270
+ if (opts.authorizePreview ? !await opts.authorizePreview(verified.claims) : !!verified.claims.siteLease) return json3(403, { error: "site_preview_forbidden" });
44271
+ return null;
44272
+ }
44252
44273
  return json3(verified.error === "scope_mismatch" ? 403 : 401, {
44253
44274
  error: `preview_token_${verified.error}`,
44254
44275
  app,
@@ -44681,7 +44702,8 @@ ${releaseId}`;
44681
44702
  templates.sort((a, b) => String(a.name).localeCompare(String(b.name)));
44682
44703
  return json3(200, { templates });
44683
44704
  }
44684
- const app = resolveApp(request, url);
44705
+ const cfgMatch = /^\/v1\/app-config\/([^/]+)$/.exec(path2);
44706
+ const app = cfgMatch?.[1] ?? resolveApp(request, url);
44685
44707
  const pin = resolvePin(request, url);
44686
44708
  if (path2 === "/v1/template-source") {
44687
44709
  if (!app) return json3(400, { error: "missing_app" });
@@ -44919,7 +44941,6 @@ ${releaseId}`;
44919
44941
  }));
44920
44942
  return json3(200, { handlers });
44921
44943
  }
44922
- const cfgMatch = /^\/v1\/app-config\/([^/]+)$/.exec(path2);
44923
44944
  if (cfgMatch) {
44924
44945
  const cfgApp = cfgMatch[1];
44925
44946
  if (pin) {
@@ -45008,7 +45029,12 @@ ${releaseId}`;
45008
45029
  if (request.method === "OPTIONS") {
45009
45030
  return new Response(null, { status: 204, headers: { ...corsHeaders(request), "content-length": "0" } });
45010
45031
  }
45011
- return withCors(request, await handle(request));
45032
+ const response = await handle(request);
45033
+ if (resolvePreviewToken(request, new URL(request.url))) {
45034
+ response.headers.set("cache-control", "private, no-store");
45035
+ response.headers.set("vary", "x-himalaya-preview-token, x-himalaya-release");
45036
+ }
45037
+ return withCors(request, response);
45012
45038
  };
45013
45039
  }
45014
45040
  var JSON_CT;
@@ -45334,19 +45360,19 @@ var init_preview_assets_generated = __esm({
45334
45360
  "../../packages/serve/src/preview-assets.generated.ts"() {
45335
45361
  init_preview_assets_format();
45336
45362
  PREVIEW_ASSET_MANIFEST = [
45337
- { key: "assets/index-H72XVDeZ.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 1009153, sha256: "494ebf398dfe5604666d1699bc6209b584a78a6a85d33a55553eca57124fe04c" },
45338
- { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 1009161, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
45339
- { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 1100085, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
45340
- { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 1191069, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
45341
- { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 1282049, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
45342
- { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 1372921, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
45343
- { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 1463901, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
45344
- { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 1572537, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
45345
- { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 1681621, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
45346
- { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 1790669, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
45347
- { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 1898369, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
45348
- { key: "index.html", contentType: "text/html; charset=utf-8", offset: 1986477, length: 4448, sha256: "375c26618baf6332437220049558fe0694b614fa92018d237a5c5c22ee5b3bde" },
45349
- { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 1990925, length: 17209, sha256: "dffc9718e2faa63ae2cc919e0a842f585ed565aaaa7c53778e90379442c731b6" }
45363
+ { key: "assets/index-vRMb0Dqk.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 1009302, sha256: "3eabff510509e865ab7d3b6e7ac347d36ba9b8a44183d65d67d980efb85a42c5" },
45364
+ { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 1009310, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
45365
+ { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 1100234, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
45366
+ { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 1191218, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
45367
+ { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 1282198, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
45368
+ { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 1373070, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
45369
+ { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 1464050, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
45370
+ { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 1572686, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
45371
+ { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 1681770, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
45372
+ { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 1790818, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
45373
+ { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 1898518, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
45374
+ { key: "index.html", contentType: "text/html; charset=utf-8", offset: 1986626, length: 4448, sha256: "70f18366fc27e810bac91bc54dfc247f27c071fb6f0442b07af48bdb7efabb8e" },
45375
+ { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 1991074, length: 17209, sha256: "dffc9718e2faa63ae2cc919e0a842f585ed565aaaa7c53778e90379442c731b6" }
45350
45376
  ];
45351
45377
  }
45352
45378
  });
@@ -56859,7 +56885,7 @@ var init_context = __esm({
56859
56885
 
56860
56886
  // src/cli.ts
56861
56887
  import { mkdtempSync as mkdtempSync4, readFileSync as readFileSync67, mkdirSync as mkdirSync27, writeFileSync as writeFileSync25, existsSync as existsSync56, rmSync as rmSync10, readdirSync as readdirSync25, statSync as statSync13, lstatSync as lstatSync6, accessSync, constants } from "node:fs";
56862
- import { execFileSync as execFileSync7, spawnSync as spawnSync5, spawn as spawn5 } from "node:child_process";
56888
+ import { execFile as execFile4, execFileSync as execFileSync7, spawnSync as spawnSync5, spawn as spawn5 } from "node:child_process";
56863
56889
  import { createHash as createHash24, randomUUID as randomUUID3 } from "node:crypto";
56864
56890
  import { tmpdir as tmpdir5, homedir as homedir7, hostname } from "node:os";
56865
56891
  import { join as join52, resolve as resolve44, relative as relative8, basename as basename12, dirname as dirname31 } from "node:path";
@@ -60813,30 +60839,48 @@ function trustedConfiguredRegistry(env) {
60813
60839
  const configured = normalizeRegistry(env.npm_config_registry ?? env.NPM_CONFIG_REGISTRY);
60814
60840
  return isTrustedRegistry(configured) ? configured : void 0;
60815
60841
  }
60816
- function createScopedRegistryResolver(exec = execFileSync7) {
60842
+ function createScopedRegistryResolver(exec = execNpmConfig) {
60817
60843
  let resolved2;
60818
- return () => {
60844
+ return async (budgetMs = SCOPED_REGISTRY_TIMEOUT_MS) => {
60819
60845
  if (resolved2) return resolved2.value;
60820
- let value;
60846
+ const deadline = Date.now() + Math.min(budgetMs, SCOPED_REGISTRY_TIMEOUT_MS);
60821
60847
  try {
60822
- const configured = (key2) => {
60823
- const raw = exec("npm", ["config", "get", key2], {
60824
- cwd: homedir7(),
60825
- timeout: 5e3,
60826
- stdio: ["ignore", "pipe", "ignore"]
60827
- }).toString().trim();
60848
+ const configured = async (key2) => {
60849
+ const timeout = deadline - Date.now();
60850
+ if (timeout <= 0) throw new Error("npm config: out of budget");
60851
+ const raw = String(await exec("npm", ["config", "get", key2], { cwd: homedir7(), timeout })).trim();
60828
60852
  return raw && raw !== "undefined" ? raw : void 0;
60829
60853
  };
60830
- const effective = normalizeRegistry(configured("@wix:registry") ?? configured("registry"));
60831
- value = isTrustedRegistry(effective) ? effective : void 0;
60854
+ const effective = normalizeRegistry(await configured("@wix:registry") ?? await configured("registry"));
60855
+ resolved2 = { value: isTrustedRegistry(effective) ? effective : void 0 };
60856
+ return resolved2.value;
60832
60857
  } catch {
60833
- value = void 0;
60858
+ return void 0;
60834
60859
  }
60835
- resolved2 = { value };
60836
- return value;
60837
60860
  };
60838
60861
  }
60862
+ var SCOPED_REGISTRY_TIMEOUT_MS = 5e3;
60863
+ function execNpmConfig(file, args, options) {
60864
+ return new Promise((resolve45, reject) => {
60865
+ execFile4(file, args, { ...options, windowsHide: true }, (error, stdout) => error ? reject(error) : resolve45(String(stdout)));
60866
+ });
60867
+ }
60839
60868
  var npmScopedWixRegistry = createScopedRegistryResolver();
60869
+ async function scopedRegistryBefore(lookup2, deadline) {
60870
+ let cancel = () => {
60871
+ };
60872
+ const expired = new Promise((resolve45) => {
60873
+ const timer = setTimeout(() => resolve45(void 0), Math.max(0, deadline - Date.now()));
60874
+ cancel = () => clearTimeout(timer);
60875
+ });
60876
+ try {
60877
+ return await Promise.race([Promise.resolve().then(() => lookup2(Math.max(0, deadline - Date.now()))), expired]);
60878
+ } catch {
60879
+ return void 0;
60880
+ } finally {
60881
+ cancel();
60882
+ }
60883
+ }
60840
60884
  function registryCandidates(env, scoped) {
60841
60885
  const ordered = [isTrustedRegistry(scoped) ? normalizeRegistry(scoped) : void 0, trustedConfiguredRegistry(env), PUBLIC_NPM_REGISTRY];
60842
60886
  return [...new Set(ordered.filter((r) => r !== void 0))];
@@ -60863,7 +60907,8 @@ async function fetchPackumentFrom(registry, fetchImpl, timeoutMs) {
60863
60907
  }
60864
60908
  async function fetchCliPackument(fetchImpl = fetch, timeoutMs = DOCTOR_TIMEOUT_MS, env = process.env, scopedRegistry = npmScopedWixRegistry) {
60865
60909
  const deadline = Date.now() + timeoutMs;
60866
- for (const registry of registryCandidates(env, scopedRegistry())) {
60910
+ const scoped = await scopedRegistryBefore(scopedRegistry, deadline);
60911
+ for (const registry of registryCandidates(env, scoped)) {
60867
60912
  const remaining = deadline - Date.now();
60868
60913
  if (remaining <= 0) break;
60869
60914
  const packument = await fetchPackumentFrom(registry, fetchImpl, remaining);
@@ -61161,8 +61206,10 @@ async function refreshUpdateCache(opts = {}) {
61161
61206
  const packument = await fetchCliPackument(opts.fetchImpl ?? fetch, UPDATE_BACKGROUND_BUDGET_MS, env, opts.scopedRegistry);
61162
61207
  if (!packument) return false;
61163
61208
  const now = opts.now ?? Date.now();
61209
+ const current = readUpdateCache(cachePath);
61210
+ if (supersededInCache(current, packument.latest, now)) return true;
61164
61211
  writeUpdateCache(cachePath, {
61165
- ...readUpdateCache(cachePath),
61212
+ ...current,
61166
61213
  running,
61167
61214
  latest: packument.latest,
61168
61215
  runningPublishedAt: packument.time[running],
@@ -61170,6 +61217,11 @@ async function refreshUpdateCache(opts = {}) {
61170
61217
  });
61171
61218
  return true;
61172
61219
  }
61220
+ function supersededInCache(current, latest, now) {
61221
+ if (!current.latest || !latest || compareVersions2(latest, current.latest) >= 0) return false;
61222
+ const checkedAt = current.checkedAt ? Date.parse(current.checkedAt) : Number.NaN;
61223
+ return Number.isFinite(checkedAt) && now - checkedAt < UPDATE_CHECK_INTERVAL_MS;
61224
+ }
61173
61225
  function createUpdateRefreshSpawner(spawnFn = spawn5, execArgv = process.execArgv) {
61174
61226
  return () => {
61175
61227
  try {
@@ -65990,7 +66042,7 @@ default (no --glyph): ${DEFAULT_GLYPH2} \u2014 a mark that claims nothing, so th
65990
66042
  const { iosProjectYml: iosYmlPath, hasRepoCheckout: hasRepoCheckout2 } = await Promise.resolve().then(() => (init_paths(), paths_exports));
65991
66043
  const { ascStatus: ascStatus2 } = await Promise.resolve().then(() => (init_asc_status(), asc_status_exports));
65992
66044
  const { readFileSync: rf, readdirSync: rd, existsSync: ex, statSync: st } = await import("node:fs");
65993
- const { execFile: execFile4 } = await import("node:child_process");
66045
+ const { execFile: execFile5 } = await import("node:child_process");
65994
66046
  const { homedir: hd } = await import("node:os");
65995
66047
  const { join: pj, dirname: pd } = await import("node:path");
65996
66048
  const { fileURLToPath: f2p } = await import("node:url");
@@ -66005,7 +66057,7 @@ default (no --glyph): ${DEFAULT_GLYPH2} \u2014 a mark that claims nothing, so th
66005
66057
  return ipas[0];
66006
66058
  };
66007
66059
  const sh = (cmd, args, opts) => new Promise((res) => {
66008
- const child = execFile4(
66060
+ const child = execFile5(
66009
66061
  cmd,
66010
66062
  args,
66011
66063
  { cwd: opts.cwd, env: { ...process.env, ...opts.env }, maxBuffer: 64 * 1024 * 1024 },
@@ -66776,7 +66828,7 @@ ${label2}`);
66776
66828
  try {
66777
66829
  const scoped = up.scopedRegistry ?? npmScopedWixRegistry;
66778
66830
  const answered = await fetchCliPackument(up.fetchImpl ?? fetch, UPDATE_EXPLICIT_BUDGET_MS, env, scoped);
66779
- const registry = answered?.registry ?? registryCandidates(env, scoped())[0];
66831
+ const registry = answered?.registry ?? registryCandidates(env, await scoped(UPDATE_EXPLICIT_BUDGET_MS))[0];
66780
66832
  if (answered?.latest && compareVersions2(answered.latest, before) <= 0) {
66781
66833
  if (flags.json) print({ ok: true, running: before, installed: before, changed: false, registry, latest: answered.latest });
66782
66834
  else io.log(`himi ${before} (unchanged \u2014 ${registry} has nothing newer; its latest is ${answered.latest})`);
Binary file
@@ -7311,7 +7311,7 @@
7311
7311
  {
7312
7312
  "name": "bookSlot",
7313
7313
  "kind": "function",
7314
- "jsdoc": "/** Book a specific availability slot — POST /bookings/v2/bookings. Pass the FULL\n * slot from queryServiceAvailability + the booker's contact. The v1 createBooking\n * above rejects a bare slot; the v2 route with bookedEntity.slot is the one that\n * works. Verified live (status CREATED).\n *\n * A visitor booking a PAID service to pay in person (no on-device payment) is a\n * three-call chain:\n *\n * 1. `bookSlot(slot, first, last, email, { selectedPaymentOption: \"OFFLINE\" })`\n * → the booking, status CREATED.\n * 2. `createCheckout([{ quantity: 1, catalogReference: { appId: <Wix Bookings\n * appDefId 13d21c63-b5ec-5912-8397-c3a5ddb27a97>, catalogItemId: booking.id } }])`\n * from `@himalaya/wix-ecom` → the checkout id.\n * 3. `createOrder(checkoutId)` from `@himalaya/wix-ecom` → the order, with the\n * balance left for the venue to collect.\n *\n * This chain was verified with raw Wix calls, not through these wrappers.\n * It is not verified whether `createOrder` still returns a `paymentGatewayOrderId`\n * for an OFFLINE booking, so do not read one as \"charge now\" and send a\n * pay-in-person customer into the cashier.\n *\n * Wix documents `selectedPaymentOption` as REQUIRED whenever the booking is paid\n * through an eCommerce checkout, and it must be an option the service offers.\n * Leave `options` out and the request is the one this function always sent. */",
7314
+ "jsdoc": "/** Book a specific availability slot — POST /bookings/v2/bookings. Pass the FULL\n * slot from queryServiceAvailability + the booker's contact. The v1 createBooking\n * above rejects a bare slot; the v2 route with bookedEntity.slot is the one that\n * works. Verified live (status CREATED).\n *\n * A visitor booking a PAID service to pay in person (no on-device payment) is a\n * three-call chain:\n *\n * 1. `bookSlot(slot, first, last, email, { selectedPaymentOption: \"OFFLINE\" })`\n * → the booking, status CREATED.\n * 2. `createCheckout([{ quantity: 1, catalogReference: { appId: <Wix Bookings\n * appDefId 13d21c63-b5ec-5912-8397-c3a5ddb27a97>, catalogItemId: booking.id } }])`\n * from `@himalaya/wix-ecom` → the checkout id.\n * 3. `createOrder(checkoutId)` from `@himalaya/wix-ecom` → the order, with the\n * balance left for the venue to collect.\n *\n * This chain was verified with raw Wix calls, not through these wrappers.\n * It is not verified whether `createOrder` still returns a `paymentGatewayOrderId`\n * for an OFFLINE booking, so do not read one as \"charge now\" and send a\n * pay-in-person customer into the cashier.\n *\n * Wix's Create Booking reference says to specify `selectedPaymentOption` when the\n * customer pays through a Wix eCommerce checkout, and that the call fails\n * otherwise. That failure has not been observed. The member paid flow in the\n * `himi-booking-time` worker calls `bookSlot` with no option and then checks\n * out, and a live run of it created the booking, the checkout and the order.\n * That run never completed payment, though, so whether a booking made without\n * an option confirms once its order is paid is still unverified, and Wix does\n * not document what an omitted option defaults to. Pass it when you know how\n * the customer means to pay.\n *\n * Any value you pass must be one the service offers. Wix exposes that on the\n * Services V2 service as `payment.options` (booleans `online`, `inPerson`,\n * `deposit`, `pricingPlan`). The `WixService` type here does not declare it\n * yet, so read it from the service response with a cast.\n * Do not hard-code `ONLINE`: a service can be set up for in-person payment\n * only, and then `ONLINE` is not one of its options.\n * Leave `options` out and the request is the one this function always sent. */",
7315
7315
  "decl": "export function bookSlot(\n slot: WixBookingSlotFull,\n firstName: string,\n lastName: string,\n email: string,\n options?: WixBookSlotOptions,\n): Promise<WixCreateBookingResponse>;",
7316
7316
  "http": "POST /bookings/v2/bookings"
7317
7317
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1003.0",
3
+ "version": "0.1005.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": [
@@ -65,5 +65,5 @@
65
65
  "artifactId": "himalaya-cli"
66
66
  }
67
67
  },
68
- "falconPackageHash": "7d08a874d8457e2d68a6d9861b88e3002a6892614e9554b006e2f8da"
68
+ "falconPackageHash": "bbc5500979643dbfcf57fbe15a73b4981e2f2e6b4a09e1e3549f5f3f"
69
69
  }