@wix/himalaya-cli 0.1861.0 → 0.1863.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 +201 -73
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -407,7 +407,9 @@ var init_client = __esm({
|
|
|
407
407
|
method: target.method ?? "PUT",
|
|
408
408
|
headers: { ...headers2, ...viaControl ? this.ctrlHeaders() : {} },
|
|
409
409
|
...viaControl ? { redirect: "error" } : {},
|
|
410
|
-
|
|
410
|
+
// A metered release store asks for the bytes base64 inside JSON: the deployed host passes
|
|
411
|
+
// no binary body through (serve-control LARGE_ASSET_JSON_ENCODING).
|
|
412
|
+
body: target.encoding === "base64-json" ? JSON.stringify({ base64: Buffer.from(bytes2.buffer, bytes2.byteOffset, bytes2.byteLength).toString("base64") }) : bytes2
|
|
411
413
|
});
|
|
412
414
|
return { ok: res.ok, status: res.status, text: await res.text().catch(() => "") };
|
|
413
415
|
}
|
|
@@ -11308,6 +11310,100 @@ var init_css = __esm({
|
|
|
11308
11310
|
}
|
|
11309
11311
|
});
|
|
11310
11312
|
|
|
11313
|
+
// ../html-to-t5/src/v2/nano-actions.ts
|
|
11314
|
+
function depthOf(value2) {
|
|
11315
|
+
let max = 0;
|
|
11316
|
+
const stack = [[value2, 0]];
|
|
11317
|
+
while (stack.length) {
|
|
11318
|
+
const [v2, d2] = stack.pop();
|
|
11319
|
+
if (d2 > max) max = d2;
|
|
11320
|
+
if (max > MAX_BLOCK_DEPTH) return max;
|
|
11321
|
+
if (v2 && typeof v2 === "object") for (const x2 of Object.values(v2)) stack.push([x2, d2 + 1]);
|
|
11322
|
+
}
|
|
11323
|
+
return max;
|
|
11324
|
+
}
|
|
11325
|
+
function analyzeNanoActions(source2, file2, diagnostics, seedComputed) {
|
|
11326
|
+
const err = (code3, message5, hint) => diagnostics.push({ file: file2, line: 1, column: 1, code: code3, severity: "error", message: message5, ...hint ? { hint } : {} });
|
|
11327
|
+
let raw;
|
|
11328
|
+
try {
|
|
11329
|
+
raw = JSON.parse(source2);
|
|
11330
|
+
} catch (e2) {
|
|
11331
|
+
err("HHP-NANO-JSON", `The nano-actions block is not valid JSON: ${e2.message}.`, "Emit one JSON object; no comments or trailing commas.");
|
|
11332
|
+
return;
|
|
11333
|
+
}
|
|
11334
|
+
if (!isRecord(raw)) {
|
|
11335
|
+
err("HHP-NANO-SHAPE", "The nano-actions block must be a JSON object.");
|
|
11336
|
+
return;
|
|
11337
|
+
}
|
|
11338
|
+
if (depthOf(raw) > MAX_BLOCK_DEPTH) {
|
|
11339
|
+
err("HHP-NANO-SHAPE", `The nano-actions block nests deeper than ${MAX_BLOCK_DEPTH} levels.`, "Keep state flat: lists of small objects.");
|
|
11340
|
+
return;
|
|
11341
|
+
}
|
|
11342
|
+
for (const key4 of Object.keys(raw)) if (!KEYS.has(key4)) err("HHP-NANO-SHAPE", `Unknown nano-actions key "${key4}".`, "Allowed keys: state, computed, persist, onOpen, actions.");
|
|
11343
|
+
if (!isRecord(raw.state)) {
|
|
11344
|
+
err("HHP-NANO-SHAPE", "nano-actions.state must be an object of JSON values.");
|
|
11345
|
+
return;
|
|
11346
|
+
}
|
|
11347
|
+
if (!isRecord(raw.actions)) {
|
|
11348
|
+
err("HHP-NANO-SHAPE", "nano-actions.actions must map action names to op lists.");
|
|
11349
|
+
return;
|
|
11350
|
+
}
|
|
11351
|
+
const computed = raw.computed ?? {};
|
|
11352
|
+
if (!isRecord(computed) || Object.values(computed).some((v2) => typeof v2 !== "string")) {
|
|
11353
|
+
err("HHP-NANO-SHAPE", "nano-actions.computed must map names to expression strings.");
|
|
11354
|
+
return;
|
|
11355
|
+
}
|
|
11356
|
+
const block = raw;
|
|
11357
|
+
const handlers = /* @__PURE__ */ new Set();
|
|
11358
|
+
for (const [name, ops] of Object.entries(block.actions)) {
|
|
11359
|
+
if (!NAME.test(name) || name.startsWith("__hhp") || unsafe2.has(name)) err("HHP-NANO-SHAPE", `Invalid action name "${name}".`);
|
|
11360
|
+
else if (!Array.isArray(ops)) err("HHP-NANO-SHAPE", `Action "${name}" must be a list of ops.`);
|
|
11361
|
+
else handlers.add(name);
|
|
11362
|
+
}
|
|
11363
|
+
const state = { ...block.state };
|
|
11364
|
+
let seeds = {};
|
|
11365
|
+
if (seedComputed) {
|
|
11366
|
+
try {
|
|
11367
|
+
seeds = seedComputed(block) ?? {};
|
|
11368
|
+
} catch {
|
|
11369
|
+
seeds = {};
|
|
11370
|
+
}
|
|
11371
|
+
}
|
|
11372
|
+
for (const key4 of Object.keys(state)) if (!NAME.test(key4) || key4.startsWith("__hhp") || unsafe2.has(key4)) err("HHP-NANO-SHAPE", `Invalid state key "${key4}".`);
|
|
11373
|
+
for (const key4 of Object.keys(computed)) {
|
|
11374
|
+
if (!NAME.test(key4) || key4.startsWith("__hhp") || unsafe2.has(key4)) err("HHP-NANO-SHAPE", `Invalid computed key "${key4}".`);
|
|
11375
|
+
else if (Object.hasOwn(state, key4)) err("HHP-NANO-SHAPE", `"${key4}" is both state and computed.`);
|
|
11376
|
+
else state[key4] = Object.hasOwn(seeds, key4) && seeds[key4] !== void 0 && seeds[key4] !== null ? seeds[key4] : "";
|
|
11377
|
+
}
|
|
11378
|
+
if (block.onOpen != null && (typeof block.onOpen !== "string" || !handlers.has(block.onOpen)))
|
|
11379
|
+
err("HHP-NANO-ACTION", `onOpen names unknown action "${String(block.onOpen)}".`);
|
|
11380
|
+
if (block.persist !== void 0) {
|
|
11381
|
+
if (!Array.isArray(block.persist)) err("HHP-NANO-SHAPE", "nano-actions.persist must be a list of state keys.");
|
|
11382
|
+
else for (const key4 of block.persist) if (typeof key4 !== "string" || !Object.hasOwn(block.state, key4)) err("HHP-NANO-ACTION", `persist names unknown state key "${String(key4)}".`);
|
|
11383
|
+
}
|
|
11384
|
+
const paths2 = /* @__PURE__ */ new Map();
|
|
11385
|
+
const collect2 = (value2, prefix = "") => {
|
|
11386
|
+
for (const [key4, v2] of Object.entries(value2)) {
|
|
11387
|
+
const path2 = prefix ? `${prefix}.${key4}` : key4;
|
|
11388
|
+
paths2.set(path2, v2);
|
|
11389
|
+
if (isRecord(v2)) collect2(v2, path2);
|
|
11390
|
+
}
|
|
11391
|
+
};
|
|
11392
|
+
collect2(state);
|
|
11393
|
+
return { info: { state, paths: paths2, handlers }, block };
|
|
11394
|
+
}
|
|
11395
|
+
var KEYS, MAX_BLOCK_DEPTH, NAME, unsafe2, isRecord;
|
|
11396
|
+
var init_nano_actions = __esm({
|
|
11397
|
+
"../html-to-t5/src/v2/nano-actions.ts"() {
|
|
11398
|
+
init_define_HHP_CATALOG();
|
|
11399
|
+
KEYS = /* @__PURE__ */ new Set(["state", "computed", "persist", "onOpen", "actions"]);
|
|
11400
|
+
MAX_BLOCK_DEPTH = 32;
|
|
11401
|
+
NAME = /^[a-zA-Z_]\w*$/;
|
|
11402
|
+
unsafe2 = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
11403
|
+
isRecord = (v2) => typeof v2 === "object" && v2 !== null && !Array.isArray(v2);
|
|
11404
|
+
}
|
|
11405
|
+
});
|
|
11406
|
+
|
|
11311
11407
|
// ../../core/ts/src/worker-subtree-safe-types.generated.ts
|
|
11312
11408
|
var WORKER_SUBTREE_SAFE_TYPE_RULES, WORKER_SUBTREE_COMMON_ACTION_PATHS;
|
|
11313
11409
|
var init_worker_subtree_safe_types_generated = __esm({
|
|
@@ -11449,20 +11545,20 @@ var init_worker_subtree_safe_types_generated = __esm({
|
|
|
11449
11545
|
});
|
|
11450
11546
|
|
|
11451
11547
|
// ../../core/ts/src/worker-subtree.ts
|
|
11452
|
-
function
|
|
11548
|
+
function isRecord2(value2) {
|
|
11453
11549
|
return typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
|
|
11454
11550
|
}
|
|
11455
11551
|
function valueAtPath(value2, path2) {
|
|
11456
11552
|
let current = value2;
|
|
11457
11553
|
for (const segment3 of path2.split(".")) {
|
|
11458
|
-
if (!
|
|
11554
|
+
if (!isRecord2(current)) return void 0;
|
|
11459
11555
|
current = current[segment3];
|
|
11460
11556
|
}
|
|
11461
11557
|
return current;
|
|
11462
11558
|
}
|
|
11463
11559
|
function componentShape(value2) {
|
|
11464
|
-
if (!
|
|
11465
|
-
return typeof value2.body.package === "string" && typeof value2.body.type === "string" &&
|
|
11560
|
+
if (!isRecord2(value2) || typeof value2.id !== "string" || !isRecord2(value2.body)) return false;
|
|
11561
|
+
return typeof value2.body.package === "string" && typeof value2.body.type === "string" && isRecord2(value2.body.props);
|
|
11466
11562
|
}
|
|
11467
11563
|
function rotateRight(value2, count3) {
|
|
11468
11564
|
return value2 >>> count3 | value2 << 32 - count3;
|
|
@@ -11620,7 +11716,7 @@ function validateWorkerSubtree(raw, slotId, policy, actionCatalog) {
|
|
|
11620
11716
|
let rejection = null;
|
|
11621
11717
|
const checkAction = (value2) => {
|
|
11622
11718
|
if (value2 == null || rejection) return;
|
|
11623
|
-
if (!
|
|
11719
|
+
if (!isRecord2(value2) || typeof value2.actionId !== "string") {
|
|
11624
11720
|
rejection = "typed_decode";
|
|
11625
11721
|
return;
|
|
11626
11722
|
}
|
|
@@ -11751,10 +11847,25 @@ function compileV2(html, profile, options2) {
|
|
|
11751
11847
|
if (!title) error(null, "HHP-TITLE", "Provide a document title.");
|
|
11752
11848
|
let controller = options2.controller;
|
|
11753
11849
|
let directService;
|
|
11850
|
+
let nanoActions;
|
|
11851
|
+
let nanoActionsSeen = false;
|
|
11754
11852
|
const scripts = $2("script").toArray();
|
|
11755
11853
|
for (const script2 of scripts) {
|
|
11756
11854
|
const type2 = $2(script2).attr("type"), src = $2(script2).attr("src");
|
|
11757
11855
|
if (type2 === "application/himalaya-props") continue;
|
|
11856
|
+
if (options2.declarativeLogic && type2 !== "application/nano-actions") {
|
|
11857
|
+
error(script2, "HHP-SCRIPT", "HHP-N documents carry no JavaScript; use exactly one application/nano-actions block.");
|
|
11858
|
+
continue;
|
|
11859
|
+
}
|
|
11860
|
+
if (type2 === "application/nano-actions" && options2.declarativeLogic && !controller && !directService && !src) {
|
|
11861
|
+
if (nanoActionsSeen) {
|
|
11862
|
+
error(script2, "HHP-NANO-SHAPE", "Use exactly one application/nano-actions block.");
|
|
11863
|
+
continue;
|
|
11864
|
+
}
|
|
11865
|
+
nanoActionsSeen = true;
|
|
11866
|
+
nanoActions = analyzeNanoActions($2(script2).text(), options2.file, diagnostics, typeof options2.declarativeLogic === "object" ? options2.declarativeLogic.seedComputed : void 0);
|
|
11867
|
+
continue;
|
|
11868
|
+
}
|
|
11758
11869
|
if (type2 === "application/himalaya-service" && !controller && !directService) {
|
|
11759
11870
|
try {
|
|
11760
11871
|
directService = src && options2.readLocal ? { ...options2.readLocal(src, options2.file), external: true } : { source: $2(script2).text(), file: options2.file, external: false };
|
|
@@ -11770,7 +11881,7 @@ function compileV2(html, profile, options2) {
|
|
|
11770
11881
|
}
|
|
11771
11882
|
} else error(script2, "HHP-SCRIPT", "Use one external application/himalaya-controller script. Inline/page JavaScript is unavailable.");
|
|
11772
11883
|
}
|
|
11773
|
-
let info4;
|
|
11884
|
+
let info4 = nanoActions?.info;
|
|
11774
11885
|
for (const cap2 of moduleCapabilities(controller?.source ?? directService?.source ?? "", controller?.file ?? options2.file, profile)) requiredCapabilities2.add(cap2);
|
|
11775
11886
|
if (controller) {
|
|
11776
11887
|
dependencies.push(controller.file);
|
|
@@ -11809,6 +11920,7 @@ function compileV2(html, profile, options2) {
|
|
|
11809
11920
|
const tags = new Map(Object.entries(profile.components).map(([name, spec]) => [spec.tag, name]));
|
|
11810
11921
|
const ids2 = /* @__PURE__ */ new Set(), bindings = /* @__PURE__ */ new Map();
|
|
11811
11922
|
const textProjections = [];
|
|
11923
|
+
const keyedLists = /* @__PURE__ */ new Set();
|
|
11812
11924
|
let subtreeCount = 0;
|
|
11813
11925
|
const own6 = (record5, key4) => Object.hasOwn(record5, key4) ? record5[key4] : void 0;
|
|
11814
11926
|
function structured(el2, value2) {
|
|
@@ -11938,7 +12050,7 @@ function compileV2(html, profile, options2) {
|
|
|
11938
12050
|
if (matches2.length) {
|
|
11939
12051
|
if (matches2.length === 1 && matches2[0][0] === text32 && type2 === "Text") {
|
|
11940
12052
|
props2.text = path2(el2, matches2[0][1], row2);
|
|
11941
|
-
} else if (controller && type2 === "Text") {
|
|
12053
|
+
} else if ((controller || nanoActions) && type2 === "Text") {
|
|
11942
12054
|
for (const match of matches2) path2(el2, match[1], row2);
|
|
11943
12055
|
const key4 = `t${textProjections.length}`;
|
|
11944
12056
|
const normalized2 = text32.replace(/{{\s*([\w.$]+)\s*}}/g, (_match, raw) => `{{${raw.startsWith("$item.") ? raw : statePath(raw)}}}`);
|
|
@@ -12057,6 +12169,10 @@ function compileV2(html, profile, options2) {
|
|
|
12057
12169
|
error(el2, "HHP-EVENT", `Unknown or unsupported ${event} handler ${raw}.`);
|
|
12058
12170
|
continue;
|
|
12059
12171
|
}
|
|
12172
|
+
if (attrs["data-action-args"] !== void 0) {
|
|
12173
|
+
error(el2, "HHP-ACTION-ARGS", `data-action-args is ignored on ${attr3}; the handler would receive no args.`, `Use data-action="${raw}" with data-action-args instead.`);
|
|
12174
|
+
continue;
|
|
12175
|
+
}
|
|
12060
12176
|
(spec.fields[field2] ? props2 : mods)[field2] = { actionId: `tier5.${serviceName2}.${raw}` };
|
|
12061
12177
|
continue;
|
|
12062
12178
|
}
|
|
@@ -12172,6 +12288,7 @@ function compileV2(html, profile, options2) {
|
|
|
12172
12288
|
else keys2.add(item2.id);
|
|
12173
12289
|
}
|
|
12174
12290
|
props2.itemsPath = path2(el2, each, false);
|
|
12291
|
+
if (!each.startsWith("$item.")) keyedLists.add(statePath(each));
|
|
12175
12292
|
}
|
|
12176
12293
|
}
|
|
12177
12294
|
const childField = Object.entries(spec.fields).find(([, f2]) => f2.kind === "children")?.[0];
|
|
@@ -12249,14 +12366,14 @@ function compileV2(html, profile, options2) {
|
|
|
12249
12366
|
let payload;
|
|
12250
12367
|
if (roots2.length === 1) payload = compile(roots2[0], "root");
|
|
12251
12368
|
else error(null, "HHP-ROOT", "Use exactly one root layout element.");
|
|
12252
|
-
const bundleName = info4 ? `hhp-${screenId?.replace(/[._]/g, "-")}` : void 0;
|
|
12369
|
+
const bundleName = info4 && !nanoActions ? `hhp-${screenId?.replace(/[._]/g, "-")}` : void 0;
|
|
12253
12370
|
const descriptor = payload && screenId ? {
|
|
12254
12371
|
screenId,
|
|
12255
12372
|
renderer: "sdui_layout",
|
|
12256
12373
|
schemaVersion: 1,
|
|
12257
12374
|
title,
|
|
12258
12375
|
payload,
|
|
12259
|
-
...info4 ? { logicBundle: { url: `/v1/bundles/${bundleName}`, integrity: "", contentType: "application/javascript+ts-bundle", declaredCapabilities: profile.declaredCapabilities, minBinaryVersion: "0.1.0", bundleVersion: "0.0.1" } } : {}
|
|
12376
|
+
...info4 && !nanoActions ? { logicBundle: { url: `/v1/bundles/${bundleName}`, integrity: "", contentType: "application/javascript+ts-bundle", declaredCapabilities: profile.declaredCapabilities, minBinaryVersion: "0.1.0", bundleVersion: "0.0.1" } } : {}
|
|
12260
12377
|
} : void 0;
|
|
12261
12378
|
const worker = info4 && controller ? controllerWorker(serviceName2, controller.workerImport, info4, bindings, textProjections) : directService ? directService.external ? `// GENERATED HHP v2 worker.
|
|
12262
12379
|
import ${JSON.stringify(directService.file)};
|
|
@@ -12271,7 +12388,16 @@ ${directService.source}
|
|
|
12271
12388
|
bundleName,
|
|
12272
12389
|
sourceMap: sourceMap2,
|
|
12273
12390
|
dependencies,
|
|
12274
|
-
manifest: {
|
|
12391
|
+
manifest: {
|
|
12392
|
+
profileVersion: "hhp/2",
|
|
12393
|
+
catalogVersion: profile.catalogVersion,
|
|
12394
|
+
screenId,
|
|
12395
|
+
bundleName,
|
|
12396
|
+
serviceName: info4 ? serviceName2 : null,
|
|
12397
|
+
requiredCapabilities: [...requiredCapabilities2].sort(),
|
|
12398
|
+
inputSha256: createHash4("sha256").update(html).digest("hex"),
|
|
12399
|
+
...nanoActions ? { logic: "nano-actions", nanoLogic: { service: serviceName2, bindings: Object.fromEntries(bindings), projections: textProjections, keyed: [...keyedLists], block: nanoActions.block } } : {}
|
|
12400
|
+
}
|
|
12275
12401
|
};
|
|
12276
12402
|
}
|
|
12277
12403
|
var camel, semantic, attributeAliases, typographyStyled, actionAliases, ajv, validators;
|
|
@@ -12281,6 +12407,7 @@ var init_compile = __esm({
|
|
|
12281
12407
|
init_controller();
|
|
12282
12408
|
init_catalog();
|
|
12283
12409
|
init_css();
|
|
12410
|
+
init_nano_actions();
|
|
12284
12411
|
init_worker_subtree();
|
|
12285
12412
|
init_implications();
|
|
12286
12413
|
camel = (s5) => s5.replace(/-([a-z])/g, (_2, c2) => c2.toUpperCase());
|
|
@@ -18295,8 +18422,8 @@ function componentNodes(descriptor) {
|
|
|
18295
18422
|
if (!value2 || typeof value2 !== "object") continue;
|
|
18296
18423
|
let childAncestors = ancestors;
|
|
18297
18424
|
let childConditional = conditional2;
|
|
18298
|
-
if (
|
|
18299
|
-
const mods =
|
|
18425
|
+
if (isRecord3(value2) && isRecord3(value2.body) && typeof value2.body.type === "string" && typeof value2.body.package === "string") {
|
|
18426
|
+
const mods = isRecord3(value2.modifiers) ? value2.modifiers : void 0;
|
|
18300
18427
|
const hiddenHere = mods !== void 0 && (mods.hidden === true || typeof mods.hiddenPath === "string" && mods.hiddenPath !== "");
|
|
18301
18428
|
const selfConditional = conditional2 || hiddenHere;
|
|
18302
18429
|
out2.push({ node: value2, path: path2, ancestors, conditional: selfConditional });
|
|
@@ -18446,10 +18573,10 @@ function motionBindingIssues(descriptor) {
|
|
|
18446
18573
|
const byTransitionId = /* @__PURE__ */ new Map();
|
|
18447
18574
|
for (const visit of componentNodes(descriptor)) {
|
|
18448
18575
|
const mods = visit.node.modifiers;
|
|
18449
|
-
if (!
|
|
18576
|
+
if (!isRecord3(mods)) continue;
|
|
18450
18577
|
const at2 = visit.path ? `${visit.path}.modifiers` : "modifiers";
|
|
18451
18578
|
out2.push(...transformPathIssues(mods, at2));
|
|
18452
|
-
if (
|
|
18579
|
+
if (isRecord3(mods.scrollLinked)) out2.push(...scrollLinkedIssues(visit, mods.scrollLinked, at2));
|
|
18453
18580
|
const tid2 = mods.transitionId;
|
|
18454
18581
|
if (typeof tid2 === "string" && tid2 !== "" && !tid2.includes("$") && !visit.conditional) {
|
|
18455
18582
|
byTransitionId.set(tid2, [...byTransitionId.get(tid2) ?? [], `${at2}.transitionId`]);
|
|
@@ -18467,7 +18594,7 @@ function motionBindingIssues(descriptor) {
|
|
|
18467
18594
|
}
|
|
18468
18595
|
return out2;
|
|
18469
18596
|
}
|
|
18470
|
-
var TRANSFORM_PATH_KEYS, SCROLL_LINKED_OUTPUTS, SCROLL_CONTAINER_TYPES, CONDITIONAL_CONTAINER_TYPES,
|
|
18597
|
+
var TRANSFORM_PATH_KEYS, SCROLL_LINKED_OUTPUTS, SCROLL_CONTAINER_TYPES, CONDITIONAL_CONTAINER_TYPES, isRecord3, issue, finiteNumbers;
|
|
18471
18598
|
var init_motion_bindings_lint = __esm({
|
|
18472
18599
|
"../../core/dev-server/src/motion-bindings-lint.ts"() {
|
|
18473
18600
|
init_define_HHP_CATALOG();
|
|
@@ -18494,7 +18621,7 @@ var init_motion_bindings_lint = __esm({
|
|
|
18494
18621
|
"Tooltip",
|
|
18495
18622
|
"DisclosureGroup"
|
|
18496
18623
|
]);
|
|
18497
|
-
|
|
18624
|
+
isRecord3 = (v2) => !!v2 && typeof v2 === "object" && !Array.isArray(v2);
|
|
18498
18625
|
issue = (severity, pass, code3, path2, message5) => ({ severity, pass, code: code3, ruleCode: code3, path: path2, message: message5 });
|
|
18499
18626
|
finiteNumbers = (v2) => Array.isArray(v2) && v2.every((n2) => typeof n2 === "number" && Number.isFinite(n2));
|
|
18500
18627
|
}
|
|
@@ -41207,15 +41334,15 @@ function authored(overlays, name) {
|
|
|
41207
41334
|
function selectIdiomOverlay(doc, ctx = {}) {
|
|
41208
41335
|
const policy = doc.idiomPolicy;
|
|
41209
41336
|
const overlays = doc.idiom;
|
|
41210
|
-
const
|
|
41211
|
-
if (!
|
|
41337
|
+
const isRecord7 = (v2) => !!v2 && typeof v2 === "object" && !Array.isArray(v2);
|
|
41338
|
+
if (!isRecord7(policy) || !isRecord7(overlays)) return void 0;
|
|
41212
41339
|
const kind = policy.policy ?? "follow-surface";
|
|
41213
41340
|
if (kind === "none") return void 0;
|
|
41214
41341
|
if (kind === "pinned") return authored(overlays, policy.pin) ? policy.pin : void 0;
|
|
41215
41342
|
if (kind !== "follow-surface") return void 0;
|
|
41216
41343
|
const surfaces = policy.surfaces;
|
|
41217
41344
|
const candidates = [
|
|
41218
|
-
ctx.surface !== void 0 &&
|
|
41345
|
+
ctx.surface !== void 0 && isRecord7(surfaces) && Object.hasOwn(surfaces, ctx.surface) ? surfaces[ctx.surface] : void 0,
|
|
41219
41346
|
...ctx.native ?? [],
|
|
41220
41347
|
policy.fallback
|
|
41221
41348
|
];
|
|
@@ -42326,7 +42453,7 @@ var init_store2 = __esm({
|
|
|
42326
42453
|
});
|
|
42327
42454
|
|
|
42328
42455
|
// ../../core/ts/src/stream-policy.ts
|
|
42329
|
-
function
|
|
42456
|
+
function isRecord4(value2) {
|
|
42330
42457
|
return typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
|
|
42331
42458
|
}
|
|
42332
42459
|
function isLoopback(host) {
|
|
@@ -42334,7 +42461,7 @@ function isLoopback(host) {
|
|
|
42334
42461
|
}
|
|
42335
42462
|
function endpointErrors(endpoint, index, options2) {
|
|
42336
42463
|
const at2 = `streamPolicy.endpoints[${index}]`;
|
|
42337
|
-
if (!
|
|
42464
|
+
if (!isRecord4(endpoint)) return [`${at2} must be an object`];
|
|
42338
42465
|
const errors = [];
|
|
42339
42466
|
let origin;
|
|
42340
42467
|
if (typeof endpoint.origin !== "string") {
|
|
@@ -42382,7 +42509,7 @@ function endpointErrors(endpoint, index, options2) {
|
|
|
42382
42509
|
return errors;
|
|
42383
42510
|
}
|
|
42384
42511
|
function validateStreamPolicy(policy, options2) {
|
|
42385
|
-
if (!
|
|
42512
|
+
if (!isRecord4(policy)) return ["streamPolicy must be an object"];
|
|
42386
42513
|
const errors = [];
|
|
42387
42514
|
if (policy.version !== STREAM_POLICY_VERSION) errors.push(`streamPolicy.version must equal ${STREAM_POLICY_VERSION}`);
|
|
42388
42515
|
if (!Array.isArray(policy.endpoints)) {
|
|
@@ -42399,7 +42526,7 @@ function validateNavigationStreamPolicyConfig(appConfig, options2) {
|
|
|
42399
42526
|
} catch {
|
|
42400
42527
|
return ["appConfig must be valid JSON"];
|
|
42401
42528
|
}
|
|
42402
|
-
if (!
|
|
42529
|
+
if (!isRecord4(config)) return ["appConfig must be an object"];
|
|
42403
42530
|
if (config.streamPolicy === void 0) return [];
|
|
42404
42531
|
return validateStreamPolicy(config.streamPolicy, options2);
|
|
42405
42532
|
}
|
|
@@ -57999,7 +58126,7 @@ var init_pdf = __esm({
|
|
|
57999
58126
|
var TYPED_ARRAY_CONSTRUCTOR = "TypedArrayConstructor";
|
|
58000
58127
|
var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(globalThis2.opera) !== "Opera";
|
|
58001
58128
|
var TYPED_ARRAY_TAG_REQUIRED = false;
|
|
58002
|
-
var
|
|
58129
|
+
var NAME3, Constructor, Prototype;
|
|
58003
58130
|
var TypedArrayConstructorsList = {
|
|
58004
58131
|
Int8Array: 1,
|
|
58005
58132
|
Uint8Array: 1,
|
|
@@ -58081,14 +58208,14 @@ var init_pdf = __esm({
|
|
|
58081
58208
|
}
|
|
58082
58209
|
}
|
|
58083
58210
|
};
|
|
58084
|
-
for (
|
|
58085
|
-
Constructor = globalThis2[
|
|
58211
|
+
for (NAME3 in TypedArrayConstructorsList) {
|
|
58212
|
+
Constructor = globalThis2[NAME3];
|
|
58086
58213
|
Prototype = Constructor && Constructor.prototype;
|
|
58087
58214
|
if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;
|
|
58088
58215
|
else NATIVE_ARRAY_BUFFER_VIEWS = false;
|
|
58089
58216
|
}
|
|
58090
|
-
for (
|
|
58091
|
-
Constructor = globalThis2[
|
|
58217
|
+
for (NAME3 in BigIntArrayConstructorsList) {
|
|
58218
|
+
Constructor = globalThis2[NAME3];
|
|
58092
58219
|
Prototype = Constructor && Constructor.prototype;
|
|
58093
58220
|
if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;
|
|
58094
58221
|
}
|
|
@@ -58096,14 +58223,14 @@ var init_pdf = __esm({
|
|
|
58096
58223
|
TypedArray = function TypedArray2() {
|
|
58097
58224
|
throw new TypeError2("Incorrect invocation");
|
|
58098
58225
|
};
|
|
58099
|
-
if (NATIVE_ARRAY_BUFFER_VIEWS) for (
|
|
58100
|
-
if (globalThis2[
|
|
58226
|
+
if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME3 in TypedArrayConstructorsList) {
|
|
58227
|
+
if (globalThis2[NAME3]) setPrototypeOf(globalThis2[NAME3], TypedArray);
|
|
58101
58228
|
}
|
|
58102
58229
|
}
|
|
58103
58230
|
if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {
|
|
58104
58231
|
TypedArrayPrototype = TypedArray.prototype;
|
|
58105
|
-
if (NATIVE_ARRAY_BUFFER_VIEWS) for (
|
|
58106
|
-
if (globalThis2[
|
|
58232
|
+
if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME3 in TypedArrayConstructorsList) {
|
|
58233
|
+
if (globalThis2[NAME3]) setPrototypeOf(globalThis2[NAME3].prototype, TypedArrayPrototype);
|
|
58107
58234
|
}
|
|
58108
58235
|
}
|
|
58109
58236
|
if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {
|
|
@@ -58117,8 +58244,8 @@ var init_pdf = __esm({
|
|
|
58117
58244
|
return isObject6(this) ? this[TYPED_ARRAY_TAG] : void 0;
|
|
58118
58245
|
}
|
|
58119
58246
|
});
|
|
58120
|
-
for (
|
|
58121
|
-
createNonEnumerableProperty(globalThis2[
|
|
58247
|
+
for (NAME3 in TypedArrayConstructorsList) if (globalThis2[NAME3]) {
|
|
58248
|
+
createNonEnumerableProperty(globalThis2[NAME3].prototype, TYPED_ARRAY_TAG, NAME3);
|
|
58122
58249
|
}
|
|
58123
58250
|
}
|
|
58124
58251
|
module.exports = {
|
|
@@ -150384,7 +150511,7 @@ function bakeBootState(bundleJs, input, opts = {}) {
|
|
|
150384
150511
|
const omitted = [];
|
|
150385
150512
|
for (const [name, state] of Object.entries(services2)) {
|
|
150386
150513
|
const probe2 = probed[name];
|
|
150387
|
-
if (name === BOOT_STATE_STORAGE_KEYS || drifting.includes(name) || !
|
|
150514
|
+
if (name === BOOT_STATE_STORAGE_KEYS || drifting.includes(name) || !isRecord5(state) || !isRecord5(probe2)) {
|
|
150388
150515
|
omitted.push(name);
|
|
150389
150516
|
continue;
|
|
150390
150517
|
}
|
|
@@ -150411,7 +150538,7 @@ function steadyPart(state, probe2, at2, omitted) {
|
|
|
150411
150538
|
for (const [key4, value2] of Object.entries(state)) {
|
|
150412
150539
|
const other = probe2[key4];
|
|
150413
150540
|
if (sameJson3(value2, other)) steady[key4] = value2;
|
|
150414
|
-
else if (
|
|
150541
|
+
else if (isRecord5(value2) && isRecord5(other)) {
|
|
150415
150542
|
const part5 = steadyPart(value2, other, `${at2}.${key4}`, omitted);
|
|
150416
150543
|
if (Object.keys(part5).length > 0) steady[key4] = part5;
|
|
150417
150544
|
} else omitted.push(`${at2}.${key4}`);
|
|
@@ -150431,9 +150558,9 @@ function gatesUnbakedPath(descriptor, state, services2) {
|
|
|
150431
150558
|
}
|
|
150432
150559
|
function withoutClosedSheets(node3, state) {
|
|
150433
150560
|
if (Array.isArray(node3)) return node3.map((v2) => withoutClosedSheets(v2, state));
|
|
150434
|
-
if (!
|
|
150561
|
+
if (!isRecord5(node3)) return node3;
|
|
150435
150562
|
const body = node3.body;
|
|
150436
|
-
if (
|
|
150563
|
+
if (isRecord5(body) && body.type === "BottomSheet" && isRecord5(body.props) && typeof body.props.presentedPath === "string") {
|
|
150437
150564
|
const m2 = /^\$service:([A-Za-z0-9_-]+)\.(.+)$/.exec(body.props.presentedPath);
|
|
150438
150565
|
if (m2 && valueAt3(state[m2[1]], m2[2]) === false) {
|
|
150439
150566
|
const { content: _closed, footer: _closedFooter, ...props2 } = body.props;
|
|
@@ -150450,7 +150577,7 @@ function valueAt3(root, path2) {
|
|
|
150450
150577
|
}
|
|
150451
150578
|
return v2;
|
|
150452
150579
|
}
|
|
150453
|
-
function
|
|
150580
|
+
function isRecord5(v2) {
|
|
150454
150581
|
return v2 !== null && typeof v2 === "object" && !Array.isArray(v2);
|
|
150455
150582
|
}
|
|
150456
150583
|
function sameJson3(a3, b3) {
|
|
@@ -175227,7 +175354,7 @@ function optHttpsUrl(obj19, key4) {
|
|
|
175227
175354
|
return url.href;
|
|
175228
175355
|
}
|
|
175229
175356
|
function parseAppSpec(raw, specDir = process.cwd()) {
|
|
175230
|
-
if (!
|
|
175357
|
+
if (!isRecord6(raw)) invalid("must be a JSON object");
|
|
175231
175358
|
onlyKeys(raw, [...TOP_KEYS2], "the spec");
|
|
175232
175359
|
const spec = {};
|
|
175233
175360
|
const url = optString(raw, "url");
|
|
@@ -175255,14 +175382,14 @@ function parseAppSpec(raw, specDir = process.cwd()) {
|
|
|
175255
175382
|
}
|
|
175256
175383
|
}
|
|
175257
175384
|
if (raw.colors !== void 0) {
|
|
175258
|
-
if (!
|
|
175385
|
+
if (!isRecord6(raw.colors)) invalid("colors must be an object");
|
|
175259
175386
|
onlyKeys(raw.colors, ["primary", "secondary"], "colors");
|
|
175260
175387
|
const primary = optHex(raw.colors, "primary", "colors.primary");
|
|
175261
175388
|
const secondary = optHex(raw.colors, "secondary", "colors.secondary");
|
|
175262
175389
|
spec.colors = { ...primary ? { primary } : {}, ...secondary ? { secondary } : {} };
|
|
175263
175390
|
}
|
|
175264
175391
|
if (raw.splash !== void 0) {
|
|
175265
|
-
if (!
|
|
175392
|
+
if (!isRecord6(raw.splash)) invalid("splash must be an object");
|
|
175266
175393
|
onlyKeys(raw.splash, ["backgroundColor", "caption"], "splash");
|
|
175267
175394
|
const splash = {};
|
|
175268
175395
|
const bg = optString(raw.splash, "backgroundColor", "splash.backgroundColor");
|
|
@@ -175281,7 +175408,7 @@ function parseAppSpec(raw, specDir = process.cwd()) {
|
|
|
175281
175408
|
if (raw.base44 !== void 0) {
|
|
175282
175409
|
if (raw.base44 === false) spec.base44 = false;
|
|
175283
175410
|
else {
|
|
175284
|
-
if (!
|
|
175411
|
+
if (!isRecord6(raw.base44)) invalid("base44 must be an object or false");
|
|
175285
175412
|
onlyKeys(raw.base44, ["appId"], "base44");
|
|
175286
175413
|
const appId3 = optString(raw.base44, "appId", "base44.appId");
|
|
175287
175414
|
if (appId3 !== void 0 && !BASE44_ID.test(appId3)) invalid(`base44.appId must be 8-64 letters and digits (the id in https://app.base44.com/apps/<id>), got ${JSON.stringify(appId3)}`);
|
|
@@ -175293,7 +175420,7 @@ function parseAppSpec(raw, specDir = process.cwd()) {
|
|
|
175293
175420
|
const seen = /* @__PURE__ */ new Set();
|
|
175294
175421
|
spec.pages = raw.pages.map((p2, i2) => {
|
|
175295
175422
|
const where = `pages[${i2}]`;
|
|
175296
|
-
if (!
|
|
175423
|
+
if (!isRecord6(p2)) invalid(`${where} must be an object`);
|
|
175297
175424
|
onlyKeys(p2, ["id", "title", "path", "icon", "placement"], where);
|
|
175298
175425
|
const id = optString(p2, "id", `${where}.id`);
|
|
175299
175426
|
const title = optString(p2, "title", `${where}.title`);
|
|
@@ -175350,7 +175477,7 @@ function normalized(u2) {
|
|
|
175350
175477
|
return u2;
|
|
175351
175478
|
}
|
|
175352
175479
|
}
|
|
175353
|
-
var FromUrlError, HEX2, BASE44_ID, PAGE_ID2, TOP_KEYS2,
|
|
175480
|
+
var FromUrlError, HEX2, BASE44_ID, PAGE_ID2, TOP_KEYS2, isRecord6;
|
|
175354
175481
|
var init_spec = __esm({
|
|
175355
175482
|
"src/from-url/spec.ts"() {
|
|
175356
175483
|
init_define_HHP_CATALOG();
|
|
@@ -175366,7 +175493,7 @@ var init_spec = __esm({
|
|
|
175366
175493
|
BASE44_ID = /^[A-Za-z0-9]{8,64}$/;
|
|
175367
175494
|
PAGE_ID2 = /^[a-z][a-z0-9_]*$/;
|
|
175368
175495
|
TOP_KEYS2 = /* @__PURE__ */ new Set(["$schema", "url", "name", "description", "icon", "colors", "splash", "base44", "pages", "supportUrl", "privacyUrl", "termsUrl"]);
|
|
175369
|
-
|
|
175496
|
+
isRecord6 = (v2) => v2 !== null && typeof v2 === "object" && !Array.isArray(v2);
|
|
175370
175497
|
}
|
|
175371
175498
|
});
|
|
175372
175499
|
|
|
@@ -180998,17 +181125,17 @@ function gatherReleaseEntries(appDir3) {
|
|
|
180998
181125
|
wanted.delete(HIMI_PACKAGE_MANIFEST_PATH);
|
|
180999
181126
|
wanted.delete(HIMI_PACKAGE_HEADER_PATH);
|
|
181000
181127
|
for (const singleton of SINGLETONS) wanted.delete(singleton);
|
|
181001
|
-
const
|
|
181128
|
+
const unsafe3 = [
|
|
181002
181129
|
...Object.keys(manifest2.screens ?? {}).filter((id) => !isSafePackageSegment(id)).map((id) => `screen "${id}"`),
|
|
181003
181130
|
...Object.keys(manifest2.widgets ?? {}).filter((id) => !isSafePackageSegment(id)).map((id) => `widget "${id}"`),
|
|
181004
181131
|
...Object.entries(manifest2.bundles ?? {}).filter(([, m2]) => !m2?.sha256 || !/^[a-f0-9]{64}$/.test(m2.sha256)).map(([name]) => `bundle "${name}"`),
|
|
181005
181132
|
...Object.entries(manifest2.assets ?? {}).filter(([, r3]) => !r3?.sha256 || !/^[a-f0-9]{64}$/.test(r3.sha256)).map(([name]) => `asset "${name}"`),
|
|
181006
181133
|
...handlerRecords(manifest2).filter((h2) => !h2?.bundleHash || !/^[a-f0-9]{64}$/.test(h2.bundleHash)).map((h2) => `handler "${h2?.id ?? "?"}"`)
|
|
181007
181134
|
];
|
|
181008
|
-
if (
|
|
181135
|
+
if (unsafe3.length) {
|
|
181009
181136
|
throw new Error(
|
|
181010
|
-
`release at ${appDir3} names ${
|
|
181011
|
-
${
|
|
181137
|
+
`release at ${appDir3} names ${unsafe3.length} entr${unsafe3.length === 1 ? "y" : "ies"} whose id is not a safe file name \u2014 refusing to pack it:
|
|
181138
|
+
${unsafe3.slice(0, 10).join("\n ")}`
|
|
181012
181139
|
);
|
|
181013
181140
|
}
|
|
181014
181141
|
const missing4 = [];
|
|
@@ -183516,18 +183643,18 @@ function configuredTokensPath(dir) {
|
|
|
183516
183643
|
}
|
|
183517
183644
|
function tokenNumericIssues(tokens2, tokensPath = "tokens.json") {
|
|
183518
183645
|
const issues = [];
|
|
183519
|
-
const
|
|
183520
|
-
if (!
|
|
183646
|
+
const isRecord7 = (v2) => v2 !== null && typeof v2 === "object" && !Array.isArray(v2);
|
|
183647
|
+
if (!isRecord7(tokens2)) return issues;
|
|
183521
183648
|
const shown3 = (v2) => typeof v2 === "string" ? JSON.stringify(v2) : JSON.stringify(v2) ?? String(v2);
|
|
183522
183649
|
const bad4 = (v2) => !(typeof v2 === "number" && Number.isInteger(v2));
|
|
183523
183650
|
const check = (layer, where) => {
|
|
183524
|
-
if (!
|
|
183651
|
+
if (!isRecord7(layer)) return;
|
|
183525
183652
|
const loses = where ? `the ${where.slice(0, -1)} overlay is dropped on device and the base look is used instead` : 'iOS and Android reject the WHOLE tokens.json otherwise ("Theme unavailable" on iOS, the default palette and fonts on Android)';
|
|
183526
183653
|
for (const { group, field, unit } of INTEGER_TOKEN_FIELDS) {
|
|
183527
183654
|
const entries = layer[group];
|
|
183528
|
-
if (!
|
|
183655
|
+
if (!isRecord7(entries)) continue;
|
|
183529
183656
|
for (const [name, token] of Object.entries(entries)) {
|
|
183530
|
-
if (!
|
|
183657
|
+
if (!isRecord7(token) || !(field in token)) continue;
|
|
183531
183658
|
const value2 = token[field];
|
|
183532
183659
|
if (!bad4(value2)) continue;
|
|
183533
183660
|
const path2 = `${where}${group}.${name}.${field}`;
|
|
@@ -183543,7 +183670,7 @@ function tokenNumericIssues(tokens2, tokensPath = "tokens.json") {
|
|
|
183543
183670
|
}
|
|
183544
183671
|
for (const group of INTEGER_TOKEN_MAPS) {
|
|
183545
183672
|
const entries = layer[group];
|
|
183546
|
-
if (!
|
|
183673
|
+
if (!isRecord7(entries)) continue;
|
|
183547
183674
|
for (const [name, value2] of Object.entries(entries)) {
|
|
183548
183675
|
if (!bad4(value2)) continue;
|
|
183549
183676
|
const fix = typeof value2 === "number" && Number.isFinite(value2) ? ` Write ${Math.round(value2)}.` : "";
|
|
@@ -183559,7 +183686,7 @@ function tokenNumericIssues(tokens2, tokensPath = "tokens.json") {
|
|
|
183559
183686
|
};
|
|
183560
183687
|
check(tokens2, "");
|
|
183561
183688
|
const idiom = tokens2.idiom;
|
|
183562
|
-
if (
|
|
183689
|
+
if (isRecord7(idiom)) {
|
|
183563
183690
|
for (const [overlay, layer] of Object.entries(idiom)) check(layer, `idiom.${overlay}.`);
|
|
183564
183691
|
}
|
|
183565
183692
|
return issues;
|
|
@@ -197357,7 +197484,7 @@ function createFunctionCallCapability(options2) {
|
|
|
197357
197484
|
if (options2.signal?.aborted) {
|
|
197358
197485
|
throw new FunctionCallError("function_call_canceled", "parent invocation was canceled");
|
|
197359
197486
|
}
|
|
197360
|
-
if (!
|
|
197487
|
+
if (!NAME2.test(name)) {
|
|
197361
197488
|
throw new FunctionCallError("function_not_found", "target function does not exist");
|
|
197362
197489
|
}
|
|
197363
197490
|
const target = targets.get(name);
|
|
@@ -197403,7 +197530,7 @@ function createFunctionCallCapability(options2) {
|
|
|
197403
197530
|
}
|
|
197404
197531
|
};
|
|
197405
197532
|
}
|
|
197406
|
-
var FunctionCallError,
|
|
197533
|
+
var FunctionCallError, NAME2;
|
|
197407
197534
|
var init_calls = __esm({
|
|
197408
197535
|
"../../core/functions-runtime/src/calls.ts"() {
|
|
197409
197536
|
init_define_HHP_CATALOG();
|
|
@@ -197414,7 +197541,7 @@ var init_calls = __esm({
|
|
|
197414
197541
|
this.name = "FunctionCallError";
|
|
197415
197542
|
}
|
|
197416
197543
|
};
|
|
197417
|
-
|
|
197544
|
+
NAME2 = /^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$/;
|
|
197418
197545
|
}
|
|
197419
197546
|
});
|
|
197420
197547
|
|
|
@@ -208236,7 +208363,7 @@ function checkPolicy(doc, source2 = "asc-policy.yml") {
|
|
|
208236
208363
|
throw new PolicyError(["the document must be a mapping"], source2);
|
|
208237
208364
|
const d2 = doc;
|
|
208238
208365
|
for (const key4 of Object.keys(d2))
|
|
208239
|
-
if (!
|
|
208366
|
+
if (!KEYS2.has(key4))
|
|
208240
208367
|
problems.push(`unknown key "${key4}"`);
|
|
208241
208368
|
if (d2.version !== 1)
|
|
208242
208369
|
problems.push("version must be 1");
|
|
@@ -208308,12 +208435,12 @@ function checkPolicy(doc, source2 = "asc-policy.yml") {
|
|
|
208308
208435
|
function gplayPolicy() {
|
|
208309
208436
|
return checkPolicy({ version: 1, default: "one", reads: "auto", actions: { ...GPLAY_POLICY_ACTIONS }, fleet: { twoApprovalsOverApps: 20, twoApprovalsAcrossAccounts: true }, agents: { mayApproveOwnJobs: false } }, "the gplay policy");
|
|
208310
208437
|
}
|
|
208311
|
-
var LEVELS,
|
|
208438
|
+
var LEVELS, KEYS2, PolicyError, GPLAY_POLICY_ACTIONS;
|
|
208312
208439
|
var init_policy_check = __esm({
|
|
208313
208440
|
"../../node_modules/@wix/asc-jobs/dist/policy-check.js"() {
|
|
208314
208441
|
init_define_HHP_CATALOG();
|
|
208315
208442
|
LEVELS = /* @__PURE__ */ new Set(["auto", "one", "two", "never"]);
|
|
208316
|
-
|
|
208443
|
+
KEYS2 = /* @__PURE__ */ new Set(["version", "default", "reads", "actions", "fleet", "agents", "testApps"]);
|
|
208317
208444
|
PolicyError = class extends Error {
|
|
208318
208445
|
problems;
|
|
208319
208446
|
constructor(problems, source2) {
|
|
@@ -253794,7 +253921,7 @@ async function printRenderBatch(ctx, o2) {
|
|
|
253794
253921
|
const entries = [];
|
|
253795
253922
|
const ownShots = {};
|
|
253796
253923
|
const ownFiles = [];
|
|
253797
|
-
let
|
|
253924
|
+
let unsafe3 = false;
|
|
253798
253925
|
const missing4 = [];
|
|
253799
253926
|
for (const screenId of asked) {
|
|
253800
253927
|
const rendered = built.renders.filter((r3) => r3.screenId === screenId).sort((a3, b3) => variantIndex(a3) - variantIndex(b3));
|
|
@@ -253812,7 +253939,7 @@ async function printRenderBatch(ctx, o2) {
|
|
|
253812
253939
|
if (wantPng && r3.pngBase64) {
|
|
253813
253940
|
const own6 = shotKit.writeScreenShot(dir, r3.screenId, r3.pngBase64);
|
|
253814
253941
|
if (own6 === null) {
|
|
253815
|
-
|
|
253942
|
+
unsafe3 = true;
|
|
253816
253943
|
return [{ ok: false, code: "unsafe_screen_id", screenId: r3.screenId, ...v2.width ? { width: v2.width } : {}, error: `screen id "${r3.screenId}" would write outside .himi/renders and .himi/shots, so no PNG was written` }];
|
|
253817
253944
|
}
|
|
253818
253945
|
pngFile = own6;
|
|
@@ -253834,7 +253961,7 @@ async function printRenderBatch(ctx, o2) {
|
|
|
253834
253961
|
}
|
|
253835
253962
|
const renderedScreens = [...new Set(built.renders.map((r3) => r3.screenId))];
|
|
253836
253963
|
const findings = renderedScreens.flatMap((id) => lintOf(id));
|
|
253837
|
-
const ok5 = entries.length > 0 && entries.every((e2) => e2.ok === true) && !
|
|
253964
|
+
const ok5 = entries.length > 0 && entries.every((e2) => e2.ok === true) && !unsafe3;
|
|
253838
253965
|
const failedEntries = entries.filter((e2) => e2.ok !== true).length;
|
|
253839
253966
|
const legacy = {
|
|
253840
253967
|
ok: ok5,
|
|
@@ -254301,7 +254428,8 @@ async function uploadLargeAssets(client4, app2, uploads) {
|
|
|
254301
254428
|
uploadUrl: j2.uploadUrl,
|
|
254302
254429
|
method: typeof j2.method === "string" ? j2.method : "PUT",
|
|
254303
254430
|
headers: j2.headers && typeof j2.headers === "object" ? j2.headers : {},
|
|
254304
|
-
...typeof j2.auth === "string" ? { auth: j2.auth } : {}
|
|
254431
|
+
...typeof j2.auth === "string" ? { auth: j2.auth } : {},
|
|
254432
|
+
...typeof j2.encoding === "string" ? { encoding: j2.encoding } : {}
|
|
254305
254433
|
}, bytes2);
|
|
254306
254434
|
const wait = busyRetryAfterSec(put);
|
|
254307
254435
|
if (wait === void 0 || waited + wait > LARGE_ASSET_BUSY_MAX_TOTAL_WAIT_SEC) break;
|
|
@@ -254350,7 +254478,7 @@ var LARGE_ASSET_BUSY_MAX_TOTAL_WAIT_SEC, LARGE_ASSET_BUSY_MAX_WAIT_SEC, sleep4;
|
|
|
254350
254478
|
var init_large_assets = __esm({
|
|
254351
254479
|
"../serve-cli/src/large-assets.ts"() {
|
|
254352
254480
|
init_define_HHP_CATALOG();
|
|
254353
|
-
LARGE_ASSET_BUSY_MAX_TOTAL_WAIT_SEC =
|
|
254481
|
+
LARGE_ASSET_BUSY_MAX_TOTAL_WAIT_SEC = 480;
|
|
254354
254482
|
LARGE_ASSET_BUSY_MAX_WAIT_SEC = 15;
|
|
254355
254483
|
sleep4 = (ms2) => new Promise((r3) => setTimeout(r3, ms2));
|
|
254356
254484
|
}
|
|
@@ -299635,14 +299763,14 @@ async function l10nCommand(ctx) {
|
|
|
299635
299763
|
}
|
|
299636
299764
|
const { convertOneApp: convertOneApp2, undeclaredLocales: undeclaredLocales2 } = await Promise.resolve().then(() => (init_import_oneapp(), import_oneapp_exports));
|
|
299637
299765
|
const existing = {};
|
|
299638
|
-
let
|
|
299766
|
+
let unsafe3;
|
|
299639
299767
|
try {
|
|
299640
|
-
|
|
299768
|
+
unsafe3 = unsafeDestination(appDir3, requested);
|
|
299641
299769
|
} catch (e2) {
|
|
299642
299770
|
return fail16("catalog_write_failed", { error: `cannot inspect ${relative37(process.cwd(), join188(appDir3, "l10n"))}: ${e2.message}`, written: [] }, 1);
|
|
299643
299771
|
}
|
|
299644
|
-
if (
|
|
299645
|
-
return fail16("unsafe_path", { error: `${
|
|
299772
|
+
if (unsafe3 !== void 0) {
|
|
299773
|
+
return fail16("unsafe_path", { error: `${unsafe3} \u2014 the import does not read or write through links`, hint: "replace the link with a real directory/file inside the app, then re-run" }, 1);
|
|
299646
299774
|
}
|
|
299647
299775
|
for (const tag of requested) {
|
|
299648
299776
|
const path2 = join188(appDir3, "l10n", `${tag}.json`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1863.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": "
|
|
85
|
+
"falconPackageHash": "779f9ae30dffb8ba9f55210b8d375a9b58fe12ddd76e3879d33ae974"
|
|
86
86
|
}
|