@wix/himalaya-cli 0.1855.0 → 0.1856.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/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{fb500748f6c4768468f2e7f985aa67c38633077c7a98caaa6b500c7b00eea8e9.bin → c1f008be31a41521c6de7c1afad419a1f4dad53cbc2701a14738d5b22f291463.bin} +1 -1
- package/dist/browser-plane/sw.js +10 -10
- package/dist/cli.mjs +596 -309
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/himi-json-output.md +2 -2
- package/guides/one-app-to-himi-app.md +1 -1
- package/package.json +2 -2
- package/templates/bare-fashion/tier5-src/himi-bare-fashion-home/index.ts +5 -2
- package/templates/branded-lite/l10n/ar.json +15 -10
- package/templates/branded-lite/l10n/cs.json +15 -10
- package/templates/branded-lite/l10n/da.json +15 -10
- package/templates/branded-lite/l10n/de.json +15 -10
- package/templates/branded-lite/l10n/el.json +15 -10
- package/templates/branded-lite/l10n/es.json +15 -10
- package/templates/branded-lite/l10n/fi.json +15 -10
- package/templates/branded-lite/l10n/fr.json +15 -10
- package/templates/branded-lite/l10n/he.json +12 -8
- package/templates/branded-lite/l10n/hu.json +15 -10
- package/templates/branded-lite/l10n/id.json +15 -10
- package/templates/branded-lite/l10n/it.json +15 -10
- package/templates/branded-lite/l10n/ja.json +15 -10
- package/templates/branded-lite/l10n/ko.json +15 -10
- package/templates/branded-lite/l10n/lt.json +15 -10
- package/templates/branded-lite/l10n/nl.json +15 -10
- package/templates/branded-lite/l10n/no.json +15 -10
- package/templates/branded-lite/l10n/pl.json +15 -10
- package/templates/branded-lite/l10n/pt.json +15 -10
- package/templates/branded-lite/l10n/ru.json +15 -10
- package/templates/branded-lite/l10n/sv.json +15 -10
- package/templates/branded-lite/l10n/th.json +15 -10
- package/templates/branded-lite/l10n/tr.json +15 -10
- package/templates/branded-lite/l10n/uk.json +15 -10
- package/templates/branded-lite/l10n/vi.json +15 -10
- package/templates/branded-lite/l10n/zh.json +15 -10
- package/templates/branded-lite/recipes/performance-tracker.json +464 -75
- package/templates/branded-lite/tier5-src/_shared/performance-tracker-goal.ts +57 -0
- package/templates/branded-lite/tier5-src/_shared/performance-tracker-section.ts +124 -49
- package/templates/branded-lite/tier5-src/_shared/performance-tracker-weeks.ts +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -3007,12 +3007,13 @@ async function retainedReleaseRefs(store, app2, keepRecent = 20, keepReleaseIds
|
|
|
3007
3007
|
}
|
|
3008
3008
|
return refs;
|
|
3009
3009
|
}
|
|
3010
|
-
var TEMPLATE_APP_PREFIX;
|
|
3010
|
+
var INLINE_ASSET_MAX_BYTES, TEMPLATE_APP_PREFIX;
|
|
3011
3011
|
var init_store = __esm({
|
|
3012
3012
|
"../../core/serve-storage/src/store.ts"() {
|
|
3013
3013
|
init_define_HHP_CATALOG();
|
|
3014
3014
|
init_ownership2();
|
|
3015
3015
|
init_wip_pointer();
|
|
3016
|
+
INLINE_ASSET_MAX_BYTES = 4 * 1024 * 1024;
|
|
3016
3017
|
TEMPLATE_APP_PREFIX = "himi-template-";
|
|
3017
3018
|
}
|
|
3018
3019
|
});
|
|
@@ -147715,7 +147716,9 @@ var init_runtimeCopy_generated = __esm({
|
|
|
147715
147716
|
"runtime.nav.dismiss": "Dismiss",
|
|
147716
147717
|
"runtime.nav.dismissMenu": "Dismiss menu",
|
|
147717
147718
|
"runtime.nav.dismissSheet": "Dismiss sheet",
|
|
147719
|
+
"runtime.nav.done": "Done",
|
|
147718
147720
|
"runtime.nav.drawer": "Navigation",
|
|
147721
|
+
"runtime.nav.edit": "Edit",
|
|
147719
147722
|
"runtime.nav.hostedAppFailed": "Couldn't open {title}.",
|
|
147720
147723
|
"runtime.nav.jumpToLatest": "Jump to latest",
|
|
147721
147724
|
"runtime.nav.menu": "Menu",
|
|
@@ -147727,7 +147730,14 @@ var init_runtimeCopy_generated = __esm({
|
|
|
147727
147730
|
"runtime.nav.screenBlocked": "This screen's address can't be opened here.",
|
|
147728
147731
|
"runtime.nav.screenFailed": "This screen couldn't render.",
|
|
147729
147732
|
"runtime.nav.search": "Search",
|
|
147733
|
+
"runtime.nav.searchClear": "Clear",
|
|
147734
|
+
"runtime.nav.searchError": "Results weren't loaded due to a technical issue. Wait and try again.",
|
|
147735
|
+
"runtime.nav.searchNoResults": "No results",
|
|
147736
|
+
"runtime.nav.searchRecents": "Recent searches",
|
|
147737
|
+
"runtime.nav.searchTryAgain": "Try Again",
|
|
147738
|
+
"runtime.nav.selectionCount": "{count} selected",
|
|
147730
147739
|
"runtime.nav.showActions": "Show actions",
|
|
147740
|
+
"runtime.nav.stillSaving": "Still saving\u2026",
|
|
147731
147741
|
"runtime.nav.thisApp": "this app",
|
|
147732
147742
|
"runtime.nav.toggleSidebar": "Toggle sidebar",
|
|
147733
147743
|
"runtime.nav.voiceSearch": "Voice search",
|
|
@@ -153808,7 +153818,7 @@ var init_src6 = __esm({
|
|
|
153808
153818
|
});
|
|
153809
153819
|
|
|
153810
153820
|
// ../../core/serve-storage/src/file-store.ts
|
|
153811
|
-
import { mkdirSync as mkdirSync22, readFileSync as readFileSync44, rmSync as rmSync12, writeFileSync as writeFileSync17, readdirSync as readdirSync25, existsSync as existsSync41 } from "node:fs";
|
|
153821
|
+
import { mkdirSync as mkdirSync22, readFileSync as readFileSync44, rmSync as rmSync12, writeFileSync as writeFileSync17, readdirSync as readdirSync25, existsSync as existsSync41, statSync as statSync10 } from "node:fs";
|
|
153812
153822
|
import { join as join36, resolve as resolve35, sep as sep12 } from "node:path";
|
|
153813
153823
|
var FileReleaseStore;
|
|
153814
153824
|
var init_file_store = __esm({
|
|
@@ -153980,11 +153990,17 @@ var init_file_store = __esm({
|
|
|
153980
153990
|
async getSource(app2, sha2569) {
|
|
153981
153991
|
return this.getDoc(app2, sha2569);
|
|
153982
153992
|
}
|
|
153983
|
-
async getAsset(app2, sha2569) {
|
|
153993
|
+
async getAsset(app2, sha2569, maxBytes) {
|
|
153994
|
+
if (maxBytes !== void 0) {
|
|
153995
|
+
const path2 = join36(this.appDir(app2), "assets", this.safe(sha2569));
|
|
153996
|
+
if (existsSync41(path2) && statSync10(path2).size > maxBytes) return null;
|
|
153997
|
+
}
|
|
153984
153998
|
return this.read(app2, "assets", this.safe(sha2569));
|
|
153985
153999
|
}
|
|
153986
|
-
async hasAsset(app2, sha2569) {
|
|
153987
|
-
|
|
154000
|
+
async hasAsset(app2, sha2569, bytes2) {
|
|
154001
|
+
const path2 = join36(this.appDir(app2), "assets", this.safe(sha2569));
|
|
154002
|
+
if (!existsSync41(path2)) return false;
|
|
154003
|
+
return bytes2 === void 0 || statSync10(path2).size === bytes2;
|
|
153988
154004
|
}
|
|
153989
154005
|
async listApps() {
|
|
153990
154006
|
try {
|
|
@@ -155879,9 +155895,9 @@ function localDatabaseAnswer(schema2, store, queue, method, params) {
|
|
|
155879
155895
|
case "queueDepth":
|
|
155880
155896
|
return { depth: queue.length };
|
|
155881
155897
|
case "queueDrain": {
|
|
155882
|
-
const
|
|
155898
|
+
const drained2 = queue.length;
|
|
155883
155899
|
queue.length = 0;
|
|
155884
|
-
return { drained };
|
|
155900
|
+
return { drained: drained2 };
|
|
155885
155901
|
}
|
|
155886
155902
|
// #5776 — principal-bound writes. A crawl session has one principal for life, so its token is
|
|
155887
155903
|
// constant and a bound write always matches; a foreign token is refused as the runtimes refuse it.
|
|
@@ -161788,7 +161804,7 @@ __export(studio_exports, {
|
|
|
161788
161804
|
writeStudioRecord: () => writeStudioRecord
|
|
161789
161805
|
});
|
|
161790
161806
|
import { createHash as createHash25 } from "node:crypto";
|
|
161791
|
-
import { existsSync as existsSync46, readdirSync as readdirSync28, readFileSync as readFileSync49, realpathSync as realpathSync7, statSync as
|
|
161807
|
+
import { existsSync as existsSync46, readdirSync as readdirSync28, readFileSync as readFileSync49, realpathSync as realpathSync7, statSync as statSync11 } from "node:fs";
|
|
161792
161808
|
import { basename as basename12, extname as extname3, join as join41, relative as relative11, resolve as resolve37, sep as sep14 } from "node:path";
|
|
161793
161809
|
import { pathToFileURL as pathToFileURL6 } from "node:url";
|
|
161794
161810
|
function realInside(dir, abs) {
|
|
@@ -161807,7 +161823,7 @@ function archiveFile(dir, memory2, abs) {
|
|
|
161807
161823
|
let mtimeMs;
|
|
161808
161824
|
let ino;
|
|
161809
161825
|
try {
|
|
161810
|
-
({ size, mtimeMs, ino } =
|
|
161826
|
+
({ size, mtimeMs, ino } = statSync11(real));
|
|
161811
161827
|
} catch {
|
|
161812
161828
|
return null;
|
|
161813
161829
|
}
|
|
@@ -161875,7 +161891,7 @@ function appIdentity(dir) {
|
|
|
161875
161891
|
const icon = text2(manifest2?.icon)?.trim();
|
|
161876
161892
|
const iconPath = icon ? resolve37(dir, icon) : null;
|
|
161877
161893
|
const real = iconPath ? realInside(dir, iconPath) : null;
|
|
161878
|
-
return { name, iconFile: real &&
|
|
161894
|
+
return { name, iconFile: real && statSync11(real).isFile() ? iconPath : null };
|
|
161879
161895
|
}
|
|
161880
161896
|
function testRuns(dir) {
|
|
161881
161897
|
const att = join41(dir, ".himi", "attestations");
|
|
@@ -162776,7 +162792,7 @@ var init_cli_shared = __esm({
|
|
|
162776
162792
|
});
|
|
162777
162793
|
|
|
162778
162794
|
// src/self-update.ts
|
|
162779
|
-
import { readFileSync as readFileSync51, mkdirSync as mkdirSync24, writeFileSync as writeFileSync19, existsSync as existsSync48, rmSync as rmSync14, statSync as
|
|
162795
|
+
import { readFileSync as readFileSync51, mkdirSync as mkdirSync24, writeFileSync as writeFileSync19, existsSync as existsSync48, rmSync as rmSync14, statSync as statSync12, accessSync, constants as constants2 } from "node:fs";
|
|
162780
162796
|
import { execFile, execFileSync as execFileSync3, spawnSync as spawnSync6 } from "node:child_process";
|
|
162781
162797
|
import { randomUUID as randomUUID7 } from "node:crypto";
|
|
162782
162798
|
import { homedir as homedir8, hostname } from "node:os";
|
|
@@ -163081,7 +163097,7 @@ function staleUpdateLockFile(cachePath, now) {
|
|
|
163081
163097
|
let since = stamped;
|
|
163082
163098
|
if (!Number.isFinite(since)) {
|
|
163083
163099
|
try {
|
|
163084
|
-
since =
|
|
163100
|
+
since = statSync12(path2).mtimeMs;
|
|
163085
163101
|
} catch {
|
|
163086
163102
|
continue;
|
|
163087
163103
|
}
|
|
@@ -163418,7 +163434,7 @@ __export(wix_owner_exports, {
|
|
|
163418
163434
|
});
|
|
163419
163435
|
import { spawn as spawn3 } from "node:child_process";
|
|
163420
163436
|
import { createHash as createHash26 } from "node:crypto";
|
|
163421
|
-
import { accessSync as accessSync2, constants as fsConstants, statSync as
|
|
163437
|
+
import { accessSync as accessSync2, constants as fsConstants, statSync as statSync13 } from "node:fs";
|
|
163422
163438
|
import { delimiter, join as join44 } from "node:path";
|
|
163423
163439
|
function resolveSiteId(flag3) {
|
|
163424
163440
|
const id = flag3?.trim() || process.env.WIX_SITE_ID?.trim();
|
|
@@ -163554,7 +163570,7 @@ function wixCliOnPath(env = process.env) {
|
|
|
163554
163570
|
for (const ext of exts) {
|
|
163555
163571
|
try {
|
|
163556
163572
|
const candidate = join44(dir, `wix${ext}`);
|
|
163557
|
-
if (!
|
|
163573
|
+
if (!statSync13(candidate).isFile()) continue;
|
|
163558
163574
|
if (process.platform !== "win32") accessSync2(candidate, fsConstants.X_OK);
|
|
163559
163575
|
return true;
|
|
163560
163576
|
} catch {
|
|
@@ -171449,7 +171465,7 @@ var init_customer_signing_inspect = __esm({
|
|
|
171449
171465
|
});
|
|
171450
171466
|
|
|
171451
171467
|
// src/push-onboarding.ts
|
|
171452
|
-
import { existsSync as existsSync52, mkdirSync as mkdirSync25, readFileSync as readFileSync55, statSync as
|
|
171468
|
+
import { existsSync as existsSync52, mkdirSync as mkdirSync25, readFileSync as readFileSync55, statSync as statSync14, writeFileSync as writeFileSync20, chmodSync as chmodSync2 } from "node:fs";
|
|
171453
171469
|
import { basename as basename14, dirname as dirname31, join as join45, resolve as resolve42 } from "node:path";
|
|
171454
171470
|
function parsePushPlatforms(v2) {
|
|
171455
171471
|
if (v2 === void 0) return { ok: true };
|
|
@@ -171554,7 +171570,7 @@ function localIdentityRefusal(i2) {
|
|
|
171554
171570
|
function readKeyFile(path2) {
|
|
171555
171571
|
let size;
|
|
171556
171572
|
try {
|
|
171557
|
-
size =
|
|
171573
|
+
size = statSync14(path2).size;
|
|
171558
171574
|
} catch {
|
|
171559
171575
|
return { ok: false, code: "key_file_unreadable", reason: "cannot read the selected key file; check its path and file permissions" };
|
|
171560
171576
|
}
|
|
@@ -171751,7 +171767,7 @@ var signing_inspect_exports = {};
|
|
|
171751
171767
|
__export(signing_inspect_exports, {
|
|
171752
171768
|
runSigningInspect: () => runSigningInspect
|
|
171753
171769
|
});
|
|
171754
|
-
import { existsSync as existsSync53, readFileSync as readFileSync56, statSync as
|
|
171770
|
+
import { existsSync as existsSync53, readFileSync as readFileSync56, statSync as statSync15 } from "node:fs";
|
|
171755
171771
|
import { isAbsolute as isAbsolute6, resolve as resolve43 } from "node:path";
|
|
171756
171772
|
function fail5(io2, code3, fields2 = {}) {
|
|
171757
171773
|
io2.error(JSON.stringify({ ok: false, code: code3, ...fields2 }));
|
|
@@ -171844,7 +171860,7 @@ async function runSigningInspect(pos, flags, io2, deps = {}) {
|
|
|
171844
171860
|
if (!existsSync53(certPath) || !existsSync53(profilePath2)) {
|
|
171845
171861
|
return fail5(io2, "signing_inspect_local_assets_unreadable", { error: "cannot read --cert-file or --profile-file" });
|
|
171846
171862
|
}
|
|
171847
|
-
if (
|
|
171863
|
+
if (statSync15(certPath).size > 1048576 || statSync15(profilePath2).size > 1048576) {
|
|
171848
171864
|
return fail5(io2, "signing_inspect_local_assets_unreadable", { error: "cert or profile file is unexpectedly large" });
|
|
171849
171865
|
}
|
|
171850
171866
|
assets = {
|
|
@@ -172391,7 +172407,7 @@ __export(template_trim_exports, {
|
|
|
172391
172407
|
trimCapabilities: () => trimCapabilities,
|
|
172392
172408
|
workersInUse: () => workersInUse
|
|
172393
172409
|
});
|
|
172394
|
-
import { cpSync, existsSync as existsSync54, mkdirSync as mkdirSync26, readdirSync as readdirSync30, readFileSync as readFileSync58, renameSync as renameSync10, rmSync as rmSync15, statSync as
|
|
172410
|
+
import { cpSync, existsSync as existsSync54, mkdirSync as mkdirSync26, readdirSync as readdirSync30, readFileSync as readFileSync58, renameSync as renameSync10, rmSync as rmSync15, statSync as statSync16, writeFileSync as writeFileSync22 } from "node:fs";
|
|
172395
172411
|
import { dirname as dirname32, join as join47 } from "node:path";
|
|
172396
172412
|
import ts9 from "typescript";
|
|
172397
172413
|
function routeMatcher(pattern) {
|
|
@@ -173304,14 +173320,14 @@ function homeModulesPass(app2, kept, edited) {
|
|
|
173304
173320
|
function listWorkers(dir) {
|
|
173305
173321
|
const root = join47(dir, "tier5-src");
|
|
173306
173322
|
if (!existsSync54(root)) return { dirs: [], files: {} };
|
|
173307
|
-
const dirs = readdirSync30(root).filter((n2) =>
|
|
173323
|
+
const dirs = readdirSync30(root).filter((n2) => statSync16(join47(root, n2)).isDirectory()).sort();
|
|
173308
173324
|
const files = {};
|
|
173309
173325
|
const walk5 = (abs, rel2) => {
|
|
173310
173326
|
for (const name of readdirSync30(abs)) {
|
|
173311
173327
|
if (name === "node_modules") continue;
|
|
173312
173328
|
const p2 = join47(abs, name);
|
|
173313
173329
|
const r3 = `${rel2}/${name}`;
|
|
173314
|
-
if (
|
|
173330
|
+
if (statSync16(p2).isDirectory()) walk5(p2, r3);
|
|
173315
173331
|
else if (/\.(?:[cm]?[jt]sx?|json)$/.test(name)) files[r3] = readFileSync58(p2, "utf8");
|
|
173316
173332
|
}
|
|
173317
173333
|
};
|
|
@@ -173747,7 +173763,7 @@ __export(template_adopt_exports, {
|
|
|
173747
173763
|
writeInventory: () => writeInventory,
|
|
173748
173764
|
writeNoFollow: () => writeNoFollow
|
|
173749
173765
|
});
|
|
173750
|
-
import { existsSync as existsSync55, lstatSync as lstatSync19, mkdirSync as mkdirSync27, readdirSync as readdirSync31, readFileSync as readFileSync59, renameSync as renameSync11, statSync as
|
|
173766
|
+
import { existsSync as existsSync55, lstatSync as lstatSync19, mkdirSync as mkdirSync27, readdirSync as readdirSync31, readFileSync as readFileSync59, renameSync as renameSync11, statSync as statSync17, writeFileSync as writeFileSync23 } from "node:fs";
|
|
173751
173767
|
import { dirname as dirname33, join as join48, posix as posix2, relative as relative13 } from "node:path";
|
|
173752
173768
|
import ts10 from "typescript";
|
|
173753
173769
|
function readAppSources(dir) {
|
|
@@ -173761,14 +173777,14 @@ function readAppSources(dir) {
|
|
|
173761
173777
|
if (existsSync55(root)) {
|
|
173762
173778
|
for (const name of readdirSync31(root).sort()) {
|
|
173763
173779
|
const abs = join48(root, name);
|
|
173764
|
-
if (!
|
|
173780
|
+
if (!statSync17(abs).isDirectory()) continue;
|
|
173765
173781
|
const files = {};
|
|
173766
173782
|
const walk5 = (a3, rel2) => {
|
|
173767
173783
|
for (const n2 of readdirSync31(a3).sort()) {
|
|
173768
173784
|
if (n2 === "node_modules") continue;
|
|
173769
173785
|
const p2 = join48(a3, n2);
|
|
173770
173786
|
const r3 = `${rel2}/${n2}`;
|
|
173771
|
-
if (
|
|
173787
|
+
if (statSync17(p2).isDirectory()) walk5(p2, r3);
|
|
173772
173788
|
else if (/\.(?:[cm]?[jt]sx?)$/.test(n2)) files[r3] = readFileSync59(p2, "utf8");
|
|
173773
173789
|
}
|
|
173774
173790
|
};
|
|
@@ -173921,7 +173937,7 @@ function walkPackage(dir, rel2 = "") {
|
|
|
173921
173937
|
if (IGNORED.has(n2)) continue;
|
|
173922
173938
|
const r3 = rel2 ? `${rel2}/${n2}` : n2;
|
|
173923
173939
|
const abs = join48(dir, r3);
|
|
173924
|
-
if (
|
|
173940
|
+
if (statSync17(abs).isDirectory()) out2.push(...walkPackage(dir, r3));
|
|
173925
173941
|
else if (/\.(?:tsx?|jsx?|json)$/.test(n2)) out2.push(r3);
|
|
173926
173942
|
}
|
|
173927
173943
|
return out2;
|
|
@@ -175621,7 +175637,7 @@ __export(icon_exports, {
|
|
|
175621
175637
|
writePreparedIcon: () => writePreparedIcon
|
|
175622
175638
|
});
|
|
175623
175639
|
import { createHash as createHash29 } from "node:crypto";
|
|
175624
|
-
import { accessSync as accessSync3, constants as constants4, existsSync as existsSync57, mkdirSync as mkdirSync28, readFileSync as readFileSync61, statSync as
|
|
175640
|
+
import { accessSync as accessSync3, constants as constants4, existsSync as existsSync57, mkdirSync as mkdirSync28, readFileSync as readFileSync61, statSync as statSync18, writeFileSync as writeFileSync24 } from "node:fs";
|
|
175625
175641
|
import { basename as basename15, dirname as dirname35, join as join49, resolve as resolve45, sep as sep16 } from "node:path";
|
|
175626
175642
|
function readManifest(dir) {
|
|
175627
175643
|
try {
|
|
@@ -175651,7 +175667,7 @@ function templateIconMatch(png) {
|
|
|
175651
175667
|
for (const template of availableTemplates()) {
|
|
175652
175668
|
const candidate = join49(templateSourceDir(template), DEFAULT_CONTENT_ICON);
|
|
175653
175669
|
try {
|
|
175654
|
-
if (
|
|
175670
|
+
if (statSync18(candidate).size !== png.length) continue;
|
|
175655
175671
|
if (readFileSync61(candidate).equals(png)) return template;
|
|
175656
175672
|
} catch {
|
|
175657
175673
|
}
|
|
@@ -175662,7 +175678,7 @@ function playState(dir) {
|
|
|
175662
175678
|
const p2 = join49(resolve45(dir), PLAY_LISTING_ICON);
|
|
175663
175679
|
if (!existsSync57(p2)) return null;
|
|
175664
175680
|
try {
|
|
175665
|
-
if (!
|
|
175681
|
+
if (!statSync18(p2).isFile()) return { path: p2, issues: ["is a directory, not a PNG file"] };
|
|
175666
175682
|
return { path: p2, issues: playListingIconIssues(readFileSync61(p2)) };
|
|
175667
175683
|
} catch (err) {
|
|
175668
175684
|
return { path: p2, issues: [`could not be read (${err.message.split("\n")[0]})`] };
|
|
@@ -175689,7 +175705,7 @@ async function iconStatus(dir) {
|
|
|
175689
175705
|
if (!path2 || !existsSync57(path2)) return base2;
|
|
175690
175706
|
let png;
|
|
175691
175707
|
try {
|
|
175692
|
-
if (!
|
|
175708
|
+
if (!statSync18(path2).isFile()) {
|
|
175693
175709
|
return {
|
|
175694
175710
|
...base2,
|
|
175695
175711
|
byteIssues: [`at ${path2} is a directory, not a PNG file`],
|
|
@@ -175814,7 +175830,7 @@ function writePreparedIcon(dir, master, play) {
|
|
|
175814
175830
|
];
|
|
175815
175831
|
for (const path2 of targets) {
|
|
175816
175832
|
if (existsSync57(path2)) {
|
|
175817
|
-
if (!
|
|
175833
|
+
if (!statSync18(path2).isFile()) throw new Error(`himi icon: destination is not a regular file: ${path2}`);
|
|
175818
175834
|
accessSync3(path2, constants4.W_OK);
|
|
175819
175835
|
} else accessSync3(dirname35(path2), constants4.W_OK);
|
|
175820
175836
|
}
|
|
@@ -180582,7 +180598,7 @@ __export(pack_exports, {
|
|
|
180582
180598
|
});
|
|
180583
180599
|
import { createHash as createHash30 } from "node:crypto";
|
|
180584
180600
|
import { deflateRawSync, inflateRawSync } from "node:zlib";
|
|
180585
|
-
import { existsSync as existsSync62, mkdirSync as mkdirSync31, readFileSync as readFileSync66, readdirSync as readdirSync32, rmSync as rmSync18, statSync as
|
|
180601
|
+
import { existsSync as existsSync62, mkdirSync as mkdirSync31, readFileSync as readFileSync66, readdirSync as readdirSync32, rmSync as rmSync18, statSync as statSync19, writeFileSync as writeFileSync27 } from "node:fs";
|
|
180586
180602
|
import { dirname as dirname38, join as join55, resolve as resolve47 } from "node:path";
|
|
180587
180603
|
function writeZip(entries) {
|
|
180588
180604
|
const sorted3 = entries.slice().sort((a3, b3) => a3.path < b3.path ? -1 : a3.path > b3.path ? 1 : 0);
|
|
@@ -180677,10 +180693,10 @@ function inflateEntry(buf, entry) {
|
|
|
180677
180693
|
return bytes2;
|
|
180678
180694
|
}
|
|
180679
180695
|
function readIf(path2) {
|
|
180680
|
-
return existsSync62(path2) &&
|
|
180696
|
+
return existsSync62(path2) && statSync19(path2).isFile() ? readFileSync66(path2) : null;
|
|
180681
180697
|
}
|
|
180682
180698
|
function listDir(dir) {
|
|
180683
|
-
return existsSync62(dir) ? readdirSync32(dir).filter((f2) =>
|
|
180699
|
+
return existsSync62(dir) ? readdirSync32(dir).filter((f2) => statSync19(join55(dir, f2)).isFile()) : [];
|
|
180684
180700
|
}
|
|
180685
180701
|
function gatherReleaseEntries(appDir3) {
|
|
180686
180702
|
const manifestPath = join55(appDir3, HIMI_PACKAGE_MANIFEST_PATH);
|
|
@@ -180759,7 +180775,7 @@ function packRelease(releaseRoot, app2, out2, opts = {}) {
|
|
|
180759
180775
|
const appDir3 = join55(resolve47(releaseRoot), app2);
|
|
180760
180776
|
const { all, header: header2, skipped } = buildEntries(appDir3, app2, opts);
|
|
180761
180777
|
const buf = writeZip(all);
|
|
180762
|
-
const isDir3 = existsSync62(out2) &&
|
|
180778
|
+
const isDir3 = existsSync62(out2) && statSync19(out2).isDirectory();
|
|
180763
180779
|
const outFile = isDir3 ? join55(resolve47(out2), packageFileName(app2, header2.releaseId)) : resolve47(out2);
|
|
180764
180780
|
mkdirSync31(dirname38(outFile), { recursive: true });
|
|
180765
180781
|
writeFileSync27(outFile, buf);
|
|
@@ -180777,10 +180793,10 @@ function resolvePackageDirDest(outDir, app2, releaseId) {
|
|
|
180777
180793
|
};
|
|
180778
180794
|
const replaceable = (dir) => {
|
|
180779
180795
|
if (!existsSync62(dir)) return true;
|
|
180780
|
-
if (!
|
|
180796
|
+
if (!statSync19(dir).isDirectory()) return false;
|
|
180781
180797
|
return readdirSync32(dir).length === 0 || packagedApp(dir) === app2;
|
|
180782
180798
|
};
|
|
180783
|
-
if (existsSync62(outDir) && !
|
|
180799
|
+
if (existsSync62(outDir) && !statSync19(outDir).isDirectory()) {
|
|
180784
180800
|
throw new Error(`refusing to write a package tree over ${outDir} \u2014 it is a file, not a directory`);
|
|
180785
180801
|
}
|
|
180786
180802
|
if (replaceable(outDir)) return outDir;
|
|
@@ -180837,7 +180853,7 @@ function openPackageDir(dir) {
|
|
|
180837
180853
|
for (const name of readdirSync32(abs)) {
|
|
180838
180854
|
const childRel = rel2 ? `${rel2}/${name}` : name;
|
|
180839
180855
|
const childAbs = join55(abs, name);
|
|
180840
|
-
if (
|
|
180856
|
+
if (statSync19(childAbs).isDirectory()) walk5(childRel);
|
|
180841
180857
|
else if (isSafeEntryName(childRel)) entries.set(childRel, readFileSync66(childAbs));
|
|
180842
180858
|
}
|
|
180843
180859
|
};
|
|
@@ -181222,7 +181238,7 @@ __export(run_watch_exports, {
|
|
|
181222
181238
|
watchedContentDir: () => watchedContentDir,
|
|
181223
181239
|
writeRunRecord: () => writeRunRecord
|
|
181224
181240
|
});
|
|
181225
|
-
import { closeSync as closeSync5, constants as constants5, existsSync as existsSync64, fstatSync as fstatSync2, lstatSync as lstatSync21, statSync as
|
|
181241
|
+
import { closeSync as closeSync5, constants as constants5, existsSync as existsSync64, fstatSync as fstatSync2, lstatSync as lstatSync21, statSync as statSync20, readdirSync as readdirSync34, mkdirSync as mkdirSync33, openSync as openSync5, readFileSync as readFileSync68, realpathSync as realpathSync9, renameSync as renameSync12, rmSync as rmSync20, writeFileSync as writeFileSync29, watch as fsWatch } from "node:fs";
|
|
181226
181242
|
import { randomUUID as randomUUID9 } from "node:crypto";
|
|
181227
181243
|
import { extname as extname4, join as join57, relative as relative14, resolve as resolve49, sep as sep19 } from "node:path";
|
|
181228
181244
|
function diffReleases(prev, next) {
|
|
@@ -181341,7 +181357,7 @@ function watchedContentDir(source2) {
|
|
|
181341
181357
|
if (!source2 || /^https?:\/\//i.test(source2)) return null;
|
|
181342
181358
|
const dir = resolve49(source2);
|
|
181343
181359
|
try {
|
|
181344
|
-
return
|
|
181360
|
+
return statSync20(dir).isDirectory() && existsSync64(join57(dir, "himalaya.content.json")) ? dir : null;
|
|
181345
181361
|
} catch {
|
|
181346
181362
|
return null;
|
|
181347
181363
|
}
|
|
@@ -181523,7 +181539,7 @@ var init_run_watch = __esm({
|
|
|
181523
181539
|
};
|
|
181524
181540
|
isDir = (path2) => {
|
|
181525
181541
|
try {
|
|
181526
|
-
return
|
|
181542
|
+
return statSync20(path2).isDirectory();
|
|
181527
181543
|
} catch {
|
|
181528
181544
|
return false;
|
|
181529
181545
|
}
|
|
@@ -182006,7 +182022,7 @@ __export(milestones_exports, {
|
|
|
182006
182022
|
});
|
|
182007
182023
|
import { createHash as createHash34, randomUUID as randomUUID10 } from "node:crypto";
|
|
182008
182024
|
import { spawn as spawn4 } from "node:child_process";
|
|
182009
|
-
import { closeSync as closeSync6, existsSync as existsSync65, lstatSync as lstatSync24, readFileSync as readFileSync72, statSync as
|
|
182025
|
+
import { closeSync as closeSync6, existsSync as existsSync65, lstatSync as lstatSync24, readFileSync as readFileSync72, statSync as statSync21 } from "node:fs";
|
|
182010
182026
|
import { createServer as createServer3 } from "node:net";
|
|
182011
182027
|
import { basename as basename18, dirname as dirname39, isAbsolute as isAbsolute8, join as join61, relative as relative15, resolve as resolve50, sep as sep20 } from "node:path";
|
|
182012
182028
|
function homeShotPath(dir, home2) {
|
|
@@ -182085,7 +182101,7 @@ async function renderHomeInChild(dir, home2, opts) {
|
|
|
182085
182101
|
}
|
|
182086
182102
|
let fresh = false;
|
|
182087
182103
|
try {
|
|
182088
|
-
fresh =
|
|
182104
|
+
fresh = statSync21(shot).mtimeMs >= started - 1e3;
|
|
182089
182105
|
} catch {
|
|
182090
182106
|
}
|
|
182091
182107
|
if (code3 === 0 && fresh) {
|
|
@@ -182294,7 +182310,7 @@ function afterBrowserTestRun(dir, input) {
|
|
|
182294
182310
|
function shotIsCurrent(shot, sourceChangedAtMs) {
|
|
182295
182311
|
if (sourceChangedAtMs === void 0) return false;
|
|
182296
182312
|
try {
|
|
182297
|
-
return
|
|
182313
|
+
return statSync21(shot).mtimeMs >= sourceChangedAtMs;
|
|
182298
182314
|
} catch {
|
|
182299
182315
|
return false;
|
|
182300
182316
|
}
|
|
@@ -182669,7 +182685,7 @@ function afterHandoverPostcard(dir, opts = {}) {
|
|
|
182669
182685
|
let fresh = false;
|
|
182670
182686
|
try {
|
|
182671
182687
|
const st2 = lstatSync24(file2);
|
|
182672
|
-
fresh = st2.isFile() && !st2.isSymbolicLink() && st2.mtimeMs >=
|
|
182688
|
+
fresh = st2.isFile() && !st2.isSymbolicLink() && st2.mtimeMs >= statSync21(join61(dir, ".himi", "progress.jsonl")).mtimeMs;
|
|
182673
182689
|
} catch {
|
|
182674
182690
|
fresh = false;
|
|
182675
182691
|
}
|
|
@@ -182758,9 +182774,9 @@ function fromBase64(b642) {
|
|
|
182758
182774
|
}
|
|
182759
182775
|
function toBase64(bytes2) {
|
|
182760
182776
|
let bin = "";
|
|
182761
|
-
const
|
|
182762
|
-
for (let i2 = 0; i2 < bytes2.length; i2 +=
|
|
182763
|
-
bin += String.fromCharCode(...bytes2.subarray(i2, i2 +
|
|
182777
|
+
const CHUNK2 = 32768;
|
|
182778
|
+
for (let i2 = 0; i2 < bytes2.length; i2 += CHUNK2) {
|
|
182779
|
+
bin += String.fromCharCode(...bytes2.subarray(i2, i2 + CHUNK2));
|
|
182764
182780
|
}
|
|
182765
182781
|
return btoa(bin);
|
|
182766
182782
|
}
|
|
@@ -188893,7 +188909,7 @@ var init_localweb = __esm({
|
|
|
188893
188909
|
});
|
|
188894
188910
|
|
|
188895
188911
|
// ../native-config/capability-registrations.ts
|
|
188896
|
-
import { existsSync as existsSync76, readdirSync as readdirSync38, readFileSync as readFileSync83, statSync as
|
|
188912
|
+
import { existsSync as existsSync76, readdirSync as readdirSync38, readFileSync as readFileSync83, statSync as statSync22 } from "node:fs";
|
|
188897
188913
|
import { dirname as dirname42, join as join74, resolve as resolve53 } from "node:path";
|
|
188898
188914
|
import { fileURLToPath as fileURLToPath29 } from "node:url";
|
|
188899
188915
|
function registrarClasses(path2, re2) {
|
|
@@ -188958,7 +188974,7 @@ function filesWithRegisterMarkers(root, ext) {
|
|
|
188958
188974
|
} else {
|
|
188959
188975
|
stack.push([path2, depth + 1, "main"]);
|
|
188960
188976
|
}
|
|
188961
|
-
} else if (where === "main" && entry.isFile() && entry.name.endsWith(ext) &&
|
|
188977
|
+
} else if (where === "main" && entry.isFile() && entry.name.endsWith(ext) && statSync22(path2).size <= 1 << 20) {
|
|
188962
188978
|
if (readFileSync83(path2, "utf8").includes(`>>> ${LABEL_CAPABILITIES_REGISTER} `)) out2.push(path2);
|
|
188963
188979
|
}
|
|
188964
188980
|
}
|
|
@@ -190681,7 +190697,7 @@ __export(gen_native_config_exports, {
|
|
|
190681
190697
|
xmlAttr: () => xmlAttr2,
|
|
190682
190698
|
yamlScalar: () => yamlScalar
|
|
190683
190699
|
});
|
|
190684
|
-
import { existsSync as existsSync81, mkdirSync as mkdirSync34, readFileSync as readFileSync89, readdirSync as readdirSync40, rmSync as rmSync23, statSync as
|
|
190700
|
+
import { existsSync as existsSync81, mkdirSync as mkdirSync34, readFileSync as readFileSync89, readdirSync as readdirSync40, rmSync as rmSync23, statSync as statSync23, writeFileSync as writeFileSync34 } from "node:fs";
|
|
190685
190701
|
import { dirname as dirname45, join as join79 } from "node:path";
|
|
190686
190702
|
import { fileURLToPath as fileURLToPath30 } from "node:url";
|
|
190687
190703
|
import ts18 from "typescript";
|
|
@@ -191228,7 +191244,7 @@ function kotlinBootSourcesUnder(root) {
|
|
|
191228
191244
|
} else {
|
|
191229
191245
|
stack.push([path2, depth + 1, "main"]);
|
|
191230
191246
|
}
|
|
191231
|
-
} else if (where === "main" && entry.isFile() && entry.name.endsWith("Application.kt") &&
|
|
191247
|
+
} else if (where === "main" && entry.isFile() && entry.name.endsWith("Application.kt") && statSync23(path2).size <= BOOT_SOURCE_MAX_BYTES && readFileSync89(path2, "utf8").includes("installLinkedModules")) {
|
|
191232
191248
|
out2.push(path2);
|
|
191233
191249
|
}
|
|
191234
191250
|
}
|
|
@@ -191581,7 +191597,7 @@ function coreExtensionSourceRoots(projectYmlPath) {
|
|
|
191581
191597
|
if (t2.type !== "app-extension" || !(t2.dependencies ?? []).some((d2) => /^HimalayaCore/.test(d2.product ?? d2.package ?? ""))) continue;
|
|
191582
191598
|
const paths2 = (t2.sources ?? []).map((s5) => typeof s5 === "string" ? s5 : s5.path).filter((p2) => !!p2);
|
|
191583
191599
|
const infoDir = t2.info?.path ? dirname45(t2.info.path) : void 0;
|
|
191584
|
-
const root = paths2.find((p2) => p2 === infoDir) ?? paths2.find((p2) => existsSync81(join79(dir, p2)) &&
|
|
191600
|
+
const root = paths2.find((p2) => p2 === infoDir) ?? paths2.find((p2) => existsSync81(join79(dir, p2)) && statSync23(join79(dir, p2)).isDirectory());
|
|
191585
191601
|
if (!root) throw new Error(`${projectYmlPath}: app extension linking HimalayaCore has no source directory to bundle its privacy manifest from`);
|
|
191586
191602
|
roots2.push(join79(dir, root));
|
|
191587
191603
|
}
|
|
@@ -195296,7 +195312,7 @@ var init_diff_hash = __esm({
|
|
|
195296
195312
|
|
|
195297
195313
|
// src/attestation-lock.ts
|
|
195298
195314
|
import { randomBytes as randomBytes2 } from "node:crypto";
|
|
195299
|
-
import { closeSync as closeSync7, linkSync, openSync as openSync6, readFileSync as readFileSync98, renameSync as renameSync13, statSync as
|
|
195315
|
+
import { closeSync as closeSync7, linkSync, openSync as openSync6, readFileSync as readFileSync98, renameSync as renameSync13, statSync as statSync24, unlinkSync as unlinkSync4, writeSync } from "node:fs";
|
|
195300
195316
|
import { hostname as hostname2 } from "node:os";
|
|
195301
195317
|
import { join as join90 } from "node:path";
|
|
195302
195318
|
function sleepSync2(ms2) {
|
|
@@ -195324,7 +195340,7 @@ function processAlive3(pid) {
|
|
|
195324
195340
|
function isStale(path2, owner, staleMs, now) {
|
|
195325
195341
|
if (!owner) {
|
|
195326
195342
|
try {
|
|
195327
|
-
return now -
|
|
195343
|
+
return now - statSync24(path2).mtimeMs > UNREADABLE_STALE_MS;
|
|
195328
195344
|
} catch {
|
|
195329
195345
|
return false;
|
|
195330
195346
|
}
|
|
@@ -196157,7 +196173,7 @@ __export(desktop_measure_lint_exports, {
|
|
|
196157
196173
|
listRoot: () => listRoot,
|
|
196158
196174
|
readMeasures: () => readMeasures
|
|
196159
196175
|
});
|
|
196160
|
-
import { readFileSync as readFileSync103, statSync as
|
|
196176
|
+
import { readFileSync as readFileSync103, statSync as statSync25 } from "node:fs";
|
|
196161
196177
|
import { isAbsolute as isAbsolute12, resolve as resolve66, sep as sep25 } from "node:path";
|
|
196162
196178
|
function nodes2(root, at2) {
|
|
196163
196179
|
const out2 = [];
|
|
@@ -196228,7 +196244,7 @@ function readMeasures(dir, config, opts = {}) {
|
|
|
196228
196244
|
}
|
|
196229
196245
|
let size;
|
|
196230
196246
|
try {
|
|
196231
|
-
const st2 =
|
|
196247
|
+
const st2 = statSync25(file2);
|
|
196232
196248
|
if (!st2.isFile()) return DEFAULT_MEASURES;
|
|
196233
196249
|
size = st2.size;
|
|
196234
196250
|
} catch {
|
|
@@ -198162,7 +198178,7 @@ var init_cli_bridge = __esm({
|
|
|
198162
198178
|
});
|
|
198163
198179
|
|
|
198164
198180
|
// src/mcp/file-tools.ts
|
|
198165
|
-
import { closeSync as closeSync8, constants as constants6, lstatSync as lstatSync29, mkdirSync as mkdirSync41, openSync as openSync7, readdirSync as readdirSync42, readFileSync as readFileSync108, realpathSync as realpathSync12, renameSync as renameSync15, rmSync as rmSync26, statSync as
|
|
198181
|
+
import { closeSync as closeSync8, constants as constants6, lstatSync as lstatSync29, mkdirSync as mkdirSync41, openSync as openSync7, readdirSync as readdirSync42, readFileSync as readFileSync108, realpathSync as realpathSync12, renameSync as renameSync15, rmSync as rmSync26, statSync as statSync26, writeSync as writeSync2, existsSync as existsSync97 } from "node:fs";
|
|
198166
198182
|
import { randomBytes as randomBytes4 } from "node:crypto";
|
|
198167
198183
|
import { dirname as dirname53, isAbsolute as isAbsolute13, join as join98, relative as relative21, resolve as resolve68, sep as sep26 } from "node:path";
|
|
198168
198184
|
import * as z2 from "zod";
|
|
@@ -198281,7 +198297,7 @@ function listFiles2(appDir3) {
|
|
|
198281
198297
|
const rel2 = relative21(appDir3, p2);
|
|
198282
198298
|
if (isDeniedSourcePath(rel2) || isDeniedSourcePath(rel2.toLowerCase())) continue;
|
|
198283
198299
|
if (files.length >= MAX_LISTED) return false;
|
|
198284
|
-
files.push({ path: rel2.split(sep26).join("/"), bytes:
|
|
198300
|
+
files.push({ path: rel2.split(sep26).join("/"), bytes: statSync26(p2).size });
|
|
198285
198301
|
}
|
|
198286
198302
|
}
|
|
198287
198303
|
return true;
|
|
@@ -198317,7 +198333,7 @@ function fileTools() {
|
|
|
198317
198333
|
handler: async (a3, d2) => {
|
|
198318
198334
|
const app2 = await confinedAppDir(a3, d2);
|
|
198319
198335
|
if (typeof app2 !== "string") return app2;
|
|
198320
|
-
if (!existsSync97(app2) || !
|
|
198336
|
+
if (!existsSync97(app2) || !statSync26(app2).isDirectory()) return refuse5("no_app", `no folder at ${app2}`);
|
|
198321
198337
|
return ok({ ok: true, dir: app2, ...listFiles2(app2) });
|
|
198322
198338
|
}
|
|
198323
198339
|
},
|
|
@@ -198333,7 +198349,7 @@ function fileTools() {
|
|
|
198333
198349
|
const p2 = confinedPath(app2, a3.path);
|
|
198334
198350
|
if (typeof p2 !== "string") return refuse5("bad_path", p2.error);
|
|
198335
198351
|
if (!existsSync97(p2) || !lstatSync29(p2).isFile()) return refuse5("not_found", `no file "${String(a3.path)}"`);
|
|
198336
|
-
const size =
|
|
198352
|
+
const size = statSync26(p2).size;
|
|
198337
198353
|
if (size > MAX_FILE_BYTES2) return refuse5("too_large", `"${String(a3.path)}" is ${size} bytes \u2014 over the ${MAX_FILE_BYTES2}-byte read limit`);
|
|
198338
198354
|
return ok({ ok: true, path: a3.path, bytes: size, content: readFileSync108(p2, "utf8") });
|
|
198339
198355
|
}
|
|
@@ -199125,7 +199141,7 @@ var init_open_url = __esm({
|
|
|
199125
199141
|
});
|
|
199126
199142
|
|
|
199127
199143
|
// src/store-build-lookup.ts
|
|
199128
|
-
import { existsSync as existsSync98, lstatSync as lstatSync30, readFileSync as readFileSync109, readdirSync as readdirSync43, statSync as
|
|
199144
|
+
import { existsSync as existsSync98, lstatSync as lstatSync30, readFileSync as readFileSync109, readdirSync as readdirSync43, statSync as statSync27 } from "node:fs";
|
|
199129
199145
|
import { basename as basename25, join as join99, resolve as resolve71 } from "node:path";
|
|
199130
199146
|
function readUploadFacts(dir) {
|
|
199131
199147
|
const path2 = join99(dir, LAST_DIST_PATH);
|
|
@@ -199152,7 +199168,7 @@ function newestLocalIpa(dir) {
|
|
|
199152
199168
|
const folder = join99(dir, LOCAL_IPA_DIR);
|
|
199153
199169
|
try {
|
|
199154
199170
|
if (!existsSync98(folder) || lstatSync30(folder).isSymbolicLink() || !lstatSync30(folder).isDirectory()) return void 0;
|
|
199155
|
-
const ipas = readdirSync43(folder).filter((n2) => n2.toLowerCase().endsWith(".ipa")).map((n2) => join99(folder, n2)).filter((p2) => lstatSync30(p2).isFile()).sort((a3, b3) =>
|
|
199171
|
+
const ipas = readdirSync43(folder).filter((n2) => n2.toLowerCase().endsWith(".ipa")).map((n2) => join99(folder, n2)).filter((p2) => lstatSync30(p2).isFile()).sort((a3, b3) => statSync27(b3).mtimeMs - statSync27(a3).mtimeMs);
|
|
199156
199172
|
return ipas[0];
|
|
199157
199173
|
} catch {
|
|
199158
199174
|
return void 0;
|
|
@@ -201455,7 +201471,7 @@ function devtoolsSend(cdp, method, params = {}) {
|
|
|
201455
201471
|
return cdp.send(method, params);
|
|
201456
201472
|
}
|
|
201457
201473
|
async function attachConsole(port, io2 = {}) {
|
|
201458
|
-
const
|
|
201474
|
+
const sleep5 = sleepFor(io2);
|
|
201459
201475
|
let target;
|
|
201460
201476
|
for (let i2 = 0; i2 < 30 && !target; i2++) {
|
|
201461
201477
|
const pages2 = await listPages(port, io2);
|
|
@@ -201465,7 +201481,7 @@ async function attachConsole(port, io2 = {}) {
|
|
|
201465
201481
|
throw new ConsoleError("auth", reauth ? `Google wants you to confirm it's you again before Play Console (its "Verify it's you" page)` : "The Chrome profile isn't signed in to Google (it shows the sign-in page)", { remediation: "Add --reauth to open the window and sign in there, or run gplay-node console login" });
|
|
201466
201482
|
}
|
|
201467
201483
|
if (!target)
|
|
201468
|
-
await
|
|
201484
|
+
await sleep5(500);
|
|
201469
201485
|
}
|
|
201470
201486
|
if (!target?.webSocketDebuggerUrl)
|
|
201471
201487
|
throw new ConsoleError("network", "No Play Console page opened in the Chrome profile");
|
|
@@ -201482,7 +201498,7 @@ async function attachConsole(port, io2 = {}) {
|
|
|
201482
201498
|
const learn = async (timeoutMs) => {
|
|
201483
201499
|
const deadline = Date.now() + timeoutMs;
|
|
201484
201500
|
while (!(auth.apiKey && auth.authUser) && Date.now() < deadline) {
|
|
201485
|
-
await
|
|
201501
|
+
await sleep5(250);
|
|
201486
201502
|
await new Promise((r3) => setTimeout(r3, 0));
|
|
201487
201503
|
}
|
|
201488
201504
|
return !!(auth.apiKey && auth.authUser) && (!wantDev || developerIdFromUrl(await href()) === wantDev);
|
|
@@ -201533,7 +201549,7 @@ function withPageSignIn(launch, opened, opts, io2 = {}) {
|
|
|
201533
201549
|
let headless = launch.headless && !opened.reauthed;
|
|
201534
201550
|
let told = false;
|
|
201535
201551
|
const waitMs = opts.waitMs ?? 10 * 6e4;
|
|
201536
|
-
const
|
|
201552
|
+
const sleep5 = sleepFor(io2);
|
|
201537
201553
|
const tell = (what, how) => {
|
|
201538
201554
|
if (told)
|
|
201539
201555
|
return;
|
|
@@ -201549,7 +201565,7 @@ function withPageSignIn(launch, opened, opts, io2 = {}) {
|
|
|
201549
201565
|
if (headless) {
|
|
201550
201566
|
current.attached.close();
|
|
201551
201567
|
current.chrome.close();
|
|
201552
|
-
await
|
|
201568
|
+
await sleep5(1500);
|
|
201553
201569
|
const chrome = await launchChrome({ ...launch, headless: false }, io2);
|
|
201554
201570
|
headless = false;
|
|
201555
201571
|
tell(what, "A Chrome window opened: sign in there yourself and the command carries on.");
|
|
@@ -201568,7 +201584,7 @@ function withPageSignIn(launch, opened, opts, io2 = {}) {
|
|
|
201568
201584
|
const href = await current.attached.page.evaluate("location.href").catch(() => "");
|
|
201569
201585
|
if (isConsoleUrl(href))
|
|
201570
201586
|
return;
|
|
201571
|
-
await
|
|
201587
|
+
await sleep5(2e3);
|
|
201572
201588
|
}
|
|
201573
201589
|
throw timedOut(what);
|
|
201574
201590
|
}
|
|
@@ -201674,7 +201690,7 @@ async function awaitSignIn(page, what) {
|
|
|
201674
201690
|
await page.signIn(what);
|
|
201675
201691
|
}
|
|
201676
201692
|
async function openForm(page, url, readyTest, what, opts = {}, settleMs = SETTLE_MS) {
|
|
201677
|
-
const
|
|
201693
|
+
const sleep5 = sleeperOf(opts);
|
|
201678
201694
|
const tries = Math.max(1, Math.ceil((opts.readyTimeoutMs ?? 3e4) / 500));
|
|
201679
201695
|
for (let signIns = 0; ; signIns++) {
|
|
201680
201696
|
const reply = await page.send("Page.navigate", { url });
|
|
@@ -201682,12 +201698,12 @@ async function openForm(page, url, readyTest, what, opts = {}, settleMs = SETTLE
|
|
|
201682
201698
|
throw new ConsoleError("network", `Couldn't open ${what}: ${reply.errorText}`);
|
|
201683
201699
|
let signin = false;
|
|
201684
201700
|
for (let i2 = 0; i2 < tries && !signin; i2++) {
|
|
201685
|
-
await
|
|
201701
|
+
await sleep5(500);
|
|
201686
201702
|
const state = await page.evaluate(formScript("ready", `if (${SIGN_IN_TEST}) return 'signin'; return !!(${readyTest});`)).catch(() => false);
|
|
201687
201703
|
if (state === "signin")
|
|
201688
201704
|
signin = true;
|
|
201689
201705
|
else if (state === true) {
|
|
201690
|
-
await
|
|
201706
|
+
await sleep5(settleMs);
|
|
201691
201707
|
return;
|
|
201692
201708
|
}
|
|
201693
201709
|
}
|
|
@@ -201702,7 +201718,7 @@ async function openForm(page, url, readyTest, what, opts = {}, settleMs = SETTLE
|
|
|
201702
201718
|
throw new ConsoleError("server", `${what} didn't load in Play Console${at2}`, { remediation: "Check the app id and that this Google account can see the app; --show opens the window to watch" });
|
|
201703
201719
|
}
|
|
201704
201720
|
async function pressSave(page, what, twoStep, opts = {}) {
|
|
201705
|
-
const
|
|
201721
|
+
const sleep5 = sleeperOf(opts);
|
|
201706
201722
|
const save = () => page.evaluate(formScript("save", "return { pressed: press('Save'), errors: errors() };"));
|
|
201707
201723
|
let result = await save();
|
|
201708
201724
|
if (result.pressed === "missing" && twoStep) {
|
|
@@ -201710,7 +201726,7 @@ async function pressSave(page, what, twoStep, opts = {}) {
|
|
|
201710
201726
|
if (next.pressed !== "pressed")
|
|
201711
201727
|
throw new ConsoleError("invalid", `${what}: Next is ${next.pressed}${next.errors.length ? `: ${next.errors.join(" | ")}` : ""}`);
|
|
201712
201728
|
for (let i2 = 0; i2 < 20; i2++) {
|
|
201713
|
-
await
|
|
201729
|
+
await sleep5(500);
|
|
201714
201730
|
result = await save();
|
|
201715
201731
|
if (result.pressed !== "missing")
|
|
201716
201732
|
break;
|
|
@@ -201719,17 +201735,17 @@ async function pressSave(page, what, twoStep, opts = {}) {
|
|
|
201719
201735
|
if (result.pressed !== "pressed") {
|
|
201720
201736
|
throw new ConsoleError("invalid", `${what}: Save is ${result.pressed}${result.errors.length ? `: ${result.errors.join(" | ")}` : ""}`, { remediation: "The form wants something this command doesn't fill in; open it in Play Console" });
|
|
201721
201737
|
}
|
|
201722
|
-
await
|
|
201738
|
+
await sleep5(SAVE_WAIT_MS);
|
|
201723
201739
|
const after = await page.evaluate(formScript("afterSave", "return { errors: errors() };")).catch(() => ({ errors: [] }));
|
|
201724
201740
|
if (after.errors.length)
|
|
201725
201741
|
throw new ConsoleError("invalid", `${what}: Play Console didn't take the answer: ${after.errors.join(" | ")}`);
|
|
201726
201742
|
}
|
|
201727
201743
|
async function readBackUntil(page, url, ready, what, read2, ok5, opts, settleMs) {
|
|
201728
|
-
const
|
|
201744
|
+
const sleep5 = sleeperOf(opts);
|
|
201729
201745
|
let value2;
|
|
201730
201746
|
for (let attempt2 = 0; attempt2 < READBACK_TRIES; attempt2++) {
|
|
201731
201747
|
if (attempt2)
|
|
201732
|
-
await
|
|
201748
|
+
await sleep5(READBACK_GAP_MS);
|
|
201733
201749
|
await openForm(page, url, ready, what, opts, settleMs);
|
|
201734
201750
|
value2 = await read2();
|
|
201735
201751
|
if (ok5(value2))
|
|
@@ -201898,10 +201914,10 @@ async function declareTargetAudience(page, url, plan, opts) {
|
|
|
201898
201914
|
const next = await page.evaluate(declareScripts.agesNext());
|
|
201899
201915
|
if (next.pressed !== "pressed")
|
|
201900
201916
|
throw new ConsoleError("invalid", `Target audience: Next is ${next.pressed}${next.errors.length ? `: ${next.errors.join(" | ")}` : ""}`);
|
|
201901
|
-
const
|
|
201917
|
+
const sleep5 = sleeperOf(opts);
|
|
201902
201918
|
let summary2 = null;
|
|
201903
201919
|
for (let i2 = 0; i2 < 20 && summary2 === null; i2++) {
|
|
201904
|
-
await
|
|
201920
|
+
await sleep5(500);
|
|
201905
201921
|
summary2 = await page.evaluate(declareScripts.agesSummary()).catch(() => null);
|
|
201906
201922
|
}
|
|
201907
201923
|
if (summary2 !== wanted.join(", ")) {
|
|
@@ -201918,7 +201934,7 @@ async function declareTargetAudience(page, url, plan, opts) {
|
|
|
201918
201934
|
async function declareCategory(page, url, plan, opts) {
|
|
201919
201935
|
const label4 = plan.set;
|
|
201920
201936
|
const base2 = { form: plan.form, title: plan.title, set: label4 };
|
|
201921
|
-
const
|
|
201937
|
+
const sleep5 = sleeperOf(opts);
|
|
201922
201938
|
const ready = "document.body.innerText.includes('App category')";
|
|
201923
201939
|
await openForm(page, url, ready, "Store settings", opts);
|
|
201924
201940
|
const before = await page.evaluate(declareScripts.categoryNow());
|
|
@@ -201929,7 +201945,7 @@ async function declareCategory(page, url, plan, opts) {
|
|
|
201929
201945
|
throw new ConsoleError("server", `App category: ${edit.error ?? "Edit wasn't pressed"}`);
|
|
201930
201946
|
let at2 = null;
|
|
201931
201947
|
for (let i2 = 0; i2 < 20 && !at2; i2++) {
|
|
201932
|
-
await
|
|
201948
|
+
await sleep5(500);
|
|
201933
201949
|
at2 = await page.evaluate(declareScripts.categoryDropdown());
|
|
201934
201950
|
}
|
|
201935
201951
|
if (!at2)
|
|
@@ -201938,7 +201954,7 @@ async function declareCategory(page, url, plan, opts) {
|
|
|
201938
201954
|
await page.send("Input.dispatchMouseEvent", { type: type2, x: at2.x, y: at2.y, button: "left", clickCount: 1 });
|
|
201939
201955
|
let pick5 = { open: false };
|
|
201940
201956
|
for (let i2 = 0; i2 < 10 && !pick5.open; i2++) {
|
|
201941
|
-
await
|
|
201957
|
+
await sleep5(500);
|
|
201942
201958
|
pick5 = await page.evaluate(declareScripts.categoryPick(label4));
|
|
201943
201959
|
}
|
|
201944
201960
|
if (!pick5.open)
|
|
@@ -202432,17 +202448,17 @@ function summarizeDataSafetyCsv(csv2) {
|
|
|
202432
202448
|
const answered3 = rows.filter((r3) => (r3[2] ?? "").trim() !== "");
|
|
202433
202449
|
return { rows: rows.length, answered: answered3.length, questionsAnswered: new Set(answered3.map((r3) => r3[0])).size };
|
|
202434
202450
|
}
|
|
202435
|
-
async function waitForCsv(dir, before,
|
|
202451
|
+
async function waitForCsv(dir, before, sleep5) {
|
|
202436
202452
|
for (let i2 = 0; i2 < 30; i2++) {
|
|
202437
202453
|
const fresh = (await readdir(dir)).filter((f2) => !before.has(f2) && f2.toLowerCase().endsWith(".csv"));
|
|
202438
202454
|
if (fresh.length)
|
|
202439
202455
|
return fresh[0];
|
|
202440
|
-
await
|
|
202456
|
+
await sleep5(1e3);
|
|
202441
202457
|
}
|
|
202442
202458
|
return void 0;
|
|
202443
202459
|
}
|
|
202444
202460
|
async function pullDataSafety(page, developerId, appId3, opts) {
|
|
202445
|
-
const
|
|
202461
|
+
const sleep5 = sleeperOf(opts);
|
|
202446
202462
|
const url = appPageUrl(developerId, appId3, "app-content/data-privacy-security");
|
|
202447
202463
|
await page.send("Page.setDownloadBehavior", { behavior: "allow", downloadPath: opts.downloadDir });
|
|
202448
202464
|
await openForm(page, url, READY, "The Data safety page", opts, 3e3);
|
|
@@ -202453,7 +202469,7 @@ async function pullDataSafety(page, developerId, appId3, opts) {
|
|
|
202453
202469
|
const pressed = await page.evaluate(dataSafetyScripts.export());
|
|
202454
202470
|
if (pressed.pressed !== "pressed")
|
|
202455
202471
|
throw new ConsoleError("server", `Data safety: Export to CSV is ${pressed.pressed}`);
|
|
202456
|
-
const file2 = await waitForCsv(opts.downloadDir, before,
|
|
202472
|
+
const file2 = await waitForCsv(opts.downloadDir, before, sleep5);
|
|
202457
202473
|
if (!file2)
|
|
202458
202474
|
throw new ConsoleError("server", "Data safety: Export to CSV was pressed but no file arrived in 30 s");
|
|
202459
202475
|
const csv2 = await readFile6(join105(opts.downloadDir, file2), "utf8");
|
|
@@ -202462,7 +202478,7 @@ async function pullDataSafety(page, developerId, appId3, opts) {
|
|
|
202462
202478
|
if (last.summary.answered > 0)
|
|
202463
202479
|
return { ...last.summary, csv: csv2, exports: n2, blank: false };
|
|
202464
202480
|
if (n2 < attempts)
|
|
202465
|
-
await
|
|
202481
|
+
await sleep5(5e3);
|
|
202466
202482
|
}
|
|
202467
202483
|
return { ...last.summary, csv: last.csv, exports: attempts, blank: true };
|
|
202468
202484
|
}
|
|
@@ -203430,10 +203446,10 @@ function parsePolicyStatus(snap, developerId, appId3) {
|
|
|
203430
203446
|
}
|
|
203431
203447
|
async function readPolicyStatus(page, developerId, appId3, opts = {}) {
|
|
203432
203448
|
await openForm(page, appPageUrl(developerId, appId3, CONSOLE_POLICY_PATHS.status), STATUS_READY, "The Policy status page", opts);
|
|
203433
|
-
const
|
|
203449
|
+
const sleep5 = sleeperOf(opts);
|
|
203434
203450
|
let snap = await page.evaluate(policyScripts.status());
|
|
203435
203451
|
for (let i2 = 1; i2 < STATUS_TRIES && !snap.rows.length && !snap.empty && !snap.notReviewed; i2++) {
|
|
203436
|
-
await
|
|
203452
|
+
await sleep5(500);
|
|
203437
203453
|
snap = await page.evaluate(policyScripts.status());
|
|
203438
203454
|
}
|
|
203439
203455
|
return parsePolicyStatus(snap, developerId, appId3);
|
|
@@ -203467,7 +203483,7 @@ function checkPolicyReply(reply) {
|
|
|
203467
203483
|
}
|
|
203468
203484
|
async function replyToPolicyIssue(page, developerId, appId3, reply, opts = {}) {
|
|
203469
203485
|
checkPolicyReply(reply);
|
|
203470
|
-
const
|
|
203486
|
+
const sleep5 = sleeperOf(opts);
|
|
203471
203487
|
const word = reply.kind === "appeal" ? "Appeal" : "Resubmit";
|
|
203472
203488
|
const rejection = await readRejection(page, developerId, appId3, reply.issueId, opts);
|
|
203473
203489
|
const button = replyButton(rejection, reply.kind);
|
|
@@ -203480,7 +203496,7 @@ async function replyToPolicyIssue(page, developerId, appId3, reply, opts = {}) {
|
|
|
203480
203496
|
for (let i2 = 0; i2 < 20 && !form; i2++) {
|
|
203481
203497
|
form = await page.evaluate(policyScripts.replyForm()).catch(() => null);
|
|
203482
203498
|
if (!form)
|
|
203483
|
-
await
|
|
203499
|
+
await sleep5(500);
|
|
203484
203500
|
}
|
|
203485
203501
|
if (!form)
|
|
203486
203502
|
throw new UncertainWriteError(`${word} was pressed on issue ${reply.issueId} and no form with a message box appeared; nothing was typed`);
|
|
@@ -203505,7 +203521,7 @@ async function replyToPolicyIssue(page, developerId, appId3, reply, opts = {}) {
|
|
|
203505
203521
|
const sent = await page.evaluate(policyScripts.replySubmit(submit));
|
|
203506
203522
|
if (sent.pressed !== "pressed")
|
|
203507
203523
|
throw new ConsoleError("invalid", `${pageName}: ${submit} is ${sent.pressed}${sent.errors.length ? `: ${sent.errors.join(" | ")}` : ""}`);
|
|
203508
|
-
await
|
|
203524
|
+
await sleep5(REPLY_WAIT_MS);
|
|
203509
203525
|
const after = await page.evaluate(formScript("afterSave", "return { errors: errors() };")).catch(() => ({ errors: [] }));
|
|
203510
203526
|
if (after.errors.length)
|
|
203511
203527
|
throw new ConsoleError("invalid", `${pageName}: Play Console didn't take it: ${after.errors.join(" | ")}`);
|
|
@@ -203513,7 +203529,7 @@ async function replyToPolicyIssue(page, developerId, appId3, reply, opts = {}) {
|
|
|
203513
203529
|
let status2 = "not listed";
|
|
203514
203530
|
for (let attempt2 = 0; attempt2 < READBACK_TRIES2; attempt2++) {
|
|
203515
203531
|
if (attempt2)
|
|
203516
|
-
await
|
|
203532
|
+
await sleep5(REPLY_WAIT_MS);
|
|
203517
203533
|
try {
|
|
203518
203534
|
const now = await readPolicyStatus(page, developerId, appId3, opts);
|
|
203519
203535
|
status2 = now.issues.find((i2) => i2.id === reply.issueId)?.status ?? "not listed";
|
|
@@ -203650,7 +203666,7 @@ async function readCard(page, developerId, appId3, opts) {
|
|
|
203650
203666
|
}
|
|
203651
203667
|
async function applyForProduction(page, developerId, appId3, answers2, opts = {}) {
|
|
203652
203668
|
checkProductionAnswers(answers2);
|
|
203653
|
-
const
|
|
203669
|
+
const sleep5 = sleeperOf(opts);
|
|
203654
203670
|
const { access: before, applyLabel } = await readCard(page, developerId, appId3, opts);
|
|
203655
203671
|
if (before.granted)
|
|
203656
203672
|
throw new ConsoleError("conflict", "This account already has production access; there is nothing to apply for");
|
|
@@ -203671,7 +203687,7 @@ async function applyForProduction(page, developerId, appId3, answers2, opts = {}
|
|
|
203671
203687
|
let form = null;
|
|
203672
203688
|
for (let i2 = 0; i2 < 20 && (!form || sameAsBefore(form)); i2++) {
|
|
203673
203689
|
if (i2)
|
|
203674
|
-
await
|
|
203690
|
+
await sleep5(500);
|
|
203675
203691
|
form = await page.evaluate(productionScripts.questions()).catch(() => null);
|
|
203676
203692
|
}
|
|
203677
203693
|
if (!form)
|
|
@@ -203726,13 +203742,13 @@ async function applyForProduction(page, developerId, appId3, answers2, opts = {}
|
|
|
203726
203742
|
const went = await page.evaluate(productionScripts.next(next));
|
|
203727
203743
|
if (went.pressed !== "pressed")
|
|
203728
203744
|
throw new ConsoleError("invalid", `${pageName}: ${next} is ${went.pressed}${went.errors.length ? `: ${went.errors.join(" | ")}` : ""}; nothing was submitted`);
|
|
203729
|
-
await
|
|
203745
|
+
await sleep5(1e3);
|
|
203730
203746
|
} else
|
|
203731
203747
|
throw new PageChangedError(pageName, [`no Submit or Next button (buttons: ${form.buttons.join(", ") || "none"})`], "nothing was submitted");
|
|
203732
203748
|
}
|
|
203733
203749
|
if (!submitted)
|
|
203734
203750
|
throw new ConsoleError("server", `${pageName} kept asking (more than ${MAX_FORM_PAGES} pages); nothing was submitted`);
|
|
203735
|
-
await
|
|
203751
|
+
await sleep5(SUBMIT_WAIT_MS);
|
|
203736
203752
|
const after = await page.evaluate(formScript("afterSave", "return { errors: errors() };")).catch(() => ({ errors: [] }));
|
|
203737
203753
|
if (after.errors.length)
|
|
203738
203754
|
throw new ConsoleError("invalid", `${pageName}: Play Console didn't take it: ${after.errors.join(" | ")}`);
|
|
@@ -203740,7 +203756,7 @@ async function applyForProduction(page, developerId, appId3, answers2, opts = {}
|
|
|
203740
203756
|
let now = before;
|
|
203741
203757
|
for (let attempt2 = 0; attempt2 < READBACK_TRIES3; attempt2++) {
|
|
203742
203758
|
if (attempt2)
|
|
203743
|
-
await
|
|
203759
|
+
await sleep5(SUBMIT_WAIT_MS);
|
|
203744
203760
|
try {
|
|
203745
203761
|
now = await readProductionAccess(page, developerId, appId3, opts);
|
|
203746
203762
|
} catch (e2) {
|
|
@@ -203875,7 +203891,7 @@ function checkContentRating(opts) {
|
|
|
203875
203891
|
}
|
|
203876
203892
|
async function rateContent(page, developerId, appId3, opts) {
|
|
203877
203893
|
checkContentRating(opts);
|
|
203878
|
-
const
|
|
203894
|
+
const sleep5 = sleeperOf(opts);
|
|
203879
203895
|
const categoryLabel = RATING_CATEGORIES[opts.category];
|
|
203880
203896
|
const url = appPageUrl(developerId, appId3, "app-content/content-rating-overview");
|
|
203881
203897
|
await openForm(page, url, READY_OVERVIEW, "The content rating page", opts, 3e3);
|
|
@@ -203884,7 +203900,7 @@ async function rateContent(page, developerId, appId3, opts) {
|
|
|
203884
203900
|
throw new ConsoleError("server", "Content rating: no Start questionnaire or Edit button");
|
|
203885
203901
|
let email = {};
|
|
203886
203902
|
for (let i2 = 0; i2 < 30 && !("value" in email); i2++) {
|
|
203887
|
-
await
|
|
203903
|
+
await sleep5(500);
|
|
203888
203904
|
email = await page.evaluate(ratingScripts.emailFocus()).catch(() => ({}));
|
|
203889
203905
|
}
|
|
203890
203906
|
if (!("value" in email))
|
|
@@ -203912,10 +203928,10 @@ async function rateContent(page, developerId, appId3, opts) {
|
|
|
203912
203928
|
const questions = [];
|
|
203913
203929
|
let answered3;
|
|
203914
203930
|
for (let round = 0; round < 40 && !answered3; round++) {
|
|
203915
|
-
await
|
|
203931
|
+
await sleep5(round === 0 ? 3e3 : 900);
|
|
203916
203932
|
const p2 = await page.evaluate(ratingScripts.pending());
|
|
203917
203933
|
if (p2.done) {
|
|
203918
|
-
await
|
|
203934
|
+
await sleep5(QUESTION_SETTLE_MS);
|
|
203919
203935
|
const again = await page.evaluate(ratingScripts.pending());
|
|
203920
203936
|
if (!again.done || (again.answered ?? []).length !== (p2.answered ?? []).length)
|
|
203921
203937
|
continue;
|
|
@@ -203950,7 +203966,7 @@ async function rateContent(page, developerId, appId3, opts) {
|
|
|
203950
203966
|
if (draft.pressed !== "pressed")
|
|
203951
203967
|
throw new ConsoleError("invalid", `Content rating: Next to the Summary is disabled, and the questionnaire's Save is ${draft.pressed}`);
|
|
203952
203968
|
for (let i2 = 0; i2 < 10 && toSummary.pressed !== "pressed"; i2++) {
|
|
203953
|
-
await
|
|
203969
|
+
await sleep5(1e3);
|
|
203954
203970
|
toSummary = await page.evaluate(ratingScripts.next());
|
|
203955
203971
|
}
|
|
203956
203972
|
}
|
|
@@ -203961,7 +203977,7 @@ async function rateContent(page, developerId, appId3, opts) {
|
|
|
203961
203977
|
}
|
|
203962
203978
|
let summary2 = null;
|
|
203963
203979
|
for (let i2 = 0; i2 < 30 && !summary2; i2++) {
|
|
203964
|
-
await
|
|
203980
|
+
await sleep5(500);
|
|
203965
203981
|
summary2 = await page.evaluate(ratingScripts.summary()).catch(() => null);
|
|
203966
203982
|
}
|
|
203967
203983
|
if (!summary2)
|
|
@@ -203979,7 +203995,7 @@ async function rateContent(page, developerId, appId3, opts) {
|
|
|
203979
203995
|
let shown3 = null;
|
|
203980
203996
|
const details = await page.evaluate(formScript("viewDetails", "return { pressed: press('View details') };"));
|
|
203981
203997
|
for (let i2 = 0; i2 < 20 && details.pressed === "pressed" && !shown3; i2++) {
|
|
203982
|
-
await
|
|
203998
|
+
await sleep5(500);
|
|
203983
203999
|
shown3 = await page.evaluate(ratingScripts.summary()).catch(() => null);
|
|
203984
204000
|
}
|
|
203985
204001
|
const onFile = shown3 ? parseRatings(shown3) : {};
|
|
@@ -204145,7 +204161,7 @@ async function findClosedTrack(page, developerId, appId3, wanted, opts = {}) {
|
|
|
204145
204161
|
}
|
|
204146
204162
|
async function setTesters(page, developerId, appId3, track2, plan, opts = {}) {
|
|
204147
204163
|
const url = testersUrl(developerId, appId3, track2.id);
|
|
204148
|
-
const
|
|
204164
|
+
const sleep5 = sleeperOf(opts);
|
|
204149
204165
|
const notes = [];
|
|
204150
204166
|
await openForm(page, url, READY2, "the track's Testers tab", opts);
|
|
204151
204167
|
let st2 = await page.evaluate(testerScripts.state());
|
|
@@ -204168,7 +204184,7 @@ async function setTesters(page, developerId, appId3, track2, plan, opts = {}) {
|
|
|
204168
204184
|
await createList(page, plan, opts);
|
|
204169
204185
|
createdList = true;
|
|
204170
204186
|
for (let i2 = 0; i2 < 20 && !lists.some((l3) => l3.name === plan.list); i2++) {
|
|
204171
|
-
await
|
|
204187
|
+
await sleep5(500);
|
|
204172
204188
|
st2 = await page.evaluate(testerScripts.state());
|
|
204173
204189
|
lists = listsOf(st2);
|
|
204174
204190
|
}
|
|
@@ -204207,7 +204223,7 @@ async function setTesters(page, developerId, appId3, track2, plan, opts = {}) {
|
|
|
204207
204223
|
return { track: track2, list: plan.list, createdList, saved: true, readBack: `"${plan.list}" is ticked after a reload${createdList ? `, holding ${plan.emails.length} address(es)` : ""}`, ticked: ticked2, ...after.optInUrl ? { optInUrl: after.optInUrl } : {}, notes };
|
|
204208
204224
|
}
|
|
204209
204225
|
async function createList(page, plan, opts) {
|
|
204210
|
-
const
|
|
204226
|
+
const sleep5 = sleeperOf(opts);
|
|
204211
204227
|
const opened = await page.evaluate(testerScripts.openCreate());
|
|
204212
204228
|
if (opened.pressed !== "pressed" || !opened.dialog)
|
|
204213
204229
|
throw new ConsoleError("server", `Create email list is ${opened.pressed === "pressed" ? "pressed, but no dialog opened" : opened.pressed}`);
|
|
@@ -204221,7 +204237,7 @@ async function createList(page, plan, opts) {
|
|
|
204221
204237
|
await type2("Add email addresses", plan.emails.join(", "));
|
|
204222
204238
|
for (const type3 of ["keyDown", "keyUp"])
|
|
204223
204239
|
await page.send("Input.dispatchKeyEvent", { type: type3, key: "Enter", code: "Enter", windowsVirtualKeyCode: 13, ...type3 === "keyDown" ? { text: "\r" } : {} });
|
|
204224
|
-
await
|
|
204240
|
+
await sleep5(1500);
|
|
204225
204241
|
const filled2 = await page.evaluate(testerScripts.dialogState());
|
|
204226
204242
|
const missing4 = plan.emails.filter((e2) => !filled2.added?.includes(e2));
|
|
204227
204243
|
if (!filled2.open || filled2.name !== plan.list || missing4.length) {
|
|
@@ -204232,13 +204248,13 @@ async function createList(page, plan, opts) {
|
|
|
204232
204248
|
throw new ConsoleError("invalid", `Create email list: Save changes is ${saved.pressed}`);
|
|
204233
204249
|
let confirm2 = { confirmed: false, open: true };
|
|
204234
204250
|
for (let i2 = 0; i2 < 10 && !confirm2.confirmed && confirm2.open; i2++) {
|
|
204235
|
-
await
|
|
204251
|
+
await sleep5(500);
|
|
204236
204252
|
confirm2 = await page.evaluate(testerScripts.confirmShared());
|
|
204237
204253
|
}
|
|
204238
204254
|
if (!confirm2.confirmed)
|
|
204239
204255
|
throw new ConsoleError("server", `Create email list: no confirmation to press${confirm2.text ? ` (the dialog says "${confirm2.text}")` : ""}`);
|
|
204240
204256
|
for (let i2 = 0; i2 < 20; i2++) {
|
|
204241
|
-
await
|
|
204257
|
+
await sleep5(500);
|
|
204242
204258
|
if (await page.evaluate(testerScripts.dialogGone()))
|
|
204243
204259
|
return;
|
|
204244
204260
|
}
|
|
@@ -204309,10 +204325,10 @@ async function stopAt(page, pageName, unknown, what = "nothing was pressed", rem
|
|
|
204309
204325
|
throw signInError(pageName);
|
|
204310
204326
|
throw new PageChangedError(pageName, unknown, what, remediation);
|
|
204311
204327
|
}
|
|
204312
|
-
async function waitUntil(page, read2, ready,
|
|
204328
|
+
async function waitUntil(page, read2, ready, sleep5, pageName, never, tries = 120) {
|
|
204313
204329
|
let value2;
|
|
204314
204330
|
for (let i2 = 0; i2 < tries; i2++) {
|
|
204315
|
-
await
|
|
204331
|
+
await sleep5(500);
|
|
204316
204332
|
value2 = await read2();
|
|
204317
204333
|
if (ready(value2))
|
|
204318
204334
|
return value2;
|
|
@@ -204329,18 +204345,18 @@ async function readBack(what, fn2) {
|
|
|
204329
204345
|
}
|
|
204330
204346
|
}
|
|
204331
204347
|
async function confirmRelease(page, developerId, appId3, trackId, o2) {
|
|
204332
|
-
const
|
|
204348
|
+
const sleep5 = sleeperOf(o2);
|
|
204333
204349
|
await openForm(page, appPageUrl(developerId, appId3, `tracks/${trackId}?tab=releases`), "!!button('Edit release') || !!button('Create new release')", "the track's Releases tab", o2, 3e3);
|
|
204334
204350
|
const edit = await page.evaluate(reviewScripts.edit());
|
|
204335
204351
|
if (edit.pressed !== "pressed") {
|
|
204336
204352
|
const remediation = trackId === PRODUCTION_TRACK_ID ? "If the track has no draft release, put one there first: gplay-node promote <package> <version code> --to production --status draft --owner-approval <id> --confirm" : "If the track has no draft release, put one there first: gplay-node closed-test setup <package> --track alpha --version-code N --status draft --confirm";
|
|
204337
204353
|
await stopAt(page, "the track's Releases tab", [`no Edit release (Edit release is ${edit.pressed})`], "nothing was pressed; the track may have no draft release to confirm", remediation);
|
|
204338
204354
|
}
|
|
204339
|
-
await waitUntil(page, () => page.evaluate(reviewScripts.prepared()).catch(() => false), (v2) => v2 === true,
|
|
204355
|
+
await waitUntil(page, () => page.evaluate(reviewScripts.prepared()).catch(() => false), (v2) => v2 === true, sleep5, "the release page", "the release page didn't load (no Next and Release name)");
|
|
204340
204356
|
const next = await page.evaluate(reviewScripts.next());
|
|
204341
204357
|
if (next.pressed !== "pressed")
|
|
204342
204358
|
await stopAt(page, "the release page", [`Next is ${next.pressed}`]);
|
|
204343
|
-
const review = await waitUntil(page, () => page.evaluate(reviewScripts.issues()).catch(() => ({ ready: false })), (v2) => !!v2?.ready,
|
|
204359
|
+
const review = await waitUntil(page, () => page.evaluate(reviewScripts.issues()).catch(() => ({ ready: false })), (v2) => !!v2?.ready, sleep5, "the release's Preview and confirm step", "Preview and confirm didn't load (no Save)");
|
|
204344
204360
|
const issues = review.issues ?? [];
|
|
204345
204361
|
let acknowledged = false;
|
|
204346
204362
|
if (review.blocked) {
|
|
@@ -204359,7 +204375,7 @@ async function confirmRelease(page, developerId, appId3, trackId, o2) {
|
|
|
204359
204375
|
if (ack.pressed !== "pressed")
|
|
204360
204376
|
await stopAt(page, "the version-code acknowledgment", [`its Proceed is ${ack.pressed}`]);
|
|
204361
204377
|
acknowledged = true;
|
|
204362
|
-
await
|
|
204378
|
+
await sleep5(3e3);
|
|
204363
204379
|
if (await page.evaluate(reviewScripts.blocked()))
|
|
204364
204380
|
throw new ConsoleError("server", "Play still won't save the release after the acknowledgment");
|
|
204365
204381
|
}
|
|
@@ -204527,7 +204543,7 @@ async function readCountries(page, developerId, appId3, trackId, opts = {}) {
|
|
|
204527
204543
|
}
|
|
204528
204544
|
async function addCountries(page, developerId, appId3, trackId, countries2, opts = {}) {
|
|
204529
204545
|
const url = countriesUrl(developerId, appId3, trackId);
|
|
204530
|
-
const
|
|
204546
|
+
const sleep5 = sleeperOf(opts);
|
|
204531
204547
|
await openForm(page, url, READY3, "the track's Countries / regions tab", opts, 4e3);
|
|
204532
204548
|
const before = parseTargeted(await page.evaluate(countryScripts.state()));
|
|
204533
204549
|
const missing4 = countries2.filter((c2) => !before.includes(c2));
|
|
@@ -204543,14 +204559,14 @@ async function addCountries(page, developerId, appId3, trackId, countries2, opts
|
|
|
204543
204559
|
await page.send("Input.insertText", { text: name });
|
|
204544
204560
|
let tick = { found: false };
|
|
204545
204561
|
for (let i2 = 0; i2 < 10 && !tick.found && !tick.ambiguous; i2++) {
|
|
204546
|
-
await
|
|
204562
|
+
await sleep5(500);
|
|
204547
204563
|
tick = await page.evaluate(countryScripts.tick(name));
|
|
204548
204564
|
}
|
|
204549
204565
|
if (tick.ambiguous)
|
|
204550
204566
|
throw new ConsoleError("invalid", `Countries / regions: more than one row is named "${name}" (${(tick.seen ?? []).join(", ")}); nothing was saved`, { remediation: "Use the name exactly as Play Console lists it" });
|
|
204551
204567
|
if (!tick.found)
|
|
204552
204568
|
throw new ConsoleError("invalid", `Countries / regions: no country "${name}" (the search shows: ${(tick.seen ?? []).join(", ") || "nothing"}); nothing was saved`, { remediation: "Use the name exactly as Play Console lists it" });
|
|
204553
|
-
await
|
|
204569
|
+
await sleep5(800);
|
|
204554
204570
|
}
|
|
204555
204571
|
await pressSave(page, "Countries / regions", false, opts);
|
|
204556
204572
|
const after = await readBackUntil(page, url, READY3, "the track's Countries / regions tab", async () => parseTargeted(await page.evaluate(countryScripts.state())), (t2) => countries2.every((c2) => t2.includes(c2)), opts, 4e3);
|
|
@@ -207105,7 +207121,7 @@ async function waitForReview(api4, packageName, options2 = {}) {
|
|
|
207105
207121
|
if (options2.versionCode !== void 0 && !options2.tracks?.length)
|
|
207106
207122
|
throw new GplayError("refused", "waiting for a version needs the track it's being reviewed on, like --track production: a copy on another track could already be live");
|
|
207107
207123
|
const now = options2.now ?? Date.now;
|
|
207108
|
-
const
|
|
207124
|
+
const sleep5 = options2.sleep ?? ((ms2) => new Promise((done) => setTimeout(done, ms2)));
|
|
207109
207125
|
const interval = options2.intervalMs ?? 5 * 6e4;
|
|
207110
207126
|
const deadline = now() + (options2.timeoutMs ?? 24 * 60 * 6e4);
|
|
207111
207127
|
const watched = /* @__PURE__ */ new Set();
|
|
@@ -207146,7 +207162,7 @@ async function waitForReview(api4, packageName, options2 = {}) {
|
|
|
207146
207162
|
const left = deadline - now();
|
|
207147
207163
|
if (left <= 0)
|
|
207148
207164
|
return { outcome: "timeout", releases: last, detail: "Stopped waiting. The review may still be running; run it again to keep waiting." };
|
|
207149
|
-
await
|
|
207165
|
+
await sleep5(Math.min(interval, left));
|
|
207150
207166
|
}
|
|
207151
207167
|
}
|
|
207152
207168
|
var DEFAULT_TRACKS, PHASES, REJECTION_HELP, WORST_FIRST, key3, TRANSIENT;
|
|
@@ -212627,7 +212643,7 @@ __export(store_google_host_exports, {
|
|
|
212627
212643
|
signingFor: () => signingFor
|
|
212628
212644
|
});
|
|
212629
212645
|
import { createHash as createHash58, randomUUID as randomUUID14 } from "node:crypto";
|
|
212630
|
-
import { existsSync as existsSync99, lstatSync as lstatSync31, mkdirSync as mkdirSync42, readFileSync as readFileSync111, readdirSync as readdirSync44, realpathSync as realpathSync13, renameSync as renameSync16, rmSync as rmSync27, statSync as
|
|
212646
|
+
import { existsSync as existsSync99, lstatSync as lstatSync31, mkdirSync as mkdirSync42, readFileSync as readFileSync111, readdirSync as readdirSync44, realpathSync as realpathSync13, renameSync as renameSync16, rmSync as rmSync27, statSync as statSync28, writeFileSync as writeFileSync41 } from "node:fs";
|
|
212631
212647
|
import { join as join116, relative as relative24 } from "node:path";
|
|
212632
212648
|
function readGooglePlayFacts(dir) {
|
|
212633
212649
|
const path2 = join116(dir, GOOGLE_FACTS_FILE);
|
|
@@ -212711,7 +212727,7 @@ function newestAab(dir) {
|
|
|
212711
212727
|
} catch {
|
|
212712
212728
|
return false;
|
|
212713
212729
|
}
|
|
212714
|
-
}).sort((a3, b3) =>
|
|
212730
|
+
}).sort((a3, b3) => statSync28(b3).mtimeMs - statSync28(a3).mtimeMs);
|
|
212715
212731
|
return found[0];
|
|
212716
212732
|
} catch {
|
|
212717
212733
|
return void 0;
|
|
@@ -215832,10 +215848,10 @@ var init_pacing = __esm({
|
|
|
215832
215848
|
now;
|
|
215833
215849
|
sleep;
|
|
215834
215850
|
next = 0;
|
|
215835
|
-
constructor(intervalMs, now = Date.now,
|
|
215851
|
+
constructor(intervalMs, now = Date.now, sleep5 = (ms2) => new Promise((resolve135) => setTimeout(resolve135, ms2))) {
|
|
215836
215852
|
this.intervalMs = intervalMs;
|
|
215837
215853
|
this.now = now;
|
|
215838
|
-
this.sleep =
|
|
215854
|
+
this.sleep = sleep5;
|
|
215839
215855
|
}
|
|
215840
215856
|
async wait() {
|
|
215841
215857
|
if (this.intervalMs <= 0)
|
|
@@ -220794,7 +220810,7 @@ var init_review = __esm({
|
|
|
220794
220810
|
*/
|
|
220795
220811
|
async waitUntilDone(appRef2, options2 = {}) {
|
|
220796
220812
|
const now = options2.now ?? Date.now;
|
|
220797
|
-
const
|
|
220813
|
+
const sleep5 = options2.sleep ?? ((ms2) => new Promise((resolve135) => setTimeout(resolve135, ms2)));
|
|
220798
220814
|
const interval = options2.intervalMs ?? 6e4;
|
|
220799
220815
|
const deadline = now() + (options2.timeoutMs ?? 30 * 6e4);
|
|
220800
220816
|
for (; ; ) {
|
|
@@ -220806,7 +220822,7 @@ var init_review = __esm({
|
|
|
220806
220822
|
throw new ReviewEndedError(`review ended with outcome developer-rejected, not a decision by App Review (${status2.summary}); the submission was canceled or the version pulled`, status2);
|
|
220807
220823
|
if (now() + interval > deadline)
|
|
220808
220824
|
throw new PendingError(`review is still ${status2.phase} (${status2.summary}); stopped waiting at the timeout`, status2);
|
|
220809
|
-
await
|
|
220825
|
+
await sleep5(interval);
|
|
220810
220826
|
}
|
|
220811
220827
|
}
|
|
220812
220828
|
/** What would block or slow a submission, most severe first. */
|
|
@@ -228171,7 +228187,7 @@ import * as __ascBuiltin049 from "node:fs";
|
|
|
228171
228187
|
import * as __ascBuiltin131 from "node:path";
|
|
228172
228188
|
function screenshotRefsFrom(dir) {
|
|
228173
228189
|
const out2 = {};
|
|
228174
|
-
const dirs = (d2) => readdirSync46(d2).filter((x2) =>
|
|
228190
|
+
const dirs = (d2) => readdirSync46(d2).filter((x2) => statSync29(join122(d2, x2)).isDirectory());
|
|
228175
228191
|
for (const locale of dirs(dir)) {
|
|
228176
228192
|
for (const type2 of dirs(join122(dir, locale))) {
|
|
228177
228193
|
const files = readdirSync46(join122(dir, locale, type2)).filter((f2) => /\.(png|jpe?g)$/i.test(f2)).sort();
|
|
@@ -228290,14 +228306,14 @@ function finish(bundleId, appId3, lines2, steps) {
|
|
|
228290
228306
|
const next = lines2.length && deferred ? `Apply this batch (one approval), then plan again: ${deferred} step(s) wait for it.${stuck.length ? ` Still open: ${stuck.join(", ")}.` : ""}` : lines2.length ? `Applying this batch (one approval) ${submits ? "submits the app for App Review" : "finishes what can be planned"}.${stuck.length ? ` Still open: ${stuck.join(", ")}.` : ""}` : stuck.length ? `Nothing to apply until ${stuck.join(", ")} ${stuck.length === 1 ? "is" : "are"} resolved.` : deferred ? "Nothing to apply yet: plan again once the deferred steps can be planned." : "Nothing to apply: every step is in place.";
|
|
228291
228307
|
return { bundleId, appId: appId3, lines: lines2, steps, complete: deferred === 0 && !stuck.length, next };
|
|
228292
228308
|
}
|
|
228293
|
-
var readFileSync115, readdirSync46,
|
|
228309
|
+
var readFileSync115, readdirSync46, statSync29, join122, STORE_STEPS, readJson10, storePrice;
|
|
228294
228310
|
var init_store_plan = __esm({
|
|
228295
228311
|
"../../node_modules/@wix/asc-jobs/dist/store-plan.js"() {
|
|
228296
228312
|
init_define_HHP_CATALOG();
|
|
228297
228313
|
init_dist3();
|
|
228298
228314
|
init_actions_release();
|
|
228299
228315
|
init_dist5();
|
|
228300
|
-
({ readFileSync: readFileSync115, readdirSync: readdirSync46, statSync:
|
|
228316
|
+
({ readFileSync: readFileSync115, readdirSync: readdirSync46, statSync: statSync29 } = __ascBuiltin049);
|
|
228301
228317
|
({ join: join122 } = __ascBuiltin131);
|
|
228302
228318
|
STORE_STEPS = ["appRecord", "bundleId", "category", "price", "privacy", "medicalDevice", "privacyPublish", "publish", "submit"];
|
|
228303
228319
|
readJson10 = (path2, fact) => {
|
|
@@ -230071,7 +230087,7 @@ function checkKeyDirectory(dir) {
|
|
|
230071
230087
|
const checkout = gitCheckoutOf(dir);
|
|
230072
230088
|
if (checkout)
|
|
230073
230089
|
throw new AscError("refused", `${dir} is inside the git checkout ${checkout}; a private key never goes into a repository \u2014 name a directory outside it (e.g. ~/.asc-node/keys)`);
|
|
230074
|
-
if (existsSync101(dir) && !
|
|
230090
|
+
if (existsSync101(dir) && !statSync30(dir).isDirectory())
|
|
230075
230091
|
throw new AscError("invalid", `${dir} is not a directory`);
|
|
230076
230092
|
return resolve78(dir);
|
|
230077
230093
|
}
|
|
@@ -230115,13 +230131,13 @@ function reserveKeyFile(dir, keyId) {
|
|
|
230115
230131
|
}
|
|
230116
230132
|
};
|
|
230117
230133
|
}
|
|
230118
|
-
var createPrivateKey6, closeSync9, existsSync101, mkdirSync44, openSync8, realpathSync14,
|
|
230134
|
+
var createPrivateKey6, closeSync9, existsSync101, mkdirSync44, openSync8, realpathSync14, statSync30, unlinkSync7, writeSync3, basename29, dirname64, isAbsolute15, join123, resolve78, TEAM_KEY_ROLES, DOWNLOAD_ATTEMPTS, ApiKeysApi;
|
|
230119
230135
|
var init_api_keys = __esm({
|
|
230120
230136
|
"../../node_modules/@wix/asc-web/dist/api-keys.js"() {
|
|
230121
230137
|
init_define_HHP_CATALOG();
|
|
230122
230138
|
init_dist3();
|
|
230123
230139
|
({ createPrivateKey: createPrivateKey6 } = __ascBuiltin051);
|
|
230124
|
-
({ closeSync: closeSync9, existsSync: existsSync101, mkdirSync: mkdirSync44, openSync: openSync8, realpathSync: realpathSync14, statSync:
|
|
230140
|
+
({ closeSync: closeSync9, existsSync: existsSync101, mkdirSync: mkdirSync44, openSync: openSync8, realpathSync: realpathSync14, statSync: statSync30, unlinkSync: unlinkSync7, writeSync: writeSync3 } = __ascBuiltin133);
|
|
230125
230141
|
({ basename: basename29, dirname: dirname64, isAbsolute: isAbsolute15, join: join123, resolve: resolve78 } = __ascBuiltin217);
|
|
230126
230142
|
TEAM_KEY_ROLES = ["ADMIN", "APP_MANAGER", "DEVELOPER", "FINANCE", "SALES", "MARKETING", "ACCESS_TO_REPORTS", "CUSTOMER_SUPPORT", "CREATE_APPS", "CLOUD_MANAGED_APP_DISTRIBUTION", "CLOUD_MANAGED_DEVELOPER_ID"];
|
|
230127
230143
|
DOWNLOAD_ATTEMPTS = 3;
|
|
@@ -230129,9 +230145,9 @@ var init_api_keys = __esm({
|
|
|
230129
230145
|
web;
|
|
230130
230146
|
sleep;
|
|
230131
230147
|
/** Waits between download attempts; tests pass a no-op. */
|
|
230132
|
-
constructor(web4,
|
|
230148
|
+
constructor(web4, sleep5 = (ms2) => new Promise((r3) => setTimeout(r3, ms2))) {
|
|
230133
230149
|
this.web = web4;
|
|
230134
|
-
this.sleep =
|
|
230150
|
+
this.sleep = sleep5;
|
|
230135
230151
|
}
|
|
230136
230152
|
pages(path2) {
|
|
230137
230153
|
return this.web.list(path2);
|
|
@@ -230205,13 +230221,13 @@ function scrubKeyText(text32, privateKey2) {
|
|
|
230205
230221
|
const lines2 = privateKey2.split(/\r?\n/).map((l3) => l3.trim()).filter((l3) => l3.length > 16 && !l3.startsWith("-----"));
|
|
230206
230222
|
return scrubSecrets(text32, [privateKey2, privateKey2.trim(), ...lines2]).replace(/-----BEGIN [A-Z ]*-----[\s\S]*?(-----END [A-Z ]*-----|$)/g, "[private key removed]");
|
|
230207
230223
|
}
|
|
230208
|
-
var
|
|
230224
|
+
var statSync31, join124, keys, destinations, savesKey, createApiKey, revokeApiKey, API_KEY_ACTIONS;
|
|
230209
230225
|
var init_api_key_actions = __esm({
|
|
230210
230226
|
"../../node_modules/@wix/asc-web/dist/api-key-actions.js"() {
|
|
230211
230227
|
init_define_HHP_CATALOG();
|
|
230212
230228
|
init_dist3();
|
|
230213
230229
|
init_api_keys();
|
|
230214
|
-
({ statSync:
|
|
230230
|
+
({ statSync: statSync31 } = __ascBuiltin052);
|
|
230215
230231
|
({ join: join124 } = __ascBuiltin134);
|
|
230216
230232
|
keys = (ctx) => {
|
|
230217
230233
|
if (!ctx.web)
|
|
@@ -230341,7 +230357,7 @@ var init_api_key_actions = __esm({
|
|
|
230341
230357
|
}
|
|
230342
230358
|
let mode = 0;
|
|
230343
230359
|
try {
|
|
230344
|
-
mode =
|
|
230360
|
+
mode = statSync31(join124(p2.outputDir, `AuthKey_${key4.keyId}.p8`)).mode & 511;
|
|
230345
230361
|
} catch {
|
|
230346
230362
|
return { ok: false, detail: `key ${key4.keyId} is active, but its private key file is missing` };
|
|
230347
230363
|
}
|
|
@@ -230530,10 +230546,10 @@ var init_portal_keys = __esm({
|
|
|
230530
230546
|
selected;
|
|
230531
230547
|
/** `developerTeam`: a Team ID or exact team name; without it the session's team is matched (developer-teams.ts).
|
|
230532
230548
|
* `sleep` waits between download attempts; tests pass a no-op. */
|
|
230533
|
-
constructor(web4, developerTeam,
|
|
230549
|
+
constructor(web4, developerTeam, sleep5 = (ms2) => new Promise((r3) => setTimeout(r3, ms2))) {
|
|
230534
230550
|
this.web = web4;
|
|
230535
230551
|
this.developerTeam = developerTeam;
|
|
230536
|
-
this.sleep =
|
|
230552
|
+
this.sleep = sleep5;
|
|
230537
230553
|
}
|
|
230538
230554
|
headers(accept, contentType) {
|
|
230539
230555
|
return {
|
|
@@ -230811,7 +230827,7 @@ async function takeDownload(keys2, target, recovery, said) {
|
|
|
230811
230827
|
recovery.discard();
|
|
230812
230828
|
return file2.path;
|
|
230813
230829
|
}
|
|
230814
|
-
var randomUUID16, closeSync10, existsSync102, fsyncSync, mkdirSync45, openSync9, readdirSync47,
|
|
230830
|
+
var randomUUID16, closeSync10, existsSync102, fsyncSync, mkdirSync45, openSync9, readdirSync47, statSync32, unlinkSync8, writeSync4, join125, KEYS_PAGE, api, services, named2, revokeCommand, downloadCommand, createApnsKey, revokePortalKey, downloadPortalKey, PORTAL_KEY_ACTIONS;
|
|
230815
230831
|
var init_portal_key_actions = __esm({
|
|
230816
230832
|
"../../node_modules/@wix/asc-web/dist/portal-key-actions.js"() {
|
|
230817
230833
|
init_define_HHP_CATALOG();
|
|
@@ -230820,7 +230836,7 @@ var init_portal_key_actions = __esm({
|
|
|
230820
230836
|
init_session();
|
|
230821
230837
|
init_portal_keys();
|
|
230822
230838
|
({ randomUUID: randomUUID16 } = __ascBuiltin054);
|
|
230823
|
-
({ closeSync: closeSync10, existsSync: existsSync102, fsyncSync, mkdirSync: mkdirSync45, openSync: openSync9, readdirSync: readdirSync47, statSync:
|
|
230839
|
+
({ closeSync: closeSync10, existsSync: existsSync102, fsyncSync, mkdirSync: mkdirSync45, openSync: openSync9, readdirSync: readdirSync47, statSync: statSync32, unlinkSync: unlinkSync8, writeSync: writeSync4 } = __ascBuiltin135);
|
|
230824
230840
|
({ join: join125 } = __ascBuiltin218);
|
|
230825
230841
|
KEYS_PAGE = "https://developer.apple.com/account/resources/authkeys/list";
|
|
230826
230842
|
api = (ctx, developerTeam) => {
|
|
@@ -230918,7 +230934,7 @@ var init_portal_key_actions = __esm({
|
|
|
230918
230934
|
return { ok: false, detail: `key ${keyId} reads back as ${services(key4)}, not APNs` };
|
|
230919
230935
|
let mode = 0;
|
|
230920
230936
|
try {
|
|
230921
|
-
mode =
|
|
230937
|
+
mode = statSync32(join125(p2.outputDir, `AuthKey_${keyId}.p8`)).mode & 511;
|
|
230922
230938
|
} catch {
|
|
230923
230939
|
return { ok: false, detail: `key ${keyId} is an APNs key, but its private key file is missing` };
|
|
230924
230940
|
}
|
|
@@ -231009,7 +231025,7 @@ var init_portal_key_actions = __esm({
|
|
|
231009
231025
|
if (applied) {
|
|
231010
231026
|
let mode = 0;
|
|
231011
231027
|
try {
|
|
231012
|
-
mode =
|
|
231028
|
+
mode = statSync32(join125(p2.outputDir, `AuthKey_${p2.keyId}.p8`)).mode & 511;
|
|
231013
231029
|
} catch {
|
|
231014
231030
|
return { ok: false, detail: `key ${p2.keyId}'s private key file is missing` };
|
|
231015
231031
|
}
|
|
@@ -232218,7 +232234,7 @@ function preparePrivateDirectory(dir) {
|
|
|
232218
232234
|
return path2;
|
|
232219
232235
|
}
|
|
232220
232236
|
mkdirSync46(path2, { recursive: true, mode: 448 });
|
|
232221
|
-
if (
|
|
232237
|
+
if (statSync33(path2).mode & 63)
|
|
232222
232238
|
throw new AscError("refused", `${path2} is not private after creating it`);
|
|
232223
232239
|
return path2;
|
|
232224
232240
|
}
|
|
@@ -232274,13 +232290,13 @@ async function downloadThreadAttachments(client4, threadId, outDir) {
|
|
|
232274
232290
|
}
|
|
232275
232291
|
return result;
|
|
232276
232292
|
}
|
|
232277
|
-
var lstatSync32, mkdirSync46,
|
|
232293
|
+
var lstatSync32, mkdirSync46, statSync33, writeFileSync43, basename31, join126, resolve79, MAX_NAME_ATTEMPTS, refreshKey;
|
|
232278
232294
|
var init_review_attachments = __esm({
|
|
232279
232295
|
"../../node_modules/@wix/asc-web/dist/review-attachments.js"() {
|
|
232280
232296
|
init_define_HHP_CATALOG();
|
|
232281
232297
|
init_dist3();
|
|
232282
232298
|
init_api_keys();
|
|
232283
|
-
({ lstatSync: lstatSync32, mkdirSync: mkdirSync46, statSync:
|
|
232299
|
+
({ lstatSync: lstatSync32, mkdirSync: mkdirSync46, statSync: statSync33, writeFileSync: writeFileSync43 } = __ascBuiltin056);
|
|
232284
232300
|
({ basename: basename31, join: join126, resolve: resolve79 } = __ascBuiltin137);
|
|
232285
232301
|
MAX_NAME_ATTEMPTS = 1e4;
|
|
232286
232302
|
refreshKey = (a3) => [a3.sourceType, a3.id, a3.threadId, a3.messageId ?? "", a3.reviewRejectionId ?? ""].join("|");
|
|
@@ -232445,7 +232461,7 @@ function resolveMessagesDb(raw, home2 = homedir14()) {
|
|
|
232445
232461
|
const given = raw?.trim();
|
|
232446
232462
|
const path2 = !given ? join127(home2, "Library", "Messages", "chat.db") : resolvePath2(given === "~" || given.startsWith("~/") ? join127(home2, given.slice(1)) : given);
|
|
232447
232463
|
try {
|
|
232448
|
-
if (
|
|
232464
|
+
if (statSync34(path2).isDirectory())
|
|
232449
232465
|
throw new MessagesCodeError(`the Messages database path ${path2} is a directory; --db must point at chat.db`);
|
|
232450
232466
|
} catch (e2) {
|
|
232451
232467
|
if (e2 instanceof MessagesCodeError)
|
|
@@ -232462,7 +232478,7 @@ function resolveMessagesDb(raw, home2 = homedir14()) {
|
|
|
232462
232478
|
async function waitForAppleCode(options2) {
|
|
232463
232479
|
const query = options2.query ?? systemSqliteQuery;
|
|
232464
232480
|
const now = options2.now ?? Date.now;
|
|
232465
|
-
const
|
|
232481
|
+
const sleep5 = options2.sleep ?? ((ms2) => new Promise((r3) => setTimeout(r3, ms2)));
|
|
232466
232482
|
const pollMs = options2.pollMs ?? 2e3;
|
|
232467
232483
|
const deadline = now() + options2.timeoutMs;
|
|
232468
232484
|
const sql = messagesCodeQuery(options2.cutoffMs);
|
|
@@ -232482,7 +232498,7 @@ async function waitForAppleCode(options2) {
|
|
|
232482
232498
|
if (now() + pollMs > deadline) {
|
|
232483
232499
|
throw new MessagesCodeError(`no Apple verification code in Messages within ${Math.round(options2.timeoutMs / 1e3)}s (accepting messages ${options2.window}); check that the code went by SMS and that iPhone Text Message Forwarding is on for this Mac`);
|
|
232484
232500
|
}
|
|
232485
|
-
await
|
|
232501
|
+
await sleep5(pollMs);
|
|
232486
232502
|
}
|
|
232487
232503
|
}
|
|
232488
232504
|
function parseDuration(text32) {
|
|
@@ -232495,14 +232511,14 @@ function parseDuration(text32) {
|
|
|
232495
232511
|
total += Number(n2) * unit[u2];
|
|
232496
232512
|
return total > 0 ? total : void 0;
|
|
232497
232513
|
}
|
|
232498
|
-
var execFile5, homedir14, join127, resolvePath2,
|
|
232514
|
+
var execFile5, homedir14, join127, resolvePath2, statSync34, pathToFileURL8, MESSAGES_DEFAULT_SINCE_MS, MESSAGES_MAX_SINCE_MS, MESSAGES_DEFAULT_TIMEOUT_MS, REQUEST_SKEW_MS, ROW_LIMIT, SECONDS_THRESHOLD, APPLE_EPOCH_MS, SYSTEM_SQLITE, MessagesCodeError, isPrivacyError, systemSqliteQuery;
|
|
232499
232515
|
var init_messages_code = __esm({
|
|
232500
232516
|
"../../node_modules/@wix/asc-web/dist/messages-code.js"() {
|
|
232501
232517
|
init_define_HHP_CATALOG();
|
|
232502
232518
|
({ execFile: execFile5 } = __ascBuiltin057);
|
|
232503
232519
|
({ homedir: homedir14 } = __ascBuiltin138);
|
|
232504
232520
|
({ join: join127, resolve: resolvePath2 } = __ascBuiltin219);
|
|
232505
|
-
({ statSync:
|
|
232521
|
+
({ statSync: statSync34 } = __ascBuiltin37);
|
|
232506
232522
|
({ pathToFileURL: pathToFileURL8 } = __ascBuiltin42);
|
|
232507
232523
|
MESSAGES_DEFAULT_SINCE_MS = 6e4;
|
|
232508
232524
|
MESSAGES_MAX_SINCE_MS = 10 * 6e4;
|
|
@@ -232625,7 +232641,7 @@ function readSessionBundle(path2) {
|
|
|
232625
232641
|
throw new SessionBundleError(`the session bundle is larger than ${MAX_SESSION_BUNDLE_BYTES} bytes`);
|
|
232626
232642
|
return readFileSync116(path2, "utf8");
|
|
232627
232643
|
}
|
|
232628
|
-
var chmodSync4, closeSync11, constants9, fstatSync3, lstatSync33, mkdirSync47, openSync10, readFileSync116, renameSync17, rmSync28,
|
|
232644
|
+
var chmodSync4, closeSync11, constants9, fstatSync3, lstatSync33, mkdirSync47, openSync10, readFileSync116, renameSync17, rmSync28, statSync35, writeSync5, createHash67, randomBytes16, dirname65, isAbsolute16, join128, resolve80, SESSION_BUNDLE_KIND, SESSION_BUNDLE_VERSION, MAX_SESSION_BUNDLE_BYTES, SessionBundleError, isAppleDomain, SESSION_FILE_VERSION, FileSessionStore, KEYRING_HINT, SecretServiceSessionStore;
|
|
232629
232645
|
var init_session_transfer = __esm({
|
|
232630
232646
|
"../../node_modules/@wix/asc-web/dist/session-transfer.js"() {
|
|
232631
232647
|
init_define_HHP_CATALOG();
|
|
@@ -232633,7 +232649,7 @@ var init_session_transfer = __esm({
|
|
|
232633
232649
|
init_api_keys();
|
|
232634
232650
|
init_session_lock();
|
|
232635
232651
|
init_session();
|
|
232636
|
-
({ chmodSync: chmodSync4, closeSync: closeSync11, constants: constants9, fstatSync: fstatSync3, lstatSync: lstatSync33, mkdirSync: mkdirSync47, openSync: openSync10, readFileSync: readFileSync116, renameSync: renameSync17, rmSync: rmSync28, statSync:
|
|
232652
|
+
({ chmodSync: chmodSync4, closeSync: closeSync11, constants: constants9, fstatSync: fstatSync3, lstatSync: lstatSync33, mkdirSync: mkdirSync47, openSync: openSync10, readFileSync: readFileSync116, renameSync: renameSync17, rmSync: rmSync28, statSync: statSync35, writeSync: writeSync5 } = __ascBuiltin058);
|
|
232637
232653
|
({ createHash: createHash67, randomBytes: randomBytes16 } = __ascBuiltin139);
|
|
232638
232654
|
({ dirname: dirname65, isAbsolute: isAbsolute16, join: join128, resolve: resolve80 } = __ascBuiltin220);
|
|
232639
232655
|
SESSION_BUNDLE_KIND = "asc-node-web-session";
|
|
@@ -232699,7 +232715,7 @@ var init_session_transfer = __esm({
|
|
|
232699
232715
|
}
|
|
232700
232716
|
prepareDir() {
|
|
232701
232717
|
mkdirSync47(this.dir, { recursive: true, mode: 448 });
|
|
232702
|
-
if (!
|
|
232718
|
+
if (!statSync35(this.dir).isDirectory())
|
|
232703
232719
|
throw Object.assign(new Error("not a directory"), { code: "ENOTDIR" });
|
|
232704
232720
|
chmodSync4(this.dir, 448);
|
|
232705
232721
|
}
|
|
@@ -233251,7 +233267,7 @@ async function startConnectServer(opts) {
|
|
|
233251
233267
|
return closed;
|
|
233252
233268
|
}
|
|
233253
233269
|
const idle = async (maxWaitMs) => {
|
|
233254
|
-
const
|
|
233270
|
+
const drained2 = (async () => {
|
|
233255
233271
|
while (inflight) {
|
|
233256
233272
|
const current = inflight;
|
|
233257
233273
|
await current;
|
|
@@ -233261,14 +233277,14 @@ async function startConnectServer(opts) {
|
|
|
233261
233277
|
return true;
|
|
233262
233278
|
})();
|
|
233263
233279
|
if (maxWaitMs === void 0 || !inflight)
|
|
233264
|
-
return
|
|
233280
|
+
return drained2;
|
|
233265
233281
|
let cap2;
|
|
233266
233282
|
const late = new Promise((resolve135) => {
|
|
233267
233283
|
cap2 = setTimeout(() => resolve135(false), maxWaitMs);
|
|
233268
233284
|
cap2.unref();
|
|
233269
233285
|
});
|
|
233270
233286
|
try {
|
|
233271
|
-
return await Promise.race([
|
|
233287
|
+
return await Promise.race([drained2, late]);
|
|
233272
233288
|
} finally {
|
|
233273
233289
|
clearTimeout(cap2);
|
|
233274
233290
|
}
|
|
@@ -234955,8 +234971,8 @@ function localFiles(inv) {
|
|
|
234955
234971
|
}
|
|
234956
234972
|
function screenshotsFrom(dir) {
|
|
234957
234973
|
const out2 = {};
|
|
234958
|
-
for (const locale of readdirSync48(dir).filter((d2) =>
|
|
234959
|
-
for (const type2 of readdirSync48(join130(dir, locale)).filter((d2) =>
|
|
234974
|
+
for (const locale of readdirSync48(dir).filter((d2) => statSync36(join130(dir, d2)).isDirectory())) {
|
|
234975
|
+
for (const type2 of readdirSync48(join130(dir, locale)).filter((d2) => statSync36(join130(dir, locale, d2)).isDirectory())) {
|
|
234960
234976
|
const files = readdirSync48(join130(dir, locale, type2)).filter((f2) => /\.(png|jpe?g)$/i.test(f2)).sort();
|
|
234961
234977
|
if (files.length)
|
|
234962
234978
|
(out2[locale] ??= {})[type2] = files.map((f2) => ({ fileName: f2, ...fileRef(join130(dir, locale, type2, f2)) }));
|
|
@@ -234968,8 +234984,8 @@ function screenshotsFrom(dir) {
|
|
|
234968
234984
|
}
|
|
234969
234985
|
function previewsFrom(dir) {
|
|
234970
234986
|
const out2 = {};
|
|
234971
|
-
for (const locale of readdirSync48(dir).filter((d2) =>
|
|
234972
|
-
for (const type2 of readdirSync48(join130(dir, locale)).filter((d2) =>
|
|
234987
|
+
for (const locale of readdirSync48(dir).filter((d2) => statSync36(join130(dir, d2)).isDirectory())) {
|
|
234988
|
+
for (const type2 of readdirSync48(join130(dir, locale)).filter((d2) => statSync36(join130(dir, locale, d2)).isDirectory())) {
|
|
234973
234989
|
const files = readdirSync48(join130(dir, locale, type2)).filter((f2) => /\.(mov|m4v|mp4)$/i.test(f2)).sort();
|
|
234974
234990
|
if (files.length)
|
|
234975
234991
|
(out2[locale] ??= {})[type2] = files.map((f2) => ({ fileName: f2, ...fileRef(join130(dir, locale, type2, f2)) }));
|
|
@@ -235014,7 +235030,7 @@ function batchView(b3) {
|
|
|
235014
235030
|
const r3 = batchReport(b3);
|
|
235015
235031
|
return { batch: b3.id, status: b3.status, planHash: b3.planHash.slice(0, 16), approvals: b3.approvals.map((a3) => a3.approver), decision: b3.decision, summary: r3.summary, lines: r3.items.map((i2) => `${i2.status} ${i2.action} ${i2.key}${i2.error ? ` \u2014 ${i2.error.split("\n")[0]}` : ""}`) };
|
|
235016
235032
|
}
|
|
235017
|
-
var readdirSync48, readFileSync118,
|
|
235033
|
+
var readdirSync48, readFileSync118, statSync36, writeFileSync44, join130, sizeText2, VERSION_FLAGS, APP_INFO_FLAGS, stringFlags, REVIEW_DETAIL_OPTIONS, batchExit, RELEASE_COMMANDS;
|
|
235018
235034
|
var init_commands_release = __esm({
|
|
235019
235035
|
"../../node_modules/@wix/asc/dist/commands-release.js"() {
|
|
235020
235036
|
init_define_HHP_CATALOG();
|
|
@@ -235024,7 +235040,7 @@ var init_commands_release = __esm({
|
|
|
235024
235040
|
init_commands();
|
|
235025
235041
|
init_output2();
|
|
235026
235042
|
init_commands_record();
|
|
235027
|
-
({ readdirSync: readdirSync48, readFileSync: readFileSync118, statSync:
|
|
235043
|
+
({ readdirSync: readdirSync48, readFileSync: readFileSync118, statSync: statSync36, writeFileSync: writeFileSync44 } = __ascBuiltin064);
|
|
235028
235044
|
({ join: join130 } = __ascBuiltin141);
|
|
235029
235045
|
sizeText2 = ([w2, h2]) => `${w2}x${h2}`;
|
|
235030
235046
|
VERSION_FLAGS = { description: "description", keywords: "keywords", "whats-new": "whatsNew", "promotional-text": "promotionalText", "marketing-url": "marketingUrl", "support-url": "supportUrl" };
|
|
@@ -236502,9 +236518,9 @@ function draftBody(inv) {
|
|
|
236502
236518
|
}
|
|
236503
236519
|
let bytes2;
|
|
236504
236520
|
try {
|
|
236505
|
-
if (!
|
|
236521
|
+
if (!statSync37(file2).isFile())
|
|
236506
236522
|
throw new Error("not a regular file");
|
|
236507
|
-
if (
|
|
236523
|
+
if (statSync37(file2).size > BODY_LIMIT)
|
|
236508
236524
|
throw new UsageError(`--body-file is over the ${BODY_LIMIT}-byte limit`);
|
|
236509
236525
|
bytes2 = readFileSync120(file2);
|
|
236510
236526
|
} catch (e2) {
|
|
@@ -236522,7 +236538,7 @@ function draftBody(inv) {
|
|
|
236522
236538
|
throw new UsageError("--body-file must hold a message");
|
|
236523
236539
|
return body;
|
|
236524
236540
|
}
|
|
236525
|
-
var readFileSync120,
|
|
236541
|
+
var readFileSync120, statSync37, resolve84, appleIdOption2, appOptions, BODY_LIMIT, webJob, draftOptions, subscriptionColumns, WEB_REVIEW_COMMANDS;
|
|
236526
236542
|
var init_commands_web_review = __esm({
|
|
236527
236543
|
"../../node_modules/@wix/asc/dist/commands-web-review.js"() {
|
|
236528
236544
|
init_define_HHP_CATALOG();
|
|
@@ -236531,7 +236547,7 @@ var init_commands_web_review = __esm({
|
|
|
236531
236547
|
init_commands();
|
|
236532
236548
|
init_commands_web();
|
|
236533
236549
|
init_output2();
|
|
236534
|
-
({ readFileSync: readFileSync120, statSync:
|
|
236550
|
+
({ readFileSync: readFileSync120, statSync: statSync37 } = __ascBuiltin067);
|
|
236535
236551
|
({ resolve: resolve84 } = __ascBuiltin143);
|
|
236536
236552
|
appleIdOption2 = { "apple-id": { type: "string" } };
|
|
236537
236553
|
appOptions = { ...appleIdOption2, app: { type: "string" } };
|
|
@@ -242308,7 +242324,7 @@ function checkJobFile(path2, param, ctx, o2 = {}) {
|
|
|
242308
242324
|
} catch (e2) {
|
|
242309
242325
|
throw new AscError("invalid", `${param}: cannot read ${path2} (${e2.code ?? "unreadable"})`);
|
|
242310
242326
|
}
|
|
242311
|
-
const stat10 =
|
|
242327
|
+
const stat10 = statSync38(real);
|
|
242312
242328
|
if (o2.directory ? !stat10.isDirectory() : !stat10.isFile())
|
|
242313
242329
|
throw new AscError("invalid", `${param}: ${path2} is not a ${o2.directory ? "directory" : "regular file"}`);
|
|
242314
242330
|
let state;
|
|
@@ -242512,7 +242528,7 @@ ${o2.detail}` : ""}` };
|
|
|
242512
242528
|
function enabledTools(env, o2 = {}) {
|
|
242513
242529
|
return TOOLS.filter((t2) => !t2.write || env.ASC_MCP_WRITE === "1" || o2.approvals === true);
|
|
242514
242530
|
}
|
|
242515
|
-
var mkdirSync49, readFileSync124, realpathSync15,
|
|
242531
|
+
var mkdirSync49, readFileSync124, realpathSync15, statSync38, writeFileSync47, delimiter3, isAbsolute17, join133, relative25, resolve86, sep29, READ, PLAN, APPLY, BATCH_SUMMARY_LINES, BATCH_CHANGES_PER_LINE, BATCH_CHANGE_LINES, ok2, app, reads, jobView2, noAppleId, EXIT_KINDS, notesOf2, cliResult, flag2, ACTIONS, FAMILIES, inside2, identityFile, appleIdParam, TOOLS;
|
|
242516
242532
|
var init_tools2 = __esm({
|
|
242517
242533
|
"../../node_modules/@wix/asc-mcp/dist/tools.js"() {
|
|
242518
242534
|
init_define_HHP_CATALOG();
|
|
@@ -242522,7 +242538,7 @@ var init_tools2 = __esm({
|
|
|
242522
242538
|
init_dist6();
|
|
242523
242539
|
init_dist7();
|
|
242524
242540
|
init_action_catalog_generated();
|
|
242525
|
-
({ mkdirSync: mkdirSync49, readFileSync: readFileSync124, realpathSync: realpathSync15, statSync:
|
|
242541
|
+
({ mkdirSync: mkdirSync49, readFileSync: readFileSync124, realpathSync: realpathSync15, statSync: statSync38, writeFileSync: writeFileSync47 } = __ascBuiltin075);
|
|
242526
242542
|
({ delimiter: delimiter3, isAbsolute: isAbsolute17, join: join133, relative: relative25, resolve: resolve86, sep: sep29 } = __ascBuiltin148);
|
|
242527
242543
|
READ = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true };
|
|
242528
242544
|
PLAN = { readOnlyHint: true, destructiveHint: false, idempotentHint: false, openWorldHint: true };
|
|
@@ -243548,15 +243564,15 @@ var init_store_android = __esm({
|
|
|
243548
243564
|
const developerId = developerOf(app2, clients);
|
|
243549
243565
|
const appId3 = await appIdOf2(app2, clients);
|
|
243550
243566
|
const gplay2 = clients;
|
|
243551
|
-
const
|
|
243567
|
+
const sleep5 = gplay2.sleep ? { sleep: gplay2.sleep } : {};
|
|
243552
243568
|
const { status: status2, issue: issue3 } = await withConsole(gplay2, { developerId, appId: appId3 }, async (opened) => {
|
|
243553
243569
|
const page = readOnlyConsolePage(opened);
|
|
243554
|
-
const status3 = await readPolicyStatus(page, developerId, appId3,
|
|
243570
|
+
const status3 = await readPolicyStatus(page, developerId, appId3, sleep5);
|
|
243555
243571
|
const pick5 = issueId ?? status3.issues.find((i2) => NEEDS_ACTION.test(i2.status))?.id;
|
|
243556
243572
|
if (!pick5)
|
|
243557
243573
|
return { status: status3, issue: null };
|
|
243558
243574
|
const listed = status3.issues.find((i2) => i2.id === pick5);
|
|
243559
|
-
const rejection = await readRejection(page, developerId, appId3, pick5,
|
|
243575
|
+
const rejection = await readRejection(page, developerId, appId3, pick5, sleep5);
|
|
243560
243576
|
return { status: status3, issue: { id: pick5, ...listed ? { title: listed.title, status: listed.status, ...listed.deadline ? { deadline: listed.deadline } : {} } : {}, ...rejection } };
|
|
243561
243577
|
});
|
|
243562
243578
|
const replies = issue3 ? issue3.actions.filter((x2) => REPLY_ACTIONS.test(x2)) : [];
|
|
@@ -244740,7 +244756,7 @@ __export(apple_keys_exports, {
|
|
|
244740
244756
|
runAppleKeys: () => runAppleKeys
|
|
244741
244757
|
});
|
|
244742
244758
|
import { createPublicKey as createPublicKey5 } from "node:crypto";
|
|
244743
|
-
import { readFileSync as readFileSync125, realpathSync as realpathSync16, statSync as
|
|
244759
|
+
import { readFileSync as readFileSync125, realpathSync as realpathSync16, statSync as statSync39 } from "node:fs";
|
|
244744
244760
|
function readKey2(flags, kind) {
|
|
244745
244761
|
const names2 = kind === "asc" ? ["asc-key-file", "asc-key-id", "asc-issuer-id"] : ["iap-key", "iap-key-id", "iap-issuer-id"];
|
|
244746
244762
|
if (names2.every((name) => flags[name] === void 0)) return void 0;
|
|
@@ -244749,7 +244765,7 @@ function readKey2(flags, kind) {
|
|
|
244749
244765
|
try {
|
|
244750
244766
|
const path2 = realpathSync16(file2);
|
|
244751
244767
|
assertCredentialOutsideRepo(names2[0], path2);
|
|
244752
|
-
if (
|
|
244768
|
+
if (statSync39(path2).size > 16384) throw new Error("oversized");
|
|
244753
244769
|
const key4 = { keyId, issuerId, key: readFileSync125(path2, "utf8") };
|
|
244754
244770
|
if (!isAppStoreConnectKey(key4)) throw new Error("invalid key");
|
|
244755
244771
|
return key4;
|
|
@@ -247551,7 +247567,7 @@ __export(browser_authoring_exports, {
|
|
|
247551
247567
|
});
|
|
247552
247568
|
import { createServer as createServer6 } from "node:http";
|
|
247553
247569
|
import { createHash as createHash73, randomBytes as randomBytes19 } from "node:crypto";
|
|
247554
|
-
import { existsSync as existsSync110, readdirSync as readdirSync51, readFileSync as readFileSync131, realpathSync as realpathSync18, statSync as
|
|
247570
|
+
import { existsSync as existsSync110, readdirSync as readdirSync51, readFileSync as readFileSync131, realpathSync as realpathSync18, statSync as statSync40 } from "node:fs";
|
|
247555
247571
|
import { join as join143, posix as posix3, relative as relative29, sep as sep31 } from "node:path";
|
|
247556
247572
|
function humanMs(ms2) {
|
|
247557
247573
|
return ms2 < 1e3 ? `${ms2}ms` : `${Math.round(ms2 / 1e3)}s`;
|
|
@@ -247567,7 +247583,7 @@ function collectWorkerSources(tier5SrcDir, bundleName) {
|
|
|
247567
247583
|
for (const name of readdirSync51(abs).sort()) {
|
|
247568
247584
|
const childAbs = join143(abs, name);
|
|
247569
247585
|
const childRel = posix3.join(rel2, name);
|
|
247570
|
-
if (
|
|
247586
|
+
if (statSync40(childAbs).isDirectory()) {
|
|
247571
247587
|
walk5(childAbs, childRel);
|
|
247572
247588
|
} else if (/\.(ts|tsx|js|mjs|json)$/.test(name)) {
|
|
247573
247589
|
files[childRel] = readFileSync131(childAbs, "utf8");
|
|
@@ -247601,7 +247617,7 @@ function collectRelativeSiblings(files, tier5SrcDir) {
|
|
|
247601
247617
|
join143(onDisk, "index.js")
|
|
247602
247618
|
];
|
|
247603
247619
|
for (const abs of candidates) {
|
|
247604
|
-
if (!existsSync110(abs) ||
|
|
247620
|
+
if (!existsSync110(abs) || statSync40(abs).isDirectory()) continue;
|
|
247605
247621
|
const key4 = `/tier5-src/${relative29(tier5SrcDir, abs).split(sep31).join(posix3.sep)}`;
|
|
247606
247622
|
if (key4 in files) break;
|
|
247607
247623
|
files[key4] = readFileSync131(abs, "utf8");
|
|
@@ -250279,7 +250295,7 @@ ${indent}`);
|
|
|
250279
250295
|
|
|
250280
250296
|
// src/one-app/access-cli.ts
|
|
250281
250297
|
import { createHash as createHash78 } from "node:crypto";
|
|
250282
|
-
import { existsSync as existsSync114, readFileSync as readFileSync135, rmSync as rmSync31, statSync as
|
|
250298
|
+
import { existsSync as existsSync114, readFileSync as readFileSync135, rmSync as rmSync31, statSync as statSync41, writeFileSync as writeFileSync54 } from "node:fs";
|
|
250283
250299
|
import { join as join147, resolve as resolve95 } from "node:path";
|
|
250284
250300
|
function parseArgs2(args) {
|
|
250285
250301
|
let evidenceDir;
|
|
@@ -250463,7 +250479,7 @@ async function runOneAppAccess(args, io2) {
|
|
|
250463
250479
|
let configText;
|
|
250464
250480
|
let screensText;
|
|
250465
250481
|
try {
|
|
250466
|
-
for (const path2 of [configPath, screensPath]) if (!
|
|
250482
|
+
for (const path2 of [configPath, screensPath]) if (!statSync41(path2).isFile()) throw new Error(`${path2} is not a file.`);
|
|
250467
250483
|
configText = readFileSync135(configPath, "utf8");
|
|
250468
250484
|
screensText = readFileSync135(screensPath, "utf8");
|
|
250469
250485
|
} catch (error) {
|
|
@@ -251202,7 +251218,7 @@ __export(validate_topbar_exports, {
|
|
|
251202
251218
|
runOneAppTopBarValidation: () => runOneAppTopBarValidation
|
|
251203
251219
|
});
|
|
251204
251220
|
import { createHash as createHash79 } from "node:crypto";
|
|
251205
|
-
import { existsSync as existsSync117, readFileSync as readFileSync138, statSync as
|
|
251221
|
+
import { existsSync as existsSync117, readFileSync as readFileSync138, statSync as statSync42 } from "node:fs";
|
|
251206
251222
|
import { resolve as resolve97, join as join150 } from "node:path";
|
|
251207
251223
|
import ts25 from "typescript";
|
|
251208
251224
|
function enrichedControls(raw, views2, omit) {
|
|
@@ -251730,7 +251746,7 @@ function validate3(evidenceDir, contentDir2) {
|
|
|
251730
251746
|
let drawerInvite = false;
|
|
251731
251747
|
try {
|
|
251732
251748
|
configPath = join150(contentDir2, "config.ts");
|
|
251733
|
-
if (!
|
|
251749
|
+
if (!statSync42(configPath).isFile()) throw new Error("config.ts is not a file.");
|
|
251734
251750
|
target = configActions(configPath);
|
|
251735
251751
|
drawerInvite = drawerOffersInvite(readFileSync138(configPath, "utf8"));
|
|
251736
251752
|
descriptorBars = screenActions2(contentDir2);
|
|
@@ -252007,7 +252023,7 @@ __export(shot_files_exports, {
|
|
|
252007
252023
|
writeScreenShot: () => writeScreenShot
|
|
252008
252024
|
});
|
|
252009
252025
|
import { createHash as createHash80 } from "node:crypto";
|
|
252010
|
-
import { mkdirSync as mkdirSync55, readdirSync as readdirSync54, readFileSync as readFileSync140, rmSync as rmSync33, statSync as
|
|
252026
|
+
import { mkdirSync as mkdirSync55, readdirSync as readdirSync54, readFileSync as readFileSync140, rmSync as rmSync33, statSync as statSync43 } from "node:fs";
|
|
252011
252027
|
import { basename as basename35, dirname as dirname69, join as join152, relative as relative30, resolve as resolve98, sep as sep32 } from "node:path";
|
|
252012
252028
|
function writeAtomic2(file2, bytes2) {
|
|
252013
252029
|
for (let attempt2 = 0; ; attempt2++) {
|
|
@@ -252115,7 +252131,7 @@ function listFiles4(root, keep) {
|
|
|
252115
252131
|
}
|
|
252116
252132
|
function mtimeOf(file2) {
|
|
252117
252133
|
try {
|
|
252118
|
-
return
|
|
252134
|
+
return statSync43(file2).mtimeMs;
|
|
252119
252135
|
} catch {
|
|
252120
252136
|
return null;
|
|
252121
252137
|
}
|
|
@@ -252587,7 +252603,7 @@ __export(render_cache_exports, {
|
|
|
252587
252603
|
renderCacheKey: () => renderCacheKey
|
|
252588
252604
|
});
|
|
252589
252605
|
import { createHash as createHash82, randomBytes as randomBytes20 } from "node:crypto";
|
|
252590
|
-
import { existsSync as existsSync121, lstatSync as lstatSync36, mkdirSync as mkdirSync57, readdirSync as readdirSync55, readFileSync as readFileSync143, readlinkSync as readlinkSync3, realpathSync as realpathSync19, renameSync as renameSync20, rmSync as rmSync34, statSync as
|
|
252606
|
+
import { existsSync as existsSync121, lstatSync as lstatSync36, mkdirSync as mkdirSync57, readdirSync as readdirSync55, readFileSync as readFileSync143, readlinkSync as readlinkSync3, realpathSync as realpathSync19, renameSync as renameSync20, rmSync as rmSync34, statSync as statSync44, writeFileSync as writeFileSync58 } from "node:fs";
|
|
252591
252607
|
import { join as join155, resolve as resolve99 } from "node:path";
|
|
252592
252608
|
import { fileURLToPath as fileURLToPath35 } from "node:url";
|
|
252593
252609
|
function renderCacheKey(contentDir2, inputs) {
|
|
@@ -252617,7 +252633,7 @@ function renderCacheKey(contentDir2, inputs) {
|
|
|
252617
252633
|
}
|
|
252618
252634
|
function statOrNull(path2) {
|
|
252619
252635
|
try {
|
|
252620
|
-
return
|
|
252636
|
+
return statSync44(path2);
|
|
252621
252637
|
} catch {
|
|
252622
252638
|
return null;
|
|
252623
252639
|
}
|
|
@@ -252682,7 +252698,7 @@ function cliFingerprint(version5, monorepo) {
|
|
|
252682
252698
|
let entry = "";
|
|
252683
252699
|
try {
|
|
252684
252700
|
const file2 = fileURLToPath35(import.meta.url);
|
|
252685
|
-
const st2 =
|
|
252701
|
+
const st2 = statSync44(file2);
|
|
252686
252702
|
entry = `${file2}:${st2.size}:${st2.mtimeMs}`;
|
|
252687
252703
|
} catch {
|
|
252688
252704
|
}
|
|
@@ -252716,7 +252732,7 @@ function keepBuild(contentDir2, key4, buildDir, build3) {
|
|
|
252716
252732
|
else renameSync20(buildDir, dest);
|
|
252717
252733
|
for (const name of readdirSync55(root)) {
|
|
252718
252734
|
const path2 = join155(root, name);
|
|
252719
|
-
if (name.startsWith(".build-") ? Date.now() -
|
|
252735
|
+
if (name.startsWith(".build-") ? Date.now() - statSync44(path2).mtimeMs > 36e5 : name !== key4) {
|
|
252720
252736
|
rmSync34(path2, { recursive: true, force: true });
|
|
252721
252737
|
}
|
|
252722
252738
|
}
|
|
@@ -253694,8 +253710,22 @@ var init_assets = __esm({
|
|
|
253694
253710
|
// ../serve-cli/src/large-assets.ts
|
|
253695
253711
|
var large_assets_exports = {};
|
|
253696
253712
|
__export(large_assets_exports, {
|
|
253713
|
+
LARGE_ASSET_BUSY_MAX_TOTAL_WAIT_SEC: () => LARGE_ASSET_BUSY_MAX_TOTAL_WAIT_SEC,
|
|
253714
|
+
busyRetryAfterSec: () => busyRetryAfterSec,
|
|
253697
253715
|
uploadLargeAssets: () => uploadLargeAssets
|
|
253698
253716
|
});
|
|
253717
|
+
function busyRetryAfterSec(put) {
|
|
253718
|
+
if (put.ok || put.status !== 429 && put.status !== 503) return void 0;
|
|
253719
|
+
let body;
|
|
253720
|
+
try {
|
|
253721
|
+
body = JSON.parse(put.text);
|
|
253722
|
+
} catch {
|
|
253723
|
+
return void 0;
|
|
253724
|
+
}
|
|
253725
|
+
if (body.code !== "large_asset_upload_in_flight" && body.code !== "large_asset_upload_capacity") return void 0;
|
|
253726
|
+
const wait = typeof body.retryAfterSec === "number" && body.retryAfterSec > 0 ? body.retryAfterSec : 5;
|
|
253727
|
+
return wait <= LARGE_ASSET_BUSY_MAX_WAIT_SEC ? wait : void 0;
|
|
253728
|
+
}
|
|
253699
253729
|
async function uploadLargeAssets(client4, app2, uploads) {
|
|
253700
253730
|
const uploaded = [];
|
|
253701
253731
|
const alreadyStored = [];
|
|
@@ -253703,9 +253733,24 @@ async function uploadLargeAssets(client4, app2, uploads) {
|
|
|
253703
253733
|
for (const u2 of uploads) {
|
|
253704
253734
|
const declaration2 = { app: app2, sha256: u2.sha256, bytes: u2.bytes, contentType: u2.contentType };
|
|
253705
253735
|
const fail16 = (code3, error, hint, extra = {}) => ({ ok: false, code: code3, error, sha256: u2.sha256, names: u2.names, ...extra, hint });
|
|
253736
|
+
const quotaExceeded = (status2, body) => fail16(
|
|
253737
|
+
"large_asset_quota_exceeded",
|
|
253738
|
+
`this ${body.scope === "account" ? "account" : "app"} has used its large asset upload budget for the last 24 hours`,
|
|
253739
|
+
"wait for the 24-hour window to pass, or upload fewer or smaller large assets; already-stored assets are not charged again",
|
|
253740
|
+
{ status: status2, body }
|
|
253741
|
+
);
|
|
253706
253742
|
const first = await client4.largeAssetTarget(declaration2);
|
|
253707
253743
|
const j2 = first.json;
|
|
253708
253744
|
if (!first.ok) {
|
|
253745
|
+
if (j2?.code === "large_assets_unavailable" && typeof j2.limit === "number") {
|
|
253746
|
+
const limit = j2.limit;
|
|
253747
|
+
return fail16(
|
|
253748
|
+
"large_assets_unavailable",
|
|
253749
|
+
`this serve plane keeps large assets in its own store, up to ${limit} bytes each, and this one is ${u2.bytes}`,
|
|
253750
|
+
`make the asset smaller than ${limit} bytes, or an operator must set LARGE_ASSET_S3 and its key pair on the plane`,
|
|
253751
|
+
{ status: first.status, body: j2 }
|
|
253752
|
+
);
|
|
253753
|
+
}
|
|
253709
253754
|
if (j2?.code === "large_assets_unavailable" || j2?.error === "large_assets_unavailable") {
|
|
253710
253755
|
return fail16(
|
|
253711
253756
|
"large_assets_unavailable",
|
|
@@ -253722,14 +253767,7 @@ async function uploadLargeAssets(client4, app2, uploads) {
|
|
|
253722
253767
|
{ status: first.status, body: j2 }
|
|
253723
253768
|
);
|
|
253724
253769
|
}
|
|
253725
|
-
if (j2?.code === "large_asset_quota_exceeded")
|
|
253726
|
-
return fail16(
|
|
253727
|
-
"large_asset_quota_exceeded",
|
|
253728
|
-
"this app has used its large asset upload budget for the last 24 hours",
|
|
253729
|
-
"wait for the 24-hour window to pass, or upload fewer or smaller large assets; already-stored assets are not charged again",
|
|
253730
|
-
{ status: first.status, body: j2 }
|
|
253731
|
-
);
|
|
253732
|
-
}
|
|
253770
|
+
if (j2?.code === "large_asset_quota_exceeded") return quotaExceeded(first.status, j2);
|
|
253733
253771
|
if (j2?.code === "large_asset_quota_contended") {
|
|
253734
253772
|
return fail16(
|
|
253735
253773
|
"large_asset_upload_failed",
|
|
@@ -253754,15 +253792,40 @@ async function uploadLargeAssets(client4, app2, uploads) {
|
|
|
253754
253792
|
}
|
|
253755
253793
|
let put;
|
|
253756
253794
|
try {
|
|
253757
|
-
|
|
253758
|
-
|
|
253759
|
-
|
|
253760
|
-
|
|
253761
|
-
|
|
253762
|
-
|
|
253795
|
+
const bytes2 = await u2.read();
|
|
253796
|
+
for (let waited = 0; ; ) {
|
|
253797
|
+
put = await client4.putLargeAsset({
|
|
253798
|
+
uploadUrl: j2.uploadUrl,
|
|
253799
|
+
method: typeof j2.method === "string" ? j2.method : "PUT",
|
|
253800
|
+
headers: j2.headers && typeof j2.headers === "object" ? j2.headers : {},
|
|
253801
|
+
...typeof j2.auth === "string" ? { auth: j2.auth } : {}
|
|
253802
|
+
}, bytes2);
|
|
253803
|
+
const wait = busyRetryAfterSec(put);
|
|
253804
|
+
if (wait === void 0 || waited + wait > LARGE_ASSET_BUSY_MAX_TOTAL_WAIT_SEC) break;
|
|
253805
|
+
await sleep4(wait * 1e3);
|
|
253806
|
+
waited += wait;
|
|
253807
|
+
}
|
|
253763
253808
|
} catch (e2) {
|
|
253764
253809
|
return fail16("large_asset_upload_failed", `upload failed: ${e2.message}`, "check the network and retry the push; already-stored assets are skipped");
|
|
253765
253810
|
}
|
|
253811
|
+
if (!put.ok && put.status === 429) {
|
|
253812
|
+
const refusal2 = (() => {
|
|
253813
|
+
try {
|
|
253814
|
+
return JSON.parse(put.text);
|
|
253815
|
+
} catch {
|
|
253816
|
+
return null;
|
|
253817
|
+
}
|
|
253818
|
+
})();
|
|
253819
|
+
if (refusal2?.code === "large_asset_quota_exceeded") return quotaExceeded(put.status, refusal2);
|
|
253820
|
+
if (refusal2?.code === "large_asset_upload_rate_limited") {
|
|
253821
|
+
return fail16(
|
|
253822
|
+
"large_asset_upload_failed",
|
|
253823
|
+
"this account has sent too many large asset uploads in the last 10 minutes",
|
|
253824
|
+
`wait ${typeof refusal2.retryAfterSec === "number" ? `${refusal2.retryAfterSec} s` : "a few minutes"} and push again; already-stored assets are skipped`,
|
|
253825
|
+
{ status: put.status, body: refusal2 }
|
|
253826
|
+
);
|
|
253827
|
+
}
|
|
253828
|
+
}
|
|
253766
253829
|
if (!put.ok && put.status !== 412) {
|
|
253767
253830
|
return fail16(
|
|
253768
253831
|
"large_asset_upload_failed",
|
|
@@ -253780,9 +253843,13 @@ async function uploadLargeAssets(client4, app2, uploads) {
|
|
|
253780
253843
|
}
|
|
253781
253844
|
return { ok: true, uploaded, alreadyStored, bytesUploaded };
|
|
253782
253845
|
}
|
|
253846
|
+
var LARGE_ASSET_BUSY_MAX_TOTAL_WAIT_SEC, LARGE_ASSET_BUSY_MAX_WAIT_SEC, sleep4;
|
|
253783
253847
|
var init_large_assets = __esm({
|
|
253784
253848
|
"../serve-cli/src/large-assets.ts"() {
|
|
253785
253849
|
init_define_HHP_CATALOG();
|
|
253850
|
+
LARGE_ASSET_BUSY_MAX_TOTAL_WAIT_SEC = 360;
|
|
253851
|
+
LARGE_ASSET_BUSY_MAX_WAIT_SEC = 15;
|
|
253852
|
+
sleep4 = (ms2) => new Promise((r3) => setTimeout(r3, ms2));
|
|
253786
253853
|
}
|
|
253787
253854
|
});
|
|
253788
253855
|
|
|
@@ -255116,7 +255183,7 @@ __export(login_refresh_exports, {
|
|
|
255116
255183
|
isStoredLogin: () => isStoredLogin,
|
|
255117
255184
|
refreshStoredLogin: () => refreshStoredLogin
|
|
255118
255185
|
});
|
|
255119
|
-
import { closeSync as closeSync13, openSync as openSync12, statSync as
|
|
255186
|
+
import { closeSync as closeSync13, openSync as openSync12, statSync as statSync46, unlinkSync as unlinkSync10 } from "node:fs";
|
|
255120
255187
|
function federatedTokenNeedsRefresh(token, nowSec) {
|
|
255121
255188
|
if (!token) return false;
|
|
255122
255189
|
const c2 = decodeControlTokenClaims(token);
|
|
@@ -255128,7 +255195,7 @@ function isStoredLogin(target, token, path2) {
|
|
|
255128
255195
|
}
|
|
255129
255196
|
async function withLock2(path2, deps, fn2, onTimeout) {
|
|
255130
255197
|
const lock = `${path2}.refresh.lock`;
|
|
255131
|
-
const
|
|
255198
|
+
const sleep5 = deps.sleep ?? ((ms2) => new Promise((r3) => setTimeout(r3, ms2)));
|
|
255132
255199
|
const started = Date.now();
|
|
255133
255200
|
let acquired = false;
|
|
255134
255201
|
for (; ; ) {
|
|
@@ -255138,7 +255205,7 @@ async function withLock2(path2, deps, fn2, onTimeout) {
|
|
|
255138
255205
|
break;
|
|
255139
255206
|
} catch {
|
|
255140
255207
|
try {
|
|
255141
|
-
if (Date.now() -
|
|
255208
|
+
if (Date.now() - statSync46(lock).mtimeMs > LOCK_STALE_MS) {
|
|
255142
255209
|
unlinkSync10(lock);
|
|
255143
255210
|
continue;
|
|
255144
255211
|
}
|
|
@@ -255146,7 +255213,7 @@ async function withLock2(path2, deps, fn2, onTimeout) {
|
|
|
255146
255213
|
continue;
|
|
255147
255214
|
}
|
|
255148
255215
|
if (Date.now() - started > (deps.lockWaitMs ?? LOCK_WAIT_MS)) return onTimeout();
|
|
255149
|
-
await
|
|
255216
|
+
await sleep5(100);
|
|
255150
255217
|
}
|
|
255151
255218
|
}
|
|
255152
255219
|
try {
|
|
@@ -255797,7 +255864,7 @@ var init_package_share = __esm({
|
|
|
255797
255864
|
});
|
|
255798
255865
|
|
|
255799
255866
|
// ../../core/serve-runtime/src/rate-limit.ts
|
|
255800
|
-
var FixedWindowRateLimiter;
|
|
255867
|
+
var FixedWindowRateLimiter, QueuedConcurrencyLimiter, KeyedQueuedConcurrencyLimiter;
|
|
255801
255868
|
var init_rate_limit = __esm({
|
|
255802
255869
|
"../../core/serve-runtime/src/rate-limit.ts"() {
|
|
255803
255870
|
init_define_HHP_CATALOG();
|
|
@@ -255845,6 +255912,129 @@ var init_rate_limit = __esm({
|
|
|
255845
255912
|
if (!first.done) this.hits.delete(first.value);
|
|
255846
255913
|
}
|
|
255847
255914
|
};
|
|
255915
|
+
QueuedConcurrencyLimiter = class {
|
|
255916
|
+
constructor(max, maxWaiting) {
|
|
255917
|
+
this.max = max;
|
|
255918
|
+
this.maxWaiting = maxWaiting;
|
|
255919
|
+
this.max = Math.max(1, max);
|
|
255920
|
+
}
|
|
255921
|
+
inUse = 0;
|
|
255922
|
+
waiting = [];
|
|
255923
|
+
/** A release fn once a slot is held, or null at once when the queue is full too. A waiter whose
|
|
255924
|
+
* `signal` aborts leaves the queue and gets null, so a client that went away holds no place. */
|
|
255925
|
+
async acquire(signal) {
|
|
255926
|
+
if (signal?.aborted) return null;
|
|
255927
|
+
if (this.inUse >= this.max) {
|
|
255928
|
+
if (this.waiting.length >= this.maxWaiting) return null;
|
|
255929
|
+
const got = await new Promise((resolve135) => {
|
|
255930
|
+
const turn = () => {
|
|
255931
|
+
signal?.removeEventListener("abort", leave);
|
|
255932
|
+
resolve135(true);
|
|
255933
|
+
};
|
|
255934
|
+
const leave = () => {
|
|
255935
|
+
const at2 = this.waiting.indexOf(turn);
|
|
255936
|
+
if (at2 >= 0) this.waiting.splice(at2, 1);
|
|
255937
|
+
resolve135(false);
|
|
255938
|
+
};
|
|
255939
|
+
this.waiting.push(turn);
|
|
255940
|
+
signal?.addEventListener("abort", leave, { once: true });
|
|
255941
|
+
});
|
|
255942
|
+
if (!got) return null;
|
|
255943
|
+
} else {
|
|
255944
|
+
this.inUse += 1;
|
|
255945
|
+
}
|
|
255946
|
+
let released = false;
|
|
255947
|
+
return () => {
|
|
255948
|
+
if (released) return;
|
|
255949
|
+
released = true;
|
|
255950
|
+
const next = this.waiting.shift();
|
|
255951
|
+
if (next) next();
|
|
255952
|
+
else if (this.inUse > 0) this.inUse -= 1;
|
|
255953
|
+
};
|
|
255954
|
+
}
|
|
255955
|
+
get active() {
|
|
255956
|
+
return this.inUse;
|
|
255957
|
+
}
|
|
255958
|
+
get queued() {
|
|
255959
|
+
return this.waiting.length;
|
|
255960
|
+
}
|
|
255961
|
+
};
|
|
255962
|
+
KeyedQueuedConcurrencyLimiter = class {
|
|
255963
|
+
constructor(max, maxWaiting) {
|
|
255964
|
+
this.max = max;
|
|
255965
|
+
this.maxWaiting = maxWaiting;
|
|
255966
|
+
}
|
|
255967
|
+
pools = /* @__PURE__ */ new Map();
|
|
255968
|
+
async acquire(key4, signal) {
|
|
255969
|
+
let pool2 = this.pools.get(key4);
|
|
255970
|
+
if (!pool2) this.pools.set(key4, pool2 = new QueuedConcurrencyLimiter(this.max, this.maxWaiting));
|
|
255971
|
+
const release4 = await pool2.acquire(signal);
|
|
255972
|
+
if (!release4) {
|
|
255973
|
+
this.forget(key4, pool2);
|
|
255974
|
+
return null;
|
|
255975
|
+
}
|
|
255976
|
+
let released = false;
|
|
255977
|
+
return () => {
|
|
255978
|
+
if (released) return;
|
|
255979
|
+
released = true;
|
|
255980
|
+
release4();
|
|
255981
|
+
this.forget(key4, pool2);
|
|
255982
|
+
};
|
|
255983
|
+
}
|
|
255984
|
+
forget(key4, pool2) {
|
|
255985
|
+
if (pool2.active === 0 && pool2.queued === 0 && this.pools.get(key4) === pool2) this.pools.delete(key4);
|
|
255986
|
+
}
|
|
255987
|
+
/** Keys with a slot held or a caller waiting. */
|
|
255988
|
+
get size() {
|
|
255989
|
+
return this.pools.size;
|
|
255990
|
+
}
|
|
255991
|
+
};
|
|
255992
|
+
}
|
|
255993
|
+
});
|
|
255994
|
+
|
|
255995
|
+
// ../../core/serve-runtime/src/releasing-body.ts
|
|
255996
|
+
function releasingBody(bytes2, release4, floorMs) {
|
|
255997
|
+
let buf = bytes2;
|
|
255998
|
+
let at2 = 0;
|
|
255999
|
+
let controller = null;
|
|
256000
|
+
const start2 = Date.now();
|
|
256001
|
+
const done = () => {
|
|
256002
|
+
clearInterval(check);
|
|
256003
|
+
buf = null;
|
|
256004
|
+
release4();
|
|
256005
|
+
};
|
|
256006
|
+
const check = setInterval(() => {
|
|
256007
|
+
const late = Date.now() - start2 - floorMs;
|
|
256008
|
+
if (late <= 0 || at2 >= late / 1e3 * RELEASING_BODY_MIN_BYTES_PER_SEC) return;
|
|
256009
|
+
try {
|
|
256010
|
+
controller?.error(new Error("body read too slowly"));
|
|
256011
|
+
} catch {
|
|
256012
|
+
}
|
|
256013
|
+
done();
|
|
256014
|
+
}, Math.min(1e3, floorMs));
|
|
256015
|
+
check.unref?.();
|
|
256016
|
+
return new ReadableStream({
|
|
256017
|
+
start(c2) {
|
|
256018
|
+
controller = c2;
|
|
256019
|
+
},
|
|
256020
|
+
pull(c2) {
|
|
256021
|
+
if (!buf) return;
|
|
256022
|
+
c2.enqueue(new Uint8Array(buf.subarray(at2, at2 + CHUNK)));
|
|
256023
|
+
at2 += CHUNK;
|
|
256024
|
+
if (at2 >= buf.byteLength) {
|
|
256025
|
+
c2.close();
|
|
256026
|
+
done();
|
|
256027
|
+
}
|
|
256028
|
+
},
|
|
256029
|
+
cancel: done
|
|
256030
|
+
}, { highWaterMark: 0 });
|
|
256031
|
+
}
|
|
256032
|
+
var RELEASING_BODY_MIN_BYTES_PER_SEC, CHUNK;
|
|
256033
|
+
var init_releasing_body = __esm({
|
|
256034
|
+
"../../core/serve-runtime/src/releasing-body.ts"() {
|
|
256035
|
+
init_define_HHP_CATALOG();
|
|
256036
|
+
RELEASING_BODY_MIN_BYTES_PER_SEC = 50 * 1024;
|
|
256037
|
+
CHUNK = 256 * 1024;
|
|
255848
256038
|
}
|
|
255849
256039
|
});
|
|
255850
256040
|
|
|
@@ -256220,6 +256410,8 @@ function makeServeHandler(opts) {
|
|
|
256220
256410
|
const webwixFetch = opts.webwixFetch ?? fetch;
|
|
256221
256411
|
const webwixOwnerInstances = new OwnerInstanceCache(webwixFetch);
|
|
256222
256412
|
const visitorMintLimiter = new FixedWindowRateLimiter({ max: opts.visitorMintRatePerMin ?? 30, windowMs: 6e4 });
|
|
256413
|
+
const largeAssetReads = new QueuedConcurrencyLimiter(LARGE_ASSET_STORE_READS_PER_POD, LARGE_ASSET_STORE_READS_QUEUED);
|
|
256414
|
+
const largeAssetCallerReads = new KeyedQueuedConcurrencyLimiter(LARGE_ASSET_STORE_READS_PER_CALLER, LARGE_ASSET_STORE_READS_QUEUED_PER_CALLER);
|
|
256223
256415
|
const forwardVisitors = /* @__PURE__ */ new Map();
|
|
256224
256416
|
const FORWARD_VISITOR_CAP = opts.forwardVisitorCap ?? 512;
|
|
256225
256417
|
const webwixOwnerSites = new OwnerSitesCache(webwixFetch);
|
|
@@ -256432,7 +256624,7 @@ ${releaseId}`;
|
|
|
256432
256624
|
const bare = new URL(request2.url);
|
|
256433
256625
|
bare.searchParams.delete("release");
|
|
256434
256626
|
bare.searchParams.delete("releaseSource");
|
|
256435
|
-
return { request: new Request(bare.toString(), { method: request2.method, headers: headers2 }), dropped: true };
|
|
256627
|
+
return { request: new Request(bare.toString(), { method: request2.method, headers: headers2, signal: original.signal }), dropped: true };
|
|
256436
256628
|
};
|
|
256437
256629
|
if (/^\/v1\/app-config\/[^/]+$/.test(url.pathname)) return drop2();
|
|
256438
256630
|
let servable;
|
|
@@ -256467,7 +256659,7 @@ ${releaseId}`;
|
|
|
256467
256659
|
const headers2 = new Headers(request2.headers);
|
|
256468
256660
|
headers2.set("x-himalaya-release", release4);
|
|
256469
256661
|
headers2.set(RELEASE_SOURCE_HEADER, "ring");
|
|
256470
|
-
return new Request(url.toString(), { method: request2.method, headers: headers2 });
|
|
256662
|
+
return new Request(url.toString(), { method: request2.method, headers: headers2, signal: request2.signal });
|
|
256471
256663
|
}
|
|
256472
256664
|
const corsHeaders = (request2) => {
|
|
256473
256665
|
const origin = request2.headers.get("origin");
|
|
@@ -257296,7 +257488,8 @@ ${releaseId}`;
|
|
|
257296
257488
|
const record5 = Object.values(m2?.assets ?? {}).find((a3) => a3.sha256 === sha5);
|
|
257297
257489
|
if (!record5) return json6(404, { error: "asset_not_found", app: app2 });
|
|
257298
257490
|
const etag = strongEtagForSha256(sha5);
|
|
257299
|
-
|
|
257491
|
+
let location = record5.storage === "large" ? opts.largeAssetUrl?.(sha5, { contentType: record5.contentType || "application/octet-stream" }) ?? void 0 : void 0;
|
|
257492
|
+
if (location && store.largeAssetUploadMaxBytes && store.hasAsset && await store.hasAsset(app2, sha5).catch(() => false)) location = void 0;
|
|
257300
257493
|
if (!location && request2.headers.get("if-none-match") === etag) {
|
|
257301
257494
|
return new Response(null, { status: 304, headers: { etag, "cache-control": BUNDLE_CACHE_CONTROL } });
|
|
257302
257495
|
}
|
|
@@ -257325,11 +257518,47 @@ ${releaseId}`;
|
|
|
257325
257518
|
}
|
|
257326
257519
|
});
|
|
257327
257520
|
}
|
|
257328
|
-
const
|
|
257329
|
-
|
|
257330
|
-
|
|
257521
|
+
const busy2 = () => new Response(JSON.stringify({ error: "large_asset_busy", code: "large_asset_busy", retryAfterSec: 2 }), {
|
|
257522
|
+
status: 503,
|
|
257523
|
+
headers: { "content-type": "application/json", "retry-after": "2", "cache-control": "no-store" }
|
|
257524
|
+
});
|
|
257525
|
+
let release4 = () => {
|
|
257526
|
+
};
|
|
257527
|
+
if (record5.storage === "large") {
|
|
257528
|
+
const caller = request2.headers.has("x-forwarded-for") ? visitorMintCaller(request2) : null;
|
|
257529
|
+
const callerSlot = caller ? await largeAssetCallerReads.acquire(caller, request2.signal) : () => {
|
|
257530
|
+
};
|
|
257531
|
+
if (!callerSlot) return request2.signal.aborted ? new Response(null, { status: 499 }) : busy2();
|
|
257532
|
+
const podSlot = await largeAssetReads.acquire(request2.signal);
|
|
257533
|
+
if (!podSlot) {
|
|
257534
|
+
callerSlot();
|
|
257535
|
+
return request2.signal.aborted ? new Response(null, { status: 499 }) : busy2();
|
|
257536
|
+
}
|
|
257537
|
+
release4 = () => {
|
|
257538
|
+
podSlot();
|
|
257539
|
+
callerSlot();
|
|
257540
|
+
};
|
|
257541
|
+
if (request2.signal.aborted) {
|
|
257542
|
+
release4();
|
|
257543
|
+
return new Response(null, { status: 499 });
|
|
257544
|
+
}
|
|
257545
|
+
}
|
|
257546
|
+
let bytes2;
|
|
257547
|
+
try {
|
|
257548
|
+
bytes2 = await store.getAsset(app2, sha5, record5.storage === "large" ? store.largeAssetUploadMaxBytes : INLINE_ASSET_MAX_BYTES);
|
|
257549
|
+
} catch (e2) {
|
|
257550
|
+
release4();
|
|
257551
|
+
throw e2;
|
|
257552
|
+
}
|
|
257553
|
+
if (!bytes2) {
|
|
257554
|
+
release4();
|
|
257555
|
+
return json6(404, { error: "asset_not_found", app: app2 });
|
|
257556
|
+
}
|
|
257557
|
+
const body = record5.storage === "large" ? releasingBody(bytes2, release4, opts.largeAssetBodyFloorMs ?? LARGE_ASSET_BODY_FLOOR_MS) : bytes2;
|
|
257558
|
+
return new Response(body, {
|
|
257331
257559
|
status: 200,
|
|
257332
257560
|
headers: {
|
|
257561
|
+
...record5.storage === "large" ? { "content-length": String(bytes2.byteLength) } : {},
|
|
257333
257562
|
"content-type": record5.contentType || "application/octet-stream",
|
|
257334
257563
|
etag,
|
|
257335
257564
|
"cache-control": BUNDLE_CACHE_CONTROL,
|
|
@@ -257460,7 +257689,7 @@ ${releaseId}`;
|
|
|
257460
257689
|
return withCors(request2, response);
|
|
257461
257690
|
};
|
|
257462
257691
|
}
|
|
257463
|
-
var JSON_CT3, VISITOR_INSTANCE_PATH;
|
|
257692
|
+
var LARGE_ASSET_STORE_READS_PER_POD, LARGE_ASSET_STORE_READS_QUEUED, LARGE_ASSET_STORE_READS_PER_CALLER, LARGE_ASSET_STORE_READS_QUEUED_PER_CALLER, LARGE_ASSET_BODY_FLOOR_MS, JSON_CT3, VISITOR_INSTANCE_PATH;
|
|
257464
257693
|
var init_server3 = __esm({
|
|
257465
257694
|
"../../core/serve/src/server.ts"() {
|
|
257466
257695
|
init_define_HHP_CATALOG();
|
|
@@ -257473,9 +257702,15 @@ var init_server3 = __esm({
|
|
|
257473
257702
|
init_member_forward();
|
|
257474
257703
|
init_package_share();
|
|
257475
257704
|
init_rate_limit();
|
|
257705
|
+
init_releasing_body();
|
|
257476
257706
|
init_wix_bridge();
|
|
257477
257707
|
init_account_rung();
|
|
257478
257708
|
init_wix_member_auth();
|
|
257709
|
+
LARGE_ASSET_STORE_READS_PER_POD = 4;
|
|
257710
|
+
LARGE_ASSET_STORE_READS_QUEUED = 256;
|
|
257711
|
+
LARGE_ASSET_STORE_READS_PER_CALLER = 2;
|
|
257712
|
+
LARGE_ASSET_STORE_READS_QUEUED_PER_CALLER = 16;
|
|
257713
|
+
LARGE_ASSET_BODY_FLOOR_MS = 1e4;
|
|
257479
257714
|
JSON_CT3 = "application/json; charset=utf-8";
|
|
257480
257715
|
VISITOR_INSTANCE_PATH = "/v1/visitor/instance";
|
|
257481
257716
|
}
|
|
@@ -257820,12 +258055,32 @@ async function toRequest(req, signal) {
|
|
|
257820
258055
|
}
|
|
257821
258056
|
return new Request(url, { method, headers: headers2, body, signal });
|
|
257822
258057
|
}
|
|
258058
|
+
function drained(res) {
|
|
258059
|
+
return new Promise((resolve135) => {
|
|
258060
|
+
const done = () => {
|
|
258061
|
+
res.off("drain", done);
|
|
258062
|
+
res.off("close", done);
|
|
258063
|
+
resolve135();
|
|
258064
|
+
};
|
|
258065
|
+
res.on("drain", done);
|
|
258066
|
+
res.on("close", done);
|
|
258067
|
+
});
|
|
258068
|
+
}
|
|
257823
258069
|
async function writeResponse(res, response) {
|
|
257824
258070
|
res.statusCode = response.status;
|
|
257825
258071
|
response.headers.forEach((value2, key4) => res.setHeader(key4, value2));
|
|
257826
|
-
|
|
258072
|
+
const streamed = !!response.body && (/^text\/event-stream\b/i.test(response.headers.get("content-type") ?? "") || Number(response.headers.get("content-length") ?? 0) > STREAM_OVER_BYTES);
|
|
258073
|
+
if (response.body && streamed) {
|
|
257827
258074
|
res.flushHeaders();
|
|
257828
258075
|
const reader = response.body.getReader();
|
|
258076
|
+
let bodyFailed = false;
|
|
258077
|
+
let wake = null;
|
|
258078
|
+
void reader.closed.then(() => {
|
|
258079
|
+
}, () => {
|
|
258080
|
+
bodyFailed = true;
|
|
258081
|
+
}).then(() => {
|
|
258082
|
+
wake?.();
|
|
258083
|
+
});
|
|
257829
258084
|
let clientDisconnected = false;
|
|
257830
258085
|
const onClose = () => {
|
|
257831
258086
|
if (!res.writableEnded) {
|
|
@@ -257839,7 +258094,14 @@ async function writeResponse(res, response) {
|
|
|
257839
258094
|
for (; ; ) {
|
|
257840
258095
|
const { done, value: value2 } = await reader.read();
|
|
257841
258096
|
if (done) break;
|
|
257842
|
-
res.write(value2)
|
|
258097
|
+
if (!res.write(value2) && !res.destroyed) {
|
|
258098
|
+
if (!bodyFailed) await new Promise((resolve135) => {
|
|
258099
|
+
wake = resolve135;
|
|
258100
|
+
void drained(res).then(resolve135);
|
|
258101
|
+
});
|
|
258102
|
+
wake = null;
|
|
258103
|
+
if (bodyFailed) throw new Error("body ended while the client was not reading");
|
|
258104
|
+
}
|
|
257843
258105
|
}
|
|
257844
258106
|
} catch {
|
|
257845
258107
|
if (!clientDisconnected && !res.destroyed) res.destroy();
|
|
@@ -257876,11 +258138,12 @@ function nodeAdapter(handler) {
|
|
|
257876
258138
|
}
|
|
257877
258139
|
});
|
|
257878
258140
|
}
|
|
257879
|
-
var BODYLESS;
|
|
258141
|
+
var BODYLESS, STREAM_OVER_BYTES;
|
|
257880
258142
|
var init_node_adapter = __esm({
|
|
257881
258143
|
"../../core/serve-runtime/src/node-adapter.ts"() {
|
|
257882
258144
|
init_define_HHP_CATALOG();
|
|
257883
258145
|
BODYLESS = /* @__PURE__ */ new Set(["GET", "HEAD", "DELETE", "OPTIONS"]);
|
|
258146
|
+
STREAM_OVER_BYTES = 1024 * 1024;
|
|
257884
258147
|
}
|
|
257885
258148
|
});
|
|
257886
258149
|
|
|
@@ -257917,7 +258180,7 @@ var init_wix_client_id = __esm({
|
|
|
257917
258180
|
});
|
|
257918
258181
|
|
|
257919
258182
|
// src/run-godot-web.ts
|
|
257920
|
-
import { existsSync as existsSync129, readFileSync as readFileSync151, statSync as
|
|
258183
|
+
import { existsSync as existsSync129, readFileSync as readFileSync151, statSync as statSync48 } from "node:fs";
|
|
257921
258184
|
import { dirname as dirname73, join as join164, resolve as resolve106 } from "node:path";
|
|
257922
258185
|
import { fileURLToPath as fileURLToPath38 } from "node:url";
|
|
257923
258186
|
function localGodotWebDir(env = process.env) {
|
|
@@ -257955,7 +258218,7 @@ function makeGodotWebRoute(opts = {}) {
|
|
|
257955
258218
|
const name = url.pathname.slice(LOCAL2.length);
|
|
257956
258219
|
if (!/^[A-Za-z0-9._-]+$/.test(name) || name.startsWith(".")) return new Response("bad name", { status: 400 });
|
|
257957
258220
|
const file2 = join164(localDir, name);
|
|
257958
|
-
if (!existsSync129(file2) || !
|
|
258221
|
+
if (!existsSync129(file2) || !statSync48(file2).isFile()) return new Response("not found", { status: 404 });
|
|
257959
258222
|
const ext = name.slice(name.lastIndexOf(".") + 1);
|
|
257960
258223
|
const body = request2.method === "HEAD" ? null : readFileSync151(file2);
|
|
257961
258224
|
return new Response(body, {
|
|
@@ -257996,53 +258259,53 @@ var init_preview_assets_generated = __esm({
|
|
|
257996
258259
|
init_define_HHP_CATALOG();
|
|
257997
258260
|
init_preview_assets_format();
|
|
257998
258261
|
PREVIEW_ASSET_MANIFEST = [
|
|
257999
|
-
{ key: "assets/DashboardHost-
|
|
258000
|
-
{ key: "assets/DevDrawer-
|
|
258001
|
-
{ key: "assets/IdiomCompare-
|
|
258002
|
-
{ key: "assets/LightboxViewer-
|
|
258003
|
-
{ key: "assets/OfflineReadingBar-
|
|
258004
|
-
{ key: "assets/PhonePreviewControl-
|
|
258005
|
-
{ key: "assets/SchemeCompare-
|
|
258006
|
-
{ key: "assets/TopBarSearchStates-
|
|
258007
|
-
{ key: "assets/WixFrogTelemetrySink-
|
|
258262
|
+
{ key: "assets/DashboardHost-Cnvx56Ob.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 2985, sha256: "563e40974d690491860a85d088f2e8e324a64484838de0d8060e7c882d02e13b" },
|
|
258263
|
+
{ key: "assets/DevDrawer-BPubZQvE.js", contentType: "application/javascript; charset=utf-8", offset: 2993, length: 16783, sha256: "e66ad823b9343f2c30d2eea6ccd6256b25dda239de2be8b3502f5b73a49a3798" },
|
|
258264
|
+
{ key: "assets/IdiomCompare-C0mset0g.js", contentType: "application/javascript; charset=utf-8", offset: 19776, length: 1926, sha256: "725c64e538ac5996c849231e6d5bd99e8f397ed88d4346b439b8a77660eee6b9" },
|
|
258265
|
+
{ key: "assets/LightboxViewer-rbfhptpA.js", contentType: "application/javascript; charset=utf-8", offset: 21702, length: 15836, sha256: "6154a530b75f8f8a013d6096a3534ae47e3273813b1e7c5ebd6a7941e38e2013" },
|
|
258266
|
+
{ key: "assets/OfflineReadingBar-By8jHXuu.js", contentType: "application/javascript; charset=utf-8", offset: 37538, length: 1695, sha256: "186a22abc375d2865c522e016bf5b64cbf94aeda8be04145d2e6140e802c5530" },
|
|
258267
|
+
{ key: "assets/PhonePreviewControl-BDLASTBR.js", contentType: "application/javascript; charset=utf-8", offset: 39233, length: 37851, sha256: "94c950be384153dc7862adf52490a563cf31f31b9a2ed6143d153e6064248d99" },
|
|
258268
|
+
{ key: "assets/SchemeCompare-CwgNCeEK.js", contentType: "application/javascript; charset=utf-8", offset: 77084, length: 1858, sha256: "8c2f4892179e94088513a7e43b97cd107ddec684f6443745f68d454bdfd4f475" },
|
|
258269
|
+
{ key: "assets/TopBarSearchStates-56aokOJi.js", contentType: "application/javascript; charset=utf-8", offset: 78942, length: 4068, sha256: "912b77d9f8c930d3b749628119d663c37c5f0d28e9dcedf62d7f64a8995edbbf" },
|
|
258270
|
+
{ key: "assets/WixFrogTelemetrySink-DgPMgFzz.js", contentType: "application/javascript; charset=utf-8", offset: 83010, length: 3515, sha256: "99dd0cadecc7a269fdaf8adf53432a606d775a35a6648bd0a658331fe77fa406" },
|
|
258008
258271
|
{ key: "assets/calendar-ics-BvfIYWjG.js", contentType: "application/javascript; charset=utf-8", offset: 86525, length: 2192, sha256: "1636167041e9829ceccd3544297b86b8475c38bd2f759c4dbc17c813dc6e9254" },
|
|
258009
258272
|
{ key: "assets/catalog-B4UJpy5D.js", contentType: "application/javascript; charset=utf-8", offset: 88717, length: 35626, sha256: "90111ffcf2d13eff399836acafd1f2b387859440a29dcd4a0afd8370915992cb" },
|
|
258010
|
-
{ key: "assets/catalogFontFaces-
|
|
258273
|
+
{ key: "assets/catalogFontFaces-c_Aan0WX.js", contentType: "application/javascript; charset=utf-8", offset: 124343, length: 1111, sha256: "3052881c68bd649598be743c9f9dca79991aaeffec117e88b4626c1b0e4f9b2a" },
|
|
258011
258274
|
{ key: "assets/contacts-vcard-BcohPQ0m.js", contentType: "application/javascript; charset=utf-8", offset: 125454, length: 2567, sha256: "c4ff75e96cd909bbb9182c5dc78794fcebc65139fbddef2537711d774fb33ad0" },
|
|
258012
|
-
{ key: "assets/files-transfer-
|
|
258275
|
+
{ key: "assets/files-transfer-DH_Te1lQ.js", contentType: "application/javascript; charset=utf-8", offset: 128021, length: 6446, sha256: "3ce0a2eacefe78a1858f079cb1676c2f8292b4b30a277c7e78909bc133dc8d7e" },
|
|
258013
258276
|
{ key: "assets/frogActionMap-CTMe3Bz1.js", contentType: "application/javascript; charset=utf-8", offset: 134467, length: 1172, sha256: "9f1ce4c70a680dfb902949e1f482c7e47500b69c3350cd091b1b51d674032d53" },
|
|
258014
|
-
{ key: "assets/frogApiRules-
|
|
258277
|
+
{ key: "assets/frogApiRules-CuJA3rYb.js", contentType: "application/javascript; charset=utf-8", offset: 135639, length: 2207, sha256: "6903064af704ec5bec38415af85ac73f7a3d590c89588e319ad34667e13836ec" },
|
|
258015
258278
|
{ key: "assets/frogScreenMap-S_IRnz20.js", contentType: "application/javascript; charset=utf-8", offset: 137846, length: 1067, sha256: "22b2f71e1b06df8f1e79b890d47fe42e983d37865c2cc9be753e4121764c91e1" },
|
|
258016
258279
|
{ key: "assets/glassPreviewBrowser-DONaOehd.js", contentType: "application/javascript; charset=utf-8", offset: 138913, length: 6578, sha256: "4402c4cddd2a564e7466cdf1e12a0e0277c0400b288e1e5eda1d23e797599d31" },
|
|
258017
258280
|
{ key: "assets/image-preparation-Cj4gldm6.js", contentType: "application/javascript; charset=utf-8", offset: 145491, length: 2704, sha256: "32944ea587c2f3b84389b66b50a850437560238f1c8d33b6275973ee04eee865" },
|
|
258018
|
-
{ key: "assets/index-
|
|
258019
|
-
{ key: "assets/jsx-runtime-CdvZGgm7.js", contentType: "application/javascript; charset=utf-8", offset:
|
|
258020
|
-
{ key: "assets/on-device-ml-D5QGvW8P.js", contentType: "application/javascript; charset=utf-8", offset:
|
|
258021
|
-
{ key: "assets/pdf-
|
|
258022
|
-
{ key: "assets/pdf.worker.min-BGnVRhRG.js", contentType: "application/javascript; charset=utf-8", offset:
|
|
258023
|
-
{ key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset:
|
|
258024
|
-
{ key: "assets/pdfDocument-
|
|
258025
|
-
{ key: "assets/pdfFetch-Cc8i1I1h.js", contentType: "application/javascript; charset=utf-8", offset:
|
|
258026
|
-
{ key: "assets/scrollLinkedRuntime-
|
|
258027
|
-
{ key: "assets/webviewBridgeHost-
|
|
258028
|
-
{ key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset:
|
|
258029
|
-
{ key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset:
|
|
258030
|
-
{ key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset:
|
|
258031
|
-
{ key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset:
|
|
258032
|
-
{ key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset:
|
|
258033
|
-
{ key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset:
|
|
258034
|
-
{ key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset:
|
|
258035
|
-
{ key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset:
|
|
258036
|
-
{ key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset:
|
|
258037
|
-
{ key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset:
|
|
258038
|
-
{ key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset:
|
|
258039
|
-
{ key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset:
|
|
258040
|
-
{ key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset:
|
|
258041
|
-
{ key: "index.html", contentType: "text/html; charset=utf-8", offset:
|
|
258042
|
-
{ key: "ios-glass-preview.css", contentType: "text/css; charset=utf-8", offset:
|
|
258043
|
-
{ key: "kit-tab-bar.css", contentType: "text/css; charset=utf-8", offset:
|
|
258044
|
-
{ key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset:
|
|
258045
|
-
{ key: "t5-worker-frame.html", contentType: "text/html; charset=utf-8", offset:
|
|
258281
|
+
{ key: "assets/index-Bg3smJjV.js", contentType: "application/javascript; charset=utf-8", offset: 148195, length: 1674985, sha256: "b20fbf356ac3ed10c231df5ea69dd2f159b3b435888f00ca33c8a9535b5775a5" },
|
|
258282
|
+
{ key: "assets/jsx-runtime-CdvZGgm7.js", contentType: "application/javascript; charset=utf-8", offset: 1823180, length: 7751, sha256: "42a78b508d0f309f6a4a6efbb8669015211b3c26574c5b0929884c4d9d20b806" },
|
|
258283
|
+
{ key: "assets/on-device-ml-D5QGvW8P.js", contentType: "application/javascript; charset=utf-8", offset: 1830931, length: 10531, sha256: "914ea54d973624e7bc82d1847444f26084ac16d69be3051b4b5938b1e35beced" },
|
|
258284
|
+
{ key: "assets/pdf-Dxze8Wox.js", contentType: "application/javascript; charset=utf-8", offset: 1841462, length: 488215, sha256: "c1f008be31a41521c6de7c1afad419a1f4dad53cbc2701a14738d5b22f291463" },
|
|
258285
|
+
{ key: "assets/pdf.worker.min-BGnVRhRG.js", contentType: "application/javascript; charset=utf-8", offset: 2329677, length: 90, sha256: "521a0e528916d678d7588b2cddf3dadd3bb959a6d62426382f61c77a82017e35" },
|
|
258286
|
+
{ key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset: 2329767, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
|
|
258287
|
+
{ key: "assets/pdfDocument-CwxGRkvL.js", contentType: "application/javascript; charset=utf-8", offset: 3646801, length: 3471, sha256: "7d56a9b20aa1a5bef30dfc900b50914e52bfcece73600b11dc73e479ed368c35" },
|
|
258288
|
+
{ key: "assets/pdfFetch-Cc8i1I1h.js", contentType: "application/javascript; charset=utf-8", offset: 3650272, length: 2266, sha256: "1d21ad008921942217c9eac0c35b1713773b9d89c71e3ab4412781f7bb88f463" },
|
|
258289
|
+
{ key: "assets/scrollLinkedRuntime-CcQ2n_a7.js", contentType: "application/javascript; charset=utf-8", offset: 3652538, length: 2278, sha256: "781ae1aafe443a355bfee10801a06a01495b8877b371bf689065e3610a36712e" },
|
|
258290
|
+
{ key: "assets/webviewBridgeHost-BMLK1fpb.js", contentType: "application/javascript; charset=utf-8", offset: 3654816, length: 9889, sha256: "920f9bcf734ec2d42de4f7538f641b67b41f6f401e5ef6f5c2c6bbe9648a81aa" },
|
|
258291
|
+
{ key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3664705, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
|
|
258292
|
+
{ key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3669315, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
|
|
258293
|
+
{ key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 4157899, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
|
|
258294
|
+
{ key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 4248823, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
|
|
258295
|
+
{ key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 4339807, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
|
|
258296
|
+
{ key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 4430787, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
|
|
258297
|
+
{ key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 4521659, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
|
|
258298
|
+
{ key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 4612639, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
|
|
258299
|
+
{ key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4721275, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
|
|
258300
|
+
{ key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4830359, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
|
|
258301
|
+
{ key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4939407, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
|
|
258302
|
+
{ key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 5047107, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
|
|
258303
|
+
{ key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset: 5135215, length: 6818, sha256: "835250c3d8004f27c2b67f9b471984351ba6df07b916d97e33b43c691200a18c" },
|
|
258304
|
+
{ key: "index.html", contentType: "text/html; charset=utf-8", offset: 5142033, length: 4924, sha256: "2ae7f884184c2dfc029f61ac217a82113bf46780cf2d6987198af04114cdcd9a" },
|
|
258305
|
+
{ key: "ios-glass-preview.css", contentType: "text/css; charset=utf-8", offset: 5146957, length: 11457, sha256: "6cb2b75264fa5fa2b4d28851878a5eab0712900e8b3a6c2370cc661d6d820805" },
|
|
258306
|
+
{ key: "kit-tab-bar.css", contentType: "text/css; charset=utf-8", offset: 5158414, length: 1171, sha256: "9e2c3a0faaf05d5471badf167a4d3bdf1c4e6dd65c432eea6d254158bfd99585" },
|
|
258307
|
+
{ key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 5159585, length: 24303, sha256: "7ee3dbacf4e6da69c1c7085a2423e33e2adaec933cd897fb2ee2391e3277c3ae" },
|
|
258308
|
+
{ key: "t5-worker-frame.html", contentType: "text/html; charset=utf-8", offset: 5183888, length: 24320, sha256: "d24f399a1fcfa7f696a0d96aadbc983d2624b45712dae9a15545f6914dbb9506" }
|
|
258046
258309
|
];
|
|
258047
258310
|
}
|
|
258048
258311
|
});
|
|
@@ -258062,7 +258325,7 @@ __export(run_exports, {
|
|
|
258062
258325
|
runPackage: () => runPackage,
|
|
258063
258326
|
withoutProdServe: () => withoutProdServe
|
|
258064
258327
|
});
|
|
258065
|
-
import { cpSync as cpSync2, existsSync as existsSync130, lstatSync as lstatSync38, mkdirSync as mkdirSync59, mkdtempSync as mkdtempSync11, readdirSync as readdirSync60, readFileSync as readFileSync152, rmSync as rmSync38, statSync as
|
|
258328
|
+
import { cpSync as cpSync2, existsSync as existsSync130, lstatSync as lstatSync38, mkdirSync as mkdirSync59, mkdtempSync as mkdtempSync11, readdirSync as readdirSync60, readFileSync as readFileSync152, rmSync as rmSync38, statSync as statSync49 } from "node:fs";
|
|
258066
258329
|
import { networkInterfaces as osNetworkInterfaces, tmpdir as tmpdir12 } from "node:os";
|
|
258067
258330
|
import { dirname as dirname74, join as join165 } from "node:path";
|
|
258068
258331
|
import { fileURLToPath as fileURLToPath39 } from "node:url";
|
|
@@ -258108,7 +258371,7 @@ async function fetchBytes(url) {
|
|
|
258108
258371
|
}
|
|
258109
258372
|
async function resolvePackage(source2, workDir) {
|
|
258110
258373
|
const isUrl2 = /^https?:\/\//i.test(source2);
|
|
258111
|
-
if (!isUrl2 && existsSync130(source2) &&
|
|
258374
|
+
if (!isUrl2 && existsSync130(source2) && statSync49(source2).isDirectory()) {
|
|
258112
258375
|
const appDirManifest = join165(source2, "release-manifest.json");
|
|
258113
258376
|
if (existsSync130(appDirManifest)) {
|
|
258114
258377
|
const link4 = firstSymlink(source2);
|
|
@@ -263306,21 +263569,21 @@ async function attemptWrite(write3) {
|
|
|
263306
263569
|
throw e2;
|
|
263307
263570
|
}
|
|
263308
263571
|
}
|
|
263309
|
-
async function pollFor(find2,
|
|
263572
|
+
async function pollFor(find2, sleep5) {
|
|
263310
263573
|
for (let read2 = 0; read2 < RECONCILE_READS; read2++) {
|
|
263311
|
-
if (read2 > 0) await
|
|
263574
|
+
if (read2 > 0) await sleep5(RECONCILE_BASE_WAIT_MS * 2 ** (read2 - 1));
|
|
263312
263575
|
const found = await find2();
|
|
263313
263576
|
if (found !== void 0) return found;
|
|
263314
263577
|
}
|
|
263315
263578
|
return void 0;
|
|
263316
263579
|
}
|
|
263317
|
-
async function ensure(spec,
|
|
263580
|
+
async function ensure(spec, sleep5) {
|
|
263318
263581
|
let outcome = await attemptWrite(spec.write);
|
|
263319
263582
|
for (let retry = 0; ; retry++) {
|
|
263320
263583
|
if ("value" in outcome) return { value: outcome.value, state: "done" };
|
|
263321
263584
|
let found;
|
|
263322
263585
|
try {
|
|
263323
|
-
found = await pollFor(spec.find,
|
|
263586
|
+
found = await pollFor(spec.find, sleep5);
|
|
263324
263587
|
} catch (error) {
|
|
263325
263588
|
throw outcome.error instanceof IapCatalogWriteOutcomeUnknown ? outcome.error : error;
|
|
263326
263589
|
}
|
|
@@ -263329,7 +263592,7 @@ async function ensure(spec, sleep4) {
|
|
|
263329
263592
|
if (retry === 1 || outcome.error.kind === "conflict") {
|
|
263330
263593
|
throw new UnresolvedWriteError(`could not confirm the outcome of the write (${outcome.error.message}); Apple was re-read and it is not there. Rerun apply later \u2014 it re-reads before writing, so nothing will be duplicated.`);
|
|
263331
263594
|
}
|
|
263332
|
-
if (outcome.error.retryAfterMs) await
|
|
263595
|
+
if (outcome.error.retryAfterMs) await sleep5(outcome.error.retryAfterMs);
|
|
263333
263596
|
outcome = await attemptWrite(spec.write);
|
|
263334
263597
|
}
|
|
263335
263598
|
}
|
|
@@ -263363,16 +263626,16 @@ async function reserveScreenshot(api4, resourceId, file2, overValid) {
|
|
|
263363
263626
|
throw new UnresolvedWriteError(`could not confirm the review screenshot reservation (${e2.message}). Make a new plan \u2014 it replaces an unfinished reservation.`);
|
|
263364
263627
|
}
|
|
263365
263628
|
}
|
|
263366
|
-
async function settledScreenshot(api4, resourceId, committed,
|
|
263629
|
+
async function settledScreenshot(api4, resourceId, committed, sleep5) {
|
|
263367
263630
|
if (SETTLED_SCREENSHOT_STATES.has(committed.state)) return committed;
|
|
263368
263631
|
const read2 = async () => {
|
|
263369
263632
|
const current = await api4.readReviewScreenshot(resourceId);
|
|
263370
263633
|
return current && SETTLED_SCREENSHOT_STATES.has(current.state) ? current : void 0;
|
|
263371
263634
|
};
|
|
263372
|
-
return await pollFor(read2,
|
|
263635
|
+
return await pollFor(read2, sleep5) ?? committed;
|
|
263373
263636
|
}
|
|
263374
263637
|
async function uploadScreenshot(context, resourceId, file2) {
|
|
263375
|
-
const { api: api4, sleep:
|
|
263638
|
+
const { api: api4, sleep: sleep5 } = context;
|
|
263376
263639
|
const current = await api4.readReviewScreenshot(resourceId);
|
|
263377
263640
|
if (current && screenshotMatches(current, file2.checksum)) return { state: "reconciled", resourceId: current.id };
|
|
263378
263641
|
const reservation = await reserveScreenshot(api4, resourceId, file2, current !== void 0 && !isScreenshotLeftover(current));
|
|
@@ -263381,45 +263644,45 @@ async function uploadScreenshot(context, resourceId, file2) {
|
|
|
263381
263644
|
const screenshot = await api4.readReviewScreenshot(resourceId);
|
|
263382
263645
|
return screenshot?.id === reservation.id && screenshot.checksum === file2.checksum ? screenshot : void 0;
|
|
263383
263646
|
};
|
|
263384
|
-
const { value: value2, state } = await ensure({ write: () => api4.commitReviewScreenshot(reservation.id, file2.checksum), find: committed },
|
|
263385
|
-
const settled = await settledScreenshot(api4, resourceId, value2,
|
|
263647
|
+
const { value: value2, state } = await ensure({ write: () => api4.commitReviewScreenshot(reservation.id, file2.checksum), find: committed }, sleep5);
|
|
263648
|
+
const settled = await settledScreenshot(api4, resourceId, value2, sleep5);
|
|
263386
263649
|
if (settled.state === "FAILED") throw new UnresolvedWriteError(`Apple could not process the review screenshot: ${settled.errors.join("; ") || "no reason given"}`);
|
|
263387
263650
|
return { state, resourceId: reservation.id };
|
|
263388
263651
|
}
|
|
263389
263652
|
async function deleteLeftoverScreenshot(context, resourceId) {
|
|
263390
|
-
const { api: api4, sleep:
|
|
263653
|
+
const { api: api4, sleep: sleep5 } = context;
|
|
263391
263654
|
const stale = await api4.readReviewScreenshot(resourceId);
|
|
263392
263655
|
if (!stale || !isScreenshotLeftover(stale)) return;
|
|
263393
263656
|
const gone = async () => (await api4.readReviewScreenshot(resourceId))?.id !== stale.id ? true : void 0;
|
|
263394
|
-
await ensure({ write: async () => (await api4.deleteReviewScreenshot(stale.id), true), find: gone },
|
|
263657
|
+
await ensure({ write: async () => (await api4.deleteReviewScreenshot(stale.id), true), find: gone }, sleep5);
|
|
263395
263658
|
}
|
|
263396
263659
|
async function upsertManagedLocalization(run4, locale, context) {
|
|
263397
263660
|
const resourceId = required(run4.resourceId, "the product id");
|
|
263398
263661
|
const text32 = textFor(run4.item, locale);
|
|
263399
|
-
const { api: api4, sleep:
|
|
263662
|
+
const { api: api4, sleep: sleep5 } = context;
|
|
263400
263663
|
const find2 = async () => {
|
|
263401
263664
|
const version5 = await findDraft(api4, resourceId);
|
|
263402
263665
|
const localization2 = version5 && await findLocalization(api4, version5.id, locale, text32);
|
|
263403
263666
|
return version5 && localization2 ? { version: version5, localization: localization2, outcome: "ALREADY_APPLIED" } : void 0;
|
|
263404
263667
|
};
|
|
263405
|
-
const { value: value2, state } = await ensure({ write: () => api4.managed.upsertLocalization(resourceId, text32), find: find2 },
|
|
263668
|
+
const { value: value2, state } = await ensure({ write: () => api4.managed.upsertLocalization(resourceId, text32), find: find2 }, sleep5);
|
|
263406
263669
|
run4.versionId = value2.version.id;
|
|
263407
263670
|
return { state: value2.outcome === "ALREADY_APPLIED" ? "reconciled" : state, resourceId: value2.localization.id };
|
|
263408
263671
|
}
|
|
263409
263672
|
function operationRunners(context, manifest2) {
|
|
263410
|
-
const { api: api4, sleep:
|
|
263673
|
+
const { api: api4, sleep: sleep5, pricing } = context;
|
|
263411
263674
|
const appId3 = manifest2.target.appleAppId;
|
|
263412
263675
|
return {
|
|
263413
263676
|
createProduct: async (run4) => {
|
|
263414
263677
|
const { item: item2 } = run4;
|
|
263415
263678
|
const newProduct = { productId: item2.productId, referenceName: item2.referenceName, type: item2.type, ...item2.reviewNote ? { reviewNote: item2.reviewNote } : {} };
|
|
263416
|
-
const { value: value2, state } = await ensure({ write: () => api4.createProduct(appId3, newProduct), find: () => findProduct(api4, appId3, item2.productId) },
|
|
263679
|
+
const { value: value2, state } = await ensure({ write: () => api4.createProduct(appId3, newProduct), find: () => findProduct(api4, appId3, item2.productId) }, sleep5);
|
|
263417
263680
|
run4.resourceId = value2.id;
|
|
263418
263681
|
return { state, resourceId: value2.id };
|
|
263419
263682
|
},
|
|
263420
263683
|
createVersion: async (run4) => {
|
|
263421
263684
|
const resourceId = required(run4.resourceId, "the product id");
|
|
263422
|
-
const { value: value2, state } = await ensure({ write: () => api4.createVersion(resourceId), find: () => findDraft(api4, resourceId) },
|
|
263685
|
+
const { value: value2, state } = await ensure({ write: () => api4.createVersion(resourceId), find: () => findDraft(api4, resourceId) }, sleep5);
|
|
263423
263686
|
run4.versionId = value2.id;
|
|
263424
263687
|
run4.localizations = [];
|
|
263425
263688
|
return { state, resourceId: value2.id };
|
|
@@ -263428,7 +263691,7 @@ function operationRunners(context, manifest2) {
|
|
|
263428
263691
|
if (api4.managed) return upsertManagedLocalization(run4, op.locale, context);
|
|
263429
263692
|
const versionId = required(run4.versionId, "the draft version");
|
|
263430
263693
|
const text32 = textFor(run4.item, op.locale);
|
|
263431
|
-
const { value: value2, state } = await ensure({ write: () => api4.createLocalization(versionId, text32), find: () => findLocalization(api4, versionId, text32.locale) },
|
|
263694
|
+
const { value: value2, state } = await ensure({ write: () => api4.createLocalization(versionId, text32), find: () => findLocalization(api4, versionId, text32.locale) }, sleep5);
|
|
263432
263695
|
return { state, resourceId: value2.id };
|
|
263433
263696
|
},
|
|
263434
263697
|
updateLocalization: async (run4, op) => {
|
|
@@ -263436,7 +263699,7 @@ function operationRunners(context, manifest2) {
|
|
|
263436
263699
|
const versionId = required(run4.versionId, "the draft version");
|
|
263437
263700
|
const text32 = textFor(run4.item, op.locale);
|
|
263438
263701
|
const localizationId = required(run4.localizations.find((l3) => l3.locale === text32.locale)?.id, `the ${text32.locale} localization`);
|
|
263439
|
-
const { value: value2, state } = await ensure({ write: () => api4.updateLocalization(localizationId, text32), find: () => findLocalization(api4, versionId, text32.locale, text32) },
|
|
263702
|
+
const { value: value2, state } = await ensure({ write: () => api4.updateLocalization(localizationId, text32), find: () => findLocalization(api4, versionId, text32.locale, text32) }, sleep5);
|
|
263440
263703
|
return { state, resourceId: value2.id };
|
|
263441
263704
|
},
|
|
263442
263705
|
setPrice: async (run4) => {
|
|
@@ -263445,7 +263708,7 @@ function operationRunners(context, manifest2) {
|
|
|
263445
263708
|
const { point, failure: failure4 } = await pricing.resolve(resourceId, price);
|
|
263446
263709
|
if (!point) throw new UnresolvedWriteError(failure4 ?? "no Apple price point");
|
|
263447
263710
|
const matches2 = async () => priceMatches(await readObservedPrice(api4, resourceId), price, point.customerPrice) ? true : void 0;
|
|
263448
|
-
const { state } = await ensure({ write: async () => (await (api4.managed ? api4.managed.applyPriceSchedule(resourceId, price) : api4.createPriceSchedule(resourceId, price.baseTerritory, point.id)), true), find: matches2 },
|
|
263711
|
+
const { state } = await ensure({ write: async () => (await (api4.managed ? api4.managed.applyPriceSchedule(resourceId, price) : api4.createPriceSchedule(resourceId, price.baseTerritory, point.id)), true), find: matches2 }, sleep5);
|
|
263449
263712
|
return { state };
|
|
263450
263713
|
},
|
|
263451
263714
|
changePrice: async (run4, op) => {
|
|
@@ -263464,14 +263727,14 @@ function operationRunners(context, manifest2) {
|
|
|
263464
263727
|
return void 0;
|
|
263465
263728
|
};
|
|
263466
263729
|
if (await matches2()) return { state: "reconciled" };
|
|
263467
|
-
const { state } = await ensure({ write: async () => (await (api4.managed ? api4.managed.applyPriceSchedule(resourceId, price) : api4.createPriceSchedule(resourceId, price.baseTerritory, point.id)), true), find: matches2 },
|
|
263730
|
+
const { state } = await ensure({ write: async () => (await (api4.managed ? api4.managed.applyPriceSchedule(resourceId, price) : api4.createPriceSchedule(resourceId, price.baseTerritory, point.id)), true), find: matches2 }, sleep5);
|
|
263468
263731
|
return { state };
|
|
263469
263732
|
},
|
|
263470
263733
|
setAvailability: async (run4) => {
|
|
263471
263734
|
const resourceId = required(run4.resourceId, "the product id");
|
|
263472
263735
|
const { territories } = run4.item;
|
|
263473
263736
|
const matches2 = async () => availabilityMatches(await readObservedAvailability(api4, resourceId), territories) ? true : void 0;
|
|
263474
|
-
const { state } = await ensure({ write: async () => (await api4.createAvailability(resourceId, territories), true), find: matches2 },
|
|
263737
|
+
const { state } = await ensure({ write: async () => (await api4.createAvailability(resourceId, territories), true), find: matches2 }, sleep5);
|
|
263475
263738
|
return { state };
|
|
263476
263739
|
},
|
|
263477
263740
|
uploadReviewScreenshot: async (run4, op) => uploadScreenshot(context, required(run4.resourceId, "the product id"), plannedScreenshot(run4.item, op, context)),
|
|
@@ -266479,7 +266742,7 @@ __export(preflight_app_exports, {
|
|
|
266479
266742
|
profileAccount: () => profileAccount,
|
|
266480
266743
|
readXcconfigVars: () => readXcconfigVars
|
|
266481
266744
|
});
|
|
266482
|
-
import { readFileSync as readFileSync165, existsSync as existsSync139, readdirSync as readdirSync62, statSync as
|
|
266745
|
+
import { readFileSync as readFileSync165, existsSync as existsSync139, readdirSync as readdirSync62, statSync as statSync50 } from "node:fs";
|
|
266483
266746
|
import { createHash as createHash90 } from "node:crypto";
|
|
266484
266747
|
import { dirname as dirname78, join as join178 } from "node:path";
|
|
266485
266748
|
function analyze(projectYml, storeConfig, icon, account2, adopted) {
|
|
@@ -266815,7 +267078,7 @@ function playListingAssets(app2, locale = "en-US") {
|
|
|
266815
267078
|
for (const name of names2) {
|
|
266816
267079
|
const p2 = join178(dir, name);
|
|
266817
267080
|
try {
|
|
266818
|
-
if (
|
|
267081
|
+
if (statSync50(p2).isFile()) return { name, bytes: readFileSync165(p2) };
|
|
266819
267082
|
} catch {
|
|
266820
267083
|
}
|
|
266821
267084
|
}
|
|
@@ -266863,7 +267126,7 @@ function listScreenshots(app2, locale = "en-US") {
|
|
|
266863
267126
|
if (existsSync139(legacy)) {
|
|
266864
267127
|
for (const deviceDir of readdirSync62(legacy)) {
|
|
266865
267128
|
const d2 = join178(legacy, deviceDir);
|
|
266866
|
-
if (!
|
|
267129
|
+
if (!statSync50(d2).isDirectory()) continue;
|
|
266867
267130
|
for (const png of readdirSync62(d2).filter((n2) => n2.endsWith(".png"))) {
|
|
266868
267131
|
const sz = pngSize3(readFileSync165(join178(d2, png)));
|
|
266869
267132
|
if (sz) out2.push({ name: `${deviceDir}/${png}`, w: sz.w, h: sz.h });
|
|
@@ -266878,7 +267141,7 @@ function placeholderHashes2() {
|
|
|
266878
267141
|
for (const target of readdirSync62(templateIos)) {
|
|
266879
267142
|
const p2 = join178(templateIos, target, "Assets.xcassets", "AppIcon.appiconset", "icon_1024.png");
|
|
266880
267143
|
try {
|
|
266881
|
-
if (!
|
|
267144
|
+
if (!statSync50(p2).isFile()) continue;
|
|
266882
267145
|
return [LEGACY_PLACEHOLDER_SHA2562, createHash90("sha256").update(readFileSync165(p2)).digest("hex")];
|
|
266883
267146
|
} catch {
|
|
266884
267147
|
}
|
|
@@ -266914,7 +267177,7 @@ async function appIconState(iosDir) {
|
|
|
266914
267177
|
for (const target of readdirSync62(iosDir)) {
|
|
266915
267178
|
const p2 = join178(iosDir, target, "Assets.xcassets", "AppIcon.appiconset", "icon_1024.png");
|
|
266916
267179
|
try {
|
|
266917
|
-
if (!
|
|
267180
|
+
if (!statSync50(p2).isFile()) continue;
|
|
266918
267181
|
const bytes2 = readFileSync165(p2);
|
|
266919
267182
|
const hash3 = createHash90("sha256").update(bytes2).digest("hex");
|
|
266920
267183
|
const pixels = await pixelIssues(bytes2);
|
|
@@ -277403,7 +277666,7 @@ var init_invite_plan = __esm({
|
|
|
277403
277666
|
});
|
|
277404
277667
|
|
|
277405
277668
|
// src/one-app/header-badges-cli.ts
|
|
277406
|
-
import { existsSync as existsSync154, lstatSync as lstatSync42, readFileSync as readFileSync183, rmSync as rmSync47, statSync as
|
|
277669
|
+
import { existsSync as existsSync154, lstatSync as lstatSync42, readFileSync as readFileSync183, rmSync as rmSync47, statSync as statSync53, writeFileSync as writeFileSync76 } from "node:fs";
|
|
277407
277670
|
import { join as join197, resolve as resolve126 } from "node:path";
|
|
277408
277671
|
function guestSignInParams(contentDir2) {
|
|
277409
277672
|
const profile = screenLoadParams(contentDir2, PROFILE_AVATAR_ITEM.onTap.params.screenId) ?? {};
|
|
@@ -277507,7 +277770,7 @@ async function runOneAppHeaderBadges(args, io2) {
|
|
|
277507
277770
|
let configLinked = false;
|
|
277508
277771
|
try {
|
|
277509
277772
|
configLinked = lstatSync42(configPath).isSymbolicLink();
|
|
277510
|
-
if (!configLinked &&
|
|
277773
|
+
if (!configLinked && statSync53(configPath).isFile()) configText = readFileSync183(configPath, "utf8");
|
|
277511
277774
|
} catch {
|
|
277512
277775
|
}
|
|
277513
277776
|
const declaration2 = options2.notNewApp || !configText ? void 0 : declareNewApp(configText);
|
|
@@ -277532,7 +277795,7 @@ async function runOneAppHeaderBadges(args, io2) {
|
|
|
277532
277795
|
let screens;
|
|
277533
277796
|
try {
|
|
277534
277797
|
if (configLinked) throw new Error("config.ts is a symlink: refusing to read or write through it.");
|
|
277535
|
-
if (!
|
|
277798
|
+
if (!statSync53(configPath).isFile()) throw new Error("config.ts is not a file.");
|
|
277536
277799
|
screens = contentScreens(options2.contentDir);
|
|
277537
277800
|
} catch (error) {
|
|
277538
277801
|
return report6(io2, false, { code: "config_uninspectable", error: error instanceof Error ? error.message : String(error), ...common2 });
|
|
@@ -277705,15 +277968,39 @@ function readParts(contentDir2, name, values, key4) {
|
|
|
277705
277968
|
const node3 = file2[key4];
|
|
277706
277969
|
const shapeOk = key4 === "node" ? !!node3 && typeof node3 === "object" && !Array.isArray(node3) : Array.isArray(node3) && node3.length > 0;
|
|
277707
277970
|
if (!shapeOk) throw new RecipeError(`recipes/${name}.json has no "${key4}" ${key4 === "node" ? "object" : "array"}`);
|
|
277708
|
-
const
|
|
277971
|
+
const keyed = keyedCopy(contentDir2, file2._keys);
|
|
277972
|
+
const authored2 = keyed ? keyCopy(node3, keyed) : node3;
|
|
277973
|
+
const text32 = JSON.stringify(authored2).replace(/\{\{([A-Za-z][A-Za-z0-9_]*)\}\}/g, (whole, key5) => Object.hasOwn(values, key5) ? JSON.stringify(values[key5]).slice(1, -1) : whole);
|
|
277709
277974
|
const left = [...new Set([...text32.matchAll(/\{\{([A-Za-z][A-Za-z0-9_]*)\}\}/g)].map((m2) => m2[1]))];
|
|
277710
277975
|
if (left.length) throw new RecipeError(`recipes/${name}.json has placeholder(s) with no value: ${left.join(", ")}`);
|
|
277711
277976
|
return JSON.parse(text32);
|
|
277712
277977
|
}
|
|
277978
|
+
function keyedCopy(contentDir2, raw) {
|
|
277979
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw) || !migrationLanguages(contentDir2).length) return void 0;
|
|
277980
|
+
let declared;
|
|
277981
|
+
try {
|
|
277982
|
+
const catalog4 = JSON.parse(readFileSync184(join198(contentDir2, "l10n", "en.json"), "utf8"));
|
|
277983
|
+
declared = new Set(Object.values(catalog4.messages ?? {}).map((m2) => m2?.key).filter((k3) => typeof k3 === "string" && k3 !== ""));
|
|
277984
|
+
} catch {
|
|
277985
|
+
return void 0;
|
|
277986
|
+
}
|
|
277987
|
+
const applies = new Map(Object.entries(raw).filter((e2) => typeof e2[1] === "string" && declared.has(e2[1])));
|
|
277988
|
+
return applies.size ? applies : void 0;
|
|
277989
|
+
}
|
|
277990
|
+
function keyCopy(value2, keys2) {
|
|
277991
|
+
if (typeof value2 === "string") {
|
|
277992
|
+
const key4 = keys2.get(value2);
|
|
277993
|
+
return key4 ? `$t:${key4}` : value2;
|
|
277994
|
+
}
|
|
277995
|
+
if (Array.isArray(value2)) return value2.map((item2) => keyCopy(item2, keys2));
|
|
277996
|
+
if (value2 && typeof value2 === "object") return Object.fromEntries(Object.entries(value2).map(([k3, v2]) => [k3, keyCopy(v2, keys2)]));
|
|
277997
|
+
return value2;
|
|
277998
|
+
}
|
|
277713
277999
|
var RecipeError;
|
|
277714
278000
|
var init_recipes = __esm({
|
|
277715
278001
|
"src/one-app/recipes.ts"() {
|
|
277716
278002
|
init_define_HHP_CATALOG();
|
|
278003
|
+
init_app_locale_edit();
|
|
277717
278004
|
RecipeError = class extends Error {
|
|
277718
278005
|
constructor(message5) {
|
|
277719
278006
|
super(message5);
|
|
@@ -279379,14 +279666,14 @@ var init_generate2 = __esm({
|
|
|
279379
279666
|
const goal = countOf2(obj15(display.defaultWeeklyGoal).value);
|
|
279380
279667
|
const showTotal = obj15(display.totalNumberOfSessions).show !== false;
|
|
279381
279668
|
const mode = str16(obj15(st2.progressCalculation).calculationMode).trim();
|
|
279382
|
-
ctx.gap(sectionId, type2, `the section counts the member's confirmed bookings that already took place (the rule of My Bookings' "This week"), not the source's tracker service; a weekly goal of ${goal ?? "2"} is
|
|
279669
|
+
ctx.gap(sectionId, type2, `the section counts the member's confirmed bookings that already took place (the rule of My Bookings' "This week"), not the source's tracker service; a weekly goal of ${goal ?? "2"} is the default, a member picks their own from 1 to 14 as in the source but it stays on that member's device (the source keeps it in a private service a member's session cannot call, so it is not shared with the source app or the member's other devices); weeks run Monday to Sunday (the rule of My Bookings), where the source starts the week on the language's first day; the "N of G sessions this week" lines and a See All button to My Bookings are additions the source's card does not show`);
|
|
279383
279670
|
ctx.gap(sectionId, type2, mode === "all" ? "the source counts every scheduled session in the week, including those still to come; the section counts only those that took place" : "the source counts only sessions marked attended; a visitor cannot read attendance, so the section counts every confirmed session that took place");
|
|
279384
279671
|
if (obj15(st2.dailyActivity).enabled === true) ctx.gap(sectionId, type2, "the source shows the member's daily activity from Apple Health; the section has no health data");
|
|
279385
279672
|
const svc = ctx.uses("performanceTracker", `performanceTracker${index}`, { ...goal !== void 0 ? { goal } : {}, showTotal });
|
|
279386
279673
|
const children2 = [];
|
|
279387
|
-
const title = str16(s5.title).trim();
|
|
279388
|
-
|
|
279389
|
-
|
|
279674
|
+
const title = s5.showTitle === true ? str16(s5.title).trim() : "";
|
|
279675
|
+
let card2 = ctx.recipe("performance-tracker", { svc, id, title, signInScreen: "himi_sign_in", seeAllLabel: "See All", seeAllScreen: "himi_bookings" });
|
|
279676
|
+
if (!title) card2 = withoutNode(card2, `${id}.title`);
|
|
279390
279677
|
if (!ctx.hasScreen("himi_sign_in")) card2 = withoutNode(card2, `${id}.signin.button`);
|
|
279391
279678
|
children2.push(card2, ...ctx.optionalRecipe("section-error", { svc, id, action: "load" }));
|
|
279392
279679
|
return vstack(`${id}.box`, children2, 12, { ...inset(16, 16), onAppear: { actionId: `tier5.${svc}.load`, params: {} } });
|
|
@@ -283264,7 +283551,7 @@ var init_customer_build = __esm({
|
|
|
283264
283551
|
});
|
|
283265
283552
|
|
|
283266
283553
|
// src/site-analyze/apply.ts
|
|
283267
|
-
import { existsSync as existsSync160, readFileSync as readFileSync191, writeFileSync as writeFileSync80, copyFileSync as copyFileSync3, mkdirSync as mkdirSync69, realpathSync as realpathSync25, statSync as
|
|
283554
|
+
import { existsSync as existsSync160, readFileSync as readFileSync191, writeFileSync as writeFileSync80, copyFileSync as copyFileSync3, mkdirSync as mkdirSync69, realpathSync as realpathSync25, statSync as statSync54 } from "node:fs";
|
|
283268
283555
|
import { dirname as dirname90, isAbsolute as isAbsolute21, join as join205, resolve as resolve130, sep as sep35 } from "node:path";
|
|
283269
283556
|
import { spawnSync as spawnSync13 } from "node:child_process";
|
|
283270
283557
|
function inRepoBakeRefusal(repoRoot2, shell) {
|
|
@@ -283617,7 +283904,7 @@ function buildMergedContract(options2) {
|
|
|
283617
283904
|
}
|
|
283618
283905
|
if (!real.startsWith(realRoot + sep35)) return void 0;
|
|
283619
283906
|
try {
|
|
283620
|
-
if (!
|
|
283907
|
+
if (!statSync54(real).isFile()) return void 0;
|
|
283621
283908
|
mkdirSync69(dirname90(to2), { recursive: true });
|
|
283622
283909
|
copyFileSync3(real, to2);
|
|
283623
283910
|
} catch {
|
|
@@ -287182,7 +287469,7 @@ function nativeCapture(devices, opts) {
|
|
|
287182
287469
|
};
|
|
287183
287470
|
const gone = /* @__PURE__ */ new Set();
|
|
287184
287471
|
const read2 = opts.readFile ?? ((p2) => readFileSync195(p2));
|
|
287185
|
-
const
|
|
287472
|
+
const sleep5 = opts.sleep ?? ((ms2) => new Promise((r3) => setTimeout(r3, ms2)));
|
|
287186
287473
|
const settleMs = opts.settleMs ?? 1e3;
|
|
287187
287474
|
const maxWaitMs = opts.maxWaitMs ?? 3e4;
|
|
287188
287475
|
const iosBundle = opts.iosBundleId ?? "dev.himalaya.player.dev";
|
|
@@ -287316,7 +287603,7 @@ function nativeCapture(devices, opts) {
|
|
|
287316
287603
|
} else why = "the screen did not stop changing";
|
|
287317
287604
|
if (waited >= maxWaitMs) return { frame, unsettled: `${why} within ${Math.round(maxWaitMs / 1e3)}s` };
|
|
287318
287605
|
previous = frame;
|
|
287319
|
-
await
|
|
287606
|
+
await sleep5(settleMs);
|
|
287320
287607
|
}
|
|
287321
287608
|
}
|
|
287322
287609
|
async function open6(platform, id, link4) {
|
|
@@ -292209,7 +292496,7 @@ async function iconsCommand(ctx) {
|
|
|
292209
292496
|
// src/commands/pull.ts
|
|
292210
292497
|
init_define_HHP_CATALOG();
|
|
292211
292498
|
init_cli_shared();
|
|
292212
|
-
import { existsSync as existsSync124, readdirSync as readdirSync57, statSync as
|
|
292499
|
+
import { existsSync as existsSync124, readdirSync as readdirSync57, statSync as statSync45 } from "node:fs";
|
|
292213
292500
|
import { join as join159, resolve as resolve101 } from "node:path";
|
|
292214
292501
|
async function pullCommand(ctx) {
|
|
292215
292502
|
const { io: io2, pos, flags, print, client: client4 } = ctx;
|
|
@@ -292233,7 +292520,7 @@ async function pullCommand(ctx) {
|
|
|
292233
292520
|
return 1;
|
|
292234
292521
|
}
|
|
292235
292522
|
if (existsSync124(dest)) {
|
|
292236
|
-
if (!
|
|
292523
|
+
if (!statSync45(dest).isDirectory()) {
|
|
292237
292524
|
io2.error(JSON.stringify({
|
|
292238
292525
|
error: `${dest} exists and is not a directory`,
|
|
292239
292526
|
hint: "pass --out/--name to land somewhere else, or remove the file"
|
|
@@ -293391,13 +293678,13 @@ async function packCommand(ctx) {
|
|
|
293391
293678
|
// src/commands/import.ts
|
|
293392
293679
|
init_define_HHP_CATALOG();
|
|
293393
293680
|
init_cli_shared();
|
|
293394
|
-
import { existsSync as existsSync127, readdirSync as readdirSync58, statSync as
|
|
293681
|
+
import { existsSync as existsSync127, readdirSync as readdirSync58, statSync as statSync47 } from "node:fs";
|
|
293395
293682
|
import { resolve as resolve104 } from "node:path";
|
|
293396
293683
|
function restoreDestinationIssue(dest, force) {
|
|
293397
293684
|
const link4 = symlinkDestinationIssue(dest);
|
|
293398
293685
|
if (link4) return link4;
|
|
293399
293686
|
if (!existsSync127(dest)) return null;
|
|
293400
|
-
if (!
|
|
293687
|
+
if (!statSync47(dest).isDirectory()) {
|
|
293401
293688
|
return { error: `${dest} exists and is not a directory`, hint: "pass --out/--name to land somewhere else, or remove the file" };
|
|
293402
293689
|
}
|
|
293403
293690
|
if (readdirSync58(dest).length > 0 && !force) {
|
|
@@ -297035,7 +297322,7 @@ async function upgradeCommand(ctx) {
|
|
|
297035
297322
|
// src/commands/doctor.ts
|
|
297036
297323
|
init_define_HHP_CATALOG();
|
|
297037
297324
|
init_config();
|
|
297038
|
-
import { statSync as
|
|
297325
|
+
import { statSync as statSync51, accessSync as accessSync5, constants as constants11 } from "node:fs";
|
|
297039
297326
|
import { join as join180 } from "node:path";
|
|
297040
297327
|
init_wix_owner();
|
|
297041
297328
|
init_owner_claim();
|
|
@@ -297107,7 +297394,7 @@ function executableOnPath(name, env = process.env) {
|
|
|
297107
297394
|
for (const suffix of suffixes) {
|
|
297108
297395
|
const candidate = join180(dir, `${name}${suffix}`);
|
|
297109
297396
|
try {
|
|
297110
|
-
if (!
|
|
297397
|
+
if (!statSync51(candidate).isFile()) continue;
|
|
297111
297398
|
if (process.platform !== "win32") accessSync5(candidate, constants11.X_OK);
|
|
297112
297399
|
return true;
|
|
297113
297400
|
} catch {
|
|
@@ -298623,7 +298910,7 @@ import {
|
|
|
298623
298910
|
realpathSync as realpathSync23,
|
|
298624
298911
|
renameSync as renameSync26,
|
|
298625
298912
|
rmSync as rmSync43,
|
|
298626
|
-
statSync as
|
|
298913
|
+
statSync as statSync52,
|
|
298627
298914
|
writeFileSync as writeFileSync68
|
|
298628
298915
|
} from "node:fs";
|
|
298629
298916
|
import { basename as basename41, dirname as dirname84, join as join187, relative as relative37, resolve as resolve121 } from "node:path";
|
|
@@ -298709,7 +298996,7 @@ async function l10nCommand(ctx) {
|
|
|
298709
298996
|
return fail16("invalid_usage", { error: "name the app: --app <slug> (in a checkout) or --content <app dir>" }, 2);
|
|
298710
298997
|
}
|
|
298711
298998
|
const messagesDir = resolve121(dirArg);
|
|
298712
|
-
if (!existsSync145(messagesDir) || !
|
|
298999
|
+
if (!existsSync145(messagesDir) || !statSync52(messagesDir).isDirectory()) {
|
|
298713
299000
|
return fail16("messages_dir_not_found", { error: `${dirArg} is not a directory`, dir: messagesDir }, 1);
|
|
298714
299001
|
}
|
|
298715
299002
|
const fileByTag = /* @__PURE__ */ new Map();
|