refactor(core): make Config.Info canonical Effect Schema (#23716)

This commit is contained in:
Kit Langton
2026-04-21 14:06:47 -04:00
committed by GitHub
parent 3205f122eb
commit ecc06a3d8f
7 changed files with 36 additions and 27 deletions

View File

@@ -147,7 +147,7 @@ export const GlobalRoutes = lazy(() =>
description: "Get global config info",
content: {
"application/json": {
schema: resolver(Config.Info),
schema: resolver(Config.Info.zod),
},
},
},
@@ -168,14 +168,14 @@ export const GlobalRoutes = lazy(() =>
description: "Successfully updated global config",
content: {
"application/json": {
schema: resolver(Config.Info),
schema: resolver(Config.Info.zod),
},
},
},
...errors(400),
},
}),
validator("json", Config.Info),
validator("json", Config.Info.zod),
async (c) => {
const config = c.req.valid("json")
const next = await AppRuntime.runPromise(Config.Service.use((cfg) => cfg.updateGlobal(config)))

View File

@@ -20,7 +20,7 @@ export const ConfigRoutes = lazy(() =>
description: "Get config info",
content: {
"application/json": {
schema: resolver(Config.Info),
schema: resolver(Config.Info.zod),
},
},
},
@@ -43,14 +43,14 @@ export const ConfigRoutes = lazy(() =>
description: "Successfully updated config",
content: {
"application/json": {
schema: resolver(Config.Info),
schema: resolver(Config.Info.zod),
},
},
},
...errors(400),
},
}),
validator("json", Config.Info),
validator("json", Config.Info.zod),
async (c) =>
jsonRequest("ConfigRoutes.update", c, function* () {
const config = c.req.valid("json")

View File

@@ -10,7 +10,7 @@ export const ConfigApi = HttpApi.make("config")
HttpApiGroup.make("config")
.add(
HttpApiEndpoint.get("get", root, {
success: Config.InfoSchema,
success: Config.Info,
}).annotateMerge(
OpenApi.annotations({
identifier: "config.get",