mcp-wordpress 2.5.1 → 2.5.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 (289) hide show
  1. package/package.json +1 -1
  2. package/dist/src/cache/CacheInvalidation.d.ts +0 -120
  3. package/dist/src/cache/CacheInvalidation.d.ts.map +0 -1
  4. package/dist/src/cache/CacheInvalidation.js +0 -355
  5. package/dist/src/cache/CacheInvalidation.js.map +0 -1
  6. package/dist/src/cache/CacheManager.d.ts +0 -149
  7. package/dist/src/cache/CacheManager.d.ts.map +0 -1
  8. package/dist/src/cache/CacheManager.js +0 -326
  9. package/dist/src/cache/CacheManager.js.map +0 -1
  10. package/dist/src/cache/HttpCacheWrapper.d.ts +0 -122
  11. package/dist/src/cache/HttpCacheWrapper.d.ts.map +0 -1
  12. package/dist/src/cache/HttpCacheWrapper.js +0 -283
  13. package/dist/src/cache/HttpCacheWrapper.js.map +0 -1
  14. package/dist/src/cache/index.d.ts +0 -12
  15. package/dist/src/cache/index.d.ts.map +0 -1
  16. package/dist/src/cache/index.js +0 -9
  17. package/dist/src/cache/index.js.map +0 -1
  18. package/dist/src/client/CachedWordPressClient.d.ts +0 -174
  19. package/dist/src/client/CachedWordPressClient.d.ts.map +0 -1
  20. package/dist/src/client/CachedWordPressClient.js +0 -345
  21. package/dist/src/client/CachedWordPressClient.js.map +0 -1
  22. package/dist/src/client/MockWordPressClient.d.ts +0 -56
  23. package/dist/src/client/MockWordPressClient.d.ts.map +0 -1
  24. package/dist/src/client/MockWordPressClient.js +0 -371
  25. package/dist/src/client/MockWordPressClient.js.map +0 -1
  26. package/dist/src/client/api.d.ts +0 -235
  27. package/dist/src/client/api.d.ts.map +0 -1
  28. package/dist/src/client/api.js +0 -896
  29. package/dist/src/client/api.js.map +0 -1
  30. package/dist/src/client/auth.d.ts +0 -121
  31. package/dist/src/client/auth.d.ts.map +0 -1
  32. package/dist/src/client/auth.js +0 -429
  33. package/dist/src/client/auth.js.map +0 -1
  34. package/dist/src/client/managers/AuthenticationManager.d.ts +0 -92
  35. package/dist/src/client/managers/AuthenticationManager.d.ts.map +0 -1
  36. package/dist/src/client/managers/AuthenticationManager.js +0 -369
  37. package/dist/src/client/managers/AuthenticationManager.js.map +0 -1
  38. package/dist/src/client/managers/BaseManager.d.ts +0 -22
  39. package/dist/src/client/managers/BaseManager.d.ts.map +0 -1
  40. package/dist/src/client/managers/BaseManager.js +0 -53
  41. package/dist/src/client/managers/BaseManager.js.map +0 -1
  42. package/dist/src/client/managers/RequestManager.d.ts +0 -47
  43. package/dist/src/client/managers/RequestManager.d.ts.map +0 -1
  44. package/dist/src/client/managers/RequestManager.js +0 -193
  45. package/dist/src/client/managers/RequestManager.js.map +0 -1
  46. package/dist/src/client/managers/index.d.ts +0 -8
  47. package/dist/src/client/managers/index.d.ts.map +0 -1
  48. package/dist/src/client/managers/index.js +0 -8
  49. package/dist/src/client/managers/index.js.map +0 -1
  50. package/dist/src/config/Config.d.ts +0 -155
  51. package/dist/src/config/Config.d.ts.map +0 -1
  52. package/dist/src/config/Config.js +0 -215
  53. package/dist/src/config/Config.js.map +0 -1
  54. package/dist/src/config/ConfigurationSchema.d.ts +0 -281
  55. package/dist/src/config/ConfigurationSchema.d.ts.map +0 -1
  56. package/dist/src/config/ConfigurationSchema.js +0 -205
  57. package/dist/src/config/ConfigurationSchema.js.map +0 -1
  58. package/dist/src/config/ServerConfiguration.d.ts +0 -47
  59. package/dist/src/config/ServerConfiguration.d.ts.map +0 -1
  60. package/dist/src/config/ServerConfiguration.js +0 -255
  61. package/dist/src/config/ServerConfiguration.js.map +0 -1
  62. package/dist/src/docs/DocumentationGenerator.d.ts +0 -185
  63. package/dist/src/docs/DocumentationGenerator.d.ts.map +0 -1
  64. package/dist/src/docs/DocumentationGenerator.js +0 -777
  65. package/dist/src/docs/DocumentationGenerator.js.map +0 -1
  66. package/dist/src/docs/MarkdownFormatter.d.ts +0 -84
  67. package/dist/src/docs/MarkdownFormatter.d.ts.map +0 -1
  68. package/dist/src/docs/MarkdownFormatter.js +0 -458
  69. package/dist/src/docs/MarkdownFormatter.js.map +0 -1
  70. package/dist/src/docs/index.d.ts +0 -8
  71. package/dist/src/docs/index.d.ts.map +0 -1
  72. package/dist/src/docs/index.js +0 -7
  73. package/dist/src/docs/index.js.map +0 -1
  74. package/dist/src/dxt-entry.d.ts +0 -6
  75. package/dist/src/dxt-entry.d.ts.map +0 -1
  76. package/dist/src/dxt-entry.js +0 -39
  77. package/dist/src/dxt-entry.js.map +0 -1
  78. package/dist/src/index.d.ts +0 -18
  79. package/dist/src/index.d.ts.map +0 -1
  80. package/dist/src/index.js +0 -143
  81. package/dist/src/index.js.map +0 -1
  82. package/dist/src/performance/MetricsCollector.d.ts +0 -145
  83. package/dist/src/performance/MetricsCollector.d.ts.map +0 -1
  84. package/dist/src/performance/MetricsCollector.js +0 -368
  85. package/dist/src/performance/MetricsCollector.js.map +0 -1
  86. package/dist/src/performance/PerformanceAnalytics.d.ts +0 -168
  87. package/dist/src/performance/PerformanceAnalytics.d.ts.map +0 -1
  88. package/dist/src/performance/PerformanceAnalytics.js +0 -570
  89. package/dist/src/performance/PerformanceAnalytics.js.map +0 -1
  90. package/dist/src/performance/PerformanceMonitor.d.ts +0 -203
  91. package/dist/src/performance/PerformanceMonitor.d.ts.map +0 -1
  92. package/dist/src/performance/PerformanceMonitor.js +0 -478
  93. package/dist/src/performance/PerformanceMonitor.js.map +0 -1
  94. package/dist/src/performance/index.d.ts +0 -11
  95. package/dist/src/performance/index.d.ts.map +0 -1
  96. package/dist/src/performance/index.js +0 -8
  97. package/dist/src/performance/index.js.map +0 -1
  98. package/dist/src/security/AISecurityScanner.d.ts +0 -176
  99. package/dist/src/security/AISecurityScanner.d.ts.map +0 -1
  100. package/dist/src/security/AISecurityScanner.js +0 -655
  101. package/dist/src/security/AISecurityScanner.js.map +0 -1
  102. package/dist/src/security/AutomatedRemediation.d.ts +0 -146
  103. package/dist/src/security/AutomatedRemediation.d.ts.map +0 -1
  104. package/dist/src/security/AutomatedRemediation.js +0 -566
  105. package/dist/src/security/AutomatedRemediation.js.map +0 -1
  106. package/dist/src/security/InputValidator.d.ts +0 -219
  107. package/dist/src/security/InputValidator.d.ts.map +0 -1
  108. package/dist/src/security/InputValidator.js +0 -295
  109. package/dist/src/security/InputValidator.js.map +0 -1
  110. package/dist/src/security/SecurityCIPipeline.d.ts +0 -213
  111. package/dist/src/security/SecurityCIPipeline.d.ts.map +0 -1
  112. package/dist/src/security/SecurityCIPipeline.js +0 -693
  113. package/dist/src/security/SecurityCIPipeline.js.map +0 -1
  114. package/dist/src/security/SecurityConfig.d.ts +0 -129
  115. package/dist/src/security/SecurityConfig.d.ts.map +0 -1
  116. package/dist/src/security/SecurityConfig.js +0 -266
  117. package/dist/src/security/SecurityConfig.js.map +0 -1
  118. package/dist/src/security/SecurityConfigManager.d.ts +0 -294
  119. package/dist/src/security/SecurityConfigManager.d.ts.map +0 -1
  120. package/dist/src/security/SecurityConfigManager.js +0 -558
  121. package/dist/src/security/SecurityConfigManager.js.map +0 -1
  122. package/dist/src/security/SecurityMonitoring.d.ts +0 -245
  123. package/dist/src/security/SecurityMonitoring.d.ts.map +0 -1
  124. package/dist/src/security/SecurityMonitoring.js +0 -598
  125. package/dist/src/security/SecurityMonitoring.js.map +0 -1
  126. package/dist/src/security/SecurityReviewer.d.ts +0 -168
  127. package/dist/src/security/SecurityReviewer.d.ts.map +0 -1
  128. package/dist/src/security/SecurityReviewer.js +0 -686
  129. package/dist/src/security/SecurityReviewer.js.map +0 -1
  130. package/dist/src/security/index.d.ts +0 -183
  131. package/dist/src/security/index.d.ts.map +0 -1
  132. package/dist/src/security/index.js +0 -218
  133. package/dist/src/security/index.js.map +0 -1
  134. package/dist/src/server/ConnectionTester.d.ts +0 -32
  135. package/dist/src/server/ConnectionTester.d.ts.map +0 -1
  136. package/dist/src/server/ConnectionTester.js +0 -135
  137. package/dist/src/server/ConnectionTester.js.map +0 -1
  138. package/dist/src/server/ToolRegistry.d.ts +0 -50
  139. package/dist/src/server/ToolRegistry.d.ts.map +0 -1
  140. package/dist/src/server/ToolRegistry.js +0 -219
  141. package/dist/src/server/ToolRegistry.js.map +0 -1
  142. package/dist/src/server.d.ts +0 -7
  143. package/dist/src/server.d.ts.map +0 -1
  144. package/dist/src/server.js +0 -7
  145. package/dist/src/server.js.map +0 -1
  146. package/dist/src/tools/BaseToolManager.d.ts +0 -62
  147. package/dist/src/tools/BaseToolManager.d.ts.map +0 -1
  148. package/dist/src/tools/BaseToolManager.js +0 -195
  149. package/dist/src/tools/BaseToolManager.js.map +0 -1
  150. package/dist/src/tools/auth.d.ts +0 -50
  151. package/dist/src/tools/auth.d.ts.map +0 -1
  152. package/dist/src/tools/auth.js +0 -133
  153. package/dist/src/tools/auth.js.map +0 -1
  154. package/dist/src/tools/cache.d.ts +0 -260
  155. package/dist/src/tools/cache.d.ts.map +0 -1
  156. package/dist/src/tools/cache.js +0 -232
  157. package/dist/src/tools/cache.js.map +0 -1
  158. package/dist/src/tools/comments.d.ts +0 -33
  159. package/dist/src/tools/comments.d.ts.map +0 -1
  160. package/dist/src/tools/comments.js +0 -235
  161. package/dist/src/tools/comments.js.map +0 -1
  162. package/dist/src/tools/index.d.ts +0 -11
  163. package/dist/src/tools/index.d.ts.map +0 -1
  164. package/dist/src/tools/index.js +0 -11
  165. package/dist/src/tools/index.js.map +0 -1
  166. package/dist/src/tools/media.d.ts +0 -70
  167. package/dist/src/tools/media.d.ts.map +0 -1
  168. package/dist/src/tools/media.js +0 -248
  169. package/dist/src/tools/media.js.map +0 -1
  170. package/dist/src/tools/pages.d.ts +0 -32
  171. package/dist/src/tools/pages.d.ts.map +0 -1
  172. package/dist/src/tools/pages.js +0 -215
  173. package/dist/src/tools/pages.js.map +0 -1
  174. package/dist/src/tools/performance.d.ts +0 -73
  175. package/dist/src/tools/performance.d.ts.map +0 -1
  176. package/dist/src/tools/performance.js +0 -922
  177. package/dist/src/tools/performance.js.map +0 -1
  178. package/dist/src/tools/posts/PostHandlers.d.ts +0 -46
  179. package/dist/src/tools/posts/PostHandlers.d.ts.map +0 -1
  180. package/dist/src/tools/posts/PostHandlers.js +0 -400
  181. package/dist/src/tools/posts/PostHandlers.js.map +0 -1
  182. package/dist/src/tools/posts/PostToolDefinitions.d.ts +0 -37
  183. package/dist/src/tools/posts/PostToolDefinitions.d.ts.map +0 -1
  184. package/dist/src/tools/posts/PostToolDefinitions.js +0 -236
  185. package/dist/src/tools/posts/PostToolDefinitions.js.map +0 -1
  186. package/dist/src/tools/posts/index.d.ts +0 -138
  187. package/dist/src/tools/posts/index.d.ts.map +0 -1
  188. package/dist/src/tools/posts/index.js +0 -163
  189. package/dist/src/tools/posts/index.js.map +0 -1
  190. package/dist/src/tools/posts.d.ts +0 -15
  191. package/dist/src/tools/posts.d.ts.map +0 -1
  192. package/dist/src/tools/posts.js +0 -16
  193. package/dist/src/tools/posts.js.map +0 -1
  194. package/dist/src/tools/site.d.ts +0 -32
  195. package/dist/src/tools/site.d.ts.map +0 -1
  196. package/dist/src/tools/site.js +0 -234
  197. package/dist/src/tools/site.js.map +0 -1
  198. package/dist/src/tools/taxonomies.d.ts +0 -36
  199. package/dist/src/tools/taxonomies.d.ts.map +0 -1
  200. package/dist/src/tools/taxonomies.js +0 -286
  201. package/dist/src/tools/taxonomies.js.map +0 -1
  202. package/dist/src/tools/users.d.ts +0 -33
  203. package/dist/src/tools/users.d.ts.map +0 -1
  204. package/dist/src/tools/users.js +0 -308
  205. package/dist/src/tools/users.js.map +0 -1
  206. package/dist/src/types/client.d.ts +0 -223
  207. package/dist/src/types/client.d.ts.map +0 -1
  208. package/dist/src/types/client.js +0 -97
  209. package/dist/src/types/client.js.map +0 -1
  210. package/dist/src/types/enhanced.d.ts +0 -237
  211. package/dist/src/types/enhanced.d.ts.map +0 -1
  212. package/dist/src/types/enhanced.js +0 -49
  213. package/dist/src/types/enhanced.js.map +0 -1
  214. package/dist/src/types/index.d.ts +0 -160
  215. package/dist/src/types/index.d.ts.map +0 -1
  216. package/dist/src/types/index.js +0 -14
  217. package/dist/src/types/index.js.map +0 -1
  218. package/dist/src/types/mcp.d.ts +0 -178
  219. package/dist/src/types/mcp.d.ts.map +0 -1
  220. package/dist/src/types/mcp.js +0 -7
  221. package/dist/src/types/mcp.js.map +0 -1
  222. package/dist/src/types/requests.d.ts +0 -322
  223. package/dist/src/types/requests.d.ts.map +0 -1
  224. package/dist/src/types/requests.js +0 -8
  225. package/dist/src/types/requests.js.map +0 -1
  226. package/dist/src/types/tools.d.ts +0 -506
  227. package/dist/src/types/tools.d.ts.map +0 -1
  228. package/dist/src/types/tools.js +0 -8
  229. package/dist/src/types/tools.js.map +0 -1
  230. package/dist/src/types/wordpress.d.ts +0 -471
  231. package/dist/src/types/wordpress.d.ts.map +0 -1
  232. package/dist/src/types/wordpress.js +0 -14
  233. package/dist/src/types/wordpress.js.map +0 -1
  234. package/dist/src/utils/debug.d.ts +0 -71
  235. package/dist/src/utils/debug.d.ts.map +0 -1
  236. package/dist/src/utils/debug.js +0 -235
  237. package/dist/src/utils/debug.js.map +0 -1
  238. package/dist/src/utils/enhancedError.d.ts +0 -61
  239. package/dist/src/utils/enhancedError.d.ts.map +0 -1
  240. package/dist/src/utils/enhancedError.js +0 -221
  241. package/dist/src/utils/enhancedError.js.map +0 -1
  242. package/dist/src/utils/error.d.ts +0 -17
  243. package/dist/src/utils/error.d.ts.map +0 -1
  244. package/dist/src/utils/error.js +0 -108
  245. package/dist/src/utils/error.js.map +0 -1
  246. package/dist/src/utils/logger.d.ts +0 -106
  247. package/dist/src/utils/logger.d.ts.map +0 -1
  248. package/dist/src/utils/logger.js +0 -280
  249. package/dist/src/utils/logger.js.map +0 -1
  250. package/dist/src/utils/streaming.d.ts +0 -104
  251. package/dist/src/utils/streaming.d.ts.map +0 -1
  252. package/dist/src/utils/streaming.js +0 -331
  253. package/dist/src/utils/streaming.js.map +0 -1
  254. package/dist/src/utils/toolWrapper.d.ts +0 -42
  255. package/dist/src/utils/toolWrapper.d.ts.map +0 -1
  256. package/dist/src/utils/toolWrapper.js +0 -101
  257. package/dist/src/utils/toolWrapper.js.map +0 -1
  258. package/dist/src/utils/validation/core.d.ts +0 -21
  259. package/dist/src/utils/validation/core.d.ts.map +0 -1
  260. package/dist/src/utils/validation/core.js +0 -71
  261. package/dist/src/utils/validation/core.js.map +0 -1
  262. package/dist/src/utils/validation/index.d.ts +0 -25
  263. package/dist/src/utils/validation/index.d.ts.map +0 -1
  264. package/dist/src/utils/validation/index.js +0 -29
  265. package/dist/src/utils/validation/index.js.map +0 -1
  266. package/dist/src/utils/validation/network.d.ts +0 -19
  267. package/dist/src/utils/validation/network.d.ts.map +0 -1
  268. package/dist/src/utils/validation/network.js +0 -93
  269. package/dist/src/utils/validation/network.js.map +0 -1
  270. package/dist/src/utils/validation/rateLimit.d.ts +0 -21
  271. package/dist/src/utils/validation/rateLimit.d.ts.map +0 -1
  272. package/dist/src/utils/validation/rateLimit.js +0 -43
  273. package/dist/src/utils/validation/rateLimit.js.map +0 -1
  274. package/dist/src/utils/validation/security.d.ts +0 -29
  275. package/dist/src/utils/validation/security.d.ts.map +0 -1
  276. package/dist/src/utils/validation/security.js +0 -327
  277. package/dist/src/utils/validation/security.js.map +0 -1
  278. package/dist/src/utils/validation/wordpress.d.ts +0 -31
  279. package/dist/src/utils/validation/wordpress.d.ts.map +0 -1
  280. package/dist/src/utils/validation/wordpress.js +0 -146
  281. package/dist/src/utils/validation/wordpress.js.map +0 -1
  282. package/dist/src/utils/validation.d.ts +0 -15
  283. package/dist/src/utils/validation.d.ts.map +0 -1
  284. package/dist/src/utils/validation.js +0 -27
  285. package/dist/src/utils/validation.js.map +0 -1
  286. package/dist/tests/vitest.setup.d.ts +0 -6
  287. package/dist/tests/vitest.setup.d.ts.map +0 -1
  288. package/dist/tests/vitest.setup.js +0 -39
  289. package/dist/tests/vitest.setup.js.map +0 -1
