@nowcrew/daemon 0.6.78 → 0.6.79-beta.2
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.
|
@@ -4,11 +4,13 @@ const DaemonUpdateMessageSchema = z.object({
|
|
|
4
4
|
type: z.literal("daemon:update"),
|
|
5
5
|
updateId: z.string().uuid(),
|
|
6
6
|
targetVersion: z.string().refine(isDaemonReleaseVersion, "invalid daemon release version"),
|
|
7
|
+
registryUrl: z.string().url().optional(),
|
|
7
8
|
}).strict();
|
|
8
9
|
const DaemonRestartMessageSchema = z.object({
|
|
9
10
|
type: z.literal("daemon:restart"),
|
|
10
11
|
updateId: z.string().uuid(),
|
|
11
12
|
targetVersion: z.string().refine(isDaemonReleaseVersion, "invalid daemon release version"),
|
|
13
|
+
registryUrl: z.string().url().optional(),
|
|
12
14
|
}).strict();
|
|
13
15
|
const DaemonControlMessageSchema = z.union([DaemonUpdateMessageSchema, DaemonRestartMessageSchema]);
|
|
14
16
|
export function createDaemonUpdateController(deps) {
|
|
@@ -24,13 +26,14 @@ export function createDaemonUpdateController(deps) {
|
|
|
24
26
|
failed(message.updateId, "ineligible");
|
|
25
27
|
return;
|
|
26
28
|
}
|
|
29
|
+
const registryUrl = message.registryUrl ?? eligibility.registryUrl;
|
|
27
30
|
const preparation = message.type === "daemon:restart"
|
|
28
31
|
? await deps.prepareRestart()
|
|
29
32
|
: await deps.install({
|
|
30
33
|
targetVersion: message.targetVersion,
|
|
34
|
+
...(registryUrl === undefined ? {} : { registryUrl }),
|
|
31
35
|
packageRoot: eligibility.packageRoot,
|
|
32
36
|
npmPrefix: eligibility.npmPrefix,
|
|
33
|
-
...(eligibility.registryUrl === undefined ? {} : { registryUrl: eligibility.registryUrl }),
|
|
34
37
|
onInstalling: () => {
|
|
35
38
|
deps.sendStatus({ type: "daemon:update-status", updateId: message.updateId, status: "installing" });
|
|
36
39
|
},
|
|
@@ -14,7 +14,7 @@ import { assertRegistryCoversDescriptors, listManagedServiceDescriptorPaths, man
|
|
|
14
14
|
export async function managedDaemonCapabilities(eligibility) {
|
|
15
15
|
try {
|
|
16
16
|
return (await eligibility()).eligible
|
|
17
|
-
? ["daemon_update_v1", "daemon_restart_v1", "daemon_layout_migration_v1"]
|
|
17
|
+
? ["daemon_update_v1", "daemon_restart_v1", "daemon_update_registry_v1", "daemon_layout_migration_v1"]
|
|
18
18
|
: [];
|
|
19
19
|
}
|
|
20
20
|
catch {
|