diff --git a/src/configs/logger/index.ts b/src/configs/logger/index.ts index 5945627..5360284 100644 --- a/src/configs/logger/index.ts +++ b/src/configs/logger/index.ts @@ -1,7 +1,7 @@ import { LoggerOptions, pino } from 'pino'; import { env } from '../env.js'; -export const loggerConfigs = { +const loggerConfigs = { development: { transport: { target: 'pino-pretty', diff --git a/src/types.test.ts b/src/types.test.ts index 078b446..0630eb0 100644 --- a/src/types.test.ts +++ b/src/types.test.ts @@ -5,35 +5,10 @@ describe('types.ts', () => { it('should import without throwing', async () => { const module = await import('./types.js'); expect(module).toBeDefined(); - expect(module.ConfigSchema).toBeDefined(); - expect(module.PostTweetSchema).toBeDefined(); - expect(module.SearchTweetsSchema).toBeDefined(); expect(module.TwitterError).toBeDefined(); }); }); - describe('ConfigSchema', () => { - it.todo('should validate valid config'); - it.todo('should reject empty apiKey'); - it.todo('should reject empty apiSecretKey'); - it.todo('should reject empty accessToken'); - it.todo('should reject empty accessTokenSecret'); - }); - - describe('PostTweetSchema', () => { - it.todo('should validate valid tweet text'); - it.todo('should reject empty text'); - it.todo('should reject text over 280 characters'); - }); - - describe('SearchTweetsSchema', () => { - it.todo('should validate valid search params'); - it.todo('should reject empty query'); - it.todo('should reject count below 10'); - it.todo('should reject count above 100'); - it.todo('should reject non-integer count'); - }); - describe('TwitterError', () => { it.todo('should create error with message, code, and status'); it.todo('should have name TwitterError'); diff --git a/src/types.ts b/src/types.ts index 5fdcaad..34f1ab1 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,33 +1,3 @@ -import { z } from 'zod'; - -// Configuration schema with validation -export const ConfigSchema = z.object({ - apiKey: z.string().min(1, 'API Key is required'), - apiSecretKey: z.string().min(1, 'API Secret Key is required'), - accessToken: z.string().min(1, 'Access Token is required'), - accessTokenSecret: z.string().min(1, 'Access Token Secret is required') -}); - -export type Config = z.infer; - -// Tool input schemas -export const PostTweetSchema = z.object({ - text: z.string() - .min(1, 'Tweet text cannot be empty') - .max(280, 'Tweet cannot exceed 280 characters') -}); - -export const SearchTweetsSchema = z.object({ - query: z.string().min(1, 'Search query cannot be empty'), - count: z.number() - .int('Count must be an integer') - .min(10, 'Minimum count is 10') - .max(100, 'Maximum count is 100') -}); - -export type PostTweetArgs = z.infer; -export type SearchTweetsArgs = z.infer; - // API Response types export interface TweetMetrics { likes: number;