mcp-wordpress 1.1.2 → 1.1.7

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 (91) hide show
  1. package/README.md +8 -8
  2. package/bin/mcp-wordpress.js +1 -1
  3. package/dist/client/api.d.ts +10 -10
  4. package/dist/client/api.js +157 -157
  5. package/dist/client/api.js.map +1 -1
  6. package/dist/client/auth.d.ts +2 -2
  7. package/dist/client/auth.d.ts.map +1 -1
  8. package/dist/client/auth.js +72 -72
  9. package/dist/client/auth.js.map +1 -1
  10. package/dist/client/managers/AuthenticationManager.d.ts +2 -2
  11. package/dist/client/managers/AuthenticationManager.d.ts.map +1 -1
  12. package/dist/client/managers/AuthenticationManager.js +50 -46
  13. package/dist/client/managers/AuthenticationManager.js.map +1 -1
  14. package/dist/client/managers/BaseManager.d.ts +1 -1
  15. package/dist/client/managers/BaseManager.d.ts.map +1 -1
  16. package/dist/client/managers/BaseManager.js +9 -9
  17. package/dist/client/managers/BaseManager.js.map +1 -1
  18. package/dist/client/managers/RequestManager.d.ts +2 -2
  19. package/dist/client/managers/RequestManager.js +15 -15
  20. package/dist/client/managers/index.d.ts +3 -3
  21. package/dist/client/managers/index.js +3 -3
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +78 -61
  24. package/dist/index.js.map +1 -1
  25. package/dist/tools/auth.d.ts +2 -2
  26. package/dist/tools/auth.js +31 -31
  27. package/dist/tools/auth.js.map +1 -1
  28. package/dist/tools/comments.d.ts +2 -2
  29. package/dist/tools/comments.js +79 -79
  30. package/dist/tools/media.d.ts +2 -2
  31. package/dist/tools/media.d.ts.map +1 -1
  32. package/dist/tools/media.js +80 -80
  33. package/dist/tools/media.js.map +1 -1
  34. package/dist/tools/pages.d.ts +2 -2
  35. package/dist/tools/pages.js +75 -75
  36. package/dist/tools/posts.d.ts +2 -2
  37. package/dist/tools/posts.js +94 -94
  38. package/dist/tools/site.d.ts +2 -2
  39. package/dist/tools/site.js +60 -60
  40. package/dist/tools/site.js.map +1 -1
  41. package/dist/tools/taxonomies.d.ts +2 -2
  42. package/dist/tools/taxonomies.js +89 -89
  43. package/dist/tools/users.d.ts +2 -2
  44. package/dist/tools/users.js +68 -68
  45. package/dist/tools/users.js.map +1 -1
  46. package/dist/types/mcp.d.ts +1 -1
  47. package/dist/types/mcp.d.ts.map +1 -1
  48. package/dist/utils/debug.d.ts.map +1 -1
  49. package/dist/utils/debug.js +10 -6
  50. package/dist/utils/debug.js.map +1 -1
  51. package/dist/utils/toolWrapper.js +3 -3
  52. package/docs/developer/GITHUB_ACTIONS_SETUP.md +208 -0
  53. package/docs/developer/MAINTENANCE.md +307 -0
  54. package/docs/developer/MIGRATION_GUIDE.md +172 -0
  55. package/docs/developer/NPM_AUTH_SETUP.md +142 -0
  56. package/docs/developer/REFACTORING.md +196 -0
  57. package/docs/releases/COMMUNITY_ANNOUNCEMENT_v1.1.2.md +126 -0
  58. package/docs/releases/RELEASE_NOTES_v1.1.2.md +173 -0
  59. package/docs/user-guides/CLAUDE_DESKTOP_SETUP.md +187 -0
  60. package/package.json +4 -3
  61. package/src/client/api.ts +229 -229
  62. package/src/client/auth.ts +135 -136
  63. package/src/client/managers/AuthenticationManager.ts +148 -105
  64. package/src/client/managers/BaseManager.ts +15 -12
  65. package/src/client/managers/RequestManager.ts +17 -17
  66. package/src/client/managers/index.ts +3 -3
  67. package/src/index.ts +141 -114
  68. package/src/server.ts +1 -1
  69. package/src/tools/auth.ts +36 -36
  70. package/src/tools/comments.ts +90 -90
  71. package/src/tools/media.ts +89 -91
  72. package/src/tools/pages.ts +86 -86
  73. package/src/tools/posts.ts +106 -106
  74. package/src/tools/site.ts +71 -71
  75. package/src/tools/taxonomies.ts +102 -102
  76. package/src/tools/users.ts +77 -77
  77. package/src/types/client.ts +1 -1
  78. package/src/types/index.ts +1 -1
  79. package/src/types/mcp.ts +36 -16
  80. package/src/types/wordpress.ts +1 -1
  81. package/src/utils/debug.ts +63 -39
  82. package/src/utils/error.ts +1 -1
  83. package/src/utils/toolWrapper.ts +4 -4
  84. package/dist/client/WordPressClient.d.ts +0 -81
  85. package/dist/client/WordPressClient.d.ts.map +0 -1
  86. package/dist/client/WordPressClient.js +0 -354
  87. package/dist/client/WordPressClient.js.map +0 -1
  88. package/dist/tools/base.d.ts +0 -37
  89. package/dist/tools/base.d.ts.map +0 -1
  90. package/dist/tools/base.js +0 -60
  91. package/dist/tools/base.js.map +0 -1
