mcp-wordpress 2.10.0 → 2.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/README.md +17 -19
  2. package/bin/mcp-wordpress.js +3 -3
  3. package/bin/setup.js +140 -141
  4. package/bin/status.js +112 -114
  5. package/dist/client/MockWordPressClient.d.ts.map +1 -1
  6. package/dist/client/MockWordPressClient.js.map +1 -1
  7. package/dist/client/SEOWordPressClient.d.ts.map +1 -1
  8. package/dist/client/SEOWordPressClient.js +16 -14
  9. package/dist/client/SEOWordPressClient.js.map +1 -1
  10. package/dist/client/index.d.ts +6 -6
  11. package/dist/client/index.js +6 -6
  12. package/dist/client/managers/AuthManager.d.ts.map +1 -1
  13. package/dist/client/managers/AuthManager.js +2 -2
  14. package/dist/client/managers/AuthManager.js.map +1 -1
  15. package/dist/client/managers/AuthenticationManager.js +1 -1
  16. package/dist/client/managers/JWTAuthImplementation.d.ts.map +1 -1
  17. package/dist/client/managers/JWTAuthImplementation.js +7 -7
  18. package/dist/client/managers/JWTAuthImplementation.js.map +1 -1
  19. package/dist/client/managers/composed/MigrationAdapter.js +1 -1
  20. package/dist/client/managers/composed/index.d.ts +2 -2
  21. package/dist/client/managers/composed/index.d.ts.map +1 -1
  22. package/dist/client/managers/composed/index.js +1 -1
  23. package/dist/client/managers/composed/index.js.map +1 -1
  24. package/dist/client/managers/implementations/ErrorHandlerImpl.d.ts.map +1 -1
  25. package/dist/client/managers/implementations/ErrorHandlerImpl.js +2 -4
  26. package/dist/client/managers/implementations/ErrorHandlerImpl.js.map +1 -1
  27. package/dist/client/managers/implementations/ParameterValidatorImpl.d.ts.map +1 -1
  28. package/dist/client/managers/implementations/ParameterValidatorImpl.js +1 -1
  29. package/dist/client/managers/implementations/ParameterValidatorImpl.js.map +1 -1
  30. package/dist/client/managers/interfaces/ManagerInterfaces.d.ts.map +1 -1
  31. package/dist/config/index.d.ts +3 -3
  32. package/dist/config/index.js +3 -3
  33. package/dist/docs/MarkdownFormatter.d.ts.map +1 -1
  34. package/dist/docs/MarkdownFormatter.js +7 -7
  35. package/dist/docs/MarkdownFormatter.js.map +1 -1
  36. package/dist/performance/PerformanceAnalytics.d.ts.map +1 -1
  37. package/dist/performance/PerformanceAnalytics.js +3 -1
  38. package/dist/performance/PerformanceAnalytics.js.map +1 -1
  39. package/dist/security/InputValidator.js +1 -1
  40. package/dist/security/SecurityCIPipeline.js +1 -1
  41. package/dist/security/SecurityCIPipeline.js.map +1 -1
  42. package/dist/security/SecurityConfig.d.ts.map +1 -1
  43. package/dist/security/SecurityConfig.js +6 -2
  44. package/dist/security/SecurityConfig.js.map +1 -1
  45. package/dist/server/index.d.ts +2 -2
  46. package/dist/server/index.js +2 -2
  47. package/dist/tools/cache.d.ts.map +1 -1
  48. package/dist/tools/cache.js.map +1 -1
  49. package/dist/tools/comments.d.ts.map +1 -1
  50. package/dist/tools/comments.js.map +1 -1
  51. package/dist/tools/performance.d.ts.map +1 -1
  52. package/dist/tools/performance.js.map +1 -1
  53. package/dist/tools/posts/PostHandlers.d.ts.map +1 -1
  54. package/dist/tools/posts/PostHandlers.js.map +1 -1
  55. package/dist/tools/seo/SEOTools.d.ts.map +1 -1
  56. package/dist/tools/seo/SEOTools.js.map +1 -1
  57. package/dist/tools/seo/analyzers/ContentAnalyzer.d.ts.map +1 -1
  58. package/dist/tools/seo/analyzers/ContentAnalyzer.js.map +1 -1
  59. package/dist/types/enhanced.d.ts +17 -17
  60. package/dist/types/enhanced.d.ts.map +1 -1
  61. package/dist/types/enhanced.js +2 -2
  62. package/dist/types/index.d.ts +2 -2
  63. package/dist/types/index.d.ts.map +1 -1
  64. package/dist/types/requests.d.ts +16 -16
  65. package/dist/types/tools.d.ts +46 -46
  66. package/dist/types/tools.d.ts.map +1 -1
  67. package/dist/utils/index.d.ts +7 -7
  68. package/dist/utils/index.js +7 -7
  69. package/docs/ARCHITECTURE.md +17 -17
  70. package/docs/BADGE_UPDATES.md +11 -11
  71. package/docs/CACHING.md +2 -0
  72. package/docs/CI_CD_IMPROVEMENTS.md +8 -5
  73. package/docs/CONFIGURATION.md +76 -46
  74. package/docs/DOCKER_PUBLISHING_TROUBLESHOOTING.md +11 -2
  75. package/docs/EVALUATION.md +16 -21
  76. package/docs/INCREMENTAL_COVERAGE.md +7 -3
  77. package/docs/INSTALLATION.md +33 -19
  78. package/docs/PUBLISHING-TROUBLESHOOTING.md +3 -2
  79. package/docs/SECURITY.md +17 -15
  80. package/docs/SECURITY_TESTING.md +3 -0
  81. package/docs/TROUBLESHOOTING.md +85 -36
  82. package/docs/api/README.md +118 -125
  83. package/docs/api/categories/auth.md +3 -1
  84. package/docs/api/categories/cache.md +3 -1
  85. package/docs/api/categories/comment.md +3 -1
  86. package/docs/api/categories/media.md +3 -1
  87. package/docs/api/categories/page.md +3 -1
  88. package/docs/api/categories/performance.md +3 -1
  89. package/docs/api/categories/post.md +3 -1
  90. package/docs/api/categories/site.md +3 -1
  91. package/docs/api/categories/taxonomy.md +3 -1
  92. package/docs/api/categories/user.md +3 -1
  93. package/docs/api/openapi.json +114 -410
  94. package/docs/api/summary.json +1 -1
  95. package/docs/api/tools/wp_approve_comment.md +13 -25
  96. package/docs/api/tools/wp_cache_clear.md +17 -30
  97. package/docs/api/tools/wp_cache_info.md +16 -29
  98. package/docs/api/tools/wp_cache_stats.md +16 -29
  99. package/docs/api/tools/wp_cache_warm.md +16 -29
  100. package/docs/api/tools/wp_create_application_password.md +14 -26
  101. package/docs/api/tools/wp_create_category.md +14 -26
  102. package/docs/api/tools/wp_create_comment.md +18 -31
  103. package/docs/api/tools/wp_create_page.md +17 -29
  104. package/docs/api/tools/wp_create_post.md +25 -30
  105. package/docs/api/tools/wp_create_tag.md +13 -25
  106. package/docs/api/tools/wp_create_user.md +18 -30
  107. package/docs/api/tools/wp_delete_application_password.md +14 -26
  108. package/docs/api/tools/wp_delete_category.md +13 -25
  109. package/docs/api/tools/wp_delete_comment.md +14 -26
  110. package/docs/api/tools/wp_delete_media.md +14 -25
  111. package/docs/api/tools/wp_delete_page.md +14 -25
  112. package/docs/api/tools/wp_delete_post.md +17 -25
  113. package/docs/api/tools/wp_delete_tag.md +13 -25
  114. package/docs/api/tools/wp_delete_user.md +14 -25
  115. package/docs/api/tools/wp_get_application_passwords.md +13 -25
  116. package/docs/api/tools/wp_get_auth_status.md +12 -24
  117. package/docs/api/tools/wp_get_category.md +13 -25
  118. package/docs/api/tools/wp_get_comment.md +13 -25
  119. package/docs/api/tools/wp_get_current_user.md +17 -30
  120. package/docs/api/tools/wp_get_media.md +13 -25
  121. package/docs/api/tools/wp_get_page.md +13 -25
  122. package/docs/api/tools/wp_get_page_revisions.md +13 -25
  123. package/docs/api/tools/wp_get_post.md +16 -25
  124. package/docs/api/tools/wp_get_post_revisions.md +13 -25
  125. package/docs/api/tools/wp_get_site_settings.md +12 -23
  126. package/docs/api/tools/wp_get_tag.md +13 -25
  127. package/docs/api/tools/wp_get_user.md +13 -25
  128. package/docs/api/tools/wp_list_categories.md +15 -27
  129. package/docs/api/tools/wp_list_comments.md +15 -27
  130. package/docs/api/tools/wp_list_media.md +18 -31
  131. package/docs/api/tools/wp_list_pages.md +18 -31
  132. package/docs/api/tools/wp_list_posts.md +29 -41
  133. package/docs/api/tools/wp_list_tags.md +14 -26
  134. package/docs/api/tools/wp_list_users.md +20 -34
  135. package/docs/api/tools/wp_performance_alerts.md +22 -36
  136. package/docs/api/tools/wp_performance_benchmark.md +20 -34
  137. package/docs/api/tools/wp_performance_export.md +22 -36
  138. package/docs/api/tools/wp_performance_history.md +21 -35
  139. package/docs/api/tools/wp_performance_optimize.md +22 -36
  140. package/docs/api/tools/wp_performance_stats.md +20 -34
  141. package/docs/api/tools/wp_search_site.md +18 -32
  142. package/docs/api/tools/wp_spam_comment.md +13 -25
  143. package/docs/api/tools/wp_switch_auth_method.md +18 -31
  144. package/docs/api/tools/wp_test_auth.md +15 -30
  145. package/docs/api/tools/wp_update_category.md +14 -26
  146. package/docs/api/tools/wp_update_comment.md +17 -30
  147. package/docs/api/tools/wp_update_media.md +19 -32
  148. package/docs/api/tools/wp_update_page.md +18 -30
  149. package/docs/api/tools/wp_update_post.md +21 -30
  150. package/docs/api/tools/wp_update_site_settings.md +18 -31
  151. package/docs/api/tools/wp_update_tag.md +14 -26
  152. package/docs/api/tools/wp_update_user.md +17 -29
  153. package/docs/api/tools/wp_upload_media.md +20 -32
  154. package/docs/api/types/WordPressPost.md +8 -15
  155. package/docs/code-improvements.md +1 -0
  156. package/docs/developer/GITHUB_ACTIONS_SETUP.md +2 -2
  157. package/docs/developer/MAINTENANCE.md +4 -0
  158. package/docs/developer/NPM_AUTH_SETUP.md +3 -0
  159. package/docs/developer/RELEASE_PROCESS.md +1 -0
  160. package/docs/examples/multi-site-setup.md +2 -0
  161. package/docs/integrations/claude-desktop.md +14 -5
  162. package/docs/integrations/cline.md +1 -0
  163. package/docs/user-guides/DTX_SETUP.md +9 -8
  164. package/docs/user-guides/NPX_SETUP.md +5 -9
  165. package/docs/user-guides/SMITHERY_SETUP.md +5 -0
  166. package/docs/v2.2.0-resolution-demo.md +17 -2
  167. package/package.json +2 -1
  168. package/src/cache/__tests__/CacheManager.test.ts +4 -8
  169. package/src/client/MockWordPressClient.ts +5 -1
  170. package/src/client/SEOWordPressClient.ts +30 -26
  171. package/src/client/index.ts +6 -6
  172. package/src/client/managers/AuthManager.ts +16 -8
  173. package/src/client/managers/AuthenticationManager.ts +2 -2
  174. package/src/client/managers/JWTAuthImplementation.ts +24 -27
  175. package/src/client/managers/ManagersIndex.ts +1 -1
  176. package/src/client/managers/composed/MigrationAdapter.ts +1 -1
  177. package/src/client/managers/composed/index.ts +7 -7
  178. package/src/client/managers/implementations/ErrorHandlerImpl.ts +12 -26
  179. package/src/client/managers/implementations/ParameterValidatorImpl.ts +49 -49
  180. package/src/client/managers/interfaces/ManagerInterfaces.ts +13 -9
  181. package/src/config/index.ts +3 -3
  182. package/src/docs/MarkdownFormatter.ts +13 -9
  183. package/src/performance/PerformanceAnalytics.ts +9 -3
  184. package/src/security/InputValidator.ts +1 -1
  185. package/src/security/SecurityCIPipeline.ts +1 -1
  186. package/src/security/SecurityConfig.ts +9 -3
  187. package/src/server/index.ts +2 -2
  188. package/src/tools/cache.ts +3 -1
  189. package/src/tools/comments.ts +3 -1
  190. package/src/tools/performance.ts +7 -3
  191. package/src/tools/posts/PostHandlers.ts +3 -1
  192. package/src/tools/seo/SEOTools.ts +6 -2
  193. package/src/tools/seo/analyzers/ContentAnalyzer.ts +9 -3
  194. package/src/types/enhanced.ts +34 -34
  195. package/src/types/index.ts +13 -11
  196. package/src/types/requests.ts +19 -19
  197. package/src/types/tools.ts +137 -84
  198. package/src/utils/index.ts +7 -7
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  // Connection Testing
7
- export { ConnectionTester } from './ConnectionTester.js';
7
+ export { ConnectionTester } from "./ConnectionTester.js";
8
8
 
