@xfey/tutti 0.1.92 → 0.1.93
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.
|
@@ -25,7 +25,7 @@ type LocalConsoleServerOptions = {
|
|
|
25
25
|
startPackageUpdate?: (preparation: LocalConsolePackageUpdatePreparation) => Promise<{
|
|
26
26
|
pid: number;
|
|
27
27
|
}>;
|
|
28
|
-
|
|
28
|
+
packageUpdateCompletion?: PackageUpdateCompletionResult;
|
|
29
29
|
};
|
|
30
30
|
export declare function createLocalConsoleServer(options: LocalConsoleServerOptions): FastifyInstance;
|
|
31
31
|
export declare function runLocalConsoleProcess(options?: {
|
|
@@ -84,6 +84,7 @@ export function createLocalConsoleServer(options) {
|
|
|
84
84
|
operations,
|
|
85
85
|
...(options.env === undefined ? {} : { env: options.env }),
|
|
86
86
|
});
|
|
87
|
+
let pendingPackageUpdateCompletion = options.packageUpdateCompletion;
|
|
87
88
|
const startPackageUpdate = options.startPackageUpdate ??
|
|
88
89
|
(async (preparation) => {
|
|
89
90
|
try {
|
|
@@ -274,7 +275,12 @@ export function createLocalConsoleServer(options) {
|
|
|
274
275
|
});
|
|
275
276
|
app.get(`${LOCAL_CONSOLE_API_BASE}/bootstrap`, (request) => {
|
|
276
277
|
const session = requireSession(request);
|
|
277
|
-
const packageUpdateCompletion =
|
|
278
|
+
const packageUpdateCompletion = session.accountReady
|
|
279
|
+
? pendingPackageUpdateCompletion
|
|
280
|
+
: undefined;
|
|
281
|
+
if (packageUpdateCompletion !== undefined) {
|
|
282
|
+
pendingPackageUpdateCompletion = undefined;
|
|
283
|
+
}
|
|
278
284
|
return {
|
|
279
285
|
account_gate: session.accountReady
|
|
280
286
|
? {
|
|
@@ -487,7 +493,7 @@ export async function runLocalConsoleProcess(options = {}) {
|
|
|
487
493
|
lastActivityAt = now().getTime();
|
|
488
494
|
},
|
|
489
495
|
onShutdown: () => requestClose(),
|
|
490
|
-
|
|
496
|
+
...(packageUpdateCompletion === undefined ? {} : { packageUpdateCompletion }),
|
|
491
497
|
...(options.now === undefined ? {} : { now: options.now }),
|
|
492
498
|
});
|
|
493
499
|
await app.listen({ host: "127.0.0.1", port: 0 });
|