@@ -3,17 +3,16 @@
3
3
  * Manages different authentication methods for WordPress REST API
4
4
  */
5
5
 
6
- import { logger, debug } from "../utils/debug.js";
7
- import * as http from "http";
8
- import { URL } from "url";
6
+ import { logger } from '../utils/debug.js';
7
+ import { URL } from 'url';
9
8
  import type {
10
9
  IAuthProvider,
11
10
  IWordPressClient,
12
11
  AuthMethod,
13
12
  AuthConfig,
14
- AuthenticationError,
15
- } from "../types/client.js";
16
- import type { WordPressUser } from "../types/wordpress.js";
13
+ AuthenticationError as _AuthenticationError
14
+ } from '../types/client.js';
15
+ import type { WordPressUser } from '../types/wordpress.js';
17
16
 
18
17
  export class WordPressAuth {
19
18
  private client: IWordPressClient;
@@ -30,21 +29,21 @@ export class WordPressAuth {
30
29
  async authenticate(): Promise<boolean> {
31
30
  try {
32
31
  switch (this.authType) {
33
- case "app-password":
34
- return await this.handleAppPasswordAuth();
35
- case "jwt":
36
- return await this.handleJWTAuth();
37
- case "basic":
38
- return await this.handleBasicAuth();
39
- case "api-key":
40
- return await this.handleAPIKeyAuth();
41
- case "cookie":
42
- return await this.handleCookieAuth();
43
- default:
44
- throw new Error(`Unsupported authentication type: ${this.authType}`);
32
+ case 'app-password':
33
+ return await this.handleAppPasswordAuth();
34
+ case 'jwt':
35
+ return await this.handleJWTAuth();
36
+ case 'basic':
37
+ return await this.handleBasicAuth();
38
+ case 'api-key':
39
+ return await this.handleAPIKeyAuth();
40
+ case 'cookie':
41
+ return await this.handleCookieAuth();
42
+ default:
43
+ throw new Error(`Unsupported authentication type: ${this.authType}`);
45
44
  }
46
45
  } catch (error) {
47
- logger.error("Authentication failed:", error);
46
+ logger.error('Authentication failed:', error);
48
47
  throw error;
49
48
  }
50
49
  }
@@ -57,8 +56,8 @@ export class WordPressAuth {
57
56
 
58
57
  if (!username || !appPassword) {
59
58
  throw new Error(
60
- "Application Password authentication requires WORDPRESS_USERNAME and WORDPRESS_APP_PASSWORD. " +
61
- "Visit your WordPress admin → Users → Profile → Application Passwords to create one.",
59
+ 'Application Password authentication requires WORDPRESS_USERNAME and WORDPRESS_APP_PASSWORD. ' +
60
+ 'Visit your WordPress admin → Users → Profile → Application Passwords to create one.'
62
61
  );
63
62
  }
64
63
 
@@ -66,12 +65,12 @@ export class WordPressAuth {
66
65
  try {
67
66
  const user = await this.client.getCurrentUser();
68
67
  logger.log(
69
- `✅ Application Password authentication successful for user: ${user.name} (${user.username})`,
68
+ `✅ Application Password authentication successful for user: ${user.name} (${user.username})`
70
69
  );
71
70
  return true;
72
71
  } catch (error) {
73
72
  const message =
74
- "Application Password authentication failed. Please check your credentials and ensure the application password is valid.";
73
+ 'Application Password authentication failed. Please check your credentials and ensure the application password is valid.';
75
74
  logger.error(message, error);
76
75
  throw new Error(message);
77
76
  }
@@ -85,19 +84,19 @@ export class WordPressAuth {
85
84
 
86
85
  if (!username || !password) {
87
86
  throw new Error(
88
- "Basic authentication requires WORDPRESS_USERNAME and WORDPRESS_PASSWORD",
87
+ 'Basic authentication requires WORDPRESS_USERNAME and WORDPRESS_PASSWORD'
89
88
  );
90
89
  }
91
90
 
92
91
  try {
93
92
  const user = await this.client.getCurrentUser();
94
93
  logger.log(
95
- `✅ Basic authentication successful for user: ${user.name} (${user.username})`,
94
+ `✅ Basic authentication successful for user: ${user.name} (${user.username})`
96
95
  );
97
96
  return true;
98
97
  } catch (error) {
99
98
  const message =
100
- "Basic authentication failed. Please check your username and password.";
99
+ 'Basic authentication failed. Please check your username and password.';
101
100
  logger.error(message, error);
102
101
  throw new Error(message);
103
102
  }
@@ -111,8 +110,8 @@ export class WordPressAuth {
111
110
 
112
111
  if (!username || !password || !secret) {
113
112
  throw new Error(
114
- "JWT authentication requires WORDPRESS_USERNAME, WORDPRESS_PASSWORD, and WORDPRESS_JWT_SECRET. " +
115
- "Install and configure the JWT Authentication plugin first.",
113
+ 'JWT authentication requires WORDPRESS_USERNAME, WORDPRESS_PASSWORD, and WORDPRESS_JWT_SECRET. ' +
114
+ 'Install and configure the JWT Authentication plugin first.'
116
115
  );
117
116
  }
118
117
 
@@ -120,12 +119,12 @@ export class WordPressAuth {
120
119
  // The JWT token should be obtained during client authentication
121
120
  const user = await this.client.getCurrentUser();
122
121
  logger.log(
123
- `✅ JWT authentication successful for user: ${user.name} (${user.username})`,
122
+ `✅ JWT authentication successful for user: ${user.name} (${user.username})`
124
123
  );
125
124
  return true;
126
125
  } catch (error) {
127
126
  const message =
128
- "JWT authentication failed. Please check your credentials and ensure the JWT plugin is installed and configured.";
127
+ 'JWT authentication failed. Please check your credentials and ensure the JWT plugin is installed and configured.';
129
128
  logger.error(message, error);
130
129
  throw new Error(message);
131
130
  }
@@ -138,17 +137,17 @@ export class WordPressAuth {
138
137
  const { apiKey } = this.client.config.auth;
139
138
 
140
139
  if (!apiKey) {
141
- throw new Error("API Key authentication requires WORDPRESS_API_KEY");
140
+ throw new Error('API Key authentication requires WORDPRESS_API_KEY');
142
141
  }
143
142
 
144
143
  try {
145
144
  // Test API key by making a simple request
146
145
  await this.client.getSiteInfo();
147
- logger.log("✅ API Key authentication successful");
146
+ logger.log('✅ API Key authentication successful');
148
147
  return true;
149
148
  } catch (error) {
150
149
  const message =
151
- "API Key authentication failed. Please check your API key.";
150
+ 'API Key authentication failed. Please check your API key.';
152
151
  logger.error(message, error);
153
152
  throw new Error(message);
154
153
  }
@@ -162,7 +161,7 @@ export class WordPressAuth {
162
161
 
163
162
  if (!nonce) {
164
163
  logger.warn(
165
- "Cookie authentication: No nonce provided, authentication may fail for write operations",
164
+ 'Cookie authentication: No nonce provided, authentication may fail for write operations'
166
165
  );
167
166
  }
168
167
 
@@ -170,12 +169,12 @@ export class WordPressAuth {
170
169
  // Test with a simple read operation
171
170
  await this.client.getSiteInfo();
172
171
  logger.log(
173
- "✅ Cookie authentication configured (note: write operations may require valid nonce)",
172
+ '✅ Cookie authentication configured (note: write operations may require valid nonce)'
174
173
  );
175
174
  return true;
176
175
  } catch (error) {
177
176
  const message =
178
- "Cookie authentication failed. Please ensure you are properly logged into WordPress.";
177
+ 'Cookie authentication failed. Please ensure you are properly logged into WordPress.';
179
178
  logger.error(message, error);
180
179
  throw new Error(message);
181
180
  }
@@ -186,11 +185,11 @@ export class WordPressAuth {
186
185
  */
187
186
  async refreshAuth(): Promise<boolean> {
188
187
  switch (this.authType) {
189
- case "jwt":
190
- return await this.refreshJWTToken();
191
- default:
192
- logger.log(`Authentication refresh not supported for ${this.authType}`);
193
- return true;
188
+ case 'jwt':
189
+ return await this.refreshJWTToken();
190
+ default:
191
+ logger.log(`Authentication refresh not supported for ${this.authType}`);
192
+ return true;
194
193
  }
195
194
  }
196
195
 
@@ -202,7 +201,7 @@ export class WordPressAuth {
202
201
  // Re-authenticate to get a new token
203
202
  return await this.handleJWTAuth();
204
203
  } catch (error) {
205
- logger.error("Failed to refresh JWT token:", error);
204
+ logger.error('Failed to refresh JWT token:', error);
206
205
  return false;
207
206
  }
208
207
  }
@@ -215,7 +214,7 @@ export class WordPressAuth {
215
214
  await this.client.getCurrentUser();
216
215
  return true;
217
216
  } catch (error) {
218
- logger.error("Authentication validation failed:", error);
217
+ logger.error('Authentication validation failed:', error);
219
218
  return false;
220
219
  }
221
220
  }
@@ -234,13 +233,13 @@ export class WordPressAuth {
234
233
  return {
235
234
  authenticated: true,
236
235
  method: this.authType,
237
- user,
236
+ user
238
237
  };
239
238
  } catch (error) {
240
239
  return {
241
240
  authenticated: false,
242
241
  method: this.authType,
243
- error: (error as Error).message,
242
+ error: (error as Error).message
244
243
  };
245
244
  }
246
245
  }
@@ -264,22 +263,22 @@ export class WordPressAuth {
264
263
  const { clientId } = this.client.config.auth;
265
264
 
266
265
  if (!clientId) {
267
- throw new Error("OAuth requires client ID");
266
+ throw new Error('OAuth requires client ID');
268
267
  }
269
268
 
270
269
  const state = this.generateRandomState();
271
- const redirectUri = "http://localhost:8080/oauth/callback";
270
+ const redirectUri = 'http://localhost:8080/oauth/callback';
272
271
 
273
- const authUrl = new URL("/oauth/authorize", this.client.config.baseUrl);
274
- authUrl.searchParams.append("client_id", clientId);
275
- authUrl.searchParams.append("redirect_uri", redirectUri);
276
- authUrl.searchParams.append("response_type", "code");
277
- authUrl.searchParams.append("state", state);
278
- authUrl.searchParams.append("scope", "read write");
272
+ const authUrl = new URL('/oauth/authorize', this.client.config.baseUrl);
273
+ authUrl.searchParams.append('client_id', clientId);
274
+ authUrl.searchParams.append('redirect_uri', redirectUri);
275
+ authUrl.searchParams.append('response_type', 'code');
276
+ authUrl.searchParams.append('state', state);
277
+ authUrl.searchParams.append('scope', 'read write');
279
278
 
280
279
  return {
281
280
  authUrl: authUrl.toString(),
282
- state,
281
+ state
283
282
  };
284
283
  }
285
284
 
@@ -289,7 +288,7 @@ export class WordPressAuth {
289
288
  async completeOAuthFlow(code: string, state: string): Promise<boolean> {
290
289
  // This would implement the OAuth token exchange
291
290
  // For now, this is a placeholder
292
- throw new Error("OAuth flow not yet implemented");
291
+ throw new Error('OAuth flow not yet implemented');
293
292
  }
294
293
 
295
294
  /**
@@ -297,8 +296,8 @@ export class WordPressAuth {
297
296
  */
298
297
  private generateRandomState(length = 32): string {
299
298
  const chars =
300
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
301
- let result = "";
299
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
300
+ let result = '';
302
301
  for (let i = 0; i < length; i++) {
303
302
  result += chars.charAt(Math.floor(Math.random() * chars.length));
304
303
  }
@@ -313,40 +312,40 @@ export class WordPressAuth {
313
312
  const auth = this.client.config.auth;
314
313
 
315
314
  switch (this.authType) {
316
- case "app-password":
317
- if (auth.username && auth.appPassword) {
318
- const credentials = Buffer.from(
319
- `${auth.username}:${auth.appPassword}`,
320
- ).toString("base64");
321
- headers["Authorization"] = `Basic ${credentials}`;
322
- }
323
- break;
324
- case "basic":
325
- if (auth.username && auth.password) {
326
- const credentials = Buffer.from(
327
- `${auth.username}:${auth.password}`,
328
- ).toString("base64");
329
- headers["Authorization"] = `Basic ${credentials}`;
330
- }
331
- break;
332
-
333
- case "jwt":
334
- if (auth.token) {
335
- headers["Authorization"] = `Bearer ${auth.token}`;
336
- }
337
- break;
338
-
339
- case "api-key":
340
- if (auth.apiKey) {
341
- headers["X-API-Key"] = auth.apiKey;
342
- }
343
- break;
344
-
345
- case "cookie":
346
- if (auth.nonce) {
347
- headers["X-WP-Nonce"] = auth.nonce;
348
- }
349
- break;
315
+ case 'app-password':
316
+ if (auth.username && auth.appPassword) {
317
+ const credentials = Buffer.from(
318
+ `${auth.username}:${auth.appPassword}`
319
+ ).toString('base64');
320
+ headers['Authorization'] = `Basic ${credentials}`;
321
+ }
322
+ break;
323
+ case 'basic':
324
+ if (auth.username && auth.password) {
325
+ const credentials = Buffer.from(
326
+ `${auth.username}:${auth.password}`
327
+ ).toString('base64');
328
+ headers['Authorization'] = `Basic ${credentials}`;
329
+ }
330
+ break;
331
+
332
+ case 'jwt':
333
+ if (auth.token) {
334
+ headers['Authorization'] = `Bearer ${auth.token}`;
335
+ }
336
+ break;
337
+
338
+ case 'api-key':
339
+ if (auth.apiKey) {
340
+ headers['X-API-Key'] = auth.apiKey;
341
+ }
342
+ break;
343
+
344
+ case 'cookie':
345
+ if (auth.nonce) {
346
+ headers['X-WP-Nonce'] = auth.nonce;
347
+ }
348
+ break;
350
349
  }
351
350
 
352
351
  return headers;
@@ -357,23 +356,23 @@ export class WordPressAuth {
357
356
  */
358
357
  requiresSetup(): boolean {
359
358
  switch (this.authType) {
360
- case "jwt":
361
- return !this.client.config.auth.secret;
362
- case "api-key":
363
- return !this.client.config.auth.apiKey;
364
- case "app-password":
365
- return (
366
- !this.client.config.auth.username ||
359
+ case 'jwt':
360
+ return !this.client.config.auth.secret;
361
+ case 'api-key':
362
+ return !this.client.config.auth.apiKey;
363
+ case 'app-password':
364
+ return (
365
+ !this.client.config.auth.username ||
367
366
  !this.client.config.auth.appPassword
368
- );
369
- case "basic":
370
- return (
371
- !this.client.config.auth.username || !this.client.config.auth.password
372
- );
373
- case "cookie":
374
- return false; // Cookie auth can work without additional setup
375
- default:
376
- return true;
367
+ );
368
+ case 'basic':
369
+ return (
370
+ !this.client.config.auth.username || !this.client.config.auth.password
371
+ );
372
+ case 'cookie':
373
+ return false; // Cookie auth can work without additional setup
374
+ default:
375
+ return true;
377
376
  }
378
377
  }
379
378
 
@@ -382,8 +381,8 @@ export class WordPressAuth {
382
381
  */
383
382
  getSetupInstructions(): string {
384
383
  switch (this.authType) {
385
- case "app-password":
386
- return `
384
+ case 'app-password':
385
+ return `
387
386
  To set up Application Password authentication:
388
387
  1. Log into your WordPress admin dashboard
389
388
  2. Go to Users → Profile (or Users → All Users → Edit your user)
@@ -394,8 +393,8 @@ To set up Application Password authentication:
394
393
  7. Set WORDPRESS_USERNAME to your WordPress username
395
394
  `;
396
395
 
397
- case "jwt":
398
- return `
396
+ case 'jwt':
397
+ return `
399
398
  To set up JWT authentication:
400
399
  1. Install the "JWT Authentication for WP REST API" plugin
401
400
  2. Add JWT_AUTH_SECRET_KEY to your wp-config.php file
@@ -404,30 +403,30 @@ To set up JWT authentication:
404
403
  5. Set WORDPRESS_USERNAME and WORDPRESS_PASSWORD
405
404
  `;
406
405
 
407
- case "api-key":
408
- return `
406
+ case 'api-key':
407
+ return `
409
408
  To set up API Key authentication:
410
409
  1. Install an API Key plugin (varies by plugin)
411
410
  2. Generate an API key in the plugin settings
412
411
  3. Set WORDPRESS_API_KEY environment variable
413
412
  `;
414
413
 
415
- case "basic":
416
- return `
414
+ case 'basic':
415
+ return `
417
416
  To set up Basic authentication:
418
417
  1. Set WORDPRESS_USERNAME to your WordPress username
419
418
  2. Set WORDPRESS_PASSWORD to your WordPress password
420
419
  Note: This method is less secure than Application Passwords
421
420
  `;
422
421
 
423
- case "cookie":
424
- return `
422
+ case 'cookie':
423
+ return `
425
424
  Cookie authentication is automatically configured when you're logged into WordPress.
426
425
  For write operations, you may need to set WORDPRESS_COOKIE_NONCE.
427
426
  `;
428
427
 
429
- default:
430
- return "No setup instructions available for this authentication method.";
428
+ default:
429
+ return 'No setup instructions available for this authentication method.';
431
430
  }
432
431
  }
433
432
  }
@@ -437,7 +436,7 @@ For write operations, you may need to set WORDPRESS_COOKIE_NONCE.
437
436
  */
438
437
 
439
438
  export class AppPasswordAuthProvider implements IAuthProvider {
440
- readonly method: AuthMethod = "app-password";
439
+ readonly method: AuthMethod = 'app-password';
441
440
 
442
441
  async authenticate(client: IWordPressClient): Promise<boolean> {
443
442
  const auth = new WordPressAuth(client);
@@ -450,7 +449,7 @@ export class AppPasswordAuthProvider implements IAuthProvider {
450
449
  }
451
450
 
452
451
  export class JWTAuthProvider implements IAuthProvider {
453
- readonly method: AuthMethod = "jwt";
452
+ readonly method: AuthMethod = 'jwt';
454
453
 
455
454
  async authenticate(client: IWordPressClient): Promise<boolean> {
456
455
  const auth = new WordPressAuth(client);
@@ -468,7 +467,7 @@ export class JWTAuthProvider implements IAuthProvider {
468
467
  }
469
468
 
470
469
  export class BasicAuthProvider implements IAuthProvider {
471
- readonly method: AuthMethod = "basic";
470
+ readonly method: AuthMethod = 'basic';
472
471
 
473
472
  async authenticate(client: IWordPressClient): Promise<boolean> {
474
473
  const auth = new WordPressAuth(client);
@@ -481,7 +480,7 @@ export class BasicAuthProvider implements IAuthProvider {
481
480
  }
482
481
 
483
482
  export class APIKeyAuthProvider implements IAuthProvider {
484
- readonly method: AuthMethod = "api-key";
483
+ readonly method: AuthMethod = 'api-key';
485
484
 
486
485
  async authenticate(client: IWordPressClient): Promise<boolean> {
487
486
  const auth = new WordPressAuth(client);
@@ -494,7 +493,7 @@ export class APIKeyAuthProvider implements IAuthProvider {
494
493
  }
495
494
 
496
495
  export class CookieAuthProvider implements IAuthProvider {
497
- readonly method: AuthMethod = "cookie";
496
+ readonly method: AuthMethod = 'cookie';
498
497
 
499
498
  async authenticate(client: IWordPressClient): Promise<boolean> {
500
499
  const auth = new WordPressAuth(client);
@@ -511,17 +510,17 @@ export class CookieAuthProvider implements IAuthProvider {
511
510
  */
512
511
  export function createAuthProvider(method: AuthMethod): IAuthProvider {
513
512
  switch (method) {
514
- case "app-password":
515
- return new AppPasswordAuthProvider();
516
- case "jwt":
517
- return new JWTAuthProvider();
518
- case "basic":
519
- return new BasicAuthProvider();
520
- case "api-key":
521
- return new APIKeyAuthProvider();
522
- case "cookie":
523
- return new CookieAuthProvider();
524
- default:
525
- throw new Error(`Unsupported authentication method: ${method}`);
513
+ case 'app-password':
514
+ return new AppPasswordAuthProvider();
515
+ case 'jwt':
516
+ return new JWTAuthProvider();
517
+ case 'basic':
518
+ return new BasicAuthProvider();
519
+ case 'api-key':
520
+ return new APIKeyAuthProvider();
521
+ case 'cookie':
522
+ return new CookieAuthProvider();
523
+ default:
524
+ throw new Error(`Unsupported authentication method: ${method}`);
526
525
  }
527
526
  }