ebay-mcp 1.13.2 → 1.14.0

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 (169) hide show
  1. package/README.de.md +3 -3
  2. package/README.es.md +3 -3
  3. package/README.fr.md +3 -3
  4. package/README.ja.md +3 -3
  5. package/README.ko.md +3 -3
  6. package/README.md +163 -41
  7. package/README.pt-BR.md +3 -3
  8. package/README.ru.md +3 -3
  9. package/README.zh-CN.md +3 -3
  10. package/build/api/account-management/account.js +633 -297
  11. package/build/api/analytics-and-report/analytics.js +111 -65
  12. package/build/api/client.js +199 -140
  13. package/build/api/clientRequestError.js +23 -0
  14. package/build/api/clientTrading.js +213 -0
  15. package/build/api/clientTradingError.js +4 -0
  16. package/build/api/communication/feedback.js +147 -59
  17. package/build/api/communication/message.js +134 -81
  18. package/build/api/communication/negotiation.js +65 -53
  19. package/build/api/communication/notification.js +458 -164
  20. package/build/api/developer/developer.js +99 -45
  21. package/build/api/index.js +23 -8
  22. package/build/api/listing-management/inventory.js +884 -338
  23. package/build/api/listing-metadata/metadata.js +416 -170
  24. package/build/api/listing-metadata/taxonomy.js +187 -42
  25. package/build/api/marketing-and-promotions/marketing.js +1392 -598
  26. package/build/api/marketing-and-promotions/recommendation.js +49 -24
  27. package/build/api/order-management/dispute.js +226 -45
  28. package/build/api/order-management/fulfillment.js +144 -71
  29. package/build/api/order-management/orderIssueHelpers.js +61 -0
  30. package/build/api/other/compliance.js +50 -38
  31. package/build/api/other/edelivery.js +603 -159
  32. package/build/api/other/finding.js +280 -0
  33. package/build/api/other/identity.js +30 -15
  34. package/build/api/other/translation.js +29 -14
  35. package/build/api/other/vero.js +113 -27
  36. package/build/api/rateLimitTracker.js +55 -0
  37. package/build/api/shared/request.js +189 -98
  38. package/build/api/trading/trading.js +154 -87
  39. package/build/auth/credentialSession.js +250 -0
  40. package/build/auth/oauth.js +298 -171
  41. package/build/auth/{oauth-metadata.js → oauthMetadata.js} +22 -6
  42. package/build/auth/oauthMiddleware.js +104 -0
  43. package/build/auth/{scope-utils.js → scopeUtils.js} +101 -28
  44. package/build/auth/tokenVerifier.js +243 -0
  45. package/build/auth/tokenVerifierError.js +21 -0
  46. package/build/config/environment.js +148 -113
  47. package/build/config/{tool-families.js → toolFamilies.js} +30 -14
  48. package/build/index.js +25 -19
  49. package/build/mcp/{http-transport.js → httpTransport.js} +102 -52
  50. package/build/mcp/readOnlyFilter.js +67 -0
  51. package/build/mcp/runtime.js +31 -13
  52. package/build/mcp/{tool-gating.js → toolGating.js} +77 -49
  53. package/build/mcp/{ui-bridge.js → uiBridge.js} +80 -23
  54. package/build/schemas/account-management/account.js +144 -6
  55. package/build/schemas/analytics/analytics.js +33 -19
  56. package/build/schemas/communication/messages.js +12 -42
  57. package/build/schemas/developer/developer.js +135 -0
  58. package/build/schemas/fulfillment/orders.js +183 -21
  59. package/build/schemas/index.js +27 -19
  60. package/build/schemas/inventory-management/inventory.js +17 -9
  61. package/build/schemas/marketing/marketing.js +480 -25
  62. package/build/schemas/metadata/metadata.js +11 -6
  63. package/build/schemas/other/finding.js +27 -0
  64. package/build/schemas/other/otherApis.js +424 -0
  65. package/build/schemas/taxonomy/taxonomy.js +11 -5
  66. package/build/scripts/{auto-setup.js → autoSetup.js} +87 -74
  67. package/build/scripts/{build-ui.js → buildUi.js} +6 -1
  68. package/build/scripts/{dev-sync.js → devSync.js} +169 -110
  69. package/build/scripts/diagnostics.js +52 -44
  70. package/build/scripts/{download-specs.js → downloadSpecs.js} +29 -21
  71. package/build/scripts/{interactive-setup.js → interactiveSetup.js} +84 -78
  72. package/build/scripts/setup.js +241 -178
  73. package/build/scripts/{setup-shared.js → setupShared.js} +29 -7
  74. package/build/scripts/skills.js +35 -27
  75. package/build/scripts/updateApiStatusDoc.js +71 -0
  76. package/build/serverHttp.js +90 -0
  77. package/build/skills/content.js +124 -118
  78. package/build/skills/index.js +22 -10
  79. package/build/skills/install.js +21 -10
  80. package/build/skills/markers.js +50 -15
  81. package/build/skills/{registry-snapshot.js → registrySnapshot.js} +8 -2
  82. package/build/skills/render.js +41 -14
  83. package/build/skills/targets.js +49 -17
  84. package/build/tools/categories/account.js +166 -264
  85. package/build/tools/categories/analytics.js +11 -22
  86. package/build/tools/categories/browse.js +17 -0
  87. package/build/tools/categories/communication.js +124 -399
  88. package/build/tools/categories/connector.js +23 -20
  89. package/build/tools/categories/developer.js +46 -159
  90. package/build/tools/categories/fulfillment.js +84 -215
  91. package/build/tools/categories/index.js +6 -14
  92. package/build/tools/categories/inventory.js +238 -293
  93. package/build/tools/categories/marketing.js +677 -39
  94. package/build/tools/categories/metadata.js +190 -117
  95. package/build/tools/categories/other.js +81 -208
  96. package/build/tools/categories/taxonomy.js +29 -20
  97. package/build/tools/categories/{token-management.js → tokenManagement.js} +187 -192
  98. package/build/tools/categories/trading.js +16 -47
  99. package/build/tools/contracts.js +34 -24
  100. package/build/tools/{define-tool.js → defineTool.js} +44 -29
  101. package/build/tools/registry.js +87 -29
  102. package/build/tools/schemas.js +3 -57
  103. package/build/tools/ui/archetypes.js +1 -0
  104. package/build/tools/ui/{map-helpers.js → mapHelpers.js} +69 -19
  105. package/build/tools/ui/maps.js +294 -80
  106. package/build/types/index.js +1 -1
  107. package/build/ui/card.html +14 -14
  108. package/build/ui/chart.html +14 -14
  109. package/build/ui/stat.html +87 -0
  110. package/build/ui/table.html +14 -14
  111. package/build/utils/apiStatusFeed.js +95 -0
  112. package/build/utils/cliOutput.js +15 -0
  113. package/build/utils/cliUi.js +108 -0
  114. package/build/utils/communication/feedback.js +57 -77
  115. package/build/utils/communication/message.js +69 -98
  116. package/build/utils/communication/negotiation.js +30 -57
  117. package/build/utils/communication/notification.js +112 -252
  118. package/build/utils/{date-converter.js → dateConverter.js} +62 -30
  119. package/build/utils/effectSchema.js +203 -0
  120. package/build/utils/effectSchemaAdapter.js +121 -0
  121. package/build/utils/effectSchemaChainMethods.js +146 -0
  122. package/build/utils/effectSchemaRefinements.js +104 -0
  123. package/build/utils/effectSchemaStringMethods.js +63 -0
  124. package/build/utils/effectSchemaTypes.js +47 -0
  125. package/build/utils/{env-parser.js → envParser.js} +10 -2
  126. package/build/utils/errors.js +7 -3
  127. package/build/utils/http.js +148 -89
  128. package/build/utils/{llm-client-detector.js → llmClientDetector.js} +295 -274
  129. package/build/utils/logger.js +127 -51
  130. package/build/utils/{oauth-helper.js → oauthHelper.js} +127 -90
  131. package/build/utils/other/compliance.js +18 -38
  132. package/build/utils/other/identity.js +2 -2
  133. package/build/utils/other/translation.js +4 -4
  134. package/build/utils/other/vero.js +36 -20
  135. package/build/utils/schemaHelpers.js +22 -0
  136. package/build/utils/scopeHelper.js +270 -0
  137. package/build/utils/securityChecker.js +316 -0
  138. package/build/utils/{setup-validator.js → setupValidator.js} +113 -94
  139. package/build/utils/{setup-wizard.js → setupWizard.js} +57 -46
  140. package/build/utils/{token-utils.js → tokenUtils.js} +2 -2
  141. package/build/utils/trading/trading.js +35 -0
  142. package/build/utils/typeGuards.js +12 -0
  143. package/build/utils/version.js +65 -29
  144. package/package.json +10 -8
  145. package/build/api/client-trading.js +0 -124
  146. package/build/api/communication/shared.js +0 -59
  147. package/build/api/shared/query-params.js +0 -16
  148. package/build/auth/credential-session.js +0 -166
  149. package/build/auth/oauth-middleware.js +0 -100
  150. package/build/auth/token-verifier.js +0 -186
  151. package/build/schemas/other/other-apis.js +0 -390
  152. package/build/scripts/update-api-status-doc.js +0 -44
  153. package/build/server-http.js +0 -85
  154. package/build/tools/definitions/marketing.js +0 -1381
  155. package/build/tools/tool-handlers/marketing.js +0 -312
  156. package/build/utils/account-management/account.js +0 -818
  157. package/build/utils/api-status-feed.js +0 -84
  158. package/build/utils/cli-ui.js +0 -47
  159. package/build/utils/order-management/dispute.js +0 -369
  160. package/build/utils/order-management/fulfillment.js +0 -205
  161. package/build/utils/other/edelivery.js +0 -235
  162. package/build/utils/schema-helpers.js +0 -13
  163. package/build/utils/scope-helper.js +0 -207
  164. package/build/utils/security-checker.js +0 -248
  165. package/build/utils/type-guards.js +0 -6
  166. /package/build/auth/{oauth-types.js → oauthTypes.js} +0 -0
  167. /package/build/{server-http.d.ts → serverHttp.d.ts} +0 -0
  168. /package/build/tools/ui/{view-models.js → viewModels.js} +0 -0
  169. /package/build/types/{ebay-enums.js → ebayEnums.js} +0 -0
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Fetches and parses the eBay API Status RSS feed (public, no auth).
3
+ * Used by the ebay_get_api_status MCP tool and optionally by the docs sync script.
4
+ */
5
+ import { XMLParser } from 'fast-xml-parser';
6
+ import { getErrorMessage } from '../utils/errors.js';
7
+ import { httpRequestEffect, isHttpError } from './http.js';
8
+ import { Effect, Either } from 'effect';
9
+ const RSS_URL = 'https://developer.ebay.com/rss/api-status';
10
+ const stripHtml = (html) => html
11
+ .replace(/<[^>]+>/g, ' ')
12
+ .replace(/\s+/g, ' ')
13
+ .trim();
14
+ const normalizeString = (value) => {
15
+ if (value == null)
16
+ return '';
17
+ if (typeof value === 'string')
18
+ return value.trim();
19
+ if (typeof value === 'number' || typeof value === 'boolean')
20
+ return String(value).trim();
21
+ return '';
22
+ };
23
+ const parseItem = (raw) => {
24
+ const summary = normalizeString(raw.summary) || stripHtml(normalizeString(raw.description)).slice(0, 300) || '';
25
+ return {
26
+ title: normalizeString(raw.title) || 'Untitled',
27
+ summary: summary || normalizeString(raw.title),
28
+ link: normalizeString(raw.link) || '',
29
+ api: normalizeString(raw.api) || '',
30
+ site: normalizeString(raw.site) || '',
31
+ status: normalizeString(raw.status) || '',
32
+ lastUpdated: normalizeString(raw.lastUpdated) || '',
33
+ };
34
+ };
35
+ /**
36
+ * Fetches the eBay API Status RSS feed, parses it, and returns items
37
+ * optionally filtered by status and API name, limited to `limit` items.
38
+ *
39
+ * @param options - Optional status/API filters and item limit.
40
+ * @returns An Effect that succeeds with parsed feed items or a recoverable error string.
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const feed = await Effect.runPromise(getApiStatusFeed({ status: 'Unresolved', limit: 10 }));
45
+ * ```
46
+ */
47
+ export const getApiStatusFeed = (options = {}) => {
48
+ const { limit = 20, status: statusFilter, api: apiFilter } = options;
49
+ return Effect.either(httpRequestEffect({
50
+ url: RSS_URL,
51
+ timeoutMs: 15_000,
52
+ responseType: 'text',
53
+ headers: { Accept: 'application/rss+xml, application/xml, text/xml' },
54
+ }).pipe(Effect.flatMap((response) => Effect.try({
55
+ try: () => {
56
+ const parser = new XMLParser({
57
+ ignoreAttributes: true,
58
+ trimValues: true,
59
+ parseTagValue: false,
60
+ });
61
+ const parsed = parser.parse(response.data);
62
+ const channel = parsed?.rss?.channel;
63
+ if (!channel) {
64
+ return { items: [], error: 'RSS feed missing channel' };
65
+ }
66
+ let rawItems = [];
67
+ if (Array.isArray(channel.item)) {
68
+ rawItems = channel.item;
69
+ }
70
+ else if (channel.item) {
71
+ rawItems = [channel.item];
72
+ }
73
+ let items = rawItems.map(parseItem);
74
+ if (statusFilter) {
75
+ items = items.filter((item) => item.status.toLowerCase() === statusFilter.toLowerCase());
76
+ }
77
+ if (apiFilter?.trim()) {
78
+ const needle = apiFilter.trim().toLowerCase();
79
+ items = items.filter((item) => item.api.toLowerCase().includes(needle));
80
+ }
81
+ items = items.slice(0, Math.min(limit, 50));
82
+ return { items };
83
+ },
84
+ catch: (error) => error,
85
+ })))).pipe(Effect.map((parsedFeed) => {
86
+ if (Either.isLeft(parsedFeed)) {
87
+ const err = parsedFeed.left;
88
+ const message = isHttpError(err) && err.status
89
+ ? `Feed unavailable (HTTP ${err.status})`
90
+ : getErrorMessage(err, 'Failed to fetch API status feed');
91
+ return { items: [], error: message };
92
+ }
93
+ return parsedFeed.right;
94
+ }));
95
+ };
@@ -0,0 +1,15 @@
1
+ import process from 'node:process';
2
+ /**
3
+ * Writes one line to stdout for interactive CLI-only flows.
4
+ *
5
+ * @param message - Text to write before the trailing newline.
6
+ * @returns Nothing; writes to stdout.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * writeCliLine('Setup complete');
11
+ * ```
12
+ */
13
+ export const writeCliLine = (message = '') => {
14
+ process.stdout.write(`${message}\n`);
15
+ };
@@ -0,0 +1,108 @@
1
+ import chalk from 'chalk';
2
+ import { writeCliLine } from './cliOutput.js';
3
+ /**
4
+ * Shared terminal styling for the project's interactive CLIs.
5
+ *
6
+ * These helpers print to stdout, which is correct for the setup/skills wizards
7
+ * (the stdout-is-reserved rule applies to the MCP *server* runtime, not CLI
8
+ * tooling). The eBay brand palette matches the setup wizard.
9
+ */
10
+ export const ebayPalette = {
11
+ red: chalk.hex('#E53238'),
12
+ blue: chalk.hex('#0064D2'),
13
+ yellow: chalk.hex('#F5AF02'),
14
+ green: chalk.hex('#86B817'),
15
+ };
16
+ /** Semantic text styles used across CLI output. */
17
+ export const ui = {
18
+ dim: chalk.dim,
19
+ bold: chalk.bold,
20
+ success: chalk.green,
21
+ warning: chalk.yellow,
22
+ error: chalk.red,
23
+ info: chalk.cyan,
24
+ };
25
+ /**
26
+ * Prints a green success line.
27
+ *
28
+ * @param message - Message to print after the status icon.
29
+ * @returns Nothing; writes to stdout for interactive CLI flows.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * printSuccess('Configuration saved');
34
+ * ```
35
+ */
36
+ export const printSuccess = (message) => {
37
+ writeCliLine(` ${ui.success('✓')} ${message}`);
38
+ };
39
+ /**
40
+ * Prints a yellow warning line.
41
+ *
42
+ * @param message - Message to print after the status icon.
43
+ * @returns Nothing; writes to stdout for interactive CLI flows.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * printWarning('No clients detected');
48
+ * ```
49
+ */
50
+ export const printWarning = (message) => {
51
+ writeCliLine(` ${ui.warning('⚠')} ${message}`);
52
+ };
53
+ /**
54
+ * Prints a red error line.
55
+ *
56
+ * @param message - Message to print after the status icon.
57
+ * @returns Nothing; writes to stdout for interactive CLI flows.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * printError('Setup failed');
62
+ * ```
63
+ */
64
+ export const printError = (message) => {
65
+ writeCliLine(` ${ui.error('✗')} ${message}`);
66
+ };
67
+ /**
68
+ * Prints a cyan info line.
69
+ *
70
+ * @param message - Message to print after the status icon.
71
+ * @returns Nothing; writes to stdout for interactive CLI flows.
72
+ *
73
+ * @example
74
+ * ```ts
75
+ * printInfo('Dry run - no files written');
76
+ * ```
77
+ */
78
+ export const printInfo = (message) => {
79
+ writeCliLine(` ${ui.info('ℹ')} ${message}`);
80
+ };
81
+ /**
82
+ * Prints a bold section heading preceded by a blank line.
83
+ *
84
+ * @param title - Heading text.
85
+ * @returns Nothing; writes to stdout for interactive CLI flows.
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * printHeading('Planned changes');
90
+ * ```
91
+ */
92
+ export const printHeading = (title) => {
93
+ writeCliLine(`\n ${ui.bold(title)}`);
94
+ };
95
+ /**
96
+ * Prints a dim horizontal rule.
97
+ *
98
+ * @param width - Number of rule characters to print.
99
+ * @returns Nothing; writes to stdout for interactive CLI flows.
100
+ *
101
+ * @example
102
+ * ```ts
103
+ * printRule(72);
104
+ * ```
105
+ */
106
+ export const printRule = (width = 56) => {
107
+ writeCliLine(' ' + ui.dim('─'.repeat(width)));
108
+ };
@@ -1,11 +1,9 @@
1
- import { z } from 'zod';
1
+ import { z } from '../../utils/effectSchema.js';
2
2
  /**
3
- * Zod schemas for Feedback API input validation
4
- * Based on: src/api/communication/feedback.ts
3
+ * Effect-backed schemas for Feedback API input validation.
5
4
  * OpenAPI spec: docs/sell-apps/communication/commerce_feedback_v1_beta_oas3.json
6
- * Types from: src/types/commerce_feedback_v1_beta_oas3.ts
7
5
  */
