engine7 7.1.113 → 7.1.114
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +28 -9
- package/dist/engine-startup.mjs +602 -527
- package/dist/main.mjs +606 -535
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -29529,6 +29529,7 @@ __export(provision_free_exports, {
|
|
|
29529
29529
|
loadOrCreateInstallIdentity: () => loadOrCreateInstallIdentity,
|
|
29530
29530
|
provisionFreeToken: () => provisionFreeToken,
|
|
29531
29531
|
readInstallIdentity: () => readInstallIdentity,
|
|
29532
|
+
readInstallIdentityDetailed: () => readInstallIdentityDetailed,
|
|
29532
29533
|
writeIdentityContactEmail: () => writeIdentityContactEmail
|
|
29533
29534
|
});
|
|
29534
29535
|
import { randomBytes as randomBytes6, randomUUID as randomUUID9 } from "node:crypto";
|
|
@@ -29573,19 +29574,37 @@ function loadOrCreateInstallIdentity(stateDir) {
|
|
|
29573
29574
|
}
|
|
29574
29575
|
return identity;
|
|
29575
29576
|
}
|
|
29576
|
-
function
|
|
29577
|
+
function readInstallIdentityDetailed(stateDir) {
|
|
29578
|
+
const file2 = join51(stateDir, IDENTITY_FILE);
|
|
29579
|
+
if (!existsSync32(file2)) return { ok: false, reason: "missing" };
|
|
29580
|
+
let text;
|
|
29577
29581
|
try {
|
|
29578
|
-
|
|
29579
|
-
|
|
29580
|
-
|
|
29581
|
-
|
|
29582
|
+
text = readFileSync39(file2, "utf8");
|
|
29583
|
+
} catch (e) {
|
|
29584
|
+
return { ok: false, reason: "corrupt", detail: `\u5B58\u5728\u4F46\u8BFB\u4E0D\u4E86\uFF08${e?.message ?? e}\uFF09` };
|
|
29585
|
+
}
|
|
29586
|
+
let parsed;
|
|
29587
|
+
try {
|
|
29588
|
+
parsed = JSON.parse(text);
|
|
29589
|
+
} catch (e) {
|
|
29590
|
+
return { ok: false, reason: "corrupt", detail: `\u4E0D\u662F\u5408\u6CD5 JSON\uFF08${e?.message ?? e}\uFF09` };
|
|
29591
|
+
}
|
|
29592
|
+
if (typeof parsed?.installId !== "string" || typeof parsed?.installSecret !== "string") {
|
|
29593
|
+
return { ok: false, reason: "corrupt", detail: "\u7F3A installId / installSecret \u5B57\u6BB5" };
|
|
29594
|
+
}
|
|
29595
|
+
const email = readContactEmailOf(parsed);
|
|
29596
|
+
return {
|
|
29597
|
+
ok: true,
|
|
29598
|
+
identity: {
|
|
29582
29599
|
installId: parsed.installId,
|
|
29583
29600
|
installSecret: parsed.installSecret,
|
|
29584
29601
|
...email ? { contactEmail: email } : {}
|
|
29585
|
-
}
|
|
29586
|
-
}
|
|
29587
|
-
|
|
29588
|
-
|
|
29602
|
+
}
|
|
29603
|
+
};
|
|
29604
|
+
}
|
|
29605
|
+
function readInstallIdentity(stateDir) {
|
|
29606
|
+
const r = readInstallIdentityDetailed(stateDir);
|
|
29607
|
+
return r.ok ? r.identity : null;
|
|
29589
29608
|
}
|
|
29590
29609
|
function writeIdentityContactEmail(stateDir, email) {
|
|
29591
29610
|
const identity = loadOrCreateInstallIdentity(stateDir);
|