@@ -1,92 +0,0 @@
1
- /**
2
- * Authentication Manager
3
- * Handles all authentication methods and token management
4
- */
5
- import type { AuthConfig, WordPressClientConfig, AuthStatus, AppPasswordCredentials, JwtCredentials, BasicCredentials, ApiKeyCredentials } from "../../types/client.js";
6
- import { type AuthMethod } from "../../types/wordpress.js";
7
- import { BaseManager } from "./BaseManager.js";
8
- interface AuthManagerConfig extends WordPressClientConfig {
9
- siteUrl: string;
10
- authMethod: AuthMethod;
11
- username?: string;
12
- appPassword?: string;
13
- password?: string;
14
- apiKey?: string;
15
- jwtSecret?: string;
16
- jwtToken?: string;
17
- tokenExpiry?: number;
18
- }
19
- export declare class AuthenticationManager extends BaseManager {
20
- private jwtToken;
21
- private authenticated;
22
- private authConfig;
23
- config: AuthManagerConfig;
24
- constructor(config: AuthManagerConfig);
25
- /**
26
- * Get config for testing purposes
27
- */
28
- getConfig(): AuthManagerConfig;
29
- /**
30
- * Get authentication from environment variables
31
- */
32
- static getAuthFromEnv(): AuthConfig;
33
- /**
34
- * Get authentication headers for requests
35
- *
36
- * Note: This method is synchronous by design for test compatibility and simplicity.
37
- * JWT token refresh should be handled externally before calling this method,
38
- * as automatic refresh would require RequestManager integration.
39
- */
40
- getAuthHeaders(): Record<string, string>;
41
- /**
42
- * Authenticate using JWT
43
- *
44
- * Note: This method is not fully implemented as it requires integration with
45
- * the RequestManager to make HTTP requests to the WordPress JWT endpoint.
46
- * JWT authentication requires the JWT Authentication for WP-API plugin.
47
- *
48
- * @throws {AuthenticationError} - JWT auth requires external dependency injection
49
- */
50
- private authenticateJWT;
51
- /**
52
- * Test authentication
53
- */
54
- testAuthentication(): Promise<boolean>;
55
- /**
56
- * Get authentication status
57
- */
58
- isAuthenticated(): boolean;
59
- /**
60
- * Clear authentication state
61
- */
62
- clearAuthentication(): void;
63
- /**
64
- * Validate authentication configuration
65
- */
66
- validateAuthConfig(): void;
67
- /**
68
- * Validate credentials for current auth method
69
- */
70
- validateCredentials(): void;
71
- /**
72
- * Update authentication method and credentials
73
- */
74
- updateAuthMethod(method: AuthMethod, credentials: AppPasswordCredentials | JwtCredentials | BasicCredentials | ApiKeyCredentials): void;
75
- /**
76
- * Refresh JWT token
77
- *
78
- * For testing compatibility, this method supports mock JWT refresh.
79
- * In production, it requires RequestManager integration.
80
- */
81
- refreshToken(): Promise<void>;
82
- /**
83
- * Check if JWT token is expired
84
- */
85
- isTokenExpired(): boolean;
86
- /**
87
- * Get authentication status
88
- */
89
- getAuthStatus(): AuthStatus;
90
- }
91
- export {};
92
- //# sourceMappingURL=AuthenticationManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AuthenticationManager.d.ts","sourceRoot":"","sources":["../../../../src/client/managers/AuthenticationManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,qBAAqB,EACrB,UAAU,EACV,sBAAsB,EACtB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,UAAU,iBAAkB,SAAQ,qBAAqB;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,qBAAsB,SAAQ,WAAW;IACpD,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,aAAa,CAAkB;IACvC,OAAO,CAAC,UAAU,CAAoB;IAC/B,MAAM,EAAE,iBAAiB,CAAC;gBAErB,MAAM,EAAE,iBAAiB;IAyCrC;;OAEG;IACH,SAAS,IAAI,iBAAiB;IAI9B;;OAEG;IACH,MAAM,CAAC,cAAc,IAAI,UAAU;IAuCnC;;;;;;OAMG;IACH,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IA6CxC;;;;;;;;OAQG;YACW,eAAe;IAkB7B;;OAEG;IACG,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;IAkB5C;;OAEG;IACH,eAAe,IAAI,OAAO;IAI1B;;OAEG;IACH,mBAAmB,IAAI,IAAI;IAK3B;;OAEG;IACH,kBAAkB,IAAI,IAAI;IAwC1B;;OAEG;IACH,mBAAmB,IAAI,IAAI;IAuC3B;;OAEG;IACH,gBAAgB,CACd,MAAM,EAAE,UAAU,EAClB,WAAW,EAAE,sBAAsB,GAAG,cAAc,GAAG,gBAAgB,GAAG,iBAAiB,GAC1F,IAAI;IA0DP;;;;;OAKG;IACG,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IA+BnC;;OAEG;IACH,cAAc,IAAI,OAAO;IAYzB;;OAEG;IACH,aAAa,IAAI,UAAU;CAiB5B"}
@@ -1,369 +0,0 @@
1
- /**
2
- * Authentication Manager
3
- * Handles all authentication methods and token management
4
- */
5
- import { AuthenticationError } from "../../types/client.js";
6
- import { AUTH_METHODS } from "../../types/wordpress.js";
7
- import { config } from "../../config/Config.js";
8
- import { BaseManager } from "./BaseManager.js";
9
- import { debug } from "../../utils/debug.js";
10
- export class AuthenticationManager extends BaseManager {
11
- jwtToken = null;
12
- authenticated = false;
13
- authConfig;
14
- config; // Expose for test compatibility
15
- constructor(config) {
16
- // Validate required config fields
17
- if (!config.siteUrl || config.siteUrl.trim() === "") {
18
- throw new AuthenticationError("Site URL is required", AUTH_METHODS.APP_PASSWORD);
19
- }
20
- // Validate site URL format
21
- try {
22
- new URL(config.siteUrl);
23
- }
24
- catch {
25
- throw new AuthenticationError("Invalid site URL", AUTH_METHODS.APP_PASSWORD);
26
- }
27
- // Validate auth method using centralized constants
28
- const validMethods = Object.values(AUTH_METHODS);
29
- if (config.authMethod && !validMethods.includes(config.authMethod)) {
30
- throw new AuthenticationError("Invalid authentication method", config.authMethod);
31
- }
32
- // Transform config to match expected format
33
- const transformedConfig = {
34
- baseUrl: config.siteUrl,
35
- timeout: config.timeout || 30000,
36
- auth: {
37
- method: config.authMethod || AUTH_METHODS.APP_PASSWORD,
38
- ...(config.username && { username: config.username }),
39
- ...(config.appPassword && { appPassword: config.appPassword }),
40
- ...(config.password && { password: config.password }),
41
- ...(config.apiKey && { apiKey: config.apiKey }),
42
- ...(config.jwtSecret && { secret: config.jwtSecret }),
43
- },
44
- };
45
- super(transformedConfig);
46
- // Store private config
47
- this.authConfig = config;
48
- // Expose config for test compatibility
49
- this.config = config;
50
- }
51
- /**
52
- * Get config for testing purposes
53
- */
54
- getConfig() {
55
- return { ...this.authConfig };
56
- }
57
- /**
58
- * Get authentication from environment variables
59
- */
60
- static getAuthFromEnv() {
61
- const cfg = config();
62
- const wp = cfg.wordpress;
63
- const method = wp.authMethod || AUTH_METHODS.APP_PASSWORD;
64
- switch (method) {
65
- case AUTH_METHODS.APP_PASSWORD:
66
- return {
67
- method: AUTH_METHODS.APP_PASSWORD,
68
- username: wp.username || "",
69
- appPassword: wp.appPassword || "",
70
- };
71
- case AUTH_METHODS.JWT:
72
- return {
73
- method: AUTH_METHODS.JWT,
74
- username: wp.username || "",
75
- password: wp.jwtPassword || wp.password || "",
76
- secret: wp.jwtSecret || "",
77
- };
78
- case AUTH_METHODS.BASIC:
79
- return {
80
- method: AUTH_METHODS.BASIC,
81
- username: wp.username || "",
82
- password: wp.password || "",
83
- };
84
- case AUTH_METHODS.API_KEY:
85
- return {
86
- method: AUTH_METHODS.API_KEY,
87
- apiKey: wp.apiKey || "",
88
- };
89
- default:
90
- throw new AuthenticationError(`Unsupported authentication method: ${method}`, method);
91
- }
92
- }
93
- /**
94
- * Get authentication headers for requests
95
- *
96
- * Note: This method is synchronous by design for test compatibility and simplicity.
97
- * JWT token refresh should be handled externally before calling this method,
98
- * as automatic refresh would require RequestManager integration.
99
- */
100
- getAuthHeaders() {
101
- const method = this.authConfig.authMethod || AUTH_METHODS.APP_PASSWORD;
102
- switch (method) {
103
- case AUTH_METHODS.APP_PASSWORD:
104
- if (!this.authConfig.username || !this.authConfig.appPassword) {
105
- throw new AuthenticationError("Username and app password are required", method);
106
- }
107
- const credentials = Buffer.from(`${this.authConfig.username}:${this.authConfig.appPassword}`).toString("base64");
108
- return { Authorization: `Basic ${credentials}` };
109
- case AUTH_METHODS.JWT:
110
- if (!this.authConfig.jwtToken) {
111
- throw new AuthenticationError("JWT token is required", method);
112
- }
113
- return { Authorization: `Bearer ${this.authConfig.jwtToken}` };
114
- case AUTH_METHODS.BASIC:
115
- if (!this.authConfig.username || !this.authConfig.password) {
116
- throw new AuthenticationError("Username and password are required", method);
117
- }
118
- const basicCredentials = Buffer.from(`${this.authConfig.username}:${this.authConfig.password}`).toString("base64");
119
- return { Authorization: `Basic ${basicCredentials}` };
120
- case AUTH_METHODS.API_KEY:
121
- if (!this.authConfig.apiKey) {
122
- throw new AuthenticationError("API key is required", method);
123
- }
124
- return { "X-API-Key": this.authConfig.apiKey };
125
- case AUTH_METHODS.COOKIE:
126
- // Cookie authentication typically handled by browser
127
- return {};
128
- default:
129
- throw new AuthenticationError(`Unsupported authentication method: ${method}`, method);
130
- }
131
- }
132
- /**
133
- * Authenticate using JWT
134
- *
135
- * Note: This method is not fully implemented as it requires integration with
136
- * the RequestManager to make HTTP requests to the WordPress JWT endpoint.
137
- * JWT authentication requires the JWT Authentication for WP-API plugin.
138
- *
139
- * @throws {AuthenticationError} - JWT auth requires external dependency injection
140
- */
141
- async authenticateJWT() {
142
- if (this.authConfig.authMethod !== AUTH_METHODS.JWT || !this.authConfig.username || !this.authConfig.password) {
143
- throw new AuthenticationError("JWT authentication requires username and password", AUTH_METHODS.JWT);
144
- }
145
- try {
146
- // TODO: Implement JWT authentication with RequestManager integration
147
- // This would require making a POST request to /wp-json/jwt-auth/v1/token
148
- // with username and password to obtain a JWT token
149
- throw new AuthenticationError("JWT authentication requires RequestManager integration - not yet implemented", AUTH_METHODS.JWT);
150
- }
151
- catch (error) {
152
- this.handleError(error, "JWT authentication");
153
- }
154
- }
155
- /**
156
- * Test authentication
157
- */
158
- async testAuthentication() {
159
- try {
160
- const _headers = await this.getAuthHeaders();
161
- debug.log("Authentication headers prepared", {
162
- method: this.authConfig.authMethod,
163
- });
164
- // This would need the RequestManager to actually test the connection
165
- // For now, we'll return true if headers can be generated
166
- this.authenticated = true;
167
- return true;
168
- }
169
- catch (error) {
170
- this.authenticated = false;
171
- debug.log("Authentication test failed", error);
172
- return false;
173
- }
174
- }
175
- /**
176
- * Get authentication status
177
- */
178
- isAuthenticated() {
179
- return this.authenticated;
180
- }
181
- /**
182
- * Clear authentication state
183
- */
184
- clearAuthentication() {
185
- this.jwtToken = null;
186
- this.authenticated = false;
187
- }
188
- /**
189
- * Validate authentication configuration
190
- */
191
- validateAuthConfig() {
192
- const method = this.authConfig.authMethod;
193
- if (!method) {
194
- throw new AuthenticationError("Authentication method is required", AUTH_METHODS.APP_PASSWORD);
195
- }
196
- switch (method) {
197
- case AUTH_METHODS.APP_PASSWORD:
198
- if (!this.authConfig.username || !this.authConfig.appPassword) {
199
- throw new AuthenticationError("App password authentication requires username and appPassword", AUTH_METHODS.APP_PASSWORD);
200
- }
201
- break;
202
- case AUTH_METHODS.JWT:
203
- if (!this.authConfig.username || !this.authConfig.password || !this.authConfig.jwtSecret) {
204
- throw new AuthenticationError("JWT authentication requires username, password, and secret", AUTH_METHODS.JWT);
205
- }
206
- break;
207
- case AUTH_METHODS.BASIC:
208
- if (!this.authConfig.username || !this.authConfig.password) {
209
- throw new AuthenticationError("Basic authentication requires username and password", AUTH_METHODS.BASIC);
210
- }
211
- break;
212
- case AUTH_METHODS.API_KEY:
213
- if (!this.authConfig.apiKey) {
214
- throw new AuthenticationError("API key authentication requires apiKey", AUTH_METHODS.API_KEY);
215
- }
216
- break;
217
- default:
218
- throw new AuthenticationError(`Unsupported authentication method: ${method}`, method);
219
- }
220
- }
221
- /**
222
- * Validate credentials for current auth method
223
- */
224
- validateCredentials() {
225
- const method = this.authConfig.authMethod || AUTH_METHODS.APP_PASSWORD;
226
- switch (method) {
227
- case AUTH_METHODS.APP_PASSWORD:
228
- if (!this.authConfig.username) {
229
- throw new AuthenticationError("Username is required", method);
230
- }
231
- if (!this.authConfig.appPassword) {
232
- throw new AuthenticationError("App password is required", method);
233
- }
234
- break;
235
- case AUTH_METHODS.JWT:
236
- if (!this.authConfig.jwtToken) {
237
- throw new AuthenticationError("JWT token is required", method);
238
- }
239
- break;
240
- case AUTH_METHODS.BASIC:
241
- if (!this.authConfig.username) {
242
- throw new AuthenticationError("Username is required", method);
243
- }
244
- if (!this.authConfig.password) {
245
- throw new AuthenticationError("Password is required", method);
246
- }
247
- break;
248
- case AUTH_METHODS.API_KEY:
249
- if (!this.authConfig.apiKey) {
250
- throw new AuthenticationError("API key is required", method);
251
- }
252
- break;
253
- default:
254
- throw new AuthenticationError(`Invalid authentication method: ${method}`, method);
255
- }
256
- }
257
- /**
258
- * Update authentication method and credentials
259
- */
260
- updateAuthMethod(method, credentials) {
261
- const validMethods = Object.values(AUTH_METHODS);
262
- if (!validMethods.includes(method)) {
263
- throw new AuthenticationError("Invalid authentication method", method);
264
- }
265
- // Clear all previous credentials to prevent leakage
266
- delete this.authConfig.username;
267
- delete this.authConfig.appPassword;
268
- delete this.authConfig.jwtToken;
269
- delete this.authConfig.password;
270
- delete this.authConfig.apiKey;
271
- delete this.authConfig.tokenExpiry;
272
- // Set new auth method
273
- this.authConfig.authMethod = method;
274
- // Set new credentials with type safety and validation
275
- switch (method) {
276
- case AUTH_METHODS.APP_PASSWORD:
277
- const appCreds = credentials;
278
- if (!appCreds.username || !appCreds.appPassword) {
279
- throw new AuthenticationError("Username and app password are required", method);
280
- }
281
- this.authConfig.username = appCreds.username;
282
- this.authConfig.appPassword = appCreds.appPassword;
283
- break;
284
- case AUTH_METHODS.JWT:
285
- const jwtCreds = credentials;
286
- if (!jwtCreds.jwtToken) {
287
- throw new AuthenticationError("JWT token is required", method);
288
- }
289
- this.authConfig.jwtToken = jwtCreds.jwtToken;
290
- if (jwtCreds.username) {
291
- this.authConfig.username = jwtCreds.username;
292
- }
293
- break;
294
- case AUTH_METHODS.BASIC:
295
- const basicCreds = credentials;
296
- if (!basicCreds.username || !basicCreds.password) {
297
- throw new AuthenticationError("Username and password are required", method);
298
- }
299
- this.authConfig.username = basicCreds.username;
300
- this.authConfig.password = basicCreds.password;
301
- break;
302
- case AUTH_METHODS.API_KEY:
303
- const apiCreds = credentials;
304
- if (!apiCreds.apiKey) {
305
- throw new AuthenticationError("API key is required", method);
306
- }
307
- this.authConfig.apiKey = apiCreds.apiKey;
308
- break;
309
- }
310
- }
311
- /**
312
- * Refresh JWT token
313
- *
314
- * For testing compatibility, this method supports mock JWT refresh.
315
- * In production, it requires RequestManager integration.
316
- */
317
- async refreshToken() {
318
- if (this.authConfig.authMethod !== AUTH_METHODS.JWT) {
319
- throw new AuthenticationError("Token refresh not supported for non-JWT authentication methods", this.authConfig.authMethod);
320
- }
321
- // Check if mock refresh method is available (for testing)
322
- const mockRefreshMethod = this.refreshJwtToken;
323
- if (typeof mockRefreshMethod === "function") {
324
- const result = await mockRefreshMethod();
325
- if (result && typeof result === "object" && "token" in result) {
326
- const tokenResult = result;
327
- this.authConfig.jwtToken = tokenResult.token;
328
- if (tokenResult.expires_in) {
329
- this.authConfig.tokenExpiry = Date.now() + tokenResult.expires_in * 1000;
330
- }
331
- return;
332
- }
333
- }
334
- // TODO: Implement JWT token refresh with RequestManager integration
335
- // This would require making a POST request to /wp-json/jwt-auth/v1/token/validate
336
- // and updating the stored token and expiry
337
- throw new AuthenticationError("JWT refresh requires RequestManager integration - not yet implemented", AUTH_METHODS.JWT);
338
- }
339
- /**
340
- * Check if JWT token is expired
341
- */
342
- isTokenExpired() {
343
- if (this.authConfig.authMethod !== AUTH_METHODS.JWT) {
344
- return false;
345
- }
346
- if (!this.authConfig.tokenExpiry) {
347
- return true;
348
- }
349
- return Date.now() >= this.authConfig.tokenExpiry;
350
- }
351
- /**
352
- * Get authentication status
353
- */
354
- getAuthStatus() {
355
- const method = this.authConfig.authMethod || AUTH_METHODS.APP_PASSWORD;
356
- const isExpired = this.isTokenExpired();
357
- const status = {
358
- method,
359
- username: this.authConfig.username,
360
- isAuthenticated: method === AUTH_METHODS.JWT ? !isExpired : true,
361
- tokenExpired: isExpired,
362
- };
363
- if (method === AUTH_METHODS.JWT && this.authConfig.tokenExpiry) {
364
- status.tokenExpiry = this.authConfig.tokenExpiry;
365
- }
366
- return status;
367
- }
368
- }
369
- //# sourceMappingURL=AuthenticationManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AuthenticationManager.js","sourceRoot":"","sources":["../../../../src/client/managers/AuthenticationManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAmB,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAc7C,MAAM,OAAO,qBAAsB,SAAQ,WAAW;IAC5C,QAAQ,GAAkB,IAAI,CAAC;IAC/B,aAAa,GAAY,KAAK,CAAC;IAC/B,UAAU,CAAoB;IAC/B,MAAM,CAAoB,CAAC,gCAAgC;IAElE,YAAY,MAAyB;QACnC,kCAAkC;QAClC,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACpD,MAAM,IAAI,mBAAmB,CAAC,sBAAsB,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;QACnF,CAAC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,OAAO;YACT,CAAC;QACH,CAAC;QAED,oEAAoE;QACpE,kFAAkF;QAClF,2CAA2C;QAC3C,MAAM,IAAI,mBAAmB,CAC3B,uEAAuE,EACvE,YAAY,CAAC,GAAG,CACjB,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,KAAK,YAAY,CAAC,GAAG,EAAE,CAAC;YACpD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;YACjC,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,aAAa;QACX,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,IAAI,YAAY,CAAC,YAAY,CAAC;QACvE,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAExC,MAAM,MAAM,GAAe;YACzB,MAAM;YACN,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ;YAClC,eAAe,EAAE,MAAM,KAAK,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI;YAChE,YAAY,EAAE,SAAS;SACxB,CAAC;QAEF,IAAI,MAAM,KAAK,YAAY,CAAC,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;YAC/D,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;QACnD,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -1,22 +0,0 @@
1
- /**
2
- * Base class for all client managers
3
- * Provides common functionality and error handling
4
- */
5
- import type { WordPressClientConfig } from "../../types/client.js";
6
- export declare abstract class BaseManager {
7
- protected config: WordPressClientConfig;
8
- constructor(config: WordPressClientConfig);
9
- /**
10
- * Standardized error handling for all managers
11
- */
12
- protected handleError(error: unknown, operation: string): never;
13
- /**
14
- * Standardized success logging
15
- */
16
- protected logSuccess(operation: string, details?: unknown): void;
17
- /**
18
- * Validate required parameters
19
- */
20
- protected validateRequired(params: Record<string, unknown>, requiredFields: string[]): void;
21
- }
22
- //# sourceMappingURL=BaseManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseManager.d.ts","sourceRoot":"","sources":["../../../../src/client/managers/BaseManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAKnE,8BAAsB,WAAW;IAC/B,SAAS,CAAC,MAAM,EAAE,qBAAqB,CAAC;gBAE5B,MAAM,EAAE,qBAAqB;IAIzC;;OAEG;IACH,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,KAAK;IA0B/D;;OAEG;IACH,SAAS,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI;IAIhE;;OAEG;IACH,SAAS,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,IAAI;CAO5F"}
@@ -1,53 +0,0 @@
1
- /**
2
- * Base class for all client managers
3
- * Provides common functionality and error handling
4
- */
5
- import { WordPressAPIError } from "../../types/client.js";
6
- import { debug, logError } from "../../utils/debug.js";
7
- import { getErrorMessage } from "../../utils/error.js";
8
- export class BaseManager {
9
- config;
10
- constructor(config) {
11
- this.config = config;
12
- }
13
- /**
14
- * Standardized error handling for all managers
15
- */
16
- handleError(error, operation) {
17
- logError(`${operation} failed:`, error);
18
- if (error instanceof WordPressAPIError) {
19
- throw error;
20
- }
21
- // Type guard for error-like objects
22
- const isErrorLike = (err) => {
23
- return typeof err === "object" && err !== null;
24
- };
25
- if (isErrorLike(error)) {
26
- if (error.name === "AbortError" || error.code === "ABORT_ERR") {
27
- throw new WordPressAPIError(`Request timeout after ${this.config.timeout}ms`, 408, "timeout");
28
- }
29
- if (error.code === "ECONNREFUSED" || error.code === "ENOTFOUND") {
30
- throw new WordPressAPIError(`Cannot connect to WordPress site: ${this.config.baseUrl}`, 503, "connection_failed");
31
- }
32
- }
33
- const message = getErrorMessage(error);
34
- throw new WordPressAPIError(`${operation} failed: ${message}`, 500, "unknown_error");
35
- }
36
- /**
37
- * Standardized success logging
38
- */
39
- logSuccess(operation, details) {
40
- debug.log(`${operation} completed successfully`, details);
41
- }
42
- /**
43
- * Validate required parameters
44
- */
45
- validateRequired(params, requiredFields) {
46
- for (const field of requiredFields) {
47
- if (params[field] === undefined || params[field] === null) {
48
- throw new WordPressAPIError(`Missing required parameter: ${field}`, 400, "missing_parameter");
49
- }
50
- }
51
- }
52
- }
53
- //# sourceMappingURL=BaseManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseManager.js","sourceRoot":"","sources":["../../../../src/client/managers/BaseManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,OAAgB,WAAW;IACrB,MAAM,CAAwB;IAExC,YAAY,MAA6B;QACvC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;OAEG;IACO,WAAW,CAAC,KAAc,EAAE,SAAiB;QACrD,QAAQ,CAAC,GAAG,SAAS,UAAU,EAAE,KAAgC,CAAC,CAAC;QAEnE,IAAI,KAAK,YAAY,iBAAiB,EAAE,CAAC;YACvC,MAAM,KAAK,CAAC;QACd,CAAC;QAED,oCAAoC;QACpC,MAAM,WAAW,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IACH,CAAC;CACF"}
@@ -1,47 +0,0 @@
1
- /**
2
- * HTTP Request Manager
3
- * Handles all HTTP operations, rate limiting, and retries
4
- */
5
- import type { HTTPMethod, RequestOptions, ClientStats, WordPressClientConfig } from "../../types/client.js";
6
- import { BaseManager } from "./BaseManager.js";
7
- import { AuthenticationManager } from "./AuthenticationManager.js";
8
- export declare class RequestManager extends BaseManager {
9
- private stats;
10
- private lastRequestTime;
11
- private requestInterval;
12
- private authManager;
13
- constructor(clientConfig: WordPressClientConfig, authManager: AuthenticationManager);
14
- /**
15
- * Make HTTP request with retry logic and rate limiting
16
- */
17
- request<T>(method: HTTPMethod, endpoint: string, data?: unknown, options?: RequestOptions): Promise<T>;
18
- /**
19
- * Make request with retry logic
20
- */
21
- private makeRequestWithRetry;
22
- /**
23
- * Make single HTTP request
24
- */
25
- private makeRequest;
26
- /**
27
- * Handle HTTP error responses
28
- */
29
- private handleErrorResponse;
30
- /**
31
- * Build full URL from endpoint
32
- */
33
- private buildUrl;
34
- /**
35
- * Enforce rate limiting
36
- */
37
- private enforceRateLimit;
38
- /**
39
- * Update average response time
40
- */
41
- private updateAverageResponseTime;
42
- /**
43
- * Get request statistics
44
- */
45
- getStats(): ClientStats;
46
- }
47
- //# sourceMappingURL=RequestManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RequestManager.d.ts","sourceRoot":"","sources":["../../../../src/client/managers/RequestManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAG5G,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,qBAAa,cAAe,SAAQ,WAAW;IAC7C,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,WAAW,CAAwB;gBAE/B,YAAY,EAAE,qBAAqB,EAAE,WAAW,EAAE,qBAAqB;IAenF;;OAEG;IACG,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,CAAC,CAAC;IAoBhH;;OAEG;YACW,oBAAoB;IAqClC;;OAEG;YACW,WAAW;IAkEzB;;OAEG;YACW,mBAAmB;IA6BjC;;OAEG;IACH,OAAO,CAAC,QAAQ;IAQhB;;OAEG;YACW,gBAAgB;IAY9B;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAOjC;;OAEG;IACH,QAAQ,IAAI,WAAW;CAGxB"}