diff --git a/packages/logger/src/index.ts b/packages/logger/src/index.ts index 976ba61..6725115 100644 --- a/packages/logger/src/index.ts +++ b/packages/logger/src/index.ts @@ -5,7 +5,11 @@ import winston from 'winston' // Create a Winston logger - passing in the Logtail transport export const logger = winston.createLogger({ format: winston.format.json(), - transports: [], + transports: [ + new winston.transports.Console({ + format: winston.format.json(), + }), + ], }) if (import.meta.env.NODE_ENV === 'production') { @@ -13,11 +17,3 @@ if (import.meta.env.NODE_ENV === 'production') { const logtail = new Logtail(process.env.BETTERSTACK_LOG_TOKEN as string) logger.add(new LogtailTransport(logtail)) } - -if (import.meta.env.NODE_ENV === 'development') { - logger.add( - new winston.transports.Console({ - format: winston.format.json(), - }), - ) -} diff --git a/packages/schema/src/commit/create.ts b/packages/schema/src/commit/create.ts index 5361f54..e80c5bb 100644 --- a/packages/schema/src/commit/create.ts +++ b/packages/schema/src/commit/create.ts @@ -30,7 +30,6 @@ export const CommitCreateInput = z body: z.string().optional(), }), ) - .openapi({ required: ['changelogId', 'commit', 'subject'], }) diff --git a/packages/schema/src/commit/index.ts b/packages/schema/src/commit/index.ts index 8089b9b..1188892 100644 --- a/packages/schema/src/commit/index.ts +++ b/packages/schema/src/commit/index.ts @@ -1,5 +1,5 @@ export * from './base' //export * from './byId' export * from './create' -//export * from './list' +export * from './list' //export * from './update' diff --git a/packages/schema/src/commit/list.ts b/packages/schema/src/commit/list.ts index e552c20..c923e8b 100644 --- a/packages/schema/src/commit/list.ts +++ b/packages/schema/src/commit/list.ts @@ -1,4 +1,19 @@ import { z } from '@hono/zod-openapi' -import { VersionOutput } from './base' +import { CommitOutput } from './base' -export const VersionListOutput = z.array(VersionOutput) +export const CommitListOutput = z.array(CommitOutput) +export const CommitListParams = z.object({ + changelogId: z + .string() + .uuid() + .openapi({ + param: { + name: 'changelogId', + in: 'query', + }, + example: 'a5ed5965-0506-44e6-aaec-0465ff9fe092', + }), + limit: z.number().or(z.string()).optional(), + offset: z.number().or(z.string()).optional(), + hasVersion: z.boolean().default(false), +})