chore(25-02): apply biome formatter to task 1 and 2 files

This commit is contained in:
2026-04-10 11:06:11 +02:00
parent e4a65314bd
commit fc9a9134e8
5 changed files with 195 additions and 151 deletions

View File

@@ -67,15 +67,15 @@ const GlobalItemsGlobalItemIdRoute = GlobalItemsGlobalItemIdRouteImport.update({
getParentRoute: () => rootRouteImport,
} as any)
const ThreadsThreadIdIndexRoute = ThreadsThreadIdIndexRouteImport.update({
id: '/',
path: '/',
getParentRoute: () => ThreadsThreadIdRoute,
id: '/threads/$threadId/',
path: '/threads/$threadId/',
getParentRoute: () => rootRouteImport,
} as any)
const ThreadsThreadIdCandidatesCandidateIdRoute =
ThreadsThreadIdCandidatesCandidateIdRouteImport.update({
id: '/candidates/$candidateId',
path: '/candidates/$candidateId',
getParentRoute: () => ThreadsThreadIdRoute,
id: '/threads/$threadId/candidates/$candidateId',
path: '/threads/$threadId/candidates/$candidateId',
getParentRoute: () => rootRouteImport,
} as any)
export interface FileRoutesByFullPath {
@@ -170,6 +170,8 @@ export interface RootRouteChildren {
UsersUserIdRoute: typeof UsersUserIdRoute
CollectionIndexRoute: typeof CollectionIndexRoute
GlobalItemsIndexRoute: typeof GlobalItemsIndexRoute
ThreadsThreadIdIndexRoute: typeof ThreadsThreadIdIndexRoute
ThreadsThreadIdCandidatesCandidateIdRoute: typeof ThreadsThreadIdCandidatesCandidateIdRoute
}
declare module '@tanstack/react-router' {
@@ -239,17 +241,17 @@ declare module '@tanstack/react-router' {
}
'/threads/$threadId/': {
id: '/threads/$threadId/'
path: '/'
path: '/threads/$threadId'
fullPath: '/threads/$threadId/'
preLoaderRoute: typeof ThreadsThreadIdIndexRouteImport
parentRoute: typeof ThreadsThreadIdRoute
parentRoute: typeof rootRouteImport
}
'/threads/$threadId/candidates/$candidateId': {
id: '/threads/$threadId/candidates/$candidateId'
path: '/candidates/$candidateId'
path: '/threads/$threadId/candidates/$candidateId'
fullPath: '/threads/$threadId/candidates/$candidateId'
preLoaderRoute: typeof ThreadsThreadIdCandidatesCandidateIdRouteImport
parentRoute: typeof ThreadsThreadIdRoute
parentRoute: typeof rootRouteImport
}
}
}
@@ -264,6 +266,9 @@ const rootRouteChildren: RootRouteChildren = {
UsersUserIdRoute: UsersUserIdRoute,
CollectionIndexRoute: CollectionIndexRoute,
GlobalItemsIndexRoute: GlobalItemsIndexRoute,
ThreadsThreadIdIndexRoute: ThreadsThreadIdIndexRoute,
ThreadsThreadIdCandidatesCandidateIdRoute:
ThreadsThreadIdCandidatesCandidateIdRoute,
}
export const routeTree = rootRouteImport
._addFileChildren(rootRouteChildren)

View File

@@ -16,21 +16,43 @@ function textResult(data: unknown): ToolResult {
}
function errorResult(message: string): ToolResult {
return { content: [{ type: "text", text: JSON.stringify({ error: message }) }] };
return {
content: [{ type: "text", text: JSON.stringify({ error: message }) }],
};
}
const catalogItemInputSchema = {
brand: z.string().describe("Brand or manufacturer name"),
model: z.string().describe("Model name — combined with brand forms the unique identifier"),
category: z.string().optional().describe("Category name (e.g., 'Bags', 'Lights')"),
model: z
.string()
.describe("Model name — combined with brand forms the unique identifier"),
category: z
.string()
.optional()
.describe("Category name (e.g., 'Bags', 'Lights')"),
weightGrams: z.number().optional().describe("Weight in grams"),
priceCents: z.number().optional().describe("MSRP price in cents (e.g., 9999 = $99.99)"),
priceCents: z
.number()
.optional()
.describe("MSRP price in cents (e.g., 9999 = $99.99)"),
imageUrl: z.string().optional().describe("URL to the product image"),
description: z.string().optional().describe("Product description"),
sourceUrl: z.string().optional().describe("URL to the product page on manufacturer/retailer site"),
imageCredit: z.string().optional().describe("Image credit — photographer or source name"),
imageSourceUrl: z.string().optional().describe("Original URL where the image was sourced from"),
tags: z.array(z.string()).optional().describe("Tags for categorization (created automatically if new)"),
sourceUrl: z
.string()
.optional()
.describe("URL to the product page on manufacturer/retailer site"),
imageCredit: z
.string()
.optional()
.describe("Image credit — photographer or source name"),
imageSourceUrl: z
.string()
.optional()
.describe("Original URL where the image was sourced from"),
tags: z
.array(z.string())
.optional()
.describe("Tags for categorization (created automatically if new)"),
};
export const catalogToolDefinitions = [

View File

@@ -48,11 +48,15 @@ app.post("/", zValidator("json", upsertGlobalItemSchema), async (c) => {
});
// Bulk upsert — per D-06, D-07, D-08
app.post("/bulk", zValidator("json", bulkUpsertGlobalItemsSchema), async (c) => {
const db = c.get("db");
const { items } = c.req.valid("json");
const result = await bulkUpsertGlobalItems(db, items);
return c.json(result);
});
app.post(
"/bulk",
zValidator("json", bulkUpsertGlobalItemsSchema),
async (c) => {
const db = c.get("db");
const { items } = c.req.valid("json");
const result = await bulkUpsertGlobalItems(db, items);
return c.json(result);
},
);
export { app as globalItemRoutes };