8
- // Reusable schema for filter parameter
6
+ /** Optional feedback filter expression. */
9
7
  const filterSchema = z
10
8
  .string({
11
9
  message: 'Filter must be a string',
@@ -13,95 +11,85 @@ const filterSchema = z
13
11
  description: 'Filter criteria for the query',
14
12
  })
15
13
  .optional();
16
- // Reusable schema for limit parameter (string in API, converted to number)
14
+ /** Optional positive page size accepted by Feedback list endpoints. */
17
15
  const limitSchema = z
18
- .string({
19
- invalid_type_error: 'limit must be a string',
16
+ .number({
17
+ invalid_type_error: 'limit must be a number',
20
18
  description: 'Maximum number of items to return per page (25-200)',
21
19
  })
20
+ .positive('limit must be a positive number')
22
21
  .optional();
23
- // Reusable schema for offset parameter (string in API, converted to number)
22
+ /** Optional zero-based page offset accepted by Feedback list endpoints. */
24
23
  const offsetSchema = z
25
- .string({
26
- invalid_type_error: 'offset must be a string',
24
+ .number({
25
+ invalid_type_error: 'offset must be a number',
27
26
  description: 'Number of items to skip',
28
27
  })
28
+ .min(0, 'offset must be a non-negative number')
29
29
  .optional();
30
- // Reusable schema for sort parameter
30
+ /** Optional feedback result sort order. */
31
31
  const sortSchema = z
32
32
  .string({
33
33
  invalid_type_error: 'sort must be a string',
34
34
  description: 'Sort order for results',
35
35
  })
36
36
  .optional();
37
- /**
38
- * Schema for getAwaitingFeedback method
39
- * Endpoint: GET /awaiting_feedback
40
- * Params: GetAwaitingFeedbackParams - filter, limit, offset, sort
41
- */
37
+ /** Schema for getAwaitingFeedback input. */
42
38
  export const getAwaitingFeedbackSchema = z.object({
43
39
  filter: filterSchema,
44
40
  limit: limitSchema,
45
41
  offset: offsetSchema,
46
42
  sort: sortSchema,
47
43
  });
48
- /**
49
- * Schema for getFeedback method
50
- * Endpoint: GET /feedback
51
- * Params: GetFeedbackParams - user_id (required), feedback_type (required), feedback_id, filter, limit, listing_id, offset, order_line_item_id, sort, transaction_id
52
- */
44
+ /** Schema for getFeedback input. */
53
45
  export const getFeedbackSchema = z.object({
54
- user_id: z.string({
46
+ userId: z.string({
55
47
  message: 'User ID is required',
56
- required_error: 'user_id is required',
57
- invalid_type_error: 'user_id must be a string',
48
+ required_error: 'userId is required',
49
+ invalid_type_error: 'userId must be a string',
58
50
  description: 'The unique identifier (eBay username) of the user',
59
51
  }),
60
- feedback_type: z.string({
52
+ feedbackType: z.string({
61
53
  message: 'Feedback type is required',
62
- required_error: 'feedback_type is required',
63
- invalid_type_error: 'feedback_type must be a string',
54
+ required_error: 'feedbackType is required',
55
+ invalid_type_error: 'feedbackType must be a string',
64
56
  description: 'Type of feedback (FEEDBACK_RECEIVED or FEEDBACK_SENT)',
65
57
  }),
66
- feedback_id: z
58
+ feedbackId: z
67
59
  .string({
68
- invalid_type_error: 'feedback_id must be a string',
60
+ invalid_type_error: 'feedbackId must be a string',
69
61
  description: 'Filter by specific feedback ID',
70
62
  })
71
63
  .optional(),
72
64
  filter: filterSchema,
73
65
  limit: limitSchema,
74
- listing_id: z
66
+ listingId: z
75
67
  .string({
76
- invalid_type_error: 'listing_id must be a string',
68
+ invalid_type_error: 'listingId must be a string',
77
69
  description: 'Filter by listing ID',
78
70
  })
79
71
  .optional(),
80
72
  offset: offsetSchema,
81
- order_line_item_id: z
73
+ orderLineItemId: z
82
74
  .string({
83
- invalid_type_error: 'order_line_item_id must be a string',
75
+ invalid_type_error: 'orderLineItemId must be a string',
84
76
  description: 'Filter by order line item ID',
85
77
  })
86
78
  .optional(),
87
79
  sort: sortSchema,
88
- transaction_id: z
80
+ transactionId: z
89
81
  .string({
90
- invalid_type_error: 'transaction_id must be a string',
91
- description: 'Filter by transaction ID',
82
+ invalid_type_error: 'transactionId must be a string',
83
+ description: 'The unique identifier of the transaction',
92
84
  })
93
85
  .optional(),
94
86
  });
95
- /**
96
- * Schema for getFeedbackRatingSummary method
97
- * Endpoint: GET /feedback_rating_summary
98
- * Params: GetFeedbackRatingSummaryParams - user_id (required), filter (required)
99
- */
87
+ /** Schema for getFeedbackRatingSummary input. */
100
88
  export const getFeedbackRatingSummarySchema = z.object({
101
- user_id: z.string({
89
+ userId: z.string({
102
90
  message: 'User ID is required',
103
- required_error: 'user_id is required',
104
- invalid_type_error: 'user_id must be a string',
91
+ required_error: 'userId is required',
92
+ invalid_type_error: 'userId must be a string',
105
93
  description: 'The unique identifier of the eBay user',
106
94
  }),
107
95
  filter: z.string({
@@ -111,22 +99,18 @@ export const getFeedbackRatingSummarySchema = z.object({
111
99
  description: 'Filter with required ratingType parameter',
112
100
  }),
113
101
  });
114
- /**
115
- * Schema for leaveFeedbackForBuyer method
116
- * Endpoint: POST /feedback
117
- * Body: LeaveFeedbackRequest - commentText, commentType, images, listingId, orderLineItemId, sellerRatings, transactionId
118
- */
102
+ /** Schema for leaveFeedback input. */
119
103
  export const leaveFeedbackForBuyerSchema = z.object({
120
- comment_text: z
104
+ commentText: z
121
105
  .string({
122
- invalid_type_error: 'comment_text must be a string',
106
+ invalid_type_error: 'commentText must be a string',
123
107
  description: 'The feedback comment text (max 500 characters)',
124
108
  })
125
- .max(500, 'comment_text must be 500 characters or less')
109
+ .max(500, 'commentText must be 500 characters or less')
126
110
  .optional(),
127
- comment_type: z
111
+ commentType: z
128
112
  .string({
129
- invalid_type_error: 'comment_type must be a string',
113
+ invalid_type_error: 'commentType must be a string',
130
114
  description: 'Overall rating: POSITIVE, NEUTRAL, or NEGATIVE',
131
115
  })
132
116
  .optional(),
@@ -144,19 +128,19 @@ export const leaveFeedbackForBuyerSchema = z.object({
144
128
  })
145
129
  .max(5, 'Maximum 5 images allowed')
146
130
  .optional(),
147
- listing_id: z
131
+ listingId: z
148
132
  .string({
149
- invalid_type_error: 'listing_id must be a string',
133
+ invalid_type_error: 'listingId must be a string',
150
134
  description: 'The listing ID related to the transaction',
151
135
  })
152
136
  .optional(),
153
- order_line_item_id: z
137
+ orderLineItemId: z
154
138
  .string({
155
- invalid_type_error: 'order_line_item_id must be a string',
139
+ invalid_type_error: 'orderLineItemId must be a string',
156
140
  description: 'The unique identifier of the line item',
157
141
  })
158
142
  .optional(),
159
- seller_ratings: z
143
+ sellerRatings: z
160
144
  .array(z.object({
161
145
  key: z
162
146
  .string({
@@ -171,45 +155,41 @@ export const leaveFeedbackForBuyerSchema = z.object({
171
155
  })
172
156
  .optional(),
173
157
  }), {
174
- invalid_type_error: 'seller_ratings must be an array',
158
+ invalid_type_error: 'sellerRatings must be an array',
175
159
  description: 'Array of seller performance ratings',
176
160
  })
177
161
  .optional(),
178
- transaction_id: z
162
+ transactionId: z
179
163
  .string({
180
- invalid_type_error: 'transaction_id must be a string',
164
+ invalid_type_error: 'transactionId must be a string',
181
165
  description: 'The unique identifier of the transaction',
182
166
  })
183
167
  .optional(),
184
168
  });
185
- /**
186
- * Schema for respondToFeedback method
187
- * Endpoint: POST /respond_to_feedback
188
- * Body: RespondToFeedbackRequest - feedbackId, recipientUserId, responseText, responseType
189
- */
169
+ /** Schema for respondToFeedback input. */
190
170
  export const respondToFeedbackSchema = z.object({
191
- feedback_id: z
171
+ feedbackId: z
192
172
  .string({
193
- invalid_type_error: 'feedback_id must be a string',
173
+ invalid_type_error: 'feedbackId must be a string',
194
174
  description: 'The unique identifier of the feedback being responded to',
195
175
  })
196
176
  .optional(),
197
- recipient_user_id: z
177
+ recipientUserId: z
198
178
  .string({
199
- invalid_type_error: 'recipient_user_id must be a string',
179
+ invalid_type_error: 'recipientUserId must be a string',
200
180
  description: 'The user ID of the feedback provider',
201
181
  })
202
182
  .optional(),
203
- response_text: z
183
+ responseText: z
204
184
  .string({
205
- invalid_type_error: 'response_text must be a string',
185
+ invalid_type_error: 'responseText must be a string',
206
186
  description: 'The text content of the response (max 500 characters)',
207
187
  })
208
- .max(500, 'response_text must be 500 characters or less')
188
+ .max(500, 'responseText must be 500 characters or less')
209
189
  .optional(),
210
- response_type: z
190
+ responseType: z
211
191
  .string({
212
- invalid_type_error: 'response_type must be a string',
192
+ invalid_type_error: 'responseType must be a string',
213
193
  description: 'The type of response: REPLY or FOLLOW_UP',
214
194
  })
215
195
  .optional(),