Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/configs/logger/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { LoggerOptions, pino } from 'pino';
import { env } from '../env.js';

export const loggerConfigs = {
const loggerConfigs = {
development: {
transport: {
target: 'pino-pretty',
Expand Down
25 changes: 0 additions & 25 deletions src/types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
30 changes: 0 additions & 30 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -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<typeof ConfigSchema>;

// 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<typeof PostTweetSchema>;
export type SearchTweetsArgs = z.infer<typeof SearchTweetsSchema>;

// API Response types
export interface TweetMetrics {
likes: number;
Expand Down
Loading