Skip to main content
Glama
wordpress-service.ts1.84 kB
// Unified WordPress Service - Combines all WordPress API services import { WordPressClient } from '../wordpress-client.js'; import { WordPressConfig } from '../../config/wordpress-config.js'; import { PostsService } from './posts-service.js'; import { PagesService } from './pages-service.js'; import { MediaService } from './media-service.js'; import { UsersService } from './users-service.js'; import { TaxonomyService } from './taxonomy-service.js'; import { CustomPostTypesService } from './custom-post-types-service.js'; import { BatchService } from './batch-service.js'; import { logger } from '../../utils/logger.js'; export class WordPressService { private client: WordPressClient; public readonly posts: PostsService; public readonly pages: PagesService; public readonly media: MediaService; public readonly users: UsersService; public readonly taxonomy: TaxonomyService; public readonly customPostTypes: CustomPostTypesService; public readonly batch: BatchService; constructor(config: WordPressConfig) { logger.info('Initializing WordPress Service'); // Create WordPress client this.client = new WordPressClient(config); const axiosInstance = this.client.getAxiosInstance(); // Initialize all services this.posts = new PostsService(axiosInstance); this.pages = new PagesService(axiosInstance); this.media = new MediaService(axiosInstance, config.baseUrl); this.users = new UsersService(axiosInstance); this.taxonomy = new TaxonomyService(axiosInstance); this.customPostTypes = new CustomPostTypesService(axiosInstance); this.batch = new BatchService(axiosInstance); logger.info('WordPress Service initialized successfully'); } // Convenience method to get the axios client getClient() { return this.client.getAxiosInstance(); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mbrown1837/Ultimate-Elementor-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server