9
9
  // Tool Registry Management
10
- export { ToolRegistry } from './ToolRegistry.js';
10
+ export { ToolRegistry } from "./ToolRegistry.js";
@@ -236,7 +236,9 @@ export class CacheTools {
236
236
  throw new Error("No WordPress sites configured.");
237
237
  } else {
238
238
  throw new Error(
239
- `Multiple sites configured. Please specify --site parameter. Available sites: ${Array.from(this.clients.keys()).join(", ")}`,
239
+ `Multiple sites configured. Please specify --site parameter. Available sites: ${Array.from(
240
+ this.clients.keys(),
241
+ ).join(", ")}`,
240
242
  );
241
243
  }
242
244
  }
@@ -168,7 +168,9 @@ export class CommentTools {
168
168
  comments
169
169
  .map(
170
170
  (c) =>
171
- `- ID ${c.id}: By **${c.author_name}** on Post ${c.post} (${c.status})\n > ${c.content.rendered.substring(0, 100)}...`,
171
+ `- ID ${c.id}: By **${c.author_name}** on Post ${c.post} (${
172
+ c.status
173
+ })\n > ${c.content.rendered.substring(0, 100)}...`,
172
174
  )
173
175
  .join("\n");
174
176
  return content;
@@ -39,7 +39,7 @@ export default class PerformanceTools {
39
39
  constructor(clients?: Map<string, unknown>) {
40
40
  // Initialize logger first
41
41
  this.logger = LoggerFactory.performance();
42
-
42
+
43
43
  // Initialize performance monitoring system
44
44
  this.monitor = new PerformanceMonitor({
45
45
  enableRealTimeMonitoring: true,
@@ -944,12 +944,16 @@ export default class PerformanceTools {
944
944
  }
945
945
 
946
946
  private formatAlertMessage(alert: PerformanceAlert): string {
947
- return `${alert.severity.toUpperCase()}: ${alert.message} (${alert.metric}: ${alert.actualValue} vs threshold: ${alert.threshold})`;
947
+ return `${alert.severity.toUpperCase()}: ${alert.message} (${alert.metric}: ${alert.actualValue} vs threshold: ${
948
+ alert.threshold
949
+ })`;
948
950
  }
949
951
 
950
952
  private formatAnomalyDescription(anomaly: PerformanceAnomaly): string {
951
953
  const direction = anomaly.actualValue > anomaly.expectedValue ? "higher" : "lower";
952
- return `${anomaly.metric} is ${Math.abs(anomaly.deviation).toFixed(1)}% ${direction} than expected (${anomaly.expectedValue.toFixed(2)} vs ${anomaly.actualValue.toFixed(2)})`;
954
+ return `${anomaly.metric} is ${Math.abs(anomaly.deviation).toFixed(
955
+ 1,
956
+ )}% ${direction} than expected (${anomaly.expectedValue.toFixed(2)} vs ${anomaly.actualValue.toFixed(2)})`;
953
957
  }
954
958
 
955
959
  private calculateAlertStatus(
@@ -204,7 +204,9 @@ export async function handleListPosts(
204
204
  // Add pagination guidance for large result sets
205
205
  let finalContent = content;
206
206
  if (posts.length >= (sanitizedParams.per_page || 10)) {
207
- finalContent += `\n\n📄 **Pagination Tip**: Use \`per_page\` parameter to control results (max 100). Current: ${sanitizedParams.per_page || 10}`;
207
+ finalContent += `\n\n📄 **Pagination Tip**: Use \`per_page\` parameter to control results (max 100). Current: ${
208
+ sanitizedParams.per_page || 10
209
+ }`;
208
210
  }
209
211
 
210
212
  return finalContent;
@@ -852,7 +852,9 @@ export class SEOTools {
852
852
  const titlePercentage = analysis.postsWithSEO > 0 ? (analysis.postsWithTitles / analysis.postsWithSEO) * 100 : 0;
853
853
  if (titlePercentage < 80) {
854
854
  analysis.recommendations.push(
855
- `${Math.round(100 - titlePercentage)}% of SEO-enabled posts lack custom titles. Add SEO titles for better search visibility.`,
855
+ `${Math.round(
856
+ 100 - titlePercentage,
857
+ )}% of SEO-enabled posts lack custom titles. Add SEO titles for better search visibility.`,
856
858
  );
857
859
  }
858
860
 
@@ -860,7 +862,9 @@ export class SEOTools {
860
862
  analysis.postsWithSEO > 0 ? (analysis.postsWithDescriptions / analysis.postsWithSEO) * 100 : 0;
861
863
  if (descPercentage < 80) {
862
864
  analysis.recommendations.push(
863
- `${Math.round(100 - descPercentage)}% of SEO-enabled posts lack meta descriptions. Add descriptions to improve click-through rates.`,
865
+ `${Math.round(
866
+ 100 - descPercentage,
867
+ )}% of SEO-enabled posts lack meta descriptions. Add descriptions to improve click-through rates.`,
864
868
  );
865
869
  }
866
870
 
@@ -179,7 +179,9 @@ export class ContentAnalyzer {
179
179
  recommendations.push({
180
180
  type: "content",
181
181
  priority: "medium",
182
- message: `Content readability is low (${metrics.fleschReadingEase.toFixed(1)}). Consider using shorter sentences and simpler words.`,
182
+ message: `Content readability is low (${metrics.fleschReadingEase.toFixed(
183
+ 1,
184
+ )}). Consider using shorter sentences and simpler words.`,
183
185
  impact: 60,
184
186
  autoFixAvailable: false,
185
187
  suggestedFix: "Break up long sentences and use more common vocabulary.",
@@ -195,7 +197,9 @@ export class ContentAnalyzer {
195
197
  recommendations.push({
196
198
  type: "keyword",
197
199
  priority: "medium",
198
- message: `Focus keyword density is low (${metrics.keywordDensity.toFixed(1)}%). Consider adding the keyword "${params.focusKeywords[0]}" more naturally throughout the content.`,
200
+ message: `Focus keyword density is low (${metrics.keywordDensity.toFixed(
201
+ 1,
202
+ )}%). Consider adding the keyword "${params.focusKeywords[0]}" more naturally throughout the content.`,
199
203
  impact: 70,
200
204
  autoFixAvailable: false,
201
205
  });
@@ -203,7 +207,9 @@ export class ContentAnalyzer {
203
207
  recommendations.push({
204
208
  type: "keyword",
205
209
  priority: "medium",
206
- message: `Focus keyword density is too high (${metrics.keywordDensity.toFixed(1)}%). This might be considered keyword stuffing.`,
210
+ message: `Focus keyword density is too high (${metrics.keywordDensity.toFixed(
211
+ 1,
212
+ )}%). This might be considered keyword stuffing.`,
207
213
  impact: 75,
208
214
  autoFixAvailable: false,
209
215
  suggestedFix: `Reduce keyword usage to around ${targetDensity}%`,
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Enhanced TypeScript Types for MCP WordPress
3
- *
3
+ *
4
4
  * This file provides stronger typing, utility types, and generic constraints
5
5
  * to improve type safety throughout the codebase.
6
6
  */
@@ -13,22 +13,22 @@ export type DeepReadonly<T> = {
13
13
  readonly [P in keyof T]: T[P] extends (infer U)[]
14
14
  ? DeepReadonlyArray<U>
15
15
  : T[P] extends readonly (infer U)[]
16
- ? DeepReadonlyArray<U>
17
- : T[P] extends object
18
- ? DeepReadonly<T[P]>
19
- : T[P];
16
+ ? DeepReadonlyArray<U>
17
+ : T[P] extends object
18
+ ? DeepReadonly<T[P]>
19
+ : T[P];
20
20
  };
21
21
 
22
22
  interface DeepReadonlyArray<T> extends ReadonlyArray<DeepReadonly<T>> {}
23
23
 
24
24
  // Branded Types for Domain-Specific Values
25
- export type WordPressId = number & { readonly __brand: 'WordPressId' };
26
- export type UserId = number & { readonly __brand: 'UserId' };
27
- export type PostId = number & { readonly __brand: 'PostId' };
28
- export type MediaId = number & { readonly __brand: 'MediaId' };
29
- export type CommentId = number & { readonly __brand: 'CommentId' };
30
- export type CategoryId = number & { readonly __brand: 'CategoryId' };
31
- export type TagId = number & { readonly __brand: 'TagId' };
25
+ export type WordPressId = number & { readonly __brand: "WordPressId" };
26
+ export type UserId = number & { readonly __brand: "UserId" };
27
+ export type PostId = number & { readonly __brand: "PostId" };
28
+ export type MediaId = number & { readonly __brand: "MediaId" };
29
+ export type CommentId = number & { readonly __brand: "CommentId" };
30
+ export type CategoryId = number & { readonly __brand: "CategoryId" };
31
+ export type TagId = number & { readonly __brand: "TagId" };
32
32
 
33
33
  // Helper functions to create branded types
34
34
  export const createWordPressId = (id: number): WordPressId => {
@@ -46,7 +46,7 @@ export const createCategoryId = (id: number): CategoryId => id as CategoryId;
46
46
  export const createTagId = (id: number): TagId => id as TagId;
47
47
 
48
48
  // Strict URL type
49
- export type WordPressURL = string & { readonly __brand: 'WordPressURL' };
49
+ export type WordPressURL = string & { readonly __brand: "WordPressURL" };
50
50
  export const createWordPressURL = (url: string): WordPressURL => {
51
51
  try {
52
52
  new URL(url);
@@ -64,13 +64,13 @@ export interface TypedError<TCode extends string = string> extends Error {
64
64
  readonly context?: Record<string, unknown>;
65
65
  }
66
66
 
67
- export interface ValidationError extends TypedError<'VALIDATION_ERROR'> {
67
+ export interface ValidationError extends TypedError<"VALIDATION_ERROR"> {
68
68
  readonly field: string;
69
69
  readonly value: unknown;
70
70
  readonly constraint: string;
71
71
  }
72
72
 
73
- export interface APIError extends TypedError<'API_ERROR'> {
73
+ export interface APIError extends TypedError<"API_ERROR"> {
74
74
  readonly endpoint: string;
75
75
  readonly method: string;
76
76
  readonly statusCode: number;
@@ -108,7 +108,7 @@ export interface RequestConfig {
108
108
  }
109
109
 
110
110
  export interface HTTPRequestOptions extends RequestConfig {
111
- readonly method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
111
+ readonly method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
112
112
  readonly url: WordPressURL;
113
113
  readonly data?: unknown;
114
114
  readonly params?: DeepReadonly<Record<string, string | number | boolean>>;
@@ -135,7 +135,7 @@ export interface ToolResult<TData = unknown> {
135
135
 
136
136
  export type ToolHandler<TInput, TOutput> = (
137
137
  input: DeepReadonly<TInput>,
138
- context: DeepReadonly<ToolContext>
138
+ context: DeepReadonly<ToolContext>,
139
139
  ) => Promise<ToolResult<TOutput>>;
140
140
 
141
141
  // Cache Types with Enhanced Type Safety
@@ -156,7 +156,7 @@ export interface CacheEntry<TData> {
156
156
  export interface CacheOptions {
157
157
  readonly ttl: number;
158
158
  readonly tags?: readonly string[];
159
- readonly priority?: 'low' | 'medium' | 'high';
159
+ readonly priority?: "low" | "medium" | "high";
160
160
  }
161
161
 
162
162
  // Configuration Types with Better Validation
@@ -165,7 +165,7 @@ export interface StrictSiteConfig {
165
165
  readonly name: string;
166
166
  readonly url: WordPressURL;
167
167
  readonly auth: DeepReadonly<{
168
- readonly method: 'app-password' | 'jwt' | 'basic' | 'api-key';
168
+ readonly method: "app-password" | "jwt" | "basic" | "api-key";
169
169
  readonly username: string;
170
170
  readonly password: string;
171
171
  }>;
@@ -193,7 +193,7 @@ export interface PerformanceThresholds {
193
193
 
194
194
  // Type Guards for Runtime Validation
195
195
  export const isWordPressId = (value: unknown): value is WordPressId => {
196
- return typeof value === 'number' && Number.isInteger(value) && value > 0;
196
+ return typeof value === "number" && Number.isInteger(value) && value > 0;
197
197
  };
198
198
 
199
199
  export const isNonEmptyArray = <T>(value: unknown): value is NonEmptyArray<T> => {
@@ -201,7 +201,7 @@ export const isNonEmptyArray = <T>(value: unknown): value is NonEmptyArray<T> =>
201
201
  };
202
202
 
203
203
  export const isValidURL = (value: unknown): value is WordPressURL => {
204
- if (typeof value !== 'string') return false;
204
+ if (typeof value !== "string") return false;
205
205
  try {
206
206
  new URL(value);
207
207
  return true;
@@ -216,7 +216,7 @@ export type OptionalFields<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T,
216
216
 
217
217
  // JSON Schema Type Definitions
218
218
  export interface JSONSchemaDefinition {
219
- readonly type: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'null';
219
+ readonly type: "string" | "number" | "boolean" | "object" | "array" | "null";
220
220
  readonly description?: string;
221
221
  readonly required?: boolean;
222
222
  readonly enum?: readonly (string | number)[];
@@ -225,21 +225,21 @@ export interface JSONSchemaDefinition {
225
225
  readonly minLength?: number;
226
226
  readonly maxLength?: number;
227
227
  readonly pattern?: string;
228
- readonly format?: 'email' | 'uri' | 'date-time' | 'date' | 'time';
228
+ readonly format?: "email" | "uri" | "date-time" | "date" | "time";
229
229
  readonly items?: JSONSchemaDefinition;
230
230
  readonly properties?: DeepReadonly<Record<string, JSONSchemaDefinition>>;
231
231
  }
232
232
 
233
233
  // Enhanced MCP Tool Schema
234
234
  export interface StrictMCPToolSchema {
235
- readonly type: 'object';
235
+ readonly type: "object";
236
236
  readonly properties: DeepReadonly<Record<string, JSONSchemaDefinition>>;
237
237
  readonly required: readonly string[];
238
238
  readonly additionalProperties: false;
239
239
  }
240
240
 
241
241
  // Result Types for Better Error Handling
242
- export type Result<TSuccess, TError = Error> =
242
+ export type Result<TSuccess, TError = Error> =
243
243
  | { readonly success: true; readonly data: TSuccess }
244
244
  | { readonly success: false; readonly error: TError };
245
245
 
@@ -298,14 +298,14 @@ export interface ConfigValidationResult {
298
298
  }
299
299
 
300
300
  // Performance Monitoring Event Types
301
- export type PerformanceEventType =
302
- | 'request_started'
303
- | 'request_completed'
304
- | 'request_failed'
305
- | 'cache_hit'
306
- | 'cache_miss'
307
- | 'auth_success'
308
- | 'auth_failure';
301
+ export type PerformanceEventType =
302
+ | "request_started"
303
+ | "request_completed"
304
+ | "request_failed"
305
+ | "cache_hit"
306
+ | "cache_miss"
307
+ | "auth_success"
308
+ | "auth_failure";
309
309
 
310
310
  export interface PerformanceEvent extends DomainEvent<PerformanceEventType> {
311
311
  readonly payload: {
@@ -315,4 +315,4 @@ export interface PerformanceEvent extends DomainEvent<PerformanceEventType> {
315
315
  readonly cacheKey?: string;
316
316
  readonly userId?: UserId;
317
317
  };
318
- }
318
+ }
@@ -14,13 +14,13 @@ export * from "./mcp.js";
14
14
  export * from "./client.js";
15
15
 
16
16
  // Enhanced Types (New) - Selective exports to avoid conflicts
17
- export type {
18
- WordPressId,
19
- PostId,
20
- UserId,
21
- MediaId,
22
- CommentId,
23
- CategoryId,
17
+ export type {
18
+ WordPressId,
19
+ PostId,
20
+ UserId,
21
+ MediaId,
22
+ CommentId,
23
+ CategoryId,
24
24
  TagId,
25
25
  Result,
26
26
  DeepReadonly,
@@ -28,14 +28,14 @@ export type {
28
28
  NonEmptyArray,
29
29
  createWordPressId,
30
30
  createSuccess,
31
- createError
31
+ createError,
32
32
  } from "./enhanced.js";
33
33
 
34
34
  // Request Types (New)
35
35
  export * from "./requests.js";
36
36
 
37
37
  // Tool Types (New) - Selective exports to avoid conflicts
38
- export type {
38
+ export type {
39
39
  BaseToolParams,
40
40
  CreatePostParams,
41
41
  UpdatePostParams,
@@ -48,7 +48,7 @@ export type {
48
48
  ListPagesParams,
49
49
  DeletePageParams,
50
50
  ToolDefinition as EnhancedToolDefinition,
51
- ToolRegistry as EnhancedToolRegistry
51
+ ToolRegistry as EnhancedToolRegistry,
52
52
  } from "./tools.js";
53
53
 
54
54
  // Common Utility Types
@@ -237,7 +237,9 @@ export type CategoryID = Brand<number, "CategoryID">;
237
237
  export type TagID = Brand<number, "TagID">;
238
238
 
239
239
  // Function Types
240
- export type AsyncFunction<TArgs extends unknown[] = unknown[], TReturn = unknown> = (...args: TArgs) => Promise<TReturn>;
240
+ export type AsyncFunction<TArgs extends unknown[] = unknown[], TReturn = unknown> = (
241
+ ...args: TArgs
242
+ ) => Promise<TReturn>;
241
243
  export type SyncFunction<TArgs extends unknown[] = unknown[], TReturn = unknown> = (...args: TArgs) => TReturn;
242
244
  export type AnyFunction<TArgs extends unknown[] = unknown[], TReturn = unknown> =
243
245
  | SyncFunction<TArgs, TReturn>
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  * Enhanced Request Types for WordPress API Client
3
- *
4
- * This file provides strongly-typed request interfaces to replace
3
+ *
4
+ * This file provides strongly-typed request interfaces to replace
5
5
  * loose typing throughout the codebase.
6
6
  */
7
7
 
8
- import type { DeepReadonly } from './enhanced.js';
8
+ import type { DeepReadonly } from "./enhanced.js";
9
9
 
10
10
  // Generic HTTP Request Structure
11
11
  export interface HTTPRequestConfig {
12
- readonly method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
12
+ readonly method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
13
13
  readonly url: string;
14
14
  readonly headers?: DeepReadonly<Record<string, string>>;
15
15
  readonly timeout?: number;
@@ -32,7 +32,7 @@ export interface QueuedRequest {
32
32
  readonly id: string;
33
33
  readonly config: HTTPRequestFull;
34
34
  readonly timestamp: Date;
35
- readonly priority: 'low' | 'medium' | 'high';
35
+ readonly priority: "low" | "medium" | "high";
36
36
  readonly retries: number;
37
37
  readonly maxRetries: number;
38
38
  }
@@ -84,7 +84,7 @@ export interface ErrorResponse {
84
84
 
85
85
  // Authentication Request Types
86
86
  export interface AuthenticationRequest {
87
- readonly method: 'app-password' | 'jwt' | 'basic' | 'api-key' | 'cookie';
87
+ readonly method: "app-password" | "jwt" | "basic" | "api-key" | "cookie";
88
88
  readonly credentials: DeepReadonly<{
89
89
  readonly username?: string;
90
90
  readonly password?: string;
@@ -108,11 +108,11 @@ export interface AuthenticationResponse {
108
108
 
109
109
  // WordPress Specific Request Types
110
110
  export interface WordPressQueryParams {
111
- readonly context?: 'view' | 'embed' | 'edit';
111
+ readonly context?: "view" | "embed" | "edit";
112
112
  readonly page?: number;
113
113
  readonly per_page?: number;
114
114
  readonly search?: string;
115
- readonly order?: 'asc' | 'desc';
115
+ readonly order?: "asc" | "desc";
116
116
  readonly orderby?: string;
117
117
  readonly offset?: number;
118
118
  readonly include?: readonly number[];
@@ -137,14 +137,14 @@ export interface PostSpecificParams extends WordPressQueryParams {
137
137
  export interface MediaSpecificParams extends WordPressQueryParams {
138
138
  readonly parent?: number;
139
139
  readonly parent_exclude?: readonly number[];
140
- readonly media_type?: 'image' | 'video' | 'text' | 'application' | 'audio';
140
+ readonly media_type?: "image" | "video" | "text" | "application" | "audio";
141
141
  readonly mime_type?: string;
142
142
  }
143
143
 
144
144
  export interface UserSpecificParams extends WordPressQueryParams {
145
145
  readonly roles?: readonly string[];
146
146
  readonly capabilities?: readonly string[];
147
- readonly who?: 'authors';
147
+ readonly who?: "authors";
148
148
  readonly has_published_posts?: readonly string[];
149
149
  }
150
150
 
@@ -153,14 +153,14 @@ export interface CommentSpecificParams extends WordPressQueryParams {
153
153
  readonly parent?: readonly number[];
154
154
  readonly parent_exclude?: readonly number[];
155
155
  readonly post?: readonly number[];
156
- readonly type?: 'comment' | 'trackback' | 'pingback';
156
+ readonly type?: "comment" | "trackback" | "pingback";
157
157
  readonly password?: string;
158
158
  }
159
159
 
160
160
  // Batch Request Types
161
161
  export interface BatchOperation<TParams = unknown> {
162
162
  readonly id: string;
163
- readonly method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
163
+ readonly method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
164
164
  readonly endpoint: string;
165
165
  readonly params?: TParams;
166
166
  readonly data?: unknown;
@@ -222,7 +222,7 @@ export interface PaginatedResponse<TData> {
222
222
  // Search Request Types
223
223
  export interface SearchRequest {
224
224
  readonly query: string;
225
- readonly type?: readonly ('post' | 'page' | 'attachment' | 'user' | 'comment')[];
225
+ readonly type?: readonly ("post" | "page" | "attachment" | "user" | "comment")[];
226
226
  readonly subtype?: readonly string[];
227
227
  readonly include?: readonly number[];
228
228
  readonly exclude?: readonly number[];
@@ -253,7 +253,7 @@ export interface UploadRequest {
253
253
  readonly description?: string;
254
254
  readonly post?: number;
255
255
  readonly author?: number;
256
- readonly status?: 'publish' | 'future' | 'draft' | 'pending' | 'private';
256
+ readonly status?: "publish" | "future" | "draft" | "pending" | "private";
257
257
  readonly date?: string;
258
258
  readonly date_gmt?: string;
259
259
  }
@@ -292,7 +292,7 @@ export interface RateLimitState {
292
292
  }
293
293
 
294
294
  export interface RateLimitedRequest extends HTTPRequestFull {
295
- readonly priority: 'low' | 'medium' | 'high';
295
+ readonly priority: "low" | "medium" | "high";
296
296
  readonly rateLimitKey?: string;
297
297
  }
298
298
 
@@ -300,7 +300,7 @@ export interface RateLimitedRequest extends HTTPRequestFull {
300
300
  export interface CacheableRequest extends HTTPRequestConfig {
301
301
  readonly cacheKey?: string;
302
302
  readonly cacheTTL?: number;
303
- readonly cacheStrategy?: 'cache-first' | 'network-first' | 'cache-only' | 'network-only';
303
+ readonly cacheStrategy?: "cache-first" | "network-first" | "cache-only" | "network-only";
304
304
  readonly invalidateCache?: boolean;
305
305
  readonly cacheTags?: readonly string[];
306
306
  }
@@ -338,7 +338,7 @@ export interface HealthCheckRequest {
338
338
  }
339
339
 
340
340
  export interface HealthCheckResponse {
341
- readonly status: 'healthy' | 'degraded' | 'unhealthy';
341
+ readonly status: "healthy" | "degraded" | "unhealthy";
342
342
  readonly responseTime: number;
343
343
  readonly statusCode: number;
344
344
  readonly timestamp: Date;
@@ -353,7 +353,7 @@ export interface HealthCheckResponse {
353
353
  export interface RequestValidationRule {
354
354
  readonly field: string;
355
355
  readonly required: boolean;
356
- readonly type: 'string' | 'number' | 'boolean' | 'array' | 'object';
356
+ readonly type: "string" | "number" | "boolean" | "array" | "object";
357
357
  readonly minLength?: number;
358
358
  readonly maxLength?: number;
359
359
  readonly pattern?: RegExp;
@@ -375,4 +375,4 @@ export interface RequestValidationResult {
375
375
  readonly code: string;
376
376
  }[];
377
377
  readonly sanitizedData?: unknown;
378
- }
378
+ }